(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,335884,e=>{"use strict";e.i(391398);var t=e.i(191788),i=e.i(940709);let n=t.default.createContext({publishedVersionOverride:!1});e.s(["useShouldUsePublishedVersion",0,function(){let{publishedVersionOverride:e}=(0,t.useContext)(n);return e||(0,i.shouldUsePublishedVersion)()}])},292750,189225,e=>{"use strict";var t=e.i(391398),i=e.i(66657),n=e.i(111672),a=e.i(455902),r=e.i(233924),o=e.i(470645),s=e.i(191788),l=e.i(897325),d=e.i(95201),c=e.i(216912),u=e.i(358003);let[p,h]=(0,r.createContext)({name:"RadioGroupContext",strict:!1}),m=(0,c.forwardRef)((e,i)=>{let{colorScheme:n,size:a,variant:r,children:c,className:h,isDisabled:m,isFocusable:g,...f}=e,{value:b,onChange:x,getRootProps:y,name:v,htmlProps:C}=function(e={}){let{onChange:t,value:i,defaultValue:n,name:a,isDisabled:r,isFocusable:o,isNative:c,...u}=e,[p,h]=(0,s.useState)(n||""),m=void 0!==i,g=m?i:p,f=(0,s.useRef)(null),b=(0,s.useCallback)(()=>{let e=f.current;if(!e)return;let t="input:not(:disabled):checked",i=e.querySelector(t);if(i)return void i.focus();t="input:not(:disabled)";let n=e.querySelector(t);n?.focus()},[]),x=(0,s.useId)(),y=`radio-${x}`,v=a||y,C=(0,s.useCallback)(e=>{let i=e&&(0,d.isObject)(e)&&(0,d.isObject)(e.target)?e.target.value:e;m||h(i),t?.(String(i))},[t,m]);return{getRootProps:(0,s.useCallback)((e={},t=null)=>({...e,ref:(0,l.mergeRefs)(t,f),role:"radiogroup"}),[]),getRadioProps:(0,s.useCallback)((e={},t=null)=>{let i=c?"checked":"isChecked";return{...e,ref:t,name:v,[i]:null!=g?e.value===g:void 0,onChange(e){C(e)},"data-radiogroup":!0}},[c,v,C,g]),name:v,ref:f,focus:b,setValue:h,value:g,onChange:C,isDisabled:r,isFocusable:o,htmlProps:u}}(f),w=(0,s.useMemo)(()=>({name:v,size:a,onChange:x,colorScheme:n,value:b,variant:r,isDisabled:m,isFocusable:g}),[v,a,x,n,b,r,m,g]);return(0,t.jsx)(p,{value:w,children:(0,t.jsx)(u.chakra.div,{...y(C,i),className:(0,o.cx)("chakra-radio-group",h),children:c})})});m.displayName="RadioGroup",e.s(["RadioGroup",0,m,"useRadioGroupContext",0,h],189225);var g=e.i(988082),f=e.i(855218),b=e.i(996651),x=e.i(766366);function y(e){e.preventDefault(),e.stopPropagation()}var v=e.i(244180);let C=(0,c.forwardRef)((e,r)=>{let o=h(),{onChange:l,value:d}=e,c=(0,v.useMultiStyleConfig)("Radio",{...o,...e}),{spacing:p="0.5rem",children:m,isDisabled:C=o?.isDisabled,isFocusable:w=o?.isFocusable,inputProps:S,...k}=(0,i.omitThemingProps)(e),A=e.isChecked;o?.value!=null&&null!=d&&(A=o.value===d);let E=l;o?.onChange&&null!=d&&(E=(0,a.callAll)(o.onChange,l));let _=e?.name??o?.name,{getInputProps:I,getRadioProps:M,getLabelProps:T,getRootProps:L,htmlProps:j}=function(e={}){let{defaultChecked:t,isChecked:i,isFocusable:n,isDisabled:r,isReadOnly:o,isRequired:l,onChange:d,isInvalid:c,name:u,value:p,id:m,"data-radiogroup":v,"aria-describedby":C,...w}=e,S=`radio-${(0,s.useId)()}`,k=(0,b.useFormControlContext)(),A=h(),E=k&&!(A||v)?k.id:S;E=m??E;let _=r??k?.isDisabled,I=o??k?.isReadOnly,M=l??k?.isRequired,T=c??k?.isInvalid,[L,j]=(0,s.useState)(!1),[P,D]=(0,s.useState)(!1),[N,R]=(0,s.useState)(!1),[O,B]=(0,s.useState)(!!t),z=void 0!==i,F=z?i:O,H=(0,s.useRef)(!1);(0,s.useEffect)(()=>(0,f.trackFocusVisible)(e=>{H.current=e}),[]);let W=(0,s.useCallback)(e=>{I||_?e.preventDefault():(z||B(e.currentTarget.checked),d?.(e))},[z,_,I,d]),U=(0,s.useCallback)(e=>{" "===e.key&&R(!0)},[R]),V=(0,s.useCallback)(e=>{" "===e.key&&R(!1)},[R]),G=(0,s.useCallback)((e={},t=null)=>({...e,ref:t,"data-active":(0,g.dataAttr)(N),"data-hover":(0,g.dataAttr)(P),"data-disabled":(0,g.dataAttr)(_),"data-invalid":(0,g.dataAttr)(T),"data-checked":(0,g.dataAttr)(F),"data-focus":(0,g.dataAttr)(L),"data-focus-visible":(0,g.dataAttr)(L&&H.current),"data-readonly":(0,g.dataAttr)(I),"aria-hidden":!0,onMouseDown:(0,a.callAllHandlers)(e.onMouseDown,()=>R(!0)),onMouseUp:(0,a.callAllHandlers)(e.onMouseUp,()=>R(!1)),onMouseEnter:(0,a.callAllHandlers)(e.onMouseEnter,()=>D(!0)),onMouseLeave:(0,a.callAllHandlers)(e.onMouseLeave,()=>D(!1))}),[N,P,_,T,F,L,I]),{onFocus:$,onBlur:Z}=k??{},K=(0,s.useCallback)((e={},t=null)=>{let i=_&&!n;return{...e,id:E,ref:t,type:"radio",name:u,value:p,onChange:(0,a.callAllHandlers)(e.onChange,W),onBlur:(0,a.callAllHandlers)(Z,e.onBlur,()=>j(!1)),onFocus:(0,a.callAllHandlers)($,e.onFocus,()=>j(!0)),onKeyDown:(0,a.callAllHandlers)(e.onKeyDown,U),onKeyUp:(0,a.callAllHandlers)(e.onKeyUp,V),checked:F,disabled:i,readOnly:I,required:M,"aria-invalid":(0,g.ariaAttr)(T),"aria-disabled":(0,g.ariaAttr)(i),"aria-required":(0,g.ariaAttr)(M),"data-readonly":(0,g.dataAttr)(I),"aria-describedby":C,style:x.visuallyHiddenStyle}},[_,n,E,u,p,W,Z,$,U,V,F,I,M,T,C]);return{state:{isInvalid:T,isFocused:L,isChecked:F,isActive:N,isHovered:P,isDisabled:_,isReadOnly:I,isRequired:M},getRadioProps:G,getInputProps:K,getLabelProps:(e={},t=null)=>({...e,ref:t,onMouseDown:(0,a.callAllHandlers)(e.onMouseDown,y),"data-disabled":(0,g.dataAttr)(_),"data-checked":(0,g.dataAttr)(F),"data-invalid":(0,g.dataAttr)(T)}),getRootProps:(e,t=null)=>({htmlFor:E,...e,ref:t,"data-disabled":(0,g.dataAttr)(_),"data-checked":(0,g.dataAttr)(F),"data-invalid":(0,g.dataAttr)(T)}),htmlProps:w}}({...k,isChecked:A,isFocusable:w,isDisabled:C,onChange:E,name:_}),[P,D]=function(e,t){let i={},n={};for(let[a,r]of Object.entries(e))t.includes(a)?i[a]=r:n[a]=r;return[i,n]}(j,n.layoutPropNames),N=M(D),R=I(S,r),O=T(),B=Object.assign({},P,L()),z={display:"inline-flex",alignItems:"center",verticalAlign:"top",cursor:"pointer",position:"relative",...c.container},F={display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,...c.control},H={userSelect:"none",marginStart:p,...c.label};return(0,t.jsxs)(u.chakra.label,{className:"chakra-radio",...B,__css:z,children:[(0,t.jsx)("input",{className:"chakra-radio__input",...R}),(0,t.jsx)(u.chakra.span,{className:"chakra-radio__control",...N,__css:F}),m&&(0,t.jsx)(u.chakra.span,{className:"chakra-radio__label",...O,__css:H,children:m})]})});C.displayName="Radio",e.s(["Radio",0,C],292750)},593058,754772,e=>{"use strict";var t=e.i(391398),i=e.i(191788),n=e.i(428683),a=e.i(969641),r=e.i(555145),o=e.i(676828),s=e.i(775493),l=e.i(704077),d=e.i(112010),c=e.i(588183),u=e.i(75495),p=e.i(751827),h=e.i(918228),m=e.i(887527);e.i(828525);var g=e.i(661e3),f=e.i(358280),b=e.i(82050),x=e.i(103104),y=e.i(418755);e.i(734710);var v=e.i(468738),C=e.i(78387),w=e.i(335884),S=e.i(335799),k=e.i(970346),A=e.i(344233),E=e.i(575329),_=e.i(292750),I=e.i(189225),M=e.i(963912),T=e.i(406112),L=e.i(620020),j=e.i(575084),P=e.i(541075),D=e.i(896620),N=e.i(876533),R=e.i(408122),O=e.i(863750),B=e.i(792565),z=e.i(907839);let F={[O.AbuseReason.DeceptiveOrMisleading]:{title:(0,t.jsx)(f.Trans,{message:"Phishing or spam",id:"Y5QK1F"})},[O.AbuseReason.Explicit]:{title:(0,t.jsx)(f.Trans,{message:"Inappropriate content",id:"Zeb01n"})},[O.AbuseReason.Other]:{title:(0,t.jsx)(f.Trans,{message:"Other",id:"/IX/7x"})},[O.AbuseReason.Spam]:{title:(0,t.jsx)(f.Trans,{message:"Phishing or spam",id:"Y5QK1F"})},[O.AbuseReason.Inappropriate]:{title:(0,t.jsx)(f.Trans,{message:"Inappropriate content",id:"Zeb01n"})}},H=[O.AbuseReason.DeceptiveOrMisleading,O.AbuseReason.Explicit,O.AbuseReason.Other],W=({docId:e,buttonType:n,onSubmitReport:r,buttonProps:o})=>{let[s]=(0,B.useLocalStorage)(z.USER_SETTINGS_CONSTANTS.abuseReports,[]),[l,d]=(0,i.useState)(s.includes(e||"")),{isOpen:c,onOpen:u,onClose:p}=(0,T.useDisclosure)({id:"report-page-modal"}),h=(0,i.useCallback)(()=>{d(!0),p(),r?.()},[p,r]);return l||!e?null:(0,t.jsxs)(t.Fragment,{children:[c&&(0,t.jsx)(U,{docId:e,isOpen:!0,onClose:p,onSubmit:h}),"iconRight"===n?(0,t.jsx)(D.GammaTooltip,{label:(0,t.jsx)(f.Trans,{message:"Report this page",id:"ch68HI"}),children:(0,t.jsx)(A.IconButton,{"aria-label":R.i18n._({id:"ch68HI",message:"Report this page"}),borderInlineStartWidth:"0px",variant:"plain",size:"sm",borderInlineStartRadius:0,icon:(0,t.jsx)(P.FontAwesomeIcon,{icon:j.faFlagSwallowtail,size:"sm"}),onClick:u,...o})}):"button"===n?(0,t.jsx)(a.Button,{marginX:"auto",colorScheme:"gray",color:"gray.500",size:"sm",variant:"ghost",leftIcon:(0,t.jsx)(P.FontAwesomeIcon,{icon:j.faFlagSwallowtail}),onClick:u,children:(0,t.jsx)(f.Trans,{message:"Report this page",id:"ch68HI"})}):null]})},U=({docId:e,isOpen:n,onClose:r,onSubmit:o})=>{let[g,b]=(0,B.useLocalStorage)(z.USER_SETTINGS_CONSTANTS.abuseReports,[]),[x,y]=(0,i.useState)(),[v]=(0,O.useReportAbuseMutation)(),[C,w]=(0,i.useState)(),A=(0,L.useToast)(),T=(0,i.useCallback)(()=>{x&&v({variables:{input:{docId:e,reason:x,description:C}}}).then(()=>{b([...g,e]),A({title:(0,t.jsx)(f.Trans,{message:"Report submitted",id:"7sBcV9"}),description:(0,t.jsx)(f.Trans,{message:"Thank you for your feedback. Our team will review this page.",id:"m02YqD"}),status:"success",duration:5e3,isClosable:!0,position:"top"}),o()})},[x,v,e,C,b,g,A,o]);return(0,t.jsx)(N.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(s.Modal,{isOpen:n,onClose:r,trapFocus:!1,children:[(0,t.jsx)(p.ModalOverlay,{}),(0,t.jsxs)(c.ModalContent,{children:[(0,t.jsx)(E.ModalHeader,{children:(0,t.jsx)(f.Trans,{message:"Report this page",id:"ch68HI"})}),(0,t.jsx)(d.ModalCloseButton,{}),(0,t.jsx)(l.ModalBody,{children:(0,t.jsxs)(h.Stack,{spacing:0,children:[(0,t.jsx)(m.Text,{mb:6,children:(0,t.jsx)(f.Trans,{message:"What type of issue are you reporting?",id:"oNyQYO"})}),(0,t.jsx)(I.RadioGroup,{onChange:e=>{y(e)},value:x,children:(0,t.jsx)(h.Stack,{children:H.map(e=>{let i=F[e];return(0,t.jsx)(_.Radio,{value:e,children:i?.title},e)})})}),(0,t.jsx)(k.Collapse,{in:x===O.AbuseReason.Other,children:(0,t.jsx)(M.Textarea,{onChange:e=>{w(e.target.value)},maxLength:200,placeholder:R.i18n._({id:"1ULmtx",message:"Tell us why you're reporting this page."}),mt:4})})]})}),(0,t.jsx)(u.ModalFooter,{children:(0,t.jsxs)(S.ButtonGroup,{children:[(0,t.jsx)(a.Button,{colorScheme:"gray",onClick:r,variant:"ghost",children:(0,t.jsx)(f.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(D.GammaTooltip,{label:(0,t.jsx)(f.Trans,{message:"Please select a reason",id:"h7+4yF"}),placement:"top",isDisabled:!!x,shouldWrapChildren:!0,children:(0,t.jsx)(a.Button,{onClick:T,variant:"hazardous",isDisabled:!x,children:(0,t.jsx)(f.Trans,{message:"Submit report",id:"ovTgfk"})})})]})})]})]})})};e.s(["ReportPageButton",0,W],754772);let V=({link:e,confirmFunction:S,onClose:k})=>{let A=(0,y.useAppSelector)(b.selectDocId),E=(0,v.useAnalytics)(),_=(0,i.useRef)(!1),I=(0,w.useShouldUsePublishedVersion)()?"gamma.site":"gamma.app";return(0,i.useEffect)(()=>{_.current||(_.current=!0,E?.track(C.SegmentEvents.ABUSE_LINK_INTERCEPT_SHOWN,{docId:A,link:e}))},[E,A,e]),(0,t.jsxs)(s.Modal,{isOpen:!0,trapFocus:!1,onClose:()=>k("cancel"),children:[(0,t.jsx)(p.ModalOverlay,{}),(0,t.jsxs)(c.ModalContent,{children:[(0,t.jsx)(d.ModalCloseButton,{}),(0,t.jsx)(l.ModalBody,{alignItems:"center",textAlign:"center",children:(0,t.jsxs)(h.Stack,{mt:8,spacing:4,children:[(0,t.jsx)(n.Box,{mx:"auto",children:(0,t.jsx)(g.GammaLogoIconOnly,{w:"16"})}),(0,t.jsx)(o.Heading,{size:"lg",children:(0,t.jsx)(f.Trans,{message:"You're leaving {GAMMA_PROPER_NOUN}",id:"7kvRf4",values:{GAMMA_PROPER_NOUN:x.GAMMA_PROPER_NOUN}})}),(0,t.jsx)(m.Text,{children:(0,t.jsx)(f.Trans,{message:"You are about to open a link that takes you outside of <0>{gammaProperty}. Be careful, as we cannot guarantee the safety or accuracy of external sites.",id:"wkyxjZ",values:{gammaProperty:I},components:{0:(0,t.jsx)("code",{})}})}),(0,t.jsx)(m.Text,{fontSize:"sm",py:1,borderRadius:"sm",color:"gray.600",fontFamily:"mono",bg:"blackAlpha.100",children:e}),(0,t.jsx)(h.Stack,{spacing:2,mt:2,children:(0,t.jsx)(a.Button,{variant:"plain",onClick:()=>{S(e),E?.track(C.SegmentEvents.ABUSE_LINK_INTERCEPT_CONTINUE,{docId:A,link:e}),k("continue")},children:(0,t.jsx)(f.Trans,{message:"Continue",id:"xGVfLh"})})}),(0,t.jsx)(a.Button,{onClick:()=>{E?.track(C.SegmentEvents.ABUSE_LINK_INTERCEPT_CANCEL,{docId:A,link:e}),k("cancel")},variant:"solid",children:(0,t.jsx)(f.Trans,{message:"Stay here",id:"zx59ra"})}),(0,t.jsx)(r.HStack,{pt:2,flex:1,children:(0,t.jsx)(W,{docId:A,buttonType:"button",onSubmitReport:()=>k("report")})})]})}),(0,t.jsx)(u.ModalFooter,{})]})]})},G=(0,i.createContext)({}),$=e=>{window.open(e,"_blank","noopener")};e.s(["LinkInterstitialProvider",0,({children:e})=>{let[n,a]=(0,i.useState)(!1),[r,o]=(0,i.useState)(""),[s,l]=(0,i.useState)(()=>$),d=(0,i.useCallback)((e,t)=>{o(e),t&&l(()=>()=>t(e)),a(!0)},[]),c=(0,i.useCallback)(()=>{o(""),l(()=>$),a(!1)},[]),[u,p]=(0,i.useState)({showLinkInterstitial:d,hideLinkInterstitial:c});return(0,t.jsxs)(G.Provider,{value:u,children:[n&&(0,t.jsx)(V,{link:r,confirmFunction:s,onClose:c}),e]})},"useLinkInterstitialContext",0,()=>(0,i.useContext)(G)],593058)},220019,949833,e=>{"use strict";function t(e,t){for(var i=e.length,n=0;n-1?e[n]:i}var W=(l=z(),(d=S&&(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame))?d.bind(window):function(e){var t=z();return setTimeout(function(){e(t-l)},1e3/60)}),U=(c=S&&(window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.msCancelAnimationFrame))?c.bind(window):function(e){clearTimeout(e)};function V(e){return Object.keys(e)}function G(e,t){var i=B(e),n=i.value,a=i.unit;if(I(t)){var r=t[a];if(r){if(j(r))return r(n);else if(E[a])return E[a](n,r)}}else if("%"===a)return n*t/100;return E[a]?E[a](n):n}function $(e,t,i,n){return void 0===n&&(n=e[0]/e[1]),[[X(t[0],1e-7),X(t[0]/n,1e-7)],[X(t[1]*n,1e-7),X(t[1],1e-7)]].filter(function(e){return e.every(function(e,n){var a=t[n],r=X(a,1e-7);return i?e<=a||e<=r:e>=a||e>=r})})[0]||e}function Z(e){for(var t=e.length,i=0,n=t-1;n>=0;--n)i+=e[n];return t?i/t:0}function K(e,t){var i=t[0]-e[0],n=Math.atan2(t[1]-e[1],i);return n>=0?n:n+2*Math.PI}function q(e){var t=[0,1].map(function(t){return Z(e.map(function(e){return e[t]}))}),i=K(t,e[0]),n=K(t,e[1]);return in&&n-i<-Math.PI?1:-1}function Y(e,t){return Math.sqrt(Math.pow((t?t[0]:0)-e[0],2)+Math.pow((t?t[1]:0)-e[1],2))}function X(e,t){return t?Math.round(e/t)/(1/t):e}function Q(e,t){return e.forEach(function(i,n){e[n]=X(e[n],t)}),e}function J(e,t){return e.classList?e.classList.contains(t):!!e.className.match(RegExp("(\\s|^)"+t+"(\\s|$)"))}function ee(e,t,i,n){e.addEventListener(t,i,n)}function et(e,t,i,n){e.removeEventListener(t,i,n)}function ei(e){var t;return(null==(t=null==e?void 0:e.ownerDocument)?void 0:t.defaultView)||window}function en(e,t){return t?Math.round(e/t)*t:e}function ea(e,t,i){void 0===i&&(i=Math.sqrt(e.length));for(var n=e.slice(),a=0;a=0;--n)i+=e[n];return i}(e.map(function(t,i){var n=e[i+1]||e[0];return t[0]*n[1]-n[0]*t[1]})))/2}function eW(e,t){var i=t.width,n=t.height,a=t.left,r=t.top,o=eU(e),s=o.minX,l=o.minY,d=o.maxX,c=o.maxY,u=i/(d-s),p=n/(c-l);return e.map(function(e){return[a+(e[0]-s)*u,r+(e[1]-l)*p]})}function eU(e){var t=e.map(function(e){return e[0]}),i=e.map(function(e){return e[1]});return{minX:Math.min.apply(Math,t),minY:Math.min.apply(Math,i),maxX:Math.max.apply(Math,t),maxY:Math.max.apply(Math,i)}}function eV(e,t,i){var n=e[0],a=e[1],r=eU(t),o=[[r.minX,a],[r.maxX,a]],s=eG(o[0],o[1]),l=eK(t),d=[];if(l.forEach(function(t){var i=eG(t[0],t[1]),n=t[0];s.every(function(e,t){return 0===eF(e-i[t])})?d.push({pos:e,line:t,type:"line"}):eZ(e$(s,i),[o,t]).forEach(function(e){t.some(function(t){return!eF(t[0]-e[0])&&!eF(t[1]-e[1])})?d.push({pos:e,line:t,type:"point"}):0!==eF(n[1]-a)&&d.push({pos:e,line:t,type:"intersection"})})}),!i&&H(d,function(e){return e[0]===n}))return!0;var c=0,u={};return d.forEach(function(e){var t=e.pos,i=e.type,r=e.line;if(!(t[0]>n)){if("intersection"===i)++c;else if("line"===i)return;else if("point"===i){var o=H(r,function(e){return e[1]!==a}),s=u[t[0]],l=o[1]>a?1:-1;s?s!==l&&++c:u[t[0]]=l}}}),c%2==1}function eG(e,t){var i=e[0],n=e[1],a=t[0],r=t[1],o=a-i,s=r-n;1e-7>Math.abs(o)&&(o=0),1e-7>Math.abs(s)&&(s=0);var l=0,d=0,c=0;return o?s?(d=1,c=-(l=-s/o)*i-n):(d=1,c=-n):s&&(l=-1,c=i),[l,d,c]}function e$(e,t){var i=e[0],n=e[1],a=e[2],r=t[0],o=t[1],s=t[2],l=0===i&&0===r,d=0===n&&0===o,c=[];if(l&&d)return[];if(l){var u=-a/n;return u!==-s/o?[]:[[-1/0,u],[1/0,u]]}if(d){var p=-a/i;return p!==-s/r?[]:[[p,-1/0],[p,1/0]]}if(0===i){var h=-a/n,m=-(o*h+s)/r;c=[[m,h]]}else if(0===r){var h=-s/o,m=-(n*h+a)/i;c=[[m,h]]}else if(0===n){var m=-a/i,h=-(r*m+s)/o;c=[[m,h]]}else if(0===o){var m=-s/r,h=-(i*m+a)/n;c=[[m,h]]}else{var m=(n*s-o*a)/(o*i-n*r),h=-(i*m+a)/n;c=[[m,h]]}return c.map(function(e){return[e[0],e[1]]})}function eZ(e,t){var i=t.map(function(e){return[0,1].map(function(t){return[Math.min(e[0][t],e[1][t]),Math.max(e[0][t],e[1][t])]})}),n=[];if(2===e.length){var a=e[0],r=a[0],o=a[1];if(eF(r-e[1][0])){if(!eF(o-e[1][1])){var s=Math.max.apply(Math,i.map(function(e){return e[0][0]})),l=Math.min.apply(Math,i.map(function(e){return e[0][1]}));if(eF(s-l)>0)return[];n=[[s,o],[l,o]]}}else{var d=Math.max.apply(Math,i.map(function(e){return e[1][0]})),c=Math.min.apply(Math,i.map(function(e){return e[1][1]}));if(eF(d-c)>0)return[];n=[[r,d],[r,c]]}}return n.length||(n=e.filter(function(e){var t=e[0],n=e[1];return i.every(function(e){return 0<=eF(t-e[0][0])&&0<=eF(e[0][1]-t)&&0<=eF(n-e[1][0])&&0<=eF(e[1][1]-n)})})),n.map(function(e){return[eF(e[0]),eF(e[1])]})}function eK(e){return(function(){for(var e=0,t=0,i=arguments.length;t-1&&n.splice(a,1)}}else this._events[e]=[];else this._events={};return this},t.once=function(e,t){var i=this;return t&&this._addEvent(e,t,{once:!0}),new Promise(function(t){i._addEvent(e,t,{once:!0})})},t.emit=function(e,t){var i=this;void 0===t&&(t={});var n=this._events[e];if(!e||!n)return!0;var a=!1;return t.eventType=e,t.stop=function(){a=!0},t.currentTarget=this,(function(){for(var e=0,t=0,i=arguments.length;tn-r?(s[1]>o.top||ns[1])&&(l[1]=1),o.left>i-r?(s[0]>o.left||is[0])&&(l[0]=1),(!!l[0]||!!l[1])&&this._continueDrag(eJ(eJ({},t),{direction:l,inputEvent:e,isDrag:!0}))}},n.checkScroll=function(e){var t=this;if(this._isWait)return!1;var i=e.prevScrollPos,n=void 0===i?this._prevScrollPos:i,a=e.direction,r=e.throttleTime,o=void 0===r?0:r,s=e.inputEvent,l=e.isDrag,d=this._getScrollPosition(a||[0,0],e),c=d[0]-n[0],u=d[1]-n[1],p=a||[c?Math.abs(c)/c:0,u?Math.abs(u)/u:0];return this._prevScrollPos=d,this._lock=!1,(!!c||!!u)&&(this.emit("move",{offsetX:p[0]?c:0,offsetY:p[1]?u:0,inputEvent:s}),o&&l&&(clearTimeout(this._timer),this._timer=window.setTimeout(function(){t._continueDrag(e)},o)),!0)},n.dragEnd=function(){this._flag=!1,this._lock=!1,clearTimeout(this._timer),this._unregisterScrollEvent()},n._getScrollPosition=function(e,t){var i=t.container,n=t.getScrollPosition;return(void 0===n?function(e){var t=e.container;return t===document.body?[t.scrollLeft||document.documentElement.scrollLeft,t.scrollTop||document.documentElement.scrollTop]:[t.scrollLeft,t.scrollTop]}:n)({container:e1(i),direction:e})},n._continueDrag=function(e){var t,i=this,n=e.container,a=e.direction,r=e.throttleTime,o=e.useScroll,s=e.isDrag,l=e.inputEvent;if(this._flag&&(!s||!this._isWait)){var d=z(),c=Math.max(r+this._prevTime-d,0);if(c>0)return clearTimeout(this._timer),this._timer=window.setTimeout(function(){i._continueDrag(e)},c),!1;this._prevTime=d;var u=this._getScrollPosition(a,e);this._prevScrollPos=u,s&&(this._isWait=!0),o||(this._lock=!0);var p={container:e1(n),direction:a,inputEvent:l};return null==(t=e.requestScroll)||t.call(e,p),this.emit("scroll",p),this._isWait=!1,o||this.checkScroll(eJ(eJ({},e),{prevScrollPos:u,direction:a,inputEvent:l}))}},n._registerScrollEvent=function(e){this._unregisterScrollEvent();var t=e.checkScrollEvent;if(t){var i=e1(e.container);!0===t&&(i===document.body||i===document.documentElement)?this._unregister=e0(window,this._onScroll):this._unregister=(!0===t?e0:t)(i,this._onScroll)}},n._unregisterScrollEvent=function(){var e;null==(e=this._unregister)||e.call(this),this._unregister=null},i}(eX),e3=e.i(191788),e5=function(e,t){return(e5=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},e4=function(){return(e4=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=0?a:a+2*Math.PI)/Math.PI*180}function e9(e){return e?e.touches?function(e){for(var t=Math.min(e.length,2),i=[],n=0;n=-1;if(!n.flag||!i){n._isDragAPI=!0;var a,r=n.options,o=r.container,s=r.pinchOutside,l=r.preventWheelClick,d=r.preventRightClick,c=r.preventDefault,u=r.checkInput,p=r.dragFocusedInput,h=r.preventClickEventOnDragStart,m=r.preventClickEventOnDrag,g=r.preventClickEventByCondition,f=n._useTouch,b=!n.flag;if(n._isSecondaryButton=3===e.which||2===e.button,l&&(2===e.which||1===e.button)||d&&(3===e.which||2===e.button))return n.stop(),!1;if(b){var x=n._window.document.activeElement,y=e.target;if(y){var v=y.tagName.toLowerCase(),C=tn.indexOf(v)>-1,w=y.isContentEditable;if(C||w){if(u||!p&&x===y)return!1;if(x&&(x===y||w&&x.isContentEditable&&x.contains(y)))if(!p)return!1;else y.blur()}else if((c||"touchstart"===e.type)&&x){var S=x.tagName.toLowerCase();(x.isContentEditable||tn.indexOf(S)>-1)&&x.blur()}(h||m||g)&&ee(n._window,"click",n._onClick,!0)}n.clientStores=[new ti(e9(e))],n._isIdle=!1,n.flag=!0,n.isDrag=!1,n._isTrusted=t,n._dragFlag=!0,n._prevInputEvent=e,n.data={},n.doubleFlag=z()-n.prevTime<200,n._isMouseEvent=e&&(e.type.indexOf("mouse")>-1||"button"in e),!n._isMouseEvent&&n._preventMouseEvent&&n._allowMouseEvent(),!1===(n._preventMouseEvent||n.emit("dragStart",e4(e4({data:n.data,datas:n.data,inputEvent:e,isMouseEvent:n._isMouseEvent,isSecondaryButton:n._isSecondaryButton,isTrusted:t,isDouble:n.doubleFlag},n.getCurrentStore().getPosition()),{preventDefault:function(){e.preventDefault()},preventDrag:function(){n._dragFlag=!1}})))&&n.stop(),n._isMouseEvent&&n.flag&&c&&e.preventDefault()}if(!n.flag)return!1;var k=0;if(b?(n._attchDragEvent(),f&&s&&(k=setTimeout(function(){ee(o,"touchstart",n.onDragStart,{passive:!1})}))):f&&s&&et(o,"touchstart",n.onDragStart),n.flag&&(a=e).touches&&a.touches.length>=2){if(clearTimeout(k),b&&e.touches.length!==e.changedTouches.length)return;n.pinchFlag||n.onPinchStart(e)}}}},n.onDrag=function(e,t){if(n.flag){var i=n.options.preventDefault;!n._isMouseEvent&&i&&e.preventDefault(),n._prevInputEvent=e;var a=e9(e),r=n.moveClients(a,e,!1);if(n._dragFlag){if((n.pinchFlag||r.deltaX||r.deltaY)&&!1===(n._preventMouseEvent||n.emit("drag",e4(e4({},r),{isScroll:!!t,inputEvent:e}))))return void n.stop();n.pinchFlag&&n.onPinch(e,a)}n.getCurrentStore().getPosition(a,!0)}},n.onDragEnd=function(e){if(n.flag){var t=n.options,i=t.pinchOutside,a=t.container,r=t.preventClickEventOnDrag,o=t.preventClickEventOnDragStart,s=t.preventClickEventByCondition,l=n.isDrag;(r||o||s)&&requestAnimationFrame(function(){n._allowClickEvent()}),s||o||!r||l||n._allowClickEvent(),n._useTouch&&i&&et(a,"touchstart",n.onDragStart),n.pinchFlag&&n.onPinchEnd(e);var d=(null==e?void 0:e.touches)?e9(e):[];0!==d.length&&n.options.keepDragging?n._addStore(new ti(d)):n.flag=!1;var c=n._getPosition(),u=z(),p=!l&&n.doubleFlag;n._prevInputEvent=null,n.prevTime=l||p?0:u,n.flag||(n._dettachDragEvent(),n._preventMouseEvent||n.emit("dragEnd",e4({data:n.data,datas:n.data,isDouble:p,isDrag:l,isClick:!l,isMouseEvent:n._isMouseEvent,isSecondaryButton:n._isSecondaryButton,inputEvent:e,isTrusted:n._isTrusted},c)),n.clientStores=[],n._isMouseEvent||(n._preventMouseEvent=!0,clearTimeout(n._preventMouseEventId),n._preventMouseEventId=setTimeout(function(){n._preventMouseEvent=!1},200)),n._isIdle=!0)}},n.onBlur=function(){n.onDragEnd()},n._allowClickEvent=function(){et(n._window,"click",n._onClick,!0)},n._onClick=function(e){n._allowClickEvent(),n._allowMouseEvent();var t=n.options.preventClickEventByCondition;null!=t&&t(e)||(e.stopPropagation(),e.preventDefault())},n._onContextMenu=function(e){n.options.preventRightClick?n.onDragEnd(e):e.preventDefault()},n._passCallback=function(){};var a=[].concat(t),r=a[0];n._window=r&&"postMessage"in r&&"blur"in r&&"self"in r?r:ei(r),n.options=e4({checkInput:!1,container:!r||"document"in r?r:ei(r),preventRightClick:!0,preventWheelClick:!0,preventClickEventOnDragStart:!1,preventClickEventOnDrag:!1,preventClickEventByCondition:null,preventDefault:!0,checkWindowBlur:!1,keepDragging:!1,pinchThreshold:0,events:["touch","mouse"]},i);var o=n.options,s=o.container,l=o.events,d=o.checkWindowBlur;if(n._useDrag=l.indexOf("drag")>-1,n._useTouch=l.indexOf("touch")>-1,n._useMouse=l.indexOf("mouse")>-1,n.targets=a,n._useDrag&&a.forEach(function(e){ee(e,"dragstart",n.onDragStart)}),n._useMouse&&(a.forEach(function(e){ee(e,"mousedown",n.onDragStart),ee(e,"mousemove",n._passCallback)}),ee(s,"contextmenu",n._onContextMenu)),d&&ee(ei(),"blur",n.onBlur),n._useTouch){var c={passive:!1};a.forEach(function(e){ee(e,"touchstart",n.onDragStart,c),ee(e,"touchmove",n._passCallback,c)})}return n}return e5(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.stop=function(){this.isDrag=!1,this.data={},this.clientStores=[],this.pinchFlag=!1,this.doubleFlag=!1,this.prevTime=0,this.flag=!1,this._isIdle=!0,this._allowClickEvent(),this._dettachDragEvent(),this._isDragAPI=!1},i.prototype.getMovement=function(e){return this.getCurrentStore().getMovement(e)+this.clientStores.slice(1).reduce(function(e,t){return e+t.movement},0)},i.prototype.isDragging=function(){return this.isDrag},i.prototype.isIdle=function(){return this._isIdle},i.prototype.isFlag=function(){return this.flag},i.prototype.isPinchFlag=function(){return this.pinchFlag},i.prototype.isDoubleFlag=function(){return this.doubleFlag},i.prototype.isPinching=function(){return this.isPinch},i.prototype.scrollBy=function(e,t,i,n){void 0===n&&(n=!0),this.flag&&(this.clientStores[0].move(e,t),n&&this.onDrag(i,!0))},i.prototype.move=function(e,t){var i=e[0],n=e[1],a=this.getCurrentStore().prevClients;return this.moveClients(a.map(function(e){var t=e.clientX,a=e.clientY;return{clientX:t+i,clientY:a+n,originalClientX:t,originalClientY:a}}),t,!0)},i.prototype.triggerDragStart=function(e){this.onDragStart(e,!1)},i.prototype.setEventData=function(e){var t=this.data;for(var i in e)t[i]=e[i];return this},i.prototype.setEventDatas=function(e){return this.setEventData(e)},i.prototype.getCurrentEvent=function(e){return void 0===e&&(e=this._prevInputEvent),e4(e4({data:this.data,datas:this.data},this._getPosition()),{movement:this.getMovement(),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,inputEvent:e})},i.prototype.getEventData=function(){return this.data},i.prototype.getEventDatas=function(){return this.data},i.prototype.unset=function(){var e=this,t=this.targets,i=this.options.container;this.off(),et(this._window,"blur",this.onBlur),this._useDrag&&t.forEach(function(t){et(t,"dragstart",e.onDragStart)}),this._useMouse&&(t.forEach(function(t){et(t,"mousedown",e.onDragStart)}),et(i,"contextmenu",this._onContextMenu)),this._useTouch&&(t.forEach(function(t){et(t,"touchstart",e.onDragStart)}),et(i,"touchstart",this.onDragStart)),this._prevInputEvent=null,this._allowClickEvent(),this._dettachDragEvent()},i.prototype.onPinchStart=function(e){var t=this,i=this.options.pinchThreshold;if(!(this.isDrag&&this.getMovement()>i)){var n=new ti(e9(e));this.pinchFlag=!0,this._addStore(n),!1===this.emit("pinchStart",e4(e4({data:this.data,datas:this.data,angle:n.getAngle(),touches:this.getCurrentStore().getPositions()},n.getPosition()),{inputEvent:e,isTrusted:this._isTrusted,preventDefault:function(){e.preventDefault()},preventDrag:function(){t._dragFlag=!1}}))&&(this.pinchFlag=!1)}},i.prototype.onPinch=function(e,t){if(this.flag&&this.pinchFlag&&!(t.length<2)){var i=this.getCurrentStore();this.isPinch=!0,this.emit("pinch",e4(e4({data:this.data,datas:this.data,movement:this.getMovement(t),angle:i.getAngle(t),rotation:i.getRotation(t),touches:i.getPositions(t),scale:i.getScale(t),distance:i.getDistance(t)},i.getPosition(t)),{inputEvent:e,isTrusted:this._isTrusted}))}},i.prototype.onPinchEnd=function(e){if(this.pinchFlag){var t=this.isPinch;this.isPinch=!1,this.pinchFlag=!1;var i=this.getCurrentStore();this.emit("pinchEnd",e4(e4({data:this.data,datas:this.data,isPinch:t,touches:i.getPositions()},i.getPosition()),{inputEvent:e}))}},i.prototype.getCurrentStore=function(){return this.clientStores[0]},i.prototype.moveClients=function(e,t,i){var n=this._getPosition(e,i),a=this.isDrag;(n.deltaX||n.deltaY)&&(this.isDrag=!0);var r=!1;return!a&&this.isDrag&&(r=!0),e4(e4({data:this.data,datas:this.data},n),{movement:this.getMovement(e),isDrag:this.isDrag,isPinch:this.isPinch,isScroll:!1,isMouseEvent:this._isMouseEvent,isSecondaryButton:this._isSecondaryButton,inputEvent:t,isTrusted:this._isTrusted,isFirstDrag:r})},i.prototype._addStore=function(e){this.clientStores.splice(0,0,e)},i.prototype._getPosition=function(e,t){var i=this.getCurrentStore().getPosition(e,t),n=this.clientStores.slice(1).reduce(function(e,t){var i=t.getPosition();return e.distX+=i.distX,e.distY+=i.distY,e},i),a=n.distX,r=n.distY;return e4(e4({},i),{distX:a,distY:r})},i.prototype._attchDragEvent=function(){var e=this._window,t=this.options.container,i={passive:!1};this._isDragAPI&&(ee(t,"dragover",this.onDrag,i),ee(e,"dragend",this.onDragEnd)),this._useMouse&&(ee(t,"mousemove",this.onDrag),ee(e,"mouseup",this.onDragEnd)),this._useTouch&&(ee(t,"touchmove",this.onDrag,i),ee(e,"touchend",this.onDragEnd,i),ee(e,"touchcancel",this.onDragEnd,i))},i.prototype._dettachDragEvent=function(){var e=this._window,t=this.options.container;this._isDragAPI&&(et(t,"dragover",this.onDrag),et(e,"dragend",this.onDragEnd)),this._useMouse&&(et(t,"mousemove",this.onDrag),et(e,"mouseup",this.onDragEnd)),this._useTouch&&(et(t,"touchstart",this.onDragStart),et(t,"touchmove",this.onDrag),et(e,"touchend",this.onDragEnd),et(e,"touchcancel",this.onDragEnd))},i.prototype._allowMouseEvent=function(){this._preventMouseEvent=!1,clearTimeout(this._preventMouseEventId)},i}(eX),tr=function(e){for(var t=5381,i=e.length;i;)t=33*t^e.charCodeAt(--i);return t>>>0};let to=function(e){var t="rCS"+tr(e).toString(36);return{className:t,inject:function(i,n){void 0===n&&(n={});var a,r,o,s=function(e){if(e&&e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t}}(i),l=(s||i.ownerDocument||document).querySelector('style[data-styled-id="'.concat(t,'"]'));if(l){var d=parseFloat(l.getAttribute("data-styled-count"))||0;l.setAttribute("data-styled-count","".concat(d+1))}else a=n,(o=(r=(null==i?void 0:i.ownerDocument)||k).createElement("style")).setAttribute("type","text/css"),o.setAttribute("data-styled-id",t),o.setAttribute("data-styled-count","1"),a.nonce&&o.setAttribute("nonce",a.nonce),o.innerHTML=a.original?e:e.replace(/([^};{\s}][^};{]*|^\s*){/mg,function(e,i){var n=i.trim();return(n?R(n):[""]).map(function(e){var i=e.trim();return 0===i.indexOf("@")?i:i.indexOf(":global")>-1?i.replace(/\:global/g,""):i.indexOf(":host")>-1?"".concat(i.replace(/\:host/g,".".concat(t))):i?".".concat(t," ").concat(i):".".concat(t)}).join(", ")+" {"}),(s||r.head||r.body).appendChild(o),l=o;return{destroy:function(){var e,t=parseFloat(l.getAttribute("data-styled-count"))||0;t<=1?(l.remove?l.remove():null==(e=l.parentNode)||e.removeChild(l),l=null):l.setAttribute("data-styled-count","".concat(t-1))}}}}};var ts=function(e,t){return(ts=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function tl(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}ts(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var td=function(){return(td=Object.assign||function(e){for(var t,i=1,n=arguments.length;it.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(i[n[a]]=e[n[a]]);return i}(e,["className","cspNonce","portalContainer"]),a=this.injector.className,r=this.tag,o={};return(e3.version||"").indexOf("simple")>-1&&i&&(o={portalContainer:i}),(0,e3.createElement)(r,td(td({ref:v(this,"element"),"data-styled-id":a,className:"".concat(void 0===t?"":t," ").concat(a)},o),n))},i.componentDidMount=function(){this.injectResult=this.injector.inject(this.element,{nonce:this.props.cspNonce})},i.componentWillUnmount=function(){this.injectResult.destroy(),this.injectResult=null},i.getElement=function(){return this.element},t}(e3.Component);let tu=function(e,t){var i=to(t);function n(){var t=null!==tc&&tc.apply(this,arguments)||this;return t.injector=i,t.tag=e,t}return tl(n,tc),n};var tp=function(e,t){return(tp=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function th(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}tp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var tm=function(){return(tm=Object.assign||function(e){for(var t,i=1,n=arguments.length;iparseFloat(h[1])),ty="moveable-",tv="\n{\n position: absolute;\n width: 1px;\n height: 1px;\n left: 0;\n top: 0;\n z-index: 3000;\n --moveable-color: #4af;\n --zoom: 1;\n --zoompx: 1px;\n will-change: transform;\n}\n.control-box {\n z-index: 0;\n}\n.line, .control {\n position: absolute;\n left: 0;\n top: 0;\n will-change: transform;\n}\n.control {\n width: 14px;\n height: 14px;\n border-radius: 50%;\n border: 2px solid #fff;\n box-sizing: border-box;\n background: #4af;\n background: var(--moveable-color);\n margin-top: -7px;\n margin-left: -7px;\n border: 2px solid #fff;\n z-index: 10;\n}\n.padding {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100px;\n height: 100px;\n transform-origin: 0 0;\n}\n.line {\n width: 1px;\n height: 1px;\n background: #4af;\n background: var(--moveable-color);\n transform-origin: 0px 50%;\n}\n.line.dashed {\n box-sizing: border-box;\n background: transparent;\n}\n.line.dashed.horizontal {\n border-top: 1px dashed #4af;\n border-top-color: #4af;\n border-top-color: var(--moveable-color);\n}\n.line.dashed.vertical {\n border-left: 1px dashed #4af;\n border-left-color: #4af;\n border-left-color: var(--moveable-color);\n}\n.line.vertical {\n transform: translateX(-50%);\n}\n.line.horizontal {\n transform: translateY(-50%);\n}\n.line.vertical.bold {\n width: 2px;\n}\n.line.horizontal.bold {\n height: 2px;\n}\n\n.control.origin {\n border-color: #f55;\n background: #fff;\n width: 12px;\n height: 12px;\n margin-top: -6px;\n margin-left: -6px;\n pointer-events: none;\n}\n".concat([0,15,30,45,60,75,90,105,120,135,150,165].map(function(e){var t,i,n;return'\n.direction[data-rotation="'.concat(e,'"] {\n ').concat((t='data:image/svg+xml;utf8,'),n="ns-resize",135==(i=45*Math.round(e/45)%180)?n="nwse-resize":45===i?n="nesw-resize":90===i&&(n="ew-resize"),"cursor:".concat(n,";cursor: url('").concat(t,"') 16 16, ").concat(n,";")),"\n}\n")}).join("\n"),"\n.group {\n z-index: -1;\n}\n.area {\n position: absolute;\n}\n.area-pieces {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n}\n.area.avoid, .area.pass {\n pointer-events: none;\n}\n.area.avoid+.area-pieces {\n display: block;\n}\n.area-piece {\n position: absolute;\n}\n\n").concat(tx?':global svg *:before {\n content:"";\n transform-origin: inherit;\n}':"","\n"),tC=[[0,1,2],[1,0,3],[2,0,3],[3,1,2]],tw=["n","w","s","e","nw","ne","sw","se"],tS={n:[0,1],s:[2,3],w:[2,0],e:[1,3],nw:[0],ne:[1],sw:[2],se:[3]},tk={n:0,s:180,w:270,e:90,nw:315,ne:45,sw:225,se:135},tA=["isMoveableElement","updateRect","updateTarget","destroy","dragStart","isInside","hitTest","setState","getRect","request","isDragging","getManager","forceUpdate"];function tE(e,t,i,n,a){var r=t.gesto.move(i,e.inputEvent),o=r.originalDatas||r.datas,s=o.draggable||(o.draggable={});return tm(tm({},a?nh(t,r):r),{isPinch:!!n,parentEvent:!0,datas:s,originalDatas:e.originalDatas})}var t_=function(){function e(){this.prevX=0,this.prevY=0,this.startX=0,this.startY=0,this.isDrag=!1,this.isFlag=!1,this.datas={draggable:{}}}var t=e.prototype;return t.dragStart=function(e,t){this.isDrag=!1,this.isFlag=!1;var i=t.originalDatas;return this.datas=i,i.draggable||(i.draggable={}),tm(tm({},this.move(e,t.inputEvent)),{type:"dragstart"})},t.drag=function(e,t){return this.move([e[0]-this.prevX,e[1]-this.prevY],t)},t.move=function(e,t){var i,n;return this.isFlag?(i=this.prevX+e[0],n=this.prevY+e[1],(e[0]||e[1])&&(this.isDrag=!0)):(this.prevX=e[0],this.prevY=e[1],this.startX=e[0],this.startY=e[1],i=e[0],n=e[1],this.isFlag=!0),this.prevX=i,this.prevY=n,{type:"drag",clientX:i,clientY:n,inputEvent:t,isDrag:this.isDrag,distX:i-this.startX,distY:n-this.startY,deltaX:e[0],deltaY:e[1],datas:this.datas.draggable,originalDatas:this.datas,parentEvent:!0,parentGesto:this}},e}();function tI(e,t,i){var n=i.originalDatas;n.groupable=n.groupable||{};var a=n.groupable;a.childDatas=a.childDatas||[];var r=a.childDatas;return e.moveables.map(function(e,n){return r[n]=r[n]||{},r[n][t]=r[n][t]||{},tm(tm({},i),{datas:r[n][t],originalDatas:r[n]})})}function tM(e,t,i,n,a,r){var o=!!i.match(/Start$/g),s=!!i.match(/End$/g),l=a.isPinch,d=a.datas,c=tI(e,t.name,a),u=e.moveables,p=c.map(function(e,a){var c=u[a],p=c.state,h=e;if(o)h=new t_().dragStart(n,e);else{if(p.gesto||(p.gesto=d.childGestos[a]),!p.gesto)return;h=tE(e,p,n,l,r)}var m=t[i](c,tm(tm({},h),{parentFlag:!0}));return s&&(p.gesto=null),m});return o&&(d.childGestos=u.map(function(e){return e.state.gesto})),p}function tT(e,t,i,n,a,r){void 0===a&&(a=function(e,t){return t});var o=!!i.match(/End$/g),s=tI(e,t.name,n),l=e.moveables;return s.map(function(e,n){var s=l[n],d=e;d=a(s,e);var c=t[i](s,tm(tm({},d),{parentFlag:!0}));return c&&r&&r(s,e,c,n),o&&(s.state.gesto=null),c})}function tL(e,t,i,n){void 0===n&&(n="");var a=e.state,r=a.renderPoses,o=a.rotation,s=a.direction,l=e.props,d=l.renderDirections,c=void 0===d?t:d,u=l.zoom,p={};if(!c)return[];var h=s>0?1:-1,m=!0===c?tw:c,g=o/Math.PI*180;return m.forEach(function(e){p[e]=!0}),m.map(function(e){var t=tS[e];if(!t||!p[e])return null;var a=(X(g,15)+h*tk[e]+720)%180;return i.createElement("div",{className:iH("control","direction",e,n),"data-rotation":a,"data-direction":e,key:"direction-".concat(e),style:i5.apply(void 0,tg([o,u],t.map(function(e){return r[e]}),!1))})})}function tj(e,t,i,n,a,r){for(var o=[],s=6;se&&r>270&&e<90?++o:r270&&--o;var s=t*(360*o+e-n);return i.prevDeg=n+s,s}function tR(e,t,i,n){return tN(K(n.startAbsoluteOrigin,[e,t])/Math.PI*180,i,n)}function tO(e,t,i,n,a,r){var o=e.props.throttleRotate,s=n,l=i.prevSnapDeg;r&&(s=function(e,t,i,n){if(!tU(e,"rotatable"))return n;var a=t.pos1,r=t.pos2,o=t.pos3,s=t.pos4,l=n*Math.PI/180,d=[a,r,o,s].map(function(e){return eu(e,i)}),c=d.map(function(e){return ex(e,l)}),u=tg(tg([],function(e,t,i,n,a){if(!e.props.bounds)return[];var r=a*Math.PI/180,o=ie(e),s=o.left,l=o.top,d=o.right,c=o.bottom,u=s-n[0],p=d-n[0],h=l-n[1],m=c-n[1],g={left:u,top:h,right:p,bottom:m};if(!ii(i,g,0))return[];var f=[];return[[u,0],[p,0],[h,1],[m,1]].forEach(function(e){var n=e[0],a=e[1];i.forEach(function(e){var i,o,s=K([0,0],e);f.push.apply(f,[o=Math.sqrt((i=i1(e))*i-n*n)||0,-o].sort(function(t,i){return Math.abs(t-e[+!a])-Math.abs(i-e[+!a])}).map(function(e){return K([0,0],a?[e,n]:[n,e])}).map(function(e){return r+e-s}).filter(function(e){return!ii(t,g,e)}).map(function(e){return X(180*e/Math.PI,1e-7)}))})}),f}(e,d,c,i,n),!0),function(e,t,i,n,a){var r=e.props.innerBounds,o=a*Math.PI/180;if(!r)return[];var s=r.left,l=r.top,d=r.width,c=r.height,u=s-n[0],p=s+d-n[0],h=l-n[1],m=l+c-n[1],g=[[u,h],[p,h],[u,m],[p,m]],f=iM(i,[0,0]);if(!t8(i,g,f,0))return[];var b=[],x=g.map(function(e){return[i1(e),K([0,0],e)]});return[[i[0],i[1]],[i[1],i[3]],[i[3],i[2]],[i[2],i[0]]].forEach(function(e){var i=K([0,0],function(e){var t=e[0],i=e[1],n=i[0]-t[0],a=i[1]-t[1];if(!n)return[t[0],0];if(!a)return[0,t[1]];var r=a/n,o=-r*t[0]+t[1];return[-o/(r+1/r),o/(r*r+1)]}(e)),n=function(e){var t=e[0],i=e[1],n=i[0]-t[0],a=i[1]-t[1];if(!n)return Math.abs(t[0]);if(!a)return Math.abs(t[1]);var r=a/n;return Math.abs((-r*t[0]+t[1])/Math.sqrt(Math.pow(r,2)+1))}(e);b.push.apply(b,x.filter(function(e){var t=e[0];return t&&n<=t}).map(function(e){var t=e[0],a=e[1],r=Math.acos(t?n/t:0);return[o+(a+r)-i,o+(a-r)-i]}).reduce(function(e,t){return e.push.apply(e,t),e},[]).filter(function(e){return!t8(t,g,f,e)}).map(function(e){return X(180*e/Math.PI,1e-7)}))}),b}(e,d,c,i,n),!0);return(u.sort(function(e,t){return Math.abs(e-n)-Math.abs(t-n)}),u.length)?u[0]:n}(e,t,i.origin,s));var d=X(a+s,void 0===o?0:o),c=d-a;return i.prevSnapDeg=c,[c-l,s,d]}function tB(e,t){if(t.isRequest)return"rotatable"===t.requestAble;var i=t.inputEvent.target;if(J(i,iH("rotation-control")))return!0;var n=e.props.rotationTarget;return!!n&&ny(n,!0).some(function(e){return!!e&&(i===e||i.contains(e))})}var tz=["left","right","center"],tF=["top","bottom","middle"],tH={start:"left",end:"right",center:"center"},tW={start:"top",end:"bottom",center:"middle"};function tU(e,t){var i=e.props,n=i.snappable,a=i.bounds,r=i.innerBounds,o=i.verticalGuidelines,s=i.horizontalGuidelines,l=i.snapGridWidth,d=i.snapGridHeight,c=e.state,u=c.guidelines,p=c.enableSnap;return!(!n||!p||t&&!0!==n&&0>n.indexOf(t))&&(!!l||!!d||!!a||!!r||!!u&&!!u.length||!!o&&!!o.length||!!s&&!!s.length||!1)}function tV(e){return!1===e?{}:!0!==e&&e?e:{left:!0,right:!0,top:!0,bottom:!0}}function tG(e,t){var i=function(e,t){var i=tV(e),n={};for(var a in i)a in t&&i[a]&&(n[a]=t[a]);return n}(e,t),n=tF.filter(function(e){return e in i}),a=tz.filter(function(e){return e in i});return{horizontal:n.map(function(e){return i[e]}),vertical:a.map(function(e){return i[e]})}}function t$(e,t,i,n,a,r,o){void 0===a&&(a=0),void 0===r&&(r=0),void 0===o&&(o={left:0,top:0,right:0,bottom:0});var s=[],l=o.left,d=o.top,c=o.bottom,u=i+o.right-l,p=n+c-d;return e&&e.forEach(function(e){s.push({type:"horizontal",pos:[l,X(e-r+d,.1)],size:u})}),t&&t.forEach(function(e){s.push({type:"vertical",pos:[X(e-a+l,.1),d],size:p})}),s}function tZ(e){var t=e.state,i=t.snapOffset,n=t.containerClientRect,a=n.overflow,r=n.scrollHeight,o=n.scrollWidth,s=n.clientHeight,l=n.clientWidth,d=n.clientLeft,c=n.clientTop,u=e.props,p=u.snapGap,h=u.verticalGuidelines,m=u.horizontalGuidelines,g=u.snapThreshold,f=u.snapGridWidth,b=u.snapGridHeight,x=tg([],function(e){var t=e.state,i=e.props.elementGuidelines,n=void 0===i?[]:i;if(!n.length)return t.elementRects=[],[];var a=(t.elementRects||[]).filter(function(e){return!e.refresh}),r=n.map(function(e){return I(e)&&"element"in e?e:{element:nx(e,!0)}}).filter(function(e){return e.element}),o=eN(a.map(function(e){return e.element}),r.map(function(e){return e.element}),eB),s=o.maintained,l=o.added,d=[];s.forEach(function(e){var t=e[0];d[e[1]]=a[t]}),(function(e,t){if(!t.length)return[];var i,n=e.state,a=n.containerClientRect,r=n.targetClientRect,o=r.top,s=r.left,l=n.rootMatrix,d=n.is3d?4:3,c=(i=iX(l,[a.clientLeft,a.clientTop],d),[a.left+i[0],a.top+i[1]]),u=c[0],p=c[1],h=eU(ni(n)),m=eu([h.minX,h.minY],np(l,[s-u,o-p],d)).map(function(e){var t;return Math.round((t=e)%1==-.5?t-1:t)}),g=m[0],f=m[1];return t.map(function(e){var t=e.element.getBoundingClientRect(),i=t.left-u,n=t.top-p,a=n+t.height,r=i+t.width,o=np(l,[i,n],d),s=o[0],c=o[1],h=np(l,[r,a],d),m=h[0],b=h[1];return tm(tm({},e),{rect:{left:s+g,right:m+g,top:c+f,bottom:b+f,center:(s+m)/2+g,middle:(c+b)/2+f}})})})(e,l.map(function(e){return r[e]})).map(function(e,t){d[l[t]]=e}),t.elementRects=d;var c=tV(e.props.elementSnapDirections),u=[];return d.forEach(function(e){var t=e.element,i=e.top,n=void 0===i?c.top:i,a=e.left,r=void 0===a?c.left:a,o=e.right,s=void 0===o?c.right:o,l=e.bottom,d=void 0===l?c.bottom:l,p=e.center,h=void 0===p?c.center:p,m=e.middle,g=void 0===m?c.middle:m,f=e.className,b=e.rect,x=tG({top:n,right:s,left:r,bottom:d,center:h,middle:g},b),y=x.horizontal,v=x.vertical,C=b.top,w=b.left,S=b.right-w,k=b.bottom-C,A=[S,k];v.forEach(function(i){u.push({type:"vertical",element:t,pos:[X(i,.1),C],size:k,sizes:A,className:f,elementRect:e})}),y.forEach(function(i){u.push({type:"horizontal",element:t,pos:[w,X(i,.1)],size:S,sizes:A,className:f,elementRect:e})})}),u}(e),!0);if(void 0===p||p){var y,v,C,w,S=iJ(ni(e.state)),k=S.top,A=S.left,E=S.bottom,_=S.right;x.push.apply(x,(y={top:k,left:A,bottom:E,right:_,center:(A+_)/2,middle:(k+E)/2},v=void 0===g?5:g,C=e.state.elementRects,w=[],[["vertical",tH,tW],["horizontal",tW,tH]].forEach(function(e){var t=e[0],i=e[1],n=e[2],a=y[i.start],r=y[i.end],o=y[i.center],s=y[n.start],l=y[n.end];function d(e){var t=e.rect;return t[i.end]l)&&!(t[n.end]0}).sort(function(e,t){return d(e)-d(t)}),u=[];c.forEach(function(e){c.forEach(function(t){if(e!==t){var i=e.rect,a=t.rect,r=i[n.start],o=i[n.end],s=a[n.start];r>a[n.end]||s>o||u.push([e,t])}})}),u.forEach(function(e){var n=e[0],s=e[1],l=n.rect,d=s.rect,c=l[i.start],u=l[i.end],p=d[i.start],h=d[i.end],m=0,g=0,f=!1,b=!1,x=!1;if(u<=a&&r<=p){if(b=!0,m=(p-u-(r-a))/2,Math.abs((g=u+m+(r-a)/2)-o)>v)return}else if(uv)return}else if(!(uv)return;m&&w.push({type:t,pos:"vertical"===t?[g,0]:[0,g],element:s.element,size:0,className:s.className,isStart:f,isCenter:b,isEnd:x,gap:m,hide:!0,gapRects:[n,s]})})}),w))}return x.push.apply(x,function(e,t,i,n,a,r){void 0===a&&(a=0),void 0===r&&(r=0);var o=[];if(t)for(var s=0;s<=n;s+=t)o.push({type:"horizontal",pos:[0,X(s-r,.1)],size:i,hide:!0});if(e)for(var s=0;s<=i;s+=e)o.push({type:"vertical",pos:[X(s-a,.1),0],size:n,hide:!0});return o}(void 0===f?0:f,void 0===b?0:b,a?o:l,a?r:s,d,c)),x.push.apply(x,t$(m||!1,h||!1,a?o:l,a?r:s,d,c,i)),x}function tK(e,t,i,n){var a=function(){for(var e=[],t=0;tn)}).sort(function(e,t){return e.dist-t.dist});return{pos:i,index:r,guidelineInfos:o}}).filter(function(e){return e.guidelineInfos.length>0}).sort(function(e,t){return e.guidelineInfos[0].dist-t.guidelineInfos[0].dist}),o=r.length>0;return{isSnap:o,index:o?r[0].index:-1,posInfos:r}}function tJ(e,t){var i=Math.abs(e.offset),n=Math.abs(t.offset);if(e.isBound&&t.isBound)return n-i;if(e.isBound)return -1;if(t.isBound)return 1;if(e.isSnap&&t.isSnap)return n-i;if(e.isSnap)return -1;else if(t.isSnap)return 1;else if(i<1e-7)return 1;else if(n<1e-7)return -1;return i-n}function t0(e,t){return e.slice().sort(function(e,i){var n=e.sign[t],a=i.sign[t],r=e.offset[t],o=i.offset[t];return n?a?tJ({isBound:e.isBound,isSnap:e.isSnap,offset:r},{isBound:i.isBound,isSnap:i.isSnap,offset:o}):-1:1})[0]}function t1(e,t){var i=Z([t[0][0],t[1][0]]),n=Z([t[0][1],t[1][1]]);return{vertical:i<=e[0],horizontal:n<=e[1]}}function t2(e,t){var i,n,a=t[0],r=t[1],o=r[0]-a[0],s=r[1]-a[1];return 1e-7>Math.abs(o)&&(o=0),1e-7>Math.abs(s)&&(s=0),o?(i=s?s/o*(e[0]-a[0])+a[1]:a[1],n=e[1]):(i=a[0],n=e[0]),i-n}function t3(e,t,i,n){return void 0===n&&(n=1e-7),e.every(function(e){var a=t2(e,t);return a<=0===i||Math.abs(a)<=n})}function t5(e,t,i,n,a){return(void 0===a&&(a=0),n&&t-a<=e||!n&&e<=i+a)?{isBound:!0,offset:n?t-e:i-e}:{isBound:!1,offset:0}}function t4(e,t,i,n,a,r){var o=t[0],s=t[1],l=e[0],d=i[0],c=i[1],u=nf(c[1]-d[1]),p=nf(c[0]-d[0]),h=-o/s;if(p){if(!u)if(r&&!s);else{if(o)return t5((d[1]-l[1])/h+l[0],d[0],c[0],n,a);var m=d[1]-l[1],g=Math.abs(m)<=(a||0);return{isBound:g,offset:g?m:0}}}else if(r&&!o);else{if(s)return t5(h*(d[0]-l[0])+l[1],d[1],c[1],n,a);var m=d[0]-l[0],g=Math.abs(m)<=(a||0);return{isBound:g,offset:g?m:0}}return{isBound:!1,offset:0}}function t6(e,t,i){return t.map(function(t){var n=function(e,t){var i=t.line,n=t.centerSign,a=t.verticalSign,r=t.horizontalSign,o=t.lineConstants,s=e.props.innerBounds;if(!s)return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var l=s.left,d=s.top,c=s.width,u=s.height,p=[[l,d],[l,d+u]],h=[[l,d],[l+c,d]],m=[[l+c,d],[l+c,d+u]],g=[[l,d+u],[l+c,d+u]];if(t3([[l,d],[l+c,d],[l,d+u],[l+c,d+u]],i,n))return{isAllBound:!1,isBound:!1,isVerticalBound:!1,isHorizontalBound:!1,offset:[0,0]};var f=t4(i,o,h,a),b=t4(i,o,g,a),x=t4(i,o,p,r),y=t4(i,o,m,r),v=f.isBound&&b.isBound,C=f.isBound||b.isBound,w=x.isBound&&y.isBound,S=x.isBound||y.isBound,k=nu(f.offset,b.offset),A=nu(x.offset,y.offset),E=[0,0],_=!1,I=!1;return Math.abs(A)Math.abs(a)&&(a=0),1e-7>Math.abs(r)&&(r=0),o=0,s=0,c=0,a?r?(s=1,c=(o=-r/a)*i[0]-i[1]):(s=1,c=-i[1]):(o=-1,c=i[0]),[o,s,c].map(function(e){return X(e,1e-7)})),f=t1(d,m),b=f.vertical,x=f.horizontal;return{multiple:u,centerSign:0>=t2(d,m),verticalSign:b,horizontalSign:x,lineConstants:g,line:[iM(t,p),iM(t,h)]}})}function t8(e,t,i,n){var a=n?e.map(function(e){return ex(e,n)}):e;return[[a[0],a[1]],[a[1],a[3]],[a[3],a[2]],[a[2],a[0]]].some(function(e){var n=0>=t2(i,e);return!t3(t,e,n)})}function t7(e,t,i){var n=e||{},a=n.position,r=n.left,o=n.top,s=n.right,l=n.bottom,d={position:void 0===a?"client":a,left:void 0===r?-1/0:r,top:void 0===o?-1/0:o,right:void 0===s?1/0:s,bottom:void 0===l?1/0:l};return{vertical:it(d,t,!0),horizontal:it(d,i,!1)}}function ie(e,t){var i=e.state,n=i.containerClientRect,a=n.clientHeight,r=n.clientWidth,o=n.clientLeft,s=n.clientTop,l=i.snapOffset,d=l.left,c=l.top,u=l.right,p=l.bottom,h=t||e.props.bounds||{},m="css"===(h.position||"client"),g=h.left,f=h.top,b=h.right,x=void 0===b?m?-1/0:1/0:b,y=h.bottom,v=void 0===y?m?-1/0:1/0:y;return m&&(x=r+u-d-x,v=a+p-c-v),{left:(void 0===g?-1/0:g)+d-o,right:x+d-o,top:(void 0===f?-1/0:f)+c-s,bottom:v+c-s}}function it(e,t,i){var n=e[i?"left":"top"],a=e[i?"right":"bottom"],r=Math.min.apply(Math,t),o=Math.max.apply(Math,t),s=[];return n+1>r&&s.push({isBound:!0,offset:r-n,pos:n}),a-1.1||e[0]>t.right&&Math.abs(e[0]-t.right)>.1||e[1].1||e[1]>t.bottom&&Math.abs(e[1]-t.bottom)>.1})}function ia(e,t){var i,n,a,r,o,s,l,d,c,u;return i=tm(tm({},e),{classNames:tg([iH("line","guideline",e.direction)],e.classNames,!0).filter(function(e){return e}),size:e.size||"".concat(e.sizeValue,"px"),pos:e.pos||e.posValue.map(function(e){return"".concat(X(e,.1),"px")})}),a=i.direction,r=i.classNames,o=i.size,s=i.pos,l=i.zoom,d=i.key,u=(c="horizontal"===a)?"Y":"X",t.createElement("div",{key:d,className:r.join(" "),style:((n={})[c?"width":"height"]="".concat(o),n.transform="translate(".concat(s[0],", ").concat(s[1],") translate").concat(u,"(-50%) scale").concat(u,"(").concat(l,")"),n)})}function ir(e,t,i,n,a,r,o,s){var l=e.props.zoom;return i.map(function(e,i){var d=e.type,c=e.pos,u=[0,0];return u[o]=n,u[+!o]=-a+c,ia({key:"".concat(t,"TargetGuideline").concat(i),classNames:[iH("target","bold",d)],posValue:u,sizeValue:r,zoom:l,direction:t},s)})}function io(e,t,i,n,a,r){var o=e.props,s=o.zoom,l=o.isDisplayInnerSnapDigit,d="horizontal"===t?tH:tW,c=a[d.start],u=a[d.end];return i.filter(function(e){var t=e.hide,i=e.elementRect;if(t)return!1;if(l&&i){var n=i.rect;if(n[d.start]<=c&&u<=n[d.end])return!1}return!0}).map(function(e,i){var a=e.pos,o=e.size,l=e.element,d=[-n[0]+a[0],-n[1]+a[1]];return ia({key:"".concat(t,"-default-guideline-").concat(i),classNames:l?[iH("bold")]:[],direction:t,posValue:d,sizeValue:o,zoom:s},r)})}function is(e,t,i,n,a,r,o,s){var l,d=e.props,c=d.snapDigit,u=d.isDisplaySnapDigit,p=d.snapDistFormat,h=d.zoom,m="horizontal"===t?"X":"Y",g="vertical"===t?"height":"width",f=Math.abs(a),b=void 0===u||u?parseFloat(f.toFixed(void 0===c?0:c)):0;return s.createElement("div",{key:"".concat(t,"-").concat(i,"-guideline-").concat(n),className:iH("guideline-group",t),style:((l={left:"".concat(r[0],"px"),top:"".concat(r[1],"px")})[g]="".concat(f,"px"),l)},ia({direction:t,classNames:[iH(i),o],size:"100%",posValue:[0,0],sizeValue:f,zoom:h},s),s.createElement("div",{className:iH("size-value","gap"),style:{transform:"translate".concat(m,"(-50%) scale(").concat(h,")")}},b>0?(void 0===p?function(e){return e}:p)(b):""))}function il(e,t,i,n,a){var r=function(e,t,i,n){var a=t[0]-e[0],r=t[1]-e[1];if(1e-7>Math.abs(a)&&(a=0),1e-7>Math.abs(r)&&(r=0),!a)return n?[0,0]:[0,i];if(!r)return n?[i,0]:[0,0];var o=r/a,s=e[1]-o*e[0];if(!n)return[(t[1]+i-s)/o-t[0],i];var l=o*(t[0]+i)+s;return[i,l-t[1]]}(e,t,i,n),o=Y(e,t),s=Y(r,e),l=Y(r,t),d=iE({datas:a,distX:r[0],distY:r[1]});return{offset:[d[0],d[1]],isOutside:s>o||l>o}}function id(e,t){return e.isBound?e.offset:t.isSnap?tX(t).offset:0}function ic(e,t,i,n){void 0===n&&(n=i);var a=t7(ie(e),n.vertical,n.horizontal),r=a.horizontal,o=a.vertical,s=t?{horizontal:{isSnap:!1,index:-1},vertical:{isSnap:!1,index:-1}}:tK(e,i.vertical,i.horizontal),l=s.horizontal,d=s.vertical,c=id(r[0],l),u=id(o[0],d),p=Math.abs(c),h=Math.abs(u);return{horizontal:{isBound:r[0].isBound,isSnap:l.isSnap,snapIndex:l.index,offset:c,dist:p,bounds:r,snap:l},vertical:{isBound:o[0].isBound,isSnap:d.isSnap,snapIndex:d.index,offset:u,dist:h,bounds:o,snap:d}}}function iu(e,t,i,n,a){var r=t7(t,i,n),o=r.horizontal,s=r.vertical,l=tq(e,i,n,a),d=l.horizontal,c=l.vertical,u=id(o[0],d),p=id(s[0],c),h=Math.abs(u),m=Math.abs(p);return{horizontal:{isBound:o[0].isBound,isSnap:d.isSnap,snapIndex:d.index,offset:u,dist:h,bounds:o,snap:d},vertical:{isBound:s[0].isBound,isSnap:c.isSnap,snapIndex:c.index,offset:p,dist:m,bounds:s,snap:c}}}function ip(e,t){return e.isBound?e.offset:t.isSnap?t.offset:0}function ih(e){var t=e.state;if(!t.guidelines||!t.guidelines.length){var i=e.state.container,n=e.props.snapContainer||i,a=t.containerClientRect,r={left:0,top:0,bottom:0,right:0};if(i!==n){var o=nx(n,!0);if(o){var s=i7(o),l=nv(t,[s.left-a.left,s.top-a.top]),d=nv(t,[s.right-a.right,s.bottom-a.bottom]);r.left=X(l[0],.1),r.top=X(l[1],.1),r.right=X(d[0],.1),r.bottom=X(d[1],.1)}}t.snapOffset=r,t.guidelines=tZ(e),t.enableSnap=!0}}function im(e,t,i,n,a,r){var o=iQ(e,t,i,r?4:3),s=iM(o,n);return nt(o,eu(a,s))}function ig(e,t,i,n,a,r,o,s){for(var l=ni(e.state),d=e.props.keepRatio,c=0,u=0,p=0;p<2;++p){var h=function(e,t,i,n,a,r){var o=function(e,t,i){var n=[];if(i)1!==Math.abs(t[0])||1!==Math.abs(t[1])?n.push([t,[-1,-1]],[t,[-1,1]],[t,[1,-1]],[t,[1,1]]):n.push([t,[e[0],-e[1]]],[t,[-e[0],e[1]]]),n.push([t,e]);else if(e[0]&&e[1]||!e[0]&&!e[1]){var a=e[0]?e:[1,1];[1,-1].forEach(function(e){[1,-1].forEach(function(i){var r=[e*a[0],i*a[1]];(t[0]!==r[0]||t[1]!==r[1])&&n.push([t,r])})})}else if(e[0]){var r=1===Math.abs(t[0])?[1]:[1,-1];r.forEach(function(i){n.push([[t[0],-1],[i*e[0],-1]],[[t[0],0],[i*e[0],0]],[[t[0],1],[i*e[0],1]])})}else if(e[1]){var r=1===Math.abs(t[1])?[1]:[1,-1];r.forEach(function(i){n.push([[-1,t[1]],[-1,i*e[1]]],[[0,t[1]],[0,i*e[1]]],[[1,t[1]],[1,i*e[1]]])})}return n}(i,r.fixedDirection,n),s=t9(e,t,i,n),l=tg(tg([],o.map(function(i){var o,s,l,d,c,u,p,h,m,g,f,b,x=i[0],y=i[1],v=iM(t,x),C=iM(t,y),w=n?function(e,t,i,n){var a=function(e,t,i){var n=ie(e),a=n.left,r=n.top,o=n.right,s=n.bottom,l=i[0],d=i[1],c=eu(i,t),u=c[0],p=c[1];1e-7>Math.abs(u)&&(u=0),1e-7>Math.abs(p)&&(p=0);var h=p>0,m=u>0,g={isBound:!1,offset:0,pos:0},f={isBound:!1,offset:0,pos:0};if(0===u&&0===p);else if(0===u)h?sd&&(f.pos=r,f.offset=d-r);else if(0===p)m?ol&&(g.pos=a,g.offset=l-a);else{var b=p/u,x=i[1]-b*l,y=0,v=0,C=!1;m&&o<=l?(y=b*o+x,v=o,C=!0):!m&&l<=a&&(y=b*a+x,v=a,C=!0),C&&(ys)&&(C=!1),C||(h&&s<=d?(v=((y=s)-x)/b,C=!0):!h&&d<=r&&(v=((y=r)-x)/b,C=!0)),C&&(g.isBound=!0,g.pos=v,g.offset=l-v,f.isBound=!0,f.pos=y,f.offset=d-y)}return{vertical:g,horizontal:f}}(e,t,i),r=a.horizontal,o=a.vertical,s=n?{horizontal:{isSnap:!1},vertical:{isSnap:!1}}:function(e,t,i){var n=i[0],a=i[1],r=t[0],o=t[1],s=eu(i,t),l=s[0],d=s[1],c=d>0,u=l>0;l=nf(l),d=nf(d);var p={isSnap:!1,offset:0,pos:0},h={isSnap:!1,offset:0,pos:0};if(0===l&&0===d)return{vertical:p,horizontal:h};var m=tK(e,l?[n]:[],d?[a]:[]),g=m.vertical,f=m.horizontal;g.posInfos.filter(function(e){var t=e.pos;return u?t>=r:t<=r}),f.posInfos.filter(function(e){var t=e.pos;return c?t>=o:t<=o}),g.isSnap=g.posInfos.length>0,f.isSnap=f.posInfos.length>0;var b=tX(g),x=b.isSnap,y=b.guideline,v=tX(f),C=v.isSnap,w=v.guideline,S=C?w.pos[1]:0,k=x?y.pos[0]:0;if(0===l)C&&(h.isSnap=!0,h.pos=w.pos[1],h.offset=a-h.pos);else if(0===d)x&&(p.isSnap=!0,p.pos=k,p.offset=n-k);else{var A=d/l,E=i[1]-A*n,_=0,I=0,M=!1;x?(_=A*(I=k)+E,M=!0):C&&(I=((_=S)-E)/A,M=!0),M&&(p.isSnap=!0,p.pos=I,p.offset=n-I,h.isSnap=!0,h.pos=_,h.offset=a-_)}return{vertical:p,horizontal:h}}(e,t,i),l=s.horizontal,d=s.vertical,c=ip(r,l),u=ip(o,d),p=Math.abs(c),h=Math.abs(u);return{horizontal:{isBound:r.isBound,isSnap:l.isSnap,offset:c,dist:p},vertical:{isBound:o.isBound,isSnap:d.isSnap,offset:u,dist:h}}}(e,v,C,a):ic(e,a,{vertical:[C[0]],horizontal:[C[1]]}),S=w.horizontal,k=S.offset,A=S.isBound,E=S.isSnap,_=w.vertical,I=_.offset,M=_.isBound,T=_.isSnap,L=eu(y,x);if(!I&&!k)return{isBound:M||A,isSnap:T||E,sign:L,offset:[0,0]};var j=(o=K(v,C)/Math.PI*180,l=(s=w.vertical).isBound,d=s.isSnap,c=s.dist,p=(u=w.horizontal).isBound,h=u.isSnap,m=u.dist,f=(g=o%180)<3||g>177,b=g>87&&g<93,mMath.abs(p-360)||2>Math.abs(p-180))&&(h[1]=n[1]);var g=il(n,h,(n[1]Math.abs(p-90)||2>Math.abs(p-270))&&(h[0]=n[0]);var C=il(n,h,(n[0]-1||t.push(i)})}),t}function ix(e,t,i,n,a,r){var o=t7(ie(e,r),t,i),s=o.vertical,l=o.horizontal;s.forEach(function(e){e.isBound&&n.push({type:"bounds",pos:e.pos})}),l.forEach(function(e){e.isBound&&a.push({type:"bounds",pos:e.pos})});var d=function(e){var t=e.props.innerBounds;if(!t)return{vertical:[],horizontal:[]};var i=e.getRect(),n=[i.pos1,i.pos2,i.pos3,i.pos4],a=iM(n,[0,0]),r=t.left,o=t.top,s=t.width,l=t.height,d=[[r,o],[r,o+l]],c=[[r,o],[r+s,o]],u=[[r+s,o],[r+s,o+l]],p=[[r,o+l],[r+s,o+l]],h=t9(e,n,[0,0],!1),m=[],g=[],f={top:!1,bottom:!1,left:!1,right:!1};return h.forEach(function(e){var t=e.line,i=e.lineConstants,n=t1(a,t),h=n.horizontal,b=n.vertical,x=t4(t,i,c,b,1,!0),y=t4(t,i,p,b,1,!0),v=t4(t,i,d,h,1,!0),C=t4(t,i,u,h,1,!0);x.isBound&&!f.top&&(m.push(o),f.top=!0),y.isBound&&!f.bottom&&(m.push(o+l),f.bottom=!0),v.isBound&&!f.left&&(g.push(r),f.left=!0),C.isBound&&!f.right&&(g.push(r+s),f.right=!0)}),{horizontal:m,vertical:g}}(e),c=d.vertical,u=d.horizontal;c.forEach(function(e){F(n,function(t){var i=t.type,n=t.pos;return"bounds"===i&&n===e})>=0||n.push({type:"bounds",pos:e})}),u.forEach(function(e){F(a,function(t){var i=t.type,n=t.pos;return"bounds"===i&&n===e})>=0||a.push({type:"bounds",pos:e})})}var iy={name:"draggable",props:{draggable:Boolean,throttleDrag:Number,throttleDragRotate:Number,startDragRotate:Number,edgeDraggable:Boolean},events:{onDragStart:"dragStart",onDrag:"drag",onDragEnd:"dragEnd",onDragGroupStart:"dragGroupStart",onDragGroup:"dragGroup",onDragGroupEnd:"dragGroupEnd"},render:function(e,t){var i=e.props,n=i.throttleDragRotate,a=i.zoom,r=e.state,o=r.dragInfo,s=r.beforeOrigin;if(!n||!o)return[];var l=o.dist;if(!l[0]&&!l[1])return[];var d=i1(l),c=K(l,[0,0]);return[t.createElement("div",{className:iH("line","horizontal","dragline","dashed"),key:"dragRotateGuideline",style:{width:"".concat(d,"px"),transform:"translate(".concat(s[0],"px, ").concat(s[1],"px) rotate(").concat(c,"rad) scaleY(").concat(a,")")}})]},dragStart:function(e,t){var i=t.datas,n=t.parentEvent,a=t.parentGesto,r=e.state,o=r.target;if(r.gesto)return!1;r.gesto=a||e.targetGesto;var s=nl(o);i.datas={},i.left=parseFloat(s.left||"")||0,i.top=parseFloat(s.top||"")||0,i.bottom=parseFloat(s.bottom||"")||0,i.right=parseFloat(s.right||"")||0,i.startValue=[0,0],iC(e,t),ij(t,"translate"),i.absolutePoses=ni(e.state),i.prevDist=[0,0],i.prevBeforeDist=[0,0],i.isDrag=!1,i.deltaOffset=[0,0];var l=na(e,t,tm({set:function(e){i.startValue=e}},iL(t)));return!1!==(n||ns(e,"onDragStart",l))?(i.isDrag=!0,e.state.dragInfo={startRect:e.getRect(),dist:[0,0]}):(r.gesto=null,i.isPinch=!1),!!i.isDrag&&l},drag:function(e,t){if(t){iw(t,"translate");var i=t.datas,n=t.parentEvent,a=t.parentFlag,r=t.isPinch,o=t.isRequest,s=t.deltaOffset,l=t.distX,d=t.distY,c=i.isDrag,u=i.prevDist,p=i.prevBeforeDist,h=i.startValue;if(c){s&&(l+=s[0],d+=s[1]);var m,g,f,b=e.props,x=b.parentMoveable,y=n?0:b.throttleDrag||0,v=n?0:b.throttleDragRotate||0,C=!1,w=0;if(!n&&v>0&&(l||d)){var S=b.startDragRotate||0,k=X(S+180*K([0,0],[l,d])/Math.PI,v)-S,A=d*Math.abs(Math.cos((k-90)/180*Math.PI)),E=i1([l*Math.abs(Math.cos(k/180*Math.PI)),A]);l=E*Math.cos(w=k*Math.PI/180),d=E*Math.sin(w)}if(!r&&!n&&!a&&(!v||l||d)){var _=function(e,t,i,n,a,r){if(!tU(e,"draggable"))return[{isSnap:!1,isBound:!1,offset:0},{isSnap:!1,isBound:!1,offset:0}];var o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A=nt(r.absolutePoses,[t,i]),E=iJ(A),_=E.left,I=E.right,M=E.top,T=E.bottom,L={horizontal:A.map(function(e){return e[1]}),vertical:A.map(function(e){return e[0]})},j=tG(tV(e.props.snapDirections),{left:_,right:I,top:M,bottom:T,center:(_+I)/2,middle:(M+T)/2}),P=ic(e,a,j,L),D=P.vertical,N=P.horizontal,R=(b=t9(e,A,[0,0],!1).map(function(e){return tm(tm({},e),{multiple:e.multiple.map(function(e){return 2*Math.abs(e)})})}),y=t0(x=t6(e,b,r),0),v=t0(x,1),C=0,w=0,S=y.isVerticalBound||v.isVerticalBound,k=y.isHorizontalBound||v.isHorizontalBound,(S||k)&&(C=(s=(o={datas:r,distX:-y.offset[0],distY:-v.offset[1]}).datas,l=o.distX,d=o.distY,c=s.beforeMatrix,u=s.matrix,p=s.is3d,h=s.startDragBeforeDist,m=s.startDragDist,g=s.absoluteOrigin,f=eu(eh(u,ec(m,[l,d]),p?4:3),g))[0],w=f[1]),{vertical:{isBound:S,offset:C},horizontal:{isBound:k,offset:w}}),O=R.vertical,B=R.horizontal,z=D.isSnap,F=N.isSnap,H=D.isBound||O.isBound,W=N.isBound||B.isBound,U=function(e,t,i,n,a){var r=t[0],o=t[1],s=i[0],l=i[1],d=n[0],c=n[1],u=a[0],p=a[1],h=-u,m=-p;if(e&&r&&o){h=0,m=0;var g=[];if(s&&l?g.push([0,p],[u,0]):s?g.push([u,0]):l?g.push([0,p]):d&&c?g.push([0,p],[u,0]):d?g.push([u,0]):c&&g.push([0,p]),g.length){g.sort(function(e,t){return i1(eu([r,o],e))-i1(eu([r,o],t))});var f=g[0];if(f[0]&&Math.abs(r)>1e-7?m=o*Math.abs(r+(h=-f[0]))/Math.abs(r)-o:f[1]&&Math.abs(o)>1e-7&&(h=r*Math.abs(o+(m=-f[1]))/Math.abs(o)-r),e&&l&&s)if(Math.abs(h)>1e-7&&Math.abs(h)1e-7&&Math.abs(m)=0&&(e[0]>=0&&t.push(3),e[0]<=0&&t.push(2)),e[1]<=0&&(e[0]>=0&&t.push(1),e[0]<=0&&t.push(0)),t}function iI(e,t){return i_(t).map(function(t){return e[t]})}function iM(e,t){var i=iI(e,t);return[Z(i.map(function(e){return e[0]})),Z(i.map(function(e){return e[1]}))]}function iT(e,t,i,n){return ed(e,iW(t,n,i),n)}function iL(e){var t=e.originalDatas.beforeRenderable;return{setTransform:function(i,n){void 0===n&&(n=-1),t.startTransforms=M(i)?i:N(i),iP(e,n)},setTransformIndex:function(t){iP(e,t)}}}function ij(e,t){var i=e.originalDatas.beforeRenderable.startTransforms;iP(e,F(i,function(e){return 0===e.indexOf("".concat(t,"("))}))}function iP(e,t){var i=e.originalDatas.beforeRenderable,n=e.datas;if(n.transformIndex=t,-1!==t){var a=i.startTransforms[t];a&&(n.startValue=eM([a])[0].functionValue)}}function iD(e,t){e.originalDatas.beforeRenderable.nextTransforms=N(t)}function iN(e){return e.originalDatas.beforeRenderable.nextTransforms.join(" ")}function iR(e,t,i,n,a){return iD(a,t),{transform:t,drag:iy.drag(e,tE(a,e.state,i,n,!1))}}function iO(e,t,i,n,a){var r,o,s,l,d,c,u,p=e.state,h=p.left,m=p.top,g=e.props.groupable,f=(r=e.state,o=r.transformOrigin,s=r.offsetMatrix,l=r.is3d,d=a.beforeTransform,c=a.afterTransform,u=l?4:3,iT(s,es(ed(ed(d,e_([t]),4),c,4),4,u),o,u)),b=eu(n,iz(e,i,f));return eu(b,[g?h:0,g?m:0])}function iB(e){var t=e.state,i=t.width,n=t.height,a=t.transformOrigin;return[-1+a[0]/(i/2),-1+a[1]/(n/2)]}function iz(e,t,i){void 0===i&&(i=e.state.allMatrix);var n=e.state,a=n.width,r=n.height,o=n.is3d;return iX(i,[a/2*(1+t[0]),r/2*(1+t[1])],o?4:3)}function iF(e,t){return iM(ni(e.state),t)}function iH(){for(var e=[],t=0;t9),"".concat(t?"matrix3d":"matrix","(").concat(ep(e,!t).join(","),")")}function iY(e){var t=e.clientWidth,i=e.clientHeight;if(!e)return{x:0,y:0,width:0,height:0,clientWidth:t,clientHeight:i};var n=e.viewBox,a=n&&n.baseVal||{x:0,y:0,width:0,height:0};return{x:a.x,y:a.y,width:a.width||t,height:a.height||i,clientWidth:t,clientHeight:i}}function iX(e,t,i){return eh(e,eo(t,i),i)}function iQ(e,t,i,n){return[[0,0],[t,0],[0,i],[t,i]].map(function(t){return iX(e,t,n)})}function iJ(e){var t=e.map(function(e){return e[0]}),i=e.map(function(e){return e[1]}),n=Math.min.apply(Math,t),a=Math.min.apply(Math,i),r=Math.max.apply(Math,t),o=Math.max.apply(Math,i);return{left:n,top:a,right:r,bottom:o,width:r-n,height:o-a}}function i0(e,t,i,n){var a=16===e.length?4:3,r=iQ(e,i,n,a),o=r[0],s=o[0],l=o[1],d=r[1],c=d[0],u=d[1],p=r[2],h=p[0],m=p[1],g=r[3],f=g[0],b=g[1],x=iX(e,t,a),y=x[0],v=x[1],C=Math.min(s,c,h,f),w=Math.min(l,u,m,b),S=Math.max(s,c,h,f),k=Math.max(l,u,m,b);return s=s-C||0,c=c-C||0,h=h-C||0,f=f-C||0,l=l-w||0,u=u-w||0,m=m-w||0,b=b-w||0,y=y-C||0,v=v-w||0,{left:C,top:w,right:S,bottom:k,origin:[y,v],pos1:[s,l],pos2:[c,u],pos3:[h,m],pos4:[f,b],direction:q(r)}}function i1(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function i2(e,t){return i1([t[0]-e[0],t[1]-e[1]])}function i3(e,t,i,n){void 0===i&&(i=1),void 0===n&&(n=K(e,t));var a=i2(e,t);return{transform:"translateY(-50%) translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(n,"rad) scaleY(").concat(i,")"),width:"".concat(a,"px")}}function i5(e,t){for(var i=[],n=2;n0?e[0]:e[1],t>0?e[1]:e[0])}function i9(e,t,i,n,a){var r=1,o=[0,0],s=i8(),l=i8(),d=i8(),c=function(e,t,i,n){void 0===i&&(i=t);var a=0,r=0,o=0,s={};if(e){var l=i4(e),d=l.offsetWidth,c=l.offsetHeight;a=d,r=c}if(e){var u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E,_,I,M,T,L,j,P,D,N,R,O,B,z,F,H=(u=e,p=t,h=i,m=n,void 0===h&&(h=p),b=(f=iK(u,p)).matrixes,x=f.is3d,y=f.targetMatrix,v=f.transformOrigin,C=f.targetOrigin,w=f.offsetContainer,S=f.hasFixed,A=(k=iK(w,h,!0)).matrixes,E=k.is3d,I=(_=m||E||x)?4:3,M="svg"!==u.tagName.toLowerCase()&&"ownerSVGElement"in u,T=y,L=ew(I),j=ew(I),P=ew(I),D=ew(I),N=b.length,A.reverse(),b.reverse(),!x&&_&&(T=es(T,3,4),iZ(b)),!E&&_&&iZ(A),A.forEach(function(e){j=ed(j,e.matrix,I)}),R=h||document.body,O=(null==(g=A[0])?void 0:g.target)||iG(R,R,!0).offsetParent,B=A.slice(1).reduce(function(e,t){return ed(e,t.matrix,I)},ew(I)),b.forEach(function(e,t){if(N-2===t&&(P=L.slice()),N-1===t&&(D=L.slice()),!e.matrix){var i=function(e,t,i,n,a){var r,o=e.target,s=e.origin,l=t.matrix,d=i4(o),c=d.offsetWidth,u=d.offsetHeight,p=i.getBoundingClientRect(),h=[0,0];i===document.body&&(h=i$(o,!0));for(var m=o.getBoundingClientRect(),g=m.left-p.left+i.scrollLeft-(i.clientLeft||0)+h[0],f=m.top-p.top+i.scrollTop-(i.clientTop||0)+h[1],b=m.width,x=m.height,y=el(n,a,l),v=iJ(iQ(y,c,u,n)),C=v.left,w=v.top,S=v.width,k=v.height,A=iX(y,s,n),E=eu(A,[C,w]),_=[g+E[0]*b/S,f+E[1]*x/k],I=[0,0],M=0;++M<10;){var T=er(a,n);r=eu(iX(T,_,n),iX(T,A,n)),I[0]=r[0],I[1]=r[1];var L=iJ(iQ(el(n,a,ek(I,n),l),c,u,n)),j=L.left,P=L.top,D=j-g,N=P-f;if(2>Math.abs(D)&&2>Math.abs(N))break;_[0]-=D,_[1]-=N}return I.map(function(e){return Math.round(e)})}(e,b[t+1],O,I,ed(B,L,I));e.matrix=ek(i,I)}L=ed(L,e.matrix,I)}),z=!M&&x,T||(T=ew(z?4:3)),F=iq(M&&16===T.length?es(T,4,3):T,z),{hasFixed:S,rootMatrix:j=ea(j,I,I),beforeMatrix:P,offsetMatrix:D,allMatrix:L,targetMatrix:T,targetTransform:F,transformOrigin:v,targetOrigin:C,is3d:_}),W=i0(H.allMatrix,H.transformOrigin,a,r);s=tm(tm({},H),W);var U=i0(H.allMatrix,[50,50],100,100);o=i6([U.pos1,U.pos2],U.direction)}var V=n?4:3;return tm({width:a,height:r,rotation:o,rootMatrix:ew(V),beforeMatrix:ew(V),offsetMatrix:ew(V),allMatrix:ew(V),targetMatrix:ew(V),targetTransform:"",transformOrigin:[0,0],targetOrigin:[0,0],is3d:!!n,left:0,top:0,right:0,bottom:0,origin:[0,0],pos1:[0,0],pos2:[0,0],pos3:[0,0],pos4:[0,0],direction:1,hasFixed:!1},s)}(t,i,a,!1);if(t){var u=c.is3d?4:3,p=i0(c.offsetMatrix,ec(c.transformOrigin,function(e,t){void 0===t&&(t=Math.sqrt(e.length));for(var i=[],n=e[t*t-1],a=0;a-1&&(i[0]=-1),t.indexOf("e")>-1&&(i[0]=1),t.indexOf("n")>-1&&(i[1]=-1),t.indexOf("s")>-1&&(i[1]=1),i}}}function nt(e,t){return[ec(t,e[0]),ec(t,e[1]),ec(t,e[2]),ec(t,e[3])]}function ni(e){var t=e.left,i=e.top;return nt([e.pos1,e.pos2,e.pos3,e.pos4],[t,i])}function nn(e,t){var i;null==(i=e[t])||i.unset(),e[t]=null}function na(e,t,i,n){var a=t.datas;a.datas||(a.datas={});var r=tm(tm({},i),{target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,moveable:e,datas:a.datas});return a.isStartEvent?n||(a.lastEvent=r):a.isStartEvent=!0,r}function nr(e,t,i){var n=t.datas,a="isDrag"in i?i.isDrag:t.isDrag;return n.datas||(n.datas={}),tm(tm({isDrag:a},i),{moveable:e,target:e.state.target,clientX:t.clientX,clientY:t.clientY,inputEvent:t.inputEvent,currentTarget:e,lastEvent:n.lastEvent,isDouble:t.isDouble,datas:n.datas})}function no(e,t,i){e._emitter.on(t,i)}function ns(e,t,i,n){return e.triggerEvent(t,i,n)}function nl(e,t){return window.getComputedStyle(e,t)}function nd(e,t,i){var n={},a={};return e.filter(function(e){var r=e.name;if(n[r]||!t.some(function(t){return e[t]}))return!1;if(!i&&e.ableGroup){if(a[e.ableGroup])return!1;a[e.ableGroup]=!0}return n[r]=!0,!0})}function nc(e,t){return e===t||null==e&&null==t}function nu(){for(var e=[],t=0;t=Math.abs(e)?0:e}function nb(e,t){if(t.isRequest)if("resizable"===t.requestAble||"scalable"===t.requestAble)return t.parentDirection;else return!1;return J(t.inputEvent.target,iH("direction"))}function nx(e,t){return e?T(e)?t?document.querySelector(e):e:j(e)?e():"current"in e?e.current:e:null}function ny(e,t){return e?(!(!e||!I(e)||e instanceof Element)&&(M(e)||"length"in e)?[].slice.call(e):[e]).reduce(function(e,i){return T(i)&&t?tg(tg([],e,!0),[].slice.call(document.querySelectorAll(i)),!0):(e.push(nx(i,t)),e)},[]):[]}function nv(e,t){var i,n,a=e.rootMatrix,r=e.is3d,o=er(a,r?4:3);return r||(o=es(o,3,4)),o[12]=0,o[13]=0,o[14]=0,n=(i=eh(o,[t[0],t[1]||0,t[2]||0,1],4))[3]||1,[i[0]/n,i[1]/n,i[2]/n]}function nC(e,t,i,n,a){var r=e[0],o=e[1],s=0,l=0;if(a&&r&&o){var d=Math.cos(K([0,0],t)-K([0,0],n))*i1(t);if(n[0])if(n[1]){var c=2*n[0]*r,u=2*n[1]*o,p=i1([c+t[0],u+t[1]])-i1([c,u]),h=K([0,0],[i,1]);s=Math.cos(h)*p,l=Math.sin(h)*p}else l=(s=d)/i;else s=(l=d)*i}else s=n[0]*t[0],l=n[1]*t[1];return[s,l]}function nw(e,t,i,n){var a,r=i.ratio,o=i.startOffsetWidth,s=i.startOffsetHeight,l=0,d=0,c=n.distX,u=n.distY,p=n.parentDistance,h=n.parentDist,m=n.parentScale,g=n.isPinch,f=i.fixedDirection;if(h)l=h[0],d=h[1],t&&(l?d||(d=l/r):l=d*r);else if(m)l=(m[0]-1)*o,d=(m[1]-1)*s;else if(g)p&&(l=p,d=p*s/o);else{var b=iE({datas:i,distX:c,distY:u});l=(a=nC([o,s],b=[0,1].map(function(t){var i=Math.abs(e[t]-f[t]);return 0!==i&&(i=2/i),b[t]*i}),r,e,t))[0],d=a[1]}return{distWidth:l,distHeight:d}}var nS=tf("pinchable",{events:{onPinchStart:"pinchStart",onPinch:"pinch",onPinchEnd:"pinchEnd",onPinchGroupStart:"pinchGroupStart",onPinchGroup:"pinchGroup",onPinchGroupEnd:"pinchGroupEnd"},dragStart:function(){return!0},pinchStart:function(e,t){var i=t.datas,n=t.targets,a=t.angle,r=t.originalDatas,o=e.props,s=o.pinchable,l=o.ables;if(!s)return!1;var d="drag".concat(n?"Group":"","ControlStart"),c=(!0===s?e.controlAbles:l.filter(function(e){return s.indexOf(e.name)>-1})).filter(function(e){return e.canPinch&&e[d]}),u=na(e,t,{});n&&(u.targets=n),i.isPinch=!1!==ns(e,"onPinch".concat(n?"Group":"","Start"),u),i.ables=c;var p=i.isPinch;return!!p&&(c.forEach(function(i){if(r[i.name]=r[i.name]||{},i[d]){var n=tm(tm({},t),{datas:r[i.name],parentRotate:a,isPinch:!0});i[d](e,n)}}),e.state.snapRenderInfo={request:t.isRequest,direction:[0,0]},p)},pinch:function(e,t){var i=t.datas,n=t.scale,a=t.distance,r=t.originalDatas,o=t.inputEvent,s=t.targets,l=t.angle;if(i.isPinch){var d=a*(1-1/n),c=na(e,t,{});s&&(c.targets=s),ns(e,"onPinch".concat(s?"Group":""),c);var u=i.ables,p="drag".concat(s?"Group":"","Control");return u.forEach(function(i){i[p]&&i[p](e,tm(tm({},t),{datas:r[i.name],inputEvent:o,parentDistance:d,parentRotate:l,isPinch:!0}))}),c}},pinchEnd:function(e,t){var i=t.datas,n=t.isPinch,a=t.inputEvent,r=t.targets,o=t.originalDatas;if(i.isPinch){var s=nr(e,t,{isDrag:n});r&&(s.targets=r),ns(e,"onPinch".concat(r?"Group":"","End"),s);var l=i.ables,d="drag".concat(r?"Group":"","ControlEnd");return l.forEach(function(i){i[d]&&i[d](e,tm(tm({},t),{isDrag:n,datas:o[i.name],inputEvent:a,isPinch:!0}))}),n}},pinchGroupStart:function(e,t){return this.pinchStart(e,tm(tm({},t),{targets:e.props.targets}))},pinchGroup:function(e,t){return this.pinch(e,tm(tm({},t),{targets:e.props.targets}))},pinchGroupEnd:function(e,t){return this.pinchEnd(e,tm(tm({},t),{targets:e.props.targets}))}}),nk={name:"resizable",ableGroup:"size",canPinch:!0,props:{resizable:Boolean,throttleResize:Number,renderDirections:Array,keepRatio:Boolean,resizeFormat:Function},events:{onResizeStart:"resizeStart",onBeforeResize:"beforeResize",onResize:"resize",onResizeEnd:"resizeEnd",onResizeGroupStart:"resizeGroupStart",onBeforeResizeGroup:"beforeResizeGroup",onResizeGroup:"resizeGroup",onResizeGroupEnd:"resizeGroupEnd"},render:function(e,t){var i=e.props,n=i.resizable,a=i.edge;if(n)return a?tP(e,t):tL(e,tw,t)},dragControlCondition:nb,dragControlStart:function(e,t){var i,n,a=t.inputEvent,r=t.isPinch,o=t.parentDirection,s=t.datas,l=t.parentFlag,d=o||(r?[0,0]:ne(a.target)),c=e.state,u=c.target,p=c.width,h=c.height;if(!d||!u)return!1;r||iC(e,t),s.datas={},s.direction=d,s.startOffsetWidth=p,s.startOffsetHeight=h,s.prevWidth=0,s.prevHeight=0,s.startWidth=(n=[parseFloat((i=nl(u)).width),parseFloat(i.height)])[0],s.startHeight=n[1];var m=[Math.max(0,p-s.startWidth),Math.max(0,h-s.startHeight)];if(s.minSize=m,s.maxSize=[1/0,1/0],!l){var g=nl(u),f=g.position,b=g.minWidth,x=g.minHeight,y=g.maxWidth,v=g.maxHeight,C="static"===f||"relative"===f,w=C?u.parentElement:u.offsetParent,S=p,k=h;if(w&&(S=w.clientWidth,k=w.clientHeight,C)){var A=nl(w);S-=parseFloat(A.paddingLeft)||0,k-=parseFloat(A.paddingTop)||0}s.minSize=ec([G(b,S)||0,G(x,k)||0],m),s.maxSize=ec([G(y,S)||1/0,G(v,k)||1/0],m)}var E=e.props.transformOrigin||"% %";function _(e){s.ratio=e&&isFinite(e)?e:0}function I(e){s.fixedDirection=e,s.fixedPosition=iM(s.startPositions,e)}s.transformOrigin=E&&T(E)?E.split(" "):E,s.isWidth=!d[0]&&!d[1]||d[0]||!d[1],s.startPositions=ni(e.state),_(p/h),I([-d[0],-d[1]]),s.setFixedDirection=I;var M=na(e,t,{direction:d,set:function(e){var t=e[0],i=e[1];s.startWidth=t,s.startHeight=i},setMin:function(e){s.minSize=[G("".concat(e[0]),0)||0,G("".concat(e[1]),0)||0]},setMax:function(e){var t=[e[0]||1/0,e[1]||1/0];(!L(t[0])||isFinite(t[0]))&&(t[0]=G("".concat(t[0]),0)||1/0),(!L(t[1])||isFinite(t[1]))&&(t[1]=G("".concat(t[1]),0)||1/0),s.maxSize=t},setRatio:_,setFixedDirection:I,setOrigin:function(e){s.transformOrigin=e},dragStart:iy.dragStart(e,new t_().dragStart([0,0],t))});return!1!==ns(e,"onResizeStart",M)&&(s.isResize=!0,e.state.snapRenderInfo={request:t.isRequest,direction:d}),!!s.isResize&&M},dragControl:function(e,t){var i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S=t.datas,k=t.parentFlag,A=t.isPinch,E=t.parentKeepRatio,_=t.dragClient,I=t.parentDist,M=t.isRequest,T=S.isResize,L=S.transformOrigin,j=S.startWidth,P=S.startHeight,D=S.prevWidth,N=S.prevHeight,R=S.minSize,O=S.maxSize,z=S.ratio,F=S.isWidth,H=S.startOffsetWidth,W=S.startOffsetHeight;if(T){var U=e.props,V=U.resizeFormat,G=U.throttleResize,Z=void 0===G?1:G,K=U.parentMoveable,q=S.direction,Y=q,Q=0,J=0;q[0]||q[1]||(Y=[1,1]);var ee=z&&(null!=E?E:U.keepRatio)||!1,et=ec(),ei=et[0],en=et[1];S.setFixedDirection(S.fixedDirection),ns(e,"onBeforeResize",na(e,t,{setFixedDirection:function(e){var t;return S.setFixedDirection(e),ei=(t=ec())[0],en=t[1],[ei,en]},boundingWidth:ei,boundingHeight:en,setSize:function(e){ei=e[0],en=e[1]}},!0));var ea=_;_||(ea=!k&&A?iF(e,[0,0]):S.fixedPosition);var er=[0,0];if(A||(er=function(e,t,i,n,a,r,o){if(!tU(e,"resizable"))return[0,0];var s=o.fixedDirection,l=e.state,d=l.allMatrix,c=l.is3d;return ig(e,function(e,n){return im(d,t+e,i+n,s,a,c)},t,i,n,a,r,o)}(e,ei,en,q,ea,M,S)),I&&(I[0]||(er[0]=0),I[1]||(er[1]=0)),ee){Y[0]&&Y[1]&&er[0]&&er[1]&&(Math.abs(er[0])>Math.abs(er[1])?er[1]=0:er[0]=0);var eo=!er[0]&&!er[1];eo&&ep(),Y[0]&&!Y[1]||er[0]&&!er[1]||eo&&F?(ei+=er[0],en=ei/z):(!Y[0]&&Y[1]||!er[0]&&er[1]||eo&&!F)&&(en+=er[1],ei=en*z)}else ei+=er[0],en+=er[1],ei=Math.max(0,ei),en=Math.max(0,en);ei=(w=function(e,t,i,n){if(!n)return e.map(function(e,n){return Math.max(t[n],Math.min(e,i[n]))});var a=e[0],r=e[1],o=!0===n?a/r:n,s=$(e,t,!1,o),l=s[0],d=s[1],c=$(e,i,!0,o),u=c[0],p=c[1];return au||r>p)&&(a=u,r=p),[a,r]}([ei,en],R,O,z))[0],en=w[1],ep();var es=[(Q=ei-H)-D,(J=en-W)-N];S.prevWidth=Q,S.prevHeight=J;var el=(i=ei,n=en,a=S.fixedDirection,r=ea,o=e.props.groupable,l=(s=e.state).transformOrigin,d=s.targetMatrix,c=s.offsetMatrix,u=s.is3d,p=s.width,h=s.height,m=s.left,g=s.top,f=u?4:3,eu((v=iT(c,d,(b=p,x=h,y=l,(void 0===b&&(b=i),void 0===x&&(x=n),void 0===y&&(y=[0,0]),L)?L.map(function(e,t){var a=B(e),r=a.value,o=a.unit,s=t?x:b,l=t?n:i;return"%"===e||isNaN(r)?l*(s?y[t]/s:0):"%"!==o?r:l*r/100}):y),f),C=iM(iQ(v,i,n,f),a),[r[0]-C[0],r[1]-C[1]]),[o?m:0,o?g:0]));if(!(!K&&es.every(function(e){return!e})&&el.every(function(e){return!e}))){var ed=na(e,t,{width:j+Q,height:P+J,offsetWidth:Math.round(ei),offsetHeight:Math.round(en),boundingWidth:ei,boundingHeight:en,direction:q,dist:[Q,J],delta:es,isPinch:!!A,drag:iy.drag(e,tE(t,e.state,el,!!A,!1))});return ns(e,"onResize",ed),ed}}function ec(){var e=nw(Y,ee,S,t);Q=e.distWidth,J=e.distHeight;var i=Y[0]||ee?Math.max(H+Q,1e-7):H,n=Y[1]||ee?Math.max(W+J,1e-7):W;return ee&&H&&W&&(F?n=i/z:i=n*z),[i,n]}function ep(){var e;V&&(ei=(e=V([ei,en]))[0],en=e[1]),ei=X(ei,Z),en=X(en,Z)}},dragControlAfter:function(e,t){var i=t.datas,n=i.isResize,a=i.startOffsetWidth,r=i.startOffsetHeight,o=i.prevWidth,s=i.prevHeight;if(n){var l=e.state,d=l.width,c=l.height,u=d-(a+o),p=c-(r+s),h=Math.abs(u)>3,m=Math.abs(p)>3;if(h&&(i.startWidth+=u,i.startOffsetWidth+=u,i.prevWidth+=u),m&&(i.startHeight+=p,i.startOffsetHeight+=p,i.prevHeight+=p),h||m)return this.dragControl(e,t)}},dragControlEnd:function(e,t){var i=t.datas;if(i.isResize){i.isResize=!1;var n=nr(e,t,{});return ns(e,"onResizeEnd",n),n}},dragGroupControlCondition:nb,dragGroupControlStart:function(e,t){var i=t.datas,n=this.dragControlStart(e,t);if(!n)return!1;var a=tI(e,"resizable",t);function r(t,n){var a=i.fixedDirection,r=i.fixedPosition,o=iM(n.datas.startPositions||ni(t.state),a),s=eh(eC(-e.rotation/180*Math.PI,3),[o[0]-r[0],o[1]-r[1],1],3),l=s[0],d=s[1];return n.datas.originalX=l,n.datas.originalY=d,n}var o=tT(e,this,"dragControlStart",t,function(e,t){return r(e,t)}),s=function(e){n.setFixedDirection(e),o.forEach(function(t,i){t.setFixedDirection(e),r(t.moveable,a[i])})};i.setFixedDirection=s;var l=tm(tm({},n),{targets:e.props.targets,events:o,setFixedDirection:s});return i.isResize=!1!==ns(e,"onResizeGroupStart",l),!!i.isResize&&n},dragGroupControl:function(e,t){var i=t.datas;if(i.isResize){no(e,"onBeforeResize",function(i){ns(e,"onBeforeResizeGroup",na(e,t,tm(tm({},i),{targets:e.props.targets}),!0))});var n=this.dragControl(e,t);if(n){var a=n.boundingWidth,r=n.boundingHeight,o=n.dist,s=e.props.keepRatio,l=[a/(a-o[0]),r/(r-o[1])],d=i.fixedPosition,c=tT(e,this,"dragControl",t,function(t,i){var n=eh(eC(e.rotation/180*Math.PI,3),[i.datas.originalX*l[0],i.datas.originalY*l[1],1],3),a=n[0],r=n[1];return tm(tm({},i),{parentDist:null,parentScale:l,dragClient:ec(d,[a,r]),parentKeepRatio:s})}),u=tm({targets:e.props.targets,events:c},n);return ns(e,"onResizeGroup",u),u}}},dragGroupControlEnd:function(e,t){var i=t.isDrag;if(t.datas.isResize){this.dragControlEnd(e,t);var n=tT(e,this,"dragControlEnd",t),a=nr(e,t,{targets:e.props.targets,events:n});return ns(e,"onResizeGroupEnd",a),i}},request:function(e){var t={},i=0,n=0,a=e.getRect();return{isControl:!0,requestStart:function(e){return{datas:t,parentDirection:e.direction||[1,1]}},request:function(e){return"offsetWidth"in e?i=e.offsetWidth-a.offsetWidth:"deltaWidth"in e&&(i+=e.deltaWidth),"offsetHeight"in e?n=e.offsetHeight-a.offsetHeight:"deltaHeight"in e&&(n+=e.deltaHeight),{datas:t,parentDist:[i,n],parentKeepRatio:e.keepRatio}},requestEnd:function(){return{datas:t,isDrag:!0}}}}};function nA(e,t){return e.map(function(e,i){return(2*e+ +t[i])/3})}function nE(e,t,i){var n=K(e,t),a=K(e,i)-n;return a>=0?a:a+2*Math.PI}var n_=iH("area-pieces"),nI=iH("area-piece"),nM=iH("avoid");function nT(e){var t=e.areaElement;if(t){var i=e.state,n=i.width,a=i.height;if(t.classList)t.classList.remove(nM);else{var r=RegExp("(\\s|^)"+nM+"(\\s|$)");t.className=t.className.replace(r," ")}t.style.cssText+="left: 0px; top: 0px; width: ".concat(n,"px; height: ").concat(a,"px")}}function nL(e){return e.createElement("div",{key:"area_pieces",className:n_},e.createElement("div",{className:nI}),e.createElement("div",{className:nI}),e.createElement("div",{className:nI}),e.createElement("div",{className:nI}))}var nj={name:"dragArea",props:{dragArea:Boolean,passDragArea:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},render:function(e,t){var i=e.props,n=i.target,a=i.dragArea,r=i.groupable,o=i.passDragArea,s=e.state,l=s.width,d=s.height,c=s.renderPoses,u=o?iH("area","pass"):iH("area");if(r)return[t.createElement("div",{key:"area",ref:v(e,"areaElement"),className:u}),nL(t)];if(!n||!a)return[];var p=eA([0,0],[l,0],[0,d],[l,d],c[0],c[1],c[2],c[3]),h=p.length?iq(p,!0):"none";return[t.createElement("div",{key:"area",ref:v(e,"areaElement"),className:u,style:{top:"0px",left:"0px",width:"".concat(l,"px"),height:"".concat(d,"px"),transformOrigin:"0 0",transform:h}}),nL(t)]},dragStart:function(e,t){var i=t.datas,n=t.clientX,a=t.clientY;if(!t.inputEvent)return!1;i.isDragArea=!1;var r=e.areaElement,o=e.state,s=o.moveableClientRect,l=o.renderPoses,d=o.rootMatrix,c=o.is3d,u=s.left,p=s.top,h=iJ(l),m=h.left,g=h.top,f=h.width,b=h.height,x=np(d,[n-u,a-p],c?4:3),y=x[0],v=x[1];y-=m,v-=g;var C=[{left:m,top:g,width:f,height:v-10},{left:m,top:g,width:y-10,height:b},{left:m,top:g+v+10,width:f,height:b-v-10},{left:m+y+10,top:g,width:f-y-10,height:b}],w=[].slice.call(r.nextElementSibling.children);C.forEach(function(e,t){w[t].style.cssText="left: ".concat(e.left,"px;top: ").concat(e.top,"px; width: ").concat(e.width,"px; height: ").concat(e.height,"px;")}),r.classList?r.classList.add(nM):r.className+=" "+nM,o.disableNativeEvent=!0},drag:function(e,t){var i=t.datas,n=t.inputEvent;if(this.enableNativeEvent(e),!n)return!1;i.isDragArea||(i.isDragArea=!0,nT(e))},dragEnd:function(e,t){this.enableNativeEvent(e);var i=t.inputEvent,n=t.datas;if(!i)return!1;n.isDragArea||nT(e)},dragGroupStart:function(e,t){return this.dragStart(e,t)},dragGroup:function(e,t){return this.drag(e,t)},dragGroupEnd:function(e,t){return this.dragEnd(e,t)},unset:function(e){nT(e),e.state.disableNativeEvent=!1},enableNativeEvent:function(e){var t=e.state;t.disableNativeEvent&&W(function(){t.disableNativeEvent=!1})}},nP=tf("origin",{render:function(e,t){var i=e.props.zoom,n=e.state,a=n.beforeOrigin,r=n.rotation;return[t.createElement("div",{className:iH("control","origin"),style:i5(r,i,a),key:"beforeOrigin"})]}});function nD(e){var t=e.scrollContainer;return[t.scrollLeft,t.scrollTop]}var nN={name:"",props:{target:Object,dragTarget:Object,container:Object,portalContainer:Object,rootContainer:Object,useResizeObserver:Boolean,zoom:Number,transformOrigin:Array,edge:Boolean,ables:Array,className:String,pinchThreshold:Number,pinchOutside:Boolean,triggerAblesSimultaneously:Boolean,checkInput:Boolean,cspNonce:String,translateZ:Number,hideDefaultLines:Boolean,props:Object},events:{}},nR=tf("padding",{render:function(e,t){var i=e.props;if(i.dragArea)return[];var n=i.padding||{},a=n.left,r=n.top,o=n.right,s=n.bottom,l=e.state,d=l.renderPoses,c=[l.pos1,l.pos2,l.pos3,l.pos4],u=[];return(void 0===a?0:a)>0&&u.push([0,2]),(void 0===r?0:r)>0&&u.push([0,1]),(void 0===o?0:o)>0&&u.push([1,3]),(void 0===s?0:s)>0&&u.push([2,3]),u.map(function(e,i){var n=e[0],a=e[1],r=eA([0,0],[100,0],[0,100],[100,100],c[n],c[a],d[n],d[a]);if(r.length)return t.createElement("div",{key:"padding".concat(i),className:iH("padding"),style:{transform:iq(r,!0)}})})}}),nO=["nw","ne","se","sw"];function nB(e,t){var i=e[0]+e[1],n=i>t?t/i:1;return e[0]*=n,e[1]=t-e[1]*n,e}var nz=[1,2,5,6],nF=[0,3,4,7],nH=[1,-1,-1,1],nW=[1,1,-1,-1];function nU(e,t,i,n,a,r,o,s,l){void 0===r&&(r=0),void 0===o&&(o=0),void 0===s&&(s=n),void 0===l&&(l=a);var d=[],c=!1,u=e.map(function(e,u){var p=t[u],h=p.horizontal,m=p.vertical;if(m&&!c&&(c=!0,d.push("/")),c){var g=Math.max(0,1===m?e[1]-o:l-e[1]);return d.push(ng(g,a,i)),g}var g=Math.max(0,1===h?e[0]-r:s-e[0]);return d.push(ng(g,n,i)),g});return{styles:d,raws:u}}function nV(e){for(var t=[0,0],i=[0,0],n=e.length,a=0;a-1?e.slice(0,c):e).length,p=e.slice(0,u),h=e.slice(u+1),m=p[0],g=void 0===m?"0px":m,f=p[1],b=void 0===f?g:f,x=p[2],y=void 0===x?g:x,v=p[3],C=void 0===v?b:v,w=h[0],S=void 0===w?g:w,k=h[1],A=void 0===k?S:k,E=h[2],_=void 0===E?S:E,I=h[3],M=void 0===I?A:I,T=[g,b,y,C].map(function(e){return G(e,t)}),L=[S,A,_,M].map(function(e){return G(e,i)}),j=T.slice(),P=L.slice();o=nB([j[0],j[1]],t),j[0]=o[0],j[1]=o[1],s=nB([j[3],j[2]],t),j[3]=s[0],j[2]=s[1],l=nB([P[0],P[3]],i),P[0]=l[0],P[3]=l[1],d=nB([P[1],P[2]],i),P[1]=d[0],P[2]=d[1];var D=j.slice(0,Math.max(r[0],p.length)),N=P.slice(0,Math.max(r[1],h.length));return tg(tg([],D.map(function(e,t){var r=nO[t];return{horizontal:nH[t],vertical:0,pos:[n+e,a+(-1===nW[t]?i:0)],sub:!0,raw:T[t],direction:r}}),!0),N.map(function(e,i){var r=nO[i];return{horizontal:0,vertical:nW[i],pos:[n+(-1===nH[i]?t:0),a+e],sub:!0,raw:L[i],direction:r}}),!0)}function n$(e,t,i,n,a){void 0===a&&(a=t.length);var r=nV(e.slice(n)),o=r.horizontalRange,s=r.verticalRange,l=i-n,d=0;if(0===l)d=a;else if(l>0&&l=s[0]))return;d=s[0]+s[1]-l}e.splice(i,d),t.splice(i,d)}function nZ(e,t,i,n,a,r,o,s,l,d,c){void 0===d&&(d=0),void 0===c&&(c=0);var u=nV(e.slice(i)),p=u.horizontalRange,h=u.verticalRange;if(n>-1)for(var m=1===nH[n]?r-d:s-r,g=p[1];g<=n;++g){var f=1===nW[g]?c:l,b=0;if(n===g?b=r:0===g?b=d+m:-1===nH[g]&&(b=s-(t[i][0]-d)),e.splice(i+g,0,{horizontal:nH[g],vertical:0,pos:[b,f]}),t.splice(i+g,0,[b,f]),0===g)break}else if(a>-1){var x=1===nW[a]?o-c:l-o;if(0===p[1]&&0===h[1]){var y=[d+x,c];e.push({horizontal:nH[0],vertical:0,pos:y}),t.push(y)}for(var v=h[0],g=h[1];g<=a;++g){var b=1===nH[g]?d:s,f=0;if(a===g?f=o:0===g?f=c+x:1===nW[g]?f=t[i+v][1]:-1===nW[g]&&(f=l-(t[i+v][1]-c)),e.push({horizontal:0,vertical:nW[g],pos:[b,f]}),t.push([b,f]),0===g)break}}}function nK(e,t){return void 0===t&&(t=e.map(function(e){return e.raw})),{horizontals:e.map(function(e,i){return e.horizontal?t[i]:null}).filter(function(e){return null!=e}),verticals:e.map(function(e,i){return e.vertical?t[i]:null}).filter(function(e){return null!=e})}}var nq=[[0,-1,"n"],[1,0,"e"]],nY=[[-1,-1,"nw"],[0,-1,"n"],[1,-1,"ne"],[1,0,"e"],[1,1,"se"],[0,1,"s"],[-1,1,"sw"],[-1,0,"w"]];function nX(e,t,i){var n=e.props.clipRelative,a=e.state,r=a.width,o=a.height,s=t.type,l=t.poses,d="rect"===s,c="circle"===s;if("polygon"===s)return i.map(function(e){return"".concat(ng(e[0],r,n)," ").concat(ng(e[1],o,n))});if(d||"inset"===s){var u=i[1][1],p=i[3][0],h=i[7][0],m=i[5][1];if(d)return[u,p,m,h].map(function(e){return"".concat(e,"px")});var g=[u,r-p,o-m,h].map(function(e,t){return ng(e,t%2?r:o,n)});if(i.length>8){var f=eu(i[4],i[0]),b=f[0],x=f[1];g.push.apply(g,tg(["round"],nU(i.slice(8),l.slice(8),n,b,x,h,u,p,m).styles,!1))}return g}if(c||"ellipse"===s){var y=i[0],v=ng(Math.abs(i[1][1]-y[1]),c?Math.sqrt((r*r+o*o)/2):o,n),g=c?[v]:[ng(Math.abs(i[2][0]-y[0]),r,n),v];return g.push("at",ng(y[0],r,n),ng(y[1],o,n)),g}}function nQ(e,t,i,n){var a=[n,(n+t)/2,t],r=[e,(e+i)/2,i];return nY.map(function(e){var t=e[0],i=e[1],n=e[2],o=a[t+1],s=r[i+1];return{vertical:Math.abs(i),horizontal:Math.abs(t),direction:n,pos:[o,s]}})}function nJ(e){var t=[1/0,-1/0],i=[1/0,-1/0];return e.forEach(function(e){var n=e.pos;t[0]=Math.min(t[0],n[0]),t[1]=Math.max(t[1],n[0]),i[0]=Math.min(i[0],n[1]),i[1]=Math.max(i[1],n[1])}),[Math.abs(t[1]-t[0]),Math.abs(i[1]-i[0])]}function n0(e,t,i,n,a){var r,o,s,l,d,c,u,p=a;if(!p){var h=nl(e),m=h.clipPath;p="none"!==m?m:h.clip}if(p&&"none"!==p&&"auto"!==p||(p=n)){var g=O(p),f=g.prefix,b=void 0===f?p:f,x=g.value,y=void 0===x?"":x,v="circle"===b,C=" ";if("polygon"===b){var w=R(y||"0% 0%, 100% 0%, 100% 100%, 0% 100%");C=",";var S=w.map(function(e){var n=e.split(" "),a=n[0],r=n[1];return{vertical:1,horizontal:1,pos:[G(a,t),G(r,i)]}});return{type:b,clipText:p,poses:S,splitter:C}}if(v||"ellipse"===b){var k="",A="",E=0,_=0,w=N(y);if(v){var I="";I=void 0===(r=w[0])?"50%":r,k=void 0===(o=w[2])?"50%":o,A=void 0===(s=w[3])?"50%":s,_=E=G(I,Math.sqrt((t*t+i*i)/2))}else{var M="",T="";M=void 0===(l=w[0])?"50%":l,T=void 0===(d=w[1])?"50%":d,k=void 0===(c=w[3])?"50%":c,A=void 0===(u=w[4])?"50%":u,E=G(M,t),_=G(T,i)}var L=[G(k,t),G(A,i)],S=tg([{vertical:1,horizontal:1,pos:L,direction:"nesw"}],nq.slice(0,v?1:2).map(function(e){return{vertical:Math.abs(e[1]),horizontal:e[0],direction:e[2],sub:!0,pos:[L[0]+e[0]*E,L[1]+e[1]*_]}}),!0);return{type:b,clipText:p,radiusX:E,radiusY:_,left:L[0]-E,top:L[1]-_,poses:S,splitter:C}}if("inset"===b){var w=N(y||"0 0 0 0"),j=w.indexOf("round"),P=(j>-1?w.slice(0,j):w).length,D=w.slice(P+1),z=w.slice(0,P),F=z[0],H=z[1],W=void 0===H?F:H,U=z[2],V=void 0===U?F:U,$=z[3],Z=void 0===$?W:$,K=[F,V].map(function(e){return G(e,i)}),q=K[0],Y=K[1],X=[Z,W].map(function(e){return G(e,t)}),Q=X[0],J=X[1],ee=t-J,et=i-Y,ei=nG(D,ee-Q,et-q,Q,q),S=tg(tg([],nQ(q,ee,et,Q),!0),ei,!0);return{type:"inset",clipText:p,poses:S,top:q,left:Q,right:ee,bottom:et,radius:D,splitter:C}}if("rect"===b){var w=R(y||"0px, ".concat(t,"px, ").concat(i,"px, 0px"));C=",";var en=w.map(function(e){return B(e).value}),q=en[0],J=en[1],Y=en[2],Q=en[3],S=nQ(q,J,Y,Q);return{type:"rect",clipText:p,poses:S,top:q,right:J,bottom:Y,left:Q,values:w,splitter:C}}}}var n1={name:"clippable",props:{clippable:Boolean,defaultClipPath:String,customClipPath:String,keepRatio:Boolean,clipRelative:Boolean,clipArea:Boolean,dragWithClip:Boolean,clipTargetBounds:Boolean,clipVerticalGuidelines:Array,clipHorizontalGuidelines:Array,clipSnapThreshold:Boolean},events:{onClipStart:"clipStart",onClip:"clip",onClipEnd:"clipEnd"},css:[".control.clip-control {\n background: #6d6;\n cursor: pointer;\n}\n.control.clip-control.clip-radius {\n background: #d66;\n}\n.line.clip-line {\n background: #6e6;\n cursor: move;\n z-index: 1;\n}\n.clip-area {\n position: absolute;\n top: 0;\n left: 0;\n}\n.clip-ellipse {\n position: absolute;\n cursor: move;\n border: 1px solid #6d6;\n border: var(--zoompx) solid #6d6;\n border-radius: 50%;\n transform-origin: 0px 0px;\n}",":host {\n --bounds-color: #d66;\n}",".guideline {\n pointer-events: none;\n z-index: 2;\n}",".line.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}"],render:function(e,t){var i=e.props,n=i.customClipPath,a=i.defaultClipPath,r=i.clipArea,o=i.zoom,s=e.state,l=s.target,d=s.width,c=s.height,u=s.allMatrix,p=s.is3d,h=s.left,m=s.top,g=s.pos1,f=s.pos2,b=s.pos3,x=s.pos4,y=s.clipPathState,v=s.snapBoundInfos,C=s.rotation;if(!l)return[];var w=n0(l,d,c,a||"inset",y||n);if(!w)return[];var S=p?4:3,k=w.type,A=w.poses.map(function(e){var t=iX(u,e.pos,S);return[t[0]-h,t[1]-m]}),E=[],_=[],I="rect"===k,M="inset"===k,T="polygon"===k;if(I||M||T){var L=M?A.slice(0,8):A;_=L.map(function(e,i){var n=0===i?L[L.length-1]:L[i-1],a=K(n,e),r=i2(n,e);return t.createElement("div",{key:"clipLine".concat(i),className:iH("line","clip-line","snap-control"),"data-clip-index":i,style:{width:"".concat(r,"px"),transform:"translate(".concat(n[0],"px, ").concat(n[1],"px) rotate(").concat(a,"rad) scaleY(").concat(o,")")}})})}if(E=A.map(function(e,i){return t.createElement("div",{key:"clipControl".concat(i),className:iH("control","clip-control","snap-control"),"data-clip-index":i,style:{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(C,"rad) scale(").concat(o,")")}})}),M&&E.push.apply(E,A.slice(8).map(function(e,i){return t.createElement("div",{key:"clipRadiusControl".concat(i),className:iH("control","clip-control","clip-radius","snap-control"),"data-clip-index":8+i,style:{transform:"translate(".concat(e[0],"px, ").concat(e[1],"px) rotate(").concat(C,"rad) scale(").concat(o,")")}})})),"circle"===k||"ellipse"===k){var j=w.left,P=w.top,D=w.radiusX,N=w.radiusY,R=eu(iX(u,[j,P],S),iX(u,[0,0],S)),O=R[0],B=R[1],z="none";if(!r){for(var F=Math.max(10,D/5,N/5),H=[],W=0;W<=F;++W){var U=2*Math.PI/F*W;H.push([D+(D-o)*Math.cos(U),N+(N-o)*Math.sin(U)])}H.push([D,-2]),H.push([-2,-2]),H.push([-2,2*N+2]),H.push([2*D+2,2*N+2]),H.push([2*D+2,-2]),H.push([D,-2]),z="polygon(".concat(H.map(function(e){return"".concat(e[0],"px ").concat(e[1],"px")}).join(", "),")")}E.push(t.createElement("div",{key:"clipEllipse",className:iH("clip-ellipse","snap-control"),style:{width:"".concat(2*D,"px"),height:"".concat(2*N,"px"),clipPath:z,transform:"translate(".concat(-h+O,"px, ").concat(-m+B,"px) ").concat(iq(u))}}))}if(r){var V=iJ(tg([g,f,b,x],A,!0)),G=V.width,$=V.height,Z=V.left,q=V.top;if(T||I||M){var H=M?A.slice(0,8):A;E.push(t.createElement("div",{key:"clipArea",className:iH("clip-area","snap-control"),style:{width:"".concat(G,"px"),height:"".concat($,"px"),transform:"translate(".concat(Z,"px, ").concat(q,"px)"),clipPath:"polygon(".concat(H.map(function(e){return"".concat(e[0]-Z,"px ").concat(e[1]-q,"px")}).join(", "),")")}}))}}return v&&["vertical","horizontal"].forEach(function(e){var i=v[e],n="horizontal"===e;i.isSnap&&_.push.apply(_,i.snap.posInfos.map(function(i,a){var r=i.pos;return tj(t,"",eu(iX(u,n?[0,r]:[r,0],S),[h,m]),eu(iX(u,n?[d,r]:[r,c],S),[h,m]),o,"clip".concat(e,"snap").concat(a),"guideline")})),i.isBound&&_.push.apply(_,i.bounds.map(function(i,a){var r=i.pos;return tj(t,"",eu(iX(u,n?[0,r]:[r,0],S),[h,m]),eu(iX(u,n?[d,r]:[r,c],S),[h,m]),o,"clip".concat(e,"bounds").concat(a),"guideline","bounds","bold")}))}),tg(tg([],E,!0),_,!0)},dragControlCondition:function(e,t){return t.inputEvent&&(t.inputEvent.target.getAttribute("class")||"").indexOf("clip")>-1},dragStart:function(e,t){var i=e.props.dragWithClip;return void 0!==i&&!i&&this.dragControlStart(e,t)},drag:function(e,t){return this.dragControl(e,tm(tm({},t),{isDragTarget:!0}))},dragEnd:function(e,t){return this.dragControlEnd(e,t)},dragControlStart:function(e,t){var i=e.state,n=e.props,a=n.defaultClipPath,r=n.customClipPath,o=i.target,s=i.width,l=i.height,d=t.inputEvent?t.inputEvent.target:null,c=d&&d.getAttribute("class")||"",u=t.datas,p=n0(o,s,l,a||"inset",r);if(!p)return!1;var h=p.clipText;return!1===ns(e,"onClipStart",na(e,t,{clipType:p.type,clipStyle:h,poses:p.poses.map(function(e){return e.pos})}))?(u.isClipStart=!1,!1):(u.isControl=c&&c.indexOf("clip-control")>-1,u.isLine=c.indexOf("clip-line")>-1,u.isArea=c.indexOf("clip-area")>-1||c.indexOf("clip-ellipse")>-1,u.clipIndex=d?parseInt(d.getAttribute("data-clip-index"),10):-1,u.clipPath=p,u.isClipStart=!0,i.clipPathState=h,iC(e,t),!0)},dragControl:function(e,t){var i,n=t.datas,a=t.originalDatas,r=t.isDragTarget;if(!n.isClipStart)return!1;var o=n.isControl,s=n.isLine,l=n.isArea,d=n.clipIndex,c=n.clipPath;if(!c)return!1;var u=e.props.keepRatio,p=0,h=0,m=a.draggable,g=iE(t);r&&m?(p=(i=m.prevBeforeDist)[0],h=i[1]):(p=g[0],h=g[1]);var f=[p,h],b=e.props,x=e.state,y=x.width,v=x.height,C=c.type,w=c.poses,S=c.splitter,k=w.map(function(e){return e.pos});l||o||s||(p=-p,h=-h);var A=!o||"nesw"===w[d].direction,E="inset"===C||"rect"===C,_=w.map(function(){return[0,0]});if(o&&!A){var I=w[d],M=I.horizontal,T=I.vertical;_=function(e,t,i,n,a){var r=e[t],o=r.direction,s=r.sub,l=e.map(function(){return[0,0]}),d=o?o.split(""):[];if(n&&t<8){var c=d.filter(function(e){return"w"===e||"e"===e}),u=d.filter(function(e){return"n"===e||"s"===e}),p=c[0],h=u[0];l[t]=i;var m=nJ(e),g=m[0],f=m[1],b=g&&f?g/f:0;if(b&&a){var x=e[(t+4)%8].pos,y=[0,0];o.indexOf("w")>-1?y[0]=-1:o.indexOf("e")>-1&&(y[0]=1),o.indexOf("n")>-1?y[1]=-1:o.indexOf("s")>-1&&(y[1]=1);var v=nC([g,f],i,b,y,!0),C=g+v[0],w=f+v[1],S=x[1],k=x[1],A=x[0],E=x[0];-1===y[0]?A=E-C:1===y[0]?E=A+C:(A-=C/2,E+=C/2),-1===y[1]?S=k-w:k=1===y[1]?S+w:(S=k-w/2)+w;var _=nQ(S,E,k,A);e.forEach(function(e,t){l[t][0]=_[t].pos[0]-e.pos[0],l[t][1]=_[t].pos[1]-e.pos[1]})}else e.forEach(function(e,t){var n=e.direction;n&&(n.indexOf(p)>-1&&(l[t][0]=i[0]),n.indexOf(h)>-1&&(l[t][1]=i[1]))}),p&&(l[1][0]=i[0]/2,l[5][0]=i[0]/2),h&&(l[3][1]=i[1]/2,l[7][1]=i[1]/2)}else o&&!s?d.forEach(function(t){var n="n"===t||"s"===t;e.forEach(function(e,a){var r=e.direction,o=e.horizontal,s=e.vertical;r&&-1!==r.indexOf(t)&&(l[a]=[n||!o?0:i[0],n&&s?i[1]:0])})}):l[t]=i;return l}(w,d,[p*Math.abs(M),h*Math.abs(T)],E,u)}else A&&(_=k.map(function(){return[p,h]}));var L=k.map(function(e,t){return ec(e,_[t])}),j=tg([],L,!0);x.snapBoundInfos=null;var P="circle"===c.type,D="ellipse"===c.type;if(P||D){var N=iJ(L),R=Math.abs(N.bottom-N.top),O=Math.abs(D?N.right-N.left:R),B=L[0][1]+R,z=L[0][0]-O,F=L[0][0]+O;P&&(j.push([F,N.bottom]),_.push([1,0])),j.push([N.left,B]),_.push([0,1]),j.push([z,N.bottom]),_.push([1,0])}var H=t$((b.clipHorizontalGuidelines||[]).map(function(e){return G("".concat(e),v)}),(b.clipVerticalGuidelines||[]).map(function(e){return G("".concat(e),y)}),y,v),W=[],U=[];if(P||D)W=[j[4][0],j[2][0]],U=[j[1][1],j[3][1]];else if(E){var V=[j[0],j[2],j[4],j[6]],$=[_[0],_[2],_[4],_[6]];W=V.filter(function(e,t){return $[t][0]}).map(function(e){return e[0]}),U=V.filter(function(e,t){return $[t][1]}).map(function(e){return e[1]})}else W=j.filter(function(e,t){return _[t][0]}).map(function(e){return e[0]}),U=j.filter(function(e,t){return _[t][1]}).map(function(e){return e[1]});var Z=[0,0],K=iu(H,b.clipTargetBounds&&{left:0,top:0,right:y,bottom:v},W,U,5),q=K.horizontal,Y=K.vertical,X=q.offset,Q=Y.offset;if(q.isBound&&(Z[1]+=X),Y.isBound&&(Z[0]+=Q),(D||P)&&0===_[0][0]&&0===_[0][1]){var N=iJ(L),J=N.bottom-N.top,ee=D?N.right-N.left:J,et=Y.isBound?Math.abs(Q):0===Y.snapIndex?-Q:Q,ei=q.isBound?Math.abs(X):0===q.snapIndex?-X:X;ee-=et,J-=ei,P&&(ee=J=tJ(Y,q)>0?J:ee);var en=j[0];j[1][1]=en[1]-J,j[2][0]=en[0]+ee,j[3][1]=en[1]+J,j[4][0]=en[0]-ee}else if(E&&u&&o){var ea=nJ(w),er=ea[0],eo=ea[1],es=er&&eo?er/eo:0,el=w[d].direction||"",eu=j[1][1],B=j[5][1],z=j[7][0],F=j[3][0];X<=Q?X=Q/es:Q=X*es,el.indexOf("w")>-1?z-=Q:el.indexOf("e")>-1?F-=Q:(z+=Q/2,F-=Q/2),el.indexOf("n")>-1?eu-=X:el.indexOf("s")>-1?B-=X:(eu+=X/2,B-=X/2);var ep=nQ(eu,F,B,z);j.forEach(function(e,t){var i;i=ep[t].pos,e[0]=i[0],e[1]=i[1]})}else j.forEach(function(e,t){var i=_[t];i[0]&&(e[0]-=Q),i[1]&&(e[1]-=X)});var eh=nX(e,c,L),em="".concat(C,"(").concat(eh.join(S),")");if(x.clipPathState=em,P||D)W=[j[4][0],j[2][0]],U=[j[1][1],j[3][1]];else if(E){var V=[j[0],j[2],j[4],j[6]];W=V.map(function(e){return e[0]}),U=V.map(function(e){return e[1]})}else W=j.map(function(e){return e[0]}),U=j.map(function(e){return e[1]});if(x.snapBoundInfos=iu(H,b.clipTargetBounds&&{left:0,top:0,right:y,bottom:v},W,U,1),m){var eg=x.is3d,ef=x.allMatrix,eb=Z;r&&(eb=[f[0]+Z[0]-g[0],f[1]+Z[1]-g[1]]),m.deltaOffset=ed(ef,[eb[0],eb[1],0,0],eg?4:3)}return ns(e,"onClip",na(e,t,{clipEventType:"changed",clipType:C,poses:L,clipStyle:em,clipStyles:eh,distX:p,distY:h})),!0},dragControlEnd:function(e,t){this.unset(e);var i=t.isDrag,n=t.datas,a=t.isDouble,r=n.isLine,o=n.isClipStart,s=n.isControl;return!!o&&(ns(e,"onClipEnd",nr(e,t,{})),a&&(s?!function(e,t){var i=t.datas,n=i.clipPath,a=i.clipIndex,r=n.type,o=n.poses,s=n.splitter,l=o.map(function(e){return e.pos}),d=l.length;if("polygon"===r)o.splice(a,1),l.splice(a,1);else if("inset"!==r||a<8||(n$(o,l,a,8,d),d===o.length))return;var c=nX(e,n,l);ns(e,"onClip",na(e,t,{clipEventType:"removed",clipType:r,poses:l,clipStyles:c,clipStyle:"".concat(r,"(").concat(c.join(s),")"),distX:0,distY:0}))}(e,t):r&&function(e,t){var i=iv(e,t),n=i[0],a=i[1],r=t.datas,o=r.clipPath,s=r.clipIndex,l=o.type,d=o.poses,c=o.splitter,u=d.map(function(e){return e.pos});if("polygon"===l)u.splice(s,0,[n,a]);else{if("inset"!==l)return;var p=nz.indexOf(s),h=nF.indexOf(s),m=d.length;if(nZ(d,u,8,p,h,n,a,u[4][0],u[4][1],u[0][0],u[0][1]),m===d.length)return}var g=nX(e,o,u);ns(e,"onClip",na(e,t,{clipEventType:"added",clipType:l,poses:u,clipStyles:g,clipStyle:"".concat(l,"(").concat(g.join(c),")"),distX:0,distY:0}))}(e,t)),a||i)},unset:function(e){e.state.clipPathState="",e.state.snapBoundInfos=null}};function n2(e,t,i,n,a){void 0===n&&(n=[0,0]);if(a)r=a;else{var r,o=nl(e);r=o&&o.borderRadius||""}return nG(r&&(a||"0px"!==r)?N(r):[],t,i,0,0,n)}function n3(e,t,i,n,a,r){var o=e.state,s=o.width,l=o.height,d=nU(r,a,e.props.roundRelative,s,l),c=d.raws,u=d.styles,p=nK(a,c),h=p.horizontals,m=p.verticals,g=u.join(" ");o.borderRadiusState=g,ns(e,"onRound",na(e,t,{horizontals:h,verticals:m,borderRadius:g,width:s,height:l,delta:n,dist:i}))}var n5={isPinch:!0,name:"beforeRenderable",props:{},events:{onBeforeRenderStart:"beforeRenderStart",onBeforeRender:"beforeRender",onBeforeRenderEnd:"beforeRenderEnd",onBeforeRenderGroupStart:"beforeRenderGroupStart",onBeforeRenderGroup:"beforeRenderGroup",onBeforeRenderGroupEnd:"beforeRenderGroupEnd"},dragRelation:"weak",setTransform:function(e,t){var i=e.state,n=i.is3d,a=i.target,r=i.targetMatrix,o=null==a?void 0:a.style.transform,s=n?"matrix3d(".concat(r.join(","),")"):"matrix(".concat(ep(r,!0),")"),l=o&&"none"!==o?o:s;t.datas.startTransforms=l===(n?"matrix3d(".concat(ew(4)):"matrix(".concat(ew(3),")"))||"matrix(1,0,0,1,0,0)"===l?[]:N(l)},resetTransform:function(e){e.datas.nextTransforms=e.datas.startTransforms,e.datas.nextTransformAppendedIndexes=[]},fillDragStartParams:function(e,t){return na(e,t,{setTransform:function(e){t.datas.startTransforms=M(e)?e:N(e)},isPinch:!!t.isPinch})},fillDragParams:function(e,t){return na(e,t,{isPinch:!!t.isPinch})},dragStart:function(e,t){this.setTransform(e,t),ns(e,"onBeforeRenderStart",this.fillDragStartParams(e,t))},drag:function(e,t){this.resetTransform(t),ns(e,"onBeforeRender",na(e,t,{isPinch:!!t.isPinch}))},dragEnd:function(e,t){ns(e,"onBeforeRenderEnd",na(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag}))},dragGroupStart:function(e,t){var i=this;this.dragStart(e,t);var n=tI(e,"beforeRenderable",t),a=e.moveables,r=n.map(function(e,t){var n=a[t];return i.setTransform(n,e),i.fillDragStartParams(n,e)});ns(e,"onBeforeRenderGroupStart",na(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,setTransform:function(){},events:r}))},dragGroup:function(e,t){var i=this;this.drag(e,t);var n=tI(e,"beforeRenderable",t),a=e.moveables,r=n.map(function(e,t){var n=a[t];return i.resetTransform(e),i.fillDragParams(n,e)});ns(e,"onBeforeRenderGroup",na(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,events:r}))},dragGroupEnd:function(e,t){this.dragEnd(e,t),ns(e,"onBeforeRenderGroupEnd",na(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)}},n4={name:"renderable",props:{},events:{onRenderStart:"renderStart",onRender:"render",onRenderEnd:"renderEnd",onRenderGroupStart:"renderGroupStart",onRenderGroup:"renderGroup",onRenderGroupEnd:"renderGroupEnd"},dragRelation:"weak",dragStart:function(e,t){ns(e,"onRenderStart",na(e,t,{isPinch:!!t.isPinch}))},drag:function(e,t){ns(e,"onRender",this.fillDragParams(e,t))},dragAfter:function(e,t){if(t.resultCount)return this.drag(e,t)},dragEnd:function(e,t){ns(e,"onRenderEnd",this.fillDragEndParams(e,t))},dragGroupStart:function(e,t){ns(e,"onRenderGroupStart",na(e,t,{isPinch:!!t.isPinch,targets:e.props.targets}))},dragGroup:function(e,t){var i=this,n=tI(e,"beforeRenderable",t),a=e.moveables,r=n.map(function(e,t){var n=a[t];return i.fillDragParams(n,e)});ns(e,"onRenderGroup",na(e,t,{isPinch:!!t.isPinch,targets:e.props.targets,transform:iN(t),events:r}))},dragGroupEnd:function(e,t){var i=this,n=tI(e,"beforeRenderable",t),a=e.moveables,r=n.map(function(e,t){var n=a[t];return i.fillDragEndParams(n,e)});ns(e,"onRenderGroupEnd",na(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag,targets:e.props.targets,events:r}))},dragControlStart:function(e,t){return this.dragStart(e,t)},dragControl:function(e,t){return this.drag(e,t)},dragControlAfter:function(e,t){return this.dragAfter(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupControlStart:function(e,t){return this.dragGroupStart(e,t)},dragGroupControl:function(e,t){return this.dragGroup(e,t)},dragGroupControlEnd:function(e,t){return this.dragGroupEnd(e,t)},fillDragParams:function(e,t){return na(e,t,{isPinch:!!t.isPinch,transform:iN(t)})},fillDragEndParams:function(e,t){return na(e,t,{isPinch:!!t.isPinch,isDrag:t.isDrag})}};function n6(e,t,i,n,a,r,o){var s,l="Start"===a,d=e.state.target,c=r.isRequest;if(!d||l&&n.indexOf("Control")>-1&&!c&&e.areaElement===r.inputEvent.target)return!1;var u="".concat(i).concat(n).concat(a),p="".concat(i).concat(n,"Condition"),h="End"===a,m="After"===a,g=l&&(!e.targetGesto||!e.controlGesto||!e.targetGesto.isFlag()||!e.controlGesto.isFlag());g&&e.updateRect(a,!0,!1),""!==a||c||nh(e.state,r);var f=tg([],e[t],!0);if(c){var b=r.requestAble;f.some(function(e){return e.name===b})||f.push.apply(f,e.props.ables.filter(function(e){return e.name===b}))}if(!f.length)return!1;var x=tg(tg([n5],f,!0),[n4],!1).filter(function(e){return e[u]}),y=r.datas;g&&x.forEach(function(t){t.unset&&t.unset(e)});var v=r.inputEvent;h&&v&&(s=document.elementFromPoint(r.clientX,r.clientY)||v.target);var C=0,w=x.filter(function(t){var i=t.name,n=y[i]||(y[i]={});if(l&&(n.isEventStart=!t[p]||t[p](e,r)),n.isEventStart){var a=t[u](e,tm(tm({},r),{resultCount:C,datas:n,originalDatas:y,inputTarget:s}));return e._emitter.off(),l&&!1===a&&(n.isEventStart=!1),C+=+!!a,a}return!1}).length,S=!1;return l&&x.length&&!w&&(S=0===x.filter(function(e){var t=y[e.name];return!!t.isEventStart&&("strong"!==e.dragRelation||(t.isEventStart=!1,!1))}).length),(h||S)&&(e.state.gesto=null,e.moveables&&e.moveables.forEach(function(e){e.state.gesto=null})),g&&S&&x.forEach(function(t){t.unset&&t.unset(e)}),l&&!c&&w&&(null==r||r.preventDefault()),!e.isUnmounted&&!S&&((!l&&w&&!o||h)&&(e.updateRect(h?a:"",!0,!1),e.forceUpdate()),l||h||m||!w||o||n6(e,t,i,n,a+"After",r),!0)}function n9(e,t,i){var n=e.controlBox.getElement(),a=[];a.push(n),(!e.props.dragArea||e.props.dragTarget)&&a.push(t);var r=function(t){var i=t.inputEvent.target;return i===e.areaElement||!e.isMoveableElement(i)&&!e.controlBox.getElement().contains(i)||J(i,"moveable-area")||J(i,"moveable-padding")};return n8(e,a,"targetAbles",i,{dragStart:r,pinchStart:r})}function n8(e,t,i,n,a){void 0===a&&(a={});var r=e.props,o=r.pinchOutside,s=new ta(t,{preventDefault:!1,container:window,pinchThreshold:r.pinchThreshold,pinchOutside:o});return["drag","pinch"].forEach(function(t){["Start","","End"].forEach(function(r){s.on("".concat(t).concat(r),function(o){var s=o.eventType;a[s]&&!a[s](o)?o.stop():n6(e,i,t,n,r,o)||o.stop()})})}),s}var n7=function(){function e(e,t,i){var n=this;this.target=e,this.moveable=t,this.eventName=i,this.ables=[],this._onEvent=function(e){var t=n.eventName,i=n.moveable;i.state.disableNativeEvent||n.ables.forEach(function(n){n[t](i,{inputEvent:e})})},e.addEventListener(i.toLowerCase(),this._onEvent)}var t=e.prototype;return t.setAbles=function(e){this.ables=e},t.destroy=function(){this.target.removeEventListener(this.eventName.toLowerCase(),this._onEvent),this.target=null,this.moveable=null},e}(),ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state=tm({container:null,gesto:null,renderPoses:[[0,0],[0,0],[0,0],[0,0]],disableNativeEvent:!1},i9(null)),t.enabledAbles=[],t.targetAbles=[],t.controlAbles=[],t.rotation=0,t.scale=[1,1],t.isUnmounted=!1,t.events={mouseEnter:null,mouseLeave:null},t._emitter=new eX,t._prevTarget=null,t._prevDragArea=!1,t._observer=null,t._observerId=0,t.onPreventClick=function(e){e.stopPropagation(),et(window,"click",t.onPreventClick,!0)},t.checkUpdateRect=function(){if(!t.isDragging()){var e=t.props.parentMoveable;if(e)return void e.checkUpdateRect();U(t._observerId),t._observerId=W(function(){t.isDragging()||t.updateRect()})}},t}th(t,e);var i=t.prototype;return i.render=function(){var e=this.props,t=this.state,i=e.parentPosition,n=e.className,a=e.target,r=e.zoom,o=e.cspNonce,s=e.translateZ,l=e.cssStyled,d=e.portalContainer;this.checkUpdate(),this.updateRenderPoses();var c=i||{left:0,top:0},u=c.left,p=c.top,h=t.left,m=t.top,g=t.target,f=t.direction,b=t.hasFixed,x=e.targets,y=(x&&x.length||a)&&g,C=this.isDragging(),w={};return this.getEnabledAbles().forEach(function(e){w["data-able-".concat(e.name.toLowerCase())]=!0}),e3.createElement(l,tm({cspNonce:o,ref:v(this,"controlBox"),className:"".concat(iH("control-box",-1===f?"reverse":"",C?"dragging":"")," ").concat(n)},w,{onClick:this.onPreventClick,portalContainer:d,style:{position:b?"fixed":"absolute",display:y?"block":"none",transform:"translate3d(".concat(h-u,"px, ").concat(m-p,"px, ").concat(s,")"),"--zoom":r,"--zoompx":"".concat(r,"px")}}),this.renderAbles(),this._renderLines())},i.componentDidMount=function(){this.isUnmounted=!1,this.controlBox.getElement();var e=this.props,t=e.parentMoveable,i=e.container,n=e.wrapperMoveable;this._updateTargets(),this._updateNativeEvents(),this._updateEvents(),i||t||n||this.updateRect("",!1,!0),this.updateCheckInput(),this._updateObserver(this.props)},i.componentDidUpdate=function(e){this._updateNativeEvents(),this._updateEvents(),this._updateTargets(),this.updateCheckInput(),this._updateObserver(e)},i.componentWillUnmount=function(){this.isUnmounted=!0,this._emitter.off(),nn(this,"targetGesto"),nn(this,"controlGesto");var e=this.events;for(var t in e){var i=e[t];i&&i.destroy()}},i.getContainer=function(){var e=this.props,t=e.parentMoveable,i=e.wrapperMoveable;return e.container||i&&i.getContainer()||t&&t.getContainer()||this.controlBox.getElement().parentElement},i.isMoveableElement=function(e){return e&&(e.getAttribute("class")||"").indexOf(ty)>-1},i.dragStart=function(e){var t=this.targetGesto;return t&&!t.isFlag()&&t.triggerDragStart(e),this},i.hitTest=function(e){var t,i,n,a,r,o,s,l,d,c,u=this.state,p=u.target,h=u.pos1,m=u.pos2,g=u.pos3,f=u.pos4,b=u.targetClientRect;if(!p)return 0;if(e instanceof Element){var x=e.getBoundingClientRect();c={left:x.left,top:x.top,width:x.width,height:x.height}}else c=tm({width:0,height:0},e);var y=c.left,v=c.top,C=c.width,w=c.height,S=eW([h,m,f,g],b),k=eH((t=[[y,v],[y+C,v],[y+C,v+w],[y,v+w]],(i=S.slice(),n=t.slice(),-1===q(i)&&i.reverse(),-1===q(n)&&n.reverse(),a=eK(i),r=eK(n),o=a.map(function(e){return eG(e[0],e[1])}),s=r.map(function(e){return eG(e[0],e[1])}),l=[],o.forEach(function(e,t){var i=a[t],o=[];s.forEach(function(n,a){var s=eZ(e$(e,n),[i,r[a]]);o.push.apply(o,s.map(function(e){return{index1:t,index2:a,pos:e,type:"intersection"}}))}),o.sort(function(e,t){return Y(i[0],e.pos)-Y(i[0],t.pos)}),l.push.apply(l,o),eV(i[1],n)&&l.push({index1:t,index2:-1,pos:i[1],type:"inside"})}),r.forEach(function(e,t){if(eV(e[1],i)){var n=!1,a=F(l,function(e){return e.index2===t?(n=!0,!1):!!n});-1===a&&(n=!1,a=F(l,function(e){var i=e.index1,a=e.index2;return -1===i&&a+1===t?(n=!0,!1):!!n})),-1===a?l.push({index1:-1,index2:t,pos:e[1],type:"inside"}):l.splice(a,0,{index1:-1,index2:t,pos:e[1],type:"inside"})}}),d={},l.filter(function(e){var t=e.pos,i=t[0]+"x"+t[1];return!d[i]&&(d[i]=!0,!0)})).map(function(e){return e.pos}))),A=eH(S);return k&&A?Math.min(100,k/A*100):0},i.isInside=function(e,t){var i=this.state,n=i.target,a=i.pos1,r=i.pos2,o=i.pos3,s=i.pos4,l=i.targetClientRect;return!!n&&eV([e,t],eW([a,r,s,o],l))},i.updateRect=function(e,t,i){void 0===i&&(i=!0);var n=this.props,a=n.parentMoveable,r=this.state.target||this.props.target,o=this.getContainer(),s=a?a.props.rootContainer:n.rootContainer;this.updateState(i9(this.controlBox&&this.controlBox.getElement(),r,o,o,s||o),!a&&i)},i.isDragging=function(){return!!this.targetGesto&&this.targetGesto.isFlag()||!!this.controlGesto&&this.controlGesto.isFlag()},i.updateTarget=function(e){this.updateRect(e,!0)},i.getRect=function(){var e=this.state,t=ni(this.state),i=t[0],n=t[1],a=t[2],r=t[3],o=iJ(t),s=e.width,l=e.height,d=o.width,c=o.height,u=o.left,p=o.top,h=[e.left,e.top],m=ec(h,e.origin);return{width:d,height:c,left:u,top:p,pos1:i,pos2:n,pos3:a,pos4:r,offsetWidth:s,offsetHeight:l,beforeOrigin:ec(h,e.beforeOrigin),origin:m,transformOrigin:e.transformOrigin,rotation:this.getRotation()}},i.getManager=function(){return this},i.getRotation=function(){var e,t=this.state,i=t.pos1,n=t.pos2,a=t.direction;return e=K(i,n)/Math.PI*180,e=(e=a>=0?e:180-e)>=0?e:360+e},i.request=function(e,t,i){void 0===t&&(t={});var n=this.props,a=n.ables,r=n.groupable,o=a.filter(function(t){return t.name===e})[0];if(this.isDragging()||!o||!o.request)return{request:function(){return this},requestEnd:function(){return this}};var s=this,l=o.request(this),d=i||t.isInstant,c=l.isControl?"controlAbles":"targetAbles",u="".concat(r?"Group":"").concat(l.isControl?"Control":""),p={request:function(t){return n6(s,c,"drag",u,"",tm(tm({},l.request(t)),{requestAble:e,isRequest:!0}),d),this},requestEnd:function(){return n6(s,c,"drag",u,"End",tm(tm({},l.requestEnd()),{requestAble:e,isRequest:!0}),d),this}};return n6(s,c,"drag",u,"Start",tm(tm({},l.requestStart(t)),{requestAble:e,isRequest:!0}),d),d?p.request(t).requestEnd():p},i.destroy=function(){this.componentWillUnmount()},i.updateRenderPoses=function(){var e=this.state,t=this.props,i=e.originalBeforeOrigin,n=e.transformOrigin,a=e.allMatrix,r=e.is3d,o=e.pos1,s=e.pos2,l=e.pos3,d=e.pos4,c=e.left,u=e.top,p=t.padding||{},h=p.left,m=void 0===h?0:h,g=p.top,f=void 0===g?0:g,b=p.bottom,x=void 0===b?0:b,y=p.right,v=void 0===y?0:y,C=r?4:3,w=t.groupable?i:ec(i,[c,u]);e.renderPoses=[ec(o,nm(a,[-m,-f],n,w,C)),ec(s,nm(a,[v,-f],n,w,C)),ec(l,nm(a,[-m,x],n,w,C)),ec(d,nm(a,[v,x],n,w,C))]},i.checkUpdate=function(){var e=this.props,t=e.target,i=e.container,n=e.parentMoveable,a=this.state,r=a.target,o=a.container;if((r||t)&&(this.updateAbles(),!nc(r,t)||!nc(o,i))){var s=i||this.controlBox;s&&this.unsetAbles(),this.updateState({target:t,container:i}),!n&&s&&this.updateRect("End",!1,!1)}},i.triggerEvent=function(e,t){this._emitter.trigger(e,t);var i=this.props[e];return i&&i(t)},i.useCSS=function(e,t){var i=this.props.customStyledMap,n=e+t;return i[n]||(i[n]=tu(e,t)),i[n]},i.unsetAbles=function(){var e=this;this.targetAbles.forEach(function(t){t.unset&&t.unset(e)})},i.updateAbles=function(e,t){void 0===e&&(e=this.props.ables),void 0===t&&(t="");var i=this.props,n=i.triggerAblesSimultaneously,a=e.filter(function(e){return e&&(e.always&&!1!==i[e.name]||i[e.name])}),r="drag".concat(t,"Start"),o="pinch".concat(t,"Start"),s="drag".concat(t,"ControlStart"),l=nd(a,[r,o],n),d=nd(a,[s],n);this.enabledAbles=a,this.targetAbles=l,this.controlAbles=d},i.updateState=function(e,t){if(t)this.isUnmounted||this.setState(e);else{var i=this.state;for(var n in e)i[n]=e[n]}},i.getEnabledAbles=function(){var e=this.props;return e.ables.filter(function(t){return t&&e[t.name]})},i.renderAbles=function(){var e,t,i,n,a=this,r=this.props.triggerAblesSimultaneously,o={createElement:e3.createElement};return(e=nd(this.getEnabledAbles(),["render"],r).map(function(e){return(0,e.render)(a,o)||[]}).reduce(function(e,t){return e.concat(t)},[]).filter(function(e){return e}),t=function(e){return e.key},i=[],n={},e.forEach(function(a,r){var o=t(a,r,e),s=n[o];s||(s=[],n[o]=s,i.push(s)),s.push(a)}),i).map(function(e){return e[0]})},i.updateCheckInput=function(){this.targetGesto&&(this.targetGesto.options.checkInput=this.props.checkInput)},i._updateObserver=function(e){var t,i=this.props,n=i.target;if(!window.ResizeObserver||!n||!i.useResizeObserver){null==(t=this._observer)||t.disconnect();return}if(e.target!==n||!this._observer){var a=new ResizeObserver(this.checkUpdateRect);a.observe(n,{box:"border-box"}),this._observer=a}},i._updateEvents=function(){var e=this.controlBox.getElement(),t=this.targetAbles.length,i=this.controlAbles.length,n=this.props,a=n.dragTarget||n.target;(!t&&this.targetGesto||this._isTargetChanged(!0))&&(nn(this,"targetGesto"),this.updateState({gesto:null})),i||nn(this,"controlGesto"),a&&t&&!this.targetGesto&&(this.targetGesto=n9(this,a,"")),!this.controlGesto&&i&&(this.controlGesto=n8(this,e,"controlAbles","Control"))},i._updateTargets=function(){var e=this.props;this._prevTarget=e.dragTarget||e.target,this._prevDragArea=e.dragArea},i._renderLines=function(){var e=this.props,t=e.edge,i=e.zoom;if(e.hideDefaultLines)return[];var n=this.state.renderPoses,a={createElement:e3.createElement};return[tj(a,t?"n":"",n[0],n[1],i,0),tj(a,t?"e":"",n[1],n[3],i,1),tj(a,t?"w":"",n[0],n[2],i,2),tj(a,t?"s":"",n[2],n[3],i,3)]},i._isTargetChanged=function(e){var t=this.props,i=t.dragTarget||t.target,n=this._prevTarget,a=this._prevDragArea,r=t.dragArea;return!r&&n!==i||(e||r)&&a!==r},i._updateNativeEvents=function(){var e=this,t=this.props.dragArea?this.areaElement:this.state.target,i=this.events,n=V(i);if(this._isTargetChanged())for(var a in i){var r=i[a];r&&r.destroy(),i[a]=null}if(t){var o=this.enabledAbles;n.forEach(function(n){var a=nd(o,[n]),r=a.length>0,s=i[n];if(!r){s&&(s.destroy(),i[n]=null);return}s||(s=new n7(t,e,n),i[n]=s),s.setAbles(a)})}},t.defaultProps={target:null,dragTarget:null,container:null,rootContainer:null,origin:!0,edge:!1,parentMoveable:null,wrapperMoveable:null,parentPosition:null,portalContainer:null,useResizeObserver:!1,ables:[],pinchThreshold:20,dragArea:!1,passDragArea:!1,transformOrigin:"",className:"",zoom:1,triggerAblesSimultaneously:!1,padding:{},pinchOutside:!0,checkInput:!1,groupable:!1,hideDefaultLines:!1,cspNonce:"",translateZ:0,cssStyled:null,customStyledMap:{},props:{}},t}(e3.PureComponent),at={name:"groupable",props:{defaultGroupRotate:Number,defaultGroupOrigin:String,groupable:Boolean},events:{},render:function(e,t){var i=e.props.targets||[];e.moveables=[];var n=e.state,a={left:n.left,top:n.top},r=e.props;return i.map(function(i,n){return t.createElement(ae,{key:"moveable"+n,ref:C(e,"moveables",n),target:i,origin:!1,cssStyled:r.cssStyled,customStyledMap:r.customStyledMap,useResizeObserver:r.useResizeObserver,parentMoveable:e,parentPosition:a})})}},ai=tf("clickable",{props:{clickable:Boolean},events:{onClick:"click",onClickGroup:"clickGroup"},always:!0,dragRelation:"weak",dragStart:function(e,t){t.isRequest||ee(window,"click",e.onPreventClick,!0)},dragControlStart:function(e,t){this.dragStart(e,t)},dragGroupStart:function(e,t){this.dragStart(e,t),t.datas.inputTarget=t.inputEvent&&t.inputEvent.target},dragEnd:function(e,t){this.endEvent(e);var i=e.state.target,n=t.inputEvent,a=t.inputTarget,r=!e.isMoveableElement(a)&&e.controlBox.getElement().contains(a);if((!t.isDrag||r)&&this.unset(e),!(!n||!a||t.isDrag||e.isMoveableElement(a))&&!r){var o=i.contains(a);ns(e,"onClick",na(e,t,{isDouble:t.isDouble,inputTarget:a,isTarget:i===a,containsTarget:o}))}},dragGroupEnd:function(e,t){this.endEvent(e);var i=t.inputEvent,n=t.inputTarget;if(!(!i||!n||t.isDrag||e.isMoveableElement(n))&&t.datas.inputTarget!==n){var a=e.props.targets,r=a.indexOf(n),o=r>-1,s=!1;-1===r&&(s=(r=F(a,function(e){return e.contains(n)}))>-1),ns(e,"onClickGroup",na(e,t,{isDouble:t.isDouble,targets:a,inputTarget:n,targetIndex:r,isTarget:o,containsTarget:s}))}},dragControlEnd:function(e,t){this.dragEnd(e,t)},dragGroupControlEnd:function(e,t){this.dragEnd(e,t)},endEvent:function(e){var t=this;W(function(){t.unset(e)})},unset:function(e){et(window,"click",e.onPreventClick,!0)}});function an(e){var t=e.originalDatas.draggable;return t||(e.originalDatas.draggable={},t=e.originalDatas.draggable),tm(tm({},e),{datas:t})}var aa=tf("edgeDraggable",{dragControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var i=t.inputEvent.target;return J(i,iH("direction"))&&J(i,iH("line"))},dragControlStart:function(e,t){return iy.dragStart(e,an(t))},dragControl:function(e,t){return iy.drag(e,an(t))},dragControlEnd:function(e,t){return iy.dragEnd(e,an(t))},dragGroupControlCondition:function(e,t){if(!e.props.edgeDraggable||!t.inputEvent)return!1;var i=t.inputEvent.target;return J(i,iH("direction"))&&J(i,iH("line"))},dragGroupControlStart:function(e,t){return iy.dragGroupStart(e,an(t))},dragGroupControl:function(e,t){return iy.dragGroup(e,an(t))},dragGroupControlEnd:function(e,t){return iy.dragGroupEnd(e,an(t))},unset:function(e){return iy.unset(e)}}),ar={name:"individualGroupable",props:{individualGroupable:Boolean},events:{}},ao=[n5,nN,{name:"snappable",dragRelation:"strong",props:{snappable:[Boolean,Array],snapContainer:Object,snapDirections:[Boolean,Object],elementSnapDirections:[Boolean,Object],snapGap:Boolean,snapGridWidth:Number,snapGridHeight:Number,isDisplaySnapDigit:Boolean,isDisplayInnerSnapDigit:Boolean,snapDigit:Number,snapThreshold:Number,horizontalGuidelines:Array,verticalGuidelines:Array,elementGuidelines:Array,bounds:Object,innerBounds:Object,snapDistFormat:Function},events:{onSnap:"snap"},css:[":host {\n --bounds-color: #d66;\n}\n.guideline {\n pointer-events: none;\n z-index: 2;\n}\n.guideline.bounds {\n background: #d66;\n background: var(--bounds-color);\n}\n.guideline-group {\n position: absolute;\n top: 0;\n left: 0;\n}\n.guideline-group .size-value {\n position: absolute;\n color: #f55;\n font-size: 12px;\n font-weight: bold;\n}\n.guideline-group.horizontal .size-value {\n transform-origin: 50% 100%;\n transform: translateX(-50%);\n left: 50%;\n bottom: 5px;\n}\n.guideline-group.vertical .size-value {\n transform-origin: 0% 50%;\n top: 50%;\n transform: translateY(-50%);\n left: 5px;\n}\n.guideline.gap {\n background: #f55;\n}\n.size-value.gap {\n color: #f55;\n}\n"],render:function(e,t){var i,n,a,r,o,s=e.state,l=s.top,d=s.left,c=s.pos1,u=s.pos2,p=s.pos3,h=s.pos4,m=s.snapRenderInfo;if(!m||!tU(e,""))return[];s.guidelines=tZ(e);var g=Math.min(c[0],u[0],p[0],h[0]),f=Math.min(c[1],u[1],p[1],h[1]),b=m.externalPoses||[],x=ni(e.state),y=[],v=[],C=[],w=[],S=[],k=iJ(x),A=k.width,E=k.height,_=k.top,I=k.left,M=k.bottom,T=k.right,L={left:I,right:T,top:_,bottom:M,center:(I+T)/2,middle:(_+M)/2},j=b.length>0,P=j?iJ(b):{};if(!m.request){if(m.direction&&S.push(function(e,t,i){var n=[];if(i[0]&&i[1])n=[i,[-i[0],i[1]],[i[0],-i[1]]].map(function(e){return iM(t,e)});else if(i[0]||i[1])e.props.keepRatio?n=[[-1,-1],[-1,1],[1,-1],[1,1],i].map(function(e){return iM(t,e)}):(n=iI(t,i)).length>1&&n.push([(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]);else for(var a=[t[0],t[1],t[3],t[2],t[0]],r=0;r<4;++r)n.push(a[r]),n.push([(a[r][0]+a[r+1][0])/2,(a[r][1]+a[r+1][1])/2]);return tK(e,n.map(function(e){return e[0]}),n.map(function(e){return e[1]}),1)}(e,x,m.direction)),m.snap){var D=iJ(x);m.center&&(D.middle=(D.top+D.bottom)/2,D.center=(D.left+D.right)/2),S.push(tY(e,D,1))}j&&(m.center&&(P.middle=(P.top+P.bottom)/2,P.center=(P.left+P.right)/2),S.push(tY(e,P,1))),S.forEach(function(e){var t=e.vertical.posInfos,i=e.horizontal.posInfos;y.push.apply(y,t.filter(function(e){return e.guidelineInfos.some(function(e){return!e.guideline.hide})}).map(function(e){return{type:"snap",pos:e.pos}})),v.push.apply(v,i.filter(function(e){return e.guidelineInfos.some(function(e){return!e.guideline.hide})}).map(function(e){return{type:"snap",pos:e.pos}})),C.push.apply(C,ib(t)),w.push.apply(w,ib(i))})}ix(e,[I,T],[_,M],y,v),j&&ix(e,[P.left,P.right],[P.top,P.bottom],y,v,m.externalBounds);var N=tg(tg([],C,!0),w,!0),R=N.filter(function(e){return e.element&&!e.gapRects}),O=N.filter(function(e){return e.gapRects});return ns(e,"onSnap",{guidelines:N.filter(function(e){return!e.element}),elements:R,gaps:O},!0),tg(tg(tg(tg(tg(tg([],(i=[g,f],n=e.props.isDisplayInnerSnapDigit,a=[],["vertical","horizontal"].forEach(function(r){var o,s,l,d,c,u,p,h,m,g=R.filter(function(e){return e.type===r}),f=+("vertical"===r),b=+!f,x=(c=+("vertical"!==r),u=+("vertical"===r),h=L[(p=c?tH:tW).start],m=L[p.end],(o=g,s=function(e){return e.pos[c]},l=[],d=[],o.forEach(function(e,t){var i=s(e,t,o),n=d.indexOf(i),a=l[n]||[];-1===n&&(d.push(i),l.push(a)),a.push(e)}),l).map(function(e){var t=[],i=[];return e.forEach(function(e){var a,o,s=e.element,l=e.elementRect.rect;if(l[p.end]0){var l=[0,0];l[f]=i[f]+u[y.start]-C-s,l[b]=c,a.push(is(e,r,"dashed",a.length,s,l,n.className,t))}u=o}),u=L,l.forEach(function(n){var o=n.elementRect.rect,s=o[y.start]-u[y.end];if(s>0){var l=[0,0];l[f]=i[f]+u[y.end]-C,l[b]=c,a.push(is(e,r,"dashed",a.length,s,l,n.className,t))}u=o}),d.forEach(function(n){var o=n.elementRect.rect,s=C-o[y.start],l=o[y.end]-w,d=[0,0],u=[0,0];d[f]=i[f]-s,d[b]=c,u[f]=i[f]+w-C,u[b]=c,a.push(is(e,r,"dashed",a.length,s,d,n.className,t)),a.push(is(e,r,"dashed",a.length,l,u,n.className,t))})})}),a),!0),(r=[g,f],o=[],["horizontal","vertical"].forEach(function(i){var n=O.filter(function(e){return e.type===i}),a=+("vertical"!==i),s=+!a,l=a?tW:tH,d=a?tH:tW,c=L[l.start],u=L[l.end],p=L[d.start],h=L[d.end];n.forEach(function(i){var n=i.gap,m=i.gapRects,g=i.className,f=Math.max.apply(Math,tg([p],m.map(function(e){return e.rect[d.start]}),!1)),b=Math.min.apply(Math,tg([h],m.map(function(e){return e.rect[d.end]}),!1)),x=(f+b)/2;f!==b&&x!==(p+h)/2&&m.forEach(function(i){var d=i.rect,h=[r[0],r[1]];if(d[l.end]0?1:-1)*1e-9),0===o&&(o=(c[1]>0?1:-1)*1e-9),[r,o]}var A=k();if(!s&&e.props.groupable){var E=(S.snapRenderInfo||{}).direction;M(E)&&(E[0]||E[1])&&(S.snapRenderInfo={direction:u,request:t.isRequest})}ns(e,"onBeforeScale",na(e,t,{scale:A,setFixedDirection:function(e){return a.setFixedDirection(e),A=k()},setScale:function(e){A=e}},!0));var _=[A[0]/g[0],A[1]/g[1]],I=l,T=[0,0];if(l||(I=!o&&s?iF(e,[0,0]):a.fixedPosition),s||(T=function(e,t,i,n,a){if(!tU(e,"scalable"))return[0,0];var r=a.startOffsetWidth,o=a.startOffsetHeight,s=a.fixedPosition,l=a.fixedDirection,d=a.is3d,c=ig(e,function(e,i){var n,c,u,p,h,m,g;return im((n=a,c=ec(t,[e/r,i/o]),u=n.transformOrigin,p=n.offsetMatrix,h=n.is3d,m=n.targetMatrix,iT(p,ed(m,eS(c,g=h?4:3),g),u,g)),r,o,l,s,d)},r,o,i,s,n,a);return[c[0]/r,c[1]/o]}(e,_,u,d,a)),w){C[0]&&C[1]&&T[0]&&T[1]&&(Math.abs(T[0]*p)>Math.abs(T[1]*h)?T[1]=0:T[0]=0);var L=!T[0]&&!T[1];if(L&&(f?_[0]=X(_[0]*g[0],y)/g[0]:_[1]=X(_[1]*g[1],y)/g[1]),C[0]&&!C[1]||T[0]&&!T[1]||L&&f){_[0]+=T[0];var j=p*_[0]*g[0]/b;_[1]=j/h/g[1]}else if(!C[0]&&C[1]||!T[0]&&T[1]||L&&!f){_[1]+=T[1];var P=h*_[1]*g[1]*b;_[0]=P/p/g[0]}}else _[0]+=T[0],_[1]+=T[1],T[0]||(_[0]=X(_[0]*g[0],y)/g[0]),T[1]||(_[1]=X(_[1]*g[1],y)/g[1]);0===_[0]&&(_[0]=(c[0]>0?1:-1)*1e-9),0===_[1]&&(_[1]=(c[1]>0?1:-1)*1e-9);var D=[_[0]/c[0],_[1]/c[1]];A=[_[0]*g[0],_[1]*g[1]];var N=(i=a.fixedDirection,n=I,iO(e,"scale(".concat(_.join(", "),")"),i,n,a)),R=eu(N,a.prevInverseDist||[0,0]);if(a.prevDist=_,a.prevInverseDist=N,A[0]===c[0]&&A[1]===c[1]&&R.every(function(e){return!e})&&!v)return!1;var O=iS(a,"scale(".concat(A.join(", "),")"),"scale(".concat(_.join(", "),")")),B=na(e,t,tm({offsetWidth:p,offsetHeight:h,direction:u,scale:A,dist:_,delta:D,isPinch:!!s},iR(e,O,R,s,t)));return ns(e,"onScale",B),B},dragControlEnd:function(e,t){var i=t.datas,n=t.isDrag;return!!i.isScale&&(i.isScale=!1,ns(e,"onScaleEnd",nr(e,t,{})),n)},dragGroupControlCondition:nb,dragGroupControlStart:function(e,t){var i=t.datas,n=this.dragControlStart(e,t);if(!n)return!1;var a=tI(e,"resizable",t);function r(t,n){var a=i.fixedDirection,r=i.fixedPosition,o=iM(n.datas.startPositions||ni(t.state),a),s=eh(eC(-e.rotation/180*Math.PI,3),[o[0]-r[0],o[1]-r[1],1],3),l=s[0],d=s[1];return n.datas.originalX=l,n.datas.originalY=d,n}i.moveableScale=e.scale;var o=tT(e,this,"dragControlStart",t,function(e,t){return r(e,t)}),s=function(e){n.setFixedDirection(e),o.forEach(function(t,i){t.setFixedDirection(e),r(t.moveable,a[i])})};i.setFixedDirection=s;var l=tm(tm({},n),{targets:e.props.targets,events:o,setFixedDirection:s});return i.isScale=!1!==ns(e,"onScaleGroupStart",l),!!i.isScale&&l},dragGroupControl:function(e,t){var i=t.datas;if(i.isScale){no(e,"onBeforeScale",function(i){ns(e,"onBeforeScaleGroup",na(e,t,tm(tm({},i),{targets:e.props.targets}),!0))});var n=this.dragControl(e,t);if(n){var a=i.moveableScale;e.scale=[n.scale[0]*a[0],n.scale[1]*a[1]];var r=e.props.keepRatio,o=n.dist,s=n.scale,l=i.fixedPosition,d=tT(e,this,"dragControl",t,function(t,i){var n=eh(eC(e.rotation/180*Math.PI,3),[i.datas.originalX*o[0],i.datas.originalY*o[1],1],3),a=n[0],d=n[1];return tm(tm({},i),{parentDist:null,parentScale:s,parentKeepRatio:r,dragClient:ec(l,[a,d])})}),c=tm({targets:e.props.targets,events:d},n);return ns(e,"onScaleGroup",c),c}}},dragGroupControlEnd:function(e,t){var i=t.isDrag;if(t.datas.isScale){this.dragControlEnd(e,t);var n=tT(e,this,"dragControlEnd",t),a=nr(e,t,{targets:e.props.targets,events:n});return ns(e,"onScaleGroupEnd",a),i}},request:function(){var e={},t=0,i=0;return{isControl:!0,requestStart:function(t){return{datas:e,parentDirection:t.direction||[1,1]}},request:function(n){return t+=n.deltaWidth,i+=n.deltaHeight,{datas:e,parentDist:[t,i],parentKeepRatio:n.keepRatio}},requestEnd:function(){return{datas:e,isDrag:!0}}}}},{name:"warpable",ableGroup:"size",props:{warpable:Boolean,renderDirections:Array},events:{onWarpStart:"warpStart",onWarp:"warp",onWarpEnd:"warpEnd"},render:function(e,t){var i=e.props,n=i.resizable,a=i.scalable,r=i.warpable,o=i.zoom;if(n||a||!r)return[];var s=e.state,l=s.pos1,d=s.pos2,c=s.pos3,u=s.pos4,p=nA(l,d),h=nA(d,l),m=nA(l,c),g=nA(c,l),f=nA(c,u),b=nA(u,c),x=nA(d,u),y=nA(u,d);return tg([t.createElement("div",{className:iH("line"),key:"middeLine1",style:i3(p,f,o)}),t.createElement("div",{className:iH("line"),key:"middeLine2",style:i3(h,b,o)}),t.createElement("div",{className:iH("line"),key:"middeLine3",style:i3(m,x,o)}),t.createElement("div",{className:iH("line"),key:"middeLine4",style:i3(g,y,o)})],tL(e,tw,t),!0)},dragControlCondition:function(e,t){return!t.isRequest&&J(t.inputEvent.target,iH("direction"))},dragControlStart:function(e,t){var i=t.datas,n=t.inputEvent,a=e.props.target,r=ne(n.target);if(!r||!a)return!1;var o=e.state,s=o.transformOrigin,l=o.is3d,d=o.targetTransform,c=o.targetMatrix,u=o.width,p=o.height,h=o.left,m=o.top;i.datas={},i.targetTransform=d,i.warpTargetMatrix=l?c:es(c,3,4),i.targetInverseMatrix=ea(er(i.warpTargetMatrix,4),3,4),i.direction=r,i.left=h,i.top=m,i.poses=[[0,0],[u,0],[0,p],[u,p]].map(function(e){return eu(e,s)}),i.nextPoses=i.poses.map(function(e){var t=e[0],n=e[1];return eh(i.warpTargetMatrix,[t,n,0,1],4)}),i.startValue=ew(4),i.prevMatrix=ew(4),i.absolutePoses=ni(o),i.posIndexes=i_(r),iC(e,t),ij(t,"matrix3d"),o.snapRenderInfo={request:t.isRequest,direction:r};var g=na(e,t,tm({set:function(e){i.startValue=e}},iL(t)));return!1!==ns(e,"onWarpStart",g)&&(i.isWarp=!0),i.isWarp},dragControl:function(e,t){var i=t.datas,n=t.isRequest,a=t.distX,r=t.distY,o=i.targetInverseMatrix,s=i.prevMatrix,l=i.isWarp,d=i.startValue,c=i.poses,u=i.posIndexes,p=i.absolutePoses;if(!l)return!1;if(iw(t,"matrix3d"),tU(e,"warpable")){var h=u.map(function(e){return p[e]});h.length>1&&h.push([(h[0][0]+h[1][0])/2,(h[0][1]+h[1][1])/2]);var m=ic(e,n,{horizontal:h.map(function(e){return e[1]+r}),vertical:h.map(function(e){return e[0]+a})}),g=m.horizontal,f=m.vertical;r-=g.offset,a-=f.offset}var b=iE({datas:i,distX:a,distY:r},!0),x=i.nextPoses.slice();if(u.forEach(function(e){x[e]=ec(x[e],b)}),!tC.every(function(e){var t,i,n,a,r;return t=e.map(function(e){return c[e]}),i=e.map(function(e){return x[e]}),n=nE(t[0],t[1],t[2]),a=nE(i[0],i[1],i[2]),(!(n>=(r=Math.PI))||!(a<=r))&&(!(n<=r)||!(a>=r))}))return!1;var y=eA(c[0],c[2],c[1],c[3],x[0],x[2],x[1],x[3]);if(!y.length)return!1;var v=ik(i,ed(o,y,4),!0),C=ed(er(s,4),v,4);i.prevMatrix=v;var w=ed(d,v,4),S=iS(i,"matrix3d(".concat(w.join(", "),")"),"matrix3d(".concat(v.join(", "),")"));return iD(t,S),ns(e,"onWarp",na(e,t,{delta:C,matrix:w,dist:v,multiply:ed,transform:S})),!0},dragControlEnd:function(e,t){var i=t.datas,n=t.isDrag;return!!i.isWarp&&(i.isWarp=!1,ns(e,"onWarpEnd",nr(e,t,{})),n)}},{name:"scrollable",canPinch:!0,props:{scrollable:Boolean,scrollContainer:Object,scrollThreshold:Number,getScrollPosition:Function},events:{onScroll:"scroll",onScrollGroup:"scrollGroup"},dragRelation:"strong",dragStart:function(e,t){var i=e.props.scrollContainer,n=void 0===i?e.getContainer():i,a=new e2,r=nx(n,!0);t.datas.dragScroll=a;var o=t.isControl?"controlGesto":"targetGesto",s=t.targets;a.on("scroll",function(i){var n=na(e,t,{scrollContainer:i.container,direction:i.direction});s&&(n.targets=s),ns(e,s?"onScrollGroup":"onScroll",n)}).on("move",function(i){var n=i.offsetX,a=i.offsetY;e[o].scrollBy(n,a,t.inputEvent,!1)}),a.dragStart(t,{container:r})},checkScroll:function(e,t){var i=t.datas.dragScroll;if(i){var n=e.props,a=n.scrollContainer,r=void 0===a?e.getContainer():a,o=n.scrollThreshold,s=n.getScrollPosition,l=void 0===s?nD:s;return i.drag(t,{container:r,threshold:void 0===o?0:o,getScrollPosition:function(e){return l({scrollContainer:e.container,direction:e.direction})}}),!0}},drag:function(e,t){return this.checkScroll(e,t)},dragEnd:function(e,t){t.datas.dragScroll.dragEnd(),t.datas.dragScroll=null},dragControlStart:function(e,t){return this.dragStart(e,tm(tm({},t),{isControl:!0}))},dragControl:function(e,t){return this.drag(e,t)},dragControlEnd:function(e,t){return this.dragEnd(e,t)},dragGroupStart:function(e,t){return this.dragStart(e,tm(tm({},t),{targets:e.props.targets}))},dragGroup:function(e,t){return this.drag(e,tm(tm({},t),{targets:e.props.targets}))},dragGroupEnd:function(e,t){return this.dragEnd(e,tm(tm({},t),{targets:e.props.targets}))},dragGroupControlStart:function(e,t){return this.dragStart(e,tm(tm({},t),{targets:e.props.targets,isControl:!0}))},dragGroupContro:function(e,t){return this.drag(e,tm(tm({},t),{targets:e.props.targets}))},dragGroupControEnd:function(e,t){return this.dragEnd(e,tm(tm({},t),{targets:e.props.targets}))}},nR,nP,{name:"originDraggable",props:{originDraggable:Boolean,originRelative:Boolean},events:{onDragOriginStart:"dragOriginStart",onDragOrigin:"dragOrigin",onDragOriginEnd:"dragOriginEnd"},css:[":host[data-able-origindraggable] .control.origin {\n pointer-events: auto;\n}"],dragControlCondition:function(e,t){return t.isRequest?"originDraggable"===t.requestAble:J(t.inputEvent.target,iH("origin"))},dragControlStart:function(e,t){var i=t.datas;iC(e,t);var n=na(e,t,{dragStart:iy.dragStart(e,new t_().dragStart([0,0],t))}),a=ns(e,"onDragOriginStart",n);return(i.startOrigin=e.state.transformOrigin,i.startTargetOrigin=e.state.targetOrigin,i.prevOrigin=[0,0],i.isDragOrigin=!0,!1===a)?(i.isDragOrigin=!1,!1):n},dragControl:function(e,t){var i=t.datas,n=t.isPinch,a=t.isRequest;if(!i.isDragOrigin)return!1;var r=iE(t),o=r[0],s=r[1],l=e.state,d=l.width,c=l.height,u=l.offsetMatrix,p=l.targetMatrix,h=l.is3d,m=e.props.originRelative,g=void 0===m||m,f=h?4:3,b=[o,s];if(a){var x=t.distOrigin;(x[0]||x[1])&&(b=x)}var y=ec(i.startOrigin,b),v=ec(i.startTargetOrigin,b),C=eu(b,i.prevOrigin),w=iT(u,p,y,f),S=e.getRect(),k=iJ(iQ(w,d,c,f)),A=[S.left-k.left,S.top-k.top];i.prevOrigin=b;var E=[ng(v[0],d,g),ng(v[1],c,g)].join(" "),_=na(e,t,{width:d,height:c,origin:y,dist:b,delta:C,transformOrigin:E,drag:iy.drag(e,tE(t,e.state,A,!!n,!1))});return ns(e,"onDragOrigin",_),_},dragControlEnd:function(e,t){return!!t.datas.isDragOrigin&&(ns(e,"onDragOriginEnd",nr(e,t,{})),!0)},dragGroupControlCondition:function(e,t){return this.dragControlCondition(e,t)},dragGroupControlStart:function(e,t){return!!this.dragControlStart(e,t)},dragGroupControl:function(e,t){var i=this.dragControl(e,t);return!!i&&(e.transformOrigin=i.transformOrigin,!0)},request:function(e){var t={},i=e.getRect(),n=0,a=0,r=i.transformOrigin,o=[0,0];return{isControl:!0,requestStart:function(){return{datas:t}},request:function(e){return"deltaOrigin"in e?(o[0]+=e.deltaOrigin[0],o[1]+=e.deltaOrigin[1]):"origin"in e?(o[0]=e.origin[0]-r[0],o[1]=e.origin[1]-r[1]):("x"in e?n=e.x-i.left:"deltaX"in e&&(n+=e.deltaX),"y"in e?a=e.y-i.top:"deltaY"in e&&(a+=e.deltaY)),{datas:t,distX:n,distY:a,distOrigin:o}},requestEnd:function(){return{datas:t,isDrag:!0}}}}},n1,{name:"roundable",props:{roundable:Boolean,roundRelative:Boolean,minRoundControls:Array,maxRoundControls:Array,roundClickable:Boolean},events:{onRoundStart:"roundStart",onRound:"round",onRoundEnd:"roundEnd"},css:[".control.border-radius {\n background: #d66;\n cursor: pointer;\n}",":host[data-able-roundable] .line.direction {\n cursor: pointer;\n}"],render:function(e,t){var i=e.state,n=i.target,a=i.width,r=i.height,o=i.allMatrix,s=i.is3d,l=i.left,d=i.top,c=i.borderRadiusState,u=e.props,p=u.minRoundControls,h=u.maxRoundControls,m=void 0===h?[4,4]:h,g=u.zoom;if(!n)return null;var f=s?4:3,b=n2(n,a,r,void 0===p?[0,0]:p,c);if(!b)return null;var x=0,y=0;return b.map(function(e,i){y+=Math.abs(e.horizontal),x+=Math.abs(e.vertical);var n=eu(iX(o,e.pos,f),[l,d]),a=e.vertical?x<=m[1]:y<=m[0];return t.createElement("div",{key:"borderRadiusControl".concat(i),className:iH("control","border-radius"),"data-radius-index":i,style:{display:a?"block":"none",transform:"translate(".concat(n[0],"px, ").concat(n[1],"px) scale(").concat(g,")")}})})},dragControlCondition:function(e,t){if(!t.inputEvent||t.isRequest)return!1;var i=t.inputEvent.target.getAttribute("class")||"";return i.indexOf("border-radius")>-1||i.indexOf("moveable-line")>-1&&i.indexOf("moveable-direction")>-1},dragControlStart:function(e,t){var i=t.inputEvent,n=t.datas,a=i.target,r=a.getAttribute("class")||"",o=r.indexOf("border-radius")>-1,s=r.indexOf("moveable-line")>-1&&r.indexOf("moveable-direction")>-1,l=o?parseInt(a.getAttribute("data-radius-index"),10):-1,d=s?parseInt(a.getAttribute("data-line-index"),10):-1;if(!o&&!s||!1===ns(e,"onRoundStart",na(e,t,{})))return!1;n.lineIndex=d,n.controlIndex=l,n.isControl=o,n.isLine=s,iC(e,t);var c=e.props,u=c.roundRelative,p=c.minRoundControls,h=e.state,m=h.target,g=h.width,f=h.height;n.isRound=!0,n.prevDist=[0,0];var b=n2(m,g,f,void 0===p?[0,0]:p)||[];return n.controlPoses=b,h.borderRadiusState=nU(b.map(function(e){return e.pos}),b,u,g,f).styles.join(" "),!0},dragControl:function(e,t){var i=t.datas;if(!i.isRound||!i.isControl||!i.controlPoses.length)return!1;var n=i.controlIndex,a=i.controlPoses,r=iE(t),o=r[0],s=r[1],l=[o,s],d=eu(l,i.prevDist),c=e.props.maxRoundControls,u=void 0===c?[4,4]:c,p=e.state,h=p.width,m=p.height,g=a[n],f=g.vertical,b=g.horizontal,x=a.map(function(e){var t=e.horizontal,i=e.vertical,n=[t*b*l[0],i*f*l[1]];if(t){if(1===u[0])return n;else if(u[0]<4&&t!==b)return n}else if(0===u[1])return n[1]=i*b*l[0]/h*m,n;else if(f){if(1===u[1])return n;else if(u[1]<4&&i!==f)return n}return[0,0]});x[n]=l;var y=a.map(function(e,t){return ec(e.pos,x[t])});return i.prevDist=[o,s],n3(e,t,l,d,a,y),!0},dragControlEnd:function(e,t){var i=e.state;i.borderRadiusState="";var n=t.datas,a=t.isDouble;if(!n.isRound)return!1;var r=i.width,o=i.height,s=n.isControl,l=n.controlIndex,d=n.isLine,c=n.lineIndex,u=n.controlPoses,p=u.map(function(e){return e.pos}),h=p.length,m=e.props.roundClickable;if(a&&(void 0===m||m)){if(s)n$(u,p,l,0);else if(d){var g,f,b,x,y,v,C,w=iv(e,t),S=w[0],k=w[1];f=(g=nK(u)).horizontals,b=g.verticals,x=f.length,y=b.length,v=-1,C=-1,0===c?0===x?v=0:1===x&&(v=1):3===c&&(x<=2?v=2:x<=3&&(v=3)),2===c?0===y?C=0:y<4&&(C=3):1===c&&(y<=1?C=1:y<=2&&(C=2)),nZ(u,p,0,v,C,S,k,r,o)}h!==u.length&&n3(e,t,[0,0],[0,0],u,p)}return ns(e,"onRoundEnd",nr(e,t,{})),i.borderRadiusState="",!0},unset:function(e){e.state.borderRadiusState=""}},at,ar,ai,nj,n4],as=ao.reduce(function(e,t){return tm(tm({},e),"events"in t?t.events:{})},{}),al=ao.reduce(function(e,t){return tm(tm({},e),t.props)},{});function ad(e,t){return Math.max.apply(Math,e.map(function(e){var i=e[0],n=e[1],a=e[2],r=e[3];return Math.max(i[t],n[t],a[t],r[t])}))}function ac(e,t){return Math.min.apply(Math,e.map(function(e){var i=e[0],n=e[1],a=e[2],r=e[3];return Math.min(i[t],n[t],a[t],r[t])}))}Object.keys(function(e){var t={};for(var i in e)t[e[i]]=i;return t}(as)),Object.keys(al);var au=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.differ=new ez,t.moveables=[],t.transformOrigin="50% 50%",t}th(t,e);var i=t.prototype;return i.checkUpdate=function(){this.updateAbles()},i.updateRect=function(e,t,i){if(void 0===i&&(i=!0),this.controlBox){this.moveables.forEach(function(t){t.updateRect(e,!1,!1)});var n=this.state,a=this.props,r=n.target||a.target;(!t||""!==e&&a.updateGroup)&&(this.rotation=a.defaultGroupRotate,this.transformOrigin=a.defaultGroupOrigin||"50% 50%",this.scale=[1,1]);var o=this.rotation,s=this.scale,l=function(e,t){if(!e.length)return[0,0,0,0];var i=e.map(function(e){return ni(e.state)}),n=1e10,a=1e10,r=0,o=0,s=X(t,1e-7);if(s%90){var l=s/180*Math.PI,d=Math.tan(l),c=-1/d,u=[-1e10,1e10],p=[-1e10,1e10];i.forEach(function(e){e.forEach(function(e){var t=e[1]-d*e[0],i=e[1]-c*e[0];u[0]=Math.max(u[0],t),u[1]=Math.min(u[1],t),p[0]=Math.max(p[0],i),p[1]=Math.min(p[1],i)})}),u.forEach(function(e){p.forEach(function(t){var i=(t-e)/(d-c);n=Math.min(n,i),a=Math.min(a,d*i+e)})});var h=i.map(function(e){var t=e[0],i=e[1],n=e[2],a=e[3];return[ex(t,-l),ex(i,-l),ex(n,-l),ex(a,-l)]});r=ad(h,0)-ac(h,0),o=ad(h,1)-ac(h,1)}else if(n=ac(i,0),a=ac(i,1),r=ad(i,0)-n,o=ad(i,1)-a,s%180){var m=r;r=o,o=m}return[n,a,r,o]}(this.moveables,o),d=l[0],c=l[1],u=l[2],p=l[3],h="rotate(".concat(o,"deg) scale(").concat(s[0]>=0?1:-1,", ").concat(s[1]>=0?1:-1,")");r.style.cssText+="left:0px;top:0px; transform-origin: ".concat(this.transformOrigin,"; width:").concat(u,"px; height:").concat(p,"px;")+"transform:".concat(h),n.width=u,n.height=p;var m=this.getContainer(),g=i9(this.controlBox.getElement(),r,this.controlBox.getElement(),this.getContainer(),this.props.rootContainer||m),f=[g.left,g.top],b=ni(g),x=b[0],y=b[1],v=b[2],C=b[3],w=eU([x,y,v,C]),S=[w.minX,w.minY];g.pos1=eu(x,S),g.pos2=eu(y,S),g.pos3=eu(v,S),g.pos4=eu(C,S),g.left=d-g.left+S[0],g.top=c-g.top+S[1],g.origin=eu(ec(f,g.origin),S),g.beforeOrigin=eu(ec(f,g.beforeOrigin),S),g.originalBeforeOrigin=ec(f,g.originalBeforeOrigin);var k=g.targetClientRect,A=s[0]*s[1]>0?1:-1;k.top+=g.top-n.top,k.left+=g.left-n.left,r.style.transform="translate(".concat(-S[0],"px, ").concat(-S[1],"px) ").concat(h),this.updateState(tm(tm({},g),{direction:A,beforeDirection:A}),i)}},i.getRect=function(){return tm(tm({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(e){return e.getRect()})})},i.triggerEvent=function(t,i,n){if(n||t.indexOf("Group")>-1)return e.prototype.triggerEvent.call(this,t,i);this._emitter.trigger(t,i)},i.updateAbles=function(){e.prototype.updateAbles.call(this,tg(tg([],this.props.ables,!0),[at],!1),"Group")},i._updateTargets=function(){e.prototype._updateTargets.call(this),this._prevTarget=this.props.dragTarget||this.areaElement},i._updateEvents=function(){var e=this.state,t=this.props,i=this._prevTarget,n=t.dragTarget||this.areaElement;i!==n&&(nn(this,"targetGesto"),nn(this,"controlGesto"),e.target=null),e.target||(e.target=this.areaElement,this.controlBox.getElement().style.display="block"),e.target&&(this.targetGesto||(this.targetGesto=n9(this,n,"Group")),this.controlGesto||(this.controlGesto=n8(this,this.controlBox.getElement(),"controlAbles","GroupControl")));var a=!nc(e.container,t.container);a&&(e.container=t.container);var r=this.differ.update(t.targets),o=r.added,s=r.changed,l=r.removed;(a||o.length||s.length||l.length)&&this.updateRect()},i._updateObserver=function(){},t.defaultProps=tm(tm({},ae.defaultProps),{transformOrigin:["50%","50%"],groupable:!0,dragArea:!0,keepRatio:!0,targets:[],defaultGroupRotate:0,defaultGroupOrigin:"50% 50%"}),t}(ae),ap=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.moveables=[],t}th(t,e);var i=t.prototype;return i.render=function(){var e=this,t=this.props,i=t.cspNonce,n=t.cssStyled,a=t.targets;return e3.createElement(n,{cspNonce:i,ref:v(this,"controlBox"),className:iH("control-box")},a.map(function(t,i){return e3.createElement(ae,tm({key:"moveable"+i,ref:C(e,"moveables",i)},e.props,{target:t,wrapperMoveable:e}))}))},i.componentDidUpdate=function(){},i.updateRect=function(e,t,i){void 0===i&&(i=!0),this.moveables.forEach(function(n){n.updateRect(e,t,i)})},i.getRect=function(){return tm(tm({},e.prototype.getRect.call(this)),{children:this.moveables.map(function(e){return e.getRect()})})},i.request=function(){return{request:function(){return this},requestEnd:function(){return this}}},i.dragStart=function(){return this},i.hitTest=function(){return 0},i.isInside=function(){return!1},i.isDragging=function(){return!1},i.updateRenderPoses=function(){},i.checkUpdate=function(){},i.triggerEvent=function(){},i.updateAbles=function(){},i._updateEvents=function(){},i._updateObserver=function(){},t}(ae),ah=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.refTargets=[],t.selectorMap={},t}th(t,e);var i,n=t.prototype;return t.makeStyled=function(){var e={};this.getTotalAbles().forEach(function(t){var i=t.css;i&&i.forEach(function(t){e[t]=!0})});var t=V(e).join("\n");this.defaultStyled=tu("div",(tv+t).replace(/([^}{]*){/gm,function(e,t){return t.replace(/\.([^{,\s\d.]+)/g,"."+ty+"$1")+"{"}))},t.getTotalAbles=function(){return tg([nN,at,ar,nj],this.defaultAbles,!0)},n.render=function(){var e,t,i,n=this.constructor;n.defaultStyled||n.makeStyled();var a=this.props,r=a.ables,o=a.props,s=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(i[n[a]]=e[n[a]]);return i}(a,["ables","props"]),l=(e=this._updateRefs(!0),t=this.selectorMap,i=[],e.forEach(function(e){if(e){if(T(e)){t[e]&&i.push.apply(i,t[e]);return}i.push(e)}}),i),d=l.length>1,c=tg(tg([],n.getTotalAbles(),!0),r||[],!0),u=tm(tm(tm({},s),o||{}),{ables:c,cssStyled:n.defaultStyled,customStyledMap:n.customStyledMap});return d?s.individualGroupable?e3.createElement(ap,tm({key:"individual-group",ref:v(this,"moveable")},u,{target:null,targets:l})):e3.createElement(au,tm({key:"group",ref:v(this,"moveable")},u,{target:null,targets:l})):e3.createElement(ae,tm({key:"single",ref:v(this,"moveable")},u,{target:l[0]}))},n.componentDidMount=function(){this._updateRefs()},n.componentDidUpdate=function(){this._updateRefs()},n.componentWillUnmount=function(){this.selectorMap={},this.refTargets=[]},n.getManager=function(){return this.moveable},n._updateRefs=function(e){var t=this.refTargets,i=ny(this.props.target||this.props.targets),n="u">typeof document,a=t.length!==i.length||t.some(function(e,t){var n=i[t];if((e||n)&&e!==n)return!0;return!1}),r=this.selectorMap,o={};return this.refTargets.forEach(function(e){T(e)&&(r[e]?o[e]=r[e]:n&&(a=!0,o[e]=[].slice.call(document.querySelectorAll(e))))}),this.refTargets=i,this.selectorMap=o,!e&&a&&this.forceUpdate(),i},t.defaultAbles=[],t.customStyledMap={},t.defaultStyled=null,!function(e,t,i,n){var a,r=arguments.length,o=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,i,o):a(t,i))||o);r>3&&o&&Object.defineProperty(t,i,o)}([(void 0===i&&(i={}),function(e,t){tA.forEach(function(n){var a=i[n]||n;a in e||(e[a]=function(){for(var e,i=[],a=0;a{"use strict";let t=new(e.i(161385)).EventEmitter;e.s(["eventEmitter",0,t])},456389,428624,e=>{"use strict";var t=e.i(391398),i=e.i(441224),n=e.i(28561),a=e.i(191788),r=e.i(220019);e.i(312434);var o=e.i(487914),s=e.i(418755),l=e.i(949833),d=e.i(316353),c=e.i(753748);let u=["0%","0%","0%","0%"],p=e=>{let t=Array.isArray(e)&&e.length>=4&&e.every(e=>"string"==typeof e);return t||null==e||console.warn("[isValidClipPath] Invalid clipPath value detected",{clipPath:e}),t},h="clippable-control-wrapper",m=(e,t,i)=>e/Math.sqrt((t*t+i*i)/2)*100,g=(e,t,i)=>e/100*Math.sqrt((t*t+i*i)/2),f=(e,t,i)=>{if("circle"===e){let e=Math.min(t,i)/2;return[`${m(e,t,i)}%`,"at","50%","50%"]}return u},b=(e,t,i)=>"circle"===e?1:"inset"===e?t/i:null,x=(e,t,i,n)=>{let[a,r,o,s]=e;if("inset"===t){let t=parseFloat(a),d=parseFloat(r),c=parseFloat(o),u=parseFloat(s),p=l.MIN_WIDTH_OR_HEIGHT_PIXELS/i*100,h=l.MIN_WIDTH_OR_HEIGHT_PIXELS/n*100;if(100-u-d=0?e[1]=`${t}%`:(e[1]="0%",e[3]=`${100-p}%`)}if(100-t-c=0?e[2]=`${i}%`:(e[2]="0%",e[0]=`${100-h}%`)}}else if("circle"===t){let t=Math.max(g(parseFloat(a),i,n),l.MIN_WIDTH_OR_HEIGHT_PIXELS);e[0]=`${m(t,i,n)}%`}},y=({clipType:e,clipStyles:t,w:i,h:n})=>{let[a,r,o,s]=t;if("inset"===e){let e=parseFloat(a),t=parseFloat(r),i=parseFloat(o),n=parseFloat(s),l=n/(t+n)*100,d=e/(e+i)*100,c=isNaN(l)?50:l,u=isNaN(d)?50:d,p=100-n-t,h=100-e-i;return{mask:` linear-gradient(#000 0 0) ${c}% ${u}% / ${p}% ${h}%, linear-gradient(rgba(0,0,0,0.4) 0 0)`,width:p,height:h,top:e,right:t,bottom:i,left:n}}if("circle"===e){let e=parseFloat(a),t=parseFloat(o),r=parseFloat(s),l=g(e,i,n),d=r/100*n-l,c=t/100*i-l,u=2*l/i*100,p=2*l/n*100;return{mask:`radial-gradient(${u}% ${p}% at ${t}% ${r}%, black 50%, rgba(0, 0, 0, 0.4) 50%) no-repeat`,width:u,height:p,top:Math.max(d/n*100,0),left:Math.max(c/i*100,0),bottom:0,right:0}}return{mask:"",width:0,height:0,top:0,left:0,bottom:0,right:0}},v=(0,r.makeMoveable)([r.Clippable]),C={[`.${h}`]:{zIndex:2,".moveable-control":{zIndex:2,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal"},"&.data-clip-type-inset":{".moveable-control":{zIndex:2,bg:"0 none !important",borderRadius:"0px",width:"16px",height:"16px",border:"6px solid var(--chakra-colors-trueblue-300)",'&[data-clip-index="0"]':{borderRight:"0",borderBottom:"0",marginTop:"-2px",marginLeft:"-2px",cursor:"nw-resize"},'&[data-clip-index="1"]':{borderRight:"0",borderBottom:"0",borderLeft:"0",marginTop:"-2px",cursor:"n-resize"},'&[data-clip-index="2"]':{borderLeft:"0",borderBottom:"0",marginTop:"-2px",marginLeft:"-14px",cursor:"ne-resize"},'&[data-clip-index="3"]':{borderBottom:"0",borderTop:"0",borderLeft:"0",marginLeft:"-14px",cursor:"e-resize"},'&[data-clip-index="4"]':{borderTop:"0",borderLeft:"0",marginLeft:"-14px",marginTop:"-14px",cursor:"se-resize"},'&[data-clip-index="5"]':{borderTop:"0",borderLeft:"0",borderRight:"0",marginTop:"-14px",cursor:"s-resize"},'&[data-clip-index="6"]':{borderTop:"0",borderRight:"0",marginTop:"-14px",marginLeft:"-2px",cursor:"sw-resize"},'&[data-clip-index="7"]':{borderTop:"0",borderBottom:"0",borderRight:"0",marginLeft:"-2px",cursor:"w-resize"}}},"&.data-clip-type-circle":{".moveable-control":{bg:"trueblue.300"}},".moveable-clip-ellipse":{borderWidth:"2px",borderColor:"var(--chakra-colors-trueblue-300) !important"},".moveable-line":{display:"none"}}};e.s(["ClippableControls",0,({clipPath:e,clipAspectRatio:r,updateResizeAttrs:l,imageWrapperRef:u,refreshDeps:m,currentWidth:g,currentHeight:C,onFinishCrop:w})=>{let S=(0,s.useAppDispatch)(),k=(0,s.useAppSelector)(c.selectClipType),A=(0,a.useRef)(null),[E,_]=(0,a.useState)({clipPath:p(e)?e:f(k,g,C),clipAspectRatio:r||b(k,g,C)}),I=(0,a.useCallback)(e=>{if(!g||!C||!u.current)return;let{mask:t}=y({w:g,h:C,clipType:k,clipStyles:e});u.current.style["-webkit-mask"]=t,u.current.style["-webkit-mask-repeat"]="no-repeat"},[u,k,g,C]),M=JSON.stringify(E.clipPath);(0,a.useEffect)(()=>{I(E.clipPath)},[I,M,E.clipPath]),(0,i.useUpdateEffect)(()=>{_(e=>({...e,clipPath:f(k,g,C),clipAspectRatio:b(k,g,C)}))},[k]),(0,a.useEffect)(()=>{A.current?.updateTarget()},[m]);let T=(0,a.useCallback)(()=>{let e={clipType:k,...E};e.clipAspectRatio&&e.clipPath&&l(e)},[l,E,k]),L=(0,a.useRef)({fn:T,confirmOnUnmount:!0});L.current.fn=T,(0,a.useEffect)(()=>d.eventEmitter.on("endClip",({confirm:e})=>{L.current.confirmOnUnmount=e,S((0,c.endCropping)()),w&&w()}),[S,w]),(0,a.useEffect)(()=>{let e=L.current;return()=>{e.confirmOnUnmount&&setTimeout(e.fn,0)}},[]),(0,a.useEffect)(()=>o.keyboardHandler.on("keydown","CLIPPABLE",e=>!!(0,n.default)("mod+x")(e)&&(e.preventDefault(),!0)),[]);let j=`${k}(${(E.clipPath||f(k,g,C)).join(" ")})`;return(0,t.jsx)(v,{ref:e=>{A.current=e},className:`${h} data-clip-type-${k}`,target:u.current,renderDirections:["ne","nw","se","sw"],origin:!1,draggable:!1,clippable:!0,clipTargetBounds:!0,clipRelative:!0,clipArea:!0,defaultClipPath:k,customClipPath:j,dragWithClip:!0,keepRatio:"circle"===k,onClip:({clipStyles:e,clipType:t})=>{x(e,t,g,C),I(e)},onClipEnd:({lastEvent:e})=>{if(!e?.clipStyles)return;let{clipStyles:t,clipType:i}=e;x(t,i,g,C),_({clipPath:t,clipAspectRatio:((e,t)=>{if("inset"===t){let[t,i]=e[0],[n,a]=e[4];return(n-t)/(a-i)}return 1})(e.poses,k)})}})},"ClippableStyles",0,C,"getCustomClipData",0,(e,t,i,n)=>{if(!e||!e.clipType||!n)return{clipType:"inset",scaleCrop:1,scaleX:1,scaleY:1,aspectRatio:n||void 0,referenceXOffset:1,referenceYOffset:1,clipPathCSSString:"",translateX:0,translateY:0};let a=p(e.clipPath)?e.clipPath:f(e.clipType,t,i),{clipType:r}=e,{width:o,height:s,top:l,left:d,right:c,bottom:u}=y({w:t,h:i,clipType:r,clipStyles:a}),h=100/o,m=100/s,g=e?.clipAspectRatio||1,b=e?.clipAspectRatio||n;return{scaleCrop:n/g<1?Math.min(m,h):Math.max(m,h),aspectRatio:b,scaleX:h,scaleY:m,translateX:d,translateY:l,referenceXOffset:t*(100/(100-d+c)-1),referenceYOffset:i*(100/(100-l+u)-1),clipPathCSSString:`${r}(${a.join(" ")})`,clipType:r}},"isValidClipPath",0,p],456389),e.s(["DOC_Z_INDEXES",0,{presentBg:1,customerLogo:4,cardButtons:11,siteNav:21,filmstrip:21,toolbar:22,nestedCardBody:2,nestedCardBodyWithComment:3,cardDivider:1,resizeableWrapper:11,commentsStack:21,commentsStackOpen:1501,commentsPopup:1100,insertWidget:1100,panel:"calc(var(--chakra-zIndices-modal) + 1)",bottomRightControls:"calc(var(--chakra-zIndices-modal) + 2)",onboardingChecklist:"calc(var(--chakra-zIndices-modal) + 2)"}],428624)},599294,e=>{"use strict";var t=e.i(476116),i=e.i(979021),n=e.i(191788),a=e.i(161385);class r extends a.EventEmitter{emitResize;constructor(){super(),this.emitResize=e=>{this.emit("resize",e)},document.addEventListener("containerResize",this.emitResize)}cleanup(){document.removeEventListener("containerResize",this.emitResize)}}let o=(0,t.default)(()=>new r);e.s(["dispatchContainerResizeEvent",0,e=>{e.dispatchEvent(new Event("containerResize",{bubbles:!0}))},"useContainerResizing",0,(e,t=250)=>{let[a,r]=(0,n.useState)(!1),s=(0,n.useMemo)(o,[]);return(0,n.useEffect)(()=>{let n,a=(0,i.default)(i=>{let{target:a}=i;a&&e.current&&((e,t)=>{let i=e;do{if(i!==t)continue;return!0}while(i=i.parentElement)return!1})(e.current,a)&&(clearTimeout(n),r(!0),n=setTimeout(()=>{r(!1)},t+100))},t,{leading:!0,trailing:!1,maxWait:t});return s.on("resize",a)},[s,t,e]),a}])},685290,529545,e=>{"use strict";var t=e.i(456389),i=e.i(391398),n=e.i(441224),a=e.i(357790),r=e.i(131254),o=e.i(191788),s=e.i(220019),l=e.i(428624);e.i(905506);var d=e.i(274970),c=e.i(599294),u=e.i(949833);let p="resizeable-control-wrapper",h=(0,s.makeMoveable)([s.Resizable]),m=(e,t)=>Math.max(e,u.MIN_WIDTH_OR_HEIGHT_PIXELS*Math.max(t.clientWidth/t.clientHeight,1)),g={[`.${p}`]:{zIndex:`${l.DOC_Z_INDEXES.resizeableWrapper}`,".moveable-control":{bg:"white",border:"2px solid var(--chakra-colors-trueblue-300)",w:"8px",h:"8px",opacity:1,zIndex:10,borderRadius:0,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal","&.moveable-ne, &.moveable-sw":{cursor:"nesw-resize"},"&.moveable-nw, &.moveable-se":{cursor:"nwse-resize"},"&.moveable-se, &.moveable-ne, &.moveable-e":{marginLeft:"-5px"},"&.moveable-sw, &.moveable-nw, &.moveable-w":{marginLeft:"-3px"},"&.moveable-ne, &.moveable-nw, &.moveable-n":{marginTop:"-3px"},"&.moveable-se, &.moveable-sw, &.moveable-s":{marginTop:"-5px"},"&.moveable-e, &.moveable-w":{cursor:"ew-resize",marginTop:"-4px"},"&.moveable-n, &.moveable-s":{cursor:"ns-resize",marginLeft:"-4px"}},".moveable-line":{display:"none"}}};e.s(["ResizableControls",0,({imageWrapperRef:e,setIsResizing:t,updateResizeAttrs:n,refreshDeps:s,keepRatio:l=!0,onResizing:d})=>{let c=(0,o.useRef)(null);return(0,o.useEffect)(()=>{let e=()=>{c.current?.updateRect(),c.current?.updateTarget()},t=requestAnimationFrame(e),i=setTimeout(()=>requestAnimationFrame(e),300);return()=>{cancelAnimationFrame(t),clearTimeout(i)}},[s]),(0,o.useEffect)(()=>{let e=()=>{requestAnimationFrame(()=>{c.current?.updateTarget()})},t=(0,r.default)(e,250);return document.addEventListener("drop",e),window.addEventListener("resize",t),()=>{document.removeEventListener("drop",e),window.removeEventListener("resize",t)}},[]),(0,i.jsx)(h,{ref:e=>{c.current=e},className:p,target:e.current,renderDirections:["se","nw","sw","ne","n","s","e","w"],keepRatio:l,draggable:!1,resizable:!0,origin:!1,onResizeStart:()=>{t(!0)},onResize:({target:e,width:t,height:i})=>{let n=m(t,e),a=l?i:m(i,e);e.style.width=`${n}px`,l||(e.style.height=`${a}px`),d?.({width:n,height:a})},onResizeEnd:({target:e})=>{let i=e.clientWidth,r=e.clientHeight,o=parseFloat(getComputedStyle(e).fontSize)/a.BASE_FONT_SIZE;n({width:i/o,height:l?null:r/o,isAuto:!1}),t(!1),e.style.width="",e.style.height=""}})},"ResizeableStyles",0,g,"useResizeable",0,function(e){let[t,i]=(0,o.useState)(!1),a=(0,d.useWindowResizing)(),r=(0,o.useRef)(null),s=(0,c.useContainerResizing)(r),[l,u]=(0,o.useState)(!1),p=(0,o.useCallback)(()=>{e.commands.forceHideBubbleMenu?.(!0),i(!0)},[e]),h=(0,o.useCallback)(()=>{e.commands.forceHideBubbleMenu?.(!1),i(!1)},[e]);return(0,n.useUpdateEffect)(()=>{e.commands.forceHideBubbleMenu?.(l||s)},[e,l,s]),{ref:r,isResizing:l,setIsResizing:u,isAnimating:t,resizeableSx:{".moveable-control":{display:a||s||t?"none":""}},onLayoutAnimationStart:p,onLayoutAnimationComplete:h}}],529545);let f={...t.ClippableStyles,...g};e.s(["MOVEABLE_WRAPPER_CLASSNAME",0,"gamma-moveable-wrapper","MediaMoveableStyles",0,f],685290)},466925,e=>{"use strict";var t=e.i(191788),i=e.i(261442);let n="is-dragging-over";e.s(["DRAGOVER_CLASS",0,n,"useDroppable",0,(e,a)=>{let r=(0,t.useCallback)(t=>{(!a||a(t))&&e.current?.classList.add(n)},[e]),o=(0,t.useCallback)(()=>e.current?.classList.remove(n),[e]);return{onDragOver:i.preventDefaultToAllowDrop,onDragEnter:r,onDragLeave:o,onDrop:o}}])},816256,802818,89081,319813,285598,832300,958859,190946,714273,214898,699764,992539,e=>{"use strict";let t,i,n,a;e.s(["absolutePositionToRelativePosition",()=>nK,"prosemirrorJSONToYDoc",()=>nX,"relativePositionToAbsolutePosition",()=>nY,"yDocToProsemirrorJSON",()=>nQ],816256),e.s(["getRelativeSelection",()=>nN,"updateYFragment",()=>n$],319813);let r=Object.keys,o=()=>new Map,s="u">typeof document?document:{};"u">typeof DOMParser&&new DOMParser,s.ELEMENT_NODE,s.TEXT_NODE,s.CDATA_SECTION_NODE,s.COMMENT_NODE,s.DOCUMENT_NODE,s.DOCUMENT_TYPE_NODE,s.DOCUMENT_FRAGMENT_NODE;var l=e.i(350461);let d=/^\s*/g,c=/([A-Z])/g,u=(e,t)=>e.replace(c,e=>`${t}${e.toLowerCase()}`).replace(d,"");"u">typeof TextEncoder&&new TextEncoder;let p="u"void 0===e?null:e,m=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{"u">typeof localStorage&&(m=localStorage)}catch(e){}let g=m,f=void 0!==l.default&&l.default.release&&/node|io\.js/.test(l.default.release.name);"u">typeof navigator&&/Mac/.test(navigator.platform);let b=[];(()=>{if(void 0===t)if(f){t=o();let e=l.default.argv,i=null;for(let n=0;n{if(0!==e.length){let[i,n]=e.split("=");t.set(`--${u(i,"-")}`,n),t.set(`-${u(i,"-")}`,n)}})):t=o();return t})().has("--production")||h(f?l.default.env.PRODUCTION:g.getItem("production"));let x=()=>{throw Error("Unexpected case")},y=e=>class{constructor(e){this._=e}destroy(){e(this._)}};y(clearTimeout),y(clearInterval),y(e=>"u">typeof requestAnimationFrame&&cancelAnimationFrame(e)),y(e=>"u">typeof cancelIdleCallback&&cancelIdleCallback(e));let v=(e,t)=>enew Map,A=e=>{let t=k();return e.forEach((e,i)=>{t.set(i,e)}),t},E=(e,t,i)=>{let n=e.get(t);return void 0===n&&e.set(t,n=i()),n},_=()=>new Set,I=e=>e[e.length-1],M=(e,t)=>{for(let i=0;i{this.off(e,i),t(...n)};this.on(e,i)}off(e,t){let i=this._observers.get(e);void 0!==i&&(i.delete(t),0===i.size&&this._observers.delete(e))}emit(e,t){return T((this._observers.get(e)||k()).values()).forEach(e=>e(...t))}destroy(){this._observers=k()}}let P=Math.floor,D=Math.abs,N=(e,t)=>ee>t?e:t,O=e=>0!==e?e<0:1/e<0,B=Number.MAX_SAFE_INTEGER,z=Number.isInteger||(e=>"number"==typeof e&&isFinite(e)&&P(e)===e);(0,String.fromCharCode)(65535);let F=/^\s*/g,H=/([A-Z])/g,W=(e,t)=>e.replace(H,e=>`${t}${e.toLowerCase()}`).replace(F,""),U="u">typeof TextEncoder?new TextEncoder:null,V=U?e=>U.encode(e):e=>{let t=unescape(encodeURIComponent(e)),i=t.length,n=new Uint8Array(i);for(let e=0;enew $,K=e=>{let t=new Uint8Array((e=>{let t=e.cpos;for(let i=0;i{let i=e.cbuf.length;e.cpos===i&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(2*i),e.cpos=0),e.cbuf[e.cpos++]=t},Y=(e,t)=>{for(;t>127;)q(e,128|127&t),t=P(t/128);q(e,127&t)},X=(e,t)=>{let i=O(t);for(i&&(t=-t),q(e,128*(t>63)|64*!!i|63&t),t=P(t/64);t>0;)q(e,128*(t>127)|127&t),t=P(t/128)},Q=new Uint8Array(3e4),J=Q.length/3,ee=U&&U.encodeInto?(e,t)=>{if(t.length{let i=unescape(encodeURIComponent(t)),n=i.length;Y(e,n);for(let t=0;t{let i=e.cbuf.length,n=e.cpos,a=N(i-n,t.length),r=t.length-a;e.cbuf.set(t.subarray(0,a),n),e.cpos+=a,r>0&&(e.bufs.push(e.cbuf),e.cbuf=new Uint8Array(R(2*i,r)),e.cbuf.set(t.subarray(a)),e.cpos=r)},ei=(e,t)=>{Y(e,t.byteLength),et(e,t)},en=(e,t)=>{let i;(i=e.cbuf.length)-e.cpos{switch(typeof t){case"string":q(e,119),ee(e,t);break;case"number":if(z(t)&&0x7fffffff>=D(t))q(e,125),X(e,t);else if(ea.setFloat32(0,t),ea.getFloat32(0)===t)q(e,124),en(e,4).setFloat32(0,t,!1);else q(e,123),en(e,8).setFloat64(0,t,!1);break;case"bigint":q(e,122),en(e,8).setBigInt64(0,t,!1);break;case"object":if(null===t)q(e,126);else if(L(t)){q(e,117),Y(e,t.length);for(let i=0;i0&&Y(this,this.count-1),this.count=1,this.w(this,e),this.s=e)}}let es=e=>{e.count>0&&(X(e.encoder,1===e.count?e.s:-e.s),e.count>1&&Y(e.encoder,e.count-2))};class el{constructor(){this.encoder=new $,this.s=0,this.count=0}write(e){this.s===e?this.count++:(es(this),this.count=1,this.s=e)}toUint8Array(){return es(this),K(this.encoder)}}let ed=e=>{if(e.count>0){let t=2*e.diff+ +(1!==e.count);X(e.encoder,t),e.count>1&&Y(e.encoder,e.count-2)}};class ec{constructor(){this.encoder=new $,this.s=0,this.count=0,this.diff=0}write(e){this.diff===e-this.s?(this.s=e,this.count++):(ed(this),this.count=1,this.diff=e-this.s,this.s=e)}toUint8Array(){return ed(this),K(this.encoder)}}class eu{constructor(){this.sarr=[],this.s="",this.lensE=new el}write(e){this.s+=e,this.s.length>19&&(this.sarr.push(this.s),this.s=""),this.lensE.write(e.length)}toUint8Array(){let e=new $;return this.sarr.push(this.s),this.s="",ee(e,this.sarr.join("")),et(e,this.lensE.toUint8Array()),K(e)}}let ep=()=>{throw Error("Method unimplemented")},eh=()=>{throw Error("Unexpected case")},em=Error("Unexpected end of array"),eg=Error("Integer out of Range");class ef{constructor(e){this.arr=e,this.pos=0}}let eb=e=>new ef(e),ex=e=>e.pos!==e.arr.length,ey=e=>{var t;let i;return t=eC(e),i=new Uint8Array(e.arr.buffer,e.pos+e.arr.byteOffset,t),e.pos+=t,i},ev=e=>e.arr[e.pos++],eC=e=>{let t=0,i=1,n=e.arr.length;for(;e.posB)throw eg}throw em},ew=e=>{let t=e.arr[e.pos++],i=63&t,n=64,a=(64&t)>0?-1:1;if((128&t)==0)return a*i;let r=e.arr.length;for(;e.posB)throw eg}throw em},eS=G?e=>G.decode(ey(e)):e=>{let t=eC(e);if(0===t)return"";{let i=String.fromCodePoint(ev(e));if(--t<100)for(;t--;)i+=String.fromCodePoint(ev(e));else for(;t>0;){let n=t<1e4?t:1e4,a=e.arr.subarray(e.pos,e.pos+n);e.pos+=n,i+=String.fromCodePoint.apply(null,a),t-=n}return decodeURIComponent(escape(i))}},ek=(e,t)=>{let i=new DataView(e.arr.buffer,e.arr.byteOffset+e.pos,t);return e.pos+=t,i},eA=[e=>void 0,e=>null,ew,e=>ek(e,4).getFloat32(0,!1),e=>ek(e,8).getFloat64(0,!1),e=>ek(e,8).getBigInt64(0,!1),e=>!1,e=>!0,eS,e=>{let t=eC(e),i={};for(let n=0;n{let t=eC(e),i=[];for(let n=0;neA[127-ev(e)](e);class e_ extends ef{constructor(e,t){super(e),this.reader=t,this.s=null,this.count=0}read(){return 0===this.count&&(this.s=this.reader(this),ex(this)?this.count=eC(this)+1:this.count=-1),this.count--,this.s}}class eI extends ef{constructor(e){super(e),this.s=0,this.count=0}read(){if(0===this.count){this.s=ew(this);let e=O(this.s);this.count=1,e&&(this.s=-this.s,this.count=eC(this)+2)}return this.count--,this.s}}class eM extends ef{constructor(e){super(e),this.s=0,this.count=0,this.diff=0}read(){if(0===this.count){let e=ew(this);this.diff=P(e/2),this.count=1,1&e&&(this.count=eC(this)+2)}return this.s+=this.diff,this.count--,this.s}}class eT{constructor(e){this.decoder=new eI(e),this.str=eS(this.decoder),this.spos=0}read(){let e=this.spos+this.decoder.read(),t=this.str.slice(this.spos,e);return this.spos=e,t}}crypto.subtle;let eL=crypto.getRandomValues.bind(crypto),ej=()=>eL(new Uint32Array(1))[0],eP=Date.now,eD=e=>new Promise(e);Promise.all.bind(Promise),e.i(221168);let eN=e=>void 0===e?null:e,eR=new class{constructor(){this.map=new Map}setItem(e,t){this.map.set(e,t)}getItem(e){return this.map.get(e)}};try{"u">typeof localStorage&&localStorage&&(eR=localStorage)}catch(e){}let eO=eR,eB=Object.assign,ez=Object.keys,eF=Object.freeze,eH=e=>{for(let t in e){let i=e[t];("object"==typeof i||"function"==typeof i)&&eH(e[t])}return eF(e)},eW=(e,t,i=0)=>{try{for(;ie,eV=void 0!==l.default&&l.default.release&&/node|io\.js/.test(l.default.release.name)&&"[object process]"===Object.prototype.toString.call(void 0!==l.default?l.default:0);"u">typeof navigator&&/Mac/.test(navigator.platform);let eG=[],e$=e=>(()=>{if(void 0===i)if(eV){i=k();let e=l.default.argv,t=null;for(let n=0;n{if(0!==e.length){let[t,n]=e.split("=");i.set(`--${W(t,"-")}`,n),i.set(`-${W(t,"-")}`,n)}})):i=k();return i})().has(e),eZ=e=>eV?eN(l.default.env[e.toUpperCase().replaceAll("-","_")]):eN(eO.getItem(e)),eK=e=>e$("--"+e)||null!==eZ(e);eK("production");let eq=eV&&["true","1","2"].includes(l.default.env.FORCE_COLOR)||!e$("--no-colors")&&!eK("no-color")&&(!eV||l.default.stdout.isTTY)&&(!eV||e$("--color")||null!==eZ("COLORTERM")||(eZ("TERM")||"").includes("color"));class eY{constructor(e,t){this.left=e,this.right=t}}let eX=(e,t)=>new eY(e,t),eQ="u">typeof document?document:{};"u">typeof DOMParser&&new DOMParser;let eJ=e=>((e,t)=>{let i=[];for(let[n,a]of e)i.push(t(a,n));return i})(e,(e,t)=>`${t}:${e};`).join("");eQ.ELEMENT_NODE,eQ.TEXT_NODE,eQ.CDATA_SECTION_NODE,eQ.COMMENT_NODE,eQ.DOCUMENT_NODE,eQ.DOCUMENT_TYPE_NODE,eQ.DOCUMENT_FRAGMENT_NODE;let e0=e=>class{constructor(e){this._=e}destroy(){e(this._)}};e0(clearTimeout),e0(clearInterval),e0(e=>"u">typeof requestAnimationFrame&&cancelAnimationFrame(e)),e0(e=>"u">typeof cancelIdleCallback&&cancelIdleCallback(e));let e1=Symbol,e2=e1(),e3=e1(),e5=e1(),e4=e1(),e6=e1(),e9=e1(),e8=e1(),e7=e1(),te=e1();eP();let tt={[e2]:eX("font-weight","bold"),[e3]:eX("font-weight","normal"),[e5]:eX("color","blue"),[e6]:eX("color","green"),[e4]:eX("color","grey"),[e9]:eX("color","red"),[e8]:eX("color","purple"),[e7]:eX("color","orange"),[te]:eX("color","black")},ti=eq?e=>{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],i=[],n=k(),a=[],r=0;for(;r0||e.length>0?(t.push("%c"+a),i.push(e)):t.push(a)}else break}}for(r>0&&(a=i).unshift(t.join(""));r{1===e.length&&e[0]?.constructor===Function&&(e=e[0]());let t=[],i=[],n=0;for(;n0&&i.push(t.join(""));n{console.warn(...ti(e)),e.unshift(e7),ta.forEach(t=>t.print(e))},ta=_(),tr=e=>({[Symbol.iterator](){return this},next:e}),to=(e,t)=>tr(()=>{let{done:i,value:n}=e.next();return{done:i,value:i?void 0:t(n)}});class ts{constructor(e,t){this.clock=e,this.len=t}}class tl{constructor(){this.clients=new Map}}let td=(e,t,i)=>t.clients.forEach((t,n)=>{let a=e.doc.store.clients.get(n);for(let n=0;n{let i=e.clients.get(t.client);return void 0!==i&&null!==((e,t)=>{let i=0,n=e.length-1;for(;i<=n;){let a=P((i+n)/2),r=e[a],o=r.clock;if(o<=t){if(t{e.clients.forEach(e=>{let t,i;for(e.sort((e,t)=>e.clock-t.clock),t=1,i=1;t=a.clock?n.len=R(n.len,a.clock+a.len-n.clock):(i{let t=new tl;for(let i=0;i{if(!t.clients.has(a)){let r=n.slice();for(let t=i+1;t{E(e.clients,t,()=>[]).push(new ts(i,n))},tm=()=>new tl,tg=e=>{let t=tm();return e.clients.forEach((e,i)=>{let n=[];for(let t=0;t0&&t.clients.set(i,n)}),t},tf=(e,t)=>{Y(e.restEncoder,t.clients.size),T(t.clients.entries()).sort((e,t)=>t[0]-e[0]).forEach(([t,i])=>{e.resetDsCurVal(),Y(e.restEncoder,t);let n=i.length;Y(e.restEncoder,n);for(let t=0;t{let t=new tl,i=eC(e.restDecoder);for(let n=0;n0){let a=E(t.clients,i,()=>[]);for(let t=0;t(e^ej()&15>>e/4).toString(16)),collectionid:t=null,gc:i=!0,gcFilter:n=()=>!0,meta:a=null,autoLoad:r=!1,shouldLoad:o=!0}={}){super(),this.gc=i,this.gcFilter=n,this.clientID=ej(),this.guid=e,this.collectionid=t,this.share=new Map,this.store=new tq,this._transaction=null,this._transactionCleanups=[],this.subdocs=new Set,this._item=null,this.shouldLoad=o,this.autoLoad=r,this.meta=a,this.isLoaded=!1,this.isSynced=!1,this.isDestroyed=!1,this.whenLoaded=eD(e=>{this.on("load",()=>{this.isLoaded=!0,e(this)})});const s=()=>eD(e=>{let t=i=>{(void 0===i||!0===i)&&(this.off("sync",t),e())};this.on("sync",t)});this.on("sync",e=>{!1===e&&this.isSynced&&(this.whenSynced=s()),this.isSynced=void 0===e||!0===e,this.isSynced&&!this.isLoaded&&this.emit("load",[this])}),this.whenSynced=s()}load(){let e=this._item;null===e||this.shouldLoad||ie(e.parent.doc,e=>{e.subdocsLoaded.add(this)},null,!0),this.shouldLoad=!0}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(T(this.subdocs).map(e=>e.guid))}transact(e,t=null){return ie(this,e,t)}get(e,t=iS){let i=E(this.share,e,()=>{let e=new t;return e._integrate(this,null),e}),n=i.constructor;if(t!==iS&&n!==t)if(n===iS){let n=new t;n._map=i._map,i._map.forEach(e=>{for(;null!==e;e=e.left)e.parent=n}),n._start=i._start;for(let e=n._start;null!==e;e=e.right)e.parent=n;return n._length=i._length,this.share.set(e,n),n._integrate(this,null),n}else throw Error(`Type with the name ${e} has already been defined with a different constructor`);return i}getArray(e=""){return this.get(e,iF)}getText(e=""){return this.get(e,i5)}getMap(e=""){return this.get(e,iW)}getXmlElement(e=""){return this.get(e,i9)}getXmlFragment(e=""){return this.get(e,i6)}toJSON(){let e={};return this.share.forEach((t,i)=>{e[i]=t.toJSON()}),e}destroy(){this.isDestroyed=!0,T(this.subdocs).forEach(e=>e.destroy());let e=this._item;if(null!==e){this._item=null;let t=e.content;t.doc=new tx({guid:this.guid,...t.opts,shouldLoad:!1}),t.doc._item=e,ie(e.parent.doc,i=>{let n=t.doc;e.deleted||i.subdocsAdded.add(n),i.subdocsRemoved.add(this)},null,!0)}this.emit("destroyed",[!0]),this.emit("destroy",[this]),super.destroy()}}class ty{constructor(e){this.restDecoder=e}resetDsCurVal(){}readDsClock(){return eC(this.restDecoder)}readDsLen(){return eC(this.restDecoder)}}class tv extends ty{readLeftID(){return tN(eC(this.restDecoder),eC(this.restDecoder))}readRightID(){return tN(eC(this.restDecoder),eC(this.restDecoder))}readClient(){return eC(this.restDecoder)}readInfo(){return ev(this.restDecoder)}readString(){return eS(this.restDecoder)}readParentInfo(){return 1===eC(this.restDecoder)}readTypeRef(){return eC(this.restDecoder)}readLen(){return eC(this.restDecoder)}readAny(){return eE(this.restDecoder)}readBuf(){var e=ey(this.restDecoder);let t=new Uint8Array(e.byteLength);return t.set(e),t}readJSON(){return JSON.parse(eS(this.restDecoder))}readKey(){return eS(this.restDecoder)}}class tC{constructor(e){this.dsCurrVal=0,this.restDecoder=e}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){return this.dsCurrVal+=eC(this.restDecoder),this.dsCurrVal}readDsLen(){let e=eC(this.restDecoder)+1;return this.dsCurrVal+=e,e}}class tw extends tC{constructor(e){super(e),this.keys=[],eC(e),this.keyClockDecoder=new eM(ey(e)),this.clientDecoder=new eI(ey(e)),this.leftClockDecoder=new eM(ey(e)),this.rightClockDecoder=new eM(ey(e)),this.infoDecoder=new e_(ey(e),ev),this.stringDecoder=new eT(ey(e)),this.parentInfoDecoder=new e_(ey(e),ev),this.typeRefDecoder=new eI(ey(e)),this.lenDecoder=new eI(ey(e))}readLeftID(){return new tP(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new tP(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return 1===this.parentInfoDecoder.read()}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return eE(this.restDecoder)}readBuf(){return ey(this.restDecoder)}readJSON(){return eE(this.restDecoder)}readKey(){let e=this.keyClockDecoder.read();if(e{let n=new Map;i.forEach((e,i)=>{tX(t,i)>e&&n.set(i,e)}),tY(t).forEach((e,t)=>{i.has(t)||n.set(t,0)}),Y(e.restEncoder,n.size),T(n.entries()).sort((e,t)=>t[0]-e[0]).forEach(([i,n])=>{((e,t,i,n)=>{n=R(n,t[0].id.clock);let a=tJ(t,n);Y(e.restEncoder,t.length-a),e.writeClient(i),Y(e.restEncoder,n);let r=t[a];r.write(e,n-r.id.clock);for(let i=a+1;i(e=>{let t=new Map,i=eC(e.restDecoder);for(let n=0;nnew tM,tL=(e,t)=>{let i=e.l,n=i.length;e.l=i.filter(e=>t!==e),n===e.l.length&&console.error("[yjs] Tried to remove event handler that doesn't exist.")},tj=(e,t,i)=>eW(e.l,[t,i]);class tP{constructor(e,t){this.client=e,this.clock=t}}let tD=(e,t)=>e===t||null!==e&&null!==t&&e.client===t.client&&e.clock===t.clock,tN=(e,t)=>new tP(e,t),tR=(e,t)=>{Y(e,t.client),Y(e,t.clock)},tO=e=>tN(eC(e),eC(e)),tB=e=>{for(let[t,i]of e.doc.share.entries())if(i===e)return t;throw eh()},tz=(e,t)=>{for(;null!==t;){if(t.parent===e)return!0;t=t.parent._item}return!1};class tF{constructor(e,t,i,n=0){this.type=e,this.tname=t,this.item=i,this.assoc=n}}class tH{constructor(e,t,i=0){this.type=e,this.index=t,this.assoc=i}}let tW=(e,t,i)=>{let n=null,a=null;return null===e._item?a=tB(e):n=tN(e._item.id.client,e._item.id.clock),new tF(n,a,t,i)},tU=(e,t,i=0)=>{let n=e._start;if(i<0){if(0===t)return tW(e,null,i);t--}for(;null!==n;){if(!n.deleted&&n.countable){if(n.length>t)return tW(e,tN(n.id.client,n.id.clock+t),i);t-=n.length}if(null===n.right&&i<0)return tW(e,n.lastId,i);n=n.right}return tW(e,null,i)},tV=(e,t,i=!0)=>{let n=t.store,a=e.item,r=e.type,o=e.tname,s=e.assoc,l=null,d=0;if(null!==a){let e,t;if(tX(n,a.client)<=a.clock)return null;let r=i?nw(n,a):(e=t0(n,a),t=a.clock-e.id.clock,{item:e,diff:t}),o=r.item;if(!(o instanceof n_))return null;if(null===(l=o.parent)._item||!l._item.deleted){d=o.deleted||!o.countable?0:r.diff+(s>=0?0:1);let e=o.left;for(;null!==e;)!e.deleted&&e.countable&&(d+=e.length),e=e.left}}else{if(null!==o)l=t.get(o);else if(null!==r){if(tX(n,r.client)<=r.clock)return null;let{item:e}=i?nw(n,r):{item:t0(n,r)};if(!(e instanceof n_)||!(e.content instanceof nC))return null;l=e.content.type}else throw eh();d=s>=0?l._length:0}return((e,t,i=0)=>new tH(e,t,i))(l,d,e.assoc)};class tG{constructor(e,t){this.ds=e,this.sv=t}}let t$=(e,t)=>new tG(e,t);t$(tm(),new Map);let tZ=(e,t)=>void 0===t?!e.deleted:t.sv.has(e.id.client)&&(t.sv.get(e.id.client)||0)>e.id.clock&&!tc(t.ds,e.id),tK=(e,t)=>{let i=E(e.meta,tK,_),n=e.doc.store;i.has(t)||(t.sv.forEach((t,i)=>{t{}),i.add(t))};class tq{constructor(){this.clients=new Map,this.pendingStructs=null,this.pendingDs=null}}let tY=e=>{let t=new Map;return e.clients.forEach((e,i)=>{let n=e[e.length-1];t.set(i,n.id.clock+n.length)}),t},tX=(e,t)=>{let i=e.clients.get(t);if(void 0===i)return 0;let n=i[i.length-1];return n.id.clock+n.length},tQ=(e,t)=>{let i=e.clients.get(t.id.client);if(void 0===i)i=[],e.clients.set(t.id.client,i);else{let e=i[i.length-1];if(e.id.clock+e.length!==t.id.clock)throw eh()}i.push(t)},tJ=(e,t)=>{let i=0,n=e.length-1,a=e[n],r=a.id.clock;if(r===t)return n;let o=P(t/(r+a.length-1)*n);for(;i<=n;){if((r=(a=e[o]).id.clock)<=t){if(t{let i=e.clients.get(t.client);return i[tJ(i,t.clock)]},t1=(e,t,i)=>{let n=tJ(t,i),a=t[n];return a.id.clock{let i=e.doc.store.clients.get(t.client);return i[t1(e,i,t.clock)]},t3=(e,t,i)=>{let n=t.clients.get(i.client),a=tJ(n,i.clock),r=n[a];return i.clock!==r.id.clock+r.length-1&&r.constructor!==ni&&n.splice(a+1,0,nk(e,r,i.clock-r.id.clock+1)),r},t5=(e,t,i,n,a)=>{let r;if(0===n)return;let o=i+n,s=t1(e,t,i);do o<(r=t[s++]).id.clock+r.length&&t1(e,t,o),a(r);while(s(0!==t.deleteSet.clients.size||!!((e,t)=>{for(let[i,n]of e)if(t(n,i))return!0;return!1})(t.afterState,(e,i)=>t.beforeState.get(i)!==e))&&(tu(t.deleteSet),t_(e,t.doc.store,t.beforeState),tf(e,t.deleteSet),!0),t9=(e,t,i)=>{let n=t._item;(null===n||n.id.clock<(e.beforeState.get(n.id.client)||0)&&!n.deleted)&&E(e.changed,t,_).add(i)},t8=(e,t)=>{let i=e[t],n=e[t-1],a=t;for(;a>0;i=n,n=e[--a-1]){if(n.deleted===i.deleted&&n.constructor===i.constructor&&n.mergeWith(i)){i instanceof n_&&null!==i.parentSub&&i.parent._map.get(i.parentSub)===i&&i.parent._map.set(i.parentSub,n);continue}break}let r=t-a;return r&&e.splice(t+1-r,r),r},t7=(e,t)=>{if(te.push(()=>{null!==n._item&&n._item.deleted||n._callObserver(i,t)})),e.push(()=>{i.changedParentTypes.forEach((e,t)=>{t._dEH.l.length>0&&(null===t._item||!t._item.deleted)&&((e=e.filter(e=>null===e.target._item||!e.target._item.deleted)).forEach(e=>{e.currentTarget=t,e._path=null}),e.sort((e,t)=>e.path.length-t.path.length),tj(t._dEH,e,i))})}),e.push(()=>n.emit("afterTransaction",[i,n])),eW(e,[]),i._needFormattingCleanup&&i1(i)}finally{n.gc&&((e,t,i)=>{for(let[n,a]of e.clients.entries()){let e=t.clients.get(n);for(let n=a.length-1;n>=0;n--){let r=a[n],o=r.clock+r.len;for(let n=tJ(e,r.clock),a=e[n];n{let i=a.clients.get(t);for(let t=e.length-1;t>=0;t--){let n=e[t],a=N(i.length-1,1+tJ(i,n.clock+n.len-1));for(let e=a,t=i[e];e>0&&t.id.clock>=n.clock;t=i[e])e-=1+t8(i,e)}}),i.afterState.forEach((e,t)=>{let n=i.beforeState.get(t)||0;if(n!==e){let e=a.clients.get(t),i=R(tJ(e,n),1);for(let t=e.length-1;t>=i;)t-=1+t8(e,t)}});for(let e=o.length-1;e>=0;e--){let{client:t,clock:i}=o[e].id,n=a.clients.get(t),r=tJ(n,i);!(r+11)&&r>0&&t8(n,r)}if(i.local||i.afterState.get(n.clientID)===i.beforeState.get(n.clientID)||(((...e)=>{console.log(...ti(e)),ta.forEach(t=>t.print(e))})(e7,e2,"[yjs] ",e3,e9,"Changed the client-id because another client seems to be using it."),n.clientID=ej()),n.emit("afterTransactionCleanup",[i,n]),n._observers.has("update")){let e=new tk;t6(e,i)&&n.emit("update",[e.toUint8Array(),i.origin,n,i])}if(n._observers.has("updateV2")){let e=new tE;t6(e,i)&&n.emit("updateV2",[e.toUint8Array(),i.origin,n,i])}let{subdocsAdded:s,subdocsLoaded:l,subdocsRemoved:d}=i;(s.size>0||d.size>0||l.size>0)&&(s.forEach(e=>{e.clientID=n.clientID,null==e.collectionid&&(e.collectionid=n.collectionid),n.subdocs.add(e)}),d.forEach(e=>n.subdocs.delete(e)),n.emit("subdocs",[{loaded:l,added:s,removed:d},n,i]),d.forEach(e=>e.destroy())),e.length<=t+1?(n._transactionCleanups=[],n.emit("afterAllTransactions",[n,e])):t7(e,t+1)}}},ie=(e,t,i=null,n=!0)=>{let a=e._transactionCleanups,r=!1,o=null;null===e._transaction&&(r=!0,e._transaction=new t4(e,i,n),a.push(e._transaction),1===a.length&&e.emit("beforeAllTransactions",[e]),e.emit("beforeTransaction",[e._transaction,e]));try{o=t(e._transaction)}finally{if(r){let t=e._transaction===a[0];e._transaction=null,t&&t7(a,0)}}return o};class it{constructor(e,t){this.insertions=t,this.deletions=e,this.meta=new Map}}let ii=(e,t,i)=>{td(e,i.deletions,i=>{i instanceof n_&&t.scope.some(t=>t===e.doc||tz(t,i))&&nS(i,!1)})},ia=(e,t,i)=>{let n=null,a=e.doc,r=e.scope;ie(a,i=>{for(;t.length>0&&null===e.currStackItem;){let n=a.store,o=t.pop(),s=new Set,l=[],d=!1;td(i,o.insertions,e=>{if(e instanceof n_){if(null!==e.redone){let{item:t,diff:a}=nw(n,e.id);a>0&&(t=t2(i,tN(t.id.client,t.id.clock+a))),e=t}!e.deleted&&r.some(t=>t===i.doc||tz(t,e))&&l.push(e)}}),td(i,o.deletions,e=>{e instanceof n_&&r.some(t=>t===i.doc||tz(t,e))&&!tc(o.insertions,e.id)&&s.add(e)}),s.forEach(t=>{d=null!==nE(i,t,s,o.insertions,e.ignoreRemoteMapChanges,e)||d});for(let t=l.length-1;t>=0;t--){let n=l[t];e.deleteFilter(n)&&(n.delete(i),d=!0)}e.currStackItem=d?o:null}i.changed.forEach((e,t)=>{e.has(null)&&t._searchMarker&&(t._searchMarker.length=0)}),n=i},e);let o=e.currStackItem;if(null!=o){let t=n.changedParentTypes;e.emit("stack-item-popped",[{stackItem:o,type:i,changedParentTypes:t,origin:e},e]),e.currStackItem=null}return o};class ir{constructor(e,t){this.gen=function*(e){let t=eC(e.restDecoder);for(let i=0;i{if(e.constructor===ni){let{client:i,clock:n}=e.id;return new ni(tN(i,n+t),e.length-t)}if(e.constructor===nT){let{client:i,clock:n}=e.id;return new nT(tN(i,n+t),e.length-t)}{let{client:i,clock:n}=e.id;return new n_(tN(i,n+t),null,tN(i,n+t-1),null,e.rightOrigin,e.parent,e.parentSub,e.content.splice(t))}},il=(e,t=tw,i=tE)=>{if(1===e.length)return e[0];let n=e.map(e=>new t(eb(e))),a=n.map(e=>new ir(e,!0)),r=null,o=new i,s=new io(o);for(;(a=a.filter(e=>null!==e.curr)).sort((e,t)=>{if(e.curr.id.client!==t.curr.id.client)return t.curr.id.client-e.curr.id.client;{let i=e.curr.id.clock-t.curr.id.clock;return 0===i?e.curr.constructor===t.curr.constructor?0:e.curr.constructor===nT?1:-1:i}}),0!==a.length;){let e=a[0],t=e.curr.id.client;if(null!==r){let i=e.curr,n=!1;for(;null!==i&&i.id.clock+i.length<=r.struct.id.clock+r.struct.length&&i.id.client>=r.struct.id.client;)i=e.next(),n=!0;if(null===i||i.id.client!==t||n&&i.id.clock>r.struct.id.clock+r.struct.length)continue;if(t!==r.struct.id.client)ic(s,r.struct,r.offset),r={struct:i,offset:0},e.next();else if(r.struct.id.clock+r.struct.length0&&(r.struct.constructor===nT?r.struct.length-=t:i=is(i,t)),r.struct.mergeWith(i)||(ic(s,r.struct,r.offset),r={struct:i,offset:0},e.next())}}else r={struct:e.curr,offset:0},e.next();for(let i=e.curr;null!==i&&i.id.client===t&&i.id.clock===r.struct.id.clock+r.struct.length&&i.constructor!==nT;i=e.next())ic(s,r.struct,r.offset),r={struct:i,offset:0}}return null!==r&&(ic(s,r.struct,r.offset),r=null),iu(s),tf(o,tp(n.map(e=>tb(e)))),o.toUint8Array()},id=e=>{e.written>0&&(e.clientStructs.push({written:e.written,restEncoder:K(e.encoder.restEncoder)}),e.encoder.restEncoder=Z(),e.written=0)},ic=(e,t,i)=>{e.written>0&&e.currClient!==t.id.client&&id(e),0===e.written&&(e.currClient=t.id.client,e.encoder.writeClient(t.id.client),Y(e.encoder.restEncoder,t.id.clock+i)),t.write(e.encoder,i),e.written++},iu=e=>{id(e);let t=e.encoder.restEncoder;Y(t,e.clientStructs.length);for(let i=0;i{if(null!==i){let n,a,r=t._map.get(i);if(this.adds(r)){let e=r.left;for(;null!==e&&this.adds(e);)e=e.left;if(this.deletes(r))if(!(null!==e&&this.deletes(e)))return;else n="delete",a=I(e.content.getContent());else null!==e&&this.deletes(e)?(n="update",a=I(e.content.getContent())):(n="add",a=void 0)}else{if(!this.deletes(r))return;n="delete",a=I(r.content.getContent())}e.set(i,{action:n,oldValue:a})}}),this._keys=e}return this._keys}get delta(){return this.changes.delta}adds(e){return e.id.clock>=(this.transaction.beforeState.get(e.id.client)||0)}get changes(){let e=this._changes;if(null===e){if(0===this.transaction.doc._transactionCleanups.length)throw Error(ip);let t=this.target,i=_(),n=_(),a=[];if(e={added:i,deleted:n,delta:a,keys:this.keys},this.transaction.changed.get(t).has(null)){let e=null,r=()=>{e&&a.push(e)};for(let a=t._start;null!==a;a=a.right)a.deleted?this.deletes(a)&&!this.adds(a)&&((null===e||void 0===e.delete)&&(r(),e={delete:0}),e.delete+=a.length,n.add(a)):this.adds(a)?((null===e||void 0===e.insert)&&(r(),e={insert:[]}),e.insert=e.insert.concat(a.content.getContent()),i.add(a)):((null===e||void 0===e.retain)&&(r(),e={retain:0}),e.retain+=a.length);null!==e&&void 0===e.retain&&r()}this._changes=e}return e}}let im=(e,t)=>{let i=[];for(;null!==t._item&&t!==e;){if(null!==t._item.parentSub)i.unshift(t._item.parentSub);else{let e=0,n=t._item.parent._start;for(;n!==t._item&&null!==n;)!n.deleted&&n.countable&&(e+=n.length),n=n.right;i.unshift(e)}t=t._item.parent}return i},ig=()=>{tn("Invalid access: Add Yjs type to a document before reading data.")},ib=0;class ix{constructor(e,t){e.marker=!0,this.p=e,this.index=t,this.timestamp=ib++}}let iy=(e,t,i)=>{e.p.marker=!1,e.p=t,t.marker=!0,e.index=i,e.timestamp=ib++},iv=(e,t)=>{if(null===e._start||0===t||null===e._searchMarker)return null;let i=0===e._searchMarker.length?null:e._searchMarker.reduce((e,i)=>D(t-e.index)t;)!(n=n.left).deleted&&n.countable&&(a-=n.length);for(;null!==n.left&&n.left.id.client===n.id.client&&n.left.id.clock+n.left.length===n.id.clock;)!(n=n.left).deleted&&n.countable&&(a-=n.length);if(null!==i&&D(i.index-a)=80){let e=r.reduce((e,t)=>e.timestamp{for(let n=e.length-1;n>=0;n--){let a=e[n];if(i>0){let t=a.p;for(t.marker=!1;t&&(t.deleted||!t.countable);)(t=t.left)&&!t.deleted&&t.countable&&(a.index-=t.length);if(null===t||!0===t.marker){e.splice(n,1);continue}a.p=t,t.marker=!0}(t0&&t===a.index)&&(a.index=R(t,a.index+i))}},iw=(e,t,i)=>{let n=e,a=t.changedParentTypes;for(;E(a,e,()=>[]).push(i),null!==e._item;)e=e._item.parent;tj(n._eH,i,t)};class iS{constructor(){this._item=null,this._map=new Map,this._start=null,this.doc=null,this._length=0,this._eH=tT(),this._dEH=tT(),this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(e,t){this.doc=e,this._item=t}_copy(){throw ep()}clone(){throw ep()}_write(e){}get _first(){let e=this._start;for(;null!==e&&e.deleted;)e=e.right;return e}_callObserver(e,t){!e.local&&this._searchMarker&&(this._searchMarker.length=0)}observe(e){let t;t=this._eH,t.l.push(e)}observeDeep(e){let t;t=this._dEH,t.l.push(e)}unobserve(e){tL(this._eH,e)}unobserveDeep(e){tL(this._dEH,e)}toJSON(){}}let ik=(e,t,i)=>{e.doc??ig(),t<0&&(t=e._length+t),i<0&&(i=e._length+i);let n=i-t,a=[],r=e._start;for(;null!==r&&n>0;){if(r.countable&&!r.deleted){let e=r.content.getContent();if(e.length<=t)t-=e.length;else{for(let i=t;i0;i++)a.push(e[i]),n--;t=0}}r=r.right}return a},iA=e=>{e.doc??ig();let t=[],i=e._start;for(;null!==i;){if(i.countable&&!i.deleted){let e=i.content.getContent();for(let i=0;i{let i=[],n=e._start;for(;null!==n;){if(n.countable&&tZ(n,t)){let e=n.content.getContent();for(let t=0;t{let i=0,n=e._start;for(e.doc??ig();null!==n;){if(n.countable&&!n.deleted){let a=n.content.getContent();for(let n=0;n{let i=[];return i_(e,(n,a)=>{i.push(t(n,a,e))}),i},iM=(e,t)=>{e.doc??ig();let i=iv(e,t),n=e._start;for(null!==i&&(n=i.p,t-=i.index);null!==n;n=n.right)if(!n.deleted&&n.countable){if(t{let a=i,r=e.doc,o=r.clientID,s=r.store,l=null===i?t._start:i.right,d=[],c=()=>{d.length>0&&((a=new n_(tN(o,tX(s,o)),a,a&&a.lastId,l,l&&l.id,t,null,new nu(d))).integrate(e,0),d=[])};n.forEach(i=>{if(null===i)d.push(i);else switch(i.constructor){case Number:case Object:case Boolean:case Array:case String:d.push(i);break;default:switch(c(),i.constructor){case Uint8Array:case ArrayBuffer:(a=new n_(tN(o,tX(s,o)),a,a&&a.lastId,l,l&&l.id,t,null,new nn(new Uint8Array(i)))).integrate(e,0);break;case tx:(a=new n_(tN(o,tX(s,o)),a,a&&a.lastId,l,l&&l.id,t,null,new no(i))).integrate(e,0);break;default:if(i instanceof iS)(a=new n_(tN(o,tX(s,o)),a,a&&a.lastId,l,l&&l.id,t,null,new nC(i))).integrate(e,0);else throw Error("Unexpected content type in insert operation")}}}),c()},iL=(e,t,i,n)=>{if(i>t._length)throw Error("Length exceeded!");if(0===i)return t._searchMarker&&iC(t._searchMarker,i,n.length),iT(e,t,null,n);let a=i,r=iv(t,i),o=t._start;for(null!==r&&(o=r.p,0==(i-=r.index)&&(i+=(o=o.prev)&&o.countable&&!o.deleted?o.length:0));null!==o;o=o.right)if(!o.deleted&&o.countable){if(i<=o.length){i{if(0===n)return;let a=i,r=n,o=iv(t,i),s=t._start;for(null!==o&&(s=o.p,i-=o.index);null!==s&&i>0;s=s.right)!s.deleted&&s.countable&&(i0&&null!==s;)s.deleted||(n0)throw Error("Length exceeded!");t._searchMarker&&iC(t._searchMarker,a,-r+n)},iP=(e,t,i)=>{let n=t._map.get(i);void 0!==n&&n.delete(e)},iD=(e,t,i,n)=>{let a,r=t._map.get(i)||null,o=e.doc,s=o.clientID;if(null==n)a=new nu([n]);else switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:a=new nu([n]);break;case Uint8Array:a=new nn(n);break;case tx:a=new no(n);break;default:if(n instanceof iS)a=new nC(n);else throw Error("Unexpected content type")}new n_(tN(s,tX(o.store,s)),r,r&&r.lastId,null,null,t,i,a).integrate(e,0)},iN=(e,t)=>{e.doc??ig();let i=e._map.get(t);return void 0===i||i.deleted?void 0:i.content.getContent()[i.length-1]},iR=e=>{let t={};return e.doc??ig(),e._map.forEach((e,i)=>{e.deleted||(t[i]=e.content.getContent()[e.length-1])}),t},iO=(e,t)=>{e.doc??ig();let i=e._map.get(t);return void 0!==i&&!i.deleted},iB=e=>{let t,i;return e.doc??ig(),t=e._map.entries(),i=e=>!e[1].deleted,tr(()=>{let e;do e=t.next();while(!e.done&&!i(e.value))return e})};class iz extends ih{}class iF extends iS{constructor(){super(),this._prelimContent=[],this._searchMarker=[]}static from(e){let t=new iF;return t.push(e),t}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new iF}clone(){let e=new iF;return e.insert(0,this.toArray().map(e=>e instanceof iS?e.clone():e)),e}get length(){return this.doc??ig(),this._length}_callObserver(e,t){super._callObserver(e,t),iw(this,e,new iz(this,e))}insert(e,t){null!==this.doc?ie(this.doc,i=>{iL(i,this,e,t)}):this._prelimContent.splice(e,0,...t)}push(e){null!==this.doc?ie(this.doc,t=>{((e,t,i)=>{let n=(t._searchMarker||[]).reduce((e,t)=>t.index>e.index?t:e,{index:0,p:t._start}).p;if(n)for(;n.right;)n=n.right;return iT(e,t,n,i)})(t,this,e)}):this._prelimContent.push(...e)}unshift(e){this.insert(0,e)}delete(e,t=1){null!==this.doc?ie(this.doc,i=>{ij(i,this,e,t)}):this._prelimContent.splice(e,t)}get(e){return iM(this,e)}toArray(){return iA(this)}slice(e=0,t=this.length){return ik(this,e,t)}toJSON(){return this.map(e=>e instanceof iS?e.toJSON():e)}map(e){return iI(this,e)}forEach(e){i_(this,e)}[Symbol.iterator](){let e,t,i;return e=this._start,t=null,i=0,{[Symbol.iterator](){return this},next:()=>{if(null===t){for(;null!==e&&e.deleted;)e=e.right;if(null===e)return{done:!0,value:void 0};t=e.content.getContent(),i=0,e=e.right}let n=t[i++];return t.length<=i&&(t=null),{done:!1,value:n}}}}_write(e){e.writeTypeRef(nm)}}class iH extends ih{constructor(e,t,i){super(e,t),this.keysChanged=i}}class iW extends iS{constructor(e){super(),this._prelimContent=null,void 0===e?this._prelimContent=new Map:this._prelimContent=new Map(e)}_integrate(e,t){super._integrate(e,t),this._prelimContent.forEach((e,t)=>{this.set(t,e)}),this._prelimContent=null}_copy(){return new iW}clone(){let e=new iW;return this.forEach((t,i)=>{e.set(i,t instanceof iS?t.clone():t)}),e}_callObserver(e,t){iw(this,e,new iH(this,e,t))}toJSON(){this.doc??ig();let e={};return this._map.forEach((t,i)=>{if(!t.deleted){let n=t.content.getContent()[t.length-1];e[i]=n instanceof iS?n.toJSON():n}}),e}get size(){return[...iB(this)].length}keys(){return to(iB(this),e=>e[0])}values(){return to(iB(this),e=>e[1].content.getContent()[e[1].length-1])}entries(){return to(iB(this),e=>[e[0],e[1].content.getContent()[e[1].length-1]])}forEach(e){this.doc??ig(),this._map.forEach((t,i)=>{t.deleted||e(t.content.getContent()[t.length-1],i,this)})}[Symbol.iterator](){return this.entries()}delete(e){null!==this.doc?ie(this.doc,t=>{iP(t,this,e)}):this._prelimContent.delete(e)}set(e,t){return null!==this.doc?ie(this.doc,i=>{iD(i,this,e,t)}):this._prelimContent.set(e,t),t}get(e){return iN(this,e)}has(e){return iO(this,e)}clear(){null!==this.doc?ie(this.doc,e=>{this.forEach(function(t,i,n){iP(e,n,i)})}):this._prelimContent.clear()}_write(e){e.writeTypeRef(ng)}}let iU=(e,t)=>{let i,n;return e===t||"object"==typeof e&&"object"==typeof t&&e&&t&&((i=e)===(n=t)||ez(i).length===ez(n).length&&((e,t)=>{for(let i in e)if(!t(e[i],i))return!1;return!0})(i,(e,t)=>{let i,a;return(void 0!==e||(i=n,a=t,Object.prototype.hasOwnProperty.call(i,a)))&&n[t]===e}))};class iV{constructor(e,t,i,n){this.left=e,this.right=t,this.index=i,this.currentAttributes=n}forward(){null===this.right&&eh(),this.right.content.constructor===nl?this.right.deleted||iK(this.currentAttributes,this.right.content):this.right.deleted||(this.index+=this.right.length),this.left=this.right,this.right=this.right.right}}let iG=(e,t,i)=>{for(;null!==t.right&&i>0;)t.right.content.constructor===nl?t.right.deleted||iK(t.currentAttributes,t.right.content):t.right.deleted||(i{let a=new Map,r=n?iv(t,i):null;return r?iG(e,new iV(r.p.left,r.p,r.index,a),i-r.index):iG(e,new iV(null,t._start,0,a),i)},iZ=(e,t,i,n)=>{for(;null!==i.right&&(!0===i.right.deleted||i.right.content.constructor===nl&&iU(n.get(i.right.content.key),i.right.content.value));)i.right.deleted||n.delete(i.right.content.key),i.forward();let a=e.doc,r=a.clientID;n.forEach((n,o)=>{let s=i.left,l=i.right,d=new n_(tN(r,tX(a.store,r)),s,s&&s.lastId,l,l&&l.id,t,null,new nl(o,n));d.integrate(e,0),i.right=d,i.forward()})},iK=(e,t)=>{let{key:i,value:n}=t;null===n?e.delete(i):e.set(i,n)},iq=(e,t)=>{for(;null!==e.right&&(e.right.deleted||e.right.content.constructor===nl&&iU(t[e.right.content.key]??null,e.right.content.value));){;e.forward()}},iY=(e,t,i,n)=>{let a=e.doc,r=a.clientID,o=new Map;for(let s in n){let l=n[s],d=i.currentAttributes.get(s)??null;if(!iU(d,l)){o.set(s,d);let{left:n,right:c}=i;i.right=new n_(tN(r,tX(a.store,r)),n,n&&n.lastId,c,c&&c.id,t,null,new nl(s,l)),i.right.integrate(e,0),i.forward()}}return o},iX=(e,t,i,n,a)=>{i.currentAttributes.forEach((e,t)=>{void 0===a[t]&&(a[t]=null)});let r=e.doc,o=r.clientID;iq(i,a);let s=iY(e,t,i,a),l=n.constructor===String?new np(n):n instanceof iS?new nC(n):new ns(n),{left:d,right:c,index:u}=i;t._searchMarker&&iC(t._searchMarker,i.index,l.getLength()),(c=new n_(tN(o,tX(r.store,o)),d,d&&d.lastId,c,c&&c.id,t,null,l)).integrate(e,0),i.right=c,i.index=u,i.forward(),iZ(e,t,i,s)},iQ=(e,t,i,n,a)=>{let r=e.doc,o=r.clientID;iq(i,a);let s=iY(e,t,i,a);for(;null!==i.right&&(n>0||s.size>0&&(i.right.deleted||i.right.content.constructor===nl));){if(!i.right.deleted)if(i.right.content.constructor===nl){let{key:t,value:r}=i.right.content,o=a[t];if(void 0!==o){if(iU(o,r))s.delete(t);else{if(0===n)break;s.set(t,r)}i.right.delete(e)}else i.currentAttributes.set(t,r)}else n0){let a="";for(;n>0;n--)a+="\n";i.right=new n_(tN(o,tX(r.store,o)),i.left,i.left&&i.left.lastId,i.right,i.right&&i.right.id,t,null,new np(a)),i.right.integrate(e,0),i.forward()}iZ(e,t,i,s)},iJ=(e,t,i,n,a)=>{let r=t,o=k();for(;r&&(!r.countable||r.deleted);){if(!r.deleted&&r.content.constructor===nl){let e=r.content;o.set(e.key,e)}r=r.right}let s=0,l=!1;for(;t!==r;){if(i===t&&(l=!0),!t.deleted){let i=t.content;if(i.constructor===nl){let{key:r,value:d}=i,c=n.get(r)??null;(o.get(r)!==i||c===d)&&(t.delete(e),s++,l||(a.get(r)??null)!==d||c===d||(null===c?a.delete(r):a.set(r,c))),l||t.deleted||iK(a,i)}}t=t.right}return s},i0=e=>{let t=0;return ie(e.doc,i=>{let n=e._start,a=e._start,r=k(),o=A(r);for(;a;)!1===a.deleted&&(a.content.constructor===nl?iK(o,a.content):(t+=iJ(i,n,a,r,o),r=A(o),n=a)),a=a.right}),t},i1=e=>{let t=new Set,i=e.doc;for(let[n,a]of e.afterState.entries()){let r=e.beforeState.get(n)||0;a!==r&&t5(e,i.store.clients.get(n),r,a,e=>{e.deleted||e.content.constructor!==nl||e.constructor===ni||t.add(e.parent)})}ie(i,i=>{for(let n of(td(e,e.deleteSet,e=>{if(e instanceof ni||!e.parent._hasFormatting||t.has(e.parent))return;let n=e.parent;if(e.content.constructor===nl)t.add(n);else{for(var a=e;a&&a.right&&(a.right.deleted||!a.right.countable);)a=a.right;let t=new Set;for(;a&&(a.deleted||!a.countable);){if(!a.deleted&&a.content.constructor===nl){let e=a.content.key;t.has(e)?a.delete(i):t.add(e)}a=a.left}}}),t))i0(n)})},i2=(e,t,i)=>{let n=i,a=A(t.currentAttributes),r=t.right;for(;i>0&&null!==t.right;){if(!1===t.right.deleted)switch(t.right.content.constructor){case nC:case ns:case np:i{null===e?this.childListChanged=!0:this.keysChanged.add(e)})}get changes(){if(null===this._changes){let e={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=e}return this._changes}get delta(){if(null===this._delta){let e=this.target.doc,t=[];ie(e,e=>{let i=new Map,n=new Map,a=this.target._start,r=null,o={},s="",l=0,d=0,c=()=>{if(null!==r){let e=null;switch(r){case"delete":d>0&&(e={delete:d}),d=0;break;case"insert":("object"==typeof s||s.length>0)&&(e={insert:s},i.size>0&&(e.attributes={},i.forEach((t,i)=>{null!==t&&(e.attributes[i]=t)}))),s="";break;case"retain":l>0&&(e={retain:l},(e=>{for(let t in e)return!1;return!0})(o)||(e.attributes=eB({},o))),l=0}e&&t.push(e),r=null}};for(;null!==a;){switch(a.content.constructor){case nC:case ns:this.adds(a)?this.deletes(a)||(c(),r="insert",s=a.content.getContent()[0],c()):this.deletes(a)?("delete"!==r&&(c(),r="delete"),d+=1):a.deleted||("retain"!==r&&(c(),r="retain"),l+=1);break;case np:this.adds(a)?this.deletes(a)||("insert"!==r&&(c(),r="insert"),s+=a.content.str):this.deletes(a)?("delete"!==r&&(c(),r="delete"),d+=a.length):a.deleted||("retain"!==r&&(c(),r="retain"),l+=a.length);break;case nl:{let{key:t,value:s}=a.content;if(this.adds(a))this.deletes(a)||(iU(i.get(t)??null,s)?null!==s&&a.delete(e):("retain"===r&&c(),iU(s,n.get(t)??null)?delete o[t]:o[t]=s));else if(this.deletes(a)){n.set(t,s);let e=i.get(t)??null;iU(e,s)||("retain"===r&&c(),o[t]=e)}else if(!a.deleted){n.set(t,s);let i=o[t];void 0!==i&&(iU(i,s)?null!==i&&a.delete(e):("retain"===r&&c(),null===s?delete o[t]:o[t]=s))}a.deleted||("insert"===r&&c(),iK(i,a.content))}}a=a.right}for(c();t.length>0;){let e=t[t.length-1];if(void 0!==e.retain&&void 0===e.attributes)t.pop();else break}}),this._delta=t}return this._delta}}class i5 extends iS{constructor(e){super(),this._pending=void 0!==e?[()=>this.insert(0,e)]:[],this._searchMarker=[],this._hasFormatting=!1}get length(){return this.doc??ig(),this._length}_integrate(e,t){super._integrate(e,t);try{this._pending.forEach(e=>e())}catch(e){console.error(e)}this._pending=null}_copy(){return new i5}clone(){let e=new i5;return e.applyDelta(this.toDelta()),e}_callObserver(e,t){super._callObserver(e,t);let i=new i3(this,e,t);iw(this,e,i),!e.local&&this._hasFormatting&&(e._needFormattingCleanup=!0)}toString(){this.doc??ig();let e="",t=this._start;for(;null!==t;)!t.deleted&&t.countable&&t.content.constructor===np&&(e+=t.content.str),t=t.right;return e}toJSON(){return this.toString()}applyDelta(e,{sanitize:t=!0}={}){null!==this.doc?ie(this.doc,i=>{let n=new iV(null,this._start,0,new Map);for(let a=0;a0)&&iX(i,this,n,o,r.attributes||{})}else void 0!==r.retain?iQ(i,this,n,r.retain,r.attributes||{}):void 0!==r.delete&&i2(i,n,r.delete)}}):this._pending.push(()=>this.applyDelta(e))}toDelta(e,t,i){this.doc??ig();let n=[],a=new Map,r=this.doc,o="",s=this._start;function l(){if(o.length>0){let e={},t=!1;a.forEach((i,n)=>{t=!0,e[n]=i});let i={insert:o};t&&(i.attributes=e),n.push(i),o=""}}let d=()=>{for(;null!==s;){if(tZ(s,e)||void 0!==t&&tZ(s,t))switch(s.content.constructor){case np:{let n=a.get("ychange");void 0===e||tZ(s,e)?void 0===t||tZ(s,t)?void 0!==n&&(l(),a.delete("ychange")):(void 0===n||n.user!==s.id.client||"added"!==n.type)&&(l(),a.set("ychange",i?i("added",s.id):{type:"added"})):(void 0===n||n.user!==s.id.client||"removed"!==n.type)&&(l(),a.set("ychange",i?i("removed",s.id):{type:"removed"})),o+=s.content.str;break}case nC:case ns:{l();let e={insert:s.content.getContent()[0]};if(a.size>0){let t={};e.attributes=t,a.forEach((e,i)=>{t[i]=e})}n.push(e);break}case nl:tZ(s,e)&&(l(),iK(a,s.content))}s=s.right}l()};return e||t?ie(r,i=>{e&&tK(i,e),t&&tK(i,t),d()},"cleanup"):d(),n}insert(e,t,i){if(t.length<=0)return;let n=this.doc;null!==n?ie(n,n=>{let a=i$(n,this,e,!i);i||(i={},a.currentAttributes.forEach((e,t)=>{i[t]=e})),iX(n,this,a,t,i)}):this._pending.push(()=>this.insert(e,t,i))}insertEmbed(e,t,i){let n=this.doc;null!==n?ie(n,n=>{let a=i$(n,this,e,!i);iX(n,this,a,t,i||{})}):this._pending.push(()=>this.insertEmbed(e,t,i||{}))}delete(e,t){if(0===t)return;let i=this.doc;null!==i?ie(i,i=>{i2(i,i$(i,this,e,!0),t)}):this._pending.push(()=>this.delete(e,t))}format(e,t,i){if(0===t)return;let n=this.doc;null!==n?ie(n,n=>{let a=i$(n,this,e,!1);null!==a.right&&iQ(n,this,a,t,i)}):this._pending.push(()=>this.format(e,t,i))}removeAttribute(e){null!==this.doc?ie(this.doc,t=>{iP(t,this,e)}):this._pending.push(()=>this.removeAttribute(e))}setAttribute(e,t){null!==this.doc?ie(this.doc,i=>{iD(i,this,e,t)}):this._pending.push(()=>this.setAttribute(e,t))}getAttribute(e){return iN(this,e)}getAttributes(){return iR(this)}_write(e){e.writeTypeRef(nf)}}class i4{constructor(e,t=()=>!0){this._filter=t,this._root=e,this._currentNode=e._start,this._firstCall=!0,e.doc??ig()}[Symbol.iterator](){return this}next(){let e=this._currentNode,t=e&&e.content&&e.content.type;if(null!==e&&(!this._firstCall||e.deleted||!this._filter(t)))do if(t=e.content.type,e.deleted||t.constructor!==i9&&t.constructor!==i6||null===t._start)for(;null!==e;){let t=e.next;if(null!==t){e=t;break}e=e.parent===this._root?null:e.parent._item}else e=t._start;while(null!==e&&(e.deleted||!this._filter(e.content.type)))return(this._firstCall=!1,null===e)?{value:void 0,done:!0}:(this._currentNode=e,{value:e.content.type,done:!1})}}class i6 extends iS{constructor(){super(),this._prelimContent=[]}get firstChild(){let e=this._first;return e?e.content.getContent()[0]:null}_integrate(e,t){super._integrate(e,t),this.insert(0,this._prelimContent),this._prelimContent=null}_copy(){return new i6}clone(){let e=new i6;return e.insert(0,this.toArray().map(e=>e instanceof iS?e.clone():e)),e}get length(){return this.doc??ig(),null===this._prelimContent?this._length:this._prelimContent.length}createTreeWalker(e){return new i4(this,e)}querySelector(e){e=e.toUpperCase();let t=new i4(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e).next();return t.done?null:t.value}querySelectorAll(e){return e=e.toUpperCase(),T(new i4(this,t=>t.nodeName&&t.nodeName.toUpperCase()===e))}_callObserver(e,t){iw(this,e,new i8(this,t,e))}toString(){return iI(this,e=>e.toString()).join("")}toJSON(){return this.toString()}toDOM(e=document,t={},i){let n=e.createDocumentFragment();return void 0!==i&&i._createAssociation(n,this),i_(this,a=>{n.insertBefore(a.toDOM(e,t,i),null)}),n}insert(e,t){null!==this.doc?ie(this.doc,i=>{iL(i,this,e,t)}):this._prelimContent.splice(e,0,...t)}insertAfter(e,t){if(null!==this.doc)ie(this.doc,i=>{iT(i,this,e&&e instanceof iS?e._item:e,t)});else{let i=this._prelimContent,n=null===e?0:i.findIndex(t=>t===e)+1;if(0===n&&null!==e)throw Error("Reference item not found");i.splice(n,0,...t)}}delete(e,t=1){null!==this.doc?ie(this.doc,i=>{ij(i,this,e,t)}):this._prelimContent.splice(e,t)}toArray(){return iA(this)}push(e){this.insert(this.length,e)}unshift(e){this.insert(0,e)}get(e){return iM(this,e)}slice(e=0,t=this.length){return ik(this,e,t)}forEach(e){i_(this,e)}_write(e){e.writeTypeRef(nx)}}class i9 extends i6{constructor(e="UNDEFINED"){super(),this.nodeName=e,this._prelimAttrs=new Map}get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_integrate(e,t){super._integrate(e,t),this._prelimAttrs.forEach((e,t)=>{this.setAttribute(t,e)}),this._prelimAttrs=null}_copy(){return new i9(this.nodeName)}clone(){let e=new i9(this.nodeName);var t,i,n=this.getAttributes();for(let a in n){t=n[a],i=a,"string"==typeof t&&e.setAttribute(i,t)}return e.insert(0,this.toArray().map(e=>e instanceof iS?e.clone():e)),e}toString(){let e=this.getAttributes(),t=[],i=[];for(let t in e)i.push(t);i.sort();let n=i.length;for(let a=0;a0?" "+t.join(" "):"";return`<${a}${r}>${super.toString()}`}removeAttribute(e){null!==this.doc?ie(this.doc,t=>{iP(t,this,e)}):this._prelimAttrs.delete(e)}setAttribute(e,t){null!==this.doc?ie(this.doc,i=>{iD(i,this,e,t)}):this._prelimAttrs.set(e,t)}getAttribute(e){return iN(this,e)}hasAttribute(e){return iO(this,e)}getAttributes(e){let t;return e?(t={},this._map.forEach((i,n)=>{let a=i;for(;null!==a&&(!e.sv.has(a.id.client)||a.id.clock>=(e.sv.get(a.id.client)||0));)a=a.left;null!==a&&tZ(a,e)&&(t[n]=a.content.getContent()[a.length-1])}),t):iR(this)}toDOM(e=document,t={},i){let n=e.createElement(this.nodeName),a=this.getAttributes();for(let e in a){let t=a[e];"string"==typeof t&&n.setAttribute(e,t)}return i_(this,a=>{n.appendChild(a.toDOM(e,t,i))}),void 0!==i&&i._createAssociation(n,this),n}_write(e){e.writeTypeRef(nb),e.writeKey(this.nodeName)}}class i8 extends ih{constructor(e,t,i){super(e,i),this.childListChanged=!1,this.attributesChanged=new Set,t.forEach(e=>{null===e?this.childListChanged=!0:this.attributesChanged.add(e)})}}class i7 extends iW{constructor(e){super(),this.hookName=e}_copy(){return new i7(this.hookName)}clone(){let e=new i7(this.hookName);return this.forEach((t,i)=>{e.set(i,t)}),e}toDOM(e=document,t={},i){let n,a=t[this.hookName];return(n=void 0!==a?a.createDom(this):document.createElement(this.hookName)).setAttribute("data-yjs-hook",this.hookName),void 0!==i&&i._createAssociation(n,this),n}_write(e){e.writeTypeRef(ny),e.writeKey(this.hookName)}}class ne extends i5{get nextSibling(){let e=this._item?this._item.next:null;return e?e.content.type:null}get prevSibling(){let e=this._item?this._item.prev:null;return e?e.content.type:null}_copy(){return new ne}clone(){let e=new ne;return e.applyDelta(this.toDelta()),e}toDOM(e=document,t,i){let n=e.createTextNode(this.toString());return void 0!==i&&i._createAssociation(n,this),n}toString(){return this.toDelta().map(e=>{let t=[];for(let i in e.attributes){let n=[];for(let t in e.attributes[i])n.push({key:t,value:e.attributes[i][t]});n.sort((e,t)=>e.keye.nodeName=0;e--)i+=``;return i}).join("")}toJSON(){return this.toString()}_write(e){e.writeTypeRef(nv)}}class nt{constructor(e,t){this.id=e,this.length=t}get deleted(){throw ep()}mergeWith(e){return!1}write(e,t,i){throw ep()}integrate(e,t){throw ep()}}class ni extends nt{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){t>0&&(this.id.clock+=t,this.length-=t),tQ(e.doc.store,this)}write(e,t){e.writeInfo(0),e.writeLen(this.length-t)}getMissing(e,t){return null}}class nn{constructor(e){this.content=e}getLength(){return 1}getContent(){return[this.content]}isCountable(){return!0}copy(){return new nn(this.content)}splice(e){throw ep()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeBuf(this.content)}getRef(){return 3}}class na{constructor(e){this.len=e}getLength(){return this.len}getContent(){return[]}isCountable(){return!1}copy(){return new na(this.len)}splice(e){let t=new na(this.len-e);return this.len=e,t}mergeWith(e){return this.len+=e.len,!0}integrate(e,t){th(e.deleteSet,t.id.client,t.id.clock,this.len),t.markDeleted()}delete(e){}gc(e){}write(e,t){e.writeLen(this.len-t)}getRef(){return 1}}let nr=(e,t)=>new tx({guid:e,...t,shouldLoad:t.shouldLoad||t.autoLoad||!1});class no{constructor(e){e._item&&console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid."),this.doc=e;const t={};this.opts=t,e.gc||(t.gc=!1),e.autoLoad&&(t.autoLoad=!0),null!==e.meta&&(t.meta=e.meta)}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return!0}copy(){return new no(nr(this.doc.guid,this.opts))}splice(e){throw ep()}mergeWith(e){return!1}integrate(e,t){this.doc._item=t,e.subdocsAdded.add(this.doc),this.doc.shouldLoad&&e.subdocsLoaded.add(this.doc)}delete(e){e.subdocsAdded.has(this.doc)?e.subdocsAdded.delete(this.doc):e.subdocsRemoved.add(this.doc)}gc(e){}write(e,t){e.writeString(this.doc.guid),e.writeAny(this.opts)}getRef(){return 9}}class ns{constructor(e){this.embed=e}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return!0}copy(){return new ns(this.embed)}splice(e){throw ep()}mergeWith(e){return!1}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeJSON(this.embed)}getRef(){return 5}}class nl{constructor(e,t){this.key=e,this.value=t}getLength(){return 1}getContent(){return[]}isCountable(){return!1}copy(){return new nl(this.key,this.value)}splice(e){throw ep()}mergeWith(e){return!1}integrate(e,t){let i=t.parent;i._searchMarker=null,i._hasFormatting=!0}delete(e){}gc(e){}write(e,t){e.writeKey(this.key),e.writeJSON(this.value)}getRef(){return 6}}class nd{constructor(e){this.arr=e}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return!0}copy(){return new nd(this.arr)}splice(e){let t=new nd(this.arr.slice(e));return this.arr=this.arr.slice(0,e),t}mergeWith(e){return this.arr=this.arr.concat(e.arr),!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){let i=this.arr.length;e.writeLen(i-t);for(let n=t;n=55296&&i<=56319&&(this.str=this.str.slice(0,e-1)+"�",t.str="�"+t.str.slice(1)),t}mergeWith(e){return this.str+=e.str,!0}integrate(e,t){}delete(e){}gc(e){}write(e,t){e.writeString(0===t?this.str:this.str.slice(t))}getRef(){return 4}}let nh=[e=>new iF,e=>new iW,e=>new i5,e=>new i9(e.readKey()),e=>new i6,e=>new i7(e.readKey()),e=>new ne],nm=0,ng=1,nf=2,nb=3,nx=4,ny=5,nv=6;class nC{constructor(e){this.type=e}getLength(){return 1}getContent(){return[this.type]}isCountable(){return!0}copy(){return new nC(this.type._copy())}splice(e){throw ep()}mergeWith(e){return!1}integrate(e,t){this.type._integrate(e.doc,t)}delete(e){let t=this.type._start;for(;null!==t;)t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e),t=t.right;this.type._map.forEach(t=>{t.deleted?t.id.clock<(e.beforeState.get(t.id.client)||0)&&e._mergeStructs.push(t):t.delete(e)}),e.changed.delete(this.type)}gc(e){let t=this.type._start;for(;null!==t;)t.gc(e,!0),t=t.right;this.type._start=null,this.type._map.forEach(t=>{for(;null!==t;)t.gc(e,!0),t=t.left}),this.type._map=new Map}write(e,t){this.type._write(e)}getRef(){return 7}}let nw=(e,t)=>{let i,n=t,a=0;do a>0&&(n=tN(n.client,n.clock+a)),i=t0(e,n),a=n.clock-i.id.clock,n=i.redone;while(null!==n&&i instanceof n_)return{item:i,diff:a}},nS=(e,t)=>{for(;null!==e&&e.keep!==t;)e.keep=t,e=e.parent._item},nk=(e,t,i)=>{let{client:n,clock:a}=t.id,r=new n_(tN(n,a+i),t,tN(n,a+i-1),t.right,t.rightOrigin,t.parent,t.parentSub,t.content.splice(i));return t.deleted&&r.markDeleted(),t.keep&&(r.keep=!0),null!==t.redone&&(r.redone=tN(t.redone.client,t.redone.clock+i)),t.right=r,null!==r.right&&(r.right.left=r),e._mergeStructs.push(r),null!==r.parentSub&&null===r.right&&r.parent._map.set(r.parentSub,r),t.length=i,r},nA=(e,t)=>((e,t)=>{for(let i=0;itc(e.deletions,t)),nE=(e,t,i,n,a,r)=>{let o,s=e.doc,l=s.store,d=s.clientID,c=t.redone;if(null!==c)return t2(e,c);let u=t.parent._item,p=null;if(null!==u&&!0===u.deleted){if(null===u.redone&&(!i.has(u)||null===nE(e,u,i,n,a,r)))return null;for(;null!==u.redone;)u=t2(e,u.redone)}let h=null===u?t.parent:u.content.type;if(null===t.parentSub){for(p=t.left,o=t;null!==p;){let t=p;for(;null!==t&&t.parent._item!==u;)t=null===t.redone?null:t2(e,t.redone);if(null!==t&&t.parent._item===u){p=t;break}p=p.left}for(;null!==o;){let t=o;for(;null!==t&&t.parent._item!==u;)t=null===t.redone?null:t2(e,t.redone);if(null!==t&&t.parent._item===u){o=t;break}o=o.right}}else if(o=null,t.right&&!a){for(p=t;null!==p&&null!==p.right&&(p.right.redone||tc(n,p.right.id)||nA(r.undoStack,p.right.id)||nA(r.redoStack,p.right.id));)for(p=p.right;p.redone;)p=t2(e,p.redone);if(p&&null!==p.right)return null}else p=h._map.get(t.parentSub)||null;let m=tX(l,d),g=tN(d,m),f=new n_(g,p,p&&p.lastId,o,o&&o.id,h,t.parentSub,t.content.copy());return t.redone=g,nS(f,!0),f.integrate(e,0),f};class n_ extends nt{constructor(e,t,i,n,a,r,o,s){super(e,s.getLength()),this.origin=i,this.left=t,this.right=n,this.rightOrigin=a,this.parent=r,this.parentSub=o,this.redone=null,this.content=s,this.info=2*!!this.content.isCountable()}set marker(e){(8&this.info)>0!==e&&(this.info^=8)}get marker(){return(8&this.info)>0}get keep(){return(1&this.info)>0}set keep(e){this.keep!==e&&(this.info^=1)}get countable(){return(2&this.info)>0}get deleted(){return(4&this.info)>0}set deleted(e){this.deleted!==e&&(this.info^=4)}markDeleted(){this.info|=4}getMissing(e,t){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=tX(t,this.origin.client))return this.origin.client;if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=tX(t,this.rightOrigin.client))return this.rightOrigin.client;if(this.parent&&this.parent.constructor===tP&&this.id.client!==this.parent.client&&this.parent.clock>=tX(t,this.parent.client))return this.parent.client;if(this.origin&&(this.left=t3(e,t,this.origin),this.origin=this.left.lastId),this.rightOrigin&&(this.right=t2(e,this.rightOrigin),this.rightOrigin=this.right.id),this.left&&this.left.constructor===ni||this.right&&this.right.constructor===ni)this.parent=null;else if(this.parent){if(this.parent.constructor===tP){let e=t0(t,this.parent);e.constructor===ni?this.parent=null:this.parent=e.content.type}}else this.left&&this.left.constructor===n_?(this.parent=this.left.parent,this.parentSub=this.left.parentSub):this.right&&this.right.constructor===n_&&(this.parent=this.right.parent,this.parentSub=this.right.parentSub);return null}integrate(e,t){if(t>0&&(this.id.clock+=t,this.left=t3(e,e.doc.store,tN(this.id.client,this.id.clock-1)),this.origin=this.left.lastId,this.content=this.content.splice(t),this.length-=t),this.parent){if(!this.left&&(!this.right||null!==this.right.left)||this.left&&this.left.right!==this.right){let t,i=this.left;if(null!==i)t=i.right;else if(null!==this.parentSub)for(t=this.parent._map.get(this.parentSub)||null;null!==t&&null!==t.left;)t=t.left;else t=this.parent._start;let n=new Set,a=new Set;for(;null!==t&&t!==this.right;){if(a.add(t),n.add(t),tD(this.origin,t.origin)){if(t.id.client{t.p===e&&(t.p=this,!this.deleted&&this.countable&&(t.index-=this.length))}),e.keep&&(this.keep=!0),this.right=e.right,null!==this.right&&(this.right.left=this),this.length+=e.length,!0}return!1}delete(e){if(!this.deleted){let t=this.parent;this.countable&&null===this.parentSub&&(t._length-=this.length),this.markDeleted(),th(e.deleteSet,this.id.client,this.id.clock,this.length),t9(e,t,this.parentSub),this.content.delete(e)}}gc(e,t){if(!this.deleted)throw eh();if(this.content.gc(e),t){var i;let t;i=new ni(this.id,this.length),(t=e.clients.get(this.id.client))[tJ(t,this.id.clock)]=i}else this.content=new na(this.length)}write(e,t){let i=t>0?tN(this.id.client,this.id.clock+t-1):this.origin,n=this.rightOrigin,a=this.parentSub,r=31&this.content.getRef()|128*(null!==i)|64*(null!==n)|32*(null!==a);if(e.writeInfo(r),null!==i&&e.writeLeftID(i),null!==n&&e.writeRightID(n),null===i&&null===n){let t=this.parent;if(void 0!==t._item){let i=t._item;if(null===i){let i=tB(t);e.writeParentInfo(!0),e.writeString(i)}else e.writeParentInfo(!1),e.writeLeftID(i.id)}else t.constructor===String?(e.writeParentInfo(!0),e.writeString(t)):t.constructor===tP?(e.writeParentInfo(!1),e.writeLeftID(t)):eh();null!==a&&e.writeString(a)}this.content.write(e,t)}}let nI=(e,t)=>nM[31&t](e),nM=[()=>{eh()},e=>new na(e.readLen()),e=>{let t=e.readLen(),i=[];for(let n=0;nnew nn(e.readBuf()),e=>new np(e.readString()),e=>new ns(e.readJSON()),e=>new nl(e.readKey(),e.readJSON()),e=>new nC(nh[e.readTypeRef()](e)),e=>{let t=e.readLen(),i=[];for(let n=0;nnew no(nr(e.readString(),e.readAny())),()=>{eh()}];class nT extends nt{get deleted(){return!0}delete(){}mergeWith(e){return this.constructor===e.constructor&&(this.length+=e.length,!0)}integrate(e,t){eh()}write(e,t){e.writeInfo(10),Y(e.restEncoder,this.length-t)}getMissing(e,t){return null}}let nL="u">typeof globalThis?globalThis:"u">typeof window?window:e.g,nj="__ $YJS$ __";!0===nL[nj]&&console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438"),nL[nj]=!0,e.s(["ContentFormat",0,nl,"ContentString",0,np,"ContentType",0,nC,"Doc",0,tx,"Item",0,n_,"RelativePosition",0,tF,"Snapshot",0,tG,"Text",0,i5,"UndoManager",0,class extends j{constructor(e,{captureTimeout:t=500,captureTransaction:i=e=>!0,deleteFilter:n=()=>!0,trackedOrigins:a=new Set([null]),ignoreRemoteMapChanges:r=!1,doc:o=L(e)?e[0].doc:e instanceof tx?e:e.doc}={}){super(),this.scope=[],this.doc=o,this.addToScope(e),this.deleteFilter=n,a.add(this),this.trackedOrigins=a,this.captureTransaction=i,this.undoStack=[],this.redoStack=[],this.undoing=!1,this.redoing=!1,this.currStackItem=null,this.lastChange=0,this.ignoreRemoteMapChanges=r,this.captureTimeout=t,this.afterTransactionHandler=e=>{if(!this.captureTransaction(e)||!this.scope.some(t=>e.changedParentTypes.has(t)||t===this.doc)||!this.trackedOrigins.has(e.origin)&&(!e.origin||!this.trackedOrigins.has(e.origin.constructor)))return;let t=this.undoing,i=this.redoing,n=t?this.redoStack:this.undoStack;t?this.stopCapturing():i||this.clear(!1,!0);let a=new tl;e.afterState.forEach((t,i)=>{let n=e.beforeState.get(i)||0,r=t-n;r>0&&th(a,i,n,r)});let r=eP(),o=!1;if(this.lastChange>0&&r-this.lastChange0&&!t&&!i){let t=n[n.length-1];t.deletions=tp([t.deletions,e.deleteSet]),t.insertions=tp([t.insertions,a])}else n.push(new it(e.deleteSet,a)),o=!0;t||i||(this.lastChange=r),td(e,e.deleteSet,t=>{t instanceof n_&&this.scope.some(i=>i===e.doc||tz(i,t))&&nS(t,!0)});let s=[{stackItem:n[n.length-1],origin:e.origin,type:t?"redo":"undo",changedParentTypes:e.changedParentTypes},this];o?this.emit("stack-item-added",s):this.emit("stack-item-updated",s)},this.doc.on("afterTransaction",this.afterTransactionHandler),this.doc.on("destroy",()=>{this.destroy()})}addToScope(e){let t=new Set(this.scope);(e=L(e)?e:[e]).forEach(e=>{t.has(e)||(t.add(e),(e instanceof iS?e.doc!==this.doc:e!==this.doc)&&tn("[yjs#509] Not same Y.Doc"),this.scope.push(e))})}addTrackedOrigin(e){this.trackedOrigins.add(e)}removeTrackedOrigin(e){this.trackedOrigins.delete(e)}clear(e=!0,t=!0){(e&&this.canUndo()||t&&this.canRedo())&&this.doc.transact(i=>{e&&(this.undoStack.forEach(e=>ii(i,this,e)),this.undoStack=[]),t&&(this.redoStack.forEach(e=>ii(i,this,e)),this.redoStack=[]),this.emit("stack-cleared",[{undoStackCleared:e,redoStackCleared:t}])})}stopCapturing(){this.lastChange=0}undo(){let e;this.undoing=!0;try{e=ia(this,this.undoStack,"undo")}finally{this.undoing=!1}return e}redo(){let e;this.redoing=!0;try{e=ia(this,this.redoStack,"redo")}finally{this.redoing=!1}return e}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this),this.doc.off("afterTransaction",this.afterTransactionHandler),super.destroy()}},"XmlElement",0,i9,"XmlFragment",0,i6,"XmlText",0,ne,"createAbsolutePositionFromRelativePosition",0,tV,"createDeleteSet",0,tm,"createID",0,tN,"createRelativePositionFromTypeIndex",0,tU,"createSnapshot",0,t$,"decodeRelativePosition",0,e=>(e=>{let t=null,i=null,n=null;switch(eC(e)){case 0:n=tO(e);break;case 1:i=eS(e);break;case 2:t=tO(e)}return new tF(t,i,n,ex(e)?ew(e):0)})(eb(e)),"encodeRelativePosition",0,e=>{let t=Z();return((e,t)=>{let{type:i,tname:n,item:a,assoc:r}=t;if(null!==a)Y(e,0),tR(e,a);else if(null!==n)q(e,1),ee(e,n);else if(null!==i)q(e,2),tR(e,i);else throw eh();return X(e,r)})(t,e),K(t)},"encodeStateAsUpdate",0,(e,t)=>((e,t=new Uint8Array([0]),i=new tE)=>{((e,t,i=new Map)=>{t_(e,t.store,i),tf(e,tg(t.store))})(i,e,tI(t));let n=[i.toUint8Array()];if(e.store.pendingDs&&n.push(e.store.pendingDs),e.store.pendingStructs&&n.push(((e,t,i=tw,n=tE)=>{let a=tI(t),r=new n,o=new io(r),s=new i(eb(e)),l=new ir(s,!1);for(;l.curr;){let e=l.curr,t=e.id.client,i=a.get(t)||0;if(l.curr.constructor===nT){l.next();continue}if(e.id.clock+e.length>i)for(ic(o,e,R(i-e.id.clock,0)),l.next();l.curr&&l.curr.id.client===t;)ic(o,l.curr,0),l.next();else for(;l.curr&&l.curr.id.client===t&&l.curr.id.clock+l.curr.length<=i;)l.next()}return iu(o),tf(r,tb(s)),r.toUint8Array()})(e.store.pendingStructs.update,t)),n.length>1){if(i.constructor===tk)return il(n.map((e,t)=>0===t?e:((e,t,i,n)=>{let a=new i(eb(e)),r=new ir(a,!1),o=new n,s=new io(o);for(let e=r.curr;null!==e;e=r.next())ic(s,t(e),0);return iu(s),tf(o,tb(a)),o.toUint8Array()})(e,eU,tw,tk)),tv,tk);else if(i.constructor===tE)return il(n)}return n[0]})(e,t,new tk),"findRootTypeKey",0,tB,"isDeleted",0,tc,"isParentOf",0,tz,"iterateDeletedStructs",0,td,"snapshot",0,e=>t$(tg(e.store),tY(e.store)),"typeListToArraySnapshot",0,iE],802818);let nP=new w.PluginKey("y-sync"),nD=new w.PluginKey("y-undo");new w.PluginKey("yjs-cursor"),e.s(["ySyncPluginKey",0,nP,"yUndoPluginKey",0,nD],89081);let nN=(e,t)=>({anchor:nK(t.selection.anchor,e.type,e.mapping),head:nK(t.selection.head,e.type,e.mapping),type:t.selection.jsonID}),nR=(e,t)=>{let i,n;return e instanceof Array?(i=new ne,n=e.map(e=>({insert:e.text,attributes:nG(e.marks)})),i.applyDelta(n),t.set(i,e),i):((e,t)=>{let i=new i9(e.type.name);for(let t in e.attrs){let n=e.attrs[t];null!==n&&"ychange"!==t&&i.setAttribute(t,n)}return i.insert(0,nz(e).map(e=>nR(e,t))),t.set(i,e),i})(e,t)},nO=e=>"object"==typeof e&&null!==e,nB=(e,t)=>{let i=Object.keys(e).filter(t=>null!==e[t]),n=i.length===Object.keys(t).filter(e=>null!==t[e]).length;for(let a=0;a{let t=e.content.content,i=[];for(let e=0;e{let i=e.toDelta();return i.length===t.length&&i.every((e,i)=>e.insert===t[i].text&&r(e.attributes||{}).length===t[i].marks.length&&t[i].marks.every(t=>nB(e.attributes[t.type.name]||{},t.attrs)))},nH=(e,t)=>{if(e instanceof i9&&!(t instanceof Array)&&nZ(e,t)){let i=nz(t);return e._length===i.length&&nB(e.getAttributes(),t.attrs)&&e.toArray().every((e,t)=>nH(e,i[t]))}return e instanceof ne&&t instanceof Array&&nF(e,t)},nW=(e,t)=>e===t||e instanceof Array&&t instanceof Array&&e.length===t.length&&e.every((e,i)=>t[i]===e),nU=(e,t,i)=>{let n=e.toArray(),a=nz(t),r=a.length,o=n.length,s=v(o,r),l=0,d=0,c=!1;for(;l{i.set(e,t);let{nAttrs:n,str:a}=(e=>{let t="",i=e._start,n={};for(;null!==i;)!i.deleted&&(i.countable&&i.content instanceof np?t+=i.content.str:i.content instanceof nl&&(n[i.content.key]=null)),i=i.right;return{str:t,nAttrs:n}})(e),r=t.map(e=>({insert:e.text,attributes:Object.assign({},n,nG(e.marks))})),{insert:o,remove:s,index:l}=((e,t)=>{let i=0,n=0;for(;ie.insert).join(""));e.delete(l,s),e.insert(l,o),e.applyDelta(r.map(e=>({retain:e.insert.length,attributes:e.attributes})))},nG=e=>{let t={};return e.forEach(e=>{"ychange"!==e.type.name&&(t[e.type.name]=e.attrs)}),t},n$=(e,t,i,n)=>{if(t instanceof i9&&t.nodeName!==i.type.name)throw Error("node name mismatch!");if(n.set(t,i),t instanceof i9){let e=t.getAttributes(),n=i.attrs;for(let i in n)null!==n[i]?e[i]!==n[i]&&"ychange"!==i&&t.setAttribute(i,n[i]):t.removeAttribute(i);for(let i in e)void 0===n[i]&&t.removeAttribute(i)}let a=nz(i),r=a.length,o=t.toArray(),s=o.length,l=v(r,s),d=0,c=0;for(;d{for(;s-d-c>0&&r-d-c>0;){let i=o[d],l=a[d],u=o[s-c-1],p=a[r-c-1];if(i instanceof ne&&l instanceof Array)nF(i,l)||nV(i,l,n),d+=1;else{let a=i instanceof i9&&nZ(i,l),r=u instanceof i9&&nZ(u,p);if(a&&r){let e=nU(i,l,n),t=nU(u,p,n);e.foundMappedChild&&!t.foundMappedChild?r=!1:!e.foundMappedChild&&t.foundMappedChild||e.equalityFactor0&&(t.slice(d,d+i).forEach(e=>n.delete(e)),t.delete(d,i)),d+c!(t instanceof Array)&&e.nodeName===t.type.name,nK=(e,t,i)=>{if(0===e)return tU(t,0);let n=null===t._first?null:t._first.content.type;for(;null!==n&&t!==n;){if(n instanceof ne){if(n._length>=e)return tU(n,e);if(e-=n._length,null!==n._item&&null!==n._item.next)n=n._item.next.content.type;else{do n=null===n._item?null:n._item.parent,e--;while(n!==t&&null!==n&&null!==n._item&&null===n._item.next)null!==n&&n!==t&&(n=null===n._item?null:n._item.next.content.type)}}else{let a=(i.get(n)||{nodeSize:0}).nodeSize;if(null!==n._first&&e1)return new tF(null===n._item?null:n._item.id,null===n._item?tB(n):null,null);if(e-=a,null!==n._item&&null!==n._item.next)n=n._item.next.content.type;else{if(0===e)return new tF(null===(n=null===n._item?n:n._item.parent)._item?null:n._item.id,null===n._item?tB(n):null,null);do n=n._item.parent,e--;while(n!==t&&null===n._item.next)n!==t&&(n=n._item.next.content.type)}}}if(null===n)throw x();if(0===e&&n.constructor!==ne&&n!==t)return nq(n._item.parent,n._item)}return tU(t,t._length)},nq=(e,t)=>{let i=null,n=null;return null===e._item?n=tB(e):i=tN(e._item.id.client,e._item.id.clock),new tF(i,n,t.id)},nY=(e,t,i,n)=>{let a=tV(i,e);if(null===a||a.type!==t&&!tz(t,a.type._item))return null;let r=a.type,o=0;if(r.constructor===ne)o=a.index;else if(null===r._item||!r._item.deleted){let e=r._first,t=0;for(;te(void 0)},n,i,new Map),r.doc):a}(C.Node.fromJSON(e,t),i)}function nQ(e,t="prosemirror"){return{type:"doc",content:e.getXmlFragment(t).toArray().map(function e(t){let i;if(t.nodeName){i={type:t.nodeName};let n=t.getAttributes();Object.keys(n).length&&(i.attrs=n);let a=t.toArray();a.length&&(i.content=a.map(e).flat())}else i=t.toDelta().map(e=>{let t={type:"text",text:e.insert};return e.attributes&&(t.marks=Object.keys(e.attributes).map(t=>{let i=e.attributes[t],n={type:t};return Object.keys(i)&&(n.attrs=i),n})),t});return i})}}e.s(["CellSelection2",()=>aB,"drawCellSelection",()=>aF,"normalizeSelection",()=>aH],714273);var nJ=w,n0=e.i(615505);e.s(["addColumn",()=>af,"addRowAfter",()=>aC,"addRowBefore",()=>av,"deleteColWhenEmpty",()=>aR,"deleteColumnTr",()=>ax,"deleteRowTr",()=>aw,"deleteRowWhenEmpty",()=>aN,"deleteTableTr",()=>aP,"deleteTableWhenEmpty",()=>aD,"goToNextCell",()=>aj,"mergeCells",()=>ak,"reorderColumnTr",()=>aO,"selectedRect",()=>ag,"setCellAttr",()=>aE,"splitCell",()=>aA,"toggleHeaderCell",()=>aL,"toggleHeaderColumn",()=>aT,"toggleHeaderRow",()=>aM],190946);var n1=e.i(54182);let n2=(e,t,i)=>t&&w.NodeSelection.isSelectable(t)?w.NodeSelection.create(e,i):null,n3=(e,t,i)=>t&&t.inlineContent?w.TextSelection.create(e,i):null;function n5(e,t,i){return e&&i?i:e&&t?t:!e&&t?t:!e&&i?i:null}function n4(e,t){let{doc:i,pos:n,parent:a,nodeAfter:r,nodeBefore:o}=e;if(a.inlineContent)return w.TextSelection.create(i,n);let s=t>0,l=n5(s,n3(i,o,n-1),n3(i,r,n+1));if(l)return l;if(n1.GapCursor.valid(e))return new n1.GapCursor(e);if(a.type.spec.isolating){let t=n5(s,n2(i,o,n-(o?.nodeSize||0)),n2(i,r,n));if(t)return t;if(0===a.childCount&&w.NodeSelection.isSelectable(a))return w.NodeSelection.create(i,e.before())}return null}function n6(e,t=1){let i=n4(e,t);if(i)return i;for(let i=e.depth-1;i>=0&&!e.node(i+1).type.spec.isolating;i--){let n=t<0?e.before(i+1):e.after(i+1),a=n4(e.doc.resolve(n),t);if(a)return a}return null}let n9=(e,t)=>{let i,n=e.steps.length-1,a=e.steps[n];return a instanceof S.ReplaceStep||a instanceof S.ReplaceAroundStep?(e.mapping.maps[n].forEach((e,t,n,a)=>{null==i&&(i=a)}),null==i)?null:n6(e.doc.resolve(i),t):null};e.s(["createSelectionNearLastTo",0,n9,"findSelectionNearOrGapCursor",0,n6],285598);var n8=e.i(777226);function n7(e){let t=e.cached.tableNodeTypes;if(!t)for(let i in t=e.cached.tableNodeTypes={},e.nodes){let n=e.nodes[i],a=n.spec.tableRole;a&&(t[a]=n)}return t}if("u">typeof WeakMap){let e=new WeakMap;n=t=>e.get(t),a=(t,i)=>(e.set(t,i),i)}else{let e=[],t=0;n=t=>{for(let i=0;i(10==t&&(t=0),e[t++]=i,e[t++]=n)}class ae{left;top;right;bottom;constructor(e,t,i,n){this.left=e,this.top=t,this.right=i,this.bottom=n}}class at{width;height;map;problems;constructor(e,t,i,n){this.width=e,this.height=t,this.map=i,this.problems=n}findCell(e){for(let t=0;tt%this.width==0)}colCount(e){for(let t=0;tn&&(r+=a.attrs.colspan)}}for(let e=0;e1&&(i=!0)}-1==t?t=r:t!=r&&(t=Math.max(t,r))}return t}(e),i=e.childCount,n=[],a=0,r=null,o=[];for(let e=0,a=t*i;e=i){(r||(r=[])).push({type:"overlong_rowspan",pos:l,n:p-e});break}let d=a+e*t;for(let e=0;eai,"addColSpan",()=>ah,"cellAround",()=>an,"cellWrapping",()=>aa,"columnIsHeader",()=>am,"inSameTable",()=>ad,"isInTable",()=>ar,"moveCellForward",()=>al,"nextCell",()=>ac,"pointsAtCell",()=>as,"removeColSpan",()=>ap,"selectionCell",()=>ao,"setAttr",()=>au],958859);let ai=new w.PluginKey("selectingCells");function an(e){if(!e)return null;for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function aa(e){if(!e)return null;for(let t=e.depth;t>0;t--){let i=e.node(t).type.spec.tableRole;if("cell"===i||"header_cell"===i)return e.node(t)}return null}function ar(e){let t=e.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function ao(e){return e instanceof aB?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e instanceof w.NodeSelection&&"cell"==e.node.type.spec.tableRole?e.$anchor:an(e.$head)||function(e){if(!e)return null;for(let t=e.nodeAfter,i=e.pos;t;t=t.firstChild,i++){let n=t.type.spec.tableRole;if("cell"==n||"header_cell"==n)return e.doc.resolve(i)}for(let t=e.nodeBefore,i=e.pos;t;t=t.lastChild,i--){let n=t.type.spec.tableRole;if("cell"==n||"header_cell"==n)return e.doc.resolve(i-t.nodeSize)}return null}(e.$head)}function as(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function al(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function ad(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function ac(e,t,i){let n=e.start(-1),a=at.get(e.node(-1)).nextCell(e.pos-n,t,i);return null==a?null:e.node(0).resolve(n+a)}function au(e,t,i){let n={};for(let t in e)n[t]=e[t];return n[t]=i,n}function ap(e,t,i=1){let n=au(e,"colspan",e.colspan-i);return n.colwidth&&(n.colwidth=n.colwidth.slice(),n.colwidth.splice(t,i),n.colwidth.some(e=>e>0)||(n.colwidth=null)),n}function ah(e,t,i=1){let n=au(e,"colspan",e.colspan+i);if(n.colwidth){n.colwidth=n.colwidth.slice();for(let e=0;e0?-1:0;am(o,n,i+s)&&(s=0==i||i==o.width?null:0);for(let a=0;a0&&i0&&n.map[s-1]==l||i0?-1:0;(function(e,t,i){let n=n7(t.type.schema).header_cell;for(let a=0;a0&&a0&&l==t.map[o-t.width]){let t=i.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(s).map(l+n),void 0,au(t,"rowspan",t.rowspan-1)),r+=t.colspan-1}else if(a0&&i[r]==i[r-1]||n.right0&&i[a]==i[a-e]||n.bottomn[e.type.spec.tableRole],(e,t)=>{let n,a,r=e.selection;if(r instanceof aB){if(r.$anchorCell.pos!=r.$headCell.pos)return!1;n=r.$anchorCell.nodeAfter,a=r.$anchorCell.pos}else{if(!(n=aa(r.$from)))return!1;a=an(r.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let o,s=n.attrs,l=[],d=s.colwidth;s.rowspan>1&&(s=au(s,"rowspan",1)),s.colspan>1&&(s=au(s,"colspan",1));let c=ag(e.selection);if(!c)return!1;let u=e.tr;for(let e=0;e{i.attrs[e]!==t&&r.setNodeMarkup(n,void 0,au(i.attrs,e,t))}):r.setNodeMarkup(a.pos,void 0,au(a.nodeAfter.attrs,e,t)),n(r)}return!0}}function a_(e,t,i){let n=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;ea.table.nodeAt(e));for(let e=0;e{let t=e+a.tableStart,i=r.doc.nodeAt(t);i&&r.setNodeMarkup(t,c,i.attrs)}),i(r)}return!0}}let aM=aI("row",{useDeprecatedLogic:!0}),aT=aI("column",{useDeprecatedLogic:!0}),aL=aI("cell",{useDeprecatedLogic:!0});function aj(e){return function(t,i){if(!ar(t.selection))return!1;let n=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,i=e.before();t>=0;t--){let n=e.node(-1).child(t);if(n.childCount)return i-1-n.lastChild.nodeSize;i-=n.nodeSize}}else{if(e.index()0;e--)if("table"==n.node(e).type.spec.tableRole){t.delete(n.before(e),n.after(e)).scrollIntoView();let a=n9(t);return a&&t.setSelection(a),i&&i(t),!0}return!1}let aD=(e,t,i)=>e instanceof aB&&!!(e.isSelectingAllCells()&&e.everyCell(aS))&&aP(e,t,i),aN=(e,t,i)=>e instanceof aB&&!!e.isRowSelection()&&!!e.everyCell(aS)&&aw(e,t,i),aR=(e,t,i)=>e instanceof aB&&!!e.isColSelection()&&!!e.everyCell(aS)&&ax(e,t,i),aO=(e,t,i,n,a,r)=>{if(!ar(i))return!1;let o=ag(i);if(!o)return!1;let s=function(e,{tableStart:t,fromCol:i,toCol:n,table:a,colMinPercent:r=10,newColSize:o=20}){if(i===n)return!1;let s=at.get(a);if(i<0||i>=s.width||n<0||n>s.width)return console.warn("Invalid column indices:",{fromCol:i,toCol:n,mapWidth:s.width}),!1;if(!af(e,{tableStart:t,col:n,table:a,colMinPercent:r,newColSize:o}))return console.warn("Failed to add column at position:",n),!1;let l=e.doc.nodeAt(t-1),d=at.get(l),c=n<=i?i+1:i;for(let i=0;i0){let i=(0,n8.removeColWidth)(m,[c]);e.setNodeMarkup(t-1,void 0,{...h.attrs,colWidths:i})}return!0}(n,{tableStart:o.tableStart,fromCol:e,toCol:t,table:o.table,colMinPercent:r?.colMinPercent||10,newColSize:r?.newColSize||20});return s&&a&&a(n),s};class aB extends nJ.Selection{$anchorCell;$headCell;visible;constructor(e,t=e){const i=e.node(-1),n=at.get(i),a=e.start(-1),r=n.rectBetween(e.pos-a,t.pos-a),o=e.node(0),s=n.cellsInRect(r).filter(e=>e!=t.pos-a);s.unshift(t.pos-a);const l=s.map(e=>{let t=i.nodeAt(e),n=e+a+1;return new nJ.SelectionRange(o.resolve(n),o.resolve(n+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t,this.visible=!1,this.$anchorCell=e,this.$headCell=t}map(e,t){let i=e.resolve(t.map(this.$anchorCell.pos)),n=e.resolve(t.map(this.$headCell.pos));if(as(i)&&as(n)&&ad(i,n)){let e=this.$anchorCell.node(-1)!=i.node(-1);return e&&this.isRowSelection()?aB.rowSelection(i,n):e&&this.isColSelection()?aB.colSelection(i,n):new aB(i,n)}return nJ.TextSelection.between(i,n)}content(){let e=this.$anchorCell.node(-1),t=at.get(e),i=this.$anchorCell.start(-1),n=t.rectBetween(this.$anchorCell.pos-i,this.$headCell.pos-i),a={},r=[];for(let i=n.top;i0||d>0){let e=s.attrs;l>0&&(e=ap(e,0,l)),d>0&&(e=ap(e,e.colspan-d,d)),s=r.leftn.bottom){let e=au(s.attrs,"rowspan",Math.min(r.bottom,n.bottom)-Math.max(r.top,n.top));s=r.top{e(i,n)||(t=!1)}),t}forEachCell(e){let t=this.$anchorCell.node(-1),i=at.get(t),n=this.$anchorCell.start(-1),a=i.cellsInRect(i.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n));for(let i=0;i0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let i=at.get(e.node(-1)),n=e.start(-1),a=i.findCell(e.pos-n),r=i.findCell(t.pos-n),o=e.node(0);return a.top<=r.top?(a.top>0&&(e=o.resolve(n+i.map[a.left])),r.bottom0&&(t=o.resolve(n+i.map[r.left])),a.bottom0)&&Math.max(i+this.$anchorCell.nodeAfter.attrs.colspan,n+this.$headCell.nodeAfter.attrs.colspan)==e.width}eq(e){return e instanceof aB&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let i=at.get(e.node(-1)),n=e.start(-1),a=i.findCell(e.pos-n),r=i.findCell(t.pos-n),o=e.node(0);return a.left<=r.left?(a.left>0&&(e=o.resolve(n+i.map[a.top*i.width])),r.right0&&(t=o.resolve(n+i.map[r.top*i.width])),a.right{t.push(n0.Decoration.node(i,i+e.nodeSize,{class:"selectedCell"}))}),n0.DecorationSet.create(e.doc,t)}function aH(e,t,i){let n,a,r=(t||e).selection,o=(t||e).doc;if(r instanceof nJ.NodeSelection&&(a=r.node.type.spec.tableRole)){if("cell"==a||"header_cell"==a)n=aB.create(o,r.from);else if("row"==a){let e=o.resolve(r.from+1);n=aB.rowSelection(e,e)}else if(!i){let e=at.get(r.node),t=r.from+1,i=t+e.map[e.width*e.height-1];n=aB.create(o,t+1,i)}}else r instanceof nJ.TextSelection&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos=0&&!(e.after(a+1)=0&&!(t.before(e+1)>t.start(e));e--,n--);return i==n&&/row|table/.test(e.node(a).type.spec.tableRole)}(r)?n=nJ.TextSelection.create(o,r.from):r instanceof nJ.TextSelection&&function({$from:e,$to:t}){let i,n;for(let t=e.depth;t>0;t--){let n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){i=n;break}}for(let e=t.depth;e>0;e--){let i=t.node(e);if("cell"===i.type.spec.tableRole||"header_cell"===i.type.spec.tableRole){n=i;break}}return i!==n&&0===t.parentOffset}(r)&&(n=nJ.TextSelection.create(o,r.$from.start(),r.$from.end()));return n&&(t||(t=e.tr)).setSelection(n),t}e.s(["fixTables",()=>aV,"fixTablesKey",()=>aU],214898);var aW=e.i(265304);let aU=new w.PluginKey("fix-tables");function aV(e,t){let i,n=(t,n)=>{"table"!=t.type.spec.tableRole||(0,aW.isTableTooLargeToHandle)(t)||(i=function(e,t,i,n){let a,r,o=at.get(t);if(!o.problems)return n;n||(n=e.tr);let s=[];for(let e=0;e0){let t="cell";i.firstChild&&(t=i.firstChild.type.spec.tableRole);let s=[];for(let i=0;i0&&n>0||"table"==t.firstChild.type.spec.tableRole);)i--,n--,t=t.firstChild.content;let a=t.firstChild,r=a.type.spec.tableRole,o=a.type.schema,s=[];if("row"==r)for(let e=0;e=0;t--){let{rowspan:a,colspan:r}=n.child(t).attrs;for(let t=e;t=t.length&&t.push(C.Fragment.empty),i[a]n&&(s=s.type.create(ap(s.attrs,s.attrs.colspan,i+s.attrs.colspan-n),s.content)),o.push(s),i+=s.attrs.colspan;for(let i=1;ia&&(t=t.type.create(au(t.attrs,"rowspan",Math.max(1,a-t.attrs.rowspan)),t.content)),o.push(t)}e.push(C.Fragment.from(o))}i=e,t=a}return{width:e,height:t,rows:i}}function aq(e,t,i,n,a,r,o,s){if(0==o||o==t.height)return!1;let l=!1;for(let d=a;dt.width)for(let r=0,d=0;rt.height){let d=[];for(let e=0,n=(t.height-1)*t.width;e=t.width)&&i.nodeAt(t.map[n+e]).type==l.header_cell;d.push(a?s||(s=l.header_cell.createAndFill()):o||(o=l.cell.createAndFill()))}let c=l.row.create(null,C.Fragment.from(d)),u=[];for(let e=t.height;e{let r=i.selection;if(r instanceof aB)return aJ(i,n,w.Selection.near(r.$headCell,t));if("horiz"!=e&&!r.empty)return!1;let o=a3(a,e,t);if(null==o)return!1;if("horiz"==e)return aJ(i,n,w.Selection.near(i.doc.resolve(r.head+t),t));{let a=i.doc.resolve(o),r=ac(a,e,t),s;return s=r?w.Selection.near(r,1):t<0?w.Selection.near(i.doc.resolve(a.before(-1)),-1):w.Selection.near(i.doc.resolve(a.after(-1)),1),aJ(i,n,s)}}}function a1(e,t){return(i,n,a)=>{let r=i.selection;if(!(r instanceof aB)){let n=a3(a,e,t);if(null==n)return!1;r=new aB(i.doc.resolve(n))}let o=ac(r.$headCell,e,t);return!!o&&aJ(i,n,new aB(r.$anchorCell,o))}}function a2(e,t){let i=e.selection;if(!(i instanceof aB))return!1;if(t){let n=e.tr,a=n7(e.schema).cell.createAndFill().content;i.forEachCell((e,t)=>{e.content.eq(a)||n.replace(n.mapping.map(t+1),n.mapping.map(t+e.nodeSize-1),new C.Slice(a,0,0))}),n.docChanged&&t(n)}return!0}function a3(e,t,i){if(!(e.state.selection instanceof w.TextSelection))return null;let{$head:n}=e.state.selection;for(let a=n.depth-1;a>=0;a--){let r=n.node(a);if((i<0?n.index(a):n.indexAfter(a))!=(i<0?0:r.childCount))break;if("cell"==r.type.spec.tableRole||"header_cell"==r.type.spec.tableRole){let r=n.before(a),o="vert"==t?i>0?"down":"up":i>0?"right":"left";return e.endOfTextblock(o)?r:null}}return null}function a5(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function a4(e,t){let i=e.posAtCoords({left:t.clientX,top:t.clientY});return i&&i?an(e.state.doc.resolve(i.pos)):null}e.s(["handleKeyDown",0,aQ,"handleMouseDown",0,function(e,t){let i;if(t.ctrlKey||t.metaKey)return!1;let n=a5(e,t.target);if(t.shiftKey&&e.state.selection instanceof aB)a(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&n&&null!=(i=an(e.state.selection.$anchor))&&a4(e,t)?.pos!=i.pos)a(i,t),t.preventDefault();else if(!n)return!1;function a(t,i){let n=a4(e,i),a=null==ai.getState(e.state);if(!n||!ad(t,n))if(!a)return!1;else n=t;let r=new aB(t,n);if(a||!e.state.selection.eq(r)){let i=e.state.tr.setSelection(r);a&&i.setMeta(ai,t.pos),e.dispatch(i)}}function r(){e.root.removeEventListener("mouseup",r),e.root.removeEventListener("dragstart",r),e.root.removeEventListener("mousemove",o),null!=ai.getState(e.state)&&e.dispatch(e.state.tr.setMeta(ai,-1))}function o(i){let o=ai.getState(e.state),s;if(null!=o)s=e.state.doc.resolve(o);else if(a5(e,i.target)!=n&&!(s=a4(e,t)))return r();s&&a(s,i)}return e.root.addEventListener("mouseup",r),e.root.addEventListener("dragstart",r),e.root.addEventListener("mousemove",o),!1},"handlePaste",0,function(e,t,i){if(!ar(e.state.selection))return!1;let n=a$(i),a=e.state.selection;if(a instanceof aB){n||(n={width:1,height:1,rows:[C.Fragment.from(aZ(n7(e.state.schema).cell,i))]});let t=a.$anchorCell.node(-1),r=a.$anchorCell.start(-1),o=at.get(t).rectBetween(a.$anchorCell.pos-r,a.$headCell.pos-r);return n=aK(n,o.right-o.left,o.bottom-o.top),aX(e.state,e.dispatch,r,o,n),!0}if(!n)return!1;{let t=ao(e.state.selection),i=t.start(-1);return aX(e.state,e.dispatch,i,at.get(t.node(-1)).findCell(t.pos-i),n),!0}}],992539)},899611,625878,456801,528403,265304,536913,763498,6419,e=>{"use strict";var t=e.i(175863),i=e.i(325059),n=e.i(256266),a=e.i(816256),r=e.i(89081),o=e.i(755453),s=e.i(103630);e.s(["MAX_TABLE_CELLS_TO_RENDER",()=>I,"isTableCellNode",()=>E,"isTableNode",()=>A,"isTableRowNode",()=>_,"isTableTooLargeToHandle",()=>M],265304),e.s(["tableEditing",()=>k],528403);var l=e.i(714273),d=e.i(214898),c=e.i(992539),u=e.i(958859),p=e.i(473226),h=e.i(615505),m=e.i(599294);e.i(462480),e.i(802818);let g=(e,t)=>{let i=r.ySyncPluginKey.getState(e);if(!i)return null;let{doc:n,type:o,binding:s}=i;return i.binding?(0,a.relativePositionToAbsolutePosition)(n,o,t,s.mapping):null};e.s(["absoluteToRelativePos",0,(e,t)=>{let i=r.ySyncPluginKey.getState(e);if(!i)return null;let{type:n,binding:o}=i;return i.binding?(0,a.absolutePositionToRelativePosition)(t,n,o.mapping):null},"relativeToAbsolutePos",0,g],625878);let f=new t.PluginKey("tableColumnResizing");class b{activeHandle;dragging;constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}getActiveHandleAbs(e){return null===this.activeHandle?null:g(e,this.activeHandle)}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){if(null===t.setHandle)return this.activeHandle=null,this;let i=r.ySyncPluginKey.getState(e);if(!i)return this;let{type:n,binding:o}=i;return this.activeHandle=(0,a.absolutePositionToRelativePosition)(t.setHandle,n,o.mapping),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let i=e.getMeta(f);return i&&"setHandle"in i?this.setHandle(t,i):i&&"setDragging"in i?this.setDragging(i):i&&"reset"in i?this.reset():this}}var x=e.i(777226),y=e.i(832300);function v(e,t,i){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:a}=n,r=(0,u.cellAround)(e.state.doc.resolve(a+1));if(!r)return null;if("right"===i)return r.pos;let o=y.TableMap.get(r.node(-1)),s=r.start(-1),l=o.map.indexOf(r.pos-s);return l%o.width==0?null:s+o.map[l-1]}function C(e,t){e.dispatch(e.state.tr.setMeta(f,{setHandle:t}))}let w=e=>{let t=e.node(-1),i=y.TableMap.get(t),n=e.start(-1);return i.colCount(e.pos-n)},S=(e,t)=>{let i=e.domAtPos(t.start(-1)).node;for(;"TABLE"!=i.nodeName;)i=i.parentNode;return i};function k({allowTableNodeSelection:e=!1}={}){return new t.Plugin({key:u.SelectingCellsKey,state:{init:()=>null,apply(e,t){let i=e.getMeta(u.SelectingCellsKey);if(null!=i)return -1==i?null:i;if(null==t||!e.docChanged)return t;let{deleted:n,pos:a}=e.mapping.mapResult(t);return n?null:a}},props:{decorations:l.drawCellSelection,handleDOMEvents:{mousedown:c.handleMouseDown},createSelectionBetween:e=>null!=u.SelectingCellsKey.getState(e.state)?e.state.selection:null,handleKeyDown:c.handleKeyDown,handlePaste:c.handlePaste},appendTransaction:(t,i,n)=>(0,l.normalizeSelection)(n,(0,d.fixTables)(n,i),e)})}e.s(["columnResizing",0,function({handleWidth:e=5,colMinPercent:n=10,lastColumnResizable:a=!0}={}){return new t.Plugin({key:f,state:{init:()=>new b,apply:(e,t,i,n)=>t.apply(e,n)},props:{attributes:e=>null!==f.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(t,n)=>((function(e,t,n,a){if(!e.editable)return;let r=f.getState(e.state);if(r.dragging)return;let o=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=null;if(o){let a=(0,i.isRtlEnabled)(),{left:r,right:l}=o.getBoundingClientRect();a?l-t.clientX<=n?s=v(e,t,"left"):t.clientX-r<=n&&(s=v(e,t,"right")):t.clientX-r<=n?s=v(e,t,"left"):l-t.clientX<=n&&(s=v(e,t,"right"))}if(s!==r.getActiveHandleAbs(e.state)){var l;let t,i;if(!a&&null!==s&&(t=(l=e.state.doc.resolve(s)).node(-1),i=y.TableMap.get(t),w(l)===i.width-1))return;C(e,s)}})(t,n,e,a),!1),mouseleave:e=>{var t;let i;return t=e,null===(i=f.getState(t.state)).getActiveHandleAbs(t.state)||i.dragging||C(t,null),!1},mousedown:(e,a)=>((function(e,n,a){if(!e.editable)return;let r=f.getState(e.state),o=r.getActiveHandleAbs(e.state);if(null===o||r.dragging)return;let s=e.state.doc.resolve(o),l=s.node(-1),d=s.start(-1),c=[...(0,x.parseColWidths)(l.attrs.colWidths)],u=w(s),h=function(e,t){let i=e.domAtPos(t),n=e.domAtPos(t).node;for(;"TABLE"!=n.nodeName;)n=n.parentNode;return i.node.childNodes[i.offset].scrollWidth}(e,o),g=S(e,s),b=S(e,s).scrollWidth,y=e.state.doc.resolve(o+2);e.state.selection.from>d&&e.state.selection.from col.col-width-control"),o.forEach((e,t)=>{l.item(t).style.width=`${e}%`}),(0,m.dispatchContainerResizeEvent)(g)}window.addEventListener("mouseup",k),window.addEventListener("mousemove",A),n.preventDefault()})(e,a,n),!1)},decorations(e){let t=f.getState(e).getActiveHandleAbs(e);if(null!==t)return function(e,t){let i=[];try{let n=e.doc.resolve(t),a=n.node(-1),r=y.TableMap.get(a),o=n.start(-1),s=r.colCount(n.pos-o)+n.nodeAfter.attrs.colspan;for(let e=0;e"table"===e.type.name,E=e=>"tableCell"===e.type.name,_=e=>"tableRow"===e.type.name,I=500,M=e=>{let t=y.TableMap.get(e);return t.height*t.width>I};var T=e.i(418755),L=e.i(551880);let j=e=>"toggle"===e.type.name;e.s(["isToggleNode",0,j,"isToggleOpen",0,e=>{let t=(0,T.getStore)();return(0,L.selectToggleExpanded)(e)(t.getState())||!1},"isToggleSummaryNode",0,e=>"toggleSummary"===e.type.name,"setToggleOpen",0,(e,t)=>{(0,T.getStore)().dispatch((0,L.setTogglesExpanded)({toggleIds:[e],isExpanded:t}))}],536913);let P=new t.PluginKey("annotation");e.s(["AnnotationPluginKey",0,P],763498);let D=e=>(0,s.isCardNode)(e)||(0,s.isCardLayoutItemNode)(e)||j(e)||A(e),N=({pos:e,from:t,to:i,editor:n})=>{let{state:a}=n,r=P.getState(a);if(!r)return null;let l=(0,o.findParentNodeClosestToPos)(n.state.doc.resolve(e),s.isCardNode),d=r.getAnnotationsBetween(a,t,i),c=l?r.getAnnotationsBetween(a,l.pos,l.pos+l.node.nodeSize).filter(e=>!d.find(t=>t.id===e.id)):[];return{inBlock:d,inCard:c,origNodePos:e}};e.s(["computeDeleteLayoutAnnotationMoves",0,({contentPos:e,contentEnd:t,insertPos:i,editor:n})=>{let o=P.getState(n.state);if(!o)return[];let{state:s}=n,l=o.getAnnotationsBetween(s,e,t),{doc:d,type:c,binding:u}=r.ySyncPluginKey.getState(n.view.state);return l.map(({id:t,relativePos:n})=>{let r=(0,a.relativePositionToAbsolutePosition)(d,c,n,u.mapping);return null==r?null:{id:t,newPos:i+(r-e)}}).filter(e=>!!e)},"computeDragAnnotationData",0,N,"computeInsertCardMoveInstructions",0,({dropPos:e,dragging:t,cardWrapOffset:i,tr:n,view:o})=>{let s;if(!P.getState(o.state))return[];let{doc:l,type:d,binding:c}=r.ySyncPluginKey.getState(o.state),u=n.mapping.map(e,-1),p=t.inBlock.map((s=t.origNodePos,({id:e,relativePos:t})=>{let n=(0,a.relativePositionToAbsolutePosition)(l,d,t,c.mapping);return null==n?null:{id:e,newPos:u+(n-s)+i}})).filter(e=>!!e),h=t.inCard.filter(({id:e})=>!p.find(t=>t.id===e)).map(({id:e,pos:t})=>{let i=n.mapping.map(t);return t===i?null:{newPos:i,id:e}}).filter(e=>!!e);return[...p,...h]},"computeInsertNestedCardMoves",0,({pos:e,tr:t,editor:i})=>{let n=P.getState(i.view.state);if(!n)return[];let a=i.state.doc.resolve(e);return a.nodeAfter?n.getAnnotationsBetween(i.state,e,e+a.nodeAfter.nodeSize).map(({id:i,pos:n})=>({id:i,newPos:n===e?t.mapping.map(n+1)-1:t.mapping.map(n)})):[]},"computeLayoutCreateMoveInstructions",0,({dropPos:e,dropNode:t,dragging:i,side:n,tr:o,view:s,leftContentSize:l})=>{let d=P.getState(s.state);if(!d)return[];let c=d.getAnnotationsBetween(s.state,e,e+t.nodeSize),u=i.inBlock,p="left"===n?i.origNodePos:e,h="left"===n?e:i.origNodePos,{doc:m,type:g,binding:f}=r.ySyncPluginKey.getState(s.state),b=o.mapping.map(e),x=(e,t)=>({id:i,relativePos:n})=>{let r=(0,a.relativePositionToAbsolutePosition)(m,g,n,f.mapping);return null==r?null:{id:i,newPos:b+(r-e)+t}},y=[...("left"===n?u:c).map(x(p,2)).filter(e=>!!e),...("left"===n?c:u).map(x(h,4+l)).filter(e=>!!e)],v=i.inCard.filter(({id:e})=>!y.find(t=>t.id===e)).map(({id:e,pos:t})=>{let i=o.mapping.map(t);return t===i?null:{newPos:i,id:e}}).filter(e=>!!e);return[...y,...v]},"computeMediaOnMediaGalleryCreationMoves",0,({dropPos:e,dropNode:t,dragging:i,side:n,tr:o,view:s})=>{let l=P.getState(s.state);if(!l)return[];let d=l.getAnnotationsBetween(s.state,e,e+t.nodeSize),c=i.inBlock,u="left"===n?i.origNodePos:e,p="left"===n?e:i.origNodePos,{doc:h,type:m,binding:g}=r.ySyncPluginKey.getState(s.state),f=o.mapping.map(e),b=(e,t)=>({id:i,relativePos:n})=>{let r=(0,a.relativePositionToAbsolutePosition)(h,m,n,g.mapping);return null==r?null:{id:i,newPos:f+(r-e)+t}},x=[...("left"===n?c:d).map(b(u,1)).filter(e=>!!e),...("left"===n?d:c).map(b(p,2)).filter(e=>!!e)],y=i.inCard.filter(({id:e})=>!x.find(t=>t.id===e)).map(({id:e,pos:t})=>{let i=o.mapping.map(t);return t===i?null:{newPos:i,id:e}}).filter(e=>!!e);return[...x,...y]},"findNearestAnnotatableParent",0,e=>{if(D(e.parent))return{pos:e.pos,node:e.nodeAfter};for(let t=e.depth;t>0;t--){let i=e.node(t);if(D(e.node(t-1)))return{pos:t>0?e.before(t):0,node:i}}return null},"isAnnotatableBlock",0,(e,t)=>!(0,s.isCardNode)(e)&&!(0,s.isCardLayoutItemNode)(e)&&D(t),"isAnnotatableParent",0,D],6419);let R=()=>{for(let e of document.querySelectorAll("[data-is-preview-element]"))e.parentNode?.removeChild(e)};e.s(["handleDragStart",0,(e,a,r,o)=>{let{view:s,state:l}=e;if(!a.dataTransfer||!o&&!(o=e.view.domAtPos(r).node))return;let{previewElement:d,xOffset:c,yOffset:u}=((e,t,i)=>{let a,r=(a=e.querySelector("[data-drag-preview]"))&&i.view.posAtDOM(a,0)===t?a:e,{contentReference:o,scalePreview:s}=r.dataset,l=0,d=0;if((0,n.isChrome)()&&o){let[e,t]=o.split(",").map(parseFloat);isNaN(e)||isNaN(t)||(l=e,d=t)}if(R(),s){let e=r.parentElement??document.body;(r=r.cloneNode(!0)).dataset.isPreviewElement="1",r.style.position="absolute",r.style.bottom="-100vh",r.style.left="-100vw",e.appendChild(r);let{width:t,height:i}=r.getBoundingClientRect();(t>i?t:i)>250&&(r.style.maxWidth="250px",r.style.maxHeight="250px",r.style.aspectRatio=`${t}/${i}`),document.addEventListener("drop",R,{once:!0}),document.addEventListener("dragend",R,{once:!0}),document.addEventListener("mouseup",R,{once:!0})}return{previewElement:r,xOffset:l,yOffset:d}})(o,r,e);a.dataTransfer.clearData(),a.dataTransfer.effectAllowed="move",a.dataTransfer.setData("text/html",o.innerHTML),a.dataTransfer.setData("text/plain",o.textContent||"");let{width:p}=d.getBoundingClientRect(),h=(0,i.isRtlEnabled)()?p-c:c;a.dataTransfer.setDragImage(d,h,u);let m=t.NodeSelection.create(l.doc,r);if(!(s.dragging&&s.dragging.accentImage)){let e=m.content();s.dispatch(s.state.tr.setSelection(m)),s.dragging={slice:e,move:!0}}let g=N({pos:r,editor:e,from:m.from,to:m.to});g&&requestAnimationFrame(()=>{s.dragging?.annotations||null!==s.dragging&&"object"==typeof s.dragging&&(s.dragging.annotations=g)})}],899611)},509510,e=>{"use strict";var t=e.i(755453),i=e.i(175863),n=e.i(524617);e.s(["findSelectionInsideNode",0,function e(n,a=1,r=!1){let{doc:o}=n,s=a<0;if(!n.nodeAfter)return null;if(n.nodeAfter.inlineContent)return i.Selection.near(o.resolve(n.pos+(s?n.nodeAfter.content.size+1:0)),a);let l=(0,t.findChildren)(n.nodeAfter,e=>e.inlineContent||!r&&i.NodeSelection.isSelectable(e));if(!l||0===l.length)return i.NodeSelection.create(o,n.pos);let d=n.start(n.depth+1)+(s?l[l.length-1].pos:l[0].pos);return e(o.resolve(d),a)},"getInsertedNodePos",0,(e,t)=>{let i,a=e.doc,r=e.steps.length-1,o=e.steps[r];if(!o||!(o instanceof n.ReplaceStep||o instanceof n.ReplaceAroundStep)||0===o.slice.content.size)return null;let s=t||o.slice.content.child(o.slice.openStart)?.type.name;if(e.mapping.maps[r].forEach((e,t,n)=>{null==i&&(i=n)}),null==i)return null;let l=a.nodeAt(i);if(l&&l.type.name===s)return a.resolve(i);if(!s)return console.warn("[getInsertedNodePos] Error selecting node, type not found in slice.lastChild",i),null;for(let t=o.from;t{"use strict";var t=e.i(157888),i=e.i(462480);class n{_queue=[];_handle=0;constructor(){this._handle=requestAnimationFrame(this._flush.bind(this))}_flush(){this._handle=0;let e=this._queue;this._queue=[],e.forEach(({fn:e})=>{e()})}push(e,t){if(t){let i=this._queue.findIndex(e=>e.id===t);i>-1?this._queue.splice(i,1,{fn:e,id:t}):this._queue.push({fn:e,id:t})}else this._queue.push({fn:e,id:(0,i.nanoid)(5)});this._handle||(this._handle=requestAnimationFrame(this._flush.bind(this)))}}let a=(0,t.default)(()=>new n);e.s(["getNextAnimationFrame",0,a])},494075,e=>{"use strict";var t=e.i(308822);e.i(734710);var i=e.i(430378),n=e.i(78387);e.s(["setDraggingContent",0,({editor:e,content:i,operation:n="insert"})=>{let a=Array.isArray(i)?i:[i],r=t.Slice.fromJSON(e.schema,{content:a});e.view.dragging={slice:r,move:!0,operation:n},e.commands.setTextSelection(e.state.selection.from)},"trackItemInserted",0,(e,t)=>{i.analytics.track(n.SegmentEvents.NODE_INSERTED,{node_name:e.nodeName,command:e.key,method:t}),"card"===e.nodeName&&i.analytics.track(n.SegmentEvents.CARD_CREATED,{method:t,command:e.key})}])},423444,45954,854861,713293,e=>{"use strict";var t=e.i(175863),i=e.i(285598);function n(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}e.s(["defaultHandlePaste",0,(e,a,r)=>{if(!r)return!0;let o=n(r),s=o&&e.state.selection instanceof t.NodeSelection,l=o?e.state.tr.replaceSelectionWith(o,e.input.shiftKey):e.state.tr.replaceSelection(r),d=(0,i.createSelectionNearLastTo)(l);return d?l.setSelection(d):s&&l.setSelection(t.NodeSelection.create(l.doc,e.state.selection.from)),e.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0},"sliceSingleNode",0,n],423444);var a=e.i(524617),r=e.i(977581);let o=e=>"smartLayoutCell"===e.type.name;e.s(["isSmartLayoutCellNode",0,o,"isSmartLayoutNode",0,e=>"smartLayout"===e.type.name],45954),e.i(755453),e.i(308822);var s=e.i(338538),l=e.i(103630),d=e.i(989458);let c=e=>["left","right"].includes(e),u=e=>e.some(e=>c(e.attrs.layout)),p=e=>d.LAYOUT_PRESETS[e??"blank"]||d.LAYOUT_PRESETS.blank,h=e=>{let t={},i=e.pos,n=e.nodeAfter;return n?n.descendants((e,n)=>{if(!(0,l.isCardLayoutItemNode)(e))return!1;t[e.attrs.itemId]={node:e,pos:i+1+n}}):console.error(`[getCardLayoutItems] could not find card node at pos ${i}`),t},m=(e,t)=>h(e.doc.resolve(t)),g=(e,t,i,n)=>{let a=i.nodes.cardAccentLayoutItem.createAndFill({itemId:"accent",background:{type:s.BackgroundType.NONE},...n});e.insert(t+1,a)},f=(e,t,i,n)=>{e.replaceRangeWith(t,t+i.nodeSize,n.nodes.cardAccentLayoutItem.createAndFill({...i.attrs}))},b=e=>"cardAccentLayoutItem"===e.type.name&&"accent"===e.attrs.itemId;e.s(["checkInsideSideLayout",0,u,"ensureCardLayoutItems",0,(e,t,i,n)=>{let a=e.doc.nodeAt(t),r=m(e,t);if("responsive"===(0,l.getCardContentType)(a)){var o;let s;if(0===Object.keys(r).length){let r,o;(o=(r=e.doc.resolve({node:a,pos:t}.pos+1)).blockRange(e.doc.resolve(r.end())))&&e.wrap(o,[{type:i.nodes.cardLayoutItem}]).setMeta("annotationEvent",{type:"wrap-nodes",start:o.start,end:o.end,level:1}),n.items.accent&&g(e,t,i);return}n.items.body&&!r.body&&(s=i.nodes.cardLayoutItem.createAndFill({itemId:"body",...o}),e.insert(t+1,s)),n.items.accent&&!r.accent?g(e,t,i):r.accent&&"cardLayoutItem"===r.accent.node.type.name&&f(e,r.accent.pos,r.accent.node,i)}},"findCardAccentBackground",0,e=>{let t=(0,r.findDirectChildren)(e,b)[0];if(t)return t.node.attrs.background},"findLayoutPreset",0,p,"getCardLayoutChildrenSx",0,e=>{let t=p(e),i={};return Object.entries(t.items).forEach(([e,t])=>{let n=t?.style??{gridArea:e};i[`> [data-layout-item-id="${e}"]`]=n}),i},"getCardLayoutItems",0,m,"getCardLayoutItemsFromResolvedPos",0,h,"getDisplayLayout",0,({layout:e,parentCards:t,isMobileDevice:i})=>i&&"left"===e?"mobileLeft":i&&"right"===e?"mobileRight":c(e)&&u(t)?"blank":e,"isAccentCardLayoutItem",0,b,"isBodyCardLayoutItem",0,e=>"cardLayoutItem"===e.type.name&&"body"===e.attrs.itemId,"isSideLayout",0,c,"replaceCardLayoutWithCardAccentLayoutItem",0,f],854861);e.s(["getDropPos",0,(e,t,i)=>{var n;let s=e.posAtCoords({left:t.clientX,top:t.clientY});if(!s||s.inside<0||!e.state.doc.resolve(s.pos))return null;let d=s.pos,c=e.state.doc.resolve(s.inside),u=e.state.doc.nodeAt(s.inside),p=e.state.doc.nodeAt(s.pos);if(u?.type.name==="smartLayout"&&p?.type.name==="smartLayoutCell")return null;let m=(0,r.findNodeAndParents)(c,o)[0];if(m&&(d=s.inside,m.pos===d)||!d)return null;if(i){if(d=(0,a.dropPoint)(e.state.doc,d,i),i.content?.firstChild?.type.name==="tableRow"&&null!==d){let t=-1;for(let e=c.depth;e>=0;e--){let i=c.node(e);if("table"===i.type.name){t=c.start(e)+i.nodeSize-1;break}}t>=0&&d===t&&(d=(0,a.dropPoint)(e.state.doc,d-1,i))}if(null==d)return null}return(n=e.state.doc.resolve(d),e.dragging?.slice,!(e=>{if(!(e.parent&&(0,l.isCardNode)(e.parent)))return!0;let t=(0,r.findParentNodes)(e,l.isCardNode)[0];return!t||0===Object.keys(h(e.doc.resolve(t.pos))).length})(n)||0)?null:d}],713293)},4877,71259,597456,e=>{"use strict";var t=e.i(357790),i=e.i(175863);e.i(261991);var n=e.i(305524),a=e.i(669288),r=e.i(160396),o=e.i(713293),s=e.i(462480),l=e.i(367792),d=e.i(383540),c=e.i(297194),u=e.i(338538),p=e.i(509510),h=e.i(755453),m=e.i(758568),g=e.i(708378),f=e.i(693416);let b=({result:e,isError:t,attrs:i})=>{if(t)return{uploadStatus:c.UploadStatus.Error,showPlaceholder:!0,tempUrl:null,src:null};let{fullResults:n,...a}=e;return{uploadStatus:c.UploadStatus.Done,showPlaceholder:!1,source:i?.source||"image.custom",...a}},x=e=>({tempUrl:e,uploadStatus:c.UploadStatus.Uploading,src:null,source:"image.custom"}),y=(e,t)=>{let i=e.type.spec.imageKeyPath,n=i?(0,f.default)({},i,t):t;return(0,g.default)({},e.attrs,n)},v=e=>{let t=e.type.spec.imageKeyPath;return t||"image"===e.type.name||"graphic"===e.type.name?t?(0,m.default)(e.attrs,t,e.attrs):e.attrs:null},C=(e,t)=>(0,h.findChildren)(e.state.doc,e=>{let i=v(e);return[i?.tempUrl,i?.src].includes(t)}),w=(e,t,i)=>{e.parentEditor&&(e=e.parentEditor),t&&k(e,i,t);let n=C(e,t);0==n.length?console.warn("[MediaUpload] Couldn't find placeholder node"):(n.forEach(({pos:t})=>{e.commands.updateImageOnUploadSuccess(t,i)}),setTimeout(()=>{e.commands.revokeImageTempURLs(t)},3e4))},S=(e,t,i,n=!1)=>{e.parentEditor&&(e=e.parentEditor);let a=C(e,t);0==a.length?console.warn("[MediaUpload] Couldn't find placeholder node"):(a.forEach(t=>e.commands.updateImageOnUploadFailure(t.pos,n)),console.error(i))},k=(e,t,i)=>{let n=e.storage.mediaUpload;n&&(n.completedUploads[i]=t)},A=(e,t,i)=>{let n=(0,h.findChildren)(e.state.doc,e=>"embed"===e.type.name&&e.attrs.url===t);0==n.length?console.warn("[MediaUpload] Couldn't find placeholder node"):n.forEach(t=>{e.commands.updateAttributesAtPos(t.pos,{url:i.src,sourceUrl:i.src,embed:{url:i.src},thumbnail:{src:i.thumbnail,uploadStatus:c.UploadStatus.Done,showPlaceholder:!1}})})},E=e=>({meta:{title:e.name,description:(0,a.formatBytes)(e.size,1)},thumbnail:{uploadStatus:c.UploadStatus.Uploading,showPlaceholder:!0},source:"embed.pdf"});e.s(["getNodeImageAttrs",0,v,"getTempPDFAttrs",0,E,"getUniqueIdForImage",0,(e,t,i,n)=>{if(n?.id)return n.id;if("smartLayoutCell"===t.type.name)return t.attrs.id;if("cardAccentLayoutItem"===t.type.name){let t=(0,h.findParentNodeClosestToPos)(e.state.doc.resolve(i),e=>"card"===e.type.name);return t?t.node.attrs.id:null}},"getUploadedImageAttrs",0,b,"getUploadingImageAttrs",0,x,"handleFileUploadSuccess",0,A,"handleImageUploadFailed",0,S,"handleImageUploadSuccess",0,w,"mergeImageAttrs",0,y],71259);let _=(e,t)=>t.map(t=>{let i=(0,a.getFileExtension)(t);return(0,r.isImageMimeType)(t.type)?M(t,e):(0,a.isSpreadsheetFile)(t.type,i)?L(t,e):(0,a.isDocumentFile)(t.type,i)?T(t,e):null}).filter(e=>null!==e),I=function(e,t,i){let n=_(e,t);if(0==n.length)return;let a=n.map(e=>e.content),r=e.state.doc.resolve(i),o=r.parent.inlineContent,s=i;o&&0===r.parentOffset?s=i-1:o&&null===r.nodeAfter&&(s=i+1),e.chain().insertContentAt(s,a,{updateSelection:!1}).command(({tr:e})=>{let t=e.doc.resolve(e.mapping.map(s)),i=(0,p.findSelectionInsideNode)(e.doc.resolve(t.pos-(t.nodeBefore?.nodeSize||1)));return i&&e.setSelection(i),!0}).run(),n.forEach(e=>{e.upload()}),setTimeout(()=>{e.commands.scrollIntoView()},200)},M=(e,t)=>{let i={uploadStatus:c.UploadStatus.Uploading,source:d.CustomImageProvider.key};(0,r.isHEICFileType)(e.type)?(i.showPlaceholder=!0,i.tempUrl=`HEIC_tempId_${(0,s.nanoid)()}`):i.tempUrl=URL.createObjectURL(e);let a=(e,n)=>{let a=i.tempUrl;(a||n)&&w(t,a||n,e)},o={onOriginalFileUpload:a,onUploadComplete:a,onUploadFailed:e=>{i.tempUrl&&(S(t,i.tempUrl,e),URL.revokeObjectURL(i.tempUrl))}};return{name:e.name,content:{type:"image",attrs:i},upload:()=>(0,n.uploadFile)(e,t.storage.mediaUpload?.orgId,o)}},T=(e,t)=>{let i=URL.createObjectURL(e),a={...E(e),url:i},r=(e,n)=>{(i||n)&&A(t,i||n,e)},o={onOriginalFileUpload:r,onUploadComplete:r};return{name:e.name,content:{type:"embed",attrs:a},upload:()=>(0,n.uploadFile)(e,t.storage.mediaUpload?.orgId,o,"node","doc")}},L=(e,t)=>{let i=URL.createObjectURL(e),a={...E(e),url:i},r=(e,n)=>{(i||n)&&A(t,i||n,e)},o={onOriginalFileUpload:r,onUploadComplete:r};return{name:e.name,content:{type:"embed",attrs:a},upload:()=>(0,n.uploadFile)(e,t.storage.mediaUpload?.orgId,o,"node","importCsv",l.config.TRANSLOADIT_FILE_TEMPLATE_ID)}};e.s(["insertAndUploadFiles",0,I,"setupImageUpload",0,M,"setupUploads",0,_,"uploadImageForCardAccentLayoutItem",0,(e,t,i,a)=>{let o,l={type:u.BackgroundType.IMAGE,source:d.CustomImageProvider.key,image:{uploadStatus:c.UploadStatus.Uploading,source:d.CustomImageProvider.key}};(0,r.isHEICFileType)(i.type)?(l.image.showPlaceholder=!0,o=`HEIC_tempId_${(0,s.nanoid)()}`):o=URL.createObjectURL(i),l.image.tempUrl=o;let p=(t,i)=>{(o||i)&&w(e,o||i,t)};t.setNodeAttribute(a,"background",l).setMeta("imageUploadUpdateAttrs",!0),(0,n.uploadFile)(i,e.storage.mediaUpload?.orgId,{onOriginalFileUpload:p,onUploadComplete:p,onUploadFailed:t=>{S(e,o,t),URL.revokeObjectURL(o)}})}],597456);let j=(e,t,i,a)=>{let r=(i,n)=>{w(e,n||t,i)},o={onOriginalFileUpload:r,onUploadComplete:r,onUploadFailed:i=>{S(e,t,i,a)}};i?(0,n.uploadFile)(i,e.storage.mediaUpload?.orgId,o):(0,n.uploadFileFromUrl)(t,e.storage.mediaUpload?.orgId,o)},P=async(e,t)=>{try{let i=await fetch(t),n=await i.blob(),a=new File([n],"blob.png",{type:n.type});j(e,t,a)}catch(i){S(e,t,i)}},D=e=>{let t=(0,a.getFileExtension)(e);return(0,r.isImageMimeType)(e.type)||(0,a.isSpreadsheetFile)(e.type,t)||(0,a.isDocumentFile)(e.type,t)},N=(e,t)=>{if(!e.clipboardData)return null;let i=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");if(n&&!i&&/^\s*\s*$/s.test(n))return[(0,r.svgToFile)(n)];let a=Array.prototype.slice.call(e.clipboardData.items);return a.some(e=>"text/html"===e.type)&&(t.content.childCount>1||t.content.firstChild?.type.name!=="image")?null:a.map(e=>e.getAsFile()).filter(e=>!!e).filter(D)};function R(e){let t=[],i=e.target;if(e.dataTransfer){let i=e.dataTransfer;i.files&&i.files.length?t=i.files:i.items&&i.items.length&&(t=i.items)}else i&&i.files&&(t=i.files);return Array.prototype.slice.call(t)}e.s(["generateUploadPlugin",0,e=>new i.Plugin({props:{transformPasted:i=>(i.content.descendants(i=>{if("image"===i.type.name&&"image.web"!==i.attrs.source){if(i.attrs.tempUrl){let t=e.storage.mediaUpload,n=t?.completedUploads[i.attrs.tempUrl];if(!n)return;Object.assign(i.attrs,y(i,b({isError:!1,result:n})))}else if(i.attrs.src&&!t.isGammaCDNUrl(i.attrs.src)){let t,n=i.attrs.src;if(n.startsWith("blob:")){Object.assign(i.attrs,x(n)),P(e,n);return}if(n.startsWith("data:")){if(!(t=(0,r.dataURLtoFile)(i.attrs.src)))return;n=URL.createObjectURL(t)}Object.assign(i.attrs,x(n)),j(e,n,t)}}}),i),handlePaste:(t,i,n)=>((e,t,i,n)=>{if(!e.isEditable)return!1;let a=N(i,n);if(!a||0===a.length)return!1;let{selection:r}=t.state,o=r.from;return r.empty||e.commands.deleteSelection(),I(e,a,o),!0})(e,t,i,n),handleDOMEvents:{drop:(t,i)=>((e,t,i)=>{if(!e.isEditable)return!1;let n=R(i).filter(D);if(0===n.length)return!1;let a=(0,o.getDropPos)(t,i);return!!a&&(i.preventDefault(),I(e,n,a),!0)})(e,t,i)}}}),"getDataTransferFiles",0,R,"getUploadsFromClipboardEvent",0,N,"handleImagePaste",0,(e,t,i)=>{let n=N(t,i);if(!n||1!==n.length)return!1;let a=M(n[0],e);return{attrs:a.content.attrs,upload:a.upload}},"isUploadable",0,D,"uploadImageBlobUrl",0,P,"uploadImageFileOrUrl",0,j],4877)},503108,e=>{"use strict";var t=e.i(338538),i=e.i(854861);e.s(["setCardLayoutCommand",0,(e,n,a,r,o)=>{let s=n.doc.nodeAt(a);if(s?.type.name!=="card")return!1;let l=s.attrs,d=(0,i.findLayoutPreset)(r);if((0,i.ensureCardLayoutItems)(n,a,e.schema,d),r===l.layout)return!0;n.setNodeAttribute(a,"layout",r);let{accent:c}=(0,i.getCardLayoutItems)(n,a);if(o&&c&&c.node.attrs.background.type===t.BackgroundType.NONE){let e=o();e&&(n.setNodeAttribute(c.pos,"background",e),c=(0,i.getCardLayoutItems)(n,a).accent)}if("behind"===r&&c){let e=c.node.attrs.background;e&&!e.mask&&n.setNodeAttribute(c.pos,"background",{...e,mask:{effect:"none"}})}let{layoutTemplateColumns:u}=s.attrs,p=l.layout;return u&&("left"===p&&"right"===r||"right"===p&&"left"===r)&&n.setNodeAttribute(a,"layoutTemplateColumns",u.split(" ").reverse().join(" ")),!0}])},337840,576826,562409,7619,e=>{"use strict";e.s(["checkCardAccentDropTarget",()=>S,"checkCreateCardAccentDropTarget",()=>_,"checkShouldRemoveCardLayout",()=>A,"handleCardAccentDragStart",()=>L,"handleImageCardAccentDrop",()=>k,"handleImageDropCreateAccent",()=>T,"handleRemoveCardLayoutAfterDrag",()=>E],337840);var t=e.i(755453),i=e.i(175863),n=e.i(494075),a=e.i(338538),r=e.i(977581);e.i(24439);var o=e.i(103630),s=e.i(160396),l=e.i(423444),d=e.i(4877),c=e.i(503108);e.s(["CardLayoutPlugin",()=>C,"CardLayoutPluginKey",()=>v,"findCardLayoutDecorationSpec",()=>w],562409);var u=e.i(524617),p=e.i(615505),h=e.i(392164),m=e.i(418755),g=e.i(963576);let f={cardLayoutsEnabled:!1},b=e=>{if(!e)return{...f};let t=null;return("doc"===e.type.name?t=e.nodeAt(0):"document"===e.type.name&&(t=e),t)?{...f,...t.attrs.docFlags}:(console.debug("[getDocFlags] could not find document node, returning defaults"),{...f})};e.s(["getDocFlags",0,b],576826);var x=e.i(597456),y=e.i(854861);let v=new i.PluginKey("cardLayoutPlugin"),C=e=>new i.Plugin({key:v,state:{init:()=>({draggingData:null}),apply:(e,t)=>t},filterTransaction:(e,i)=>{if(!e.docChanged||!((0,t.isNodeSelection)(i.selection)&&(0,o.isCardLayoutItemNode)(i.selection.node))||e.steps.every(e=>e instanceof u.AttrStep)||e.getMeta("imageUploadUpdateAttrs")||e.steps.every(t=>{if(!(t instanceof u.ReplaceStep))return!1;let i=e.before.nodeAt(t.from);if(!i||!(0,y.isAccentCardLayoutItem)(i))return!1;let n=t.slice.content;return 1===n.childCount&&(0,y.isAccentCardLayoutItem)(n.firstChild)}))return!0;let n=(0,g.default)(e).every(t=>{let i=e.before.nodeAt(t.oldStart);return!i||!(0,o.isCardLayoutItemNode)(i)});return n||console.warn("[CardLayoutPlugin] blocking transaction with CardLayoutItem selected"),n},appendTransaction:(i,n,a)=>{if(!(i.some(e=>e.docChanged)&&!n.doc.eq(a.doc))||!b(e.state.doc).cardLayoutsEnabled)return;let r=a.tr,s=(0,t.combineTransactionSteps)(n.doc,i);if((0,g.default)(s).forEach(i=>{let n={from:i.newStart,to:i.newEnd};(0,t.findChildrenInRange)(a.doc,n,e=>"card"===e.type.name&&"responsive"===(0,o.getCardContentType)(e)).forEach(({pos:t})=>{if(tL(e,t,i),drop(t,i){let n=t.state.tr,a=_(t,i);if(a&&a.isImageUpload){i.preventDefault();let r=a.pos;(0,c.setCardLayoutCommand)(e,n,r,a.layout);let{accent:o}=(0,y.getCardLayoutItems)(n,r);if(!o)throw Error(`Could not find accent after setting card layout=${a.layout} at pos=${a.pos}`);return(0,x.uploadImageForCardAccentLayoutItem)(e,n,a.file,o.pos),t.dispatch(n),!0}let r=S(t,i);if(r&&r.isImageUpload)return i.preventDefault(),(0,x.uploadImageForCardAccentLayoutItem)(e,n,r.file,r.pos),t.dispatch(n),!0;let o=A(e,t,i),s=v.getState(t.state);return o&&s&&(s.draggingData={removeLayoutFromCardId:o.node.attrs.id}),!1}},handlePaste:(t,n,r)=>{let{selection:o}=t.state;if(!(o instanceof i.NodeSelection&&(0,y.isAccentCardLayoutItem)(o.node)))return!1;let s=(0,d.handleImagePaste)(e,n,r),c=(0,l.sliceSingleNode)(r),u=c&&"image"===c.type.name;if(!s&&!u)return!1;let p=s&&s?.attrs||c?.attrs;return e.commands.updateNestedAttributesAtPos(o.from,{background:{image:p,type:a.BackgroundType.IMAGE,source:p?.source}}),s&&s.upload(),!0},handleDrop(t,i,n){let a=t.state.tr,r=T(e,a,t,i,n),o=k(t,a,i,n);return(!!r||!!o)&&(E(e,a),t.dispatch(a),!0)},decorations:({doc:e})=>{let t=[];return e.descendants((i,n)=>{if("card"===i.type.name){let a=e.resolve(n),s=(0,r.findParentNodes)(a,o.isCardNode).map(e=>e.node),l=(0,h.selectShouldRenderMobile)((0,m.getStore)().getState()),d=(0,y.getDisplayLayout)({parentCards:s,layout:i.attrs.layout,isMobileDevice:l});i.forEach((e,n)=>{let r=a.pos+n+1;if(!(0,o.isCardLayoutItemNode)(e))return;let l={cardId:i.attrs.id,isCardLayoutDecoration:!0,layout:d,cardSize:i.attrs.cardSize,isNested:s.length>=1};t.push(p.Decoration.node(r,r+e.nodeSize,{"data-layout-item-id":e.attrs.itemId},l))})}}),p.DecorationSet.create(e,t)}}}),w=e=>{let t=e.find(e=>e.spec.isCardLayoutDecoration);return t?.spec},S=(e,t,i)=>{let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n||n.inside<0)return null;let{doc:c}=e.state,{inside:u}=n,p=c.resolve(u),h=(0,r.findNodeAndParents)(p,y.isAccentCardLayoutItem),m=(0,r.findNodeAndParents)(p,o.isCardNode)[0],g=i&&(0,l.sliceSingleNode)(i),f=(0,r.rectAtPos)(u,e);if(0===h.length||!f||!m)return null;if(!g){let e=(0,d.getDataTransferFiles)(t).filter(e=>(0,s.isImageMimeType)(e.type));return 1!==e.length?null:{pos:u,rect:f,isImageUpload:!0,file:e[0]}}return g&&"image"===g.type.name?{pos:u,rect:f,isImageUpload:!1,background:{type:a.BackgroundType.IMAGE,source:g.attrs.source,image:g.attrs}}:null},k=(e,t,i,n)=>{let a;try{if(!(a=S(e,i,n)))return!1}catch(e){return console.error("(caught) [CardLayoutPlugin] handleDrop checkCardAccentDropTarget error:",e),!1}return!!a&&!a.isImageUpload&&(t.setNodeAttribute(a.pos,"background",a.background),t.deleteSelection(),!0)},A=(e,t,i)=>{let n=t.posAtCoords({left:i.clientX,top:i.clientY});if(!n||n.inside<0)return null;let{doc:a}=t.state,{inside:s}=n,l=a.resolve(s),d=(0,r.findNodeAndParents)(l,o.isCardNode)[0];if(!d)return null;let c=t.dragging?.accentImage?.cardId;if(!c)return null;let u=c===d.node.attrs.id;return l.nodeAfter&&(0,y.isAccentCardLayoutItem)(l.nodeAfter)&&u?null:(0,o.findCardById)(e,c)},E=(e,i)=>{let n=v.getState(e.state);if(n?.draggingData?.removeLayoutFromCardId){let a=n.draggingData.removeLayoutFromCardId;n.draggingData=null;let r=(0,t.findChildren)(i.doc,e=>(0,o.isCardNode)(e)&&e.attrs.id===a)[0];return!!r&&(0,c.setCardLayoutCommand)(e,i,r.pos,"blank")}return!1},_=(e,t,i)=>{let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n||n.inside<0)return null;let{doc:c}=e.state,{inside:u}=n,p=c.resolve(u),h=c.nodeAt(u),m=h?.type.name==="cardLayoutItem";if(!h||!m)return null;let[g,...f]=(0,r.findNodeAndParents)(p,o.isCardNode),b=i&&(0,l.sliceSingleNode)(i),x=(0,r.rectAtPos)(u,e);if(!g||!x||f.length>0)return null;let y=g.node.attrs,v="blank"===y.layout?M(t,x):"behind"===y.layout?I(t,x):null;if(!v)return null;if(!b){let e=(0,d.getDataTransferFiles)(t).filter(e=>(0,s.isImageMimeType)(e.type));return 1!==e.length?null:{pos:g.pos,isImageUpload:!0,file:e[0],...v}}return b&&"image"===b.type.name?{pos:g.pos,...v,isImageUpload:!1,background:{type:a.BackgroundType.IMAGE,source:b.attrs.source,image:b.attrs}}:null},I=(e,t)=>e.clientYt.right-80?{layout:"behind",rect:t}:null,M=(e,t)=>{let i,n=t,a=Math.min(t.height/3,100),r=t.left+40,o=t.right-40;if(e.clientXo)i="right",n={...t.toJSON(),right:t.right,left:t.right-t.width/3,top:t.top,bottom:t.bottom};else{if(!(e.clientY{let l;try{if(!(l=_(a,r,s)))return!1}catch(e){return console.error("(caught) [handleImageDropCreateAccent] handleDrop checkCreateCardAccentDropTarget error:",e),!1}if(!l||l.isImageUpload||!l.layout)return!1;let d=l.background;n.deleteSelection();let u=n.doc.resolve(n.mapping.map(l.pos)),p=u.nodeAfter&&"card"===u.nodeAfter.type.name?u.pos:(0,t.findParentNodeClosestToPos)(u,o.isCardNode)?.pos;if(!p)return!1;(0,c.setCardLayoutCommand)(e,n,p,l.layout);let{accent:h}=(0,y.getCardLayoutItems)(n,p);return!!h&&(n.setNodeAttribute(h.pos,"background",d),n.setSelection(i.NodeSelection.create(n.doc,h.pos)),!0)},L=(e,t,i)=>{if(!i.target)return;let r=t.posAtDOM(i.target,0);if(!r||r<0)return;let s=(0,o.findCardNodeClosestToPos)(e,r),l=t.state.doc.nodeAt(r);if(!l||!(0,y.isAccentCardLayoutItem)(l))return;if(l.attrs.background.type===a.BackgroundType.NONE)return i.preventDefault(),i.stopPropagation(),!0;let d=e.view.domAtPos(r).node;if(d&&i.dataTransfer){let e=d.querySelector("[data-content-reference]");if(e){let t=e.cloneNode(!0);t.style.width="18em",t.style.height="10em",t.style.borderRadius=".375em";let n=document.createElement("div");n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",document.body.appendChild(n),n.appendChild(t),i.dataTransfer.clearData(),i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/html",t.innerHTML),i.dataTransfer.setData("text/plain",t.textContent||""),i.dataTransfer.setDragImage(t,0,0),setTimeout(()=>{document.body.removeChild(n)},0)}}(0,n.setDraggingContent)({editor:e,content:{type:"image",attrs:{...l.attrs.background.image,source:l.attrs.background.source}}});let c=t.dragging;return c&&(c.accentImage={cardId:s?.node.attrs.id}),!0};class j{constructor(e,t,i={}){this.match=e,this.match=e,this.handler="string"==typeof t?function(e){return function(t,i,n,a){let r=e;if(i[1]){let e=i[0].lastIndexOf(i[1]);r+=i[0].slice(e+i[1].length);let t=(n+=e)-a;t>0&&(r=i[0].slice(e-t,e)+r,n=a)}return t.tr.insertText(r,n,a)}}(t):t,this.undoable=!1!==i.undoable,this.inCode=i.inCode||!1}}function P(e,t,i,n,a,r){if(e.composing)return!1;let o=e.state,s=o.doc.resolve(t),l=s.parent.textBetween(Math.max(0,s.parentOffset-500),s.parentOffset,null,"")+n;for(let d=0;dnull,apply(e,t){let i=e.getMeta(this);return i||(e.selectionSet||e.docChanged?null:t)}},props:{handleTextInput:(i,n,a,r)=>P(i,n,a,r,e,t),handleDOMEvents:{compositionend:i=>{setTimeout(()=>{let{$cursor:n}=i.state.selection;n&&P(i,n.pos,n.pos,"",e,t)})}}},isInputRules:!0});return t}],7619)},767730,e=>{"use strict";var t=e.i(365808),i=e.i(755453);function n(e,t){let i=t?new Set(t):void 0,n={};for(let[t,a]of Object.entries(e)){let e={default:i?.has(t)?void 0:a.default??null,rendered:!1};"placeholder"===t&&(e.keepOnSplit=!1),n[t]=e}return n}function a(e,t){let i={name:e.name,addAttributes:()=>n(e.attrs,t)};return e.content&&(i.content=e.content),e.group&&(i.group=e.group),e.atom&&(i.atom=e.atom),e.inline&&(i.inline=e.inline),e.code&&(i.code=e.code),void 0!==e.marks&&(i.marks=e.marks),i}function r(e){let t={name:e.name,addAttributes:()=>e.attrs?n(e.attrs):{}};return e.code&&(t.code=e.code),t}e.s(["createTiptapMark",0,function(e,n={}){let a=t.Marks[e];return i.Mark.create({...r(a),...n,_gmlSchema:!0})},"createTiptapNode",0,function(e,n={}){let r=t.Nodes[e],{requiredAttrs:o,...s}=n;return i.Node.create({...a(r,o),...s,_gmlSchema:!0})},"extendTiptapMark",0,function(e,i,n={}){let a=t.Marks[i];return e.extend({...r(a),...n,_gmlSchema:!0})},"extendTiptapNode",0,function(e,i,n={}){let r=t.Nodes[i],{requiredAttrs:o,...s}=n;return e.extend({...a(r,o),...s,_gmlSchema:!0})},"parseFontSize",0,function(e){return e.getAttribute("data-font-size")},"parseHorizontalAlign",0,function(e){let t=e.style.textAlign||e.getAttribute("align");return t?{horizontalAlign:t}:{}},"parseIdAttr",0,function(e,t,i="id"){return e.getAttribute(`data-${i}`)??e.getAttribute(i)??t()},"parseJSONAttr",0,function(e,t){let i=e.getAttribute(`data-${t}`)||e.getAttribute(t);if(i)try{return JSON.parse(i)}catch(e){console.error(`[caught] Error parsing ${t} attribute. Error: ${e}. Value: ${i}`);return}},"renderFontSize",0,function(e){let t;return null==(t=e.fontSize)?{}:{"data-font-size":String(t)}},"renderHorizontalAlign",0,function(e){return e.horizontalAlign?{style:`text-align: ${e.horizontalAlign}`}:{}},"renderJSONAttrs",0,function(e,...t){let i={};for(let n of t){let t=e[n];null!=t&&(i[`data-${n}`]=JSON.stringify(t))}return i}])},578014,135053,612904,795478,e=>{"use strict";let t;var i=e.i(755453),n=e.i(7619),a=e.i(175863);e.i(144786);var r=e.i(275316),o=e.i(767730);let s=(0,o.createTiptapNode)("mathDisplay",{renderHTML:({HTMLAttributes:e})=>["div",(0,i.mergeAttributes)(e,{class:"math-node","data-node-type":"math_display"}),0],parseHTML:()=>[{tag:'div[data-node-type="math_display"]'},{tag:"math-display"},{tag:"formula"}]});var l=e.i(150215),d=e.i(270225),c=e.i(524617),u=e.i(615505);function p(e,t,i,n=!0){return(r,o)=>{let s=e.state,{to:l,from:d}=s.selection,{to:c,from:u}=r.selection;if(n&&c!==u)return!1;let p=t>0?c:u;if(i){let e=r.doc.nodeSize-2;if(t>0&&p0)return!1}return o&&(e.dispatch(s.tr.setSelection(a.TextSelection.create(s.doc,t>0?l:d))),e.focus()),!0}}class h{_node;_outerView;_getPos;dom;_mathRenderElt;_mathSrcElt;_innerView;cursorSide;_options;_katexOptions;_tagName;_isEditing;_onDestroy;_mathPluginKey;constructor(i,n,a,r={},o,s){e.A(859766).then(e=>{t=e.default,this.renderMath()}),this._node=i,this._outerView=n,this._getPos=a,this._onDestroy=s&&s.bind(this),this._mathPluginKey=o,this.cursorSide="start",this._isEditing=!1,this._options=r,this._katexOptions=Object.assign({globalGroup:!0,throwOnError:!1},r.katexOptions),this._tagName=r.tagName??"div",this.dom=document.createElement(this._tagName),this.dom.setAttribute("data-node-type",this._node.type.name),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",()=>this.ensureFocus()),this.renderMath()}destroy(){this.closeEditor(!1)}ensureFocus(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}update(e,t){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){let t=this._innerView.state,i=e.content.findDiffStart(t.doc.content);if(null!=i){let n=e.content.findDiffEnd(t.doc.content);if(n){let{a:a,b:r}=n,o=i-Math.min(a,r);o>0&&(a+=o,r+=o),this._innerView.dispatch(t.tr.replace(i,r,e.slice(i,a)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}updateCursorPos(e){let t=this._getPos(),i=this._node.nodeSize;e.selection.from0&&null!==e[0].textContent&&(i=e[0].textContent.trim()),i.length<1){for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();return}if(this.dom.classList.remove("empty-math"),!t){this._mathRenderElt.textContent=i;return}try{t.render(i,this._mathRenderElt,this._katexOptions),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(e){if(e instanceof Error)console.error(e),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",e.toString());else throw e}}dispatchInner(e){if(!this._innerView)return;let{state:t,transactions:i}=this._innerView.state.applyTransaction(e);if(this._innerView.updateState(t),!e.getMeta("fromOutside")){let e=this._outerView.state.tr,t=c.StepMap.offset(this._getPos()+1);for(let n=0;n(t&&t(e.tr.insertText(" ")),!0),Backspace:(0,l.chainCommands)(l.deleteSelection,(e,t,i)=>!!e.selection.empty&&!(this._node.textContent.length>0)&&(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0)),"Ctrl-Backspace":(e,t,i)=>(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0),Enter:(0,l.chainCommands)(l.newlineInCode,p(this._outerView,1,!1)),"Ctrl-Enter":p(this._outerView,1,!1),ArrowLeft:p(this._outerView,-1,!0),ArrowRight:p(this._outerView,1,!0),ArrowUp:p(this._outerView,-1,!0),ArrowDown:p(this._outerView,1,!0),"Mod-z":this._options.undo,"Shift-Mod-z":this._options.redo})]}),dispatchTransaction:this.dispatchInner.bind(this)});let e=this._innerView.state;this._innerView.focus();let t=this._mathPluginKey.getState(this._outerView.state)?.prevCursorPos;null==t&&console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");let i=(t??0)<=this._getPos()?0:this._node.nodeSize-2;this._innerView.dispatch(e.tr.setSelection(a.TextSelection.create(e.doc,i))),this._isEditing=!0}closeEditor(e=!0){this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}}let m=new a.PluginKey("prosemirror-math");function g(e,t){return(i,n,a)=>{let r=m.getState(n.state);if(!r)throw Error("no math plugin!");let o=r.activeNodeViews,s=new h(i,n,a,{katexOptions:{displayMode:e,macros:r.macros},...t},m,()=>{o.splice(o.indexOf(s))});return o.push(s),s}}var f=e.i(308822);function b(e,t){return f.Fragment.from(t.text(e))}function x(e){let t=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return t?.getAttribute("alt")??!1}function y(e){let t=e.querySelector("math[alttext]");return t?.getAttribute("alttext")??!1}function v(e){let t=e.querySelector("math annotation[encoding='application/x-tex'");return t?.textContent??!1}function C(e){var t=e,i=[x,y,v];for(let e of i){let i=e(t);if(!1!==i)return i}return!1}let w=/\$(.+)\$/;function S(e,t,i){return new n.InputRule(e,(e,n,r,o)=>{let s=e.doc.resolve(r),l=i instanceof Function?i(n):i;if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),t))return null;let d=e.tr.delete(r,o).setBlockType(r,r,t,l);return n[1]&&d.insertText(n[1],r,r),d.setSelection(a.NodeSelection.create(d.doc,d.mapping.map(s.pos-1)))})}(()=>{try{return RegExp("(?{let{from:t,to:i}=e.selection,n=e.selection.content().content,a=[];return n.descendants((e,i,n)=>"text"!=e.type.name&&(!e.type.name.startsWith("math_")||(a.push({start:Math.max(t+i-1,0),end:t+i+e.nodeSize-1}),!1))),u.DecorationSet.create(e.doc,a.map(({start:e,end:t})=>u.Decoration.node(e,t,{class:"math-select"})))},A=new a.Plugin({state:{init:(e,t)=>k(t),apply:(e,t)=>e.selection&&e.selectionSet?k(e):t},props:{decorations:e=>A.getState(e)}}),E=new class{nodes;marks;constructor(e,t){this.nodes={...t?.nodes,...e.nodes},this.marks={...t?.marks,...e.marks}}serializeFragment(e){let t="",i=!0,n=e.size;return e.nodesBetween(0,n,(e,a)=>{let r=this.serializeNode(e);if(null!==r)return t+=r,!1;e.isText?(t+=e.text?.slice(Math.max(0,a)-a,n-a)||"",i=!1):!i&&e.isBlock&&(t+="\n\n",i=!0)},0),t}serializeSlice(e){return this.serializeFragment(e.content)}serializeNode(e){let t=this.nodes[e.type.name];return void 0!==t?t(e):null}}({nodes:{math_inline:e=>`$${e.textContent}$`,math_display:e=>` $$ ${e.textContent} $$`}});e.s([],135053);let _=(0,o.createTiptapNode)("mathInline",{renderHTML:({HTMLAttributes:e})=>["span",(0,i.mergeAttributes)(e,{class:"math-node","data-node-type":"math_inline"}),0],parseHTML:()=>[{tag:'span[data-node-type="math_inline"]'},{tag:"math"}],addCommands(){return{insertMathInline:()=>({state:e,dispatch:t,view:i})=>(function(e,t=""){return function(i,n){let{$from:r}=i.selection,o=r.index();if(!r.parent.canReplaceWith(o,o,e))return!1;if(n){let o=e.create({},t?i.schema.text(t):null),s=i.tr.replaceSelectionWith(o);n(s=s.setSelection(a.NodeSelection.create(s.doc,r.pos)))}return!0}})(this.type," ")(e,t,i),convertToMathInline:()=>({state:e,chain:t})=>{let i=e.doc.textBetween(e.selection.from,e.selection.to);return t().insertContent({type:"math_inline",content:[{type:"text",text:i}]}).run(),!0}}}}),I=/\$([^ $]+)\$[ ]$/,M=/^\${2}\s+$/,T=/^\${2}(.+)\${2}$/,L=i.Extension.create({name:"math",addExtensions:()=>[_,s],addProseMirrorPlugins(){var e;let t,i=r.featureFlags.get("math")?[new a.Plugin({props:{clipboardTextSerializer:e=>E.serializeSlice(e)}}),(0,n.inputRules)({rules:[S(M,this.editor.schema.nodes.math_display),S(T,this.editor.schema.nodes.math_display),(e=this.editor.schema.nodes.math_inline,new n.InputRule(I,(t,i,n,a)=>{let r=t.doc.resolve(n),o=r.index(),s=t.doc.resolve(a);if(!r.parent.canReplaceWith(o,s.index(),e))return null;let l=[e.create(void 0,e.schema.text(i[1]))];return i[0].endsWith(" ")&&" "!==t.doc.textBetween(a,a+1)&&l.push(e.schema.text(" ")),t.tr.replaceWith(n,a,l)}))]})]:[];return[(t={undo:()=>this.editor.commands.undo(),redo:()=>this.editor.commands.redo()},new a.Plugin({key:m,state:{init:(e,t)=>({macros:{},activeNodeViews:[],prevCursorPos:0}),apply:(e,t,i,n)=>({activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:i.selection.from})},props:{nodeViews:{math_inline:g(!1,{...t,tagName:"span"}),math_display:g(!0,t)}}}))].concat(i)}});e.s(["Math",0,L,"isMathNode",0,e=>"math_display"===e.type.name||"math_inline"===e.type.name],612904),e.s([],578014),e.s(["isCalloutBoxNode",0,e=>"calloutBox"===e.type.name],795478)},257140,(e,t,i)=>{t.exports=function(e){return null==e}},131339,e=>{"use strict";var t=e.i(755453),i=e.i(257140),n=e.i(175863),a=e.i(418755),r=e.i(551880),o=e.i(615393);e.i(24439);var s=e.i(103630),l=e.i(85547);let d=t.Extension.create({name:"cardCollapse",addKeyboardShortcuts:()=>({Escape:({editor:e})=>{let i=(0,a.getStore)();if((0,r.selectMode)(i.getState())===o.EditorModeEnum.SLIDE_VIEW)return!1;let{selection:n}=e.state;if(!n.empty)return!1;let d=(0,t.findParentNode)(s.isCardNode)(n);return!(!d||!(d.depth>l.CARD_DEPTH)||c(d.node))&&(u(d.node.attrs.id,!0),!0)}}),addProseMirrorPlugins:()=>[new n.Plugin({key:new n.PluginKey("cardCollapse"),appendTransaction:(e,i,a)=>{if(a.selection.eq(i.selection)||!a.selection.empty)return;let r=(0,t.findParentNode)(s.isCardNode)(a.selection);if(!r)return;let{node:o,pos:l}=r;if(c(o))try{let{tr:e}=a,t=n.NodeSelection.create(e.doc,l);if(!t)return;return e.setSelection(t)}catch(e){console.error("Error moving selection out of collapsed card",{node:o,pos:l},e)}}})]}),c=e=>{let t="string"==typeof e?e:e?.attrs?.id;if(!t)return;let i=(0,a.getStore)().getState();return(0,r.selectCardCollapsed)(t)(i)},u=(e,t)=>{if((0,i.default)(e))return void console.error("[setCardCollapsed] Input is unexpectedly not string | string[]: ",e);let n=Array.isArray(e)?e:[e],o=(0,a.getStore)();(1!==n.length||(0,r.selectCardCollapsed)(n[0])(o.getState())!==t)&&o.dispatch((0,r.setCardsCollapsed)({cardIds:n,isCollapsed:t}))};e.s(["CardCollapse",0,d,"initializeCardExpanded",0,e=>{let t=(0,a.getStore)();void 0===t.getState().TipTap.memoState.expandedCards[e]&&t.dispatch((0,r.setCardsCollapsed)({cardIds:[e],isCollapsed:!1}))},"isCardCollapsed",0,c,"setCardCollapsed",0,u,"setDefaultCardCollapse",0,(e,t)=>{let i=[],n=[];e.descendants((e,t,a)=>{if(!(0,s.isCardNode)(e))return;let{id:r}=e.attrs;a&&"document"===a.type.name?i.push(r):n.push(r)}),t((0,r.setCardsCollapsed)({cardIds:i,isCollapsed:!1})),t((0,r.setCardsCollapsed)({cardIds:n,isCollapsed:!0}))}])},106147,e=>{"use strict";e.s(["isGridItemNode",0,e=>"gridItem"===e.type.name])},171764,(e,t,i)=>{t.exports=function(e,t,i,n){for(var a=-1,r=null==e?0:e.length;++a{var n=e.r(885049);t.exports=function(e,t,i,a){return n(e,function(e,n,r){t(a,e,i(e),r)}),a}},316666,(e,t,i)=>{var n=e.r(171764),a=e.r(299177),r=e.r(305792),o=e.r(448684);t.exports=function(e,t){return function(i,s){var l=o(i)?n:a,d=t?t():{};return l(i,e,r(s,2),d)}}},130074,(e,t,i)=>{var n=e.r(398629);t.exports=e.r(316666)(function(e,t,i){n(e,i,t)})},49202,3297,860766,37169,368740,607400,83100,e=>{"use strict";var t,i=e.i(161385),n=((t={}).CREATE_COMMENT_FROM_SELECTION="createCommentFromSelection",t.OPEN_POPUP_COMMENT="openPopupComment",t.POPUP_COMMENT_TOGGLED="popupCommentToggled",t.OPEN_THEME_DRAWER="openThemeDrawer",t.OPEN_PAGE_SETUP="openPageSetup",t.OPEN_PRESENT_MODE_CONTEXT_MENU="openPresentModeContextMenu",t.Y_DOC_IS_TOO_LARGE="yDocIsTooLarge",t.GENERATION_STREAM_START="generationStreamStart",t.GENERATION_CARD_COMPLETE="generationCardComplete",t.GENERATION_STREAM_DONE="generationStreamDone",t.GENERATION_STREAM_ERROR="generationStreamError",t);class a extends i.EventEmitter{}let r=new a;e.s(["EventBusEvent",()=>n,"TiptapEventBus",0,r],49202);var o=e.i(686435);e.s(["enUS",()=>o.default],3297);var s=e.i(524473),l=e.i(408122);let d=()=>({note:{name:l.i18n._({id:"KiJn9B",message:"Note"}),commandName:()=>l.i18n._({id:"Cq+sLh",message:"Note box"}),description:l.i18n._({id:"ooy/OF",message:"Draw attention using your theme accent color"}),icon:s.faStickyNote,colors:"accent"},info:{name:l.i18n._({id:"CE+M2e",message:"Info"}),commandName:()=>l.i18n._({id:"1E4ojF",message:"Info box"}),description:l.i18n._({id:"NfbNtV",message:"Highlight information in a blue box"}),icon:s.faInfoCircle,colors:{light:{backgroundColor:"#b6d6fc",iconColor:"#006ED6"},dark:{backgroundColor:"#022349",iconColor:"#8DD4FB"}}},warning:{name:l.i18n._({id:"r6y+jM",message:"Warning"}),commandName:()=>l.i18n._({id:"xb1fsI",message:"Warning box"}),icon:s.faTriangleExclamation,description:l.i18n._({id:"tpYgEx",message:"Call out risks in a yellow box"}),colors:{light:{backgroundColor:"#fcf2b5",iconColor:"#B29500"},dark:{backgroundColor:"#4b3f02",iconColor:"#F5F380"}}},caution:{name:l.i18n._({id:"VvjZ7K",message:"Caution"}),commandName:()=>l.i18n._({id:"tC/T1p",message:"Caution box"}),description:l.i18n._({id:"nbib7S",message:"Emphasize problems in a red box"}),icon:s.faXmarkCircle,colors:{light:{backgroundColor:"#ffb3b4",iconColor:"#EB0000"},dark:{backgroundColor:"#450707",iconColor:"#EF8784"}}},success:{name:l.i18n._({id:"zzDlyQ",message:"Success"}),commandName:()=>l.i18n._({id:"Vv+D/T",message:"Success box"}),description:l.i18n._({id:"pqvop4",message:"Add positive news in a green box"}),icon:s.faCheckCircle,colors:{light:{backgroundColor:"#b6fcb8",iconColor:"#008545"},dark:{backgroundColor:"#183a13",iconColor:"#8CE29F"}}},question:{name:l.i18n._({id:"bfgr/e",message:"Question"}),commandName:()=>l.i18n._({id:"Ev0Vqt",message:"Question box"}),description:l.i18n._({id:"IsUqRH",message:"Capture open questions in a gray box"}),icon:s.faQuestionCircle,colors:{light:{backgroundColor:"#d9d9d9",iconColor:"#7A7A7A"},dark:{backgroundColor:"#262626",iconColor:"#AFAFAF"}}}});e.s(["getCalloutBoxCommands",0,()=>Object.entries(d()).map(([e,{commandName:t,icon:i}])=>({key:`calloutBox-${e}`,name:t,nodeName:"calloutBox",icon:i,shortcut:`/${e}`,keywords:["callout","box"],execute:t=>t.chain().focus().insertContent([{type:"calloutBox",attrs:{variant:e},content:[{type:"paragraph"}]}]).run()})),"getCalloutBoxEmptyNodes",0,()=>Object.fromEntries(Object.keys(d()).map(e=>[`calloutBox-${e}`,{type:"calloutBox",attrs:{variant:e},content:[{type:"paragraph"}]}])),"getCalloutBoxOption",0,e=>d()[e]||d().note,"getCalloutBoxOptions",0,d],860766),e.s(["DEFAULT_CARD_GENERATOR_INPUT",0,{prompt:"",template:null,settings:{},status:"ready"}],37169);var c=e.i(275316);e.i(144786);let u=["basic","imageCards","cardLayouts","images","collections","charts","pyramid","data","embeds","progressiveDisclosure","calls-to-action","misc"],p={default:u,modal:u,placeholder:["cardPlaceholder"]},h=e=>p[e].map(e=>{let t;return(t=[{id:"basic",name:()=>l.i18n._({id:"0wJVK+",message:"Basic"}),templateIds:["blankCard","titleWith2ColumnImageLeft","titleWith2ColumnImageRight","titleWith2ColumnContent","titleWith2ColumnContentAndHeadings","titleWith3ColumnContent","titleWith3ColumnContentAndHeadings","titleWith4ColumnContent","titleWithBullets","titleWithBulletsAndImage"]},{id:"cardLayouts",name:()=>l.i18n._({id:"125H9i",message:"Card layouts"}),templateIds:["accentLeft","accentRight","accentTop","accentRightFit","accentLeftFit"]},{id:"images",name:()=>l.i18n._({id:"an5hVd",message:"Images"}),templateIds:["titleWith2ImageColumns","titleWith3ImageColumns","titleWith4ImageColumns","titleWith3ImagesWithText","imageGallery","titleWithTeamPhotos"]},{id:"collections",name:()=>l.i18n._({id:"MISW12",message:"Collections and sequences"}),templateIds:["titleWithTextBoxes","titleWithTimeline","titleWithLargeBulletList","titleWithIconsWithText","titleWithSmallIconsAndText","titleWithArrows"]},{id:"data",name:()=>l.i18n._({id:"+60MiA",message:"Charts, statistics and data"}),templateIds:["titleWithColumnChart","titleWithBarChart","titleWithLineChart","titleWithPieChart","titleWithDonutChart","titleWithStats","barStatsWithText","titleWithCircleStats","titleWith3RowTable"]},{id:"embeds",name:()=>l.i18n._({id:"aTofd0",message:"Embeds"}),templateIds:["titleWithYouTubeEmbed","titleWithWebpageEmbed"]},{id:"progressiveDisclosure",name:()=>l.i18n._({id:"rd7L5e",message:"Progressive disclosure"}),templateIds:["titleWith3NestedCards","titleWith3Toggles"]},{id:"pyramid",name:()=>l.i18n._({id:"96Rp0u",message:"Pyramids and funnels"}),templateIds:["funnelWithText","steppedPyramidWithText","pyramidWithTitleAndTextOutside","leftSteppedPyramidWithTitleAndTextOutside"]},{id:"calls-to-action",name:()=>l.i18n._({id:"gm+qKB",message:"Calls to action"}),templateIds:["titleWithContentAndButton"]},{id:"misc",name:()=>l.i18n._({id:"RDie0n",message:"Miscellaneous"}),templateIds:["titleCard","titleWithGif","titleWithDiagram"]},{id:"cardPlaceholder",name:()=>l.i18n._({id:"hx1ePY",message:"Placeholder"}),templateIds:["titleWith2ColumnImageLeft","titleWith2ColumnContent","accentRight","titleWith3ImageColumns"]}],c.featureFlags.get("imageCardsUX")&&t.push({id:"imageCards",name:()=>l.i18n._({id:"QBkg06",message:"Image cards"}),templateIds:["blankImageCard"],description:()=>l.i18n._({id:"TQJ2If",message:"Insert a full image card for maximum visual effect"})}),t).find(t=>t.id===e)}).filter(e=>!!e);e.s(["getTemplateCollectionsForContext",0,h],368740);var m=e.i(576281);let g=()=>{let e=()=>l.i18n._({id:"6MDj8K",message:"Start typing..."});return{blankCard:{id:"blankCard",createdBy:null,name:()=>l.i18n._({id:"UQOvxZ",message:"Blank card"}),description:()=>l.i18n._({id:"V7lf6B",message:"A blank card to start with"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading()]),keywords:["blank"]},titleWithBullets:{id:"titleWithBullets",name:()=>l.i18n._({id:"jzSy62",message:"Title with bullets"}),createdBy:null,description:()=>l.i18n._({id:"605WM6",message:"A card with bullet points"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.bullet(),m.templateHelpers.bullet(),m.templateHelpers.bullet(),m.templateHelpers.bullet()]),keywords:["heading","bullets"]},titleWithBulletsAndImage:{id:"titleWithBulletsAndImage",name:()=>l.i18n._({id:"ciw/iY",message:"Title with bullets and image"}),createdBy:null,description:()=>l.i18n._({id:"kTU/Ne",message:"A card with a heading and bullet points, and an image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.bullet(),m.templateHelpers.bullet(),m.templateHelpers.bullet(),m.templateHelpers.bullet()],[m.templateHelpers.mediaPlaceholder()]])]),keywords:["heading","bullets"]},titleWith2ColumnContent:{id:"titleWith2ColumnContent",createdBy:null,name:()=>l.i18n._({id:"uVQ8y8",message:"Two columns"}),description:()=>l.i18n._({id:"pRDCBH",message:"A card with a heading and two columns"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())]])]),keywords:["title","2 column","split","paragraph"]},titleWith2ColumnContentAndHeadings:{id:"titleWith2ColumnContentAndHeadings",createdBy:null,name:()=>l.i18n._({id:"/ESRO3",message:"Two column with headings"}),description:()=>l.i18n._({id:"acTyiC",message:"A card with a heading and two columns with headings"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.h3(),m.templateHelpers.paragraph(e())],[m.templateHelpers.h3(),m.templateHelpers.paragraph(e())]])]),keywords:["title","2 column","split","paragraph"]},titleWith3ColumnContent:{id:"titleWith3ColumnContent",createdBy:null,name:()=>l.i18n._({id:"YmAqYT",message:"Three columns"}),description:()=>l.i18n._({id:"od0FQb",message:"A card with a heading and three columns"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())]])]),keywords:["heading","3 column","paragraph"]},titleWith3ColumnContentAndHeadings:{id:"titleWith3ColumnContentAndHeadings",createdBy:null,name:()=>l.i18n._({id:"3tQQ39",message:"Three column with headings"}),description:()=>l.i18n._({id:"Yno39F",message:"A card with a heading and three columns with headings"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.h4(),m.templateHelpers.paragraph(e())]])]),keywords:["heading","3 column","paragraph"]},titleWith4ColumnContent:{id:"titleWith4ColumnContent",createdBy:null,name:()=>l.i18n._({id:"+a/yD6",message:"Four columns"}),description:()=>l.i18n._({id:"h5ySm8",message:"A card with a heading and four columns"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())],[m.templateHelpers.paragraph(e())]])]),keywords:["heading","4 column","paragraph"]},titleWith2ColumnImageLeft:{id:"titleWith2ColumnImageLeft",createdBy:null,name:()=>l.i18n._({id:"6edF/U",message:"Image and text"}),description:()=>l.i18n._({id:"SzGG7G",message:"A card with a heading and two columns of content with an image on the left"}),jsonContent:m.templateHelpers.card([m.templateHelpers.columns([[m.templateHelpers.mediaPlaceholder()],[m.templateHelpers.heading(),m.templateHelpers.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["title","2 column","image","left"]},titleWith2ColumnImageRight:{id:"titleWith2ColumnImageRight",createdBy:null,name:()=>l.i18n._({id:"afp0nb",message:"Text and image"}),description:()=>l.i18n._({id:"M7cuHB",message:"A card with a heading and two columns of content with an image on the right"}),jsonContent:m.templateHelpers.card([m.templateHelpers.columns([[m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder()]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["title","2 column","image","right"]},blankImageCard:{id:"blankImageCard",createdBy:null,name:()=>l.i18n._({id:"YkssmO",message:"Blank image card"}),description:()=>l.i18n._({id:"aI+qic",message:"A blank image card"}),jsonContent:m.templateHelpers.card(null,void 0,void 0,{image:{}}),keywords:["image","blank"],badge:()=>l.i18n._({id:"isRobC",message:"New"})},titleWith2ImageColumns:{id:"titleWith2ImageColumns",createdBy:null,name:()=>l.i18n._({id:"oVMU3f",message:"2 image columns"}),description:()=>l.i18n._({id:"sqVSP2",message:"A card with a heading and two columns of images"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h3(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h3(),m.templateHelpers.paragraph(e())]])]),keywords:["heading","2 column","image"]},titleWith3ImageColumns:{id:"titleWith3ImageColumns",createdBy:null,name:()=>l.i18n._({id:"ZjjVJt",message:"3 image columns"}),description:()=>l.i18n._({id:"kmtZuD",message:"A card with a heading and three columns of images"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())]])]),keywords:["heading","3 column","paragraph","image"]},titleWith4ImageColumns:{id:"titleWith4ImageColumns",createdBy:null,name:()=>l.i18n._({id:"Re1S+b",message:"4 image columns"}),description:()=>l.i18n._({id:"+x8oem",message:"A card with a heading and four columns of images"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())],[m.templateHelpers.mediaPlaceholder(),m.templateHelpers.h4(),m.templateHelpers.paragraph(e())]])]),keywords:["heading","4 column","image"]},titleWith3ImagesWithText:{id:"titleWith3ImagesWithText",createdBy:null,name:()=>l.i18n._({id:"cDxTeG",message:"Images with text"}),description:()=>l.i18n._({id:"rwJuIz",message:"A card with a heading and smart layout with three images with text"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("imagesText",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:10,shapeSize:"full",horizontalAlign:"left",imageShape:"square"}})]),keywords:["heading","image","layout"]},imageGallery:{id:"imageGallery",createdBy:null,name:()=>l.i18n._({id:"Oho0T7",message:"Image gallery"}),description:()=>l.i18n._({id:"H87HG1",message:"A card with a heading and a gallery of images"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.gallery([m.templateHelpers.mediaPlaceholder({source:"image.custom"}),m.templateHelpers.mediaPlaceholder({source:"image.custom"}),m.templateHelpers.mediaPlaceholder({source:"image.custom"})])]),keywords:["heading","gallery","image"]},titleWithTeamPhotos:{id:"titleWithTeamPhotos",createdBy:null,name:()=>l.i18n._({id:"+kQMBP",message:"Team photos"}),description:()=>l.i18n._({id:"tt2nIz",message:"A card with a heading and three circular photos"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("imagesText",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"6YtxFj",message:"Name"})),m.templateHelpers.paragraph(l.i18n._({id:"GDvlUT",message:"Role"})),m.templateHelpers.paragraph(l.i18n._({id:"Nu4oKW",message:"Description"}),{fontSize:"sm"})]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"6YtxFj",message:"Name"})),m.templateHelpers.paragraph(l.i18n._({id:"GDvlUT",message:"Role"})),m.templateHelpers.paragraph(l.i18n._({id:"Nu4oKW",message:"Description"}),{fontSize:"sm"})]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"6YtxFj",message:"Name"})),m.templateHelpers.paragraph(l.i18n._({id:"GDvlUT",message:"Role"})),m.templateHelpers.paragraph(l.i18n._({id:"Nu4oKW",message:"Description"}),{fontSize:"sm"})])],{options:{cellSize:10,shapeSize:"full",horizontalAlign:"center",imageShape:"circle"}})]),keywords:["heading","image","team"]},accentRight:{id:"accentRight",createdBy:null,name:()=>l.i18n._({id:"Czo70+",message:"Accent right"}),description:()=>l.i18n._({id:"x5nYRE",message:"A card with a heading and a right accent image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],{layout:"right"}),keywords:["accent"]},accentRightFit:{id:"accentRightFit",createdBy:null,name:()=>l.i18n._({id:"1BvkHE",message:"Accent right (fit)"}),description:()=>l.i18n._({id:"oItvxV",message:"A card with a heading and a right accent fit image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],{layout:"right"},{fitType:"fit"}),keywords:["accent"]},accentLeft:{id:"accentLeft",createdBy:null,name:()=>l.i18n._({id:"5HMSY5",message:"Accent left"}),description:()=>l.i18n._({id:"c/I4N2",message:"A card with a heading and a left accent image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],{layout:"left"}),keywords:["accent"]},accentLeftFit:{id:"accentLeftFit",createdBy:null,name:()=>l.i18n._({id:"bGTdlK",message:"Accent left (fit)"}),description:()=>l.i18n._({id:"r4fLNa",message:"A card with a heading and a left accent fit image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],{layout:"left"},{fitType:"fit"}),keywords:["accent"]},accentTop:{id:"accentTop",createdBy:null,name:()=>l.i18n._({id:"BUdX7X",message:"Accent top"}),description:()=>l.i18n._({id:"QuKih6",message:"A card with a heading and a top accent image"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e())],{layout:"top"}),keywords:["accent"]},titleWith3NestedCards:{id:"titleWith3NestedCards",createdBy:null,name:()=>l.i18n._({id:"ORoO1f",message:"3 nested cards"}),description:()=>l.i18n._({id:"J89hiV",message:"A card with a heading and three nested cards"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph()]),m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph()]),m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph()])]),keywords:["heading","nested","card"]},titleWith3Toggles:{id:"titleWith3Toggles",createdBy:null,name:()=>l.i18n._({id:"Sf3ASu",message:"3 toggles"}),description:()=>l.i18n._({id:"58JI2k",message:"A card with a heading and three toggles"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.toggle([m.templateHelpers.paragraph(e())]),m.templateHelpers.toggle([m.templateHelpers.paragraph(e())]),m.templateHelpers.toggle([m.templateHelpers.paragraph(e())])]),keywords:["heading","toggle"]},titleWithTimeline:{id:"titleWithTimeline",createdBy:null,name:()=>l.i18n._({id:"cklVjM",message:"Timeline"}),description:()=>l.i18n._({id:"Wdyt2J",message:"A card with a heading and a timeline"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("timeline",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{orientation:"vertical",twoSided:!1}})]),keywords:["heading","timeline"]},titleWithLargeBulletList:{id:"titleWithLargeBulletList",createdBy:null,name:()=>l.i18n._({id:"F5uDGO",message:"Large bullet list"}),description:()=>l.i18n._({id:"g1FTqD",message:"A card with a heading and a large bullet list"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("bigBullets",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:20}})]),keywords:["heading","bullet","list"]},titleWithIconsWithText:{id:"titleWithIconsWithText",createdBy:null,name:()=>l.i18n._({id:"joUkNe",message:"Icons with text"}),description:()=>l.i18n._({id:"DHZYRd",message:"A card with a heading and four medium icons with text"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("iconsText",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:10,shapeSize:"md",horizontalAlign:"center"}})]),keywords:["heading","icons"]},titleWithSmallIconsAndText:{id:"titleWithSmallIconsAndText",createdBy:null,name:()=>l.i18n._({id:"AhHG+7",message:"Small icons with text"}),description:()=>l.i18n._({id:"L8/5yN",message:"A card with a heading and four small icons with text"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("iconsText",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:10,shapeSize:"sm",horizontalAlign:"left"}})]),keywords:["heading","icons"]},titleWithTextBoxes:{id:"titleWithTextBoxes",createdBy:null,name:()=>l.i18n._({id:"b7qbjN",message:"Text boxes"}),description:()=>l.i18n._({id:"Cg0xBG",message:"A card with a heading and three text boxes"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("solidBoxes",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:15}})]),keywords:["heading","boxes"]},titleWithArrows:{id:"titleWithArrows",createdBy:null,name:()=>l.i18n._({id:"YUGjgn",message:"Arrows"}),description:()=>l.i18n._({id:"SnGUtD",message:"A card with a arrows"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("arrows",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())])],{options:{cellSize:10}})]),keywords:["arrows","process","sequence","flow"]},titleWithColumnChart:{id:"titleWithColumnChart",createdBy:null,name:()=>l.i18n._({id:"kaIve5",message:"Column chart"}),description:()=>l.i18n._({id:"EE/H36",message:"A card with a heading and a column chart"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.graphyColumnChart()]),keywords:["heading","chart","column chart"]},titleWithBarChart:{id:"titleWithBarChart",createdBy:null,name:()=>l.i18n._({id:"JXpNuP",message:"Bar chart"}),description:()=>l.i18n._({id:"2s/J1+",message:"A card with a heading and a horizontal bar chart"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.graphyBarChart()]),keywords:["heading","chart","bar chart"]},titleWithLineChart:{id:"titleWithLineChart",createdBy:null,name:()=>l.i18n._({id:"Kt/Lzz",message:"Line chart"}),description:()=>l.i18n._({id:"eRabUB",message:"A card with a heading and a line chart"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.graphyLineChart()]),keywords:["heading","chart","line chart"]},titleWithPieChart:{id:"titleWithPieChart",createdBy:null,name:()=>l.i18n._({id:"5+y+OQ",message:"Pie chart"}),description:()=>l.i18n._({id:"zIzb1A",message:"A card with a heading and a pie chart"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.graphyPieChart()]),keywords:["heading","chart","pie chart"]},titleWithDonutChart:{id:"titleWithDonutChart",createdBy:null,name:()=>l.i18n._({id:"DNipMm",message:"Donut chart"}),description:()=>l.i18n._({id:"MWtClR",message:"A card with a heading and a donut chart"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.graphyDonutChart()]),keywords:["heading","chart","donut chart"]},titleWithStats:{id:"titleWithStats",createdBy:null,name:()=>l.i18n._({id:"w0arAq",message:"Big numbers"}),description:()=>l.i18n._({id:"YEhR/1",message:"A card with a heading and three stat numbers"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("stats",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"nH8BJ4",message:"Stat"})),m.templateHelpers.paragraph(e())],{label:"25%"}),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"nH8BJ4",message:"Stat"})),m.templateHelpers.paragraph(e())],{label:"3/4"}),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"nH8BJ4",message:"Stat"})),m.templateHelpers.paragraph(e())],{label:"50"})],{options:{cellSize:15,shapeSize:"lg"}})]),keywords:["heading","stats"]},barStatsWithText:{id:"barStatsWithText",createdBy:null,name:()=>l.i18n._({id:"LYRXtx",message:"Bar stats"}),description:()=>l.i18n._({id:"DgfiYp",message:"A card with a heading and three bar stats"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("barStats",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"nH8BJ4",message:"Stat"})),m.templateHelpers.paragraph(e())],{label:"25%"}),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"nH8BJ4",message:"Stat"})),m.templateHelpers.paragraph(e())],{label:"3/4"})],{options:{cellSize:20}})]),keywords:["heading","stats"]},titleWithCircleStats:{id:"titleWithCircleStats",createdBy:null,name:()=>l.i18n._({id:"mvpFPS",message:"Circle stats"}),description:()=>l.i18n._({id:"9AzsRa",message:"A card with a circle stats"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("circleStats",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())],{label:"25%"}),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())],{label:"1/3"}),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3(l.i18n._({id:"HX5SVx",message:"Item"})),m.templateHelpers.paragraph(e())],{label:"75"})],{options:{cellSize:10,horizontalAlign:"center"}})]),keywords:["arrows","process","sequence","flow"]},titleWith3RowTable:{id:"titleWith3RowTable",createdBy:null,name:()=>l.i18n._({id:"aDo58o",message:"3 row table"}),description:()=>l.i18n._({id:"2ZoOCu",message:"A card with a heading and a three row table"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.table([m.templateHelpers.tableRow([m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()])]),m.templateHelpers.tableRow([m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()])]),m.templateHelpers.tableRow([m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()]),m.templateHelpers.tableCell([m.templateHelpers.paragraph()])])])]),keywords:["heading","table"]},funnelWithText:{id:"funnelWithText",createdBy:null,name:()=>l.i18n._({id:"ETqzyH",message:"Funnel with text"}),description:()=>l.i18n._({id:"GxaYRj",message:"A card with a heading and a funnel in a column"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.smartLayout("funnel",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()])],{options:{numbered:!0,outsideText:!1}})],[m.templateHelpers.h2(),m.templateHelpers.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["heading","funnel"]},steppedPyramidWithText:{id:"steppedPyramidWithText",createdBy:null,name:()=>l.i18n._({id:"6xmZsQ",message:"Stepped pyramid with text"}),description:()=>l.i18n._({id:"GqW7Xg",message:"A card with a heading and a stepped pyramid"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.columns([[m.templateHelpers.smartLayout("staircase",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()])],{options:{outsideText:!1,horizontalAlign:"center"}})],[m.templateHelpers.h2(),m.templateHelpers.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["heading","pyramid","stepped","staircase"]},leftSteppedPyramidWithTitleAndTextOutside:{id:"leftSteppedPyramidWithTitleAndTextOutside",createdBy:null,name:()=>l.i18n._({id:"6j13ZR",message:"Left-stepped pyramid with text"}),description:()=>l.i18n._({id:"JGF7vo",message:"A card with a heading and a left-aligned staircase with text outside"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("staircase",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()])],{options:{outsideText:!1,horizontalAlign:"left"}})]),keywords:["heading","pyramid","stepped","staircase"]},pyramidWithTitleAndTextOutside:{id:"pyramidWithTitleAndTextOutside",createdBy:null,name:()=>l.i18n._({id:"l1mM+L",message:"Pyramid with outside text"}),description:()=>l.i18n._({id:"L0QPEt",message:"A card with a heading and a pyramid with text outside"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.smartLayout("pyramid",[m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()]),m.templateHelpers.smartLayoutCell([m.templateHelpers.h3()])],{options:{numbered:!0,outsideText:!0}})]),keywords:["heading","pyramid"]},titleWithContentAndButton:{id:"titleWithContentAndButton",name:()=>l.i18n._({id:"FJJPAA",message:"Content with button"}),createdBy:null,description:()=>l.i18n._({id:"itiMvE",message:"A card with a heading, paragraph, and a button"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.paragraph(e()),m.templateHelpers.buttons([m.templateHelpers.button(l.i18n._({id:"uWe4QF",message:"Click here"}),{variant:"solid"}),m.templateHelpers.button(l.i18n._({id:"zwWKhA",message:"Learn more"}),{variant:"outline"})])]),keywords:["button","heading","paragraph"]},titleWithYouTubeEmbed:{id:"titleWithYouTubeEmbed",createdBy:null,name:()=>l.i18n._({id:"D1Tqqj",message:"YouTube video"}),description:()=>l.i18n._({id:"s0st+i",message:"A card with a YouTube video embed"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.mediaPlaceholder({source:"video.youtube"})]),keywords:["heading","embed","video"]},titleWithWebpageEmbed:{id:"titleWithWebpageEmbed",createdBy:null,name:()=>l.i18n._({id:"8FOKyw",message:"Webpage embed"}),description:()=>l.i18n._({id:"0ngLOJ",message:"A card with a webpage embed"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.mediaPlaceholder({source:"embed.custom"})]),keywords:["heading","embed","webpage"]},titleCard:{id:"titleCard",createdBy:null,name:()=>l.i18n._({id:"5U/oBM",message:"Title card"}),description:()=>l.i18n._({id:"rYur7N",message:"A card with a title"}),jsonContent:m.templateHelpers.card([m.templateHelpers.title(),m.templateHelpers.h2()]),keywords:["title"]},titleWithGif:{id:"titleWithGif",createdBy:null,name:()=>l.i18n._({id:"wRkP2d",message:"GIF"}),description:()=>l.i18n._({id:"kHFDdm",message:"A card with a GIF"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.mediaPlaceholder({source:"image.giphy"})]),keywords:["heading","embed","webpage"]},titleWithDiagram:{id:"titleWithDiagram",createdBy:null,name:()=>l.i18n._({id:"i+ShMB",message:"Diagram"}),description:()=>l.i18n._({id:"6i4/hD",message:"A card with a diagram"}),jsonContent:m.templateHelpers.card([m.templateHelpers.heading(),m.templateHelpers.diagram()]),keywords:["heading","diagram"],featureFlag:"tldraw2"}}},f=()=>Object.values(g());e.s(["checkTemplateDisabled",0,(e,t,i)=>{try{if(t.featureFlag&&!c.featureFlags.get(t.featureFlag)||i?.(t))return!0;return!1}catch(e){return!0}},"getCardTemplates",0,f,"getCardTemplatesEmptyNodes",0,()=>f().reduce((e,t)=>(e[t.id]=t.jsonContent,e),{}),"getCardTemplatesMap",0,g,"getGroupedCardTemplates",0,(e="default")=>h(e).map(({name:e,templateIds:t,description:i})=>{let n=t.map(e=>g()[e]);return{subcategory:e(),items:n,description:i?.()}})],607400),e.s(["TABLE_OF_CONTENTS_HEADER",0,()=>l.i18n._({id:"9FTolD",message:"Table of contents"})],83100)},555999,e=>{"use strict";var t=e.i(89081);let i=e=>{let i=e.getMeta(t.ySyncPluginKey);return i?.isChangeOrigin===!0},n=e=>i(e)&&!a(e),a=e=>e.getMeta(t.ySyncPluginKey)?.isUndoRedoOperation;e.s(["isLocalTransaction",0,e=>!n(e),"isRemoteTransaction",0,n,"isYSyncTransaction",0,i])},438106,e=>{"use strict";e.s(["ExtensionPriorityMap",0,{UniqueAttribute:1e4,CardMention:1001,DocMention:1001,UserMention:1001,UndoInputRuleKeymap:1001,HorizontalAlign:1001,Collaboration:1e3,Highlight:150,FootnoteLabel:150,TextColor:150,Code:150,Link:140,SlashMenu:104,EmojiShortcuts:104,MentionSuggestionMenu:104,List:103,CardAccentLayoutItem:103,Table:102,Image:102,Gallery:102,CardLayoutItem:101,MediaPlaceholder:101,CodeBlock:101,Layout:101,Footnote:101,Card:101,Toggle:101,SmartLayout:101,Grid:101,PositionedBox:101,KeyMapOverride:100,GlobalDragHandle:99,CardIds:1,KeyBoardCatchall:1,UndoHistory:-100}])},391736,907648,566358,e=>{"use strict";var t=e.i(462480),i=e.i(175863),n=e.i(555999),a=e.i(755453),r=e.i(308822),o=e.i(438106),s=e.i(524617),l=e.i(800602),d=e.i(963576);let c=new i.PluginKey("UniqueAttribute"),u=({tr:e,node:t,initialValue:i,pos:n,attributeName:a})=>{let r=i();return e.setNodeMarkup(n,void 0,{...t.attrs,[a]:r}),{node:t,val:r,pos:n}},p=a.Extension.create({name:"UniqueAttribute",priority:o.ExtensionPriorityMap.UniqueAttribute,addOptions(){return{attributeName:"",pluginKey:new i.PluginKey(this.name),types:[],initialValue:()=>void 0,filterTransaction:null,syncWithFilmstrip:!1}},onCreate(){let{view:e,state:t}=this.editor;if(this.editor.isReadOnly)return;let{tr:i,doc:n}=t,{types:r,attributeName:o,initialValue:s,callback:l}=this.options,d=(0,a.findChildren)(n,e=>r.includes(e.type.name)&&null===e.attrs[o]).map(({node:e,pos:t})=>u({pos:t,node:e,tr:i,initialValue:s,attributeName:o}));0!==d.length&&(console.debug("UniqueAttribute onCreate fixed missing ids",{extra:{results:d,tr:i,attributeName:o,types:r}}),e.dispatch(i),l&&l(this.editor,d,i.doc))},addProseMirrorPlugins(){let e=!1;return[new i.Plugin({key:this.options.pluginKey,appendTransaction:(e,t,i)=>{var n;let r,o=e.some(e=>e.docChanged)&&!t.doc.eq(i.doc),p=this.options.filterTransaction&&e.some(e=>!this.options.filterTransaction?.(e));if(!o||p)return;let{tr:h}=i,{types:m,attributeName:g,syncWithFilmstrip:f,initialValue:b,callback:x,pluginKey:y}=this.options,v=(n=t.doc,r=new s.Transform(n),e.forEach(e=>{e.steps.forEach(e=>{r.step(e)})}),r),{mapping:C}=v,w=(0,d.default)(v),S=[],k=e.some(e=>!0===e.getMeta(c));if(w.forEach(e=>{var t;let n,r={from:e.newStart,to:e.newEnd},o=(0,a.findChildrenInRange)(i.doc,r,e=>m.includes(e.type.name)),s=(n=(t=o.map(({node:e})=>e.attrs[g]).filter(e=>null!==e)).filter((e,i)=>t.indexOf(e)!==i),(0,l.default)(n));o.forEach(({node:e,pos:t})=>{let i=h.doc.nodeAt(t)?.attrs[g];if(!i)return void S.push(u({pos:t,node:e,tr:h,initialValue:b,attributeName:g}));let{deleted:n}=C.invert().mapResult(t),a=n&&s.includes(i),r=n&&k;if(a||r){let i=u({pos:t,node:e,tr:h,initialValue:b,attributeName:g});S.push(i),console.debug(`%c [UniqueAttribute][${this.options.types}] Replaced ${e.attrs[g]} with new val: ${i.val}`,"background-color: deeppink",{override:r,newNode:a})}})}),x&&x(this.editor,S,h.doc),h.steps.length)return h},props:{handleDOMEvents:{drop:(t,i)=>((t.dragging?.move!==!0||i.dataTransfer?.effectAllowed==="copy")&&(e=!0),!1),paste:()=>(e=!0,!1)},transformPasted:t=>{if(!e)return t;let{types:i,attributeName:n}=this.options,a=e=>{let t=[];return e.forEach(e=>{if(e.isText)return void t.push(e);if(!i.includes(e.type.name))return void t.push(e.copy(a(e.content)));let r=e.type.create({...e.attrs,[n]:null},a(e.content),e.marks);t.push(r)}),r.Fragment.from(t)},o=this.options.transformPasted?this.options.transformPasted(t,this.options,this?.editor?.gammaDocId):new r.Slice(a(t.content),t.openStart,t.openEnd);return e=!1,o}}})]}});e.s(["UniqueAttribute",0,p,"UniqueAttributePluginKey",0,c,"pruneUniqueIds",0,(e,t)=>{let i=(e=>{let t=new Map;for(let i of e.extensionManager.extensions)if(i.parent?.name===p.name)for(let e of i.options.types)t.set(e,i.options.attributeName);return t})(e),n=e=>{let t=e.type?i.get(e.type):void 0,a=t&&e.attrs,r={...e};if(a){let{[t]:i,...n}=e.attrs;r.attrs=n}return e.content&&(r.content=e.content.map(n)),r};return n(t)}],907648),e.s([],566358);let h=new i.PluginKey("UniqueMediaId"),m=()=>(0,t.nanoid)(5),g=p.extend({name:"UniqueMediaId"}).configure({attributeName:"id",types:["image","embed","video","cardAccentLayoutItem","smartLayoutCell","mediaPlaceholder","cardImageItem","positionedTextbox","positionedContentBox","positionedImageBox","positionedHtmlBox","cardCanvasItem"],initialValue:m,filterTransaction:n.isLocalTransaction,pluginKey:h});e.s(["UniqueMediaId",0,g,"generateMediaId",0,m],391736)},144294,503752,522542,e=>{"use strict";var t=e.i(408122),i=e.i(860766),n=e.i(37169),a=e.i(607400),r=e.i(83100),o=e.i(391736);let s=()=>({title:{type:"title",attrs:{level:1}},h1:{type:"heading",attrs:{level:1}},normalText:{type:"paragraph"},h2:{type:"heading",attrs:{level:2}},h3:{type:"heading",attrs:{level:3}},h4:{type:"heading",attrs:{level:4}},bulletedList:{type:"bullet",attrs:{indent:0}},numberedList:{type:"numbered",attrs:{indent:0}},todoList:{type:"todo",attrs:{indent:0}},blockquote:{type:"blockquote",content:[{type:"paragraph"}]},codeBlock:{type:"codeBlock"},mathBlock:{type:"math_display"},button:{type:"button",content:[{type:"text",text:t.i18n._({id:"uWe4QF",message:"Click here"})}]},buttonGroup:{type:"buttonGroup",content:[{type:"button",content:[{type:"text",text:t.i18n._({id:"uWe4QF",message:"Click here"})}]}]},label:{type:"label"},labelGroup:{type:"labelGroup",content:[{type:"label"}]},table2:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table3:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table4:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},columns2:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns3:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns4:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},insertCardInside:{type:"card",content:[{type:"cardLayoutItem",attrs:{itemId:"body",background:{}},content:[{type:"heading",attrs:{level:1}}]}]},aiCardAfter:{type:"card",attrs:{generatorInput:n.DEFAULT_CARD_GENERATOR_INPUT},content:[{type:"paragraph"}]},imageCard:{type:"card",content:[{type:"cardImageItem"}]},codeCard:{type:"card",content:[{type:"cardCodeItem"}]},footnote:{type:"footnote",content:[{type:"paragraph"}]},contributors:{type:"contributors"},divider:{type:"divider"},tableOfContents:[{type:"heading",attrs:{level:3},content:[{type:"text",text:(0,r.TABLE_OF_CONTENTS_HEADER)()}]},{type:"tableOfContents"}],gallery:{type:"gallery",content:[]},logoGallery:{type:"gallery",attrs:{layout:"logo"},content:[]},...(0,a.getCardTemplatesEmptyNodes)(),...(0,i.getCalloutBoxEmptyNodes)(),toggle:{type:"toggle",content:[{type:"toggleSummary"},{type:"paragraph"}]},graphic:{type:"graphic",attrs:{id:(0,o.generateMediaId)(),showPlaceholder:!0},content:[]}});e.s(["EMPTY_NODES",0,s],144294);var l=e.i(575084);new(e.i(175863)).PluginKey("autocomplete"),e.s(["AUTOCOMPLETE_INPUT_SHORTCUT",0,"+++","INSERT_FADE_TIME",0,1500],503752),e.s(["AICommands",0,()=>[{key:"autoComplete",name:()=>t.i18n._({id:"ZyVTQp",message:"Continue writing with AI"}),shortcut:"+++",nodeName:"paragraph",icon:l.faSparkle,keywords:["continue","autocomplete","typeahead","complete","continue","ai"],execute:e=>{e.commands.autoComplete()},featureFlag:"aiAutocomplete",creditType:"autocomplete",needsConnection:!0},{key:"aiCardAfter",name:()=>t.i18n._({id:"yk2NpI",message:"New card with AI"}),nodeName:"card",icon:l.faSparkle,execute:e=>e.commands.insertCardAfter(s().aiCardAfter),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"],needsConnection:!0}]],522542)},671173,(e,t,i)=>{e.e,function(e,t){"use strict";var i=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach(function(i){if("default"!==i){var n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return e[i]}})}}),t.default=e,Object.freeze(t)}(t);function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var a={error:null},r=function(e){function t(){for(var t,i=arguments.length,n=Array(i),r=0;r{"use strict";var n=e.r(191788),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=n.useState,o=n.useEffect,s=n.useLayoutEffect,l=n.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!a(e,i)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(793596)},94925,(e,t,i)=>{"use strict";var n=e.r(191788),a=e.r(903815),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=a.useSyncExternalStore,s=n.useRef,l=n.useEffect,d=n.useMemo,c=n.useDebugValue;i.useSyncExternalStoreWithSelector=function(e,t,i,n,a){var u=s(null);if(null===u.current){var p={hasValue:!1,value:null};u.current=p}else p=u.current;var h=o(e,(u=d(function(){function e(e){if(!l){if(l=!0,o=e,e=n(e),void 0!==a&&p.hasValue){var t=p.value;if(a(t,e))return s=t}return s=e}if(t=s,r(o,e))return t;var i=n(e);return void 0!==a&&a(t,i)?t:(o=e,s=i)}var o,s,l=!1,d=void 0===i?null:i;return[function(){return e(t())},null===d?void 0:function(){return e(d())}]},[t,i,n,a]))[0],u[1]);return l(function(){p.hasValue=!0,p.value=h},[h]),c(h),h}},405020,(e,t,i)=>{"use strict";t.exports=e.r(94925)},429577,353653,812059,683164,517344,785872,255664,296691,e=>{"use strict";let t,i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E;e.s(["ChartCommands",()=>D],429577);var _,I=e.i(500425),M=e.i(408122),T=e.i(854624);e.i(144786);var L=e.i(275316);e.i(601019);var j=e.i(494075),P=e.i(687461);let D=()=>L.featureFlags.get("hideNonGraphyCharts")?[]:[{key:"barChartVertical",name:()=>M.i18n._({id:"kaIve5",message:"Column chart"}),icon:I.faChartSimple,chartType:"bar"},{key:"barChartHorizontal",name:()=>M.i18n._({id:"JXpNuP",message:"Bar chart"}),icon:I.faChartSimpleHorizontal,chartType:"horizontal-bar"},{key:"lineChart",name:()=>M.i18n._({id:"Kt/Lzz",message:"Line chart"}),icon:I.faChartLine,chartType:"line"},{key:"pieChart",name:()=>M.i18n._({id:"5+y+OQ",message:"Pie chart"}),icon:I.faChartPie,chartType:"pie"},{key:"donutChart",name:()=>M.i18n._({id:"DNipMm",message:"Donut chart"}),icon:I.faDonut,chartType:"donut"}].map(e=>({nodeName:"chart",keywords:["graph",e.chartType],execute:t=>{t.chain().insertChart(e.chartType,!0).editSelectedChart().run()},dragStartFn:t=>{let i=(0,T.generateChartId)();(0,j.setDraggingContent)({editor:t,content:{type:"chart",attrs:{chartType:e.chartType,id:i,data:(0,P.getSampleChartData)(e.chartType)||{}}}})},dragEndFn:e=>{e.commands.editSelectedChart()},...e}));e.s(["DiagramCommands",()=>d9],683164);var N=e.i(921679),R=e.i(191788),O=Object.defineProperty,B=(e,t,i)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?O(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,i},z=class{static clamp(e,t,i){return Math.max(t,void 0!==i?Math.min(e,i):e)}static clampV(e,t,i){return e.map(e=>i?z.clamp(e,t,i):z.clamp(e,t))}static cross(e,t,i){return(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])}static snap(e,t=1){return[Math.round(e[0]/t)*t,Math.round(e[1]/t)*t]}};B(z,"neg",e=>[-e[0],-e[1]]),B(z,"add",(e,t)=>[e[0]+t[0],e[1]+t[1]]),B(z,"addScalar",(e,t)=>[e[0]+t,e[1]+t]),B(z,"sub",(e,t)=>[e[0]-t[0],e[1]-t[1]]),B(z,"subScalar",(e,t)=>[e[0]-t,e[1]-t]),B(z,"vec",(e,t)=>[t[0]-e[0],t[1]-e[1]]),B(z,"mul",(e,t)=>[e[0]*t,e[1]*t]),B(z,"mulV",(e,t)=>[e[0]*t[0],e[1]*t[1]]),B(z,"div",(e,t)=>[e[0]/t,e[1]/t]),B(z,"divV",(e,t)=>[e[0]/t[0],e[1]/t[1]]),B(z,"per",e=>[e[1],-e[0]]),B(z,"dpr",(e,t)=>e[0]*t[0]+e[1]*t[1]),B(z,"cpr",(e,t)=>e[0]*t[1]-t[0]*e[1]),B(z,"len2",e=>e[0]*e[0]+e[1]*e[1]),B(z,"len",e=>Math.hypot(e[0],e[1])),B(z,"pry",(e,t)=>z.dpr(e,t)/z.len(t)),B(z,"uni",e=>z.div(e,z.len(e))),B(z,"normalize",e=>z.uni(e)),B(z,"tangent",(e,t)=>z.uni(z.sub(e,t))),B(z,"dist2",(e,t)=>z.len2(z.sub(e,t))),B(z,"dist",(e,t)=>Math.hypot(e[1]-t[1],e[0]-t[0])),B(z,"fastDist",(e,t)=>{let i=[t[0]-e[0],t[1]-e[1]],n=[Math.abs(i[0]),Math.abs(i[1])],a=1/Math.max(n[0],n[1]);return[i[0]*(a*=1.29289-(n[0]+n[1])*a*.29289),i[1]*a]}),B(z,"ang",(e,t)=>Math.atan2(z.cpr(e,t),z.dpr(e,t))),B(z,"angle",(e,t)=>Math.atan2(t[1]-e[1],t[0]-e[0])),B(z,"med",(e,t)=>z.mul(z.add(e,t),.5)),B(z,"rot",(e,t=0)=>[e[0]*Math.cos(t)-e[1]*Math.sin(t),e[0]*Math.sin(t)+e[1]*Math.cos(t)]),B(z,"rotWith",(e,t,i=0)=>{if(0===i)return e;let n=Math.sin(i),a=Math.cos(i),r=e[0]-t[0],o=e[1]-t[1];return[r*a-o*n+t[0],r*n+o*a+t[1]]}),B(z,"isEqual",(e,t)=>e[0]===t[0]&&e[1]===t[1]),B(z,"lrp",(e,t,i)=>z.add(e,z.mul(z.sub(t,e),i))),B(z,"int",(e,t,i,n,a=1)=>{let r=(z.clamp(i,n)-i)/(n-i);return z.add(z.mul(e,1-r),z.mul(t,a))}),B(z,"ang3",(e,t,i)=>{let n=z.vec(t,e),a=z.vec(t,i);return z.ang(n,a)}),B(z,"abs",e=>[Math.abs(e[0]),Math.abs(e[1])]),B(z,"rescale",(e,t)=>{let i=z.len(e);return[t*e[0]/i,t*e[1]/i]}),B(z,"isLeft",(e,t,i)=>(t[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(t[1]-e[1])),B(z,"clockwise",(e,t,i)=>z.isLeft(e,t,i)>0),B(z,"toFixed",e=>e.map(e=>Math.round(100*e)/100)),B(z,"nearestPointOnLineThroughPoint",(e,t,i)=>z.add(e,z.mul(t,z.pry(z.sub(i,e),t)))),B(z,"distanceToLineThroughPoint",(e,t,i)=>z.dist(i,z.nearestPointOnLineThroughPoint(e,t,i))),B(z,"nearestPointOnLineSegment",(e,t,i,n=!0)=>{let a=z.uni(z.sub(t,e)),r=z.add(e,z.mul(a,z.pry(z.sub(i,e),a)));if(n){if(r[0]Math.max(e[0],t[0]))return e[0]>t[0]?e:t;if(r[1]Math.max(e[1],t[1]))return e[1]>t[1]?e:t}return r}),B(z,"distanceToLineSegment",(e,t,i,n=!0)=>z.dist(i,z.nearestPointOnLineSegment(e,t,i,n))),B(z,"nearestPointOnBounds",(e,t)=>[z.clamp(t[0],e.minX,e.maxX),z.clamp(t[1],e.minY,e.maxY)]),B(z,"distanceToBounds",(e,t)=>z.dist(t,z.nearestPointOnBounds(e,t))),B(z,"nudge",(e,t,i)=>z.isEqual(e,t)?e:z.add(e,z.mul(z.uni(z.sub(t,e)),i))),B(z,"nudgeAtAngle",(e,t,i)=>[Math.cos(t)*i+e[0],Math.sin(t)*i+e[1]]),B(z,"toPrecision",(e,t=4)=>[+e[0].toPrecision(t),+e[1].toPrecision(t)]),B(z,"pointsBetween",(e,t,i=6)=>Array.from(Array(i)).map((n,a)=>{let r=a/(i-1),o=Math.min(1,.5+Math.abs(.5-r));return[...z.lrp(e,t,r),o]})),B(z,"slope",(e,t)=>e[0]===t[0]?NaN:(e[1]-t[1])/(e[0]-t[0])),B(z,"max",(...e)=>[Math.max(...e.map(e=>e[0])),Math.max(...e.map(e=>e[1]))]),B(z,"min",(...e)=>[Math.min(...e.map(e=>e[0])),Math.min(...e.map(e=>e[1]))]),e.i(350461);let F={toVector:(e,t)=>(void 0===e&&(e=t),Array.isArray(e)?e:[e,e]),add:(e,t)=>[e[0]+t[0],e[1]+t[1]],sub:(e,t)=>[e[0]-t[0],e[1]-t[1]],addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function H(e,t,i){return 0===t||Math.abs(t)===1/0?Math.pow(e,5*i):e*t*i/(t+i*e)}function W(e,t,i,n=.15){return 0===n?Math.max(t,Math.min(e,i)):ei?+H(e-i,i-t,n)+i:e}function U(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function V(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function G(e){for(var t=1;tt.includes(e.identifier));return J(i,n)}function et(e){let t=Q(e);return Y(e)?t.identifier:t.pointerId}function ei(e){let t=Q(e);return[t.clientX,t.clientY]}function en(e){let{deltaX:t,deltaY:i,deltaMode:n}=e;return 1===n?(t*=40,i*=40):2===n&&(t*=800,i*=800),[t,i]}function ea(e,...t){return"function"==typeof e?e(...t):e}function er(){}function eo(e,t){return Object.assign({},t,e||{})}class es{constructor(e,t,i){this.ctrl=e,this.args=t,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){let{state:e,shared:t,ingKey:i,args:n}=this;t[i]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=n,e.axis=void 0,e.memo=void 0,e.elapsedTime=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){let t=this.state,i=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=i.from?ea(i.from,t):t.offset,t.offset=t.lastOffset),t.startTime=t.timeStamp=e.timeStamp}computeValues(e){let t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){let e=this.state;e._initial=e._values,e.initial=e.values}compute(e){let{state:t,config:i,shared:n}=this;t.args=this.args;let a=0;if(e&&(t.event=e,i.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,function(e){let t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){let{shiftKey:i,altKey:n,metaKey:a,ctrlKey:r}=e;Object.assign(t,{shiftKey:i,altKey:n,metaKey:a,ctrlKey:r})}return t}(e)),n.down=n.pressed=n.buttons%2==1||n.touches>0,a=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){let e=t._delta.map(Math.abs);F.addTo(t._distance,e)}this.axisIntent&&this.axisIntent(e);let[r,o]=t._movement,[s,l]=i.threshold,{_step:d,values:c}=t;if(i.hasCustomTransform?(!1===d[0]&&(d[0]=Math.abs(r)>=s&&c[0]),!1===d[1]&&(d[1]=Math.abs(o)>=l&&c[1])):(!1===d[0]&&(d[0]=Math.abs(r)>=s&&Math.sign(r)*s),!1===d[1]&&(d[1]=Math.abs(o)>=l&&Math.sign(o)*l)),t.intentional=!1!==d[0]||!1!==d[1],!t.intentional)return;let u=[0,0];if(i.hasCustomTransform){let[e,t]=c;u[0]=!1!==d[0]?e-d[0]:0,u[1]=!1!==d[1]?t-d[1]:0}else u[0]=!1!==d[0]?r-d[0]:0,u[1]=!1!==d[1]?o-d[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(u);let p=t.offset,h=t._active&&!t._blocked||t.active;h&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=n[this.ingKey]=t._active,e&&(t.first&&("bounds"in i&&(t._bounds=ea(i.bounds,t)),this.setup&&this.setup()),t.movement=u,this.computeOffset()));let[m,g]=t.offset,[[f,b],[x,y]]=t._bounds;t.overflow=[mb),gy)],t._movementBound[0]=!!t.overflow[0]&&(!1===t._movementBound[0]?t._movement[0]:t._movementBound[0]),t._movementBound[1]=!!t.overflow[1]&&(!1===t._movementBound[1]?t._movement[1]:t._movementBound[1]);let v=t._active&&i.rubberband||[0,0];if(t.offset=function(e,[t,i],[n,a]){let[[r,o],[s,l]]=e;return[W(t,r,o,n),W(i,s,l,a)]}(t._bounds,t.offset,v),t.delta=F.sub(t.offset,p),this.computeMovement(),h&&(!t.last||a>32)){t.delta=F.sub(t.offset,p);let e=t.delta.map(Math.abs);F.addTo(t.distance,e),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&a>0&&(t.velocity=[e[0]/a,e[1]/a])}}emit(){let e=this.state,t=this.shared,i=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!i.triggerAllEvents)return;let n=this.handler(G(G(G({},t),e),{},{[this.aliasKey]:e.values}));void 0!==n&&(e.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}class el extends es{constructor(...e){super(...e),U(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=F.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=F.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){let t=this.state,i=this.config;if(!t.axis&&e){let n="object"==typeof i.axisThreshold?i.axisThreshold[X(e)]:i.axisThreshold;t.axis=function([e,t],i){let n=Math.abs(e),a=Math.abs(t);return n>a&&n>i?"x":a>n&&a>i?"y":void 0}(t._movement,n)}t._blocked=(i.lockDirection||!!i.axis)&&!t.axis||!!i.axis&&i.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0}}}let ed=e=>e,ec={enabled:(e=!0)=>e,eventOptions:(e,t,i)=>G(G({},i.shared.eventOptions),e),preventDefault:(e=!1)=>e,triggerAllEvents:(e=!1)=>e,rubberband(e=0){switch(e){case!0:return[.15,.15];case!1:return[0,0];default:return F.toVector(e)}},from:e=>"function"==typeof e?e:null!=e?F.toVector(e):void 0,transform(e,t,i){let n=e||i.shared.transform;return this.hasCustomTransform=!!n,n||ed},threshold:e=>F.toVector(e,0)},eu=0,ep=G(G({},ec),{},{axis(e,t,{axis:i}){if(this.lockDirection="lock"===i,!this.lockDirection)return i},axisThreshold:(e=eu)=>e,bounds(e={}){if("function"==typeof e)return t=>ep.bounds(e(t));if("current"in e)return()=>e.current;if("function"==typeof HTMLElement&&e instanceof HTMLElement)return e;let{left:t=-1/0,right:i=1/0,top:n=-1/0,bottom:a=1/0}=e;return[[t,i],[n,a]]}}),eh={ArrowRight:(e=1)=>[10*e,0],ArrowLeft:(e=1)=>[-10*e,0],ArrowUp:(e=1)=>[0,-10*e],ArrowDown:(e=1)=>[0,10*e]},em="u">typeof window&&window.document&&window.document.createElement;function eg(){return em&&"ontouchstart"in window||em&&window.navigator.maxTouchPoints>1}let ef={isBrowser:em,gesture:function(){try{return"constructor"in GestureEvent}catch(e){return!1}}(),touch:eg(),touchscreen:eg(),pointer:em&&"onpointerdown"in window,pointerLock:em&&"exitPointerLock"in window.document},eb={mouse:0,touch:0,pen:8},ex=G(G({},ep),{},{device(e,t,{pointer:{touch:i=!1,lock:n=!1,mouse:a=!1}={}}){return(this.pointerLock=n&&ef.pointerLock,ef.touch&&i)?"touch":this.pointerLock?"mouse":ef.pointer&&!a?"pointer":ef.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:i}){if(this.preventScrollDelay="number"==typeof i?i:i||void 0===i&&e?250:void 0,ef.touchscreen&&!1!==i)return e||(void 0!==i?"y":void 0)},pointerCapture(e,t,{pointer:{capture:i=!0,buttons:n=1}={}}){return this.pointerButtons=n,!this.pointerLock&&"pointer"===this.device&&i},keys:(e=!0)=>e,threshold(e,t,{filterTaps:i=!1,tapsThreshold:n=3,axis:a}){let r=F.toVector(e,i?n:+!!a);return this.filterTaps=i,this.tapsThreshold=n,r},swipe({velocity:e=.5,distance:t=50,duration:i=250}={}){return{velocity:this.transform(F.toVector(e)),distance:this.transform(F.toVector(t)),duration:i}},delay(e=0){switch(e){case!0:return 180;case!1:return 0;default:return e}},axisThreshold:e=>e?G(G({},eb),e):eb}),ey=G(G({},ec),{},{device(e,t,{shared:i,pointer:{touch:n=!1}={}}){if(i.target&&!ef.touch&&ef.gesture)return"gesture";if(ef.touch&&n)return"touch";if(ef.touchscreen){if(ef.pointer)return"pointer";if(ef.touch)return"touch"}},bounds(e,t,{scaleBounds:i={},angleBounds:n={}}){let a=e=>{let t=eo(ea(i,e),{min:-1/0,max:1/0});return[t.min,t.max]},r=e=>{let t=eo(ea(n,e),{min:-1/0,max:1/0});return[t.min,t.max]};return"function"!=typeof i&&"function"!=typeof n?[a(),r()]:e=>[a(e),r(e)]},threshold(e,t,i){return this.lockDirection="lock"===i.axis,F.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey:e=>void 0===e?"ctrlKey":e}),ev=G(G({},ep),{},{mouseOnly:(e=!0)=>e}),eC=G(G({},ep),{},{mouseOnly:(e=!0)=>e}),ew=new Map,eS=new Map;function ek(e){ew.set(e.key,e.engine),eS.set(e.key,e.resolver)}let eA={key:"drag",engine:class extends el{constructor(...e){super(...e),U(this,"ingKey","dragging")}reset(){super.reset();let e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){let e=this.state;if(e._bounds instanceof HTMLElement){let t=e._bounds.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),n={left:t.left-i.left+e.offset[0],right:t.right-i.right+e.offset[0],top:t.top-i.top+e.offset[1],bottom:t.bottom-i.bottom+e.offset[1]};e._bounds=ep.bounds(n)}}cancel(){let e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){let t=this.config,i=this.state;if(null!=e.buttons&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):-1!==t.pointerButtons&&t.pointerButtons!==e.buttons))return;let n=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),n&&n.size>1&&i._pointerActive||(this.start(e),this.setupPointer(e),i._pointerId=et(e),i._pointerActive=!0,this.computeValues(ei(e)),this.computeInitial(),t.preventScrollAxis&&"mouse"!==X(e)?(i._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){let t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){let t=this.state,i=this.config;if(!t._pointerActive||t.type===e.type&&e.timeStamp===t.timeStamp)return;let n=et(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;let a=ei(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=F.sub(a,t._values),this.computeValues(a)),F.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(i.preventScrollAxis&&!t._preventScroll)if(!t.axis)return;else if(t.axis===i.preventScrollAxis||"xy"===i.preventScrollAxis){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch(e){}let t=this.state,i=this.config;if(!t._active||!t._pointerActive)return;let n=et(e);if(void 0!==t._pointerId&&n!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);let[a,r]=t._distance;if(t.tap=a<=i.tapsThreshold&&r<=i.tapsThreshold,t.tap&&i.filterTaps)t._force=!0;else{let[e,n]=t.direction,[a,r]=t.velocity,[o,s]=t.movement,[l,d]=i.swipe.velocity,[c,u]=i.swipe.distance,p=i.swipe.duration;t.elapsedTimel&&Math.abs(o)>c&&(t.swipe[0]=e),Math.abs(r)>d&&Math.abs(s)>u&&(t.swipe[1]=n))}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){let t=this.config,i=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){var t;this.state._preventScroll=!1,"persist"in(t=e)&&"function"==typeof t.persist&&t.persist();let i=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",i),this.eventStore.add(this.sharedConfig.window,"touch","cancel",i),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){let t=eh[e.key];if(t){let i=this.state,n=e.shiftKey?10:e.altKey?.1:1;this.start(e),i._delta=t(n),i._keyboardActive=!0,F.addTo(i._movement,i._delta),this.compute(e),this.emit()}}keyUp(e){e.key in eh&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){let t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}},resolver:ex},eE={key:"hover",engine:class extends el{constructor(...e){super(...e),U(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.start(e),this.computeValues(ei(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&"mouse"!==e.pointerType)return;let t=this.state;if(!t._active)return;t._active=!1;let i=ei(e);t._movement=t._delta=F.sub(i,t._values),this.computeValues(i),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}},resolver:eC},e_={key:"move",engine:class extends el{constructor(...e){super(...e),U(this,"ingKey","moving")}move(e){this.config.mouseOnly&&"mouse"!==e.pointerType||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(ei(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;let t=ei(e),i=this.state;i._delta=F.sub(t,i._values),F.addTo(i._movement,i._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}},resolver:ev},eI={key:"pinch",engine:class extends es{constructor(...e){super(...e),U(this,"ingKey","pinching"),U(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();let e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){let{type:e,movement:t,lastOffset:i}=this.state;"wheel"===e?this.state.offset=F.add(t,i):this.state.offset=[(1+t[0])*i[0],t[1]+i[1]]}computeMovement(){let{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){let e=this.state,[t,i]=e._movement;if(!e.axis){let n=30*Math.abs(t)-Math.abs(i);n<0?e.axis="angle":n>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&("scale"===this.state.axis?e[1]=0:"angle"===this.state.axis&&(e[0]=0))}cancel(){let e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);let t=this.state,i=this.ctrl.touchIds;if(t._active&&t._touchIds.every(e=>i.has(e))||i.size<2)return;this.start(e),t._touchIds=Array.from(i).slice(0,2);let n=ee(e,t._touchIds);this.pinchStart(e,n)}pointerStart(e){if(null!=e.buttons&&e.buttons%2!=1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);let t=this.state,i=t._pointerEvents,n=this.ctrl.pointerIds;if(t._active&&Array.from(i.keys()).every(e=>n.has(e))||(i.size<2&&i.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);let a=J(...Array.from(i.values()));this.pinchStart(e,a)}pinchStart(e,t){this.state.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;let t=ee(e,this.state._touchIds);this.pinchMove(e,t)}pointerMove(e){let t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;let i=J(...Array.from(t.values()));this.pinchMove(e,i)}pinchMove(e,t){let i=this.state,n=i._values[1],a=t.angle-n,r=0;Math.abs(a)>270&&(r+=Math.sign(a)),this.computeValues([t.distance,t.angle-360*r]),i.origin=t.origin,i.turns=r,i._movement=[i._values[0]/i._initial[0]-1,i._values[1]-i._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(e=>!this.ctrl.touchIds.has(e))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){let t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch(e){}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();let t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;let t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];let i=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=F.sub(t._movement,i),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){let t=this.config.modifierKey;(!t||e[t])&&(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();let t=this.state;t._delta=[-en(e)[1]/100*t.offset[0],0],F.addTo(t._movement,t._delta),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){let t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this))),e("wheel","",this.wheel.bind(this),{passive:!1})}},resolver:ey},eM={key:"scroll",engine:class extends el{constructor(...e){super(...e),U(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();let t=this.state,i=function(e){var t,i;let{scrollX:n,scrollY:a,scrollLeft:r,scrollTop:o}=e.currentTarget;return[null!=(t=null!=n?n:r)?t:0,null!=(i=null!=a?a:o)?i:0]}(e);t._delta=F.sub(i,t._values),F.addTo(t._movement,t._delta),this.computeValues(i),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}},resolver:ep},eT={key:"wheel",engine:class extends el{constructor(...e){super(...e),U(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){let t=this.state;t._delta=en(e),F.addTo(t._movement,t._delta);let[i,n]=t.overflow,[a,r]=t._delta,[o,s]=t._direction;(i<0&&a>0&&o<0||i>0&&a<0&&o>0)&&(t._movement[0]=t._movementBound[0]),(n<0&&r>0&&s<0||n>0&&r<0&&s>0)&&(t._movement[1]=t._movementBound[1]),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}},resolver:ep},eL={target(e){if(e)return()=>"current"in e?e.current:e},enabled:(e=!0)=>e,window:(e=ef.isBrowser?window:void 0)=>e,eventOptions:({passive:e=!0,capture:t=!1}={})=>({passive:e,capture:t}),transform:e=>e},ej=["target","eventOptions","window","enabled","transform"];function eP(e={},t){let i={};for(let[n,a]of Object.entries(t))switch(typeof a){case"function":i[n]=a.call(i,e[n],n,e);break;case"object":i[n]=eP(e[n],a);break;case"boolean":a&&(i[n]=e[n])}return i}class eD{constructor(e,t){U(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,i,n,a){let r=this._listeners,o=function(e,t=""){let i=$[e];return e+(i&&i[t]||t)}(t,i),s=G(G({},this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{}),a);e.addEventListener(o,n,s);let l=()=>{e.removeEventListener(o,n,s),r.delete(l)};return r.add(l),l}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class eN{constructor(){U(this,"_timeouts",new Map)}add(e,t,i=140,...n){this.remove(e),this._timeouts.set(e,window.setTimeout(t,i,...n))}remove(e){let t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}class eR{constructor(e){U(this,"gestures",new Set),U(this,"_targetEventStore",new eD(this)),U(this,"gestureEventStores",{}),U(this,"gestureTimeoutStores",{}),U(this,"handlers",{}),U(this,"config",{}),U(this,"pointerIds",new Set),U(this,"touchIds",new Set),U(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),function(e,t){t.drag&&eO(e,"drag"),t.wheel&&eO(e,"wheel"),t.scroll&&eO(e,"scroll"),t.move&&eO(e,"move"),t.pinch&&eO(e,"pinch"),t.hover&&eO(e,"hover")}(this,e)}setEventIds(e){if(Y(e))return this.touchIds=new Set(Array.from(e.touches).filter(t=>{var i,n;return t.target===e.currentTarget||(null==(i=e.currentTarget)||null==(n=i.contains)?void 0:n.call(i,t.target))}).map(e=>e.identifier)),this.touchIds;if("pointerId"in e)return"pointerup"===e.type||"pointercancel"===e.type?this.pointerIds.delete(e.pointerId):"pointerdown"===e.type&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=function(e,t){let{target:i,eventOptions:n,window:a,enabled:r,transform:o}=e,s=function(e,t){if(null==e)return{};var i,n,a=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(a[i]=e[i])}return a}(e,ej),l={shared:eP({target:i,eventOptions:n,window:a,enabled:r,transform:o},eL)};if(t){let e=eS.get(t);l[t]=eP(G({shared:l.shared},s),e)}else for(let e in s){let t=eS.get(e);t&&(l[e]=eP(G({shared:l.shared},s[e]),t))}return l}(e,t)}clean(){for(let e of(this._targetEventStore.clean(),this.gestures))this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){let t,i=this.config.shared,n={};if(!i.target||(t=i.target())){if(i.enabled){for(let i of this.gestures){let a=this.config[i],r=eB(n,a.eventOptions,!!t);a.enabled&&new(ew.get(i))(this,e,i).bind(r)}let a=eB(n,i.eventOptions,!!t);for(let t in this.nativeHandlers)a(t,"",i=>this.nativeHandlers[t](G(G({},this.state.shared),{},{event:i,args:e})),void 0,!0)}for(let e in n)n[e]=function(...e){return 0===e.length?er:1===e.length?e[0]:function(){let t;for(let i of e)t=i.apply(this,arguments)||t;return t}}(...n[e]);if(!t)return n;for(let e in n){let{device:i,capture:a,passive:r}=function(e){let t=e.substring(2).toLowerCase(),i=!!~t.indexOf("passive");i&&(t=t.replace("passive",""));let n=q.includes(t)?"capturecapture":"capture",a=!!~t.indexOf(n);return a&&(t=t.replace("capture","")),{device:t,capture:a,passive:i}}(e);this._targetEventStore.add(t,i,"",n[e],{capture:a,passive:r})}}}}function eO(e,t){e.gestures.add(t),e.gestureEventStores[t]=new eD(e,t),e.gestureTimeoutStores[t]=new eN}let eB=(e,t,i)=>(n,a,r,o={},s=!1)=>{var l,d;let c=null!=(l=o.capture)?l:t.capture,u=null!=(d=o.passive)?d:t.passive,p=s?n:function(e,t="",i=!1){let n=$[e],a=n&&n[t]||t;return"on"+Z(e)+Z(a)+(!function(e=!1,t){return e&&!K.includes(t)}(i,a)?"":"Capture")}(n,a,c);i&&u&&(p+="Passive"),e[p]=e[p]||[],e[p].push(r)},ez=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function eF(e,t,i,n,a,r){if(!e.has(i)||!ew.has(n))return;let o=i+"Start",s=i+"End";a[n]=e=>{let n;return e.first&&o in t&&t[o](e),i in t&&(n=t[i](e)),e.last&&s in t&&t[s](e),n},r[n]=r[n]||{}}function eH(e,t,i,n=e=>e){return e*n(.5-t*(.5-i))}function eW(e,t){return[e[0]+t[0],e[1]+t[1]]}function eU(e,t){return[e[0]-t[0],e[1]-t[1]]}function eV(e,t){return[e[0]*t,e[1]*t]}function eG(e){return[e[1],-e[0]]}function e$(e,t){var i;return(i=eU(e,t))[0]*i[0]+i[1]*i[1]}function eZ(e){var t;return t=Math.hypot(e[0],e[1]),[e[0]/t,e[1]/t]}function eK(e,t,i){let n=Math.sin(i),a=Math.cos(i),r=e[0]-t[0],o=e[1]-t[1];return[r*a-o*n+t[0],r*n+o*a+t[1]]}function eq(e,t,i){return eW(e,eV(eU(t,e),i))}var{min:eY,PI:eX}=Math,eQ=eX+1e-4,eJ=Object.defineProperty,e0=Object.defineProperties,e1=Object.getOwnPropertyDescriptors,e2=Object.getOwnPropertySymbols,e3=Object.prototype.hasOwnProperty,e5=Object.prototype.propertyIsEnumerable,e4=(e,t,i)=>t in e?eJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,e6=(e,t)=>{for(var i in t||(t={}))e3.call(t,i)&&e4(e,i,t[i]);if(e2)for(var i of e2(t))e5.call(t,i)&&e4(e,i,t[i]);return e};function e9(e,...t){return{didIntersect:t.length>0,message:e,points:t}}function e8(e,t,i=0){let n=[e[0]+t[0]/2,e[1]+t[1]/2],a=z.rotWith(e,n,i),r=z.rotWith(z.add(e,[t[0],0]),n,i),o=z.rotWith(z.add(e,t),n,i),s=z.rotWith(z.add(e,[0,t[1]]),n,i);return[["top",[a,r]],["right",[r,o]],["bottom",[o,s]],["left",[s,a]]]}function e7(e,t,i,n){let[a,r]=e,[o,s]=t,[l,d]=i,[c,u]=n;if(s/o!=(u-d)/(c-l)){let e=o*(u-d)-s*(c-l);if(0!==e){let t=((r-d)*(c-l)-(a-l)*(u-d))/e,i=((r-d)*o-(a-l)*s)/e;if(t>=0&&i>=0&&i<=1)return e9("intersection",[a+t*o,r+t*s])}}return e9("no intersection")}function te(e,t,i,n,a,r){return ta(e,z.mul(t,0x3b9ac9ff),i,n,a,r)}function tt(e,t,i,n=0){let{minX:a,minY:r,width:o,height:s}=i;return function(e,t,i,n,a=0){var r,o,s,l,d;return r=i,o=n,s=a,l=e,d=t,e8(r,o,s).reduce((e,[t,[i,n]])=>{let a=e7(l,d,i,n);return e.push(e9(t,...a.points)),e},[]).filter(e=>e.didIntersect)}(e,t,[a,r],[o,s],n)}function ti(e,t,i,n){let a=z.sub(e,i),r=z.sub(n,i),o=z.sub(t,e),s=r[0]*a[1]-r[1]*a[0],l=o[0]*a[1]-o[1]*a[0],d=r[1]*o[0]-r[0]*o[1];if(0===s||0===l)return e9("coincident");if(0===d)return e9("parallel");if(0!==d){let t=s/d,i=l/d;if(0<=t&&t<=1&&0<=i&&i<=1)return e9("intersection",z.add(e,z.mul(o,t)))}return e9("no intersection")}function tn(e,t,i,n){let a=(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]),r=2*((t[0]-e[0])*(e[0]-i[0])+(t[1]-e[1])*(e[1]-i[1])),o=r*r-4*a*(i[0]*i[0]+i[1]*i[1]+e[0]*e[0]+e[1]*e[1]-2*(i[0]*e[0]+i[1]*e[1])-n*n);if(o<0)return e9("outside");if(0===o)return e9("tangent");let s=Math.sqrt(o),l=(-r+s)/(2*a),d=(-r-s)/(2*a);if((l<0||l>1)&&(d<0||d>1))if(l<0&&d<0||l>1&&d>1)return e9("outside");else return e9("inside");let c=[];return 0<=l&&l<=1&&c.push(z.lrp(e,t,l)),0<=d&&d<=1&&c.push(z.lrp(e,t,d)),e9("intersection",...c)}function ta(e,t,i,n,a,r=0){if(0===n||0===a||z.isEqual(e,t))return e9("no intersection");n=n<0?n:-n,a=a<0?a:-a,e=z.sub(z.rotWith(e,i,-r),i),t=z.sub(z.rotWith(t,i,-r),i);let o=z.sub(t,e),s=o[0]*o[0]/n/n+o[1]*o[1]/a/a,l=2*e[0]*o[0]/n/n+2*e[1]*o[1]/a/a,d=e[0]*e[0]/n/n+e[1]*e[1]/a/a-1,c=[],u=l*l-4*s*d;if(0===u)c.push(-l/2/s);else if(u>0){let e=Math.sqrt(u);c.push((-l+e)/2/s),c.push((-l-e)/2/s)}return e9("intersection",...c.filter(e=>e>=0&&e<=1).map(n=>z.add(i,z.add(e,z.mul(z.sub(t,e),n)))).map(e=>z.rotWith(e,i,r)))}function tr(e,t,i){let n=[];for(let a=1;a{let o=ti(i,n,a,r);return e.push(e9(t,...o.points)),e},[]).filter(e=>e.didIntersect)}function ts(e,t,i){let{minX:n,minY:a,width:r,height:o}=e;return to([n,a],[r,o],t,i)}function tl(e,t){var i,n;return i=[t.minX,t.minY],n=[t.width,t.height],e8(i,n).reduce((t,[i,[n,a]])=>{let r=tr(n,a,e);return r.didIntersect&&t.push(e9(i,...r.points)),t},[]).filter(e=>e.didIntersect)}function td(e,t){var i,n;return i=[t.minX,t.minY],n=[t.width,t.height],e8(i,n).reduce((t,[i,[n,a]])=>{let r=function(e,t,i){let n=[];for(let a=1;ae.didIntersect)}var tc=Object.defineProperty,tu=Object.defineProperties,tp=Object.getOwnPropertyDescriptors,th=Object.getOwnPropertySymbols,tm=Object.prototype.hasOwnProperty,tg=Object.prototype.propertyIsEnumerable,tf=(e,t,i)=>t in e?tc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,tb=(e,t)=>{for(var i in t||(t={}))tm.call(t,i)&&tf(e,i,t[i]);if(th)for(var i of th(t))tg.call(t,i)&&tf(e,i,t[i]);return e},tx=(e,t)=>{var i={};for(var n in e)tm.call(e,n)&&0>t.indexOf(n)&&(i[n]=e[n]);if(null!=e&&th)for(var n of th(e))0>t.indexOf(n)&&tg.call(e,n)&&(i[n]=e[n]);return i},ty=(e,t,i)=>(tf(e,"symbol"!=typeof t?t+"":t,i),i),tv=R.createContext({});function tC(){return R.useContext(tv)}var tw=((i=tw||{}).TransformSelected="transform_selected",i.TranslateSelected="translate_selected",i.TransformAll="transform_all",i.TranslateAll="translate_all",i),tS=((n=tS||{}).Top="top_edge",n.Right="right_edge",n.Bottom="bottom_edge",n.Left="left_edge",n),tk=((a=tk||{}).TopLeft="top_left_corner",a.TopRight="top_right_corner",a.BottomRight="bottom_right_corner",a.BottomLeft="bottom_left_corner",a),tA=((r=tA||{}).minX="minX",r.midX="midX",r.maxX="maxX",r.minY="minY",r.midY="midY",r.maxY="maxY",r);String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return"[object regexp]"===Object.prototype.toString.call(e).toLowerCase()?this.replace(e,t):this.replace(RegExp(e,"g"),t)});var tE=2*Math.PI,t_=class{static lerp(e,t,i){return e*(1-(i=t_.clamp(i,0,1)))+t*i}static lerpColor(e,t,i=.5){function n(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}let a=n(e)||[0,0,0],r=n(t)||[0,0,0],o=a.slice();for(let e=0;e<3;e++)o[e]=Math.round(o[e]+i*(r[e]-a[e]));return"#"+(0x1000000+(o[0]<<16)+(o[1]<<8)+o[2]).toString(16).slice(1)}static modulate(e,t,i,n=!1){let[a,r]=t,[o,s]=i,l=o+(e-a)/(r-a)*(s-o);return n?ot[i]="object"==typeof e[i]?t_.deepClone(e[i]):e[i]),t}return e}static rng(e=""){let t=0,i=0,n=0,a=0;function r(){let e=t^t<<11;return t=i,i=n,n=a,(a^=(a>>>19^e^e>>>8)>>>0)/0x100000000}for(let i=0;in}static degreesToRadians(e){return e*Math.PI/180}static radiansToDegrees(e){return 180*e/Math.PI}static getArcLength(e,t,i,n){return 2*Math.PI*t*(t_.getSweep(e,i,n)/(2*Math.PI))}static getSweepFlag(e,t,i){let n=z.angle(e,i);return(z.angle(e,t)-n+3*Math.PI)%(2*Math.PI)-Math.PI>0?0:1}static getLargeArcFlag(e,t,i){let n=z.angle(i,e);return Math.abs((z.angle(i,t)-n+3*Math.PI)%(2*Math.PI)-Math.PI)>Math.PI/2?0:1}static getArcDashOffset(e,t,i,n,a){let r=t_.getSweepFlag(e,i,n),o=t_.getArcLength(e,t,i,n);return-(r<0?o:2*Math.PI*e[2]-o)/2+a}static getEllipseDashOffset(e,t){return-(2*Math.PI*e[2])/2+-t}static pointInCircle(e,t,i){return z.dist(e,t)<=i}static pointInEllipse(e,t,i,n,a=0){let r=Math.cos(a=a||0),o=Math.sin(a),s=z.sub(e,t),l=r*s[0]+o*s[1],d=o*s[0]-r*s[1];return l*l/(i*i)+d*d/(n*n)<=1}static pointInRect(e,t){return!(e[0]e[0]+t[0]||e[1]e[1]+t[1])}static pointInPolygon(e,t){let i=0;return t.forEach((n,a)=>{let r=t[(a+1)%t.length];n[1]<=e[1]?r[1]>e[1]&&z.cross(n,r,e)>0&&(i+=1):r[1]<=e[1]&&0>z.cross(n,r,e)&&(i-=1)}),0!==i}static pointInBounds(e,t){return!(e[0]t.maxX||e[1]t.maxY)}static pointInPolyline(e,t,i=3){for(let n=1;nt.maxX||e.maxYt.maxY)}static boundsContain(e,t){return e.minXt.maxY&&e.maxX>t.maxX}static boundsContained(e,t){return t_.boundsContain(t,e)}static boundsAreEqual(e,t){return t.maxX===e.maxX&&t.minX===e.minX&&t.maxY===e.maxY&&t.minY===e.minY}static getBoundsFromPoints(e,t=0){let i=1/0,n=1/0,a=-1/0,r=-1/0;if(e.length<2)i=0,n=0,a=1,r=1;else for(let[t,o]of e)i=Math.min(t,i),n=Math.min(o,n),a=Math.max(t,a),r=Math.max(o,r);return 0!==t?t_.getBoundsFromPoints(e.map(e=>z.rotWith(e,[(i+a)/2,(n+r)/2],t))):{minX:i,minY:n,maxX:a,maxY:r,width:Math.max(1,a-i),height:Math.max(1,r-n)}}static centerBounds(e,t){let i=this.getBoundsCenter(e),n=t[0]-i[0],a=t[1]-i[1];return this.translateBounds(e,[n,a])}static snapBoundsToGrid(e,t){let i=Math.round(e.minX/t)*t,n=Math.round(e.minY/t)*t,a=Math.round(e.maxX/t)*t,r=Math.round(e.maxY/t)*t;return{minX:i,minY:n,maxX:a,maxY:r,width:Math.max(1,a-i),height:Math.max(1,r-n)}}static translateBounds(e,t){return{minX:e.minX+t[0],minY:e.minY+t[1],maxX:e.maxX+t[0],maxY:e.maxY+t[1],width:e.width,height:e.height}}static rotateBounds(e,t,i){let[n,a]=z.rotWith([e.minX,e.minY],t,i),[r,o]=z.rotWith([e.maxX,e.maxY],t,i);return{minX:n,minY:a,maxX:r,maxY:o,width:e.width,height:e.height}}static getRotatedEllipseBounds(e,t,i,n,a=0){let r=Math.cos(a),o=Math.sin(a),s=Math.hypot(i*r,n*o),l=Math.hypot(i*o,n*r);return{minX:e+i-s,minY:t+n-l,maxX:e+i+s,maxY:t+n+l,width:2*s,height:2*l}}static getExpandedBounds(e,t){let i=Math.min(e.minX,t.minX),n=Math.min(e.minY,t.minY),a=Math.max(e.maxX,t.maxX),r=Math.max(e.maxY,t.maxY),o=Math.abs(a-i),s=Math.abs(r-n);return{minX:i,minY:n,maxX:a,maxY:r,width:o,height:s}}static getCommonBounds(e){if(e.length<2)return e[0];let t=e[0];for(let i=1;iz.rotWith(e,i,t))}static getTransformedBoundingBox(e,t,i,n=0,a=!1){let[r,o]=[e.minX,e.minY],[s,l]=[e.maxX,e.maxY],[d,c]=[e.minX,e.minY],[u,p]=[e.maxX,e.maxY];if("center"===t)return{minX:d+i[0],minY:c+i[1],maxX:u+i[0],maxY:p+i[1],width:u-d,height:p-c,scaleX:1,scaleY:1};let[h,m]=z.rot(i,-n);switch(t){case"top_edge":case"top_left_corner":case"top_right_corner":c+=m;break;case"bottom_edge":case"bottom_left_corner":case"bottom_right_corner":p+=m}switch(t){case"left_edge":case"top_left_corner":case"bottom_left_corner":d+=h;break;case"right_edge":case"top_right_corner":case"bottom_right_corner":u+=h}let g=s-r,f=l-o,b=(u-d)/g,x=(p-c)/f,y=Math.abs(u-d),v=Math.abs(p-c);if(a){let e=g/f,i=ez.rotWith(e,i,t)),a=t_.getBoundsFromPoints(n);return[a.width,a.height]}static getBoundsCenter(e){return[e.minX+e.width/2,e.minY+e.height/2]}static getBoundsWithCenter(e){let t=t_.getBoundsCenter(e);return tu(tb({},e),tp({midX:t[0],midY:t[1]}))}static getCommonTopLeft(e){let t=[1/0,1/0];return e.forEach(e=>{t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1])}),t}static getFromCache(e,t,i){let n=e.get(t);if(void 0===n&&(e.set(t,i()),void 0===(n=e.get(t))))throw Error("Cache did not include item!");return n}static uniqueId(e=""){return e?((Number(e)^16*Math.random())>>Number(e)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,t_.uniqueId)}static rotateArray(e,t){return e.map((i,n)=>e[(n+t)%e.length])}static debounce(e,t=0){let i;return function(...n){clearTimeout(i),i=setTimeout(()=>e.apply(n),t)}}static getSvgPathFromStroke(e){let t=e.length;if(!t)return"";let i=e[0],n=`M${i[0].toFixed(3)},${i[1].toFixed(3)}Q`;for(let i=0,o=t-1;ii=!1,t),n=e(...a)),n}}static isDarwin(){return/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)}static metaKey(e){return t_.isDarwin()?e.metaKey:e.ctrlKey}static lns(e){let t=e.split("");return t.push(...t.splice(0,Math.round(t.length/5))),t.push(...t.splice(0,Math.round(t.length/4))),t.push(...t.splice(0,Math.round(t.length/3))),t.push(...t.splice(0,Math.round(t.length/2))),t.reverse().map(e=>+e?5>+e?5+ +e:+e>5?e-5:e:e).join("")}},tI=t_;ty(tI,"getSnapPoints",(e,t,i)=>{let n=tb({},e),a=[0,0],r=[],o={minX:{id:"minX",isSnapped:!1},midX:{id:"midX",isSnapped:!1},maxX:{id:"maxX",isSnapped:!1},minY:{id:"minY",isSnapped:!1},midY:{id:"midY",isSnapped:!1},maxY:{id:"maxY",isSnapped:!1}},s=["midX","minX","maxX"],l=["midY","minY","maxY"],d=t.map(e=>{let t=s.flatMap((t,i)=>s.map((a,r)=>{let o=n[t]-e[a],s=Math.abs(o);return{f:t,t:a,gap:o,distance:s,isCareful:0===i||i+r===3}})),i=l.flatMap((t,i)=>l.map((a,r)=>{let o=n[t]-e[a],s=Math.abs(o);return{f:t,t:a,gap:o,distance:s,isCareful:0===i||i+r===3}}));return[e,t,i]}),c=1/0,u=1/0,p=1/0,h=1/0;return d.forEach(([e,t,n])=>{t.forEach(e=>{e.distance{e.distance{c!==1/0&&t.forEach(t=>{2>Math.abs(t.gap-c)&&(o[t.f]=tu(tb({},o[t.f]),tp({isSnapped:!0,to:e[t.t],B:e,distance:t.distance})))}),u!==1/0&&i.forEach(t=>{2>Math.abs(t.gap-u)&&(o[t.f]=tu(tb({},o[t.f]),tp({isSnapped:!0,to:e[t.t],B:e,distance:t.distance})))})}),a[0]=c===1/0?0:c,a[1]=u===1/0?0:u,n.minX-=a[0],n.midX-=a[0],n.maxX-=a[0],n.minY-=a[1],n.midY-=a[1],n.maxY-=a[1],s.forEach(e=>{let t=o[e];if(!t.isSnapped)return;let{id:i,B:a}=t,s=n[i];r.push("minX"===i?[[s,n.midY],[s,a.minY],[s,a.maxY]]:[[s,n.minY],[s,n.maxY],[s,a.minY],[s,a.maxY]])}),l.forEach(e=>{let t=o[e];if(!t.isSnapped)return;let{id:i,B:a}=t,s=n[i];r.push("midY"===i?[[n.midX,s],[a.minX,s],[a.maxX,s]]:[[n.minX,s],[n.maxX,s],[a.minX,s],[a.maxX,s]])}),{offset:a,snapLines:r}}),ty(tI,"deepMerge",(e,t)=>{let i=tb({},e);for(let[e,n]of Object.entries(t))i[e]=n!==Object(n)||Array.isArray(n)?n:t_.deepMerge(i[e],n);return i});var tM=new Map,tT={accent:"rgb(255, 0, 0)",brushFill:"rgba(0,0,0,.05)",brushStroke:"rgba(0,0,0,.25)",brushDashStroke:"rgba(0,0,0,.6)",selectStroke:"rgb(66, 133, 244)",selectFill:"rgba(65, 132, 244, 0.05)",binding:"rgba(65, 132, 244, 0.12)",background:"rgb(248, 249, 250)",foreground:"rgb(51, 51, 51)",grid:"rgba(144, 144, 144, 1)"},tL=((e,...t)=>e.reduce((e,i,n)=>e+i+(n * { stroke: var(--tl-selectFill); } .tl-handle:active .tl-handle-bg { cursor: grabbing; fill: var(--tl-selectFill); } .tl-handle:active .tl-handle-bg > * { stroke: var(--tl-selectFill); } .tl-handle { fill: var(--tl-background); stroke: var(--tl-selectStroke); stroke-width: 1.5px; } .tl-handle-bg { fill: transparent; stroke: none; pointer-events: all; r: calc(16px / max(1, var(--tl-zoom))); } .tl-binding-indicator { fill: transparent; stroke: var(--tl-binding); } .tl-centered-g { transform: translate(var(--tl-padding), var(--tl-padding)); } .tl-current-parent > *[data-shy='true'] { opacity: 1; } .tl-binding { fill: none; stroke: var(--tl-selectStroke); stroke-width: calc(2px * var(--tl-scale)); } .tl-grid-dot { fill: var(--tl-grid); } .tl-erase-line { stroke-linejoin: round; stroke-linecap: round; pointer-events: none; fill: var(--tl-grid); opacity: 0.32; } `;function tj(e){let{callbacks:t,inputs:i}=tC(),n=R.useCallback(n=>{var a,r,o;if(n.dead||(n.dead=!0,!i.pointerIsValid(n)))return;let s=i.pointerDown(n,e);if(2===n.button){null==(a=t.onRightPointBoundsHandle)||a.call(t,s,n);return}0===n.button&&(null==(r=t.onPointBoundsHandle)||r.call(t,s,n)),null==(o=t.onPointerDown)||o.call(t,s,n)},[i,t,e]),a=R.useCallback(n=>{var a,r,o;if(n.dead||(n.dead=!0,2===n.button||!i.pointerIsValid(n)))return;let s=i.pointerUp(n,e),l=i.isDoubleClick();0===n.button&&(l&&!(s.altKey||s.metaKey)&&(null==(a=t.onDoubleClickBoundsHandle)||a.call(t,s,n)),null==(r=t.onReleaseBoundsHandle)||r.call(t,s,n)),null==(o=t.onPointerUp)||o.call(t,s,n)},[i,t,e]),r=R.useCallback(n=>{var a,r;if(n.dead||(n.dead=!0,!i.pointerIsValid(n))||2===n.buttons)return;let o=i.pointerMove(n,e);1===n.buttons&&n.currentTarget.hasPointerCapture(n.pointerId)&&(null==(a=t.onDragBoundsHandle)||a.call(t,o,n)),null==(r=t.onPointerMove)||r.call(t,o,n)},[i,t,e]);return{onPointerDown:n,onPointerUp:a,onPointerEnter:R.useCallback(n=>{var a;i.pointerIsValid(n)&&null!=(a=t.onHoverBoundsHandle)&&a.call(t,i.pointerEnter(n,e),n)},[i,t,e]),onPointerMove:r,onPointerLeave:R.useCallback(n=>{var a;i.pointerIsValid(n)&&null!=(a=t.onUnhoverBoundsHandle)&&a.call(t,i.pointerEnter(n,e),n)},[i,t,e])}}function tP(e,t){return[(e[0]+t.point[0])*t.zoom,(e[1]+t.point[1])*t.zoom]}function tD(e,t=0){let i=R.useRef(null);return R.useLayoutEffect(()=>{let n=i.current,a=` translate( calc(${e.minX}px - var(--tl-padding)), calc(${e.minY}px - var(--tl-padding)) ) rotate(${t+(e.rotation||0)}rad)`;n.style.setProperty("transform",a),n.style.setProperty("width",`calc(${Math.floor(e.width)}px + (var(--tl-padding) * 2))`),n.style.setProperty("height",`calc(${Math.floor(e.height)}px + (var(--tl-padding) * 2))`)},[e,t]),i}var tN=R.memo(function(e){var{id:t,bounds:i,rotation:n=0,isGhost:a=!1,isSelected:r=!1,children:o}=e,s=tx(e,["id","bounds","rotation","isGhost","isSelected","children"]);let l=tD(i,n);return R.createElement("div",tb({id:t,ref:l,className:`tl-positioned${a?" tl-ghost":""}${r?" tl-positioned-selected":""}`,"aria-label":"container","data-testid":"container"},s),o)}),tR=R.memo(function({brush:e,zoom:t,dashed:i}){return R.createElement(tN,{bounds:e,rotation:0},R.createElement(tW,null,R.createElement("rect",{className:"tl-brush"+(i?" dashed":""),opacity:1,x:0,y:0,width:e.width,height:e.height,"aria-label":"brush"}),i&&R.createElement("g",{className:"tl-dashed-brush-line"},R.createElement(tO,{x1:0,y1:0,x2:e.width,y2:0,zoom:t}),R.createElement(tO,{x1:e.width,y1:0,x2:e.width,y2:e.height,zoom:t}),R.createElement(tO,{x1:0,y1:e.height,x2:e.width,y2:e.height,zoom:t}),R.createElement(tO,{x1:0,y1:0,x2:0,y2:e.height,zoom:t}))))});function tO({x1:e,y1:t,x2:i,y2:n,zoom:a}){let r=tI.getPerfectDashProps(Math.hypot(i-e,n-t),1/a,"dashed",1,!0,3);return R.createElement("line",{x1:e,y1:t,x2:i,y2:n,strokeWidth:1/a,strokeDasharray:r.strokeDasharray,strokeDashoffset:r.strokeDashoffset})}var tB=R.memo(function({points:e,zoom:t}){if(0===e.length)return null;let i=tI.getSvgPathFromStroke(function(e,t={}){return function(e,t={}){var i,n;let{size:a=16,smoothing:r=.5,thinning:o=.5,simulatePressure:s=!0,easing:l=e=>e,start:d={},end:c={},last:u=!1}=t,{cap:p=!0,easing:h=e=>e*(2-e)}=d,{cap:m=!0,easing:g=e=>--e*e*e+1}=c;if(0===e.length||a<=0)return[];let f=e[e.length-1].runningLength,b=!1===d.taper?0:!0===d.taper?Math.max(a,f):d.taper,x=!1===c.taper?0:!0===c.taper?Math.max(a,f):c.taper,y=Math.pow(a*r,2),v=[],C=[],w=e.slice(0,10).reduce((e,t)=>{let i=t.pressure;if(s){let n=eY(1,t.distance/a),r=eY(1,1-n);i=eY(1,e+.275*n*(r-e))}return(e+i)/2},e[0].pressure),S=eH(a,o,e[e.length-1].pressure,l),k,A=e[0].vector,E=e[0].point,_=E,I=E,M=_;for(let t=0;ty)&&(v.push(I),E=I),M=eW(n,m),(t<=1||e$(_,M)>y)&&(C.push(M),_=M),w=i,A=r}let T=e[0].point.slice(0,2),L=e.length>1?e[e.length-1].point.slice(0,2):eW(e[0].point,[1,1]),j=[],P=[];if(1===e.length){if(!(b||x)||u){let e=(i=eZ(eG(eU(T,L))),eW(T,eV(i,-(k||S)))),t=[];for(let i=1/13,n=i;n<=1;n+=i)t.push(eK(e,T,2*eQ*n));return t}}else{if(!(b||x&&1===e.length))if(p)for(let e=1/13,t=e;t<=1;t+=e){let e=eK(C[0],T,eQ*t);j.push(e)}else{let e=eU(v[0],C[0]),t=eV(e,.5),i=eV(e,.51);j.push(eU(T,t),eU(T,i),eW(T,i),eW(T,t))}let t=eG([-(n=e[e.length-1].vector)[0],-n[1]]);if(x||b&&1===e.length)P.push(L);else if(m){let e=eW(L,eV(t,S));for(let t=1/29,i=t;i<1;i+=t)P.push(eK(e,L,3*eQ*i))}else P.push(eW(L,eV(t,S)),eW(L,eV(t,.99*S)),eU(L,eV(t,.99*S)),eU(L,eV(t,S)))}return v.concat(P,C.reverse(),j)}(function(e,t={}){var i,n,a;let{streamline:r=.5,size:o=16,last:s=!1}=t;if(0===e.length)return[];let l=.15+(1-r)*.85,d=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:i=.5})=>[e,t,i]);if(2===d.length){let e=d[1];d=d.slice(0,-1);for(let t=1;t<5;t++)d.push(eq(d[0],e,t/4))}1===d.length&&(d=[...d,[...eW(d[0],[1,1]),...d[0].slice(2)]]);let c=[{point:[d[0][0],d[0][1]],pressure:d[0][2]>=0?d[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],u=!1,p=0,h=c[0],m=d.length-1;for(let e=1;e=0?d[e][2]:.5,vector:eZ(eU(h.point,t)),distance:i,runningLength:p},c.push(h)}return c[0].vector=(null==(i=c[1])?void 0:i.vector)||[0,0],c}(e,t),t)}(e,{size:16/t,start:{taper:!0}}));return R.createElement("path",{d:i,className:"tl-erase-line"})}),tz=[[-1,.15,64],[.05,.375,16],[.15,1,4],[.7,2.5,1]];function tF({grid:e,camera:t}){return R.createElement("svg",{className:"tl-grid",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},R.createElement("defs",null,tz.map(([i,n,a],r)=>{let o=a*e*t.zoom,s=t.point[0]*t.zoom,l=t.point[1]*t.zoom,d=s>0?s%o:o+s%o,c=l>0?l%o:o+l%o,u=t.zoomR.createElement("rect",{key:`grid-rect-${t}`,width:"100%",height:"100%",fill:`url(#grid-${t})`})))}var tH=R.memo(function({camera:{zoom:e,point:t},children:i}){let n=2.5/e;return R.createElement("svg",{className:"tl-overlay"},R.createElement("defs",null,R.createElement("g",{id:"tl-snap-point"},R.createElement("path",{className:"tl-snap-point",d:`M ${-n},${-n} L ${n},${n} M ${-n},${n} L ${n},${-n}`}))),R.createElement("g",{transform:`scale(${e}) translate(${t})`},i))}),tW=R.memo(R.forwardRef(function(e,t){var{id:i,className:n="",children:a,shapeStyle:r}=e,o=tx(e,["id","className","children","shapeStyle"]);let s=r?{"data-color":r.color,"data-fill":r.isFilled}:{};return R.createElement("svg",tb({ref:t,className:`tl-positioned-svg ${n}`},o),R.createElement("g",tb({id:i,className:"tl-centered-g"},s),a))})),tU=R.memo(function({bounds:e,isLocked:t,isHidden:i}){return R.createElement("rect",{className:["tl-bounds-center",t?"tl-dashed":""].join(" "),x:-1,y:-1,width:e.width+2,height:e.height+2,opacity:+!i,pointerEvents:"none","aria-label":"center handle"})}),tV={right:0,bottomRight:45,bottom:90,bottomLeft:135,left:180,topLeft:225,top:270,topRight:315},tG=R.memo(function({bounds:e,side:t,targetSize:i,size:n}){let a=2*i,r={left:-a,topLeft:-a,bottomLeft:-a,right:e.width,topRight:e.width,bottomRight:e.width,top:e.width/2-a/2,bottom:e.width/2-a/2}[t],o={left:e.height/2-a/2,right:e.height/2-a/2,top:-(2*a),topLeft:-a,topRight:-a,bottom:e.height,bottomLeft:e.height,bottomRight:e.height}[t],{callbacks:s,inputs:l}=tC(),d=R.useCallback(e=>{var i;e.stopPropagation();let n=l.pointerDown(e,t);null==(i=s.onShapeClone)||i.call(s,n,e)},[s.onShapeClone]);return R.createElement("g",{className:"tl-clone-target",transform:`translate(${r}, ${o})`,"aria-label":"clone button"},R.createElement("rect",{className:"tl-transparent",width:2*i,height:2*i}),R.createElement("g",{className:"tl-clone-button-target",onPointerDown:d,transform:`translate(${i}, ${i}) rotate(${tV[t]})`},R.createElement("circle",{className:"tl-transparent ",r:i}),R.createElement("path",{className:"tl-clone-button",d:`M -${n/2},-${n/2} L ${n/2},0 -${n/2},${n/2} Z`,strokeLinejoin:"round"})))}),t$=R.memo(function({targetSize:e,size:t,bounds:i}){return R.createElement(R.Fragment,null,R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"top"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"right"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"bottom"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"left"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"topLeft"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"topRight"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"bottomLeft"}),R.createElement(tG,{targetSize:e,size:t,bounds:i,side:"bottomRight"}))}),tZ={top_left_corner:"tl-cursor-nwse",top_right_corner:"tl-cursor-nesw",bottom_right_corner:"tl-cursor-nwse",bottom_left_corner:"tl-cursor-nesw"},tK=R.memo(function({size:e,targetSize:t,isHidden:i,corner:n,bounds:a}){let r=tj(n),o="top_left_corner"===n||"top_right_corner"===n,s="top_left_corner"===n||"bottom_left_corner"===n;return R.createElement("g",{opacity:+!i},R.createElement("rect",tb({className:"tl-transparent "+(i?"":tZ[n]),"aria-label":"corner transparent",x:(s?-1:a.width+1)-t,y:(o?-1:a.height+1)-t,width:2*t,height:2*t,pointerEvents:i?"none":"all"},r)),R.createElement("rect",{className:"tl-corner-handle","aria-label":"corner handle",x:(s?-1:a.width+1)-e/2,y:(o?-1:a.height+1)-e/2,width:e,height:e,pointerEvents:"none"}))}),tq={top_edge:"tl-cursor-ns",right_edge:"tl-cursor-ew",bottom_edge:"tl-cursor-ns",left_edge:"tl-cursor-ew"},tY=R.memo(function({size:e,isHidden:t,bounds:i,edge:n}){let a=tj(n),r="top_edge"===n||"bottom_edge"===n,o="right_edge"===n||"bottom_edge"===n,{height:s,width:l}=i;return R.createElement("rect",tb({pointerEvents:t?"none":"all",className:"tl-transparent tl-edge-handle "+(t?"":tq[n]),"aria-label":`${n} handle`,opacity:+!t,x:r?e/2:(o?l+1:-1)-e/2,y:r?(o?s+1:-1)-e/2:e/2,width:r?Math.max(0,l+1-e):e,height:r?e:Math.max(0,s+1-e)},a))}),tX=R.memo(function({size:e,bounds:t,isHidden:i}){let n=tj("left"),a=tj("center"),r=tj("right");return R.createElement("g",{cursor:"grab",transform:`translate(${t.width/2-4*e}, ${t.height+2*e})`,"aria-label":"link handle"},R.createElement("g",{className:"tl-transparent",pointerEvents:i?"none":"all"},R.createElement("rect",tb({x:0,y:0,width:2*e,height:2*e},n)),R.createElement("rect",tb({x:3*e,y:0,width:2*e,height:2*e},a)),R.createElement("rect",tb({x:6*e,y:0,width:2*e,height:2*e},r))),R.createElement("g",{className:"tl-rotate-handle",transform:`translate(${e/2}, ${e/2})`,"aria-label":"link rotate handle"},R.createElement("path",{d:`M 0,${e/2} L ${e},${e} ${e},0 Z`,pointerEvents:"none",opacity:+!i}),R.createElement("path",{transform:`translate(${3*e}, 0)`,d:`M 0,0 L ${e},0 ${e/2},${e} Z`,pointerEvents:"none",opacity:+!i}),R.createElement("path",{transform:`translate(${6*e}, 0)`,d:`M ${e},${e/2} L 0,0 0,${e} Z`,pointerEvents:"none",opacity:+!i})))}),tQ=R.memo(function({bounds:e,targetSize:t,size:i,isHidden:n}){let a=tj("rotate");return R.createElement("g",{cursor:"grab",opacity:+!n},R.createElement("circle",tb({className:"tl-transparent","aria-label":"rotate handle transparent",cx:e.width/2,cy:-2*i,r:t,pointerEvents:n?"none":"all"},a)),R.createElement("circle",{className:"tl-rotate-handle","aria-label":"rotate handle",cx:e.width/2,cy:-2*i,r:i/2,pointerEvents:"none"}))}),tJ=R.memo(function({zoom:e,bounds:t,viewportWidth:i,rotation:n,isHidden:a,isLocked:r,hideCloneHandles:o,hideResizeHandles:s,hideRotateHandle:l,hideBindingHandles:d}){let c=(i<768?16:8)/e,u=8/e,p=Math.min(t.width,t.height)*e,h=!l&&!a&&!r&&p>32,m=!a&&!r&&p>24,g=!a&&!r&&p>20;return R.createElement(tN,{bounds:t,rotation:n},R.createElement(tW,null,R.createElement(tU,{bounds:t,isLocked:r,isHidden:a}),s||r?null:R.createElement(R.Fragment,null,R.createElement(tY,{targetSize:c,size:u,bounds:t,edge:"top_edge",isHidden:!m}),R.createElement(tY,{targetSize:c,size:u,bounds:t,edge:"right_edge",isHidden:!m}),R.createElement(tY,{targetSize:c,size:u,bounds:t,edge:"bottom_edge",isHidden:!m}),R.createElement(tY,{targetSize:c,size:u,bounds:t,edge:"left_edge",isHidden:!m}),R.createElement(tK,{targetSize:c,size:u,bounds:t,isHidden:a||!g,corner:"top_left_corner"}),R.createElement(tK,{targetSize:c,size:u,bounds:t,isHidden:a||!g,corner:"top_right_corner"}),R.createElement(tK,{targetSize:c,size:u,bounds:t,isHidden:a||!g,corner:"bottom_right_corner"}),R.createElement(tK,{targetSize:c,size:u,bounds:t,isHidden:a||!g,corner:"bottom_left_corner"})),h&&R.createElement(tQ,{targetSize:c,size:u,bounds:t,isHidden:!m}),!o&&p>24&&R.createElement(t$,{bounds:t,targetSize:c,size:u}),!d&&R.createElement(tX,{targetSize:c,size:u,bounds:t,isHidden:!m})))}),t0=R.memo(function({bounds:e,rotation:t,isHidden:i}){let n=function(){let{callbacks:e,inputs:t}=tC();return R.useMemo(()=>({onPointerDown:i=>{var n,a,r,o;if(i.dead||(i.dead=!0,!t.pointerIsValid(i)))return;if(2===i.button){null==(n=e.onRightPointBounds)||n.call(e,t.pointerDown(i,"bounds"),i);return}let s=t.pointerDown(i,"bounds");null==(a=i.currentTarget)||a.setPointerCapture(i.pointerId),0===i.button&&(null==(r=e.onPointBounds)||r.call(e,s,i)),null==(o=e.onPointerDown)||o.call(e,s,i)},onPointerUp:i=>{var n,a,r,o;if(i.dead||(i.dead=!0,2===i.button)||(t.activePointer=void 0,!t.pointerIsValid(i)))return;let s=t.isDoubleClick(),l=t.pointerUp(i,"bounds");i.currentTarget.hasPointerCapture(i.pointerId)&&(null==(n=i.currentTarget)||n.releasePointerCapture(i.pointerId)),0===i.button&&(s&&!(l.altKey||l.metaKey)&&(null==(a=e.onDoubleClickBounds)||a.call(e,l,i)),null==(r=e.onReleaseBounds)||r.call(e,l,i)),null==(o=e.onPointerUp)||o.call(e,l,i)},onPointerMove:i=>{var n,a;if(i.dead||(i.dead=!0,!t.pointerIsValid(i)))return;1===i.buttons&&i.currentTarget.hasPointerCapture(i.pointerId)&&(null==(n=e.onDragBounds)||n.call(e,t.pointerMove(i,"bounds"),i));let r=t.pointerMove(i,"bounds");null==(a=e.onPointerMove)||a.call(e,r,i)},onPointerEnter:i=>{var n;t.pointerIsValid(i)&&null!=(n=e.onHoverBounds)&&n.call(e,t.pointerEnter(i,"bounds"),i)},onPointerLeave:i=>{var n;t.pointerIsValid(i)&&null!=(n=e.onUnhoverBounds)&&n.call(e,t.pointerEnter(i,"bounds"),i)}}),[t,e])}();return R.createElement(tN,{bounds:e,rotation:t},R.createElement(tW,null,R.createElement("rect",tb({className:"tl-bounds-bg","aria-label":"bounds bg",width:e.width,height:e.height,opacity:+!i},n))))}),t1=R.memo(function({id:e,point:t}){let i=function(e){let{inputs:t,callbacks:i}=tC();return R.useMemo(()=>({onPointerDown:n=>{var a,r,o;if(n.dead||(n.dead=!0,!t.pointerIsValid(n))||2===n.button)return;null==(a=n.currentTarget)||a.setPointerCapture(n.pointerId);let s=t.pointerDown(n,e);0===n.button&&(null==(r=i.onPointHandle)||r.call(i,s,n)),null==(o=i.onPointerDown)||o.call(i,s,n)},onPointerUp:n=>{var a,r,o,s;if(n.dead||(n.dead=!0,!t.pointerIsValid(n))||2===n.button)return;let l=t.isDoubleClick(),d=t.pointerUp(n,e);n.currentTarget.hasPointerCapture(n.pointerId)&&(null==(a=n.currentTarget)||a.releasePointerCapture(n.pointerId),0===n.button&&(l&&!(d.altKey||d.metaKey)&&(null==(r=i.onDoubleClickHandle)||r.call(i,d,n)),null==(o=i.onReleaseHandle)||o.call(i,d,n))),null==(s=i.onPointerUp)||s.call(i,d,n)},onPointerMove:n=>{var a,r;if(n.dead||(n.dead=!0,!t.pointerIsValid(n))||2===n.buttons)return;let o=t.pointerMove(n,e);1===n.buttons&&n.currentTarget.hasPointerCapture(n.pointerId)&&(null==(a=i.onDragHandle)||a.call(i,o,n)),null==(r=i.onPointerMove)||r.call(i,o,n)},onPointerEnter:n=>{var a;if(!t.pointerIsValid(n))return;let r=t.pointerEnter(n,e);null==(a=i.onHoverHandle)||a.call(i,r,n)},onPointerLeave:n=>{var a;if(!t.pointerIsValid(n))return;let r=t.pointerEnter(n,e);null==(a=i.onUnhoverHandle)||a.call(i,r,n)}}),[t,i,e])}(e);return R.createElement(tN,{bounds:tI.translateBounds({minX:0,minY:0,maxX:0,maxY:0,width:0,height:0},t)},R.createElement(tW,null,R.createElement("g",tb({className:"tl-handle","aria-label":"handle"},i),R.createElement("circle",{className:"tl-handle-bg",pointerEvents:"all"}),R.createElement("circle",{className:"tl-counter-scaled tl-handle",pointerEvents:"none",r:4}))))}),t2=R.memo(function({shape:e,zoom:t}){if(void 0===e.handles)return null;let i=null,n=Object.values(e.handles).reduce((n,a)=>{let r=z.add(a.point,e.point);return(!i||z.dist(r,i)*t>=32)&&(n.push(a),i=r),n},[]);return 1===n.length?null:R.createElement(R.Fragment,null,n.map(t=>R.createElement(t1,{key:e.id+"_"+t.id,id:t.id,point:z.add(t.point,e.point)})))}),t3=R.memo(function(e){let t=e.utils.getRef(e.shape);return R.createElement(e.utils.Component,tb({ref:t},e))},(e,t)=>e.isHovered===t.isHovered&&e.isSelected===t.isSelected&&e.isEditing===t.isEditing&&e.isBinding===t.isBinding&&e.isGhost===t.isGhost&&e.meta===t.meta&&(t.shape===e.shape||!t.utils.shouldRender(t.shape,e.shape))),t5=R.memo(function(e){var{shape:t,utils:i,meta:n}=e,a=tx(e,["shape","utils","meta"]);let{callbacks:r}=tC(),o=i.getBounds(t),s=function(e){let{rPageState:t,rSelectionBounds:i,callbacks:n,inputs:a}=R.useContext(tv);return R.useMemo(()=>({onPointerDown:r=>{var o,s,l,d,c,u,p;if(r.dead||(r.dead=!0,!a.pointerIsValid(r)))return;if(2===r.button){null==(o=n.onRightPointShape)||o.call(n,a.pointerDown(r,e),r);return}let h=a.pointerDown(r,e);if(null==(s=r.currentTarget)||s.setPointerCapture(r.pointerId),i.current&&tI.pointInBounds(h.point,i.current)&&!t.current.selectedIds.includes(e)){0===r.button&&(null==(l=n.onPointBounds)||l.call(n,a.pointerDown(r,"bounds"),r),null==(d=n.onPointShape)||d.call(n,h,r)),null==(c=n.onPointerDown)||c.call(n,h,r);return}0===r.button&&(null==(u=n.onPointShape)||u.call(n,h,r)),null==(p=n.onPointerDown)||p.call(n,h,r)},onPointerUp:t=>{var i,r,o,s;if(t.dead||(t.dead=!0,!a.pointerIsValid(t))||2===t.button)return;a.activePointer=void 0;let l=a.isDoubleClick(),d=a.pointerUp(t,e);t.pointerId&&t.currentTarget.hasPointerCapture(t.pointerId)&&(null==(i=t.currentTarget)||i.releasePointerCapture(t.pointerId)),0===t.button&&(l&&!(d.altKey||d.metaKey)&&(null==(r=n.onDoubleClickShape)||r.call(n,d,t)),null==(o=n.onReleaseShape)||o.call(n,d,t)),null==(s=n.onPointerUp)||s.call(n,d,t)},onPointerMove:t=>{var i,r;if(t.dead||(t.dead=!0,2===t.buttons||!a.pointerIsValid(t)||a.pointer&&t.pointerId!==a.pointer.pointerId))return;let o=a.pointerMove(t,e);1===t.buttons&&t.currentTarget.hasPointerCapture(t.pointerId)&&(null==(i=n.onDragShape)||i.call(n,o,t)),null==(r=n.onPointerMove)||r.call(n,o,t)},onPointerEnter:t=>{var i;if(!a.pointerIsValid(t))return;let r=a.pointerEnter(t,e);null==(i=n.onHoverShape)||i.call(n,r,t)},onPointerLeave:t=>{var i;if(!a.pointerIsValid(t))return;let r=a.pointerEnter(t,e);null==(i=n.onUnhoverShape)||i.call(n,r,t)}}),[a,n,e])}(t.id);return R.createElement(tN,{id:t.id,bounds:o,rotation:t.rotation,"data-shape":t.type,isGhost:a.isGhost,isSelected:a.isSelected},R.createElement(t3,tb({shape:t,utils:i,meta:n,events:s,bounds:o,onShapeChange:r.onShapeChange,onShapeBlur:r.onShapeBlur},a)))}),t4=R.memo(function(e){var{shape:t,utils:i,meta:n,children:a}=e,r=tx(e,["shape","utils","meta","children"]);return R.createElement(R.Fragment,null,R.createElement(t5,tb({shape:t,utils:i[t.type],meta:n},r)),a&&a.map(e=>R.createElement(t4,tb({key:e.shape.id,utils:i},e))))}),t6=R.memo(function({isHovered:e=!1,isSelected:t=!1,isEditing:i=!1,shape:n,user:a,meta:r}){let{shapeUtils:o}=tC(),s=o[n.type],l=s.getBounds(n),d=tD(l,n.rotation);return R.createElement("div",{ref:d,draggable:!1,className:["tl-indicator tl-absolute",t&&!a?"tl-selected":"tl-hovered",i?"tl-editing":"",n.isLocked?"tl-locked":""].join(" ")},R.createElement("svg",{width:"100%",height:"100%"},R.createElement("g",{className:"tl-centered-g",stroke:null==a?void 0:a.color},R.createElement(s.Indicator,{shape:n,meta:r,user:a,bounds:l,isSelected:t,isHovered:e}))))}),t9=R.memo(function({page:e,pageState:t,assets:i,hideBounds:n,hideHandles:a,hideIndicators:r,hideBindingHandles:o,hideCloneHandles:s,hideRotateHandle:l,hideResizeHandles:d,meta:c}){let{bounds:u,shapeUtils:p}=tC(),h=function(e,t,i,n){let{callbacks:a,shapeUtils:r,bounds:o}=tC(),s=R.useRef(),l=R.useRef(-1),d=R.useRef(new Set),c=R.useRef(new Set),{selectedIds:u,camera:p}=t,[h,m]=z.sub(z.div([0,0],p.zoom),p.point),[g,f]=z.sub(z.div([o.width,o.height],p.zoom),p.point),b={minX:h,minY:m,maxX:g,maxY:f,height:g-h,width:f-m},x=c.current,y=d.current;x.clear(),y.clear(),Object.values(e.shapes).filter(e=>{var t;return r[e.type].isStateful||u.includes(e.id)||(t=r[e.type].getBounds(e),tI.boundsContain(b,t)||tI.boundsCollide(b,t))}).forEach(t=>{if(t.parentId===e.id){y.add(t.id),x.add(t);return}let i=e.shapes[t.parentId];if(void 0===i)throw Error(`A shape (${t.id}) has a parent (${t.parentId}) that does not exist!`);y.add(i.id),x.add(i)}),x.size!==l.current&&(s.current&&clearTimeout(s.current),s.current=requestAnimationFrame(()=>{var e;null==(e=a.onRenderCountChange)||e.call(a,Array.from(y.values()))}),l.current=x.size);let v=t.bindingId?e.bindings[t.bindingId].toId:void 0,C=[];return x.forEach(a=>{if(void 0===a)throw Error("Rendered shapes included a missing shape");!function e(t,i,n,a,r,o=!1,s=!1,l){let d={shape:t,asset:t.assetId?r[t.assetId]:void 0,meta:l,isChildOfSelected:s,isGhost:t.isGhost||o,isEditing:a.editingId===t.id,isBinding:a.bindingTargetId===t.id,isSelected:a.selectedIds.includes(t.id),isHovered:a.hoveredId===t.id||void 0!==t.children&&(a.hoveredId&&t.children.includes(a.hoveredId)||t.children.some(e=>a.selectedIds.includes(e)))};i.push(d),t.children&&(d.children=[],t.children.map(e=>n[e]).filter(e=>n[e.id]).sort((e,t)=>e.childIndex-t.childIndex).forEach(t=>e(t,d.children,n,a,r,d.isGhost,d.isSelected||d.isChildOfSelected,l)))}(a,C,e.shapes,tu(tb({},t),tp({bindingTargetId:v})),i,a.isGhost,!1,n)}),C.sort((e,t)=>e.shape.childIndex-t.shape.childIndex),C}(e,t,i,c),{bounds:m,isLinked:g,isLocked:f,rotation:b}=function(e,t,i){let{rSelectionBounds:n}=tC(),{selectedIds:a}=t,r=R.useRef(),o,s=0,l=!1,d=!1;if(1===a.length){let t=a[0],n=e.shapes[t];if(!n)throw Error(`selectedIds is set to the id of a shape that doesn't exist: ${t}`);s=n.rotation||0,l=n.isLocked||!1;let r=i[n.type];o=r.hideBounds?void 0:r.getBounds(n)}else if(a.length>1){let t=a.map(t=>e.shapes[t]);s=0,l=t.every(e=>e.isLocked),o=t.reduce((e,t,n)=>0===n?i[t.type].getRotatedBounds(t):tI.getExpandedBounds(e,i[t.type].getRotatedBounds(t)),{})}if(o){let[i,r]=tP([o.minX,o.minY],t.camera),[s,l]=tP([o.maxX,o.maxY],t.camera);d=!!Object.values(e.bindings).find(e=>a.includes(e.toId)||a.includes(e.fromId)),n.current={minX:i,minY:r,maxX:s,maxY:l,width:s-i,height:l-r}}else n.current=null;let c=r.current;return c&&o?o&&c.minX===o.minX&&c.minY===o.minY&&c.maxX===o.maxX&&c.maxY===o.maxY&&(o=r.current):r.current=o,{bounds:o,rotation:s,isLocked:l,isLinked:d}}(e,t,p),{selectedIds:x,hoveredId:y,editingId:v,camera:{zoom:C}}=t,w=r,S=!0,k=!1,A,E=x.map(t=>e.shapes[t]);if(1===E.length){let e=E[0];(k=v===e.id)&&(w=!0);let t=p[e.type];S=s||!t.showCloneHandles,void 0===e.handles||k||(A=e)}return R.createElement(R.Fragment,null,m&&R.createElement(t0,{bounds:m,rotation:b,isHidden:n}),h.map(e=>R.createElement(t4,tb({key:e.shape.id,utils:p},e))),!w&&E.map(e=>R.createElement(t6,{key:"selected_"+e.id,shape:e,meta:c,isSelected:!0,isEditing:k})),!w&&y&&y!==v&&R.createElement(t6,{key:"hovered_"+y,shape:e.shapes[y],meta:c,isHovered:!0}),m&&R.createElement(tJ,{zoom:C,bounds:m,viewportWidth:u.width,isLocked:f,rotation:b,isHidden:n,hideRotateHandle:l,hideResizeHandles:d,hideBindingHandles:o||!g,hideCloneHandles:S}),!a&&A&&R.createElement(t2,{shape:A,zoom:C}))}),t8=R.memo(function({snapLine:e}){let t=tI.getBoundsFromPoints(e);return R.createElement(R.Fragment,null,R.createElement("line",{className:"tl-snap-line",x1:t.minX,y1:t.minY,x2:t.maxX,y2:t.maxY}),e.map(([e,t],i)=>R.createElement("use",{key:i,href:"#tl-snap-point",x:e,y:t})))}),t7=R.memo(function({snapLines:e}){return R.createElement(R.Fragment,null,e.map((e,t)=>R.createElement(t8,{key:t,snapLine:e})))});function ie({user:e}){let t=R.useRef(null);return R.useLayoutEffect(()=>{t.current&&(t.current.style.transform=`translate(${e.point[0]}px, ${e.point[1]}px)`)},[e.point]),R.createElement("svg",{ref:t,className:`tl-absolute tl-user tl-counter-scaled ${e.session?"":"tl-animated"}`,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 35 35",fill:"none",fillRule:"evenodd"},R.createElement("g",{fill:"rgba(0,0,0,.2)",transform:"translate(1,1)"},R.createElement("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),R.createElement("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})),R.createElement("g",{fill:"white"},R.createElement("path",{d:"m12 24.4219v-16.015l11.591 11.619h-6.781l-.411.124z"}),R.createElement("path",{d:"m21.0845 25.0962-3.605 1.535-4.682-11.089 3.686-1.553z"})),R.createElement("g",{fill:e.color},R.createElement("path",{d:"m19.751 24.4155-1.844.774-3.1-7.374 1.841-.775z"}),R.createElement("path",{d:"m13 10.814v11.188l2.969-2.866.428-.139h4.768z"})))}function it({userId:e,users:t}){return R.createElement(R.Fragment,null,Object.values(t).filter(t=>t&&t.id!==e).map(e=>R.createElement(ie,{key:e.id,user:e})))}function ii({userId:e,users:t,meta:i,page:n}){let{shapeUtils:a}=tC();return R.createElement(R.Fragment,null,Object.values(t).filter(Boolean).filter(t=>t.id!==e&&t.selectedIds.length>0).map(e=>{let t=e.selectedIds.map(e=>n.shapes[e]).filter(Boolean);if(0===t.length)return null;let r=tI.getCommonBounds(t.map(e=>a[e.type].getBounds(e)));return R.createElement(R.Fragment,{key:e.id+"_shapes"},R.createElement("div",{className:"tl-absolute tl-user-indicator-bounds",style:{backgroundColor:e.color+"0d",borderColor:e.color+"78",transform:`translate(${r.minX}px, ${r.minY}px)`,width:r.width,height:r.height,pointerEvents:"none"}}),t.map(t=>R.createElement(t6,{key:`${e.id}_${t.id}_indicator`,shape:t,user:e,meta:i,isHovered:!0})))}))}var ia=R.memo(function({id:e,page:t,pageState:i,assets:n,snapLines:a,eraseLine:r,grid:o,users:s,userId:l,meta:d,performanceMode:c,externalContainerRef:u,showDashedBrush:p,hideHandles:h,hideBounds:m,hideIndicators:g,hideBindingHandles:f,hideCloneHandles:b,hideResizeHandles:x,hideRotateHandle:y,hideGrid:v,onBoundsChange:C}){let w,S,k=R.useRef(null),A=R.useRef(i.camera.zoom);A.current=i.camera.zoom,function(e,t){var i,n;let a=R.useRef(void 0),r=R.useRef(void 0),o=R.useRef([0,0]),{inputs:s,bounds:l,callbacks:d}=tC();R.useEffect(()=>{let e=e=>e.preventDefault();return document.addEventListener("gesturestart",e),document.addEventListener("gesturechange",e),()=>{document.removeEventListener("gesturestart",e),document.removeEventListener("gesturechange",e)}},[]),i={onWheel:R.useCallback(({event:e})=>{var t,i,n,a;if(e.preventDefault(),s.isPinching)return;let[r,o,c]=function(e){let{deltaY:t,deltaX:i}=e,n=0;if(e.ctrlKey||e.metaKey){let i=Math.sign(e.deltaY),a=Math.abs(e.deltaY),r=t;a>10&&(r=10*i),n=r}return[i,t,n]}(e);if((e.altKey||e.ctrlKey||e.metaKey)&&0===e.buttons){let a=[...null!=(i=null==(t=s.pointer)?void 0:t.point)?i:[l.width/2,l.height/2],.618*c],r=s.pan(a,e);null==(n=d.onZoom)||n.call(d,tu(tb({},r),tp({delta:a})),e);return}let u=z.mul(e.shiftKey&&!tI.isDarwin?[o,0]:[r,o],.5);if(z.isEqual(u,[0,0]))return;let p=s.pan(u,e);null==(a=d.onPan)||a.call(d,p,e)},[d,s,l]),onPinchStart:R.useCallback(({origin:e,event:i})=>{var n;if(i instanceof WheelEvent)return;let l=t.current;if(!l||!(i.target===l||l.contains(i.target)))return;let c=s.pinch(e,e);s.isPinching=!0,null==(n=d.onPinchStart)||n.call(d,c,i),r.current=c.point,a.current=c.origin,o.current=[0,0]},[d,s,l]),onPinch:R.useCallback(({origin:e,offset:i,event:n})=>{var l;if(n instanceof WheelEvent)return;let c=t.current;if(!(n.target===c||(null==c?void 0:c.contains(n.target)))||!a.current)return;let u=s.pinch(e,a.current),p=z.sub(u.delta,o.current);o.current=u.delta,null==(l=d.onPinch)||l.call(d,tu(tb({},u),tp({point:u.point,origin:a.current,delta:[...p,i[0]]})),n),r.current=e},[d,s,l]),onPinchEnd:R.useCallback(({origin:e,event:i})=>{var n;let l=t.current;if(!(i.target===l||(null==l?void 0:l.contains(i.target))))return;let c=s.pinch(e,e);s.isPinching=!1,null==(n=d.onPinchEnd)||n.call(d,c,i),r.current=void 0,a.current=void 0,o.current=[0,0]},[])},n={target:t,eventOptions:{passive:!1},pinch:{from:[e.current,0],scaleBounds:()=>({from:e.current,max:5,min:.1})}},([eA,eI,eM,eT,e_,eE].forEach(ek),function(e,t){let{handlers:i,nativeHandlers:n,config:a}=function(e,t){let[i,n,a]=function(e){let t={},i={},n=new Set;for(let a in e)ez.test(a)?(n.add(RegExp.lastMatch),i[a]=e[a]):t[a]=e[a];return[i,t,n]}(e),r={};return eF(a,i,"onDrag","drag",r,t),eF(a,i,"onWheel","wheel",r,t),eF(a,i,"onScroll","scroll",r,t),eF(a,i,"onPinch","pinch",r,t),eF(a,i,"onMove","move",r,t),eF(a,i,"onHover","hover",r,t),{handlers:r,config:t,nativeHandlers:n}}(e,t||{});return function(e,t={},i,n){let a=R.default.useMemo(()=>new eR(e),[]);if(a.applyHandlers(e,n),a.applyConfig(t,i),R.default.useEffect(a.effect.bind(a)),R.default.useEffect(()=>a.clean.bind(a),[]),void 0===t.target)return a.bind.bind(a)}(i,a,void 0,n)})(i,n||{})}(A,u||k),function(e,t){let{inputs:i,callbacks:n}=tC(),a=R.useRef(!1),r=R.useCallback(()=>{var r,o;if(a.current){let a=null==(r=e.current)?void 0:r.getBoundingClientRect();if(a){let e={minX:a.left,maxX:a.left+a.width,minY:a.top,maxY:a.top+a.height,width:a.width,height:a.height};i.bounds=e,t(e),null==(o=n.onBoundsChange)||o.call(n,e)}}else a.current=!0},[e,i,n.onBoundsChange]);R.useEffect(()=>{let t=e.current?(e=>{let t=e.parentElement;for(;t&&t!==document.body;){let{overflowY:e}=window.getComputedStyle(t);if(t.scrollHeight>t.clientHeight&&("auto"===e||"scroll"===e||"overlay"===e))return t;t=t.parentElement}return document})(e.current):document,i=tI.debounce(r,100);return t.addEventListener("scroll",i),window.addEventListener("resize",i),()=>{t.removeEventListener("scroll",i),window.removeEventListener("resize",i)}},[]),R.useEffect(()=>{let t=new ResizeObserver(e=>{i.isPinching||e[0].contentRect&&r()});return e.current&&t.observe(e.current),()=>{t.disconnect()}},[e,i]),R.useEffect(()=>{r()},[e])}(k,C),function(){let{callbacks:e}=tC();(0,R.useEffect)(()=>{function t(){var t;null==(t=e.onShapeBlur)||t.call(e)}return tI.isMobileSafari()?(document.addEventListener("focusout",t),()=>document.removeEventListener("focusout",t)):()=>null},[e])}(),function(e){let{bounds:t}=tC();R.useEffect(()=>{let i=e=>{e.preventDefault()},n=e=>{let i=e.touches[0].pageX,n=e.touches[0].radiusX||0;(i-n<10||i+n>t.width-10)&&e.preventDefault()},a=e.current;return a?(a.addEventListener("gestureend",i),a.addEventListener("gesturechange",i),a.addEventListener("gesturestart",i),a.addEventListener("touchstart",n),()=>{a&&(a.removeEventListener("gestureend",i),a.removeEventListener("gesturechange",i),a.removeEventListener("gesturestart",i),a.removeEventListener("touchstart",n))}):()=>{}},[e,t.width])}(k);let E=R.useRef(null),_=R.useRef(null);w=R.useRef(),S=R.useRef(),R.useLayoutEffect(()=>{let{zoom:e,point:t}=i.camera,n=e!==w.current,a=t!==S.current;if(w.current=e,S.current=t,n||a){let i=_.current;if(E&&"current"in E){let a=E.current;n&&a&&a.style.setProperty("--tl-zoom",e.toString()),i&&i.style.setProperty("transform",`scale(${e}) translateX(${t[0]}px) translateY(${t[1]}px)`)}}},[i.camera.zoom,i.camera.point]),R.useLayoutEffect(()=>{if(E&&"current"in E){let e=null==E?void 0:E.current;if(e)switch(c){case"transform_selected":e.style.setProperty("--tl-performance-all","auto"),e.style.setProperty("--tl-performance-selected","transform, contents");break;case"transform_all":e.style.setProperty("--tl-performance-all","transform, contents"),e.style.setProperty("--tl-performance-selected","transform, contents");break;case"translate_selected":e.style.setProperty("--tl-performance-all","auto"),e.style.setProperty("--tl-performance-selected","transform");break;case"translate_all":e.style.setProperty("--tl-performance-all","transform"),e.style.setProperty("--tl-performance-selected","transform");break;default:e.style.setProperty("--tl-performance-all","auto"),e.style.setProperty("--tl-performance-selected","auto")}}},[c]),function(){let{inputs:e,callbacks:t}=tC();R.useEffect(()=>{let i=i=>{var n;null==(n=t.onKeyDown)||n.call(t,i.key,e.keydown(i),i)},n=i=>{var n;e.keyup(i),null==(n=t.onKeyUp)||n.call(t,i.key,e.keyup(i),i)};return window.addEventListener("keydown",i),window.addEventListener("keyup",n),()=>{window.removeEventListener("keydown",i),window.removeEventListener("keyup",n)}},[e,t])}();let I=function(){let{callbacks:e,inputs:t}=tC();return R.useMemo(()=>({onPointerDown:i=>{var n,a;if(i.dead||(i.dead=!0,!t.pointerIsValid(i))||2===i.button)return;i.currentTarget.setPointerCapture(i.pointerId);let r=t.pointerDown(i,"canvas");0===i.button&&(null==(n=e.onPointCanvas)||n.call(e,r,i)),null==(a=e.onPointerDown)||a.call(e,r,i)},onPointerMove:i=>{var n,a;if(i.dead||(i.dead=!0,!t.pointerIsValid(i)))return;let r=t.pointerMove(i,"canvas");1===i.buttons&&i.currentTarget.hasPointerCapture(i.pointerId)&&(null==(n=e.onDragCanvas)||n.call(e,r,i)),null==(a=e.onPointerMove)||a.call(e,r,i)},onPointerUp:i=>{var n,a,r,o;if(i.dead||(i.dead=!0,t.activePointer=void 0,!t.pointerIsValid(i))||2===i.button)return;let s=t.pointerUp(i,"canvas"),l=t.isDoubleClick();i.currentTarget.hasPointerCapture(i.pointerId)&&(null==(n=i.currentTarget)||n.releasePointerCapture(i.pointerId)),0===i.button&&(l&&!(s.altKey||s.metaKey)&&(null==(a=e.onDoubleClickCanvas)||a.call(e,s,i)),null==(r=e.onReleaseCanvas)||r.call(e,s,i)),null==(o=e.onPointerUp)||o.call(e,s,i)},onDrop:e.onDrop,onDragOver:e.onDragOver}),[e,t])}();return R.createElement("div",{id:e,className:"tl-container",ref:E},R.createElement("div",tb({id:"canvas",className:"tl-absolute tl-canvas",ref:k},I),!v&&o&&R.createElement(tF,{grid:o,camera:i.camera}),R.createElement("div",{ref:_,className:"tl-absolute tl-layer","data-testid":"layer"},R.createElement(t9,{page:t,pageState:i,assets:n,hideBounds:m,hideIndicators:g,hideHandles:h,hideBindingHandles:f,hideCloneHandles:b,hideResizeHandles:x,hideRotateHandle:y,meta:d}),s&&l&&R.createElement(ii,{userId:l,users:s,page:t,meta:d}),i.brush&&R.createElement(tR,{brush:i.brush,dashed:p,zoom:i.camera.zoom}),s&&R.createElement(it,{userId:l,users:s})),R.createElement(tH,{camera:i.camera},r&&R.createElement(tB,{points:r,zoom:i.camera.zoom}),a&&R.createElement(t7,{snapLines:a}))))}),ir=class{constructor(){ty(this,"pointer"),ty(this,"keyboard"),ty(this,"keys",{}),ty(this,"isPinching",!1),ty(this,"bounds",{minX:0,maxX:640,minY:0,maxY:480,width:640,height:480}),ty(this,"pointerUpTime",0),ty(this,"activePointer"),ty(this,"panStart",e=>{var t,i;let{shiftKey:n,ctrlKey:a,metaKey:r,altKey:o}=e,s={target:"wheel",pointerId:(null==(t=this.pointer)?void 0:t.pointerId)||0,origin:(null==(i=this.pointer)?void 0:i.origin)||[0,0],delta:[0,0],pressure:.5,point:ir.getPoint(e,this.bounds),shiftKey:n,ctrlKey:a,metaKey:r,altKey:o,spaceKey:this.keys[" "]};return this.pointer=s,s}),ty(this,"pan",(e,t)=>{if(!this.pointer||"wheel"!==this.pointer.target)return this.panStart(t);let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=t,o=this.pointer,s=ir.getPoint(t,this.bounds),l=tu(tb({},o),tp({target:"wheel",delta:e,point:s,shiftKey:i,ctrlKey:n,metaKey:a,altKey:r,spaceKey:this.keys[" "]}));return this.pointer=l,l}),ty(this,"keydown",e=>{var t,i;let{shiftKey:n,ctrlKey:a,metaKey:r,altKey:o}=e;return this.keys[e.key]=!0,{point:(null==(t=this.pointer)?void 0:t.point)||[0,0],origin:(null==(i=this.pointer)?void 0:i.origin)||[0,0],key:e.key,keys:Object.keys(this.keys),shiftKey:n,ctrlKey:a,metaKey:tI.isDarwin()?r:a,altKey:o}}),ty(this,"keyup",e=>{var t,i;let{shiftKey:n,ctrlKey:a,metaKey:r,altKey:o}=e;return delete this.keys[e.key],{point:(null==(t=this.pointer)?void 0:t.point)||[0,0],origin:(null==(i=this.pointer)?void 0:i.origin)||[0,0],key:e.key,keys:Object.keys(this.keys),shiftKey:n,ctrlKey:a,metaKey:tI.isDarwin()?r:a,altKey:o}})}pointerIsValid(e){if("pointerId"in e&&this.activePointer&&this.activePointer!==e.pointerId)return!1;if("touches"in e){let t=e.changedTouches[0];if(this.activePointer&&this.activePointer!==t.identifier)return!1}return!0}touchStart(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=e.changedTouches[0];this.activePointer=o.identifier;let s={target:t,pointerId:o.identifier,origin:ir.getPoint(o,this.bounds),delta:[0,0],point:ir.getPoint(o,this.bounds),pressure:ir.getPressure(o),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]};return this.pointer=s,s}touchEnd(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=e.changedTouches[0],s={target:t,pointerId:o.identifier,origin:ir.getPoint(o,this.bounds),delta:[0,0],point:ir.getPoint(o,this.bounds),pressure:ir.getPressure(o),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]};return this.pointer=s,this.activePointer=void 0,s}touchMove(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=e.changedTouches[0],s=this.pointer,l=ir.getPoint(o,this.bounds),d=(null==s?void 0:s.point)?z.sub(l,s.point):[0,0],c=tu(tb({origin:l},s),tp({target:t,pointerId:o.identifier,point:l,delta:d,pressure:ir.getPressure(o),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]}));return this.pointer=c,c}pointerDown(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=ir.getPoint(e,this.bounds);this.activePointer=e.pointerId;let s={target:t,pointerId:e.pointerId,origin:o,point:o,delta:[0,0],pressure:ir.getPressure(e),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]};return this.pointer=s,s}pointerEnter(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=ir.getPoint(e,this.bounds),s={target:t,pointerId:e.pointerId,origin:o,delta:[0,0],point:o,pressure:ir.getPressure(e),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]};return this.pointer=s,s}pointerMove(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=this.pointer,s=ir.getPoint(e,this.bounds),l=(null==o?void 0:o.point)?z.sub(s,o.point):[0,0],d=tu(tb({origin:s},o),tp({target:t,pointerId:e.pointerId,point:s,delta:l,pressure:ir.getPressure(e),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]}));return this.pointer=d,d}pointerUp(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=e,o=this.pointer,s=ir.getPoint(e,this.bounds),l=(null==o?void 0:o.point)?z.sub(s,o.point):[0,0];this.activePointer=void 0;let d=tu(tb({origin:s},o),tp({target:t,pointerId:e.pointerId,point:s,delta:l,pressure:ir.getPressure(e),shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]}));return this.pointer=d,this.pointerUpTime=performance.now(),d}isDoubleClick(){if(!this.pointer)return!1;let{origin:e,point:t}=this.pointer,i=performance.now()-this.pointerUpTime<250&&4>z.dist(e,t);return i&&(this.activePointer=void 0),i}clear(){this.pointer=void 0}resetDoubleClick(){this.pointerUpTime=0}pinch(e,t){let{shiftKey:i,ctrlKey:n,metaKey:a,altKey:r}=this.keys,o=z.sub(t,e),s={pointerId:0,target:"pinch",origin:t,delta:o,point:z.sub(z.toFixed(e),[this.bounds.minX,this.bounds.minY]),pressure:.5,shiftKey:i,ctrlKey:n,metaKey:tI.isDarwin()?a:n,altKey:r,spaceKey:this.keys[" "]};return this.pointer=s,s}reset(){this.pointerUpTime=0,this.pointer=void 0,this.keyboard=void 0,this.activePointer=void 0,this.keys={}}static getPoint(e,t){return[e.clientX.toFixed(2)-t.minX,e.clientY.toFixed(2)-t.minY]}static getPressure(e){return"pressure"in e&&+e.pressure.toFixed(2)||.5}static commandKey(){return tI.isDarwin()?"⌘":"Ctrl"}};new ir;var io={},is=R.memo(function(e){var t,{id:i="tl",shapeUtils:n,page:a,pageState:r,assets:o=io,users:s,userId:l,theme:d,meta:c,snapLines:u,eraseLine:p,grid:h,containerRef:m,performanceMode:g,hideHandles:f=!1,hideIndicators:b=!1,hideCloneHandles:x=!1,hideBindingHandles:y=!1,hideResizeHandles:v=!1,hideRotateHandles:C=!1,hideBounds:w=!1,hideGrid:S=!0,showDashedBrush:k=!1}=e,A=tx(e,["id","shapeUtils","page","pageState","assets","users","userId","theme","meta","snapLines","eraseLine","grid","containerRef","performanceMode","hideHandles","hideIndicators","hideCloneHandles","hideBindingHandles","hideResizeHandles","hideRotateHandles","hideBounds","hideGrid","showDashedBrush"]);(function(e,t=":root"){R.useLayoutEffect(()=>{let i=document.createElement("style"),n=Object.keys(e).reduce((t,i)=>{let n=e[i];return n?t+`--tl-${i}: ${n}; `:t},"");return i.setAttribute("id","tl-theme"),i.setAttribute("data-selector",t),i.innerHTML=` ${t} { ${n} } `,document.head.appendChild(i),()=>{i&&document.head.contains(i)&&document.head.removeChild(i)}},["tl",e,t])})(R.useMemo(()=>tb(tb({},tT),d),[d]),"#"+i),t="tl-canvas",R.useLayoutEffect(()=>{if(tM.get(t))return()=>{};let e=document.createElement("style");return e.innerHTML=tL,e.setAttribute("id",t),document.head.appendChild(e),tM.set(t,e),()=>{e&&document.head.contains(e)&&(document.head.removeChild(e),tM.delete(t))}},[t,tL]);let E=R.useRef(null),_=R.useRef(r);R.useEffect(()=>{_.current=r},[r]);let[I,M]=R.useState(()=>({callbacks:A,shapeUtils:n,rSelectionBounds:E,rPageState:_,bounds:{minX:0,minY:0,maxX:1/0,maxY:1/0,width:1/0,height:1/0},inputs:new ir})),T=R.useCallback(e=>{M(t=>tu(tb({},t),tp({bounds:e})))},[]);return R.createElement(tv.Provider,{value:I},R.createElement(ia,{id:i,page:a,pageState:r,assets:o,snapLines:u,eraseLine:p,grid:h,users:s,userId:l,externalContainerRef:m,hideBounds:w,hideIndicators:b,hideHandles:f,hideCloneHandles:x,hideBindingHandles:y,hideRotateHandle:C,hideResizeHandles:v,hideGrid:S,showDashedBrush:k,onBoundsChange:T,performanceMode:g,meta:c}))}),il=R.memo(R.forwardRef(function(e,t){var{children:i,className:n=""}=e,a=tx(e,["children","className"]);return R.createElement("div",tb({ref:t,className:`tl-positioned-div ${n}`,draggable:!1},a),R.createElement("div",{className:"tl-inner-div"},i))})),id=class{constructor(){ty(this,"refMap",new Map),ty(this,"boundsCache",new WeakMap),ty(this,"showCloneHandles",!1),ty(this,"hideBounds",!1),ty(this,"isStateful",!1),ty(this,"shouldRender",(e,t)=>!0),ty(this,"getRef",e=>(this.refMap.has(e.id)||this.refMap.set(e.id,R.createRef()),this.refMap.get(e.id))),ty(this,"hitTestBounds",(e,t)=>{let i=this.getBounds(e),n=tI.getRotatedCorners(i,e.rotation);return n.every(e=>tI.pointInBounds(e,t))||td(n,t).length>0}),ty(this,"getRotatedBounds",e=>tI.getBoundsFromPoints(tI.getRotatedCorners(this.getBounds(e),e.rotation)))}};ty(id,"Component",e=>R.forwardRef(e)),ty(id,"Indicator",e=>e);var ic=e.i(671173),iu=function(e,t){return(iu=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},ip=function(){return(ip=Object.assign||function(e){for(var t,i=1,n=arguments.length;it.indexOf(n)&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);at.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(i[n[a]]=e[n[a]]);return i}function im(e,t,i){if(void 0===i&&(i=Error),!e)throw new i(t)}e.i(734980);var ig=function(e,t){return(ig=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};function ib(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}ig(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}var ix=function(){return(ix=Object.assign||function(e){for(var t,i=1,n=arguments.length;i=Math.abs(e)},i2=!0;try{i2=(null==(a$=i7("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu").exec("a"))?void 0:a$[0])==="a"}catch(e){i2=!1}var i3=iq?function(e,t,i){return e.startsWith(t,i)}:function(e,t,i){return e.slice(i,i+t.length)===t},i5=iY?String.fromCodePoint:function(){for(var e,t=[],i=0;ir;){if((e=t[r++])>1114111)throw RangeError(e+" is not a valid code point");n+=e<65536?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,e%1024+56320)}return n},i4=iX?Object.fromEntries:function(e){for(var t={},i=0;i=n)){var a=e.charCodeAt(t);return a<55296||a>56319||t+1===n||(i=e.charCodeAt(t+1))<56320||i>57343?a:(a-55296<<10)+(i-56320)+65536}},i9=iJ?function(e){return e.trimStart()}:function(e){return e.replace(i$,"")},i8=i0?function(e){return e.trimEnd()}:function(e){return e.replace(iZ,"")};function i7(e,t){return new RegExp(e,t)}if(i2){var ne=i7("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");aZ=function(e,t){var i;return ne.lastIndex=t,null!=(i=ne.exec(e)[1])?i:""}}else aZ=function(e,t){for(var i=[];;){var n,a=i6(e,t);if(void 0===a||nn(a)||(n=a)>=33&&n<=35||36===n||n>=37&&n<=39||40===n||41===n||42===n||43===n||44===n||45===n||n>=46&&n<=47||n>=58&&n<=59||n>=60&&n<=62||n>=63&&n<=64||91===n||92===n||93===n||94===n||96===n||123===n||124===n||125===n||126===n||161===n||n>=162&&n<=165||166===n||167===n||169===n||171===n||172===n||174===n||176===n||177===n||182===n||187===n||191===n||215===n||247===n||n>=8208&&n<=8213||n>=8214&&n<=8215||8216===n||8217===n||8218===n||n>=8219&&n<=8220||8221===n||8222===n||8223===n||n>=8224&&n<=8231||n>=8240&&n<=8248||8249===n||8250===n||n>=8251&&n<=8254||n>=8257&&n<=8259||8260===n||8261===n||8262===n||n>=8263&&n<=8273||8274===n||8275===n||n>=8277&&n<=8286||n>=8592&&n<=8596||n>=8597&&n<=8601||n>=8602&&n<=8603||n>=8604&&n<=8607||8608===n||n>=8609&&n<=8610||8611===n||n>=8612&&n<=8613||8614===n||n>=8615&&n<=8621||8622===n||n>=8623&&n<=8653||n>=8654&&n<=8655||n>=8656&&n<=8657||8658===n||8659===n||8660===n||n>=8661&&n<=8691||n>=8692&&n<=8959||n>=8960&&n<=8967||8968===n||8969===n||8970===n||8971===n||n>=8972&&n<=8991||n>=8992&&n<=8993||n>=8994&&n<=9e3||9001===n||9002===n||n>=9003&&n<=9083||9084===n||n>=9085&&n<=9114||n>=9115&&n<=9139||n>=9140&&n<=9179||n>=9180&&n<=9185||n>=9186&&n<=9254||n>=9255&&n<=9279||n>=9280&&n<=9290||n>=9291&&n<=9311||n>=9472&&n<=9654||9655===n||n>=9656&&n<=9664||9665===n||n>=9666&&n<=9719||n>=9720&&n<=9727||n>=9728&&n<=9838||9839===n||n>=9840&&n<=10087||10088===n||10089===n||10090===n||10091===n||10092===n||10093===n||10094===n||10095===n||10096===n||10097===n||10098===n||10099===n||10100===n||10101===n||n>=10132&&n<=10175||n>=10176&&n<=10180||10181===n||10182===n||n>=10183&&n<=10213||10214===n||10215===n||10216===n||10217===n||10218===n||10219===n||10220===n||10221===n||10222===n||10223===n||n>=10224&&n<=10239||n>=10240&&n<=10495||n>=10496&&n<=10626||10627===n||10628===n||10629===n||10630===n||10631===n||10632===n||10633===n||10634===n||10635===n||10636===n||10637===n||10638===n||10639===n||10640===n||10641===n||10642===n||10643===n||10644===n||10645===n||10646===n||10647===n||10648===n||n>=10649&&n<=10711||10712===n||10713===n||10714===n||10715===n||n>=10716&&n<=10747||10748===n||10749===n||n>=10750&&n<=11007||n>=11008&&n<=11055||n>=11056&&n<=11076||n>=11077&&n<=11078||n>=11079&&n<=11084||n>=11085&&n<=11123||n>=11124&&n<=11125||n>=11126&&n<=11157||11158===n||n>=11159&&n<=11263||n>=11776&&n<=11777||11778===n||11779===n||11780===n||11781===n||n>=11782&&n<=11784||11785===n||11786===n||11787===n||11788===n||11789===n||n>=11790&&n<=11798||11799===n||n>=11800&&n<=11801||11802===n||11803===n||11804===n||11805===n||n>=11806&&n<=11807||11808===n||11809===n||11810===n||11811===n||11812===n||11813===n||11814===n||11815===n||11816===n||11817===n||n>=11818&&n<=11822||11823===n||n>=11824&&n<=11833||n>=11834&&n<=11835||n>=11836&&n<=11839||11840===n||11841===n||11842===n||n>=11843&&n<=11855||n>=11856&&n<=11857||11858===n||n>=11859&&n<=11903||n>=12289&&n<=12291||12296===n||12297===n||12298===n||12299===n||12300===n||12301===n||12302===n||12303===n||12304===n||12305===n||n>=12306&&n<=12307||12308===n||12309===n||12310===n||12311===n||12312===n||12313===n||12314===n||12315===n||12316===n||12317===n||n>=12318&&n<=12319||12320===n||12336===n||64830===n||64831===n||n>=65093&&n<=65094)break;i.push(a),t+=a>=65536?2:1}return i5.apply(void 0,i)};var nt=function(){function e(e,t){void 0===t&&(t={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!t.ignoreTag,this.locale=t.locale,this.requiresOtherClause=!!t.requiresOtherClause,this.shouldParseSkeletons=!!t.shouldParseSkeletons}return e.prototype.parse=function(){if(0!==this.offset())throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},e.prototype.parseMessage=function(e,t,i){for(var n=[];!this.isEOF();){var a=this.char();if(123===a){var r=this.parseArgument(e,i);if(r.err)return r;n.push(r.val)}else if(125===a&&e>0)break;else if(35===a&&("plural"===t||"selectordinal"===t)){var o=this.clonePosition();this.bump(),n.push({type:aV.pound,location:iK(o,this.clonePosition())})}else if(60!==a||this.ignoreTag||47!==this.peek())if(60===a&&!this.ignoreTag&&ni(this.peek()||0)){var r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{var r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}else if(!i)return this.error(aU.UNMATCHED_CLOSING_TAG,iK(this.clonePosition(),this.clonePosition()));else break}return{val:n,err:null}},e.prototype.parseTag=function(e,t){var i=this.clonePosition();this.bump();var n=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:aV.literal,value:"<".concat(n,"/>"),location:iK(i,this.clonePosition())},err:null};if(!this.bumpIf(">"))return this.error(aU.INVALID_TAG,iK(i,this.clonePosition()));var a=this.parseMessage(e+1,t,!0);if(a.err)return a;var r=a.val,o=this.clonePosition();if(!this.bumpIf(""))?{val:{type:aV.tag,value:n,children:r,location:iK(i,this.clonePosition())},err:null}:this.error(aU.INVALID_TAG,iK(o,this.clonePosition()))},e.prototype.parseTagName=function(){var e,t=this.offset();for(this.bump();!this.isEOF()&&(45===(e=this.char())||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039);)this.bump();return this.message.slice(t,this.offset())},e.prototype.parseLiteral=function(e,t){for(var i=this.clonePosition(),n="";;){var a=this.tryParseQuote(t);if(a){n+=a;continue}var r=this.tryParseUnquoted(e,t);if(r){n+=r;continue}var o=this.tryParseLeftAngleBracket();if(o){n+=o;continue}break}var s=iK(i,this.clonePosition());return{val:{type:aV.literal,value:n,location:s},err:null}},e.prototype.tryParseLeftAngleBracket=function(){var e;return this.isEOF()||60!==this.char()||!this.ignoreTag&&(ni(e=this.peek()||0)||47===e)?null:(this.bump(),"<")},e.prototype.tryParseQuote=function(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if("plural"===e||"selectordinal"===e)break;return null;default:return null}this.bump();var t=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(39===i)if(39===this.peek())t.push(39),this.bump();else{this.bump();break}else t.push(i);this.bump()}return i5.apply(void 0,t)},e.prototype.tryParseUnquoted=function(e,t){if(this.isEOF())return null;var i=this.char();return 60===i||123===i||35===i&&("plural"===t||"selectordinal"===t)||125===i&&e>0?null:(this.bump(),i5(i))},e.prototype.parseArgument=function(e,t){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(aU.EXPECT_ARGUMENT_CLOSING_BRACE,iK(i,this.clonePosition()));if(125===this.char())return this.bump(),this.error(aU.EMPTY_ARGUMENT,iK(i,this.clonePosition()));var n=this.parseIdentifierIfPossible().value;if(!n)return this.error(aU.MALFORMED_ARGUMENT,iK(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(aU.EXPECT_ARGUMENT_CLOSING_BRACE,iK(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:aV.argument,value:n,location:iK(i,this.clonePosition())},err:null};case 44:if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(aU.EXPECT_ARGUMENT_CLOSING_BRACE,iK(i,this.clonePosition()));return this.parseArgumentOptions(e,t,n,i);default:return this.error(aU.MALFORMED_ARGUMENT,iK(i,this.clonePosition()))}},e.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),t=this.offset(),i=aZ(this.message,t),n=t+i.length;return this.bumpTo(n),{value:i,location:iK(e,this.clonePosition())}},e.prototype.parseArgumentOptions=function(e,t,i,n){var a,r=this.clonePosition(),o=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(o){case"":return this.error(aU.EXPECT_ARGUMENT_TYPE,iK(r,s));case"number":case"date":case"time":this.bumpSpace();var l=null;if(this.bumpIf(",")){this.bumpSpace();var d=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var u=i8(c.val);if(0===u.length)return this.error(aU.EXPECT_ARGUMENT_STYLE,iK(this.clonePosition(),this.clonePosition()));l={style:u,styleLocation:iK(d,this.clonePosition())}}var p=this.tryParseArgumentClose(n);if(p.err)return p;var h=iK(n,this.clonePosition());if(l&&i3(null==l?void 0:l.style,"::",0)){var m=i9(l.style.slice(2));if("number"===o){var c=this.parseNumberSkeletonFromString(m,l.styleLocation);if(c.err)return c;return{val:{type:aV.number,value:i,location:h,style:c.val},err:null}}if(0===m.length)return this.error(aU.EXPECT_DATE_TIME_SKELETON,h);var g,f=m;this.locale&&(f=function(e,t){for(var i="",n=0;n>1),l=function(e){var t,i=e.hourCycle;if(void 0===i&&e.hourCycles&&e.hourCycles.length&&(i=e.hourCycles[0]),i)switch(i){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw Error("Invalid hourCycle")}var n=e.language;return"root"!==n&&(t=e.maximize().region),(iG[t||""]||iG[n||""]||iG["".concat(n,"-001")]||iG["001"])[0]}(t);for(("H"==l||"k"==l)&&(s=0);s-- >0;)i+="a";for(;o-- >0;)i=l+i}else"J"===a?i+="H":i+=a}return i}(m,this.locale));var u={type:aG.dateTime,pattern:f,location:l.styleLocation,parsedOptions:this.shouldParseSkeletons?(g={},f.replace(iV,function(e){var t=e.length;switch(e[0]){case"G":g.era=4===t?"long":5===t?"narrow":"short";break;case"y":g.year=2===t?"2-digit":"numeric";break;case"Y":case"u":case"U":case"r":throw RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead");case"q":case"Q":throw RangeError("`q/Q` (quarter) patterns are not supported");case"M":case"L":g.month=["numeric","2-digit","short","long","narrow"][t-1];break;case"w":case"W":throw RangeError("`w/W` (week) patterns are not supported");case"d":g.day=["numeric","2-digit"][t-1];break;case"D":case"F":case"g":throw RangeError("`D/F/g` (day) patterns are not supported, use `d` instead");case"E":g.weekday=4===t?"short":5===t?"narrow":"short";break;case"e":if(t<4)throw RangeError("`e..eee` (weekday) patterns are not supported");g.weekday=["short","long","narrow","short"][t-4];break;case"c":if(t<4)throw RangeError("`c..ccc` (weekday) patterns are not supported");g.weekday=["short","long","narrow","short"][t-4];break;case"a":g.hour12=!0;break;case"b":case"B":throw RangeError("`b/B` (period) patterns are not supported, use `a` instead");case"h":g.hourCycle="h12",g.hour=["numeric","2-digit"][t-1];break;case"H":g.hourCycle="h23",g.hour=["numeric","2-digit"][t-1];break;case"K":g.hourCycle="h11",g.hour=["numeric","2-digit"][t-1];break;case"k":g.hourCycle="h24",g.hour=["numeric","2-digit"][t-1];break;case"j":case"J":case"C":throw RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead");case"m":g.minute=["numeric","2-digit"][t-1];break;case"s":g.second=["numeric","2-digit"][t-1];break;case"S":case"A":throw RangeError("`S/A` (second) patterns are not supported, use `s` instead");case"z":g.timeZoneName=t<4?"short":"long";break;case"Z":case"O":case"v":case"V":case"X":case"x":throw RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead")}return""}),g):{}};return{val:{type:"date"===o?aV.date:aV.time,value:i,location:h,style:u},err:null}}return{val:{type:"number"===o?aV.number:"date"===o?aV.date:aV.time,value:i,location:h,style:null!=(a=null==l?void 0:l.style)?a:null},err:null};case"plural":case"selectordinal":case"select":var b=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(aU.EXPECT_SELECT_ARGUMENT_OPTIONS,iK(b,ik({},b)));this.bumpSpace();var x=this.parseIdentifierIfPossible(),y=0;if("select"!==o&&"offset"===x.value){if(!this.bumpIf(":"))return this.error(aU.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,iK(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(aU.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,aU.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),x=this.parseIdentifierIfPossible(),y=c.val}var v=this.tryParsePluralOrSelectOptions(e,o,t,x);if(v.err)return v;var p=this.tryParseArgumentClose(n);if(p.err)return p;var C=iK(n,this.clonePosition());if("select"===o)return{val:{type:aV.select,value:i,options:i4(v.val),location:C},err:null};return{val:{type:aV.plural,value:i,options:i4(v.val),offset:y,pluralType:"plural"===o?"cardinal":"ordinal",location:C},err:null};default:return this.error(aU.INVALID_ARGUMENT_TYPE,iK(r,s))}},e.prototype.tryParseArgumentClose=function(e){return this.isEOF()||125!==this.char()?this.error(aU.EXPECT_ARGUMENT_CLOSING_BRACE,iK(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},e.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,t=this.clonePosition();!this.isEOF();)switch(this.char()){case 39:this.bump();var i=this.clonePosition();if(!this.bumpUntil("'"))return this.error(aU.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,iK(i,this.clonePosition()));this.bump();break;case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}return{val:this.message.slice(t.offset,this.offset()),err:null}},e.prototype.parseNumberSkeletonFromString=function(e,t){var i=[];try{i=function(e){if(0===e.length)throw Error("Number skeleton cannot be empty");for(var t=e.split(iR).filter(function(e){return e.length>0}),i=[],n=0;n1)throw RangeError("integer-width stems only accept a single optional option");n.options[0].replace(iz,function(e,i,n,a,r,o){if(i)t.minimumIntegerDigits=n.length;else if(a&&r)throw Error("We currently do not support maximum integer digits");else if(o)throw Error("We currently do not support exact integer digits");return""});continue}if(iF.test(n.stem)){t.minimumIntegerDigits=n.stem.length;continue}if(iO.test(n.stem)){if(n.options.length>1)throw RangeError("Fraction-precision stems only accept a single optional option");n.stem.replace(iO,function(e,i,n,a,r,o){return"*"===n?t.minimumFractionDigits=i.length:a&&"#"===a[0]?t.maximumFractionDigits=a.length:r&&o?(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length+o.length):(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length),""});var a=n.options[0];"w"===a?t=iN(iN({},t),{trailingZeroDisplay:"stripIfInteger"}):a&&(t=iN(iN({},t),iH(a)));continue}if(iB.test(n.stem)){t=iN(iN({},t),iH(n.stem));continue}var r=iW(n.stem);r&&(t=iN(iN({},t),r));var o=function(e){var t;if("E"===e[0]&&"E"===e[1]?(t={notation:"engineering"},e=e.slice(2)):"E"===e[0]&&(t={notation:"scientific"},e=e.slice(1)),t){var i=e.slice(0,2);if("+!"===i?(t.signDisplay="always",e=e.slice(2)):"+?"===i&&(t.signDisplay="exceptZero",e=e.slice(2)),!iF.test(e))throw Error("Malformed concise eng/scientific notation");t.minimumIntegerDigits=e.length}return t}(n.stem);o&&(t=iN(iN({},t),o))}return t}(i):{}},err:null}},e.prototype.tryParsePluralOrSelectOptions=function(e,t,i,n){for(var a,r=!1,o=[],s=new Set,l=n.value,d=n.location;;){if(0===l.length){var c=this.clonePosition();if("select"!==t&&this.bumpIf("=")){var u=this.tryParseDecimalInteger(aU.EXPECT_PLURAL_ARGUMENT_SELECTOR,aU.INVALID_PLURAL_ARGUMENT_SELECTOR);if(u.err)return u;d=iK(c,this.clonePosition()),l=this.message.slice(c.offset,this.offset())}else break}if(s.has(l))return this.error("select"===t?aU.DUPLICATE_SELECT_ARGUMENT_SELECTOR:aU.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,d);"other"===l&&(r=!0),this.bumpSpace();var p=this.clonePosition();if(!this.bumpIf("{"))return this.error("select"===t?aU.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:aU.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,iK(this.clonePosition(),this.clonePosition()));var h=this.parseMessage(e+1,t,i);if(h.err)return h;var m=this.tryParseArgumentClose(p);if(m.err)return m;o.push([l,{value:h.val,location:iK(p,this.clonePosition())}]),s.add(l),this.bumpSpace(),l=(a=this.parseIdentifierIfPossible()).value,d=a.location}return 0===o.length?this.error("select"===t?aU.EXPECT_SELECT_ARGUMENT_SELECTOR:aU.EXPECT_PLURAL_ARGUMENT_SELECTOR,iK(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!r?this.error(aU.MISSING_OTHER_CLAUSE,iK(this.clonePosition(),this.clonePosition())):{val:o,err:null}},e.prototype.tryParseDecimalInteger=function(e,t){var i=1,n=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var a=!1,r=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)a=!0,r=10*r+(o-48),this.bump();else break}var s=iK(n,this.clonePosition());return a?i1(r*=i)?{val:r,err:null}:this.error(t,s):this.error(e,s)},e.prototype.offset=function(){return this.position.offset},e.prototype.isEOF=function(){return this.offset()===this.message.length},e.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},e.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var t=i6(this.message,e);if(void 0===t)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return t},e.prototype.error=function(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}},e.prototype.bump=function(){if(!this.isEOF()){var e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},e.prototype.bumpIf=function(e){if(i3(this.message,e,this.offset())){for(var t=0;t=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},e.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var t=this.offset();if(t===e)break;if(t>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},e.prototype.bumpSpace=function(){for(;!this.isEOF()&&nn(this.char());)this.bump()},e.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),t=this.offset(),i=this.message.charCodeAt(t+(e>=65536?2:1));return null!=i?i:null},e}();function ni(e){return e>=97&&e<=122||e>=65&&e<=90}function nn(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function na(e,t){void 0===t&&(t={});var i=new nt(e,t=ik({shouldParseSkeletons:!0,requiresOtherClause:!0},t)).parse();if(i.err){var n=SyntaxError(aU[i.err.kind]);throw n.location=i.err.location,n.originalMessage=i.err.message,n}return(null==t?void 0:t.captureLocation)||function e(t){t.forEach(function(t){if(delete t.location,iM(t)||iT(t))for(var i in t.options)delete t.options[i].location,e(t.options[i].value);else iE(t)&&ij(t.style)||(i_(t)||iI(t))&&iP(t.style)?delete t.style.location:iL(t)&&e(t.children)})}(i.val),i.val}function nr(e,t){var i=t&&t.cache?t.cache:nc,n=t&&t.serializer?t.serializer:nl;return(t&&t.strategy?t.strategy:function(e,t){var i,n,a=1===e.length?no:ns;return i=t.cache.create(),n=t.serializer,a.bind(this,e,i,n)})(e,{cache:i,serializer:n})}function no(e,t,i,n){var a=null==n||"number"==typeof n||"boolean"==typeof n?n:i(n),r=t.get(a);return void 0===r&&(r=e.call(this,n),t.set(a,r)),r}function ns(e,t,i){var n=Array.prototype.slice.call(arguments,3),a=i(n),r=t.get(a);return void 0===r&&(r=e.apply(this,n),t.set(a,r)),r}var nl=function(){return JSON.stringify(arguments)};function nd(){this.cache=Object.create(null)}nd.prototype.get=function(e){return this.cache[e]},nd.prototype.set=function(e,t){this.cache[e]=t};var nc={create:function(){return new nd}},nu={variadic:function(e,t){var i,n;return i=t.cache.create(),n=t.serializer,ns.bind(this,e,i,n)},monadic:function(e,t){var i,n;return i=t.cache.create(),n=t.serializer,no.bind(this,e,i,n)}};(aF=aK||(aK={})).MISSING_VALUE="MISSING_VALUE",aF.INVALID_VALUE="INVALID_VALUE",aF.MISSING_INTL_API="MISSING_INTL_API";var np=function(e){function t(t,i,n){var a=e.call(this,t)||this;return a.code=i,a.originalMessage=n,a}return iC(t,e),t.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},t}(Error),nh=function(e){function t(t,i,n,a){return e.call(this,'Invalid values for "'.concat(t,'": "').concat(i,'". Options are "').concat(Object.keys(n).join('", "'),'"'),aK.INVALID_VALUE,a)||this}return iC(t,e),t}(np),nm=function(e){function t(t,i,n){return e.call(this,'Value for "'.concat(t,'" must be of type ').concat(i),aK.INVALID_VALUE,n)||this}return iC(t,e),t}(np),ng=function(e){function t(t,i){return e.call(this,'The intl string context variable "'.concat(t,'" was not provided to the string "').concat(i,'"'),aK.MISSING_VALUE,i)||this}return iC(t,e),t}(np);function nf(e){return"function"==typeof e}function nb(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,i){e[t]=i}}}}}(aH=aq||(aq={}))[aH.literal=0]="literal",aH[aH.object=1]="object";var nx=function(){function e(t,i,n,a){void 0===i&&(i=e.defaultLocale);var r,o,s=this;if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=function(e){var t=s.formatToParts(e);if(1===t.length)return t[0].value;var i=t.reduce(function(e,t){return e.length&&t.type===aq.literal&&"string"==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e},[]);return i.length<=1?i[0]||"":i},this.formatToParts=function(e){return function e(t,i,n,a,r,o,s){if(1===t.length&&iA(t[0]))return[{type:aq.literal,value:t[0].value}];for(var l=[],d=0;d0?t[0]:"string"==typeof e?e:e[0])}},e.__parse=na,e.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},e}();function ny(e,t){var i=t&&t.cache?t.cache:nk,n=t&&t.serializer?t.serializer:nw;return(t&&t.strategy?t.strategy:function(e,t){var i,n,a=1===e.length?nv:nC;return i=t.cache.create(),n=t.serializer,a.bind(this,e,i,n)})(e,{cache:i,serializer:n})}function nv(e,t,i,n){var a=null==n||"number"==typeof n||"boolean"==typeof n?n:i(n),r=t.get(a);return void 0===r&&(r=e.call(this,n),t.set(a,r)),r}function nC(e,t,i){var n=Array.prototype.slice.call(arguments,3),a=i(n),r=t.get(a);return void 0===r&&(r=e.apply(this,n),t.set(a,r)),r}var nw=function(){return JSON.stringify(arguments)};function nS(){this.cache=Object.create(null)}nS.prototype.get=function(e){return this.cache[e]},nS.prototype.set=function(e,t){this.cache[e]=t};var nk={create:function(){return new nS}},nA={variadic:function(e,t){var i,n;return i=t.cache.create(),n=t.serializer,nC.bind(this,e,i,n)},monadic:function(e,t){var i,n;return i=t.cache.create(),n=t.serializer,nv.bind(this,e,i,n)}};(aW=aY||(aY={})).FORMAT_ERROR="FORMAT_ERROR",aW.UNSUPPORTED_FORMATTER="UNSUPPORTED_FORMATTER",aW.INVALID_CONFIG="INVALID_CONFIG",aW.MISSING_DATA="MISSING_DATA",aW.MISSING_TRANSLATION="MISSING_TRANSLATION";var nE=function(e){function t(i,n,a){var r=this,o=a?a instanceof Error?a:Error(String(a)):void 0;return(r=e.call(this,"[@formatjs/intl Error ".concat(i,"] ").concat(n,"\n").concat(o?"\n".concat(o.message,"\n").concat(o.stack):""))||this).code=i,"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(r,t),r}return ib(t,e),t}(Error),n_=function(e){function t(t,i){return e.call(this,aY.UNSUPPORTED_FORMATTER,t,i)||this}return ib(t,e),t}(nE),nI=function(e){function t(t,i){return e.call(this,aY.INVALID_CONFIG,t,i)||this}return ib(t,e),t}(nE),nM=function(e){function t(t,i){return e.call(this,aY.MISSING_DATA,t,i)||this}return ib(t,e),t}(nE),nT=function(e){function t(t,i,n){return e.call(this,aY.FORMAT_ERROR,"".concat(t,"\nLocale: ").concat(i,"\n"),n)||this}return ib(t,e),t}(nE),nL=function(e){function t(t,i,n,a){var r=e.call(this,"".concat(t,"\nMessageID: ").concat(null==n?void 0:n.id,"\nDefault Message: ").concat(null==n?void 0:n.defaultMessage,"\nDescription: ").concat(null==n?void 0:n.description,"\n"),i,a)||this;return r.descriptor=n,r}return ib(t,e),t}(nT),nj=function(e){function t(t,i){var n=e.call(this,aY.MISSING_TRANSLATION,'Missing message: "'.concat(t.id,'" for locale "').concat(i,'", using ').concat(t.defaultMessage?"default message (".concat("string"==typeof t.defaultMessage?t.defaultMessage:t.defaultMessage.map(function(e){var t;return null!=(t=e.value)?t:JSON.stringify(e)}).join(),")"):"id"," as fallback."))||this;return n.descriptor=t,n}return ib(t,e),t}(nE);function nP(e,t,i){return void 0===i&&(i={}),t.reduce(function(t,n){return n in e?t[n]=e[n]:n in i&&(t[n]=i[n]),t},{})}var nD={formats:{},messages:{},timeZone:void 0,defaultLocale:"en",defaultFormats:{},fallbackOnEmptyString:!0,onError:function(e){},onWarn:function(e){}};function nN(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function nR(e){return{create:function(){return{get:function(t){return e[t]},set:function(t,i){e[t]=i}}}}}function nO(e,t,i,n){var a,r=e&&e[t];if(r&&(a=r[i]),a)return a;n(new n_("No ".concat(t," format named: ").concat(i)))}function nB(e){im(e,"[React Intl] Could not find required `intl` object. needs to exist in the component ancestry.")}var nz=ip(ip({},nD),{textComponent:R.Fragment});function nF(e,t){if(e===t)return!0;if(!e||!t)return!1;var i=Object.keys(e),n=Object.keys(t),a=i.length;if(n.length!==a)return!1;for(var r=0;rtypeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function ap(e,t,i,n){e.addEventListener?e.addEventListener(t,i,n):e.attachEvent&&e.attachEvent("on".concat(t),function(){i(window.event)})}function ah(e,t){for(var i=t.slice(0,t.length-1),n=0;n=0;)t[i-1]+=",",t.splice(i,1),i=t.lastIndexOf("");return t}for(var ag={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"⇪":20,",":188,".":190,"/":191,"`":192,"-":au?173:189,"=":au?61:187,";":au?59:186,"'":222,"[":219,"]":221,"\\":220},af={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},ab={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},ax={16:!1,18:!1,17:!1,91:!1},ay={},av=1;av<20;av++)ag["f".concat(av)]=111+av;var aC=[],aw=!1,aS="all",ak=[],aA=function(e){return ag[e.toLowerCase()]||af[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function aE(e){aS=e||"all"}function a_(){return aS||"all"}var aI=function(e){var t=e.key,i=e.scope,n=e.method,a=e.splitKey,r=void 0===a?"+":a;am(t).forEach(function(e){var t=e.split(r),a=t.length,o=t[a-1],s="*"===o?"*":aA(o);if(ay[s]){i||(i=a_());var l=a>1?ah(af,t):[];ay[s]=ay[s].filter(function(e){return!((!n||e.method===n)&&e.scope===i&&function(e,t){for(var i=e.length>=t.length?e:t,n=e.length>=t.length?t:e,a=!0,r=0;r0,ax)Object.prototype.hasOwnProperty.call(ax,r)&&(!ax[r]&&t.mods.indexOf(+r)>-1||ax[r]&&-1===t.mods.indexOf(+r))&&(a=!1);(0!==t.mods.length||ax[16]||ax[18]||ax[17]||ax[91])&&!a&&"*"!==t.shortcut||!1!==t.method(e,t)||(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function aT(e,t){var i=ay["*"],n=e.keyCode||e.which||e.charCode;if(aL.filter.call(this,e)){if((93===n||224===n)&&(n=91),-1===aC.indexOf(n)&&229!==n&&aC.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(t){var i=ab[t];e[t]&&-1===aC.indexOf(i)?aC.push(i):!e[t]&&aC.indexOf(i)>-1?aC.splice(aC.indexOf(i),1):"metaKey"===t&&e[t]&&3===aC.length&&!(e.ctrlKey||e.shiftKey||e.altKey)&&(aC=aC.slice(aC.indexOf(i)))}),n in ax){for(var a in ax[n]=!0,af)af[a]===n&&(aL[a]=!0);if(!i)return}for(var r in ax)Object.prototype.hasOwnProperty.call(ax,r)&&(ax[r]=e[ab[r]]);e.getModifierState&&!(e.altKey&&!e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===aC.indexOf(17)&&aC.push(17),-1===aC.indexOf(18)&&aC.push(18),ax[17]=!0,ax[18]=!0);var o=a_();if(i)for(var s=0;s1&&(r=ah(af,e)),(e="*"===(e=e[e.length-1])?"*":aA(e))in ay||(ay[e]=[]),ay[e].push({keyup:d,keydown:c,scope:o,mods:r,shortcut:a[l],method:i,key:a[l],splitKey:u,element:s});void 0!==s&&(n=s,!(ak.indexOf(n)>-1))&&window&&(ak.push(s),ap(s,"keydown",function(e){aT(e,s)},p),aw||(aw=!0,ap(window,"focus",function(){aC=[]},p)),ap(s,"keyup",function(e){aT(e,s);var t=e.keyCode||e.which||e.charCode,i=aC.indexOf(t);if(i>=0&&aC.splice(i,1),e.key&&"meta"===e.key.toLowerCase()&&aC.splice(0,aC.length),(93===t||224===t)&&(t=91),t in ax)for(var n in ax[t]=!1,af)af[n]===t&&(aL[n]=!1)},p))}var aj={setScope:aE,getScope:a_,deleteScope:function(e,t){var i,n;for(var a in e||(e=a_()),ay)if(Object.prototype.hasOwnProperty.call(ay,a))for(n=0,i=ay[a];n1&&void 0!==arguments[1]?arguments[1]:"all";Object.keys(ay).forEach(function(i){var n=ay[i].find(function(i){return i.scope===t&&i.shortcut===e});n&&n.method&&n.method()})},unbind:function(e){if(void 0===e)Object.keys(ay).forEach(function(e){return delete ay[e]});else if(Array.isArray(e))e.forEach(function(e){e.key&&aI(e)});else if("object"==typeof e)e.key&&aI(e);else if("string"==typeof e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;ntypeof window){var aD=window.hotkeys;aL.noConflict=function(e){return e&&window.hotkeys===aL&&(window.hotkeys=aD),aL},window.hotkeys=aL}aL.filter=function(){return!0};var aN=function(e,t){var i=e.target,n=i&&i.tagName;return!!(n&&t&&t.includes(n))};function aR(e,t,i,n){i instanceof Array&&(n=i,i=void 0);var a=i||{},r=a.enableOnTags,o=a.filter,s=a.keyup,l=a.keydown,d=a.filterPreventDefault,c=void 0===d||d,u=a.enabled,p=void 0===u||u,h=a.enableOnContentEditable,m=void 0!==h&&h,g=(0,R.useRef)(null),f=(0,R.useCallback)(function(e,i){var n,a;return o&&!o(e)?!c:!(!aN(e,["INPUT","TEXTAREA","SELECT"])||aN(e,r))||null!=(n=e.target)&&!!n.isContentEditable&&!m||!!(null===g.current||document.activeElement===g.current||null!=(a=g.current)&&a.contains(document.activeElement))&&(t(e,i),!0)},n?[g,r,o].concat(n):[g,r,o]);return(0,R.useEffect)(function(){return p?(s&&!0!==l&&(i.keydown=!1),aL(e,i||{},f),function(){return aL.unbind(e,f)}):void aL.unbind(e,f)},[f,e,p]),g}aL.isPressed;var aO,aB,az,aF,aH,aW,aU,aV,aG,a$,aZ,aK,aq,aY,aX,aQ="colors",aJ="sizes",a0="space",a1={gap:a0,gridGap:a0,columnGap:a0,gridColumnGap:a0,rowGap:a0,gridRowGap:a0,inset:a0,insetBlock:a0,insetBlockEnd:a0,insetBlockStart:a0,insetInline:a0,insetInlineEnd:a0,insetInlineStart:a0,margin:a0,marginTop:a0,marginRight:a0,marginBottom:a0,marginLeft:a0,marginBlock:a0,marginBlockEnd:a0,marginBlockStart:a0,marginInline:a0,marginInlineEnd:a0,marginInlineStart:a0,padding:a0,paddingTop:a0,paddingRight:a0,paddingBottom:a0,paddingLeft:a0,paddingBlock:a0,paddingBlockEnd:a0,paddingBlockStart:a0,paddingInline:a0,paddingInlineEnd:a0,paddingInlineStart:a0,top:a0,right:a0,bottom:a0,left:a0,scrollMargin:a0,scrollMarginTop:a0,scrollMarginRight:a0,scrollMarginBottom:a0,scrollMarginLeft:a0,scrollMarginX:a0,scrollMarginY:a0,scrollMarginBlock:a0,scrollMarginBlockEnd:a0,scrollMarginBlockStart:a0,scrollMarginInline:a0,scrollMarginInlineEnd:a0,scrollMarginInlineStart:a0,scrollPadding:a0,scrollPaddingTop:a0,scrollPaddingRight:a0,scrollPaddingBottom:a0,scrollPaddingLeft:a0,scrollPaddingX:a0,scrollPaddingY:a0,scrollPaddingBlock:a0,scrollPaddingBlockEnd:a0,scrollPaddingBlockStart:a0,scrollPaddingInline:a0,scrollPaddingInlineEnd:a0,scrollPaddingInlineStart:a0,fontSize:"fontSizes",background:aQ,backgroundColor:aQ,backgroundImage:aQ,borderImage:aQ,border:aQ,borderBlock:aQ,borderBlockEnd:aQ,borderBlockStart:aQ,borderBottom:aQ,borderBottomColor:aQ,borderColor:aQ,borderInline:aQ,borderInlineEnd:aQ,borderInlineStart:aQ,borderLeft:aQ,borderLeftColor:aQ,borderRight:aQ,borderRightColor:aQ,borderTop:aQ,borderTopColor:aQ,caretColor:aQ,color:aQ,columnRuleColor:aQ,fill:aQ,outline:aQ,outlineColor:aQ,stroke:aQ,textDecorationColor:aQ,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:aJ,minBlockSize:aJ,maxBlockSize:aJ,inlineSize:aJ,minInlineSize:aJ,maxInlineSize:aJ,width:aJ,minWidth:aJ,maxWidth:aJ,height:aJ,minHeight:aJ,maxHeight:aJ,flexBasis:aJ,gridTemplateColumns:aJ,gridTemplateRows:aJ,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},a2=(e,t)=>"function"==typeof t?{"()":Function.prototype.toString.call(t)}:t,a3=()=>{let e=Object.create(null);return(t,i,...n)=>{let a=JSON.stringify(t,a2);return a in e?e[a]:e[a]=i(t,...n)}},a5=Symbol.for("sxs.internal"),a4=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),a6=e=>{for(let t in e)return!0;return!1},{hasOwnProperty:a9}=Object.prototype,a8=e=>e.includes("-")?e:e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase()),a7=/\s+(?![^()]*\))/,re=e=>t=>e(..."string"==typeof t?String(t).split(a7):[t]),rt={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:re((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:re((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:re((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:re((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:re((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:re((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},ri=/([\d.]+)([^]*)/,rn=(e,t)=>e.length?e.reduce((e,i)=>(e.push(...t.map(e=>e.includes("&")?e.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(e)?`:is(${i})`:i):i+" "+e)),e),[]):t,ra=(e,t)=>e in rr&&"string"==typeof t?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(t,i,n,a)=>i+("stretch"===n?`-moz-available${a};${a8(e)}:${i}-webkit-fill-available`:`-moz-fit-content${a};${a8(e)}:${i}fit-content`)+a):String(t),rr={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},ro=e=>e?e+"-":"",rs=(e,t,i)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(e,n,a,r,o)=>"$"==r==!!a?e:(n||"--"==r?"calc(":"")+"var(--"+("$"===r?ro(t)+(o.includes("$")?"":ro(i))+o.replace(/\$/g,"-"):o)+")"+(n||"--"==r?"*"+(n||"")+(a||"1")+")":"")),rl=/\s*,\s*(?![^()]*\))/,rd=Object.prototype.toString,rc=(e,t,i,n,a)=>{let r,o,s,l=(e,t,i)=>{let d,c,u=e=>{var p;for(d in e){let h=64===d.charCodeAt(0);for(c of h&&Array.isArray(e[d])?e[d]:[e[d]]){let e=/[A-Z]/.test(p=d)?p:p.replace(/-[^]/g,e=>e[1].toUpperCase()),m="object"==typeof c&&c&&c.toString===rd&&(!n.utils[e]||!t.length);if(e in n.utils&&!m){let t=n.utils[e];if(t!==o){o=t,u(t(c)),o=null;continue}}else if(e in rt){let t=rt[e];if(t!==s){s=t,u(t(c)),s=null;continue}}if(h&&(d=(d.slice(1)in n.media?"@media "+n.media[d.slice(1)]:d).replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(e,t,i,n,a,r)=>{let o=ri.test(t),s=.0625*(o?-1:1),[l,d]=o?[n,t]:[t,n];return"("+("="===i[0]?"":">"===i[0]===o?"max-":"min-")+l+":"+("="!==i[0]&&1===i.length?d.replace(ri,(e,t,n)=>Number(t)+s*(">"===i?1:-1)+n):d)+(a?") and ("+(">"===a[0]?"min-":"max-")+l+":"+(1===a.length?r.replace(ri,(e,t,i)=>Number(t)+s*(">"===a?-1:1)+i):r):"")+")"})),m){let e=h?i.concat(d):[...i],n=h?[...t]:rn(t,d.split(rl));void 0!==r&&a(ru(...r)),r=void 0,l(c,n,e)}else void 0===r&&(r=[[],t,i]),d=h||36!==d.charCodeAt(0)?d:`--${ro(n.prefix)}${d.slice(1).replace(/\$/g,"-")}`,c=m?c:"number"==typeof c?c&&e in rp?String(c)+"px":String(c):rs(ra(e,null==c?"":c),n.prefix,n.themeMap[e]),r[0].push(`${h?`${d} `:`${a8(d)}:`}${c}`)}}};u(e),void 0!==r&&a(ru(...r)),r=void 0};l(e,t,i)},ru=(e,t,i)=>`${i.map(e=>`${e}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(i.length?i.length+1:0).join("}")}`,rp={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},rh=e=>String.fromCharCode(e+(e>25?39:97)),rm=e=>(e=>{let t,i="";for(t=Math.abs(e);t>52;t=t/52|0)i=rh(t%52)+i;return rh(t%52)+i})(((e,t)=>{let i=t.length;for(;i;)e=33*e^t.charCodeAt(--i);return e})(5381,JSON.stringify(e))>>>0),rg=["themed","global","styled","onevar","resonevar","allvar","inline"],rf=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch(e){return!1}},rb=e=>{let t=e.group,i=t.cssRules.length;e.apply=e=>{try{t.insertRule(e,i),++i}catch(e){}}},rx=Symbol(),ry=a3(),rv=(e,t)=>ry(e,()=>(...i)=>{let n={type:null,composers:new Set};for(let t of i)if(null!=t)if(t[a5])for(let e of(null==n.type&&(n.type=t[a5].type),t[a5].composers))n.composers.add(e);else t.constructor!==Object||t.$$typeof?null==n.type&&(n.type=t):n.composers.add(rC(t,e));return null==n.type&&(n.type="span"),n.composers.size||n.composers.add(["PJLV",{},[],[],{},[]]),rw(e,n,t)}),rC=({variants:e,compoundVariants:t,defaultVariants:i,...n},a)=>{let r=`${ro(a.prefix)}c-${rm(n)}`,o=[],s=[],l=Object.create(null),d=[];for(let e in i)l[e]=String(i[e]);if("object"==typeof e&&e)for(let t in e){a9.call(l,t)||(l[t]="undefined");let i=e[t];for(let e in i){let n={[t]:String(e)};"undefined"===String(e)&&d.push(t);let a=i[e],r=[n,a,!a6(a)];o.push(r)}}if("object"==typeof t&&t)for(let e of t){let{css:t,...i}=e;for(let e in t="object"==typeof t&&t||{},i)i[e]=String(i[e]);let n=[i,t,!a6(t)];s.push(n)}return[r,n,o,s,l,d]},rw=(e,t,i)=>{let[n,a,r,o]=rS(t.composers),s="function"==typeof t.type||t.type.$$typeof?(e=>{function t(){for(let i=0;it.rules[e]={apply:i=>t[rx].push([e,i])}),t})(i):null,l=(s||i).rules,d=`.${n}${a.length>1?`:where(.${a.slice(1).join(".")})`:""}`,c=c=>{let{css:u,...p}=c="object"==typeof c&&c||rA,h={};for(let e in r)if(delete p[e],e in c){let t=c[e];"object"==typeof t&&t?h[e]={"@initial":r[e],...t}:(t=String(t),h[e]="undefined"!==t||o.has(e)?t:r[e])}else h[e]=r[e];let m=new Set([...a]);for(let[n,a,r,o]of t.composers){i.rules.styled.cache.has(n)||(i.rules.styled.cache.add(n),rc(a,[`.${n}`],[],e,e=>{l.styled.apply(e)}));let t=rk(r,h,e.media),s=rk(o,h,e.media,!0);for(let a of t)if(void 0!==a)for(let[t,r,o]of a){let a=`${n}-${rm(r)}-${t}`;m.add(a);let s=(o?i.rules.resonevar:i.rules.onevar).cache,d=o?l.resonevar:l.onevar;s.has(a)||(s.add(a),rc(r,[`.${a}`],[],e,e=>{d.apply(e)}))}for(let t of s)if(void 0!==t)for(let[a,r]of t){let t=`${n}-${rm(r)}-${a}`;m.add(t),i.rules.allvar.cache.has(t)||(i.rules.allvar.cache.add(t),rc(r,[`.${t}`],[],e,e=>{l.allvar.apply(e)}))}}if("object"==typeof u&&u){let t=`${n}-i${rm(u)}-css`;m.add(t),i.rules.inline.cache.has(t)||(i.rules.inline.cache.add(t),rc(u,[`.${t}`],[],e,e=>{l.inline.apply(e)}))}for(let e of String(c.className||"").trim().split(/\s+/))e&&m.add(e);let g=p.className=[...m].join(" ");return{type:t.type,className:g,selector:d,props:p,toString:()=>g,deferredInjector:s}};return a4(c,{className:n,selector:d,[a5]:t,toString:()=>(i.rules.styled.cache.has(n)||c(),n)})},rS=e=>{let t="",i=[],n={},a=[];for(let[r,,,,o,s]of e)for(let e in""===t&&(t=r),i.push(r),a.push(...s),o){let t=o[e];(void 0===n[e]||"undefined"!==t||s.includes(t))&&(n[e]=t)}return[t,i,n,new Set(a)]},rk=(e,t,i,n)=>{let a=[];t:for(let[r,o,s]of e){if(s)continue;let e,l=0,d=!1;for(e in r){let n=r[e],a=t[e];if(a!==n){if("object"!=typeof a||!a)continue t;{let e,t,r=0;for(let o in a){if(n===String(a[o])){if("@initial"!==o){let e=o.slice(1);(t=t||[]).push(e in i?i[e]:o.replace(/^@media ?/,"")),d=!0}l+=r,e=!0}++r}if(t&&t.length&&(o={["@media "+t.join(", ")]:o}),!e)continue t}}}(a[l]=a[l]||[]).push([n?"cv":`${e}-${r[e]}`,o,d])}return a},rA={},rE=a3(),r_=a3(),rI=class{constructor(e,t,i,n){this.token=null==e?"":String(e),this.value=null==t?"":String(t),this.scale=null==i?"":String(i),this.prefix=null==n?"":String(n)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+ro(this.prefix)+ro(this.scale)+this.token}toString(){return this.computedValue}},rM=a3(),rT=a3(),rL=a3(),rj=e=>{let t,i,n=(t=!1,i=rT(e,e=>{let i,n,a;t=!0;let r="prefix"in(e="object"==typeof e&&e||{})?String(e.prefix):"",o="object"==typeof e.media&&e.media||{},s="object"==typeof e.root?e.root||null:globalThis.document||null,l="object"==typeof e.theme&&e.theme||{},d={prefix:r,media:o,theme:l,themeMap:"object"==typeof e.themeMap&&e.themeMap||{...a1},utils:"object"==typeof e.utils&&e.utils||{}},c=(n=()=>{let{cssRules:e}=i.sheet;return[].map.call(e,(t,n)=>{let{cssText:a}=t,r="";if(a.startsWith("--sxs"))return"";if(e[n-1]&&(r=e[n-1].cssText).startsWith("--sxs")){if(!t.cssRules.length)return"";for(let e in i.rules)if(i.rules[e].group===t)return`--sxs{--sxs:${[...i.rules[e].cache].join(" ")}}${a}`;return t.cssRules.length?`${r}${a}`:""}return a}).join("")},(a=()=>{if(i){let{rules:e,sheet:t}=i;if(!t.deleteRule){for(;3===Object(Object(t.cssRules)[0]).type;)t.cssRules.splice(0,1);t.cssRules=[]}for(let t in e)delete e[t]}for(let e of Object(s).styleSheets||[])if(rf(e)){for(let t=0,r=e.cssRules;r[t];++t){let o=Object(r[t]);if(1!==o.type)continue;let s=Object(r[t+1]);if(4!==s.type)continue;++t;let{cssText:l}=o;if(!l.startsWith("--sxs"))continue;let d=l.slice(14,-3).trim().split(/\s+/),c=rg[d[0]];c&&(i||(i={sheet:e,reset:a,rules:{},toString:n}),i.rules[c]={group:s,index:t,cache:new Set(d)})}if(i)break}if(!i){let e=(t,i)=>({type:i,cssRules:[],insertRule(t,i){this.cssRules.splice(i,0,e(t,{import:3,undefined:1}[(t.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return"@media{}"===t?`@media{${[].map.call(this.cssRules,e=>e.cssText).join("")}}`:t}});i={sheet:s?(s.head||s).appendChild(document.createElement("style")).sheet:e("","text/css"),rules:{},reset:a,toString:n}}let{sheet:e,rules:t}=i;for(let i=rg.length-1;i>=0;--i){let n=rg[i];if(!t[n]){let a=rg[i+1],r=t[a]?t[a].index:e.cssRules.length;e.insertRule("@media{}",r),e.insertRule(`--sxs{--sxs:${i}}`,r),t[n]={group:e.cssRules[r+1],index:r,cache:new Set([i])}}rb(t[n])}})(),i),u={css:rv(d,c),globalCss:rE(d,()=>(...e)=>{let t=()=>{for(let t of e){let e=rm(t="object"==typeof t&&t||{});if(!c.rules.global.cache.has(e)){if(c.rules.global.cache.add(e),"@import"in t){let e=[].indexOf.call(c.sheet.cssRules,c.rules.themed.group)-1;for(let i of[].concat(t["@import"]))i=i.includes('"')||i.includes("'")?i:`"${i}"`,c.sheet.insertRule(`@import ${i};`,e++);delete t["@import"]}rc(t,[],[],d,e=>{c.rules.global.apply(e)})}}return""};return a4(t,{toString:t})}),keyframes:r_(d,()=>e=>{let t=`${ro(d.prefix)}k-${rm(e)}`,i=()=>{if(!c.rules.global.cache.has(t)){c.rules.global.cache.add(t);let i=[];rc(e,[],[],d,e=>i.push(e));let n=`@keyframes ${t}{${i.join("")}}`;c.rules.global.apply(n)}return t};return a4(i,{get name(){return i()},toString:i})}),createTheme:rM(d,()=>(e,t)=>{t="object"==typeof e&&e||Object(t);let i=`.${e=(e="string"==typeof e?e:"")||`${ro(d.prefix)}t-${rm(t)}`}`,n={},a=[];for(let e in t)for(let i in n[e]={},t[e]){let r=`--${ro(d.prefix)}${e}-${i}`,o=rs(String(t[e][i]),d.prefix,e);n[e][i]=new rI(i,o,e,d.prefix),a.push(`${r}:${o}`)}let r=()=>{if(a.length&&!c.rules.themed.cache.has(e)){c.rules.themed.cache.add(e);let i=`${t===d.theme?":root,":""}.${e}{${a.join(";")}}`;c.rules.themed.apply(i)}return e};return{...n,get className(){return r()},selector:i,toString:r}}),reset(){c.reset(),u.theme.toString()},theme:{},sheet:c,config:d,prefix:r,getCssText:c.toString,toString:c.toString};return String(u.theme=u.createTheme(l)),u}),t||i.reset(),i);return n.styled=(({config:e,sheet:t})=>rL(e,()=>{let i=rv(e,t);return(...e)=>{let t=i(...e),n=t[a5].type,a=R.default.forwardRef((e,i)=>{let a=e&&e.as||n,{props:r,deferredInjector:o}=t(e);return delete r.as,r.ref=i,o?R.default.createElement(R.default.Fragment,null,R.default.createElement(a,r),R.default.createElement(o,null)):R.default.createElement(a,r)});return a.className=t.className,a.displayName=`Styled.${n.displayName||n.name||n}`,a.selector=t.selector,a.toString=()=>t.selector,a[a5]=t[a5],a}}))(n),n},rP=(...e)=>(aX||(aX=rj())).styled(...e);function rD(e,t,i,n=e=>e){return e*n(.5-t*(.5-i))}function rN(e,t){return[e[0]+t[0],e[1]+t[1]]}function rR(e,t){return[e[0]-t[0],e[1]-t[1]]}function rO(e,t){return[e[0]*t,e[1]*t]}function rB(e){return[e[1],-e[0]]}function rz(e,t){return e[0]*t[0]+e[1]*t[1]}function rF(e,t){var i;return(i=rR(e,t))[0]*i[0]+i[1]*i[1]}function rH(e){var t;return t=Math.hypot(e[0],e[1]),[e[0]/t,e[1]/t]}function rW(e,t,i){let n=Math.sin(i),a=Math.cos(i),r=e[0]-t[0],o=e[1]-t[1];return[r*a-o*n+t[0],r*n+o*a+t[1]]}function rU(e,t,i){return rN(e,rO(rR(t,e),i))}var{min:rV,PI:rG}=Math,r$=rG+1e-4;function rZ(e,t={}){var i,n;let{size:a=16,smoothing:r=.5,thinning:o=.5,simulatePressure:s=!0,easing:l=e=>e,start:d={},end:c={},last:u=!1}=t,{cap:p=!0,easing:h=e=>e*(2-e)}=d,{cap:m=!0,easing:g=e=>--e*e*e+1}=c;if(0===e.length||a<=0)return[];let f=e[e.length-1].runningLength,b=!1===d.taper?0:!0===d.taper?Math.max(a,f):d.taper,x=!1===c.taper?0:!0===c.taper?Math.max(a,f):c.taper,y=Math.pow(a*r,2),v=[],C=[],w=e.slice(0,10).reduce((e,t)=>{let i=t.pressure;if(s){let n=rV(1,t.distance/a),r=rV(1,1-n);i=rV(1,e+.275*n*(r-e))}return(e+i)/2},e[0].pressure),S=rD(a,o,e[e.length-1].pressure,l),k,A=e[0].vector,E=e[0].point,_=E,I=E,M=_,T=!1;for(let t=0;trz(r,A)&&!T,L=null!==p&&p<0;if(m||L){let e=rO(rB(A),S);for(let t=1/13,i=0;i<=1;i+=t)I=rW(rR(n,e),n,r$*i),v.push(I),M=rW(rN(n,e),n,-(r$*i)),C.push(M);E=I,_=M,L&&(T=!0);continue}if(T=!1,t===e.length-1){let e=rO(rB(r),S);v.push(rR(n,e)),C.push(rN(n,e));continue}let j=rO(rB(rU(u,r,p)),S);I=rR(n,j),(t<=1||rF(E,I)>y)&&(v.push(I),E=I),M=rN(n,j),(t<=1||rF(_,M)>y)&&(C.push(M),_=M),w=i,A=r}let L=e[0].point.slice(0,2),j=e.length>1?e[e.length-1].point.slice(0,2):rN(e[0].point,[1,1]),P=[],D=[];if(1===e.length){if(!(b||x)||u){let e=(i=rH(rB(rR(L,j))),rN(L,rO(i,-(k||S)))),t=[];for(let i=1/13,n=i;n<=1;n+=i)t.push(rW(e,L,2*r$*n));return t}}else{if(!(b||x&&1===e.length))if(p)for(let e=1/13,t=e;t<=1;t+=e){let e=rW(C[0],L,r$*t);P.push(e)}else{let e=rR(v[0],C[0]),t=rO(e,.5),i=rO(e,.51);P.push(rR(L,t),rR(L,i),rN(L,i),rN(L,t))}let t=rB([-(n=e[e.length-1].vector)[0],-n[1]]);if(x||b&&1===e.length)D.push(j);else if(m){let e=rN(j,rO(t,S));for(let t=1/29,i=t;i<1;i+=t)D.push(rW(e,j,3*r$*i))}else D.push(rN(j,rO(t,S)),rN(j,rO(t,.99*S)),rR(j,rO(t,.99*S)),rR(j,rO(t,S)))}return v.concat(D,C.reverse(),P)}function rK(e,t={}){var i,n,a;let{streamline:r=.5,size:o=16,last:s=!1}=t;if(0===e.length)return[];let l=.15+(1-r)*.85,d=Array.isArray(e[0])?e:e.map(({x:e,y:t,pressure:i=.5})=>[e,t,i]);if(2===d.length){let e=d[1];d=d.slice(0,-1);for(let t=1;t<5;t++)d.push(rU(d[0],e,t/4))}1===d.length&&(d=[...d,[...rN(d[0],[1,1]),...d[0].slice(2)]]);let c=[{point:[d[0][0],d[0][1]],pressure:d[0][2]>=0?d[0][2]:.25,vector:[1,1],distance:0,runningLength:0}],u=!1,p=0,h=c[0],m=d.length-1;for(let e=1;e=0?d[e][2]:.5,vector:rH(rR(h.point,t)),distance:i,runningLength:p},c.push(h)}return c[0].vector=(null==(i=c[1])?void 0:i.vector)||[0,0],c}var rq=function(e,t={}){return rZ(rK(e,t),t)};function rY(e){return new Promise((t,i)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>i(e.error)})}function rX(){var e;let i,n;return t||(e="keyval",(i=indexedDB.open("keyval-store")).onupgradeneeded=()=>i.result.createObjectStore(e),n=rY(i),t=(t,i)=>n.then(n=>i(n.transaction(e,t).objectStore(e)))),t}function rQ(e,t=rX()){return t("readonly",t=>rY(t.get(e)))}function rJ(e,t,i=rX()){return i("readwrite",i=>(i.put(t,e),rY(i.transaction)))}let r0=e=>{let t,i=new Set,n=(e,n)=>{let a="function"==typeof e?e(t):e;if(a!==t){let e=t;t=(null!=n?n:"object"!=typeof a)?a:Object.assign({},t,a),i.forEach(i=>i(t,e))}},a=()=>t,r={setState:n,getState:a,subscribe:e=>(i.add(e),()=>i.delete(e)),destroy:()=>i.clear()};return t=e(n,a,r),r},r1=e=>e?r0(e):r0,{useSyncExternalStoreWithSelector:r2}=e.i(405020).default,r3=e=>{let t="function"==typeof e?r1(e):e,i=(e,i)=>(function(e,t=e.getState,i){let n=r2(e.subscribe,e.getState,e.getServerState||e.getState,t,i);return(0,R.useDebugValue)(n),n})(t,e,i);return Object.assign(i,t),i},r5=(()=>{if("u"{let t=await e.getFile();return t.handle=e,t};var oi=async(e=[{}])=>{Array.isArray(e)||(e=[e]);let t=[];e.forEach((e,i)=>{t[i]={description:e.description||"Files",accept:{}},e.mimeTypes?e.mimeTypes.map(n=>{t[i].accept[n]=e.extensions||[]}):t[i].accept["*/*"]=e.extensions||[]});let i=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),n=await Promise.all(i.map(ot));return e[0].multiple?n:n[0]},on={__proto__:null,default:oi};function oa(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(oa=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new oa(e)}let or=async(e,t,i=e.name,n)=>{let a=[],r=[];var o,s=!1,l=!1;try{for(var d,c=function(e){var t,i,n,a=2;for("u">typeof Symbol&&(i=Symbol.asyncIterator,n=Symbol.iterator);a--;){if(i&&null!=(t=e[i]))return t.call(e);if(n&&null!=(t=e[n]))return new oa(t.call(e));i="@@asyncIterator",n="@@iterator"}throw TypeError("Object is not async iterable")}(e.values());s=!(d=await c.next()).done;s=!1){let o=d.value,s=`${i}/${o.name}`;"file"===o.kind?r.push(o.getFile().then(t=>(t.directoryHandle=e,t.handle=o,Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>s})))):"directory"!==o.kind||!t||n&&n(o)||a.push(or(o,t,s,n))}}catch(e){l=!0,o=e}finally{try{s&&null!=c.return&&await c.return()}finally{if(l)throw o}}return[...(await Promise.all(a)).flat(),...await Promise.all(r)]};var oo=async(e={})=>(e.recursive=e.recursive||!1,e.mode=e.mode||"read",or(await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode}),e.recursive,void 0,e.skipDirectory)),os={__proto__:null,default:oo},ol=async(e,t=[{}],i=null,n=!1,a=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";let r=[],o=null;if(e instanceof Blob&&e.type?o=e.type:e.headers&&e.headers.get("content-type")&&(o=e.headers.get("content-type")),t.forEach((e,t)=>{r[t]={description:e.description||"Files",accept:{}},e.mimeTypes?(0===t&&o&&e.mimeTypes.push(o),e.mimeTypes.map(i=>{r[t].accept[i]=e.extensions||[]})):o?r[t].accept[o]=e.extensions||[]:r[t].accept["*/*"]=e.extensions||[]}),i)try{await i.getFile()}catch(e){if(i=null,n)throw e}let s=i||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:r,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!i&&a&&a(s);let l=await s.createWritable();if("stream"in e){let t=e.stream();return await t.pipeTo(l),s}return"body"in e?await e.body.pipeTo(l):(await l.write(await e),await l.close()),s},od={__proto__:null,default:ol},oc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,i)=>{let n=document.createElement("input");n.type="file";let a=[...e.map(e=>e.mimeTypes||[]),...e.map(e=>e.extensions||[])].join();n.multiple=e[0].multiple||!1,n.accept=a||"",n.style.display="none",document.body.append(n);let r=e=>{"function"==typeof o&&o(),t(e)},o=e[0].legacySetup&&e[0].legacySetup(r,()=>o(i),n),s=()=>{window.removeEventListener("focus",s),n.remove()};n.addEventListener("click",()=>{window.addEventListener("focus",s)}),n.addEventListener("change",()=>{window.removeEventListener("focus",s),n.remove(),r(n.multiple?Array.from(n.files):n.files[0])}),n.click()})),ou={__proto__:null,default:oc},op=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,i)=>{let n=document.createElement("input");n.type="file",n.webkitdirectory=!0;let a=e=>{"function"==typeof r&&r(),t(e)},r=e[0].legacySetup&&e[0].legacySetup(a,()=>r(i),n);n.addEventListener("change",()=>{let t=Array.from(n.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(t=t.filter(t=>t.webkitRelativePath.split("/").every(t=>!e[0].skipDirectory({name:t,kind:"directory"})))):t=t.filter(e=>2===e.webkitRelativePath.split("/").length),a(t)}),n.click()})),oh={__proto__:null,default:op},om=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);let i=document.createElement("a"),n=e;"body"in e&&(n=await async function(e,t){let i=e.getReader(),n=new Response(new ReadableStream({start:e=>(async function t(){return i.read().then(({done:i,value:n})=>{if(!i)return e.enqueue(n),t();e.close()})})()})),a=await n.blob();return i.releaseLock(),new Blob([a],{type:t})}(e.body,e.headers.get("content-type"))),i.download=t.fileName||"Untitled",i.href=URL.createObjectURL(await n);let a=()=>{"function"==typeof r&&r()},r=t.legacySetup&&t.legacySetup(a,()=>r(),i);return i.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(i.href),3e4),a()}),i.click(),null},og={__proto__:null,default:om};e.s(["directoryOpen",0,r8,"directoryOpenLegacy",0,op,"directoryOpenModern",0,oo,"fileOpen",0,r6,"fileOpenLegacy",0,oc,"fileOpenModern",0,oi,"fileSave",0,oe,"fileSaveLegacy",0,om,"fileSaveModern",0,ol,"supported",0,r5],323681);var of=e.i(323681),ob=Object.defineProperty,ox=Object.defineProperties,oy=Object.getOwnPropertyDescriptor,ov=Object.getOwnPropertyDescriptors,oC=Object.getOwnPropertyNames,ow=Object.getOwnPropertySymbols,oS=Object.prototype.hasOwnProperty,ok=Object.prototype.propertyIsEnumerable,oA=(e,t,i)=>t in e?ob(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,oE=(e,t)=>{for(var i in t||(t={}))oS.call(t,i)&&oA(e,i,t[i]);if(ow)for(var i of ow(t))ok.call(t,i)&&oA(e,i,t[i]);return e},o_=(e,t)=>ox(e,ov(t)),oI=(e,t)=>{for(var i in t)ob(e,i,{get:t[i],enumerable:!0})},oM=(e,t,i)=>(oA(e,"symbol"!=typeof t?t+"":t,i),i),oT=(e,t,i)=>new Promise((n,a)=>{var r=e=>{try{s(i.next(e))}catch(e){a(e)}},o=e=>{try{s(i.throw(e))}catch(e){a(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(r,o);s((i=i.apply(e,t)).next())}),oL=class{constructor(){oM(this,"onPinchStart"),oM(this,"onPinchEnd"),oM(this,"onPinch"),oM(this,"onKeyDown"),oM(this,"onKeyUp"),oM(this,"onPointerMove"),oM(this,"onPointerUp"),oM(this,"onPan"),oM(this,"onZoom"),oM(this,"onPointerDown"),oM(this,"onPointCanvas"),oM(this,"onDoubleClickCanvas"),oM(this,"onRightPointCanvas"),oM(this,"onDragCanvas"),oM(this,"onReleaseCanvas"),oM(this,"onPointShape"),oM(this,"onDoubleClickShape"),oM(this,"onRightPointShape"),oM(this,"onDragShape"),oM(this,"onHoverShape"),oM(this,"onUnhoverShape"),oM(this,"onReleaseShape"),oM(this,"onPointBounds"),oM(this,"onDoubleClickBounds"),oM(this,"onRightPointBounds"),oM(this,"onDragBounds"),oM(this,"onHoverBounds"),oM(this,"onUnhoverBounds"),oM(this,"onReleaseBounds"),oM(this,"onPointBoundsHandle"),oM(this,"onDoubleClickBoundsHandle"),oM(this,"onRightPointBoundsHandle"),oM(this,"onDragBoundsHandle"),oM(this,"onHoverBoundsHandle"),oM(this,"onUnhoverBoundsHandle"),oM(this,"onReleaseBoundsHandle"),oM(this,"onPointHandle"),oM(this,"onDoubleClickHandle"),oM(this,"onRightPointHandle"),oM(this,"onDragHandle"),oM(this,"onHoverHandle"),oM(this,"onUnhoverHandle"),oM(this,"onReleaseHandle"),oM(this,"onShapeBlur"),oM(this,"onShapeClone")}},oj=((o=oj||{}).Idle="idle",o.Connecting="connecting",o.Connected="connected",o.Disconnected="disconnected",o),oP=((s=oP||{}).Transform="transform",s.Translate="translate",s.TransformSingle="transformSingle",s.Brush="brush",s.Arrow="arrow",s.Draw="draw",s.Erase="erase",s.Rotate="rotate",s.Handle="handle",s.Grid="grid",s.Edit="edit",s),oD=((l=oD||{}).Idle="idle",l.PointingHandle="pointingHandle",l.PointingBounds="pointingBounds",l.PointingBoundsHandle="pointingBoundsHandle",l.TranslatingLabel="translatingLabel",l.TranslatingHandle="translatingHandle",l.Translating="translating",l.Transforming="transforming",l.Rotating="rotating",l.Pinching="pinching",l.Brushing="brushing",l.Creating="creating",l.EditingText="editing-text",l),oN=((d=oN||{}).Backward="backward",d.Forward="forward",d.ToFront="toFront",d.ToBack="toBack",d),oR=((c=oR||{}).Top="top",c.CenterVertical="centerVertical",c.Bottom="bottom",c.Left="left",c.CenterHorizontal="centerHorizontal",c.Right="right",c),oO=((u=oO||{}).Horizontal="horizontal",u.Vertical="vertical",u),oB=((p=oB||{}).Horizontal="horizontal",p.Vertical="vertical",p),oz=((h=oz||{}).Horizontal="horizontal",h.Vertical="vertical",h),oF=((m=oF||{}).Sticky="sticky",m.Ellipse="ellipse",m.Rectangle="rectangle",m.Triangle="triangle",m.Draw="draw",m.Arrow="arrow",m.Line="line",m.Text="text",m.Group="group",m.Image="image",m.Video="video",m),oH=((g=oH||{}).Arrow="arrow",g),oW=((f=oW||{}).White="white",f.LightGray="lightGray",f.Gray="gray",f.Black="black",f.Green="green",f.Cyan="cyan",f.Blue="blue",f.Indigo="indigo",f.Violet="violet",f.Red="red",f.Orange="orange",f.Yellow="yellow",f),oU=((b=oU||{}).Small="small",b.Medium="medium",b.Large="large",b),oV=((x=oV||{}).Draw="draw",x.Solid="solid",x.Dashed="dashed",x.Dotted="dotted",x),oG=((y=oG||{}).Small="small",y.Medium="medium",y.Large="large",y.ExtraLarge="extraLarge",y),o$=((v=o$||{}).Start="start",v.Middle="middle",v.End="end",v.Justify="justify",v),oZ=((C=oZ||{}).Script="script",C.Sans="sans",C.Serif="serif",C.Mono="mono",C),oK=((w=oK||{}).Image="image",w.Video="video",w),oq=((S=oq||{}).PNG="png",S.JPG="jpeg",S.WEBP="webp",S.SVG="svg",S.JSON="json",S),oY=((k=oY||{}).Transparent="transparent",k.Auto="auto",k.Light="light",k.Dark="dark",k),oX=new Map,oQ="tldraw-fonts",oJ=` @import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Source+Code+Pro&family=Source+Sans+Pro&family=Crimson+Pro&display=block'); @font-face { font-family: 'Recursive'; font-style: normal; font-weight: 500; font-display: swap; src: url(https://fonts.gstatic.com/s/recursive/v23/8vI-7wMr0mhh-RQChyHEH06TlXhq_gukbYrFMk1QuAIcyEwG_X-dpEfaE5YaERmK-CImKsvxvU-MXGX2fSqasNfUlTGZnI14ZeY.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { font-family: 'Recursive'; font-style: normal; font-weight: 700; font-display: swap; src: url(https://fonts.gstatic.com/s/recursive/v23/8vI-7wMr0mhh-RQChyHEH06TlXhq_gukbYrFMk1QuAIcyEwG_X-dpEfaE5YaERmK-CImKsvxvU-MXGX2fSqasNfUlTGZnI14ZeY.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } @font-face { font-family: 'Recursive Mono'; font-style: normal; font-weight: 420; font-display: swap; src: url(https://fonts.gstatic.com/s/recursive/v23/8vI-7wMr0mhh-RQChyHEH06TlXhq_gukbYrFMk1QuAIcyEwG_X-dpEfaE5YaERmK-CImqvTxvU-MXGX2fSqasNfUlTGZnI14ZeY.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; } `,o0=R.createContext({});function o1(){return R.useContext(o0)}var o2=R.createContext({}),o3={"style.menu.color":"Color","style.menu.fill":"Fill","style.menu.dash":"Dash","style.menu.size":"Size","style.menu.keep.open":"Keep Open","style.menu.font":"Font","style.menu.align":"Align",styles:"Styles","zoom.in":"Zoom In","zoom.out":"Zoom Out",to:"To","menu.tools":"Tools","menu.transform":"Transform","menu.file":"File","menu.edit":"Edit","menu.view":"View","menu.preferences":"Preferences","menu.sign.in":"Sign In","menu.sign.out":"Sign Out","become.a.sponsor":"Become a Sponsor","zoom.to.content":"Back to content","zoom.to.selection":"Zoom to Selection","zoom.to.fit":"Zoom to Fit","zoom.to":"Zoom to","preferences.dark.mode":"Dark Mode","preferences.focus.mode":"Focus Mode","preferences.debug.mode":"Debug Mode","preferences.show.grid":"Show Grid","preferences.use.cad.selection":"Use CAD Selection","preferences.keep.stylemenu.open":"Keep Style Menu Open","preferences.always.show.snaps":"Always Show Snaps","preferences.rotate.handles":"Rotate Handles","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"Clone Handles",undo:"Undo",redo:"Redo",cut:"Cut",copy:"Copy",paste:"Paste","copy.as":"Copy As","export.as":"Export As","select.all":"Select All","select.none":"Select None",delete:"Delete","new.project":"New Project",open:"Open",save:"Save","save.as":"Save As","upload.media":"Upload Media","create.page":"Create Page","new.page":"New Page","page.name":"Page Name",duplicate:"Duplicate",cancel:"Cancel","copy.invite.link":"Copy Invite Link","copy.readonly.link":"Copy ReadOnly Link","create.multiplayer.project":"Create a Multiplayer Project","copy.multiplayer.project":"Copy to Multiplayer Project",select:"Select",eraser:"Eraser",draw:"Draw",arrow:"Arrow",text:"Text",sticky:"Sticky",rectangle:"Rectangle",ellipse:"Ellipse",triangle:"Triangle",line:"Line",rotate:"Rotate","lock.aspect.ratio":"Lock Aspect Ratio","unlock.aspect.ratio":"Unlock Aspect Ratio",group:"Group",ungroup:"Ungroup","move.to.back":"Move to Back","move.backward":"Move Backward","move.forward":"Move Forward","move.to.front":"Move to Front","reset.angle":"Reset Angle",lock:"Lock",unlock:"Unlock","align.distribute":"Align / Distribute","move.to.page":"Move to Page","flip.horizontal":"Flip Horizontal","flip.vertical":"Flip Vertical",move:"Move","to.front":"To Front",forward:"Forward",backward:"Backward",back:"To Back",language:"Language","translation.link":"Learn More","dock.position":"Dock Position",bottom:"Bottom",left:"Left",right:"Right",top:"Top",page:"Page","keyboard.shortcuts":"Keyboard shortcuts",search:"Search",loading:"Loading{dots}","export.background":"Export Background",transparent:"Transparent",auto:"Auto",light:"Light",dark:"Dark",github:"Github",twitter:"Twitter",discord:"Discord",image:"Image","align.left":"Align Left","align.center.x":"Align Horizontal Center","align.right":"Align Right","align.top":"Align Top","align.center.y":"Align Vertical Center","align.bottom":"Align Bottom","distribute.x":"Distribute Horizontal","distribute.y":"Distribute Vertical","stretch.x":"Stretch Horizontal","stretch.y":"Stretch Vertical","dialog.save.firsttime":"Do you want to save your current project?","dialog.save.again":"Do you want to save changes to your current project?","dialog.cancel":"Cancel","dialog.no":"No","dialog.yes":"Yes","enter.file.name":"Enter file name"},o5=[{locale:"ar",label:"عربي",messages:{"style.menu.color":"اللون","style.menu.fill":"يملأ","style.menu.dash":"متقطع","style.menu.size":"حجم","style.menu.keep.open":"تبقى مفتوحة","style.menu.font":"الخط","style.menu.align":"محاذاة",styles:"الأنماط","zoom.in":"تكبير","zoom.out":"تصغير",to:"إلى","menu.tools":"أدوات","menu.transform":"التحويلات","menu.file":"ملف","menu.edit":"تحرير","menu.view":"معاينة","menu.preferences":"التفضيلات","menu.sign.in":"تسجيل الدخول","menu.sign.out":"خروج","become.a.sponsor":"كن راعياً","zoom.to.content":"العودة إلى المحتوى","zoom.to.selection":"تكبير للتحديد","zoom.to.fit":"تكبير لتناسب","zoom.to":"تكبير إلى","preferences.dark.mode":"الوضع الداكن","preferences.focus.mode":"وضع التركيز","preferences.debug.mode":"وضع التصحيح","preferences.show.grid":"اظهر الشبكة","preferences.use.cad.selection":"استخدام التحديد CAD","preferences.keep.stylemenu.open":"الاحتفاظ بقائمة النمط مفتوحة","preferences.always.show.snaps":"إظهار اللقطات دائمًا","preferences.rotate.handles":"تدوير المقابض","preferences.binding.handles":"مقابض ملزمة","preferences.clone.handles":"مقابض استنساخ",undo:"الغاء",redo:"إعادة",cut:"قطع",copy:"نسح",paste:"لصق","copy.as":"نسخ الى","export.as":"صدر الى","select.all":"اختر الكل","select.none":"لا تختر شيء",delete:"حذف","new.project":"مشروع جديد",open:"فتح",save:"حفظ","save.as":"حفظ باسم","upload.media":"تحميل الوسائط","create.page":"إنشاء صفحة","new.page":"صفحة جديدة","page.name":"اسم الصفحة",duplicate:"نسخ",cancel:"الغاء","copy.invite.link":"نسخ رابط الدعوة","copy.readonly.link":"نسخ رابط دعوة القراءة فقط","create.multiplayer.project":"قم بإنشاء مشروع متعدد اللاعبين","copy.multiplayer.project":"نسخ إلى مشروع متعدد اللاعبين",select:"اختر",eraser:"ممحاة",draw:"رسم",arrow:"سهم",text:"نص",sticky:"لاصق",rectangle:"مربع",ellipse:"بيضاوي",triangle:"مثلث",line:"خط",rotate:"دوّر","lock.aspect.ratio":"قفل نسبة الابعاد","unlock.aspect.ratio":"فتح قفل نسبة الابعاد",group:"جمّع",ungroup:"فك التجمع","move.to.back":"انتقل إلى الخلف","move.backward":"تحريك للخلف","move.forward":"تحريك للأمام","move.to.front":"تحرك للأمام","reset.angle":"إعادة ضبط الزاوية",lock:"قفل",unlock:"الغاء القفل","move.to.page":"انقل إلى الصفحة","flip.horizontal":"انعكاس أفقي","flip.vertical":"انعكاس عمودي",move:"حرّك","to.front":"للامام",forward:"للخلف",backward:"للوراء",back:"خلف",language:"لغة","translation.link":"للمزيد","dock.position":"موقع الادوات",bottom:"اسفل",left:"يسار",right:"يمين",top:"أعلى",page:"صفحة","keyboard.shortcuts":"اختصارات لوحة المفاتيح",search:"بحث",loading:"{dots}تحميل ","export.background":"تصدير الخلفية",transparent:"شـفاف",auto:"ذاتي",light:"خفيف",dark:"غامق"}},{locale:"da",label:"Danish",messages:{"style.menu.color":"Farve","style.menu.fill":"Fyld","style.menu.dash":"Streg","style.menu.size":"Størrelse","style.menu.keep.open":"Hold åben","style.menu.font":"Skrifttype","style.menu.align":"Juster",styles:"Format","zoom.in":"Zoom ind","zoom.out":"Zoom ud",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Indstillinger","menu.sign.in":"Log ind","menu.sign.out":"Log ud","become.a.sponsor":"Bliv sponsor","zoom.to.selection":"Zoom til valgte","zoom.to.fit":"Zoom til lærred","zoom.to":"Zoom til","preferences.dark.mode":"Mørkt udseende","preferences.focus.mode":"Fokus tilstand","preferences.debug.mode":"Debug tilstand","preferences.show.grid":"Vis net","preferences.use.cad.selection":"Brug CAD udvælgelse","preferences.keep.stylemenu.open":"Hold formatmenuen åben","preferences.always.show.snaps":"Vis altid snaps","preferences.rotate.handles":"Roteringshåndtag","preferences.binding.handles":"Bindingshåndtag","preferences.clone.handles":"Kloningshåndtag",undo:"Fortryd",redo:"Gentag",cut:"Klip",copy:"Kopier",paste:"Indsæt","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Vælg alt","select.none":"Fravælg alt",delete:"Slet","new.project":"Nyt projekt",open:"Åben",save:"Gem","save.as":"Gem som","upload.media":"Upload medie","create.page":"Opret side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliker",cancel:"Fortryd","copy.invite.link":"Kopier invitationslink","create.multiplayer.project":"Opret multiplayer projekt","copy.multiplayer.project":"Kopier til multiplayer projekt",select:"Vælg",eraser:"Viskelæder",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Note",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"Lås billedformat","unlock.aspect.ratio":"Frigør billedformat",group:"Grupper",ungroup:"Opdel gruppe","move.to.back":"Placer bagerst","move.backward":"Flyt tilbage","move.forward":"Flyt frem","move.to.front":"Læg forrest","reset.angle":"Nulstil vinkel",lock:"Lås",unlock:"Lås op","move.to.page":"Flyt til side","flip.horizontal":"Vend vandret","flip.vertical":"Vend lodret",move:"Flyt","to.front":"Forrest",forward:"Frem",backward:"Tilbage",back:"Bagerst",language:"Sprog"}},{locale:"de",label:"Deutsch",messages:{"style.menu.color":"Farbe","style.menu.fill":"Füllen","style.menu.dash":"Strich","style.menu.size":"Größe","style.menu.keep.open":"Offen halten","style.menu.font":"Schriftart","style.menu.align":"Ausrichten",styles:"Stile","zoom.in":"Heranzoomen","zoom.out":"Herauszoomen",to:"zu","menu.file":"Datei","menu.edit":"Bearbeiten","menu.view":"Ansicht","menu.preferences":"Präferenzen","menu.sign.in":"Einloggen","menu.sign.out":"Ausloggen","become.a.sponsor":"Sponsor werden","zoom.to.selection":"Zur Auswahl zoomen","zoom.to.fit":"Zoom anpassen","zoom.to":"Zoomen nach","preferences.dark.mode":"Dunkler Modus","preferences.focus.mode":"Fokus Modus","preferences.debug.mode":"Debug Modus","preferences.show.grid":"Gitter anzeigen","preferences.use.cad.selection":"CAD Auswahl verwenden","preferences.keep.stylemenu.open":"Stilmenü offen halten","preferences.always.show.snaps":"Hilfslinien immer anzeigen","preferences.rotate.handles":"Rotiergriffe","preferences.binding.handles":"Bindegriffe","preferences.clone.handles":"Klongriffe",undo:"Rückgängig machen",redo:"Wiederherstellen",cut:"Ausschneiden",copy:"Kopieren",paste:"Einfügen","copy.as":"Kopieren als","export.as":"Exportieren als","select.all":"Alles auswählen","select.none":"Nichts auswählen",delete:"Löschen","new.project":"Neues Projekt",open:"Öffnen",save:"Speichern","save.as":"Speichern als","upload.media":"Medien hochladen","create.page":"Seite erstellen","new.page":"Neue Seite","page.name":"Seitenname",duplicate:"Duplizieren",cancel:"Abbrechen","copy.invite.link":"Einladungslink kopieren","create.multiplayer.project":"Mehrspielerprojekt kreieren","copy.multiplayer.project":"In Mehrspielerprojekt kopieren",select:"Auswählen",eraser:"Radierer",draw:"Malen",arrow:"Pfeil",text:"Text",sticky:"Notiz",rectangle:"Rechteck",ellipse:"Ellipse",triangle:"Dreieck",line:"Linie",rotate:"Drehen","lock.aspect.ratio":"Seitenverhältnis sperren","unlock.aspect.ratio":"Seitenverhältnis entsperren",group:"Gruppieren",ungroup:"Gruppierung aufheben","move.to.back":"Nach Hinten verschieben","move.backward":"Rückwärts schieben","move.forward":"Vorwärts schieben","move.to.front":"Nach Vorne verschieben","reset.angle":"Winkel zurücksetzen",lock:"Sperren",unlock:"Entsperren","move.to.page":"Zu Seite verschieben","flip.horizontal":"Horizontal spiegeln","flip.vertical":"Vertikal spiegeln",move:"Verschieben","to.front":"Nach Vorne",forward:"Vorwärts",backward:"Rückwärts",back:"Hinten",language:"Sprache"}},{locale:"en",label:"English",messages:{}},{locale:"es",label:"Español",messages:{"style.menu.color":"Color","style.menu.fill":"Relleno","style.menu.dash":"Línea","style.menu.size":"Tamaño","style.menu.keep.open":"Mantener abierto","style.menu.font":"Fuente","style.menu.align":"Alineación",styles:"Estilos","zoom.in":"Acercar","zoom.out":"Alejar",to:"A","menu.file":"Archivo","menu.edit":"Editar","menu.view":"Ver","menu.preferences":"Preferencias","menu.sign.in":"Iniciar sesión","menu.sign.out":"Cerrar sesión","become.a.sponsor":"Conviértete en patrocinador","zoom.to.content":"Acercar al contenido","zoom.to.selection":"Acercar a la selección","zoom.to.fit":"Ajustar a la ventana","zoom.to":"Acercar a","preferences.dark.mode":"Modo oscuro","preferences.focus.mode":"Modo concentración","preferences.debug.mode":"Modo depuración","preferences.show.grid":"Mostrar cuadrícula","preferences.use.cad.selection":"Usar selección CAD","preferences.keep.stylemenu.open":"Mantener menú de estilos abierto","preferences.always.show.snaps":"Mostrar puntos de ajuste","preferences.rotate.handles":"Control de rotación","preferences.binding.handles":"Control de vinculación","preferences.clone.handles":"Control de clonación",undo:"Deshacer",redo:"Rehacer",cut:"Cortar",copy:"Copiar",paste:"Pegar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todo","select.none":"Selecionar nada",delete:"Borrar","new.project":"Nuevo Proyecto",open:"Abrir",save:"Guardar","save.as":"Guardar como","upload.media":"Subir medios","create.page":"Crear página","new.page":"Nueva página","page.name":"Nombre de página",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar invitación","copy.readonly.link":"Copiar invitación (solo lectura)","create.multiplayer.project":"Crear proyecto multijugador","copy.multiplayer.project":"Copiar proyecto multijugador",select:"Seleccionar",eraser:"Borrador",draw:"Dibujar",arrow:"Flecha",text:"Texto",sticky:"Pegatina",rectangle:"Rectángulo",ellipse:"Elipse",triangle:"Triángulo",line:"Línea",rotate:"Rotar","lock.aspect.ratio":"Bloquear relación de aspecto","unlock.aspect.ratio":"Desbloquear relación de aspecto",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Mover al fondo","move.backward":"Mover atrás","move.forward":"Mover adelante","move.to.front":"Mover al frente","reset.angle":"Restablecer ángulo",lock:"Bloquear",unlock:"Desbloquear","move.to.page":"Mover a página","flip.horizontal":"Voltear horizontalmente","flip.vertical":"Voltear verticalmente",move:"Mover","to.front":"Al frente",forward:"Adelante",backward:"Atrás",back:"Fondo",language:"Idioma","translation.link":"Saber más","dock.position":"Posición del dock",bottom:"Abajo","keyboard.shortcuts":"Atajos de teclado",loading:"Cargando{dots}",left:"Izquierda",right:"Derecha",top:"Arriba",search:"Buscar",page:"Página",image:"Imagen"}},{locale:"fa",label:"فارسی",messages:{"style.menu.color":"رنگ","style.menu.fill":"توپُر","style.menu.dash":"خط‌ چین","style.menu.size":"اندازه","style.menu.keep.open":"باز باش","style.menu.font":"فونت","style.menu.align":"تراز",styles:"استایل‌ها","zoom.in":"زوم جلو","zoom.out":"زوم عقب",to:"به","menu.file":"فایل","menu.edit":"ویرایش","menu.view":"نمایش","menu.preferences":"تنظیم‌ها","menu.sign.in":"ورود","menu.sign.out":"خروج","become.a.sponsor":" حامی شو","zoom.to.selection":"نمایش انتخاب‌شده‌ها","zoom.to.fit":"نمایش کل صفحه","zoom.to":"زوم به ","preferences.dark.mode":"حالت شب","preferences.focus.mode":"حالت تمرکز","preferences.debug.mode":"حالت عیب‌یایی","preferences.show.grid":"نمایش خطوط راهنما","preferences.use.cad.selection":"استفاده از حالت انتخابی CAD","preferences.keep.stylemenu.open":"منوی استایل باز باشه","preferences.always.show.snaps":"راهنمای لبه‌ها رو نشون بده","preferences.rotate.handles":"دستگیره‌های چرخش رو نشون بده","preferences.binding.handles":"دستهٔ لبه‌ها رو نشون بده","preferences.clone.handles":"دستگیره‌های کپی رو نشون بده",undo:"یه قدم عقب",redo:"یه قدم جلو",cut:"بریدن",copy:"کپی",paste:"جای‌گذاری","copy.as":"کپی به‌‌عنوان","export.as":"خروجی با فرمت","select.all":"انتخاب همه","select.none":"انتخاب هیچ",delete:" پاک‌کردن","new.project":"پروژهٔ تازه",open:"باز کن",save:"ذخیره","save.as":"ذخیره با اسم","upload.media":"آپلود عکس","create.page":"ساخت صفحه","new.page":"صفحهٔ تازه","page.name":"اسم صفحه",duplicate:"کپی درجا",cancel:"بی‌خیال","copy.invite.link":"کپی لینک دعوت","create.multiplayer.project":"ساخت پروژهٔ چندنفره","copy.multiplayer.project":"کپی در پروژهٔ چندنفره",select:"انتخاب",eraser:"پاک‌کن",draw:"رسم",arrow:"فلِش",text:"متن",sticky:"یادداشت",rectangle:"چارگوش",ellipse:"گردی",triangle:"سه‌گوش",line:"خط",rotate:"چرخش","lock.aspect.ratio":"تثبیت نسبت ابعاد","unlock.aspect.ratio":"نسبت ابعاد متغیر",group:"جمع کن",ungroup:"جدا کن","move.to.back":"ببر آخر","move.backward":"ببر عقب","move.forward":"ببر اول","move.to.front":"ببر جلو","reset.angle":"حذف چرخش",lock:"قفل‌ کن",unlock:"باز کن","move.to.page":"ببر به صفحه","flip.horizontal":"برگردون افقی","flip.vertical":"برگردون عمودی",move:"جابه‌جاش کن","to.front":"به اول",forward:"به جلو",backward:"به عقب",back:"به آخر",language:"زبان"}},{locale:"fr",label:"Français",messages:{"style.menu.color":"Couleur","style.menu.fill":"Remplir","style.menu.dash":"Bordure","style.menu.size":"Taille","style.menu.keep.open":"Toujours afficher le menu","style.menu.font":"Police","style.menu.align":"Alignement",styles:"Styles","zoom.in":"Zoom avant","zoom.out":"Zoom arrière",to:"À","menu.tools":"Outils","menu.transform":"Transformation","menu.file":"Fichier","menu.edit":"Édition","menu.view":"Afficher","menu.preferences":"Préférences","menu.sign.in":"S'authentifier","menu.sign.out":"Se déconnecter","become.a.sponsor":"Devenir un sponsor","zoom.to.content":"Retour au contenu","zoom.to.selection":"Ajuster le zoom à la sélection","zoom.to.fit":"Adapter le zoom au contenu","zoom.to":"Rétablir le zoom à","preferences.dark.mode":"Mode sombre","preferences.focus.mode":"Mode focus","preferences.debug.mode":"Afficher la barre développeur","preferences.show.grid":"Afficher la grille","preferences.use.cad.selection":"Utiliser la sélection CAD","preferences.keep.stylemenu.open":"Toujours afficher le menu styles","preferences.always.show.snaps":"Afficher les repères dynamiques","preferences.rotate.handles":"Manier la rotation","preferences.binding.handles":"Manier les liaisons","preferences.clone.handles":"Manier le clonage",undo:"Annuler",redo:"Rétablir",cut:"Couper",copy:"Copier",paste:"Coller","copy.as":"Copier au format","export.as":"Exporter au format","select.all":"Tout sélectionner","select.none":"Tout désélectionner",delete:"Supprimer","new.project":"Nouveau project",open:"Ouvrir",save:"Enregistrer","save.as":"Enregistrer sous","upload.media":"Importer un média","create.page":"Créer une page","new.page":"Nouvelle Page","page.name":"Nom de la page",duplicate:"Dupliquer",cancel:"Annuler","copy.invite.link":"Copier le lien d'invitation","copy.readonly.link":"Copier le lien en lecture seule d'invitation","create.multiplayer.project":"Créer un project multi-joueurs","copy.multiplayer.project":"Copier dans un projet multi-joueurs",select:"Sélection",eraser:"Gomme",draw:"Crayon",arrow:"Flèche",text:"Texte",sticky:"Note",rectangle:"Rectangle",ellipse:"Cercle",triangle:"Triangle",line:"Ligne",rotate:"Rotation","lock.aspect.ratio":"Verrouiller les proportions","unlock.aspect.ratio":"Déverrouiller les proportions",group:"Grouper",ungroup:"Dégrouper","move.to.back":"Déplacer à l'arrière-plan","move.backward":"Reculer d'un plan","move.forward":"Avancer d'un plan","move.to.front":"Placer au premier plan","reset.angle":"Réinitialiser la rotation",lock:"Verrouiller",unlock:"Déverrouiller","align.distribute":"Alignement / Répartion","move.to.page":"Déplacer vers la page","flip.horizontal":"Retourner horizontalement","flip.vertical":"Retourner verticalement",move:"Disposition","to.front":"Placer au premier plan",forward:"Avancer d'un plan",backward:"Reculer d'un plan",back:"Déplacer à l'arrière-plan",language:"Langage","translation.link":"En savoir plus","dock.position":"Position du dock",bottom:"En bas",left:"À gauche",right:"À droite",top:"En haut",page:"Page","keyboard.shortcuts":"Raccourcis clavier",search:"Rechercher",loading:"Chargement{dots}","export.background":"Couleur d'arrière-plan de l'export",transparent:"Transparent",auto:"Automatique",light:"Clair",dark:"Sombre"}},{locale:"he",label:"עברית",messages:{"style.menu.color":"צבע","style.menu.fill":"מלא","style.menu.dash":"גבול","style.menu.size":"גודל","style.menu.keep.open":"השאר פתוח","style.menu.font":"גופן","style.menu.align":"יישור",styles:"עיצוב","zoom.in":"הגדל תצוגה","zoom.out":"הקטן תצוגה",to:"ל","menu.file":"קובץ","menu.edit":"עריכה","menu.view":"תצוגה","menu.preferences":"מאפיינים","menu.sign.in":"הירשם","menu.sign.out":"התנתק","become.a.sponsor":"מתן חסות","zoom.to.selection":"זום לבחירה","zoom.to.fit":"זום להתאמה","zoom.to":"זום ל","preferences.dark.mode":"מצב חשוך","preferences.focus.mode":"מצב פוקוס","preferences.debug.mode":"מצב דיבאג","preferences.show.grid":"(גריד)הראה רשת עימוד","preferences.use.cad.selection":"סימון CAD","preferences.keep.stylemenu.open":"השאר תפריט עיצוב פתוח","preferences.always.show.snaps":"הראה קווי מתאר","preferences.rotate.handles":"הראה ידיות סיבוב","preferences.binding.handles":"הראה ידיות קשירה","preferences.clone.handles":"הראה ידיות שיכפול",undo:"בטל",redo:"עשה מחדש",cut:"גזור",copy:"העתק",paste:"הדבק","copy.as":"העתק כ","export.as":"ייצא כ","select.all":"בחר הכל","select.none":"בטל בחירה",delete:"מחק","new.project":"פרויקט חדש",open:"פתח",save:"שמור","save.as":"שמור כ","upload.media":"העלאת מדיה","create.page":"צור דף","new.page":"דף חדש","page.name":"שם הדף",duplicate:"שכפל",cancel:"בטל","copy.invite.link":"העתק קישור הזמנה","create.multiplayer.project":"צור פרויקט רב משתתפים","copy.multiplayer.project":"העתק לפרויקט רב משתתפים",select:"סמן",eraser:"מחק",draw:"צייר",arrow:"חץ",text:"טקסט",sticky:"דביקי",rectangle:"מרובע",ellipse:"אליפסה",triangle:"משולש",line:"קו",rotate:"סובב","lock.aspect.ratio":"נעל יחס רוחב-גובה","unlock.aspect.ratio":"שחרר נעילת יחס רוחב-גובה",group:"קבץ",ungroup:"בטל קיבוץ","move.to.back":"הבא לתחתית","move.backward":"הזז אחורה","move.forward":"הזז קדימה","move.to.front":"הבא לחזית","reset.angle":"אפס זווית",lock:"נעל",unlock:"שחרר נעילה","move.to.page":"הזז לדף","flip.horizontal":"הפוך אופקית","flip.vertical":"הפוך אנכית",move:"הזז","to.front":"הבא לקדימה",forward:"קדימה",backward:"אחורה",back:"בחזרה",language:"שפה"}},{locale:"it",label:"Italiano",messages:{"style.menu.color":"Colore","style.menu.fill":"Riempi","style.menu.dash":"Tratteggo","style.menu.size":"Dimensione","style.menu.keep.open":"Mantieni aperto","style.menu.font":"Font","style.menu.align":"Allineamento",styles:"Stile","zoom.in":"Ingrandisci","zoom.out":"Rimpicciolisci",to:"Imposta","menu.file":"File","menu.edit":"Modifica","menu.view":"Visualizzazione","menu.preferences":"Preferenze","menu.sign.in":"Accedi","menu.sign.out":"Esci","become.a.sponsor":"Sponsorizza","zoom.to.selection":"Adatta alla selezione","zoom.to.fit":"Adatta","zoom.to":"Ingrandisci","preferences.dark.mode":"Modalità scura","preferences.focus.mode":"Modalità zen","preferences.debug.mode":"Modalità sviluppatore","preferences.show.grid":"Mostra griglia","preferences.use.cad.selection":"Selezione CAD","preferences.keep.stylemenu.open":"Mantieni menu stile aperto","preferences.always.show.snaps":"Mostra sempre le guide","preferences.rotate.handles":"Controlli d'inclinazione","preferences.binding.handles":"Controlli d'associazione","preferences.clone.handles":"Controlli di clonazione",undo:"Annulla",redo:"Ripristina",cut:"Taglia",copy:"Copia",paste:"Incolla","copy.as":"Copia come","export.as":"Esporta come","select.all":"Seleziona tutto","select.none":"Deseleziona tutto",delete:"Elimina","new.project":"Nuovo progetto",open:"Apri",save:"Salva","save.as":"Salva come","upload.media":"Carica contenuti multimediali","create.page":"Crea nuova pagina","new.page":"Nuova pagina","page.name":"Nome pagina",page:"Pagina",duplicate:"Duplica",cancel:"Chiudi","copy.invite.link":"Copia link invito","create.multiplayer.project":"Crea progetto multiplayer","copy.multiplayer.project":"Trasforma in progetto multiplayer",select:"Seleziona",eraser:"Gomma",draw:"Matita",arrow:"Freccia",text:"Casella di testo",sticky:"Post-it",rectangle:"Rettangolo",ellipse:"Ellisse",triangle:"Triangolo",line:"Linea",rotate:"Ruota","lock.aspect.ratio":"Blocca rapporto lati","unlock.aspect.ratio":"Sblocca rapporto lati",group:"Raggruppa",ungroup:"Separa","move.to.back":"Muovi in fondo","move.backward":"Sposta indietro","move.forward":"Sposta avanti","move.to.front":"Muovi in fronte","reset.angle":"Reimposta angolo",lock:"Blocca",unlock:"Sblocca","move.to.page":"Trasferisci a pagina","flip.horizontal":"Ribalta orizzontalmente","flip.vertical":"Ribalta verticalmente",move:"Sposta","to.front":"In primo piano",forward:"Sposta avanti",backward:"Sposta indietro",back:"In fondo",language:"Lingua","dock.position":"Posizione dock",bottom:"In basso",left:"Sinistra",right:"Destra",top:"In Alto"}},{locale:"ja",label:"日本語",messages:{"style.menu.color":"色","style.menu.fill":"塗りつぶし","style.menu.dash":"線","style.menu.size":"大きさ","style.menu.keep.open":"常に表示","style.menu.font":"フォント","style.menu.align":"配置",styles:"スタイル","zoom.in":"拡大","zoom.out":"縮小",to:" ","menu.file":"ファイル","menu.edit":"編集","menu.view":"表示","menu.preferences":"設定","menu.sign.in":"サインイン","menu.sign.out":"サインアウト","become.a.sponsor":"支援する","zoom.to.selection":"選択したアイテムに合わせて拡大","zoom.to.fit":"拡大してすべてを表示","zoom.to":" ","preferences.dark.mode":"ダークモード","preferences.focus.mode":"フォーカスモード","preferences.debug.mode":"デバッグモード","preferences.show.grid":"グリッドを表示","preferences.use.cad.selection":"CADの選択法を使用","preferences.keep.stylemenu.open":"スタイルメニューを常に表示","preferences.always.show.snaps":"スナップを常に表示","preferences.rotate.handles":"回転ハンドルを表示","preferences.binding.handles":"結合ハンドルを表示","preferences.clone.handles":"クローンハンドルを表示",undo:"元に戻す",redo:"やり直し",cut:"切り取り",copy:"コピー",paste:"貼り付け","copy.as":"形式を選択してコピー","export.as":"形式を選択してエクスポート","select.all":"すべて選択","select.none":"選択を解除",delete:"削除","new.project":"新しいプロジェクト",open:"開く",save:"保存","save.as":"名前をつけて保存","upload.media":"メディアをアップロード","create.page":"ページを作成","new.page":"新規ページ","page.name":"ページ名",duplicate:"複製",cancel:"キャンセル","copy.invite.link":"共有リンクをクリップボードにコピー","create.multiplayer.project":"マルチプレイヤープロジェクトを作成","copy.multiplayer.project":"マルチプレイヤープロジェクトにコピー",select:"選択",eraser:"消しゴム",draw:"描画",arrow:"矢印",text:"テキスト",sticky:"ふせん",rectangle:"長方形",ellipse:"楕円形",triangle:"三角形",line:"線",rotate:"回転","lock.aspect.ratio":"縦横比を固定","unlock.aspect.ratio":"縦横比の固定を解除",group:"グルーピング",ungroup:"グループ解除","move.to.back":"最後面に移動","move.backward":"ひとつ後ろに移動","move.forward":"ひとつ前に移動","move.to.front":"最背面に移動","reset.angle":"角度を初期化",lock:"ロック",unlock:"アンロック","move.to.page":"ページへ移動","flip.horizontal":"水平方向に反転","flip.vertical":"垂直方向に反転",move:"移動","to.front":"最前面へ",forward:"ひとつ前へ",backward:"ひとつ後ろへ",back:"最背面へ",language:"言語"}},{locale:"ko-kr",label:"한국어",messages:{"style.menu.color":"색깔","style.menu.fill":"채우기","style.menu.dash":"테두리","style.menu.size":"크기","style.menu.keep.open":"항상 열기","style.menu.font":"글꼴","style.menu.align":"정렬",styles:"스타일","zoom.in":"확대","zoom.out":"축소",to:"to","menu.file":"파일","menu.edit":"편집","menu.view":"보기","menu.preferences":"설정","menu.sign.in":"로그인","menu.sign.out":"로그아웃","become.a.sponsor":"후원자 되기","zoom.to.selection":"선택 요소 맞추기","zoom.to.fit":"전체 맞추기","zoom.to":"맞추기","preferences.dark.mode":"다크 모드","preferences.focus.mode":"집중 모드","preferences.debug.mode":"디버그 모드","preferences.show.grid":"격자 보기","preferences.use.cad.selection":"CAD 선택 사용","preferences.keep.stylemenu.open":"스타일 메뉴 항상 열기","preferences.always.show.snaps":"Snap 항상 열기","preferences.rotate.handles":"회전 보이기","preferences.binding.handles":"Binding Handles","preferences.clone.handles":"복제 보이기",undo:"실행 취소",redo:"다시 실행",cut:"자르기",copy:"복사",paste:"붙여넣기","copy.as":"다른 형식으로 복사하기","export.as":"내보내기","select.all":"전체 선택","select.none":"선택 안함",delete:"삭제하기","new.project":"새 프로젝트",open:"열기",save:"저장","save.as":"다른 이름으로 저장","upload.media":"미디어 업로드","create.page":"새 페이지 만들기","new.page":"새 페이지","page.name":"페이지 이름",duplicate:"복제",cancel:"취소","copy.invite.link":"초대 링크 복사하기","create.multiplayer.project":"공동 프로젝트 만들기","copy.multiplayer.project":"공동 프로젝트로 복사하기",select:"선택",eraser:"지우개",draw:"그리기",arrow:"화살표",text:"텍스트",sticky:"메모",rectangle:"사각형",ellipse:"원",triangle:"삼각형",line:"선",rotate:"회전","lock.aspect.ratio":"비율 잠금","unlock.aspect.ratio":"비율 잠금 해제",group:"그룹화",ungroup:"그룹화 해제","move.to.back":"맨 뒤로 보내기","move.backward":"뒤로 보내기","move.forward":"앞으로 가져오기","move.to.front":"맨 앞으로 가져오기","reset.angle":"회전 초기화",lock:"잠구기",unlock:"잠금 해제하기","move.to.page":"페이지로 이동","flip.horizontal":"수평으로 뒤집기","flip.vertical":"수직으로 뒤집기",move:"순서","to.front":"맨 앞으로",forward:"앞으로",backward:"뒤로",back:"맨 뒤로",language:"언어"}},{locale:"ne",label:"नेपाली",messages:{"style.menu.color":"रंग","style.menu.fill":"भर्नुहोस्","style.menu.dash":"धर्का","style.menu.size":"आकार","style.menu.keep.open":"खुला राख्नुहोस्","style.menu.font":"फन्ट","style.menu.align":"पङ्क्तिबद्ध",styles:"शैलीहरू","zoom.in":"जुम इन","zoom.out":"जुम आउट",to:"टु","menu.file":"फाइल","menu.edit":"सम्पादन गर्नुहोस्","menu.view":"भ्यू","menu.preferences":"प्राथमिकताहरू","menu.sign.in":"साइन इन गर्नुहोस्","menu.sign.out":"साइन आउट गर्नुहोस्","become.a.sponsor":"प्रायोजक बन्नुहोस्","zoom.to.selection":"जुम टु सेलेक्सन","zoom.to.fit":"जुम टु फिट","zoom.to":"जुम टु","preferences.dark.mode":"अँध्यारो मोड","preferences.focus.mode":"फोकस मोड","preferences.debug.mode":"डिबग मोड","preferences.show.grid":"ग्रिड देखाउनुहोस्","preferences.use.cad.selection":"CAD सेलेक्सन गर्नुहोस्","preferences.keep.stylemenu.open":"स्टाइल मेनु खुला राख्नुहोस्","preferences.always.show.snaps":"सधैँ स्न्यापहरू देखाउनुहोस्","preferences.rotate.handles":"ह्यान्डलहरू घुमाउनुहोस्","preferences.binding.handles":"बाइन्डिङ ह्यान्डलहरू","preferences.clone.handles":"क्लोन ह्यान्डलहरू",undo:"पूर्ववत गर्नुहोस्",redo:"पुनः गर्नुहोस्",cut:"कट गर्नुहोस्",copy:"कपि गर्नुहोस्",paste:"पेस्ट गर्नुहोस्","copy.as":"कपि एज","export.as":"एक्सपोर्ट एज","select.all":"सबै छान्नुहोस्","select.none":"केहि पनि सेलेक्ट नगर्नुहोस्",delete:"मेटाउनुहोस्","new.project":"नयाँ परियोजना",open:"खोल्नुहोस्",save:"सुरक्षित गर्नुहोस्","save.as":"सेभ एज","upload.media":"मिडिया अपलोड गर्नुहोस्","create.page":"पृष्ठ सिर्जना गर्नुहोस्","new.page":"नयाँ पृष्ठ सिर्जना गर्नुहोस्","page.name":"पृष्ठको नाम",duplicate:"अनुलिपि गर्नुहोस्",cancel:"रद्द गर्नुहोस्","copy.invite.link":"निमन्त्रणा लिङ्क कपि गर्नुहोस्","create.multiplayer.project":"मल्टिप्लेयर परियोजना सिर्जना गर्नुहोस्","copy.multiplayer.project":"मल्टिप्लेयर प्रोजेक्टमा कपि गर्नुहोस्",select:"सेलेक्ट",eraser:"इरेजर",draw:"चित्र बनाउनु",arrow:"तीर",text:"शब्द",sticky:"टाँसिने",rectangle:"आयत",ellipse:"दीर्घवृत्त",triangle:"त्रिभुज",line:"रेखा",rotate:"घुमाउनुहोस्","lock.aspect.ratio":"आकार अनुपात लक गर्नुहोस्","unlock.aspect.ratio":"आकार अनुपात अनलक गर्नुहोस्",group:"समूह",ungroup:"समूह रद्द गर्नुहोस्","move.to.back":"पछाडि सार्नुहोस्","move.backward":"थप पछाडि सार्नुहोस्","move.forward":"अगाडि सार्नुहोस्","move.to.front":"थप अगाडि सार्नुहोस्","reset.angle":"कोण रिसेट गर्नुहोस्",lock:"लक गर्नुहोस्",unlock:"अनलक गर्नुहोस्","move.to.page":"पृष्ठमा सार्नुहोस्","flip.horizontal":"तेर्सो फ्लिप गर्नुहोस्","flip.vertical":"ठाडो फ्लिप गर्नुहोस्",move:"सार्नुहोस्","to.front":"थप अगाडि",forward:"अगाडि",backward:"पछाडि",back:"थप पछाडि",language:"भाषा"}},{locale:"no",label:"Norwegian",messages:{"style.menu.color":"Farge","style.menu.fill":"Fyll","style.menu.dash":"Linje","style.menu.size":"Størrelse","style.menu.keep.open":"Hold åpen","style.menu.font":"Teksttype","style.menu.align":"Juster",styles:"Stiler","zoom.in":"Zoom inn","zoom.out":"Zoom ut",to:"til","menu.file":"Fil","menu.edit":"Rediger","menu.view":"Vis","menu.preferences":"Preferanser","menu.sign.in":"Logg inn","menu.sign.out":"Logg ut","become.a.sponsor":"Bli en sponsor","zoom.to.selection":"Zoom til valg","zoom.to.fit":"Zoom for å passe","zoom.to":"Zoom til","preferences.dark.mode":"Mørk modus","preferences.focus.mode":"Fokus modus","preferences.debug.mode":"Debug modus","preferences.show.grid":"Vis rutenett","preferences.use.cad.selection":"Bruk CAD seleksjon","preferences.keep.stylemenu.open":"Hold stilmeny åpen","preferences.always.show.snaps":"Vis alltid snaps","preferences.rotate.handles":"Vis roteringshåndtak","preferences.binding.handles":"Vis bindingshåndtak","preferences.clone.handles":"Vis kloningshåndtak",undo:"Angre",redo:"Gjør om",cut:"Klipp ut",copy:"Kopier",paste:"Lim inn","copy.as":"Kopier som","export.as":"Eksporter som","select.all":"Velg alle","select.none":"Velg ingen",delete:"Slett","new.project":"Nytt prosjekt",open:"Åpne",save:"Lagre","save.as":"Lagre som","upload.media":"Last opp media","create.page":"Opprett side","new.page":"Ny side","page.name":"Sidenavn",duplicate:"Dupliser",cancel:"Avbryt","copy.invite.link":"Kopier invitasjonslink","create.multiplayer.project":"Opprett et flerspiller prosjekt","copy.multiplayer.project":"Kopier til flerspiller prosjekt",select:"Velg",eraser:"Viskelær",draw:"Tegn",arrow:"Pil",text:"Tekst",sticky:"Lapp",rectangle:"Rektangel",ellipse:"Ellipse",triangle:"Trekant",line:"Linje",rotate:"Roter","lock.aspect.ratio":"Lås størrelsesforhold","unlock.aspect.ratio":"Lås opp størrelsesforhold",group:"Grupper",ungroup:"Avgrupper","move.to.back":"Flytt bakerst","move.backward":"Flytt bakover","move.forward":"Flytt forover","move.to.front":"Flytt til front","reset.angle":"Tilbakestill vinkel",lock:"Lås",unlock:"Lås opp","move.to.page":"Flytt til side","flip.horizontal":"Snu horisontalt","flip.vertical":"Snu vertikalt",move:"Flytt","to.front":"Foran",forward:"Framover",backward:"Bakover",back:"Bakerst",language:"Språk"}},{locale:"pl",label:"Polski",messages:{"style.menu.color":"Kolor","style.menu.fill":"Wypełnienie","style.menu.dash":"Linia","style.menu.size":"Rozmiar","style.menu.keep.open":"Zachowaj otwarte","style.menu.font":"Czcionka","style.menu.align":"Wyrównanie",styles:"Style","zoom.in":"Przybliż","zoom.out":"Oddal",to:"do","menu.file":"Plik","menu.edit":"Edycja","menu.view":"Widok","menu.preferences":"Preferencje","menu.sign.in":"Zaloguj","menu.sign.out":"Wyloguj","become.a.sponsor":"Zostań sponsorem","zoom.to.selection":"Przybliż do zaznaczenia","zoom.to.fit":"Wypełnij ekran","zoom.to":"Przybliż do","preferences.dark.mode":"Tryb ciemny","preferences.focus.mode":"Tryb skupienia","preferences.debug.mode":"Tryb debugowania","preferences.show.grid":"Pokaż siatkę","preferences.use.cad.selection":"Użyj zaznaczania CAD","preferences.keep.stylemenu.open":"Zachowaj menu styli otwarte","preferences.always.show.snaps":"Przyciągaj obiekty","preferences.rotate.handles":"Uchwyty obrotu","preferences.binding.handles":"Uchwyty powiązania","preferences.clone.handles":"Uchwyty klonujące",undo:"Cofnij",redo:"Powtórz",cut:"Wytnij",copy:"Kopiuj",paste:"Wklej","copy.as":"Kopiuj jako","export.as":"Eksportuj jako","select.all":"Zaznacz wszystko","select.none":"Odznacz wszystko",delete:"Usuń","new.project":"Nowy projekt",open:"Otwórz",save:"Zapisz","save.as":"Zapisz jako","upload.media":"Załaduj multimedia","create.page":"Utwórz stronę","new.page":"Nowa strona","page.name":"Nazwa strony",duplicate:"Powiel",cancel:"Anuluj","copy.invite.link":"Kopiuj link zaproszenia","create.multiplayer.project":"Stwórz projekt wieloosobowy","copy.multiplayer.project":"Kopiuj do projektu wieloosobowego",select:"Zaznacz",eraser:"Gumka",draw:"Rysuj",arrow:"Strzałka",text:"Tekst",sticky:"Naklejka",rectangle:"Prostokąt",ellipse:"Elipsa",triangle:"Trójkąt",line:"Linia",rotate:"Obróć","lock.aspect.ratio":"Zablokuj proporcje","unlock.aspect.ratio":"Odblokuj proporcje",group:"Grupuj",ungroup:"Rozgrupuj","move.to.back":"Przenieś na tył","move.backward":"Przesuń do tyłu","move.forward":"Przesuń do przodu","move.to.front":"Przenieś na przód","reset.angle":"Resetuj kąt",lock:"Zablokuj",unlock:"Odblokuj","move.to.page":"Przenieś na stronę","flip.horizontal":"Odwróć w poziomie","flip.vertical":"Odwróć w pionie",move:"Przenieś","to.front":"Na wierzch",forward:"Do przodu",backward:"Do tyłu",back:"Na spód",language:"Język"}},{locale:"pt",label:"Português - Europeu",messages:{"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Traço","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Ficheiro","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Preferências","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom na seleção","zoom.to.fit":"Zoom para caber","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grelha","preferences.use.cad.selection":"Usar seleção CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controlo de Rotação","preferences.binding.handles":"Controlo de Binds","preferences.clone.handles":"Controlo de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Apagar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Upload Média","create.page":"Criar Página","new.page":"Nova Página","page.name":"Nome da Página",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multi-Utilizador","copy.multiplayer.project":"Copiar num Projeto Multi-Utilizador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Post-it",rectangle:"Retângulo",ellipse:"Elipse",triangle:"Triângulo",line:"Linha",rotate:"Rodar","lock.aspect.ratio":"Trancar a Proporção","unlock.aspect.ratio":"Destrancar a Proporção",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Colocar no Fundo","move.backward":"Mover abaixo","move.forward":"Mover acima","move.to.front":"Colocar à Frente","reset.angle":"Reiniciar Ângulo",lock:"Trancar",unlock:"Destrancar","move.to.page":"Mover para Página","flip.horizontal":"Inverter Horizontalmente","flip.vertical":"Inverter Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avançar",backward:"Recuar",back:"Voltar",language:"Língua"}},{locale:"pt-br",label:"Português - Brasil",messages:{"style.menu.color":"Cor","style.menu.fill":"Preencher","style.menu.dash":"Traço","style.menu.size":"Tamanho","style.menu.keep.open":"Manter aberto","style.menu.font":"Fonte","style.menu.align":"Alinhamento",styles:"Estilos","zoom.in":"Aumentar zoom","zoom.out":"Diminuir zoom",to:"para","menu.file":"Arquivo","menu.edit":"Editar","menu.view":"Visualizar","menu.preferences":"Preferências","menu.sign.in":"Entrar","menu.sign.out":"Sair","become.a.sponsor":"Torne-se um patrocinador","zoom.to.selection":"Zoom para a seleção","zoom.to.fit":"Zoom para ajuste","zoom.to":"Zoom para","preferences.dark.mode":"Modo Escuro","preferences.focus.mode":"Modo Foco","preferences.debug.mode":"Modo Debug","preferences.show.grid":"Mostrar Grade","preferences.use.cad.selection":"Usar seleção CAD","preferences.keep.stylemenu.open":"Manter Menu de Estilos Aberto","preferences.always.show.snaps":"Mostrar Pontos de Ajuste","preferences.rotate.handles":"Controle de Rotação","preferences.binding.handles":"Controle de Vínculos","preferences.clone.handles":"Controle de Clone",undo:"Desfazer",redo:"Refazer",cut:"Cortar",copy:"Copiar",paste:"Colar","copy.as":"Copiar como","export.as":"Exportar como","select.all":"Selecionar todos","select.none":"Selecionar nenhum",delete:"Deletar","new.project":"Novo Projeto",open:"Abrir",save:"Salvar","save.as":"Salvar Como","upload.media":"Carregar Mídia","create.page":"Criar Página","new.page":"Nova Página","page.name":"Nome da Página",duplicate:"Duplicar",cancel:"Cancelar","copy.invite.link":"Copiar Link de Convite","create.multiplayer.project":"Criar um Projeto Multijogador","copy.multiplayer.project":"Copiar para Projeto Multijogador",select:"Selecionar",eraser:"Borracha",draw:"Desenhar",arrow:"Seta",text:"Texto",sticky:"Adesivo",rectangle:"Retângulo",ellipse:"Elipse",triangle:"Triângulo",line:"Linha",rotate:"Rotacionar","lock.aspect.ratio":"Travar Proporção da Tela","unlock.aspect.ratio":"Destravar Proporção da Tela",group:"Agrupar",ungroup:"Desagrupar","move.to.back":"Recuar","move.backward":"Enviar para Trás","move.forward":"Avançar","move.to.front":"Trazer para Frente","reset.angle":"Reiniciar Ângulo",lock:"Travar",unlock:"Destravar","move.to.page":"Mover para Página","flip.horizontal":"Virar Horizontalmente","flip.vertical":"Virar Verticalmente",move:"Mover","to.front":"Para Frente",forward:"Avançar",backward:"Recuar",back:"Voltar",language:"Idioma"}},{locale:"ru",label:"Russian",messages:{"style.menu.color":"Цвет","style.menu.fill":"Заполнять","style.menu.dash":"Штрих","style.menu.size":"Размер","style.menu.keep.open":"Держать открытым","style.menu.font":"Шрифт","style.menu.align":"Выравнивание",styles:"Стиль","zoom.in":"Увеличить","zoom.out":"Уменьшить",to:"к","menu.tools":"Инструменты","menu.transform":"Изменение","menu.file":"Файл","menu.edit":"Редактирование","menu.view":"Вид","menu.preferences":"Настройки","menu.sign.in":"Войти","menu.sign.out":"Выйти","become.a.sponsor":"Стать спонсором","zoom.to.content":"Вернуться к содержимому","zoom.to.selection":"Масштабировать по выделению","zoom.to.fit":"Масштабировать по размеру экрана","zoom.to":"Масштабировать к","preferences.dark.mode":"Тёмная тема","preferences.focus.mode":"Минималистичный режим","preferences.debug.mode":"Режим отладки","preferences.show.grid":"Показать сетку","preferences.use.cad.selection":"Использовать CAD выделение","preferences.keep.stylemenu.open":"Держать меню стилей открытым","preferences.always.show.snaps":"Всегда показывать привязки","preferences.rotate.handles":"Ручки вращения","preferences.binding.handles":"Ручки привязки","preferences.clone.handles":"Ручки клонирования",undo:"Отменить",redo:"Повторить",cut:"Вырезать",copy:"Копировать",paste:"Вставить","copy.as":"Копировать как","export.as":"Экспортировать как","select.all":"Выделить всё","select.none":"Снять выделение",delete:"Удалить","new.project":"Новый проект",open:"Открыть",save:"Сохранить","save.as":"Сохранить как","upload.media":"Загрузить медиафайл","create.page":"Создать страницу","new.page":"Новая страница","page.name":"Название страницы",duplicate:"Дублировать",cancel:"Отменить","copy.invite.link":"Скопировать ссылку приглашения","copy.readonly.link":"Скопировать ссылку только для чтения","create.multiplayer.project":"Создать многопользовательский проект","copy.multiplayer.project":"Скопировать в многопользовательский проект",select:"Выделить",eraser:"Ластик",draw:"Рисовать",arrow:"Стрелка",text:"Текст",sticky:"Заметка",rectangle:"Прямоугольник",ellipse:"Эллипс",triangle:"Треугольник",line:"Линия",rotate:"Повернуть","lock.aspect.ratio":"Заблокировать соотношение сторон","unlock.aspect.ratio":"Разблокировать соотношение сторон",group:"Сгруппировать",ungroup:"Разгруппировать","move.to.back":"Переместить назад","move.backward":"Переместить на задний план","move.forward":"Переместить вперёд","move.to.front":"Переместить на передний план","reset.angle":"Сбросить угол",lock:"Блокировать",unlock:"Разблокировать","align.distribute":"Выровнять / распределить","move.to.page":"Переместить на страницу","flip.horizontal":"Перевернуть горизонтально","flip.vertical":"Перевернуть вертикально",move:"Переместить","to.front":"На передний план",forward:"Вперед",backward:"На задний план",back:"Назад",language:"Язык","translation.link":"Подробнее","dock.position":"Расположение панели инструментов",bottom:"Снизу",left:"Слева",right:"Справа",top:"Сверху",page:"Страница","keyboard.shortcuts":"Сочетания клавиш",search:"Поиск",loading:"Загрузка","export.background":"Экспорт фона",transparent:"Прозрачный",auto:"Авто",light:"Светлый",dark:"Тёмный",image:"Изображение","align.left":"Выровнять по левому краю","align.center.x":"Выровнять по центру горизонтально","align.right":"Выровнять по правому краю","align.top":"Выровнять по верхнему краю","align.center.y":"Выровнять по центру вертикально","align.bottom":"Выровнять по нижнему краю","distribute.x":"Распределить горизонтально","distribute.y":"Распределить вертикально","stretch.x":"Растянуть горизонтально","stretch.y":"Растянуть вертикально",share:"Поделиться","copy.current.page.link":"Скопировать ссылку на текущую страницу","copy.project.link":"Скопировать ссылку на проект","data.too.big.encoded":"Данные слишком велики, чтобы закодировать их в ссылке. Не включайте изображение или видео!","dialog.save.firsttime":"Сохранить текущий проект?","dialog.save.again":"Сохранить изменения в текущем проекте?","dialog.cancel":"Отменить","dialog.no":"Нет","dialog.yes":"Да","enter.file.name":"Введите имя файла"}},{locale:"sv",label:"Svenska",messages:{"style.menu.color":"Färg","style.menu.fill":"Ifylld","style.menu.dash":"Streck","style.menu.size":"Storlek","style.menu.keep.open":"Håll stilmenyn öppen","style.menu.font":"Typsnitt","style.menu.align":"Justera",styles:"Utseende","zoom.in":"Zooma in","zoom.out":"Zooma ut",to:"Till","menu.tools":"Verktyg","menu.transform":"Transform","menu.file":"Arkiv","menu.edit":"Redigera","menu.view":"Innehåll","menu.preferences":"Inställningar","menu.sign.in":"Logga in","menu.sign.out":"Logga ut","become.a.sponsor":"Bli en sponsor","zoom.to.content":"Anpassa zoom till innehåll","zoom.to.selection":"Anpassa zoom till urval","zoom.to.fit":"Anpassa zoom till skärm","zoom.to":"Zooma till","preferences.dark.mode":"Mörkt läge","preferences.focus.mode":"Fokusläge","preferences.debug.mode":"Debugläge","preferences.show.grid":"Visa rutnät","preferences.use.cad.selection":"Välj som i CAD-mjukvara","preferences.keep.stylemenu.open":"Håll stilmenyn öppen","preferences.always.show.snaps":"Visa alltid fästpunkter","preferences.rotate.handles":"Rotationshandtag","preferences.binding.handles":"Bindningshandtag","preferences.clone.handles":"Kloningshandtag",undo:"Ångra",redo:"Gör om",cut:"Klipp ut",copy:"Kopiera",paste:"Klistra in","copy.as":"Kopiera som","export.as":"Exportera till","select.all":"Välj alla","select.none":"Välj ingen",delete:"Radera","new.project":"Nytt projekt",open:"Öppna",save:"Spara","save.as":"Spara som","upload.media":"Ladda upp media","create.page":"Skapa sida","new.page":"Ny sida","page.name":"Sidnamn",duplicate:"Duplicera",cancel:"Avbryt","copy.invite.link":"Kopiera länk med redigeringsrättigheter","copy.readonly.link":"Kopiera länk med läsrättigheter","create.multiplayer.project":"Skapa ett Multiplayer-projekt","copy.multiplayer.project":"Kopiera till Multiplayer-project",select:"Välj",eraser:"Radera",draw:"Rita",arrow:"Pil",text:"Text",sticky:"Klisterlapp",rectangle:"Rektangel",ellipse:"Ellips",triangle:"Triangel",line:"Linje",rotate:"Rotera","lock.aspect.ratio":"Lås storleksförhållande","unlock.aspect.ratio":"Lås upp storleksförhållande",group:"Gruppera",ungroup:"Avgruppera","move.to.back":"Placera längst bak","move.backward":"Flytta bakåt","move.forward":"Flytta framåt","move.to.front":"Placera längst fram","reset.angle":"Återställ vinkel",lock:"Lås",unlock:"Lås upp","align.distribute":"Justera / Placera","move.to.page":"Flytta till sida","flip.horizontal":"Vänd horisontellt","flip.vertical":"Vänd vertikalt",move:"Flytta","to.front":"Till längst fram",forward:"Framåt",backward:"Bakåt",back:"Till längst bak",language:"Språk","translation.link":"Mer information","dock.position":"Dockningsposition",bottom:"Botten",left:"Vänster",right:"Höger",top:"Topp",page:"Sida","keyboard.shortcuts":"Tangentbordsgenvägar",search:"Sök",loading:"Laddar{dots}","export.background":"Exportbakgrund",transparent:"Transparent",auto:"Auto",light:"Ljus",dark:"Mörk",github:"Github",twitter:"Twitter",discord:"Discord",image:"Bild"}},{locale:"tr",label:"Türkçe",messages:{"style.menu.color":"Renk","style.menu.fill":"Doldur","style.menu.dash":"Çizgi","style.menu.size":"Boyut","style.menu.keep.open":"Açık Tut","style.menu.font":"Yazı Tipi","style.menu.align":"Hizala",styles:"Stiller","zoom.in":"Yakınlaştır","zoom.out":"Uzaklaştır",to:"","menu.file":"Dosya","menu.edit":"Düzenle","menu.view":"Görüntü","menu.preferences":"Tercihler","menu.sign.in":"Giriş Yap","menu.sign.out":"Oturumu Kapat","become.a.sponsor":"Sponsor Ol","zoom.to.selection":"Seçime Yakınlaştır","zoom.to.fit":"Sığdırmak için Yakınlaştır","zoom.to":"Yakınlaştır","preferences.dark.mode":"Karanlık Mod","preferences.focus.mode":"Odak Modu","preferences.debug.mode":"Debug Modu","preferences.show.grid":"Izgarayı Göster","preferences.use.cad.selection":"CAD Seçimi Kullan","preferences.keep.stylemenu.open":"Stil Menüsünü Açık Tut","preferences.always.show.snaps":"Hiza Çizgilerini Hep Göster","preferences.rotate.handles":"Rotasyon Kontrolcüleri","preferences.binding.handles":"Bağlama Kontrolcüleri","preferences.clone.handles":"Klon Kontrolcüleri",undo:"Geri Al",redo:"Yinele",cut:"Kes",copy:"Kopyala",paste:"Yapıştır","copy.as":"Olarak Kopyala","export.as":"Olarak Dışarı Aktar","select.all":"Hepsini Seç","select.none":"Hiçbirini Seçme",delete:"Sil","new.project":"Yeni Proje",open:"Aç",save:"Kaydet","save.as":"Farklı Kaydet","upload.media":"Medya Yükle","create.page":"Sayfa Oluştur","new.page":"Yeni Sayfa","page.name":"Sayfa İsmi",duplicate:"Kopya Oluştur",cancel:"İptal","copy.invite.link":"Davet Linkini Kopyala","create.multiplayer.project":"Çok Oyunculu Proje Oluştur","copy.multiplayer.project":"Çok Oyunculu Projeye Kopyala",select:"Seç",eraser:"Silgi",draw:"Çizim",arrow:"Ok",text:"Yazı",sticky:"Yapışkan",rectangle:"Dikdörtgen",ellipse:"Elips",triangle:"Üçgen",line:"Çizgi",rotate:"Döndür","lock.aspect.ratio":"En Boy Oranını Kilitle","unlock.aspect.ratio":"En Boy Oranı Kilidini Aç",group:"Grupla",ungroup:"Gruplamayı Kaldır","move.to.back":"Arkaya Taşı","move.backward":"En Arkaya Taşı","move.forward":"En Öne Taşı","move.to.front":"Öne Taşı","reset.angle":"Açıyı Sıfırla",lock:"Kilitle",unlock:"Kilidini Aç","move.to.page":"Sayfaya Taşı","flip.horizontal":"Yatay Çevir","flip.vertical":"Dikey Çevir",move:"Taşı","to.front":"Öne",forward:"En Öne",backward:"En Arkaya",back:"Arkaya",language:"Dil"}},{locale:"uk",label:"Ukrainian",messages:{"style.menu.color":"Колір","style.menu.fill":"Заповнювати","style.menu.dash":"Штрих","style.menu.size":"Розмір","style.menu.keep.open":"Тримати відкритим","style.menu.font":"Шрифт","style.menu.align":"Вирівняти",styles:"Стиль","zoom.in":"Збільшити","zoom.out":"Зменшити",to:"до","menu.file":"Файл","menu.edit":"Редагування","menu.view":"Вигляд","menu.preferences":"Налаштування","menu.sign.in":"Увійти","menu.sign.out":"Вийти","become.a.sponsor":"Стати спонсором","zoom.to.selection":"Наблизити до виділення","zoom.to.fit":"Збільшити за розміром екрану","zoom.to":"Наблизити до","preferences.dark.mode":"Темна тема","preferences.focus.mode":"Мінімалістичний режим","preferences.debug.mode":"Режим налагодження","preferences.show.grid":"Показати сітку","preferences.use.cad.selection":"Використовувати CAD виділення","preferences.keep.stylemenu.open":"Тримати меню стилів відкритим","preferences.always.show.snaps":"Завжди показувати прив'язки","preferences.rotate.handles":"Ручки обертання","preferences.binding.handles":"Ручки прив'язки","preferences.clone.handles":"Ручки клонування",undo:"Скасувати",redo:"Повторити",cut:"Вирізати",copy:"Скопіювати",paste:"Вставити","copy.as":"Скопіювати як","export.as":"Експортувати як","select.all":"Обрати все","select.none":"Зняти виділення",delete:"Видалити","new.project":"Новий проект",open:"Відкрити",save:"Зберегти","save.as":"Зберегти як","upload.media":"Завантажити медіа","create.page":"Створити сторінку","new.page":"Нова сторінка","page.name":"Назва сторінки",duplicate:"Дублювати",cancel:"Скасувати","copy.invite.link":"Скопіювати посилання на запрошення","create.multiplayer.project":"Створити багатокористувацький проект","copy.multiplayer.project":"Скопіювати в багатокористувацький проект",select:"Вибирати",eraser:"Ластик",draw:"Малювати",arrow:"Стрілка",text:"Текст",sticky:"Нотатка",rectangle:"Прямокутник",ellipse:"Еліпс",triangle:"Трикутник",line:" Лінія",rotate:"Повернути","lock.aspect.ratio":"Заблокувати співвідношення сторін","unlock.aspect.ratio":" Розблокувати співвідношення сторін",group:"Згрупувати",ungroup:" Розгрупувати","move.to.back":"Перемістити назад","move.backward":"Перемістити на задній план","move.forward":"Перемістити вперед","move.to.front":"Перемістити на передній план","reset.angle":"Скидання кута",lock:"Блокування",unlock:" Розблокування","move.to.page":"Перейти на сторінку","flip.horizontal":"Перевернути горизонтально","flip.vertical":"Перевернути вертикально",move:"Перемістити","to.front":"На передній план",forward:" Вперед",backward:"На задній план",back:"Назад",language:"Мова"}},{locale:"zh-ch",label:"简体中文",messages:{"style.menu.color":"颜色","style.menu.fill":"填充","style.menu.dash":"边框","style.menu.size":"尺寸","style.menu.keep.open":"保持常开","style.menu.font":"字体","style.menu.align":"对齐",styles:"样式","zoom.in":"放大","zoom.out":"缩小",to:"缩放至","menu.tools":"工具","menu.transform":"转换","menu.file":"文件","menu.edit":"编辑","menu.view":"视图","menu.preferences":"偏好","menu.sign.in":"登录","menu.sign.out":"登出",search:"搜索","become.a.sponsor":"成为赞助者","zoom.to.selection":"缩放选中","zoom.to.fit":"自适应缩放","zoom.to":"缩放至","zoom.to.content":"缩放至内容","preferences.dark.mode":"暗黑模式","preferences.focus.mode":"专注模式","preferences.debug.mode":"调试模式","preferences.show.grid":"显示网格","preferences.use.cad.selection":"使用 CAD 选择","preferences.keep.stylemenu.open":"保持样式菜单常开","preferences.always.show.snaps":"总是展示对齐线","preferences.rotate.handles":"旋转手柄","preferences.binding.handles":"捆绑手柄","preferences.clone.handles":"克隆手柄",undo:"撤销",redo:"重做",cut:"剪切",copy:"复制",paste:"粘贴","copy.as":"复制为","export.as":"导出为","select.all":"选中全部","select.none":"取消选中",delete:"删除","new.project":"新项目",open:"打开",save:"保存","save.as":"保存为","upload.media":"上传媒体文件","create.page":"创建页面","new.page":"新页面","page.name":"页面名称",duplicate:"复制",cancel:"取消","copy.invite.link":"复制邀请链接","create.multiplayer.project":"创建多人项目","copy.multiplayer.project":"复制到多人项目",select:"选择",eraser:"橡皮",draw:"画笔",arrow:"箭头",text:"文本",sticky:"便利贴",rectangle:"矩形",ellipse:"椭圆形",triangle:"三角形",line:"直线",rotate:"旋转","lock.aspect.ratio":"锁定宽高比","unlock.aspect.ratio":"解锁宽高比",group:"分组",ungroup:"取消分组","move.to.back":"置底","move.backward":"下移一层","move.forward":"上移一层","move.to.front":"置顶","reset.angle":"重置旋转角度",lock:"锁定",unlock:"解锁","move.to.page":"移动到页面","flip.horizontal":"水平翻转","flip.vertical":"垂直翻转",move:"移动","to.front":"置顶",forward:"上一层",backward:"下一层",back:"置底",language:"语言","keyboard.shortcuts":"键盘快捷键","translation.link":"了解更多",page:"页面","dock.position":"锚点位置",bottom:"下面",left:"左面",right:"右面",top:"上面","export.background":"导出背景色",transparent:"透明",auto:"自动",light:"明亮",dark:"暗黑","copy.readonly.link":"复制只读链接",image:"图片","align.distribute":"对齐 / 分散","dialog.save.firsttime":"您是否想保存当前的项目?","dialog.save.again":"您是否想保存对当前项目的更改?","dialog.cancel":"取消","dialog.no":"否","dialog.yes":"是"}},{locale:"zh-tw",label:"繁體中文 (台灣)",messages:{"style.menu.color":"顏色","style.menu.fill":"填充","style.menu.dash":"虛線","style.menu.size":"大小","style.menu.keep.open":"保持開啟","style.menu.font":"字型","style.menu.align":"對齊",styles:"樣式","zoom.in":"放大","zoom.out":"縮小",to:"至","menu.file":"檔案","menu.edit":"編輯","menu.view":"檢視","menu.preferences":"選項","menu.sign.in":"登入","menu.sign.out":"登出","become.a.sponsor":"成為贊助者","zoom.to.selection":"縮放至選取範圍","zoom.to.fit":"縮放至適當大小","zoom.to":"縮放至","preferences.dark.mode":"深色模式","preferences.focus.mode":"專注模式","preferences.debug.mode":"除錯模式","preferences.show.grid":"顯示網格","preferences.use.cad.selection":"使用 CAD 選取","preferences.keep.stylemenu.open":"樣式選單保持開啟","preferences.always.show.snaps":"永遠顯示對齊線","preferences.rotate.handles":"旋轉控點","preferences.binding.handles":"綁定控點","preferences.clone.handles":"複製控點",undo:"復原",redo:"取消復原",cut:"剪下",copy:"複製",paste:"貼上","copy.as":"複製成","export.as":"匯出成","select.all":"全選","select.none":"取消選取",delete:"刪除","new.project":"新專案",open:"開啟",save:"儲存","save.as":"另存為","upload.media":"上傳媒體","create.page":"建立頁面","new.page":"新頁面","page.name":"頁面名稱",duplicate:"複製",cancel:"取消","copy.invite.link":"複製邀請連結","copy.readonly.link":"複製唯讀連結","create.multiplayer.project":"建立多人專案","copy.multiplayer.project":"複製至多人專案",select:"選取",eraser:"橡皮擦",draw:"手繪",arrow:"箭頭",text:"文字",sticky:"便利貼",rectangle:"長方形",ellipse:"橢圓形",triangle:"三角形",line:"直線",rotate:"旋轉","lock.aspect.ratio":"鎖定長寬比","unlock.aspect.ratio":"解鎖長寬比",group:"組成群組",ungroup:"取消群組","move.to.back":"移到最下層","move.backward":"下移一層","move.forward":"上移一層","move.to.front":"移到最上層","reset.angle":"重設角度",lock:"鎖定",unlock:"解鎖","move.to.page":"移至頁面","flip.horizontal":"水平翻轉","flip.vertical":"垂直翻轉",move:"移動","to.front":"到最上層",forward:"到上一層",backward:"到下一層",back:"到最下層",language:"語言","translation.link":"了解詳情","dock.position":"工具列位置",bottom:"下方",left:"左側",right:"右側",top:"上方",page:"頁面"}}];o5.sort((e,t)=>e.localee=>Array.isArray(e)?{strokeWidth:`calc(${e[0]}px / var(--camera-zoom))`}:{strokeWidth:`calc(${e}px / var(--camera-zoom))`}}}),o8=o9({colors:{bounds:"rgba(38, 150, 255, 1.000)",boundsBg:"rgba(38, 150, 255, 0.05)",hover:"#444A50",overlay:"rgba(0, 0, 0, 0.15)",overlayContrast:"rgba(255, 255, 255, 0.15)",panel:"#363D44",panelContrast:"#49555f",selected:"rgba(38, 150, 255, 1.000)",selectedContrast:"#fefefe",text:"#f8f9fa",tooltip:"#1d1d1d",tooltipContrast:"#ffffff",canvas:"#212529"},shadows:{2:"0px 1px 1px rgba(0, 0, 0, 0.24)",3:"0px 2px 3px rgba(0, 0, 0, 0.24)",4:"0px 4px 5px -1px rgba(0, 0, 0, 0.24)",8:"0px 12px 17px rgba(0, 0, 0, 0.24)",12:"0px 12px 17px rgba(0, 0, 0, 0.24)",24:"0px 24px 38px rgba(0, 0, 0, 0.24)",panel:`0px 0px 16px -1px rgba(0, 0, 0, 0.05), 0px 0px 16px -8px rgba(0, 0, 0, 0.09), 0px 0px 16px -12px rgba(0, 0, 0, 0.2)`}}),o7=e=>e.appState.isLoading;function se(){let e=o1().useStore(o7);return R.createElement(st,{hidden:!e},R.createElement(ac,{id:"loading",values:{dots:"..."}}))}var st=o6("div",{position:"absolute",top:0,left:"50%",transform:"translate(-50%, 0)",borderBottomLeftRadius:"12px",borderBottomRightRadius:"12px",padding:"8px 16px",fontFamily:"var(--fonts-ui)",fontSize:"var(--fontSizes-1)",boxShadow:"var(--shadows-panel)",backgroundColor:"white",zIndex:200,pointerEvents:"none","& > div > *":{pointerEvents:"all"},variants:{transform:{hidden:{transform:"translate(-50%, 100%)"},visible:{transform:"translate(-50%, 0%)"}}}}),si="-0.03em",sn=[.5,.5],sa=".tldr",sr={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>e*(2-e),easeInOutQuad:e=>e<.5?2*e*e:-1+(4-2*e)*e,easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1,easeInQuart:e=>e*e*e*e,easeOutQuart:e=>1- --e*e*e*e,easeInOutQuart:e=>e<.5?8*e*e*e*e:1-8*--e*e*e*e,easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>1+--e*e*e*e*e,easeInOutQuint:e=>e<.5?16*e*e*e*e*e:1+16*--e*e*e*e*e,easeInSine:e=>1-Math.cos(e*Math.PI/2),easeOutSine:e=>Math.sin(e*Math.PI/2),easeInOutSine:e=>-(Math.cos(Math.PI*e)-1)/2,easeInExpo:e=>e<=0?0:Math.pow(2,10*e-10),easeOutExpo:e=>e>=1?1:1-Math.pow(2,-10*e),easeInOutExpo:e=>e<=0?0:e>=1?1:e<.5?Math.pow(2,20*e-10)/2:(2-Math.pow(2,-20*e+10))/2},so=["#EC5E41","#F2555A","#F04F88","#E34BA9","#BD54C6","#9D5BD2","#7B66DC","#02B1CC","#11B3A3","#39B178","#55B467","#FF802B"],ss="u">typeof Window&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),sl="u">typeof Window&&/linux/i.test(navigator.userAgent),sd=[".png",".svg",".jpg",".jpeg",".gif"],sc=ss?[]:[".mp4",".webm"],su={};function sp(e,t){let i=tI.getFromCache(t,e,()=>{let[t,i]=e.size;return{minX:0,maxX:t,minY:0,maxY:i,width:t,height:i}});return tI.translateBounds(i,e.point)}oI(su,{LabelMask:()=>sw,PolygonUtils:()=>sA,TextAreaUtils:()=>sK,TextLabel:()=>s1,clearPrevSize:()=>sx,defaultStyle:()=>s$,defaultTextStyle:()=>sZ,fills:()=>sj,getBoundsRectangle:()=>sp,getFontFace:()=>sF,getFontSize:()=>sz,getFontStyle:()=>sW,getOffsetPolygon:()=>sE,getShapeStyle:()=>sG,getStickyFontSize:()=>sH,getStickyFontStyle:()=>sU,getStickyShapeStyle:()=>sV,getStrokeWidth:()=>sB,getTextAlign:()=>sm,getTextLabelSize:()=>sy,getTextSvgElement:()=>sC,stickyFills:()=>sT,strokes:()=>sL,transformRectangle:()=>s6,transformSingleRectangle:()=>s9});var sh={start:"left",middle:"center",end:"right",justify:"justify"};function sm(e="start"){return sh[e]}"u">typeof window&&(null==(lj=document.getElementById("__textLabelMeasure"))||lj.remove(),(A=document.createElement("pre")).id="__textLabelMeasure",Object.assign(A.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:si,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical",lineHeight:1.3}),A.tabIndex=-1,document.body.appendChild(A),lP=A);var sg="",sf="",sb=[0,0];function sx(){sg=""}function sy(e,t){return e?lP?(lP.parent||document.body.appendChild(lP),e===sg&&t===sf)?sb:(sg=e,sf=t,lP.textContent=e,lP.style.font=t,sb=[lP.offsetWidth||1,lP.offsetHeight||1]):[10,10]:[16,32]}var sv=RegExp(`${[32,160,4961,65792,65793,4153,4241].map(e=>String.fromCodePoint(e)).join("|")}`);function sC(e,t,i,n,a,r=!1){let o="normal",s=function(e){let t=document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","-9999px"),t.style.setProperty("left","-9999px"),t.style.setProperty("width",e.width+"px"),t.style.setProperty("height","min-content"),t.style.setProperty("font-size",e.fontSize+"px"),t.style.setProperty("font-family",e.fontFamily),t.style.setProperty("font-weight",e.fontWeight),t.style.setProperty("line-height",e.lineHeight*e.fontSize+"px"),t.style.setProperty("letter-spacing",e.letterSpacing),t.style.setProperty("text-align",e.textAlign),document.body.appendChild(t);let i=e.text.split(sv).flatMap(e=>e.replaceAll(` `,` `)).join(" ").split(" ");t.innerText=i[0];let n=t.offsetHeight,a=[i[0]],r=[a];for(let e=1;en&&(n=s,a=[],r.push(a)),a.push(o)}return t.remove(),r.map(e=>e.join(" "))}({text:e,wrap:r,width:a,fontSize:t,fontWeight:o,fontFamily:i,fontStyle:"normal",textAlign:"left",letterSpacing:si,lineHeight:1}),l=document.createElementNS("http://www.w3.org/2000/svg","text");l.setAttribute("font-size",t+"px"),l.setAttribute("font-family",i),l.setAttribute("font-weight",o),l.setAttribute("line-height",1.3*t+"px"),l.setAttribute("letter-spacing",si),l.setAttribute("text-align",null!=n?n:"left"),l.setAttribute("dominant-baseline","mathematical"),l.setAttribute("alignment-baseline","mathematical");let d=s.map((e,i)=>{let n=document.createElementNS("http://www.w3.org/2000/svg","tspan");return n.textContent=e+` `,n.setAttribute("y",1.3*t*(i+.5)+"px"),l.appendChild(n),n});switch(n){case"middle":l.setAttribute("text-align","center"),l.setAttribute("text-anchor","middle"),d.forEach(e=>e.setAttribute("x",4+a/2+""));break;case"end":l.setAttribute("text-align","right"),l.setAttribute("text-anchor","end"),d.forEach(e=>e.setAttribute("x",4+a+""));break;default:l.setAttribute("text-align","left"),l.setAttribute("text-anchor","start"),d.forEach(e=>e.setAttribute("x","4"))}return l}function sw({id:e,bounds:t,labelSize:i,offset:n,scale:a=1}){return R.createElement("defs",null,R.createElement("mask",{id:e+"_clip"},R.createElement("rect",{x:-100,y:-100,width:t.width+200,height:t.height+200,fill:"white"}),R.createElement("rect",{x:t.width/2-i[0]/2*a+((null==n?void 0:n[0])||0),y:t.height/2-i[1]/2*a+((null==n?void 0:n[1])||0),width:i[0]*a,height:i[1]*a,rx:4*a,ry:4*a,fill:"black",opacity:Math.max(a,.8)})))}var sS=2*Math.PI,sk=class{static inwardEdgeNormal(e){let t=z.sub(e[1],e[0]),i=z.len2(t);return[-t[0]/i,t[1]/i]}static outwardEdgeNormal(e){return z.neg(sk.inwardEdgeNormal(e))}static isReflexVertex(e,t){let i=e.length,n=e[(t+i-1)%i],a=e[t],r=e[(t+1)%i];return 0>sk.leftSide(n,r,a)}static getEdges(e){return e.map((t,i)=>[t,e[(i+1)%e.length]])}static edgesIntersection([e,t],[i,n]){let a=(n[1]-i[1])*(t[0]-e[0])-(n[0]-i[0])*(t[1]-e[1]);if(0==a)return null;let r=((n[0]-i[0])*(e[1]-i[1])-(n[1]-i[1])*(e[0]-i[0]))/a,o=((t[0]-e[0])*(e[1]-i[1])-(t[1]-e[1])*(e[0]-i[0]))/a;return r<0||o<0||r>1||o>1?null:[e[0]+r*(t[0]-e[0]),e[1]+r*(t[1]-e[1])]}static appendArc(e,t,i,n,a,r=!1){let o=[...e],s=Math.atan2(n[1]-t[1],n[0]-t[0]),l=Math.atan2(a[1]-t[1],a[0]-t[0]);s<0&&(s+=sS),l<0&&(l+=sS);let d=s>l?s-l:s+sS-l,c=(r?-d:sS-d)/5;o.push(n);for(let e=1;e<5;++e){let n=s+c*e;o.push([t[0]+Math.cos(n)*i,t[1]+Math.sin(n)*i])}return o.push(a),o}static createOffsetEdge(e,t){return e.map(e=>z.add(e,t))}static getOffsetPolygon(e,t=0){let i=sk.getEdges(e),n=i.map(e=>sk.createOffsetEdge(e,z.mul(sk.outwardEdgeNormal(e),t))),a=[];for(let e=0;esk.createOffsetEdge(e,sk.inwardEdgeNormal(e))),n=[];for(let a=0;a[t,e[(n+1)%i]]).map(([e,i])=>{let n=z.mul(z.per(z.uni(z.sub(i,e))),t);return[z.add(e,n),z.add(i,n)]}).map((e,t,i)=>{let n=function(e,t){let i=z.slope(e[0],e[1]),n=z.slope(t[0],t[1]);if(i===n)return;if(Number.isNaN(i)&&!Number.isNaN(n))return[e[0][0],(e[0][0]-t[0][0])*n+t[0][1]];if(Number.isNaN(n)&&!Number.isNaN(i))return[t[0][0],(t[0][0]-e[0][0])*i+e[0][1]];let a=(i*e[0][0]-n*t[0][0]+t[0][1]-e[0][1])/(i-n),r=n*(a-t[0][0])+t[0][1];return[a,r]}(e,i[(t+1)%i.length]);if(void 0===n)throw Error("Expected an intersection");return n})}oM(sA,"leftSide",z.isLeft);var s_="#fafafa",sI="#343d45",sM={white:"#f0f1f3",lightGray:"#c6cbd1",gray:"#788492",black:"#1d1d1d",green:"#36b24d",cyan:"#0e98ad",blue:"#1c7ed6",indigo:"#4263eb",violet:"#7746f1",red:"#ff2133",orange:"#ff9433",yellow:"#ffc936"},sT={light:o_(oE({},Object.fromEntries(Object.entries(sM).map(([e,t])=>[e,tI.lerpColor(t,s_,.45)]))),{white:"#ffffff",black:"#3d3d3d"}),dark:o_(oE({},Object.fromEntries(Object.entries(sM).map(([e,t])=>[e,tI.lerpColor(tI.lerpColor(t,"#999999",.3),sI,.4)]))),{white:"#1d1d1d",black:"#bbbbbb"})},sL={light:o_(oE({},sM),{white:"#1d1d1d"}),dark:o_(oE({},Object.fromEntries(Object.entries(sM).map(([e,t])=>[e,tI.lerpColor(t,sI,.1)]))),{white:"#cecece",black:"#cecece"})},sj={light:o_(oE({},Object.fromEntries(Object.entries(sM).map(([e,t])=>[e,tI.lerpColor(t,s_,.82)]))),{white:"#fefefe"}),dark:o_(oE({},Object.fromEntries(Object.entries(sM).map(([e,t])=>[e,tI.lerpColor(t,sI,.82)]))),{white:"rgb(30,33,37)",black:"#1e1e1f"})},sP={small:2,medium:3.5,large:5},sD={small:28,medium:48,large:96,auto:"auto"},sN={script:'"Caveat Brush"',sans:'"Source Sans Pro"',serif:'"Crimson Pro"',mono:'"Source Code Pro"'},sR={script:1,sans:1,serif:1,mono:1},sO={small:24,medium:36,large:48,auto:"auto"};function sB(e){return sP[e]}function sz(e,t="script"){return sD[e]*sR[t]}function sF(e="script"){return sN[e]}function sH(e){return sO[e]}function sW(e){let t=sz(e.size,e.font),i=sF(e.font),{scale:n=1}=e;return`${t*n}px/1.3 ${i}`}function sU(e){let t=sO[e.size],i=sF(e.font),{scale:n=1}=e;return`${t*n}px/1 ${i}`}function sV(e,t=!1){let{color:i}=e,n=t?"dark":"light",a="white"===i||"black"===i?"yellow":i;return{fill:sT[n][a],stroke:sL[n][a],color:t?"#1d1d1d":"#0d0d0d"}}function sG(e,t){let{color:i,size:n,isFilled:a}=e,r=sP[n],o=t?"dark":"light";return{stroke:sL[o][i],fill:a?sj[o][i]:"none",strokeWidth:r}}var s$={color:"black",size:"small",isFilled:!1,dash:"draw",scale:1},sZ=o_(oE({},s$),{font:"script",textAlign:"middle"}),sK=class{static insertTextFirefox(e,t){e.setRangeText(t,e.selectionStart||0,e.selectionEnd||0,"end"),e.dispatchEvent(new InputEvent("input",{data:t,inputType:"insertText",isComposing:!1}))}static insert(e,t){let i=e.ownerDocument,n=i.activeElement;n!==e&&e.focus(),i.execCommand("insertText",!1,t)||sK.insertTextFirefox(e,t),n===i.body?e.blur():n instanceof HTMLElement&&n!==e&&n.focus()}static set(e,t){e.select(),sK.insert(e,t)}static getSelection(e){let{selectionStart:t,selectionEnd:i}=e;return e.value.slice(t||void 0,i||void 0)}static wrapSelection(e,t,i){let{selectionStart:n,selectionEnd:a}=e,r=sK.getSelection(e);sK.insert(e,t+r+(null!=i?i:t)),e.selectionStart=(n||0)+t.length,e.selectionEnd=(a||0)+t.length}static replace(e,t,i){let n=0;e.value.replace(t,(...t)=>{let a=n+t[t.length-2],r=t[0].length;e.selectionStart=a,e.selectionEnd=a+r;let o="string"==typeof i?i:i(...t);return sK.insert(e,o),e.selectionStart=a,n+=o.length-r,o})}static findLineEnd(e,t){let i=e.lastIndexOf(` `,t-1)+1;return" "!==e.charAt(i)?t:i+1}static indent(e){var t;let{selectionStart:i,selectionEnd:n,value:a}=e,r=a.slice(i,n),o=null==(t=/\n/g.exec(r))?void 0:t.length;if(o&&o>0){let t=a.lastIndexOf(` `,i-1)+1,r=e.value.slice(t,n-1),o=r.replace(/^|\n/g,"$& "),s=o.length-r.length;e.setSelectionRange(t,n-1),sK.insert(e,o),e.setSelectionRange(i+1,n+s)}else sK.insert(e," ")}static unindent(e){let{selectionStart:t,selectionEnd:i,value:n}=e,a=n.lastIndexOf(` `,t-1)+1,r=sK.findLineEnd(n,i),o=e.value.slice(a,r),s=o.replace(/(^|\n)(\t| {1,2})/g,"$1"),l=o.length-s.length;e.setSelectionRange(a,r),sK.insert(e,s);let d=/\t| {1,2}/.exec(n.slice(a,t)),c=d?d[0].length:0,u=t-c;e.setSelectionRange(t-c,Math.max(u,i-l))}},sq=e=>e.stopPropagation();function sY(e){if(null===e)return e;if(e instanceof Date)return new Date(e.getTime());if("object"==typeof e)if("function"==typeof e[Symbol.iterator]){let t=[];if(e.length>0)for(let i of e)t.push(sY(i));return t}else{let t=Object.keys(e),i={};if(t.length>0)for(let n of t)i[n]=sY(e[n]);return i}return e}function sX(e,t=0,i=0){let[n,a]=e,r=[[n/2,0],[n,a],[0,a]];return t&&(r=sE(r,t)),i&&(r=r.map(e=>z.rotWith(e,[n/2,a/2],i))),r}function sQ(e){let[t,i]=e,n=[[t/2,0],[t,i],[0,i]];return[(n[0][0]+n[1][0]+n[2][0])/3,(n[0][1]+n[1][1]+n[2][1])/3]}function sJ(e,t,i){let{strokeWidth:n}=sG(i),{points:a}=function(e,t,i){let[n,a]=t,r=tI.rng(e),o=Array.from([,,,]).map(()=>[r()*i*.75,r()*i*.75]),s=[z.add([n/2,0],o[0]),z.add([n,a],o[1]),z.add([0,a],o[2])],l=Math.round(Math.abs(2*r()*3)),d=tI.rotateArray([z.pointsBetween(s[0],s[1],32),z.pointsBetween(s[1],s[2],32),z.pointsBetween(s[2],s[0],32)],l);return{points:[...d.flat(),...d[0]]}}(e,t,n);return{points:a,options:{size:n,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}var s0=class{static getShapeUtil(e){return dn(e)}static getSelectedShapes(e,t){let i=s0.getPage(e,t);return s0.getSelectedIds(e,t).map(e=>i.shapes[e])}static screenToWorld(e,t){let i=s0.getPageState(e,e.appState.currentPageId).camera;return z.sub(z.div(t,i.zoom),i.point)}static getCameraZoom(e){return tI.clamp(e,.1,5)}static getPage(e,t){return e.document.pages[t]}static getPageState(e,t){return e.document.pageStates[t]}static getSelectedIds(e,t){return s0.getPageState(e,t).selectedIds}static getShapes(e,t){return Object.values(s0.getPage(e,t).shapes)}static getCamera(e,t){return s0.getPageState(e,t).camera}static getShape(e,t,i){return s0.getPage(e,i).shapes[t]}static getCenter(e){return s0.getShapeUtil(e).getCenter(e)}static getBounds(e){return s0.getShapeUtil(e).getBounds(e)}static getRotatedBounds(e){return s0.getShapeUtil(e).getRotatedBounds(e)}static getSelectedBounds(e){return tI.getCommonBounds(s0.getSelectedShapes(e,e.appState.currentPageId).map(e=>s0.getShapeUtil(e).getBounds(e)))}static getParentId(e,t,i){return s0.getShape(e,t,i).parentId}static getDocumentBranch(e,t,i){let n=s0.getShape(e,t,i);return void 0===n.children?[t]:[t,...n.children.flatMap(t=>s0.getDocumentBranch(e,t,i))]}static getSelectedBranchSnapshot(e,t,i){let n=s0.getPage(e,t),a=s0.getSelectedIds(e,t).flatMap(i=>s0.getDocumentBranch(e,i,t).map(e=>n.shapes[e])).filter(e=>!e.isLocked).map(tI.deepClone);return void 0!==i?a.map(e=>oE({id:e.id},i(e))):a}static getSelectedShapeSnapshot(e,t,i){let n=s0.getSelectedShapes(e,t).filter(e=>!e.isLocked).map(tI.deepClone);return void 0!==i?n.map(e=>oE({id:e.id},i(e))):n}static getAllEffectedShapeIds(e,t,i){let n=s0.getPage(e,i),a=new Set(t);return t.forEach(e=>{let t=n.shapes[e];!function e(t){void 0!==t.children&&t.children.filter(e=>!a.has(e)).forEach(t=>{a.add(t),e(n.shapes[t])})}(t),function e(t){let i=t.parentId;i!==n.id&&(a.has(i)||(a.add(i),e(n.shapes[i])))}(t),a.forEach(e=>{Object.values(n.bindings).filter(t=>t.fromId===e||t.toId===e).forEach(t=>a.add(t.fromId===e?t.toId:t.fromId))})}),Array.from(a.values())}static getLinkedShapeIds(e,t,i,n=!0){let a=s0.getSelectedIds(e,t),r=s0.getPage(e,t),o=new Set(a),s=new Set,l=[...a],d=new Set(Object.values(r.shapes).filter(e=>{var t;return"arrow"===e.type&&(e.handles.start.bindingId||(null==(t=e.handles)?void 0:t.end.bindingId))}));for(;l.length;){let e=l.pop();if(!(e&&d.size))break;s.has(e)||(s.add(e),d.forEach(t=>{var a,s;let{handles:{start:{bindingId:c},end:{bindingId:u}}}=t,p=c?r.bindings[c]:null,h=u?r.bindings[u]:null;p&&p.toId===e?("center"===i||((null==(a=t.decorations)?void 0:a.start)&&h?"left"===i:"right"===i))&&(n&&o.add(t.id),o.add(e),h&&(o.add(h.toId),l.push(h.toId))):h&&h.toId===e&&("center"===i||((null==(s=t.decorations)?void 0:s.end)&&p?"left"===i:"right"===i))&&(n&&o.add(t.id),o.add(e),p&&(o.add(p.toId),l.push(p.toId))),(!p||o.has(p.toId))&&(!h||o.has(h.toId))&&d.delete(t)}))}return Array.from(o.values())}static getChildIndexAbove(e,t,i){let n=e.document.pages[i],a=n.shapes[t],r;if(a.parentId===n.id)r=Object.values(n.shapes).filter(e=>e.parentId===n.id).sort((e,t)=>e.childIndex-t.childIndex);else{let e=n.shapes[a.parentId];if(!e.children)throw Error("No children in parent!");r=e.children.map(e=>n.shapes[e]).sort((e,t)=>e.childIndex-t.childIndex)}let o=r.indexOf(a),s=r[o+1];return s?s.childIndex:a.childIndex+1}static getBeforeShape(e,t){return Object.fromEntries(Object.keys(t).map(t=>[t,e[t]]))}static mutateShapes(e,t,i,n,a=!1){let r={},o={};t.forEach((s,l)=>{let d=s0.getShape(e,s,n);if(d.isLocked)return;(null==d?void 0:d.type)==="group"&&(1===t.length||a)&&d.children.forEach((t,a)=>{let s=s0.getShape(e,t,n);if(s.isLocked)return;let l=i(s,a);l&&(r[t]=s0.getBeforeShape(s,l),o[t]=l)});let c=i(d,l);c&&(r[s]=s0.getBeforeShape(d,c),o[s]=c)});let s=tI.deepMerge(e,{document:{pages:{[e.appState.currentPageId]:{shapes:o}}}});return{before:r,after:o,data:s}}static createShapes(e,t,i){return{before:{document:{pages:{[i]:{shapes:oE({},Object.fromEntries(t.flatMap(t=>{let n=[[t.id,void 0]];if(t.parentId!==i){let a=s0.getShape(e,t.parentId,i);if(!a.children)throw Error("No children in parent!");n.push([a.id,{children:a.children}])}return n})))}}}},after:{document:{pages:{[i]:{shapes:{shapes:oE({},Object.fromEntries(t.flatMap(t=>{let n=[[t.id,t]];if(t.parentId!==i){let a=s0.getShape(e,t.parentId,i);if(!a.children)throw Error("No children in parent!");n.push([a.id,{children:[...a.children,t.id]}])}return n})))}}}}}}}static deleteShapes(e,t,i){i=i||e.appState.currentPageId;let n=s0.getPage(e,i),a="string"==typeof t[0]?t:t.map(e=>e.id);return{before:{document:{pages:{[i]:{shapes:oE({},Object.fromEntries(a.flatMap(e=>{let t=n.shapes[e],a=[[t.id,t]];if(t.parentId!==i){let e=n.shapes[t.parentId];if(!e.children)throw Error("No children in parent!");a.push([e.id,{children:e.children}])}return a}))),bindings:oE({},Object.fromEntries(Object.values(n.bindings).filter(e=>a.includes(e.fromId)||a.includes(e.toId)).map(e=>[e.id,e])))}}}},after:{document:{pages:{[i]:{shapes:oE({},Object.fromEntries(a.flatMap(e=>{let t=n.shapes[e],i=[[t.id,void 0]];if(t.parentId!==n.id){let e=n.shapes[t.parentId];if(!e.children)throw Error("No children in parent!");i.push([e.id,{children:e.children.filter(e=>e!==t.id)}])}return i})))}}}}}}static onSessionComplete(e){var t,i;let n=null==(i=(t=s0.getShapeUtil(e)).onSessionComplete)?void 0:i.call(t,e);return n?oE(oE({},e),n):e}static onChildrenChange(e,t,i){var n,a;if(!t.children)return;let r=null==(a=(n=s0.getShapeUtil(t)).onChildrenChange)?void 0:a.call(n,t,t.children.map(t=>s0.getShape(e,t,i)));return r?oE(oE({},t),r):t}static updateArrowBindings(e,t){var i,n,a,r,o,s;let l={start:sY(t.handles.start),end:sY(t.handles.end)},d={isBound:!1,handle:t.handles.start,point:z.add(t.handles.start.point,t.point)},c={isBound:!1,handle:t.handles.end,point:z.add(t.handles.end.point,t.point)};if(t.handles.start.bindingId){let n=(null==(i=t.decorations)?void 0:i.start)!==void 0,a=t.handles.start,r=e.bindings[t.handles.start.bindingId];if(!r)throw Error("Could not find a binding to match the start handle's bindingId");let o=e.shapes[r.toId],s=s0.getShapeUtil(o),l=s.getBounds(o),c=s.getExpandedBounds(o),u=n?tI.expandBounds(l,r.distance):l,{minX:p,minY:h,width:m,height:g}=c,f=z.add([p,h],z.mulV([m,g],z.rotWith(r.point,[.5,.5],o.rotation||0)));d={isBound:!0,hasDecoration:n,binding:r,handle:a,point:f,util:s,target:o,bounds:l,expandedBounds:c,intersectBounds:u,center:s.getCenter(o)}}if(t.handles.end.bindingId){let i=(null==(n=t.decorations)?void 0:n.end)!==void 0,a=t.handles.end,r=e.bindings[t.handles.end.bindingId];if(!r)throw Error("Could not find a binding to match the end handle's bindingId");let o=e.shapes[r.toId],s=s0.getShapeUtil(o),l=s.getBounds(o),d=s.getExpandedBounds(o),u=i?tI.expandBounds(l,r.distance):l,{minX:p,minY:h,width:m,height:g}=d,f=z.add([p,h],z.mulV([m,g],z.rotWith(r.point,[.5,.5],o.rotation||0)));c={isBound:!0,hasDecoration:i,binding:r,handle:a,point:f,util:s,target:o,bounds:l,expandedBounds:d,intersectBounds:u,center:s.getCenter(o)}}for(let e of["end","start"]){let i="start"===e?d:c,n="start"===e?c:d;if(i.isBound)if(i.binding.distance){let o=z.uni(z.sub(i.point,n.point));switch(i.target.type){case"ellipse":{let a=te(n.point,o,i.center,i.target.radius[0]+(i.hasDecoration?i.binding.distance:0),i.target.radius[1]+(i.hasDecoration?i.binding.distance:0),i.target.rotation||0).points.sort((e,t)=>z.dist(e,n.point)-z.dist(t,n.point));void 0!==a[0]&&(l[e].point=z.toFixed(z.sub(a[0],t.point)));break}case"triangle":{let a=i.target.point,r=sX(i.target.size,16*!!i.hasDecoration,i.target.rotation).map(e=>z.add(e,a)),s=tI.pointsToLineSegments(r,!0).map(([e,t])=>e7(n.point,o,e,t)).filter(e=>e.didIntersect).flatMap(e=>e.points).sort((e,t)=>z.dist(e,n.point)-z.dist(t,n.point));void 0!==s[0]&&(l[e].point=z.toFixed(z.sub(s[0],t.point)));break}default:{let s,d=tt(n.point,o,i.intersectBounds,i.target.rotation).filter(e=>e.didIntersect).map(e=>e.points[0]).sort((e,t)=>z.dist(e,n.point)-z.dist(t,n.point));if(!d[0])continue;if(n.isBound&&(s=tt(n.point,o,n.intersectBounds,n.target.rotation).filter(e=>e.didIntersect).map(e=>e.points[0]).sort((e,t)=>z.dist(e,n.point)-z.dist(t,n.point))[0]),n.isBound&&(d.length<2||s&&d[0]&&40>Math.ceil(z.dist(d[0],s))||tI.boundsContain(i.expandedBounds,n.expandedBounds)||tI.boundsCollide(i.expandedBounds,n.expandedBounds))){let a=z.uni(z.sub(n.point,i.point)),r=tt(i.point,a,i.bounds,i.target.rotation).filter(e=>e.didIntersect).map(e=>e.points[0]);if(!r[0])continue;l[e].point=z.toFixed(z.sub(r[0],t.point)),l["start"===e?"end":"start"].point=z.toFixed(z.add(z.sub(r[0],t.point),z.mul(a,Math.min(z.dist(r[0],n.point),40*(tI.boundsContain(n.bounds,i.intersectBounds)?-1:1)))))}else if(!n.isBound&&(d[0]&&40>z.dist(d[0],n.point)||tI.pointInBounds(n.point,i.intersectBounds))){let o=z.uni(z.sub(i.center,n.point));return null==(r=(a=s0.getShapeUtil(t)).onHandleChange)?void 0:r.call(a,t,{[e]:o_(oE({},t.handles[e]),{point:z.toFixed(z.add(z.sub(n.point,t.point),z.mul(o,40)))})})}else d[0]&&(l[e].point=z.toFixed(z.sub(d[0],t.point)))}}}else l[e].point=z.sub(i.point,t.point)}return null==(s=(o=s0.getShapeUtil(t)).onHandleChange)?void 0:s.call(o,t,l)}static transform(e,t,i){let n=s0.getShapeUtil(e).transform(e,t,i);return n?oE(oE({},e),n):e}static transformSingle(e,t,i){let n=s0.getShapeUtil(e).transformSingle(e,t,i);return n?oE(oE({},e),n):e}static getRotatedShapeMutation(e,t,i,n){var a,r;let o=z.sub(t,e.point),s=z.rotWith(t,i,n),l=z.toFixed(z.sub(s,o));return void 0!==e.handles?null==(r=(a=this.getShapeUtil(e)).onHandleChange)?void 0:r.call(a,o_(oE({},e),{point:l}),Object.fromEntries(Object.entries(e.handles).map(([e,t])=>{let i=z.toFixed(z.rotWith(t.point,o,n));return[e,o_(oE({},t),{point:i})]}))):{point:l,rotation:tI.clampRadians((e.rotation||0)+n)}}static updateParents(e,t,i){let n=s0.getPage(e,t);if(0===i.length)return;let{shapes:a}=s0.getPage(e,t),r=Array.from(new Set(i.map(e=>a[e].parentId).values())).filter(e=>e!==n.id);for(let i of r){let n=a[i];if(!n.children)throw Error("A shape is parented to a shape without a children array.");s0.onChildrenChange(e,n,t)}s0.updateParents(e,t,r)}static getBinding(e,t,i){return s0.getPage(e,i).bindings[t]}static getBindings(e,t){return Object.values(s0.getPage(e,t).bindings)}static getBindableShapeIds(e){return s0.getShapes(e,e.appState.currentPageId).filter(e=>s0.getShapeUtil(e).canBind).sort((e,t)=>t.childIndex-e.childIndex).map(e=>e.id)}static getBindingsWithShapeIds(e,t,i){return Array.from(new Set(s0.getBindings(e,i).filter(e=>t.includes(e.toId)||t.includes(e.fromId))).values())}static getRelatedBindings(e,t,i){let n=new Set(t),a=Object.values(s0.getPage(e,i).bindings),r=new Set(a.filter(e=>n.has(e.toId)||n.has(e.fromId))),o=r.size,s=-1;for(;0!==s;)r.forEach(e=>{let t=e.fromId;for(let e of a)e.fromId===t&&r.add(e),e.toId===t&&r.add(e)}),s=r.size-o,o=r.size;return Array.from(r.values())}static normalizeText(e){return e.replace(s0.fixNewLines,` `).split(` `).map(e=>e||" ").join(` `)}static assertShapeHasProperty(e,t){if(void 0===e[t])throw Error()}static warn(e){}static error(e){}static getSvgString(e,t=1){let i=e.cloneNode(!0);return e.setAttribute("width",e.getAttribute("width")*t+""),e.setAttribute("height",e.getAttribute("height")*t+""),new XMLSerializer().serializeToString(i).replaceAll(" ","").replaceAll(/((\s|")[0-9]*\.[0-9]{2})([0-9]*)(\b|"|\))/g,"$1")}static getSvgAsDataUrl(e,t=1){let i=s0.getSvgString(e,t);return`data:image/svg+xml;base64,${window.btoa(unescape(i))}`}static getImageForSvg(e){return oT(this,arguments,function*(e,t="png",i={}){let{scale:n=2,quality:a=1}=i,r=s0.getSvgString(e,n),o=+e.getAttribute("width"),s=+e.getAttribute("height");if(!r)return;let l=yield new Promise(e=>{let t=new Image;t.crossOrigin="anonymous";let i=`data:image/svg+xml;base64,${window.btoa(unescape(encodeURIComponent(r)))}`;t.onload=()=>{let n=document.createElement("canvas"),a=n.getContext("2d");n.width=o,n.height=s,a.drawImage(t,0,0,o,s),URL.revokeObjectURL(i),e(n)},t.onerror=()=>{console.warn("Could not convert that SVG to an image.")},t.src=i});return yield new Promise(e=>l.toBlob(t=>e(t),"image/"+t,a))})}};oM(s0,"copyStringToClipboard",e=>{try{navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([e],{type:"text/plain"})})])}catch(i){let t=document.createElement("textarea");t.setAttribute("position","fixed"),t.setAttribute("top","0"),t.setAttribute("readonly","true"),t.setAttribute("contenteditable","true"),t.style.position="fixed",t.value=e,document.body.appendChild(t),t.focus(),t.select();try{let e=document.createRange();e.selectNodeContents(t);let i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(e),t.setSelectionRange(0,t.value.length)),document.execCommand("copy")}catch(e){}finally{document.body.removeChild(t)}}}),oM(s0,"flattenShape",(e,t)=>{var i;return[t,...(null!=(i=t.children)?i:[]).map(t=>s0.getShape(e,t,e.appState.currentPageId)).sort((e,t)=>e.childIndex-t.childIndex).flatMap(t=>s0.flattenShape(e,t))]}),oM(s0,"flattenPage",(e,t)=>Object.values(e.document.pages[t].shapes).sort((e,t)=>e.childIndex-t.childIndex).reduce((t,i)=>[...t,...s0.flattenShape(e,i)],[])),oM(s0,"getTopChildIndex",(e,t)=>{let i=s0.getShapes(e,t);return 0===i.length?1:i.filter(e=>e.parentId===t).sort((e,t)=>t.childIndex-e.childIndex)[0].childIndex+1}),oM(s0,"fixNewLines",/\r?\n|\r/g);var s1=R.memo(function({font:e,text:t,color:i,offsetX:n=0,offsetY:a=0,scale:r=1,isEditing:o=!1,onBlur:s,onChange:l,shape:d}){let c=R.useRef(null),u=R.useRef(!1),p=R.useCallback(e=>{l(s0.normalizeText(e.currentTarget.value))},[l]),h=R.useCallback(e=>{if("Escape"===e.key){e.preventDefault(),e.stopPropagation(),null==s||s();return}if("Tab"===e.key&&0===t.length)return void e.preventDefault();if("Meta"===e.key||e.metaKey){if("z"===e.key&&e.metaKey){e.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),e.stopPropagation(),e.preventDefault();return}}else e.stopPropagation();(e.metaKey||e.ctrlKey)&&"="===e.key&&e.preventDefault(),"Tab"===e.key&&(e.preventDefault(),e.shiftKey?sK.unindent(e.currentTarget):sK.indent(e.currentTarget),null==l||l(s0.normalizeText(e.currentTarget.value)))},[l]),m=R.useCallback(e=>{e.currentTarget.setSelectionRange(0,0),null==s||s()},[s]),g=R.useCallback(e=>{o&&u.current&&document.activeElement===e.currentTarget&&e.currentTarget.select()},[o]),f=R.useCallback(e=>{o&&e.stopPropagation()},[o]);R.useEffect(()=>{o?requestAnimationFrame(()=>{u.current=!0;let e=c.current;e&&(e.focus(),e.select())}):null==s||s()},[o,s]);let b=R.useRef(null);return R.useLayoutEffect(()=>{let i=b.current;if(!i)return;let o=sy(t,e);i.style.transform=`scale(${r}, ${r}) translate(${n}px, ${a}px)`,i.style.width=o[0]+1+"px",i.style.height=o[1]+1+"px"},[t,e,a,n,r]),R.createElement(s2,null,R.createElement(s5,{ref:b,hasText:!!t,isEditing:o,style:{font:e,color:i},"data-color":null==d?void 0:d.style.color},o?R.createElement(s4,{ref:c,style:{font:e,color:i},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:t,color:i,onFocus:g,onChange:p,onKeyDown:h,onBlur:m,onPointerDown:f,onContextMenu:sq,onCopy:sq,onPaste:sq,onCut:sq}):t,"​"))}),s2=o6("div",{position:"absolute",top:0,left:0,width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",userSelect:"none",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}}}}),s3={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:si},s5=o6("div",oE({position:"absolute",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,outline:0,fontWeight:"500",textAlign:"center",backfaceVisibility:"hidden",userSelect:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",variants:{hasText:{false:{pointerEvents:"none"},true:{pointerEvents:"all"}},isEditing:{false:{userSelect:"none"},true:{background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}}},s3)),s4=o6("textarea",o_(oE({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text",fontSmooth:"always",WebkitFontSmoothing:"subpixel-antialiased",MozOsxFontSmoothing:"auto"},s3),{"&:focus":{outline:"none",border:"none"}}));function s6(e,t,{initialShape:i,transformOrigin:n,scaleX:a,scaleY:r}){return e.rotation||i.isAspectRatioLocked?{size:z.toFixed(z.mul(i.size,Math.min(Math.abs(a),Math.abs(r)))),point:z.toFixed([t.minX+(t.width-e.size[0])*(a<0?1-n[0]:n[0]),t.minY+(t.height-e.size[1])*(r<0?1-n[1]:n[1])]),rotation:a<0&&r>=0||r<0&&a>=0?i.rotation?-i.rotation:0:i.rotation}:{point:z.toFixed([t.minX,t.minY]),size:z.toFixed([t.width,t.height])}}function s9(e,t){return{size:z.toFixed([t.width,t.height]),point:z.toFixed([t.minX,t.minY])}}var s8=class extends id{constructor(){super(...arguments),oM(this,"canBind",!1),oM(this,"canEdit",!1),oM(this,"canClone",!1),oM(this,"isAspectRatioLocked",!1),oM(this,"hideResizeHandles",!1),oM(this,"bindingDistance",16),oM(this,"hitTestPoint",(e,t)=>tI.pointInBounds(t,this.getRotatedBounds(e))),oM(this,"hitTestLineSegment",(e,t,i)=>{let n=tI.getBoundsFromPoints([t,i]),a=this.getBounds(e);return tI.boundsContain(a,n)||e.rotation?tr(t,i,tI.getRotatedCorners(this.getBounds(e))).didIntersect:ts(this.getBounds(e),t,i).length>0}),oM(this,"create",e=>(this.refMap.set(e.id,R.createRef()),this.getShape(e))),oM(this,"getCenter",e=>tI.getBoundsCenter(this.getBounds(e))),oM(this,"getExpandedBounds",e=>tI.expandBounds(this.getBounds(e),this.bindingDistance)),oM(this,"getBindingPoint",(e,t,i,n,a,r)=>{let o=this.getBounds(e),s=this.getExpandedBounds(e);if(!tI.pointInBounds(i,s))return;let l=tt(n,a,s).filter(e=>e.didIntersect).map(e=>e.points[0]);if(!l.length)return;let d=this.getCenter(e),c=l.sort((e,t)=>z.dist(t,n)-z.dist(e,n))[0],u=z.med(i,c),p,h;r?(p=8>z.dist(i,d)?d:i,h=0):(p=8>z.distanceToLineSegment(i,u,d)?d:u,h=tI.pointInBounds(i,o)?this.bindingDistance:Math.max(this.bindingDistance,tI.getBoundsSides(o).map(e=>z.distanceToLineSegment(e[1][0],e[1][1],i)).sort((e,t)=>e-t)[0]));let m=z.divV(z.sub(p,[s.minX,s.minY]),[s.width,s.height]);return{point:z.clampV(m,0,1),distance:h}}),oM(this,"mutate",(e,t)=>t),oM(this,"transform",(e,t,i)=>o_(oE({},e),{point:[t.minX,t.minY]})),oM(this,"transformSingle",(e,t,i)=>this.transform(e,t,i)),oM(this,"updateChildren"),oM(this,"onChildrenChange"),oM(this,"onHandleChange"),oM(this,"onRightPointHandle"),oM(this,"onDoubleClickHandle"),oM(this,"onDoubleClickBoundsHandle"),oM(this,"onSessionComplete"),oM(this,"getSvgElement",(e,t)=>{var i,n,a,r,o;let s=null==(i=document.getElementById(e.id+"_svg"))?void 0:i.cloneNode(!0);if(s){if(null!=(r=null==(a=null==(n=e.label)?void 0:n.trim())?void 0:a.length)&&r){let i=document.createElementNS("http://www.w3.org/2000/svg","g"),n=sW(e.style),a=sy(e.label,n),r=sz(e.style.size,e.style.font)*(null!=(o=e.style.scale)?o:1),l=sF(e.style.font).slice(1,-1),d=sC(e.label,r,l,"middle",a[0],!1),c=this.getBounds(e);return d.setAttribute("transform",`translate(${c.width/2-a[0]/2}, ${c.height/2-a[1]/2})`),d.setAttribute("fill",sG(e.style,t).stroke),d.setAttribute("data-color",e.style.color),d.setAttribute("transform-origin","center center"),i.setAttribute("text-align","center"),i.setAttribute("text-anchor","middle"),i.appendChild(s),i.appendChild(d),i}return s}})}};function s7(e,t){let{start:i,end:n}=e,a=z.dist(i.point,n.point),r=z.med(i.point,n.point),o=a/2*t,s=z.uni(z.vec(i.point,n.point));return z.toFixed(10>Math.abs(o)?r:z.add(r,z.mul(z.per(s),o)))}function le(e,t,i){return tI.circleFromThreePoints(e,i,t)}function lt(e,t,i,n,a){var r;let o,s,l,d,c,u=(r=.618*t,d=((l=Math.sqrt((o=i[0]-e[0])*o+(s=i[1]-e[1])*s))*l-n*n+r*r)/(2*l),c=Math.sqrt(r*r-d*d),o/=l,s/=l,e9("intersection",[e[0]+o*d-s*c,e[1]+s*d+o*c],[e[0]+o*d+s*c,e[1]+s*d-o*c])).points;if(!u)return s0.warn("Could not find an intersection for the arrow head."),{left:e,right:e};let p=a?u[0]:u[1];return{left:p?z.nudge(z.rotWith(p,e,Math.PI/6),e,-.382*t):e,right:p?z.nudge(z.rotWith(p,e,-Math.PI/6),e,-.382*t):e}}function li(e,t,i){let n=tn(e,t,e,i).points;if(!n)return s0.warn("Could not find an intersection for the arrow head."),{left:e,right:e};let a=n[0];return{left:a?z.rotWith(a,e,Math.PI/6):e,right:a?z.rotWith(a,e,-Math.PI/6):e}}function ln(e,t,i,n,a){let{left:r,right:o}=lt(e,t,i,n,a);return`M ${r} L ${e} ${o}`}function la(e,t,i){let{left:n,right:a}=li(e,t,i);return`M ${n} L ${e} ${a}`}function lr(e,t,i){if(4>=z.dist2(t,z.med(e,i)))return[e,i];let n=[],a=le(e,t,i),r=[a[0],a[1]],o=a[2],s=z.angle(r,e),l=z.angle(r,i);for(let e=.05;e<1;e+=.05){let t=tI.lerpAngles(s,l,e);n.push(z.nudgeAtAngle(r,t,o))}return n}function lo(e,t,i,n){return 2*Math.PI*t*(tI.getSweep(e,i,n)/(2*Math.PI))}function ls({left:e,middle:t,right:i,stroke:n,strokeWidth:a}){return R.createElement("g",null,R.createElement("path",{className:"tl-stroke-hitarea",d:`M ${e} L ${t} ${i}`}),R.createElement("path",{d:`M ${e} L ${t} ${i}`,fill:"none",stroke:n,strokeWidth:a,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}))}var ll=R.memo(function({id:e,style:t,start:i,bend:n,end:a,arrowBend:r,decorationStart:o,decorationEnd:s,isDraw:l,isDarkMode:d}){let c=z.dist(i,a);if(c<2)return null;let u=sG(t,d),{strokeWidth:p}=u,h=1+1.618*p,m=le(i,n,a),g=[m[0],m[1]],f=m[2],b=lo(g,f,i,a),x=sr[tI.rng(e)()>0?"easeInOutSine":"easeInOutCubic"],y=l?function(e,t,i,n,a,r,o,s,l,d){let c=tI.rng(e),u=sG(t).strokeWidth,p=a?z.rotWith(i,o,u/l):i,h=r?z.rotWith(n,o,-(u/l)):n,m=z.angle(o,p),g=z.angle(o,h),f=[],b=8+Math.floor(Math.abs(l)/20*1+c()/2);for(let e=0;e=0):null;return R.createElement(R.Fragment,null,R.createElement("path",{className:"tl-stroke-hitarea",d:y}),R.createElement("path",{d:y,fill:l?u.stroke:"none",stroke:u.stroke,strokeWidth:l?0:h,strokeDasharray:v,strokeDashoffset:C,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"none"}),S&&R.createElement(ls,{left:S.left,middle:i,right:S.right,stroke:u.stroke,strokeWidth:h}),k&&R.createElement(ls,{left:k.left,middle:a,right:k.right,stroke:u.stroke,strokeWidth:h}))}),ld=R.memo(function({id:e,style:t,start:i,end:n,decorationStart:a,decorationEnd:r,isDraw:o,isDarkMode:s}){let l,d,c,u=z.dist(i,n);if(u<2)return null;let p=sG(t,s),{strokeWidth:h}=p,m=1+1.618*h,g=o?(l=tI.rng(e),d=sG(t).strokeWidth,c=rq([a?z.nudge(i,n,d):i,r?z.nudge(n,i,d):n],{size:d,thinning:.618+.2*l(),easing:sr.easeOutQuad,simulatePressure:!0,streamline:0,last:!0}),tI.getSvgPathFromStroke(c)):"M"+z.toFixed(i)+"L"+z.toFixed(n),{strokeDasharray:f,strokeDashoffset:b}=tI.getPerfectDashProps(u,1.618*h,t.dash,2,!1),x=Math.min(u/3,8*h),y=a?li(i,n,x):null,v=r?li(n,i,x):null;return R.createElement(R.Fragment,null,R.createElement("path",{className:"tl-stroke-hitarea",d:g}),R.createElement("path",{d:g,fill:p.stroke,stroke:p.stroke,strokeWidth:o?m/2:m,strokeDasharray:f,strokeDashoffset:b,strokeLinecap:"round",strokeLinejoin:"round",pointerEvents:"stroke"}),y&&R.createElement(ls,{left:y.left,middle:i,right:y.right,stroke:p.stroke,strokeWidth:m}),v&&R.createElement(ls,{left:v.left,middle:n,right:v.right,stroke:p.stroke,strokeWidth:m}))}),lc=class extends s8{constructor(){super(...arguments),oM(this,"type","arrow"),oM(this,"hideBounds",!0),oM(this,"canEdit",!0),oM(this,"pathCache",new WeakMap),oM(this,"getShape",e=>{var t,i,n,a;return oE({id:"id",type:"arrow",name:"Arrow",parentId:"page",childIndex:1,point:[0,0],rotation:0,bend:0,handles:{start:oE({id:"start",index:0,point:[0,0],canBind:!0},null==(t=e.handles)?void 0:t.start),end:oE({id:"end",index:1,point:[1,1],canBind:!0},null==(i=e.handles)?void 0:i.end),bend:oE({id:"bend",index:2,point:[.5,.5]},null==(n=e.handles)?void 0:n.bend)},decorations:null!=(a=e.decorations)?a:{end:"arrow"},style:oE(o_(oE({},s$),{isFilled:!1}),e.style),label:"",labelPoint:[.5,.5]},e)}),oM(this,"Component",s8.Component(({shape:e,isEditing:t,isGhost:i,meta:n,events:a,onShapeChange:r,onShapeBlur:o},s)=>{var l,d;let{id:c,label:u="",handles:{start:p,bend:h,end:m},decorations:g={},style:f}=e,b=null!=(d=null==(l=null==u?void 0:u.trim())?void 0:l.length)&&d,x=1>z.dist(h.point,z.toFixed(z.med(p.point,m.point))),y=sW(f),v=sG(f,n.isDarkMode),C=b||t?sy(u,y):[0,0],w=this.getBounds(e),S=R.useMemo(()=>{let{start:t,bend:i,end:n}=e.handles;if(x)return z.dist(t.point,n.point);let a=le(t.point,i.point,n.point);return Math.abs(lo(a.slice(0,2),a[2],t.point,n.point))},[e.handles]),k=Math.max(.5,Math.min(1,Math.max(S/(C[1]+128),S/(C[0]+128)))),A=R.useMemo(()=>{let t=this.getBounds(e);return z.sub(e.handles.bend.point,z.toFixed([t.width/2,t.height/2]))},[e,k]),E=R.useCallback(e=>{null==r||r({id:c,label:e})},[r]);return R.createElement(lu,oE({ref:s},a),R.createElement(s1,{font:y,text:u,color:v.stroke,offsetX:A[0],offsetY:A[1],scale:k,isEditing:t,onChange:E,onBlur:o,shape:e}),R.createElement(tW,{id:e.id+"_svg",shapeStyle:f},R.createElement("defs",null,R.createElement("mask",{id:e.id+"_clip"},R.createElement("rect",{x:-100,y:-100,width:w.width+200,height:w.height+200,fill:"white"}),R.createElement("rect",{x:w.width/2-C[0]/2*k+A[0],y:w.height/2-C[1]/2*k+A[1],width:C[0]*k,height:C[1]*k,rx:4*k,ry:4*k,fill:"black",opacity:1}))),R.createElement("g",{pointerEvents:"none",opacity:i?.3:1,mask:b||t?`url(#${e.id}_clip)`:""},R.createElement(x?ld:ll,{id:c,style:f,start:p.point,end:m.point,bend:h.point,arrowBend:e.bend,decorationStart:null==g?void 0:g.start,decorationEnd:null==g?void 0:g.end,isDraw:"draw"===f.dash,isDarkMode:n.isDarkMode}))))})),oM(this,"Indicator",s8.Indicator(({shape:e,bounds:t})=>{var i,n;let{style:a,decorations:r,label:o,handles:{start:s,bend:l,end:d}}=e,c=null!=(n=null==(i=null==o?void 0:o.trim())?void 0:i.length)&&n,u=sW(a),p=c?sy(o,u):[0,0],h=1>z.dist(l.point,z.toFixed(z.med(s.point,d.point))),m=R.useMemo(()=>{let{start:t,bend:i,end:n}=e.handles;if(h)return z.dist(t.point,n.point);let a=le(t.point,i.point,n.point);return Math.abs(lo(a.slice(0,2),a[2],t.point,n.point))},[e.handles]),g=Math.max(.5,Math.min(1,Math.max(m/(p[1]+128),m/(p[0]+128)))),f=R.useMemo(()=>{let t=this.getBounds(e);return z.sub(e.handles.bend.point,[t.width/2,t.height/2])},[e,g]);return R.createElement(R.Fragment,null,c&&R.createElement(sw,{id:e.id,scale:g,offset:f,bounds:t,labelSize:p}),R.createElement("path",{d:function(e,t,i,n,a,r){let{strokeWidth:o}=sG(e,!1),s=Math.min(z.dist(t,n)/3,8*o),l=[];if(1>z.dist(i,z.toFixed(z.med(t,n))))l.push(`M ${t} L ${n}`),a&&l.push(la(t,n,s)),r&&l.push(la(n,t,s));else{let e=le(t,i,n),o=[e[0],e[1]],d=e[2],c=lo(o,d,t,n);l.push(`M ${t} A ${d} ${d} 0 0 ${c>0?"1":"0"} ${n}`),a&&l.push(ln(t,s,o,d,c<0)),r&&l.push(ln(n,s,o,d,c>=0))}return l.join(" ")}(a,s.point,l.point,d.point,null==r?void 0:r.start,null==r?void 0:r.end),mask:c?`url(#${e.id}_clip)`:""}),c&&R.createElement("rect",{x:t.width/2-p[0]/2*g+f[0],y:t.height/2-p[1]/2*g+f[1],width:p[0]*g,height:p[1]*g,rx:4*g,ry:4*g,fill:"transparent"}))})),oM(this,"getBounds",e=>{let t=tI.getFromCache(this.boundsCache,e,()=>{let{handles:{start:t,bend:i,end:n}}=e;return tI.getBoundsFromPoints(lr(t.point,i.point,n.point))});return tI.translateBounds(t,e.point)}),oM(this,"getRotatedBounds",e=>{let{handles:{start:t,bend:i,end:n}}=e,a=lr(t.point,i.point,n.point),{minX:r,minY:o,maxX:s,maxY:l}=tI.getBoundsFromPoints(a);return 0!==e.rotation&&(a=a.map(t=>z.rotWith(t,[(r+s)/2,(o+l)/2],e.rotation||0))),tI.translateBounds(tI.getBoundsFromPoints(a),e.point)}),oM(this,"getCenter",e=>{let{start:t,end:i}=e.handles;return z.add(e.point,z.med(t.point,i.point))}),oM(this,"shouldRender",(e,t)=>t.decorations!==e.decorations||t.handles!==e.handles||t.style!==e.style||t.label!==e.label),oM(this,"hitTestPoint",(e,t)=>{let{handles:{start:i,bend:n,end:a}}=e,r=z.sub(t,e.point),o=lr(i.point,n.point,a.point);for(let e=1;ez.distanceToLineSegment(o[e-1],o[e],r))return!0;return!1}),oM(this,"hitTestLineSegment",(e,t,i)=>{let{handles:{start:n,bend:a,end:r}}=e,o=z.sub(t,e.point),s=z.sub(i,e.point),l=lr(n.point,a.point,r.point);for(let e=1;e{let{start:i,end:n,bend:a}=e.handles,r=z.add(e.point,i.point),o=z.add(e.point,n.point);if(tI.pointInBounds(r,t)||tI.pointInBounds(o,t))return!0;if(z.isEqual(z.med(i.point,n.point),a.point))return ts(t,r,o).length>0;{let[s,l,d]=le(i.point,a.point,n.point);return function(e,t,i,n,a){var r,o;let{minX:s,minY:l,width:d,height:c}=a;return e8(r=[s,l],o=[d,c]).reduce((a,[r,[o,s]])=>{let l=function(e,t,i,n,a,r){let o=z.angle(e,i),s=z.angle(e,n),l=function(e,t,i,n=0,a,r){return t===i?tn(a,r,e,t):ta(a,r,e,t,i,n)}(e,t,t,0,a,r);if(!l.didIntersect)return e9("no intersection");let d=l.points.filter(t=>(function(e,t,i){if(i===e||i===t)return!0;let n=2*Math.PI,a=(t-e+n)%n;return a<=Math.PI!=(i-e+n)%n>a})(o,s,z.angle(e,t)));return 0===d.length?e9("no intersection"):e9("intersection",...d)}(e,t,i,n,o,s);return l&&a.push(e0(e6({},l),e1({message:r}))),a},[]).filter(e=>e.didIntersect)}(z.add(e.point,[s,l]),d,r,o,t).length>0}}),oM(this,"transform",(e,t,{initialShape:i,scaleX:n,scaleY:a})=>{let r=this.getBounds(i),o=oE({},i.handles);["start","end"].forEach(e=>{let[i,s]=o[e].point,l=i/r.width,d=s/r.height;o[e]=o_(oE({},o[e]),{point:[t.width*(n<0?1-l:l),t.height*(a<0?1-d:d)]})});let{start:s,bend:l,end:d}=o,c=z.dist(s.point,d.point),u=z.med(s.point,d.point),p=c/2*i.bend,h=z.uni(z.vec(s.point,d.point)),m=z.add(u,z.mul(z.per(h),p));return o.bend=o_(oE({},l),{point:z.toFixed(10>Math.abs(p)?u:m)}),{point:z.toFixed([t.minX,t.minY]),handles:o}}),oM(this,"onDoubleClickHandle",(e,t)=>{var i,n;switch(t){case"bend":return{bend:0,handles:o_(oE({},e.handles),{bend:o_(oE({},e.handles.bend),{point:s7(e.handles,e.bend)})})};case"start":return{decorations:o_(oE({},e.decorations),{start:(null==(i=e.decorations)?void 0:i.start)?void 0:"arrow"})};case"end":return{decorations:o_(oE({},e.decorations),{end:(null==(n=e.decorations)?void 0:n.end)?void 0:"arrow"})}}return this}),oM(this,"onHandleChange",(e,t)=>{let i=tI.deepMerge(e.handles,t),n=e.bend;if(i=tI.deepMerge(i,{start:{point:z.toFixed(i.start.point)},end:{point:z.toFixed(i.end.point)}}),z.isEqual(i.start.point,i.end.point))return;if("bend"in t){let{start:e,end:t,bend:a}=i,r=z.dist(e.point,t.point),o=z.med(e.point,t.point),s=z.angle(e.point,t.point),l=z.uni(z.vec(e.point,t.point)),d=z.add(o,z.mul(z.per(l),r)),c=z.sub(o,z.mul(z.per(l),r)),u=z.nearestPointOnLineSegment(d,c,a.point,!0),p=z.dist(o,u)/(r/2);n=tI.clamp(p,-.99,.99);let h=z.angle(e.point,u);z.isEqual(o,s7(i,n))?n=0:function(e,t,i){if(i===e||i===t)return!0;let n=2*Math.PI,a=(t-e+n)%n;return a<=Math.PI!=(i-e+n)%n>a}(s,s+Math.PI,h)&&(n*=-1)}let a={point:e.point,bend:n,handles:o_(oE({},i),{bend:o_(oE({},i.bend),{point:s7(i,n)})})},r=e.point,o=this.getBounds(oE({},a)),s=z.sub([o.minX,o.minY],r);return z.isEqual(s,[0,0])||(Object.values(a.handles).forEach(e=>{e.point=z.toFixed(z.sub(e.point,s))}),a.point=z.toFixed(z.add(a.point,s))),a}),oM(this,"getSvgElement",(e,t)=>{var i,n,a,r,o;let s=null==(i=document.getElementById(e.id+"_svg"))?void 0:i.cloneNode(!0);if(s){if(null!=(r=null==(a=null==(n=e.label)?void 0:n.trim())?void 0:a.length)&&r){let i=document.createElementNS("http://www.w3.org/2000/svg","g"),n=sW(e.style),a=sy(e.label,n),r=sz(e.style.size,e.style.font)*(null!=(o=e.style.scale)?o:1),l=sF(e.style.font).slice(1,-1),d=sC(e.label,r,l,"start",a[0],!1),c,{start:u,bend:p,end:h}=e.handles;if(1>z.dist(p.point,z.toFixed(z.med(u.point,h.point))))c=z.dist(u.point,h.point);else{let e=le(u.point,p.point,h.point);c=Math.abs(lo(e.slice(0,2),e[2],u.point,h.point))}let m=Math.max(.5,Math.min(1,Math.max(c/(a[1]+128),c/(a[0]+128)))),g=this.getBounds(e),f=z.sub(e.handles.bend.point,[g.width/2,g.height/2]),b=g.width/2-a[0]/2*m+f[0],x=g.height/2-a[1]/2*m+f[1];return d.setAttribute("transform",`translate(${b}, ${x})`),d.setAttribute("fill",sG(e.style,t).stroke),d.setAttribute("transform-origin","center center"),i.setAttribute("text-align","center"),i.setAttribute("text-anchor","middle"),i.appendChild(s),i.appendChild(d),i}return s}})}},lu=o6("div",{width:"100%",height:"100%"}),lp={easing:e=>Math.sin(e*Math.PI/2),simulatePressure:!0},lh={easing:e=>e*e,simulatePressure:!1};function lm(e){return o_(oE({size:1+1.5*sG(e.style).strokeWidth,thinning:.65,streamline:.65,smoothing:.65},.5===e.points[1][2]?lp:lh),{last:e.isComplete})}function lg(e){let{points:t}=e;if(t.length<2)return"M 0 0 L 0 0";let i=lm(e),n=rK(e.points,i),a=t[t.length-1];return z.isEqual(n[0].point,a)||n.push({point:a}),tI.getSvgPathFromStrokePoints(n)}var lf=class extends s8{constructor(){super(...arguments),oM(this,"type","draw"),oM(this,"pointsBoundsCache",new WeakMap([])),oM(this,"shapeBoundsCache",new Map),oM(this,"rotatedCache",new WeakMap([])),oM(this,"pointCache",{}),oM(this,"canClone",!0),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"draw",name:"Draw",parentId:"page",childIndex:1,point:[0,0],rotation:0,style:s$,points:[],isComplete:!1},e)),oM(this,"Component",s8.Component(({shape:e,meta:t,isSelected:i,isGhost:n,events:a},r)=>{let{points:o,style:s,isComplete:l}=e,d=R.useMemo(()=>e.points.length<2?"":tI.getSvgPathFromStroke(rK(e.points,lm(e)).map(e=>e.point)),[o,s.size]),c=R.useMemo(()=>"draw"===s.dash?function(e){if(e.points.length<2)return"";let t=lm(e),i=rK(e.points,t);return tI.getSvgPathFromStroke(rZ(i,t))}(e):lg(e),[o,s.size,s.dash,l]),{stroke:u,fill:p,strokeWidth:h}=sG(s,t.isDarkMode),m=this.getBounds(e);if(m.width<=h/2&&m.height<=h/2)return R.createElement(tW,oE({ref:r,id:e.id+"_svg"},a),R.createElement("circle",{r:1+h,fill:u,stroke:u,pointerEvents:"all",opacity:n?.3:1}));let g=s.isFilled&&o.length>3&&z.dist(o[0],o[o.length-1])<2*h;if("draw"===e.style.dash)return R.createElement(tW,oE({ref:r,id:e.id+"_svg"},a),R.createElement("g",{opacity:n?.3:1},R.createElement("path",{className:g||i?"tl-fill-hitarea":"tl-stroke-hitarea",d:c}),g&&R.createElement("path",{d:d,stroke:"none",fill:p,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),R.createElement("path",{d:c,fill:u,stroke:u,strokeWidth:h/2,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"})));let f={draw:"none",solid:"none",dotted:`0.1 ${4*h}`,dashed:`${4*h} ${4*h}`}[s.dash],b={draw:"none",solid:"none",dotted:"0",dashed:"0"}[s.dash];return R.createElement(tW,oE({ref:r,id:e.id+"_svg"},a),R.createElement("g",{opacity:n?.3:1},R.createElement("path",{className:g&&i?"tl-fill-hitarea":"tl-stroke-hitarea",d:c}),R.createElement("path",{d:c,fill:g?p:"none",stroke:"none",strokeWidth:Math.min(4,2*h),strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"}),R.createElement("path",{d:c,fill:"none",stroke:u,strokeWidth:1+1.5*h,strokeDasharray:f,strokeDashoffset:b,strokeLinejoin:"round",strokeLinecap:"round",pointerEvents:"none"})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{points:t}=e,i=R.useMemo(()=>lg(e),[t]),n=this.getBounds(e);return n.width<4&&n.height<4?R.createElement("circle",{x:n.width/2,y:n.height/2,r:1}):R.createElement("path",{d:i})})),oM(this,"transform",(e,t,{initialShape:i,scaleX:n,scaleY:a})=>{let r=tI.getFromCache(this.boundsCache,i,()=>tI.getBoundsFromPoints(i.points)),o=i.points.map(([e,i,o])=>[t.width*(n<0?1-e/r.width:e/r.width),t.height*(a<0?1-i/r.height:i/r.height),o]),s=tI.getBoundsFromPoints(e.points);return{points:o,point:z.sub([t.minX,t.minY],[s.minX,s.minY])}}),oM(this,"getBounds",e=>{let t=!this.pointsBoundsCache.has(e.points),i=this.pointCache[e.id]!==e.point;if(t){let t=tI.getBoundsFromPoints(e.points);this.pointsBoundsCache.set(e.points,t),this.shapeBoundsCache.set(e.id,tI.translateBounds(t,e.point)),this.pointCache[e.id]=e.point}else i&&!t&&(this.pointCache[e.id]=e.point,this.shapeBoundsCache.set(e.id,tI.translateBounds(this.pointsBoundsCache.get(e.points),e.point)));return this.shapeBoundsCache.get(e.id)}),oM(this,"shouldRender",(e,t)=>t.points!==e.points||t.style!==e.style||t.isComplete!==e.isComplete),oM(this,"hitTestPoint",(e,t)=>{let i=z.sub(t,e.point);return tI.pointInPolyline(i,e.points)}),oM(this,"hitTestLineSegment",(e,t,i)=>{let{points:n,point:a}=e,r=z.sub(t,a),o=z.sub(i,a),s=this.getBounds(e);if(s.width<8&&s.height<8)return 5>z.distanceToLineSegment(t,i,tI.getBoundsCenter(s));if(ts(s,r,o)){for(let e=1;e{var i,n,a,r,o;if(!e.rotation){let s=this.getBounds(e);return tI.boundsContain(t,s)||(tI.boundsContain(s,t)||(i=[s.minX,s.minY],n=[s.width,s.height],a=[t.minX,t.minY],r=[t.width,t.height],e8(i,n).reduce((e,[t,[i,n]])=>{let o=to(a,r,i,n);return e.push(...o.map(e=>e9(`${t} ${e.message}`,...e.points))),e},[]).filter(e=>e.didIntersect)).length>0)&&(o=tI.translateBounds(t,z.neg(e.point)),tl(e.points,o)).length>0}let s=this.getRotatedBounds(e),l=tI.getFromCache(this.rotatedCache,e,()=>{let t=tI.getBoundsCenter(tI.getBoundsFromPoints(e.points));return e.points.map(i=>z.rotWith(i,t,e.rotation||0))});return tI.boundsContain(t,s)||tl(l,tI.translateBounds(t,z.neg(e.point))).length>0})}},lb=R.memo(function({radius:e,style:t,isSelected:i,isDarkMode:n}){let{stroke:a,strokeWidth:r,fill:o}=sG(t,n),s=1+1.618*r,l=Math.max(0,e[0]-s/2),d=Math.max(0,e[1]-s/2),c=tI.perimeterOfEllipse(l,d),{strokeDasharray:u,strokeDashoffset:p}=tI.getPerfectDashProps(c<64?2*c:c,1.618*r,t.dash,4);return R.createElement(R.Fragment,null,R.createElement("ellipse",{className:t.isFilled||i?"tl-fill-hitarea":"tl-stroke-hitarea",cx:e[0],cy:e[1],rx:e[0],ry:e[1]}),R.createElement("ellipse",{cx:e[0],cy:e[1],rx:l,ry:d,fill:o,stroke:a,strokeWidth:s,strokeDasharray:u,strokeDashoffset:p,pointerEvents:"none",strokeLinecap:"round",strokeLinejoin:"round"}))});function lx(e,t,i){let{strokeWidth:n}=sG(i),a=tI.rng(e),r=t[0]+a()*n*2,o=t[1]+a()*n*2,s=tI.perimeterOfEllipse(r,o),l=[],d=Math.PI+Math.PI*a(),c=Math.abs(a()),u=Math.max(16,s/10);for(let e=0;etI.deepMerge({id:"id",type:"ellipse",name:"Ellipse",parentId:"page",childIndex:1,point:[0,0],radius:[1,1],rotation:0,style:s$,label:"",labelPoint:[.5,.5]},e)),oM(this,"Component",s8.Component(({shape:e,isGhost:t,isSelected:i,isBinding:n,isEditing:a,meta:r,bounds:o,events:s,onShapeChange:l,onShapeBlur:d},c)=>{let{id:u,radius:p,style:h,label:m="",labelPoint:g=sn}=e,f=sW(e.style),b=sG(h,r.isDarkMode),x=1+1.618*b.strokeWidth,y=Math.max(0,p[0]-x/2),v=Math.max(0,p[1]-x/2),C="draw"===h.dash?lv:lb,w=R.useCallback(e=>null==l?void 0:l({id:u,label:e}),[l]);return R.createElement(lw,oE({ref:c},s),R.createElement(s1,{isEditing:a,onChange:w,onBlur:d,font:f,text:m,color:b.stroke,offsetX:(g[0]-.5)*o.width,offsetY:(g[1]-.5)*o.height,shape:e}),R.createElement(tW,{id:e.id+"_svg",opacity:t?.3:1,shapeStyle:h},n&&R.createElement("ellipse",{className:"tl-binding-indicator",cx:p[0],cy:p[1],rx:y,ry:v,strokeWidth:this.bindingDistance}),R.createElement(C,{id:u,radius:p,style:h,isSelected:i,isDarkMode:r.isDarkMode})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{id:t,radius:i,style:n}=e,a=1+1.618*sG(n).strokeWidth,r=Math.max(0,i[0]-a/2),o=Math.max(0,i[1]-a/2);return"draw"===n.dash?R.createElement("path",{d:ly(t,i,n)}):R.createElement("ellipse",{cx:i[0],cy:i[1],rx:r,ry:o})})),oM(this,"hitTestPoint",(e,t)=>tI.pointInBounds(t,this.getRotatedBounds(e))&&tI.pointInEllipse(t,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0)),oM(this,"hitTestLineSegment",(e,t,i)=>ta(t,i,this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0).didIntersect),oM(this,"getBounds",e=>tI.getFromCache(this.boundsCache,e,()=>tI.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],0))),oM(this,"getRotatedBounds",e=>tI.getRotatedEllipseBounds(e.point[0],e.point[1],e.radius[0],e.radius[1],e.rotation)),oM(this,"hitTestBounds",(e,t)=>{let i=this.getBounds(e);return tI.boundsContained(i,t)||function(e,t,i,n,a){let{minX:r,minY:o,width:s,height:l}=a;return function(e,t,i,n=0,a,r){if(t===i)return e8(a,r).reduce((i,[n,[a,r]])=>{let o=tn(a,r,e,t);return o&&i.push(e0(e6({},o),e1({message:n}))),i},[]).filter(e=>e.didIntersect);return function(e,t,i,n,a,r=0){return e8(e,t).reduce((e,[t,[o,s]])=>{let l=ta(o,s,i,n,a,r);return l&&e.push(e0(e6({},l),e1({message:t}))),e},[]).filter(e=>e.didIntersect)}(a,r,e,t,i,n)}(e,t,i,n,[r,o],[s,l])}(this.getCenter(e),e.radius[0],e.radius[1],e.rotation||0,t).length>0}),oM(this,"shouldRender",(e,t)=>t.radius!==e.radius||t.style!==e.style||t.label!==e.label),oM(this,"getCenter",e=>z.add(e.point,e.radius)),oM(this,"getBindingPoint",(e,t,i,n,a,r)=>{{let t=this.getExpandedBounds(e),o=this.getCenter(e),s,l;if(!tI.pointInEllipse(i,o,e.radius[0]+this.bindingDistance,e.radius[1]+this.bindingDistance))return;if(r)s=12>z.dist(i,this.getCenter(e))?[.5,.5]:z.divV(z.sub(i,[t.minX,t.minY]),[t.width,t.height]),l=0;else{let r=te(n,a,o,e.radius[0],e.radius[1],e.rotation||0).points.sort((e,t)=>z.dist(e,n)-z.dist(t,n))[0];if(r||(r=ta(i,o,o,e.radius[0],e.radius[1],e.rotation||0).points.sort((e,t)=>z.dist(e,i)-z.dist(t,i))[0]),!r)return;let d=z.med(i,r);if(s=12>z.distanceToLineSegment(i,d,this.getCenter(e))?[.5,.5]:z.divV(z.sub(d,[t.minX,t.minY]),[t.width,t.height]),tI.pointInEllipse(i,o,e.radius[0],e.radius[1],e.rotation||0))l=this.bindingDistance/2;else{let t=ta(i,o,o,e.radius[0],e.radius[1],e.rotation||0).points[0];if(!t)return;l=Math.max(this.bindingDistance/2,z.dist(i,t))}}return{point:s,distance:l}}}),oM(this,"transform",(e,t,{scaleX:i,scaleY:n,initialShape:a})=>{let{rotation:r=0}=a;return{point:[t.minX,t.minY],radius:[t.width/2,t.height/2],rotation:i<0&&n>=0||n<0&&i>=0?-(r||0):r||0}}),oM(this,"transformSingle",(e,t)=>({point:z.toFixed([t.minX,t.minY]),radius:z.div([t.width,t.height],2)}))}},lw=o6("div",{width:"100%",height:"100%"}),lS=class extends s8{constructor(){super(...arguments),oM(this,"type","group"),oM(this,"canBind",!0),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"group",name:"Group",parentId:"page",childIndex:1,point:[0,0],size:[100,100],rotation:0,children:[],style:s$},e)),oM(this,"Component",s8.Component(({shape:e,isBinding:t,isGhost:i,isHovered:n,isSelected:a,events:r},o)=>{let{id:s,size:l}=e,d=Math.max(0,l[0]-1),c=Math.max(0,l[1]-1),u=[[[1,1],[d,1],d-1],[[d,1],[d,c],c-1],[[d,c],[1,c],d-1],[[1,c],[1,1],c-1]].map(([e,t],i)=>R.createElement("line",{key:s+"_"+i,x1:e[0],y1:e[1],x2:t[0],y2:t[1]}));return R.createElement(tW,oE({ref:o},r),t&&R.createElement("rect",{className:"tl-binding-indicator",strokeWidth:this.bindingDistance}),R.createElement("g",{opacity:i?.3:1},R.createElement("rect",{x:0,y:0,width:l[0],height:l[1],fill:"transparent",pointerEvents:"all"}),R.createElement(lk,{stroke:"black",opacity:n||a?1:0,strokeLinecap:"round",pointerEvents:"stroke"},u)))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{id:t,size:i}=e,n=Math.max(0,i[0]-1),a=Math.max(0,i[1]-1),r=[[[1,1],[n,1],n-1],[[n,1],[n,a],a-1],[[n,a],[1,a],n-1],[[1,a],[1,1],a-1]].map(([e,i],n)=>R.createElement("line",{key:t+"_"+n,x1:e[0],y1:e[1],x2:i[0],y2:i[1]}));return R.createElement(lk,{strokeLinecap:"round",pointerEvents:"stroke"},r)})),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style)}},lk=o6("g",{strokeWidth:"calc(1.5px * var(--tl-scale))",strokeDasharray:"calc(1px * var(--tl-scale)), calc(3px * var(--tl-scale))"}),lA=class extends s8{constructor(){super(...arguments),oM(this,"type","image"),oM(this,"canBind",!0),oM(this,"canClone",!0),oM(this,"isAspectRatioLocked",!0),oM(this,"showCloneHandles",!1),oM(this,"getShape",e=>tI.deepMerge({id:"image",type:"image",name:"Image",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:o_(oE({},s$),{isFilled:!0}),assetId:"assetId"},e)),oM(this,"Component",s8.Component(({shape:e,asset:t={src:""},isBinding:i,isGhost:n,meta:a,events:r,onShapeChange:o},s)=>{let{size:l,style:d}=e,{bindingDistance:c}=this,u=R.useRef(null),p=R.useRef(null);return R.useLayoutEffect(()=>{let e=p.current;if(!e)return;let[t,i]=l;e.style.width=`${t}px`,e.style.height=`${i}px`},[l]),R.createElement(il,oE({ref:s},r),i&&R.createElement("div",{className:"tl-binding-indicator",style:{position:"absolute",top:`calc(${-c}px * var(--tl-zoom))`,left:`calc(${-c}px * var(--tl-zoom))`,width:`calc(100% + ${2*c}px * var(--tl-zoom))`,height:`calc(100% + ${2*c}px * var(--tl-zoom))`,backgroundColor:"var(--tl-selectFill)"}}),R.createElement(lE,{ref:p,isDarkMode:a.isDarkMode,isFilled:d.isFilled,isGhost:n},R.createElement(l_,{id:e.id+"_image",ref:u,src:t.src,alt:"tl_image_asset",draggable:!1})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{size:[t,i]}=e;return R.createElement("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,i)})})),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style),oM(this,"transform",s6),oM(this,"transformSingle",s9),oM(this,"getSvgElement",e=>{let t=this.getBounds(e),i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("width",`${t.width}`),i.setAttribute("height",`${t.height}`),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),i})}},lE=rP("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{}},{isFilled:!0,isDarkMode:!1,css:{}}]}),l_=rP("img",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2});function lI({strokeWidth:e,size:t}){return R.createElement("rect",{className:"tl-binding-indicator",x:e,y:e,width:Math.max(0,t[0]-e/2),height:Math.max(0,t[1]-e/2),strokeWidth:32})}var lM=R.memo(function({id:e,style:t,size:i,isSelected:n,isDarkMode:a}){let{stroke:r,strokeWidth:o,fill:s}=sG(t,a),l=1+1.618*o,d=Math.max(0,i[0]-l/2),c=Math.max(0,i[1]-l/2),u=[[[l/2,l/2],[d,l/2],d-l/2],[[d,l/2],[d,c],c-l/2],[[d,c],[l/2,c],d-l/2],[[l/2,c],[l/2,l/2],c-l/2]].map(([i,n,a],r)=>{let{strokeDasharray:s,strokeDashoffset:l}=tI.getPerfectDashProps(a,1.618*o,t.dash);return R.createElement("line",{key:e+"_"+r,x1:i[0],y1:i[1],x2:n[0],y2:n[1],strokeDasharray:s,strokeDashoffset:l})});return R.createElement(R.Fragment,null,R.createElement("rect",{className:n||t.isFilled?"tl-fill-hitarea":"tl-stroke-hitarea",x:l/2,y:l/2,width:d,height:c,strokeWidth:16}),t.isFilled&&R.createElement("rect",{x:l/2,y:l/2,width:d,height:c,fill:s,pointerEvents:"none"}),R.createElement("g",{pointerEvents:"none",stroke:r,strokeWidth:l,strokeLinecap:"round"},u))});function lT(e,t,i){let n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,{points:y}=(n=sG(t),a=tI.rng(e),r=n.strokeWidth,o=Math.max(0,i[0]),s=Math.max(0,i[1]),l=Array.from([,,,,]).map(()=>[a()*r*.75,a()*r*.75]),d=z.add([r/2,r/2],l[0]),c=z.add([o-r/2,r/2],l[1]),u=z.add([o-r/2,s-r/2],l[2]),p=z.add([r/2,s-r/2],l[3]),h=Math.round(Math.abs(2*a()*4)),m=Math.min(o/4,2*r),g=Math.min(s/4,2*r),f=Math.max(8,Math.floor(o/16)),b=Math.max(8,Math.floor(s/16)),{points:[...(x=tI.rotateArray([z.pointsBetween(z.add(d,[m,0]),z.sub(c,[m,0]),f),z.pointsBetween(z.add(c,[0,g]),z.sub(u,[0,g]),b),z.pointsBetween(z.sub(u,[m,0]),z.add(p,[m,0]),f),z.pointsBetween(z.sub(p,[0,g]),z.add(d,[0,g]),b)],h)).flat(),...x[0]].slice(5,Math.floor(-((h%2==0?f:b)/2))+3)}),{strokeWidth:v}=sG(t);return{points:y,options:{size:v,thinning:.65,streamline:.3,smoothing:1,simulatePressure:!1,last:!0}}}function lL(e,t,i){let{points:n,options:a}=lT(e,t,i);return tI.getSvgPathFromStrokePoints(rK(n,a))}var lj,lP,lD,lN=R.memo(function({id:e,style:t,size:i,isSelected:n,isDarkMode:a}){let{isFilled:r}=t,{stroke:o,strokeWidth:s,fill:l}=sG(t,a),d=function(e,t,i){let{points:n,options:a}=lT(e,t,i),r=rq(n,a);return tI.getSvgPathFromStroke(r)}(e,t,i),c=lL(e,t,i);return R.createElement(R.Fragment,null,R.createElement("path",{className:t.isFilled||n?"tl-fill-hitarea":"tl-stroke-hitarea",d:c}),r&&R.createElement("path",{d:c,fill:l,pointerEvents:"none"}),R.createElement("path",{d:d,fill:o,stroke:o,strokeWidth:s,pointerEvents:"none"}))}),lR=class extends s8{constructor(){super(...arguments),oM(this,"type","rectangle"),oM(this,"canBind",!0),oM(this,"canClone",!0),oM(this,"canEdit",!0),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"rectangle",name:"Rectangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:s$,label:"",labelPoint:[.5,.5]},e)),oM(this,"Component",s8.Component(({shape:e,isEditing:t,isBinding:i,isSelected:n,isGhost:a,meta:r,bounds:o,events:s,onShapeBlur:l,onShapeChange:d},c)=>{let{id:u,size:p,style:h,label:m="",labelPoint:g=sn}=e,f=sW(h),b=sG(h,r.isDarkMode),x="draw"===h.dash?lN:lM,y=R.useCallback(e=>null==d?void 0:d({id:u,label:e}),[d]);return R.createElement(lO,oE({ref:c},s),R.createElement(s1,{isEditing:t,onChange:y,onBlur:l,font:f,text:m,color:b.stroke,offsetX:(g[0]-.5)*o.width,offsetY:(g[1]-.5)*o.height,shape:e}),R.createElement(tW,{id:e.id+"_svg",opacity:a?.3:1,shapeStyle:h},i&&R.createElement(lI,{strokeWidth:b.strokeWidth,size:p}),R.createElement(x,{id:u,style:h,size:p,isSelected:n,isDarkMode:r.isDarkMode})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{id:t,style:i,size:n}=e,a=sG(i,!1).strokeWidth;return"draw"===i.dash?R.createElement("path",{d:lL(t,i,n)}):R.createElement("rect",{x:a,y:a,rx:1,ry:1,width:Math.max(1,n[0]-2*a),height:Math.max(1,n[1]-2*a)})})),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label),oM(this,"transform",s6),oM(this,"transformSingle",s9)}},lO=o6("div",{width:"100%",height:"100%"}),lB=class extends s8{constructor(){super(...arguments),oM(this,"type","sticky"),oM(this,"canBind",!0),oM(this,"canEdit",!0),oM(this,"canClone",!0),oM(this,"hideResizeHandles",!0),oM(this,"showCloneHandles",!0),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"sticky",name:"Sticky",parentId:"page",childIndex:1,point:[0,0],size:[200,200],text:"",rotation:0,style:sZ},e)),oM(this,"Component",s8.Component(({shape:e,meta:t,events:i,isGhost:n,isBinding:a,isEditing:r,onShapeBlur:o,onShapeChange:s},l)=>{let d=sU(e.style),{color:c,fill:u}=sV(e.style,t.isDarkMode),p=R.useRef(null),h=R.useRef(null),m=R.useRef(null),g=R.useRef(!1),f=R.useCallback(e=>{e.stopPropagation()},[]),b=R.useCallback(t=>{null==s||s({id:e.id,type:e.type,text:s0.normalizeText(t)})},[e.id]),x=R.useCallback(e=>{b(e.currentTarget.value)},[s,b]),y=R.useCallback(t=>{if("Escape"===t.key){t.preventDefault(),t.stopPropagation(),null==o||o();return}if("Tab"===t.key&&0===e.text.length)return void t.preventDefault();if("Meta"===t.key||t.metaKey){if("z"===t.key&&t.metaKey){t.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),t.stopPropagation(),t.preventDefault();return}}else t.stopPropagation();(t.metaKey||t.ctrlKey)&&"="===t.key&&t.preventDefault(),"Tab"===t.key&&(t.preventDefault(),t.shiftKey?sK.unindent(t.currentTarget):sK.indent(t.currentTarget),null==s||s(o_(oE({},e),{text:s0.normalizeText(t.currentTarget.value)})))},[e,s]),v=R.useCallback(e=>{e.currentTarget.setSelectionRange(0,0),null==o||o()},[]),C=R.useCallback(e=>{r&&g.current&&e.currentTarget.select()},[r]);R.useEffect(()=>{if(r){g.current=!0;let e=h.current;e.focus(),e.select()}},[r]),R.useEffect(()=>{let t=m.current,{size:i}=e,{offsetHeight:n}=t,a=lF-2*lz;if(n===i[1]-2*lz)return;if(n>a){null==s||s({id:e.id,size:[i[0],n+2*lz]});return}if(nlF){null==s||s({id:e.id,size:[i[0],lF]});return}let r=h.current;null==r||r.focus()},[e.text,e.size[1],e.style]);let w={font:d,color:c,textShadow:t.isDarkMode?"0.5px 0.5px 2px rgba(255, 255, 255,.25)":"0.5px 0.5px 2px rgba(255, 255, 255,.5)"};return R.createElement(il,oE({ref:l},i),R.createElement(lH,{ref:p,isDarkMode:t.isDarkMode,isGhost:n,style:oE({backgroundColor:u},w)},a&&R.createElement("div",{className:"tl-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${2*this.bindingDistance}px)`,height:`calc(100% + ${2*this.bindingDistance}px)`,backgroundColor:"var(--tl-selectFill)"}}),R.createElement(lU,{ref:m,isEditing:r,alignment:e.style.textAlign},e.text,"​"),r&&R.createElement(lV,{ref:h,onPointerDown:f,value:e.text,onChange:x,onKeyDown:y,onFocus:C,onBlur:v,tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,spellCheck:!0,alignment:e.style.textAlign,onContextMenu:sq,onCopy:sq,onPaste:sq,onCut:sq})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{size:[t,i]}=e;return R.createElement("rect",{x:0,y:0,rx:3,ry:3,width:Math.max(1,t),height:Math.max(1,i)})})),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.text!==e.text),oM(this,"transform",(e,t,{scaleX:i,scaleY:n,transformOrigin:a})=>({point:z.toFixed([t.minX+(t.width-e.size[0])*(i<0?1-a[0]:a[0]),t.minY+(t.height-e.size[1])*(n<0?1-a[1]:a[1])])})),oM(this,"transformSingle",e=>e),oM(this,"getSvgElement",(e,t)=>{var i,n;let a=this.getBounds(e),r=sV(e.style,t),o=sO[e.style.size]*(null!=(i=e.style.scale)?i:1),s=sF(e.style.font).slice(1,-1),l=null!=(n=e.style.textAlign)?n:"start",d=sC(e.text,o,s,l,a.width-2*lz,!0);d.setAttribute("fill",r.color),d.setAttribute("transform",`translate(${lz}, ${lz})`);let c=document.createElementNS("http://www.w3.org/2000/svg","g"),u=document.createElementNS("http://www.w3.org/2000/svg","rect");return u.setAttribute("width",a.width+""),u.setAttribute("height",a.height+""),u.setAttribute("fill",r.fill),u.setAttribute("rx","3"),u.setAttribute("ry","3"),c.appendChild(u),c.appendChild(d),c})}},lz=16,lF=200,lH=o6("div",{pointerEvents:"all",position:"relative",backgroundColor:"rgba(255, 220, 100)",fontFamily:"sans-serif",height:"100%",width:"100%",padding:"16px",borderRadius:"3px",perspective:"800px",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isDarkMode:{true:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"},false:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}}}),lW={whiteSpace:"pre-wrap",overflowWrap:"break-word",letterSpacing:si},lU=o6("div",oE({position:"absolute",top:lz,left:lz,width:`calc(100% - ${2*lz}px)`,height:"fit-content",font:"inherit",pointerEvents:"none",userSelect:"none",variants:{isEditing:{true:{opacity:1},false:{opacity:1}},alignment:{start:{textAlign:"left"},middle:{textAlign:"center"},end:{textAlign:"right"},justify:{textAlign:"justify"}}}},lW)),lV=o6("textarea",o_(oE({width:"100%",height:"100%",border:"none",overflow:"hidden",background:"none",outline:"none",textAlign:"left",font:"inherit",padding:0,color:"transparent",verticalAlign:"top",resize:"none",caretColor:"black"},lW),{variants:{alignment:{start:{textAlign:"left"},middle:{textAlign:"center"},end:{textAlign:"right"},justify:{textAlign:"justify"}}},"&:focus":{outline:"none",border:"none"}})),lG=class extends s8{constructor(){super(...arguments),oM(this,"type","text"),oM(this,"isAspectRatioLocked",!0),oM(this,"canEdit",!0),oM(this,"canBind",!0),oM(this,"canClone",!0),oM(this,"bindingDistance",8),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"text",name:"Text",parentId:"page",childIndex:1,point:[0,0],rotation:0,text:" ",style:sZ},e)),oM(this,"texts",new Map),oM(this,"Component",s8.Component(({shape:e,isBinding:t,isGhost:i,isEditing:n,onShapeBlur:a,onShapeChange:r,meta:o,events:s},l)=>{let{text:d,style:c}=e,u=sG(c,o.isDarkMode),p=sW(e.style),h=R.useRef(null),m=R.useRef(!1),g=R.useRef(d);R.useLayoutEffect(()=>{if(d!==g.current){let t=[0,0];this.texts.set(e.id,d);let i=this.getBounds(e),n=this.getBounds(e);switch(e.style.textAlign){case"start":break;case"middle":t=z.div([n.width-i.width,0],2);break;case"end":t=[n.width-i.width,0]}g.current=d,null==r||r(o_(oE({},e),{id:e.id,point:z.sub(e.point,t),text:d}))}},[d]);let f=R.useCallback(t=>{let i=[0,0],n=s0.normalizeText(t.currentTarget.value),a=this.getBounds(e);this.texts.set(e.id,n);let o=this.getBounds(o_(oE({},e),{text:n}));switch(e.style.textAlign){case"start":break;case"middle":i=z.div([o.width-a.width,0],2);break;case"end":i=[o.width-a.width,0]}g.current=n,null==r||r(o_(oE({},e),{id:e.id,point:z.sub(e.point,i),text:n}))},[e.id,e.point]),b=R.useCallback(t=>{if("Escape"===t.key){t.preventDefault(),t.stopPropagation(),null==a||a();return}if("Tab"===t.key&&0===e.text.length)return void t.preventDefault();if("Enter"===t.key&&(t.metaKey||t.ctrlKey)){t.preventDefault(),t.stopPropagation(),h.current.blur();return}if("Meta"===t.key||t.metaKey){if("z"===t.key&&t.metaKey){t.shiftKey?document.execCommand("redo",!1):document.execCommand("undo",!1),t.stopPropagation(),t.preventDefault();return}}else t.stopPropagation();(t.metaKey||t.ctrlKey)&&"="===t.key&&t.preventDefault(),"Tab"===t.key&&(t.preventDefault(),t.shiftKey?sK.unindent(t.currentTarget):sK.indent(t.currentTarget),null==r||r(o_(oE({},e),{text:s0.normalizeText(t.currentTarget.value)})))},[e,r]),x=R.useCallback(e=>{e.currentTarget.setSelectionRange(0,0),null==a||a()},[]),y=R.useCallback(e=>{n&&m.current&&document.activeElement===e.currentTarget&&e.currentTarget.select()},[n]),v=R.useCallback(e=>{n&&e.stopPropagation()},[n]);return R.useEffect(()=>{n?(this.texts.set(e.id,d),requestAnimationFrame(()=>{m.current=!0;let e=h.current;e&&(e.focus(),e.select())})):null==a||a()},[n]),R.createElement(il,oE({ref:l},s),R.createElement(l$,{isGhost:i,isEditing:n,onPointerDown:v},R.createElement(lK,{style:{font:p,color:u.stroke,textAlign:sm(c.textAlign)},"data-color":e.style.color},t&&R.createElement("div",{className:"tl-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${2*this.bindingDistance}px)`,height:`calc(100% + ${2*this.bindingDistance}px)`,backgroundColor:"var(--tl-selectFill)"}}),n?R.createElement(lq,{ref:h,style:{font:p,color:u.stroke},name:"text",tabIndex:-1,autoComplete:"false",autoCapitalize:"false",autoCorrect:"false",autoSave:"false",autoFocus:!0,placeholder:"",spellCheck:"true",wrap:"off",dir:"auto",datatype:"wysiwyg",defaultValue:d,color:u.stroke,onFocus:y,onChange:f,onKeyDown:b,onBlur:x,onPointerDown:v,onContextMenu:sq,onCopy:sq,onPaste:sq,onCut:sq}):d,"​")))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{width:t,height:i}=this.getBounds(e);return R.createElement("rect",{x:0,y:0,width:t,height:i})})),oM(this,"getBounds",e=>{let t=tI.getFromCache(this.boundsCache,e,()=>{var t;if(!lD)return{minX:0,minY:0,maxX:10,maxY:10,width:10,height:10};lD.parentNode||document.body.appendChild(lD),lD.style.font=sW(e.style),lD.textContent=null!=(t=this.texts.get(e.id))?t:e.text;let i=lD.offsetWidth||1,n=lD.offsetHeight||1;return{minX:0,maxX:i,minY:0,maxY:n,width:i,height:n}});return tI.translateBounds(t,e.point)}),oM(this,"shouldRender",(e,t)=>t.text!==e.text||t.style.scale!==e.style.scale||t.style!==e.style),oM(this,"transform",(e,t,{initialShape:i,scaleX:n,scaleY:a})=>{let{rotation:r=0,style:{scale:o=1}}=i,s=o*Math.abs(Math.min(n,a));return{point:[t.minX,t.minY],rotation:n<0&&a>=0||a<0&&n>=0?-(r||0):r,style:o_(oE({},i.style),{scale:s})}}),oM(this,"transformSingle",(e,t,{initialShape:i,scaleX:n,scaleY:a})=>{let{style:{scale:r=1}}=i;return{point:z.toFixed([t.minX,t.minY]),style:o_(oE({},i.style),{scale:r*Math.max(Math.abs(a),Math.abs(n))})}}),oM(this,"onDoubleClickBoundsHandle",e=>{let t=this.getCenter(e),i=this.getCenter(o_(oE({},e),{style:o_(oE({},e.style),{scale:1})}));return{style:o_(oE({},e.style),{scale:1}),point:z.toFixed(z.add(e.point,z.sub(t,i)))}}),oM(this,"getSvgElement",(e,t)=>{var i,n;let a=this.getBounds(e),r=sG(e.style,t),o=sz(e.style.size,e.style.font)*(null!=(i=e.style.scale)?i:1),s=sF(e.style.font).slice(1,-1),l=null!=(n=e.style.textAlign)?n:"start",d=sC(e.text,o,s,l,a.width,!1);return d.setAttribute("fill",r.stroke),d.setAttribute("data-color",e.style.color),d})}};"u">typeof window&&(null==(_=document.getElementById("__textMeasure"))||_.remove(),(E=document.createElement("pre")).id="__textMeasure",Object.assign(E.style,{whiteSpace:"pre",width:"auto",border:"1px solid transparent",padding:"4px",margin:"0px",letterSpacing:si,opacity:"0",position:"absolute",top:"-500px",left:"0px",zIndex:"9999",pointerEvents:"none",userSelect:"none",alignmentBaseline:"mathematical",dominantBaseline:"mathematical"}),E.tabIndex=-1,document.body.appendChild(E),lD=E);var l$=o6("div",{width:"100%",height:"100%",variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isEditing:{false:{pointerEvents:"all",userSelect:"all"},true:{pointerEvents:"none",userSelect:"none"}}}}),lZ={whiteSpace:"pre-wrap",overflowWrap:"break-word"},lK=o6("div",oE({position:"absolute",width:"100%",height:"100%",padding:"4px",zIndex:1,minHeight:1,minWidth:1,lineHeight:1,letterSpacing:si,outline:0,fontWeight:"500",backfaceVisibility:"hidden",userSelect:"none",pointerEvents:"none",WebkitUserSelect:"none",WebkitTouchCallout:"none",isEditing:{false:{},true:{pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"}}},lZ)),lq=o6("textarea",o_(oE({position:"absolute",top:0,left:0,zIndex:1,width:"100%",height:"100%",border:"none",padding:"4px",resize:"none",textAlign:"inherit",minHeight:"inherit",minWidth:"inherit",lineHeight:"inherit",letterSpacing:"inherit",outline:0,fontWeight:"inherit",overflow:"hidden",backfaceVisibility:"hidden",display:"inline-block",pointerEvents:"all",background:"$boundsBg",userSelect:"text",WebkitUserSelect:"text"},lZ),{"&:focus":{outline:"none",border:"none"}})),lY=R.memo(function({id:e,size:t,style:i,isSelected:n,isDarkMode:a}){let{stroke:r,strokeWidth:o,fill:s}=sG(i,a),l=1+1.618*o,d=sX(t),c=tI.pointsToLineSegments(d,!0).map(([t,n],a)=>{let{strokeDasharray:s,strokeDashoffset:d}=tI.getPerfectDashProps(z.dist(t,n),1.618*o,i.dash);return R.createElement("line",{key:e+"_"+a,x1:t[0],y1:t[1],x2:n[0],y2:n[1],stroke:r,strokeWidth:l,strokeLinecap:"round",strokeDasharray:s,strokeDashoffset:d})}),u=d.join();return R.createElement(R.Fragment,null,R.createElement("polygon",{className:i.isFilled||n?"tl-fill-hitarea":"tl-stroke-hitarea",points:u}),i.isFilled&&R.createElement("polygon",{fill:s,points:u,pointerEvents:"none"}),R.createElement("g",{pointerEvents:"stroke"},c))}),lX=R.memo(function({id:e,size:t,style:i,isSelected:n,isDarkMode:a}){let{stroke:r,strokeWidth:o,fill:s}=sG(i,a),l=function(e,t,i){let{points:n,options:a}=sJ(e,t,i),r=rq(n,a);return tI.getSvgPathFromStroke(r)}(e,t,i),d=function(e,t,i){let{points:n,options:a}=sJ(e,t,i);return tI.getSvgPathFromStrokePoints(rK(n,a))}(e,t,i);return R.createElement(R.Fragment,null,R.createElement("path",{className:i.isFilled||n?"tl-fill-hitarea":"tl-stroke-hitarea",d:d}),i.isFilled&&R.createElement("path",{d:d,fill:s,pointerEvents:"none"}),R.createElement("path",{d:l,fill:r,stroke:r,strokeWidth:o,pointerEvents:"none"}))});function lQ({size:e}){let t=sX(e).join();return R.createElement("polygon",{className:"tl-binding-indicator",points:t,strokeWidth:32})}var lJ=class extends s8{constructor(){super(...arguments),oM(this,"type","triangle"),oM(this,"canBind",!0),oM(this,"canClone",!0),oM(this,"canEdit",!0),oM(this,"getShape",e=>tI.deepMerge({id:"id",type:"triangle",name:"Triangle",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:s$,label:"",labelPoint:[.5,.5]},e)),oM(this,"Component",s8.Component(({shape:e,bounds:t,isBinding:i,isEditing:n,isSelected:a,isGhost:r,meta:o,events:s,onShapeChange:l,onShapeBlur:d},c)=>{let{id:u,label:p="",size:h,style:m,labelPoint:g=sn}=e,f=sW(m),b=sG(m,o.isDarkMode),x="draw"===m.dash?lX:lY,y=R.useCallback(e=>null==l?void 0:l({id:u,label:e}),[l]),v=R.useMemo(()=>this.getLabelOffsetY(e),[h]);return R.createElement(l0,oE({ref:c},s),R.createElement(s1,{font:f,text:p,color:b.stroke,offsetX:(g[0]-.5)*t.width,offsetY:v+(g[1]-.5)*t.height,isEditing:n,onChange:y,onBlur:d,shape:e}),R.createElement(tW,{id:e.id+"_svg",opacity:r?.3:1,shapeStyle:m},i&&R.createElement(lQ,{size:h}),R.createElement(x,{id:u,style:m,size:h,isSelected:a,isDarkMode:o.isDarkMode})))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{size:t}=e;return R.createElement("polygon",{points:sX(t).join()})})),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.label!==e.label),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"getExpandedBounds",e=>tI.getBoundsFromPoints(sX(e.size,this.bindingDistance).map(t=>z.add(t,e.point)))),oM(this,"hitTestLineSegment",(e,t,i)=>tr(t,i,this.getPoints(e)).didIntersect),oM(this,"hitTestBounds",(e,t)=>tI.boundsContained(this.getBounds(e),t)||td(this.getPoints(e),t).length>0),oM(this,"getBindingPoint",(e,t,i,n,a,r)=>{let o=this.getExpandedBounds(e);if(!tI.pointInBounds(i,o))return;let s=sX(e.size).map(t=>z.add(t,e.point)),l=sX(e.size,this.bindingDistance).map(t=>z.add(t,e.point)),d=tI.pointsToLineSegments(s,!0).map(([e,t])=>z.distanceToLineSegment(e,t,i)).sort((e,t)=>e-t)[0];if(!(tI.pointInPolygon(i,l)||de7(n,a,e[0],e[1])).filter(e=>e.didIntersect).flatMap(e=>e.points);if(!c.length)return;let u=z.add(sQ(e.size),e.point),p=c.sort((e,t)=>z.dist(t,n)-z.dist(e,n))[0],h=z.med(i,p),m,g;r?(m=8>z.dist(i,u)?u:i,g=0):(m=8>z.distanceToLineSegment(i,h,u)?u:h,g=tI.pointInPolygon(i,s)?this.bindingDistance:Math.max(this.bindingDistance,d));let f=z.divV(z.sub(m,[o.minX,o.minY]),[o.width,o.height]);return{point:z.clampV(f,0,1),distance:g}}),oM(this,"transform",s6),oM(this,"transformSingle",s9),oM(this,"getSvgElement",e=>{var t,i;let n=null==(t=document.getElementById(e.id+"_svg"))?void 0:t.cloneNode(!0);if(n){if("label"in e&&void 0!==e.label){let t=document.createElementNS("http://www.w3.org/2000/svg","g"),a=this.getBounds(e),r=sW(e.style),o=void 0!==e.style.scale?e.style.scale:1,s=sz(e.style.size,e.style.font)*(null!=(i=e.style.scale)?i:1),l=sF(e.style.font).slice(1,-1),d=sy(e.label,r),c=sC(e.label,s,l,"middle",d[0],!1);return c.setAttribute("fill",sG(e.style).stroke),c.setAttribute("transform-origin","top left"),c.setAttribute("transform",`translate(${(a.width-d[0]*o)/2}, ${(a.height-d[1]*o)/2+this.getLabelOffsetY(e)})`),t.appendChild(n),t.appendChild(c),t}return n}}),oM(this,"getLabelOffsetY",e=>{let t=z.div(e.size,2);return(sQ(e.size)[1]-t[1])*.72})}getPoints(e){let{rotation:t=0,point:[i,n],size:[a,r]}=e;return[[i+a/2,n],[i,n+r],[i+a,n+r]].map(i=>z.rotWith(i,this.getCenter(e),t))}},l0=o6("div",{width:"100%",height:"100%"}),l1=class extends s8{constructor(){super(...arguments),oM(this,"type","video"),oM(this,"canBind",!0),oM(this,"canEdit",!0),oM(this,"canClone",!0),oM(this,"isAspectRatioLocked",!0),oM(this,"showCloneHandles",!1),oM(this,"isStateful",!0),oM(this,"getShape",e=>tI.deepMerge({id:"video",type:"video",name:"Video",parentId:"page",childIndex:1,point:[0,0],size:[1,1],rotation:0,style:s$,assetId:"assetId",isPlaying:!0,currentTime:0},e)),oM(this,"Component",s8.Component(({shape:e,asset:t={src:""},isBinding:i,isEditing:n,isGhost:a,meta:r,events:o,onShapeChange:s},l)=>{let d=R.useRef(null),c=R.useRef(null),{currentTime:u=0,size:p,isPlaying:h,style:m}=e;R.useLayoutEffect(()=>{let e=c.current;if(!e)return;let[t,i]=p;e.style.width=`${t}px`,e.style.height=`${i}px`},[p]),R.useLayoutEffect(()=>{let e=d.current;e&&(h?e.play():e.pause())},[h]),R.useLayoutEffect(()=>{let e=d.current;e&&u!==e.currentTime&&(e.currentTime=u)},[u]);let g=R.useCallback(()=>{null==s||s({id:e.id,isPlaying:!0})},[]),f=R.useCallback(()=>{null==s||s({id:e.id,isPlaying:!1})},[]),b=R.useCallback(()=>{let t=d.current;t&&n&&null!=s&&s({id:e.id,currentTime:t.currentTime})},[n]);return R.createElement(il,oE({ref:l},o),i&&R.createElement("div",{className:"tl-binding-indicator",style:{position:"absolute",top:-this.bindingDistance,left:-this.bindingDistance,width:`calc(100% + ${2*this.bindingDistance}px)`,height:`calc(100% + ${2*this.bindingDistance}px)`,backgroundColor:"var(--tl-selectFill)"}}),R.createElement(l2,{ref:c,isDarkMode:r.isDarkMode,isGhost:a,isFilled:m.isFilled},R.createElement(l3,{ref:d,id:e.id+"_video",muted:!0,loop:!0,playsInline:!0,disableRemotePlayback:!0,disablePictureInPicture:!0,controls:n,autoPlay:h,onPlay:g,onPause:f,onTimeUpdate:b},R.createElement("source",{src:t.src}))))})),oM(this,"Indicator",s8.Indicator(({shape:e})=>{let{size:[t,i]}=e;return R.createElement("rect",{x:0,y:0,rx:2,ry:2,width:Math.max(1,t),height:Math.max(1,i)})})),oM(this,"getBounds",e=>sp(e,this.boundsCache)),oM(this,"shouldRender",(e,t)=>t.size!==e.size||t.style!==e.style||t.isPlaying!==e.isPlaying),oM(this,"getSvgElement",e=>{let t=this.getBounds(e),i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("width",`${t.width}`),i.setAttribute("height",`${t.height}`),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),i}),oM(this,"transform",s6),oM(this,"transformSingle",s9)}},l2=rP("div",{pointerEvents:"all",position:"relative",fontFamily:"sans-serif",fontSize:"2em",height:"100%",width:"100%",borderRadius:"3px",perspective:"800px",overflow:"hidden",p:{userSelect:"none"},img:{userSelect:"none"},variants:{isGhost:{false:{opacity:1},true:{transition:"opacity .2s",opacity:.3}},isFilled:{true:{},false:{}},isDarkMode:{true:{},false:{}}},compoundVariants:[{isFilled:!0,isDarkMode:!0,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.3), 1px 1px 4px rgba(0,0,0,.3), 1px 1px 2px rgba(0,0,0,.3)"}},{isFilled:!0,isDarkMode:!1,css:{boxShadow:"2px 3px 12px -2px rgba(0,0,0,.2), 1px 1px 4px rgba(0,0,0,.16), 1px 1px 2px rgba(0,0,0,.16)"}}]}),l3=rP("video",{position:"absolute",top:0,left:0,width:"100%",height:"100%",maxWidth:"100%",minWidth:"100%",pointerEvents:"none",objectFit:"cover",userSelect:"none",borderRadius:2}),l5=new lR,l4=new lJ,l6=new lC,l9=new lf,l8=new lc,l7=new lG,de=new lS,dt=new lB,di={rectangle:l5,triangle:l4,ellipse:l6,draw:l9,arrow:l8,text:l7,group:de,sticky:dt,image:new lA,video:new l1},dn=e=>"string"==typeof e?di[e]:di[e.type],da="tldraw_clipboard",dr=class{constructor(e,t,i,n){oM(this,"_idbId"),oM(this,"initialState"),oM(this,"store"),oM(this,"pointer",-1),oM(this,"_state"),oM(this,"_status","loading"),oM(this,"stack",[]),oM(this,"_snapshot"),oM(this,"useStore"),oM(this,"ready"),oM(this,"isPaused",!1),oM(this,"persist",(e,t)=>{if("ready"===this._status&&(this.onPersist&&this.onPersist(this._state,e,t),this._idbId))return rJ(this._idbId,this._state).catch(e=>console.error(e))}),oM(this,"applyPatch",(e,t)=>{let i=this._state,n=tI.deepMerge(this._state,e),a=this.cleanup(n,i,e,t);return this.onStateWillChange&&this.onStateWillChange(a,t),this._state=a,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,t),this}),oM(this,"migrate",e=>e),oM(this,"cleanup",(e,t,i,n)=>e),oM(this,"onStateWillChange"),oM(this,"onStateDidChange"),oM(this,"patchState",(e,t)=>(this.applyPatch(e,t),this.onPatch&&this.onPatch(this._state,e,t),this)),oM(this,"replaceState",(e,t)=>{let i=this.cleanup(e,this._state,e,t);return this.onStateWillChange&&this.onStateWillChange(i,"replace"),this._state=i,this.store.setState(this._state,!0),this.onStateDidChange&&this.onStateDidChange(this._state,"replace"),this}),oM(this,"setState",(e,t=e.id)=>(this.pointer(this.onStateWillChange&&this.onStateWillChange(this.initialState,"reset"),this._state=this.initialState,this.store.setState(this._state,!0),this.resetHistory(),this.persist({},"reset"),this.onStateDidChange&&this.onStateDidChange(this._state,"reset"),this.onReset&&this.onReset(this._state),this)),oM(this,"replaceHistory",(e,t=e.length-1)=>(this.stack=e,this.pointer=t,this.onReplace&&this.onReplace(this._state),this)),oM(this,"resetHistory",()=>(this.stack=[],this.pointer=-1,this.onResetHistory&&this.onResetHistory(this._state),this)),oM(this,"undo",()=>{if(!this.isPaused){if(!this.canUndo)return this;let e=this.stack[this.pointer];this.pointer--,this.applyPatch(e.before,"undo"),this.persist(e.before,"undo")}return this.onUndo&&this.onUndo(this._state),this}),oM(this,"redo",()=>{if(!this.isPaused){if(!this.canRedo)return this;this.pointer++;let e=this.stack[this.pointer];this.applyPatch(e.after,"redo"),this.persist(e.after,"undo")}return this.onRedo&&this.onRedo(this._state),this}),oM(this,"setSnapshot",()=>(this._snapshot=oE({},this._state),this)),oM(this,"forceUpdate",()=>{this.store.setState(this._state,!0)}),this._idbId=t,this._state=sY(e),this._snapshot=sY(e),this.initialState=sY(e),this.store=r1(()=>this._state),this.useStore=(e=>e?r3(e):r3)(this.store),this.ready=new Promise(a=>{let r="none";this._idbId?(r="restored",rQ(this._idbId).then(o=>oT(this,null,function*(){if(o){let a=o;if(i){let s=yield rQ(t+"_version");s&&sconsole.error(e))):(this._status="ready",a(r))}).then(e=>(this.onReady&&this.onReady(e),e))}pause(){this.isPaused=!0}resume(){this.isPaused=!1}get canUndo(){return this.pointer>-1}get canRedo(){return this.pointer{a[e.id]=void 0,r[e.id]=e});let o={},s={};return i.forEach(e=>{o[e.id]=void 0,s[e.id]=e}),{id:"create",before:{document:{pages:{[n]:{shapes:a,bindings:o}},pageStates:{[n]:{selectedIds:[...e.selectedIds]}}}},after:{document:{pages:{[n]:{shapes:r,bindings:s}},pageStates:{[n]:{selectedIds:t.map(e=>e.id)}}}}}}function dl(e,t,i=e.currentPageId){var n;let a,r,o,s,l,d,c,{pageState:u,selectedIds:p,document:{assets:h}}=e,{before:m,after:g,assetsToRemove:f}=(n=e.state,a={shapes:{},bindings:{}},r={shapes:{},bindings:{}},o=[],s=new Set,l=new Set,t.filter(e=>!s0.getShape(n,e,i).isLocked).forEach(e=>{s.add(e);let t=s0.getShape(n,e,i);a.shapes[e]=t,r.shapes[e]=void 0,void 0!==t.children&&t.children.forEach(e=>{s.add(e);let t=s0.getShape(n,e,i);a.shapes[e]=t,r.shapes[e]=void 0}),t.parentId!==i&&o.push(s0.getShape(n,t.parentId,i)),t.assetId&&l.add(t.assetId)}),o.forEach(e=>{var o;t.includes(e.id)||(s.add(e.id),a.shapes[e.id]={children:e.children},r.shapes[e.id]={children:e.children.filter(e=>!t.includes(e))},(null==(o=r.shapes[e.id])?void 0:o.children.length)===0&&(r.shapes[e.id]=void 0,a.shapes[e.id]=s0.getShape(n,e.id,i)))}),Object.values((d=s0.getPage(n,i)).bindings).filter(e=>s.has(e.fromId)||s.has(e.toId)).forEach(e=>{for(let t of[e.toId,e.fromId])if(void 0===r.shapes[t]){a.bindings[e.id]=e,r.bindings[e.id]=void 0;let i=d.shapes[t];i&&i.handles&&Object.values(i.handles).filter(t=>t.bindingId===e.id).forEach(i=>{var n,o,l,d,c,u;a.shapes[t]=o_(oE({},a.shapes[t]),{handles:o_(oE({},null==(n=a.shapes[t])?void 0:n.handles),{[i.id]:o_(oE({},null==(l=null==(o=a.shapes[t])?void 0:o.handles)?void 0:l[i.id]),{bindingId:e.id})})}),s.has(t)||(r.shapes[t]=o_(oE({},r.shapes[t]),{handles:o_(oE({},null==(d=r.shapes[t])?void 0:d.handles),{[i.id]:o_(oE({},null==(u=null==(c=r.shapes[t])?void 0:c.handles)?void 0:u[i.id]),{bindingId:void 0})})}))})}}),Object.values(n.document.pages).flatMap(e=>Object.values(e.shapes)).forEach(e=>{"assetId"in e&&e.assetId&&!s.has(e.id)&&l.delete(e.assetId)}),{before:a,after:r,assetsToRemove:Array.from(l)}),b=(c=oE({},h),f.forEach(e=>c[e]=void 0),c);return{id:"delete",before:{document:{assets:h,pages:{[i]:m},pageStates:{[i]:{selectedIds:[...e.selectedIds]}}}},after:{document:{assets:b,pages:{[i]:g},pageStates:{[i]:{selectedIds:p.filter(e=>!t.includes(e)),hoveredId:u.hoveredId&&t.includes(u.hoveredId)?void 0:u.hoveredId}}}}}}function dd(e,t,i){let{selectedIds:n,currentPageId:a,page:{shapes:r}}=e,o=t.map(e=>s0.getBounds(r[e])),s=1===t.length&&"group"===r[t[0]].type,l=tI.getCommonBounds(o),{before:d,after:c}=s0.mutateShapes(e.state,t,e=>{let t=s0.getBounds(e),n=e.parentId!==a;switch(i){case"horizontal":{if(n&&!s){let i=s0.getBounds(r[e.parentId]),n=tI.getRelativeTransformedBoundingBox(l,l,i,!0,!1).minX-i.minX;return s0.getShapeUtil(e).transform(e,o_(oE({},t),{minX:t.minX+n,maxX:t.maxX+n}),{type:tk.TopLeft,scaleX:1,scaleY:1,initialShape:e,transformOrigin:[.5,.5]})}let i=tI.getRelativeTransformedBoundingBox(l,l,t,!0,!1);return s0.getShapeUtil(e).transform(e,i,{type:tk.TopLeft,scaleX:-1,scaleY:1,initialShape:e,transformOrigin:[.5,.5]})}case"vertical":{if(n&&!s){let i=s0.getBounds(r[e.parentId]),n=tI.getRelativeTransformedBoundingBox(l,l,i,!1,!0).minY-i.minY;return s0.getShapeUtil(e).transform(e,o_(oE({},t),{minY:t.minY+n,maxY:t.maxY+n}),{type:tk.TopLeft,scaleX:1,scaleY:1,initialShape:e,transformOrigin:[.5,.5]})}let i=tI.getRelativeTransformedBoundingBox(l,l,t,!1,!0);return s0.getShapeUtil(e).transform(e,i,{type:tk.TopLeft,scaleX:1,scaleY:-1,initialShape:e,transformOrigin:[.5,.5]})}}},a,!0);return{id:"flip",before:{document:{pages:{[a]:{shapes:d}},pageStates:{[a]:{selectedIds:n}}}},after:{document:{pages:{[a]:{shapes:c}},pageStates:{[a]:{selectedIds:t}}}}}}function dc(e,t,i){let{currentPageId:n,page:a}=e,r=new Set(t.map(t=>e.getShape(t).parentId)),o={before:{},after:{}},s,l,d;return Array.from(r.values()).forEach(r=>{let c=[];if(r===a.id)c=Object.values(a.shapes).sort((e,t)=>e.childIndex-t.childIndex);else{let t=e.getShape(r);if(!t.children)throw Error("No children in parent!");c=t.children.map(t=>e.getShape(t)).sort((e,t)=>e.childIndex-t.childIndex)}let u=c.map(e=>e.id),p=t.filter(e=>u.includes(e)).map(e=>u.indexOf(e)).sort((e,t)=>e-t);if(p.length!==u.length)switch(i){case"toBack":for(let e=0;ec[e].id).reverse(),(e,t)=>({childIndex:l-(t+1)*d}),n);break;case"toFront":for(let e=u.length-1;e>=0;e--)if(!p.includes(e)){s=e;break}l=c[s].childIndex,d=1,o=s0.mutateShapes(e.state,p.map(e=>c[e].id),(e,t)=>({childIndex:l+(t+1)}),n);break;case"backward":{let t={};for(let e=u.length-1;e>=0;e--)if(p.includes(e)){for(let i=e;i>=0;i--)if(!p.includes(i)){let n=c[i].childIndex,a,r;0===i?(a=n/2,r=n/2/(e-i+1)):(r=(n-(a=c[i-1].childIndex))/(e-i+1),a+=r);for(let n=0;n0&&(o=s0.mutateShapes(e.state,p.map(e=>c[e].id),e=>({childIndex:t[e.id]}),n));break}case"forward":{let t={};for(let e=0;e0&&(o=s0.mutateShapes(e.state,p.map(e=>c[e].id),e=>({childIndex:t[e.id]}),n))}}}),{id:"move",before:{document:{pages:{[n]:{shapes:o.before}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:o.after}},pageStates:{[n]:{selectedIds:t}}}}}}function du(e,t,i){let{currentPageId:n}=e,{before:a,after:r}=s0.mutateShapes(e.state,t,t=>{var i,n;return null==(n=(i=e.getShapeUtil(t)).onDoubleClickBoundsHandle)?void 0:n.call(i,t)},i);return{id:"reset_bounds",before:{document:{pages:{[n]:{shapes:a}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:r}},pageStates:{[n]:{selectedIds:t}}}}}}var dp=2*Math.PI;function dh(e,t,i){let{currentPageId:n}=e,a=t.map(t=>e.getShape(t)).filter(e=>"isLocked"===i||!e.isLocked),r=a.every(e=>e[i]),o={},s={};return a.forEach(e=>{o[e.id]={[i]:e[i]},s[e.id]={[i]:!r}}),{id:"toggle",before:{document:{pages:{[n]:{shapes:o}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:s}},pageStates:{[n]:{selectedIds:t}}}}}}function dm(e,t,i){let n=t.map(e=>e.id),a=s0.mutateShapes(e.state,n.filter(t=>!e.getShape(t,i).isLocked),(e,i)=>t[i],i);return{id:"update",before:{document:{pages:{[i]:{shapes:a.before}}}},after:{document:{pages:{[i]:{shapes:a.after}}}}}}var dg={};function df(e,t){let{document:i,settings:n}=e,{version:a=0}=i;"assets"in i||(i.assets={});let r=new Set;return Object.values(i.pages).forEach(e=>Object.values(e.shapes).forEach(t=>{let{parentId:i,children:n,assetId:a}=t;a&&r.add(a),i===e.id||e.shapes[i]||(console.warn("Encountered a shape with a missing parent!"),t.parentId=e.id),"group"===t.type&&n&&n.forEach(i=>{e.shapes[i]||(console.warn("Encountered a parent with a missing child!",t.id,i),null==n||n.splice(n.indexOf(i),1))})})),Object.keys(i.assets).forEach(e=>{r.has(e)||delete i.assets[e]}),a===t||(a<14&&Object.values(i.pages).forEach(e=>{Object.values(e.shapes).filter(e=>"text"===e.type).forEach(e=>"script"===e.style.font)}),a<=13&&Object.values(i.pages).forEach(e=>{Object.values(e.bindings).forEach(e=>{Object.assign(e,e.meta)}),Object.values(e.shapes).forEach(e=>{Object.entries(e.style).forEach(([t,i])=>{"string"==typeof i&&(e.style[t]=i.toLowerCase())}),"arrow"===e.type&&e.decorations&&Object.entries(e.decorations).forEach(([t,i])=>{"Arrow"===i&&(e.decorations=o_(oE({},e.decorations),{[t]:"arrow"}))})})}),a<=13.1&&(i.name="New Document"),a<15&&(i.assets={}),Object.values(i.pages).forEach(e=>{Object.values(e.shapes).forEach(e=>{a<15.2&&("image"===e.type||"video"===e.type)&&(e.style.isFilled=!0),a<15.3&&("rectangle"===e.type||"triangle"===e.type||"ellipse"===e.type||"arrow"===e.type)&&(e.label=e.text||"",e.labelPoint=[.5,.5])})}),a<15.4&&(n.dockPosition="bottom"),a<15.5&&(n.exportBackground="transparent"),Object.values(i.pageStates).forEach(e=>{e.selectedIds=e.selectedIds.filter(t=>void 0!==i.pages[e.id].shapes[t]),e.bindingId=void 0,e.editingId=void 0,e.hoveredId=void 0,e.pointedId=void 0}),i.version=t),e}oI(dg,{fileToBase64:()=>dS,fileToText:()=>dk,getImageSizeFromSrc:()=>dA,getVideoSizeFromSrc:()=>dE,loadFileHandle:()=>dx,migrate:()=>df,openAssetsFromFileSystem:()=>dw,openFromFileSystem:()=>dC,saveFileHandle:()=>dy,saveToFileSystem:()=>dv});var db={mode:"readwrite"};function dx(){return oT(this,null,function*(){if(!("u"{let i=new FileReader;i.onloadend=()=>{i.readyState===FileReader.DONE&&e(i.result)},i.readAsText(t,"utf8")}))),n=null!=(e=t.handle)?e:null;return yield dy(n),{fileHandle:n,document:i.document}})}function dw(){return oT(this,null,function*(){return r6({description:"Image or Video",extensions:[...sd,...sc],multiple:!0})})}function dS(e){return new Promise((t,i)=>{if(e){let n=new FileReader;n.readAsDataURL(e),n.onload=()=>t(n.result),n.onerror=e=>i(e),n.onabort=e=>i(e)}})}function dk(e){return new Promise((t,i)=>{if(e){let n=new FileReader;n.readAsText(e),n.onload=()=>t(n.result),n.onerror=e=>i(e),n.onabort=e=>i(e)}})}function dA(e){return new Promise((t,i)=>{let n=new Image;n.onload=()=>t([n.width,n.height]),n.onerror=()=>i(Error("Could not get image size")),n.src=e})}function dE(e){return new Promise((t,i)=>{let n=document.createElement("video");n.onloadedmetadata=()=>t([n.videoWidth,n.videoHeight]),n.onerror=()=>i(Error("Could not get video size")),n.src=e})}((e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let a of oC(t))!oS.call(e,a)&&(i||"default"!==a)&&ob(e,a,{get:()=>t[a],enumerable:!(n=oy(t,a))||n.enumerable})})(dg,of);var d_=class{constructor(e){this.app=e}},dI=class extends d_{constructor(e,t,i,n=!1){var a,r,o;super(e),oM(this,"type","arrow"),oM(this,"performanceMode"),oM(this,"status","translatingHandle"),oM(this,"newStartBindingId",tI.uniqueId()),oM(this,"draggedBindingId",tI.uniqueId()),oM(this,"didBind",!1),oM(this,"initialShape"),oM(this,"handleId"),oM(this,"bindableShapeIds"),oM(this,"initialBinding"),oM(this,"startBindingShapeId"),oM(this,"isCreate"),oM(this,"start",()=>{}),oM(this,"update",()=>{var e,t,i;let{initialShape:n}=this,{currentPoint:a,shiftKey:r,altKey:o,metaKey:s,currentGrid:l,settings:{showGrid:d}}=this.app,c=this.app.getShape(n.id);if(c.isLocked)return;let{handles:u}=n,p=this.handleId;if(!u[p].canBind)return;let h=z.sub(a,z.add(u[p].point,n.point));if(r){let e=o?z.med(u.start.point,u.end.point):u["start"===p?"end":"start"].point,t=u[p].point,i=z.add(t,h),n=z.angle(e,i),a=z.rotWith(i,e,tI.snapAngleToSegments(n,24)-n);h=z.add(h,z.sub(a,i))}let m=z.add(u[p].point,h),g={[p]:o_(oE({},u[p]),{point:d?z.snap(m,l):z.toFixed(m),bindingId:void 0})},f=di.arrow,b=null==(e=f.onHandleChange)?void 0:e.call(f,n,g);if(!b)return;let x={shape:tI.deepMerge(c,b),bindings:{}},y,v=x.shape.handles[this.handleId],C=x.shape.handles["start"===this.handleId?"end":"start"];if(this.startBindingShapeId){let e,t=this.app.page.shapes[this.startBindingShapeId],i=s0.getShapeUtil(t),r=i.getCenter(t),o=x.shape.handles.start,l=x.shape.handles.end,d=z.add(o.point,x.shape.point);z.isEqual(d,r)&&d[1]++;let u=i.hitTestPoint(t,a),p=z.uni(z.sub(d,r)),h=void 0!==this.app.getBinding(this.newStartBindingId);s||i.hitTestPoint(t,z.add(x.shape.point,l.point))||(e=this.findBindingPoint(c,t,"start",this.newStartBindingId,r,r,p,u)),e&&!h?(this.didBind=!0,x.bindings[this.newStartBindingId]=e,x.shape=tI.deepMerge(x.shape,{handles:{start:{bindingId:e.id}}})):!e&&h&&(this.didBind=!1,x.bindings[this.newStartBindingId]=void 0,x.shape=tI.deepMerge(n,{handles:{start:{bindingId:void 0}}}))}if(!s){let e=z.add(C.point,x.shape.point),t=z.add(v.point,x.shape.point),i=z.uni(z.sub(t,e)),n=z.add(x.shape.point,x.shape.handles.start.point),a=z.add(x.shape.point,x.shape.handles.end.point);for(let r of this.bindableShapeIds.map(e=>this.app.page.shapes[e]).sort((e,t)=>t.childIndex-e.childIndex).filter(e=>{if(e.isLocked)return!1;let t=s0.getShapeUtil(e);return![n,a].every(i=>t.hitTestPoint(e,i))}))if(y=this.findBindingPoint(c,r,this.handleId,this.draggedBindingId,t,e,i,o))break}if(y)this.didBind=!0,x.bindings[this.draggedBindingId]=y,x.shape=tI.deepMerge(x.shape,{handles:{[this.handleId]:{bindingId:this.draggedBindingId}}});else{this.didBind=this.didBind||!1;let e=c.handles[this.handleId].bindingId;void 0!==e&&(x.bindings[e]=void 0,x.shape=tI.deepMerge(x.shape,{handles:{[this.handleId]:{bindingId:void 0}}}))}let w=null==(i=(t=s0.getShapeUtil(x.shape)).onHandleChange)?void 0:i.call(t,x.shape,x.shape.handles);return{document:{pages:{[this.app.currentPageId]:{shapes:{[c.id]:oE(oE({},x.shape),null!=w?w:{})},bindings:x.bindings}},pageStates:{[this.app.currentPageId]:{bindingId:x.shape.handles[p].bindingId}}}}}),oM(this,"cancel",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:i,draggedBindingId:n}=this,a=s0.onSessionComplete(this.app.page.shapes[e.id]),r=this.isCreate||4>z.dist(a.handles.start.point,a.handles.end.point),o={};return o[n]=void 0,t&&(o[t.id]=r?void 0:t),i&&(o[i]=void 0),{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:r?void 0:e},bindings:o}},pageStates:{[this.app.currentPageId]:{selectedIds:r?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}}),oM(this,"complete",()=>{let{initialShape:e,initialBinding:t,newStartBindingId:i,startBindingShapeId:n,handleId:a}=this,r=s0.onSessionComplete(this.app.page.shapes[e.id]),o=r.handles[a].bindingId,s=z.dist(r.handles.start.point,r.handles.end.point);if(!(o||t)&&s<4)return this.cancel();let l={},d={};return t&&(l[t.id]=this.isCreate?void 0:t,d[t.id]=void 0),o&&(l[o]=void 0,d[o]=this.app.page.bindings[o]),n&&(l[i]=void 0,d[i]=this.app.page.bindings[i]),{id:"arrow",before:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:this.isCreate?void 0:e},bindings:l}},pageStates:{[this.app.currentPageId]:{selectedIds:this.isCreate?[]:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}},after:{document:{pages:{[this.app.currentPageId]:{shapes:{[e.id]:r},bindings:d}},pageStates:{[this.app.currentPageId]:{selectedIds:[e.id],bindingId:void 0,hoveredId:void 0,editingId:void 0}}}}}}),oM(this,"findBindingPoint",(e,t,i,n,a,r,o,s)=>{let l=s0.getShapeUtil(t.type).getBindingPoint(t,e,a,r,o,s);if(l)return{id:n,type:"arrow",fromId:e.id,toId:t.id,handleId:i,point:z.toFixed(l.point),distance:l.distance}}),this.isCreate=n;let{currentPageId:s}=e.state.appState,l=e.state.document.pages[s];this.handleId=i,this.initialShape=sY(l.shapes[t]),this.bindableShapeIds=s0.getBindableShapeIds(e.state).filter(e=>e!==this.initialShape.id&&e!==this.initialShape.parentId);let d=null==(a=this.initialShape.handles["start"===i?"end":"start"])?void 0:a.bindingId;if(d){let e=null==(r=l.bindings[d])?void 0:r.toId;e&&(this.bindableShapeIds=this.bindableShapeIds.filter(t=>t!==e))}let{originPoint:c}=this.app;if(this.isCreate)this.startBindingShapeId=null==(o=this.bindableShapeIds.map(e=>l.shapes[e]).filter(e=>!e.isLocked&&tI.pointInBounds(c,s0.getShapeUtil(e).getBounds(e))).sort((e,t)=>t.childIndex-e.childIndex)[0])?void 0:o.id,this.startBindingShapeId&&this.bindableShapeIds.splice(this.bindableShapeIds.indexOf(this.startBindingShapeId),1);else{let e=this.initialShape.handles[this.handleId].bindingId;e?this.initialBinding=l.bindings[e]:this.initialShape.handles[this.handleId].bindingId=void 0}}},dM=class extends d_{constructor(e){super(e),oM(this,"type","brush"),oM(this,"performanceMode"),oM(this,"status","brushing"),oM(this,"initialSelectedIds"),oM(this,"shapesToTest"),oM(this,"start",()=>{}),oM(this,"update",()=>{let{initialSelectedIds:e,shapesToTest:t,app:{metaKey:i,settings:n,originPoint:a,currentPoint:r}}=this,o=tI.getBoundsFromPoints([a,r]),s=n.isCadSelectMode?!i&&a[0]{let i=this.app.getShape(e);if(!l.has(t)){let e=this.app.getShapeUtil(i);(s?tI.boundsContain(o,e.getBounds(i)):e.hitTestBounds(i,o))?(l.add(t),d.has(t)||d.add(t)):d.has(t)&&d.delete(t)}});let c=this.app.selectedIds,u=d.size!==c.length||c.some(e=>!d.has(e)),p=u?Array.from(d.values()):c;return u?{appState:{selectByContain:s},document:{pageStates:{[this.app.currentPageId]:{brush:o,selectedIds:p}}}}:{appState:{selectByContain:s},document:{pageStates:{[this.app.currentPageId]:{brush:o}}}}}),oM(this,"cancel",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:Array.from(this.initialSelectedIds.values())}}}})),oM(this,"complete",()=>({appState:{selectByContain:!1},document:{pageStates:{[this.app.currentPageId]:{brush:null,selectedIds:[...this.app.selectedIds]}}}}));let{currentPageId:t}=e;this.initialSelectedIds=new Set(this.app.selectedIds),this.shapesToTest=this.app.shapes.filter(e=>!(e.isLocked||e.isHidden||e.parentId!==t||this.initialSelectedIds.has(e.id)||this.initialSelectedIds.has(e.parentId))).map(e=>({id:e.id,bounds:this.app.getShapeUtil(e).getBounds(e),selectId:e.id})),this.update()}},dT=class extends d_{constructor(e,t){var i;super(e),oM(this,"type","draw"),oM(this,"performanceMode"),oM(this,"status","creating"),oM(this,"topLeft"),oM(this,"points"),oM(this,"initialShape"),oM(this,"lastAdjustedPoint"),oM(this,"shiftedPoints",[]),oM(this,"shapeId"),oM(this,"isLocked"),oM(this,"isExtending"),oM(this,"lockedDirection"),oM(this,"start",()=>{var e;let t=this.app.originPoint,i=[0,0,null!=(e=t[2])?e:.5];this.points.push(i);let n=[Math.min(this.topLeft[0],t[0]),Math.min(this.topLeft[1],t[1])],a=z.sub(n,t);return this.topLeft=n,this.shiftedPoints=this.points.map(e=>z.toFixed(z.sub(e,a)).concat(e[2])),{document:{pages:{[this.app.currentPageId]:{shapes:{[this.shapeId]:{point:this.topLeft,points:this.shiftedPoints}}}},pageStates:{[this.app.currentPageId]:{selectedIds:[this.shapeId]}}}}}),oM(this,"update",()=>{let{shapeId:e}=this,{currentPoint:t,originPoint:i,shiftKey:n,zoom:a}=this.app;if(!this.lockedDirection&&this.points.length>1){let e=z.sub(t,i);z.len(e)>3/a&&(this.lockedDirection=Math.abs(e[0])>Math.abs(e[1])?"horizontal":"vertical")}if(n){if(!this.isLocked&&this.points.length>2){if(!this.lockedDirection){let e=z.sub(t,i);z.len(e)>3/a&&(this.lockedDirection=Math.abs(e[0])>Math.abs(e[1])?"horizontal":"vertical")}this.isLocked=!0;let e=[...this.lastAdjustedPoint];"vertical"===this.lockedDirection?e[0]=0:e[1]=0,this.points.push(e.concat(t[2]))}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&("vertical"===this.lockedDirection?t[0]=i[0]:t[1]=i[1]);let r=this.addPoint(t);if(r)return{document:{pages:{[this.app.currentPageId]:{shapes:{[e]:r}}},pageStates:{[this.app.currentPageId]:{selectedIds:[e]}}}}}),oM(this,"cancel",()=>{let{shapeId:e}=this,t=this.app.currentPageId;return{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}}}),oM(this,"complete",()=>{let{shapeId:e}=this,t=this.app.currentPageId,i=this.app.getShape(e);return{id:"create_draw",before:{document:{pages:{[t]:{shapes:{[e]:this.isExtending?this.initialShape:void 0}}},pageStates:{[t]:{selectedIds:[]}}}},after:{document:{pages:{[t]:{shapes:{[e]:o_(oE({},i),{point:z.toFixed(i.point),points:i.points.map(e=>z.toFixed(e)),isComplete:!0})}}},pageStates:{[this.app.currentPageId]:{selectedIds:[]}}}}}}),oM(this,"addPoint",e=>{let{originPoint:t}=this.app,i=z.toFixed(z.sub(e,t)).concat(e[2]);if(z.isEqual(this.lastAdjustedPoint,i))return;this.points.push(i),this.lastAdjustedPoint=i;let n=[...this.topLeft],a=[Math.min(this.topLeft[0],e[0]),Math.min(this.topLeft[1],e[1])],r=z.sub(a,t),o;return n[0]!==a[0]||n[1]!==a[1]?(this.topLeft=a,o=this.points.map(e=>z.toFixed(z.sub(e,r)).concat(e[2]))):o=[...this.shiftedPoints,z.sub(i,r).concat(i[2])],this.shiftedPoints=o,{point:this.topLeft,points:o}});let{originPoint:n}=this.app;this.shapeId=t,this.initialShape=this.app.getShape(t),this.topLeft=[...this.initialShape.point];let a=[0,0,null!=(i=n[2])?i:.5],r=z.sub(n,this.topLeft),o=this.initialShape.points.map(e=>z.sub(e,r).concat(e[2]));this.isExtending=o.length>0;let s=[];if(this.isExtending){let e=o[o.length-1];if(e){s.push(e,e);let t=Math.floor(z.dist(e,a)/16);if(t>1)for(let i=0;iz.add(e,r).concat(e[2])),this.lastAdjustedPoint=this.points[this.points.length-1]}},dL=class extends d_{constructor(e,t,i){super(e),oM(this,"type","edit"),oM(this,"performanceMode"),oM(this,"initialShape"),oM(this,"initialSelectedIds"),oM(this,"currentPageId"),oM(this,"isCreating"),oM(this,"start",()=>{}),oM(this,"update",()=>{}),oM(this,"cancel",()=>({document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}})),oM(this,"complete",()=>{let e=this.app.getShape(this.initialShape.id);return{id:"edit",before:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:this.isCreating?void 0:this.initialShape}}},pageStates:{[this.currentPageId]:{selectedIds:this.isCreating?[]:this.initialSelectedIds,editingId:void 0}}}},after:{document:{pages:{[this.currentPageId]:{shapes:{[this.initialShape.id]:e}}},pageStates:{[this.currentPageId]:{selectedIds:[e.id],editingId:void 0}}}}}}),this.initialShape=e.getShape(t,e.currentPageId),this.currentPageId=e.currentPageId,this.isCreating=i,this.initialSelectedIds=[...e.selectedIds]}},dj=class extends d_{constructor(e){super(e),oM(this,"type","draw"),oM(this,"performanceMode"),oM(this,"status","creating"),oM(this,"isLocked"),oM(this,"lockedDirection"),oM(this,"erasedShapes",new Set),oM(this,"erasedBindings",new Set),oM(this,"initialSelectedShapes"),oM(this,"erasableShapes"),oM(this,"prevPoint"),oM(this,"prevEraseShapesSize",0),oM(this,"interval"),oM(this,"timestamp1",0),oM(this,"timestamp2",0),oM(this,"prevErasePoint",[]),oM(this,"loop",()=>{let e=Date.now(),t=e-this.timestamp1,i=e-this.timestamp2,{eraseLine:n}=this.app.appState,a=[...n],r=!1;t>16&&this.prevErasePoint!==this.prevPoint&&(r=!0,a=[...n,this.prevPoint],this.prevErasePoint=this.prevPoint),i>32&&a.length>1&&(r=!0,a.splice(0,Math.ceil(.1*a.length)),this.timestamp2=e),r&&this.app.patchState({appState:{eraseLine:a}},"eraseline"),this.interval=requestAnimationFrame(this.loop)}),oM(this,"start",()=>{}),oM(this,"update",()=>{let{page:e,shiftKey:t,originPoint:i,currentPoint:n,zoom:a}=this.app;if(t){let e=z.sub(n,i);if(!this.isLocked&&z.len(e)>3/a){if(!this.lockedDirection){let e=z.sub(n,i);this.lockedDirection=Math.abs(e[0])>Math.abs(e[1])?"horizontal":"vertical"}this.isLocked=!0}}else this.isLocked&&(this.isLocked=!1);this.isLocked&&("vertical"===this.lockedDirection?n[0]=i[0]:n[1]=i[1]);let r=z.toFixed(z.add(i,z.sub(n,i))),o=new Set([]);this.erasableShapes.forEach(e=>{if(!this.erasedShapes.has(e)&&this.app.getShapeUtil(e).hitTestLineSegment(e,this.prevPoint,r)&&(this.erasedShapes.add(e),o.add(e.id),void 0!==e.children))for(let t of e.children)this.erasedShapes.add(this.app.getShape(t)),o.add(t)}),Object.values(e.bindings).forEach(e=>{for(let t of[e.toId,e.fromId])o.has(t)&&this.erasedBindings.add(e)}),this.erasedShapes.forEach(e=>{this.app.getShape(e.id)||(this.erasedShapes.delete(e),this.erasableShapes.delete(e),o.delete(e.id))});let s=Array.from(this.erasedShapes.values());if(this.prevPoint=r,s.length!==this.prevEraseShapesSize)return this.prevEraseShapesSize=s.length,{document:{pages:{[e.id]:{shapes:Object.fromEntries(s.map(e=>[e.id,{isGhost:!0}]))}}}}}),oM(this,"cancel",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(e=>{this.app.getShape(e.id)||(this.erasedShapes.delete(e),this.erasableShapes.delete(e))});let t=Array.from(this.erasedShapes.values());return{document:{pages:{[e.id]:{shapes:Object.fromEntries(t.map(e=>[e.id,{isGhost:!1}]))}},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.map(e=>e.id)}}},appState:{eraseLine:[]}}}),oM(this,"complete",()=>{let{page:e}=this.app;cancelAnimationFrame(this.interval),this.erasedShapes.forEach(e=>{this.app.getShape(e.id)||(this.erasedShapes.delete(e),this.erasableShapes.delete(e))}),this.erasedBindings.forEach(e=>{this.app.getBinding(e.id)||this.erasedBindings.delete(e)});let t=Array.from(this.erasedShapes.values()),i=Array.from(this.erasedBindings.values()),n=t.map(e=>e.id),a=i.map(e=>e.id),r={shapes:Object.fromEntries(t.map(e=>[e.id,e])),bindings:Object.fromEntries(i.map(e=>[e.id,e]))},o={shapes:Object.fromEntries(t.map(e=>[e.id,void 0])),bindings:Object.fromEntries(i.map(e=>[e.id,void 0]))};return this.app.shapes.forEach(e=>{e.handles&&!o.shapes[e.id]&&Object.values(e.handles).forEach(t=>{var i,s;t.bindingId&&a.includes(t.bindingId)&&(r.shapes[e.id]=o_(oE({},r.shapes[e.id]),{handles:o_(oE({},null==(i=r.shapes[e.id])?void 0:i.handles),{[t.id]:t})}),n.includes(e.id)||(o.shapes[e.id]=o_(oE({},o.shapes[e.id]),{handles:o_(oE({},null==(s=o.shapes[e.id])?void 0:s.handles),{[t.id]:o_(oE({},t),{bindingId:void 0})})})))})}),{id:"erase",before:{document:{pages:{[e.id]:r},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(e=>!!this.app.getShape(e.id)).map(e=>e.id)}}},appState:{eraseLine:[]}},after:{document:{pages:{[e.id]:o},pageStates:{[e.id]:{selectedIds:this.initialSelectedShapes.filter(e=>!!this.app.getShape(e.id)).filter(e=>!n.includes(e.id)).map(e=>e.id)}}},appState:{eraseLine:[]}}}}),this.prevPoint=[...e.originPoint],this.initialSelectedShapes=this.app.selectedIds.map(e=>this.app.getShape(e)),this.erasableShapes=new Set(this.app.shapes.filter(e=>!e.isLocked)),this.interval=this.loop()}},dP=class extends d_{constructor(e,t){var i;super(e),oM(this,"type","grid"),oM(this,"performanceMode"),oM(this,"status","translating"),oM(this,"shape"),oM(this,"bounds"),oM(this,"initialSelectedIds"),oM(this,"initialSiblings"),oM(this,"grid",{}),oM(this,"columns",1),oM(this,"rows",1),oM(this,"isCopying",!1),oM(this,"start",()=>{}),oM(this,"update",()=>{let{currentPageId:e,altKey:t,shiftKey:i,currentPoint:n}=this.app,a={},r=tI.getBoundsCenter(this.bounds),o=z.sub(n,r);i&&(Math.abs(o[0])e!==this.shape.id).forEach(e=>a[e]=void 0),this.grid={"0_0":this.shape.id},this.isCopying=t);for(let e=u;e{g.has(e)||(a[t]=void 0,delete this.grid[e])}),0!==Object.values(a).length)return this.initialSiblings&&(a[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),{document:{pages:{[e]:{shapes:a}},pageStates:{[e]:{}}}}}),oM(this,"cancel",()=>{let{currentPageId:e}=this.app,t={};return Object.values(this.grid).forEach(e=>{t[e]=void 0}),t[this.shape.id]=o_(oE({},t[this.shape.id]),{point:this.shape.point}),this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]}),{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[this.shape.id]}}}}}),oM(this,"complete",()=>{let{currentPageId:e}=this.app,t={},i={},n=[];if(Object.values(this.grid).forEach(e=>{t[e]=void 0,i[e]=this.app.getShape(e),n.push(e)}),t[this.shape.id]=this.shape,this.initialSiblings&&(t[this.shape.parentId]={children:[...this.initialSiblings,this.shape.id]},i[this.shape.parentId]={children:[...this.initialSiblings,...Object.values(this.grid)]}),1!==n.length)return{id:"grid",before:{document:{pages:{[e]:{shapes:t}},pageStates:{[e]:{selectedIds:[],hoveredId:void 0}}}},after:{document:{pages:{[e]:{shapes:i}},pageStates:{[e]:{selectedIds:n,hoveredId:void 0}}}}}}),oM(this,"getClone",(e,t)=>{let i=o_(oE({},this.shape),{id:tI.uniqueId(),point:e});return t||"sticky"===i.type&&(i.text=""),i}),this.shape=this.app.getShape(t),this.grid["0_0"]=this.shape.id,this.bounds=this.app.getShapeBounds(t),this.initialSelectedIds=[...this.app.selectedIds],this.shape.parentId!==this.app.currentPageId&&(this.initialSiblings=null==(i=this.app.getShape(this.shape.parentId).children)?void 0:i.filter(e=>e!==this.shape.id))}},dD={arrow:dI,brush:dM,draw:dT,erase:dj,handle:class extends d_{constructor(e,t,i,n="move_handle"){super(e),oM(this,"type","handle"),oM(this,"performanceMode"),oM(this,"status","translatingHandle"),oM(this,"commandId"),oM(this,"topLeft"),oM(this,"shiftKey",!1),oM(this,"initialShape"),oM(this,"handleId"),oM(this,"start",()=>{}),oM(this,"update",()=>{var e,t;let{initialShape:i,app:{currentPageId:n,currentPoint:a}}=this,r=this.app.getShape(i.id);if(r.isLocked)return;let o=r.handles,s=this.handleId,l=z.sub(a,o[s].point),d={[s]:o_(oE({},o[s]),{point:z.sub(z.add(o[s].point,l),r.point)})},c=null==(t=(e=s0.getShapeUtil(r)).onHandleChange)?void 0:t.call(e,r,d);if(c)return{document:{pages:{[n]:{shapes:{[r.id]:c}}}}}}),oM(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{document:{pages:{[t]:{shapes:{[e.id]:e}}}}}}),oM(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;return{id:this.commandId,before:{document:{pages:{[t]:{shapes:{[e.id]:e}}}}},after:{document:{pages:{[t]:{shapes:{[e.id]:s0.onSessionComplete(this.app.getShape(this.initialShape.id))}}}}}}});let{originPoint:a}=e;this.topLeft=[...a],this.handleId=i,this.initialShape=this.app.getShape(t),this.commandId=n}},rotate:class extends d_{constructor(e){super(e),oM(this,"type","rotate"),oM(this,"status","transforming"),oM(this,"performanceMode"),oM(this,"delta",[0,0]),oM(this,"commonBoundsCenter"),oM(this,"initialAngle"),oM(this,"initialShapes"),oM(this,"changes",{}),oM(this,"start",()=>{}),oM(this,"update",()=>{let{commonBoundsCenter:e,initialShapes:t,app:{currentPageId:i,currentPoint:n,shiftKey:a}}=this,r={},o=z.angle(e,n)-this.initialAngle;return a&&(o=tI.snapAngleToSegments(o,24)),t.forEach(({center:t,shape:i})=>{let{rotation:n=0}=i,s=0;a&&(s=tI.snapAngleToSegments(n,24)-n);let l=s0.getRotatedShapeMutation(i,t,e,a?o+s:o);l&&(r[i.id]=l)}),this.changes=r,{document:{pages:{[i]:{shapes:r}}}}}),oM(this,"cancel",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,i={};return e.forEach(({shape:e})=>i[e.id]=e),{document:{pages:{[t]:{shapes:i}}}}}),oM(this,"complete",()=>{let{initialShapes:e,app:{currentPageId:t}}=this,i={},n=this.changes;return e.forEach(({shape:{id:e,point:t,rotation:n,handles:a}})=>{i[e]={point:t,rotation:n,handles:a}}),{id:"rotate",before:{document:{pages:{[t]:{shapes:i}}}},after:{document:{pages:{[t]:{shapes:n}}}}}});let{app:{currentPageId:t,pageState:i,originPoint:n}}=this,a=s0.getSelectedBranchSnapshot(e.state,t).filter(e=>!e.isLocked);if(0===a.length)throw Error("No selected shapes!");if(e.rotationInfo.selectedIds===i.selectedIds){if(void 0===e.rotationInfo.center)throw Error("We should have a center for rotation!");this.commonBoundsCenter=e.rotationInfo.center}else this.commonBoundsCenter=tI.getBoundsCenter(tI.getCommonBounds(a.map(s0.getBounds))),e.rotationInfo.selectedIds=i.selectedIds,e.rotationInfo.center=this.commonBoundsCenter;this.initialShapes=a.filter(e=>void 0===e.children).map(e=>({shape:e,center:this.app.getShapeUtil(e).getCenter(e)})),this.initialAngle=z.angle(this.commonBoundsCenter,n)}},transform:class extends d_{constructor(e,t=tk.BottomRight,i=!1){super(e),this.transformType=t,this.isCreate=i,oM(this,"type","transform"),oM(this,"performanceMode"),oM(this,"status","transforming"),oM(this,"scaleX",1),oM(this,"scaleY",1),oM(this,"initialShapes"),oM(this,"initialShapeIds"),oM(this,"initialSelectedIds"),oM(this,"shapeBounds"),oM(this,"hasUnlockedShapes"),oM(this,"isAllAspectRatioLocked"),oM(this,"initialCommonBounds"),oM(this,"snapInfo",{state:"empty"}),oM(this,"prevPoint",[0,0]),oM(this,"speed",1),oM(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>!this.initialShapeIds.includes(e.id)).map(e=>tI.getBoundsWithCenter(s0.getRotatedBounds(e)))}}),oM(this,"update",()=>{let{transformType:e,shapeBounds:t,initialCommonBounds:i,isAllAspectRatioLocked:n,app:{currentPageId:a,pageState:{camera:r},viewport:o,currentPoint:s,previousPoint:l,originPoint:d,shiftKey:c,altKey:u,metaKey:p,currentGrid:h,settings:{isSnapping:m,showGrid:g}}}=this,f={},b=u?z.mul(z.sub(s,d),2):z.sub(s,d),x=tI.getTransformedBoundingBox(i,e,b,0,c||n);u&&(x=oE(oE({},x),tI.centerBounds(x,tI.getBoundsCenter(i)))),g&&(x=oE(oE({},x),tI.snapBoundsToGrid(x,h)));let y=z.dist(s,l)-this.speed;this.speed=this.speed+y*(y>1?.5:.15);let v=[];if((m&&!p||!m&&p)&&this.speed*r.zoom<10&&"ready"===this.snapInfo.state){let t=tI.getSnapPoints(tI.getBoundsWithCenter(x),this.snapInfo.bounds.filter(e=>tI.boundsContain(o,e)||tI.boundsCollide(o,e)),5/r.zoom);t&&(v=t.snapLines,x=tI.getTransformedBoundingBox(i,e,z.sub(b,t.offset),0,c||n))}return this.scaleX=x.scaleX,this.scaleY=x.scaleY,t.forEach(({initialShape:e,initialShapeBounds:t,transformOrigin:n})=>{let a=tI.getRelativeTransformedBoundingBox(x,i,t,this.scaleX<0,this.scaleY<0);g&&(a=tI.snapBoundsToGrid(a,h));let r=s0.transform(this.app.getShape(e.id),a,{type:this.transformType,initialShape:e,scaleX:this.scaleX,scaleY:this.scaleY,transformOrigin:n});f[e.id]=r}),{appState:{snapLines:v},document:{pages:{[a]:{shapes:f}}}}}),oM(this,"cancel",()=>{let{shapeBounds:e,app:{currentPageId:t}}=this,i={};return this.isCreate?e.forEach(e=>i[e.initialShape.id]=void 0):e.forEach(e=>i[e.initialShape.id]=e.initialShape),{appState:{snapLines:[]},document:{pages:{[t]:{shapes:i}},pageStates:{[t]:{selectedIds:this.isCreate?[]:e.map(e=>e.initialShape.id)}}}}}),oM(this,"complete",()=>{let{isCreate:e,shapeBounds:t,hasUnlockedShapes:i,app:{currentPageId:n}}=this;if(!i)return;if(this.isCreate&&2>z.dist(this.app.originPoint,this.app.currentPoint))return this.cancel();let a={},r={},o,s;return e?(o=[],s=[],t.forEach(({initialShape:e})=>{a[e.id]=void 0,r[e.id]=this.app.getShape(e.id)})):(o=this.initialSelectedIds,s=this.initialSelectedIds,t.forEach(({initialShape:e})=>{a[e.id]=e,r[e.id]=this.app.getShape(e.id)})),{id:"transform",before:{appState:{snapLines:[]},document:{pages:{[n]:{shapes:a}},pageStates:{[n]:{selectedIds:o,hoveredId:void 0,editingId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[n]:{shapes:r}},pageStates:{[n]:{selectedIds:s,hoveredId:void 0,editingId:void 0}}}}}}),this.initialSelectedIds=[...this.app.selectedIds],this.app.rotationInfo.selectedIds=[...this.initialSelectedIds],this.initialShapes=s0.getSelectedBranchSnapshot(this.app.state,this.app.currentPageId).filter(e=>!e.isLocked),this.initialShapeIds=this.initialShapes.map(e=>e.id),this.hasUnlockedShapes=this.initialShapes.length>0,this.isAllAspectRatioLocked=this.initialShapes.every(e=>e.isAspectRatioLocked||s0.getShapeUtil(e).isAspectRatioLocked);let n=Object.fromEntries(this.initialShapes.map(e=>[e.id,s0.getBounds(e)])),a=Object.values(n);this.initialCommonBounds=tI.getCommonBounds(a);let r=tI.getBoundsFromPoints(a.map(tI.getBoundsCenter));this.shapeBounds=this.initialShapes.map(e=>{let t=n[e.id],i=tI.getBoundsCenter(t);return{initialShape:e,initialShapeBounds:t,transformOrigin:[(i[0]-r.minX)/r.width,(i[1]-r.minY)/r.height]}})}},transformSingle:class extends d_{constructor(e,t,i,n=!1){super(e),oM(this,"type","transformSingle"),oM(this,"status","transforming"),oM(this,"performanceMode"),oM(this,"transformType"),oM(this,"scaleX",1),oM(this,"scaleY",1),oM(this,"isCreate"),oM(this,"initialShape"),oM(this,"initialShapeBounds"),oM(this,"initialCommonBounds"),oM(this,"snapInfo",{state:"empty"}),oM(this,"prevPoint",[0,0]),oM(this,"speed",1),oM(this,"start",()=>{this.snapInfo={state:"ready",bounds:this.app.shapes.filter(e=>e.id!==this.initialShape.id).map(e=>tI.getBoundsWithCenter(s0.getRotatedBounds(e)))}}),oM(this,"update",()=>{let{transformType:e,initialShape:t,initialShapeBounds:i,app:{settings:{isSnapping:n,showGrid:a},currentPageId:r,pageState:{camera:o},viewport:s,currentPoint:l,previousPoint:d,originPoint:c,currentGrid:u,shiftKey:p,altKey:h,metaKey:m}}=this;if(t.isLocked)return;let g={},f=h?z.mul(z.sub(l,c),2):z.sub(l,c),b=this.app.getShape(t.id),x=s0.getShapeUtil(b),y=tI.getTransformedBoundingBox(i,e,f,b.rotation,p||b.isAspectRatioLocked||x.isAspectRatioLocked);h&&(y=oE(oE({},y),tI.centerBounds(y,tI.getBoundsCenter(i)))),a&&(y=oE(oE({},y),tI.snapBoundsToGrid(y,u)));let v=z.dist(l,d)-this.speed;this.speed=this.speed+v*(v>1?.5:.15);let C=[];if((n&&!m||!n&&m)&&!t.rotation&&this.speed*o.zoom<10&&"ready"===this.snapInfo.state){let t=tI.getSnapPoints(tI.getBoundsWithCenter(y),this.snapInfo.bounds.filter(e=>tI.boundsContain(s,e)||tI.boundsCollide(s,e)),5/o.zoom);t&&(C=t.snapLines,y=tI.getTransformedBoundingBox(i,e,z.sub(f,t.offset),b.rotation,p||b.isAspectRatioLocked||x.isAspectRatioLocked))}let w=s0.getShapeUtil(b).transformSingle(b,y,{initialShape:t,type:this.transformType,scaleX:y.scaleX,scaleY:y.scaleY,transformOrigin:[.5,.5]});return w&&(g[b.id]=w),a&&w&&w.point&&(w.point=z.snap(w.point,u)),{appState:{snapLines:C},document:{pages:{[r]:{shapes:g}}}}}),oM(this,"cancel",()=>{let{initialShape:e,app:{currentPageId:t}}=this,i={};return this.isCreate?i[e.id]=void 0:i[e.id]=e,{appState:{snapLines:[]},document:{pages:{[t]:{shapes:i}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id]}}}}}),oM(this,"complete",()=>{let{initialShape:e,app:{currentPageId:t}}=this;if(e.isLocked)return;if(this.isCreate&&2>z.dist(this.app.originPoint,this.app.currentPoint))return this.cancel();let i={},n={};return i[e.id]=this.isCreate?void 0:e,n[e.id]=s0.onSessionComplete(this.app.getShape(e.id)),{id:"transform_single",before:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:i}},pageStates:{[t]:{selectedIds:this.isCreate?[]:[e.id],editingId:void 0,hoveredId:void 0}}}},after:{appState:{snapLines:[]},document:{pages:{[t]:{shapes:n}},pageStates:{[t]:{selectedIds:[e.id],editingId:void 0,hoveredId:void 0}}}}}}),this.isCreate=n,this.transformType=i;let a=this.app.getShape(t);this.initialShape=a,this.initialShapeBounds=s0.getBounds(a),this.initialCommonBounds=s0.getRotatedBounds(a),this.app.rotationInfo.selectedIds=[a.id]}},translate:class extends d_{constructor(e,t=!1,i=!1){super(e),oM(this,"performanceMode"),oM(this,"type","translate"),oM(this,"status","translating"),oM(this,"delta",[0,0]),oM(this,"prev",[0,0]),oM(this,"prevPoint",[0,0]),oM(this,"speed",1),oM(this,"cloneInfo",{state:"empty"}),oM(this,"snapInfo",{state:"empty"}),oM(this,"snapLines",[]),oM(this,"isCloning",!1),oM(this,"isCreate"),oM(this,"link"),oM(this,"initialIds"),oM(this,"hasUnlockedShapes"),oM(this,"initialSelectedIds"),oM(this,"initialCommonBounds"),oM(this,"initialShapes"),oM(this,"initialParentChildren"),oM(this,"bindingsToDelete"),oM(this,"start",()=>{let{bindingsToDelete:e,initialIds:t,app:{currentPageId:i,page:n}}=this,a=[],r=[];if(Object.values(n.shapes).forEach(e=>{let i=tI.getBoundsWithCenter(s0.getRotatedBounds(e));a.push(i),t.has(e.id)||r.push(i)}),this.snapInfo={state:"ready",bounds:a,others:r},0===e.length)return;let o={};return e.forEach(e=>o[e.id]=void 0),{document:{pages:{[i]:{bindings:o}}}}}),oM(this,"update",()=>{let{initialParentChildren:e,initialShapes:t,initialCommonBounds:i,bindingsToDelete:n,app:{pageState:{camera:a},settings:{isSnapping:r,showGrid:o},currentPageId:s,viewport:l,selectedIds:d,currentPoint:c,previousPoint:u,originPoint:p,altKey:h,shiftKey:m,metaKey:g,currentGrid:f}}=this,b={},x={},y={},v=z.sub(c,p),C=!1;this.isCreate||(h&&!this.isCloning?(this.isCloning=!0,C=!0):!h&&this.isCloning&&(this.isCloning=!1,C=!0)),m&&(Math.abs(v[0])1?.5:.15),this.snapLines=[],(r&&!g||!r&&g)&&this.speed*a.zoom<10&&"ready"===this.snapInfo.state){let e=tI.getSnapPoints(tI.getBoundsWithCenter(o?tI.snapBoundsToGrid(tI.translateBounds(i,v),f):tI.translateBounds(i,v)),(this.isCloning?this.snapInfo.bounds:this.snapInfo.others).filter(e=>tI.boundsContain(l,e)||tI.boundsCollide(l,e)),5/a.zoom);e&&(this.snapLines=e.snapLines,v=z.sub(v,e.offset))}if(this.prev=v,this.isCloning)if(C){if("empty"===this.cloneInfo.state&&this.createCloneInfo(),"empty"===this.cloneInfo.state)throw Error;let{clones:i,clonedBindings:a}=this.cloneInfo;for(let r of(this.isCloning=!0,n.forEach(e=>b[e.id]=e),t.forEach(e=>x[e.id]={point:e.point}),i.forEach(t=>{var i;if(x[t.id]=oE({},t),t.parentId!==s&&!d.includes(t.parentId)){let n=(null==(i=x[t.parentId])?void 0:i.children)||e[t.parentId];n.includes(t.id)||(x[t.parentId]=o_(oE({},x[t.parentId]),{children:[...n,t.id]}))}}),a))b[r.id]=r;y.selectedIds=i.map(e=>e.id),i.forEach(e=>{x[e.id]=o_(oE({},e),{point:o?z.snap(z.toFixed(z.add(e.point,v)),f):z.toFixed(z.add(e.point,v))})})}else{if("empty"===this.cloneInfo.state)throw Error;let{clones:e}=this.cloneInfo;e.forEach(e=>{x[e.id]={point:o?z.snap(z.toFixed(z.add(e.point,v)),f):z.toFixed(z.add(e.point,v))}})}else if(C){if("empty"===this.cloneInfo.state)throw Error;let{clones:i,clonedBindings:a}=this.cloneInfo;for(let r of(this.isCloning=!1,n.forEach(e=>b[e.id]=void 0),i.forEach(t=>{t.parentId!==s&&(x[t.parentId]=o_(oE({},x[t.parentId]),{children:e[t.parentId]}))}),i.forEach(e=>x[e.id]=void 0),t.forEach(e=>{x[e.id]={point:o?z.snap(z.toFixed(z.add(e.point,v)),f):z.toFixed(z.add(e.point,v))}}),a))b[r.id]=void 0;y.selectedIds=t.map(e=>e.id)}else t.forEach(e=>{x[e.id]={point:o?z.snap(z.toFixed(z.add(e.point,v)),f):z.toFixed(z.add(e.point,v))}});return{appState:{snapLines:this.snapLines},document:{pages:{[s]:{shapes:x,bindings:b}},pageStates:{[s]:y}}}}),oM(this,"cancel",()=>{let{initialShapes:e,initialSelectedIds:t,bindingsToDelete:i,app:{currentPageId:n}}=this,a={},r={},o={editingId:void 0,hoveredId:void 0};if(i.forEach(e=>a[e.id]=e),this.isCreate?(e.forEach(({id:e})=>r[e]=void 0),o.selectedIds=[]):(e.forEach(({id:e,point:t})=>r[e]=o_(oE({},r[e]),{point:t})),o.selectedIds=t),"ready"===this.cloneInfo.state){let{clones:e,clonedBindings:t}=this.cloneInfo;e.forEach(e=>r[e.id]=void 0),t.forEach(e=>a[e.id]=void 0)}return{appState:{snapLines:[]},document:{pages:{[n]:{shapes:r,bindings:a}},pageStates:{[n]:o}}}}),oM(this,"complete",()=>{let{initialShapes:e,initialParentChildren:t,bindingsToDelete:i,app:{currentPageId:n}}=this,a={},r={},o={},s={};if(this.isCloning){if("empty"===this.cloneInfo.state&&this.createCloneInfo(),"ready"!==this.cloneInfo.state)throw Error;let{clones:e,clonedBindings:i}=this.cloneInfo;e.forEach(e=>{r[e.id]=void 0,s[e.id]=this.app.getShape(e.id),e.parentId!==n&&(r[e.parentId]=o_(oE({},r[e.parentId]),{children:t[e.parentId]}),s[e.parentId]=o_(oE({},s[e.parentId]),{children:this.app.getShape(e.parentId).children}))}),i.forEach(e=>{a[e.id]=void 0,o[e.id]=this.app.getBinding(e.id)})}else e.forEach(e=>{r[e.id]=this.isCreate?void 0:o_(oE({},r[e.id]),{point:e.point}),s[e.id]=oE(oE({},s[e.id]),this.isCreate?this.app.getShape(e.id):{point:this.app.getShape(e.id).point})});return i.forEach(e=>{for(let t of(a[e.id]=e,[e.toId,e.fromId])){let i=this.app.getShape(t);i.handles&&Object.values(i.handles).filter(t=>t.bindingId===e.id).forEach(i=>{r[t]=o_(oE({},r[t]),{handles:{}}),s[t]=o_(oE({},s[t]),{handles:{}}),r[t].handles[i.id]={bindingId:e.id},s[t].handles[i.id]={bindingId:void 0}})}}),{id:"translate",before:{appState:{snapLines:[]},document:{pages:{[n]:{shapes:r,bindings:a}},pageStates:{[n]:{selectedIds:this.isCreate?[]:[...this.initialSelectedIds]}}}},after:{appState:{snapLines:[]},document:{pages:{[n]:{shapes:s,bindings:o}},pageStates:{[n]:{selectedIds:[...this.app.selectedIds]}}}}}}),oM(this,"createCloneInfo",()=>{let{initialShapes:e,initialParentChildren:t,app:{selectedIds:i,currentPageId:n,page:a}}=this,r={},o={},s=[],l=[];e.forEach(e=>{let i=tI.uniqueId();t[i]=t[e.id],r[e.id]=i;let a=o_(oE({},tI.deepClone(e)),{id:i,parentId:e.parentId,childIndex:s0.getChildIndexAbove(this.app.state,e.id,n)});if("video"===a.type){let t=document.getElementById(e.id+"_video");t&&(a.currentTime=(t.currentTime+16)%t.duration)}l.push(a)}),l.forEach(e=>{void 0!==e.children&&(e.children=e.children.map(e=>r[e]))}),l.forEach(e=>{i.includes(e.parentId)&&(e.parentId=r[e.parentId])});let d=new Set(Object.keys(r));Object.values(a.bindings).filter(e=>d.has(e.fromId)||d.has(e.toId)).forEach(e=>{if(d.has(e.fromId)&&d.has(e.toId)){let t=tI.uniqueId(),i=o_(oE({},tI.deepClone(e)),{id:t,fromId:r[e.fromId]||e.fromId,toId:r[e.toId]||e.toId});o[e.id]=t,s.push(i)}}),l.forEach(e=>{if(e.handles&&e.handles)for(let t in e.handles){let i=e.handles[t];i.bindingId=i.bindingId?o[i.bindingId]:void 0}}),l.forEach(e=>{if(a.shapes[e.id])throw Error("uh oh, we didn't clone correctly")}),this.cloneInfo={state:"ready",clones:l,cloneMap:r,clonedBindings:s}}),this.isCreate=t,this.link=i;let{currentPageId:n,selectedIds:a,page:r}=this.app;this.initialSelectedIds=[...a];let o=(i?s0.getLinkedShapeIds(this.app.state,n,i,!1):a).map(e=>this.app.getShape(e)).filter(e=>!e.isLocked),s=new Set(o.map(e=>e.id));this.hasUnlockedShapes=o.length>0,this.initialShapes=Array.from(new Set(o.filter(e=>!s.has(e.parentId)).flatMap(e=>e.children?[e,...e.children.map(e=>this.app.getShape(e))]:[e])).values()),this.initialIds=new Set(this.initialShapes.map(e=>e.id)),this.bindingsToDelete=[],Object.values(r.bindings).filter(e=>this.initialIds.has(e.fromId)||this.initialIds.has(e.toId)).forEach(e=>{this.initialIds.has(e.fromId)&&(this.initialIds.has(e.toId)||this.bindingsToDelete.push(e))}),this.initialParentChildren={},this.initialShapes.map(e=>e.parentId).filter(e=>e!==r.id).forEach(e=>{this.initialParentChildren[e]=this.app.getShape(e).children}),this.initialCommonBounds=tI.getCommonBounds(this.initialShapes.map(s0.getRotatedBounds)),this.app.rotationInfo.selectedIds=[...this.app.selectedIds]}},grid:dP,edit:dL},dN=class extends oL{constructor(e){super(),this.app=e,oM(this,"type","select"),oM(this,"previous"),oM(this,"status","idle"),oM(this,"setStatus",e=>{this.status=e,this.app.setStatus(this.status)}),oM(this,"onEnter",()=>{this.setStatus("idle")}),oM(this,"onExit",()=>{this.setStatus("idle")}),oM(this,"onCancel",()=>{"idle"===this.status?this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()}),oM(this,"getNextChildIndex",()=>{let{shapes:e,appState:{currentPageId:t}}=this.app;return 0===e.length?1:e.filter(e=>e.parentId===t).sort((e,t)=>t.childIndex-e.childIndex)[0].childIndex+1}),oM(this,"onPinchStart",()=>{this.app.cancelSession(),this.setStatus("pinching")}),oM(this,"onPinchEnd",()=>{tI.isMobileSafari()&&this.app.undoSelect(),this.setStatus("idle")}),oM(this,"onPinch",(e,t)=>{var i;"pinching"===this.status&&(isNaN(e.delta[0])||isNaN(e.delta[1])||(this.app.pinchZoom(e.point,e.delta,e.delta[2]),null==(i=this.onPointerMove)||i.call(this,e,t)))}),oM(this,"onKeyDown",e=>{"Escape"===e?this.onCancel():("Meta"===e||"Control"===e||"Alt"===e)&&this.app.updateSession()}),oM(this,"onKeyUp",e=>{if("Meta"===e||"Control"===e||"Alt"===e)return void this.app.updateSession()}),oM(this,"onPointerMove",()=>{"creating"===this.status&&this.app.updateSession()}),oM(this,"onPointerUp",()=>{if("creating"===this.status){this.app.completeSession();let{isToolLocked:e}=this.app.appState;e||this.app.selectTool("select")}this.setStatus("idle")})}},dR=class extends dN{constructor(){super(...arguments),oM(this,"type","arrow"),oM(this,"onPointerDown",()=>{if("idle"!==this.status)return;let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId(),s=l8.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,style:oE({},a)});this.app.patchCreate([s]),this.app.startSession("arrow",s.id,"end",!0),this.setStatus("creating")})}},dO=class extends dN{constructor(){super(...arguments),oM(this,"type","draw"),oM(this,"lastShapeId"),oM(this,"onEnter",()=>{this.lastShapeId=void 0}),oM(this,"onCancel",()=>{"idle"===this.status?this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()}),oM(this,"onPointerDown",e=>{if("idle"!==this.status||this.app.readOnly)return;let{currentPoint:t,appState:{currentPageId:i,currentStyle:n}}=this.app,a=this.lastShapeId&&this.app.getShape(this.lastShapeId);if(e.shiftKey&&a)this.app.startSession("draw",a.id),this.setStatus("extending");else{let e=this.getNextChildIndex(),a=tI.uniqueId(),r=l9.create({id:a,parentId:i,childIndex:e,point:t,style:oE({},n)});this.lastShapeId=a,this.app.patchCreate([r]),this.app.startSession("draw",a),this.setStatus("creating")}}),oM(this,"onPointerMove",()=>{if(!this.app.readOnly)switch(this.status){case"extending":case"creating":this.app.updateSession()}}),oM(this,"onPointerUp",()=>{this.app.completeSession(),this.setStatus("idle")})}},dB=class extends dN{constructor(){super(...arguments),oM(this,"type","ellipse"),oM(this,"onPointerDown",()=>{if(this.app.readOnly||"idle"!==this.status)return;let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId(),s=l6.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,style:oE({},a)});this.app.patchCreate([s]),this.app.startSession("transformSingle",s.id,tk.BottomRight,!0),this.setStatus("creating")})}},dz=class extends dN{constructor(){super(...arguments),oM(this,"type","erase"),oM(this,"status","idle"),oM(this,"onPointerDown",()=>{this.app.readOnly||"idle"===this.status&&this.setStatus("pointing")}),oM(this,"onPointerMove",e=>{if(!this.app.readOnly)switch(this.status){case"pointing":z.dist(e.origin,e.point)>3&&(this.app.startSession("erase"),this.app.updateSession(),this.setStatus("erasing"));break;case"erasing":this.app.updateSession()}}),oM(this,"onPointerUp",()=>{if(!this.app.readOnly){switch(this.status){case"pointing":{let e=this.app.shapes.filter(e=>!e.isLocked).filter(e=>this.app.getShapeUtil(e).hitTestPoint(e,this.app.currentPoint)).flatMap(e=>e.children?[e.id,...e.children]:e.id);this.app.delete(e);break}case"erasing":this.app.completeSession()}this.setStatus("idle")}}),oM(this,"onCancel",()=>{"idle"===this.status?this.previous?this.app.selectTool(this.previous):this.app.selectTool("select"):this.setStatus("idle"),this.app.cancelSession()})}},dF=class extends dN{constructor(){super(...arguments),oM(this,"type","line"),oM(this,"onPointerDown",()=>{if(this.app.readOnly||"idle"!==this.status)return;let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId(),s=l8.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,decorations:{start:void 0,end:void 0},style:oE({},a)});this.app.patchCreate([s]),this.app.startSession("arrow",s.id,"end",!0),this.setStatus("creating")})}},dH=class extends dN{constructor(){super(...arguments),oM(this,"type","rectangle"),oM(this,"onPointerDown",()=>{if(this.app.readOnly||"idle"!==this.status)return;let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId(),s=l5.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,style:oE({},a)});this.app.patchCreate([s]),this.app.startSession("transformSingle",s.id,tk.BottomRight,!0),this.setStatus("creating")})}},dW=class extends dN{constructor(){super(...arguments),oM(this,"type","select"),oM(this,"pointedId"),oM(this,"selectedGroupId"),oM(this,"pointedHandleId"),oM(this,"pointedBoundsHandle"),oM(this,"pointedLinkHandleId"),oM(this,"onEnter",()=>{this.setStatus("idle")}),oM(this,"onExit",()=>{this.setStatus("idle")}),oM(this,"clonePaint",e=>{if(0===this.app.selectedIds.length)return;let t=this.app.selectedIds.map(e=>this.app.getShape(e)),i=tI.expandBounds(tI.getCommonBounds(t.map(s0.getBounds)),16),n=tI.getBoundsCenter(i),a=[i.width,i.height],r=[n[0]+a[0]*Math.floor((e[0]+a[0]/2-n[0])/a[0]),n[1]+a[1]*Math.floor((e[1]+a[1]/2-n[1])/a[1])],o=tI.centerBounds(i,r);this.app.shapes.some(e=>s0.getShapeUtil(e).hitTestBounds(e,o))||this.app.duplicate(this.app.selectedIds,r)}),oM(this,"getShapeClone",(e,t)=>{let i=this.app.getShape(e),n=s0.getShapeUtil(i);if(n.canClone){let e=n.getBounds(i),a=n.getCenter(i),r={top:[e.minX,e.minY-(e.height+32)],right:[e.maxX+32,e.minY],bottom:[e.minX,e.maxY+32],left:[e.minX-(e.width+32),e.minY],topLeft:[e.minX-(e.width+32),e.minY-(e.height+32)],topRight:[e.maxX+32,e.minY-(e.height+32)],bottomLeft:[e.minX-(e.width+32),e.maxY+32],bottomRight:[e.maxX+32,e.maxY+32]}[t];if(0!==i.rotation){let t=z.add(r,[e.width/2,e.height/2]),n=z.rotWith(t,a,i.rotation||0);r=z.sub(n,[e.width/2,e.height/2])}let o=tI.uniqueId(),s=o_(oE({},i),{id:o,point:r});return"sticky"===s.type&&(s.text=""),s}}),oM(this,"onCancel",()=>{this.app.session?this.app.cancelSession():this.selectNone(),this.setStatus("idle")}),oM(this,"onKeyDown",(e,t,i)=>{switch(e){case"Escape":this.onCancel();break;case"Tab":if(this.app.readOnly)return;if(!this.app.pageState.editingId&&"idle"===this.status&&1===this.app.selectedIds.length){let[e]=this.app.selectedIds,t=this.getShapeClone(e,"right");t&&(this.app.createShapes(t),this.setStatus("idle"),"sticky"===t.type&&(this.app.select(t.id),this.app.setEditingId(t.id)))}break;case"Meta":case"Control":case"Alt":this.app.updateSession();break;case"Enter":{if(this.app.readOnly)return;let{pageState:e}=this.app;1!==e.selectedIds.length||e.editingId||(this.app.setEditingId(e.selectedIds[0]),i.preventDefault())}}}),oM(this,"onKeyUp",(e,t)=>{"clonePainting"!==this.status||t.altKey&&t.shiftKey?("Meta"===e||"Control"===e||"Alt"===e)&&this.app.updateSession():this.setStatus("idle")}),oM(this,"onPointerMove",()=>{let{originPoint:e,currentPoint:t}=this.app;if(this.app.readOnly&&this.app.isPointing)return void(this.app.session?this.app.updateSession():z.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing")));switch(this.status){case"pointingBoundsHandle":if(!this.pointedBoundsHandle)throw Error("No pointed bounds handle");if(z.dist(e,t)>3){if("rotate"===this.pointedBoundsHandle)this.setStatus("rotating"),this.app.startSession("rotate");else if("center"===this.pointedBoundsHandle||"left"===this.pointedBoundsHandle||"right"===this.pointedBoundsHandle)this.setStatus("translating"),this.app.startSession("translate",!1,this.pointedBoundsHandle);else{this.setStatus("transforming");let e=this.app.selectedIds.flatMap(e=>s0.getDocumentBranch(this.app.state,e,this.app.currentPageId));1===e.length?this.app.startSession("transformSingle",e[0],this.pointedBoundsHandle):this.app.startSession("transform",this.pointedBoundsHandle)}this.app.updateSession()}break;case"pointingCanvas":z.dist(e,t)>3&&(this.app.startSession("brush"),this.setStatus("brushing"));break;case"pointingClone":z.dist(e,t)>3&&(this.setStatus("translatingClone"),this.app.startSession("translate"),this.app.updateSession());break;case"pointingBounds":z.dist(e,t)>3&&(this.setStatus("translating"),this.app.startSession("translate"),this.app.updateSession());break;case"pointingHandle":if(!this.pointedHandleId)throw Error("No pointed handle");if(z.dist(e,t)>3){this.setStatus("translatingHandle");let e=this.app.getShape(this.app.selectedIds[0]);e&&("bend"===this.pointedHandleId?this.app.startSession("handle",e.id,this.pointedHandleId):this.app.startSession("arrow",e.id,this.pointedHandleId,!1),this.app.updateSession())}break;case"clonePainting":this.clonePaint(t);break;default:this.app.session&&this.app.updateSession()}}),oM(this,"onPointerDown",(e,t)=>{if("canvas"===e.target&&"idle"===this.status){let{currentPoint:i}=this.app;if(!e.spaceKey||1!==t.buttons){if("idle"===this.status&&e.altKey&&e.shiftKey){this.setStatus("clonePainting"),this.clonePaint(i);return}if(!e.shiftKey){if(this.app.onShapeBlur(),e.altKey&&this.app.selectedIds.length>0)return void this.app.duplicate(this.app.selectedIds,i);this.selectNone()}this.setStatus("pointingCanvas")}}}),oM(this,"onPointerUp",e=>{var t;if("translatingClone"===this.status||"pointingClone"===this.status){this.pointedId&&(this.app.completeSession(),this.app.setEditingId(this.pointedId)),this.setStatus("idle"),this.pointedId=void 0;return}if("pointingBounds"===this.status){if("bounds"===e.target)this.selectNone();else if(this.app.isSelected(e.target))e.shiftKey?this.pointedId!==e.target&&this.deselect(e.target):this.pointedId!==e.target&&this.app.selectedIds.length>1&&this.select(e.target);else if(this.pointedId===e.target){if(this.app.getShape(e.target).isLocked)return;e.shiftKey?this.pushSelect(e.target):this.select(e.target)}}this.setStatus("idle"),this.pointedBoundsHandle=void 0,this.pointedHandleId=void 0,this.pointedId=void 0,(null==(t=this.app.session)?void 0:t.type)!=="edit"&&this.app.completeSession()}),oM(this,"onDoubleClickCanvas",()=>{this.app.readOnly}),oM(this,"onPointShape",(e,t)=>{if(e.spaceKey&&1===t.buttons||this.app.getShape(e.target).isLocked)return;let{editingId:i,hoveredId:n}=this.app.pageState;if(i&&e.target!==i&&this.app.onShapeBlur(),("idle"===this.status||"pointingBounds"===this.status)&&e.metaKey&&e.shiftKey&&n){this.pointedId=n,this.app.isSelected(n)?this.deselect(n):(this.pushSelect(n),this.setStatus("pointingBounds"));return}if("pointingBounds"===this.status){let{parentId:t}=this.app.getShape(e.target);this.pointedId=t===this.app.currentPageId?e.target:t;return}if("idle"===this.status){if(this.setStatus("pointingBounds"),e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}let t,{parentId:i}=this.app.getShape(e.target);i===this.app.currentPageId?(t=e.target,this.selectedGroupId=void 0):i===this.selectedGroupId?t=e.target:(t=i,this.selectedGroupId=void 0),this.app.isSelected(t)||(this.pointedId=t,e.shiftKey?this.pushSelect(t):this.select(t))}}),oM(this,"onDoubleClickShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);t.isLocked||(s0.getShapeUtil(t.type).canEdit&&(t.parentId===this.app.currentPageId||t.parentId===this.selectedGroupId)&&this.app.setEditingId(e.target),t.parentId!==this.app.currentPageId&&(this.selectedGroupId=t.parentId)),this.app.select(e.target)}),oM(this,"onRightPointShape",e=>{this.app.isSelected(e.target)||this.app.select(e.target)}),oM(this,"onHoverShape",e=>{this.app.setHoveredId(e.target)}),oM(this,"onUnhoverShape",e=>{let{currentPageId:t}=this.app;requestAnimationFrame(()=>{t===this.app.currentPageId&&this.app.pageState.hoveredId===e.target&&this.app.setHoveredId(void 0)})}),oM(this,"onPointBounds",e=>{if(e.metaKey){e.shiftKey||this.selectNone(),this.app.startSession("brush"),this.setStatus("brushing");return}this.setStatus("pointingBounds")}),oM(this,"onRightPointBounds",(e,t)=>{t.stopPropagation()}),oM(this,"onReleaseBounds",()=>{("translating"===this.status||"brushing"===this.status)&&this.app.completeSession(),this.setStatus("idle")}),oM(this,"onPointBoundsHandle",e=>{this.pointedBoundsHandle=e.target,this.setStatus("pointingBoundsHandle")}),oM(this,"onDoubleClickBoundsHandle",e=>{switch(e.target){case"center":case"left":case"right":this.app.select(...s0.getLinkedShapeIds(this.app.state,this.app.currentPageId,e.target,e.shiftKey));break;default:if(1===this.app.selectedIds.length){this.app.resetBounds(this.app.selectedIds);let e=this.app.getShape(this.app.selectedIds[0]);"label"in e&&this.app.setEditingId(e.id)}}}),oM(this,"onReleaseBoundsHandle",()=>{this.setStatus("idle")}),oM(this,"onPointHandle",e=>{this.pointedHandleId=e.target,this.setStatus("pointingHandle")}),oM(this,"onDoubleClickHandle",e=>{if("bend"===e.target){let{selectedIds:e}=this.app;if(1!==e.length)return;let t=this.app.getShape(e[0]);s0.getShapeUtil(t.type).canEdit&&(t.parentId===this.app.currentPageId||t.parentId===this.selectedGroupId)&&this.app.setEditingId(t.id);return}this.app.toggleDecoration(e.target)}),oM(this,"onReleaseHandle",()=>{this.setStatus("idle")}),oM(this,"onShapeClone",e=>{let t=this.app.selectedIds[0],i=this.getShapeClone(t,e.target);"left"===e.target||"right"===e.target||"top"===e.target||"bottom"===e.target?i&&(this.app.createShapes(i),this.pointedId=i.id,this.setStatus("pointingClone")):(this.setStatus("gridCloning"),this.app.startSession("grid",t))})}deselect(e){this.app.select(...this.app.selectedIds.filter(t=>t!==e))}select(e){this.app.select(e)}pushSelect(e){let t=this.app.getShape(e);this.app.select(...this.app.selectedIds.filter(e=>e!==t.parentId),e)}selectNone(){this.app.selectNone()}},dU=class extends dN{constructor(){super(...arguments),oM(this,"type","sticky"),oM(this,"shapeId"),oM(this,"onPointerDown",()=>{if(!this.app.readOnly){if("creating"===this.status){this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select");return}if("idle"===this.status){let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId();this.shapeId=o;let s=dt.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,style:oE({},a)}),l=dt.getBounds(s);s.point=z.sub(s.point,[l.width/2,l.height/2]),this.app.patchCreate([s]),this.app.startSession("translate"),this.setStatus("creating")}}}),oM(this,"onPointerUp",()=>{this.app.readOnly||"creating"===this.status&&(this.setStatus("idle"),this.app.completeSession(),this.app.selectTool("select"),this.app.setEditingId(this.shapeId))})}},dV=class extends dN{constructor(){super(...arguments),oM(this,"type","text"),oM(this,"stopEditingShape",()=>{this.setStatus("idle"),this.app.appState.isToolLocked||this.app.selectTool("select")}),oM(this,"onKeyUp",()=>{}),oM(this,"onKeyDown",()=>{}),oM(this,"onPointerDown",()=>{if("creating"===this.status)return void this.stopEditingShape();if("idle"===this.status){let{currentPoint:e,currentGrid:t,settings:{showGrid:i}}=this.app;this.app.createTextShapeAtPoint(i?z.snap(e,t):e,void 0,!0),this.setStatus("creating");return}}),oM(this,"onPointerUp",()=>{}),oM(this,"onPointShape",e=>{if(this.app.readOnly)return;let t=this.app.getShape(e.target);"text"===t.type&&(this.setStatus("idle"),this.app.setEditingId(t.id))}),oM(this,"onShapeBlur",()=>{this.app.readOnly||this.stopEditingShape()})}},dG=class extends dN{constructor(){super(...arguments),oM(this,"type","triangle"),oM(this,"onPointerDown",()=>{if(this.app.readOnly||"idle"!==this.status)return;let{currentPoint:e,currentGrid:t,settings:{showGrid:i},appState:{currentPageId:n,currentStyle:a}}=this.app,r=this.getNextChildIndex(),o=tI.uniqueId(),s=l4.create({id:o,parentId:n,childIndex:r,point:i?z.snap(e,t):e,style:oE({},a)});this.app.patchCreate([s]),this.app.startSession("transformSingle",s.id,tk.BottomRight,!0),this.setStatus("creating")})}},d$=tI.uniqueId(),dZ=class extends dr{constructor(e,t={}){super(dZ.defaultState,e,dZ.version,(e,t,i)=>df(o_(oE({},t),{document:o_(oE(oE({},t.document),e.document),{version:i})}),dZ.version)),oM(this,"callbacks",{}),oM(this,"tools",{select:new dW(this),erase:new dz(this),text:new dV(this),draw:new dO(this),ellipse:new dB(this),rectangle:new dH(this),triangle:new dG(this),line:new dF(this),arrow:new dR(this),sticky:new dU(this)}),oM(this,"currentTool",this.tools.select),oM(this,"session"),oM(this,"readOnly",!1),oM(this,"isDirty",!1),oM(this,"isCreating",!1),oM(this,"originPoint",[0,0]),oM(this,"currentPoint",[0,0]),oM(this,"previousPoint",[0,0]),oM(this,"shiftKey",!1),oM(this,"altKey",!1),oM(this,"metaKey",!1),oM(this,"ctrlKey",!1),oM(this,"spaceKey",!1),oM(this,"isPointing",!1),oM(this,"isForcePanning",!1),oM(this,"isPastePrevented",!1),oM(this,"editingStartTime",-1),oM(this,"fileSystemHandle",null),oM(this,"viewport",tI.getBoundsFromPoints([[0,0],[100,100]])),oM(this,"rendererBounds",tI.getBoundsFromPoints([[0,0],[100,100]])),oM(this,"selectHistory",{stack:[[]],pointer:0}),oM(this,"clipboard"),oM(this,"rotationInfo",{selectedIds:[],center:[0,0]}),oM(this,"migrate",e=>df(e,dZ.version)),oM(this,"onReady",()=>{var e,t;this.loadDocument(this.document),dx().then(e=>{this.fileSystemHandle=e});try{this.patchState(o_(oE({},df(this.state,dZ.version)),{appState:{status:"idle"}}))}catch(e){console.error("The data appears to be corrupted. Resetting!",e),localStorage.setItem(this.document.id+"_corrupted",JSON.stringify(this.document)),this.patchState(o_(oE({},dZ.defaultState),{appState:o_(oE({},dZ.defaultState.appState),{status:"idle"})}))}null==(t=(e=this.callbacks).onMount)||t.call(e,this)}),oM(this,"cleanup",(e,t)=>{var i;let n=oE({},e);n.document!==t.document&&Object.entries(n.document.pages).forEach(([e,i])=>{if(void 0===i){delete n.document.pages[e],delete n.document.pageStates[e];return}let a=t.document.pages[e],r={};if(!a||i.shapes!==a.shapes||i.bindings!==a.bindings){i.shapes=oE({},i.shapes),i.bindings=oE({},i.bindings);let t=new Set;Object.entries(i.shapes).forEach(([o,s])=>{var l;let d;s?d=s.parentId:(d=null==(l=null==a?void 0:a.shapes[o])?void 0:l.parentId,delete i.shapes[o]),i.id===n.appState.currentPageId&&(null==a?void 0:a.shapes[o])!==s&&(r[o]=s),d&&d!==e&&void 0!==i.shapes[d]&&t.add(i.shapes[d])}),Object.keys(i.bindings).forEach(e=>{i.bindings[e]||delete i.bindings[e]}),n.document.pages[e]=i;let o=s0.getRelatedBindings(n,Object.keys(r),e),s=new Set;o.forEach(t=>{if(!i.bindings[t.id])return;let a=i.shapes[t.toId],r=i.shapes[t.fromId];if(!(a&&r))return void delete n.document.pages[e].bindings[t.id];if(s.has(r))return;let o=s0.updateArrowBindings(i,r);if(s.add(r),o){let e=oE(oE({},r),o);i.shapes[r.id]=e}}),t.forEach(e=>{if(!e)throw Error("no group!");let t=e.children.filter(e=>void 0!==i.shapes[e]),n=tI.getCommonBounds(t.map(e=>i.shapes[e]).filter(Boolean).map(e=>s0.getRotatedBounds(e)));i.shapes[e.id]=o_(oE({},e),{point:[n.minX,n.minY],size:[n.width,n.height],children:t})})}let o=oE({},n.document.pageStates[e]);o.brush||delete o.brush,o.hoveredId&&!i.shapes[o.hoveredId]&&delete o.hoveredId,o.bindingId&&!i.bindings[o.bindingId]&&(s0.warn(`Could not find the binding of ${e}`),delete o.bindingId),o.editingId&&!i.shapes[o.editingId]&&(s0.warn("Could not find the editing shape!"),delete o.editingId),n.document.pageStates[e]=o}),Object.keys(null!=(i=n.document.assets)?i:{}).forEach(e=>{var t,i;(null==(t=n.document.assets)?void 0:t[e])||null==(i=n.document.assets)||delete i[e]});let a=n.appState.currentPageId,r=n.document.pageStates[a];if(n.room&&n.room!==t.room){let e=o_(oE({},n.room),{users:oE({},n.room.users)});t.room&&Object.values(t.room.users).filter(Boolean).forEach(t=>{void 0===e.users[t.id]&&delete e.users[t.id]}),n.room=e}return n.room&&(n.room.users[n.room.userId]=o_(oE({},n.room.users[n.room.userId]),{point:this.currentPoint,selectedIds:r.selectedIds})),this.readOnly&&(n.document.pages=t.document.pages),n}),oM(this,"broadcastPatch",(e,t)=>{var i,n,a,r,o,s,l,d,c;let u={},p={},h={},m=null==(a=null==(n=null==(i=null==e?void 0:e.document)?void 0:i.pages)?void 0:n[this.currentPageId])?void 0:a.shapes,g=null==(s=null==(o=null==(r=null==e?void 0:e.document)?void 0:r.pages)?void 0:o[this.currentPageId])?void 0:s.bindings,f=null==(l=null==e?void 0:e.document)?void 0:l.assets;m&&Object.keys(m).forEach(e=>{u[e]=this.getShape(e,this.currentPageId)}),g&&Object.keys(g).forEach(e=>{p[e]=this.getBinding(e,this.currentPageId)}),f&&Object.keys(f).forEach(e=>{h[e]=this.document.assets[e]}),null==(c=(d=this.callbacks).onChangePage)||c.call(d,this,u,p,h,t)}),oM(this,"onPatch",(e,t,i)=>{var n,a,r,o,s,l;(this.callbacks.onChangePage&&(null==(a=null==(n=null==t?void 0:t.document)?void 0:n.pages)?void 0:a[this.currentPageId])||(null==(r=null==t?void 0:t.document)?void 0:r.assets))&&((null==(o=null==t?void 0:t.document)?void 0:o.assets)||this.session&&"brush"!==this.session.type&&"erase"!==this.session.type&&"draw"!==this.session.type)&&this.broadcastPatch(t,!1),null==(l=(s=this.callbacks).onPatch)||l.call(s,this,t,i)}),oM(this,"onCommand",(e,t,i)=>{var n,a;this.clearSelectHistory(),this.isDirty=!0,null==(a=(n=this.callbacks).onCommand)||a.call(n,this,t,i)}),oM(this,"onReplace",()=>{this.clearSelectHistory(),this.isDirty=!1}),oM(this,"onUndo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],null==(t=(e=this.callbacks).onUndo)||t.call(e,this)}),oM(this,"onRedo",()=>{var e,t;this.rotationInfo.selectedIds=[...this.selectedIds],null==(t=(e=this.callbacks).onRedo)||t.call(e,this)}),oM(this,"onPersist",(e,t)=>{var i,n;null==(n=(i=this.callbacks).onPersist)||n.call(i,this),this.broadcastPatch(t,!0)}),oM(this,"prevSelectedIds",this.selectedIds),oM(this,"onStateDidChange",(e,t)=>{var i,n,a,r;null==(n=(i=this.callbacks).onChange)||n.call(i,this,t),this.room&&this.selectedIds!==this.prevSelectedIds&&(null==(r=(a=this.callbacks).onChangePresence)||r.call(a,this,o_(oE({},this.room.users[this.room.userId]),{selectedIds:this.selectedIds,session:!!this.session})),this.prevSelectedIds=this.selectedIds)}),oM(this,"preventPaste",()=>{if(this.isPastePrevented)return;let e=e=>e.stopImmediatePropagation(),t=()=>{setTimeout(()=>{document.removeEventListener("paste",e,{capture:!0}),this.isPastePrevented=!1},50)};document.addEventListener("paste",e,{capture:!0}),window.addEventListener("pointerup",t,{once:!0}),this.isPastePrevented=!0}),oM(this,"justSent",!1),oM(this,"getReservedContent",(e,t=this.currentPageId)=>{let{bindings:i}=this.document.pages[t],n={},a={},r=Object.values(i),o=[new Map(r.map(e=>[e.toId,e])),new Map(r.map(e=>[e.fromId,e]))],s=[];this.session&&e.forEach(e=>s.push(e)),this.pageState.editingId&&s.push(this.pageState.editingId);let l=new Set(s),d=new Set;for(;s.length>0;){let e=s.pop();if(!e)break;if(d.has(e))continue;d.add(e);let i=this.getShape(e);n[e]=i,i.parentId!==t&&s.push(i.parentId),i.children&&s.push(...i.children),o.map(e=>e.get(i.id)).filter(Boolean).forEach(e=>{a[e.id]=e,s.push(e.toId,e.fromId)})}return{reservedShapes:n,reservedBindings:a,strongReservedShapeIds:l}}),oM(this,"replacePageContent",(e,t,i,n=this.currentPageId)=>{if(this.justSent)return this.justSent=!1,this;let a=this.document.pages[this.currentPageId];return Object.values(e).forEach(t=>{t.parentId===n||a.shapes[t.parentId]||e[t.parentId]||(console.warn("Added a shape without a parent on the page"),t.parentId=n)}),this.useStore.setState(a=>{let{hoveredId:r,editingId:o,bindingId:s,selectedIds:l}=a.document.pageStates[n],d=[...l],c=o&&a.document.pages[this.currentPageId].shapes[o];c&&d.push(c.id);let{reservedShapes:u,reservedBindings:p,strongReservedShapeIds:h}=this.getReservedContent(d,this.currentPageId);Object.values(u).filter(e=>!("text"in e)).forEach(t=>{let i=e[t.id];if(i){if(!("arrow"===t.type||h.has(t.id))){e[t.id]=i;return}"decorations"in i&&"decorations"in t&&(e[t.id]=o_(oE({},t),{decorations:i.decorations})),t.style=i.style}});let m=oE(oE({},e),u);c&&(m[c.id]=c);let g=oE(oE({},t),p),f=oE({},i),b=o_(oE({},a),{document:o_(oE({},a.document),{pages:{[n]:o_(oE({},a.document.pages[n]),{shapes:m,bindings:g})},assets:f,pageStates:o_(oE({},a.document.pageStates),{[n]:o_(oE({},a.document.pageStates[n]),{selectedIds:l.filter(e=>void 0!==m[e]),hoveredId:r?void 0===m[r]?void 0:r:void 0,editingId:o,bindingId:s?void 0===g[s]?void 0:s:void 0})})})}),x=b.document.pages[n],y=s0.getRelatedBindings(b,Object.keys(m),n),v=new Set;return y.forEach(e=>{if(!x.bindings[e.id])return;let t=x.shapes[e.fromId];if(v.has(t))return;let i=s0.updateArrowBindings(x,t);if(v.add(t),i){let e=oE(oE({},t),i);x.shapes[t.id]=e}}),Object.values(m).forEach(e=>{if("group"!==e.type)return;let t=e.children.filter(e=>void 0!==x.shapes[e]),i=tI.getCommonBounds(t.map(e=>x.shapes[e]).filter(Boolean).map(e=>s0.getRotatedBounds(e)));x.shapes[e.id]=o_(oE({},e),{point:[i.minX,i.minY],size:[i.width,i.height],children:t})}),this.state.document=b.document,b},!0),this}),oM(this,"updateBounds",e=>{this.rendererBounds=e;let{point:t,zoom:i}=this.camera;this.updateViewport(t,i),!this.readOnly&&this.session&&this.session.update()}),oM(this,"updateViewport",(e,t)=>{let{width:i,height:n}=this.rendererBounds,[a,r]=z.sub(z.div([0,0],t),e),[o,s]=z.sub(z.div([i,n],t),e);this.viewport={minX:a,minY:r,maxX:o,maxY:s,height:o-a,width:s-r}}),oM(this,"setEditingId",(e,t=!1)=>{if(!this.readOnly){if(e)this.startSession("edit",e,t);else{if(!this.pageState.editingId)return;this.completeSession()}this.editingStartTime=performance.now(),this.patchState({document:{pageStates:{[this.currentPageId]:{editingId:e}}}},"set_editing_id")}}),oM(this,"setHoveredId",e=>{this.patchState({document:{pageStates:{[this.currentPageId]:{hoveredId:e}}}},"set_hovered_id")}),oM(this,"setSetting",(e,t)=>{if(this.session)return this;let i={settings:{[e]:"function"==typeof t?t(this.settings[e]):t}};return this.patchState(i,`settings:${e}`),this.persist(i),this}),oM(this,"toggleFocusMode",()=>{if(this.session)return this;let e={settings:{isFocusMode:!this.settings.isFocusMode}};return this.patchState(e,"settings:toggled_focus_mode"),this.persist(e),this}),oM(this,"togglePenMode",()=>{if(this.session)return this;let e={settings:{isPenMode:!this.settings.isPenMode}};return this.patchState(e,"settings:toggled_pen_mode"),this.persist(e),this}),oM(this,"toggleDarkMode",()=>{if(this.session)return this;let e={settings:{isDarkMode:!this.settings.isDarkMode}};return this.patchState(e,"settings:toggled_dark_mode"),this.persist(e),this}),oM(this,"toggleZoomSnap",()=>{if(this.session)return this;let e={settings:{isZoomSnap:!this.settings.isZoomSnap}};return this.patchState(e,"settings:toggled_zoom_snap"),this.persist(e),this}),oM(this,"toggleDebugMode",()=>{if(this.session)return this;let e={settings:{isDebugMode:!this.settings.isDebugMode}};return this.patchState(e,"settings:toggled_debug"),this.persist(e),this}),oM(this,"setMenuOpen",e=>{let t={appState:{isMenuOpen:e}};return this.patchState(t,"ui:toggled_menu_opened"),this.persist(t),this}),oM(this,"setIsLoading",e=>{let t={appState:{isLoading:e}};return this.patchState(t,"ui:toggled_is_loading"),this.persist(t),this}),oM(this,"setDisableAssets",e=>(this.patchState({appState:{disableAssets:e}},"ui:toggled_disable_images"),this)),oM(this,"toggleGrid",()=>{if(this.session)return this;let e={settings:{showGrid:!this.settings.showGrid}};return this.patchState(e,"settings:toggled_grid"),this.persist(e),this}),oM(this,"selectTool",e=>{if(this.readOnly||this.session)return this;this.isPointing=!1;let t=this.tools[e];return t===this.currentTool?(this.patchState({appState:{isToolLocked:!1}}),this):(this.currentTool.onExit(),t.previous=this.currentTool.type,this.currentTool=t,this.currentTool.onEnter(),this.patchState({appState:{activeTool:e,isToolLocked:!1}},`selected_tool:${e}`))}),oM(this,"toggleToolLock",()=>this.session?this:this.patchState({appState:{isToolLocked:!this.appState.isToolLocked}},"toggled_tool_lock")),oM(this,"resetDocument",()=>(this.session||(this.session=void 0,this.currentTool=this.tools.select,dZ.defaultDocument.pages.page.name="Page 1",this.resetHistory().clearSelectHistory().loadDocument(dZ.defaultDocument).persist({})),this)),oM(this,"updateUsers",(e,t=!1)=>{this.patchState({room:{users:Object.fromEntries(e.map(e=>[e.id,e]))}},t?"room:self:update":"room:user:update")}),oM(this,"removeUser",e=>{this.patchState({room:{users:{[e]:void 0}}})}),oM(this,"mergeDocument",e=>{if(this.document.id!==e.id)return this.replaceState(o_(oE({},df(o_(oE({},this.state),{document:e}),dZ.version)),{appState:o_(oE({},this.appState),{currentPageId:Object.keys(e.pages)[0]})})),this;let t=oE({},this.document.pageStates),i=o_(oE({},this.appState),{currentPageId:e.pages[this.currentPageId]?this.currentPageId:Object.keys(e.pages)[0],pages:Object.values(e.pages).map((e,t)=>({id:e.id,name:e.name,childIndex:e.childIndex||t}))});this.resetHistory(),Object.keys(this.document.pages).forEach(i=>{e.pages[i]||(i===this.appState.currentPageId&&(this.cancelSession(),this.selectNone()),t[i]=void 0)}),this.session&&this.selectedIds.filter(t=>!e.pages[this.currentPageId].shapes[t]).forEach(t=>e.pages[this.currentPageId].shapes[t]=this.page.shapes[t]),Object.entries(t).forEach(([t,i])=>{i.selectedIds=i.selectedIds.filter(i=>!!e.pages[t].shapes[i])});let{editingId:n}=this.pageState;return n&&(e.pages[this.currentPageId].shapes[n]=this.page.shapes[n],t[this.currentPageId].selectedIds=[n]),this.replaceState(o_(oE({},df(o_(oE({},this.state),{document:o_(oE({},e),{pageStates:t})}),dZ.version)),{appState:i}),"merge")}),oM(this,"updateDocument",(e,t="updated_document")=>{let i=this.state,n=o_(oE({},i),{document:o_(oE({},i.document),{assets:e.assets})});e.pages[this.currentPageId]||(n.appState=o_(oE({},i.appState),{currentPageId:Object.keys(e.pages)[0]}));let a=1;for(let t of Object.values(e.pages))t!==i.document.pages[t.id]&&(n.document.pages[t.id]=t,t.name||(n.document.pages[t.id].name=`Page ${a+1}`,a++));for(let t of Object.values(e.pageStates))if(t!==i.document.pageStates[t.id]){n.document.pageStates[t.id]=t;let i=e.pages[t.id];for(let e of["bindingId","editingId","hoveredId","pointedId"])i.shapes[e]||(t[e]=void 0);t.selectedIds=t.selectedIds.filter(t=>!!e.pages[i.id].shapes[t])}return this.replaceState(df(n,n.document.version||0),`${t}:${e.id}`)}),oM(this,"loadRoom",e=>(this.patchState({room:{id:e,userId:d$,users:{[d$]:{id:d$,color:so[Math.floor(Math.random()*so.length)],point:[100,100],selectedIds:[],activeShapes:[]}}}}),this)),oM(this,"loadDocument",e=>{this.setIsLoading(!0),this.selectNone(),this.resetHistory(),this.clearSelectHistory(),this.session=void 0;let t=o_(oE({},dZ.defaultState),{settings:oE({},this.state.settings),document:e,appState:o_(oE(oE({},dZ.defaultState.appState),this.state.appState),{currentPageId:Object.keys(e.pages)[0],disableAssets:this.disableAssets})});this.replaceState(df(t,dZ.version),"loaded_document");let{point:i,zoom:n}=this.camera;return this.updateViewport(i,n),this.setIsLoading(!1),this}),oM(this,"loadPageFromURL",(e,t)=>{let i=e.id,n=o_(oE({},this.state.document),{pageStates:o_(oE({},this.state.document.pageStates),{[i]:t}),pages:o_(oE({},this.document.pages),{[i]:e})});this.loadDocument(n),this.persist({})}),oM(this,"newProject",()=>{this.isLocal&&(this.fileSystemHandle=null,this.resetDocument())}),oM(this,"saveProject",()=>oT(this,null,function*(){if(this.readOnly)return;let e=yield dv(df(this.state,dZ.version).document,this.fileSystemHandle);return this.fileSystemHandle=e,this.persist({}),this.isDirty=!1,this})),oM(this,"saveProjectAs",e=>oT(this,null,function*(){try{let t=yield dv(this.document,null,e);this.fileSystemHandle=t,this.persist({}),this.isDirty=!1}catch(e){console.error(e.message)}return this})),oM(this,"openProject",()=>oT(this,null,function*(){if(this.isLocal)try{let e=yield dC();if(!e)throw Error();let{fileHandle:t,document:i}=e;this.loadDocument(i),this.fileSystemHandle=t,this.zoomToFit(),this.persist({})}catch(e){console.error(e)}finally{this.persist({})}})),oM(this,"openAsset",()=>oT(this,null,function*(){if(!this.disableAssets)try{let e=yield dw();if(Array.isArray(e))this.addMediaFromFiles(e,this.centerPoint);else{if(!e)return;this.addMediaFromFiles([e])}}catch(e){console.error(e)}finally{this.persist({})}})),oM(this,"signOut",()=>{}),oM(this,"getAppState",()=>this.appState),oM(this,"getPage",(e=this.currentPageId)=>s0.getPage(this.state,e||this.currentPageId)),oM(this,"getShapes",(e=this.currentPageId)=>s0.getShapes(this.state,e||this.currentPageId)),oM(this,"getBindings",(e=this.currentPageId)=>s0.getBindings(this.state,e||this.currentPageId)),oM(this,"getShape",(e,t=this.currentPageId)=>s0.getShape(this.state,e,t)),oM(this,"getShapeBounds",(e,t=this.currentPageId)=>s0.getBounds(this.getShape(e,t))),oM(this,"getBinding",(e,t=this.currentPageId)=>s0.getBinding(this.state,e,t)),oM(this,"getPageState",(e=this.currentPageId)=>s0.getPageState(this.state,e||this.currentPageId)),oM(this,"getPagePoint",(e,t=this.currentPageId)=>{let{camera:i}=this.getPageState(t);return z.sub(z.div(e,i.zoom),i.point)}),oM(this,"createPage",(e,t)=>{if(this.readOnly)return this;let{width:i,height:n}=this.rendererBounds;return this.setState(function(e,t,i=tI.uniqueId(),n="Page"){let{currentPageId:a}=e,r=Object.values(e.state.document.pages).sort((e,t)=>{var i,n;return(null!=(i=e.childIndex)?i:0)-(null!=(n=t.childIndex)?n:0)}),o=r[r.length-1],s=(null==o?void 0:o.childIndex)?(null==o?void 0:o.childIndex)+1:1,l={id:i,name:function(e,t){var i;let n=e,a=new Set(t);for(;a.has(n);)n=(null==(i=/^.*(\d+)$/.exec(n))?void 0:i[1])?n.replace(/(\d+)(?=\D?)$/,e=>(+e+1).toString()):`${n} 1`;return n}(n,r.map(e=>{var t;return null!=(t=e.name)?t:""})),childIndex:s,shapes:{},bindings:{}};return{id:"create_page",before:{appState:{currentPageId:a},document:{pages:{[i]:void 0},pageStates:{[i]:void 0}}},after:{appState:{currentPageId:l.id},document:{pages:{[i]:l},pageStates:{[i]:{id:i,selectedIds:[],camera:{point:t,zoom:1},editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0}}}}}}(this,[-i/2,-n/2],e,t))}),oM(this,"changePage",e=>this.setState({id:"change_page",before:{appState:{currentPageId:this.currentPageId}},after:{appState:{currentPageId:e}}})),oM(this,"movePage",(e,t)=>this.readOnly?this:this.setState(function(e,t,i){let{pages:n}=e.document,a=n[t],r=Object.values(n).sort((e,t)=>{var i,n;return(null!=(i=e.childIndex)?i:0)-(null!=(n=t.childIndex)?n:0)}),o=r.indexOf(a),s=[...r];return s.splice(o,1),s.splice(i>o?i-1:i,0,a),{id:"move_page",before:{document:{pages:Object.fromEntries(r.map(e=>[e.id,{childIndex:e.childIndex}]))}},after:{document:{pages:Object.fromEntries(s.map((e,t)=>[e.id,{childIndex:t}]))}}}}(this,e,t))),oM(this,"renamePage",(e,t)=>this.readOnly?this:this.setState(function(e,t,i){let{page:n}=e;return{id:"rename_page",before:{document:{pages:{[t]:{name:n.name}}}},after:{document:{pages:{[t]:{name:i}}}}}}(this,e,t))),oM(this,"duplicatePage",e=>this.readOnly?this:this.setState(function(e,t){let{currentPageId:i,pageState:{camera:n}}=e,a=e.document.pages[t],r=tI.uniqueId(),o=o_(oE({},a),{id:r,name:a.name+" Copy",shapes:Object.fromEntries(Object.entries(a.shapes).map(([e,t])=>[e,o_(oE({},t),{parentId:t.parentId===a.id?r:t.parentId})]))});return{id:"duplicate_page",before:{appState:{currentPageId:i},document:{pages:{[r]:void 0},pageStates:{[r]:void 0}}},after:{appState:{currentPageId:r},document:{pages:{[r]:o},pageStates:{[r]:o_(oE({},a),{id:r,selectedIds:[],camera:oE({},n),editingId:void 0,bindingId:void 0,hoveredId:void 0,pointedId:void 0})}}}}}(this,e))),oM(this,"deletePage",e=>this.readOnly||Object.values(this.document.pages).length<=1?this:this.setState(function(e,t){let{currentPageId:i,document:{pages:n,pageStates:a}}=e,r=Object.values(n).sort((e,t)=>(e.childIndex||0)-(t.childIndex||0)),o=r.findIndex(e=>e.id===t),s;return s=t===i?o===r.length-1?r[r.length-2].id:r[o+1].id:i,{id:"delete_page",before:{appState:{currentPageId:t},document:{pages:{[t]:oE({},n[t])},pageStates:{[t]:oE({},a[t])}}},after:{appState:{currentPageId:s},document:{pages:{[t]:void 0},pageStates:{[t]:void 0}}}}}(this,e||this.currentPageId))),oM(this,"cut",(e=this.selectedIds,t)=>(null==t||t.preventDefault(),this.copy(e,t),this.readOnly||this.delete(e),this)),oM(this,"copy",(e=this.selectedIds,t)=>{var i;null==t||t.preventDefault(),this.clipboard=this.getContent(e);let n=`${JSON.stringify(oE({type:"tldr/clipboard"},this.clipboard))}`;return function(e){oT(this,null,function*(){return rJ(da,e)})}(n),t&&(null==(i=t.clipboardData)||i.setData("text/html",n)),navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:"text/html"})})]),this}),oM(this,"paste",(e,t)=>oT(this,null,function*(){var i,n;if(this.readOnly)return;let a=[],r=[],o,s=e=>oT(this,null,function*(){let t=document.createElement("div");t.innerHTML=e;let i=t.firstChild;i.style.setProperty("background-color","transparent");let n=yield s0.getImageForSvg(i,"svg",{scale:1,quality:1});if(n){let e=new File([n],"image.svg");a.push(e)}else l(e)}),l=t=>{let i=this.getPagePoint(null!=e?e:this.centerPoint,this.currentPageId),n=t.includes(` `);r.push(s0.getShapeUtil("text").getShape({id:tI.uniqueId(),type:"text",parentId:this.appState.currentPageId,text:s0.normalizeText(t.trim()),point:i,style:o_(oE({},this.appState.currentStyle),{textAlign:n?"start":this.appState.currentStyle.textAlign})}))},d=e=>{var t;try{let i=null==(t=e.match(/(.*)<\/tldraw>/))?void 0:t[1];if(!i)return;let n=JSON.parse(i);if("tldr/clipboard"===n.type){o=n;return}throw Error("Not tldraw data!")}catch(t){l(e)}};if(void 0!==t){let e=Array.from(null!=(n=null==(i=t.clipboardData)?void 0:i.items)?n:[]);yield Promise.all(e.map(e=>oT(this,null,function*(){var t;let{type:i,kind:n}=e;switch(n){case"string":{let n=yield new Promise(t=>e.getAsString(t));switch(i){case"text/html":if(null==(t=n.match(/(.*)<\/tldraw>/))?void 0:t[1])return void d(n);break;case"text/plain":n.startsWith("{let n=s0.getBounds(e);0===t&&(i[0]-=n.width/2,i[1]-=n.height/2),e.point=[...i],i[0]+=n.width}),this.createShapes(...r),this}return this.clipboard?this.insertContent(this.clipboard):(function(){return oT(this,null,function*(){return rQ(da)})})().then(e=>{e&&d(e)}),this})),oM(this,"getSvg",(...e)=>oT(this,[...e],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes),t={}){if(0===e.length)return;let i=document.createElementNS("http://www.w3.org/2000/svg","svg"),n=document.createElementNS("http://www.w3.org/2000/svg","defs"),a=document.createElementNS("http://www.w3.org/2000/svg","style");if("u">typeof window&&window.focus(),t.includeFonts)try{let{fonts:e}=yield fetch(dZ.assetSrc,{mode:"no-cors"}).then(e=>e.json());a.textContent=` @font-face { font-family: 'Caveat Brush'; src: url(data:application/x-font-woff;charset=utf-8;base64,${e.caveat}) format('woff'); font-weight: 500; font-style: normal; } @font-face { font-family: 'Source Code Pro'; src: url(data:application/x-font-woff;charset=utf-8;base64,${e.source_code_pro}) format('woff'); font-weight: 500; font-style: normal; } @font-face { font-family: 'Source Sans Pro'; src: url(data:application/x-font-woff;charset=utf-8;base64,${e.source_sans_pro}) format('woff'); font-weight: 500; font-style: normal; } @font-face { font-family: 'Crimson Pro'; src: url(data:application/x-font-woff;charset=utf-8;base64,${e.crimson_pro}) format('woff'); font-weight: 500; font-style: normal; } `}catch(e){s0.warn("Could not find tldraw-assets.json file.")}else a.textContent="@import url('https://fonts.googleapis.com/css2?family=Caveat+Brush&family=Source+Code+Pro&family=Source+Sans+Pro&family=Crimson+Pro&display=block');";n.append(a),i.append(n);let r=e.map(e=>this.getShape(e,this.currentPageId)).sort((e,t)=>e.childIndex-t.childIndex),o=tI.getCommonBounds(r.map(s0.getRotatedBounds)),s=t.padding||16,l=e=>{let t=s0.getShapeUtil(e),i=t.getBounds(e),n=t.getSvgElement(e,this.settings.isDarkMode);if(n)return"image"===e.type?n.setAttribute("xlink:href",this.document.assets[e.assetId].src):"video"===e.type&&n.setAttribute("xlink:href",this.serializeVideo(e.id)),n.setAttribute("transform",`translate(${(s+e.point[0]-o.minX).toFixed(2)}, ${(s+e.point[1]-o.minY).toFixed(2)}) rotate(${(180*(e.rotation||0)/Math.PI).toFixed(2)}, ${(i.width/2).toFixed(2)}, ${(i.height/2).toFixed(2)})`),n};r.forEach(e=>{var t;if(null==(t=e.children)?void 0:t.length){let t=document.createElementNS("http://www.w3.org/2000/svg","g");e.children.forEach(e=>{let i=l(this.getShape(e,this.currentPageId));i&&t.append(i)}),i.append(t);return}let n=l(e);n&&i.append(n)}),i.setAttribute("viewBox",["0 0",o.width+2*s,o.height+2*s].join(" ")),i.setAttribute("width",(o.width+2*s).toString()),i.setAttribute("height",(o.height+2*s).toString());let d=this.settings.exportBackground,c="#212529",u="rgb(248, 249, 250)";switch(d){case"auto":i.style.setProperty("background-color",this.settings.isDarkMode?c:u);break;case"dark":i.style.setProperty("background-color",c);break;case"light":i.style.setProperty("background-color",u);break;default:i.style.setProperty("background-color","transparent")}return i.querySelectorAll(".tl-fill-hitarea, .tl-stroke-hitarea, .tl-binding-indicator").forEach(e=>e.remove()),i})),oM(this,"copySvg",(...e)=>oT(this,[...e],function*(e=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)){if(0===e.length)return;let t=yield this.getSvg(e);if(!t)return;let i=s0.getSvgString(t,1);this.clipboard=this.getContent(e);let n=JSON.stringify(oE({type:"tldr/clipboard"},this.clipboard));return navigator.clipboard&&window.ClipboardItem&&navigator.clipboard.write([new ClipboardItem({"text/html":new Blob([n],{type:"text/html"}),"text/plain":new Blob([i],{type:"text/plain"})})]),i})),oM(this,"getContent",e=>{let t=this.getPage(this.currentPageId);if(e&&0===e.length||(e||(e=this.selectedIds),0===e.length&&(e=Object.keys(t.shapes)),0===e.length))return;let i=e.map(e=>t.shapes[e]).flatMap(e=>{var i;return[e,...(null!=(i=e.children)?i:[]).map(e=>t.shapes[e])]}).map(sY),n=new Set(i.map(e=>e.id));i.forEach(e=>{e.parentId===this.currentPageId&&(e.parentId="currentPageId")});let a=Object.values(t.bindings).filter(e=>{if(n.has(e.fromId)||n.has(e.toId))return!0;if(n.has(e.fromId)){let t=i.find(t=>t.id===e.fromId).handles;t&&Object.values(t).forEach(t=>{t.bindingId===e.id&&(t.bindingId=void 0)})}if(n.has(e.toId)){let t=i.find(t=>t.id===e.toId).handles;t&&Object.values(t).forEach(t=>{t.bindingId===e.id&&(t.bindingId=void 0)})}return!1}).map(sY),r=[...new Set(i.map(e=>{if(e.assetId)return this.document.assets[e.assetId]}).filter(Boolean).map(sY))];return{shapes:i,bindings:a,assets:r}}),oM(this,"copyJson",(e=this.selectedIds)=>{let t=this.getContent(e);return t&&s0.copyStringToClipboard(JSON.stringify(t)),this}),oM(this,"exportJson",(e=this.selectedIds)=>{let t=this.getContent(e);if(t){let e=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(e),n=document.createElement("a");n.href=i,n.download="export.json",n.click()}return this}),oM(this,"insertContent",(e,t={})=>this.setState(function(e,t,i={}){let{currentPageId:n}=e,{point:a,select:r,overwrite:o}=i,s=e.document.pages[n],l={shapes:{},bindings:{}},d={},c={shapes:{},bindings:{}};if(o){for(let e of t.shapes)l.shapes[e.id]=s.shapes[e.id],c.shapes[e.id]=e;if(t.bindings)for(let e of t.bindings)l.bindings[e.id]=s.bindings[e.id],c.bindings[e.id]=e;if(t.assets)for(let e of t.assets)d[e.id]=e}else{let i={},r=s0.getTopChildIndex(e.state,n),o=t.shapes.sort((e,t)=>e.childIndex-t.childIndex).map(e=>{let t=tI.uniqueId();return i[e.id]=t,o_(oE({},tI.deepClone(e)),{id:t})}),s=new Set;for(;o.length>0;){let e=o.shift();if(!e)break;if(s.add(e.id),"currentPageId"===e.parentId)e.parentId=n,e.childIndex=r++;else{e.parentId=i[e.parentId];let t=c.shapes[e.parentId];if(!t){s.has(e.id)&&(e.parentId="currentPageId"),o.push(e);continue}t.children.push(e.id)}e.children&&(e.children=[]),l.shapes[e.id]=void 0,c.shapes[e.id]=e}Object.values(c.shapes).forEach(e=>{e.children&&0===e.children.length&&(delete l.shapes[e.id],delete c.shapes[e.id])}),t.bindings&&t.bindings.forEach(e=>{let t=tI.uniqueId();i[e.id]=t;let n=i[e.toId],a=i[e.fromId];if(!n||!a){if(a){let t=c.shapes[a].handles;t&&Object.values(t).forEach(t=>{t.bindingId===e.id&&(t.bindingId=void 0)})}if(n){let t=c.shapes[n].handles;t&&Object.values(t).forEach(t=>{t.bindingId===e.id&&(t.bindingId=void 0)})}return}let r=c.shapes[a].handles;r&&Object.values(r).forEach(i=>{i.bindingId===e.id&&(i.bindingId=t)}),c.shapes[n].handles&&Object.values(c.shapes[n].handles).forEach(i=>{i.bindingId===e.id&&(i.bindingId=t)});let o=o_(oE({},tI.deepClone(e)),{id:t,toId:n,fromId:a});l.bindings[o.id]=void 0,c.bindings[o.id]=o});let u=Object.values(c.shapes);if(u.length>0)if(a){let e=tI.getCommonBounds(u.map(e=>s0.getBounds(e))),t=tI.getBoundsCenter(e);u.forEach(e=>{e.point&&(e.point=z.sub(a,z.sub(t,e.point)))})}else{let t=tI.getCommonBounds(u.map(s0.getBounds));if(!(tI.boundsContain(e.viewport,t)||tI.boundsCollide(e.viewport,t))){let i=z.toFixed(e.getPagePoint(e.centerPoint)),n=tI.centerBounds(t,i),a=z.sub(tI.getBoundsCenter(n),tI.getBoundsCenter(t));u.forEach(e=>{e.point=z.toFixed(z.add(e.point,a))})}}if(t.assets)for(let e of t.assets)d[e.id]=e}let u=document.createElement("textarea");return Object.values(c.shapes).forEach(e=>{"text"in e&&(u.innerHTML=e.text,e.text=u.value),"label"in e&&(u.innerHTML=e.label,e.label=u.value)}),u.remove(),{id:"insert",before:{document:{pages:{[n]:l},pageStates:{[n]:{selectedIds:[...e.selectedIds]}}}},after:{document:{pages:{[n]:c},assets:d,pageStates:{[n]:{selectedIds:r?Object.keys(c.shapes):[...e.selectedIds]}}}}}}(this,e,t),"insert_content")),oM(this,"getImage",(...e)=>oT(this,[...e],function*(e="png",t={}){let{ids:i=this.selectedIds.length?this.selectedIds:Object.keys(this.page.shapes)}=t,n=yield this.getSvg(i,{includeFonts:"svg"!==e});if(!n)return;if("svg"===e)return new Blob([s0.getSvgString(n,1)],{type:"image/svg+xml"});let a=yield s0.getImageForSvg(n,e,t);if(a)return a})),oM(this,"copyImage",(...e)=>oT(this,[...e],function*(e="png",t={}){if("svg"===e)return void this.copySvg(t.ids);if(!(navigator.clipboard&&window.ClipboardItem))return void console.warn("Sorry, your browser does not support copying images.");let i=yield this.getImage(e,t);i&&navigator.clipboard.write([new ClipboardItem({[i.type]:i})])})),oM(this,"exportImage",(...e)=>oT(this,[...e],function*(e="png",t={}){var i;let{pageId:n=this.currentPageId}=t,a=yield this.getImage(e,t);if(!a)return;let r=null!=(i=this.document.pages[n].name)?i:"export";if(this.callbacks.onExport)this.callbacks.onExport(this,{name:r,type:e,blob:a});else{let t=URL.createObjectURL(a),i=document.createElement("a");i.href=t,i.download=`${r}.${e}`,i.click()}})),oM(this,"setCamera",(e,t,i)=>(this.updateViewport(e,t),this.patchState({document:{pageStates:{[this.currentPageId]:{camera:{point:e,zoom:t}}}}},i),this)),oM(this,"resetCamera",()=>this.setCamera(this.centerPoint,1,"reset_camera")),oM(this,"pan",e=>{let{camera:t}=this.pageState;return this.setCamera(z.toFixed(z.sub(t.point,e)),t.zoom,"panned")}),oM(this,"pinchZoom",(e,t,i)=>{let{camera:n}=this.pageState,a=z.sub(n.point,z.div(t,n.zoom)),r=z.sub(z.div(e,n.zoom),a),o=z.sub(z.div(e,i),a);return this.setCamera(z.toFixed(z.add(a,z.sub(o,r))),i,"pinch_zoomed")}),oM(this,"zoomTo",(e,t=this.centerPoint)=>{let{zoom:i,point:n}=this.camera,a=z.sub(z.div(t,i),n),r=z.sub(z.div(t,e),n);return this.setCamera(z.toFixed(z.add(n,z.sub(r,a))),e,"zoomed_camera")}),oM(this,"zoomIn",()=>{let e=Math.round(100*this.camera.zoom/25),t=s0.getCameraZoom((e+1)*.25);return this.zoomTo(t)}),oM(this,"zoomOut",()=>{let e=Math.round(100*this.camera.zoom/25),t=s0.getCameraZoom((e-1)*.25);return this.zoomTo(t)}),oM(this,"zoomToFit",()=>{let{shapes:e,pageState:{camera:t}}=this;if(0===e.length)return this;let{rendererBounds:i}=this,n=tI.getCommonBounds(e.map(s0.getBounds)),a=s0.getCameraZoom(Math.min((i.width-128)/n.width,(i.height-128)/n.height));a=t.zoom===a||t.zoom<1?Math.min(1,a):a;let r=(i.width-n.width*a)/2/a,o=(i.height-n.height*a)/2/a;return this.setCamera(z.toFixed(z.sub([r,o],[n.minX,n.minY])),a,"zoomed_to_fit")}),oM(this,"zoomToSelection",()=>{if(0===this.selectedIds.length)return this;let{rendererBounds:e}=this,t=s0.getSelectedBounds(this.state),i=s0.getCameraZoom(Math.min((e.width-128)/t.width,(e.height-128)/t.height));i=this.camera.zoom===i||this.camera.zoom<1?Math.min(1,i):i;let n=(e.width-t.width*i)/2/i,a=(e.height-t.height*i)/2/i;return this.setCamera(z.toFixed(z.sub([n,a],[t.minX,t.minY])),i,"zoomed_to_selection")}),oM(this,"zoomToContent",()=>{let e=this.shapes,t=this.pageState;if(0===e.length)return this;let{rendererBounds:i}=this,{zoom:n}=t.camera,a=tI.getCommonBounds(e.map(s0.getBounds)),r=(i.width-a.width*n)/2/n,o=(i.height-a.height*n)/2/n;return this.setCamera(z.toFixed(z.sub([r,o],[a.minX,a.minY])),this.camera.zoom,"zoomed_to_content")}),oM(this,"resetZoom",()=>this.zoomTo(1)),oM(this,"zoomBy",tI.throttle((e,t)=>{let{zoom:i}=this.camera,n=s0.getCameraZoom(i-e*i);return this.zoomTo(n,t)},16)),oM(this,"clearSelectHistory",()=>(this.selectHistory.pointer=0,this.selectHistory.stack=[this.selectedIds],this)),oM(this,"addToSelectHistory",e=>(this.selectHistory.pointer{let i=t?[...this.pageState.selectedIds,...e]:[...e];return this.patchState({appState:{activeTool:"select"},document:{pageStates:{[this.currentPageId]:{selectedIds:i}}}},"selected")}),oM(this,"undoSelect",()=>(this.selectHistory.pointer>0&&(this.selectHistory.pointer--,this.setSelectedIds(this.selectHistory.stack[this.selectHistory.pointer])),this)),oM(this,"redoSelect",()=>(this.selectHistory.pointer(e.forEach(e=>{if(!this.page.shapes[e])throw Error(`That shape does not exist on page ${this.currentPageId}`)}),this.setSelectedIds(e),this.addToSelectHistory(e),this)),oM(this,"selectAll",(e=this.currentPageId)=>(this.session||(this.setSelectedIds(Object.values(this.document.pages[e].shapes).filter(t=>t.parentId===e).map(e=>e.id)),this.addToSelectHistory(this.selectedIds),this.selectTool("select")),this)),oM(this,"selectNone",()=>(this.setSelectedIds([]),this.addToSelectHistory(this.selectedIds),this)),oM(this,"startSession",(e,...t)=>{var i,n;if(this.readOnly&&"brush"!==e)return this;this.session&&(s0.warn(`Already in a session! (${this.session.constructor.name})`),this.cancelSession());let a=dD[e];this.session=new a(this,...t);let r=this.session.start();return r&&this.patchState(r,`session:start_${this.session.constructor.name}`),null==(n=(i=this.callbacks).onSessionStart)||n.call(i,this,this.session.constructor.name),this}),oM(this,"updateSession",()=>{let{session:e}=this;if(!e)return this;let t=e.update();return t?this.patchState(t,`session:${null==e?void 0:e.constructor.name}`):this}),oM(this,"cancelSession",()=>{var e,t;let{session:i}=this;if(!i)return this;this.session=void 0;let n=i.cancel();return n&&this.patchState(n,`session:cancel:${i.constructor.name}`),this.setEditingId(),null==(t=(e=this.callbacks).onSessionEnd)||t.call(e,this,i.constructor.name),this}),oM(this,"completeSession",()=>{var e,t,i,n,a,r,o,s,l;let{session:d}=this;if(!d)return this;this.session=void 0;let c=d.complete();return void 0===c?(this.isCreating=!1,this.patchState({appState:{status:"idle"},document:{pageStates:{[this.currentPageId]:{editingId:void 0,bindingId:void 0,hoveredId:void 0}}}},`session:complete:${d.constructor.name}`)):"after"in c?(this.isCreating&&(c.before={appState:o_(oE({},c.before.appState),{status:"idle"}),document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(this.selectedIds.map(e=>[e,void 0]))}},pageStates:{[this.currentPageId]:{selectedIds:[],editingId:null,bindingId:null,hoveredId:null}}}},this.appState.isToolLocked&&(((null==(i=null==(t=null==(e=c.after)?void 0:e.document)?void 0:t.pageStates)?void 0:i[this.currentPageId])||{}).selectedIds=[]),this.isCreating=!1),c.after.appState=o_(oE({},c.after.appState),{status:"idle"}),c.after.document=o_(oE({},c.after.document),{pageStates:o_(oE({},null==(n=c.after.document)?void 0:n.pageStates),{[this.currentPageId]:o_(oE({},((null==(a=c.after.document)?void 0:a.pageStates)||{})[this.currentPageId]),{editingId:null})})}),this.setState(c,`session:complete:${d.constructor.name}`)):this.patchState(o_(oE({},c),{appState:o_(oE({},c.appState),{status:"idle"}),document:o_(oE({},c.document),{pageStates:{[this.currentPageId]:o_(oE({},null==(o=null==(r=c.document)?void 0:r.pageStates)?void 0:o[this.currentPageId]),{editingId:null})}})}),`session:complete:${d.constructor.name}`),null==(l=(s=this.callbacks).onSessionEnd)||l.call(s,this,d.constructor.name),this}),oM(this,"createShapes",(...e)=>0===e.length?this:this.create(e.map(e=>s0.getShapeUtil(e.type).create(oE({parentId:this.currentPageId},e))))),oM(this,"updateShapes",(...e)=>{let t=this.document.pages[this.currentPageId].shapes,i=e.filter(e=>t[e.id]);return 0===i.length?this:this.setState(dm(this,i,this.currentPageId),"updated_shapes")}),oM(this,"create",(e=[],t=[])=>0===e.length?this:this.setState(ds(this,e,t))),oM(this,"patchCreate",(e=[],t=[])=>0===e.length?this:this.patchState(ds(this,e,t).after)),oM(this,"delete",(e=this.selectedIds)=>{var t,i;if(0===e.length||this.session)return this;let n=dl(this,e);if(this.callbacks.onAssetDelete&&(null==(t=n.before.document)?void 0:t.assets)&&(null==(i=n.after.document)?void 0:i.assets)){let e=Object.keys(n.before.document.assets).filter(e=>!!n.before.document.assets[e]),t=Object.keys(n.after.document.assets).filter(e=>!!n.after.document.assets[e]);e.filter(e=>!t.includes(e)).forEach(e=>this.callbacks.onAssetDelete(this,e))}return this.setState(n)}),oM(this,"deleteAll",()=>(this.selectAll(),this.delete(),this)),oM(this,"style",(e,t=this.selectedIds)=>this.setState(function(e,t,i){let{currentPageId:n,selectedIds:a}=e,r=t.flatMap(t=>s0.getDocumentBranch(e.state,t,n)).filter(t=>!e.getShape(t).isLocked),o={},s={};return r.map(t=>e.getShape(t)).filter(e=>!e.isLocked).forEach(t=>{o[t.id]={style:oE({},Object.fromEntries(Object.keys(i).map(e=>[e,t.style[e]])))},s[t.id]={style:i},"text"===t.type&&(o[t.id].point=t.point,s[t.id].point=z.toFixed(z.add(t.point,z.sub(e.getShapeUtil(t).getCenter(t),e.getShapeUtil(t).getCenter(o_(oE({},t),{style:oE(oE({},t.style),i)}))))))}),{id:"style",before:{document:{pages:{[n]:{shapes:o}},pageStates:{[n]:{selectedIds:a}}},appState:{currentStyle:oE({},e.appState.currentStyle)}},after:{document:{pages:{[n]:{shapes:s}},pageStates:{[n]:{selectedIds:t}}},appState:{currentStyle:i}}}}(this,t,e))),oM(this,"align",(e,t=this.selectedIds)=>t.length<2?this:this.setState(function(e,t,i){let{currentPageId:n}=e,a=t.map(t=>e.getShape(t)),r=a.map(e=>({id:e.id,point:[...e.point],bounds:s0.getBounds(e)})),o=tI.getCommonBounds(r.map(({bounds:e})=>e)),s=o.minX+o.width/2,l=o.minY+o.height/2,d=Object.fromEntries(r.map(({id:e,point:t,bounds:n})=>[e,{prev:t,next:{top:[t[0],o.minY],centerVertical:[t[0],l-n.height/2],bottom:[t[0],o.maxY-n.height],left:[o.minX,t[1]],centerHorizontal:[s-n.width/2,t[1]],right:[o.maxX-n.width,t[1]]}[i]}])),{before:c,after:u}=s0.mutateShapes(e.state,t,e=>d[e.id]?{point:d[e.id].next}:e,n,!1);return a.forEach(t=>{if("group"===t.type){let i=z.sub(u[t.id].point,c[t.id].point);t.children.forEach(t=>{let n=e.getShape(t);c[n.id]={point:n.point},u[n.id]={point:z.add(n.point,i)}}),delete c[t.id],delete u[t.id]}}),{id:"align",before:{document:{pages:{[n]:{shapes:c}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:u}},pageStates:{[n]:{selectedIds:t}}}}}}(this,t,e))),oM(this,"distribute",(e,t=this.selectedIds)=>t.length<3?this:this.setState(function(e,t,i){let{currentPageId:n}=e,a=t.map(t=>e.getShape(t)),r=Object.fromEntries((function(e,t){let i=e.map(e=>{let t=s0.getShapeUtil(e);return{id:e.id,point:[...e.point],bounds:t.getBounds(e),center:t.getCenter(e)}}),n=i.length,a=tI.getCommonBounds(i.map(({bounds:e})=>e)),r=[];switch(t){case"horizontal":{let e=i.reduce((e,t)=>e+t.bounds.width,0);if(e>a.width){let e=i.sort((e,t)=>e.bounds.minX-t.bounds.minX)[0],t=i.sort((e,t)=>t.bounds.maxX-e.bounds.maxX)[0],a=i.filter(i=>i!==e&&i!==t).sort((e,t)=>e.center[0]-t.center[0]),o=(t.center[0]-e.center[0])/(n-1),s=e.center[0]+o;a.forEach(({id:e,point:t,bounds:i},n)=>{r.push({id:e,prev:t,next:[s+o*n-i.width/2,i.minY]})})}else{let t=i.sort((e,t)=>e.center[0]-t.center[0]),o=a.minX,s=(a.width-e)/(n-1);t.forEach(({id:e,point:t,bounds:i})=>{r.push({id:e,prev:t,next:[o,i.minY]}),o+=i.width+s})}break}case"vertical":{let e=i.reduce((e,t)=>e+t.bounds.height,0);if(e>a.height){let e=i.sort((e,t)=>e.bounds.minY-t.bounds.minY)[0],t=i.sort((e,t)=>t.bounds.maxY-e.bounds.maxY)[0],a=i.filter(i=>i!==e&&i!==t).sort((e,t)=>e.center[1]-t.center[1]),o=(t.center[1]-e.center[1])/(n-1),s=e.center[1]+o;a.forEach(({id:e,point:t,bounds:i},n)=>{r.push({id:e,prev:t,next:[i.minX,s+o*n-i.height/2]})})}else{let t=i.sort((e,t)=>e.center[1]-t.center[1]),o=a.minY,s=(a.height-e)/(n-1);t.forEach(({id:e,point:t,bounds:i})=>{r.push({id:e,prev:t,next:[i.minX,o]}),o+=i.height+s})}}}return r})(a,i).map(e=>[e.id,e])),{before:o,after:s}=s0.mutateShapes(e.state,t.filter(e=>void 0!==r[e]),e=>{var t;return{point:null==(t=r[e.id])?void 0:t.next}},n);return a.forEach(t=>{if("group"===t.type){let i=z.sub(s[t.id].point,o[t.id].point);t.children.forEach(t=>{let n=e.getShape(t);o[n.id]={point:n.point},s[n.id]={point:z.add(n.point,i)}}),delete o[t.id],delete s[t.id]}}),{id:"distribute",before:{document:{pages:{[n]:{shapes:o}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:s}},pageStates:{[n]:{selectedIds:t}}}}}}(this,t,e))),oM(this,"stretch",(e,t=this.selectedIds)=>t.length<2?this:this.setState(function(e,t,i){let{currentPageId:n,selectedIds:a}=e,r=t.map(t=>e.getShape(t)),o=r.map(e=>s0.getBounds(e)),s=tI.getCommonBounds(o),l=t.flatMap(t=>{let i=e.getShape(t);return i.children?i.children:i.id}).filter(t=>!e.getShape(t).isLocked),{before:d,after:c}=s0.mutateShapes(e.state,l,e=>{let t=s0.getBounds(e);switch(i){case"horizontal":{let i=o_(oE({},t),{minX:s.minX,maxX:s.maxX,width:s.width});return s0.getShapeUtil(e).transformSingle(e,i,{type:tk.TopLeft,scaleX:i.width/t.width,scaleY:1,initialShape:e,transformOrigin:[.5,.5]})}case"vertical":{let i=o_(oE({},t),{minY:s.minY,maxY:s.maxY,height:s.height});return s0.getShapeUtil(e).transformSingle(e,i,{type:tk.TopLeft,scaleX:1,scaleY:i.height/t.height,initialShape:e,transformOrigin:[.5,.5]})}}},n);return r.forEach(e=>{"group"===e.type&&(delete d[e.id],delete c[e.id])}),{id:"stretch",before:{document:{pages:{[n]:{shapes:d}},pageStates:{[n]:{selectedIds:a}}}},after:{document:{pages:{[n]:{shapes:c}},pageStates:{[n]:{selectedIds:t}}}}}}(this,t,e))),oM(this,"flipHorizontal",(e=this.selectedIds)=>0===e.length?this:this.setState(dd(this,e,"horizontal"))),oM(this,"flipVertical",(e=this.selectedIds)=>0===e.length?this:this.setState(dd(this,e,"vertical"))),oM(this,"moveToPage",(e,t=this.currentPageId,i=this.selectedIds)=>{if(0===i.length)return this;let{rendererBounds:n}=this;return this.setState(function(e,t,i,n,a){let{page:r}=e,o={shapes:{},bindings:{}},s={shapes:{},bindings:{}},l={shapes:{},bindings:{}},d={shapes:{},bindings:{}},c=new Set,u=new Set;t.map(t=>e.getShape(t,n)).filter(e=>!e.isLocked).forEach(t=>{c.add(t.id),u.add(t),void 0!==t.children&&t.children.forEach(t=>{c.add(t),u.add(e.getShape(t,n))})});let p=s0.getTopChildIndex(e.state,a),h=Array.from(u.values());h.forEach((t,i)=>{if(o.shapes[t.id]=t,s.shapes[t.id]=void 0,l.shapes[t.id]=void 0,d.shapes[t.id]=t,!c.has(t.parentId)&&(d.shapes[t.id]=o_(oE({},t),{parentId:a,childIndex:p+i}),t.parentId!==n)){let i=e.getShape(t.parentId,n);o.shapes[i.id]={children:i.children},s.shapes[i.id]={children:i.children.filter(e=>e!==t.id)}}}),Object.values(r.bindings).filter(e=>c.has(e.fromId)||c.has(e.toId)).forEach(t=>{o.bindings[t.id]=t,s.bindings[t.id]=void 0;let i=e.getShape(t.fromId,n);if(c.has(t.fromId)&&c.has(t.toId))l.bindings[t.id]=void 0,d.bindings[t.id]=t;else if(c.has(t.fromId)){let a=e.getShape(t.fromId,n),r=Object.values(i.handles).find(e=>e.bindingId===t.id).id,o=d.shapes[a.id];o.handles=o_(oE({},o.handles),{[r]:o_(oE({},o.handles[r]),{bindingId:void 0})})}else{let a=e.getShape(t.fromId,n),r=Object.values(i.handles).find(e=>e.bindingId===t.id);o.shapes[a.id]={handles:{[r.id]:{bindingId:t.id}}},s.shapes[a.id]={handles:{[r.id]:{bindingId:void 0}}}}});let m=e.state.document.pageStates[a],g=tI.getCommonBounds(h.map(e=>s0.getBounds(e))),f=s0.getCameraZoom(i.width0===e.length?this:this.setState(dc(this,e,"toBack"))),oM(this,"moveBackward",(e=this.selectedIds)=>0===e.length?this:this.setState(dc(this,e,"backward"))),oM(this,"moveForward",(e=this.selectedIds)=>0===e.length?this:this.setState(dc(this,e,"forward"))),oM(this,"moveToFront",(e=this.selectedIds)=>0===e.length?this:this.setState(dc(this,e,"toFront"))),oM(this,"nudge",(e,t=!1,i=this.selectedIds)=>{if(0===i.length)return this;let n=t?this.settings.showGrid?4*this.currentGrid:10:this.settings.showGrid?this.currentGrid:1;return this.setState(function(e,t,i){let{currentPageId:n,selectedIds:a}=e;e.rotationInfo.selectedIds=[...a];let r={shapes:{},bindings:{}},o={shapes:{},bindings:{}},s=t.flatMap(t=>{let i=e.getShape(t);return i.children?i.children:i.id}).filter(t=>!e.getShape(t).isLocked),l=s0.mutateShapes(e.state,s,e=>({point:z.toFixed(z.add(e.point,i))}),n);return r.shapes=l.before,o.shapes=l.after,s0.getBindings(e.state,n).filter(e=>t.includes(e.fromId)&&!t.includes(e.toId)).forEach(t=>{for(let i of(r.bindings[t.id]=t,o.bindings[t.id]=void 0,[t.toId,t.fromId])){let n=e.getShape(i);n.handles&&Object.values(n.handles).filter(e=>e.bindingId===t.id).forEach(e=>{var n,a;r.shapes[i]=o_(oE({},r.shapes[i]),{handles:o_(oE({},null==(n=r.shapes[i])?void 0:n.handles),{[e.id]:{bindingId:t.id}})}),o.shapes[i]=o_(oE({},o.shapes[i]),{handles:o_(oE({},null==(a=o.shapes[i])?void 0:a.handles),{[e.id]:{bindingId:void 0}})})})}}),{id:"translate",before:{document:{pages:{[n]:r},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:o},pageStates:{[n]:{selectedIds:t}}}}}}(this,i,z.mul(e,n)))}),oM(this,"duplicate",(e=this.selectedIds,t)=>this.readOnly||0===e.length?this:this.setState(function(e,t,i){let{selectedIds:n,currentPageId:a,page:r,shapes:o}=e,s={shapes:{},bindings:{}},l={shapes:{},bindings:{}},d={},c=t.map(t=>e.getShape(t)).filter(e=>!t.includes(e.parentId));c.forEach(t=>{let i=tI.uniqueId();if(s.shapes[i]=void 0,l.shapes[i]=o_(oE({},tI.deepClone(t)),{id:i,childIndex:s0.getChildIndexAbove(e.state,t.id,a)}),t.children&&(l.shapes[i].children=[]),t.parentId!==a){let n=e.getShape(t.parentId);s.shapes[n.id]=o_(oE({},s.shapes[n.id]),{children:n.children}),l.shapes[n.id]=o_(oE({},l.shapes[n.id]),{children:[...(l.shapes[n.id]||n).children,i]})}d[t.id]=i}),c.forEach(t=>{t.children&&t.children.forEach(i=>{var n,r;let o=e.getShape(i),c=tI.uniqueId(),u=d[t.id];s.shapes[c]=void 0,l.shapes[c]=o_(oE({},tI.deepClone(o)),{id:c,parentId:u,childIndex:s0.getChildIndexAbove(e.state,o.id,a)}),d[i]=c,null==(r=null==(n=l.shapes[d[t.id]])?void 0:n.children)||r.push(c)})});let u=new Set(Object.keys(d));Object.values(r.bindings).filter(e=>u.has(e.fromId)||u.has(e.toId)).forEach(e=>{if(u.has(e.fromId))if(u.has(e.toId)){let t=tI.uniqueId(),i=o_(oE({},tI.deepClone(e)),{id:t,fromId:d[e.fromId],toId:d[e.toId]});s.bindings[t]=void 0,l.bindings[t]=i,Object.values(l.shapes[i.fromId].handles).forEach(i=>{i.bindingId===e.id&&(i.bindingId=t)})}else Object.values(l.shapes[d[e.fromId]].handles).forEach(t=>{t.bindingId===e.id&&(t.bindingId=void 0)})});let p=Object.values(l.shapes);if(i){let e=tI.getCommonBounds(p.map(e=>s0.getBounds(e))),t=tI.getBoundsCenter(e);p.forEach(e=>{e.point&&(e.point=z.sub(i,z.sub(t,e.point)))})}else{let e=[16,16];p.forEach(t=>{t.point&&(t.point=z.add(t.point,e))})}return p.forEach(e=>{e.isLocked&&(e.isLocked=!1)}),{id:"duplicate",before:{document:{pages:{[a]:s},pageStates:{[a]:{selectedIds:n}}}},after:{document:{pages:{[a]:l},pageStates:{[a]:{selectedIds:Array.from(u.values()).map(e=>d[e])}}}}}}(this,e,t))),oM(this,"resetBounds",(e=this.selectedIds)=>{let t=du(this,e,this.currentPageId);return this.setState(du(this,e,this.currentPageId),t.id)}),oM(this,"toggleHidden",(e=this.selectedIds)=>0===e.length?this:this.setState(dh(this,e,"isHidden"))),oM(this,"toggleLocked",(e=this.selectedIds)=>0===e.length?this:this.setState(dh(this,e,"isLocked"))),oM(this,"toggleAspectRatioLocked",(e=this.selectedIds)=>0===e.length?this:this.setState(dh(this,e,"isAspectRatioLocked"))),oM(this,"toggleDecoration",(e,t=this.selectedIds)=>0===t.length||"start"!==e&&"end"!==e?this:this.setState(function(e,t,i){let{currentPageId:n,selectedIds:a}=e;return{id:"toggle_decorations",before:{document:{pages:{[n]:{shapes:Object.fromEntries(t.map(t=>{var n;return[t,{decorations:{[i]:null==(n=e.getShape(t).decorations)?void 0:n[i]}}]}))}},pageStates:{[n]:{selectedIds:a}}}},after:{document:{pages:{[n]:{shapes:Object.fromEntries(t.filter(t=>!e.getShape(t).isLocked).map(t=>{var n;return[t,{decorations:{[i]:(null==(n=e.getShape(t).decorations)?void 0:n[i])?void 0:"arrow"}}]}))}},pageStates:{[n]:{selectedIds:t}}}}}}(this,t,e))),oM(this,"setShapeProps",(e,t=this.selectedIds)=>this.setState(function(e,t,i){let{currentPageId:n,selectedIds:a}=e,r=t.map(t=>e.getShape(t)).filter(e=>!!i.isLocked||!e.isLocked),o={},s={},l=Object.keys(i);return r.forEach(e=>{o[e.id]=Object.fromEntries(l.map(t=>[t,e[t]])),s[e.id]=i}),{id:"set_props",before:{document:{pages:{[n]:{shapes:o}},pageStates:{[n]:{selectedIds:a}}}},after:{document:{pages:{[n]:{shapes:s}},pageStates:{[n]:{selectedIds:a}}}}}}(this,t,e))),oM(this,"rotate",(e=-.5*Math.PI,t=this.selectedIds)=>{if(0===t.length)return this;let i=function(e,t,i=-dp/4){let{currentPageId:n}=e,a={},r={},o=t.flatMap(t=>{let i=e.getShape(t);return i.children?i.children.map(t=>e.getShape(t)):i}).filter(e=>!e.isLocked),s=tI.getBoundsCenter(tI.getCommonBounds(o.map(e=>s0.getBounds(e))));return o.forEach(e=>{let t=s0.getRotatedShapeMutation(e,s0.getCenter(e),s,i);t&&(a[e.id]=s0.getBeforeShape(e,t),r[e.id]=t)}),{id:"rotate",before:{document:{pages:{[n]:{shapes:a}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:r}},pageStates:{[n]:{selectedIds:t}}}}}}(this,t,e);return i?this.setState(i):this}),oM(this,"group",(e=this.selectedIds,t=tI.uniqueId(),i=this.currentPageId)=>{if(this.readOnly)return this;if(1===e.length&&"group"===this.getShape(e[0],i).type)return this.ungroup(e,i);if(e.length<2)return this;let n=function(e,t,i,n){var a,r;if(t.length<2)return;let o={},s={},l={},d={},c=[...t],u=[],p=[],h=[];for(let i of t){let t=e.getShape(i);if(!t.isLocked)if(void 0===t.children)u.push(t);else{let i=t.children.filter(t=>!e.getShape(t).isLocked);h.push(t),c.push(...i),u.push(...i.map(t=>e.getShape(t)).filter(Boolean))}}if(u.every(e=>e.parentId===u[0].parentId)&&u[0].parentId!==n&&(null==(a=e.getShape(u[0].parentId).children)?void 0:a.length)===c.length)return;let m=s0.flattenPage(e.state,n),g=Object.fromEntries(u.map(e=>[e.id,m.indexOf(e)])),f=u.sort((e,t)=>g[e.id]-g[t.id]),b=(f.filter(e=>e.parentId===n)[0]||f[0]).childIndex,x=tI.getCommonBounds(u.map(e=>s0.getBounds(e)));for(o[i]=void 0,s[i]=s0.getShapeUtil("group").create({id:i,childIndex:b,parentId:n,point:[x.minX,x.minY],size:[x.width,x.height],children:f.map(e=>e.id)}),f.forEach((t,a)=>{if(t.parentId!==n){let i=e.getShape(t.parentId);h.push(i)}o[t.id]=o_(oE({},o[t.id]),{parentId:t.parentId,childIndex:t.childIndex}),s[t.id]=o_(oE({},s[t.id]),{parentId:i,childIndex:a+1})});h.length>0;){let t=h.pop();if(!t)break;let i=((null==(r=o[t.id])?void 0:r.children)||t.children).filter(e=>e&&!(c.includes(e)||p.includes(e)));0===i.length?(o[t.id]=t,s[t.id]=void 0,t.parentId!==n&&(p.push(t.id),h.push(e.getShape(t.parentId)))):(o[t.id]=o_(oE({},o[t.id]),{children:t.children}),s[t.id]=o_(oE({},s[t.id]),{children:i}))}let{bindings:y}=e,v=new Set(p);return y.forEach(t=>{for(let i of[t.toId,t.fromId])if(v.has(i)){l[t.id]=t,d[t.id]=void 0;let n=e.getShape(i);n.handles&&Object.values(n.handles).filter(e=>e.bindingId===t.id).forEach(e=>{var n,a;o[i]=o_(oE({},o[i]),{handles:o_(oE({},null==(n=o[i])?void 0:n.handles),{[e.id]:{bindingId:t.id}})}),p.includes(i)||(s[i]=o_(oE({},s[i]),{handles:o_(oE({},null==(a=s[i])?void 0:a.handles),{[e.id]:{bindingId:void 0}})}))})}}),{id:"group",before:{document:{pages:{[n]:{shapes:o,bindings:l}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:s,bindings:l}},pageStates:{[n]:{selectedIds:[i]}}}}}}(this,e,t,i);return n?this.setState(n):this}),oM(this,"ungroup",(e=this.selectedIds,t=this.currentPageId)=>{if(this.readOnly)return this;let i=e.map(e=>this.getShape(e,t)).filter(e=>"group"===e.type);if(0===i.length)return this;let n=function(e,t,i,n){let{bindings:a}=e,r={},o={},s={},l={},d=t.filter(e=>!i.find(t=>t.id===e));return i.filter(e=>!e.isLocked).forEach(t=>{let i=[],c=[];r[t.id]=t,o[t.id]=void 0,t.children.forEach(t=>{d.push(t);let a=e.getShape(t,n);i.push(a)});let u=t.childIndex,p=(s0.getChildIndexAbove(e.state,t.id,n)-u)/i.length;i.sort((e,t)=>e.childIndex-t.childIndex).forEach((e,t)=>{r[e.id]={parentId:e.parentId,childIndex:e.childIndex},o[e.id]={parentId:n,childIndex:u+p*t}}),a.filter(e=>e.toId===t.id||e.fromId===t.id).forEach(t=>{for(let i of[t.toId,t.fromId])if(void 0===o[i]){s[t.id]=t,l[t.id]=void 0;let a=e.getShape(i,n);a.handles&&Object.values(a.handles).filter(e=>e.bindingId===t.id).forEach(e=>{var n,a;r[i]=o_(oE({},r[i]),{handles:o_(oE({},null==(n=r[i])?void 0:n.handles),{[e.id]:{bindingId:t.id}})}),c.includes(i)||(o[i]=o_(oE({},o[i]),{handles:o_(oE({},null==(a=o[i])?void 0:a.handles),{[e.id]:{bindingId:void 0}})}))})}})}),{id:"ungroup",before:{document:{pages:{[n]:{shapes:r,bindings:s}},pageStates:{[n]:{selectedIds:t}}}},after:{document:{pages:{[n]:{shapes:o,bindings:s}},pageStates:{[n]:{selectedIds:d}}}}}}(this,e,i,t);return n?this.setState(n):this}),oM(this,"cancel",()=>{var e,t;return null==(t=(e=this.currentTool).onCancel)||t.call(e),this}),oM(this,"addMediaFromFiles",(e,...t)=>oT(this,[e,...t],function*(e,t=this.centerPoint){this.setIsLoading(!0);let i=[],n=this.getPagePoint(t);for(let n of e){let e=tI.uniqueId(),a=n.name.match(/\.[0-9a-z]+$/i);if(!a)throw Error("No extension");let r=sd.includes(a[0].toLowerCase()),o=sc.includes(a[0].toLowerCase());if(!(r||o))throw Error("Wrong extension");let s=r?"image":"video",l=r?"image":"video",d;try{if(this.callbacks.onAssetCreate){let t=yield this.callbacks.onAssetCreate(this,n,e);if(!t)throw Error("Asset creation callback returned false");d=t}else d=yield dS(n);if("string"==typeof d){let o=[0,0];if(r){if(".svg"==a[0]){let e,t=yield dk(n),i=this.getViewboxFromSVG(t);i&&(e=i.split(" "),o[0]=parseFloat(e[2]),o[1]=parseFloat(e[3]))}z.isEqual(o,[0,0])&&(o=yield dA(d))}else o=yield dE(d);let c=Object.values(this.document.assets).find(e=>e.type===l&&e.src===d),u;if(c)u=c.id;else{let t={id:u=e,type:l,name:n.name,src:d,size:o};this.patchState({document:{assets:{[u]:t}}})}i.push(this.getImageOrVideoShapeAtPoint(e,s,t,o,u))}}catch(e){console.warn(e)}}if(i.length){let e=z.add(n,[0,0]);i.forEach((t,i)=>{let n=s0.getBounds(t);0===i&&(e[0]-=n.width/2,e[1]-=n.height/2),t.point=[...e],e[0]+=n.width});let t=tI.getCommonBounds(i.map(s0.getBounds));this.createShapes(...i),tI.boundsContain(this.viewport,t)||(this.zoomToSelection(),this.zoom>1&&this.resetZoom())}return this.setIsLoading(!1),this})),oM(this,"getViewboxFromSVG",e=>{if("string"==typeof e){let t=e.match(/.*?viewBox=["'](-?[\d.]+[, ]+-?[\d.]+[, ][\d.]+[, ][\d.]+)["']/);return t&&t.length>=2?t[1]:null}return this.setIsLoading(!1),null}),oM(this,"onKeyDown",(e,t,i)=>{var n,a;switch(i.key){case"/":if("idle"===this.status&&!this.pageState.editingId){let{shiftKey:e,metaKey:i,altKey:n,ctrlKey:a,spaceKey:r}=this;this.onPointerDown({target:"canvas",pointerId:0,origin:t.point,point:t.point,delta:[0,0],pressure:.5,shiftKey:e,ctrlKey:a,metaKey:i,altKey:n,spaceKey:r},{shiftKey:e,altKey:n,ctrlKey:a,pointerId:0,clientX:t.point[0],clientY:t.point[1]})}break;case"Escape":this.cancel();break;case"Meta":this.metaKey=!0;break;case"Alt":this.altKey=!0;break;case"Control":this.ctrlKey=!0;break;case" ":this.isForcePanning=!0,this.spaceKey=!0}return null==(a=(n=this.currentTool).onKeyDown)||a.call(n,e,t,i),this}),oM(this,"onKeyUp",(e,t,i)=>{var n,a;if(t){switch(i.key){case"/":{let{currentPoint:e,shiftKey:t,metaKey:i,altKey:n,ctrlKey:a,spaceKey:r}=this;this.onPointerUp({target:"canvas",pointerId:0,origin:e,point:e,delta:[0,0],pressure:.5,shiftKey:t,ctrlKey:a,metaKey:i,altKey:n,spaceKey:r},{shiftKey:t,altKey:n,ctrlKey:a,pointerId:0,clientX:e[0],clientY:e[1]});break}case"Meta":this.metaKey=!1;break;case"Alt":this.altKey=!1;break;case"Control":this.ctrlKey=!1;break;case" ":this.isForcePanning=!1,this.spaceKey=!1}null==(a=(n=this.currentTool).onKeyUp)||a.call(n,e,t,i)}}),oM(this,"refreshBoundingBoxes",()=>{let e=this.shapes.map(e=>[e.id,oE({point:[...e.point]},"label"in e&&{label:""})]),t=this.shapes.map(e=>[e.id,oE({point:[...e.point]},"label"in e&&{label:e.label})]);sx(),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(e)}}}}),this.patchState({document:{pages:{[this.currentPageId]:{shapes:Object.fromEntries(t)}}}})}),oM(this,"onDragOver",e=>{e.preventDefault()}),oM(this,"onDrop",e=>oT(this,null,function*(){var t;return e.preventDefault(),this.disableAssets||(null==(t=e.dataTransfer.files)?void 0:t.length)&&this.addMediaFromFiles(Object.values(e.dataTransfer.files),[e.clientX,e.clientY]),this})),oM(this,"onPinchStart",(e,t)=>{var i,n;null==(n=(i=this.currentTool).onPinchStart)||n.call(i,e,t)}),oM(this,"onPinchEnd",(e,t)=>{var i,n;return null==(n=(i=this.currentTool).onPinchEnd)?void 0:n.call(i,e,t)}),oM(this,"onPinch",(e,t)=>{var i,n;return null==(n=(i=this.currentTool).onPinch)?void 0:n.call(i,e,t)}),oM(this,"onPan",(e,t)=>{if("pinching"===this.appState.status)return;let i=z.div(e.delta,this.camera.zoom),n=this.camera.point,a=z.sub(n,i);z.isEqual(a,n)||(this.pan(i),this.isForcePanning||this.onPointerMove(e,t),sl&&this.isForcePanning&&this.preventPaste())}),oM(this,"onZoom",(e,t)=>{if("idle"!==this.state.appState.status)return;let i=e.delta[2]/50;this.zoomBy(i,e.point),this.onPointerMove(e,t)}),oM(this,"updateInputs",e=>{this.currentPoint=this.getPagePoint(e.point).concat(e.pressure),this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey}),oM(this,"onPointerMove",(e,t)=>{var i,n,a,r,o;if(this.previousPoint=this.currentPoint,this.updateInputs(e,t),this.isForcePanning&&this.isPointing){null==(i=this.onPan)||i.call(this,o_(oE({},e),{delta:z.neg(e.delta)}),t);return}if(null==(a=(n=this.currentTool).onPointerMove)||a.call(n,e,t),this.state.room){let{users:t,userId:i}=this.state.room;null==(o=(r=this.callbacks).onChangePresence)||o.call(r,this,o_(oE({},t[i]),{point:this.getPagePoint(e.point),session:!!this.session}))}}),oM(this,"onPointerDown",(e,t)=>{var i,n;if(4===t.buttons)this.isForcePanning=!0;else if(this.isPointing)return;this.isPointing=!0,this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),this.isForcePanning||null==(n=(i=this.currentTool).onPointerDown)||n.call(i,e,t)}),oM(this,"onPointerUp",(e,t)=>{var i,n;this.isPointing=!1,this.shiftKey||(this.isForcePanning=!1),this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointerUp)||n.call(i,e,t)}),oM(this,"onPointCanvas",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointCanvas)||n.call(i,e,t)}),oM(this,"onDoubleClickCanvas",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDoubleClickCanvas)||n.call(i,e,t)}),oM(this,"onRightPointCanvas",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onRightPointCanvas)||n.call(i,e,t)}),oM(this,"onDragCanvas",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDragCanvas)||n.call(i,e,t)}),oM(this,"onReleaseCanvas",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onReleaseCanvas)||n.call(i,e,t)}),oM(this,"onPointShape",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointShape)||n.call(i,e,t)}),oM(this,"onReleaseShape",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onReleaseShape)||n.call(i,e,t)}),oM(this,"onDoubleClickShape",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onDoubleClickShape)||n.call(i,e,t)}),oM(this,"onRightPointShape",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onRightPointShape)||n.call(i,e,t)}),oM(this,"onDragShape",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDragShape)||n.call(i,e,t)}),oM(this,"onHoverShape",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onHoverShape)||n.call(i,e,t)}),oM(this,"onUnhoverShape",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onUnhoverShape)||n.call(i,e,t)}),oM(this,"onPointBounds",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointBounds)||n.call(i,e,t)}),oM(this,"onDoubleClickBounds",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onDoubleClickBounds)||n.call(i,e,t)}),oM(this,"onRightPointBounds",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onRightPointBounds)||n.call(i,e,t)}),oM(this,"onDragBounds",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDragBounds)||n.call(i,e,t)}),oM(this,"onHoverBounds",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onHoverBounds)||n.call(i,e,t)}),oM(this,"onUnhoverBounds",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onUnhoverBounds)||n.call(i,e,t)}),oM(this,"onReleaseBounds",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onReleaseBounds)||n.call(i,e,t)}),oM(this,"onPointBoundsHandle",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointBoundsHandle)||n.call(i,e,t)}),oM(this,"onDoubleClickBoundsHandle",(e,t)=>{var i,n;if(this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onDoubleClickBoundsHandle)||n.call(i,e,t),1!==this.selectedIds.length)return;let a=this.getShape(this.selectedIds[0]);if("image"===a.type||"video"===a.type){let e=this.document.assets[a.assetId],t=s0.getShapeUtil(a),i=t.getCenter(a),n=t.getCenter(o_(oE({},a),{size:e.size})),r=z.sub(n,i);this.updateShapes({id:a.id,point:z.sub(a.point,r),size:e.size})}}),oM(this,"onRightPointBoundsHandle",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onRightPointBoundsHandle)||n.call(i,e,t)}),oM(this,"onDragBoundsHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDragBoundsHandle)||n.call(i,e,t)}),oM(this,"onHoverBoundsHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onHoverBoundsHandle)||n.call(i,e,t)}),oM(this,"onUnhoverBoundsHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onUnhoverBoundsHandle)||n.call(i,e,t)}),oM(this,"onReleaseBoundsHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onReleaseBoundsHandle)||n.call(i,e,t)}),oM(this,"onPointHandle",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onPointHandle)||n.call(i,e,t)}),oM(this,"onDoubleClickHandle",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onDoubleClickHandle)||n.call(i,e,t)}),oM(this,"onRightPointHandle",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onRightPointHandle)||n.call(i,e,t)}),oM(this,"onDragHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onDragHandle)||n.call(i,e,t)}),oM(this,"onHoverHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onHoverHandle)||n.call(i,e,t)}),oM(this,"onUnhoverHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onUnhoverHandle)||n.call(i,e,t)}),oM(this,"onReleaseHandle",(e,t)=>{var i,n;this.updateInputs(e,t),null==(n=(i=this.currentTool).onReleaseHandle)||n.call(i,e,t)}),oM(this,"onShapeChange",e=>{let t=dm(this,[oE(oE({},this.document.pages[this.currentPageId].shapes[e.id]),e)],this.currentPageId).after;return this.patchState(t,"patched_shapes")}),oM(this,"onShapeBlur",()=>{var e,t;if(performance.now()-this.editingStartTime<50)return;let{editingId:i}=this.pageState,{isToolLocked:n}=this.getAppState();if(i){let e=this.getShape(i);this.setEditingId(),"text"===e.type&&(e.text.trim().length<=0?this.patchState(dl(this,[i]).after,"delete_empty_text"):n||this.select(i))}null==(t=(e=this.currentTool).onShapeBlur)||t.call(e)}),oM(this,"onShapeClone",(e,t)=>{var i,n;this.originPoint=this.getPagePoint(e.point).concat(e.pressure),this.updateInputs(e,t),null==(n=(i=this.currentTool).onShapeClone)||n.call(i,e,t)}),oM(this,"onRenderCountChange",e=>{let t=this.getAppState();t.isEmptyCanvas&&e.length>0?this.patchState({appState:{isEmptyCanvas:!1}},"empty_canvas:false"):!t.isEmptyCanvas&&e.length<=0&&this.patchState({appState:{isEmptyCanvas:!0}},"empty_canvas:true")}),oM(this,"onError",()=>{}),oM(this,"getShapeUtil",s0.getShapeUtil),this.callbacks=t}setStatus(e){return this.patchState({appState:{status:e}},`set_status:${e}`)}get isMenuOpen(){return this.appState.isMenuOpen}get isLoading(){return this.appState.isLoading}get disableAssets(){return this.appState.disableAssets}get history(){return this.stack.slice(0,this.pointer+1)}set history(e){this.replaceHistory(e)}get document(){return this.state.document}get settings(){return this.state.settings}get appState(){return this.state.appState}get currentPageId(){return this.state.appState.currentPageId}get page(){return this.state.document.pages[this.currentPageId]}get shapes(){return Object.values(this.page.shapes)}get bindings(){return Object.values(this.page.bindings)}get assets(){return Object.values(this.document.assets)}get pageState(){return this.state.document.pageStates[this.currentPageId]}get camera(){return this.pageState.camera}get zoom(){return this.pageState.camera.zoom}get selectedIds(){return this.pageState.selectedIds}createTextShapeAtPoint(e,t,i){let{shapes:n,appState:{currentPageId:a,currentStyle:r}}=this,o=0===n.length?1:n.filter(e=>e.parentId===a).sort((e,t)=>t.childIndex-e.childIndex)[0].childIndex+1,s=di.text,l=s.create({id:t||tI.uniqueId(),parentId:a,childIndex:o,point:e,style:oE({},r)}),d=s.getBounds(l);return l.point=z.sub(l.point,[d.width/2,d.height/2]),i?this.patchCreate([s0.getShapeUtil(l.type).create(l)]):this.createShapes(l),this.setEditingId(l.id,!0),this}getImageOrVideoShapeAtPoint(e,t,i,n,a){let{shapes:r,appState:{currentPageId:o,currentStyle:s}}=this,l=0===r.length?1:r.filter(e=>e.parentId===o).sort((e,t)=>t.childIndex-e.childIndex)[0].childIndex+1,d=di[t];if(n[0]>this.viewport.width){let e=n[1]/n[0];n[0]=this.viewport.width-128/this.camera.zoom*2,n[1]=n[0]*e,(n[1]<32||n[1]<32)&&(n[1]=32,n[0]=n[1]/e)}else if(n[1]>this.viewport.height){let e=n[0]/n[1];n[1]=this.viewport.height-128/this.camera.zoom*2,n[0]=n[1]*e,(n[1]<32||n[1]<32)&&(n[0]=32,n[1]=n[0]/e)}return d.create({id:e,parentId:o,childIndex:l,point:i,size:n,style:oE({},s),assetId:a})}isSelected(e){return this.selectedIds.includes(e)}serializeVideo(e){let t=document.getElementById(e+"_video");if(t){let e=document.createElement("canvas");return e.width=t.videoWidth,e.height=t.videoHeight,e.getContext("2d").drawImage(t,0,0),e.toDataURL("image/png")}throw Error("Video with id "+e+" not found")}serializeImage(e){let t=document.getElementById(e+"_image");if(t){let e=document.createElement("canvas");return e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0),e.toDataURL("image/png")}throw Error("Image with id "+e+" not found")}patchAssets(e){this.document.assets=oE(oE({},this.document.assets),e)}get room(){return this.state.room}get isLocal(){return void 0===this.state.room||"local"===this.state.room.id}get status(){return this.appState.status}get currentUser(){if(this.state.room)return this.state.room.users[this.state.room.userId]}get centerPoint(){let{width:e,height:t}=this.rendererBounds;return z.toFixed([e/2,t/2])}get currentGrid(){let{zoom:e}=this.camera;return e<.15?128:e<1?32:8}};oM(dZ,"version",15.5),oM(dZ,"defaultDocument",{id:"doc",name:"New Document",version:dZ.version,pages:{page:{id:"page",name:"Page 1",childIndex:1,shapes:{},bindings:{}}},pageStates:{page:{id:"page",selectedIds:[],camera:{point:[0,0],zoom:1}}},assets:{}}),oM(dZ,"defaultState",{settings:{isCadSelectMode:!1,isPenMode:!1,isDarkMode:!1,isZoomSnap:!1,isFocusMode:!1,isSnapping:!1,isDebugMode:!1,isReadonlyMode:!1,keepStyleMenuOpen:!1,nudgeDistanceLarge:16,nudgeDistanceSmall:1,showRotateHandles:!0,showBindingHandles:!0,showCloneHandles:!1,showGrid:!1,language:"en",dockPosition:"bottom",exportBackground:"transparent"},appState:{status:"idle",activeTool:"select",hoveredId:void 0,currentPageId:"page",currentStyle:s$,isToolLocked:!1,isMenuOpen:!1,isEmptyCanvas:!1,eraseLine:[],snapLines:[],isLoading:!1,disableAssets:!1},document:dZ.defaultDocument}),oM(dZ,"assetSrc","tldraw-assets.json");var dK=ic.ErrorBoundary,dq="u">typeof window&&!!window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,dY=R.memo(function({id:e,autofocus:t,showPages:i,showMenu:n,showMultiplayerMenu:a,showZoom:r,showStyles:o,showTools:s,readOnly:l,showUI:d}){var c,u,p;let h=o1(),[m,g]=R.useState(null),f=R.useRef(null),b=h.useStore(),{document:x,settings:y,appState:v,room:C}=b,w="select"===b.appState.activeTool,S=x.pages[v.currentPageId],k=x.pageStates[S.id],A=x.assets,{selectedIds:E}=k,_=1===E.length&&S.shapes[E[0]]&&s0.getShapeUtil(S.shapes[E[0]].type).hideBounds,I=1===E.length&&S.shapes[E[0]]&&s0.getShapeUtil(S.shapes[E[0]].type).hideResizeHandles,M=R.useMemo(()=>({isDarkMode:y.isDarkMode}),[y.isDarkMode]),T=y.isCadSelectMode?!v.selectByContain:v.selectByContain,L=R.useMemo(()=>{let{selectByContain:e}=v,{isDarkMode:t,isCadSelectMode:i}=y;if(t){let t=i?e?"69, 155, 255":"105, 209, 73":"180, 180, 180";return{brushFill:`rgba(${t}, ${i?.08:.05})`,brushStroke:`rgba(${t}, ${i?.5:.25})`,brushDashStroke:`rgba(${t}, .6)`,selected:"rgba(38, 150, 255, 1.000)",selectFill:"rgba(38, 150, 255, 0.05)",background:"#212529",foreground:"#49555f"}}let n=i?e?"0, 89, 242":"51, 163, 23":"0,0,0";return{brushFill:`rgba(${n}, ${i?.08:.05})`,brushStroke:`rgba(${n}, ${i?.4:.25})`,brushDashStroke:`rgba(${n}, .6)`}},[y.isDarkMode,y.isCadSelectMode,v.selectByContain]),j=void 0!==h.session,P=j&&(null==(c=h.session)?void 0:c.constructor.name)!=="BrushSession"||!w||_||!!k.editingId,D=j||!w,N=j&&"brushing"!==b.appState.status||!w,O=j||!w||k.camera.zoom<.2,B=(p=y.language,R.useMemo(()=>{var e,t;let i;return e=null!=p?p:navigator.language.split(/[-_]/)[0],i=o5.find(t=>t.locale===e),{locale:e,label:null!=(t=null==i?void 0:i.label)?t:e,messages:oE(oE({},o3),null==i?void 0:i.messages)}},[p]));return R.useLayoutEffect(()=>{let e=f.current;e&&(y.isDarkMode?e.classList.add(o8):e.classList.remove(o8))},[y.isDarkMode]),R.default.useEffect(()=>{let e=!1,t=!1,i=f.current;if(!i)return;let n=n=>{" "!==n.key||t||(t=!0,e?i.setAttribute("style","cursor: grabbing !important"):i.setAttribute("style","cursor: grab !important"))},a=e=>{" "===e.key&&(t=!1,i.setAttribute("style","cursor: initial"))},r=n=>{e=!0,1===n.button&&i.setAttribute("style","cursor: grabbing !important"),0===n.button&&t&&i.setAttribute("style","cursor: grabbing !important")},o=()=>{e=!1,t?i.setAttribute("style","cursor: grab !important"):i.setAttribute("style","cursor: initial")};return i.addEventListener("keydown",n),i.addEventListener("keyup",a),i.addEventListener("pointerdown",r),i.addEventListener("pointerup",o),()=>{i.removeEventListener("keydown",n),i.removeEventListener("keyup",a),i.removeEventListener("pointerdown",r),i.removeEventListener("pointerup",o)}},[f.current]),R.createElement(o2.Provider,{value:f},R.createElement(al,{locale:B.locale,messages:B.messages},R.createElement(dQ,{ref:f,tabIndex:-0},R.createElement(se,null),R.createElement(dX,{focusableRef:f,autofocus:t}),R.createElement(dK,{FallbackComponent:R.createElement("span",null)},R.createElement(is,{id:e,containerRef:f,shapeUtils:di,page:S,pageState:k,assets:A,snapLines:v.snapLines,eraseLine:v.eraseLine,grid:8,users:null==C?void 0:C.users,userId:null==C?void 0:C.userId,theme:L,meta:M,hideBounds:P,hideHandles:D,hideResizeHandles:I,hideIndicators:N,hideBindingHandles:!y.showBindingHandles,hideCloneHandles:O,hideRotateHandles:!y.showRotateHandles,hideGrid:!y.showGrid,showDashedBrush:T,performanceMode:null==(u=h.session)?void 0:u.performanceMode,onPinchStart:h.onPinchStart,onPinchEnd:h.onPinchEnd,onPinch:h.onPinch,onPan:h.onPan,onZoom:h.onZoom,onPointerDown:h.onPointerDown,onPointerMove:h.onPointerMove,onPointerUp:h.onPointerUp,onPointCanvas:h.onPointCanvas,onDoubleClickCanvas:h.onDoubleClickCanvas,onRightPointCanvas:h.onRightPointCanvas,onDragCanvas:h.onDragCanvas,onReleaseCanvas:h.onReleaseCanvas,onPointShape:h.onPointShape,onDoubleClickShape:h.onDoubleClickShape,onRightPointShape:h.onRightPointShape,onDragShape:h.onDragShape,onHoverShape:h.onHoverShape,onUnhoverShape:h.onUnhoverShape,onReleaseShape:h.onReleaseShape,onPointBounds:h.onPointBounds,onDoubleClickBounds:h.onDoubleClickBounds,onRightPointBounds:h.onRightPointBounds,onDragBounds:h.onDragBounds,onHoverBounds:h.onHoverBounds,onUnhoverBounds:h.onUnhoverBounds,onReleaseBounds:h.onReleaseBounds,onPointBoundsHandle:h.onPointBoundsHandle,onDoubleClickBoundsHandle:h.onDoubleClickBoundsHandle,onRightPointBoundsHandle:h.onRightPointBoundsHandle,onDragBoundsHandle:h.onDragBoundsHandle,onHoverBoundsHandle:h.onHoverBoundsHandle,onUnhoverBoundsHandle:h.onUnhoverBoundsHandle,onReleaseBoundsHandle:h.onReleaseBoundsHandle,onPointHandle:h.onPointHandle,onDoubleClickHandle:h.onDoubleClickHandle,onRightPointHandle:h.onRightPointHandle,onDragHandle:h.onDragHandle,onHoverHandle:h.onHoverHandle,onUnhoverHandle:h.onUnhoverHandle,onReleaseHandle:h.onReleaseHandle,onError:h.onError,onRenderCountChange:h.onRenderCountChange,onShapeChange:h.onShapeChange,onShapeBlur:h.onShapeBlur,onShapeClone:h.onShapeClone,onBoundsChange:h.updateBounds,onKeyDown:h.onKeyDown,onKeyUp:h.onKeyUp,onDragOver:h.onDragOver,onDrop:h.onDrop})))))}),dX=R.memo(function({focusableRef:e,autofocus:t}){return function(e){let t=o1(),i=R.useCallback((i=!1)=>{let n=e.current;return!!i&&(!!t.isMenuOpen||!!t.settings.keepStyleMenuOpen)||(null==n||n.focus(),n&&(document.activeElement===n||n.contains(document.activeElement)))},[e]);R.useEffect(()=>{if(!t)return;let e=e=>{if(i(!0)){if(t.readOnly)return void t.copy(void 0,e);t.cut(void 0,e)}},n=e=>{i(!0)&&t.copy(void 0,e)},a=e=>{!i(!0)||t.readOnly||t.paste(void 0,e)};return document.addEventListener("cut",e),document.addEventListener("copy",n),document.addEventListener("paste",a),()=>{document.removeEventListener("cut",e),document.removeEventListener("copy",n),document.removeEventListener("paste",a)}},[t]),aR("v,1",()=>{i(!0)&&t.selectTool("select")},[t,e.current]),aR("d,p,2",()=>{i(!0)&&t.selectTool("draw")},void 0,[t]),aR("e,3",()=>{i(!0)&&t.selectTool("erase")},void 0,[t]),aR("r,4",()=>{i(!0)&&t.selectTool("rectangle")},void 0,[t]),aR("o,5",()=>{i(!0)&&t.selectTool("ellipse")},void 0,[t]),aR("g,6",()=>{i()&&t.selectTool("triangle")},void 0,[t]),aR("l,7",()=>{i(!0)&&t.selectTool("line")},void 0,[t]),aR("a,8",()=>{i(!0)&&t.selectTool("arrow")},void 0,[t]),aR("t,9",()=>{i(!0)&&t.selectTool("text")},void 0,[t]),aR("s,0",()=>{i(!0)&&t.selectTool("sticky")},void 0,[t]),aR("ctrl+shift+d,⌘+shift+d",e=>{i(!0)&&(t.toggleDarkMode(),e.preventDefault())},void 0,[t]),aR("ctrl+.,⌘+.",()=>{i(!0)&&t.toggleFocusMode()},void 0,[t]),aR("ctrl+shift+g,⌘+shift+g",()=>{i(!0)&&t.toggleGrid()},void 0,[t]);let{onNewProject:n,onOpenProject:a,onSaveProject:r,onSaveProjectAs:o,onOpenMedia:s}=function(){let e=o1(),{openDialog:t}=(()=>{let e=R.useContext(o4);if(!e)throw Error("useCtx must be inside a Provider with a value");return e})();return{onNewProject:R.useCallback(i=>oT(this,null,function*(){var n,a;i&&e.callbacks.onOpenProject&&i.preventDefault(),null==(a=(n=e.callbacks).onNewProject)||a.call(n,e,t)}),[e,t]),onSaveProject:R.useCallback(t=>{var i,n;t&&e.callbacks.onOpenProject&&t.preventDefault(),null==(n=(i=e.callbacks).onSaveProject)||n.call(i,e)},[e]),onSaveProjectAs:R.useCallback(t=>{var i,n;t&&e.callbacks.onOpenProject&&t.preventDefault(),null==(n=(i=e.callbacks).onSaveProjectAs)||n.call(i,e)},[e]),onOpenProject:R.useCallback(i=>oT(this,null,function*(){var n,a;i&&e.callbacks.onOpenProject&&i.preventDefault(),null==(a=(n=e.callbacks).onOpenProject)||a.call(n,e,t)}),[e,t]),onOpenMedia:R.useCallback(t=>oT(this,null,function*(){var i,n;t&&e.callbacks.onOpenMedia&&t.preventDefault(),null==(n=(i=e.callbacks).onOpenMedia)||n.call(i,e)}),[e])}}();aR("ctrl+n,⌘+n",e=>{e.preventDefault(),i()&&n(e)},void 0,[t]),aR("ctrl+s,⌘+s",e=>{i()&&r(e)},void 0,[t]),aR("ctrl+shift+s,⌘+shift+s",e=>{i()&&o(e)},void 0,[t]),aR("ctrl+o,⌘+o",e=>{i()&&a(e)},void 0,[t]),aR("ctrl+u,⌘+u",e=>{i()&&s(e)},void 0,[t]),aR("⌘+z,ctrl+z",e=>{e.preventDefault(),i(!0)&&(t.session?t.cancelSession():t.undo())},void 0,[t]),aR("ctrl+shift+z,⌘+shift+z",()=>{i(!0)&&(t.session?t.cancelSession():t.redo())},void 0,[t]),aR("⌘+u,ctrl+u",()=>{i()&&t.undoSelect()},void 0,[t]),aR("ctrl+shift-u,⌘+shift+u",()=>{i()&&t.redoSelect()},void 0,[t]),aR("ctrl+=,⌘+=,ctrl+num_add,⌘+num_add",e=>{i(!0)&&(t.zoomIn(),e.preventDefault())},void 0,[t]),aR("ctrl+-,⌘+-,ctrl+num_subtract,⌘+num_subtract",e=>{i(!0)&&(t.zoomOut(),e.preventDefault())},void 0,[t]),aR("shift+0,ctrl+numpad_0,⌘+numpad_0",()=>{i(!0)&&t.resetZoom()},void 0,[t]),aR("shift+1",()=>{i(!0)&&t.zoomToFit()},void 0,[t]),aR("shift+2",()=>{i(!0)&&t.zoomToSelection()},void 0,[t]),aR("ctrl+d,⌘+d",e=>{i()&&(t.duplicate(),e.preventDefault())},void 0,[t]),aR("shift+h",()=>{i(!0)&&t.flipHorizontal()},void 0,[t]),aR("shift+v",()=>{i(!0)&&t.flipVertical()},void 0,[t]),aR("escape",()=>{i(!0)&&t.cancel()},void 0,[t]),aR("backspace,del",()=>{i()&&t.delete()},void 0,[t]),aR("⌘+a,ctrl+a",()=>{i(!0)&&t.selectAll()},void 0,[t]),aR("up",()=>{i()&&t.nudge([0,-1],!1)},void 0,[t]),aR("right",()=>{i()&&t.nudge([1,0],!1)},void 0,[t]),aR("down",()=>{i()&&t.nudge([0,1],!1)},void 0,[t]),aR("left",()=>{i()&&t.nudge([-1,0],!1)},void 0,[t]),aR("shift+up",()=>{i()&&t.nudge([0,-1],!0)},void 0,[t]),aR("shift+right",()=>{i()&&t.nudge([1,0],!0)},void 0,[t]),aR("shift+down",()=>{i()&&t.nudge([0,1],!0)},void 0,[t]),aR("shift+left",()=>{i()&&t.nudge([-1,0],!0)},void 0,[t]),aR("⌘+shift+l,ctrl+shift+l",()=>{i()&&t.toggleLocked()},void 0,[t]),aR("⌘+shift+c,ctrl+shift+c",e=>{i()&&(t.copySvg(),e.preventDefault())},void 0,[t]),aR("⌘+g,ctrl+g",e=>{i()&&(t.group(),e.preventDefault())},void 0,[t]),aR("⌘+shift+g,ctrl+shift+g",e=>{i()&&(t.ungroup(),e.preventDefault())},void 0,[t]),aR("[",()=>{i(!0)&&t.moveBackward()},void 0,[t]),aR("]",()=>{i(!0)&&t.moveForward()},void 0,[t]),aR("shift+[",()=>{i(!0)&&t.moveToBack()},void 0,[t]),aR("shift+]",()=>{i(!0)&&t.moveToFront()},void 0,[t]),aR("ctrl+shift+backspace,⌘+shift+backspace",e=>{i()&&(t.settings.isDebugMode&&t.resetDocument(),e.preventDefault())},void 0,[t]),aR("alt+command+l,alt+ctrl+l",e=>{i(!0)&&(t.style({textAlign:"start"}),e.preventDefault())},void 0,[t]),aR("alt+command+t,alt+ctrl+t",e=>{i(!0)&&(t.style({textAlign:"middle"}),e.preventDefault())},void 0,[t]),aR("alt+command+r,alt+ctrl+r",e=>{i(!0)&&(t.style({textAlign:"end"}),e.preventDefault())},void 0,[t])}(e),R.useLayoutEffect(()=>{if(oX.get(oQ))return;let e=document.createElement("style");return e.innerHTML=oJ,e.setAttribute("id",oQ),document.head.appendChild(e),oX.set(oQ,e),()=>{e&&document.head.contains(e)&&(document.head.removeChild(e),oX.delete(oQ))}},[]),R.useEffect(()=>{var i;t&&(null==(i=e.current)||i.focus())},[t]),null}),dQ=o6("div",{position:"absolute",height:"100%",width:"100%",minHeight:0,minWidth:0,maxHeight:"100%",maxWidth:"100%",overflow:"hidden",boxSizing:"border-box",outline:"none","& .tl-container":{position:"absolute",top:0,left:0,height:"100%",width:"100%",zIndex:1},"& input, textarea, button, select, label, button":{webkitTouchCallout:"none",webkitUserSelect:"none","-webkit-tap-highlight-color":"transparent","tap-highlight-color":"transparent"}});o6("div",{position:"absolute",top:0,left:0,height:"100%",width:"100%",padding:"8px 8px 0 8px",display:"flex",alignItems:"flex-start",justifyContent:"flex-start",pointerEvents:"none",zIndex:2,"& > *":{pointerEvents:"all"}}),o6("div",{flexGrow:2}),e.s(["AlignStyle",0,o$,"AlignType",0,oR,"ColorStyle",0,oW,"DashStyle",0,oV,"DistributeType",0,oB,"TDAssetType",0,oK,"TDExportType",0,oq,"TDShapeType",0,oF,"TLDR",0,s0,"Tldraw",0,function({id:e,document:t,currentPageId:i,autofocus:n=!0,showMenu:a=!0,showMultiplayerMenu:r=!0,showPages:o=!0,showTools:s=!0,showZoom:l=!0,showStyles:d=!0,showUI:c=!0,readOnly:u=!1,disableAssets:p=!1,darkMode:h=dq,onMount:m,onChange:g,onChangePresence:f,onNewProject:b,onSaveProject:x,onSaveProjectAs:y,onOpenProject:v,onOpenMedia:C,onUndo:w,onRedo:S,onPersist:k,onPatch:A,onCommand:E,onChangePage:_,onAssetCreate:I,onAssetDelete:M,onAssetUpload:T,onSessionStart:L,onSessionEnd:j,onExport:P}){let[D,N]=R.useState(e),[O,B]=R.useState(()=>new dZ(e,{onMount:m,onChange:g,onChangePresence:f,onNewProject:b,onSaveProject:x,onSaveProjectAs:y,onOpenProject:v,onOpenMedia:C,onUndo:w,onRedo:S,onPersist:k,onPatch:A,onCommand:E,onChangePage:_,onAssetDelete:M,onAssetCreate:I,onAssetUpload:T,onSessionStart:L,onSessionEnd:j})),[z,F]=R.useState(null),[H,W]=R.useState(null),[U,V]=R.useState(null),[G,$]=R.useState(null),Z=R.useCallback((e,t,i,n)=>{$(()=>e),F(()=>n),W(()=>t),V(()=>i)},[]);return R.useLayoutEffect(()=>{if(e===D)return;let t=new dZ(e,{onMount:m,onChange:g,onChangePresence:f,onNewProject:b,onSaveProject:x,onSaveProjectAs:y,onOpenProject:v,onOpenMedia:C,onUndo:w,onRedo:S,onPersist:k,onPatch:A,onCommand:E,onChangePage:_,onAssetDelete:M,onAssetCreate:I,onAssetUpload:T,onExport:P,onSessionStart:L,onSessionEnd:j});N(e),B(t)},[D,e]),R.useEffect(()=>{t&&(t.id===O.document.id?O.updateDocument(t):O.loadDocument(t))},[t,O]),R.useEffect(()=>{O.setDisableAssets(p)},[O,p]),R.useEffect(()=>{i&&O.changePage(i)},[i,O]),R.useEffect(()=>{O.readOnly=u,u||(O.selectNone(),O.cancelSession(),O.setEditingId())},[O,u]),R.useEffect(()=>{h!==O.settings.isDarkMode&&O.toggleDarkMode()},[O,h]),R.useEffect(()=>{O.callbacks={onMount:m,onChange:g,onChangePresence:f,onNewProject:b,onSaveProject:x,onSaveProjectAs:y,onOpenProject:v,onOpenMedia:C,onUndo:w,onRedo:S,onPersist:k,onPatch:A,onCommand:E,onChangePage:_,onAssetDelete:M,onAssetCreate:I,onAssetUpload:T,onExport:P,onSessionStart:L,onSessionEnd:j}},[m,g,f,b,x,y,v,C,w,S,k,A,E,_,M,I,T,P,L,j]),R.useLayoutEffect(()=>{var e;if("u">typeof window&&(null==(e=window.document)?void 0:e.fonts))return window.document.fonts.addEventListener("loadingdone",t),()=>{window.document.fonts.removeEventListener("loadingdone",t)};function t(){O.refreshBoundingBoxes()}},[O]),R.createElement(o0.Provider,{value:O},R.createElement(o4.Provider,{value:{onYes:H,onCancel:z,onNo:U,dialogState:G,setDialogState:$,openDialog:Z}},R.createElement(dY,{key:D||"Tldraw",id:D,autofocus:n,showPages:o,showMenu:a,showMultiplayerMenu:r,showStyles:d,showZoom:l,showTools:s,showUI:c,readOnly:u})))},"TldrawApp",0,dZ,"shapeUtils",0,di,"shapesShared",0,su],353653);var dJ=e.i(462480),d0=e.i(418755),d1=e.i(551880);let d2=(e,t)=>{(0,d0.getStore)().dispatch((0,d1.setExpandedDrawingId)(t?{drawingId:e}:{drawingId:null}))},d3=()=>(0,dJ.nanoid)(5);e.s(["generateDrawingId",0,d3,"initializeApp",0,(e,t)=>{e.setSetting("isSnapping",t),setTimeout(()=>{((e,t=128)=>{let{shapes:i,pageState:{camera:n},rendererBounds:a}=e;if(0===i.length)return;let r=tI.getCommonBounds(i.map(s0.getRotatedBounds));if(!r)return;let o=s0.getCameraZoom(Math.min((a.width-t)/r.width,(a.height-t)/r.height)),s=(a.width-r.width*o)/2/o,l=(a.height-r.height*o)/2/o;e.setCamera(z.toFixed(z.sub([s,l],[r.minX,r.minY])),o,"zoomed_to_fit")})(e,t?128:10)})},"setContent",0,(e,t,i)=>{e&&t&&e.replacePageContent(t.shapes,t.bindings,i)},"setDrawingExpanded",0,d2],812059);let d5={flywheel:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1024.2205225919886,y:545.3520002984831,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:sBqhkO1gaRDC33E9nLFRf",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Two

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:605.5691768594324,y:545.3520002984831,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:LuxCoSOJiKidTHonK_r3y",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Four

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:811.2936767672497,y:332.49917028373386,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:jNEccTSx5tCosurJ5Ot2M",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

One

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:786.7936767672497,y:753.4464458368486,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:OUIb317WtLr7vTROMJmRY",type:"text",props:{color:"black",size:"m",w:145.68119328124112,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Three

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:774.4554909171899,y:664.006697053962,rotation:3.141592653589793,isLocked:!1,opacity:1,meta:{},id:"shape:gOmdcWQlSymeyfc0iFv_H",type:"arrow",parentId:"page:page",index:"a8",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-143.39749318568477,y:299.6671450013758},end:{type:"point",x:-296.8596898701958,y:124.06206342608016},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:949.3708512974239,y:475.1522148190538,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:FoSkoOljiovlpXtyepQ0L",type:"arrow",parentId:"page:page",index:"a8G",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-165.31582160993514,y:295.60684693665877},end:{type:"point",x:-292.70420767490987,y:127.69426010254801},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:749.9432407400066,y:507.6958283407593,rotation:4.555309347705199,isLocked:!1,opacity:1,meta:{},id:"shape:xJbFH6GE8sktyfodgK-9d",type:"arrow",parentId:"page:page",index:"a8V",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-141.06822675649278,y:304.84894107910753},end:{type:"point",x:-293.7665666504506,y:149.96506626343376},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:973.8831014746072,y:631.4630835322564,rotation:1.413716694115406,isLocked:!1,opacity:1,meta:{},id:"shape:98AlWuZ3MNJ8HXkw_0SX8",type:"arrow",parentId:"page:page",index:"a9",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-138.9882886080492,y:300.5849857402369},end:{type:"point",x:-290.8832143177716,y:128.98965564678986},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"}],assets:[],meta:{},width:420.44444444444446,svg:'

Two

Four

One

Three

'}},quadrant:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1074.82421875,y:229.03125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:0ok4F6wp2WXfO_JbW55tI",type:"arrow",parentId:"page:page",index:"a1",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:0,start:{type:"point",x:0,y:0},end:{type:"point",x:0,y:400},arrowheadStart:"arrow",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:869.5924737463713,y:27.95840719431982,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lfd5uMWVGIIFlwc_gfUf_",type:"arrow",parentId:"page:page",index:"a2",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:0,start:{type:"point",x:0,y:400},end:{type:"point",x:400,y:400},arrowheadStart:"arrow",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:1026.82421875,y:170.3671875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:c4kLEFg-x_YebbalM4bbJ",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a3",typeName:"shape"},{x:1275.47265625,y:404.9296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:rr2bWXVlRik_OTR3-Mzxb",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:770.2109375,y:404.9296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:4nADMgFMClNzOAl0NqJsR",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a4V",typeName:"shape"},{x:1026.82421875,y:640.79296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:pQUKVKJOu78f_j_B0Y1_-",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"}],assets:[],meta:{},width:434.6666666666667,svg:'

Title

Title

Title

Title

'}},venn:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1175.87109375,y:508.45703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YuAAYaKmNVXbxRM9Ym0z4",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:904.79296875,y:508.45703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ywvivjfUEJxH_FT8HCp6E",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:1040.3320312500002,y:270.0929726013588,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:uoJ_xUvPbDuyBaVh94J02",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3",typeName:"shape"},{x:1092.234375,y:547.42578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:W8BtDrKhUUa_fmB-YfrG4",type:"text",props:{color:"black",size:"m",w:108,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:24,html:'

Expensive

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:1282.02734375,y:547.42578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lLHXbsMOmu2pfYDmh7SMV",type:"text",props:{color:"black",size:"m",w:104,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:24,html:'

Take time

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:1185.5507812500002,y:689.046875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:FJv1W-bQpfCY0dAUn_ezA",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:52,html:'

Low
quality

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:1373.08984375,y:705.67578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tT7vEjVJGLo0tv18nWtJV",type:"text",props:{color:"black",size:"m",w:107,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Cheap

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:1017.1328125,y:705.67578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:gaQCyTxoxdrsvbDkqQV9C",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Fast

',shapeColor:null},parentId:"page:page",index:"a8",typeName:"shape"},{x:1189.5507812500002,y:424.234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VAbhvBq-Ec1CIYnCjzhl2",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Good

',shapeColor:null},parentId:"page:page",index:"a9",typeName:"shape"}],assets:[],meta:{},width:431.1111111111111,svg:'

Expensive

Take time

Low
quality

Cheap

Fast

Good

'}},calendarWeek:{type:"diagram",attrs:{horizontalAlign:null,shapes:[{x:179.0625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hF6E8P7CiXiSsRo7LG0FF",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"Zy",typeName:"shape"},{x:495.4840350809791,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:taayoSjVZnQxAEAkYzW8F",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"Zz",typeName:"shape"},{x:811.9055701619584,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:DogbW2-V83SiEhlezSTF1",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0",typeName:"shape"},{x:1128.3271052429373,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:SzwGSCVn7h1Uo_B_b-0jU",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:1445.4682141660628,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IAo_g6FQp9YK2JWBCaGMU",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:832.3614242096944,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:l_vkpYMsSpaE9s3TN_mKw",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Wed",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Wed

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:1148.7829592906733,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Cw9jJcIeB18UZCowlxx0A",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Thu",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Thu

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:1465.9240682137988,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VvguEUBmR1u7tIdodua_7",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Fri",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Fri

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:204.97813786171344,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lqef5zWrrlQl9HENeGEnL",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Meeting with Jon",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Meeting with Jon

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aD",typeName:"shape"},{x:204.97813786171344,y:605.0019073645135,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IgEYD45iYr1sSFMoAwbyu",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Team bonding",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team bonding

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDG",typeName:"shape"},{x:204.97813786171344,y:297.31890598073045,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Qim4eNR90mSPnWlJh468S",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Checking emails",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Checking emails

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDV",typeName:"shape"},{x:1154.2427431046506,y:295.64859941977187,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IL-fsOSVuSRXre2dwItqj",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"HR meetings",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

HR meetings

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDZ",typeName:"shape"},{x:1154.2427431046506,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:bH7UwVBlNxoEzsh_1zjen",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Onboarding new hire",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Onboarding new hire

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDb",typeName:"shape"},{x:521.3996729426926,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:HAHtaenTwvKec_w0q3MVQ",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Attend CS meeting",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Attend CS meeting

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDd",typeName:"shape"},{x:1471.3838520277761,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:7ONsfQ5KbFBdZuwBMYOXz",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Team happy hour",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team happy hour

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"aDe",typeName:"shape"},{x:1471.3838520277761,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ov9MLbM2hIPHiHbKtLXgq",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Attend CS meeting",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Attend CS meeting

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDf",typeName:"shape"},{x:1471.3838520277761,y:295.64859941977187,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:JcWFs24GgyS_MNCWFyy4F",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Office tour",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Office tour

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDg",typeName:"shape"},{x:837.8212080236717,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:avNg2b0XCoj-PSVRH9NqC",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"1:1 with Zach",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

1:1 with Zach

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDh",typeName:"shape"},{x:837.8212080236717,y:297.45150900814224,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:B3hQTKLjKcuwSsT8VwJpR",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Company all hands",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Company all hands

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDj",typeName:"shape"},{x:837.8212080236717,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Ew3E_uQg_oIqeazf2vqpP",type:"geo",props:{w:251,h:101.34061312191727,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Bugbashing diagrams V2 with eng team",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Bugbashing diagrams V2 with eng team

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDk",typeName:"shape"},{x:837.8212080236717,y:500.13645302107966,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Fg4fxWRIxgyovffXhHIzF",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Customer call",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Customer call

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDkV",typeName:"shape"},{x:1154.2427431046506,y:211.51595163729678,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VvbN_RGjDdrkdA1f5rsRd",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Vendor call",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Vendor call

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDkl",typeName:"shape"},{x:204.97813786171344,y:381.1218603241642,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:2vK8h6FMVleRUW2G9Od19",type:"geo",props:{w:251,h:121.0625,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Setup a call with our food vendor at the office in SF",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Setup a call with our food vendor at the office in SF

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDl",typeName:"shape"},{x:204.97813786171344,y:521.1989530210797,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:9SYkhq44JuzFO637hB390",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:" Lunch",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

🍔 Lunch

',shapeColor:"#26A688",strokeWidth:"none"},parentId:"page:page",index:"aDt",typeName:"shape"},{x:515.9398891287151,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:SDZcV2JidoSxClP0MxiaV",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Tue",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Tue

',shapeColor:null},parentId:"page:page",index:"aE",typeName:"shape"},{x:199.518354047736,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tSOF89upJLNWmMbbVcY6R",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Mon",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Mon

',shapeColor:null},parentId:"page:page",index:"aF",typeName:"shape"}],assets:[{meta:{},id:"asset:1703535279",type:"image",typeName:"asset",props:{name:"Screen Shot 2024-04-10 at 3.37.50 PM.png",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/b63db3d6baac4d469108cf61a4c7ee71/original/Screen-Shot-2024-04-10-at-3.37.50-PM.png",w:2842,h:1550,mimeType:"image/png",isAnimated:!1}},{meta:{},id:"asset:-1866522948",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/c494e974b8cc46b8910df2aa1a4051db/original/tldrawFile.png",w:3841,h:2161,mimeType:"image/png",isAnimated:!1}}],meta:{},width:null,svg:'

Wed

Thu

Fri

Meeting with Jon

Team bonding

Checking emails

HR meetings

Onboarding new hire

Attend CS meeting

Team happy hour

Attend CS meeting

Office tour

1:1 with Zach

Company all hands

Bugbashing diagrams V2 with eng team

Customer call

Vendor call

Setup a call with our food vendor at the office in SF

🍔 Lunch

Tue

Mon

'}},calendarMonths:{type:"diagram",attrs:{horizontalAlign:null,shapes:[{x:187.0625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hF6E8P7CiXiSsRo7LG0FF",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"Zy",typeName:"shape"},{x:621.23828125,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:taayoSjVZnQxAEAkYzW8F",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"Zz",typeName:"shape"},{x:1055.4140625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:DogbW2-V83SiEhlezSTF1",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"a0",typeName:"shape"},{x:1479.765625,y:227.52734375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:n-HH4IouUsStSFr3VNbU-",type:"line",parentId:"page:page",index:"a2",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:-4.6640625,y:22115642650533118e-29},a2:{id:"a2",index:"a2",x:-1292.703125,y:2220446049250313e-28}},shapeColor:null,strokeWidth:"none"},typeName:"shape"},{x:201.34708590770333,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:BEBrp9VENbneWCEP9Z57D",type:"text",props:{color:"black",size:"m",w:389.55916409229667,text:"January",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

January

',shapeColor:null},parentId:"page:page",index:"a3",typeName:"shape"},{x:631.6081020625556,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:-3Bu-xyyud5-NY1mEsn_r",type:"text",props:{color:"black",size:"m",w:399.24346043744436,text:"February",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

February

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:1064.4140625,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:97V6hIrYPl_7kahzLVj4Y",type:"text",props:{color:"black",size:"m",w:397.96463853034425,text:"March",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

March

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:213.4453125,y:262.6015625,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hqEIx0gJpckN8eL0a3_eG",type:"geo",props:{w:377.57421875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Campaign brief",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Campaign brief

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a6",typeName:"shape"},{x:424.8515625,y:350.465234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:L4SJqvXoG-EotQtRMTPY8",type:"geo",props:{w:242.98046875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Brainstorming idea",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Brainstorming idea

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a7",typeName:"shape"},{x:642.359375,y:438.32890625000005,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:5PsZHZLZu4_CVVyhnfMhV",type:"geo",props:{w:317.4921875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Pitching V1 draft",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Pitching V1 draft

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a8",typeName:"shape"},{x:801.10546875,y:526.192578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:gaTWbH01oHY5U8i7-0YWM",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Team sync",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team sync

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a9",typeName:"shape"},{x:1017.24609375,y:614.05625,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:LTp09wJ7CZ4hmqxK3TqOs",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Product launch",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Product launch

',shapeColor:"#26A688",strokeWidth:"none"},parentId:"page:page",index:"aA",typeName:"shape"},{x:1224.703125,y:701.919921875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YRlBT-re2qFu7J2lowdkX",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"PR push",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

PR push

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aB",typeName:"shape"}],assets:[],meta:{},width:null,svg:'

January

February

March

Campaign brief

Brainstorming idea

Pitching V1 draft

Team sync

Product launch

PR push

'}},concentricCircles:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:565.8710406141417,y:267.2348052328804,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:TAw6_9rfNRYvwwWYH_HCE",type:"geo",props:{w:477.70836857906545,h:477.70836857906545,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:616.0939715727751,y:367.685804457496,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:EgzihrX9ISnR1IDnH3Nb-",type:"geo",props:{w:377.2573693544499,h:377.2573693544499,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:668.9469658115557,y:473.48237590821486,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:PjG3dFUaDsYRxpsyfV9pW",type:"geo",props:{w:271.5513808768887,h:271.5513808768887,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3",typeName:"shape"},{x:710.2141277616566,y:556.2474435629489,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:q-kyMkxhO2b6WeTH0ets_",type:"geo",props:{w:189.21399728645815,h:189.21399728645815,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"a4",typeName:"shape"},{x:464.90514248458214,y:65.35157205630884,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:j5viwZdfHENtGXtzpl0By",type:"geo",props:{w:679.628218169672,h:679.628218169672,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0",typeName:"shape"},{x:510.91801733541865,y:157.35060141748204,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ktAwuZYMrly1jH7bcYmPU",type:"geo",props:{w:587.634481733614,h:587.634481733614,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0V",typeName:"shape"},{x:725.4037617637376,y:93.6328125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:arpSUqzdolhE3v92x2Hlg",type:"text",props:{color:"black",size:"m",w:159,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Strangers

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:698.7226562500001,y:191.5703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:p4dDCuUjLEG9hLXieB7uX",type:"text",props:{color:"black",size:"m",w:211.83203125000003,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Community

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:698.7226562500001,y:300.83203125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IQ2anr8KXqvDn1DTJJIM1",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Acquaintances

',shapeColor:null},parentId:"page:page",index:"a8",typeName:"shape"},{x:698.7226562500001,y:410.09375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:O77tcKAFokcE_JogX_h3n",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Friends

',shapeColor:null},parentId:"page:page",index:"a9",typeName:"shape"},{x:698.7226562500001,y:497.0234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Ku24cDrP5-0A12pFZdch1",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Family

',shapeColor:null},parentId:"page:page",index:"aA",typeName:"shape"},{x:698.7226562500001,y:628.6171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Bd8YnNb0vDeKdtlRMcNh_",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Me

',shapeColor:"#FFFFFF"},parentId:"page:page",index:"aB",typeName:"shape"}],assets:[{meta:{},id:"asset:1250396056",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/1503bafa04414cc2a7b9848c75a23885/original/tldrawFile.png",w:800,h:801,mimeType:"image/png",isAnimated:!1}}],meta:{},width:360,svg:'

Strangers

Community

Acquaintances

Friends

Family

Me

'}},targetCircles:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:929.6197161942252,y:155.0916582850458,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Lyhoe8Jk5MAMoudOizb8X",type:"geo",props:{w:500.14804571219815,h:500.14804571219815,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0G",typeName:"shape"},{x:967.92743672945,y:193.45976889185556,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:RYOvVH5HKvjk5GXZojXEJ",type:"geo",props:{w:423.4118244985782,h:423.4118244985782,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0l",typeName:"shape"},{x:1007.5906901264586,y:233.06263221727892,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:guJhyRC2_2GgZ9f0HcNJR",type:"geo",props:{w:344.20609784773154,h:344.20609784773154,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1V",typeName:"shape"},{x:1043.7799729004403,y:269.2519149912604,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:seEkM5XtC9yIw7hoXfdbS",type:"geo",props:{w:271.8275322997684,h:271.8275322997684,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2V",typeName:"shape"},{x:1081.7319672065987,y:307.3344023477454,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:NS2ahjw0mGlpg-PMYOxM8",type:"geo",props:{w:195.6625575867985,h:195.6625575867985,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3V",typeName:"shape"},{x:1115.50785950286,y:340.94563257104426,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:3f1yjdcch_VMlWXK600PT",type:"geo",props:{w:128.4400971402006,h:128.4400971402006,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"a4V",typeName:"shape"},{x:1073.6937390503244,y:381.6656811411451,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:1FLv65NIvaurbbxTQrE18",type:"text",props:{color:"black",size:"m",w:212,text:"Me",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Me

',shapeColor:"#FFFFFF"},parentId:"page:page",index:"aB",typeName:"shape"},{x:1381.0026472829704,y:173.17393949526377,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Q6dHtLEQiLE4grg0RCM-A",type:"line",parentId:"page:page",index:"aC",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:2.417216937863941,y:7.723304968297555},a2:{id:"a2",index:"a2",x:-52.226471674030236,y:48.30663418059406}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:245.48057367585784,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:V6TsnoH4I7lC4eFh_jCVf",type:"line",parentId:"page:page",index:"aCV",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:48.001155258881184,y:41.665293041944466},a2:{id:"a2",index:"a2",x:-47.682312332765534,y:66.29026038484135}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1418.8041070476638,y:554.4103614129623,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Z7iFyapJSWnC-Nj48trDz",type:"line",parentId:"page:page",index:"aCd",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:28.116150018295414,y:-27.85190422662322},a2:{id:"a2",index:"a2",x:-138.26659908197,y:-91.24836881350053}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:405.1656811411451,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:UyPPQxh5Izzrta_PeC4Lv",type:"line",parentId:"page:page",index:"aCl",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:94.52397902306642,y:3674838211509268e-29},a2:{id:"a2",index:"a2",x:-62.28449928723883,y:3674838211509268e-29}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:680.9410126688012,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YvmG2cbsMv-yBAjUCLAZV",type:"line",parentId:"page:page",index:"aD",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:-30.33301659894073,y:-34.31453399190673},a2:{id:"a2",index:"a2",x:-187.1016230443878,y:-198.11935311752904}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1456.428646134135,y:520.7240691140834,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:EdTs6rzP02YRCn-NSSouG",type:"text",props:{color:"black",size:"m",w:190.61066381032765,text:"Friends",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Friends

',shapeColor:null},parentId:"page:page",index:"aE",typeName:"shape"},{x:1373.8179823238074,y:633.1902718076452,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:9DzQSxc3Xru2fKGSdFx16",type:"text",props:{color:"black",size:"m",w:191,text:"Family",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Family

',shapeColor:null},parentId:"page:page",index:"aF",typeName:"shape"},{x:1496.9281991809464,y:383.1656811411449,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VKIjJjszvAlrkJQJfGUV1",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Acquaintances",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Acquaintances

',shapeColor:null},parentId:"page:page",index:"aG",typeName:"shape"},{x:1451.2460195004435,y:263.4599680925235,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:V6a9zGihrEPKbWp0WyYFu",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Community",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Community

',shapeColor:null},parentId:"page:page",index:"aH",typeName:"shape"},{x:1389.4198642208344,y:155.14109047464459,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tneIatSl5yj2J6kQLD4Hy",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Strangers",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Strangers

',shapeColor:null},parentId:"page:page",index:"aI",typeName:"shape"}],assets:[{meta:{},id:"asset:1250396056",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/1503bafa04414cc2a7b9848c75a23885/original/tldrawFile.png",w:800,h:801,mimeType:"image/png",isAnimated:!1}}],meta:{},width:534.2222222222222,svg:'

Me

Friends

Family

Acquaintances

Community

Strangers

'}}},d4={src:e.i(340917).default,width:253,height:96,blurWidth:0,blurHeight:0},d6={src:e.i(28113).default,width:253,height:96,blurWidth:0,blurHeight:0},d9=()=>[{key:"diagram",name:()=>M.i18n._({id:"G1q1hG",message:"Blank diagram"}),keywords:["sketch","drawing","shapes","diagram","canvas","freeform"],shortcut:"/diagram"},{key:"calendarWeek",name:()=>M.i18n._({id:"ToE1YL",message:"Weekly calendar"}),keywords:["week","days","calendar","diagram","kanban","schedule","timeline"],icon:I.faCalendarWeek,previewImage:d6},{key:"calendarMonths",name:()=>M.i18n._({id:"jIipv0",message:"Gantt chart"}),keywords:["month","days","calendar","diagram","kanban","schedule","gantt chart","timeline"],icon:I.faCalendars,previewImage:d4}].map(e=>{let t="diagram"===e.key?{type:"diagram",attrs:{}}:d5[e.key];return{nodeName:"diagram",icon:I.faShapes,...e,execute:e=>{let i=d3(),n=(0,N.default)(t);n.attrs.id=i,d2(i,!0),e.commands.insertContent(n)},dragStartFn:e=>{let i=d3(),n=(0,N.default)(t);n.attrs.id=i,d2(i,!0),(0,j.setDraggingContent)({editor:e,content:n})}}}).filter(e=>!!e);var d8=e.i(979021),d7=e.i(175863);let ce=(e,t)=>{let i=(0,d0.getStore)();i.dispatch((0,d1.setExpandedNoteId)(t?{noteId:e}:{noteId:null}));let n=i.getState();!t&&(0,d1.selectIsEditingMedia)(n)&&i.dispatch((0,d1.setIsEditingMedia)({isEditingMedia:!1})),!t&&(0,d1.selectExpandedMediaId)(n)&&i.dispatch((0,d1.setMediaNodeExpanded)({nodeId:null}))},ct=(0,d8.default)(ce,30);e.s(["generateFootnoteId",0,()=>(0,dJ.nanoid)(5),"getExpandedFootnoteId",0,()=>{let e=(0,d0.getStore)().getState();return(0,d1.selectExpandedNoteId)(e)},"isFootnoteSelected",0,e=>e instanceof d7.NodeSelection&&"footnote"===e.node.type.name,"setFootnoteExpanded",0,ce,"setFootnoteExpandedDebounced",0,ct],517344);var ci=e.i(524617);let cn="fromInnerEditor";e.s(["INNER_EDITOR_META_KEY",0,cn,"OUTER_EDITOR_META_KEY",0,"fromOuterEditor"],785872),e.s(["isFootnoteEditor",0,e=>"footnote"==e.schema.topNodeType.name,"preventLeakyMarks",0,(e,t,i,n,a="footnote")=>{e.forEach(e=>{let t=e.steps.filter(e=>e instanceof ci.AddMarkStep||e instanceof ci.RemoveMarkStep);0==t.length||e.getMeta(cn)||e.getMeta("appendedTransaction")||t.forEach(e=>{let{from:t,to:r,mark:o}=e;i.doc.nodesBetween(t,r,(i,s)=>{i.type.name===a&&sco],296691);var ca=e.i(428856),cr=e.i(254140);let co=()=>{let e=M.i18n._({id:"bJmm4q",message:" chart"});return ca.CHART_TYPE_CONFIGS.filter(e=>!e.hidden).map(t=>({nodeName:"graphyChart",key:`graphyChart${t.key.charAt(0).toUpperCase()+t.key.slice(1)}`,name:()=>`${t.label()}${e}`,icon:t.icon,keywords:["chart","graph","data","visualization",t.key,...t.keywords??[]],execute:e=>{e.commands.insertGraphyChart(t.key)},dragStartFn:e=>{let i=(0,cr.createGraphConfigFromSampleData)(t.key);(0,j.setDraggingContent)({editor:e,content:{type:"graphyChart",attrs:{chartType:t.key,chartData:i}}})}}))}},189779,(e,t,i)=>{"use strict";let{entries:n,setPrototypeOf:a,isFrozen:r,getPrototypeOf:o,getOwnPropertyDescriptor:s}=Object,{freeze:l,seal:d,create:c}=Object,{apply:u,construct:p}="u">typeof Reflect&&Reflect;l||(l=function(e){return e}),d||(d=function(e){return e}),u||(u=function(e,t,i){return e.apply(t,i)}),p||(p=function(e,t){return new e(...t)});let h=_(Array.prototype.forEach),m=_(Array.prototype.lastIndexOf),g=_(Array.prototype.pop),f=_(Array.prototype.push),b=_(Array.prototype.splice),x=_(String.prototype.toLowerCase),y=_(String.prototype.toString),v=_(String.prototype.match),C=_(String.prototype.replace),w=_(String.prototype.indexOf),S=_(String.prototype.trim),k=_(Object.prototype.hasOwnProperty),A=_(RegExp.prototype.test),E=(X=TypeError,function(){for(var e=arguments.length,t=Array(e),i=0;i1?i-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:x;a&&a(e,null);let n=t.length;for(;n--;){let a=t[n];if("string"==typeof a){let e=i(a);e!==a&&(r(t)||(t[n]=e),a=e)}e[a]=!0}return e}function M(e){let t=c(null);for(let[i,a]of n(e))k(e,i)&&(Array.isArray(a)?t[i]=function(e){for(let t=0;t/gm),V=d(/\$\{[\w\W]*/gm),G=d(/^data-[\-\w.\u00B7-\uFFFF]+$/),$=d(/^aria-[\-\w]+$/),Z=d(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),K=d(/^(?:\w+script|data):/i),q=d(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Y=d(/^html$/i);var X,Q=Object.freeze({__proto__:null,ARIA_ATTR:$,ATTR_WHITESPACE:q,CUSTOM_ELEMENT:d(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:G,DOCTYPE_NAME:Y,ERB_EXPR:U,IS_ALLOWED_URI:Z,IS_SCRIPT_OR_DATA:K,MUSTACHE_EXPR:W,TMPLIT_EXPR:V});let J=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let a="dompurify"+(i?"#"+i:"");try{return e.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}},ee=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};t.exports=function e(){let t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"e(t);if(a.version="3.2.6",a.removed=[],!i||!i.document||9!==i.document.nodeType||!i.Element)return a.isSupported=!1,a;let{document:r}=i,o=r,s=o.currentScript,{DocumentFragment:d,HTMLTemplateElement:u,Node:p,Element:_,NodeFilter:W,NamedNodeMap:U=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:V,DOMParser:G,trustedTypes:$}=i,K=_.prototype,q=T(K,"cloneNode"),X=T(K,"remove"),et=T(K,"nextSibling"),ei=T(K,"childNodes"),en=T(K,"parentNode");if("function"==typeof u){let e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let ea="",{implementation:er,createNodeIterator:eo,createDocumentFragment:es,getElementsByTagName:el}=r,{importNode:ed}=o,ec=ee();a.isSupported="function"==typeof n&&"function"==typeof en&&er&&void 0!==er.createHTMLDocument;let{MUSTACHE_EXPR:eu,ERB_EXPR:ep,TMPLIT_EXPR:eh,DATA_ATTR:em,ARIA_ATTR:eg,IS_SCRIPT_OR_DATA:ef,ATTR_WHITESPACE:eb,CUSTOM_ELEMENT:ex}=Q,{IS_ALLOWED_URI:ey}=Q,ev=null,eC=I({},[...L,...j,...P,...N,...O]),ew=null,eS=I({},[...B,...z,...F,...H]),ek=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),eA=null,eE=null,e_=!0,eI=!0,eM=!1,eT=!0,eL=!1,ej=!0,eP=!1,eD=!1,eN=!1,eR=!1,eO=!1,eB=!1,ez=!0,eF=!1,eH=!0,eW=!1,eU={},eV=null,eG=I({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),e$=null,eZ=I({},["audio","video","img","source","image","track"]),eK=null,eq=I({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),eY="http://www.w3.org/1998/Math/MathML",eX="http://www.w3.org/2000/svg",eQ="http://www.w3.org/1999/xhtml",eJ=eQ,e0=!1,e1=null,e2=I({},[eY,eX,eQ],y),e3=I({},["mi","mo","mn","ms","mtext"]),e5=I({},["annotation-xml"]),e4=I({},["title","style","font","a","script"]),e6=null,e9=["application/xhtml+xml","text/html"],e8=null,e7=null,te=r.createElement("form"),tt=function(e){return e instanceof RegExp||e instanceof Function},ti=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e7||e7!==e){if(e&&"object"==typeof e||(e={}),e=M(e),e8="application/xhtml+xml"===(e6=-1===e9.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?y:x,ev=k(e,"ALLOWED_TAGS")?I({},e.ALLOWED_TAGS,e8):eC,ew=k(e,"ALLOWED_ATTR")?I({},e.ALLOWED_ATTR,e8):eS,e1=k(e,"ALLOWED_NAMESPACES")?I({},e.ALLOWED_NAMESPACES,y):e2,eK=k(e,"ADD_URI_SAFE_ATTR")?I(M(eq),e.ADD_URI_SAFE_ATTR,e8):eq,e$=k(e,"ADD_DATA_URI_TAGS")?I(M(eZ),e.ADD_DATA_URI_TAGS,e8):eZ,eV=k(e,"FORBID_CONTENTS")?I({},e.FORBID_CONTENTS,e8):eG,eA=k(e,"FORBID_TAGS")?I({},e.FORBID_TAGS,e8):M({}),eE=k(e,"FORBID_ATTR")?I({},e.FORBID_ATTR,e8):M({}),eU=!!k(e,"USE_PROFILES")&&e.USE_PROFILES,e_=!1!==e.ALLOW_ARIA_ATTR,eI=!1!==e.ALLOW_DATA_ATTR,eM=e.ALLOW_UNKNOWN_PROTOCOLS||!1,eT=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,eL=e.SAFE_FOR_TEMPLATES||!1,ej=!1!==e.SAFE_FOR_XML,eP=e.WHOLE_DOCUMENT||!1,eR=e.RETURN_DOM||!1,eO=e.RETURN_DOM_FRAGMENT||!1,eB=e.RETURN_TRUSTED_TYPE||!1,eN=e.FORCE_BODY||!1,ez=!1!==e.SANITIZE_DOM,eF=e.SANITIZE_NAMED_PROPS||!1,eH=!1!==e.KEEP_CONTENT,eW=e.IN_PLACE||!1,ey=e.ALLOWED_URI_REGEXP||Z,eJ=e.NAMESPACE||eQ,e3=e.MATHML_TEXT_INTEGRATION_POINTS||e3,e5=e.HTML_INTEGRATION_POINTS||e5,ek=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(ek.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&tt(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(ek.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(ek.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),eL&&(eI=!1),eO&&(eR=!0),eU&&(ev=I({},O),ew=[],!0===eU.html&&(I(ev,L),I(ew,B)),!0===eU.svg&&(I(ev,j),I(ew,z),I(ew,H)),!0===eU.svgFilters&&(I(ev,P),I(ew,z),I(ew,H)),!0===eU.mathMl&&(I(ev,N),I(ew,F),I(ew,H))),e.ADD_TAGS&&(ev===eC&&(ev=M(ev)),I(ev,e.ADD_TAGS,e8)),e.ADD_ATTR&&(ew===eS&&(ew=M(ew)),I(ew,e.ADD_ATTR,e8)),e.ADD_URI_SAFE_ATTR&&I(eK,e.ADD_URI_SAFE_ATTR,e8),e.FORBID_CONTENTS&&(eV===eG&&(eV=M(eV)),I(eV,e.FORBID_CONTENTS,e8)),eH&&(ev["#text"]=!0),eP&&I(ev,["html","head","body"]),ev.table&&(I(ev,["tbody"]),delete eA.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw E('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ea=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=J($,s)),null!==t&&"string"==typeof ea&&(ea=t.createHTML(""));l&&l(e),e7=e}},tn=I({},[...j,...P,...D]),ta=I({},[...N,...R]),tr=function(e){let t=en(e);t&&t.tagName||(t={namespaceURI:eJ,tagName:"template"});let i=x(e.tagName),n=x(t.tagName);return!!e1[e.namespaceURI]&&(e.namespaceURI===eX?t.namespaceURI===eQ?"svg"===i:t.namespaceURI===eY?"svg"===i&&("annotation-xml"===n||e3[n]):!!tn[i]:e.namespaceURI===eY?t.namespaceURI===eQ?"math"===i:t.namespaceURI===eX?"math"===i&&e5[n]:!!ta[i]:e.namespaceURI===eQ?(t.namespaceURI!==eX||!!e5[n])&&(t.namespaceURI!==eY||!!e3[n])&&!ta[i]&&(e4[i]||!tn[i]):"application/xhtml+xml"===e6&&!!e1[e.namespaceURI])},to=function(e){f(a.removed,{element:e});try{en(e).removeChild(e)}catch(t){X(e)}},ts=function(e,t){try{f(a.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){f(a.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(eR||eO)try{to(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},tl=function(e){let i=null,n=null;if(eN)e=""+e;else{let t=v(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===e6&&eJ===eQ&&(e=''+e+"");let a=t?t.createHTML(e):e;if(eJ===eQ)try{i=new G().parseFromString(a,e6)}catch(e){}if(!i||!i.documentElement){i=er.createDocument(eJ,"template",null);try{i.documentElement.innerHTML=e0?ea:a}catch(e){}}let o=i.body||i.documentElement;return(e&&n&&o.insertBefore(r.createTextNode(n),o.childNodes[0]||null),eJ===eQ)?el.call(i,eP?"html":"body")[0]:eP?i.documentElement:o},td=function(e){return eo.call(e.ownerDocument||e,e,W.SHOW_ELEMENT|W.SHOW_COMMENT|W.SHOW_TEXT|W.SHOW_PROCESSING_INSTRUCTION|W.SHOW_CDATA_SECTION,null)},tc=function(e){return e instanceof V&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof U)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},tu=function(e){return"function"==typeof p&&e instanceof p};function tp(e,t,i){h(e,e=>{e.call(a,t,i,e7)})}let th=function(e){let t=null;if(tp(ec.beforeSanitizeElements,e,null),tc(e))return to(e),!0;let i=e8(e.nodeName);if(tp(ec.uponSanitizeElement,e,{tagName:i,allowedTags:ev}),ej&&e.hasChildNodes()&&!tu(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||7===e.nodeType||ej&&8===e.nodeType&&A(/<[/\w]/g,e.data))return to(e),!0;if(!ev[i]||eA[i]){if(!eA[i]&&tg(i)&&(ek.tagNameCheck instanceof RegExp&&A(ek.tagNameCheck,i)||ek.tagNameCheck instanceof Function&&ek.tagNameCheck(i)))return!1;if(eH&&!eV[i]){let t=en(e)||e.parentNode,i=ei(e)||e.childNodes;if(i&&t){let n=i.length;for(let a=n-1;a>=0;--a){let n=q(i[a],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,et(e))}}}return to(e),!0}return e instanceof _&&!tr(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(to(e),!0):(eL&&3===e.nodeType&&(t=e.textContent,h([eu,ep,eh],e=>{t=C(t,e," ")}),e.textContent!==t&&(f(a.removed,{element:e.cloneNode()}),e.textContent=t)),tp(ec.afterSanitizeElements,e,null),!1)},tm=function(e,t,i){if(ez&&("id"===t||"name"===t)&&(i in r||i in te))return!1;if(eI&&!eE[t]&&A(em,t));else if(e_&&A(eg,t));else if(!ew[t]||eE[t]){if(!(tg(e)&&(ek.tagNameCheck instanceof RegExp&&A(ek.tagNameCheck,e)||ek.tagNameCheck instanceof Function&&ek.tagNameCheck(e))&&(ek.attributeNameCheck instanceof RegExp&&A(ek.attributeNameCheck,t)||ek.attributeNameCheck instanceof Function&&ek.attributeNameCheck(t))||"is"===t&&ek.allowCustomizedBuiltInElements&&(ek.tagNameCheck instanceof RegExp&&A(ek.tagNameCheck,i)||ek.tagNameCheck instanceof Function&&ek.tagNameCheck(i))))return!1}else if(eK[t]);else if(A(ey,C(i,eb,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===w(i,"data:")&&e$[e]);else if(eM&&!A(ef,C(i,eb,"")));else if(i)return!1;return!0},tg=function(e){return"annotation-xml"!==e&&v(e,ex)},tf=function(e){tp(ec.beforeSanitizeAttributes,e,null);let{attributes:i}=e;if(!i||tc(e))return;let n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ew,forceKeepAttr:void 0},r=i.length;for(;r--;){let{name:o,namespaceURI:s,value:l}=i[r],d=e8(o),c="value"===o?l:S(l);if(n.attrName=d,n.attrValue=c,n.keepAttr=!0,n.forceKeepAttr=void 0,tp(ec.uponSanitizeAttribute,e,n),c=n.attrValue,eF&&("id"===d||"name"===d)&&(ts(o,e),c="user-content-"+c),ej&&A(/((--!?|])>)|<\/(style|title)/i,c)){ts(o,e);continue}if(n.forceKeepAttr)continue;if(!n.keepAttr||!eT&&A(/\/>/i,c)){ts(o,e);continue}eL&&h([eu,ep,eh],e=>{c=C(c,e," ")});let u=e8(e.nodeName);if(!tm(u,d,c)){ts(o,e);continue}if(t&&"object"==typeof $&&"function"==typeof $.getAttributeType)if(s);else switch($.getAttributeType(u,d)){case"TrustedHTML":c=t.createHTML(c);break;case"TrustedScriptURL":c=t.createScriptURL(c)}if(c!==l)try{s?e.setAttributeNS(s,o,c):e.setAttribute(o,c),tc(e)?to(e):g(a.removed)}catch(t){ts(o,e)}}tp(ec.afterSanitizeAttributes,e,null)},tb=function e(t){let i=null,n=td(t);for(tp(ec.beforeSanitizeShadowDOM,t,null);i=n.nextNode();)tp(ec.uponSanitizeShadowNode,i,null),th(i),tf(i),i.content instanceof d&&e(i.content);tp(ec.afterSanitizeShadowDOM,t,null)};return a.sanitize=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,r=null,s=null,l=null;if((e0=!e)&&(e=""),"string"!=typeof e&&!tu(e))if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw E("dirty is not a string, aborting")}else throw E("toString is not a function");if(!a.isSupported)return e;if(eD||ti(i),a.removed=[],"string"==typeof e&&(eW=!1),eW){if(e.nodeName){let t=e8(e.nodeName);if(!ev[t]||eA[t])throw E("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof p)1===(r=(n=tl("")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===r.nodeName||"HTML"===r.nodeName?n=r:n.appendChild(r);else{if(!eR&&!eL&&!eP&&-1===e.indexOf("<"))return t&&eB?t.createHTML(e):e;if(!(n=tl(e)))return eR?null:eB?ea:""}n&&eN&&to(n.firstChild);let c=td(eW?e:n);for(;s=c.nextNode();)th(s),tf(s),s.content instanceof d&&tb(s.content);if(eW)return e;if(eR){if(eO)for(l=es.call(n.ownerDocument);n.firstChild;)l.appendChild(n.firstChild);else l=n;return(ew.shadowroot||ew.shadowrootmode)&&(l=ed.call(o,l,!0)),l}let u=eP?n.outerHTML:n.innerHTML;return eP&&ev["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&A(Y,n.ownerDocument.doctype.name)&&(u="\n"+u),eL&&h([eu,ep,eh],e=>{u=C(u,e," ")}),t&&eB?t.createHTML(u):u},a.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};ti(e),eD=!0},a.clearConfig=function(){e7=null,eD=!1},a.isValidAttribute=function(e,t,i){return e7||ti({}),tm(e8(e),e8(t),i)},a.addHook=function(e,t){"function"==typeof t&&f(ec[e],t)},a.removeHook=function(e,t){if(void 0!==t){let i=m(ec[e],t);return -1===i?void 0:b(ec[e],i,1)[0]}return g(ec[e])},a.removeHooks=function(e){ec[e]=[]},a.removeAllHooks=function(){ec=ee()},a}()},277051,(e,t,i)=>{t.exports=window.DOMPurify||(window.DOMPurify=e.r(189779).default||e.r(189779))},454416,(e,t,i)=>{!function(){"use strict";var i=!!("u">typeof window&&window.document&&window.document.createElement),n={canUseDOM:i,canUseWorkers:"u">typeof Worker,canUseEventListeners:i&&!!(window.addEventListener||window.attachEvent),canUseViewport:i&&!!window.screen};if("function"==typeof define&&"object"==typeof define.amd&&define.amd)e.r,void 0!==n&&e.v(n);else t.exports?t.exports=n:window.ExecutionEnvironment=n}()},963365,e=>{"use strict";var t=e.i(85583),i=e.i(118518),n=e.i(520677);e.s(["HandlerType",()=>i.HandlerType,"Logger",()=>i.Logger,"StatusType",()=>n.StatusType,"datadogLogs",()=>t.datadogLogs])},490091,(e,t,i)=>{"use strict";var n=/^[-!#$%&'*+\/0-9=?A-Z^_a-z{|}~](\.?[-!#$%&'*+\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\.?[a-zA-Z0-9])*\.[a-zA-Z](-?[a-zA-Z0-9])+$/;i.validate=function(e){if(!e||e.length>254||!n.test(e))return!1;var t=e.split("@");return!(t[0].length>64||t[1].split(".").some(function(e){return e.length>63}))}},188166,(e,t,i)=>{var n=e.r(596351),a=e.r(234464),r=e.r(291475),o=e.r(782346);t.exports=function(e){return function(t){var i=a(t=o(t))?r(t):void 0,s=i?i[0]:t.charAt(0),l=i?n(i,1).join(""):t.slice(1);return s[e]()+l}}},670915,(e,t,i)=>{t.exports=e.r(188166)("toUpperCase")},788411,(e,t,i)=>{var n=e.r(782346),a=e.r(670915);t.exports=function(e){return a(n(e).toLowerCase())}},16840,864935,227909,157048,549022,873082,442136,822311,296690,266652,109834,581074,187587,803597,912711,231,613914,578011,772177,750526,233365,754851,477893,957881,131526,387111,281997,783197,802150,517103,820773,771732,787485,162690,7301,534904,973886,340560,586044,324886,929508,989619,971681,364351,550530,301219,684034,601583,595995,865786,878726,260241,480801,470020,267617,53158,869557,819197,607663,644315,280318,991154,4751,400506,576750,826480,809701,315965,188970,399839,400722,974994,486962,297391,23917,19988,413399,690310,639243,169039,853081,647031,897587,185635,429693,957631,352522,75572,161334,330185,168982,778694,733618,312285,571790,326062,546257,292632,746706,e=>{"use strict";let t;var i,n,a,r,o,s,l=e.i(500425),d=e.i(408122),c=e.i(524473),u=e.i(755453),p=e.i(175863),h=e.i(661619),m=e.i(325059),g=e.i(977581),f=e.i(438106),b=e.i(615505);let x=["paragraph","heading","title","drawing","diagram","image","contributors","mediaPlaceholder","buttonGroup","labelGroup","navbarLinks","gallery","chart","toggleSummary","smartDiagram","positionedTextbox","positionedContentBox","graphic"],y=["positionedTextbox","positionedContentBox"],v=["title","heading","paragraph","bullet","todo","numbered","image","graphic","contributors","diagram","mediaPlaceholder","buttonGroup","labelGroup","gallery","chart","smartDiagram","blockquote"],C=["toggle","blockquote"],w=new p.PluginKey("horizontalAlign");class S{decorations;hasInitialized=!1;constructor(e=b.DecorationSet.empty){this.decorations=e}isRelevantNode(e){return v.includes(e.type.name)}isRelevantParentNode(e){return C.includes(e.type.name)}apply(e){if(!e.docChanged&&this.hasInitialized)return this;this.hasInitialized=!0;let t=[],i=(0,m.getPreferredTextDirection)();return e.doc.descendants((e,n)=>{if(this.isRelevantParentNode(e)){let i=(0,h.getTextDirectionForNode)(e);t.push(b.Decoration.node(n,n+e.nodeSize,{},{dir:i})),"toggle"===e.type.name&&e.forEach((e,a,r)=>{if("toggleSummary"===e.type.name){let r=n+1+a;t.push(b.Decoration.node(r,r+e.nodeSize,{},{dir:i}))}})}if(this.isRelevantNode(e)){let a=(0,h.getTextDirectionForNode)(e);a?i=a:t.push(b.Decoration.node(n,n+e.nodeSize,{},{dir:i}))}return!0}),this.decorations=b.DecorationSet.create(e.doc,t),this}}let k=["left","right","center"],A=e=>t=>{let{dir:i,ctx:n}=t||{};return"menu"===n?null:e&&"center"!==e&&"ltr"!==i?i?"left"===e?"right":"left":null:e},E=(e,t)=>{if(e)return _(e,t||(0,m.getPreferredTextDirection)())},_=(e,t)=>{if(e)return"rtl"===t?({left:"flex-end",center:"center",right:"flex-start"})[e]:({left:"flex-start",center:"center",right:"flex-end"})[e]},I=u.Extension.create({name:"horizontalAlign",priority:f.ExtensionPriorityMap.HorizontalAlign,addOptions:()=>({types:x,alignments:k,defaultAlignment:null}),addCommands:()=>({toggleHorizontalAlign:e=>({tr:t,dispatch:i,state:n,editor:a})=>{if(!i)return!0;let r=M(a,e)?null:e;return t.selection.ranges.forEach(e=>{let i=e.$from.pos,a=e.$to.pos;n.doc.nodesBetween(i,a,(e,i)=>{if("footnote"===e.type.name)return!1;!y.includes(e.type.name)&&x.includes(e.type.name)&&t.setNodeMarkup(i,void 0,{...e.attrs,horizontalAlign:r}).setMeta("annotationEvent",{type:"update-node-attrs",pos:i})})}),!0}}),addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.toggleHorizontalAlign("left"),"Mod-Shift-e":()=>this.editor.commands.toggleHorizontalAlign("center"),"Mod-Shift-r":()=>this.editor.commands.toggleHorizontalAlign("right"),Backspace:()=>{let{selection:e}=this.editor.state;if(!(e instanceof p.TextSelection)||!e.empty)return!1;let t=e.$from.parent;return!!x.includes(t.type.name)&&!!t.isTextblock&&!(t.nodeSize>2)&&t.attrs.horizontalAlign!=this.options.defaultAlignment&&this.editor.commands.toggleHorizontalAlign(this.options.defaultAlignment)}}},addProseMirrorPlugins:()=>[new p.Plugin({key:w,state:{init:()=>new S,apply:(e,t)=>t.apply(e)},props:{decorations(e){let t=w.getState(e);return t?.decorations}}})]}),M=(e,t)=>{let i=k.filter(e=>e!==t);return e.isActive({horizontalAlign:t})&&!i.some(t=>e.isActive({horizontalAlign:t}))},T=e=>!(0,g.selectionAllowsAttr)(e,"horizontalAlign"),L=[{key:"alignLeft",name:()=>d.i18n._({id:"VjjKVj",message:"Left align"}),icon:c.faAlignLeft,checkActive:e=>M(e,"left"),checkDisabled:T,apply:e=>e.chain().toggleHorizontalAlign("left").run(),shortcut:"Mod+Shift+L",enabledForTables:!0,alignment:"left"},{key:"alignCenter",name:()=>d.i18n._({id:"95ckMP",message:"Center align"}),icon:c.faAlignCenter,checkActive:e=>M(e,"center"),checkDisabled:T,apply:e=>e.chain().toggleHorizontalAlign("center").run(),shortcut:"Mod+Shift+E",enabledForTables:!0,alignment:"center"},{key:"alignRight",name:()=>d.i18n._({id:"vTKw81",message:"Right align"}),icon:c.faAlignRight,checkActive:e=>M(e,"right"),checkDisabled:T,apply:e=>e.chain().toggleHorizontalAlign("right").run(),shortcut:"Mod+Shift+R",enabledForTables:!0,alignment:"right"}];e.s(["AlignmentCommands",0,L,"HorizontalAlign",0,I,"forceFlexAlignParent",0,e=>({"--descendant-align-self":e,"--descendant-align-self-left":e,"--descendant-align-self-center":e,"--descendant-align-self-right":e}),"getAlignDirection",0,(e,t)=>{if(!t)return e.find(e=>e.spec.dir)?.spec.dir||"auto"},"getAlignDirectionFromDecorations",0,e=>e.find(e=>e.spec.dir)?.spec.dir,"getAlignSelfStyles",0,e=>e?{alignSelf:`var(${({left:"--descendant-align-self-left",center:"--descendant-align-self-center",right:"--descendant-align-self-right"})[e]}, --descendant-align-self)`}:{alignSelf:"var(--descendant-align-self, self-start)"},"getAlignStyles",0,(e,t)=>{let i=E(e,t);return{textAlign:e||void 0,alignItems:i||"var(--flex-align)","--flex-align":i}},"getAlignStylesParent",0,(e,t)=>{let i={"--descendant-align-self-left":"rtl"===t?"flex-end":"flex-start","--descendant-align-self-center":"center","--descendant-align-self-right":"rtl"===t?"flex-start":"flex-end"};return e?{"--descendant-align-self":_(e,t),...i}:i},"getCurrentAlignment",0,e=>k.find(t=>e.isActive({horizontalAlign:t})),"getCurrentTextDirection",0,e=>{let t=e.state.selection.$head.node().textContent;return(0,h.getDirectionFromContent)(t)||(0,m.getPreferredTextDirection)()},"getDefaultHorizontalAlignment",0,A,"getDirectionDecoration",0,(e,t,i)=>{let n=w.getState(e);if(!n)return null;let a=n.decorations.find(t,i,e=>e.dir)?.[0];return a?a.spec.dir:null},"getFlexAlign",0,E],864935);var j=e.i(391398),P=e.i(969641),D=e.i(402818),N=e.i(613616),R=e.i(892194),O=e.i(654656),B=e.i(541075),z=e.i(358280),F=e.i(191788);e.i(734710);var H=e.i(78387),W=e.i(468738),U=e.i(555145),V=e.i(932786),G=e.i(641099),$=e.i(864860),Z=e.i(887527),K=e.i(606004),q=e.i(275561);let Y=(0,q.createIcon)({viewBox:"0 0 14 14",path:(0,j.jsx)("g",{fill:"currentColor",children:(0,j.jsx)("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});e.s(["CheckIcon",0,Y],227909),e.i(828525);var X=e.i(896620),Q=e.i(548402);(i={})[i.small=4]="small",i[i.medium=7]="medium";let J=({color:e,setColor:t=()=>{},isActive:i=!1,name:n,size:a=7,tooltipIsDisabled:r=!1})=>{let o=(0,Q.isColorDark)(e)?"white":"black";return(0,j.jsx)(X.GammaTooltip,{label:n||e.toUpperCase(),placement:"top",isDisabled:r,children:(0,j.jsx)(P.Button,{display:"inline-block",alignSelf:"center",boxSize:a,borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.300",color:o,bgColor:e??"#FFFFFF",onClick:()=>t(e),variant:"unstyled",minW:0,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",children:i&&(0,j.jsx)(Y,{})})})},ee=({label:e,colors:t,setColor:i,currentColor:n,isDefault:a,handleAddColorButtonClick:r})=>{let{isInOfflineMode:o}=(0,K.useHealthCheck)();return(0,j.jsx)(V.MenuGroup,{children:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(U.HStack,{px:"2",fontSize:"sm",w:"100%",justifyContent:"space-between",alignItems:"center",mb:"2",mt:+!!r,children:[(0,j.jsx)(Z.Text,{children:e}),(0,j.jsx)($.Spacer,{}),r&&(0,j.jsx)(P.Button,{variant:"link",fontSize:"sm",onClick:r,isDisabled:o,children:(0,j.jsx)(z.Trans,{message:"Edit",id:"ePK91l"})})]}),(0,j.jsx)(G.SimpleGrid,{gap:1.5,columns:6,p:2,pt:0,children:t.map(({hex:e,name:t},r)=>(0,j.jsx)(J,{name:t,color:e,setColor:i,isActive:a?null===n:n===e},r))})]})})},et=({setColor:e,currentColor:t})=>(0,j.jsx)(ee,{label:d.i18n._({id:"Zp2USm",message:"System colors"}),colors:[{key:"black",hex:"#000000",name:d.i18n._({id:"THokF3",message:"Black"})},{key:"dark-gray",hex:"#4D4D4D",name:d.i18n._({id:"uUMrFZ",message:"Dark Gray"})},{key:"gray",hex:"#808080",name:d.i18n._({id:"qS5//Q",message:"Gray"})},{key:"light-gray",hex:"#CCCCCC",name:d.i18n._({id:"xa/b9m",message:"Light Gray"})},{key:"white-smoke",hex:"#F2F2F2",name:d.i18n._({id:"rGj3KB",message:"White Smoke"})},{key:"white",hex:"#FFFFFF",name:d.i18n._({id:"5Ex+AP",message:"White"})},{key:"light-sun",hex:"#FCEC99",name:d.i18n._({id:"nOXj3q",message:"Light Sun"})},{key:"peach",hex:"#FFD1A7",name:d.i18n._({id:"68+2yw",message:"Peach"})},{key:"salmon",hex:"#FAA1A1",name:d.i18n._({id:"TrGQaZ",message:"Salmon"})},{key:"lavender",hex:"#D8AFF8",name:d.i18n._({id:"gc4DdH",message:"Lavender"})},{key:"baby-blue",hex:"#AFCBF8",name:d.i18n._({id:"+bmpN5",message:"Baby Blue"})},{key:"pale-green",hex:"#AEE4BD",name:d.i18n._({id:"hUOhvE",message:"Pale Green"})},{key:"gold",hex:"#F9D933",name:d.i18n._({id:"FYlHHU",message:"Gold"})},{key:"orange",hex:"#FFA44F",name:d.i18n._({id:"4OE5Sf",message:"Orange"})},{key:"red",hex:"#F44444",name:d.i18n._({id:"wRTiSD",message:"Red"})},{key:"purple",hex:"#B05EF1",name:d.i18n._({id:"mF9LxA",message:"Purple"})},{key:"blue",hex:"#5E98F1",name:d.i18n._({id:"Zn5crm",message:"Blue"})},{key:"green",hex:"#5CC97B",name:d.i18n._({id:"VmkjGB",message:"Green"})},{key:"dark-goldenrod",hex:"#957D00",name:d.i18n._({id:"vWWr+k",message:"Dark Goldenrod"})},{key:"brown",hex:"#995515",name:d.i18n._({id:"JLxwQS",message:"Brown"})},{key:"maroon",hex:"#910D0D",name:d.i18n._({id:"cg4yu3",message:"Maroon"})},{key:"dark-purple",hex:"#5E208E",name:d.i18n._({id:"oqSDkM",message:"Dark Purple"})},{key:"midnight-blue",hex:"#204C8E",name:d.i18n._({id:"QCyMdk",message:"Midnight Blue"})},{key:"forest-green",hex:"#1F7135",name:d.i18n._({id:"HVCLqF",message:"Forest Green"})}],setColor:e,currentColor:t});var ei=e.i(418755),en=e.i(80192),ea=e.i(82050),er=e.i(283591),eo=e.i(551880),es=e.i(195305),el=e.i(25747);let ed=()=>{let{currentWorkspace:e}=(0,el.useUserContext)(),t=(0,ei.useAppSelector)(eo.selectTheme),i=(0,ei.useAppSelector)(ea.selectFile),n=(0,er.useCanManageThemesAndFonts)();return(0,F.useMemo)(()=>{if(!n)return"disabled";let a=!t.workspaceId,r=!a&&t.workspaceId===e?.id,o=i?.sourceTheme?.id,s=!!o&&o===t.id;return r?"edit":a||s?"fork":"disabled"},[n,t.workspaceId,t.id,e?.id,i?.sourceTheme?.id])};e.s(["useThemeEditAction",0,ed],157048);var ec=e.i(686296),eu=e.i(770127);let ep=({setColor:e,currentColor:t,showAddColorButton:i=!0,includeGradients:n=!1,onSelectGradient:a,currentThemeColor:r})=>{let o=(0,ei.useAppSelector)(eo.selectTheme),s=ed(),{isInOfflineMode:l}=(0,K.useHealthCheck)(),c=(0,ec.getThemePalette)(o,!n),u=c.filter(e=>"solid"===e.type).map(e=>{let t=(0,ec.getThemeColorSolid)(e);return{hex:t,key:t}}),p=n?c.filter(e=>"linear-gradient"===e.type):[],h=i&&"disabled"!==s?()=>{"edit"===s?(0,en.openThemeEditorWithCurrentTheme)({theme:o}):(0,en.openThemeEditorWithNewFork)({theme:o,sourceThemeInfo:{themeId:o.id,workspaceId:o.workspaceId,source:"color_picker"}})}:void 0;return(0,j.jsxs)(V.MenuGroup,{children:[(0,j.jsxs)(U.HStack,{px:"2",fontSize:"sm",w:"100%",justifyContent:"space-between",alignItems:"center",mb:"2",mt:+!!h,children:[(0,j.jsx)(Z.Text,{children:d.i18n._({id:"J1XRO3",message:"Theme colors"})}),(0,j.jsx)($.Spacer,{}),h&&(0,j.jsx)(P.Button,{variant:"link",fontSize:"sm",onClick:h,isDisabled:l,children:(0,j.jsx)(z.Trans,{message:"Edit",id:"ePK91l"})})]}),(0,j.jsxs)(G.SimpleGrid,{gap:1.5,columns:6,p:2,pt:0,children:[u.map(({hex:i},n)=>(0,j.jsx)(J,{color:i,setColor:e,isActive:t===i},n)),p.map((e,t)=>(0,j.jsx)(eh,{gradient:e,isActive:r?.type==="linear-gradient"&&JSON.stringify(r)===JSON.stringify(e),onClick:()=>a?.(e)},`gradient-${t}`))]})]})},eh=({gradient:e,isActive:t,onClick:i})=>(0,j.jsx)(P.Button,{display:"inline-block",alignSelf:"center",boxSize:7,borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.300",color:"white",backgroundImage:(0,eu.getGradientCss)(e),onClick:i,variant:"unstyled",minW:0,fontSize:"xs",sx:{textShadow:"0 1px 2px rgba(0,0,0,0.5)"},children:t&&(0,j.jsx)(Y,{})}),em=({currentColor:e,setColor:t,unsetColor:i=()=>t(null),source:n,showAddColorButton:a=!0,includeGradients:r,onSelectGradient:o,currentThemeColor:s})=>{let l=(0,R.useColorModeValue)("gray.50","elevation.1"),d=(0,W.useAnalytics)(),u=(0,F.useCallback)(e=>{d?.track(H.SegmentEvents.COLOR_PICKER_SET_COLOR,{color:e,source:n}),t(e)},[t,d,n]),p=(0,F.useCallback)(()=>{d?.track(H.SegmentEvents.COLOR_PICKER_RESET,{source:n}),i()},[i,d,n]);return(0,W.useAnalyticsEffect)(e=>{e.track(H.SegmentEvents.COLOR_PICKER_OPENED,{source:n})},[n]),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(O.VStack,{divider:(0,j.jsx)(D.Divider,{}),p:0,align:"start",children:[(0,j.jsx)(ep,{showAddColorButton:a,setColor:u,currentColor:e,includeGradients:r,onSelectGradient:o,currentThemeColor:s}),(0,j.jsx)(et,{setColor:u,currentColor:e})]}),(0,j.jsx)(N.Flex,{px:5,py:3,bg:l,alignItems:"center",justifyContent:"center",mx:-2,mb:-2,mt:2,children:(0,j.jsx)(P.Button,{onClick:p,variant:"link",size:"sm",colorScheme:"gray",leftIcon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faUndo}),children:(0,j.jsx)(z.Trans,{message:"Reset to default",id:"L+rMC9"})})})]})};e.s(["ColorPickerMenuInner",0,em],549022);var eg=e.i(721455),ef=e.i(148318),eb=e.i(704273),ex=e.i(261442),ey=e.i(338538);let ev=e=>{setTimeout(()=>{e.commands.focus()})};e.s(["focusEditorOnMenuClose",0,ev,"handleBackgroundResetOrUpdate",0,(e,t,i)=>{i.background?.type===ey.BackgroundType.NONE?e.commands.updateAttributesAtPos(t,i):e.commands.updateNestedAttributesAtPos(t,i)}],873082);let eC=({editor:e,color:t,setColor:i,analyticsSource:n})=>(0,j.jsxs)(eg.Menu,{isLazy:!0,onClose:()=>e&&ev(e),children:[(0,j.jsx)(X.GammaTooltip,{placement:"top",label:(0,j.jsx)(z.Trans,{message:"Color...",id:"XAIjEI"}),"aria-label":d.i18n._({id:"XAIjEI",message:"Color..."}),children:(0,j.jsx)(ef.MenuButton,{as:P.Button,variant:"toolbar","data-formatting-menu-button":!0,rightIcon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faChevronDown,transform:"shrink-6"}),size:"sm",onMouseDown:ex.preventDefaultToAvoidBlur,children:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faPalette})})}),(0,j.jsx)(eb.MenuList,{overflow:"hidden",children:(0,j.jsx)(em,{currentColor:t||null,setColor:i,source:n})})]});e.s(["ColorButton",0,eC],442136);let ew={key:"color",Control:({value:e,updateValue:t,editor:i})=>(0,j.jsx)(eC,{color:e,setColor:e=>t(e,!0),editor:i,analyticsSource:"SmartLayout"}),ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:c.faPalette,items:[{key:"clear",element:i=>(0,j.jsx)(em,{currentColor:e,setColor:e=>{t(e,!0),i?.()},unsetColor:()=>{t(null,!0),i?.()},source:"SmartLayout",showAddColorButton:!1})}]}),name:()=>"Color"};e.s(["ColorOption",0,ew],822311);var eS=e.i(575084),ek=e.i(763896);let eA=({label:e,shortcut:t,disabled:i=!1,color:n,isActive:a=!1,onClick:r,icon:o,iconRotation:s,testId:l,children:d,flipIcon:c,...u})=>{let p=(0,j.jsx)(P.Button,{isDisabled:i,color:n,variant:a?"activeToolbar":"toolbar",onClick:r,"data-testid":l,onMouseDown:ex.preventDefaultToAvoidBlur,size:"sm",...u,children:o?(0,j.jsx)(B.FontAwesomeIcon,{icon:o,rotation:s,flip:c,fixedWidth:!0}):d||null});return e?(0,j.jsx)(eE,{label:e,shortcut:t,children:p}):p},eE=({label:e,shortcut:t,children:i})=>(0,j.jsx)(X.GammaTooltip,{placement:"top",portalProps:{containerRef:(0,ek.useTooltipPortalRef)()},label:e,shortcut:t,children:i});e.s(["ToolbarButton",0,eA,"ToolbarTooltip",0,eE],296690);let e_={key:"isEmphasized",Control:({value:e,editor:t,pos:i})=>(0,j.jsx)(eA,{label:e?d.i18n._({id:"PDMbsX",message:"De-emphasize"}):d.i18n._({id:"m1crrt",message:"Emphasize"}),icon:e?eS.faStar:c.faStar,onClick:()=>{i&&t.chain().handleEmphasizeCell(i,!e).run()}}),ControlMenu:(e,t,i)=>({key:i.key,label:e?d.i18n._({id:"PDMbsX",message:"De-emphasize"}):d.i18n._({id:"m1crrt",message:"Emphasize"}),icon:e?eS.faStar:c.faStar,onClick:()=>{t(!e)}}),name:()=>"Emphasis"};e.s(["EmphasisOption",0,e_],266652);let eI={key:"hasLine",defaultValue:()=>!0,Control:({value:e,updateValue:t,option:i})=>(0,j.jsx)(eA,{label:i.name(),onClick:()=>t(!e),isActive:e,icon:c.faHyphen}),ControlMenu:(e,t,i)=>({key:i.key,label:e?(0,j.jsx)(z.Trans,{message:"Hide line",id:"IELtbA"}):(0,j.jsx)(z.Trans,{message:"Show line",id:"81xMlD"}),icon:c.faHyphen,onClick:()=>t(!e)}),name:()=>d.i18n._({id:"aPb1AT",message:"Show line?"})},eM={key:"orientation",defaultValue:()=>"horizontal",Control:({value:e,updateValue:t,option:i})=>(0,j.jsx)(eA,{label:i.name(),onClick:()=>t("horizontal"===e?"vertical":"horizontal"),isActive:"vertical"===e,icon:"horizontal"===e?c.faArrowRight:c.faArrowDown,testId:"smart-layout-orientation-option"}),ControlMenu:(e,t,i)=>({key:i.key,label:d.i18n._({id:"R56kJO",message:"Change direction"}),icon:"horizontal"===e?c.faArrowRight:c.faArrowDown,items:[{key:"horizontal",label:d.i18n._({id:"pzu7v4",message:"Horizontal"}),icon:"horizontal"===e?c.faCheck:void 0,onClick:()=>t("horizontal")},{key:"vertical",label:d.i18n._({id:"mX/isJ",message:"Vertical"}),icon:"vertical"===e?c.faCheck:void 0,onClick:()=>t("vertical")}]}),name:()=>d.i18n._({id:"MRB7nI",message:"Direction"}),validator:e=>"horizontal"===e||"vertical"===e};e.s(["OrientationOption",0,eM],109834);let eT={key:"twoSided",defaultValue:()=>!0,Control:({value:e,updateValue:t,option:i})=>(0,j.jsx)(eA,{label:i.name(),onClick:()=>t(!e),isActive:e,icon:c.faTimeline,testId:"smart-layout-two-sided-option"}),ControlMenu:(e,t,i)=>({key:i.key,label:e?d.i18n._({id:"x+f1ZW",message:"Show one side"}):d.i18n._({id:"o18EC+",message:"Show two sides"}),icon:c.faTimeline,onClick:()=>t(!e)}),name:()=>d.i18n._({id:"ovs7iP",message:"Two sided"})},eL=(...e)=>Object.values(e.reduce((e,t)=>(t.forEach(t=>{e[t.key]=t}),e),{}));e.s(["mergeOptions",0,eL],581074);let ej=e=>{let{additionalOptions:t=[],additionalCellOptions:i=[],presetConfigurations:n=[],...a}=e;return{baseHorizontalAlign:A("center"),imageSlot:"optional",imageType:"icon",dragHandleTopOffset:"-0.5em",options:eL([{...eM,defaultValue:()=>"vertical"},eT,eI,ew],t),cellOptions:eL([ew,e_],i),presetConfigurations:n.length>0?n:[{name:()=>"Horizontal (one-sided)",options:{twoSided:!1,hasLine:!0,orientation:"horizontal"}},{name:()=>"Horizontal (two-sided)",options:{twoSided:!0,hasLine:!0,orientation:"horizontal"}},{name:()=>"Vertical (one-sided)",options:{twoSided:!1,hasLine:!0,orientation:"vertical"}},{name:()=>"Vertical (two-sided)",options:{twoSided:!0,hasLine:!0,orientation:"vertical"}}],addDirection:e=>"horizontal"===e.orientation?"right":"bottom",isFullWidth:e=>"horizontal"===e.orientation,...a}},eP=e=>{let{additionalOptions:t=[],presetConfigurations:i=[],...n}=e;return ej({...n,additionalOptions:[{...eT,defaultValue:()=>!0},...t],presetConfigurations:i.length>0?i:[{name:()=>"Horizontal",options:{twoSided:!0,hasLine:!0,orientation:"horizontal"}},{name:()=>"Vertical",options:{twoSided:!0,hasLine:!0,orientation:"vertical"}}],defaultOptions:{twoSided:!0,numbered:!1,...n.defaultOptions}})};e.s(["createAlternatingVariant",0,ej,"createTwoSidedAlternatingVariant",0,eP],187587),e.s(["getMinimalTimeline",0,()=>ej({key:"minimalTimeline",name:()=>d.i18n._({id:"cupqy6",message:"Minimal timeline"}),family:"sequence",icon:l.faListTimeline,htmlTag:"minimal-timeline",config:{wrapperConfig:{gridStyle:"alternating_tight"},cellConfig:{cellStyle:"none",distanceFromLine:2,minCellSize:8,lineMarker:{markerType:"smallBullet",markerFontSize:"h3",verticalAlign:"top",markerSize:.75,lineLength:2}}},keywords:["minimal","timeline","layout","list","horizontal","vertical","clean"]})],16840),e.s(["getMinimalTimelineWithBoxes",0,()=>ej({key:"minimalTimelineWithBoxes",name:()=>d.i18n._({id:"D5zoh6",message:"Minimal timeline with boxes"}),family:"sequence",icon:eS.faListTimeline,htmlTag:"minimal-timeline-boxes",config:{wrapperConfig:{gridStyle:"alternating_tight"},cellConfig:{cellStyle:"solid",distanceFromLine:0,minCellSize:8,lineMarker:{markerType:"smallBullet",markerFontSize:null,verticalAlign:"center",markerSize:.75,lineLength:3}}},keywords:["minimal","timeline","boxes","layout","list","horizontal","vertical","clean"]})],803597);let eD={key:"horizontalAlign",defaultValue:()=>null,Control:({value:e,updateValue:t})=>(0,j.jsx)(U.HStack,{spacing:0,dir:"ltr",children:L.map(({name:i,icon:n,alignment:a})=>(0,j.jsx)(eA,{label:i(),icon:n,onClick:()=>{t(a===e?null:a)},isActive:e===a},i()))}),ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:c.faAlignLeft,items:L.map(({name:i,alignment:n})=>({key:i(),label:i(),icon:e===n?c.faCheck:void 0,onClick:()=>{t(n===e?null:n)}}))}),name:()=>d.i18n._({id:"0j+RGO",message:"Horizontal alignment"})};e.s(["HorizontalAlignOption",0,eD],912711),e.s(["getSolidBoxesAlternating",0,()=>eP({key:"solidBoxesAlternating",name:()=>d.i18n._({id:"17LxIH",message:"Alternating boxes"}),family:"boxes",config:{wrapperConfig:{gridStyle:"alternating_loose",lineColor:"accent"},cellConfig:{cellStyle:"solid",minCellSize:6,distanceFromLine:0,lineMarker:{markerType:null,markerFontSize:null,markerSize:0,lineLength:0}}},icon:l.faSignsPost,htmlTag:"solidBoxesAlternating",additionalOptions:[eD],defaultOptions:{horizontalAlign:"center",verticalAlign:"middle"},keywords:["solid","boxes","alternating","layout","list","horizontal","vertical"]})],231);var eN=e.i(45954);let eR={key:"numbered",defaultValue:()=>!0,Control:({value:e,updateValue:t,option:i})=>(0,j.jsx)(eA,{label:i.name(),onClick:()=>t(!e),isActive:e,icon:c.faListOl}),ControlMenu:(e,t,i)=>({key:i.key,label:e?d.i18n._({id:"qCzYrD",message:"Hide numbers"}):d.i18n._({id:"Ty8hAp",message:"Show numbers"}),icon:c.faListOl,onClick:()=>t(!e)}),name:()=>d.i18n._({id:"mVQI+S",message:"Numbered"})},eO={...eR,getDefaultOnParse:e=>!Array.from(e.children).every(e=>e.querySelector("icon")),checkEnabled:({options:e,node:t})=>{let i=t&&(0,u.findChildren)(t,eN.isSmartLayoutCellNode);return i?.every(e=>!e?.node?.attrs?.image||e?.node?.attrs?.image?.src===void 0)||!0===e.numbered}};e.s(["NumberedOption",0,eR,"NumberedOptionWithoutIcons",0,eO],613914),e.s(["getTimeline",0,()=>ej({key:"timeline",name:()=>d.i18n._({id:"cklVjM",message:"Timeline"}),family:"sequence",config:{wrapperConfig:{gridStyle:"alternating_tight"},cellConfig:{cellStyle:"none",distanceFromLine:2,minCellSize:8,lineMarker:{markerType:"bigBullet",markerFontSize:"h3",verticalAlign:"top",markerSize:1.125,lineLength:3}}},icon:eS.faTimelineArrow,htmlTag:"timeline",keywords:["timeline","layout","list","horizontal","vertical"],additionalOptions:[eO]})],578011);var eB=e.i(650292),ez=e.i(595408);let eF="themed-heading",eH="themed-heading-no-gradient",eW={fontWeight:"var(--heading-font-weight)",fontFamily:"var(--heading-font)",color:"var(--heading-color)",background:"unset",backgroundClip:"unset",width:"fit-content",maxWidth:"100%",letterSpacing:"var(--letter-spacing-heading)",textTransform:"var(--heading-transform)"},eU={...eW,background:"var(--heading-gradient)",backgroundClip:"text",caretColor:"var(--heading-color)",color:"transparent","span.textColor":{textShadow:"0px 0.25px 0px var(--text-color), -0px -0.25px 0px var(--text-color)","@media print":{textShadow:"none"}}},eV=e=>({[`.${eF}`]:eW,"--heading-color":e});e.s(["GradientHeadingStyles",0,eU,"HEADING_CLASS",0,eF,"HEADING_NO_GRADIENT_CLASS",0,eH,"HeadingStyles",0,eW,"getHeadingStylesheet",0,e=>"linear-gradient"===(0,ec.getThemeHeadingColor)(e).type?{[`*:where(.${eF})`]:eU,[`.${eH}`]:{[`.${eF}`]:eW},"@media print":{[`.${eF}`]:eW},".is-pptx-exporting":{[`.${eF}`]:eW}}:{[`.${eF}`]:eW},"resetHeadingStylesheet",0,eV],772177);let eG=e=>({"svg.colorable-icon":{path:{fill:e},"[stroke], [stroke] > *":{stroke:e,fill:"none"}}});e.s(["ImageSx",0,{borderRadius:"var(--box-border-radius)"},"getRecolorableIconSx",0,eG],750526);var e$=e.i(809770);let eZ=(e,t=1,i="var(--card-color)")=>{if(!e)return{};let n=0==t?e:(0,e$.getBorderColorForBackground)(e);return{"--shape-bg-color-override":0===t?void 0:1===t?e:eB.isPptExport?(0,Q.colorWithOpacity)(e,t):`color-mix(in oklab, ${e} ${100*t}%, ${i})`,"--shape-border-color-override":n}},eK=e=>{if(!e)return{textColor:void 0,textColorVars:void 0};let t=(0,Q.isColorDark)(e)?"#fff":"#000",i=eq(t);return{textColor:t,textColorVars:i}},eq=e=>{if(e)return{"--shape-text-color":e,"--shape-fill-text-color":e,"--body-color":e,"--heading-color":e,"--link-color":e,"--link-color-inverted":(0,Q.isColorDark)(e)?"#fff":"#000","--link-color-hover":(0,Q.isColorDark)(e)?(0,Q.lightenColor)(e,10):(0,Q.lightenColor)(e,-10)}},eY=(e,t=1)=>{if(!e)return;let i=eZ(e,t);if(0===t)return i;let{textColor:n,textColorVars:a}=eK(e),r=n?eV(n):void 0;return{...i,...a,...r}};e.s(["getShapeColorCss",0,eY,"getShapeColorOverrideVars",0,eZ,"getTextColorVars",0,eq,"getTextColorVarsForBackground",0,eK],233365);let eX="themed-html-shape-background",eQ="themed-html-shape-outline",eJ="themed-svg-shape-outline",e0="themed-svg-shape-background",e1="themed-svg-shape-background-dim",e2="themed-svg-shape-background-light",e3="themed-svg-neutral-background",e5="themed-html-shape-fill",e4="themed-svg-shape-fill",e6="themed-svg-shape-fill-dim",e9="themed-svg-shape-fill-light",e8="themed-line",e7="themed-svg-line",te="themed-shape-outside-text",tt="themed-shape-text-over-background",ti="themed-shape-text-over-fill",tn="themed-svg-shape-background-rtl",ta="themed-svg-shape-fill-rtl",tr="themed-svg-shape-fill-dim-rtl",to="themed-svg-shape-fill-light-rtl",ts="var(--shape-shadow-color, var(--shape-border-color-override, var(--shape-border-color)))",tl={borderRadius:"var(--box-border-radius)",boxShadow:`var(--shape-shadow, var(--shape-shadow-size) var(--shape-shadow-size) var(--shape-shadow-blur) ${ts})`,border:"var(--shape-border-width) solid var(--shape-border-color-override, var(--shape-border-color))",background:"var(--shape-bg-color-override, var(--shape-bg-image, var(--shape-bg-color-alpha)))",backgroundColor:"var(--shape-bg-color-override, var(--shape-bg-color-alpha))","--body-color":"var(--shape-text-color)",...eV("var(--shape-text-color)")},td={background:"var(--card-background-color)",border:"var(--line-thickness) solid var(--shape-border-color-override, var(--shape-border-color))",borderRadius:"var(--box-border-radius)",boxShadow:`var(--shape-shadow, var(--shape-shadow-size) var(--shape-shadow-size) var(--shape-shadow-blur) ${ts})`,...eV("var(--body-color)")},tc={stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--shape-border-width)",vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round"},tu={...tc,fill:"none"},tp={...tc,fill:"var(--shape-bg-color-override, var(--shape-bg-image-svg) var(--shape-bg-color-alpha))",filter:`var(--shape-filter, drop-shadow(var(--shape-shadow-size) var(--shape-shadow-size) var(--shape-shadow-blur) ${ts}))`},th={...tc,fill:"var(--shape-bg-color-override, var(--shape-bg-color-alpha-dim))"},tm={...tc,fill:"var(--shape-bg-color-override, var(--shape-bg-color-alpha-light))"},tg={...tc,fill:"var(--neutral-background-color)"},tf={"--body-color":"var(--shape-text-color)",...eV("var(--shape-text-color)")},tb={background:"var(--shape-bg-color-override, var(--shape-fill))"},tx={fill:"var(--shape-bg-color-override, var(--shape-fill-svg))"},ty={fill:"var(--shape-bg-color-override, var(--shape-fill-svg-dim))"},tv={fill:"var(--shape-bg-color-override, var(--shape-fill-svg-light))"},tC={"--body-color":"var(--shape-fill-text-color)",...eV("var(--shape-fill-text-color)"),...eG("var(--shape-fill-text-color)")},tw={backgroundColor:"var(--shape-border-color-override, var(--line-color))",borderRadius:"var(--box-border-radius)"},tS={stroke:"var(--shape-border-color-override, var(--line-color))",strokeLinejoin:"round",strokeLinecap:"round"},tk={...eV("var(--body-color)")},tA=({cardColor:e,bodyColor:t,config:i,theme:n})=>{let a=(0,ec.getThemeColorSolid)(e),r=(0,ec.getThemeColorSolid)((0,ec.getThemeShapeBackgroundColor)(n,i.shapeColorScheme)),o=(0,ec.getThemeShapeBorderColor)(n,i.shapeColorScheme,i.shapeFill),s="custom"===i.shapeColorScheme?"var(--neutral-border-color)":o,l=ez.SHAPE_FILL_OPTIONS[i.shapeFill].opacity,d=(0,Q.blendColors)(a,r,l),c=(0,Q.isColorDark)(a),u=c?(0,Q.lightenColor)(d,3):(0,Q.lightenColor)(d,-3),p=c?(0,Q.lightenColor)(d,-3):(0,Q.lightenColor)(d,3),h=(0,ec.getThemeColorSolid)(t),m=l>0&&!(0,Q.isColorReadable)(r,h)?eK(r).textColor:h,g=(0,ec.getThemeColorSolid)((0,ec.getThemePrimaryAccentColor)(n)),f=eK(g).textColor,b=c?(0,Q.brightenColor)(g,10):(0,Q.brightenColor)(g,-10),x=c?(0,Q.brightenColor)(g,-10):(0,Q.brightenColor)(g,10),y="none"!==i.shapeShadow,v=tE(e),C=!(0,Q.isColorReadable)(a,d),w=eB.isPdfExport&&y&&C;return{shapeBackgroundAlpha:d,shapeBackgroundAlphaDim:u,shapeBackgroundAlphaLight:p,shapeBackgroundColor:r,finalShapeBorderColor:w?v:o,isOverridingBorder:w,shapeTextColor:m,lineColor:s,fillOpacity:l,shapeFillTextColor:f,accentColorDim:b,accentColorLight:x}},tE=e=>{let t=(0,ec.getThemeColorSolid)(e);return .35>(0,Q.getColorLightness)(t)?(0,Q.colorWithOpacity)("white",.25):(0,Q.colorWithOpacity)((0,Q.colorWithLightness)(t,.2),.125)},t_={...tc,fill:"var(--shape-bg-color-override, var(--shape-bg-image-svg-rtl, var(--shape-bg-image-svg)) var(--shape-bg-color-alpha))",filter:`var(--shape-filter, drop-shadow(calc(-1 * var(--shape-shadow-size)) var(--shape-shadow-size) var(--shape-shadow-blur) ${ts}))`},tI={fill:"var(--shape-bg-color-override, var(--shape-fill-svg-rtl, var(--shape-fill-svg)))"},tM={fill:"var(--shape-bg-color-override, var(--shape-fill-svg-dim))"},tT={fill:"var(--shape-bg-color-override, var(--shape-fill-svg-light))"};e.s(["HTML_SHAPE_BACKGROUND_CLASS",0,eX,"HTML_SHAPE_FILL_CLASS",0,e5,"HTML_SHAPE_OUTLINE_CLASS",0,eQ,"LINE_CLASS",0,e8,"SHAPE_OUTSIDE_TEXT_CLASS",0,te,"SHAPE_TEXT_OVER_BACKGROUND_CLASS",0,tt,"SHAPE_TEXT_OVER_FILL_CLASS",0,ti,"SVG_LINE_CLASS",0,e7,"SVG_NEUTRAL_BACKGROUND_CLASS",0,e3,"SVG_SHAPE_BACKGROUND_CLASS",0,e0,"SVG_SHAPE_BACKGROUND_DIM_CLASS",0,e1,"SVG_SHAPE_BACKGROUND_LIGHT_CLASS",0,e2,"SVG_SHAPE_BACKGROUND_RTL_CLASS",0,tn,"SVG_SHAPE_FILL_CLASS",0,e4,"SVG_SHAPE_FILL_DIM_CLASS",0,e6,"SVG_SHAPE_FILL_DIM_RTL_CLASS",0,tr,"SVG_SHAPE_FILL_LIGHT_CLASS",0,e9,"SVG_SHAPE_FILL_LIGHT_RTL_CLASS",0,to,"SVG_SHAPE_FILL_RTL_CLASS",0,ta,"SVG_SHAPE_OUTLINE_CLASS",0,eJ,"SvgShapeBackgroundSx",0,tp,"getRtlShapesStylesheet",0,()=>({[`.${tn}`]:t_,[`.${ta}`]:tI,[`.${tr}`]:tM,[`.${to}`]:tT}),"getShapeBorderVars",0,({config:e})=>{let t=ez.ROUNDNESS_OPTIONS[e.roundness].blockRadius,i=ez.BUTTON_ROUNDNESS_OPTIONS[e.buttonRoundness]?.borderRadius,{shapeBorderEm:n,lineThicknessEm:a}=ez.BORDER_OPTIONS[e.shapeBorder];return{"--box-border-radius":"sm"===e.roundness&&n>0?"1px":`${t}em`,"--shape-border-width":`${n}em`,"--line-thickness":`max(round(${a}em, 1px), 1px)`,"--button-border-radius":i}},"getShapeColorVars",0,({cardColor:e,bodyColor:t,config:i,theme:n})=>{let{shapeBackgroundAlpha:a,shapeBackgroundAlphaDim:r,shapeBackgroundAlphaLight:o,shapeBackgroundColor:s,finalShapeBorderColor:l,isOverridingBorder:d,shapeTextColor:c,lineColor:u,fillOpacity:p,shapeFillTextColor:h,accentColorDim:m,accentColorLight:g}=tA({cardColor:e,bodyColor:t,config:i,theme:n});return{"--shape-bg-image":"none"===i.shapeFill||"accent"!==i.shapeColorScheme?void 0:"var(--accent-gradient-background)","--shape-bg-color-alpha":a,"--shape-bg-color-alpha-dim":r,"--shape-bg-color-alpha-light":o,"--shape-bg-color":s,"--shape-border-color":l,...d&&{"--shape-border-color-override":l,"--shape-border-width":"0.125em"},"--shape-text-color":c,"--line-color":u,"--shape-bg-image-svg":"none"===i.shapeFill||"accent"!==i.shapeColorScheme?"url(#transparent)":"url(#theme-accent-background-gradient-linear)","--shape-bg-image-svg-rtl":"none"===i.shapeFill||"accent"!==i.shapeColorScheme?"url(#transparent)":"url(#theme-accent-background-gradient-linear-rtl)","--shape-fill":"var(--accent-gradient-fill, var(--accent-color))","--shape-fill-opacity":p,"--shape-fill-svg":"url(#theme-accent-gradient-linear) var(--accent-color)","--shape-fill-svg-rtl":"url(#theme-accent-gradient-linear-rtl) var(--accent-color)","--shape-fill-svg-dim":"var(--accent-color-dim)","--shape-fill-svg-light":"var(--accent-color-light)","--shape-fill-text-color":h,"--accent-color-dim":m,"--accent-color-light":g}},"getShapeColors",0,tA,"getShapeShadowVars",0,({cardColor:e,config:t})=>{let i=(0,ec.getThemeColorSolid)(e),n=ez.SHAPE_SHADOW_OPTIONS[t.shapeShadow],a=ez.BORDER_OPTIONS[t.shapeBorder].shadowSizeEm;if("getShadow"in n)return{"--shape-shadow":n.getShadow(i),"--clickable-shadow":n.getClickShadow(i),"--shape-filter":n.shapeFilter};{let{shadowDistance:t,shadowBlur:i,shadowColorScheme:r,pdfShadow:o}=n,s="block"===r?void 0:tE(e),l="0 0.25em 0.375em -0.0625em rgba(0, 0, 0, 0.1), 0 0.125em 0.25em -0.0625em rgba(0, 0, 0, 0.06)";return eB.isPdfExport&&!o?{"--shape-shadow":"none","--clickable-shadow":"none","--shape-filter":"none"}:0===t&&"0"===i?{"--shape-shadow":"none","--clickable-shadow":l}:{"--shape-shadow-size":`${t*a}em`,"--shape-shadow-blur":i,"--shape-shadow-color":s,"--clickable-shadow":l,"--shape-filter":void 0}}},"getShapesStylesheet",0,()=>({[`.${eX}`]:tl,[`.${eQ}`]:td,[`.${e0}`]:tp,[`.${eJ}`]:tu,[`.${e1}`]:th,[`.${e2}`]:tm,[`.${e3}`]:tg,[`.${e8}`]:tw,[`.${e7}`]:tS,[`.${e5}`]:tb,[`.${e4}`]:tx,[`.${e6}`]:ty,[`.${e9}`]:tv,[`.${te}`]:tk,[`.${tt}`]:tf,[`.${ti}`]:tC})],754851);var tL=e.i(218378);e.s([],477893),e.s(["useCellColor",0,({layoutColorOverride:e,cellColorOverride:t,isColoringCell:i=!0,index:n=0,forceTransparent:a,optOutOfPalette:r})=>{let o=(0,ei.useAppSelector)(eo.selectTheme),s=t??e,l=s,d=(0,tL.getThemeKnobsV3)(o),c=ez.SHAPE_FILL_OPTIONS[d.shapeFill].opacity,u=(0,ec.getThemeShapeColors)(o);if(!l&&!r&&"custom"===d.shapeColorScheme&&u.length>0&&i){let e=(0,ec.getThemeShapeColors)(o).map(ec.getThemeColorSolid);l=e[n%e.length]}let p=!0===a?0:!1===a?1:c,h=(0,F.useMemo)(()=>eY(l,p),[l,p]),m=s?eV(s):void 0;return{color:l,colorVars:h,headingColorCss:m,colorOverride:s}}],957881);var tj=e.i(878410),tP=e.i(761657),tD=e.i(714521);let tN=(e,t)=>{let{size:i,mobileSize:n}=(0,tD.getFontSizeOption)(e);if(e&&(0,tD.isHeadingStyle)(e)){let e=(t.config.headingFontSize??1)/(t.config.fontSize??1),a=i*e,r=n?n*e:void 0;return{fontSize:r?[`${r}em`,`${a}em`]:`${a}em`,"@media print":{fontSize:`${a}em`},lineHeight:"var(--line-height-heading)"}}return{fontSize:n?[`${n}em`,`${i}em`]:`${i}em`,"@media print":{fontSize:`${i}em`},lineHeight:(0,tj.scaleALittleLessThanFontScale)("var(--line-height-body)")}};e.s(["BODY_LINE_HEIGHT",0,1.6,"HEADING_LINE_HEIGHT",0,1.25,"getFontSizeStyles",0,tN,"getFontSizeStylesheet",0,e=>{let t={".block-paragraph":{...tN("default",e)},".block-heading":{'.heading[level="1"]':{...tN("h1",e)},'.heading[level="2"]':{...tN("h2",e)},'.heading[level="3"]':{...tN("h3",e)},'.heading[level="4"]':{...tN("h4",e)}},".block-title":{".title":{...tN("title",e)},'.title[level="1"]':{...tN("title",e)},'.title[level="2"]':{...tN("titleLg",e)},'.title[level="3"]':{...tN("titleXl",e)}}};return Object.keys((0,tP.getFontSizeOptions)()).forEach(i=>{let n=tN(i,e);t[`[data-font-size="${i}"]`]=n}),t}],131526);let tR=(e,t)=>{let i=(0,tD.getFontSizeOption)(t);return(e?i.mobileSize??i.size:i.size)+.75};e.s(["getBulletSizeEm",0,tR,"matchBulletTextAlignment",0,(e,t,i,n,a)=>{let r=(0,tD.getFontSizeOption)(n),o="body"===r.type,s=t?r.mobileSize??r.size:r.size,l=null===i?0:tR(t,i),d=o||t?e.config.lineHeightBody??1.6:e.config.lineHeightHeading??1.25;return a&&l>s*a?0:(l-s*d)/2}],387111),e.i(350461);var tO=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,a,r=i.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(a)throw a.error}}return o},tB=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],tz={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"},tF=function(){return(tF=Object.assign||function(e){for(var t,i=1,n=arguments.length;i0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(a)throw a.error}}return o},tW=function(e,t,i){if(i||2==arguments.length)for(var n,a=0,r=t.length;a0;--n)i+=t[Math.round(Math.random()*(t.length-1))];return i}(),"-").concat(m)),Array.isArray(l)&&l.forEach(function(t){t.condition(h,m,u)&&("function"==typeof t.pre&&((h=t.pre(h,m,u))instanceof Node||(h=e)),"function"==typeof t.post&&g.push(t.post(h,m,u)))}),g.length)return g;switch(h.nodeType){case 1:return F.createElement((i=h.nodeName,/[a-z]+[A-Z]+[a-z]+/.test(i)?i:i.toLowerCase()),function(e,t){var i={key:t};if(e instanceof Element){var n=e.getAttribute("class");n&&(i.className=n),tW([],tH(e.attributes),!1).forEach(function(e){switch(e.name){case"class":break;case"style":i[e.name]=e.value.split(/ ?; ?/).reduce(function(e,t){var i=tO(t.split(/ ?: ?/),2),n=i[0],a=i[1];return n&&a&&(e[n.replace(/-(\w)/g,function(e,t){return t.toUpperCase()})]=Number.isNaN(Number(a))?a:Number(a)),e},{});break;case"allowfullscreen":case"allowpaymentrequest":case"async":case"autofocus":case"autoplay":case"checked":case"controls":case"default":case"defer":case"disabled":case"formnovalidate":case"hidden":case"ismap":case"itemscope":case"loop":case"multiple":case"muted":case"nomodule":case"novalidate":case"open":case"readonly":case"required":case"reversed":case"selected":case"typemustmatch":i[tz[e.name]||e.name]=!0;break;default:i[tz[e.name]||e.name]=e.value}})}return i}(h,m),(n=h.childNodes,a=t,(r=tW([],tH(n),!1).map(function(e,t){return tU(e,tF(tF({},a),{index:t,level:u+1}))}).filter(Boolean)).length?r:null));case 3:var f=(null==(o=h.nodeValue)?void 0:o.toString())||"";if(/^\s+$/.test(f)&&!/[\u00A0\u202F]/.test(f))return null;if(!h.parentNode)return f;var b=h.parentNode.nodeName.toLowerCase();if(tB.includes(b))return/\S/.test(f)&&console.warn("A textNode is not allowed inside '".concat(b,"'. Your text \"").concat(f,'" will be ignored')),null;return f;default:return null}}function tV(e,t){if(void 0===t&&(t={}),"string"==typeof e){var i=t;if(void 0===i&&(i={}),!e||"string"!=typeof e)return null;var n=i.nodeOnly,a=i.selector,r=i.type;try{var o=new DOMParser().parseFromString(e,void 0===r?"text/html":r).querySelector(void 0===a?"body > *":a);if(!(o instanceof Node))throw TypeError("Error parsing input");if(void 0!==n&&n)return o;return tU(o,i)}catch(e){}return null}return e instanceof Node?tU(e,t):null}var tG=e.i(454416),t$="failed",tZ="loaded",tK="loading",tq="pending",tY="ready",tX="unsupported";function tQ(){return tG.canUseDOM}var tJ=(n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function i(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),t0=function(){return(t0=Object.assign||function(e){for(var t,i=1,n=arguments.length;i0)&&!(n=r.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(a)throw a.error}}return o},t2=function(e,t,i){if(i||2==arguments.length)for(var n,a=0,r=t.length;a299)throw Error("Not found");if(!["image/svg+xml","text/plain"].some(function(e){return i.includes(e)}))throw Error("Content type isn't valid: ".concat(i));return e.text()}).then(function(e){var n=i.props.src;if(a!==n){t3[a].status===tK&&delete t3[a];return}if(i.handleLoad(e),t){var r=t3[a];r&&(r.content=e,r.status=tZ)}}).catch(function(e){i.handleError(e),t&&t3[a]&&delete t3[a]})}catch(e){return i.handleError(Error(e.message))}}}),i.state={content:"",element:null,hasCache:!!t.cacheRequests&&!!t3[t.src],status:tq},i.hash=t.uniqueHash||function(){for(var e="abcdefghijklmnopqrstuvwxyz",t="".concat(e).concat(e.toUpperCase()).concat("1234567890"),i="",n=0;n<8;n++)i+=t[Math.floor(Math.random()*t.length)];return i}(),i}return tJ(t,e),Object.defineProperty(t.prototype,"componentDidMount",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isActive=!0,tQ()&&!this.isInitialized){var e=this.state.status,t=this.props.src;try{if(e===tq){if(!(function(){if(!document)return!1;var e=document.createElement("div");e.innerHTML="";var t=e.firstChild;return!!t&&"http://www.w3.org/2000/svg"===t.namespaceURI}()&&"u">typeof window&&null!==window))throw Error("Browser does not support SVG");if(!t)throw Error("Missing src");this.load()}}catch(e){this.handleError(e)}this.isInitialized=!0}}}),Object.defineProperty(t.prototype,"componentDidUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(tQ()){var i=this.state,n=i.hasCache,a=i.status,r=this.props,o=r.onLoad,s=r.src;if(t.status!==tY&&a===tY&&o&&o(s,n),e.src!==s){if(!s)return void this.handleError(Error("Missing src"));this.load()}}}}),Object.defineProperty(t.prototype,"componentWillUnmount",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isActive=!1}}),Object.defineProperty(t.prototype,"getNode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.props,t=e.description,i=e.title;try{var n=this.processSVG(),a=tV(n,{nodeOnly:!0});if(!a||!(a instanceof SVGSVGElement))throw Error("Could not convert the src to a DOM Node");var r=this.updateSVGAttributes(a);if(t){var o=r.querySelector("desc");o&&o.parentNode&&o.parentNode.removeChild(o);var s=document.createElement("desc");s.innerHTML=t,r.prepend(s)}if(i){var l=r.querySelector("title");l&&l.parentNode&&l.parentNode.removeChild(l);var d=document.createElement("title");d.innerHTML=i,r.prepend(d)}return r}catch(e){return this.handleError(e)}}}),Object.defineProperty(t.prototype,"getElement",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getNode(),t=tV(e);if(!t||!F.isValidElement(t))throw Error("Could not convert the src to a React element");this.setState({element:t,status:tY})}catch(e){this.handleError(Error(e.message))}}}),Object.defineProperty(t.prototype,"load",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.isActive&&this.setState({content:"",element:null,status:tK},function(){var t,i=e.props,n=i.cacheRequests,a=i.src,r=n&&t3[a];if(r&&r.status===tZ)return void e.handleLoad(r.content);var o=a.match(/data:image\/svg[^,]*?(;base64)?,(.*)/);(o?t=o[1]?window.atob(o[2]):decodeURIComponent(o[2]):a.includes("\" "}),il=e=>{let{isOpen:t,onClose:i,onToggle:n}=(0,t6.useDisclosure)(),a=(0,t9.useMultiStyleConfig)("Dropdown",e),r=(0,t8.usePopper)({placement:"bottom-start"}),o=(0,F.useMemo)(()=>({isOpen:t,onClose:i,onToggle:n,popper:r}),[t,i,n,r]);return(0,j.jsx)(ia,{value:o,children:(0,j.jsx)(io,{value:a,children:(0,j.jsx)(ii.ListBox,{...e})})})},id=e=>{let{children:t,as:i,...n}=e,{popper:a,onToggle:r}=ir(),o=i||P.Button;return(0,j.jsx)(o,{...n,ref:a.referenceRef,onClick:(0,it.callAllHandlers)(e.onClick,r),children:(0,j.jsx)(t7.chakra.span,{__css:{pointerEvents:"none",flex:"1 1 auto",justifyContent:"flex-start",display:"flex",minW:0},children:t})})},ic=e=>{let{children:t,...i}=e,{isOpen:n,popper:a}=ir(),r=is();if(!n)return null;let o=a.getPopperProps({...e,style:{visibility:n?"visible":"hidden",...e.style}});return(0,j.jsx)(t7.chakra.div,{...i,mt:2,minWidth:"var(--chakra-sizes-48)",ref:a.popperRef,...o,__css:{zIndex:e.zIndex??r.list?.zIndex},children:(0,j.jsx)(ii.ListBoxList,{children:t})})},iu=e=>{let{onToggle:t}=ir();return(0,j.jsx)(ii.ListBoxItem,{...e,onClick:(0,it.callAllHandlers)(e.onClick,t)})};e.s(["Dropdown",0,il,"DropdownButton",0,id,"DropdownItem",0,iu,"DropdownList",0,ic],802150);let ip=({value:e,updateValue:t,choices:i,defaultIcon:n,option:a})=>(0,j.jsxs)(il,{isLazy:!0,children:[(0,j.jsx)(X.GammaTooltip,{placement:"top",label:a.name(),shouldWrapChildren:!0,children:(0,j.jsx)(id,{as:P.Button,variant:"toolbar",onMouseDown:ex.preventDefaultToAvoidBlur,rightIcon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faChevronDown,transform:"shrink-6"}),children:(0,j.jsx)(B.FontAwesomeIcon,{icon:i[e]?.icon||n})})}),(0,j.jsx)(ic,{children:Object.entries(i).map(([e,{icon:i,name:n,disabled:a}])=>a?null:(0,j.jsx)(iu,{icon:(0,j.jsx)(B.FontAwesomeIcon,{icon:i,fixedWidth:!0}),onClick:()=>t(e),children:n},e))})]}),ih=()=>({square:{name:d.i18n._({id:"1DA6ap",message:"Square"}),icon:c.faSquare},circle:{name:d.i18n._({id:"7xMmki",message:"Circle"}),icon:c.faCircle},landscape:{name:d.i18n._({id:"XxIeKn",message:"Landscape"}),icon:c.faRectangleWide},portrait:{name:d.i18n._({id:"3bV9gD",message:"Portrait"}),icon:c.faRectangleVertical}});e.s(["ImageShapeAspectRatios",0,{square:1,circle:1,landscape:1.618,portrait:.8},"ImageShapeOption",0,{key:"imageShape",defaultValue:()=>null,Control:({value:e,updateValue:t,editor:i,option:n})=>(0,j.jsx)(ip,{value:e,updateValue:t,editor:i,choices:ih(),option:n,defaultIcon:c.faSquare}),ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:"square"===e?c.faSquare:"circle"===e?c.faCircle:"landscape"===e?c.faRectangleWide:c.faRectangleVertical,items:Object.entries(ih()).map(([i,{name:n}])=>({key:n,label:n,icon:e===i?c.faCheck:void 0,onClick:()=>t(i)}))}),name:()=>d.i18n._({id:"JbOau/",message:"Image shape"}),validator:e=>!e||["square","circle","landscape","portrait"].includes(e)},"ImageShapeStyles",0,{square:{aspectRatio:"1 / 1"},circle:{borderRadius:"9999px",aspectRatio:"1 / 1"},landscape:{aspectRatio:"1.618 / 1"},portrait:{aspectRatio:"4 / 5"}}],517103);var im=e.i(297194),ig=e.i(697240);e.s(["MediaUploadIndicators",0,({uploadStatus:e,isEditable:t})=>{let i=e===im.UploadStatus.Uploading&&t,n=e===im.UploadStatus.Error;return i||n?(0,j.jsxs)(j.Fragment,{children:[i&&(0,j.jsx)(ig.MediaPlaceholderSpinner,{}),n&&(0,j.jsx)(ig.MediaPlaceholderErrorUploadingTag,{})]}):null}],820773);var ib=e.i(454519);e.s(["AiAnimationProvider",()=>ib.AIAnimationProvider],771732);var ix=e.i(604316);e.s(["PDFProvider",()=>ix.FileUploadProvider],787485),e.s(["CharacterLimitDisplay",0,({length:e,idealLength:t,maxLength:i})=>{let n=e>=i;return(0,j.jsxs)(Z.Text,{fontSize:"xs",color:n?"red.400":"gray.500",children:[n&&(0,j.jsx)(B.FontAwesomeIcon,{icon:eS.faWarning})," ",e,"/",t??i]})}],162690);var iy=e.i(963912);e.i(905506);var iv=e.i(267158),iC=e.i(274970);let iw=(0,F.forwardRef)(({initialHeight:e="1em",bottomSpacing:t=0,onChange:i,resizeOnMount:n=!0,onKeyDown:a,animated:r=!1,...o},s)=>{let l=(0,F.useRef)(null),d=s??l,[c,u]=(0,F.useState)(!1),p=(0,F.useCallback)(()=>{if("function"==typeof d||!d?.current)return;let i=d.current;if(!r||c){i.style.height=e,i.style.height=`${i.scrollHeight+t}px`;return}let n=i.offsetHeight;i.style.transition="none",i.style.height=e;let a=i.scrollHeight+t;if(a===n){i.style.height=`${a}px`;return}i.style.height=`${n}px`,i.offsetHeight,i.style.transition="height 0.15s ease-out",i.style.height=`${a}px`},[e,d,t,r,c]),[h,m]=(0,F.useState)(!1);(0,iv.useEffectWhen)(()=>{h||n?p():m(!0)},[p,o.value,h,n],[o.value]);let g=(0,iC.useWindowResizing)();return(0,F.useEffect)(()=>{g&&(r&&"function"!=typeof d&&d?.current&&(d.current.style.transition="none"),p())},[g,p,d,r]),(0,j.jsx)(iy.Textarea,{h:e,minH:e,ref:d,resize:"none",overflow:"hidden",...o,onCompositionStart:()=>u(!0),onCompositionEnd:()=>u(!1),onChange:e=>{p(),i?.(e)},onKeyDown:e=>{c||a?.(e)}})});iw.displayName="ResizingTextarea",e.s(["ResizingTextarea",0,iw],7301);var iS=e.i(428683),ik=e.i(344233),iA=e.i(865799);e.i(615835);var iE=e.i(842368),i_=e.i(652474);e.i(832019);var iI=e.i(736386),iM=e.i(180939),iT=e.i(103104);[...i_.PAID_PRODUCT_KEYS];let iL={free:{name:iT.FREE_PROPER_NOUN,gammaName:iT.FREE_PROPER_NOUN,targetAudience:"individual"},plus:{name:iT.PLUS_PROPER_NOUN,gammaName:iT.GAMMA_PLUS_PROPER_NOUN,targetAudience:"individual",canToggleBillingCycle:!0},pro:{name:iT.PRO_PROPER_NOUN,gammaName:iT.GAMMA_PRO_PROPER_NOUN,targetAudience:"individual",canToggleBillingCycle:!0},ultra:{name:iT.ULTRA_PROPER_NOUN,gammaName:iT.GAMMA_ULTRA_PROPER_NOUN,targetAudience:"individual"},team:{name:iT.TEAM_PROPER_NOUN,gammaName:iT.GAMMA_TEAM_PROPER_NOUN,targetAudience:"group",canSelectNumSeats:!0,minSeats:2,maxSeats:1e3},business:{name:iT.BUSINESS_PROPER_NOUN,gammaName:iT.GAMMA_BUSINESS_PROPER_NOUN,targetAudience:"group",shouldLinkToContactSales:!0,canSelectNumSeats:!0,minSeats:10,maxSeats:1e3}};z.Trans;let ij=({product:e="pro",lightGradient:t=!1,...i})=>(0,j.jsxs)(iA.Badge,{fontSize:"xxs",bottom:0,insetEnd:0,variant:e,height:"fit-content",alignSelf:"center",...t&&"ultra"!==e&&{bg:"linear-gradient(120deg, var(--chakra-colors-blue-200), white)",color:"blue.950"},...i,children:["ultra"===e?(0,j.jsx)(iS.Box,{me:.5,as:"span",children:(0,j.jsx)(B.FontAwesomeIcon,{icon:eS.faSparkle,size:"sm"})}):void 0," ",iL[e].name]});e.s(["PaidProductBadge",0,ij,"UpsellProductBadge",0,({canUseFeature:e,productFeature:t,lightGradient:i,...n})=>{let{user:a,isUserLoading:r}=(0,el.useUserContext)(),o=(0,iE.getProductRequiredForFeature)(t);return!a||r||e||null===o?null:(0,j.jsx)(ij,{product:o,lightGradient:i,...n})}],534904);var iP=e.i(256266);let iD={info:{light:{bg:"blue.100",border:"blue.500",title:"blue.500",subtitle:"gray.700"},dark:{bg:"blue.900",border:"blue.200",title:"blue.200",subtitle:"blue.100"}},warning:{light:{bg:"gray.100",border:"gray.700",buttonBorder:"gray.700",title:"gray.700",subtitle:"gray.700"},dark:{bg:"gray.800",border:"gray.200",title:"gray.200",subtitle:"gray.300"}},error:{light:{bg:"orange.100",border:"orange.600",title:"red.600",subtitle:"gray.700"},dark:{bg:"red.950",border:"red.900",buttonBorder:"red.900",title:"red.300",subtitle:"red.200"}}},iN=({statusBorderColor:e,...t})=>{let i=(0,R.useColorModeValue)("white","transparent"),n=(0,R.useColorModeValue)("blue.950","inherit"),a=(0,R.useColorModeValue)("blue.200","gray.600"),r=(0,R.useColorModeValue)("blue.50","whiteAlpha.100");return(0,j.jsx)(P.Button,{variant:"outline",bg:i,borderColor:e||a,borderRadius:"full",color:n,fontWeight:"semibold",_hover:{bg:r},...t})};e.s(["UpsellWarningBox",0,({productBadgeLabel:e,title:t,subtitle:i,onClick:n,cta:a,ctaTooltip:r,status:o="warning",onDismiss:s,stacked:l=!1,actions:u,borderColor:p,titleColor:h,subtitleColor:m})=>{let g=(0,iP.isMobileDevice)(),f=(0,R.useColorModeValue)("light","dark"),b=iD[o][f],x=h||b.title,y=m||b.subtitle;return(0,j.jsxs)(O.VStack,{borderRadius:"lg",bg:b.bg,border:"1px solid",borderColor:p||b.border,px:{base:2,md:3},ps:4,py:2.5,align:"stretch",w:"100%",spacing:2,children:[(0,j.jsxs)(U.HStack,{spacing:2,children:[e?(0,j.jsx)(ij,{product:e}):(0,j.jsx)(iS.Box,{color:x,flexShrink:0,children:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faSealExclamation})}),(0,j.jsxs)(iS.Box,{fontSize:"sm",lineHeight:"1.3",flex:"1",color:y,display:"flex",flexDirection:g?"column":"row",flexWrap:"wrap",columnGap:1.5,children:[(0,j.jsx)(Z.Text,{color:x,as:"strong",flex:"0 0 auto",children:t}),i&&(0,j.jsx)(Z.Text,{flex:"1 1 auto",children:i})]}),u||a&&(0,j.jsx)(X.GammaTooltip,{label:r,placement:"top",children:(0,j.jsx)(iN,{statusBorderColor:"buttonBorder"in b?b.buttonBorder:void 0,onClick:n,cursor:n?"pointer":"default",size:"xs",px:4,py:3,flexShrink:0,display:l?"none":{base:"none",sm:"inline-flex"},children:a})}),s&&(0,j.jsx)(ik.IconButton,{size:"sm",variant:"ghost",color:y,flexShrink:0,_hover:{opacity:.7},icon:(0,j.jsx)(B.FontAwesomeIcon,{icon:eS.faXmark,fontSize:"16px"}),"aria-label":d.i18n._({id:"1QfxQT",message:"Dismiss"}),onClick:s})]}),!u&&a&&(0,j.jsx)(X.GammaTooltip,{label:r,placement:"top",children:(0,j.jsx)(iN,{statusBorderColor:b.border,onClick:n,cursor:n?"pointer":"default",size:"md",px:4,py:3,w:"100%",display:l?"inline-flex":{base:"inline-flex",sm:"none"},children:a})})]})}],973886);var iR=e.i(533879);"u"this.maxSizeBytes&&this.cache.size>0;){let e=this.cache.keys().next().value,t=this.cache.get(e);this.currentSizeBytes-=t.size,this.cache.delete(e)}if(i>this.maxSizeBytes)return void console.warn(`Item ${e} exceeds max cache size (${i} > ${this.maxSizeBytes})`);let n={value:t,timestamp:Date.now(),size:i};this.cache.set(e,n),this.currentSizeBytes+=i,this.persistToStorage()}load(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp>this.expiryMs?(this.currentSizeBytes-=t.size,this.cache.delete(e),this.persistToStorage(),null):(this.cache.delete(e),this.cache.set(e,t),this.persistToStorage(),t.value):null}delete(e){let t=this.cache.get(e);return!!t&&(this.currentSizeBytes-=t.size,this.cache.delete(e),this.persistToStorage(),!0)}clear(){this.cache.clear(),this.currentSizeBytes=0,this.persistToStorage()}get size(){return this.cache.size}get sizeBytes(){return this.currentSizeBytes}loadFromStorage(){if(window.localStorage)try{let e=localStorage.getItem(this.storageKey);if(!e)return;let t=JSON.parse(e),i=Date.now();for(this.cache.clear(),this.currentSizeBytes=0,t.forEach(([e,t])=>{i-t.timestamp<=this.expiryMs&&(this.cache.set(e,t),this.currentSizeBytes+=t.size)});this.currentSizeBytes>this.maxSizeBytes&&this.cache.size>0;){let e=this.cache.keys().next().value,t=this.cache.get(e);this.currentSizeBytes-=t.size,this.cache.delete(e)}}catch(e){console.error("Failed to load cache from localStorage:",e),this.cache.clear(),this.currentSizeBytes=0}}persistToStorage(){if(window.localStorage)try{let e=Array.from(this.cache.entries());localStorage.setItem(this.storageKey,JSON.stringify(e))}catch(e){if(console.error("Failed to persist cache to localStorage:",e),e instanceof DOMException&&"QuotaExceededError"===e.name){let e=Math.ceil(.2*this.cache.size);for(let t=0;t0;t++){let e=this.cache.keys().next().value,t=this.cache.get(e);this.currentSizeBytes-=t.size,this.cache.delete(e)}try{let e=Array.from(this.cache.entries());localStorage.setItem(this.storageKey,JSON.stringify(e))}catch(e){console.error("Failed to persist cache after reduction:",e)}}}}getAllValid(){let e=new Map,t=Date.now(),i=[];return this.cache.forEach((n,a)=>{t-n.timestamp<=this.expiryMs?e.set(a,n.value):i.push(a)}),i.length>0&&(i.forEach(e=>{let t=this.cache.get(e);this.currentSizeBytes-=t.size,this.cache.delete(e)}),this.persistToStorage()),e}}({storageKey:"ai_interaction_cache",maxSizeBytes:5242880,expiryMs:36e5});var iH=e.i(683989),iW=e.i(863750),iU=e.i(430378);let iV=async e=>{let t=(0,es.getCurrentUser)().id,i=(0,iE.getProductForWorkspace)((0,es.getCurrentWorkspace)()),n=(0,iH.getApolloClient)(),a=await n.mutate({mutation:iW.DeductCreditsV2Document,variables:{input:e}}),r=a.data?.deductCreditsV2;if(!r)return null;let{deducted:o,remaining:s}=r,l={isCreditsV2:!0,description:e.description,operationCount:e.operationCount,operation:e.operation,model:e.model,userId:t,workspaceId:e.workspaceId,used:o,source:e.source,remaining:s,interactionId:e.interactionId,plan:i};return iU.analytics.track(H.SegmentEvents.AI_CREDITS_USED,l),{deducted:o,remaining:s}};var iG=iB;class i$ extends iG.EventEmitter{items;constructor(e={}){super(),this.items=e}add(e,t){if(this.items[e])return this;let i={id:e,status:"pending",created:new Date().toISOString(),toDeduct:t,creditsDeducted:null,creditsRemaining:null,deductedAt:null};return this.items[e]=i,this}async deduct(e){let t=this.items[e];if(!t)throw Error(`No item found with id ${e}`);if("pending"===t.status){t.status="processing";try{let e=new Date().toISOString(),i=await iV(t.toDeduct);if(!i)throw Error("No result returned from deductCreditsV2");t.status="charged",t.creditsDeducted=i.deducted,t.creditsRemaining=i.remaining,t.deductedAt=e,this.emit("DEDUCTION_CHARGED",{item:t})}catch(e){t.status="error",t.error=e.message,this.emit("DEDUCTION_ERROR",{item:t,error:e.message});return}}}toString(){let e=(e,t)=>e.length>t?e.substring(0,t-1)+"…":e.padEnd(t),t=[e("ID",12),e("Status",8),e("Operation",8),e("Model",16),e("Credits Deducted",8),e("Error",20)].join(" | "),i=["-".repeat(12),"-".repeat(8),"-".repeat(8),"-".repeat(16),"-".repeat(8),"-".repeat(20)].join("-+-"),n=Object.values(this.items).map(t=>{let i=t.toDeduct.operation||"N/A",n=t.toDeduct.model||"N/A",a=null!==t.creditsDeducted?t.creditsDeducted.toString():"N/A",r=t.error||"";return[e(t.id,12),e(t.status,8),e(i,8),e(n,16),e(a,8),e(r,20)].join(" | ")});return["Interaction Ledger","=".repeat(i.length),t,i,...n,"=".repeat(i.length),`Total items: ${Object.keys(this.items).length}`].join("\n")}serialize(){return{items:this.items}}}let iZ=e=>"buddy-chat"===e;e.s(["shouldChargeForInteraction",0,iZ],340560);var iK=((a={}).Start="ai.interaction.start",a.Finish="ai.interaction.finish",a.DeductionSuccess="ai.interaction.deduction.success",a.DeductionError="ai.interaction.deduction.error",a);let iq={"generate-deck":"p0","generate-outline":"p0","buddy-chat":"p1","generate-image":"p1","generate-remix":"p2","generator-v3-chat":"p2","import-ppt-vision":"p2","import-go-prompt-editor":"p2","import-get-from-google-drive":"p2","import-get-web-url":"p2","import-parse-pdf":"p2","import-parse-ppt":"p2","import-parse-docx":"p2","card-image-item-retry":"p2","design-chat":"p1","design-generation":"p1","design-generation-more":"p2","design-canvas-generation":"p1","design-tool-edit":"p2"};class iY extends iB.EventEmitter{name;id;ledger;get traceparent(){return this.span.traceparent}span;logger;static create(e,t){return new iY(e,t)}static load(e){let t=iF.load(e);return t?new iY(t.name,e,t.span,t.ledger):null}constructor(t,i,n,a){super(),this.name=t,this.setupLedger(a);const r=function(e){return e.trim().replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase()}(t);this.span=n?iz.aijsxTracer.loadSpan(n):iz.aijsxTracer.createSpan("ai.interaction",{attributes:{interactionName:t,resource_name:r}}),this.id=i||`${this.span.spanContext.traceId}-${this.span.spanContext.spanId}`,this.span.setAttributes({interactionId:this.id});const o={dd:{span_id:BigInt(`0x${this.span.spanContext.spanId}`).toString(),trace_id:BigInt(`0x${this.span.spanContext.traceId}`).toString()},interactionId:this.id,interactionName:t,resource_name:r,...this.getCommonAttributes()};if((0,eB.isClientSide)()){const{datadogLogs:t}=e.r(963365);this.logger=t.createLogger("AIInteraction",{context:o})}else this.logger=((e,t)=>({debug:(i,...n)=>{console.debug(`[${e}] ${i}`,t,...n)},info:(i,...n)=>{console.info(`[${e}] ${i}`,t,...n)},warn:(i,...n)=>{console.warn(`[${e}] ${i}`,t,...n)},error:(i,...n)=>{console.error(`[${e}] ${i}`,t,...n)}}))("AIInteraction",o)}setAttributes(e){return this.span.setAttributes(e),iF.save(this.id,this.serialize()),this}start(e){return"created"!==this.span.status?this.logger.warn("AIInteraction.start called when already started"):(this.span.start(),this.setAttributes({...this.getCommonAttributes(),...e}),this.logger.info(`[AIInteraction] start: ${this.name}`,{logType:iK.Start,type:"start",interactionStatus:null,interactionId:this.id,interactionName:this.name,attributes:this.span.attributes}),iF.save(this.id,this.serialize())),this}error(e){if("started"!==this.span.status)return void this.logger.warn("AIInteraction.error called when already ended");let t=function(e){let t;if(!(e instanceof iR.ApolloError))return null;for(let i of(t=e?.graphQLErrors||[],t?.map(e=>e.extensions?.code||e.code)))if(function(e){return iO.some(t=>t===e)}(i))return i;return null}(e);if(t){this.logger.info(`[AIInteraction] expected error in ${this.name}: ${t}`,{logType:iK.Finish,interactionStatus:"complete",interactionId:this.id,interactionName:this.name,expectedErrorCode:t,attributes:this.span.attributes}),this.complete({expectedError:{code:t}});return}this.onEnd("error",{error:e})}complete(e){"started"!==this.span.status?this.logger.warn("AIInteraction.complete called when already ended"):(e&&this.span.setAttributes(e),this.onEnd("complete"))}abort(e=!1){"started"!==this.span.status?this.logger.warn("AIInteraction.abort called when already ended"):this.onEnd("aborted",{sendAsBeacon:e})}stop(){"started"!==this.span.status?this.logger.warn("AIInteraction.stop called when already ended"):this.onEnd("stopped")}trace(e,t,i){return this.span.trace(e,t,i)}charge(e,t){this.ledger.add(e,t),iZ(this.name)&&this.ledger.deduct(e)}onEnd(e,{error:t,sendAsBeacon:i}={}){this.span.setAttributes({interaction_status:e}),t?(this.logger.error(`[AIInteraction] ${e}: ${this.name} - ${t.message}`,{logType:iK.Finish,interaction_status:e,interactionId:this.id,interactionName:this.name,attributes:this.span.attributes,errorInfo:{message:t.message,stack:t.stack,name:t.name}},t),this.span.recordException(t)):this.logger.info(`[AIInteraction] ${e}: ${this.name}`,{logType:iK.Finish,interaction_status:e,interactionId:this.id,interactionName:this.name,attributes:this.span.attributes}),this.span.end(i),this.emit("end",{}),iF.save(this.id,this.serialize())}setupLedger(e){this.ledger=new i$(e?.items||{}),this.ledger.on("DEDUCTION_CHARGED",({item:e})=>{this.logDeduction(e)}),this.ledger.on("DEDUCTION_ERROR",({item:e})=>{this.logDeductionError(e)})}serialize(){return{id:this.id,name:this.name,span:this.span.serialize(),ledger:this.ledger.serialize()}}getCommonAttributes(){try{let e=(0,ei.getStore)(),t=(0,es.getCurrentUser)(),i=(0,es.getCurrentWorkspace)();return{docId:(0,ea.selectDocId)(e.getState())??null,userId:t?.id??null,userEmail:t?.email??null,workspaceId:i?.id??null,workspaceName:i?.name??null,product:(0,iE.getProductForWorkspace)((0,es.getCurrentWorkspace)())??"free",device:(0,iP.getDeviceType)(),priority:iq[this.name]??"p3"}}catch(e){return this.logger.error("Error getting common AIInteraction attributes ",e),{}}}logDeductionError(e){this.logger.error(`[AIInteraction] error deducting credits in ${this.name}: ${e.error}`,{logType:iK.DeductionError,deduction:e})}logDeduction(e){this.logger.info(`[AIInteraction] deducted credits in ${this.name}: [${e.toDeduct.operation} - ${e.toDeduct.model}] ${e.creditsDeducted} credits`,{logType:iK.DeductionSuccess,deduction:e})}}e.s(["AIInteraction",0,iY],586044);class iX{name;current;cleanupFn;constructor(e){this.name=e,this.name=e,this.current=this.createInteraction()}createInteraction(){let e=iY.create(this.name);return this.cleanupFn&&this.cleanupFn(),this.cleanupFn=e.on("end",()=>{this.current=this.createInteraction()}),e}stop(){"started"===this.current.span.status&&this.current.stop()}abort(e=!1){"started"===this.current.span.status&&this.current.abort(e)}reset(){this.current=this.createInteraction()}cleanup(){this.cleanupFn&&(this.cleanupFn(),this.cleanupFn=void 0)}}e.s(["useAIInteraction",0,(e,{abortOnUnmount:t=!0}={})=>{let i=(0,F.useMemo)(()=>new iX(e),[e]);return(0,F.useEffect)(()=>()=>{t&&i.current.abort(),i.cleanup()},[i,t]),(0,F.useEffect)(()=>{let e=()=>{t&&i.current.abort(!0)};return window.addEventListener("beforeunload",e),()=>{window.removeEventListener("beforeunload",e)}},[i,t]),i}],324886);var iQ=e.i(367792);let iJ=(e,t)=>{iU.analytics.track(e,{...t,gitSHA:iQ.config.GIT_SHA,product:(0,iE.getProductForWorkspace)((0,es.getCurrentWorkspace)()),device:(0,iP.getDeviceType)()})},i0=e=>{iJ(H.SegmentEvents.AI_REQUEST_SENT,e)},i1=e=>{iJ(H.SegmentEvents.AI_REQUEST_RESPONSE,e)},i2=e=>{iJ(H.SegmentEvents.AI_REQUEST_ERROR,e)};e.s(["trackAIIImageFeedback",0,e=>{iJ(H.SegmentEvents.AI_IMAGE_FEEDBACK_SUBMITTED,e)},"trackAIImageRating",0,e=>{iJ(H.SegmentEvents.AI_IMAGE_RATED,e)},"trackAIImageSelected",0,e=>{iJ(H.SegmentEvents.AI_IMAGE_SELECTED,e)},"trackAIRequestError",0,i2,"trackAIRequestResponse",0,i1,"trackAIRequestSent",0,i0,"trackBuddyResultFeedback",0,e=>{iJ(H.SegmentEvents.AI_AGENT_RESPONSE_FEEDBACK,{...e,tags_map:e.tags.reduce((e,t)=>(e[t]=!0,e),{})})},"trackBuddyResultRatedImplicit",0,e=>{iJ(H.SegmentEvents.AI_AGENT_RESULT_RATED_IMPLICIT,e)},"trackBuddyResultRating",0,e=>{iJ(H.SegmentEvents.AI_AGENT_RESPONSE_RATED,e)},"trackEditCardFeedback",0,e=>{iJ(H.SegmentEvents.AI_CARD_FEEDBACK,e)},"trackEditCardRating",0,e=>{iJ(H.SegmentEvents.AI_CARD_RATING,e)},"trackImageReplaced",0,e=>{iJ(H.SegmentEvents.IMAGE_REPLACED,e)},"trackSelectiveAcceptCollapsed",0,e=>{iJ(H.SegmentEvents.AI_SELECTIVE_ACCEPT_COLLAPSED,e)},"trackSelectiveAcceptExpanded",0,e=>{iJ(H.SegmentEvents.AI_SELECTIVE_ACCEPT_EXPANDED,e)},"trackSelectiveAcceptShown",0,e=>{iJ(H.SegmentEvents.AI_SELECTIVE_ACCEPT_SHOWN,e)}],929508);var i3=e.i(389928),i5=e.i(849187),i4=e.i(994633);e.s([],989619);var i6=e.i(180078),i9=e.i(29215),i8=e.i(743373),i7=e.i(382167),ne=e.i(775493),nt=e.i(704077),ni=e.i(112010),nn=e.i(588183),na=e.i(751827),nr=e.i(918228),no=e.i(876533),ns=e.i(960480);e.i(144786);let nl={CREATE_NEW_GAMMA:"https://help.gamma.app/en/articles/7838093-how-to-create-a-new-presentation-document-or-webpage-with-gamma-ai",ADD_BLOCKS:"https://help.gamma.app/en/articles/7898153-how-to-add-blocks-and-content",CHANGE_THEME:"https://help.gamma.app/en/articles/10262646-how-to-change-the-theme-in-gamma",EDIT_WITH_AI:"https://help.gamma.app/en/articles/8033284-how-to-edit-content-using-ai",PRESENT_MODE:"https://help.gamma.app/en/articles/8032935-how-to-present-your-gamma",EXPORT:"https://help.gamma.app/en/articles/8022861-how-to-export-gammas",AI_CREDITS:"https://help.gamma.app/en/articles/7834324-about-how-ai-credits-work",EARN_CREDITS_WITH_REFERRALS:"https://help.gamma.app/en/articles/7834324-about-how-ai-credits-work",UPGRADE_TO_PAID:"https://help.gamma.app/en/articles/8077107-about-upgrading-your-workspace-to-gamma-s-paid-plans",CANCELLATION:"https://help.gamma.app/en/articles/8568920-how-to-manage-or-cancel-your-gamma-subscription",CREATE_SITE:"https://help.gamma.app/en/articles/8429268-how-to-create-a-site",PUBLISH_SITE:"https://help.gamma.app/en/collections/12178914-websites-publishing",SSO_END_USER_GUIDE:"https://help.gamma.app/en/articles/12608550-how-do-i-log-in-with-single-sign-on-sso",CREDITS:"https://help.gamma.app/en/articles/7834324-how-do-credits-work-in-gamma",INFOGRAPHICS:"https://help.gamma.app/en/articles/13920805-how-do-i-add-infographics-in-gamma",ANIMATIONS:"https://help.gamma.app/en/articles/13920980-how-do-i-add-animations-in-gamma",CHARTS_AND_DIAGRAMS:"https://help.gamma.app/en/articles/11029098-how-can-i-generate-charts-and-diagrams-in-gamma",STYLE_REFERENCES:"https://help.gamma.app/en/articles/13928575-what-are-image-style-references-and-how-do-i-use-them",MULTI_PAGE_GAMMAS:"https://help.gamma.app/en/articles/13929260-what-are-multi-page-gammas-and-how-do-i-use-them",WORKSPACE_TEMPLATES:"https://help.gamma.app/en/articles/12590858-how-do-i-use-workspace-templates",REMIX:"https://help.gamma.app/en/articles/12601672-what-is-remix-and-how-do-i-use-it",INTEGRATIONS:"https://help.gamma.app/en/articles/13943863-integrations-and-connectors-with-gamma",IMAGINE:"https://help.gamma.app/en/articles/13928852-what-is-imagine-and-how-do-i-design-with-it"};e.s(["GAMMA_SUPPORT_EMAIL",0,"support@gamma.app","HELP_ARTICLE_URLS",0,nl],971681);var nd=j,nc=e.i(676828),nu=z;let np=({size:e="md"}={})=>({content:'""',position:"absolute",inset:0,borderRadius:"lg"===e?"lg":"md",border:`${"lg"===e?3:2}px solid transparent`,background:"var(--chakra-colors-gradient-brand-bg) border-box",mask:"linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)",maskComposite:"subtract",opacity:.7,pointerEvents:"none"});e.s(["gradientBorderBeforeStyles",0,np],364351);let nh=({title:e=(0,nd.jsx)(nu.Trans,{message:"Create without limits",id:"0i4o6E"}),description:t,buttonLabel:i,onOpenCallback:n,onCloseCallback:a,segmentEvent:r,targetFeature:o,isNarrow:s,upsellLocation:l,...d})=>{let c=(0,i5.useFeatureFlag)("planCreditsLaunch"),{openUpsellModal:u}=(0,iI.useMonetizationContext)(),p={light:{bgGradient:"linear-gradient(0deg, var(--chakra-colors-gray-50) 0%, white 100%)",title:"gray.800",description:"gray.600"},dark:{bgGradient:"linear-gradient(0deg, var(--chakra-colors-gray-800) 0%, var(--chakra-colors-gray-700) 100%)",title:"gray.50",description:"gray.50"}}["light"===(0,R.useColorMode)().colorMode?"light":"dark"],h=c?(0,nd.jsx)(nu.Trans,{message:"Upgrade for more credits, advanced AI models, and branding tools.",id:"TBvhj7"}):(0,nd.jsx)(nu.Trans,{message:"Upgrade to unlock our most powerful AI and branding features.",id:"0GWGUB"}),m=c?(0,nd.jsx)(nu.Trans,{message:"More power, fewer limits",id:"1lwYKC"}):(0,nd.jsx)(nu.Trans,{message:"Create without limits",id:"0i4o6E"});return(0,nd.jsxs)(N.Flex,{flex:1,w:"100%",mb:4,p:4,bgGradient:p.bgGradient,position:"relative",flexDirection:s?"column":"row",align:"center",borderRadius:"lg",gap:4,zIndex:1,boxShadow:"md",_before:np({size:"lg"}),...d,children:[(0,nd.jsxs)(nr.Stack,{flex:2,alignSelf:"stretch",spacing:1,children:[(0,nd.jsx)(nc.Heading,{size:"sm",color:p.title,children:e||m}),(0,nd.jsx)(Z.Text,{color:p.description,fontSize:{base:"xs",md:"sm"},children:t||h})]}),(0,nd.jsx)(nr.Stack,{spacing:1,flex:0,justifyContent:"flex-end",children:(0,nd.jsx)(P.Button,{variant:"plain",size:{base:"xs",md:"md"},"data-test-id":"ai-credits-upsell",onClick:()=>{u({onOpenCallback:n,onCloseCallback:a,segmentEvent:r,targetFeature:o??null,upsellLocation:l})},children:i||(0,nd.jsx)(nu.Trans,{message:"Upgrade",id:"kwkhPe"})})})]})};var nm=H;let ng=(e,t)=>{let i;if(!e)return{};let n=(0,iE.getProductForWorkspace)(e),a=t?.products?.[0]?.productPrice?.frequencyUnit;return{workspaceId:e?.id,currentProduct:n??"free",current_plan:n?(0,iE.getPlanLoggingName)(n,a):null,subscription_tenure_days:t?(i=t?.createdTime||"")?Math.floor((Date.now()-new Date(i).getTime())/864e5):null:null,numWorkspaceMembers:e?.memberCount}};var nf=e.i(40317),nb=e.i(404529),nx=e.i(531768),ny=e.i(147349),nv=e.i(470645),nC=e.i(216912);let nw=(0,nC.forwardRef)(function(e,t){let{spacing:i="0.5rem",spacingX:n,spacingY:a,children:r,justify:o,direction:s,align:l,className:d,shouldWrapChildren:c,...u}=e,p=(0,F.useMemo)(()=>c?F.Children.map(r,(e,t)=>(0,j.jsx)(nS,{children:e},t)):r,[r,c]);return(0,j.jsx)(t7.chakra.div,{ref:t,className:(0,nv.cx)("chakra-wrap",d),...u,children:(0,j.jsx)(t7.chakra.ul,{className:"chakra-wrap__list",__css:{display:"flex",flexWrap:"wrap",justifyContent:o,alignItems:l,flexDirection:s,listStyleType:"none",gap:i,columnGap:n,rowGap:a,padding:"0"},children:p})})});nw.displayName="Wrap";let nS=(0,nC.forwardRef)(function(e,t){let{className:i,...n}=e;return(0,j.jsx)(t7.chakra.li,{ref:t,__css:{display:"flex",alignItems:"flex-start"},className:(0,nv.cx)("chakra-wrap__listitem",i),...n})});nS.displayName="WrapItem",e.s(["Wrap",0,nw,"WrapItem",0,nS],550530);var nk=e.i(55261),nA=e.i(736641),nE=e.i(623886),n_=e.i(699213);function nI(e,t){(0,n_.default)(2,arguments);var i=(0,nE.default)(e),n=(0,nE.default)(t),a=i.getTime()-n.getTime();return a<0?-1:a>0?1:a}function nM(e){var t={},i=e;if(null==t)throw TypeError("assign requires that input parameter not be null or undefined");for(var n in i=i||{})i.hasOwnProperty(n)&&(t[n]=i[n]);return t}var nT=e.i(686435);function nL(e,t){return(0,n_.default)(1,arguments),function(e,t){var i,n,a,r,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n_.default)(2,arguments);var s=o.locale||nT.default;if(!s.formatDistance)throw RangeError("locale must contain localize.formatDistance property");var l=nI(e,t);if(isNaN(l))throw RangeError("Invalid time value");var d=nM(o);d.addSuffix=!!o.addSuffix,d.comparison=l,l>0?(i=(0,nE.default)(t),n=(0,nE.default)(e)):(i=(0,nE.default)(e),n=(0,nE.default)(t));var c=null==o.roundingMethod?"round":String(o.roundingMethod);if("floor"===c)a=Math.floor;else if("ceil"===c)a=Math.ceil;else if("round"===c)a=Math.round;else throw RangeError("roundingMethod must be 'floor', 'ceil' or 'round'");var u=n.getTime()-i.getTime(),p=u/6e4,h=(u-((0,nA.default)(n)-(0,nA.default)(i)))/6e4;if("second"===(r=null==o.unit?p<1?"second":p<60?"minute":p<1440?"hour":h<43200?"day":h<525600?"month":"year":String(o.unit))){var m=a(u/1e3);return s.formatDistance("xSeconds",m,d)}if("minute"===r){var g=a(p);return s.formatDistance("xMinutes",g,d)}if("hour"===r){var f=a(p/60);return s.formatDistance("xHours",f,d)}if("day"===r){var b=a(h/1440);return s.formatDistance("xDays",b,d)}if("month"===r){var x=a(h/43200);return 12===x&&"month"!==o.unit?s.formatDistance("xYears",1,d):s.formatDistance("xMonths",x,d)}else if("year"===r){var y=a(h/525600);return s.formatDistance("xYears",y,d)}throw RangeError("unit must be 'second', 'minute', 'hour', 'day', 'month' or 'year'")}(e,Date.now(),t)}function nj(e,t){(0,n_.default)(2,arguments);var i=(0,nE.default)(e),n=(0,nE.default)(t);return i.getTime()-n.getTime()}e.s(["formatDistanceToNowStrict",0,nL],301219);var nP=e.i(799306),nD=/[T ]/,nN=/[Z ]/i,nR=/([Z+-].*)$/,nO=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,nB=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,nz=/^([+-])(\d{2})(?::?(\d{2}))?$/;function nF(e,t){(0,n_.default)(1,arguments);var i,n,a=t||{},r=null==a.additionalDigits?2:(0,nP.default)(a.additionalDigits);if(2!==r&&1!==r&&0!==r)throw RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof e&&"[object String]"!==Object.prototype.toString.call(e))return new Date(NaN);var o=function(e){var t,i={},n=e.split(nD);if(n.length>2)return i;if(/:/.test(n[0])?(i.date=null,t=n[0]):(i.date=n[0],t=n[1],nN.test(i.date)&&(i.date=e.split(nN)[0],t=e.substr(i.date.length,e.length))),t){var a=nR.exec(t);a?(i.time=t.replace(a[1],""),i.timezone=a[1]):i.time=t}return i}(e);if(o.date){var s=function(e,t){var i=RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(i);if(!n)return{year:null};var a=n[1]&&parseInt(n[1]),r=n[2]&&parseInt(n[2]);return{year:null==r?a:100*r,restDateString:e.slice((n[1]||n[2]).length)}}(o.date,r);i=function(e,t){if(null===t)return null;var i,n,a,r,o,s,l,d,c,u,p,h,m=e.match(nO);if(!m)return null;var g=!!m[4],f=nH(m[1]),b=nH(m[2])-1,x=nH(m[3]),y=nH(m[4]),v=nH(m[5])-1;if(g){return(i=y,n=v,i>=1&&i<=53&&n>=0&&n<=6)?(a=t,r=y,o=v,(s=new Date(0)).setUTCFullYear(a,0,4),l=s.getUTCDay()||7,s.setUTCDate(s.getUTCDate()+((r-1)*7+o+1-l)),s):new Date(NaN)}var C=new Date(0);return(d=t,c=b,u=x,c>=0&&c<=11&&u>=1&&u<=(nU[c]||(nV(d)?29:28))&&(p=t,(h=f)>=1&&h<=(nV(p)?366:365)))?(C.setUTCFullYear(t,b,Math.max(f,x)),C):new Date(NaN)}(s.restDateString,s.year)}if(isNaN(i)||!i)return new Date(NaN);var l=i.getTime(),d=0;if(o.time&&(isNaN(d=function(e){var t,i,n,a=e.match(nB);if(!a)return null;var r=nW(a[1]),o=nW(a[2]),s=nW(a[3]);return(t=r,i=o,n=s,24===t?0===i&&0===n:n>=0&&n<60&&i>=0&&i<60&&t>=0&&t<25)?36e5*r+6e4*o+1e3*s:NaN}(o.time))||null===d))return new Date(NaN);if(o.timezone){if(isNaN(n=function(e){if("Z"===e)return 0;var t,i=e.match(nz);if(!i)return 0;var n="+"===i[1]?-1:1,a=parseInt(i[2]),r=i[3]&&parseInt(i[3])||0;return(t=r)>=0&&t<=59?n*(36e5*a+6e4*r):NaN}(o.timezone)))return new Date(NaN)}else{var c=new Date(l+d),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(l+d+n)}function nH(e){return e?parseInt(e):1}function nW(e){return e&&parseFloat(e.replace(",","."))||0}var nU=[31,null,31,30,31,30,31,31,30,31,30,31];function nV(e){return e%400==0||e%4==0&&e%100}e.s(["parseISO",0,nF],684034);var nG={lessThanXSeconds:{one:"minder as 'n sekonde",other:"minder as {{count}} sekondes"},xSeconds:{one:"1 sekonde",other:"{{count}} sekondes"},halfAMinute:"'n halwe minuut",lessThanXMinutes:{one:"minder as 'n minuut",other:"minder as {{count}} minute"},xMinutes:{one:"'n minuut",other:"{{count}} minute"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} ure"},xHours:{one:"1 uur",other:"{{count}} ure"},xDays:{one:"1 dag",other:"{{count}} dae"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weke"},xWeeks:{one:"1 week",other:"{{count}} weke"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maande"},xMonths:{one:"1 maand",other:"{{count}} maande"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer as 1 jaar",other:"meer as {{count}} jaar"},almostXYears:{one:"byna 1 jaar",other:"byna {{count}} jaar"}},n$=e.i(898867),nZ={date:(0,n$.default)({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"yyyy/MM/dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},nK={lastWeek:"'verlede' eeee 'om' p",yesterday:"'gister om' p",today:"'vandag om' p",tomorrow:"'môre om' p",nextWeek:"eeee 'om' p",other:"P"},nq=e.i(230867),nY={ordinalNumber:function(e){var t=Number(e),i=t%100;if(i<20)switch(i){case 1:case 8:break;default:return t+"de"}return t+"ste"},era:(0,nq.default)({values:{narrow:["vC","nC"],abbreviated:["vC","nC"],wide:["voor Christus","na Christus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1ste kwartaal","2de kwartaal","3de kwartaal","4de kwartaal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mrt","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"],wide:["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","D","W","D","V","S"],short:["So","Ma","Di","Wo","Do","Vr","Sa"],abbreviated:["Son","Maa","Din","Woe","Don","Vry","Sat"],wide:["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"vm",pm:"nm",midnight:"middernag",noon:"middaguur",morning:"oggend",afternoon:"middag",evening:"laat middag",night:"aand"},abbreviated:{am:"vm",pm:"nm",midnight:"middernag",noon:"middaguur",morning:"oggend",afternoon:"middag",evening:"laat middag",night:"aand"},wide:{am:"vm",pm:"nm",midnight:"middernag",noon:"middaguur",morning:"oggend",afternoon:"middag",evening:"laat middag",night:"aand"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm",pm:"nm",midnight:"middernag",noon:"uur die middag",morning:"uur die oggend",afternoon:"uur die middag",evening:"uur die aand",night:"uur die aand"},abbreviated:{am:"vm",pm:"nm",midnight:"middernag",noon:"uur die middag",morning:"uur die oggend",afternoon:"uur die middag",evening:"uur die aand",night:"uur die aand"},wide:{am:"vm",pm:"nm",midnight:"middernag",noon:"uur die middag",morning:"uur die oggend",afternoon:"uur die middag",evening:"uur die aand",night:"uur die aand"}},defaultFormattingWidth:"wide"})},nX=e.i(94549),nQ=e.i(37064),nJ={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(ste|de)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?C\.?)/,wide:/^((voor|na) Christus)/},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/,/^n/]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234](st|d)e kwartaal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(Jan|Feb|Mrt|Apr|Mei|Jun|Jul|Aug|Sep|Okt|Nov|Dec)\.?/i,wide:/^(Januarie|Februarie|Maart|April|Mei|Junie|Julie|Augustus|September|Oktober|November|Desember)/i},defaultMatchWidth:"wide",parsePatterns:{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:[/^Jan/i,/^Feb/i,/^Mrt/i,/^Apr/i,/^Mei/i,/^Jun/i,/^Jul/i,/^Aug/i,/^Sep/i,/^Okt/i,/^Nov/i,/^Dec/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smdwv]/i,short:/^(So|Ma|Di|Wo|Do|Vr|Sa)/i,abbreviated:/^(Son|Maa|Din|Woe|Don|Vry|Sat)/i,wide:/^(Sondag|Maandag|Dinsdag|Woensdag|Donderdag|Vrydag|Saterdag)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^S/i,/^M/i,/^D/i,/^W/i,/^D/i,/^V/i,/^S/i],any:[/^So/i,/^Ma/i,/^Di/i,/^Wo/i,/^Do/i,/^Vr/i,/^Sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(vm|nm|middernag|(?:uur )?die (oggend|middag|aand))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^vm/i,pm:/^nm/i,midnight:/^middernag/i,noon:/^middaguur/i,morning:/oggend/i,afternoon:/middag/i,evening:/laat middag/i,night:/aand/i}},defaultParseWidth:"any"})},n0={lessThanXSeconds:{one:"أقل من ثانية واحدة",two:"أقل من ثانتين",threeToTen:"أقل من {{count}} ثواني",other:"أقل من {{count}} ثانية"},xSeconds:{one:"ثانية واحدة",two:"ثانتين",threeToTen:"{{count}} ثواني",other:"{{count}} ثانية"},halfAMinute:"نصف دقيقة",lessThanXMinutes:{one:"أقل من دقيقة",two:"أقل من دقيقتين",threeToTen:"أقل من {{count}} دقائق",other:"أقل من {{count}} دقيقة"},xMinutes:{one:"دقيقة واحدة",two:"دقيقتين",threeToTen:"{{count}} دقائق",other:"{{count}} دقيقة"},aboutXHours:{one:"ساعة واحدة تقريباً",two:"ساعتين تقريباً",threeToTen:"{{count}} ساعات تقريباً",other:"{{count}} ساعة تقريباً"},xHours:{one:"ساعة واحدة",two:"ساعتين",threeToTen:"{{count}} ساعات",other:"{{count}} ساعة"},xDays:{one:"يوم واحد",two:"يومين",threeToTen:"{{count}} أيام",other:"{{count}} يوم"},aboutXWeeks:{one:"أسبوع واحد تقريباً",two:"أسبوعين تقريباً",threeToTen:"{{count}} أسابيع تقريباً",other:"{{count}} أسبوع تقريباً"},xWeeks:{one:"أسبوع واحد",two:"أسبوعين",threeToTen:"{{count}} أسابيع",other:"{{count}} أسبوع"},aboutXMonths:{one:"شهر واحد تقريباً",two:"شهرين تقريباً",threeToTen:"{{count}} أشهر تقريباً",other:"{{count}} شهر تقريباً"},xMonths:{one:"شهر واحد",two:"شهرين",threeToTen:"{{count}} أشهر",other:"{{count}} شهر"},aboutXYears:{one:"عام واحد تقريباً",two:"عامين تقريباً",threeToTen:"{{count}} أعوام تقريباً",other:"{{count}} عام تقريباً"},xYears:{one:"عام واحد",two:"عامين",threeToTen:"{{count}} أعوام",other:"{{count}} عام"},overXYears:{one:"أكثر من عام",two:"أكثر من عامين",threeToTen:"أكثر من {{count}} أعوام",other:"أكثر من {{count}} عام"},almostXYears:{one:"عام واحد تقريباً",two:"عامين تقريباً",threeToTen:"{{count}} أعوام تقريباً",other:"{{count}} عام تقريباً"}},n1={date:(0,n$.default)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'عند' {{time}}",long:"{{date}} 'عند' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},n2={lastWeek:"'أخر' eeee 'عند' p",yesterday:"'أمس عند' p",today:"'اليوم عند' p",tomorrow:"'غداً عند' p",nextWeek:"eeee 'عند' p",other:"P"},n3={ordinalNumber:function(e){return String(e)},era:(0,nq.default)({values:{narrow:["ق","ب"],abbreviated:["ق.م.","ب.م."],wide:["قبل الميلاد","بعد الميلاد"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["ر1","ر2","ر3","ر4"],wide:["الربع الأول","الربع الثاني","الربع الثالث","الربع الرابع"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ي","ف","م","أ","م","ي","ي","أ","س","أ","ن","د"],abbreviated:["ينا","فبر","مارس","أبريل","مايو","يونـ","يولـ","أغسـ","سبتـ","أكتـ","نوفـ","ديسـ"],wide:["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ح","ن","ث","ر","خ","ج","س"],short:["أحد","اثنين","ثلاثاء","أربعاء","خميس","جمعة","سبت"],abbreviated:["أحد","اثنـ","ثلا","أربـ","خميـ","جمعة","سبت"],wide:["الأحد","الاثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ص",pm:"م",midnight:"ن",noon:"ظ",morning:"صباحاً",afternoon:"بعد الظهر",evening:"مساءاً",night:"ليلاً"},abbreviated:{am:"ص",pm:"م",midnight:"نصف الليل",noon:"ظهر",morning:"صباحاً",afternoon:"بعد الظهر",evening:"مساءاً",night:"ليلاً"},wide:{am:"ص",pm:"م",midnight:"نصف الليل",noon:"ظهر",morning:"صباحاً",afternoon:"بعد الظهر",evening:"مساءاً",night:"ليلاً"}},defaultWidth:"wide",formattingValues:{narrow:{am:"ص",pm:"م",midnight:"ن",noon:"ظ",morning:"في الصباح",afternoon:"بعد الظـهر",evening:"في المساء",night:"في الليل"},abbreviated:{am:"ص",pm:"م",midnight:"نصف الليل",noon:"ظهر",morning:"في الصباح",evening:"في المساء",night:"في الليل"},wide:{am:"ص",pm:"م",midnight:"نصف الليل",noon:"ظهر",afternoon:"بعد الظـهر",evening:"في المساء",night:"في الليل"}},defaultFormattingWidth:"wide"})},n5={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ق|ب)/i,abbreviated:/^(ق\.?\s?م\.?|ق\.?\s?م\.?\s?|a\.?\s?d\.?|c\.?\s?)/i,wide:/^(قبل الميلاد|قبل الميلاد|بعد الميلاد|بعد الميلاد)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^قبل/i,/^بعد/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^ر[1234]/i,wide:/^الربع [1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[يفمأمسند]/i,abbreviated:/^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i,wide:/^(ين|ف|مار|أب|ماي|يون|يول|أغ|س|أك|ن|د)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ي/i,/^ف/i,/^م/i,/^أ/i,/^م/i,/^ي/i,/^ي/i,/^أ/i,/^س/i,/^أ/i,/^ن/i,/^د/i],any:[/^ين/i,/^ف/i,/^مار/i,/^أب/i,/^ماي/i,/^يون/i,/^يول/i,/^أغ/i,/^س/i,/^أك/i,/^ن/i,/^د/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[حنثرخجس]/i,short:/^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/i,abbreviated:/^(أحد|اثن|ثلا|أرب|خمي|جمعة|سبت)/i,wide:/^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ح/i,/^ن/i,/^ث/i,/^ر/i,/^خ/i,/^ج/i,/^س/i],wide:[/^الأحد/i,/^الاثنين/i,/^الثلاثاء/i,/^الأربعاء/i,/^الخميس/i,/^الجمعة/i,/^السبت/i],any:[/^أح/i,/^اث/i,/^ث/i,/^أر/i,/^خ/i,/^ج/i,/^س/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{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},defaultMatchWidth:"any",parsePatterns:{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}},defaultParseWidth:"any"})},n4={lessThanXSeconds:{one:"по-малко от секунда",other:"по-малко от {{count}} секунди"},xSeconds:{one:"1 секунда",other:"{{count}} секунди"},halfAMinute:"половин минута",lessThanXMinutes:{one:"по-малко от минута",other:"по-малко от {{count}} минути"},xMinutes:{one:"1 минута",other:"{{count}} минути"},aboutXHours:{one:"около час",other:"около {{count}} часа"},xHours:{one:"1 час",other:"{{count}} часа"},xDays:{one:"1 ден",other:"{{count}} дни"},aboutXWeeks:{one:"около седмица",other:"около {{count}} седмици"},xWeeks:{one:"1 седмица",other:"{{count}} седмици"},aboutXMonths:{one:"около месец",other:"около {{count}} месеца"},xMonths:{one:"1 месец",other:"{{count}} месеца"},aboutXYears:{one:"около година",other:"около {{count}} години"},xYears:{one:"1 година",other:"{{count}} години"},overXYears:{one:"над година",other:"над {{count}} години"},almostXYears:{one:"почти година",other:"почти {{count}} години"}},n6={date:(0,n$.default)({formats:{full:"EEEE, dd MMMM yyyy",long:"dd MMMM yyyy",medium:"dd MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{any:"{{date}} {{time}}"},defaultWidth:"any"})},n9=e.i(452975);function n8(e,t,i){(0,n_.default)(2,arguments);var n=(0,n9.default)(e,i),a=(0,n9.default)(t,i);return n.getTime()===a.getTime()}var n7=["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"];function ae(e){var t=n7[e];return 2===e?"'във "+t+" в' p":"'в "+t+" в' p"}var at={lastWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return ae(n);var a=n7[n];switch(n){case 0:case 3:case 6:return"'миналата "+a+" в' p";case 1:case 2:case 4:case 5:return"'миналия "+a+" в' p"}},yesterday:"'вчера в' p",today:"'днес в' p",tomorrow:"'утре в' p",nextWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return ae(n);var a=n7[n];switch(n){case 0:case 3:case 6:return"'следващата "+a+" в' p";case 1:case 2:case 4:case 5:return"'следващия "+a+" в' p"}},other:"P"};function ai(e,t,i,n,a){return e+"-"+("quarter"===t?a:"year"===t||"week"===t||"minute"===t||"second"===t?n:i)}var an={ordinalNumber:function(e,t){var i=String((t||{}).unit),n=Number(e);if(0===n)return ai(0,i,"ев","ева","ево");if(n%1e3==0)return ai(n,i,"ен","на","но");if(n%100==0)return ai(n,i,"тен","тна","тно");var a=n%100;if(a>20||a<10)switch(a%10){case 1:return ai(n,i,"ви","ва","во");case 2:return ai(n,i,"ри","ра","ро");case 7:case 8:return ai(n,i,"ми","ма","мо")}return ai(n,i,"ти","та","то")},era:(0,nq.default)({values:{narrow:["пр.н.е.","н.е."],abbreviated:["преди н. е.","н. е."],wide:["преди новата ера","новата ера"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1-во тримес.","2-ро тримес.","3-то тримес.","4-то тримес."],wide:["1-во тримесечие","2-ро тримесечие","3-то тримесечие","4-то тримесечие"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{abbreviated:["яну","фев","мар","апр","май","юни","юли","авг","сеп","окт","ное","дек"],wide:["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вто","сря","чет","пет","съб"],wide:["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{wide:{am:"преди обяд",pm:"след обяд",midnight:"в полунощ",noon:"на обяд",morning:"сутринта",afternoon:"следобед",evening:"вечерта",night:"през нощта"}},defaultWidth:"wide"})},aa={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-?[врмт][аи]|-?т?(ен|на)|-?(ев|ева))?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^((пр)?н\.?\s?е\.?)/i,abbreviated:/^((пр)?н\.?\s?е\.?)/i,wide:/^(преди новата ера|новата ера|нова ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^п/i,/^н/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[врт]?o?)? тримес.?/i,wide:/^[1234](-?[врт]?о?)? тримесечие/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{abbreviated:/^(яну|фев|мар|апр|май|юни|юли|авг|сеп|окт|ное|дек)/i,wide:/^(януари|февруари|март|април|май|юни|юли|август|септември|октомври|ноември|декември)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^май/i,/^юн/i,/^юл/i,/^ав/i,/^се/i,/^окт/i,/^но/i,/^де/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)/i,abbreviated:/^(нед|пон|вто|сря|чет|пет|съб)/i,wide:/^(неделя|понеделник|вторник|сряда|четвъртък|петък|събота)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н[ед]/i,/^п[он]/i,/^вт/i,/^ср/i,/^ч[ет]/i,/^п[ет]/i,/^с[ъб]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(преди о|след о|в по|на о|през|веч|сут|следо)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^преди о/i,pm:/^след о/i,midnight:/^в пол/i,noon:/^на об/i,morning:/^сут/i,afternoon:/^следо/i,evening:/^веч/i,night:/^през н/i}},defaultParseWidth:"any"})},ar={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},ao={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},as={localeToNumber:function(e){return Number(e.toString().replace(/[১২৩৪৫৬৭৮৯০]/g,function(e){return ao[e]}))},numberToLocale:function(e){return e.toString().replace(/\d/g,function(e){return ar[e]})},ordinalNumber:function(e,t){var i=as.localeToNumber(e),n=as.numberToLocale(i);if("date"===t.unit){if(i>18&&i<=31)return n+"শে";switch(i){case 1:return n+"লা";case 2:case 3:return n+"রা";case 4:return n+"ঠা";default:return n+"ই"}}if(i>10||0===i)return n+"তম";switch(i%10){case 2:case 3:return n+"য়";case 4:return n+"র্থ";case 6:return n+"ষ্ঠ";case 1:case 5:case 7:case 8:case 9:case 0:return n+"ম"}},era:(0,nq.default)({values:{narrow:["খ্রিঃপূঃ","খ্রিঃ"],abbreviated:["খ্রিঃপূর্ব","খ্রিঃ"],wide:["খ্রিস্টপূর্ব","খ্রিস্টাব্দ"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["১","২","৩","৪"],abbreviated:["১ত্রৈ","২ত্রৈ","৩ত্রৈ","৪ত্রৈ"],wide:["১ম ত্রৈমাসিক","২য় ত্রৈমাসিক","৩য় ত্রৈমাসিক","৪র্থ ত্রৈমাসিক"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্ট","অক্টো","নভে","ডিসে"],abbreviated:["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্ট","অক্টো","নভে","ডিসে"],wide:["জানুয়ারি","ফেব্রুয়ারি","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["র","সো","ম","বু","বৃ","শু","শ"],short:["রবি","সোম","মঙ্গল","বুধ","বৃহ","শুক্র","শনি"],abbreviated:["রবি","সোম","মঙ্গল","বুধ","বৃহ","শুক্র","শনি"],wide:["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার ","শুক্রবার","শনিবার"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"পূ",pm:"অপ",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"},abbreviated:{am:"পূর্বাহ্ন",pm:"অপরাহ্ন",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"},wide:{am:"পূর্বাহ্ন",pm:"অপরাহ্ন",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"}},defaultWidth:"wide",formattingValues:{narrow:{am:"পূ",pm:"অপ",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"},abbreviated:{am:"পূর্বাহ্ন",pm:"অপরাহ্ন",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"},wide:{am:"পূর্বাহ্ন",pm:"অপরাহ্ন",midnight:"মধ্যরাত",noon:"মধ্যাহ্ন",morning:"সকাল",afternoon:"বিকাল",evening:"সন্ধ্যা",night:"রাত"}},defaultFormattingWidth:"wide"})},al={lessThanXSeconds:{one:"প্রায় ১ সেকেন্ড",other:"প্রায় {{count}} সেকেন্ড"},xSeconds:{one:"১ সেকেন্ড",other:"{{count}} সেকেন্ড"},halfAMinute:"আধ মিনিট",lessThanXMinutes:{one:"প্রায় ১ মিনিট",other:"প্রায় {{count}} মিনিট"},xMinutes:{one:"১ মিনিট",other:"{{count}} মিনিট"},aboutXHours:{one:"প্রায় ১ ঘন্টা",other:"প্রায় {{count}} ঘন্টা"},xHours:{one:"১ ঘন্টা",other:"{{count}} ঘন্টা"},xDays:{one:"১ দিন",other:"{{count}} দিন"},aboutXWeeks:{one:"প্রায় ১ সপ্তাহ",other:"প্রায় {{count}} সপ্তাহ"},xWeeks:{one:"১ সপ্তাহ",other:"{{count}} সপ্তাহ"},aboutXMonths:{one:"প্রায় ১ মাস",other:"প্রায় {{count}} মাস"},xMonths:{one:"১ মাস",other:"{{count}} মাস"},aboutXYears:{one:"প্রায় ১ বছর",other:"প্রায় {{count}} বছর"},xYears:{one:"১ বছর",other:"{{count}} বছর"},overXYears:{one:"১ বছরের বেশি",other:"{{count}} বছরের বেশি"},almostXYears:{one:"প্রায় ১ বছর",other:"প্রায় {{count}} বছর"}},ad={date:(0,n$.default)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}} 'সময়'",long:"{{date}} {{time}} 'সময়'",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ac={lastWeek:"'গত' eeee 'সময়' p",yesterday:"'গতকাল' 'সময়' p",today:"'আজ' 'সময়' p",tomorrow:"'আগামীকাল' 'সময়' p",nextWeek:"eeee 'সময়' p",other:"P"},au={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(ম|য়|র্থ|ষ্ঠ|শে|ই|তম)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(খ্রিঃপূঃ|খ্রিঃ)/i,abbreviated:/^(খ্রিঃপূর্ব|খ্রিঃ)/i,wide:/^(খ্রিস্টপূর্ব|খ্রিস্টাব্দ)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^খ্রিঃপূঃ/i,/^খ্রিঃ/i],abbreviated:[/^খ্রিঃপূর্ব/i,/^খ্রিঃ/i],wide:[/^খ্রিস্টপূর্ব/i,/^খ্রিস্টাব্দ/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[১২৩৪]/i,abbreviated:/^[১২৩৪]ত্রৈ/i,wide:/^[১২৩৪](ম|য়|র্থ)? ত্রৈমাসিক/i},defaultMatchWidth:"wide",parsePatterns:{any:[/১/i,/২/i,/৩/i,/৪/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,abbreviated:/^(জানু|ফেব্রু|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্ট|অক্টো|নভে|ডিসে)/i,wide:/^(জানুয়ারি|ফেব্রুয়ারি|মার্চ|এপ্রিল|মে|জুন|জুলাই|আগস্ট|সেপ্টেম্বর|অক্টোবর|নভেম্বর|ডিসেম্বর)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^জানু/i,/^ফেব্রু/i,/^মার্চ/i,/^এপ্রিল/i,/^মে/i,/^জুন/i,/^জুলাই/i,/^আগস্ট/i,/^সেপ্ট/i,/^অক্টো/i,/^নভে/i,/^ডিসে/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(র|সো|ম|বু|বৃ|শু|শ)+/i,short:/^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,abbreviated:/^(রবি|সোম|মঙ্গল|বুধ|বৃহ|শুক্র|শনি)+/i,wide:/^(রবিবার|সোমবার|মঙ্গলবার|বুধবার|বৃহস্পতিবার |শুক্রবার|শনিবার)+/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^র/i,/^সো/i,/^ম/i,/^বু/i,/^বৃ/i,/^শু/i,/^শ/i],short:[/^রবি/i,/^সোম/i,/^মঙ্গল/i,/^বুধ/i,/^বৃহ/i,/^শুক্র/i,/^শনি/i],abbreviated:[/^রবি/i,/^সোম/i,/^মঙ্গল/i,/^বুধ/i,/^বৃহ/i,/^শুক্র/i,/^শনি/i],wide:[/^রবিবার/i,/^সোমবার/i,/^মঙ্গলবার/i,/^বুধবার/i,/^বৃহস্পতিবার /i,/^শুক্রবার/i,/^শনিবার/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(পূ|অপ|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,abbreviated:/^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i,wide:/^(পূর্বাহ্ন|অপরাহ্ন|মধ্যরাত|মধ্যাহ্ন|সকাল|বিকাল|সন্ধ্যা|রাত)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^পূ/i,pm:/^অপ/i,midnight:/^মধ্যরাত/i,noon:/^মধ্যাহ্ন/i,morning:/সকাল/i,afternoon:/বিকাল/i,evening:/সন্ধ্যা/i,night:/রাত/i}},defaultParseWidth:"any"})},ap={lessThanXSeconds:{one:"menys d'un segon",eleven:"menys d'onze segons",other:"menys de {{count}} segons"},xSeconds:{one:"1 segon",other:"{{count}} segons"},halfAMinute:"mig minut",lessThanXMinutes:{one:"menys d'un minut",eleven:"menys d'onze minuts",other:"menys de {{count}} minuts"},xMinutes:{one:"1 minut",other:"{{count}} minuts"},aboutXHours:{one:"aproximadament una hora",other:"aproximadament {{count}} hores"},xHours:{one:"1 hora",other:"{{count}} hores"},xDays:{one:"1 dia",other:"{{count}} dies"},aboutXWeeks:{one:"aproximadament una setmana",other:"aproximadament {{count}} setmanes"},xWeeks:{one:"1 setmana",other:"{{count}} setmanes"},aboutXMonths:{one:"aproximadament un mes",other:"aproximadament {{count}} mesos"},xMonths:{one:"1 mes",other:"{{count}} mesos"},aboutXYears:{one:"aproximadament un any",other:"aproximadament {{count}} anys"},xYears:{one:"1 any",other:"{{count}} anys"},overXYears:{one:"més d'un any",eleven:"més d'onze anys",other:"més de {{count}} anys"},almostXYears:{one:"gairebé un any",other:"gairebé {{count}} anys"}},ah={date:(0,n$.default)({formats:{full:"EEEE, d 'de' MMMM y",long:"d 'de' MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'a les' {{time}}",long:"{{date}} 'a les' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},am={lastWeek:"'el' eeee 'passat a la' LT",yesterday:"'ahir a la' p",today:"'avui a la' p",tomorrow:"'demà a la' p",nextWeek:"eeee 'a la' p",other:"P"},ag={lastWeek:"'el' eeee 'passat a les' p",yesterday:"'ahir a les' p",today:"'avui a les' p",tomorrow:"'demà a les' p",nextWeek:"eeee 'a les' p",other:"P"},af={ordinalNumber:function(e,t){var i=Number(e),n=i%100;if(n>20||n<10)switch(n%10){case 1:case 3:return i+"r";case 2:return i+"n";case 4:return i+"t"}return i+"è"},era:(0,nq.default)({values:{narrow:["aC","dC"],abbreviated:["a. de C.","d. de C."],wide:["abans de Crist","després de Crist"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1r trimestre","2n trimestre","3r trimestre","4t trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["GN","FB","MÇ","AB","MG","JN","JL","AG","ST","OC","NV","DS"],abbreviated:["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],wide:["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],short:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],abbreviated:["dg.","dl.","dt.","dm.","dj.","dv.","ds."],wide:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"am",pm:"pm",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"mitjanit",noon:"migdia",morning:"matí",afternoon:"tarda",evening:"vespre",night:"nit"}},defaultWidth:"wide",formattingValues:{narrow:{am:"am",pm:"pm",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},abbreviated:{am:"AM",pm:"PM",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"},wide:{am:"ante meridiem",pm:"post meridiem",midnight:"de la mitjanit",noon:"del migdia",morning:"del matí",afternoon:"de la tarda",evening:"del vespre",night:"de la nit"}},defaultFormattingWidth:"wide"})},ab={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(è|r|n|r|t)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a. de C.|d. de C.)/i,wide:/^(abans de Crist|despr[eé]s de Crist)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^aC/i,/^dC/i],abbreviated:[/^(a. de C.)/i,/^(d. de C.)/i],wide:[/^(abans de Crist)/i,/^(despr[eé]s de Crist)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](è|r|n|r|t)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(GN|FB|MÇ|AB|MG|JN|JL|AG|ST|OC|NV|DS)/i,abbreviated:/^(gen.|febr.|març|abr.|maig|juny|jul.|ag.|set.|oct.|nov.|des.)/i,wide:/^(gener|febrer|març|abril|maig|juny|juliol|agost|setembre|octubre|novembre|desembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^GN/i,/^FB/i,/^MÇ/i,/^AB/i,/^MG/i,/^JN/i,/^JL/i,/^AG/i,/^ST/i,/^OC/i,/^NV/i,/^DS/i],abbreviated:[/^gen./i,/^febr./i,/^març/i,/^abr./i,/^maig/i,/^juny/i,/^jul./i,/^ag./i,/^set./i,/^oct./i,/^nov./i,/^des./i],wide:[/^gener/i,/^febrer/i,/^març/i,/^abril/i,/^maig/i,/^juny/i,/^juliol/i,/^agost/i,/^setembre/i,/^octubre/i,/^novembre/i,/^desembre/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,short:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,abbreviated:/^(dg\.|dl\.|dt\.|dm\.|dj\.|dv\.|ds\.)/i,wide:/^(diumenge|dilluns|dimarts|dimecres|dijous|divendres|dissabte)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],abbreviated:[/^dg./i,/^dl./i,/^dt./i,/^dm./i,/^dj./i,/^dv./i,/^ds./i],wide:[/^diumenge/i,/^dilluns/i,/^dimarts/i,/^dimecres/i,/^dijous/i,/^divendres/i,/^disssabte/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|mn|md|(del|de la) (matí|tarda|vespre|nit))/i,abbreviated:/^([ap]\.?\s?m\.?|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i,wide:/^(ante meridiem|post meridiem|mitjanit|migdia|(del|de la) (matí|tarda|vespre|nit))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mitjanit/i,noon:/^migdia/i,morning:/matí/i,afternoon:/tarda/i,evening:/vespre/i,night:/nit/i}},defaultParseWidth:"any"})},ax={lessThanXSeconds:{one:{regular:"méně než vteřina",past:"před méně než vteřinou",future:"za méně než vteřinu"},few:{regular:"méně než {{count}} vteřiny",past:"před méně než {{count}} vteřinami",future:"za méně než {{count}} vteřiny"},many:{regular:"méně než {{count}} vteřin",past:"před méně než {{count}} vteřinami",future:"za méně než {{count}} vteřin"}},xSeconds:{one:{regular:"vteřina",past:"před vteřinou",future:"za vteřinu"},few:{regular:"{{count}} vteřiny",past:"před {{count}} vteřinami",future:"za {{count}} vteřiny"},many:{regular:"{{count}} vteřin",past:"před {{count}} vteřinami",future:"za {{count}} vteřin"}},halfAMinute:{other:{regular:"půl minuty",past:"před půl minutou",future:"za půl minuty"}},lessThanXMinutes:{one:{regular:"méně než minuta",past:"před méně než minutou",future:"za méně než minutu"},few:{regular:"méně než {{count}} minuty",past:"před méně než {{count}} minutami",future:"za méně než {{count}} minuty"},many:{regular:"méně než {{count}} minut",past:"před méně než {{count}} minutami",future:"za méně než {{count}} minut"}},xMinutes:{one:{regular:"minuta",past:"před minutou",future:"za minutu"},few:{regular:"{{count}} minuty",past:"před {{count}} minutami",future:"za {{count}} minuty"},many:{regular:"{{count}} minut",past:"před {{count}} minutami",future:"za {{count}} minut"}},aboutXHours:{one:{regular:"přibližně hodina",past:"přibližně před hodinou",future:"přibližně za hodinu"},few:{regular:"přibližně {{count}} hodiny",past:"přibližně před {{count}} hodinami",future:"přibližně za {{count}} hodiny"},many:{regular:"přibližně {{count}} hodin",past:"přibližně před {{count}} hodinami",future:"přibližně za {{count}} hodin"}},xHours:{one:{regular:"hodina",past:"před hodinou",future:"za hodinu"},few:{regular:"{{count}} hodiny",past:"před {{count}} hodinami",future:"za {{count}} hodiny"},many:{regular:"{{count}} hodin",past:"před {{count}} hodinami",future:"za {{count}} hodin"}},xDays:{one:{regular:"den",past:"před dnem",future:"za den"},few:{regular:"{{count}} dny",past:"před {{count}} dny",future:"za {{count}} dny"},many:{regular:"{{count}} dní",past:"před {{count}} dny",future:"za {{count}} dní"}},aboutXWeeks:{one:{regular:"přibližně týden",past:"přibližně před týdnem",future:"přibližně za týden"},few:{regular:"přibližně {{count}} týdny",past:"přibližně před {{count}} týdny",future:"přibližně za {{count}} týdny"},many:{regular:"přibližně {{count}} týdnů",past:"přibližně před {{count}} týdny",future:"přibližně za {{count}} týdnů"}},xWeeks:{one:{regular:"týden",past:"před týdnem",future:"za týden"},few:{regular:"{{count}} týdny",past:"před {{count}} týdny",future:"za {{count}} týdny"},many:{regular:"{{count}} týdnů",past:"před {{count}} týdny",future:"za {{count}} týdnů"}},aboutXMonths:{one:{regular:"přibližně měsíc",past:"přibližně před měsícem",future:"přibližně za měsíc"},few:{regular:"přibližně {{count}} měsíce",past:"přibližně před {{count}} měsíci",future:"přibližně za {{count}} měsíce"},many:{regular:"přibližně {{count}} měsíců",past:"přibližně před {{count}} měsíci",future:"přibližně za {{count}} měsíců"}},xMonths:{one:{regular:"měsíc",past:"před měsícem",future:"za měsíc"},few:{regular:"{{count}} měsíce",past:"před {{count}} měsíci",future:"za {{count}} měsíce"},many:{regular:"{{count}} měsíců",past:"před {{count}} měsíci",future:"za {{count}} měsíců"}},aboutXYears:{one:{regular:"přibližně rok",past:"přibližně před rokem",future:"přibližně za rok"},few:{regular:"přibližně {{count}} roky",past:"přibližně před {{count}} roky",future:"přibližně za {{count}} roky"},many:{regular:"přibližně {{count}} roků",past:"přibližně před {{count}} roky",future:"přibližně za {{count}} roků"}},xYears:{one:{regular:"rok",past:"před rokem",future:"za rok"},few:{regular:"{{count}} roky",past:"před {{count}} roky",future:"za {{count}} roky"},many:{regular:"{{count}} roků",past:"před {{count}} roky",future:"za {{count}} roků"}},overXYears:{one:{regular:"více než rok",past:"před více než rokem",future:"za více než rok"},few:{regular:"více než {{count}} roky",past:"před více než {{count}} roky",future:"za více než {{count}} roky"},many:{regular:"více než {{count}} roků",past:"před více než {{count}} roky",future:"za více než {{count}} roků"}},almostXYears:{one:{regular:"skoro rok",past:"skoro před rokem",future:"skoro za rok"},few:{regular:"skoro {{count}} roky",past:"skoro před {{count}} roky",future:"skoro za {{count}} roky"},many:{regular:"skoro {{count}} roků",past:"skoro před {{count}} roky",future:"skoro za {{count}} roků"}}},ay={date:(0,n$.default)({formats:{full:"EEEE, d. MMMM yyyy",long:"d. MMMM yyyy",medium:"d. M. yyyy",short:"dd.MM.yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'v' {{time}}",long:"{{date}} 'v' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},av=["neděli","pondělí","úterý","středu","čtvrtek","pátek","sobotu"],aC={lastWeek:"'poslední' eeee 've' p",yesterday:"'včera v' p",today:"'dnes v' p",tomorrow:"'zítra v' p",nextWeek:function(e,t,i){return"'v "+av[e.getUTCDay()]+" o' p"},other:"P"},aw={ordinalNumber:function(e){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["př. n. l.","n. l."],abbreviated:["př. n. l.","n. l."],wide:["před naším letopočtem","našeho letopočtu"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1. čtvrtletí","2. čtvrtletí","3. čtvrtletí","4. čtvrtletí"],wide:["1. čtvrtletí","2. čtvrtletí","3. čtvrtletí","4. čtvrtletí"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["L","Ú","B","D","K","Č","Č","S","Z","Ř","L","P"],abbreviated:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],wide:["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"]},defaultWidth:"wide",formattingValues:{narrow:["L","Ú","B","D","K","Č","Č","S","Z","Ř","L","P"],abbreviated:["led","úno","bře","dub","kvě","čvn","čvc","srp","zář","říj","lis","pro"],wide:["ledna","února","března","dubna","května","června","července","srpna","září","října","listopadu","prosince"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ne","po","út","st","čt","pá","so"],short:["ne","po","út","st","čt","pá","so"],abbreviated:["ned","pon","úte","stř","čtv","pát","sob"],wide:["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},abbreviated:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},wide:{am:"dopoledne",pm:"odpoledne",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"}},defaultWidth:"wide",formattingValues:{narrow:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},abbreviated:{am:"dop.",pm:"odp.",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"},wide:{am:"dopoledne",pm:"odpoledne",midnight:"půlnoc",noon:"poledne",morning:"ráno",afternoon:"odpoledne",evening:"večer",night:"noc"}},defaultFormattingWidth:"wide"})},aS={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\.?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(p[řr]ed Kr\.|pred n\. l\.|po Kr\.|n\. l\.)/i,abbreviated:/^(pe[řr]ed Kr\.|pe[řr]ed n\. l\.|po Kr\.|n\. l\.)/i,wide:/^(p[řr]ed Kristem|pred na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^p[řr]/i,/^(po|n)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]\. [čc]tvrtlet[íi]/i,wide:/^[1234]\. [čc]tvrtlet[íi]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[lúubdkčcszřrlp]/i,abbreviated:/^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,wide:/^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^l/i,/^[úu]/i,/^b/i,/^d/i,/^k/i,/^[čc]/i,/^[čc]/i,/^s/i,/^z/i,/^[řr]/i,/^l/i,/^p/i],any:[/^led/i,/^[úu]n/i,/^b[řr]e/i,/^dub/i,/^kv[ěe]/i,/^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,/^[čc]vc|[čc]erven(ec|ce)/i,/^srp/i,/^z[áa][řr]/i,/^[řr][íi]j/i,/^lis/i,/^pro/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[npuúsčps]/i,short:/^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,abbreviated:/^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,wide:/^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^n/i,/^p/i,/^[úu]/i,/^s/i,/^[čc]/i,/^p/i,/^s/i],any:[/^ne/i,/^po/i,/^ut/i,/^st/i,/^[čc]t/i,/^p/i,/^so/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^dopoledne|dop\.?|odpoledne|odp\.?|půlnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^dop/i,pm:/^odp/i,midnight:/^p[ůu]lnoc/i,noon:/^poledne/i,morning:/r[áa]no/i,afternoon:/odpoledne/i,evening:/ve[čc]er/i,night:/noc/i}},defaultParseWidth:"any"})},ak={lessThanXSeconds:{one:"llai na eiliad",other:"llai na {{count}} eiliad"},xSeconds:{one:"1 eiliad",other:"{{count}} eiliad"},halfAMinute:"hanner munud",lessThanXMinutes:{one:"llai na munud",two:"llai na 2 funud",other:"llai na {{count}} munud"},xMinutes:{one:"1 munud",two:"2 funud",other:"{{count}} munud"},aboutXHours:{one:"tua 1 awr",other:"tua {{count}} awr"},xHours:{one:"1 awr",other:"{{count}} awr"},xDays:{one:"1 diwrnod",two:"2 ddiwrnod",other:"{{count}} diwrnod"},aboutXWeeks:{one:"tua 1 wythnos",two:"tua pythefnos",other:"tua {{count}} wythnos"},xWeeks:{one:"1 wythnos",two:"pythefnos",other:"{{count}} wythnos"},aboutXMonths:{one:"tua 1 mis",two:"tua 2 fis",other:"tua {{count}} mis"},xMonths:{one:"1 mis",two:"2 fis",other:"{{count}} mis"},aboutXYears:{one:"tua 1 flwyddyn",two:"tua 2 flynedd",other:"tua {{count}} mlynedd"},xYears:{one:"1 flwyddyn",two:"2 flynedd",other:"{{count}} mlynedd"},overXYears:{one:"dros 1 flwyddyn",two:"dros 2 flynedd",other:"dros {{count}} mlynedd"},almostXYears:{one:"bron 1 flwyddyn",two:"bron 2 flynedd",other:"bron {{count}} mlynedd"}},aA={date:(0,n$.default)({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'am' {{time}}",long:"{{date}} 'am' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},aE={lastWeek:"eeee 'diwethaf am' p",yesterday:"'ddoe am' p",today:"'heddiw am' p",tomorrow:"'yfory am' p",nextWeek:"eeee 'am' p",other:"P"},a_={ordinalNumber:function(e,t){var i=Number(e);if(i<20)switch(i){case 0:case 7:case 8:case 9:case 10:case 12:case 15:case 18:return i+"fed";case 1:return i+"af";case 2:return i+"ail";case 3:case 4:return i+"ydd";case 5:case 6:return i+"ed";case 11:case 13:case 14:case 16:case 17:case 19:return i+"eg"}else if(i>=50&&i<=60||80===i||i>=100)return i+"fed";return i+"ain"},era:(0,nq.default)({values:{narrow:["C","O"],abbreviated:["CC","OC"],wide:["Cyn Crist","Ar ôl Crist"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Ch1","Ch2","Ch3","Ch4"],wide:["Chwarter 1af","2ail chwarter","3ydd chwarter","4ydd chwarter"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["I","Ch","Ma","E","Mi","Me","G","A","Md","H","T","Rh"],abbreviated:["Ion","Chwe","Maw","Ebr","Mai","Meh","Gor","Aws","Med","Hyd","Tach","Rhag"],wide:["Ionawr","Chwefror","Mawrth","Ebrill","Mai","Mehefin","Gorffennaf","Awst","Medi","Hydref","Tachwedd","Rhagfyr"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","Ll","M","M","I","G","S"],short:["Su","Ll","Ma","Me","Ia","Gw","Sa"],abbreviated:["Sul","Llun","Maw","Mer","Iau","Gwe","Sad"],wide:["dydd Sul","dydd Llun","dydd Mawrth","dydd Mercher","dydd Iau","dydd Gwener","dydd Sadwrn"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"b",pm:"h",midnight:"hn",noon:"hd",morning:"bore",afternoon:"prynhawn",evening:"gyda'r nos",night:"nos"},abbreviated:{am:"yb",pm:"yh",midnight:"hanner nos",noon:"hanner dydd",morning:"bore",afternoon:"prynhawn",evening:"gyda'r nos",night:"nos"},wide:{am:"y.b.",pm:"y.h.",midnight:"hanner nos",noon:"hanner dydd",morning:"bore",afternoon:"prynhawn",evening:"gyda'r nos",night:"nos"}},defaultWidth:"wide",formattingValues:{narrow:{am:"b",pm:"h",midnight:"hn",noon:"hd",morning:"yn y bore",afternoon:"yn y prynhawn",evening:"gyda'r nos",night:"yn y nos"},abbreviated:{am:"yb",pm:"yh",midnight:"hanner nos",noon:"hanner dydd",morning:"yn y bore",afternoon:"yn y prynhawn",evening:"gyda'r nos",night:"yn y nos"},wide:{am:"y.b.",pm:"y.h.",midnight:"hanner nos",noon:"hanner dydd",morning:"yn y bore",afternoon:"yn y prynhawn",evening:"gyda'r nos",night:"yn y nos"}},defaultFormattingWidth:"wide"})},aI={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(af|ail|ydd|ed|fed|eg|ain)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(c|o)/i,abbreviated:/^(c\.?\s?c\.?|o\.?\s?c\.?)/i,wide:/^(cyn christ|ar ôl crist|ar ol crist)/i},defaultMatchWidth:"wide",parsePatterns:{wide:[/^c/i,/^(ar ôl crist|ar ol crist)/i],any:[/^c/i,/^o/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^ch[1234]/i,wide:/^(chwarter 1af)|([234](ail|ydd)? chwarter)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(i|ch|m|e|g|a|h|t|rh)/i,abbreviated:/^(ion|chwe|maw|ebr|mai|meh|gor|aws|med|hyd|tach|rhag)/i,wide:/^(ionawr|chwefror|mawrth|ebrill|mai|mehefin|gorffennaf|awst|medi|hydref|tachwedd|rhagfyr)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^i/i,/^ch/i,/^m/i,/^e/i,/^m/i,/^m/i,/^g/i,/^a/i,/^m/i,/^h/i,/^t/i,/^rh/i],any:[/^io/i,/^ch/i,/^maw/i,/^e/i,/^mai/i,/^meh/i,/^g/i,/^a/i,/^med/i,/^h/i,/^t/i,/^rh/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(s|ll|m|i|g)/i,short:/^(su|ll|ma|me|ia|gw|sa)/i,abbreviated:/^(sul|llun|maw|mer|iau|gwe|sad)/i,wide:/^dydd (sul|llun|mawrth|mercher|iau|gwener|sadwrn)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^ll/i,/^m/i,/^m/i,/^i/i,/^g/i,/^s/i],wide:[/^dydd su/i,/^dydd ll/i,/^dydd ma/i,/^dydd me/i,/^dydd i/i,/^dydd g/i,/^dydd sa/i],any:[/^su/i,/^ll/i,/^ma/i,/^me/i,/^i/i,/^g/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(b|h|hn|hd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i,any:/^(y\.?\s?[bh]\.?|hanner nos|hanner dydd|(yn y|y|yr|gyda'r) (bore|prynhawn|nos|hwyr))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^b|(y\.?\s?b\.?)/i,pm:/^h|(y\.?\s?h\.?)|(yr hwyr)/i,midnight:/^hn|hanner nos/i,noon:/^hd|hanner dydd/i,morning:/bore/i,afternoon:/prynhawn/i,evening:/^gyda'r nos$/i,night:/blah/i}},defaultParseWidth:"any"})},aM={lessThanXSeconds:{one:"mindre end ét sekund",other:"mindre end {{count}} sekunder"},xSeconds:{one:"1 sekund",other:"{{count}} sekunder"},halfAMinute:"ét halvt minut",lessThanXMinutes:{one:"mindre end ét minut",other:"mindre end {{count}} minutter"},xMinutes:{one:"1 minut",other:"{{count}} minutter"},aboutXHours:{one:"cirka 1 time",other:"cirka {{count}} timer"},xHours:{one:"1 time",other:"{{count}} timer"},xDays:{one:"1 dag",other:"{{count}} dage"},aboutXWeeks:{one:"cirka 1 uge",other:"cirka {{count}} uger"},xWeeks:{one:"1 uge",other:"{{count}} uger"},aboutXMonths:{one:"cirka 1 måned",other:"cirka {{count}} måneder"},xMonths:{one:"1 måned",other:"{{count}} måneder"},aboutXYears:{one:"cirka 1 år",other:"cirka {{count}} år"},xYears:{one:"1 år",other:"{{count}} år"},overXYears:{one:"over 1 år",other:"over {{count}} år"},almostXYears:{one:"næsten 1 år",other:"næsten {{count}} år"}},aT={date:(0,n$.default)({formats:{full:"EEEE 'den' d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'kl'. {{time}}",long:"{{date}} 'kl'. {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},aL={lastWeek:"'sidste' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"'på' eeee 'kl.' p",other:"P"},aj={ordinalNumber:function(e){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["fvt","vt"],abbreviated:["f.v.t.","v.t."],wide:["før vesterlandsk tidsregning","vesterlandsk tidsregning"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1. kvt.","2. kvt.","3. kvt.","4. kvt."],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn.","man.","tir.","ons.","tor.","fre.","lør."],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"morgen",afternoon:"eftermiddag",evening:"aften",night:"nat"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},abbreviated:{am:"AM",pm:"PM",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnat",noon:"middag",morning:"om morgenen",afternoon:"om eftermiddagen",evening:"om aftenen",night:"om natten"}},defaultFormattingWidth:"wide"})},aP={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(fKr|fvt|eKr|vt)/i,abbreviated:/^(f\.Kr\.?|f\.v\.t\.?|e\.Kr\.?|v\.t\.)/i,wide:/^(f.Kr.|før vesterlandsk tidsregning|e.Kr.|vesterlandsk tidsregning)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^(v|e)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]. kvt\./i,wide:/^[1234]\.? kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mar.|apr.|maj|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januar|februar|marts|april|maj|juni|juli|august|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smtofl]/i,short:/^(søn.|man.|tir.|ons.|tor.|fre.|lør.)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^o/i,/^t/i,/^f/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i,any:/^([ap]\.?\s?m\.?|midnat|middag|(om) (morgenen|eftermiddagen|aftenen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/midnat/i,noon:/middag/i,morning:/morgen/i,afternoon:/eftermiddag/i,evening:/aften/i,night:/nat/i}},defaultParseWidth:"any"})},aD={lessThanXSeconds:{standalone:{one:"weniger als eine Sekunde",other:"weniger als {{count}} Sekunden"},withPreposition:{one:"weniger als einer Sekunde",other:"weniger als {{count}} Sekunden"}},xSeconds:{standalone:{one:"eine Sekunde",other:"{{count}} Sekunden"},withPreposition:{one:"einer Sekunde",other:"{{count}} Sekunden"}},halfAMinute:{standalone:"eine halbe Minute",withPreposition:"einer halben Minute"},lessThanXMinutes:{standalone:{one:"weniger als eine Minute",other:"weniger als {{count}} Minuten"},withPreposition:{one:"weniger als einer Minute",other:"weniger als {{count}} Minuten"}},xMinutes:{standalone:{one:"eine Minute",other:"{{count}} Minuten"},withPreposition:{one:"einer Minute",other:"{{count}} Minuten"}},aboutXHours:{standalone:{one:"etwa eine Stunde",other:"etwa {{count}} Stunden"},withPreposition:{one:"etwa einer Stunde",other:"etwa {{count}} Stunden"}},xHours:{standalone:{one:"eine Stunde",other:"{{count}} Stunden"},withPreposition:{one:"einer Stunde",other:"{{count}} Stunden"}},xDays:{standalone:{one:"ein Tag",other:"{{count}} Tage"},withPreposition:{one:"einem Tag",other:"{{count}} Tagen"}},aboutXWeeks:{standalone:{one:"etwa ein Woche",other:"etwa {{count}} Wochen"},withPreposition:{one:"etwa einem Woche",other:"etwa {{count}} Wochen"}},xWeeks:{standalone:{one:"ein Woche",other:"{{count}} Wochen"},withPreposition:{one:"einem Woche",other:"{{count}} Wochen"}},aboutXMonths:{standalone:{one:"etwa ein Monat",other:"etwa {{count}} Monate"},withPreposition:{one:"etwa einem Monat",other:"etwa {{count}} Monaten"}},xMonths:{standalone:{one:"ein Monat",other:"{{count}} Monate"},withPreposition:{one:"einem Monat",other:"{{count}} Monaten"}},aboutXYears:{standalone:{one:"etwa ein Jahr",other:"etwa {{count}} Jahre"},withPreposition:{one:"etwa einem Jahr",other:"etwa {{count}} Jahren"}},xYears:{standalone:{one:"ein Jahr",other:"{{count}} Jahre"},withPreposition:{one:"einem Jahr",other:"{{count}} Jahren"}},overXYears:{standalone:{one:"mehr als ein Jahr",other:"mehr als {{count}} Jahre"},withPreposition:{one:"mehr als einem Jahr",other:"mehr als {{count}} Jahren"}},almostXYears:{standalone:{one:"fast ein Jahr",other:"fast {{count}} Jahre"},withPreposition:{one:"fast einem Jahr",other:"fast {{count}} Jahren"}}},aN={date:(0,n$.default)({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM. y",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'um' {{time}}",long:"{{date}} 'um' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},aR={lastWeek:"'letzten' eeee 'um' p",yesterday:"'gestern um' p",today:"'heute um' p",tomorrow:"'morgen um' p",nextWeek:"eeee 'um' p",other:"P"},aO={ordinalNumber:function(e,t){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["v.Chr.","n.Chr."],abbreviated:["v.Chr.","n.Chr."],wide:["vor Christus","nach Christus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. Quartal","2. Quartal","3. Quartal","4. Quartal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],wide:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","D","M","D","F","S"],short:["So","Mo","Di","Mi","Do","Fr","Sa"],abbreviated:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],wide:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachm.",evening:"Abend",night:"Nacht"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"Morgen",afternoon:"Nachmittag",evening:"Abend",night:"Nacht"}},defaultWidth:"wide",formattingValues:{narrow:{am:"vm.",pm:"nm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachm.",evening:"abends",night:"nachts"},abbreviated:{am:"vorm.",pm:"nachm.",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"},wide:{am:"vormittags",pm:"nachmittags",midnight:"Mitternacht",noon:"Mittag",morning:"morgens",afternoon:"nachmittags",evening:"abends",night:"nachts"}},defaultFormattingWidth:"wide"})},aB={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,abbreviated:/^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,wide:/^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/i,/^n/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? Quartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mär|apr|mai|jun|jul|aug|sep|okt|nov|dez)/i,wide:/^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smdmf]/i,short:/^(so|mo|di|mi|do|fr|sa)/i,abbreviated:/^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,wide:/^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^so/i,/^mo/i,/^di/i,/^mi/i,/^do/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,abbreviated:/^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,wide:/^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^v/i,pm:/^n/i,midnight:/^Mitte/i,noon:/^Mitta/i,morning:/morgens/i,afternoon:/nachmittags/i,evening:/abends/i,night:/nachts/i}},defaultParseWidth:"any"})},az={lessThanXSeconds:{one:"λιγότερο από ένα δευτερόλεπτο",other:"λιγότερο από {{count}} δευτερόλεπτα"},xSeconds:{one:"1 δευτερόλεπτο",other:"{{count}} δευτερόλεπτα"},halfAMinute:"μισό λεπτό",lessThanXMinutes:{one:"λιγότερο από ένα λεπτό",other:"λιγότερο από {{count}} λεπτά"},xMinutes:{one:"1 λεπτό",other:"{{count}} λεπτά"},aboutXHours:{one:"περίπου 1 ώρα",other:"περίπου {{count}} ώρες"},xHours:{one:"1 ώρα",other:"{{count}} ώρες"},xDays:{one:"1 ημέρα",other:"{{count}} ημέρες"},aboutXWeeks:{one:"περίπου 1 εβδομάδα",other:"περίπου {{count}} εβδομάδες"},xWeeks:{one:"1 εβδομάδα",other:"{{count}} εβδομάδες"},aboutXMonths:{one:"περίπου 1 μήνας",other:"περίπου {{count}} μήνες"},xMonths:{one:"1 μήνας",other:"{{count}} μήνες"},aboutXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"},xYears:{one:"1 χρόνο",other:"{{count}} χρόνια"},overXYears:{one:"πάνω από 1 χρόνο",other:"πάνω από {{count}} χρόνια"},almostXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"}},aF={date:(0,n$.default)({formats:{full:"EEEE, d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"d/M/yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} - {{time}}",long:"{{date}} - {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},aH={lastWeek:function(e){return 6===e.getUTCDay()?"'το προηγούμενο' eeee 'στις' p":"'την προηγούμενη' eeee 'στις' p"},yesterday:"'χθες στις' p",today:"'σήμερα στις' p",tomorrow:"'αύριο στις' p",nextWeek:"eeee 'στις' p",other:"P"},aW={ordinalNumber:function(e,t){var i=String((t||{}).unit);return e+("year"===i||"month"===i?"ος":"week"===i||"dayOfYear"===i||"day"===i||"hour"===i||"date"===i?"η":"ο")},era:(0,nq.default)({values:{narrow:["πΧ","μΧ"],abbreviated:["π.Χ.","μ.Χ."],wide:["προ Χριστού","μετά Χριστόν"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Τ1","Τ2","Τ3","Τ4"],wide:["1ο τρίμηνο","2ο τρίμηνο","3ο τρίμηνο","4ο τρίμηνο"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μάρ","Απρ","Μάι","Ιούν","Ιούλ","Αύγ","Σεπ","Οκτ","Νοέ","Δεκ"],wide:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]},defaultWidth:"wide",formattingValues:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],wide:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Κ","Δ","T","Τ","Π","Π","Σ"],short:["Κυ","Δε","Τρ","Τε","Πέ","Πα","Σά"],abbreviated:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"],wide:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"πμ",pm:"μμ",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},abbreviated:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},wide:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"}},defaultWidth:"wide"})},aU={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(ος|η|ο)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(πΧ|μΧ)/i,abbreviated:/^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,wide:/^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^π/i,/^(μ|κ)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^τ[1234]/i,wide:/^[1234]ο? τρ(ί|ι)μηνο/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[ιφμαμιιασονδ]/i,abbreviated:/^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,wide:/^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ι/i,/^φ/i,/^μ/i,/^α/i,/^μ/i,/^ι/i,/^ι/i,/^α/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i],any:[/^ια/i,/^φ/i,/^μ[άα]ρ/i,/^απ/i,/^μ[άα][ιΐ]/i,/^ιο[ύυ]ν/i,/^ιο[ύυ]λ/i,/^α[ύυ]/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[κδτπσ]/i,short:/^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,abbreviated:/^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,wide:/^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^κ/i,/^δ/i,/^τ/i,/^τ/i,/^π/i,/^π/i,/^σ/i],any:[/^κ/i,/^δ/i,/^τρ/i,/^τε/i,/^π[εέ]/i,/^π[αά]/i,/^σ/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,any:/^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^πμ|π\.\s?μ\./i,pm:/^μμ|μ\.\s?μ\./i,midnight:/^μεσάν/i,noon:/^μεσημ(έ|ε)/i,morning:/πρω(ί|ι)/i,afternoon:/απ(ό|ο)γευμα/i,evening:/βρ(ά|α)δυ/i,night:/ν(ύ|υ)χτα/i}},defaultParseWidth:"any"})},aV=e.i(3297),aG={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},a$={date:(0,n$.default)({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},aZ={lastWeek:"'el' eeee 'pasado a la' LT",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},aK={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},aq={ordinalNumber:function(e){return Number(e)+"º"},era:(0,nq.default)({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sa"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},defaultFormattingWidth:"wide"})},aY={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|sa)/i,abbreviated:/^(dom|lun|mar|mie|jue|vie|sab)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},defaultParseWidth:"any"})},aX={lessThanXSeconds:{standalone:{one:"vähem kui üks sekund",other:"vähem kui {{count}} sekundit"},withPreposition:{one:"vähem kui ühe sekundi",other:"vähem kui {{count}} sekundi"}},xSeconds:{standalone:{one:"üks sekund",other:"{{count}} sekundit"},withPreposition:{one:"ühe sekundi",other:"{{count}} sekundi"}},halfAMinute:{standalone:"pool minutit",withPreposition:"poole minuti"},lessThanXMinutes:{standalone:{one:"vähem kui üks minut",other:"vähem kui {{count}} minutit"},withPreposition:{one:"vähem kui ühe minuti",other:"vähem kui {{count}} minuti"}},xMinutes:{standalone:{one:"üks minut",other:"{{count}} minutit"},withPreposition:{one:"ühe minuti",other:"{{count}} minuti"}},aboutXHours:{standalone:{one:"umbes üks tund",other:"umbes {{count}} tundi"},withPreposition:{one:"umbes ühe tunni",other:"umbes {{count}} tunni"}},xHours:{standalone:{one:"üks tund",other:"{{count}} tundi"},withPreposition:{one:"ühe tunni",other:"{{count}} tunni"}},xDays:{standalone:{one:"üks päev",other:"{{count}} päeva"},withPreposition:{one:"ühe päeva",other:"{{count}} päeva"}},aboutXWeeks:{standalone:{one:"umbes üks nädal",other:"umbes {{count}} nädalat"},withPreposition:{one:"umbes ühe nädala",other:"umbes {{count}} nädala"}},xWeeks:{standalone:{one:"üks nädal",other:"{{count}} nädalat"},withPreposition:{one:"ühe nädala",other:"{{count}} nädala"}},aboutXMonths:{standalone:{one:"umbes üks kuu",other:"umbes {{count}} kuud"},withPreposition:{one:"umbes ühe kuu",other:"umbes {{count}} kuu"}},xMonths:{standalone:{one:"üks kuu",other:"{{count}} kuud"},withPreposition:{one:"ühe kuu",other:"{{count}} kuu"}},aboutXYears:{standalone:{one:"umbes üks aasta",other:"umbes {{count}} aastat"},withPreposition:{one:"umbes ühe aasta",other:"umbes {{count}} aasta"}},xYears:{standalone:{one:"üks aasta",other:"{{count}} aastat"},withPreposition:{one:"ühe aasta",other:"{{count}} aasta"}},overXYears:{standalone:{one:"rohkem kui üks aasta",other:"rohkem kui {{count}} aastat"},withPreposition:{one:"rohkem kui ühe aasta",other:"rohkem kui {{count}} aasta"}},almostXYears:{standalone:{one:"peaaegu üks aasta",other:"peaaegu {{count}} aastat"},withPreposition:{one:"peaaegu ühe aasta",other:"peaaegu {{count}} aasta"}}},aQ={date:(0,n$.default)({formats:{full:"eeee, d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'kell' {{time}}",long:"{{date}} 'kell' {{time}}",medium:"{{date}}. {{time}}",short:"{{date}}. {{time}}"},defaultWidth:"full"})},aJ={lastWeek:"'eelmine' eeee 'kell' p",yesterday:"'eile kell' p",today:"'täna kell' p",tomorrow:"'homme kell' p",nextWeek:"'järgmine' eeee 'kell' p",other:"P"},a0={narrow:["J","V","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jaan","veebr","märts","apr","mai","juuni","juuli","aug","sept","okt","nov","dets"],wide:["jaanuar","veebruar","märts","aprill","mai","juuni","juuli","august","september","oktoober","november","detsember"]},a1={narrow:["P","E","T","K","N","R","L"],short:["P","E","T","K","N","R","L"],abbreviated:["pühap.","esmasp.","teisip.","kolmap.","neljap.","reede.","laup."],wide:["pühapäev","esmaspäev","teisipäev","kolmapäev","neljapäev","reede","laupäev"]},a2={ordinalNumber:function(e){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["e.m.a","m.a.j"],abbreviated:["e.m.a","m.a.j"],wide:["enne meie ajaarvamist","meie ajaarvamise järgi"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:a0,formattingValues:a0,defaultWidth:"wide"}),day:(0,nq.default)({values:a1,formattingValues:a1,defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"kesköö",noon:"keskpäev",morning:"hommik",afternoon:"pärastlõuna",evening:"õhtu",night:"öö"},abbreviated:{am:"AM",pm:"PM",midnight:"kesköö",noon:"keskpäev",morning:"hommik",afternoon:"pärastlõuna",evening:"õhtu",night:"öö"},wide:{am:"AM",pm:"PM",midnight:"kesköö",noon:"keskpäev",morning:"hommik",afternoon:"pärastlõuna",evening:"õhtu",night:"öö"}},formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"keskööl",noon:"keskpäeval",morning:"hommikul",afternoon:"pärastlõunal",evening:"õhtul",night:"öösel"},abbreviated:{am:"AM",pm:"PM",midnight:"keskööl",noon:"keskpäeval",morning:"hommikul",afternoon:"pärastlõunal",evening:"õhtul",night:"öösel"},wide:{am:"AM",pm:"PM",midnight:"keskööl",noon:"keskpäeval",morning:"hommikul",afternoon:"pärastlõunal",evening:"õhtul",night:"öösel"}},defaultWidth:"wide"})},a3={ordinalNumber:(0,nX.default)({matchPattern:/^\d+\./i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(e\.m\.a|m\.a\.j|eKr|pKr)/i,abbreviated:/^(e\.m\.a|m\.a\.j|eKr|pKr)/i,wide:/^(enne meie ajaarvamist|meie ajaarvamise järgi|enne Kristust|pärast Kristust)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^e/i,/^(m|p)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234](\.)? kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jvmasond]/i,abbreviated:/^('jaan|veebr|märts|apr|mai|juuni|juuli|aug|sept|okt|nov|dets')/i,wide:/^('jaanuar|veebruar|märts|aprill|mai|juuni|juuli|august|september|oktoober|november|detsember')/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^v/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^v/i,/^mär/i,/^ap/i,/^mai/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[petknrl]/i,short:/^[petknrl]/i,abbreviated:/^(püh?|esm?|tei?|kolm?|nel?|ree?|laup?)\.?/i,wide:/^('pühapäev|esmaspäev|teisipäev|kolmapäev|neljapäev|reede|laupäev')/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^p/i,/^e/i,/^t/i,/^k/i,/^n/i,/^r/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(am|pm|kesköö|keskpäev|hommik|pärastlõuna|õhtu|öö)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^keskö/i,noon:/^keskp/i,morning:/hommik/i,afternoon:/pärastlõuna/i,evening:/õhtu/i,night:/öö/i}},defaultParseWidth:"any"})},a5={lessThanXSeconds:{one:"کمتر از یک ثانیه",other:"کمتر از {{count}} ثانیه"},xSeconds:{one:"1 ثانیه",other:"{{count}} ثانیه"},halfAMinute:"نیم دقیقه",lessThanXMinutes:{one:"کمتر از یک دقیقه",other:"کمتر از {{count}} دقیقه"},xMinutes:{one:"1 دقیقه",other:"{{count}} دقیقه"},aboutXHours:{one:"حدود 1 ساعت",other:"حدود {{count}} ساعت"},xHours:{one:"1 ساعت",other:"{{count}} ساعت"},xDays:{one:"1 روز",other:"{{count}} روز"},aboutXWeeks:{one:"حدود 1 هفته",other:"حدود {{count}} هفته"},xWeeks:{one:"1 هفته",other:"{{count}} هفته"},aboutXMonths:{one:"حدود 1 ماه",other:"حدود {{count}} ماه"},xMonths:{one:"1 ماه",other:"{{count}} ماه"},aboutXYears:{one:"حدود 1 سال",other:"حدود {{count}} سال"},xYears:{one:"1 سال",other:"{{count}} سال"},overXYears:{one:"بیشتر از 1 سال",other:"بیشتر از {{count}} سال"},almostXYears:{one:"نزدیک 1 سال",other:"نزدیک {{count}} سال"}},a4={date:(0,n$.default)({formats:{full:"EEEE do MMMM y",long:"do MMMM y",medium:"d MMM y",short:"yyyy/MM/dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'در' {{time}}",long:"{{date}} 'در' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},a6={lastWeek:"eeee 'گذشته در' p",yesterday:"'دیروز در' p",today:"'امروز در' p",tomorrow:"'فردا در' p",nextWeek:"eeee 'در' p",other:"P"},a9={ordinalNumber:function(e){return String(e)},era:(0,nq.default)({values:{narrow:["ق","ب"],abbreviated:["ق.م.","ب.م."],wide:["قبل از میلاد","بعد از میلاد"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["س‌م1","س‌م2","س‌م3","س‌م4"],wide:["سه‌ماهه 1","سه‌ماهه 2","سه‌ماهه 3","سه‌ماهه 4"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ژ","ف","م","آ","م","ج","ج","آ","س","ا","ن","د"],abbreviated:["ژانـ","فور","مارس","آپر","می","جون","جولـ","آگو","سپتـ","اکتـ","نوامـ","دسامـ"],wide:["ژانویه","فوریه","مارس","آپریل","می","جون","جولای","آگوست","سپتامبر","اکتبر","نوامبر","دسامبر"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ی","د","س","چ","پ","ج","ش"],short:["1ش","2ش","3ش","4ش","5ش","ج","ش"],abbreviated:["یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"],wide:["یکشنبه","دوشنبه","سه‌شنبه","چهارشنبه","پنجشنبه","جمعه","شنبه"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ق",pm:"ب",midnight:"ن",noon:"ظ",morning:"ص",afternoon:"ب.ظ.",evening:"ع",night:"ش"},abbreviated:{am:"ق.ظ.",pm:"ب.ظ.",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"},wide:{am:"قبل‌ازظهر",pm:"بعدازظهر",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"}},defaultWidth:"wide",formattingValues:{narrow:{am:"ق",pm:"ب",midnight:"ن",noon:"ظ",morning:"ص",afternoon:"ب.ظ.",evening:"ع",night:"ش"},abbreviated:{am:"ق.ظ.",pm:"ب.ظ.",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"},wide:{am:"قبل‌ازظهر",pm:"بعدازظهر",midnight:"نیمه‌شب",noon:"ظهر",morning:"صبح",afternoon:"بعدازظهر",evening:"عصر",night:"شب"}},defaultFormattingWidth:"wide"})},a8={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ق|ب)/i,abbreviated:/^(ق\.?\s?م\.?|ق\.?\s?د\.?\s?م\.?|م\.?\s?|د\.?\s?م\.?)/i,wide:/^(قبل از میلاد|قبل از دوران مشترک|میلادی|دوران مشترک|بعد از میلاد)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^قبل/i,/^بعد/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^س‌م[1234]/i,wide:/^سه‌ماهه [1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[جژفمآاماسند]/i,abbreviated:/^(جنو|ژانـ|ژانویه|فوریه|فور|مارس|آوریل|آپر|مه|می|ژوئن|جون|جول|جولـ|ژوئیه|اوت|آگو|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نوامـ|دسامبر|دسامـ|دسم)/i,wide:/^(ژانویه|جنوری|فبروری|فوریه|مارچ|مارس|آپریل|اپریل|ایپریل|آوریل|مه|می|ژوئن|جون|جولای|ژوئیه|آگست|اگست|آگوست|اوت|سپتمبر|سپتامبر|اکتبر|اکتوبر|نوامبر|نومبر|دسامبر|دسمبر)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^(ژ|ج)/i,/^ف/i,/^م/i,/^(آ|ا)/i,/^م/i,/^(ژ|ج)/i,/^(ج|ژ)/i,/^(آ|ا)/i,/^س/i,/^ا/i,/^ن/i,/^د/i],any:[/^ژا/i,/^ف/i,/^ما/i,/^آپ/i,/^(می|مه)/i,/^(ژوئن|جون)/i,/^(ژوئی|جول)/i,/^(اوت|آگ)/i,/^س/i,/^(اوک|اک)/i,/^ن/i,/^د/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[شیدسچپج]/i,short:/^(ش|ج|1ش|2ش|3ش|4ش|5ش)/i,abbreviated:/^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i,wide:/^(یکشنبه|دوشنبه|سه‌شنبه|چهارشنبه|پنج‌شنبه|جمعه|شنبه)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ی/i,/^دو/i,/^س/i,/^چ/i,/^پ/i,/^ج/i,/^ش/i],any:[/^(ی|1ش|یکشنبه)/i,/^(د|2ش|دوشنبه)/i,/^(س|3ش|سه‌شنبه)/i,/^(چ|4ش|چهارشنبه)/i,/^(پ|5ش|پنجشنبه)/i,/^(ج|جمعه)/i,/^(ش|شنبه)/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(ب|ق|ن|ظ|ص|ب.ظ.|ع|ش)/i,abbreviated:/^(ق.ظ.|ب.ظ.|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i,wide:/^(قبل‌ازظهر|نیمه‌شب|ظهر|صبح|بعدازظهر|عصر|شب)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(ق|ق.ظ.|قبل‌ازظهر)/i,pm:/^(ب|ب.ظ.|بعدازظهر)/i,midnight:/^(‌نیمه‌شب|ن)/i,noon:/^(ظ|ظهر)/i,morning:/(ص|صبح)/i,afternoon:/(ب|ب.ظ.|بعدازظهر)/i,evening:/(ع|عصر)/i,night:/(ش|شب)/i}},defaultParseWidth:"any"})};function a7(e){return e.replace(/sekuntia?/,"sekunnin")}function re(e){return e.replace(/minuuttia?/,"minuutin")}function rt(e){return e.replace(/tuntia?/,"tunnin")}function ri(e){return e.replace(/(viikko|viikkoa)/,"viikon")}function rn(e){return e.replace(/(kuukausi|kuukautta)/,"kuukauden")}function ra(e){return e.replace(/(vuosi|vuotta)/,"vuoden")}var rr={lessThanXSeconds:{one:"alle sekunti",other:"alle {{count}} sekuntia",futureTense:a7},xSeconds:{one:"sekunti",other:"{{count}} sekuntia",futureTense:a7},halfAMinute:{one:"puoli minuuttia",other:"puoli minuuttia",futureTense:function(e){return"puolen minuutin"}},lessThanXMinutes:{one:"alle minuutti",other:"alle {{count}} minuuttia",futureTense:re},xMinutes:{one:"minuutti",other:"{{count}} minuuttia",futureTense:re},aboutXHours:{one:"noin tunti",other:"noin {{count}} tuntia",futureTense:rt},xHours:{one:"tunti",other:"{{count}} tuntia",futureTense:rt},xDays:{one:"päivä",other:"{{count}} päivää",futureTense:function(e){return e.replace(/päivää?/,"päivän")}},aboutXWeeks:{one:"noin viikko",other:"noin {{count}} viikkoa",futureTense:ri},xWeeks:{one:"viikko",other:"{{count}} viikkoa",futureTense:ri},aboutXMonths:{one:"noin kuukausi",other:"noin {{count}} kuukautta",futureTense:rn},xMonths:{one:"kuukausi",other:"{{count}} kuukautta",futureTense:rn},aboutXYears:{one:"noin vuosi",other:"noin {{count}} vuotta",futureTense:ra},xYears:{one:"vuosi",other:"{{count}} vuotta",futureTense:ra},overXYears:{one:"yli vuosi",other:"yli {{count}} vuotta",futureTense:ra},almostXYears:{one:"lähes vuosi",other:"lähes {{count}} vuotta",futureTense:ra}},ro={date:(0,n$.default)({formats:{full:"eeee d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"d.M.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH.mm.ss zzzz",long:"HH.mm.ss z",medium:"HH.mm.ss",short:"HH.mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'klo' {{time}}",long:"{{date}} 'klo' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},rs={lastWeek:"'viime' eeee 'klo' p",yesterday:"'eilen klo' p",today:"'tänään klo' p",tomorrow:"'huomenna klo' p",nextWeek:"'ensi' eeee 'klo' p",other:"P"},rl={narrow:["T","H","M","H","T","K","H","E","S","L","M","J"],abbreviated:["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu"],wide:["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"]},rd={narrow:rl.narrow,abbreviated:rl.abbreviated,wide:rl.wide.map(function(e){return e+"ta"})},rc={narrow:["S","M","T","K","T","P","L"],short:["su","ma","ti","ke","to","pe","la"],abbreviated:["sunn.","maan.","tiis.","kesk.","torst.","perj.","la"],wide:["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"]},ru={narrow:rc.narrow,short:rc.short,abbreviated:rc.abbreviated,wide:rc.wide.map(function(e){return e+"na"})},rp={ordinalNumber:function(e){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["eaa.","jaa."],abbreviated:["eaa.","jaa."],wide:["ennen ajanlaskun alkua","jälkeen ajanlaskun alun"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartaali","2. kvartaali","3. kvartaali","4. kvartaali"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:rl,formattingValues:rd,defaultWidth:"wide"}),day:(0,nq.default)({values:rc,formattingValues:ru,defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ap",pm:"ip",midnight:"keskiyö",noon:"keskipäivä",morning:"ap",afternoon:"ip",evening:"illalla",night:"yöllä"},abbreviated:{am:"ap",pm:"ip",midnight:"keskiyö",noon:"keskipäivä",morning:"ap",afternoon:"ip",evening:"illalla",night:"yöllä"},wide:{am:"ap",pm:"ip",midnight:"keskiyöllä",noon:"keskipäivällä",morning:"aamupäivällä",afternoon:"iltapäivällä",evening:"illalla",night:"yöllä"}},defaultWidth:"wide"})},rh={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(\.)/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(e|j)/i,abbreviated:/^(eaa.|jaa.)/i,wide:/^(ennen ajanlaskun alkua|jälkeen ajanlaskun alun)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^e/i,/^j/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]\.? kvartaali/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[thmkeslj]/i,abbreviated:/^(tammi|helmi|maalis|huhti|touko|kesä|heinä|elo|syys|loka|marras|joulu)/i,wide:/^(tammikuu|helmikuu|maaliskuu|huhtikuu|toukokuu|kesäkuu|heinäkuu|elokuu|syyskuu|lokakuu|marraskuu|joulukuu)(ta)?/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^t/i,/^h/i,/^m/i,/^h/i,/^t/i,/^k/i,/^h/i,/^e/i,/^s/i,/^l/i,/^m/i,/^j/i],any:[/^ta/i,/^hel/i,/^maa/i,/^hu/i,/^to/i,/^k/i,/^hei/i,/^e/i,/^s/i,/^l/i,/^mar/i,/^j/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smtkpl]/i,short:/^(su|ma|ti|ke|to|pe|la)/i,abbreviated:/^(sunn.|maan.|tiis.|kesk.|torst.|perj.|la)/i,wide:/^(sunnuntai|maanantai|tiistai|keskiviikko|torstai|perjantai|lauantai)(na)?/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^k/i,/^t/i,/^p/i,/^l/i],any:[/^s/i,/^m/i,/^ti/i,/^k/i,/^to/i,/^p/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(ap|ip|keskiyö|keskipäivä|aamupäivällä|iltapäivällä|illalla|yöllä)/i,any:/^(ap|ip|keskiyöllä|keskipäivällä|aamupäivällä|iltapäivällä|illalla|yöllä)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^ap/i,pm:/^ip/i,midnight:/^keskiyö/i,noon:/^keskipäivä/i,morning:/aamupäivällä/i,afternoon:/iltapäivällä/i,evening:/illalla/i,night:/yöllä/i}},defaultParseWidth:"any"})},rm={lessThanXSeconds:{one:"moins d’une seconde",other:"moins de {{count}} secondes"},xSeconds:{one:"1 seconde",other:"{{count}} secondes"},halfAMinute:"30 secondes",lessThanXMinutes:{one:"moins d’une minute",other:"moins de {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"environ 1 heure",other:"environ {{count}} heures"},xHours:{one:"1 heure",other:"{{count}} heures"},xDays:{one:"1 jour",other:"{{count}} jours"},aboutXWeeks:{one:"environ 1 semaine",other:"environ {{count}} semaines"},xWeeks:{one:"1 semaine",other:"{{count}} semaines"},aboutXMonths:{one:"environ 1 mois",other:"environ {{count}} mois"},xMonths:{one:"1 mois",other:"{{count}} mois"},aboutXYears:{one:"environ 1 an",other:"environ {{count}} ans"},xYears:{one:"1 an",other:"{{count}} ans"},overXYears:{one:"plus d’un an",other:"plus de {{count}} ans"},almostXYears:{one:"presqu’un an",other:"presque {{count}} ans"}},rg={date:(0,n$.default)({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'à' {{time}}",long:"{{date}} 'à' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rf={lastWeek:"eeee 'dernier à' p",yesterday:"'hier à' p",today:"'aujourd’hui à' p",tomorrow:"'demain à' p'",nextWeek:"eeee 'prochain à' p",other:"P"},rb={ordinalNumber:function(e,t){var i,n=Number(e),a=String((t||{}).unit);return 0===n?n:(i="year"===a||"hour"===a||"week"===a?1===n?"ère":"ème":1===n?"er":"ème",n+i)},era:(0,nq.default)({values:{narrow:["av. J.-C","ap. J.-C"],abbreviated:["av. J.-C","ap. J.-C"],wide:["avant Jésus-Christ","après Jésus-Christ"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["T1","T2","T3","T4"],abbreviated:["1er trim.","2ème trim.","3ème trim.","4ème trim."],wide:["1er trimestre","2ème trimestre","3ème trimestre","4ème trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],wide:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["D","L","M","M","J","V","S"],short:["di","lu","ma","me","je","ve","sa"],abbreviated:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],wide:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"mat.",afternoon:"ap.m.",evening:"soir",night:"mat."},abbreviated:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"matin",afternoon:"après-midi",evening:"soir",night:"matin"},wide:{am:"AM",pm:"PM",midnight:"minuit",noon:"midi",morning:"du matin",afternoon:"de l’après-midi",evening:"du soir",night:"du matin"}},defaultWidth:"wide"})},rx={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(ième|ère|ème|er|e)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(av\.J\.C|ap\.J\.C|ap\.J\.-C)/i,abbreviated:/^(av\.J\.-C|av\.J-C|apr\.J\.-C|apr\.J-C|ap\.J-C)/i,wide:/^(avant Jésus-Christ|après Jésus-Christ)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^av/i,/^ap/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](er|ème|e)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv|févr|mars|avr|mai|juin|juill|juil|août|sept|oct|nov|déc)\.?/i,wide:/^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^av/i,/^ma/i,/^juin/i,/^juil/i,/^ao/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[lmjvsd]/i,short:/^(di|lu|ma|me|je|ve|sa)/i,abbreviated:/^(dim|lun|mar|mer|jeu|ven|sam)\.?/i,wide:/^(dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^di/i,/^lu/i,/^ma/i,/^me/i,/^je/i,/^ve/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|minuit|midi|mat\.?|ap\.?m\.?|soir|nuit)/i,any:/^([ap]\.?\s?m\.?|du matin|de l'après[-\s]midi|du soir|de la nuit)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^min/i,noon:/^mid/i,morning:/mat/i,afternoon:/ap/i,evening:/soir/i,night:/nuit/i}},defaultParseWidth:"any"})},ry={lessThanXSeconds:{one:"હમણાં",other:"​આશરે {{count}} સેકંડ"},xSeconds:{one:"1 સેકંડ",other:"{{count}} સેકંડ"},halfAMinute:"અડધી મિનિટ",lessThanXMinutes:{one:"આ મિનિટ",other:"​આશરે {{count}} મિનિટ"},xMinutes:{one:"1 મિનિટ",other:"{{count}} મિનિટ"},aboutXHours:{one:"​આશરે 1 કલાક",other:"​આશરે {{count}} કલાક"},xHours:{one:"1 કલાક",other:"{{count}} કલાક"},xDays:{one:"1 દિવસ",other:"{{count}} દિવસ"},aboutXWeeks:{one:"આશરે 1 અઠવાડિયું",other:"આશરે {{count}} અઠવાડિયા"},xWeeks:{one:"1 અઠવાડિયું",other:"{{count}} અઠવાડિયા"},aboutXMonths:{one:"આશરે 1 મહિનો",other:"આશરે {{count}} મહિના"},xMonths:{one:"1 મહિનો",other:"{{count}} મહિના"},aboutXYears:{one:"આશરે 1 વર્ષ",other:"આશરે {{count}} વર્ષ"},xYears:{one:"1 વર્ષ",other:"{{count}} વર્ષ"},overXYears:{one:"1 વર્ષથી વધુ",other:"{{count}} વર્ષથી વધુ"},almostXYears:{one:"લગભગ 1 વર્ષ",other:"લગભગ {{count}} વર્ષ"}},rv={date:(0,n$.default)({formats:{full:"EEEE, d MMMM, y",long:"d MMMM, y",medium:"d MMM, y",short:"d/M/yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"hh:mm:ss a zzzz",long:"hh:mm:ss a z",medium:"hh:mm:ss a",short:"hh:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},rC={lastWeek:"'પાછલા' eeee p",yesterday:"'ગઈકાલે' p",today:"'આજે' p",tomorrow:"'આવતીકાલે' p",nextWeek:"eeee p",other:"P"},rw={ordinalNumber:function(e,t){return Number(e)},era:(0,nq.default)({values:{narrow:["ઈસપૂ","ઈસ"],abbreviated:["ઈ.સ.પૂર્વે","ઈ.સ."],wide:["ઈસવીસન પૂર્વે","ઈસવીસન"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1લો ત્રિમાસ","2જો ત્રિમાસ","3જો ત્રિમાસ","4થો ત્રિમાસ"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["જા","ફે","મા","એ","મે","જૂ","જુ","ઓ","સ","ઓ","ન","ડિ"],abbreviated:["જાન્યુ","ફેબ્રુ","માર્ચ","એપ્રિલ","મે","જૂન","જુલાઈ","ઑગસ્ટ","સપ્ટે","ઓક્ટો","નવે","ડિસે"],wide:["જાન્યુઆરી","ફેબ્રુઆરી","માર્ચ","એપ્રિલ","મે","જૂન","જુલાઇ","ઓગસ્ટ","સપ્ટેમ્બર","ઓક્ટોબર","નવેમ્બર","ડિસેમ્બર"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ર","સો","મં","બુ","ગુ","શુ","શ"],short:["ર","સો","મં","બુ","ગુ","શુ","શ"],abbreviated:["રવિ","સોમ","મંગળ","બુધ","ગુરુ","શુક્ર","શનિ"],wide:["રવિવાર","સોમવાર","મંગળવાર","બુધવાર","ગુરુવાર","શુક્રવાર","શનિવાર"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"મ.રાત્રિ",noon:"બ.",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"},abbreviated:{am:"AM",pm:"PM",midnight:"​મધ્યરાત્રિ",noon:"બપોરે",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"},wide:{am:"AM",pm:"PM",midnight:"​મધ્યરાત્રિ",noon:"બપોરે",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"મ.રાત્રિ",noon:"બપોરે",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"},abbreviated:{am:"AM",pm:"PM",midnight:"મધ્યરાત્રિ",noon:"બપોરે",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"},wide:{am:"AM",pm:"PM",midnight:"​મધ્યરાત્રિ",noon:"બપોરે",morning:"સવારે",afternoon:"બપોરે",evening:"સાંજે",night:"રાત્રે"}},defaultFormattingWidth:"wide"})},rS={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(લ|જ|થ|ઠ્ઠ|મ)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ઈસપૂ|ઈસ)/i,abbreviated:/^(ઈ\.સ\.પૂર્વે|ઈ\.સ\.)/i,wide:/^(ઈસવીસન\sપૂર્વે|ઈસવીસન)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(ઈસપૂ|ઈસ)/i,/^(ઈ\.સ\.પૂર્વે|ઈ\.સ\.)/i,/^(ઈસવીસન\sપૂર્વે|ઈસવીસન)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](લો|જો|થો)? ત્રિમાસ/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[જાફેમાએમેજૂજુઓસઓનડિ]/i,abbreviated:/^(જાન્યુ|ફેબ્રુ|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઈ|ઑગસ્ટ|સપ્ટે|ઓક્ટો|નવે|ડિસે)/i,wide:/^(જાન્યુઆરી|ફેબ્રુઆરી|માર્ચ|એપ્રિલ|મે|જૂન|જુલાઇ|ઓગસ્ટ|સપ્ટેમ્બર|ઓક્ટોબર|નવેમ્બર|ડિસેમ્બર)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^જા/i,/^ફે/i,/^મા/i,/^એ/i,/^મે/i,/^જૂ/i,/^જુ/i,/^ઑગ/i,/^સ/i,/^ઓક્ટો/i,/^ન/i,/^ડિ/i],any:[/^જા/i,/^ફે/i,/^મા/i,/^એ/i,/^મે/i,/^જૂ/i,/^જુ/i,/^ઑગ/i,/^સ/i,/^ઓક્ટો/i,/^ન/i,/^ડિ/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,short:/^(ર|સો|મં|બુ|ગુ|શુ|શ)/i,abbreviated:/^(રવિ|સોમ|મંગળ|બુધ|ગુરુ|શુક્ર|શનિ)/i,wide:/^(રવિવાર|સોમવાર|મંગળવાર|બુધવાર|ગુરુવાર|શુક્રવાર|શનિવાર)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ર/i,/^સો/i,/^મં/i,/^બુ/i,/^ગુ/i,/^શુ/i,/^શ/i],any:[/^ર/i,/^સો/i,/^મં/i,/^બુ/i,/^ગુ/i,/^શુ/i,/^શ/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|મ\.?|સ|બ|સાં|રા)/i,any:/^(a|p|મ\.?|સ|બ|સાં|રા)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^મ\.?/i,noon:/^બ/i,morning:/સ/i,afternoon:/બ/i,evening:/સાં/i,night:/રા/i}},defaultParseWidth:"any"})},rk={lessThanXSeconds:{one:"פחות משנייה",two:"פחות משתי שניות",other:"פחות מ־{{count}} שניות"},xSeconds:{one:"שנייה",two:"שתי שניות",other:"{{count}} שניות"},halfAMinute:"חצי דקה",lessThanXMinutes:{one:"פחות מדקה",two:"פחות משתי דקות",other:"פחות מ־{{count}} דקות"},xMinutes:{one:"דקה",two:"שתי דקות",other:"{{count}} דקות"},aboutXHours:{one:"כשעה",two:"כשעתיים",other:"כ־{{count}} שעות"},xHours:{one:"שעה",two:"שעתיים",other:"{{count}} שעות"},xDays:{one:"יום",two:"יומיים",other:"{{count}} ימים"},aboutXWeeks:{one:"כשבוע",two:"כשבועיים",other:"כ־{{count}} שבועות"},xWeeks:{one:"שבוע",two:"שבועיים",other:"{{count}} שבועות"},aboutXMonths:{one:"כחודש",two:"כחודשיים",other:"כ־{{count}} חודשים"},xMonths:{one:"חודש",two:"חודשיים",other:"{{count}} חודשים"},aboutXYears:{one:"כשנה",two:"כשנתיים",other:"כ־{{count}} שנים"},xYears:{one:"שנה",two:"שנתיים",other:"{{count}} שנים"},overXYears:{one:"יותר משנה",two:"יותר משנתיים",other:"יותר מ־{{count}} שנים"},almostXYears:{one:"כמעט שנה",two:"כמעט שנתיים",other:"כמעט {{count}} שנים"}},rA={date:(0,n$.default)({formats:{full:"EEEE, d בMMMM y",long:"d בMMMM y",medium:"d בMMM y",short:"d.M.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'בשעה' {{time}}",long:"{{date}} 'בשעה' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rE={lastWeek:"eeee 'שעבר בשעה' p",yesterday:"'אתמול בשעה' p",today:"'היום בשעה' p",tomorrow:"'מחר בשעה' p",nextWeek:"eeee 'בשעה' p",other:"P"},r_={ordinalNumber:function(e,t){var i=Number(e);if(i<=0||i>10)return i;var n=["year","hour","minute","second"].indexOf(String((t||{}).unit))>=0,a=i-1;return n?["ראשונה","שנייה","שלישית","רביעית","חמישית","שישית","שביעית","שמינית","תשיעית","עשירית"][a]:["ראשון","שני","שלישי","רביעי","חמישי","שישי","שביעי","שמיני","תשיעי","עשירי"][a]},era:(0,nq.default)({values:{narrow:["לפנה״ס","לספירה"],abbreviated:["לפנה״ס","לספירה"],wide:["לפני הספירה","לספירה"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["רבעון 1","רבעון 2","רבעון 3","רבעון 4"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["ינו׳","פבר׳","מרץ","אפר׳","מאי","יוני","יולי","אוג׳","ספט׳","אוק׳","נוב׳","דצמ׳"],wide:["ינואר","פברואר","מרץ","אפריל","מאי","יוני","יולי","אוגוסט","ספטמבר","אוקטובר","נובמבר","דצמבר"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["א׳","ב׳","ג׳","ד׳","ה׳","ו׳","ש׳"],short:["א׳","ב׳","ג׳","ד׳","ה׳","ו׳","ש׳"],abbreviated:["יום א׳","יום ב׳","יום ג׳","יום ד׳","יום ה׳","יום ו׳","שבת"],wide:["יום ראשון","יום שני","יום שלישי","יום רביעי","יום חמישי","יום שישי","יום שבת"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בוקר",afternoon:"אחר הצהריים",evening:"ערב",night:"לילה"},abbreviated:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בוקר",afternoon:"אחר הצהריים",evening:"ערב",night:"לילה"},wide:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בוקר",afternoon:"אחר הצהריים",evening:"ערב",night:"לילה"}},defaultWidth:"wide",formattingValues:{narrow:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בבוקר",afternoon:"בצהריים",evening:"בערב",night:"בלילה"},abbreviated:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בבוקר",afternoon:"אחר הצהריים",evening:"בערב",night:"בלילה"},wide:{am:"לפנה״צ",pm:"אחה״צ",midnight:"חצות",noon:"צהריים",morning:"בבוקר",afternoon:"אחר הצהריים",evening:"בערב",night:"בלילה"}},defaultFormattingWidth:"wide"})},rI=["רא","שנ","של","רב","ח","שי","שב","שמ","ת","ע"],rM={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+|(ראשון|שני|שלישי|רביעי|חמישי|שישי|שביעי|שמיני|תשיעי|עשירי|ראשונה|שנייה|שלישית|רביעית|חמישית|שישית|שביעית|שמינית|תשיעית|עשירית))/i,parsePattern:/^(\d+|רא|שנ|של|רב|ח|שי|שב|שמ|ת|ע)/i,valueCallback:function(e){var t=parseInt(e,10);return isNaN(t)?rI.indexOf(e)+1:t}}),era:(0,nQ.default)({matchPatterns:{narrow:/^ל(ספירה|פנה״ס)/i,abbreviated:/^ל(ספירה|פנה״ס)/i,wide:/^ל(פני ה)?ספירה/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^לפ/i,/^לס/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^רבעון [1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^\d+/i,abbreviated:/^(ינו|פבר|מרץ|אפר|מאי|יוני|יולי|אוג|ספט|אוק|נוב|דצמ)׳?/i,wide:/^(ינואר|פברואר|מרץ|אפריל|מאי|יוני|יולי|אוגוסט|ספטמבר|אוקטובר|נובמבר|דצמבר)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^1$/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^7/i,/^8/i,/^9/i,/^10/i,/^11/i,/^12/i],any:[/^ינ/i,/^פ/i,/^מר/i,/^אפ/i,/^מא/i,/^יונ/i,/^יול/i,/^אוג/i,/^ס/i,/^אוק/i,/^נ/i,/^ד/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[אבגדהוש]׳/i,short:/^[אבגדהוש]׳/i,abbreviated:/^(שבת|יום (א|ב|ג|ד|ה|ו)׳)/i,wide:/^יום (ראשון|שני|שלישי|רביעי|חמישי|שישי|שבת)/i},defaultMatchWidth:"wide",parsePatterns:{abbreviated:[/א׳$/i,/ב׳$/i,/ג׳$/i,/ד׳$/i,/ה׳$/i,/ו׳$/i,/^ש/i],wide:[/ן$/i,/ני$/i,/לישי$/i,/עי$/i,/מישי$/i,/שישי$/i,/ת$/i],any:[/^א/i,/^ב/i,/^ג/i,/^ד/i,/^ה/i,/^ו/i,/^ש/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(אחר ה|ב)?(חצות|צהריים|בוקר|ערב|לילה|אחה״צ|לפנה״צ)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^לפ/i,pm:/^אחה/i,midnight:/^ח/i,noon:/^צ/i,morning:/בוקר/i,afternoon:/בצ|אחר/i,evening:/ערב/i,night:/לילה/i}},defaultParseWidth:"any"})},rT={1:"१",2:"२",3:"३",4:"४",5:"५",6:"६",7:"७",8:"८",9:"९",0:"०"},rL={"१":"1","२":"2","३":"3","४":"4","५":"5","६":"6","७":"7","८":"8","९":"9","०":"0"},rj={localeToNumber:function(e){return Number(e.toString().replace(/[१२३४५६७८९०]/g,function(e){return rL[e]}))},numberToLocale:function(e){return e.toString().replace(/\d/g,function(e){return rT[e]})},ordinalNumber:function(e){var t=rj.localeToNumber(e),i=rj.numberToLocale(t);switch(t%10){case 2:case 3:case 4:case 6:case 1:case 5:case 7:case 8:case 9:case 0:return i}},era:(0,nq.default)({values:{narrow:["ईसा-पूर्व","ईस्वी"],abbreviated:["ईसा-पूर्व","ईस्वी"],wide:["ईसा-पूर्व","ईसवी सन"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["ति1","ति2","ति3","ति4"],wide:["पहली तिमाही","दूसरी तिमाही","तीसरी तिमाही","चौथी तिमाही"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ज","फ़","मा","अ","मई","जू","जु","अग","सि","अक्तू","न","दि"],abbreviated:["जन","फ़र","मार्च","अप्रैल","मई","जून","जुल","अग","सित","अक्तू","नव","दिस"],wide:["जनवरी","फ़रवरी","मार्च","अप्रैल","मई","जून","जुलाई","अगस्त","सितंबर","अक्तूबर","नवंबर","दिसंबर"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["र","सो","मं","बु","गु","शु","श"],short:["र","सो","मं","बु","गु","शु","श"],abbreviated:["रवि","सोम","मंगल","बुध","गुरु","शुक्र","शनि"],wide:["रविवार","सोमवार","मंगलवार","बुधवार","गुरुवार","शुक्रवार","शनिवार"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultWidth:"wide",formattingValues:{narrow:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},abbreviated:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"},wide:{am:"पूर्वाह्न",pm:"अपराह्न",midnight:"मध्यरात्रि",noon:"दोपहर",morning:"सुबह",afternoon:"दोपहर",evening:"शाम",night:"रात"}},defaultFormattingWidth:"wide"})},rP={lessThanXSeconds:{one:"१ सेकंड से कम",other:"{{count}} सेकंड से कम"},xSeconds:{one:"१ सेकंड",other:"{{count}} सेकंड"},halfAMinute:"आधा मिनट",lessThanXMinutes:{one:"१ मिनट से कम",other:"{{count}} मिनट से कम"},xMinutes:{one:"१ मिनट",other:"{{count}} मिनट"},aboutXHours:{one:"लगभग १ घंटा",other:"लगभग {{count}} घंटे"},xHours:{one:"१ घंटा",other:"{{count}} घंटे"},xDays:{one:"१ दिन",other:"{{count}} दिन"},aboutXWeeks:{one:"लगभग १ सप्ताह",other:"लगभग {{count}} सप्ताह"},xWeeks:{one:"१ सप्ताह",other:"{{count}} सप्ताह"},aboutXMonths:{one:"लगभग १ महीना",other:"लगभग {{count}} महीने"},xMonths:{one:"१ महीना",other:"{{count}} महीने"},aboutXYears:{one:"लगभग १ वर्ष",other:"लगभग {{count}} वर्ष"},xYears:{one:"१ वर्ष",other:"{{count}} वर्ष"},overXYears:{one:"१ वर्ष से अधिक",other:"{{count}} वर्ष से अधिक"},almostXYears:{one:"लगभग १ वर्ष",other:"लगभग {{count}} वर्ष"}},rD={date:(0,n$.default)({formats:{full:"EEEE, do MMMM, y",long:"do MMMM, y",medium:"d MMM, y",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'को' {{time}}",long:"{{date}} 'को' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rN={lastWeek:"'पिछले' eeee p",yesterday:"'कल' p",today:"'आज' p",tomorrow:"'कल' p",nextWeek:"eeee 'को' p",other:"P"},rR={ordinalNumber:(0,nX.default)({matchPattern:/^[०१२३४५६७८९]+/i,parsePattern:/^[०१२३४५६७८९]+/i,valueCallback:rj.localeToNumber}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ईसा-पूर्व|ईस्वी)/i,abbreviated:/^(ईसा\.?\s?पूर्व\.?|ईसा\.?)/i,wide:/^(ईसा-पूर्व|ईसवी पूर्व|ईसवी सन|ईसवी)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^ति[1234]/i,wide:/^[1234](पहली|दूसरी|तीसरी|चौथी)? तिमाही/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[जफ़माअप्मईजूनजुअगसिअक्तनदि]/i,abbreviated:/^(जन|फ़र|मार्च|अप्|मई|जून|जुल|अग|सित|अक्तू|नव|दिस)/i,wide:/^(जनवरी|फ़रवरी|मार्च|अप्रैल|मई|जून|जुलाई|अगस्त|सितंबर|अक्तूबर|नवंबर|दिसंबर)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ज/i,/^फ़/i,/^मा/i,/^अप्/i,/^मई/i,/^जू/i,/^जु/i,/^अग/i,/^सि/i,/^अक्तू/i,/^न/i,/^दि/i],any:[/^जन/i,/^फ़/i,/^मा/i,/^अप्/i,/^मई/i,/^जू/i,/^जु/i,/^अग/i,/^सि/i,/^अक्तू/i,/^नव/i,/^दिस/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[रविसोममंगलबुधगुरुशुक्रशनि]/i,short:/^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,abbreviated:/^(रवि|सोम|मंगल|बुध|गुरु|शुक्र|शनि)/i,wide:/^(रविवार|सोमवार|मंगलवार|बुधवार|गुरुवार|शुक्रवार|शनिवार)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^रवि/i,/^सोम/i,/^मंगल/i,/^बुध/i,/^गुरु/i,/^शुक्र/i,/^शनि/i],any:[/^रवि/i,/^सोम/i,/^मंगल/i,/^बुध/i,/^गुरु/i,/^शुक्र/i,/^शनि/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(पू|अ|म|द.\?|सु|दो|शा|रा)/i,any:/^(पूर्वाह्न|अपराह्न|म|द.\?|सु|दो|शा|रा)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^पूर्वाह्न/i,pm:/^अपराह्न/i,midnight:/^मध्य/i,noon:/^दो/i,morning:/सु/i,afternoon:/दो/i,evening:/शा/i,night:/रा/i}},defaultParseWidth:"any"})},rO={lessThanXSeconds:{one:{standalone:"manje od 1 sekunde",withPrepositionAgo:"manje od 1 sekunde",withPrepositionIn:"manje od 1 sekundu"},dual:"manje od {{count}} sekunde",other:"manje od {{count}} sekundi"},xSeconds:{one:{standalone:"1 sekunda",withPrepositionAgo:"1 sekunde",withPrepositionIn:"1 sekundu"},dual:"{{count}} sekunde",other:"{{count}} sekundi"},halfAMinute:"pola minute",lessThanXMinutes:{one:{standalone:"manje od 1 minute",withPrepositionAgo:"manje od 1 minute",withPrepositionIn:"manje od 1 minutu"},dual:"manje od {{count}} minute",other:"manje od {{count}} minuta"},xMinutes:{one:{standalone:"1 minuta",withPrepositionAgo:"1 minute",withPrepositionIn:"1 minutu"},dual:"{{count}} minute",other:"{{count}} minuta"},aboutXHours:{one:{standalone:"oko 1 sat",withPrepositionAgo:"oko 1 sat",withPrepositionIn:"oko 1 sat"},dual:"oko {{count}} sata",other:"oko {{count}} sati"},xHours:{one:{standalone:"1 sat",withPrepositionAgo:"1 sat",withPrepositionIn:"1 sat"},dual:"{{count}} sata",other:"{{count}} sati"},xDays:{one:{standalone:"1 dan",withPrepositionAgo:"1 dan",withPrepositionIn:"1 dan"},dual:"{{count}} dana",other:"{{count}} dana"},aboutXWeeks:{one:{standalone:"oko 1 tjedan",withPrepositionAgo:"oko 1 tjedan",withPrepositionIn:"oko 1 tjedan"},dual:"oko {{count}} tjedna",other:"oko {{count}} tjedana"},xWeeks:{one:{standalone:"1 tjedan",withPrepositionAgo:"1 tjedan",withPrepositionIn:"1 tjedan"},dual:"{{count}} tjedna",other:"{{count}} tjedana"},aboutXMonths:{one:{standalone:"oko 1 mjesec",withPrepositionAgo:"oko 1 mjesec",withPrepositionIn:"oko 1 mjesec"},dual:"oko {{count}} mjeseca",other:"oko {{count}} mjeseci"},xMonths:{one:{standalone:"1 mjesec",withPrepositionAgo:"1 mjesec",withPrepositionIn:"1 mjesec"},dual:"{{count}} mjeseca",other:"{{count}} mjeseci"},aboutXYears:{one:{standalone:"oko 1 godinu",withPrepositionAgo:"oko 1 godinu",withPrepositionIn:"oko 1 godinu"},dual:"oko {{count}} godine",other:"oko {{count}} godina"},xYears:{one:{standalone:"1 godina",withPrepositionAgo:"1 godine",withPrepositionIn:"1 godinu"},dual:"{{count}} godine",other:"{{count}} godina"},overXYears:{one:{standalone:"preko 1 godinu",withPrepositionAgo:"preko 1 godinu",withPrepositionIn:"preko 1 godinu"},dual:"preko {{count}} godine",other:"preko {{count}} godina"},almostXYears:{one:{standalone:"gotovo 1 godinu",withPrepositionAgo:"gotovo 1 godinu",withPrepositionIn:"gotovo 1 godinu"},dual:"gotovo {{count}} godine",other:"gotovo {{count}} godina"}},rB={date:(0,n$.default)({formats:{full:"EEEE, d. MMMM y.",long:"d. MMMM y.",medium:"d. MMM y.",short:"dd. MM. y."},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss (zzzz)",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'u' {{time}}",long:"{{date}} 'u' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},rz={lastWeek:function(e){switch(e.getUTCDay()){case 0:return"'prošlu nedjelju u' p";case 3:return"'prošlu srijedu u' p";case 6:return"'prošlu subotu u' p";default:return"'prošli' EEEE 'u' p"}},yesterday:"'jučer u' p",today:"'danas u' p",tomorrow:"'sutra u' p",nextWeek:function(e){switch(e.getUTCDay()){case 0:return"'iduću nedjelju u' p";case 3:return"'iduću srijedu u' p";case 6:return"'iduću subotu u' p";default:return"'prošli' EEEE 'u' p"}},other:"P"},rF={ordinalNumber:function(e){return String(Number(e)).concat(".")},era:(0,nq.default)({values:{narrow:["pr.n.e.","AD"],abbreviated:["pr. Kr.","po. Kr."],wide:["Prije Krista","Poslije Krista"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1.","2.","3.","4."],abbreviated:["1. kv.","2. kv.","3. kv.","4. kv."],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12."],abbreviated:["sij","velj","ožu","tra","svi","lip","srp","kol","ruj","lis","stu","pro"],wide:["siječanj","veljača","ožujak","travanj","svibanj","lipanj","srpanj","kolovoz","rujan","listopad","studeni","prosinac"]},defaultWidth:"wide",formattingValues:{narrow:["1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12."],abbreviated:["sij","velj","ožu","tra","svi","lip","srp","kol","ruj","lis","stu","pro"],wide:["siječnja","veljače","ožujka","travnja","svibnja","lipnja","srpnja","kolovoza","rujna","listopada","studenog","prosinca"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["N","P","U","S","Č","P","S"],short:["ned","pon","uto","sri","čet","pet","sub"],abbreviated:["ned","pon","uto","sri","čet","pet","sub"],wide:["nedjelja","ponedjeljak","utorak","srijeda","četvrtak","petak","subota"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"popodne",evening:"navečer",night:"noću"},abbreviated:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"popodne",evening:"navečer",night:"noću"},wide:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"poslije podne",evening:"navečer",night:"noću"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"popodne",evening:"navečer",night:"noću"},abbreviated:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"popodne",evening:"navečer",night:"noću"},wide:{am:"AM",pm:"PM",midnight:"ponoć",noon:"podne",morning:"ujutro",afternoon:"poslije podne",evening:"navečer",night:"noću"}},defaultFormattingWidth:"wide"})},rH={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\./i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(pr\.n\.e\.|AD)/i,abbreviated:/^(pr\.\s?Kr\.|po\.\s?Kr\.)/i,wide:/^(Prije Krista|prije nove ere|Poslije Krista|nova era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^pr/i,/^(po|nova)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]\.\s?kv\.?/i,wide:/^[1234]\. kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(10|11|12|[123456789])\./i,abbreviated:/^(sij|velj|(ožu|ozu)|tra|svi|lip|srp|kol|ruj|lis|stu|pro)/i,wide:/^((siječanj|siječnja|sijecanj|sijecnja)|(veljača|veljače|veljaca|veljace)|(ožujak|ožujka|ozujak|ozujka)|(travanj|travnja)|(svibanj|svibnja)|(lipanj|lipnja)|(srpanj|srpnja)|(kolovoz|kolovoza)|(rujan|rujna)|(listopad|listopada)|(studeni|studenog)|(prosinac|prosinca))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/(10|11|12|[123456789])/i],abbreviated:[/^sij/i,/^velj/i,/^(ožu|ozu)/i,/^tra/i,/^svi/i,/^lip/i,/^srp/i,/^kol/i,/^ruj/i,/^lis/i,/^stu/i,/^pro/i],wide:[/^sij/i,/^velj/i,/^(ožu|ozu)/i,/^tra/i,/^svi/i,/^lip/i,/^srp/i,/^kol/i,/^ruj/i,/^lis/i,/^stu/i,/^pro/i]},defaultParseWidth:"wide"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[npusčc]/i,short:/^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,abbreviated:/^(ned|pon|uto|sri|(čet|cet)|pet|sub)/i,wide:/^(nedjelja|ponedjeljak|utorak|srijeda|(četvrtak|cetvrtak)|petak|subota)/i},defaultMatchWidth:"wide",parsePatterns:{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]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(am|pm|ponoc|ponoć|(po)?podne|navecer|navečer|noću|poslije podne|ujutro)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^pono/i,noon:/^pod/i,morning:/jutro/i,afternoon:/(poslije\s|po)+podne/i,evening:/(navece|naveče)/i,night:/(nocu|noću)/i}},defaultParseWidth:"any"})},rW={about:"körülbelül",over:"több mint",almost:"majdnem",lessthan:"kevesebb mint"},rU={xseconds:" másodperc",halfaminute:"fél perc",xminutes:" perc",xhours:" óra",xdays:" nap",xweeks:" hét",xmonths:" hónap",xyears:" év"},rV={xseconds:{"-1":" másodperccel ezelőtt",1:" másodperc múlva",0:" másodperce"},halfaminute:{"-1":"fél perccel ezelőtt",1:"fél perc múlva",0:"fél perce"},xminutes:{"-1":" perccel ezelőtt",1:" perc múlva",0:" perce"},xhours:{"-1":" órával ezelőtt",1:" óra múlva",0:" órája"},xdays:{"-1":" nappal ezelőtt",1:" nap múlva",0:" napja"},xweeks:{"-1":" héttel ezelőtt",1:" hét múlva",0:" hete"},xmonths:{"-1":" hónappal ezelőtt",1:" hónap múlva",0:" hónapja"},xyears:{"-1":" évvel ezelőtt",1:" év múlva",0:" éve"}},rG={date:(0,n$.default)({formats:{full:"y. MMMM d., EEEE",long:"y. MMMM d.",medium:"y. MMM d.",short:"y. MM. dd."},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},r$=["vasárnap","hétfőn","kedden","szerdán","csütörtökön","pénteken","szombaton"];function rZ(e){return function(t,i,n){return(e?"":"'múlt' ")+"'"+r$[t.getUTCDay()]+"' p'-kor'"}}var rK={lastWeek:rZ(!1),yesterday:"'tegnap' p'-kor'",today:"'ma' p'-kor'",tomorrow:"'holnap' p'-kor'",nextWeek:rZ(!0),other:"P"},rq={ordinalNumber:function(e,t){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["ie.","isz."],abbreviated:["i. e.","i. sz."],wide:["Krisztus előtt","időszámításunk szerint"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1.","2.","3.","4."],abbreviated:["1. n.év","2. n.év","3. n.év","4. n.év"],wide:["1. negyedév","2. negyedév","3. negyedév","4. negyedév"]},defaultWidth:"wide",formattingValues:{narrow:["I.","II.","III.","IV."],abbreviated:["I. n.év","II. n.év","III. n.év","IV. n.év"],wide:["I. negyedév","II. negyedév","III. negyedév","IV. negyedév"]},argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","Á","M","J","J","A","Sz","O","N","D"],abbreviated:["jan.","febr.","márc.","ápr.","máj.","jún.","júl.","aug.","szept.","okt.","nov.","dec."],wide:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["V","H","K","Sz","Cs","P","Sz"],short:["V","H","K","Sze","Cs","P","Szo"],abbreviated:["V","H","K","Sze","Cs","P","Szo"],wide:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"du.",evening:"este",night:"éjjel"},abbreviated:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"du.",evening:"este",night:"éjjel"},wide:{am:"de.",pm:"du.",midnight:"éjfél",noon:"dél",morning:"reggel",afternoon:"délután",evening:"este",night:"éjjel"}},defaultWidth:"wide",defaultFormattingWidth:"wide"})},rY={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\.?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ie\.|isz\.)/i,abbreviated:/^(i\.\s?e\.?|b?\s?c\s?e|i\.\s?sz\.?)/i,wide:/^(Krisztus előtt|időszámításunk előtt|időszámításunk szerint|i\. sz\.)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/ie/i,/isz/i],abbreviated:[/^(i\.?\s?e\.?|b\s?ce)/i,/^(i\.?\s?sz\.?|c\s?e)/i],any:[/előtt/i,/(szerint|i. sz.)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]\.?/i,abbreviated:/^[1234]?\.?\s?n\.év/i,wide:/^([1234]|I|II|III|IV)?\.?\s?negyedév/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1|I$/i,/2|II$/i,/3|III/i,/4|IV/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmaásond]|sz/i,abbreviated:/^(jan\.?|febr\.?|márc\.?|ápr\.?|máj\.?|jún\.?|júl\.?|aug\.?|szept\.?|okt\.?|nov\.?|dec\.?)/i,wide:/^(január|február|március|április|május|június|július|augusztus|szeptember|október|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a|á/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s|sz/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^már/i,/^áp/i,/^máj/i,/^jún/i,/^júl/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^([vhkpc]|sz|cs|sz)/i,short:/^([vhkp]|sze|cs|szo)/i,abbreviated:/^([vhkp]|sze|cs|szo)/i,wide:/^(vasárnap|hétfő|kedd|szerda|csütörtök|péntek|szombat)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^v/i,/^h/i,/^k/i,/^sz/i,/^c/i,/^p/i,/^sz/i],any:[/^v/i,/^h/i,/^k/i,/^sze/i,/^c/i,/^p/i,/^szo/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^((de|du)\.?|éjfél|délután|dél|reggel|este|éjjel)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^de\.?/i,pm:/^du\.?/i,midnight:/^éjf/i,noon:/^dé/i,morning:/reg/i,afternoon:/^délu\.?/i,evening:/es/i,night:/éjj/i}},defaultParseWidth:"any"})},rX={lessThanXSeconds:{one:"kurang dari 1 detik",other:"kurang dari {{count}} detik"},xSeconds:{one:"1 detik",other:"{{count}} detik"},halfAMinute:"setengah menit",lessThanXMinutes:{one:"kurang dari 1 menit",other:"kurang dari {{count}} menit"},xMinutes:{one:"1 menit",other:"{{count}} menit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},rQ={date:(0,n$.default)({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},rJ={lastWeek:"eeee 'lalu pukul' p",yesterday:"'Kemarin pukul' p",today:"'Hari ini pukul' p",tomorrow:"'Besok pukul' p",nextWeek:"eeee 'pukul' p",other:"P"},r0={ordinalNumber:function(e,t){return"ke-"+Number(e)},era:(0,nq.default)({values:{narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masehi","Masehi"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["Kuartal ke-1","Kuartal ke-2","Kuartal ke-3","Kuartal ke-4"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Ags","Sep","Okt","Nov","Des"],wide:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["M","S","S","R","K","J","S"],short:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],abbreviated:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],wide:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"},wide:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"siang",evening:"sore",night:"malam"}},defaultFormattingWidth:"wide"})},r1={ordinalNumber:(0,nX.default)({matchPattern:/^ke-(\d+)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|s\.?\s?e\.?\s?u\.?|m\.?|e\.?\s?u\.?)/i,wide:/^(sebelum masehi|sebelum era umum|masehi|era umum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^(m|e)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K-?\s[1234]/i,wide:/^Kuartal ke-?\s?[1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|mei|jun|jul|agt|sep|okt|nov|des)/i,wide:/^(januari|februari|maret|april|mei|juni|juli|agustus|september|oktober|november|desember)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[srkjm]/i,short:/^(min|sen|sel|rab|kam|jum|sab)/i,abbreviated:/^(min|sen|sel|rab|kam|jum|sab)/i,wide:/^(minggu|senin|selasa|rabu|kamis|jumat|sabtu)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^m/i,/^s/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^m/i,/^sen/i,/^sel/i,/^r/i,/^k/i,/^j/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|tengah m|tengah h|(di(\swaktu)?) (pagi|siang|sore|malam))/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|(di(\swaktu)?) (pagi|siang|sore|malam))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pagi/i,afternoon:/siang/i,evening:/sore/i,night:/malam/i}},defaultParseWidth:"any"})},r2={lessThanXSeconds:{one:"minna en 1 sekúnda",other:"minna en {{count}} sekúndur"},xSeconds:{one:"1 sekúnda",other:"{{count}} sekúndur"},halfAMinute:"hálf mínúta",lessThanXMinutes:{one:"minna en 1 mínúta",other:"minna en {{count}} mínútur"},xMinutes:{one:"1 mínúta",other:"{{count}} mínútur"},aboutXHours:{one:"u.þ.b. 1 klukkustund",other:"u.þ.b. {{count}} klukkustundir"},xHours:{one:"1 klukkustund",other:"{{count}} klukkustundir"},xDays:{one:"1 dagur",other:"{{count}} dagar"},aboutXWeeks:{one:"um viku",other:"um {{count}} vikur"},xWeeks:{one:"1 viku",other:"{{count}} vikur"},aboutXMonths:{one:"u.þ.b. 1 mánuður",other:"u.þ.b. {{count}} mánuðir"},xMonths:{one:"1 mánuður",other:"{{count}} mánuðir"},aboutXYears:{one:"u.þ.b. 1 ár",other:"u.þ.b. {{count}} ár"},xYears:{one:"1 ár",other:"{{count}} ár"},overXYears:{one:"meira en 1 ár",other:"meira en {{count}} ár"},almostXYears:{one:"næstum 1 ár",other:"næstum {{count}} ár"}},r3={date:(0,n$.default)({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"d.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},r5={lastWeek:"'síðasta' dddd 'kl.' p",yesterday:"'í gær kl.' p",today:"'í dag kl.' p",tomorrow:"'á morgun kl.' p",nextWeek:"dddd 'kl.' p",other:"L"},r4={ordinalNumber:function(e,t){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["fyrir Krist","eftir Krist"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1F","2F","3F","4F"],wide:["1. fjórðungur","2. fjórðungur","3. fjórðungur","4. fjórðungur"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","Á","S","Ó","N","D"],abbreviated:["jan.","feb.","mars","apríl","maí","júní","júlí","ágúst","sept.","okt.","nóv.","des."],wide:["janúar","febrúar","mars","apríl","maí","júní","júlí","ágúst","september","október","nóvember","desember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","Þ","M","F","F","L"],short:["Su","Má","Þr","Mi","Fi","Fö","La"],abbreviated:["sun.","mán.","þri.","mið.","fim.","fös.","lau"],wide:["sunnudagur","mánudagur","þriðjudagur","miðvikudagur","fimmtudagur","föstudagur","laugardagur"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"f",pm:"e",midnight:"miðnætti",noon:"hádegi",morning:"morgunn",afternoon:"síðdegi",evening:"kvöld",night:"nótt"},abbreviated:{am:"f.h.",pm:"e.h.",midnight:"miðnætti",noon:"hádegi",morning:"morgunn",afternoon:"síðdegi",evening:"kvöld",night:"nótt"},wide:{am:"fyrir hádegi",pm:"eftir hádegi",midnight:"miðnætti",noon:"hádegi",morning:"morgunn",afternoon:"síðdegi",evening:"kvöld",night:"nótt"}},defaultWidth:"wide",formattingValues:{narrow:{am:"f",pm:"e",midnight:"á miðnætti",noon:"á hádegi",morning:"að morgni",afternoon:"síðdegis",evening:"um kvöld",night:"um nótt"},abbreviated:{am:"f.h.",pm:"e.h.",midnight:"á miðnætti",noon:"á hádegi",morning:"að morgni",afternoon:"síðdegis",evening:"um kvöld",night:"um nótt"},wide:{am:"fyrir hádegi",pm:"eftir hádegi",midnight:"á miðnætti",noon:"á hádegi",morning:"að morgni",afternoon:"síðdegis",evening:"um kvöld",night:"um nótt"}},defaultFormattingWidth:"wide"})},r6={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(f\.Kr\.|e\.Kr\.)/i,abbreviated:/^(f\.Kr\.|e\.Kr\.)/i,wide:/^(fyrir Krist|eftir Krist)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(f\.Kr\.|e\.Kr\.)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234] fjórðungur/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmásónd]/i,abbreviated:/^(jan\.|feb\.|mars\.|apríl\.|maí|júní|júlí|águst|sep\.|oct\.|nov\.|dec\.)/i,wide:/^(januar|februar|mars|apríl|maí|júní|júlí|águst|september|október|nóvember|desember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^á/i,/^s/i,/^ó/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^maí/i,/^jún/i,/^júl/i,/^áu/i,/^s/i,/^ó/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|má|þr|mi|fi|fö|la)/i,abbreviated:/^(sun|mán|þri|mið|fim|fös|lau)\.?/i,wide:/^(sunnudagur|mánudagur|þriðjudagur|miðvikudagur|fimmtudagur|föstudagur|laugardagur)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^þ/i,/^m/i,/^f/i,/^f/i,/^l/i],any:[/^su/i,/^má/i,/^þr/i,/^mi/i,/^fi/i,/^fö/i,/^la/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(f|e|síðdegis|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i,any:/^(fyrir hádegi|eftir hádegi|[ef]\.?h\.?|síðdegis|morgunn|(á|að|um) (morgni|kvöld|nótt|miðnætti))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^mi/i,noon:/^há/i,morning:/morgunn/i,afternoon:/síðdegi/i,evening:/kvöld/i,night:/nótt/i}},defaultParseWidth:"any"})},r9={lessThanXSeconds:{one:"meno di un secondo",other:"meno di {{count}} secondi"},xSeconds:{one:"un secondo",other:"{{count}} secondi"},halfAMinute:"alcuni secondi",lessThanXMinutes:{one:"meno di un minuto",other:"meno di {{count}} minuti"},xMinutes:{one:"un minuto",other:"{{count}} minuti"},aboutXHours:{one:"circa un'ora",other:"circa {{count}} ore"},xHours:{one:"un'ora",other:"{{count}} ore"},xDays:{one:"un giorno",other:"{{count}} giorni"},aboutXWeeks:{one:"circa una settimana",other:"circa {{count}} settimane"},xWeeks:{one:"una settimana",other:"{{count}} settimane"},aboutXMonths:{one:"circa un mese",other:"circa {{count}} mesi"},xMonths:{one:"un mese",other:"{{count}} mesi"},aboutXYears:{one:"circa un anno",other:"circa {{count}} anni"},xYears:{one:"un anno",other:"{{count}} anni"},overXYears:{one:"più di un anno",other:"più di {{count}} anni"},almostXYears:{one:"quasi un anno",other:"quasi {{count}} anni"}},r8={date:(0,n$.default)({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},r7=["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"];function oe(e){return"'"+r7[e]+" alle' p"}var ot={lastWeek:function(e,t,i){var n=e.getUTCDay();return n8(e,t,i)?oe(n):0===n?"'domenica scorsa alle' p":"'"+r7[n]+" scorso alle' p"},yesterday:"'ieri alle' p",today:"'oggi alle' p",tomorrow:"'domani alle' p",nextWeek:function(e,t,i){var n=e.getUTCDay();return n8(e,t,i)?oe(n):0===n?"'domenica prossima alle' p":"'"+r7[n]+" prossimo alle' p"},other:"P"},oi={ordinalNumber:function(e){return Number(e)+"º"},era:(0,nq.default)({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["avanti Cristo","dopo Cristo"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["G","F","M","A","M","G","L","A","S","O","N","D"],abbreviated:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],wide:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["D","L","M","M","G","V","S"],short:["dom","lun","mar","mer","gio","ven","sab"],abbreviated:["dom","lun","mar","mer","gio","ven","sab"],wide:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"mattina",afternoon:"pomeriggio",evening:"sera",night:"notte"}},defaultWidth:"wide",formattingValues:{narrow:{am:"m.",pm:"p.",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},abbreviated:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"},wide:{am:"AM",pm:"PM",midnight:"mezzanotte",noon:"mezzogiorno",morning:"di mattina",afternoon:"del pomeriggio",evening:"di sera",night:"di notte"}},defaultFormattingWidth:"wide"})},on={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(aC|dC)/i,abbreviated:/^(a\.?\s?C\.?|a\.?\s?e\.?\s?v\.?|d\.?\s?C\.?|e\.?\s?v\.?)/i,wide:/^(avanti Cristo|avanti Era Volgare|dopo Cristo|Era Volgare)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^a/i,/^(d|e)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^t[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[gfmalsond]/i,abbreviated:/^(gen|feb|mar|apr|mag|giu|lug|ago|set|ott|nov|dic)/i,wide:/^(gennaio|febbraio|marzo|aprile|maggio|giugno|luglio|agosto|settembre|ottobre|novembre|dicembre)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^g/i,/^f/i,/^m/i,/^a/i,/^m/i,/^g/i,/^l/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ge/i,/^f/i,/^mar/i,/^ap/i,/^mag/i,/^gi/i,/^l/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[dlmgvs]/i,short:/^(do|lu|ma|me|gi|ve|sa)/i,abbreviated:/^(dom|lun|mar|mer|gio|ven|sab)/i,wide:/^(domenica|luned[i|ì]|marted[i|ì]|mercoled[i|ì]|gioved[i|ì]|venerd[i|ì]|sabato)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^g/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^me/i,/^g/i,/^v/i,/^s/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|m\.|p|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i,any:/^([ap]\.?\s?m\.?|mezzanotte|mezzogiorno|(di|del) (mattina|pomeriggio|sera|notte))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mezza/i,noon:/^mezzo/i,morning:/mattina/i,afternoon:/pomeriggio/i,evening:/sera/i,night:/notte/i}},defaultParseWidth:"any"})},oa={lessThanXSeconds:{one:"1秒未満",other:"{{count}}秒未満",oneWithSuffix:"約1秒",otherWithSuffix:"約{{count}}秒"},xSeconds:{one:"1秒",other:"{{count}}秒"},halfAMinute:"30秒",lessThanXMinutes:{one:"1分未満",other:"{{count}}分未満",oneWithSuffix:"約1分",otherWithSuffix:"約{{count}}分"},xMinutes:{one:"1分",other:"{{count}}分"},aboutXHours:{one:"約1時間",other:"約{{count}}時間"},xHours:{one:"1時間",other:"{{count}}時間"},xDays:{one:"1日",other:"{{count}}日"},aboutXWeeks:{one:"約1週間",other:"約{{count}}週間"},xWeeks:{one:"1週間",other:"{{count}}週間"},aboutXMonths:{one:"約1か月",other:"約{{count}}か月"},xMonths:{one:"1か月",other:"{{count}}か月"},aboutXYears:{one:"約1年",other:"約{{count}}年"},xYears:{one:"1年",other:"{{count}}年"},overXYears:{one:"1年以上",other:"{{count}}年以上"},almostXYears:{one:"1年近く",other:"{{count}}年近く"}},or={date:(0,n$.default)({formats:{full:"y年M月d日EEEE",long:"y年M月d日",medium:"y/MM/dd",short:"y/MM/dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H時mm分ss秒 zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},oo={lastWeek:"先週のeeeeのp",yesterday:"昨日のp",today:"今日のp",tomorrow:"明日のp",nextWeek:"翌週のeeeeのp",other:"P"},os={ordinalNumber:function(e,t){var i=Number(e),n=String((t||{}).unit);return"date"===n?i+"日":"year"===n?i+"年":i},era:(0,nq.default)({values:{narrow:["BC","AC"],abbreviated:["紀元前","西暦"],wide:["紀元前","西暦"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["第1四半期","第2四半期","第3四半期","第4四半期"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["日","月","火","水","木","金","土"],short:["日","月","火","水","木","金","土"],abbreviated:["日","月","火","水","木","金","土"],wide:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultWidth:"wide",formattingValues:{narrow:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},abbreviated:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"},wide:{am:"午前",pm:"午後",midnight:"深夜",noon:"正午",morning:"朝",afternoon:"午後",evening:"夜",night:"深夜"}},defaultFormattingWidth:"wide"})},ol={ordinalNumber:(0,nX.default)({matchPattern:/^第?\d+(日)?(年)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(B\.?C\.?|A\.?D\.?)/i,abbreviated:/^(紀元[前後]|西暦)/i,wide:/^(紀元[前後]|西暦)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^B/i,/^A/i],any:[/^(紀元前)/i,/^(西暦|紀元後)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^Q[1234]/i,wide:/^第[1234一二三四1234]四半期/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一|1)/i,/(2|二|2)/i,/(3|三|3)/i,/(4|四|4)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^([123456789]|1[012])/,abbreviated:/^([123456789]|1[012])月/i,wide:/^([123456789]|1[012])月/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1\D/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[日月火水木金土]/,short:/^[日月火水木金土]/,abbreviated:/^[日月火水木金土]/,wide:/^[日月火水木金土]曜日/},defaultMatchWidth:"wide",parsePatterns:{any:[/^日/,/^月/,/^火/,/^水/,/^木/,/^金/,/^土/]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(AM|PM|午前|午後|正午|深夜|真夜中|夜|朝)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(A|午前)/i,pm:/^(P|午後)/i,midnight:/^深夜|真夜中/i,noon:/^正午/i,morning:/^朝/i,afternoon:/^午後/i,evening:/^夜/i,night:/^深夜/i}},defaultParseWidth:"any"})};function od(e,t){if(void 0!==e.one&&1===t)return e.one;var i=t%10,n=t%100;return 1===i&&11!==n?e.singularNominative.replace("{{count}}",t):i>=2&&i<=4&&(n<10||n>20)?e.singularGenitive.replace("{{count}}",t):e.pluralGenitive.replace("{{count}}",t)}function oc(e){return function(t,i){if(!i.addSuffix)return od(e.regular,t);if(i.comparison>0)if(e.future)return od(e.future,t);else return od(e.regular,t)+" кейін";return e.past?od(e.past,t):od(e.regular,t)+" бұрын"}}var ou={lessThanXSeconds:oc({regular:{one:"1 секундтан аз",singularNominative:"{{count}} секундтан аз",singularGenitive:"{{count}} секундтан аз",pluralGenitive:"{{count}} секундтан аз"},future:{one:"бір секундтан кейін",singularNominative:"{{count}} секундтан кейін",singularGenitive:"{{count}} секундтан кейін",pluralGenitive:"{{count}} секундтан кейін"}}),xSeconds:oc({regular:{singularNominative:"{{count}} секунд",singularGenitive:"{{count}} секунд",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунд бұрын",singularGenitive:"{{count}} секунд бұрын",pluralGenitive:"{{count}} секунд бұрын"},future:{singularNominative:"{{count}} секундтан кейін",singularGenitive:"{{count}} секундтан кейін",pluralGenitive:"{{count}} секундтан кейін"}}),halfAMinute:function(e,t){if(t.addSuffix)if(t.comparison>0)return"жарты минут ішінде";else return"жарты минут бұрын";return"жарты минут"},lessThanXMinutes:oc({regular:{one:"1 минуттан аз",singularNominative:"{{count}} минуттан аз",singularGenitive:"{{count}} минуттан аз",pluralGenitive:"{{count}} минуттан аз"},future:{one:"минуттан кем ",singularNominative:"{{count}} минуттан кем",singularGenitive:"{{count}} минуттан кем",pluralGenitive:"{{count}} минуттан кем"}}),xMinutes:oc({regular:{singularNominative:"{{count}} минут",singularGenitive:"{{count}} минут",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минут бұрын",singularGenitive:"{{count}} минут бұрын",pluralGenitive:"{{count}} минут бұрын"},future:{singularNominative:"{{count}} минуттан кейін",singularGenitive:"{{count}} минуттан кейін",pluralGenitive:"{{count}} минуттан кейін"}}),aboutXHours:oc({regular:{singularNominative:"шамамен {{count}} сағат",singularGenitive:"шамамен {{count}} сағат",pluralGenitive:"шамамен {{count}} сағат"},future:{singularNominative:"шамамен {{count}} сағаттан кейін",singularGenitive:"шамамен {{count}} сағаттан кейін",pluralGenitive:"шамамен {{count}} сағаттан кейін"}}),xHours:oc({regular:{singularNominative:"{{count}} сағат",singularGenitive:"{{count}} сағат",pluralGenitive:"{{count}} сағат"}}),xDays:oc({regular:{singularNominative:"{{count}} күн",singularGenitive:"{{count}} күн",pluralGenitive:"{{count}} күн"},future:{singularNominative:"{{count}} күннен кейін",singularGenitive:"{{count}} күннен кейін",pluralGenitive:"{{count}} күннен кейін"}}),aboutXWeeks:{one:"шамамен 1 апта",other:"шамамен {{count}} апта"},xWeeks:{one:"1 апта",other:"{{count}} апта"},aboutXMonths:oc({regular:{singularNominative:"шамамен {{count}} ай",singularGenitive:"шамамен {{count}} ай",pluralGenitive:"шамамен {{count}} ай"},future:{singularNominative:"шамамен {{count}} айдан кейін",singularGenitive:"шамамен {{count}} айдан кейін",pluralGenitive:"шамамен {{count}} айдан кейін"}}),xMonths:oc({regular:{singularNominative:"{{count}} ай",singularGenitive:"{{count}} ай",pluralGenitive:"{{count}} ай"}}),aboutXYears:oc({regular:{singularNominative:"шамамен {{count}} жыл",singularGenitive:"шамамен {{count}} жыл",pluralGenitive:"шамамен {{count}} жыл"},future:{singularNominative:"шамамен {{count}} жылдан кейін",singularGenitive:"шамамен {{count}} жылдан кейін",pluralGenitive:"шамамен {{count}} жылдан кейін"}}),xYears:oc({regular:{singularNominative:"{{count}} жыл",singularGenitive:"{{count}} жыл",pluralGenitive:"{{count}} жыл"},future:{singularNominative:"{{count}} жылдан кейін",singularGenitive:"{{count}} жылдан кейін",pluralGenitive:"{{count}} жылдан кейін"}}),overXYears:oc({regular:{singularNominative:"{{count}} жылдан астам",singularGenitive:"{{count}} жылдан астам",pluralGenitive:"{{count}} жылдан астам"},future:{singularNominative:"{{count}} жылдан астам",singularGenitive:"{{count}} жылдан астам",pluralGenitive:"{{count}} жылдан астам"}}),almostXYears:oc({regular:{singularNominative:"{{count}} жылға жақын",singularGenitive:"{{count}} жылға жақын",pluralGenitive:"{{count}} жылға жақын"},future:{singularNominative:"{{count}} жылдан кейін",singularGenitive:"{{count}} жылдан кейін",pluralGenitive:"{{count}} жылдан кейін"}})},op={date:(0,n$.default)({formats:{full:"EEEE, do MMMM y 'ж.'",long:"do MMMM y 'ж.'",medium:"d MMM y 'ж.'",short:"dd.MM.yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{any:"{{date}}, {{time}}"},defaultWidth:"any"})},oh=["жексенбіде","дүйсенбіде","сейсенбіде","сәрсенбіде","бейсенбіде","жұмада","сенбіде"];function om(e){return"'"+oh[e]+" сағат' p'-де'"}var og={lastWeek:function(e,t,i){var n=e.getUTCDay();return n8(e,t,i)?om(n):"'өткен "+oh[n]+" сағат' p'-де'"},yesterday:"'кеше сағат' p'-де'",today:"'бүгін сағат' p'-де'",tomorrow:"'ертең сағат' p'-де'",nextWeek:function(e,t,i){var n=e.getUTCDay();return n8(e,t,i)?om(n):"'келесі "+oh[n]+" сағат' p'-де'"},other:"P"},of={0:"-ші",1:"-ші",2:"-ші",3:"-ші",4:"-ші",5:"-ші",6:"-шы",7:"-ші",8:"-ші",9:"-шы",10:"-шы",20:"-шы",30:"-шы",40:"-шы",50:"-ші",60:"-шы",70:"-ші",80:"-ші",90:"-шы",100:"-ші"},ob={ordinalNumber:function(e){var t=Number(e);return t+(of[t]||of[t%10]||of[t>=100?100:null])},era:(0,nq.default)({values:{narrow:["б.з.д.","б.з."],abbreviated:["б.з.д.","б.з."],wide:["біздің заманымызға дейін","біздің заманымыз"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1-ші тоқ.","2-ші тоқ.","3-ші тоқ.","4-ші тоқ."],wide:["1-ші тоқсан","2-ші тоқсан","3-ші тоқсан","4-ші тоқсан"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["Қ","А","Н","С","М","М","Ш","Т","Қ","Қ","Қ","Ж"],abbreviated:["қаң","ақп","нау","сәу","мам","мау","шіл","там","қыр","қаз","қар","жел"],wide:["қаңтар","ақпан","наурыз","сәуір","мамыр","маусым","шілде","тамыз","қыркүйек","қазан","қараша","желтоқсан"]},defaultWidth:"wide",formattingValues:{narrow:["Қ","А","Н","С","М","М","Ш","Т","Қ","Қ","Қ","Ж"],abbreviated:["қаң","ақп","нау","сәу","мам","мау","шіл","там","қыр","қаз","қар","жел"],wide:["қаңтар","ақпан","наурыз","сәуір","мамыр","маусым","шілде","тамыз","қыркүйек","қазан","қараша","желтоқсан"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Ж","Д","С","С","Б","Ж","С"],short:["жс","дс","сс","ср","бс","жм","сб"],abbreviated:["жс","дс","сс","ср","бс","жм","сб"],wide:["жексенбі","дүйсенбі","сейсенбі","сәрсенбі","бейсенбі","жұма","сенбі"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ТД",pm:"ТК",midnight:"түн ортасы",noon:"түс",morning:"таң",afternoon:"күндіз",evening:"кеш",night:"түн"},wide:{am:"ТД",pm:"ТК",midnight:"түн ортасы",noon:"түс",morning:"таң",afternoon:"күндіз",evening:"кеш",night:"түн"}},defaultWidth:"any",formattingValues:{narrow:{am:"ТД",pm:"ТК",midnight:"түн ортасында",noon:"түс",morning:"таң",afternoon:"күн",evening:"кеш",night:"түн"},wide:{am:"ТД",pm:"ТК",midnight:"түн ортасында",noon:"түсте",morning:"таңертең",afternoon:"күндіз",evening:"кеште",night:"түнде"}},defaultFormattingWidth:"wide"})},ox={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-?(ші|шы))?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^((б )?з\.?\s?д\.?)/i,abbreviated:/^((б )?з\.?\s?д\.?)/i,wide:/^(біздің заманымызға дейін|біздің заманымыз|біздің заманымыздан)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^б/i,/^з/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?ші)? тоқ.?/i,wide:/^[1234](-?ші)? тоқсан/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(қ|а|н|с|м|мау|ш|т|қыр|қаз|қар|ж)/i,abbreviated:/^(қаң|ақп|нау|сәу|мам|мау|шіл|там|қыр|қаз|қар|жел)/i,wide:/^(қаңтар|ақпан|наурыз|сәуір|мамыр|маусым|шілде|тамыз|қыркүйек|қазан|қараша|желтоқсан)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^қ/i,/^а/i,/^н/i,/^с/i,/^м/i,/^м/i,/^ш/i,/^т/i,/^қ/i,/^қ/i,/^қ/i,/^ж/i],abbreviated:[/^қаң/i,/^ақп/i,/^нау/i,/^сәу/i,/^мам/i,/^мау/i,/^шіл/i,/^там/i,/^қыр/i,/^қаз/i,/^қар/i,/^жел/i],any:[/^қ/i,/^а/i,/^н/i,/^с/i,/^м/i,/^м/i,/^ш/i,/^т/i,/^қ/i,/^қ/i,/^қ/i,/^ж/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(ж|д|с|с|б|ж|с)/i,short:/^(жс|дс|сс|ср|бс|жм|сб)/i,wide:/^(жексенбі|дүйсенбі|сейсенбі|сәрсенбі|бейсенбі|жұма|сенбі)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ж/i,/^д/i,/^с/i,/^с/i,/^б/i,/^ж/i,/^с/i],short:[/^жс/i,/^дс/i,/^сс/i,/^ср/i,/^бс/i,/^жм/i,/^сб/i],any:[/^ж[ек]/i,/^д[үй]/i,/^сe[й]/i,/^сә[р]/i,/^б[ей]/i,/^ж[ұм]/i,/^се[н]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,wide:/^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i,any:/^Т\.?\s?[ДК]\.?|түн ортасында|((түсте|таңертең|таңда|таңертең|таңмен|таң|күндіз|күн|кеште|кеш|түнде|түн)\.?)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^ТД/i,pm:/^ТК/i,midnight:/^түн орта/i,noon:/^күндіз/i,morning:/таң/i,afternoon:/түс/i,evening:/кеш/i,night:/түн/i}},defaultParseWidth:"any"})},oy={lessThanXSeconds:{one:{default:"1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",future:"1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",past:"1 ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ"},other:{default:"{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",future:"{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ",past:"{{count}} ಸೆಕೆಂಡ್‌ಗಿಂತ ಕಡಿಮೆ"}},xSeconds:{one:{default:"1 ಸೆಕೆಂಡ್",future:"1 ಸೆಕೆಂಡ್‌ನಲ್ಲಿ",past:"1 ಸೆಕೆಂಡ್ ಹಿಂದೆ"},other:{default:"{{count}} ಸೆಕೆಂಡುಗಳು",future:"{{count}} ಸೆಕೆಂಡ್‌ಗಳಲ್ಲಿ",past:"{{count}} ಸೆಕೆಂಡ್ ಹಿಂದೆ"}},halfAMinute:{other:{default:"ಅರ್ಧ ನಿಮಿಷ",future:"ಅರ್ಧ ನಿಮಿಷದಲ್ಲಿ",past:"ಅರ್ಧ ನಿಮಿಷದ ಹಿಂದೆ"}},lessThanXMinutes:{one:{default:"1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",future:"1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",past:"1 ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ"},other:{default:"{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",future:"{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ",past:"{{count}} ನಿಮಿಷಕ್ಕಿಂತ ಕಡಿಮೆ"}},xMinutes:{one:{default:"1 ನಿಮಿಷ",future:"1 ನಿಮಿಷದಲ್ಲಿ",past:"1 ನಿಮಿಷದ ಹಿಂದೆ"},other:{default:"{{count}} ನಿಮಿಷಗಳು",future:"{{count}} ನಿಮಿಷಗಳಲ್ಲಿ",past:"{{count}} ನಿಮಿಷಗಳ ಹಿಂದೆ"}},aboutXHours:{one:{default:"ಸುಮಾರು 1 ಗಂಟೆ",future:"ಸುಮಾರು 1 ಗಂಟೆಯಲ್ಲಿ",past:"ಸುಮಾರು 1 ಗಂಟೆ ಹಿಂದೆ"},other:{default:"ಸುಮಾರು {{count}} ಗಂಟೆಗಳು",future:"ಸುಮಾರು {{count}} ಗಂಟೆಗಳಲ್ಲಿ",past:"ಸುಮಾರು {{count}} ಗಂಟೆಗಳ ಹಿಂದೆ"}},xHours:{one:{default:"1 ಗಂಟೆ",future:"1 ಗಂಟೆಯಲ್ಲಿ",past:"1 ಗಂಟೆ ಹಿಂದೆ"},other:{default:"{{count}} ಗಂಟೆಗಳು",future:"{{count}} ಗಂಟೆಗಳಲ್ಲಿ",past:"{{count}} ಗಂಟೆಗಳ ಹಿಂದೆ"}},xDays:{one:{default:"1 ದಿನ",future:"1 ದಿನದಲ್ಲಿ",past:"1 ದಿನದ ಹಿಂದೆ"},other:{default:"{{count}} ದಿನಗಳು",future:"{{count}} ದಿನಗಳಲ್ಲಿ",past:"{{count}} ದಿನಗಳ ಹಿಂದೆ"}},aboutXMonths:{one:{default:"ಸುಮಾರು 1 ತಿಂಗಳು",future:"ಸುಮಾರು 1 ತಿಂಗಳಲ್ಲಿ",past:"ಸುಮಾರು 1 ತಿಂಗಳ ಹಿಂದೆ"},other:{default:"ಸುಮಾರು {{count}} ತಿಂಗಳು",future:"ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳಲ್ಲಿ",past:"ಸುಮಾರು {{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ"}},xMonths:{one:{default:"1 ತಿಂಗಳು",future:"1 ತಿಂಗಳಲ್ಲಿ",past:"1 ತಿಂಗಳ ಹಿಂದೆ"},other:{default:"{{count}} ತಿಂಗಳು",future:"{{count}} ತಿಂಗಳುಗಳಲ್ಲಿ",past:"{{count}} ತಿಂಗಳುಗಳ ಹಿಂದೆ"}},aboutXYears:{one:{default:"ಸುಮಾರು 1 ವರ್ಷ",future:"ಸುಮಾರು 1 ವರ್ಷದಲ್ಲಿ",past:"ಸುಮಾರು 1 ವರ್ಷದ ಹಿಂದೆ"},other:{default:"ಸುಮಾರು {{count}} ವರ್ಷಗಳು",future:"ಸುಮಾರು {{count}} ವರ್ಷಗಳಲ್ಲಿ",past:"ಸುಮಾರು {{count}} ವರ್ಷಗಳ ಹಿಂದೆ"}},xYears:{one:{default:"1 ವರ್ಷ",future:"1 ವರ್ಷದಲ್ಲಿ",past:"1 ವರ್ಷದ ಹಿಂದೆ"},other:{default:"{{count}} ವರ್ಷಗಳು",future:"{{count}} ವರ್ಷಗಳಲ್ಲಿ",past:"{{count}} ವರ್ಷಗಳ ಹಿಂದೆ"}},overXYears:{one:{default:"1 ವರ್ಷದ ಮೇಲೆ",future:"1 ವರ್ಷದ ಮೇಲೆ",past:"1 ವರ್ಷದ ಮೇಲೆ"},other:{default:"{{count}} ವರ್ಷಗಳ ಮೇಲೆ",future:"{{count}} ವರ್ಷಗಳ ಮೇಲೆ",past:"{{count}} ವರ್ಷಗಳ ಮೇಲೆ"}},almostXYears:{one:{default:"ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ",future:"ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ",past:"ಬಹುತೇಕ 1 ವರ್ಷದಲ್ಲಿ"},other:{default:"ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ",future:"ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ",past:"ಬಹುತೇಕ {{count}} ವರ್ಷಗಳಲ್ಲಿ"}}};function ov(e,t){if(t.addSuffix)if(t.comparison>0)return e.future;else return e.past;return e.default}var oC={date:(0,n$.default)({formats:{full:"EEEE, MMMM d, y",long:"MMMM d, y",medium:"MMM d, y",short:"d/M/yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"hh:mm:ss a zzzz",long:"hh:mm:ss a z",medium:"hh:mm:ss a",short:"hh:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},ow={lastWeek:"'ಕಳೆದ' eeee p 'ಕ್ಕೆ'",yesterday:"'ನಿನ್ನೆ' p 'ಕ್ಕೆ'",today:"'ಇಂದು' p 'ಕ್ಕೆ'",tomorrow:"'ನಾಳೆ' p 'ಕ್ಕೆ'",nextWeek:"eeee p 'ಕ್ಕೆ'",other:"P"},oS={ordinalNumber:function(e,t){return Number(e)+"ನೇ"},era:(0,nq.default)({values:{narrow:["ಕ್ರಿ.ಪೂ","ಕ್ರಿ.ಶ"],abbreviated:["ಕ್ರಿ.ಪೂ","ಕ್ರಿ.ಶ"],wide:["ಕ್ರಿಸ್ತ ಪೂರ್ವ","ಕ್ರಿಸ್ತ ಶಕ"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["ತ್ರೈ 1","ತ್ರೈ 2","ತ್ರೈ 3","ತ್ರೈ 4"],wide:["1ನೇ ತ್ರೈಮಾಸಿಕ","2ನೇ ತ್ರೈಮಾಸಿಕ","3ನೇ ತ್ರೈಮಾಸಿಕ","4ನೇ ತ್ರೈಮಾಸಿಕ"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ಜ","ಫೆ","ಮಾ","ಏ","ಮೇ","ಜೂ","ಜು","ಆ","ಸೆ","ಅ","ನ","ಡಿ"],abbreviated:["ಜನ","ಫೆಬ್ರ","ಮಾರ್ಚ್","ಏಪ್ರಿ","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗ","ಸೆಪ್ಟೆಂ","ಅಕ್ಟೋ","ನವೆಂ","ಡಿಸೆಂ"],wide:["ಜನವರಿ","ಫೆಬ್ರವರಿ","ಮಾರ್ಚ್","ಏಪ್ರಿಲ್","ಮೇ","ಜೂನ್","ಜುಲೈ","ಆಗಸ್ಟ್","ಸೆಪ್ಟೆಂಬರ್","ಅಕ್ಟೋಬರ್","ನವೆಂಬರ್","ಡಿಸೆಂಬರ್"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ಭಾ","ಸೋ","ಮಂ","ಬು","ಗು","ಶು","ಶ"],short:["ಭಾನು","ಸೋಮ","ಮಂಗಳ","ಬುಧ","ಗುರು","ಶುಕ್ರ","ಶನಿ"],abbreviated:["ಭಾನು","ಸೋಮ","ಮಂಗಳ","ಬುಧ","ಗುರು","ಶುಕ್ರ","ಶನಿ"],wide:["ಭಾನುವಾರ","ಸೋಮವಾರ","ಮಂಗಳವಾರ","ಬುಧವಾರ","ಗುರುವಾರ","ಶುಕ್ರವಾರ","ಶನಿವಾರ"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ಪೂರ್ವಾಹ್ನ",pm:"ಅಪರಾಹ್ನ",midnight:"ಮಧ್ಯರಾತ್ರಿ",noon:"ಮಧ್ಯಾಹ್ನ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾಹ್ನ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"},abbreviated:{am:"ಪೂರ್ವಾಹ್ನ",pm:"ಅಪರಾಹ್ನ",midnight:"ಮಧ್ಯರಾತ್ರಿ",noon:"ಮಧ್ಯಾನ್ಹ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾನ್ಹ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"},wide:{am:"ಪೂರ್ವಾಹ್ನ",pm:"ಅಪರಾಹ್ನ",midnight:"ಮಧ್ಯರಾತ್ರಿ",noon:"ಮಧ್ಯಾನ್ಹ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾನ್ಹ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"}},defaultWidth:"wide",formattingValues:{narrow:{am:"ಪೂ",pm:"ಅ",midnight:"ಮಧ್ಯರಾತ್ರಿ",noon:"ಮಧ್ಯಾನ್ಹ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾನ್ಹ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"},abbreviated:{am:"ಪೂರ್ವಾಹ್ನ",pm:"ಅಪರಾಹ್ನ",midnight:"ಮಧ್ಯ ರಾತ್ರಿ",noon:"ಮಧ್ಯಾನ್ಹ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾನ್ಹ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"},wide:{am:"ಪೂರ್ವಾಹ್ನ",pm:"ಅಪರಾಹ್ನ",midnight:"ಮಧ್ಯ ರಾತ್ರಿ",noon:"ಮಧ್ಯಾನ್ಹ",morning:"ಬೆಳಗ್ಗೆ",afternoon:"ಮಧ್ಯಾನ್ಹ",evening:"ಸಂಜೆ",night:"ರಾತ್ರಿ"}},defaultFormattingWidth:"wide"})},ok={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(ನೇ|ನೆ)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ಕ್ರಿ.ಪೂ|ಕ್ರಿ.ಶ)/i,abbreviated:/^(ಕ್ರಿ\.?\s?ಪೂ\.?|ಕ್ರಿ\.?\s?ಶ\.?|ಪ್ರ\.?\s?ಶ\.?)/i,wide:/^(ಕ್ರಿಸ್ತ ಪೂರ್ವ|ಕ್ರಿಸ್ತ ಶಕ|ಪ್ರಸಕ್ತ ಶಕ)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ಪೂ/i,/^(ಶ|ಪ್ರ)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^ತ್ರೈ[1234]|ತ್ರೈ [1234]| [1234]ತ್ರೈ/i,wide:/^[1234](ನೇ)? ತ್ರೈಮಾಸಿಕ/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(ಜೂ|ಜು|ಜ|ಫೆ|ಮಾ|ಏ|ಮೇ|ಆ|ಸೆ|ಅ|ನ|ಡಿ)/i,abbreviated:/^(ಜನ|ಫೆಬ್ರ|ಮಾರ್ಚ್|ಏಪ್ರಿ|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗ|ಸೆಪ್ಟೆಂ|ಅಕ್ಟೋ|ನವೆಂ|ಡಿಸೆಂ)/i,wide:/^(ಜನವರಿ|ಫೆಬ್ರವರಿ|ಮಾರ್ಚ್|ಏಪ್ರಿಲ್|ಮೇ|ಜೂನ್|ಜುಲೈ|ಆಗಸ್ಟ್|ಸೆಪ್ಟೆಂಬರ್|ಅಕ್ಟೋಬರ್|ನವೆಂಬರ್|ಡಿಸೆಂಬರ್)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ಜ$/i,/^ಫೆ/i,/^ಮಾ/i,/^ಏ/i,/^ಮೇ/i,/^ಜೂ/i,/^ಜು$/i,/^ಆ/i,/^ಸೆ/i,/^ಅ/i,/^ನ/i,/^ಡಿ/i],any:[/^ಜನ/i,/^ಫೆ/i,/^ಮಾ/i,/^ಏ/i,/^ಮೇ/i,/^ಜೂನ್/i,/^ಜುಲೈ/i,/^ಆ/i,/^ಸೆ/i,/^ಅ/i,/^ನ/i,/^ಡಿ/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(ಭಾ|ಸೋ|ಮ|ಬು|ಗು|ಶು|ಶ)/i,short:/^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,abbreviated:/^(ಭಾನು|ಸೋಮ|ಮಂಗಳ|ಬುಧ|ಗುರು|ಶುಕ್ರ|ಶನಿ)/i,wide:/^(ಭಾನುವಾರ|ಸೋಮವಾರ|ಮಂಗಳವಾರ|ಬುಧವಾರ|ಗುರುವಾರ|ಶುಕ್ರವಾರ|ಶನಿವಾರ)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ಭಾ/i,/^ಸೋ/i,/^ಮ/i,/^ಬು/i,/^ಗು/i,/^ಶು/i,/^ಶ/i],any:[/^ಭಾ/i,/^ಸೋ/i,/^ಮ/i,/^ಬು/i,/^ಗು/i,/^ಶು/i,/^ಶ/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(ಪೂ|ಅ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i,any:/^(ಪೂರ್ವಾಹ್ನ|ಅಪರಾಹ್ನ|ಮಧ್ಯರಾತ್ರಿ|ಮಧ್ಯಾನ್ಹ|ಬೆಳಗ್ಗೆ|ಸಂಜೆ|ರಾತ್ರಿ)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^ಪೂ/i,pm:/^ಅ/i,midnight:/ಮಧ್ಯರಾತ್ರಿ/i,noon:/ಮಧ್ಯಾನ್ಹ/i,morning:/ಬೆಳಗ್ಗೆ/i,afternoon:/ಮಧ್ಯಾನ್ಹ/i,evening:/ಸಂಜೆ/i,night:/ರಾತ್ರಿ/i}},defaultParseWidth:"any"})},oA={lessThanXSeconds:{one:"1초 미만",other:"{{count}}초 미만"},xSeconds:{one:"1초",other:"{{count}}초"},halfAMinute:"30초",lessThanXMinutes:{one:"1분 미만",other:"{{count}}분 미만"},xMinutes:{one:"1분",other:"{{count}}분"},aboutXHours:{one:"약 1시간",other:"약 {{count}}시간"},xHours:{one:"1시간",other:"{{count}}시간"},xDays:{one:"1일",other:"{{count}}일"},aboutXWeeks:{one:"약 1주",other:"약 {{count}}주"},xWeeks:{one:"1주",other:"{{count}}주"},aboutXMonths:{one:"약 1개월",other:"약 {{count}}개월"},xMonths:{one:"1개월",other:"{{count}}개월"},aboutXYears:{one:"약 1년",other:"약 {{count}}년"},xYears:{one:"1년",other:"{{count}}년"},overXYears:{one:"1년 이상",other:"{{count}}년 이상"},almostXYears:{one:"거의 1년",other:"거의 {{count}}년"}},oE={date:(0,n$.default)({formats:{full:"y년 M월 d일 EEEE",long:"y년 M월 d일",medium:"y.MM.dd",short:"y.MM.dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"a H시 mm분 ss초 zzzz",long:"a H:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},o_={lastWeek:"'지난' eeee p",yesterday:"'어제' p",today:"'오늘' p",tomorrow:"'내일' p",nextWeek:"'다음' eeee p",other:"P"},oI={ordinalNumber:function(e,t){var i=Number(e);switch(String((t||{}).unit)){case"minute":case"second":return i;case"date":return i+"일";default:return i+"번째"}},era:(0,nq.default)({values:{narrow:["BC","AD"],abbreviated:["BC","AD"],wide:["기원전","서기"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1분기","2분기","3분기","4분기"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],wide:["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["일","월","화","수","목","금","토"],short:["일","월","화","수","목","금","토"],abbreviated:["일","월","화","수","목","금","토"],wide:["일요일","월요일","화요일","수요일","목요일","금요일","토요일"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},defaultWidth:"wide",formattingValues:{narrow:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},abbreviated:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"},wide:{am:"오전",pm:"오후",midnight:"자정",noon:"정오",morning:"아침",afternoon:"오후",evening:"저녁",night:"밤"}},defaultFormattingWidth:"wide"})},oM={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(일|번째)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(기원전|서기)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(bc|기원전)/i,/^(ad|서기)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]사?분기/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(1[012]|[123456789])/,abbreviated:/^(1[012]|[123456789])월/i,wide:/^(1[012]|[123456789])월/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^1월?$/,/^2/,/^3/,/^4/,/^5/,/^6/,/^7/,/^8/,/^9/,/^10/,/^11/,/^12/]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[일월화수목금토]/,short:/^[일월화수목금토]/,abbreviated:/^[일월화수목금토]/,wide:/^[일월화수목금토]요일/},defaultMatchWidth:"wide",parsePatterns:{any:[/^일/,/^월/,/^화/,/^수/,/^목/,/^금/,/^토/]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(am|pm|오전|오후|자정|정오|아침|저녁|밤)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(am|오전)/i,pm:/^(pm|오후)/i,midnight:/^자정/i,noon:/^정오/i,morning:/^아침/i,afternoon:/^오후/i,evening:/^저녁/i,night:/^밤/i}},defaultParseWidth:"any"})},oT={lessThanXSeconds:{one:oj,other:oR},xSeconds:{one:oj,other:oR},halfAMinute:"pusė minutės",lessThanXMinutes:{one:oP,other:oR},xMinutes:{one:oP,other:oR},aboutXHours:{one:oP,other:oR},xHours:{one:oP,other:oR},xDays:{one:oP,other:oR},aboutWeeks:{one:oP,other:oR},xWeeks:{one:oP,other:oR},aboutXMonths:{one:oP,other:oR},xMonths:{one:oP,other:oR},aboutXYears:{one:oP,other:oR},xYears:{one:oP,other:oR},overXYears:{one:oP,other:oR},almostXYears:{one:oP,other:oR}},oL={xseconds_other:"sekundė_sekundžių_sekundes",xminutes_one:"minutė_minutės_minutę",xminutes_other:"minutės_minučių_minutes",xhours_one:"valanda_valandos_valandą",xhours_other:"valandos_valandų_valandas",xdays_one:"diena_dienos_dieną",xdays_other:"dienos_dienų_dienas",xweeks_one:"savaitė_savaitės_savaitę",xweeks_other:"savaitės_savaičių_savaites",xmonths_one:"mėnuo_mėnesio_mėnesį",xmonths_other:"mėnesiai_mėnesių_mėnesius",xyears_one:"metai_metų_metus",xyears_other:"metai_metų_metus",about:"apie",over:"daugiau nei",almost:"beveik",lessthan:"mažiau nei"};function oj(e,t,i,n){return t?n?"kelių sekundžių":"kelias sekundes":"kelios sekundės"}function oP(e,t,i,n){return t?n?oN(i)[1]:oN(i)[2]:oN(i)[0]}function oD(e){return e%10==0||e>10&&e<20}function oN(e){return oL[e].split("_")}function oR(e,t,i,n){var a=e+" ";return 1===e?a+oP(e,t,i[0],n):t?n?a+oN(i)[1]:a+(oD(e)?oN(i)[1]:oN(i)[2]):a+(oD(e)?oN(i)[1]:oN(i)[0])}var oO={date:(0,n$.default)({formats:{full:"y 'm'. MMMM d 'd'., EEEE",long:"y 'm'. MMMM d 'd'.",medium:"y-MM-dd",short:"y-MM-dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},oB={lastWeek:"'Praėjusį' eeee p",yesterday:"'Vakar' p",today:"'Šiandien' p",tomorrow:"'Rytoj' p",nextWeek:"eeee p",other:"P"};let oz={code:"lt",formatDistance:function(e,t,i){i=i||{};var n,a=e.match(/about|over|almost|lessthan/i),r=e.replace(a,"");if(n="string"==typeof oT[e]?oT[e]:1===t?oT[e].one(t,i.addSuffix,r.toLowerCase()+"_one"):oT[e].other(t,i.addSuffix,r.toLowerCase()+"_other"),a&&(n=oL[a[0].toLowerCase()]+" "+n),i.addSuffix)if(i.comparison>0)return"po "+n;else return"prieš "+n;return n},formatLong:oO,formatRelative:function(e,t,i,n){return oB[e]},localize:{ordinalNumber:function(e,t){return Number(e)+"-oji"},era:(0,nq.default)({values:{narrow:["pr. Kr.","po Kr."],abbreviated:["pr. Kr.","po Kr."],wide:["prieš Kristų","po Kristaus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["I ketv.","II ketv.","III ketv.","IV ketv."],wide:["I ketvirtis","II ketvirtis","III ketvirtis","IV ketvirtis"]},defaultWidth:"wide",formattingValues:{narrow:["1","2","3","4"],abbreviated:["I k.","II k.","III k.","IV k."],wide:["I ketvirtis","II ketvirtis","III ketvirtis","IV ketvirtis"]},defaultFormattingWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["S","V","K","B","G","B","L","R","R","S","L","G"],abbreviated:["saus.","vas.","kov.","bal.","geg.","birž.","liep.","rugp.","rugs.","spal.","lapkr.","gruod."],wide:["sausis","vasaris","kovas","balandis","gegužė","birželis","liepa","rugpjūtis","rugsėjis","spalis","lapkritis","gruodis"]},defaultWidth:"wide",formattingValues:{narrow:["S","V","K","B","G","B","L","R","R","S","L","G"],abbreviated:["saus.","vas.","kov.","bal.","geg.","birž.","liep.","rugp.","rugs.","spal.","lapkr.","gruod."],wide:["sausio","vasario","kovo","balandžio","gegužės","birželio","liepos","rugpjūčio","rugsėjo","spalio","lapkričio","gruodžio"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","P","A","T","K","P","Š"],short:["Sk","Pr","An","Tr","Kt","Pn","Št"],abbreviated:["sk","pr","an","tr","kt","pn","št"],wide:["sekmadienis","pirmadienis","antradienis","trečiadienis","ketvirtadienis","penktadienis","šeštadienis"]},defaultWidth:"wide",formattingValues:{narrow:["S","P","A","T","K","P","Š"],short:["Sk","Pr","An","Tr","Kt","Pn","Št"],abbreviated:["sk","pr","an","tr","kt","pn","št"],wide:["sekmadienį","pirmadienį","antradienį","trečiadienį","ketvirtadienį","penktadienį","šeštadienį"]},defaultFormattingWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"pr. p.",pm:"pop.",midnight:"vidurnaktis",noon:"vidurdienis",morning:"rytas",afternoon:"diena",evening:"vakaras",night:"naktis"},abbreviated:{am:"priešpiet",pm:"popiet",midnight:"vidurnaktis",noon:"vidurdienis",morning:"rytas",afternoon:"diena",evening:"vakaras",night:"naktis"},wide:{am:"priešpiet",pm:"popiet",midnight:"vidurnaktis",noon:"vidurdienis",morning:"rytas",afternoon:"diena",evening:"vakaras",night:"naktis"}},defaultWidth:"wide",formattingValues:{narrow:{am:"pr. p.",pm:"pop.",midnight:"vidurnaktis",noon:"perpiet",morning:"rytas",afternoon:"popietė",evening:"vakaras",night:"naktis"},abbreviated:{am:"priešpiet",pm:"popiet",midnight:"vidurnaktis",noon:"perpiet",morning:"rytas",afternoon:"popietė",evening:"vakaras",night:"naktis"},wide:{am:"priešpiet",pm:"popiet",midnight:"vidurnaktis",noon:"perpiet",morning:"rytas",afternoon:"popietė",evening:"vakaras",night:"naktis"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-oji)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^p(r|o)\.?\s?(kr\.?|me)/i,abbreviated:/^(pr\.\s?(kr\.|m\.\s?e\.)|po\s?kr\.|mūsų eroje)/i,wide:/^(prieš Kristų|prieš mūsų erą|po Kristaus|mūsų eroje)/i},defaultMatchWidth:"wide",parsePatterns:{wide:[/prieš/i,/(po|mūsų)/i],any:[/^pr/i,/^(po|m)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^([1234])/i,abbreviated:/^(I|II|III|IV)\s?ketv?\.?/i,wide:/^(I|II|III|IV)\s?ketvirtis/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/1/i,/2/i,/3/i,/4/i],any:[/I$/i,/II$/i,/III/i,/IV/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[svkbglr]/i,abbreviated:/^(saus\.|vas\.|kov\.|bal\.|geg\.|birž\.|liep\.|rugp\.|rugs\.|spal\.|lapkr\.|gruod\.)/i,wide:/^(sausi(s|o)|vasari(s|o)|kov(a|o)s|balandž?i(s|o)|gegužės?|birželi(s|o)|liep(a|os)|rugpjū(t|č)i(s|o)|rugsėj(is|o)|spali(s|o)|lapkri(t|č)i(s|o)|gruodž?i(s|o))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^v/i,/^k/i,/^b/i,/^g/i,/^b/i,/^l/i,/^r/i,/^r/i,/^s/i,/^l/i,/^g/i],any:[/^saus/i,/^vas/i,/^kov/i,/^bal/i,/^geg/i,/^birž/i,/^liep/i,/^rugp/i,/^rugs/i,/^spal/i,/^lapkr/i,/^gruod/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[spatkš]/i,short:/^(sk|pr|an|tr|kt|pn|št)/i,abbreviated:/^(sk|pr|an|tr|kt|pn|št)/i,wide:/^(sekmadien(is|į)|pirmadien(is|į)|antradien(is|į)|trečiadien(is|į)|ketvirtadien(is|į)|penktadien(is|į)|šeštadien(is|į))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^p/i,/^a/i,/^t/i,/^k/i,/^p/i,/^š/i],wide:[/^se/i,/^pi/i,/^an/i,/^tr/i,/^ke/i,/^pe/i,/^še/i],any:[/^sk/i,/^pr/i,/^an/i,/^tr/i,/^kt/i,/^pn/i,/^št/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(pr.\s?p.|pop.|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i,any:/^(priešpiet|popiet$|vidurnaktis|(vidurdienis|perpiet)|rytas|(diena|popietė)|vakaras|naktis)/i},defaultMatchWidth:"any",parsePatterns:{narrow:{am:/^pr/i,pm:/^pop./i,midnight:/^vidurnaktis/i,noon:/^(vidurdienis|perp)/i,morning:/rytas/i,afternoon:/(die|popietė)/i,evening:/vakaras/i,night:/naktis/i},any:{am:/^pr/i,pm:/^popiet$/i,midnight:/^vidurnaktis/i,noon:/^(vidurdienis|perp)/i,morning:/rytas/i,afternoon:/(die|popietė)/i,evening:/vakaras/i,night:/naktis/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}};function oF(e){return function(t,i){if(1===t)if(i.addSuffix)return e.one[0].replace("{{time}}",e.one[2]);else return e.one[0].replace("{{time}}",e.one[1]);var n=t%10==1&&t%100!=11;return i.addSuffix?e.other[0].replace("{{time}}",n?e.other[3]:e.other[4]).replace("{{count}}",t):e.other[0].replace("{{time}}",n?e.other[1]:e.other[2]).replace("{{count}}",t)}}var oH={lessThanXSeconds:oF({one:["mazāk par {{time}}","sekundi","sekundi"],other:["mazāk nekā {{count}} {{time}}","sekunde","sekundes","sekundes","sekundēm"]}),xSeconds:oF({one:["1 {{time}}","sekunde","sekundes"],other:["{{count}} {{time}}","sekunde","sekundes","sekundes","sekundēm"]}),halfAMinute:function(e,t){return t.addSuffix?"pusminūtes":"pusminūte"},lessThanXMinutes:oF({one:["mazāk par {{time}}","minūti","minūti"],other:["mazāk nekā {{count}} {{time}}","minūte","minūtes","minūtes","minūtēm"]}),xMinutes:oF({one:["1 {{time}}","minūte","minūtes"],other:["{{count}} {{time}}","minūte","minūtes","minūtes","minūtēm"]}),aboutXHours:oF({one:["apmēram 1 {{time}}","stunda","stundas"],other:["apmēram {{count}} {{time}}","stunda","stundas","stundas","stundām"]}),xHours:oF({one:["1 {{time}}","stunda","stundas"],other:["{{count}} {{time}}","stunda","stundas","stundas","stundām"]}),xDays:oF({one:["1 {{time}}","diena","dienas"],other:["{{count}} {{time}}","diena","dienas","dienas","dienām"]}),aboutXWeeks:oF({one:["apmēram 1 {{time}}","nedēļa","nedēļas"],other:["apmēram {{count}} {{time}}","nedēļa","nedēļu","nedēļas","nedēļām"]}),xWeeks:oF({one:["1 {{time}}","nedēļa","nedēļas"],other:["{{count}} {{time}}","nedēļa","nedēļu","nedēļas","nedēļām"]}),aboutXMonths:oF({one:["apmēram 1 {{time}}","mēnesis","mēneša"],other:["apmēram {{count}} {{time}}","mēnesis","mēneši","mēneša","mēnešiem"]}),xMonths:oF({one:["1 {{time}}","mēnesis","mēneša"],other:["{{count}} {{time}}","mēnesis","mēneši","mēneša","mēnešiem"]}),aboutXYears:oF({one:["apmēram 1 {{time}}","gads","gada"],other:["apmēram {{count}} {{time}}","gads","gadi","gada","gadiem"]}),xYears:oF({one:["1 {{time}}","gads","gada"],other:["{{count}} {{time}}","gads","gadi","gada","gadiem"]}),overXYears:oF({one:["ilgāk par 1 {{time}}","gadu","gadu"],other:["vairāk nekā {{count}} {{time}}","gads","gadi","gada","gadiem"]}),almostXYears:oF({one:["gandrīz 1 {{time}}","gads","gada"],other:["vairāk nekā {{count}} {{time}}","gads","gadi","gada","gadiem"]})},oW={date:(0,n$.default)({formats:{full:"EEEE, y. 'gada' d. MMMM",long:"y. 'gada' d. MMMM",medium:"dd.MM.y.",short:"dd.MM.y."},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'plkst.' {{time}}",long:"{{date}} 'plkst.' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},oU=["svētdienā","pirmdienā","otrdienā","trešdienā","ceturtdienā","piektdienā","sestdienā"],oV={lastWeek:function(e,t,i){return n8(e,t,i)?"eeee 'plkst.' p":"'Pagājušā "+oU[e.getUTCDay()]+" plkst.' p"},yesterday:"'Vakar plkst.' p",today:"'Šodien plkst.' p",tomorrow:"'Rīt plkst.' p",nextWeek:function(e,t,i){return n8(e,t,i)?"eeee 'plkst.' p":"'Nākamajā "+oU[e.getUTCDay()]+" plkst.' p"},other:"P"},oG={ordinalNumber:function(e,t){return e+"."},era:(0,nq.default)({values:{narrow:["p.m.ē","m.ē"],abbreviated:["p. m. ē.","m. ē."],wide:["pirms mūsu ēras","mūsu ērā"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1. cet.","2. cet.","3. cet.","4. cet."],wide:["pirmais ceturksnis","otrais ceturksnis","trešais ceturksnis","ceturtais ceturksnis"]},defaultWidth:"wide",formattingValues:{narrow:["1","2","3","4"],abbreviated:["1. cet.","2. cet.","3. cet.","4. cet."],wide:["pirmajā ceturksnī","otrajā ceturksnī","trešajā ceturksnī","ceturtajā ceturksnī"]},defaultFormattingWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","febr.","marts","apr.","maijs","jūn.","jūl.","aug.","sept.","okt.","nov.","dec."],wide:["janvāris","februāris","marts","aprīlis","maijs","jūnijs","jūlijs","augusts","septembris","oktobris","novembris","decembris"]},defaultWidth:"wide",formattingValues:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["janv.","febr.","martā","apr.","maijs","jūn.","jūl.","aug.","sept.","okt.","nov.","dec."],wide:["janvārī","februārī","martā","aprīlī","maijā","jūnijā","jūlijā","augustā","septembrī","oktobrī","novembrī","decembrī"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","P","O","T","C","P","S"],short:["Sv","P","O","T","C","Pk","S"],abbreviated:["svētd.","pirmd.","otrd.","trešd.","ceturtd.","piektd.","sestd."],wide:["svētdiena","pirmdiena","otrdiena","trešdiena","ceturtdiena","piektdiena","sestdiena"]},defaultWidth:"wide",formattingValues:{narrow:["S","P","O","T","C","P","S"],short:["Sv","P","O","T","C","Pk","S"],abbreviated:["svētd.","pirmd.","otrd.","trešd.","ceturtd.","piektd.","sestd."],wide:["svētdienā","pirmdienā","otrdienā","trešdienā","ceturtdienā","piektdienā","sestdienā"]},defaultFormattingWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"am",pm:"pm",midnight:"pusn.",noon:"pusd.",morning:"rīts",afternoon:"diena",evening:"vakars",night:"nakts"},abbreviated:{am:"am",pm:"pm",midnight:"pusn.",noon:"pusd.",morning:"rīts",afternoon:"pēcpusd.",evening:"vakars",night:"nakts"},wide:{am:"am",pm:"pm",midnight:"pusnakts",noon:"pusdienlaiks",morning:"rīts",afternoon:"pēcpusdiena",evening:"vakars",night:"nakts"}},defaultWidth:"wide",formattingValues:{narrow:{am:"am",pm:"pm",midnight:"pusn.",noon:"pusd.",morning:"rītā",afternoon:"dienā",evening:"vakarā",night:"naktī"},abbreviated:{am:"am",pm:"pm",midnight:"pusn.",noon:"pusd.",morning:"rītā",afternoon:"pēcpusd.",evening:"vakarā",night:"naktī"},wide:{am:"am",pm:"pm",midnight:"pusnaktī",noon:"pusdienlaikā",morning:"rītā",afternoon:"pēcpusdienā",evening:"vakarā",night:"naktī"}},defaultFormattingWidth:"wide"})},o$={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\./i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(p\.m\.ē|m\.ē)/i,abbreviated:/^(p\. m\. ē\.|m\. ē\.)/i,wide:/^(pirms mūsu ēras|mūsu ērā)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^p/i,/^m/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](\. cet\.)/i,wide:/^(pirma(is|jā)|otra(is|jā)|treša(is|jā)|ceturta(is|jā)) ceturksn(is|ī)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^1/i,/^2/i,/^3/i,/^4/i],abbreviated:[/^1/i,/^2/i,/^3/i,/^4/i],wide:[/^p/i,/^o/i,/^t/i,/^c/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(janv\.|febr\.|marts|apr\.|maijs|jūn\.|jūl\.|aug\.|sept\.|okt\.|nov\.|dec\.)/i,wide:/^(janvār(is|ī)|februār(is|ī)|mart[sā]|aprīl(is|ī)|maij[sā]|jūnij[sā]|jūlij[sā]|august[sā]|septembr(is|ī)|oktobr(is|ī)|novembr(is|ī)|decembr(is|ī))/i},defaultMatchWidth:"wide",parsePatterns:{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,/^mai/i,/^jūn/i,/^jūl/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[spotc]/i,short:/^(sv|pi|o|t|c|pk|s)/i,abbreviated:/^(svētd\.|pirmd\.|otrd.\|trešd\.|ceturtd\.|piektd\.|sestd\.)/i,wide:/^(svētdien(a|ā)|pirmdien(a|ā)|otrdien(a|ā)|trešdien(a|ā)|ceturtdien(a|ā)|piektdien(a|ā)|sestdien(a|ā))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^p/i,/^o/i,/^t/i,/^c/i,/^p/i,/^s/i],any:[/^sv/i,/^pi/i,/^o/i,/^t/i,/^c/i,/^p/i,/^se/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(am|pm|pusn\.|pusd\.|rīt(s|ā)|dien(a|ā)|vakar(s|ā)|nakt(s|ī))/,abbreviated:/^(am|pm|pusn\.|pusd\.|rīt(s|ā)|pēcpusd\.|vakar(s|ā)|nakt(s|ī))/,wide:/^(am|pm|pusnakt(s|ī)|pusdienlaik(s|ā)|rīt(s|ā)|pēcpusdien(a|ā)|vakar(s|ā)|nakt(s|ī))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^am/i,pm:/^pm/i,midnight:/^pusn/i,noon:/^pusd/i,morning:/^r/i,afternoon:/^(d|pēc)/i,evening:/^v/i,night:/^n/i}},defaultParseWidth:"any"})},oZ={lessThanXSeconds:{one:"помалку од секунда",other:"помалку од {{count}} секунди"},xSeconds:{one:"1 секунда",other:"{{count}} секунди"},halfAMinute:"половина минута",lessThanXMinutes:{one:"помалку од минута",other:"помалку од {{count}} минути"},xMinutes:{one:"1 минута",other:"{{count}} минути"},aboutXHours:{one:"околу 1 час",other:"околу {{count}} часа"},xHours:{one:"1 час",other:"{{count}} часа"},xDays:{one:"1 ден",other:"{{count}} дена"},aboutXWeeks:{one:"околу 1 недела",other:"околу {{count}} месеци"},xWeeks:{one:"1 недела",other:"{{count}} недели"},aboutXMonths:{one:"околу 1 месец",other:"околу {{count}} недели"},xMonths:{one:"1 месец",other:"{{count}} месеци"},aboutXYears:{one:"околу 1 година",other:"околу {{count}} години"},xYears:{one:"1 година",other:"{{count}} години"},overXYears:{one:"повеќе од 1 година",other:"повеќе од {{count}} години"},almostXYears:{one:"безмалку 1 година",other:"безмалку {{count}} години"}},oK={date:(0,n$.default)({formats:{full:"EEEE, dd MMMM yyyy",long:"dd MMMM yyyy",medium:"dd MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{any:"{{date}} {{time}}"},defaultWidth:"any"})},oq=["недела","понеделник","вторник","среда","четврток","петок","сабота"];function oY(e){var t=oq[e];switch(e){case 0:case 3:case 6:return"'ова "+t+" вo' p";case 1:case 2:case 4:case 5:return"'овој "+t+" вo' p"}}var oX={lastWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return oY(n);var a=oq[n];switch(n){case 0:case 3:case 6:return"'минатата "+a+" во' p";case 1:case 2:case 4:case 5:return"'минатиот "+a+" во' p"}},yesterday:"'вчера во' p",today:"'денес во' p",tomorrow:"'утре во' p",nextWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return oY(n);var a=oq[n];switch(n){case 0:case 3:case 6:return"'следната "+a+" вo' p";case 1:case 2:case 4:case 5:return"'следниот "+a+" вo' p"}},other:"P"},oQ={ordinalNumber:function(e){var t=Number(e),i=t%100;if(i>20||i<10)switch(i%10){case 1:return t+"-ви";case 2:return t+"-ри";case 7:case 8:return t+"-ми"}return t+"-ти"},era:(0,nq.default)({values:{narrow:["пр.н.е.","н.е."],abbreviated:["пред н. е.","н. е."],wide:["пред нашата ера","нашата ера"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1-ви кв.","2-ри кв.","3-ти кв.","4-ти кв."],wide:["1-ви квартал","2-ри квартал","3-ти квартал","4-ти квартал"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{abbreviated:["јан","фев","мар","апр","мај","јун","јул","авг","септ","окт","ноем","дек"],wide:["јануари","февруари","март","април","мај","јуни","јули","август","септември","октомври","ноември","декември"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Н","П","В","С","Ч","П","С"],short:["не","по","вт","ср","че","пе","са"],abbreviated:["нед","пон","вто","сре","чет","пет","саб"],wide:["недела","понеделник","вторник","среда","четврток","петок","сабота"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{wide:{am:"претпладне",pm:"попладне",midnight:"полноќ",noon:"напладне",morning:"наутро",afternoon:"попладне",evening:"навечер",night:"ноќе"}},defaultWidth:"wide"})},oJ={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-?[врмт][и])?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^((пр)?н\.?\s?е\.?)/i,abbreviated:/^((пр)?н\.?\s?е\.?)/i,wide:/^(пред нашата ера|нашата ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^п/i,/^н/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[врт]?и?)? кв.?/i,wide:/^[1234](-?[врт]?и?)? квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{abbreviated:/^(јан|фев|мар|апр|мај|јун|јул|авг|сеп|окт|ноем|дек)/i,wide:/^(јануари|февруари|март|април|мај|јуни|јули|август|септември|октомври|ноември|декември)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ја/i,/^Ф/i,/^мар/i,/^ап/i,/^мај/i,/^јун/i,/^јул/i,/^ав/i,/^се/i,/^окт/i,/^но/i,/^де/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[нпвсч]/i,short:/^(не|по|вт|ср|че|пе|са)/i,abbreviated:/^(нед|пон|вто|сре|чет|пет|саб)/i,wide:/^(недела|понеделник|вторник|среда|четврток|петок|сабота)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н[ед]/i,/^п[он]/i,/^вт/i,/^ср/i,/^ч[ет]/i,/^п[ет]/i,/^с[аб]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(претп|попл|полноќ|утро|пладне|вечер|ноќ)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/претпладне/i,pm:/попладне/i,midnight:/полноќ/i,noon:/напладне/i,morning:/наутро/i,afternoon:/попладне/i,evening:/навечер/i,night:/ноќе/i}},defaultParseWidth:"any"})},o0={lessThanXSeconds:{one:"kurang dari 1 saat",other:"kurang dari {{count}} saat"},xSeconds:{one:"1 saat",other:"{{count}} saat"},halfAMinute:"setengah minit",lessThanXMinutes:{one:"kurang dari 1 minit",other:"kurang dari {{count}} minit"},xMinutes:{one:"1 minit",other:"{{count}} minit"},aboutXHours:{one:"sekitar 1 jam",other:"sekitar {{count}} jam"},xHours:{one:"1 jam",other:"{{count}} jam"},xDays:{one:"1 hari",other:"{{count}} hari"},aboutXWeeks:{one:"sekitar 1 minggu",other:"sekitar {{count}} minggu"},xWeeks:{one:"1 minggu",other:"{{count}} minggu"},aboutXMonths:{one:"sekitar 1 bulan",other:"sekitar {{count}} bulan"},xMonths:{one:"1 bulan",other:"{{count}} bulan"},aboutXYears:{one:"sekitar 1 tahun",other:"sekitar {{count}} tahun"},xYears:{one:"1 tahun",other:"{{count}} tahun"},overXYears:{one:"lebih dari 1 tahun",other:"lebih dari {{count}} tahun"},almostXYears:{one:"hampir 1 tahun",other:"hampir {{count}} tahun"}},o1={date:(0,n$.default)({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"d/M/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH.mm.ss",long:"HH.mm.ss",medium:"HH.mm",short:"HH.mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'pukul' {{time}}",long:"{{date}} 'pukul' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},o2={lastWeek:"eeee 'lepas pada jam' p",yesterday:"'Semalam pada jam' p",today:"'Hari ini pada jam' p",tomorrow:"'Esok pada jam' p",nextWeek:"eeee 'pada jam' p",other:"P"},o3={ordinalNumber:function(e,t){return"ke-"+Number(e)},era:(0,nq.default)({values:{narrow:["SM","M"],abbreviated:["SM","M"],wide:["Sebelum Masihi","Masihi"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["S1","S2","S3","S4"],wide:["Suku pertama","Suku kedua","Suku ketiga","Suku keempat"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","O","S","O","N","D"],abbreviated:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogo","Sep","Okt","Nov","Dis"],wide:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["A","I","S","R","K","J","S"],short:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],abbreviated:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],wide:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"am",pm:"pm",midnight:"tgh malam",noon:"tgh hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"},wide:{am:"a.m.",pm:"p.m.",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"}},defaultWidth:"wide",formattingValues:{narrow:{am:"am",pm:"pm",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"},abbreviated:{am:"AM",pm:"PM",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"},wide:{am:"a.m.",pm:"p.m.",midnight:"tengah malam",noon:"tengah hari",morning:"pagi",afternoon:"tengah hari",evening:"petang",night:"malam"}},defaultFormattingWidth:"wide"})},o5={ordinalNumber:(0,nX.default)({matchPattern:/^ke-(\d+)?/i,parsePattern:/petama|\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(sm|m)/i,abbreviated:/^(s\.?\s?m\.?|m\.?)/i,wide:/^(sebelum masihi|masihi)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^(m)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^S[1234]/i,wide:/Suku (pertama|kedua|ketiga|keempat)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/pertama|1/i,/kedua|2/i,/ketiga|3/i,/keempat|4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mac|apr|mei|jun|jul|ogo|sep|okt|nov|dis)/i,wide:/^(januari|februari|mac|april|mei|jun|julai|ogos|september|oktober|november|disember)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^o/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^ma/i,/^ap/i,/^me/i,/^jun/i,/^jul/i,/^og/i,/^s/i,/^ok/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[aisrkj]/i,short:/^(ahd|isn|sel|rab|kha|jum|sab)/i,abbreviated:/^(ahd|isn|sel|rab|kha|jum|sab)/i,wide:/^(ahad|isnin|selasa|rabu|khamis|jumaat|sabtu)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^a/i,/^i/i,/^s/i,/^r/i,/^k/i,/^j/i,/^s/i],any:[/^a/i,/^i/i,/^se/i,/^r/i,/^k/i,/^j/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(am|pm|tengah malam|tengah hari|pagi|petang|malam)/i,any:/^([ap]\.?\s?m\.?|tengah malam|tengah hari|pagi|petang|malam)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^pm/i,midnight:/^tengah m/i,noon:/^tengah h/i,morning:/pa/i,afternoon:/tengah h/i,evening:/pe/i,night:/m/i}},defaultParseWidth:"any"})},o4={lessThanXSeconds:{singular:"mindre enn ett sekund",plural:"mindre enn {{count}} sekunder"},xSeconds:{singular:"ett sekund",plural:"{{count}} sekunder"},halfAMinute:"et halvt minutt",lessThanXMinutes:{singular:"mindre enn ett minutt",plural:"mindre enn {{count}} minutter"},xMinutes:{singular:"ett minutt",plural:"{{count}} minutter"},aboutXHours:{singular:"omtrent en time",plural:"omtrent {{count}} timer"},xHours:{singular:"en time",plural:"{{count}} timer"},xDays:{singular:"en dag",plural:"{{count}} dager"},aboutXWeeks:{singular:"omtrent en uke",plural:"omtrent {{count}} uker"},xWeeks:{singular:"en uke",plural:"{{count}} uker"},aboutXMonths:{singular:"omtrent en måned",plural:"omtrent {{count}} måneder"},xMonths:{singular:"en måned",plural:"{{count}} måneder"},aboutXYears:{singular:"omtrent ett år",plural:"omtrent {{count}} år"},xYears:{singular:"ett år",plural:"{{count}} år"},overXYears:{singular:"over ett år",plural:"over {{count}} år"},almostXYears:{singular:"nesten ett år",plural:"nesten {{count}} år"}},o6=["null","en","to","tre","fire","fem","seks","sju","åtte","ni","ti","elleve","tolv"],o9={date:(0,n$.default)({formats:{full:"EEEE d. MMMM y",long:"d. MMMM y",medium:"d. MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},o8={lastWeek:"'forrige' eeee 'kl.' p",yesterday:"'i går kl.' p",today:"'i dag kl.' p",tomorrow:"'i morgen kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},o7={ordinalNumber:function(e){return Number(e)+"."},era:(0,nq.default)({values:{narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["før Kristus","etter Kristus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1. kvartal","2. kvartal","3. kvartal","4. kvartal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],wide:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","T","O","T","F","L"],short:["sø","ma","ti","on","to","fr","lø"],abbreviated:["søn","man","tir","ons","tor","fre","lør"],wide:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},abbreviated:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på etterm.",evening:"på kvelden",night:"på natten"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnatt",noon:"middag",morning:"på morgenen",afternoon:"på ettermiddagen",evening:"på kvelden",night:"på natten"}},defaultWidth:"wide"})},se={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\.?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,abbreviated:/^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,wide:/^(før Kristus|før vår tid|etter Kristus|vår tid)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^e/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](\.)? kvartal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,wide:/^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^mai/i,/^jun/i,/^jul/i,/^aug/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sø|ma|ti|on|to|fr|lø)/i,abbreviated:/^(søn|man|tir|ons|tor|fre|lør)/i,wide:/^(søndag|mandag|tirsdag|onsdag|torsdag|fredag|lørdag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten)|[ap])/i,any:/^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgenen|ettermiddagen|kvelden|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a(\.?\s?m\.?)?$/i,pm:/^p(\.?\s?m\.?)?$/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgen/i,afternoon:/ettermiddag/i,evening:/kveld/i,night:/natt/i}},defaultParseWidth:"any"})},st={lessThanXSeconds:{one:"minder dan een seconde",other:"minder dan {{count}} seconden"},xSeconds:{one:"1 seconde",other:"{{count}} seconden"},halfAMinute:"een halve minuut",lessThanXMinutes:{one:"minder dan een minuut",other:"minder dan {{count}} minuten"},xMinutes:{one:"een minuut",other:"{{count}} minuten"},aboutXHours:{one:"ongeveer 1 uur",other:"ongeveer {{count}} uur"},xHours:{one:"1 uur",other:"{{count}} uur"},xDays:{one:"1 dag",other:"{{count}} dagen"},aboutXWeeks:{one:"ongeveer 1 week",other:"ongeveer {{count}} weken"},xWeeks:{one:"1 week",other:"{{count}} weken"},aboutXMonths:{one:"ongeveer 1 maand",other:"ongeveer {{count}} maanden"},xMonths:{one:"1 maand",other:"{{count}} maanden"},aboutXYears:{one:"ongeveer 1 jaar",other:"ongeveer {{count}} jaar"},xYears:{one:"1 jaar",other:"{{count}} jaar"},overXYears:{one:"meer dan 1 jaar",other:"meer dan {{count}} jaar"},almostXYears:{one:"bijna 1 jaar",other:"bijna {{count}} jaar"}},si={date:(0,n$.default)({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"dd-MM-y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'om' {{time}}",long:"{{date}} 'om' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sn={lastWeek:"'afgelopen' eeee 'om' p",yesterday:"'gisteren om' p",today:"'vandaag om' p",tomorrow:"'morgen om' p",nextWeek:"eeee 'om' p",other:"P"},sa={ordinalNumber:function(e){return Number(e)+"e"},era:(0,nq.default)({values:{narrow:["v.C.","n.C."],abbreviated:["v.Chr.","n.Chr."],wide:["voor Christus","na Christus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["K1","K2","K3","K4"],wide:["1e kwartaal","2e kwartaal","3e kwartaal","4e kwartaal"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Z","M","D","W","D","V","Z"],short:["zo","ma","di","wo","do","vr","za"],abbreviated:["zon","maa","din","woe","don","vri","zat"],wide:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},abbreviated:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"},wide:{am:"AM",pm:"PM",midnight:"middernacht",noon:"het middaguur",morning:"'s ochtends",afternoon:"'s middags",evening:"'s avonds",night:"'s nachts"}},defaultWidth:"wide"})},sr={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)e?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^([vn]\.? ?C\.?)/,abbreviated:/^([vn]\. ?Chr\.?)/,wide:/^((voor|na) Christus)/},defaultMatchWidth:"wide",parsePatterns:{any:[/^v/,/^n/]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^K[1234]/i,wide:/^[1234]e kwartaal/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan.|feb.|mrt.|apr.|mei|jun.|jul.|aug.|sep.|okt.|nov.|dec.)/i,wide:/^(januari|februari|maart|april|mei|juni|juli|augustus|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{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:[/^jan/i,/^feb/i,/^m(r|a)/i,/^apr/i,/^mei/i,/^jun/i,/^jul/i,/^aug/i,/^sep/i,/^okt/i,/^nov/i,/^dec/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[zmdwv]/i,short:/^(zo|ma|di|wo|do|vr|za)/i,abbreviated:/^(zon|maa|din|woe|don|vri|zat)/i,wide:/^(zondag|maandag|dinsdag|woensdag|donderdag|vrijdag|zaterdag)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^z/i,/^m/i,/^d/i,/^w/i,/^d/i,/^v/i,/^z/i],any:[/^zo/i,/^ma/i,/^di/i,/^wo/i,/^do/i,/^vr/i,/^za/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(am|pm|middernacht|het middaguur|'s (ochtends|middags|avonds|nachts))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^am/i,pm:/^pm/i,midnight:/^middernacht/i,noon:/^het middaguur/i,morning:/ochtend/i,afternoon:/middag/i,evening:/avond/i,night:/nacht/i}},defaultParseWidth:"any"})};function so(e,t,i){i=i||"regular";var n=function(e,t){if(1===t)return e.one;var i=t%100;if(i<=20&&i>10)return e.other;var n=i%10;return n>=2&&n<=4?e.twoFour:e.other}(e,t);return(n[i]||n).replace("{{count}}",t)}var ss={lessThanXSeconds:{one:{regular:"mniej niż sekunda",past:"mniej niż sekundę",future:"mniej niż sekundę"},twoFour:"mniej niż {{count}} sekundy",other:"mniej niż {{count}} sekund"},xSeconds:{one:{regular:"sekunda",past:"sekundę",future:"sekundę"},twoFour:"{{count}} sekundy",other:"{{count}} sekund"},halfAMinute:{one:"pół minuty",twoFour:"pół minuty",other:"pół minuty"},lessThanXMinutes:{one:{regular:"mniej niż minuta",past:"mniej niż minutę",future:"mniej niż minutę"},twoFour:"mniej niż {{count}} minuty",other:"mniej niż {{count}} minut"},xMinutes:{one:{regular:"minuta",past:"minutę",future:"minutę"},twoFour:"{{count}} minuty",other:"{{count}} minut"},aboutXHours:{one:{regular:"około godziny",past:"około godziny",future:"około godzinę"},twoFour:"około {{count}} godziny",other:"około {{count}} godzin"},xHours:{one:{regular:"godzina",past:"godzinę",future:"godzinę"},twoFour:"{{count}} godziny",other:"{{count}} godzin"},xDays:{one:{regular:"dzień",past:"dzień",future:"1 dzień"},twoFour:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"około tygodnia",twoFour:"około {{count}} tygodni",other:"około {{count}} tygodni"},xWeeks:{one:"tydzień",twoFour:"{{count}} tygodnie",other:"{{count}} tygodni"},aboutXMonths:{one:"około miesiąc",twoFour:"około {{count}} miesiące",other:"około {{count}} miesięcy"},xMonths:{one:"miesiąc",twoFour:"{{count}} miesiące",other:"{{count}} miesięcy"},aboutXYears:{one:"około rok",twoFour:"około {{count}} lata",other:"około {{count}} lat"},xYears:{one:"rok",twoFour:"{{count}} lata",other:"{{count}} lat"},overXYears:{one:"ponad rok",twoFour:"ponad {{count}} lata",other:"ponad {{count}} lat"},almostXYears:{one:"prawie rok",twoFour:"prawie {{count}} lata",other:"prawie {{count}} lat"}},sl={date:(0,n$.default)({formats:{full:"EEEE, do MMMM y",long:"do MMMM y",medium:"do MMM y",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sd={masculine:"ostatni",feminine:"ostatnia"},sc={masculine:"ten",feminine:"ta"},su={masculine:"następny",feminine:"następna"},sp={0:"feminine",1:"masculine",2:"masculine",3:"feminine",4:"masculine",5:"masculine",6:"feminine"};function sh(e,t,i,n){var a,r=(a=t.getUTCDay(),function(e,t,i,n){if(n8(t,i,n))return sc;if("lastWeek"===e)return sd;if("nextWeek"===e)return su;throw Error("Cannot determine adjectives for token ".concat(e))}(e,t,i,n)[sp[a]]);return"'".concat(r,"' eeee 'o' p")}var sm={lastWeek:sh,yesterday:"'wczoraj o' p",today:"'dzisiaj o' p",tomorrow:"'jutro o' p",nextWeek:sh,other:"P"},sg={ordinalNumber:function(e){return String(Number(e))},era:(0,nq.default)({values:{narrow:["p.n.e.","n.e."],abbreviated:["p.n.e.","n.e."],wide:["przed naszą erą","naszej ery"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["I kw.","II kw.","III kw.","IV kw."],wide:["I kwartał","II kwartał","III kwartał","IV kwartał"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["S","L","M","K","M","C","L","S","W","P","L","G"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"]},defaultWidth:"wide",formattingValues:{narrow:["s","l","m","k","m","c","l","s","w","p","l","g"],abbreviated:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru"],wide:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["N","P","W","Ś","C","P","S"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},defaultWidth:"wide",formattingValues:{narrow:["n","p","w","ś","c","p","s"],short:["nie","pon","wto","śro","czw","pią","sob"],abbreviated:["niedz.","pon.","wt.","śr.","czw.","pt.","sob."],wide:["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"]},defaultFormattingWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"półn.",noon:"poł",morning:"rano",afternoon:"popoł.",evening:"wiecz.",night:"noc"},abbreviated:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"},wide:{am:"AM",pm:"PM",midnight:"północ",noon:"południe",morning:"rano",afternoon:"popołudnie",evening:"wieczór",night:"noc"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"o półn.",noon:"w poł.",morning:"rano",afternoon:"po poł.",evening:"wiecz.",night:"w nocy"},abbreviated:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"},wide:{am:"AM",pm:"PM",midnight:"o północy",noon:"w południe",morning:"rano",afternoon:"po południu",evening:"wieczorem",night:"w nocy"}},defaultFormattingWidth:"wide"})},sf={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,abbreviated:/^(p\.?\s*n\.?\s*e\.?\s*|n\.?\s*e\.?\s*)/i,wide:/^(przed\s*nasz(ą|a)\s*er(ą|a)|naszej\s*ery)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^p/i,/^n/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^(I|II|III|IV)\s*kw\.?/i,wide:/^(I|II|III|IV)\s*kwarta(ł|l)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/1/i,/2/i,/3/i,/4/i],any:[/^I kw/i,/^II kw/i,/^III kw/i,/^IV kw/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[slmkcwpg]/i,abbreviated:/^(sty|lut|mar|kwi|maj|cze|lip|sie|wrz|pa(ź|z)|lis|gru)/i,wide:/^(stycznia|stycze(ń|n)|lutego|luty|marca|marzec|kwietnia|kwiecie(ń|n)|maja|maj|czerwca|czerwiec|lipca|lipiec|sierpnia|sierpie(ń|n)|wrze(ś|s)nia|wrzesie(ń|n)|pa(ź|z)dziernika|pa(ź|z)dziernik|listopada|listopad|grudnia|grudzie(ń|n))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^l/i,/^m/i,/^k/i,/^m/i,/^c/i,/^l/i,/^s/i,/^w/i,/^p/i,/^l/i,/^g/i],any:[/^st/i,/^lu/i,/^mar/i,/^k/i,/^maj/i,/^c/i,/^lip/i,/^si/i,/^w/i,/^p/i,/^lis/i,/^g/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[npwścs]/i,short:/^(nie|pon|wto|(ś|s)ro|czw|pi(ą|a)|sob)/i,abbreviated:/^(niedz|pon|wt|(ś|s)r|czw|pt|sob)\.?/i,wide:/^(niedziela|poniedzia(ł|l)ek|wtorek|(ś|s)roda|czwartek|pi(ą|a)tek|sobota)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^n/i,/^p/i,/^w/i,/^ś/i,/^c/i,/^p/i,/^s/i],abbreviated:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pt/i,/^so/i],any:[/^n/i,/^po/i,/^w/i,/^(ś|s)r/i,/^c/i,/^pi/i,/^so/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(^a$|^p$|pó(ł|l)n\.?|o\s*pó(ł|l)n\.?|po(ł|l)\.?|w\s*po(ł|l)\.?|po\s*po(ł|l)\.?|rano|wiecz\.?|noc|w\s*nocy)/i,any:/^(am|pm|pó(ł|l)noc|o\s*pó(ł|l)nocy|po(ł|l)udnie|w\s*po(ł|l)udnie|popo(ł|l)udnie|po\s*po(ł|l)udniu|rano|wieczór|wieczorem|noc|w\s*nocy)/i},defaultMatchWidth:"any",parsePatterns:{narrow:{am:/^a$/i,pm:/^p$/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i},any:{am:/^am/i,pm:/^pm/i,midnight:/pó(ł|l)n/i,noon:/po(ł|l)/i,morning:/rano/i,afternoon:/po\s*po(ł|l)/i,evening:/wiecz/i,night:/noc/i}},defaultParseWidth:"any"})},sb={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"aproximadamente 1 hora",other:"aproximadamente {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"aproximadamente 1 semana",other:"aproximadamente {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"aproximadamente 1 mês",other:"aproximadamente {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"aproximadamente 1 ano",other:"aproximadamente {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},sx={date:(0,n$.default)({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d 'de' MMM 'de' y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sy={lastWeek:"'na última' eeee 'às' p",yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},sv={ordinalNumber:function(e){return Number(e)+"º"},era:(0,nq.default)({values:{narrow:["aC","dC"],abbreviated:["a.C.","d.C."],wide:["antes de Cristo","depois de Cristo"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["d","s","t","q","q","s","s"],short:["dom","seg","ter","qua","qui","sex","sáb"],abbreviated:["dom","seg","ter","qua","qui","sex","sáb"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"noite",night:"madrugada"}},defaultWidth:"wide",formattingValues:{narrow:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"},wide:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da noite",night:"da madrugada"}},defaultFormattingWidth:"wide"})},sC={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(º|ª)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes da era comum|depois de cristo|era comum)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes da era comum)/i,/^(depois de cristo|era comum)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º|ª)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^ab/i,/^mai/i,/^jun/i,/^jul/i,/^ag/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[dstq]/i,short:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[áa]b)/i,wide:/^(domingo|segunda-?\s?feira|terça-?\s?feira|quarta-?\s?feira|quinta-?\s?feira|sexta-?\s?feira|s[áa]bado)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^s/i,/^t/i,/^q/i,/^q/i,/^s/i,/^s/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[áa]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i,any:/^([ap]\.?\s?m\.?|meia-?\s?noite|meio-?\s?dia|(da) (manh[ãa]|tarde|noite|madrugada))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^meia/i,noon:/^meio/i,morning:/manh[ãa]/i,afternoon:/tarde/i,evening:/noite/i,night:/madrugada/i}},defaultParseWidth:"any"})},sw={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},sS={date:(0,n$.default)({formats:{full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'às' {{time}}",long:"{{date}} 'às' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sk={lastWeek:function(e,t,i){var n=e.getUTCDay();return"'"+(0===n||6===n?"último":"última")+"' eeee 'às' p"},yesterday:"'ontem às' p",today:"'hoje às' p",tomorrow:"'amanhã às' p",nextWeek:"eeee 'às' p",other:"P"},sA={ordinalNumber:function(e,t){var i=Number(e),n=String((t||{}).unit);return"week"===n||"isoWeek"===n?i+"ª":i+"º"},era:(0,nq.default)({values:{narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},defaultFormattingWidth:"wide"})},sE={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)[ºªo]?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},defaultMatchWidth:"wide",parsePatterns:{short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},defaultParseWidth:"any"})},s_={lessThanXSeconds:{one:"mai puțin de o secundă",other:"mai puțin de {{count}} secunde"},xSeconds:{one:"1 secundă",other:"{{count}} secunde"},halfAMinute:"jumătate de minut",lessThanXMinutes:{one:"mai puțin de un minut",other:"mai puțin de {{count}} minute"},xMinutes:{one:"1 minut",other:"{{count}} minute"},aboutXHours:{one:"circa 1 oră",other:"circa {{count}} ore"},xHours:{one:"1 oră",other:"{{count}} ore"},xDays:{one:"1 zi",other:"{{count}} zile"},aboutXWeeks:{one:"circa o săptămână",other:"circa {{count}} săptămâni"},xWeeks:{one:"1 săptămână",other:"{{count}} săptămâni"},aboutXMonths:{one:"circa 1 lună",other:"circa {{count}} luni"},xMonths:{one:"1 lună",other:"{{count}} luni"},aboutXYears:{one:"circa 1 an",other:"circa {{count}} ani"},xYears:{one:"1 an",other:"{{count}} ani"},overXYears:{one:"peste 1 an",other:"peste {{count}} ani"},almostXYears:{one:"aproape 1 an",other:"aproape {{count}} ani"}},sI={date:(0,n$.default)({formats:{full:"EEEE, d MMMM yyyy",long:"d MMMM yyyy",medium:"d MMM yyyy",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'la' {{time}}",long:"{{date}} 'la' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sM={lastWeek:"eeee 'trecută la' p",yesterday:"'ieri la' p",today:"'astăzi la' p",tomorrow:"'mâine la' p",nextWeek:"eeee 'viitoare la' p",other:"P"},sT={ordinalNumber:function(e){return String(Number(e))},era:(0,nq.default)({values:{narrow:["Î","D"],abbreviated:["Î.d.C.","D.C."],wide:["Înainte de Cristos","După Cristos"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["primul trimestru","al doilea trimestru","al treilea trimestru","al patrulea trimestru"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["I","F","M","A","M","I","I","A","S","O","N","D"],abbreviated:["ian","feb","mar","apr","mai","iun","iul","aug","sep","oct","noi","dec"],wide:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["d","l","m","m","j","v","s"],short:["du","lu","ma","mi","jo","vi","sâ"],abbreviated:["dum","lun","mar","mie","joi","vin","sâm"],wide:["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"ami",morning:"dim",afternoon:"da",evening:"s",night:"n"},abbreviated:{am:"AM",pm:"PM",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},wide:{am:"a.m.",pm:"p.m.",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mn",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},abbreviated:{am:"AM",pm:"PM",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"},wide:{am:"a.m.",pm:"p.m.",midnight:"miezul nopții",noon:"amiază",morning:"dimineață",afternoon:"după-amiază",evening:"seară",night:"noapte"}},defaultFormattingWidth:"wide"})},sL={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(Î|D)/i,abbreviated:/^(Î\.?\s?d\.?\s?C\.?|Î\.?\s?e\.?\s?n\.?|D\.?\s?C\.?|e\.?\s?n\.?)/i,wide:/^(Înainte de Cristos|Înaintea erei noastre|După Cristos|Era noastră)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^ÎC/i,/^DC/i],wide:[/^(Înainte de Cristos|Înaintea erei noastre)/i,/^(După Cristos|Era noastră)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^trimestrul [1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[ifmaasond]/i,abbreviated:/^(ian|feb|mar|apr|mai|iun|iul|aug|sep|oct|noi|dec)/i,wide:/^(ianuarie|februarie|martie|aprilie|mai|iunie|iulie|august|septembrie|octombrie|noiembrie|decembrie)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^i/i,/^f/i,/^m/i,/^a/i,/^m/i,/^i/i,/^i/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ia/i,/^f/i,/^mar/i,/^ap/i,/^mai/i,/^iun/i,/^iul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[dlmjvs]/i,short:/^(d|l|ma|mi|j|v|s)/i,abbreviated:/^(dum|lun|mar|mie|jo|vi|sâ)/i,wide:/^(duminica|luni|marţi|miercuri|joi|vineri|sâmbătă)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^d/i,/^l/i,/^ma/i,/^mi/i,/^j/i,/^v/i,/^s/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|mn|a|(dimineaţa|după-amiaza|seara|noaptea))/i,any:/^([ap]\.?\s?m\.?|miezul nopții|amiaza|(dimineaţa|după-amiaza|seara|noaptea))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/amiaza/i,morning:/dimineaţa/i,afternoon:/după-amiaza/i,evening:/seara/i,night:/noaptea/i}},defaultParseWidth:"any"})};function sj(e,t){if(void 0!==e.one&&1===t)return e.one;var i=t%10,n=t%100;return 1===i&&11!==n?e.singularNominative.replace("{{count}}",t):i>=2&&i<=4&&(n<10||n>20)?e.singularGenitive.replace("{{count}}",t):e.pluralGenitive.replace("{{count}}",t)}function sP(e){return function(t,i){if(!i.addSuffix)return sj(e.regular,t);if(i.comparison>0)if(e.future)return sj(e.future,t);else return"через "+sj(e.regular,t);return e.past?sj(e.past,t):sj(e.regular,t)+" назад"}}var sD={lessThanXSeconds:sP({regular:{one:"меньше секунды",singularNominative:"меньше {{count}} секунды",singularGenitive:"меньше {{count}} секунд",pluralGenitive:"меньше {{count}} секунд"},future:{one:"меньше, чем через секунду",singularNominative:"меньше, чем через {{count}} секунду",singularGenitive:"меньше, чем через {{count}} секунды",pluralGenitive:"меньше, чем через {{count}} секунд"}}),xSeconds:sP({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунды",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду назад",singularGenitive:"{{count}} секунды назад",pluralGenitive:"{{count}} секунд назад"},future:{singularNominative:"через {{count}} секунду",singularGenitive:"через {{count}} секунды",pluralGenitive:"через {{count}} секунд"}}),halfAMinute:function(e,t){if(t.addSuffix)if(t.comparison>0)return"через полминуты";else return"полминуты назад";return"полминуты"},lessThanXMinutes:sP({regular:{one:"меньше минуты",singularNominative:"меньше {{count}} минуты",singularGenitive:"меньше {{count}} минут",pluralGenitive:"меньше {{count}} минут"},future:{one:"меньше, чем через минуту",singularNominative:"меньше, чем через {{count}} минуту",singularGenitive:"меньше, чем через {{count}} минуты",pluralGenitive:"меньше, чем через {{count}} минут"}}),xMinutes:sP({regular:{singularNominative:"{{count}} минута",singularGenitive:"{{count}} минуты",pluralGenitive:"{{count}} минут"},past:{singularNominative:"{{count}} минуту назад",singularGenitive:"{{count}} минуты назад",pluralGenitive:"{{count}} минут назад"},future:{singularNominative:"через {{count}} минуту",singularGenitive:"через {{count}} минуты",pluralGenitive:"через {{count}} минут"}}),aboutXHours:sP({regular:{singularNominative:"около {{count}} часа",singularGenitive:"около {{count}} часов",pluralGenitive:"около {{count}} часов"},future:{singularNominative:"приблизительно через {{count}} час",singularGenitive:"приблизительно через {{count}} часа",pluralGenitive:"приблизительно через {{count}} часов"}}),xHours:sP({regular:{singularNominative:"{{count}} час",singularGenitive:"{{count}} часа",pluralGenitive:"{{count}} часов"}}),xDays:sP({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} дней"}}),aboutXWeeks:sP({regular:{singularNominative:"около {{count}} недели",singularGenitive:"около {{count}} недель",pluralGenitive:"около {{count}} недель"},future:{singularNominative:"приблизительно через {{count}} неделю",singularGenitive:"приблизительно через {{count}} недели",pluralGenitive:"приблизительно через {{count}} недель"}}),xWeeks:sP({regular:{singularNominative:"{{count}} неделя",singularGenitive:"{{count}} недели",pluralGenitive:"{{count}} недель"}}),aboutXMonths:sP({regular:{singularNominative:"около {{count}} месяца",singularGenitive:"около {{count}} месяцев",pluralGenitive:"около {{count}} месяцев"},future:{singularNominative:"приблизительно через {{count}} месяц",singularGenitive:"приблизительно через {{count}} месяца",pluralGenitive:"приблизительно через {{count}} месяцев"}}),xMonths:sP({regular:{singularNominative:"{{count}} месяц",singularGenitive:"{{count}} месяца",pluralGenitive:"{{count}} месяцев"}}),aboutXYears:sP({regular:{singularNominative:"около {{count}} года",singularGenitive:"около {{count}} лет",pluralGenitive:"около {{count}} лет"},future:{singularNominative:"приблизительно через {{count}} год",singularGenitive:"приблизительно через {{count}} года",pluralGenitive:"приблизительно через {{count}} лет"}}),xYears:sP({regular:{singularNominative:"{{count}} год",singularGenitive:"{{count}} года",pluralGenitive:"{{count}} лет"}}),overXYears:sP({regular:{singularNominative:"больше {{count}} года",singularGenitive:"больше {{count}} лет",pluralGenitive:"больше {{count}} лет"},future:{singularNominative:"больше, чем через {{count}} год",singularGenitive:"больше, чем через {{count}} года",pluralGenitive:"больше, чем через {{count}} лет"}}),almostXYears:sP({regular:{singularNominative:"почти {{count}} год",singularGenitive:"почти {{count}} года",pluralGenitive:"почти {{count}} лет"},future:{singularNominative:"почти через {{count}} год",singularGenitive:"почти через {{count}} года",pluralGenitive:"почти через {{count}} лет"}})},sN={date:(0,n$.default)({formats:{full:"EEEE, d MMMM y 'г.'",long:"d MMMM y 'г.'",medium:"d MMM y 'г.'",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{any:"{{date}}, {{time}}"},defaultWidth:"any"})},sR=["воскресенье","понедельник","вторник","среду","четверг","пятницу","субботу"];function sO(e){var t=sR[e];return 2===e?"'во "+t+" в' p":"'в "+t+" в' p"}var sB={lastWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return sO(n);var a=sR[n];switch(n){case 0:return"'в прошлое "+a+" в' p";case 1:case 2:case 4:return"'в прошлый "+a+" в' p";case 3:case 5:case 6:return"'в прошлую "+a+" в' p"}},yesterday:"'вчера в' p",today:"'сегодня в' p",tomorrow:"'завтра в' p",nextWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return sO(n);var a=sR[n];switch(n){case 0:return"'в следующее "+a+" в' p";case 1:case 2:case 4:return"'в следующий "+a+" в' p";case 3:case 5:case 6:return"'в следующую "+a+" в' p"}},other:"P"},sz={ordinalNumber:function(e,t){var i=String((t||{}).unit);return e+("date"===i?"-е":"week"===i||"minute"===i||"second"===i?"-я":"-й")},era:(0,nq.default)({values:{narrow:["до н.э.","н.э."],abbreviated:["до н. э.","н. э."],wide:["до нашей эры","нашей эры"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","март","апр.","май","июнь","июль","авг.","сент.","окт.","нояб.","дек."],wide:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"]},defaultWidth:"wide",formattingValues:{narrow:["Я","Ф","М","А","М","И","И","А","С","О","Н","Д"],abbreviated:["янв.","фев.","мар.","апр.","мая","июн.","июл.","авг.","сент.","окт.","нояб.","дек."],wide:["января","февраля","марта","апреля","мая","июня","июля","августа","сентября","октября","ноября","декабря"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["В","П","В","С","Ч","П","С"],short:["вс","пн","вт","ср","чт","пт","сб"],abbreviated:["вск","пнд","втр","срд","чтв","птн","суб"],wide:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утро",afternoon:"день",evening:"веч.",night:"ночь"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утро",afternoon:"день",evening:"вечер",night:"ночь"}},defaultWidth:"any",formattingValues:{narrow:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},abbreviated:{am:"ДП",pm:"ПП",midnight:"полн.",noon:"полд.",morning:"утра",afternoon:"дня",evening:"веч.",night:"ночи"},wide:{am:"ДП",pm:"ПП",midnight:"полночь",noon:"полдень",morning:"утра",afternoon:"дня",evening:"вечера",night:"ночи"}},defaultFormattingWidth:"wide"})},sF={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-?(е|я|й|ое|ье|ая|ья|ый|ой|ий|ый))?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^((до )?н\.?\s?э\.?)/i,abbreviated:/^((до )?н\.?\s?э\.?)/i,wide:/^(до нашей эры|нашей эры|наша эра)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^д/i,/^н/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[ыои]?й?)? кв.?/i,wide:/^[1234](-?[ыои]?й?)? квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[яфмаисонд]/i,abbreviated:/^(янв|фев|март?|апр|ма[йя]|июн[ья]?|июл[ья]?|авг|сент?|окт|нояб?|дек)\.?/i,wide:/^(январ[ья]|феврал[ья]|марта?|апрел[ья]|ма[йя]|июн[ья]|июл[ья]|августа?|сентябр[ья]|октябр[ья]|октябр[ья]|ноябр[ья]|декабр[ья])/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^я/i,/^ф/i,/^м/i,/^а/i,/^м/i,/^и/i,/^и/i,/^а/i,/^с/i,/^о/i,/^н/i,/^я/i],any:[/^я/i,/^ф/i,/^мар/i,/^ап/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^ав/i,/^с/i,/^о/i,/^н/i,/^д/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[впсч]/i,short:/^(вс|во|пн|по|вт|ср|чт|че|пт|пя|сб|су)\.?/i,abbreviated:/^(вск|вос|пнд|пон|втр|вто|срд|сре|чтв|чет|птн|пят|суб).?/i,wide:/^(воскресень[ея]|понедельника?|вторника?|сред[аы]|четверга?|пятниц[аы]|суббот[аы])/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^в/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^в[ос]/i,/^п[он]/i,/^в/i,/^ср/i,/^ч/i,/^п[ят]/i,/^с[уб]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,abbreviated:/^([дп]п|полн\.?|полд\.?|утр[оа]|день|дня|веч\.?|ноч[ьи])/i,wide:/^([дп]п|полночь|полдень|утр[оа]|день|дня|вечера?|ноч[ьи])/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^дп/i,pm:/^пп/i,midnight:/^полн/i,noon:/^полд/i,morning:/^у/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},defaultParseWidth:"any"})},sH={lessThanXSeconds:{one:"manj kot {{count}} sekunda",two:"manj kot {{count}} sekundi",few:"manj kot {{count}} sekunde",other:"manj kot {{count}} sekund"},xSeconds:{one:"{{count}} sekunda",two:"{{count}} sekundi",few:"{{count}} sekunde",other:"{{count}} sekund"},halfAMinute:"pol minute",lessThanXMinutes:{one:"manj kot {{count}} minuta",two:"manj kot {{count}} minuti",few:"manj kot {{count}} minute",other:"manj kot {{count}} minut"},xMinutes:{one:"{{count}} minuta",two:"{{count}} minuti",few:"{{count}} minute",other:"{{count}} minut"},aboutXHours:{one:"približno {{count}} ura",two:"približno {{count}} uri",few:"približno {{count}} ure",other:"približno {{count}} ur"},xHours:{one:"{{count}} ura",two:"{{count}} uri",few:"{{count}} ure",other:"{{count}} ur"},xDays:{one:"{{count}} dan",two:"{{count}} dni",few:"{{count}} dni",other:"{{count}} dni"},aboutXWeeks:{one:"približno {{count}} teden",two:"približno {{count}} tedna",few:"približno {{count}} tedne",other:"približno {{count}} tednov"},xWeeks:{one:"{{count}} teden",two:"{{count}} tedna",few:"{{count}} tedne",other:"{{count}} tednov"},aboutXMonths:{one:"približno {{count}} mesec",two:"približno {{count}} meseca",few:"približno {{count}} mesece",other:"približno {{count}} mesecev"},xMonths:{one:"{{count}} mesec",two:"{{count}} meseca",few:"{{count}} meseci",other:"{{count}} mesecev"},aboutXYears:{one:"približno {{count}} leto",two:"približno {{count}} leti",few:"približno {{count}} leta",other:"približno {{count}} let"},xYears:{one:"{{count}} leto",two:"{{count}} leti",few:"{{count}} leta",other:"{{count}} let"},overXYears:{one:"več kot {{count}} leto",two:"več kot {{count}} leti",few:"več kot {{count}} leta",other:"več kot {{count}} let"},almostXYears:{one:"skoraj {{count}} leto",two:"skoraj {{count}} leti",few:"skoraj {{count}} leta",other:"skoraj {{count}} let"}},sW={lessThanXSeconds:{one:"manj kot {{count}} sekundo",two:"manj kot {{count}} sekundama",few:"manj kot {{count}} sekundami",other:"manj kot {{count}} sekundami"},xSeconds:{one:"{{count}} sekundo",two:"{{count}} sekundama",few:"{{count}} sekundami",other:"{{count}} sekundami"},halfAMinute:"pol minute",lessThanXMinutes:{one:"manj kot {{count}} minuto",two:"manj kot {{count}} minutama",few:"manj kot {{count}} minutami",other:"manj kot {{count}} minutami"},xMinutes:{one:"{{count}} minuto",two:"{{count}} minutama",few:"{{count}} minutami",other:"{{count}} minutami"},aboutXHours:{one:"približno {{count}} uro",two:"približno {{count}} urama",few:"približno {{count}} urami",other:"približno {{count}} urami"},xHours:{one:"{{count}} uro",two:"{{count}} urama",few:"{{count}} urami",other:"{{count}} urami"},xDays:{one:"{{count}} dnem",two:"{{count}} dnevoma",few:"{{count}} dnevi",other:"{{count}} dnevi"},aboutXMonths:{one:"približno {{count}} mesecem",two:"približno {{count}} mesecema",few:"približno {{count}} meseci",other:"približno {{count}} meseci"},xMonths:{one:"{{count}} mesecem",two:"{{count}} mesecema",few:"{{count}} meseci",other:"{{count}} meseci"},aboutXYears:{one:"približno {{count}} letom",two:"približno {{count}} letoma",few:"približno {{count}} leti",other:"približno {{count}} leti"},xYears:{one:"{{count}} letom",two:"{{count}} letoma",few:"{{count}} leti",other:"{{count}} leti"},overXYears:{one:"več kot {{count}} letom",two:"več kot {{count}} letoma",few:"več kot {{count}} leti",other:"več kot {{count}} leti"},almostXYears:{one:"skoraj {{count}} letom",two:"skoraj {{count}} letoma",few:"skoraj {{count}} leti",other:"skoraj {{count}} leti"}},sU={lessThanXSeconds:{one:"manj kot {{count}} sekundo",two:"manj kot {{count}} sekundi",few:"manj kot {{count}} sekunde",other:"manj kot {{count}} sekund"},xSeconds:{one:"{{count}} sekundo",two:"{{count}} sekundi",few:"{{count}} sekunde",other:"{{count}} sekund"},halfAMinute:"pol minute",lessThanXMinutes:{one:"manj kot {{count}} minuto",two:"manj kot {{count}} minuti",few:"manj kot {{count}} minute",other:"manj kot {{count}} minut"},xMinutes:{one:"{{count}} minuto",two:"{{count}} minuti",few:"{{count}} minute",other:"{{count}} minut"},aboutXHours:{one:"približno {{count}} uro",two:"približno {{count}} uri",few:"približno {{count}} ure",other:"približno {{count}} ur"},xHours:{one:"{{count}} uro",two:"{{count}} uri",few:"{{count}} ure",other:"{{count}} ur"},xDays:{one:"{{count}} dan",two:"{{count}} dni",few:"{{count}} dni",other:"{{count}} dni"},aboutXMonths:{one:"približno {{count}} mesec",two:"približno {{count}} meseca",few:"približno {{count}} mesece",other:"približno {{count}} mesecev"},xMonths:{one:"{{count}} mesec",two:"{{count}} meseca",few:"{{count}} mesece",other:"{{count}} mesecev"},aboutXYears:{one:"približno {{count}} leto",two:"približno {{count}} leti",few:"približno {{count}} leta",other:"približno {{count}} let"},xYears:{one:"{{count}} leto",two:"{{count}} leti",few:"{{count}} leta",other:"{{count}} let"},overXYears:{one:"več kot {{count}} leto",two:"več kot {{count}} leti",few:"več kot {{count}} leta",other:"več kot {{count}} let"},almostXYears:{one:"skoraj {{count}} leto",two:"skoraj {{count}} leti",few:"skoraj {{count}} leta",other:"skoraj {{count}} let"}},sV={date:(0,n$.default)({formats:{full:"EEEE, dd. MMMM y",long:"dd. MMMM y",medium:"d. MMM y",short:"d. MM. yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},sG={lastWeek:function(e){switch(e.getUTCDay()){case 0:return"'prejšnjo nedeljo ob' p";case 3:return"'prejšnjo sredo ob' p";case 6:return"'prejšnjo soboto ob' p";default:return"'prejšnji' EEEE 'ob' p"}},yesterday:"'včeraj ob' p",today:"'danes ob' p",tomorrow:"'jutri ob' p",nextWeek:function(e){switch(e.getUTCDay()){case 0:return"'naslednjo nedeljo ob' p";case 3:return"'naslednjo sredo ob' p";case 6:return"'naslednjo soboto ob' p";default:return"'naslednji' EEEE 'ob' p"}},other:"P"},s$={ordinalNumber:function(e){return String(Number(e)).concat(".")},era:(0,nq.default)({values:{narrow:["pr. n. št.","po n. št."],abbreviated:["pr. n. št.","po n. št."],wide:["pred našim štetjem","po našem štetju"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1. čet.","2. čet.","3. čet.","4. čet."],wide:["1. četrtletje","2. četrtletje","3. četrtletje","4. četrtletje"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan.","feb.","mar.","apr.","maj","jun.","jul.","avg.","sep.","okt.","nov.","dec."],wide:["januar","februar","marec","april","maj","junij","julij","avgust","september","oktober","november","december"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["n","p","t","s","č","p","s"],short:["ned.","pon.","tor.","sre.","čet.","pet.","sob."],abbreviated:["ned.","pon.","tor.","sre.","čet.","pet.","sob."],wide:["nedelja","ponedeljek","torek","sreda","četrtek","petek","sobota"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"d",pm:"p",midnight:"24.00",noon:"12.00",morning:"j",afternoon:"p",evening:"v",night:"n"},abbreviated:{am:"dop.",pm:"pop.",midnight:"poln.",noon:"pold.",morning:"jut.",afternoon:"pop.",evening:"več.",night:"noč"},wide:{am:"dop.",pm:"pop.",midnight:"polnoč",noon:"poldne",morning:"jutro",afternoon:"popoldne",evening:"večer",night:"noč"}},defaultWidth:"wide",formattingValues:{narrow:{am:"d",pm:"p",midnight:"24.00",noon:"12.00",morning:"zj",afternoon:"p",evening:"zv",night:"po"},abbreviated:{am:"dop.",pm:"pop.",midnight:"opoln.",noon:"opold.",morning:"zjut.",afternoon:"pop.",evening:"zveč.",night:"ponoči"},wide:{am:"dop.",pm:"pop.",midnight:"opolnoči",noon:"opoldne",morning:"zjutraj",afternoon:"popoldan",evening:"zvečer",night:"ponoči"}},defaultFormattingWidth:"wide"})},sZ={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\./i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{abbreviated:/^(pr\. n\. št\.|po n\. št\.)/i,wide:/^(pred Kristusom|pred na[sš]im [sš]tetjem|po Kristusu|po na[sš]em [sš]tetju|na[sš]ega [sš]tetja)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^pr/i,/^(po|na[sš]em)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]\.\s?[čc]et\.?/i,wide:/^[1234]\. [čc]etrtletje/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan\.|feb\.|mar\.|apr\.|maj|jun\.|jul\.|avg\.|sep\.|okt\.|nov\.|dec\.)/i,wide:/^(januar|februar|marec|april|maj|junij|julij|avgust|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{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],abbreviated:[/^ja/i,/^fe/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^av/i,/^s/i,/^o/i,/^n/i,/^d/i],wide:[/^ja/i,/^fe/i,/^mar/i,/^ap/i,/^maj/i,/^jun/i,/^jul/i,/^av/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"wide"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[nptsčc]/i,short:/^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,abbreviated:/^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,wide:/^(nedelja|ponedeljek|torek|sreda|[cč]etrtek|petek|sobota)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^n/i,/^p/i,/^t/i,/^s/i,/^[cč]/i,/^p/i,/^s/i],any:[/^n/i,/^po/i,/^t/i,/^sr/i,/^[cč]/i,/^pe/i,/^so/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(d|po?|z?v|n|z?j|24\.00|12\.00)/i,any:/^(dop\.|pop\.|o?poln(\.|o[cč]i?)|o?pold(\.|ne)|z?ve[cč](\.|er)|(po)?no[cč]i?|popold(ne|an)|jut(\.|ro)|zjut(\.|raj))/i},defaultMatchWidth:"any",parsePatterns:{narrow:{am:/^d/i,pm:/^p/i,midnight:/^24/i,noon:/^12/i,morning:/^(z?j)/i,afternoon:/^p/i,evening:/^(z?v)/i,night:/^(n|po)/i},any:{am:/^dop\./i,pm:/^pop\./i,midnight:/^o?poln/i,noon:/^o?pold/i,morning:/j/i,afternoon:/^pop\./i,evening:/^z?ve/i,night:/(po)?no/i}},defaultParseWidth:"any"})},sK={lessThanXSeconds:{one:"më pak se një sekondë",other:"më pak se {{count}} sekonda"},xSeconds:{one:"1 sekondë",other:"{{count}} sekonda"},halfAMinute:"gjysëm minuti",lessThanXMinutes:{one:"më pak se një minute",other:"më pak se {{count}} minuta"},xMinutes:{one:"1 minutë",other:"{{count}} minuta"},aboutXHours:{one:"rreth 1 orë",other:"rreth {{count}} orë"},xHours:{one:"1 orë",other:"{{count}} orë"},xDays:{one:"1 ditë",other:"{{count}} ditë"},aboutXWeeks:{one:"rreth 1 javë",other:"rreth {{count}} javë"},xWeeks:{one:"1 javë",other:"{{count}} javë"},aboutXMonths:{one:"rreth 1 muaj",other:"rreth {{count}} muaj"},xMonths:{one:"1 muaj",other:"{{count}} muaj"},aboutXYears:{one:"rreth 1 vit",other:"rreth {{count}} vite"},xYears:{one:"1 vit",other:"{{count}} vite"},overXYears:{one:"mbi 1 vit",other:"mbi {{count}} vite"},almostXYears:{one:"pothuajse 1 vit",other:"pothuajse {{count}} vite"}},sq={date:(0,n$.default)({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'në' {{time}}",long:"{{date}} 'në' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},sY={lastWeek:"'të' eeee 'e shkuar në' p",yesterday:"'dje në' p",today:"'sot në' p",tomorrow:"'nesër në' p",nextWeek:"eeee 'at' p",other:"P"},sX={ordinalNumber:function(e,t){var i=Number(e);return"hour"===String((t||{}).unit)?i:1===i?i+"-rë":4===i?i+"t":i+"-të"},era:(0,nq.default)({values:{narrow:["P","M"],abbreviated:["PK","MK"],wide:["Para Krishtit","Mbas Krishtit"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["4-mujori I","4-mujori II","4-mujori III","4-mujori IV"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","S","M","P","M","Q","K","G","S","T","N","D"],abbreviated:["Jan","Shk","Mar","Pri","Maj","Qer","Kor","Gus","Sht","Tet","Nën","Dhj"],wide:["Janar","Shkurt","Mars","Prill","Maj","Qershor","Korrik","Gusht","Shtator","Tetor","Nëntor","Dhjetor"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["D","H","M","M","E","P","S"],short:["Di","Hë","Ma","Më","En","Pr","Sh"],abbreviated:["Die","Hën","Mar","Mër","Enj","Pre","Sht"],wide:["Dielë","Hënë","Martë","Mërkurë","Enjte","Premte","Shtunë"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"p",pm:"m",midnight:"m",noon:"d",morning:"mëngjes",afternoon:"dite",evening:"mbrëmje",night:"natë"},abbreviated:{am:"PD",pm:"MD",midnight:"mesnëtë",noon:"drek",morning:"mëngjes",afternoon:"mbasdite",evening:"mbrëmje",night:"natë"},wide:{am:"p.d.",pm:"m.d.",midnight:"mesnëtë",noon:"drek",morning:"mëngjes",afternoon:"mbasdite",evening:"mbrëmje",night:"natë"}},defaultWidth:"wide",formattingValues:{narrow:{am:"p",pm:"m",midnight:"m",noon:"d",morning:"në mëngjes",afternoon:"në mbasdite",evening:"në mbrëmje",night:"në mesnatë"},abbreviated:{am:"PD",pm:"MD",midnight:"mesnatë",noon:"drek",morning:"në mëngjes",afternoon:"në mbasdite",evening:"në mbrëmje",night:"në mesnatë"},wide:{am:"p.d.",pm:"m.d.",midnight:"mesnatë",noon:"drek",morning:"në mëngjes",afternoon:"në mbasdite",evening:"në mbrëmje",night:"në mesnatë"}},defaultFormattingWidth:"wide"})},sQ={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-rë|-të|t|)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(p|m)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(para krishtit|mbas krishtit)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(p|m)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234]-mujori (i{1,3}|iv)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jsmpqkftnd]/i,abbreviated:/^(jan|shk|mar|pri|maj|qer|kor|gus|sht|tet|nën|dhj)/i,wide:/^(janar|shkurt|mars|prill|maj|qershor|korrik|gusht|shtator|tetor|nëntor|dhjetor)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^s/i,/^m/i,/^p/i,/^m/i,/^q/i,/^k/i,/^g/i,/^s/i,/^t/i,/^n/i,/^d/i],any:[/^ja/i,/^shk/i,/^mar/i,/^pri/i,/^maj/i,/^qer/i,/^kor/i,/^gu/i,/^sht/i,/^tet/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[dhmeps]/i,short:/^(di|hë|ma|më|en|pr|sh)/i,abbreviated:/^(die|hën|mar|mër|enj|pre|sht)/i,wide:/^(dielë|hënë|martë|mërkurë|enjte|premte|shtunë)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^d/i,/^h/i,/^m/i,/^m/i,/^e/i,/^p/i,/^s/i],any:[/^d/i,/^h/i,/^ma/i,/^më/i,/^e/i,/^p/i,/^s/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(p|m|me|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i,any:/^([pm]\.?\s?d\.?|drek|në (mëngjes|mbasdite|mbrëmje|mesnatë))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^p/i,pm:/^m/i,midnight:/^me/i,noon:/^dr/i,morning:/mëngjes/i,afternoon:/mbasdite/i,evening:/mbrëmje/i,night:/natë/i}},defaultParseWidth:"any"})},sJ={lessThanXSeconds:{one:{standalone:"мање од 1 секунде",withPrepositionAgo:"мање од 1 секунде",withPrepositionIn:"мање од 1 секунду"},dual:"мање од {{count}} секунде",other:"мање од {{count}} секунди"},xSeconds:{one:{standalone:"1 секунда",withPrepositionAgo:"1 секунде",withPrepositionIn:"1 секунду"},dual:"{{count}} секунде",other:"{{count}} секунди"},halfAMinute:"пола минуте",lessThanXMinutes:{one:{standalone:"мање од 1 минуте",withPrepositionAgo:"мање од 1 минуте",withPrepositionIn:"мање од 1 минуту"},dual:"мање од {{count}} минуте",other:"мање од {{count}} минута"},xMinutes:{one:{standalone:"1 минута",withPrepositionAgo:"1 минуте",withPrepositionIn:"1 минуту"},dual:"{{count}} минуте",other:"{{count}} минута"},aboutXHours:{one:{standalone:"око 1 сат",withPrepositionAgo:"око 1 сат",withPrepositionIn:"око 1 сат"},dual:"око {{count}} сата",other:"око {{count}} сати"},xHours:{one:{standalone:"1 сат",withPrepositionAgo:"1 сат",withPrepositionIn:"1 сат"},dual:"{{count}} сата",other:"{{count}} сати"},xDays:{one:{standalone:"1 дан",withPrepositionAgo:"1 дан",withPrepositionIn:"1 дан"},dual:"{{count}} дана",other:"{{count}} дана"},aboutXWeeks:{one:{standalone:"око 1 недељу",withPrepositionAgo:"око 1 недељу",withPrepositionIn:"око 1 недељу"},dual:"око {{count}} недеље",other:"око {{count}} недеље"},xWeeks:{one:{standalone:"1 недељу",withPrepositionAgo:"1 недељу",withPrepositionIn:"1 недељу"},dual:"{{count}} недеље",other:"{{count}} недеље"},aboutXMonths:{one:{standalone:"око 1 месец",withPrepositionAgo:"око 1 месец",withPrepositionIn:"око 1 месец"},dual:"око {{count}} месеца",other:"око {{count}} месеци"},xMonths:{one:{standalone:"1 месец",withPrepositionAgo:"1 месец",withPrepositionIn:"1 месец"},dual:"{{count}} месеца",other:"{{count}} месеци"},aboutXYears:{one:{standalone:"око 1 годину",withPrepositionAgo:"око 1 годину",withPrepositionIn:"око 1 годину"},dual:"око {{count}} године",other:"око {{count}} година"},xYears:{one:{standalone:"1 година",withPrepositionAgo:"1 године",withPrepositionIn:"1 годину"},dual:"{{count}} године",other:"{{count}} година"},overXYears:{one:{standalone:"преко 1 годину",withPrepositionAgo:"преко 1 годину",withPrepositionIn:"преко 1 годину"},dual:"преко {{count}} године",other:"преко {{count}} година"},almostXYears:{one:{standalone:"готово 1 годину",withPrepositionAgo:"готово 1 годину",withPrepositionIn:"готово 1 годину"},dual:"готово {{count}} године",other:"готово {{count}} година"}},s0={date:(0,n$.default)({formats:{full:"EEEE, d. MMMM yyyy.",long:"d. MMMM yyyy.",medium:"d. MMM yy.",short:"dd. MM. yy."},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss (zzzz)",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'у' {{time}}",long:"{{date}} 'у' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},s1={lastWeek:function(e){switch(e.getUTCDay()){case 0:return"'прошле недеље у' p";case 3:return"'прошле среде у' p";case 6:return"'прошле суботе у' p";default:return"'прошли' EEEE 'у' p"}},yesterday:"'јуче у' p",today:"'данас у' p",tomorrow:"'сутра у' p",nextWeek:function(e){switch(e.getUTCDay()){case 0:return"'следеће недеље у' p";case 3:return"'следећу среду у' p";case 6:return"'следећу суботу у' p";default:return"'следећи' EEEE 'у' p"}},other:"P"},s2={ordinalNumber:function(e){return String(Number(e)).concat(".")},era:(0,nq.default)({values:{narrow:["пр.н.е.","АД"],abbreviated:["пр. Хр.","по. Хр."],wide:["Пре Христа","После Христа"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1.","2.","3.","4."],abbreviated:["1. кв.","2. кв.","3. кв.","4. кв."],wide:["1. квартал","2. квартал","3. квартал","4. квартал"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12."],abbreviated:["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец"],wide:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"]},defaultWidth:"wide",formattingValues:{narrow:["1.","2.","3.","4.","5.","6.","7.","8.","9.","10.","11.","12."],abbreviated:["јан","феб","мар","апр","мај","јун","јул","авг","сеп","окт","нов","дец"],wide:["јануар","фебруар","март","април","мај","јун","јул","август","септембар","октобар","новембар","децембар"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Н","П","У","С","Ч","П","С"],short:["нед","пон","уто","сре","чет","пет","суб"],abbreviated:["нед","пон","уто","сре","чет","пет","суб"],wide:["недеља","понедељак","уторак","среда","четвртак","петак","субота"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"AM",pm:"PM",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"поподне",evening:"увече",night:"ноћу"},abbreviated:{am:"AM",pm:"PM",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"поподне",evening:"увече",night:"ноћу"},wide:{am:"AM",pm:"PM",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"после подне",evening:"увече",night:"ноћу"}},defaultWidth:"wide",formattingValues:{narrow:{am:"АМ",pm:"ПМ",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"поподне",evening:"увече",night:"ноћу"},abbreviated:{am:"АМ",pm:"ПМ",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"поподне",evening:"увече",night:"ноћу"},wide:{am:"AM",pm:"PM",midnight:"поноћ",noon:"подне",morning:"ујутру",afternoon:"после подне",evening:"увече",night:"ноћу"}},defaultFormattingWidth:"wide"})},s3={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)\./i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(пр\.н\.е\.|АД)/i,abbreviated:/^(пр\.\s?Хр\.|по\.\s?Хр\.)/i,wide:/^(Пре Христа|пре нове ере|После Христа|нова ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^пр/i,/^(по|нова)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]\.\s?кв\.?/i,wide:/^[1234]\. квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(10|11|12|[123456789])\./i,abbreviated:/^(јан|феб|мар|апр|мај|јун|јул|авг|сеп|окт|нов|дец)/i,wide:/^((јануар|јануара)|(фебруар|фебруара)|(март|марта)|(април|априла)|(мја|маја)|(јун|јуна)|(јул|јула)|(август|августа)|(септембар|септембра)|(октобар|октобра)|(новембар|новембра)|(децембар|децембра))/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/(10|11|12|[123456789])/i],any:[/^ја/i,/^ф/i,/^мар/i,/^ап/i,/^мај/i,/^јун/i,/^јул/i,/^авг/i,/^с/i,/^о/i,/^н/i,/^д/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[пусчн]/i,short:/^(нед|пон|уто|сре|чет|пет|суб)/i,abbreviated:/^(нед|пон|уто|сре|чет|пет|суб)/i,wide:/^(недеља|понедељак|уторак|среда|четвртак|петак|субота)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^п/i,/^у/i,/^с/i,/^ч/i,/^н/i],any:[/^нед/i,/^пон/i,/^уто/i,/^сре/i,/^чет/i,/^пет/i,/^суб/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(ам|пм|поноћ|(по)?подне|увече|ноћу|после подне|ујутру)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^поно/i,noon:/^под/i,morning:/ујутру/i,afternoon:/(после\s|по)+подне/i,evening:/(увече)/i,night:/(ноћу)/i}},defaultParseWidth:"any"})},s5={lessThanXSeconds:{singular:"mindre än en sekund",plural:"mindre än {{count}} sekunder"},xSeconds:{singular:"en sekund",plural:"{{count}} sekunder"},halfAMinute:"en halv minut",lessThanXMinutes:{singular:"mindre än en minut",plural:"mindre än {{count}} minuter"},xMinutes:{singular:"en minut",plural:"{{count}} minuter"},aboutXHours:{singular:"ungefär en timme",plural:"ungefär {{count}} timmar"},xHours:{singular:"en timme",plural:"{{count}} timmar"},xDays:{singular:"en dag",plural:"{{count}} dagar"},aboutXWeeks:{singular:"ungefär en vecka",plural:"ungefär {{count}} vecka"},xWeeks:{singular:"en vecka",plural:"{{count}} vecka"},aboutXMonths:{singular:"ungefär en månad",plural:"ungefär {{count}} månader"},xMonths:{singular:"en månad",plural:"{{count}} månader"},aboutXYears:{singular:"ungefär ett år",plural:"ungefär {{count}} år"},xYears:{singular:"ett år",plural:"{{count}} år"},overXYears:{singular:"över ett år",plural:"över {{count}} år"},almostXYears:{singular:"nästan ett år",plural:"nästan {{count}} år"}},s4=["noll","en","två","tre","fyra","fem","sex","sju","åtta","nio","tio","elva","tolv"],s6={date:(0,n$.default)({formats:{full:"EEEE d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"y-MM-dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"'kl'. HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'kl.' {{time}}",long:"{{date}} 'kl.' {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},s9={lastWeek:"'i' EEEE's kl.' p",yesterday:"'igår kl.' p",today:"'idag kl.' p",tomorrow:"'imorgon kl.' p",nextWeek:"EEEE 'kl.' p",other:"P"},s8={ordinalNumber:function(e){var t=Number(e),i=t%100;if(i>20||i<10)switch(i%10){case 1:case 2:return t+":a"}return t+":e"},era:(0,nq.default)({values:{narrow:["f.Kr.","e.Kr."],abbreviated:["f.Kr.","e.Kr."],wide:["före Kristus","efter Kristus"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1:a kvartalet","2:a kvartalet","3:e kvartalet","4:e kvartalet"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["jan.","feb.","mars","apr.","maj","juni","juli","aug.","sep.","okt.","nov.","dec."],wide:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["S","M","T","O","T","F","L"],short:["sö","må","ti","on","to","fr","lö"],abbreviated:["sön","mån","tis","ons","tors","fre","lör"],wide:["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"morg.",afternoon:"efterm.",evening:"kväll",night:"natt"},abbreviated:{am:"f.m.",pm:"e.m.",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"efterm.",evening:"kväll",night:"natt"},wide:{am:"förmiddag",pm:"eftermiddag",midnight:"midnatt",noon:"middag",morning:"morgon",afternoon:"eftermiddag",evening:"kväll",night:"natt"}},defaultWidth:"wide",formattingValues:{narrow:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},abbreviated:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morg.",afternoon:"på efterm.",evening:"på kvällen",night:"på natten"},wide:{am:"fm",pm:"em",midnight:"midnatt",noon:"middag",morning:"på morgonen",afternoon:"på eftermiddagen",evening:"på kvällen",night:"på natten"}},defaultFormattingWidth:"wide"})},s7={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(:a|:e)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,abbreviated:/^(f\.? ?Kr\.?|f\.? ?v\.? ?t\.?|e\.? ?Kr\.?|v\.? ?t\.?)/i,wide:/^(före Kristus|före vår tid|efter Kristus|vår tid)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^f/i,/^[ev]/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](:a|:e)? kvartalet/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|maj|jun|jul|aug|sep|okt|nov|dec)\.?/i,wide:/^(januari|februari|mars|april|maj|juni|juli|augusti|september|oktober|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{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,/^maj/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[smtofl]/i,short:/^(sö|må|ti|on|to|fr|lö)/i,abbreviated:/^(sön|mån|tis|ons|tors|fre|lör)/i,wide:/^(söndag|måndag|tisdag|onsdag|torsdag|fredag|lördag)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^s/i,/^m/i,/^ti/i,/^o/i,/^to/i,/^f/i,/^l/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^([fe]\.?\s?m\.?|midn(att)?|midd(ag)?|(på) (morgonen|eftermiddagen|kvällen|natten))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^f/i,pm:/^e/i,midnight:/^midn/i,noon:/^midd/i,morning:/morgon/i,afternoon:/eftermiddag/i,evening:/kväll/i,night:/natt/i}},defaultParseWidth:"any"})},le={lessThanXSeconds:{one:{default:"ஒரு வினாடிக்கு குறைவாக",in:"ஒரு வினாடிக்குள்",ago:"ஒரு வினாடிக்கு முன்பு"},other:{default:"{{count}} வினாடிகளுக்கு குறைவாக",in:"{{count}} வினாடிகளுக்குள்",ago:"{{count}} வினாடிகளுக்கு முன்பு"}},xSeconds:{one:{default:"1 வினாடி",in:"1 வினாடியில்",ago:"1 வினாடி முன்பு"},other:{default:"{{count}} விநாடிகள்",in:"{{count}} வினாடிகளில்",ago:"{{count}} விநாடிகளுக்கு முன்பு"}},halfAMinute:{default:"அரை நிமிடம்",in:"அரை நிமிடத்தில்",ago:"அரை நிமிடம் முன்பு"},lessThanXMinutes:{one:{default:"ஒரு நிமிடத்திற்கும் குறைவாக",in:"ஒரு நிமிடத்திற்குள்",ago:"ஒரு நிமிடத்திற்கு முன்பு"},other:{default:"{{count}} நிமிடங்களுக்கும் குறைவாக",in:"{{count}} நிமிடங்களுக்குள்",ago:"{{count}} நிமிடங்களுக்கு முன்பு"}},xMinutes:{one:{default:"1 நிமிடம்",in:"1 நிமிடத்தில்",ago:"1 நிமிடம் முன்பு"},other:{default:"{{count}} நிமிடங்கள்",in:"{{count}} நிமிடங்களில்",ago:"{{count}} நிமிடங்களுக்கு முன்பு"}},aboutXHours:{one:{default:"சுமார் 1 மணி நேரம்",in:"சுமார் 1 மணி நேரத்தில்",ago:"சுமார் 1 மணி நேரத்திற்கு முன்பு"},other:{default:"சுமார் {{count}} மணி நேரம்",in:"சுமார் {{count}} மணி நேரத்திற்கு முன்பு",ago:"சுமார் {{count}} மணி நேரத்தில்"}},xHours:{one:{default:"1 மணி நேரம்",in:"1 மணி நேரத்தில்",ago:"1 மணி நேரத்திற்கு முன்பு"},other:{default:"{{count}} மணி நேரம்",in:"{{count}} மணி நேரத்தில்",ago:"{{count}} மணி நேரத்திற்கு முன்பு"}},xDays:{one:{default:"1 நாள்",in:"1 நாளில்",ago:"1 நாள் முன்பு"},other:{default:"{{count}} நாட்கள்",in:"{{count}} நாட்களில்",ago:"{{count}} நாட்களுக்கு முன்பு"}},aboutXWeeks:{one:{default:"சுமார் 1 வாரம்",in:"சுமார் 1 வாரத்தில்",ago:"சுமார் 1 வாரம் முன்பு"},other:{default:"சுமார் {{count}} வாரங்கள்",in:"சுமார் {{count}} வாரங்களில்",ago:"சுமார் {{count}} வாரங்களுக்கு முன்பு"}},xWeeks:{one:{default:"1 வாரம்",in:"1 வாரத்தில்",ago:"1 வாரம் முன்பு"},other:{default:"{{count}} வாரங்கள்",in:"{{count}} வாரங்களில்",ago:"{{count}} வாரங்களுக்கு முன்பு"}},aboutXMonths:{one:{default:"சுமார் 1 மாதம்",in:"சுமார் 1 மாதத்தில்",ago:"சுமார் 1 மாதத்திற்கு முன்பு"},other:{default:"சுமார் {{count}} மாதங்கள்",in:"சுமார் {{count}} மாதங்களில்",ago:"சுமார் {{count}} மாதங்களுக்கு முன்பு"}},xMonths:{one:{default:"1 மாதம்",in:"1 மாதத்தில்",ago:"1 மாதம் முன்பு"},other:{default:"{{count}} மாதங்கள்",in:"{{count}} மாதங்களில்",ago:"{{count}} மாதங்களுக்கு முன்பு"}},aboutXYears:{one:{default:"சுமார் 1 வருடம்",in:"சுமார் 1 ஆண்டில்",ago:"சுமார் 1 வருடம் முன்பு"},other:{default:"சுமார் {{count}} ஆண்டுகள்",in:"சுமார் {{count}} ஆண்டுகளில்",ago:"சுமார் {{count}} ஆண்டுகளுக்கு முன்பு"}},xYears:{one:{default:"1 வருடம்",in:"1 ஆண்டில்",ago:"1 வருடம் முன்பு"},other:{default:"{{count}} ஆண்டுகள்",in:"{{count}} ஆண்டுகளில்",ago:"{{count}} ஆண்டுகளுக்கு முன்பு"}},overXYears:{one:{default:"1 வருடத்திற்கு மேல்",in:"1 வருடத்திற்கும் மேலாக",ago:"1 வருடம் முன்பு"},other:{default:"{{count}} ஆண்டுகளுக்கும் மேலாக",in:"{{count}} ஆண்டுகளில்",ago:"{{count}} ஆண்டுகளுக்கு முன்பு"}},almostXYears:{one:{default:"கிட்டத்தட்ட 1 வருடம்",in:"கிட்டத்தட்ட 1 ஆண்டில்",ago:"கிட்டத்தட்ட 1 வருடம் முன்பு"},other:{default:"கிட்டத்தட்ட {{count}} ஆண்டுகள்",in:"கிட்டத்தட்ட {{count}} ஆண்டுகளில்",ago:"கிட்டத்தட்ட {{count}} ஆண்டுகளுக்கு முன்பு"}}};function lt(e,t){if(t.addSuffix)if(t.comparison>0)return e.in;else return e.ago;return e.default}var li={date:(0,n$.default)({formats:{full:"EEEE, d MMMM, y",long:"d MMMM, y",medium:"d MMM, y",short:"d/M/yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"a h:mm:ss zzzz",long:"a h:mm:ss z",medium:"a h:mm:ss",short:"a h:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ln={lastWeek:"'கடந்த' eeee p 'மணிக்கு'",yesterday:"'நேற்று ' p 'மணிக்கு'",today:"'இன்று ' p 'மணிக்கு'",tomorrow:"'நாளை ' p 'மணிக்கு'",nextWeek:"eeee p 'மணிக்கு'",other:"P"},la={ordinalNumber:function(e,t){return Number(e)},era:(0,nq.default)({values:{narrow:["கி.மு.","கி.பி."],abbreviated:["கி.மு.","கி.பி."],wide:["கிறிஸ்துவுக்கு முன்","அன்னோ டோமினி"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["காலா.1","காலா.2","காலா.3","காலா.4"],wide:["ஒன்றாம் காலாண்டு","இரண்டாம் காலாண்டு","மூன்றாம் காலாண்டு","நான்காம் காலாண்டு"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ஜ","பி","மா","ஏ","மே","ஜூ","ஜூ","ஆ","செ","அ","ந","டி"],abbreviated:["ஜன.","பிப்.","மார்.","ஏப்.","மே","ஜூன்","ஜூலை","ஆக.","செப்.","அக்.","நவ.","டிச."],wide:["ஜனவரி","பிப்ரவரி","மார்ச்","ஏப்ரல்","மே","ஜூன்","ஜூலை","ஆகஸ்ட்","செப்டம்பர்","அக்டோபர்","நவம்பர்","டிசம்பர்"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ஞா","தி","செ","பு","வி","வெ","ச"],short:["ஞா","தி","செ","பு","வி","வெ","ச"],abbreviated:["ஞாயி.","திங்.","செவ்.","புத.","வியா.","வெள்.","சனி"],wide:["ஞாயிறு","திங்கள்","செவ்வாய்","புதன்","வியாழன்","வெள்ளி","சனி"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"மு.ப",pm:"பி.ப",midnight:"நள்.",noon:"நண்.",morning:"கா.",afternoon:"மதி.",evening:"மா.",night:"இர."},abbreviated:{am:"முற்பகல்",pm:"பிற்பகல்",midnight:"நள்ளிரவு",noon:"நண்பகல்",morning:"காலை",afternoon:"மதியம்",evening:"மாலை",night:"இரவு"},wide:{am:"முற்பகல்",pm:"பிற்பகல்",midnight:"நள்ளிரவு",noon:"நண்பகல்",morning:"காலை",afternoon:"மதியம்",evening:"மாலை",night:"இரவு"}},defaultWidth:"wide",formattingValues:{narrow:{am:"மு.ப",pm:"பி.ப",midnight:"நள்.",noon:"நண்.",morning:"கா.",afternoon:"மதி.",evening:"மா.",night:"இர."},abbreviated:{am:"முற்பகல்",pm:"பிற்பகல்",midnight:"நள்ளிரவு",noon:"நண்பகல்",morning:"காலை",afternoon:"மதியம்",evening:"மாலை",night:"இரவு"},wide:{am:"முற்பகல்",pm:"பிற்பகல்",midnight:"நள்ளிரவு",noon:"நண்பகல்",morning:"காலை",afternoon:"மதியம்",evening:"மாலை",night:"இரவு"}},defaultFormattingWidth:"wide"})},lr={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(வது)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(கி.மு.|கி.பி.)/i,abbreviated:/^(கி\.?\s?மு\.?|கி\.?\s?பி\.?)/,wide:/^(கிறிஸ்துவுக்கு\sமுன்|அன்னோ\sடோமினி)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/கி\.?\s?மு\.?/,/கி\.?\s?பி\.?/]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^காலா.[1234]/i,wide:/^(ஒன்றாம்|இரண்டாம்|மூன்றாம்|நான்காம்) காலாண்டு/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/1/i,/2/i,/3/i,/4/i],any:[/(1|காலா.1|ஒன்றாம்)/i,/(2|காலா.2|இரண்டாம்)/i,/(3|காலா.3|மூன்றாம்)/i,/(4|காலா.4|நான்காம்)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(ஜ|பி|மா|ஏ|மே|ஜூ|ஆ|செ|அ|ந|டி)$/i,abbreviated:/^(ஜன.|பிப்.|மார்.|ஏப்.|மே|ஜூன்|ஜூலை|ஆக.|செப்.|அக்.|நவ.|டிச.)/i,wide:/^(ஜனவரி|பிப்ரவரி|மார்ச்|ஏப்ரல்|மே|ஜூன்|ஜூலை|ஆகஸ்ட்|செப்டம்பர்|அக்டோபர்|நவம்பர்|டிசம்பர்)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ஜ$/i,/^பி/i,/^மா/i,/^ஏ/i,/^மே/i,/^ஜூ/i,/^ஜூ/i,/^ஆ/i,/^செ/i,/^அ/i,/^ந/i,/^டி/i],any:[/^ஜன/i,/^பி/i,/^மா/i,/^ஏ/i,/^மே/i,/^ஜூன்/i,/^ஜூலை/i,/^ஆ/i,/^செ/i,/^அ/i,/^ந/i,/^டி/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(ஞா|தி|செ|பு|வி|வெ|ச)/i,short:/^(ஞா|தி|செ|பு|வி|வெ|ச)/i,abbreviated:/^(ஞாயி.|திங்.|செவ்.|புத.|வியா.|வெள்.|சனி)/i,wide:/^(ஞாயிறு|திங்கள்|செவ்வாய்|புதன்|வியாழன்|வெள்ளி|சனி)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ஞா/i,/^தி/i,/^செ/i,/^பு/i,/^வி/i,/^வெ/i,/^ச/i],any:[/^ஞா/i,/^தி/i,/^செ/i,/^பு/i,/^வி/i,/^வெ/i,/^ச/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(மு.ப|பி.ப|நள்|நண்|காலை|மதியம்|மாலை|இரவு)/i,any:/^(மு.ப|பி.ப|முற்பகல்|பிற்பகல்|நள்ளிரவு|நண்பகல்|காலை|மதியம்|மாலை|இரவு)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^மு/i,pm:/^பி/i,midnight:/^நள்/i,noon:/^நண்/i,morning:/காலை/i,afternoon:/மதியம்/i,evening:/மாலை/i,night:/இரவு/i}},defaultParseWidth:"any"})},lo={lessThanXSeconds:{standalone:{one:"సెకను కన్నా తక్కువ",other:"{{count}} సెకన్ల కన్నా తక్కువ"},withPreposition:{one:"సెకను",other:"{{count}} సెకన్ల"}},xSeconds:{standalone:{one:"ఒక సెకను",other:"{{count}} సెకన్ల"},withPreposition:{one:"ఒక సెకను",other:"{{count}} సెకన్ల"}},halfAMinute:{standalone:"అర నిమిషం",withPreposition:"అర నిమిషం"},lessThanXMinutes:{standalone:{one:"ఒక నిమిషం కన్నా తక్కువ",other:"{{count}} నిమిషాల కన్నా తక్కువ"},withPreposition:{one:"ఒక నిమిషం",other:"{{count}} నిమిషాల"}},xMinutes:{standalone:{one:"ఒక నిమిషం",other:"{{count}} నిమిషాలు"},withPreposition:{one:"ఒక నిమిషం",other:"{{count}} నిమిషాల"}},aboutXHours:{standalone:{one:"సుమారు ఒక గంట",other:"సుమారు {{count}} గంటలు"},withPreposition:{one:"సుమారు ఒక గంట",other:"సుమారు {{count}} గంటల"}},xHours:{standalone:{one:"ఒక గంట",other:"{{count}} గంటలు"},withPreposition:{one:"ఒక గంట",other:"{{count}} గంటల"}},xDays:{standalone:{one:"ఒక రోజు",other:"{{count}} రోజులు"},withPreposition:{one:"ఒక రోజు",other:"{{count}} రోజుల"}},aboutXWeeks:{standalone:{one:"సుమారు ఒక వారం",other:"సుమారు {{count}} వారాలు"},withPreposition:{one:"సుమారు ఒక వారం",other:"సుమారు {{count}} వారాలల"}},xWeeks:{standalone:{one:"ఒక వారం",other:"{{count}} వారాలు"},withPreposition:{one:"ఒక వారం",other:"{{count}} వారాలల"}},aboutXMonths:{standalone:{one:"సుమారు ఒక నెల",other:"సుమారు {{count}} నెలలు"},withPreposition:{one:"సుమారు ఒక నెల",other:"సుమారు {{count}} నెలల"}},xMonths:{standalone:{one:"ఒక నెల",other:"{{count}} నెలలు"},withPreposition:{one:"ఒక నెల",other:"{{count}} నెలల"}},aboutXYears:{standalone:{one:"సుమారు ఒక సంవత్సరం",other:"సుమారు {{count}} సంవత్సరాలు"},withPreposition:{one:"సుమారు ఒక సంవత్సరం",other:"సుమారు {{count}} సంవత్సరాల"}},xYears:{standalone:{one:"ఒక సంవత్సరం",other:"{{count}} సంవత్సరాలు"},withPreposition:{one:"ఒక సంవత్సరం",other:"{{count}} సంవత్సరాల"}},overXYears:{standalone:{one:"ఒక సంవత్సరం పైగా",other:"{{count}} సంవత్సరాలకు పైగా"},withPreposition:{one:"ఒక సంవత్సరం",other:"{{count}} సంవత్సరాల"}},almostXYears:{standalone:{one:"దాదాపు ఒక సంవత్సరం",other:"దాదాపు {{count}} సంవత్సరాలు"},withPreposition:{one:"దాదాపు ఒక సంవత్సరం",other:"దాదాపు {{count}} సంవత్సరాల"}}},ls={date:(0,n$.default)({formats:{full:"d, MMMM y, EEEE",long:"d MMMM, y",medium:"d MMM, y",short:"dd-MM-yy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}'కి'",long:"{{date}} {{time}}'కి'",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},ll={lastWeek:"'గత' eeee p",yesterday:"'నిన్న' p",today:"'ఈ రోజు' p",tomorrow:"'రేపు' p",nextWeek:"'తదుపరి' eeee p",other:"P"},ld={ordinalNumber:function(e,t){return Number(e)+"వ"},era:(0,nq.default)({values:{narrow:["క్రీ.పూ.","క్రీ.శ."],abbreviated:["క్రీ.పూ.","క్రీ.శ."],wide:["క్రీస్తు పూర్వం","క్రీస్తుశకం"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["త్రై1","త్రై2","త్రై3","త్రై4"],wide:["1వ త్రైమాసికం","2వ త్రైమాసికం","3వ త్రైమాసికం","4వ త్రైమాసికం"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["జ","ఫి","మా","ఏ","మే","జూ","జు","ఆ","సె","అ","న","డి"],abbreviated:["జన","ఫిబ్ర","మార్చి","ఏప్రి","మే","జూన్","జులై","ఆగ","సెప్టెం","అక్టో","నవం","డిసెం"],wide:["జనవరి","ఫిబ్రవరి","మార్చి","ఏప్రిల్","మే","జూన్","జులై","ఆగస్టు","సెప్టెంబర్","అక్టోబర్","నవంబర్","డిసెంబర్"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["ఆ","సో","మ","బు","గు","శు","శ"],short:["ఆది","సోమ","మంగళ","బుధ","గురు","శుక్ర","శని"],abbreviated:["ఆది","సోమ","మంగళ","బుధ","గురు","శుక్ర","శని"],wide:["ఆదివారం","సోమవారం","మంగళవారం","బుధవారం","గురువారం","శుక్రవారం","శనివారం"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"},abbreviated:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"},wide:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"}},defaultWidth:"wide",formattingValues:{narrow:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"},abbreviated:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"},wide:{am:"పూర్వాహ్నం",pm:"అపరాహ్నం",midnight:"అర్ధరాత్రి",noon:"మిట్టమధ్యాహ్నం",morning:"ఉదయం",afternoon:"మధ్యాహ్నం",evening:"సాయంత్రం",night:"రాత్రి"}},defaultFormattingWidth:"wide"})},lc={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(వ)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(క్రీ\.పూ\.|క్రీ\.శ\.)/i,abbreviated:/^(క్రీ\.?\s?పూ\.?|ప్ర\.?\s?శ\.?\s?పూ\.?|క్రీ\.?\s?శ\.?|సా\.?\s?శ\.?)/i,wide:/^(క్రీస్తు పూర్వం|ప్రస్తుత శకానికి పూర్వం|క్రీస్తు శకం|ప్రస్తుత శకం)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(పూ|శ)/i,/^సా/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^త్రై[1234]/i,wide:/^[1234](వ)? త్రైమాసికం/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(జూ|జు|జ|ఫి|మా|ఏ|మే|ఆ|సె|అ|న|డి)/i,abbreviated:/^(జన|ఫిబ్ర|మార్చి|ఏప్రి|మే|జూన్|జులై|ఆగ|సెప్|అక్టో|నవ|డిసె)/i,wide:/^(జనవరి|ఫిబ్రవరి|మార్చి|ఏప్రిల్|మే|జూన్|జులై|ఆగస్టు|సెప్టెంబర్|అక్టోబర్|నవంబర్|డిసెంబర్)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^జ/i,/^ఫి/i,/^మా/i,/^ఏ/i,/^మే/i,/^జూ/i,/^జు/i,/^ఆ/i,/^సె/i,/^అ/i,/^న/i,/^డి/i],any:[/^జన/i,/^ఫి/i,/^మా/i,/^ఏ/i,/^మే/i,/^జూన్/i,/^జులై/i,/^ఆగ/i,/^సె/i,/^అ/i,/^న/i,/^డి/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(ఆ|సో|మ|బు|గు|శు|శ)/i,short:/^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,abbreviated:/^(ఆది|సోమ|మం|బుధ|గురు|శుక్ర|శని)/i,wide:/^(ఆదివారం|సోమవారం|మంగళవారం|బుధవారం|గురువారం|శుక్రవారం|శనివారం)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ఆ/i,/^సో/i,/^మ/i,/^బు/i,/^గు/i,/^శు/i,/^శ/i],any:[/^ఆది/i,/^సోమ/i,/^మం/i,/^బుధ/i,/^గురు/i,/^శుక్ర/i,/^శని/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i,any:/^(పూర్వాహ్నం|అపరాహ్నం|అర్ధరాత్రి|మిట్టమధ్యాహ్నం|ఉదయం|మధ్యాహ్నం|సాయంత్రం|రాత్రి)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^పూర్వాహ్నం/i,pm:/^అపరాహ్నం/i,midnight:/^అర్ధ/i,noon:/^మిట్ట/i,morning:/ఉదయం/i,afternoon:/మధ్యాహ్నం/i,evening:/సాయంత్రం/i,night:/రాత్రి/i}},defaultParseWidth:"any"})},lu={lessThanXSeconds:{one:"น้อยกว่า 1 วินาที",other:"น้อยกว่า {{count}} วินาที"},xSeconds:{one:"1 วินาที",other:"{{count}} วินาที"},halfAMinute:"ครึ่งนาที",lessThanXMinutes:{one:"น้อยกว่า 1 นาที",other:"น้อยกว่า {{count}} นาที"},xMinutes:{one:"1 นาที",other:"{{count}} นาที"},aboutXHours:{one:"ประมาณ 1 ชั่วโมง",other:"ประมาณ {{count}} ชั่วโมง"},xHours:{one:"1 ชั่วโมง",other:"{{count}} ชั่วโมง"},xDays:{one:"1 วัน",other:"{{count}} วัน"},aboutXWeeks:{one:"ประมาณ 1 สัปดาห์",other:"ประมาณ {{count}} สัปดาห์"},xWeeks:{one:"1 สัปดาห์",other:"{{count}} สัปดาห์"},aboutXMonths:{one:"ประมาณ 1 เดือน",other:"ประมาณ {{count}} เดือน"},xMonths:{one:"1 เดือน",other:"{{count}} เดือน"},aboutXYears:{one:"ประมาณ 1 ปี",other:"ประมาณ {{count}} ปี"},xYears:{one:"1 ปี",other:"{{count}} ปี"},overXYears:{one:"มากกว่า 1 ปี",other:"มากกว่า {{count}} ปี"},almostXYears:{one:"เกือบ 1 ปี",other:"เกือบ {{count}} ปี"}},lp={date:(0,n$.default)({formats:{full:"วันEEEEที่ do MMMM y",long:"do MMMM y",medium:"d MMM y",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss น. zzzz",long:"H:mm:ss น. z",medium:"H:mm:ss น.",short:"H:mm น."},defaultWidth:"medium"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'เวลา' {{time}}",long:"{{date}} 'เวลา' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lh={lastWeek:"eeee'ที่แล้วเวลา' p",yesterday:"'เมื่อวานนี้เวลา' p",today:"'วันนี้เวลา' p",tomorrow:"'พรุ่งนี้เวลา' p",nextWeek:"eeee 'เวลา' p",other:"P"},lm={ordinalNumber:function(e){return Number(e)},era:(0,nq.default)({values:{narrow:["B","คศ"],abbreviated:["BC","ค.ศ."],wide:["ปีก่อนคริสตกาล","คริสต์ศักราช"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["ไตรมาสแรก","ไตรมาสที่สอง","ไตรมาสที่สาม","ไตรมาสที่สี่"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],abbreviated:["ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค."],wide:["มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],short:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],abbreviated:["อา.","จ.","อ.","พ.","พฤ.","ศ.","ส."],wide:["อาทิตย์","จันทร์","อังคาร","พุธ","พฤหัสบดี","ศุกร์","เสาร์"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"เช้า",afternoon:"บ่าย",evening:"เย็น",night:"กลางคืน"},abbreviated:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"เช้า",afternoon:"บ่าย",evening:"เย็น",night:"กลางคืน"},wide:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"เช้า",afternoon:"บ่าย",evening:"เย็น",night:"กลางคืน"}},defaultWidth:"wide",formattingValues:{narrow:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"ตอนเช้า",afternoon:"ตอนกลางวัน",evening:"ตอนเย็น",night:"ตอนกลางคืน"},abbreviated:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"ตอนเช้า",afternoon:"ตอนกลางวัน",evening:"ตอนเย็น",night:"ตอนกลางคืน"},wide:{am:"ก่อนเที่ยง",pm:"หลังเที่ยง",midnight:"เที่ยงคืน",noon:"เที่ยง",morning:"ตอนเช้า",afternoon:"ตอนกลางวัน",evening:"ตอนเย็น",night:"ตอนกลางคืน"}},defaultFormattingWidth:"wide"})},lg={ordinalNumber:(0,nX.default)({matchPattern:/^\d+/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^([bB]|[aA]|คศ)/i,abbreviated:/^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,wide:/^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^[bB]/i,/^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^ไตรมาส(ที่)? ?[1234]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|แรก|หนึ่ง)/i,/(2|สอง)/i,/(3|สาม)/i,/(4|สี่)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,abbreviated:/^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,wide:/^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i},defaultMatchWidth:"wide",parsePatterns:{wide:[/^มก/i,/^กุม/i,/^มี/i,/^เม/i,/^พฤษ/i,/^มิ/i,/^กรก/i,/^ส/i,/^กัน/i,/^ต/i,/^พฤศ/i,/^ธ/i],any:[/^ม\.?ค\.?/i,/^ก\.?พ\.?/i,/^มี\.?ค\.?/i,/^เม\.?ย\.?/i,/^พ\.?ค\.?/i,/^มิ\.?ย\.?/i,/^ก\.?ค\.?/i,/^ส\.?ค\.?/i,/^ก\.?ย\.?/i,/^ต\.?ค\.?/i,/^พ\.?ย\.?/i,/^ธ\.?ค\.?/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,short:/^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,abbreviated:/^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,wide:/^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i},defaultMatchWidth:"wide",parsePatterns:{wide:[/^อา/i,/^จั/i,/^อั/i,/^พุธ/i,/^พฤ/i,/^ศ/i,/^เส/i],any:[/^อา/i,/^จ/i,/^อ/i,/^พ(?!ฤ)/i,/^พฤ/i,/^ศ/i,/^ส/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^ก่อนเที่ยง/i,pm:/^หลังเที่ยง/i,midnight:/^เที่ยงคืน/i,noon:/^เที่ยง/i,morning:/เช้า/i,afternoon:/บ่าย/i,evening:/เย็น/i,night:/กลางคืน/i}},defaultParseWidth:"any"})},lf={lessThanXSeconds:{one:"bir saniyeden az",other:"{{count}} saniyeden az"},xSeconds:{one:"1 saniye",other:"{{count}} saniye"},halfAMinute:"yarım dakika",lessThanXMinutes:{one:"bir dakikadan az",other:"{{count}} dakikadan az"},xMinutes:{one:"1 dakika",other:"{{count}} dakika"},aboutXHours:{one:"yaklaşık 1 saat",other:"yaklaşık {{count}} saat"},xHours:{one:"1 saat",other:"{{count}} saat"},xDays:{one:"1 gün",other:"{{count}} gün"},aboutXWeeks:{one:"yaklaşık 1 hafta",other:"yaklaşık {{count}} hafta"},xWeeks:{one:"1 hafta",other:"{{count}} hafta"},aboutXMonths:{one:"yaklaşık 1 ay",other:"yaklaşık {{count}} ay"},xMonths:{one:"1 ay",other:"{{count}} ay"},aboutXYears:{one:"yaklaşık 1 yıl",other:"yaklaşık {{count}} yıl"},xYears:{one:"1 yıl",other:"{{count}} yıl"},overXYears:{one:"1 yıldan fazla",other:"{{count}} yıldan fazla"},almostXYears:{one:"neredeyse 1 yıl",other:"neredeyse {{count}} yıl"}},lb={date:(0,n$.default)({formats:{full:"d MMMM y EEEE",long:"d MMMM y",medium:"d MMM y",short:"dd.MM.yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'saat' {{time}}",long:"{{date}} 'saat' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lx={lastWeek:"'geçen hafta' eeee 'saat' p",yesterday:"'dün saat' p",today:"'bugün saat' p",tomorrow:"'yarın saat' p",nextWeek:"eeee 'saat' p",other:"P"},ly={ordinalNumber:function(e,t){return Number(e)+"."},era:(0,nq.default)({values:{abbreviated:["MÖ","MS"],narrow:["MÖ","MS"],wide:["Milattan Önce","Milattan Sonra"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1Ç","2Ç","3Ç","4Ç"],wide:["İlk çeyrek","İkinci Çeyrek","Üçüncü çeyrek","Son çeyrek"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["O","Ş","M","N","M","H","T","A","E","E","K","A"],abbreviated:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],wide:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["P","P","S","Ç","P","C","C"],short:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],abbreviated:["Paz","Pts","Sal","Çar","Per","Cum","Cts"],wide:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"öö",pm:"ös",midnight:"gy",noon:"ö",morning:"sa",afternoon:"ös",evening:"ak",night:"ge"},abbreviated:{am:"ÖÖ",pm:"ÖS",midnight:"gece yarısı",noon:"öğle",morning:"sabah",afternoon:"öğleden sonra",evening:"akşam",night:"gece"},wide:{am:"Ö.Ö.",pm:"Ö.S.",midnight:"gece yarısı",noon:"öğle",morning:"sabah",afternoon:"öğleden sonra",evening:"akşam",night:"gece"}},defaultWidth:"wide",formattingValues:{narrow:{am:"öö",pm:"ös",midnight:"gy",noon:"ö",morning:"sa",afternoon:"ös",evening:"ak",night:"ge"},abbreviated:{am:"ÖÖ",pm:"ÖS",midnight:"gece yarısı",noon:"öğlen",morning:"sabahleyin",afternoon:"öğleden sonra",evening:"akşamleyin",night:"geceleyin"},wide:{am:"ö.ö.",pm:"ö.s.",midnight:"gece yarısı",noon:"öğlen",morning:"sabahleyin",afternoon:"öğleden sonra",evening:"akşamleyin",night:"geceleyin"}},defaulFormattingWidth:"wide"})},lv={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(\.)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(mö|ms)/i,abbreviated:/^(mö|ms)/i,wide:/^(milattan önce|milattan sonra)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(^mö|^milattan önce)/i,/(^ms|^milattan sonra)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234]ç/i,wide:/^((i|İ)lk|(i|İ)kinci|üçüncü|son) çeyrek/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i],abbreviated:[/1ç/i,/2ç/i,/3ç/i,/4ç/i],wide:[/^(i|İ)lk çeyrek/i,/(i|İ)kinci çeyrek/i,/üçüncü çeyrek/i,/son çeyrek/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[oşmnhtaek]/i,abbreviated:/^(oca|şub|mar|nis|may|haz|tem|ağu|eyl|eki|kas|ara)/i,wide:/^(ocak|şubat|mart|nisan|mayıs|haziran|temmuz|ağustos|eylül|ekim|kasım|aralık)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^o/i,/^ş/i,/^m/i,/^n/i,/^m/i,/^h/i,/^t/i,/^a/i,/^e/i,/^e/i,/^k/i,/^a/i],any:[/^o/i,/^ş/i,/^mar/i,/^n/i,/^may/i,/^h/i,/^t/i,/^ağ/i,/^ey/i,/^ek/i,/^k/i,/^ar/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[psçc]/i,short:/^(pz|pt|sa|ça|pe|cu|ct)/i,abbreviated:/^(paz|pts|sal|çar|per|cum|cts)/i,wide:/^(pazar|pazartesi|salı|çarşamba|perşembe|cuma|cumartesi)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^p/i,/^p/i,/^s/i,/^ç/i,/^p/i,/^c/i,/^c/i],any:[/^pz/i,/^pt/i,/^sa/i,/^ça/i,/^pe/i,/^cu/i,/^ct/i],wide:[/^pazar/i,/^pazartesi/i,/^salı/i,/^çarşamba/i,/^perşembe/i,/^cuma/i,/cumartesi/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(öö|ös|gy|ö|sa|ös|ak|ge)/i,any:/^(ö\.?\s?[ös]\.?|öğleden sonra|gece yarısı|öğle|(sabah|öğ|akşam|gece)(leyin))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^ö\.?ö\.?/i,pm:/^ö\.?s\.?/i,midnight:/^(gy|gece yarısı)/i,noon:/^öğ/i,morning:/^sa/i,afternoon:/^öğleden sonra/i,evening:/^ak/i,night:/^ge/i}},defaultParseWidth:"any"})};function lC(e,t){if(void 0!==e.one&&1===t)return e.one;var i=t%10,n=t%100;return 1===i&&11!==n?e.singularNominative.replace("{{count}}",t):i>=2&&i<=4&&(n<10||n>20)?e.singularGenitive.replace("{{count}}",t):e.pluralGenitive.replace("{{count}}",t)}function lw(e){return function(t,i){if(!i.addSuffix)return lC(e.regular,t);if(i.comparison>0)if(e.future)return lC(e.future,t);else return"за "+lC(e.regular,t);return e.past?lC(e.past,t):lC(e.regular,t)+" тому"}}var lS={lessThanXSeconds:lw({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:lw({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:function(e,t){if(t.addSuffix)if(t.comparison>0)return"за півхвилини";else return"півхвилини тому";return"півхвилини"},lessThanXMinutes:lw({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:lw({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:lw({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:lw({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:lw({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} дня",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:lw({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижні"}}),xWeeks:lw({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижня",pluralGenitive:"{{count}} тижні"}}),aboutXMonths:lw({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяця",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:lw({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяця",pluralGenitive:"{{count}} місяців"}}),aboutXYears:lw({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:lw({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:lw({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:lw({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},lk={date:(0,n$.default)({formats:{full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},lA=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function lE(e){return"'у "+lA[e]+" о' p"}var l_={lastWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return lE(n);var a=lA[n];switch(n){case 0:case 3:case 5:case 6:return"'у минулу "+a+" о' p";case 1:case 2:case 4:return"'у минулий "+a+" о' p"}},yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:function(e,t,i){var n=e.getUTCDay();if(n8(e,t,i))return lE(n);var a=lA[n];switch(n){case 0:case 3:case 5:case 6:return"'у наступну "+a+" о' p";case 1:case 2:case 4:return"'у наступний "+a+" о' p"}},other:"P"},lI={ordinalNumber:function(e,t){var i,n=String((t||{}).unit);return i="date"===n?3===e||23===e?"-є":"-е":"minute"===n||"second"===n||"hour"===n?"-а":"-й",e+i},era:(0,nq.default)({values:{narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},defaultWidth:"wide",formattingValues:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},defaultWidth:"any",formattingValues:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},defaultFormattingWidth:"wide"})},lM={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(-?(е|й|є|а|я))?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^д/i,/^н/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер|берез|кві|трав?|чер|лип|сер|вер|жов|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопада?|грудень|грудня)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},defaultParseWidth:"any"})},lT={lessThanXSeconds:{one:"sekunddan kam",other:"{{count}} sekunddan kam"},xSeconds:{one:"1 sekund",other:"{{count}} sekund"},halfAMinute:"yarim minut",lessThanXMinutes:{one:"bir minutdan kam",other:"{{count}} minutdan kam"},xMinutes:{one:"1 minut",other:"{{count}} minut"},aboutXHours:{one:"tahminan 1 soat",other:"tahminan {{count}} soat"},xHours:{one:"1 soat",other:"{{count}} soat"},xDays:{one:"1 kun",other:"{{count}} kun"},aboutXWeeks:{one:"tahminan 1 hafta",other:"tahminan {{count}} hafta"},xWeeks:{one:"1 hafta",other:"{{count}} hafta"},aboutXMonths:{one:"tahminan 1 oy",other:"tahminan {{count}} oy"},xMonths:{one:"1 oy",other:"{{count}} oy"},aboutXYears:{one:"tahminan 1 yil",other:"tahminan {{count}} yil"},xYears:{one:"1 yil",other:"{{count}} yil"},overXYears:{one:"1 yildan ko'p",other:"{{count}} yildan ko'p"},almostXYears:{one:"deyarli 1 yil",other:"deyarli {{count}} yil"}},lL={date:(0,n$.default)({formats:{full:"EEEE, do MMMM, y",long:"do MMMM, y",medium:"d MMM, y",short:"dd/MM/yyyy"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"h:mm:ss zzzz",long:"h:mm:ss z",medium:"h:mm:ss",short:"h:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{any:"{{date}}, {{time}}"},defaultWidth:"any"})},lj={lastWeek:"'oldingi' eeee p 'da'",yesterday:"'kecha' p 'da'",today:"'bugun' p 'da'",tomorrow:"'ertaga' p 'da'",nextWeek:"eeee p 'da'",other:"P"},lP={ordinalNumber:function(e,t){return Number(e)},era:(0,nq.default)({values:{narrow:["M.A","M."],abbreviated:["M.A","M."],wide:["Miloddan Avvalgi","Milodiy"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["CH.1","CH.2","CH.3","CH.4"],wide:["1-chi chorak","2-chi chorak","3-chi chorak","4-chi chorak"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["Y","F","M","A","M","I","I","A","S","O","N","D"],abbreviated:["Yan","Fev","Mar","Apr","May","Iyun","Iyul","Avg","Sen","Okt","Noy","Dek"],wide:["Yanvar","Fevral","Mart","Aprel","May","Iyun","Iyul","Avgust","Sentabr","Oktabr","Noyabr","Dekabr"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["Y","D","S","CH","P","J","SH"],short:["Ya","Du","Se","Cho","Pa","Ju","Sha"],abbreviated:["Yak","Dush","Sesh","Chor","Pay","Jum","Shan"],wide:["Yakshanba","Dushanba","Seshanba","Chorshanba","Payshanba","Juma","Shanba"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"a",pm:"p",midnight:"y.t",noon:"p.",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"},abbreviated:{am:"AM",pm:"PM",midnight:"yarim tun",noon:"peshin",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"},wide:{am:"a.m.",pm:"p.m.",midnight:"yarim tun",noon:"peshin",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"y.t",noon:"p.",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"},abbreviated:{am:"AM",pm:"PM",midnight:"yarim tun",noon:"peshin",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"},wide:{am:"a.m.",pm:"p.m.",midnight:"yarim tun",noon:"peshin",morning:"ertalab",afternoon:"tushdan keyin",evening:"kechqurun",night:"tun"}},defaultFormattingWidth:"wide"})},lD={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)(chi)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(m\.a|m\.)/i,abbreviated:/^(m\.a\.?\s?m\.?)/i,wide:/^(miloddan avval|miloddan keyin)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](chi)? chorak/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^[yfmasond]/i,abbreviated:/^(yan|fev|mar|apr|may|iyun|iyul|avg|sen|okt|noy|dek)/i,wide:/^(yanvar|fevral|mart|aprel|may|iyun|iyul|avgust|sentabr|oktabr|noyabr|dekabr)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^y/i,/^f/i,/^m/i,/^a/i,/^m/i,/^i/i,/^i/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ya/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^iyun/i,/^iyul/i,/^av/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[ydschj]/i,short:/^(ya|du|se|cho|pa|ju|sha)/i,abbreviated:/^(yak|dush|sesh|chor|pay|jum|shan)/i,wide:/^(yakshanba|dushanba|seshanba|chorshanba|payshanba|juma|shanba)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^y/i,/^d/i,/^s/i,/^ch/i,/^p/i,/^j/i,/^sh/i],any:[/^ya/i,/^d/i,/^se/i,/^ch/i,/^p/i,/^j/i,/^sh/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|y\.t|p| (ertalab|tushdan keyin|kechqurun|tun))/i,any:/^([ap]\.?\s?m\.?|yarim tun|peshin| (ertalab|tushdan keyin|kechqurun|tun))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^y\.t/i,noon:/^pe/i,morning:/ertalab/i,afternoon:/tushdan keyin/i,evening:/kechqurun/i,night:/tun/i}},defaultParseWidth:"any"})},lN={lessThanXSeconds:{one:"dưới 1 giây",other:"dưới {{count}} giây"},xSeconds:{one:"1 giây",other:"{{count}} giây"},halfAMinute:"nửa phút",lessThanXMinutes:{one:"dưới 1 phút",other:"dưới {{count}} phút"},xMinutes:{one:"1 phút",other:"{{count}} phút"},aboutXHours:{one:"khoảng 1 giờ",other:"khoảng {{count}} giờ"},xHours:{one:"1 giờ",other:"{{count}} giờ"},xDays:{one:"1 ngày",other:"{{count}} ngày"},aboutXWeeks:{one:"khoảng 1 tuần",other:"khoảng {{count}} tuần"},xWeeks:{one:"1 tuần",other:"{{count}} tuần"},aboutXMonths:{one:"khoảng 1 tháng",other:"khoảng {{count}} tháng"},xMonths:{one:"1 tháng",other:"{{count}} tháng"},aboutXYears:{one:"khoảng 1 năm",other:"khoảng {{count}} năm"},xYears:{one:"1 năm",other:"{{count}} năm"},overXYears:{one:"hơn 1 năm",other:"hơn {{count}} năm"},almostXYears:{one:"gần 1 năm",other:"gần {{count}} năm"}},lR={date:(0,n$.default)({formats:{full:"EEEE, 'ngày' d MMMM 'năm' y",long:"'ngày' d MMMM 'năm' y",medium:"d MMM 'năm' y",short:"dd/MM/y"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},lO={lastWeek:"eeee 'tuần trước vào lúc' p",yesterday:"'hôm qua vào lúc' p",today:"'hôm nay vào lúc' p",tomorrow:"'ngày mai vào lúc' p",nextWeek:"eeee 'tới vào lúc' p",other:"P"},lB={ordinalNumber:function(e,t){var i=String((t||{}).unit),n=parseInt(e,10);if("quarter"===i)switch(n){case 1:return"I";case 2:return"II";case 3:return"III";case 4:return"IV"}else if("day"===i)switch(n){case 1:return"thứ 2";case 2:return"thứ 3";case 3:return"thứ 4";case 4:return"thứ 5";case 5:return"thứ 6";case 6:return"thứ 7";case 7:return"chủ nhật"}else if("week"===i)if(1===n)return"thứ nhất";else return"thứ "+n;else if("dayOfYear"===i)if(1===n)return"đầu tiên";else return"thứ "+n;return n},era:(0,nq.default)({values:{narrow:["TCN","SCN"],abbreviated:["trước CN","sau CN"],wide:["trước Công Nguyên","sau Công Nguyên"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["Quý 1","Quý 2","Quý 3","Quý 4"]},defaultWidth:"wide",formattingValues:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["quý I","quý II","quý III","quý IV"]},defaultFormattingWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["1","2","3","4","5","6","7","8","9","10","11","12"],abbreviated:["Thg 1","Thg 2","Thg 3","Thg 4","Thg 5","Thg 6","Thg 7","Thg 8","Thg 9","Thg 10","Thg 11","Thg 12"],wide:["Tháng Một","Tháng Hai","Tháng Ba","Tháng Tư","Tháng Năm","Tháng Sáu","Tháng Bảy","Tháng Tám","Tháng Chín","Tháng Mười","Tháng Mười Một","Tháng Mười Hai"]},defaultWidth:"wide",formattingValues:{narrow:["01","02","03","04","05","06","07","08","09","10","11","12"],abbreviated:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],wide:["tháng 01","tháng 02","tháng 03","tháng 04","tháng 05","tháng 06","tháng 07","tháng 08","tháng 09","tháng 10","tháng 11","tháng 12"]},defaultFormattingWidth:"wide"}),day:(0,nq.default)({values:{narrow:["CN","T2","T3","T4","T5","T6","T7"],short:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],abbreviated:["CN","Thứ 2","Thứ 3","Thứ 4","Thứ 5","Thứ 6","Thứ 7"],wide:["Chủ Nhật","Thứ Hai","Thứ Ba","Thứ Tư","Thứ Năm","Thứ Sáu","Thứ Bảy"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"am",pm:"pm",midnight:"nửa đêm",noon:"tr",morning:"sg",afternoon:"ch",evening:"tối",night:"đêm"},abbreviated:{am:"AM",pm:"PM",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"},wide:{am:"SA",pm:"CH",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"}},defaultWidth:"wide",formattingValues:{narrow:{am:"am",pm:"pm",midnight:"nửa đêm",noon:"tr",morning:"sg",afternoon:"ch",evening:"tối",night:"đêm"},abbreviated:{am:"AM",pm:"PM",midnight:"nửa đêm",noon:"trưa",morning:"sáng",afternoon:"chiều",evening:"tối",night:"đêm"},wide:{am:"SA",pm:"CH",midnight:"nửa đêm",noon:"giữa trưa",morning:"vào buổi sáng",afternoon:"vào buổi chiều",evening:"vào buổi tối",night:"vào ban đêm"}},defaultFormattingWidth:"wide"})},lz={ordinalNumber:(0,nX.default)({matchPattern:/^(\d+)/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(tcn|scn)/i,abbreviated:/^(trước CN|sau CN)/i,wide:/^(trước Công Nguyên|sau Công Nguyên)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^t/i,/^s/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^([1234]|i{1,3}v?)/i,abbreviated:/^q([1234]|i{1,3}v?)/i,wide:/^quý ([1234]|i{1,3}v?)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|i)$/i,/(2|ii)$/i,/(3|iii)$/i,/(4|iv)$/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(0?[2-9]|10|11|12|0?1)/i,abbreviated:/^thg[ _]?(0?[1-9](?!\d)|10|11|12)/i,wide:/^tháng ?(Một|Hai|Ba|Tư|Năm|Sáu|Bảy|Tám|Chín|Mười|Mười ?Một|Mười ?Hai|0?[1-9](?!\d)|10|11|12)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/0?1$/i,/0?2/i,/3/,/4/,/5/,/6/,/7/,/8/,/9/,/10/,/11/,/12/],abbreviated:[/^thg[ _]?0?1(?!\d)/i,/^thg[ _]?0?2/i,/^thg[ _]?0?3/i,/^thg[ _]?0?4/i,/^thg[ _]?0?5/i,/^thg[ _]?0?6/i,/^thg[ _]?0?7/i,/^thg[ _]?0?8/i,/^thg[ _]?0?9/i,/^thg[ _]?10/i,/^thg[ _]?11/i,/^thg[ _]?12/i],wide:[/^tháng ?(Một|0?1(?!\d))/i,/^tháng ?(Hai|0?2)/i,/^tháng ?(Ba|0?3)/i,/^tháng ?(Tư|0?4)/i,/^tháng ?(Năm|0?5)/i,/^tháng ?(Sáu|0?6)/i,/^tháng ?(Bảy|0?7)/i,/^tháng ?(Tám|0?8)/i,/^tháng ?(Chín|0?9)/i,/^tháng ?(Mười|10)/i,/^tháng ?(Mười ?Một|11)/i,/^tháng ?(Mười ?Hai|12)/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^(CN|T2|T3|T4|T5|T6|T7)/i,short:/^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,abbreviated:/^(CN|Th ?2|Th ?3|Th ?4|Th ?5|Th ?6|Th ?7)/i,wide:/^(Chủ ?Nhật|Chúa ?Nhật|thứ ?Hai|thứ ?Ba|thứ ?Tư|thứ ?Năm|thứ ?Sáu|thứ ?Bảy)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],short:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],abbreviated:[/CN/i,/2/i,/3/i,/4/i,/5/i,/6/i,/7/i],wide:[/(Chủ|Chúa) ?Nhật/i,/Hai/i,/Ba/i,/Tư/i,/Năm/i,/Sáu/i,/Bảy/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{narrow:/^(a|p|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,abbreviated:/^(am|pm|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i,wide:/^(ch[^i]*|sa|nửa đêm|trưa|(giờ) (sáng|chiều|tối|đêm))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^(a|sa)/i,pm:/^(p|ch[^i]*)/i,midnight:/nửa đêm/i,noon:/trưa/i,morning:/sáng/i,afternoon:/chiều/i,evening:/tối/i,night:/^đêm/i}},defaultParseWidth:"any"})},lF={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},lH={date:(0,n$.default)({formats:{full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})};function lW(e,t,i,n){return n8(e,t,i)?n:e.getTime()>t.getTime()?"'下个'"+n:"'上个'"+n}var lU={lastWeek:lW,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:lW,other:"PP p"},lV={ordinalNumber:function(e,t){var i=Number(e);switch(String((t||{}).unit)){case"date":return i.toString()+"日";case"hour":return i.toString()+"时";case"minute":return i.toString()+"分";case"second":return i.toString()+"秒";default:return"第 "+i.toString()}},era:(0,nq.default)({values:{narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["第一刻","第二刻","第三刻","第四刻"],wide:["第一刻钟","第二刻钟","第三刻钟","第四刻钟"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},defaultWidth:"wide",formattingValues:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},defaultFormattingWidth:"wide"})},lG={ordinalNumber:(0,nX.default)({matchPattern:/^(第\s*)?\d+(日|时|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(前)/i,/^(公元)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},defaultParseWidth:"any"})},l$={lessThanXSeconds:{one:"少於 1 秒",other:"少於 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分鐘",lessThanXMinutes:{one:"少於 1 分鐘",other:"少於 {{count}} 分鐘"},xMinutes:{one:"1 分鐘",other:"{{count}} 分鐘"},xHours:{one:"1 小時",other:"{{count}} 小時"},aboutXHours:{one:"大約 1 小時",other:"大約 {{count}} 小時"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大約 1 個星期",other:"大約 {{count}} 個星期"},xWeeks:{one:"1 個星期",other:"{{count}} 個星期"},aboutXMonths:{one:"大約 1 個月",other:"大約 {{count}} 個月"},xMonths:{one:"1 個月",other:"{{count}} 個月"},aboutXYears:{one:"大約 1 年",other:"大約 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超過 1 年",other:"超過 {{count}} 年"},almostXYears:{one:"將近 1 年",other:"將近 {{count}} 年"}},lZ={date:(0,n$.default)({formats:{full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},defaultWidth:"full"}),time:(0,n$.default)({formats:{full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},defaultWidth:"full"}),dateTime:(0,n$.default)({formats:{full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},defaultWidth:"full"})},lK={lastWeek:"'上個'eeee p",yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:"'下個'eeee p",other:"P"},lq={ordinalNumber:function(e,t){var i=Number(e);switch(String((t||{}).unit)){case"date":return i.toString()+"日";case"hour":return i.toString()+"時";case"minute":return i.toString()+"分";case"second":return i.toString()+"秒";default:return"第 "+i.toString()}},era:(0,nq.default)({values:{narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},defaultWidth:"wide"}),quarter:(0,nq.default)({values:{narrow:["1","2","3","4"],abbreviated:["第一刻","第二刻","第三刻","第四刻"],wide:["第一刻鐘","第二刻鐘","第三刻鐘","第四刻鐘"]},defaultWidth:"wide",argumentCallback:function(e){return Number(e)-1}}),month:(0,nq.default)({values:{narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},defaultWidth:"wide"}),day:(0,nq.default)({values:{narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["週日","週一","週二","週三","週四","週五","週六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},defaultWidth:"wide"}),dayPeriod:(0,nq.default)({values:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"}},defaultWidth:"wide",formattingValues:{narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜間"}},defaultFormattingWidth:"wide"})},lY={ordinalNumber:(0,nX.default)({matchPattern:/^(第\s*)?\d+(日|時|分|秒)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:(0,nQ.default)({matchPatterns:{narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^(前)/i,/^(公元)/i]},defaultParseWidth:"any"}),quarter:(0,nQ.default)({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻鐘/i},defaultMatchWidth:"wide",parsePatterns:{any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:(0,nQ.default)({matchPatterns:{narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},defaultParseWidth:"any"}),day:(0,nQ.default)({matchPatterns:{narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^週[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},defaultMatchWidth:"wide",parsePatterns:{any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},defaultParseWidth:"any"}),dayPeriod:(0,nQ.default)({matchPatterns:{any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},defaultParseWidth:"any"})};let lX={af:{code:"af",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof nG[e]?nG[e]:1===t?nG[e].one:nG[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"oor "+n;else return n+" gelede";return n},formatLong:nZ,formatRelative:function(e){return nK[e]},localize:nY,match:nJ,options:{weekStartsOn:0,firstWeekContainsDate:1}},ar:{code:"ar-SA",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof n0[e]?n0[e]:1===t?n0[e].one:2===t?n0[e].two:t<=10?n0[e].threeToTen.replace("{{count}}",t):n0[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"في خلال "+n;else return"منذ "+n;return n},formatLong:n1,formatRelative:function(e,t,i,n){return n2[e]},localize:n3,match:n5,options:{weekStartsOn:0,firstWeekContainsDate:1}},bg:{code:"bg",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof n4[e]?n4[e]:1===t?n4[e].one:n4[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"след "+n;else return"преди "+n;return n},formatLong:n6,formatRelative:function(e,t,i,n){var a=at[e];return"function"==typeof a?a(t,i,n):a},localize:an,match:aa,options:{weekStartsOn:1,firstWeekContainsDate:1}},bn:{code:"bn",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof al[e]?al[e]:1===t?al[e].one:al[e].other.replace("{{count}}",as.numberToLocale(t)),i.addSuffix)if(i.comparison>0)return n+" এর মধ্যে";else return n+" আগে";return n},formatLong:ad,formatRelative:function(e,t,i,n){return ac[e]},localize:as,match:au,options:{weekStartsOn:0,firstWeekContainsDate:1}},ca:{code:"ca",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof ap[e]?ap[e]:1===t?ap[e].one:11===t&&ap[e].eleven?ap[e].eleven:ap[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"en "+n;else return"fa "+n;return n},formatLong:ah,formatRelative:function(e,t,i,n){return 1!==t.getUTCHours()?ag[e]:am[e]},localize:af,match:ab,options:{weekStartsOn:1,firstWeekContainsDate:4}},cs:{code:"cs",formatDistance:function(e,t,i){i=i||{};var n,a,r=ax[e];n="object"==typeof r.other?"other":1===t?"one":t>1&&t<5||0===t?"few":"many";var o=!0===i.addSuffix,s=i.comparison;return a=o&&-1===s?"past":o&&1===s?"future":"regular",r[n][a].replace("{{count}}",t)},formatLong:ay,formatRelative:function(e,t,i,n){var a=aC[e];return"function"==typeof a?a(t,i,n):a},localize:aw,match:aS,options:{weekStartsOn:1,firstWeekContainsDate:4}},cy:{code:"cy",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof ak[e]?ak[e]:1===t?ak[e].one:2===t&&ak[e].two?ak[e].two:ak[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"mewn "+n;else return n+" yn ôl";return n},formatLong:aA,formatRelative:function(e,t,i,n){return aE[e]},localize:a_,match:aI,options:{weekStartsOn:0,firstWeekContainsDate:1}},da:{code:"da",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof aM[e]?aM[e]:1===t?aM[e].one:aM[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"om "+n;else return n+" siden";return n},formatLong:aT,formatRelative:function(e,t,i,n){return aL[e]},localize:aj,match:aP,options:{weekStartsOn:1,firstWeekContainsDate:4}},de:{code:"de",formatDistance:function(e,t,i){var n,a=(i=i||{}).addSuffix?aD[e].withPreposition:aD[e].standalone;if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"in "+n;else return"vor "+n;return n},formatLong:aN,formatRelative:function(e,t,i,n){return aR[e]},localize:aO,match:aB,options:{weekStartsOn:1,firstWeekContainsDate:4}},el:{code:"el",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof az[e]?az[e]:1===t?az[e].one:az[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"σε "+n;else return n+" πριν";return n},formatLong:aF,formatRelative:function(e,t,i,n){var a=aH[e];return"function"==typeof a?a(t,i,n):a},localize:aW,match:aU,options:{weekStartsOn:1,firstWeekContainsDate:4}},en:aV.enUS,es:{code:"es",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof aG[e]?aG[e]:1===t?aG[e].one:aG[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"en "+n;else return"hace "+n;return n},formatLong:a$,formatRelative:function(e,t,i,n){return 1!==t.getUTCHours()?aK[e]:aZ[e]},localize:aq,match:aY,options:{weekStartsOn:1,firstWeekContainsDate:1}},et:{code:"et",formatDistance:function(e,t,i){var n,a=(i=i||{}).addSuffix?aX[e].withPreposition:aX[e].standalone;if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+" pärast";else return n+" eest";return n},formatLong:aQ,formatRelative:function(e,t,i,n){return aJ[e]},localize:a2,match:a3,options:{weekStartsOn:1,firstWeekContainsDate:4}},fa:{code:"fa-IR",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof a5[e]?a5[e]:1===t?a5[e].one:a5[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"در "+n;else return n+" قبل";return n},formatLong:a4,formatRelative:function(e,t,i,n){return a6[e]},localize:a9,match:a8,options:{weekStartsOn:6,firstWeekContainsDate:1}},fi:{code:"fi",formatDistance:function(e,t,i){i=i||{};var n=rr[e],a=1===t?n.one:n.other.replace("{{count}}",t);if(i.addSuffix)if(i.comparison>0)return n.futureTense(a)+" kuluttua";else return a+" sitten";return a},formatLong:ro,formatRelative:function(e,t,i,n){return rs[e]},localize:rp,match:rh,options:{weekStartsOn:1,firstWeekContainsDate:4}},fr:{code:"fr",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof rm[e]?rm[e]:1===t?rm[e].one:rm[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"dans "+n;else return"il y a "+n;return n},formatLong:rg,formatRelative:function(e,t,i,n){return rf[e]},localize:rb,match:rx,options:{weekStartsOn:1,firstWeekContainsDate:4}},gu:{code:"gu",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof ry[e]?ry[e]:1===t?ry[e].one:ry[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+"માં";else return n+" પહેલાં";return n},formatLong:rv,formatRelative:function(e,t,i,n){return rC[e]},localize:rw,match:rS,options:{weekStartsOn:1,firstWeekContainsDate:4}},he:{code:"he",formatDistance:function(e,t,i){if(i=i||{},"xDays"===e&&i.addSuffix&&t<=2){var n;return i.comparison>0?({1:"מחר",2:"מחרתיים"})[t]:({1:"אתמול",2:"שלשום"})[t]}if(n="string"==typeof rk[e]?rk[e]:1===t?rk[e].one:2===t?rk[e].two:rk[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"בעוד "+n;else return"לפני "+n;return n},formatLong:rA,formatRelative:function(e,t,i,n){return rE[e]},localize:r_,match:rM,options:{weekStartsOn:0,firstWeekContainsDate:1}},hi:{code:"hi",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof rP[e]?rP[e]:1===t?rP[e].one:rP[e].other.replace("{{count}}",rj.numberToLocale(t)),i.addSuffix)if(i.comparison>0)return n+"मे ";else return n+" पहले";return n},formatLong:rD,formatRelative:function(e,t,i,n){return rN[e]},localize:rj,match:rR,options:{weekStartsOn:0,firstWeekContainsDate:4}},hr:{code:"hr",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof rO[e]?rO[e]:1===t?i.addSuffix?i.comparison>0?rO[e].one.withPrepositionIn:rO[e].one.withPrepositionAgo:rO[e].one.standalone:t%10>1&&t%10<5&&"1"!==String(t).substr(-2,1)?rO[e].dual.replace("{{count}}",t):rO[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"za "+n;else return"prije "+n;return n},formatLong:rB,formatRelative:function(e,t,i,n){var a=rz[e];return"function"==typeof a?a(t):a},localize:rF,match:rH,options:{weekStartsOn:1,firstWeekContainsDate:1}},hu:{code:"hu",formatDistance:function(e,t,i){i=i||{};var n,a,r,o,s,l=e.match(/about|over|almost|lessthan/i),d=e.replace(l,"");return n=i.addSuffix,a=d.toLowerCase(),r=i.comparison,o=n?rV[a][r]:rU[a],s="halfaminute"===a?o:t+o,l&&(s=rW[l[0].toLowerCase()]+" "+s),s},formatLong:rG,formatRelative:function(e,t,i,n){var a=rK[e];return"function"==typeof a?a(t,i,n):a},localize:rq,match:rY,options:{weekStartsOn:1,firstWeekContainsDate:4}},id:{code:"id",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof rX[e]?rX[e]:1===t?rX[e].one:rX[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"dalam waktu "+n;else return n+" yang lalu";return n},formatLong:rQ,formatRelative:function(e,t,i,n){return rJ[e]},localize:r0,match:r1,options:{weekStartsOn:1,firstWeekContainsDate:1}},is:{code:"is",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof r2[e]?r2[e]:1===t?r2[e].one:r2[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"í "+n;else return n+" síðan";return n},formatLong:r3,formatRelative:function(e,t,i,n){return r5[e]},localize:r4,match:r6,options:{weekStartsOn:1,firstWeekContainsDate:4}},it:{code:"it",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof r9[e]?r9[e]:1===t?r9[e].one:r9[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"tra "+n;else return n+" fa";return n},formatLong:r8,formatRelative:function(e,t,i,n){var a=ot[e];return"function"==typeof a?a(t,i,n):a},localize:oi,match:on,options:{weekStartsOn:1,firstWeekContainsDate:4}},ja:{code:"ja",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof oa[e]?oa[e]:1===t?i.addSuffix&&oa[e].oneWithSuffix?oa[e].oneWithSuffix:oa[e].one:i.addSuffix&&oa[e].otherWithSuffix?oa[e].otherWithSuffix.replace("{{count}}",t):oa[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+"後";else return n+"前";return n},formatLong:or,formatRelative:function(e,t,i,n){return oo[e]},localize:os,match:ol,options:{weekStartsOn:0,firstWeekContainsDate:1}},kk:{code:"kk",formatDistance:function(e,t,i){return i=i||{},ou[e](t,i)},formatLong:op,formatRelative:function(e,t,i,n){var a=og[e];return"function"==typeof a?a(t,i,n):a},localize:ob,match:ox,options:{weekStartsOn:1,firstWeekContainsDate:1}},kn:{code:"kn",formatDistance:function(e,t,i){return i=i||{},("string"==typeof oy[e]?oy[e]:1===t?ov(oy[e].one,i):ov(oy[e].other,i)).replace("{{count}}",t)},formatLong:oC,formatRelative:function(e,t,i,n){return ow[e]},localize:oS,match:ok,options:{weekStartsOn:1,firstWeekContainsDate:1}},ko:{code:"ko",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof oA[e]?oA[e]:1===t?oA[e].one:oA[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+" 후";else return n+" 전";return n},formatLong:oE,formatRelative:function(e,t,i,n){return o_[e]},localize:oI,match:oM,options:{weekStartsOn:0,firstWeekContainsDate:1}},lt:oz,"lt-LT":oz,lv:{code:"lv",formatDistance:function(e,t,i){i=i||{};var n=oH[e](t,i);if(i.addSuffix)if(i.comparison>0)return"pēc "+n;else return"pirms "+n;return n},formatLong:oW,formatRelative:function(e,t,i,n){var a=oV[e];return"function"==typeof a?a(t,i,n):a},localize:oG,match:o$,options:{weekStartsOn:1,firstWeekContainsDate:4}},mk:{code:"mk",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof oZ[e]?oZ[e]:1===t?oZ[e].one:oZ[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"за "+n;else return"пред "+n;return n},formatLong:oK,formatRelative:function(e,t,i,n){var a=oX[e];return"function"==typeof a?a(t,i,n):a},localize:oQ,match:oJ,options:{weekStartsOn:1,firstWeekContainsDate:4}},ms:{code:"ms",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof o0[e]?o0[e]:1===t?o0[e].one:o0[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"dalam masa "+n;else return n+" yang lalu";return n},formatLong:o1,formatRelative:function(e,t,i,n){return o2[e]},localize:o3,match:o5,options:{weekStartsOn:1,firstWeekContainsDate:1}},nl:{code:"nl",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof st[e]?st[e]:1===t?st[e].one:st[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"over "+n;else return n+" geleden";return n},formatLong:si,formatRelative:function(e,t,i,n){return sn[e]},localize:sa,match:sr,options:{weekStartsOn:1,firstWeekContainsDate:4}},no:{code:"nb",formatDistance:function(e,t,i){i=i||{onlyNumeric:!1};var n,a=o4[e];if(n="string"==typeof a?a:0===t||t>1?i.onlyNumeric?a.plural.replace("{{count}}",t):a.plural.replace("{{count}}",t<13?o6[t]:t):a.singular,i.addSuffix)if(i.comparison>0)return"om "+n;else return n+" siden";return n},formatLong:o9,formatRelative:function(e,t,i,n){return o8[e]},localize:o7,match:se,options:{weekStartsOn:1,firstWeekContainsDate:4}},pl:{code:"pl",formatDistance:function(e,t,i){i=i||{};var n=ss[e];return i.addSuffix?i.comparison>0?"za "+so(n,t,"future"):so(n,t,"past")+" temu":so(n,t)},formatLong:sl,formatRelative:function(e,t,i,n){var a=sm[e];return"function"==typeof a?a(e,t,i,n):a},localize:sg,match:sf,options:{weekStartsOn:1,firstWeekContainsDate:4}},pt:{code:"pt",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof sb[e]?sb[e]:1===t?sb[e].one:sb[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"daqui a "+n;else return"há "+n;return n},formatLong:sx,formatRelative:function(e,t,i,n){return sy[e]},localize:sv,match:sC,options:{weekStartsOn:1,firstWeekContainsDate:4}},"pt-br":{code:"pt-BR",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof sw[e]?sw[e]:1===t?sw[e].one:sw[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"em "+n;else return"há "+n;return n},formatLong:sS,formatRelative:function(e,t,i,n){var a=sk[e];return"function"==typeof a?a(t,i,n):a},localize:sA,match:sE,options:{weekStartsOn:0,firstWeekContainsDate:1}},ro:{code:"ro",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof s_[e]?s_[e]:1===t?s_[e].one:s_[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"în "+n;else return n+" în urmă";return n},formatLong:sI,formatRelative:function(e,t,i,n){return sM[e]},localize:sT,match:sL,options:{weekStartsOn:1,firstWeekContainsDate:1}},ru:{code:"ru",formatDistance:function(e,t,i){return i=i||{},sD[e](t,i)},formatLong:sN,formatRelative:function(e,t,i,n){var a=sB[e];return"function"==typeof a?a(t,i,n):a},localize:sz,match:sF,options:{weekStartsOn:1,firstWeekContainsDate:1}},sl:{code:"sl",formatDistance:function(e,t,i){var n=sH,a="";if((i=i||{}).addSuffix&&(i.comparison>0?(n=sU,a+="čez "):(n=sW,a+="pred ")),"string"==typeof n[e])a+=n[e];else{var r=function(e){switch(e%100){case 1:return"one";case 2:return"two";case 3:case 4:return"few";default:return"other"}}(t);a+=n[e][r].replace("{{count}}",t)}return a},formatLong:sV,formatRelative:function(e,t,i,n){var a=sG[e];return"function"==typeof a?a(t):a},localize:s$,match:sZ,options:{weekStartsOn:1,firstWeekContainsDate:1}},sq:{code:"sq",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof sK[e]?sK[e]:1===t?sK[e].one:sK[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"në "+n;else return n+" më parë";return n},formatLong:sq,formatRelative:function(e,t,i,n){return sY[e]},localize:sX,match:sQ,options:{weekStartsOn:1,firstWeekContainsDate:1}},sr:{code:"sr",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof sJ[e]?sJ[e]:1===t?i.addSuffix?i.comparison>0?sJ[e].one.withPrepositionIn:sJ[e].one.withPrepositionAgo:sJ[e].one.standalone:t%10>1&&t%10<5&&"1"!==String(t).substr(-2,1)?sJ[e].dual.replace("{{count}}",t):sJ[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return"за "+n;else return"пре "+n;return n},formatLong:s0,formatRelative:function(e,t,i,n){var a=s1[e];return"function"==typeof a?a(t):a},localize:s2,match:s3,options:{weekStartsOn:1,firstWeekContainsDate:1}},sv:{code:"sv",formatDistance:function(e,t,i){i=i||{onlyNumeric:!1};var n,a=s5[e];if(n="string"==typeof a?a:0===t||t>1?i.onlyNumeric?a.plural.replace("{{count}}",t):a.plural.replace("{{count}}",t<13?s4[t]:t):a.singular,i.addSuffix)if(i.comparison>0)return"om "+n;else return n+" sedan";return n},formatLong:s6,formatRelative:function(e,t,i,n){return s9[e]},localize:s8,match:s7,options:{weekStartsOn:1,firstWeekContainsDate:4}},ta:{code:"ta",formatDistance:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return(le[e].default?lt(le[e],i):1===t?lt(le[e].one,i):lt(le[e].other,i)).replace("{{count}}",t)},formatLong:li,formatRelative:function(e,t,i,n){return ln[e]},localize:la,match:lr,options:{weekStartsOn:1,firstWeekContainsDate:4}},te:{code:"te",formatDistance:function(e,t,i){var n,a=(i=i||{}).addSuffix?lo[e].withPreposition:lo[e].standalone;if(n="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+"లో";else return n+" క్రితం";return n},formatLong:ls,formatRelative:function(e,t,i,n){return ll[e]},localize:ld,match:lc,options:{weekStartsOn:0,firstWeekContainsDate:1}},th:{code:"th",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof lu[e]?lu[e]:1===t?lu[e].one:lu[e].other.replace("{{count}}",t),i.addSuffix)if(!(i.comparison>0))return n+"ที่ผ่านมา";else if("halfAMinute"===e)return"ใน"+n;else return"ใน "+n;return n},formatLong:lp,formatRelative:function(e,t,i,n){return lh[e]},localize:lm,match:lg,options:{weekStartsOn:0,firstWeekContainsDate:1}},tr:{code:"tr",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof lf[e]?lf[e]:1===t?lf[e].one:lf[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+" sonra";else return n+" önce";return n},formatLong:lb,formatRelative:function(e,t,i,n){return lx[e]},localize:ly,match:lv,options:{weekStartsOn:1,firstWeekContainsDate:1}},uk:{code:"uk",formatDistance:function(e,t,i){return i=i||{},lS[e](t,i)},formatLong:lk,formatRelative:function(e,t,i,n){var a=l_[e];return"function"==typeof a?a(t,i,n):a},localize:lI,match:lM,options:{weekStartsOn:1,firstWeekContainsDate:1}},uz:{code:"uz",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof lT[e]?lT[e]:1===t?lT[e].one:lT[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+" dan keyin";else return n+" oldin";return n},formatLong:lL,formatRelative:function(e,t,i,n){return lj[e]},localize:lP,match:lD,options:{weekStartsOn:1,firstWeekContainsDate:1}},vi:{code:"vi",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof lN[e]?lN[e]:1===t?lN[e].one:lN[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+" nữa";else return n+" trước";return n},formatLong:lR,formatRelative:function(e,t,i,n){return lO[e]},localize:lB,match:lz,options:{weekStartsOn:1,firstWeekContainsDate:1}},"zh-cn":{code:"zh-CN",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof lF[e]?lF[e]:1===t?lF[e].one:lF[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+"内";else return n+"前";return n},formatLong:lH,formatRelative:function(e,t,i,n){var a=lU[e];return"function"==typeof a?a(t,i,n,"eeee p"):a},localize:lV,match:lG,options:{weekStartsOn:1,firstWeekContainsDate:4}},"zh-tw":{code:"zh-TW",formatDistance:function(e,t,i){var n;if(i=i||{},n="string"==typeof l$[e]?l$[e]:1===t?l$[e].one:l$[e].other.replace("{{count}}",t),i.addSuffix)if(i.comparison>0)return n+"內";else return n+"前";return n},formatLong:lZ,formatRelative:function(e,t,i,n){return lK[e]},localize:lq,match:lY,options:{weekStartsOn:1,firstWeekContainsDate:4}}},lQ=()=>lX[d.i18n.locale],lJ=(e,t)=>e?(0,nk.format)("string"==typeof e?nF(e):e,t,{locale:lQ()}):"";e.s(["formatDate",0,lJ,"formatDateRelative",0,(e,t)=>e?function(e,t){var i,n,a,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};(0,n_.default)(2,arguments);var o=r.locale||nT.default;if(!o.formatDistance)throw RangeError("locale must contain formatDistance property");var s=nI(e,t);if(isNaN(s))throw RangeError("Invalid time value");var l=nM(r);l.addSuffix=!!r.addSuffix,l.comparison=s,s>0?(i=(0,nE.default)(t),n=(0,nE.default)(e)):(i=(0,nE.default)(e),n=(0,nE.default)(t));var d=function(e,t){(0,n_.default)(2,arguments);var i=nj(e,t)/1e3;return i>0?Math.floor(i):Math.ceil(i)}(n,i),c=Math.round((d-((0,nA.default)(n)-(0,nA.default)(i))/1e3)/60);if(c<2)if(r.includeSeconds)if(d<5)return o.formatDistance("lessThanXSeconds",5,l);else if(d<10)return o.formatDistance("lessThanXSeconds",10,l);else if(d<20)return o.formatDistance("lessThanXSeconds",20,l);else if(d<40)return o.formatDistance("halfAMinute",null,l);else if(d<60)return o.formatDistance("lessThanXMinutes",1,l);else return o.formatDistance("xMinutes",1,l);else if(0===c)return o.formatDistance("lessThanXMinutes",1,l);else return o.formatDistance("xMinutes",c,l);if(c<45)return o.formatDistance("xMinutes",c,l);if(c<90)return o.formatDistance("aboutXHours",1,l);if(c<1440){var u=Math.round(c/60);return o.formatDistance("aboutXHours",u,l)}if(c<2520)return o.formatDistance("xDays",1,l);else if(c<43200){var p=Math.round(c/1440);return o.formatDistance("xDays",p,l)}else if(c<86400)return a=Math.round(c/43200),o.formatDistance("aboutXMonths",a,l);if((a=function(e,t){(0,n_.default)(2,arguments);var i,n=(0,nE.default)(e),a=(0,nE.default)(t),r=nI(n,a),o=Math.abs(function(e,t){(0,n_.default)(2,arguments);var i=(0,nE.default)(e),n=(0,nE.default)(t);return 12*(i.getFullYear()-n.getFullYear())+(i.getMonth()-n.getMonth())}(n,a));if(o<1)i=0;else{1===n.getMonth()&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-r*o);var s=nI(n,a)===-r;(function(e){(0,n_.default)(1,arguments);var t=(0,nE.default)(e);return(function(e){(0,n_.default)(1,arguments);var t=(0,nE.default)(e);return t.setHours(23,59,59,999),t})(t).getTime()===(function(e){(0,n_.default)(1,arguments);var t=(0,nE.default)(e),i=t.getMonth();return t.setFullYear(t.getFullYear(),i+1,0),t.setHours(23,59,59,999),t})(t).getTime()})((0,nE.default)(e))&&1===o&&1===nI(e,a)&&(s=!1),i=r*(o-Number(s))}return 0===i?0:i}(n,i))<12){var h=Math.round(c/43200);return o.formatDistance("xMonths",h,l)}var m=a%12,g=Math.floor(a/12);return m<3?o.formatDistance("aboutXYears",g,l):m<9?o.formatDistance("overXYears",g,l):o.formatDistance("almostXYears",g+1,l)}("string"==typeof e?nF(e):e,t?"string"==typeof t?nF(t):t:new Date,{locale:lQ()}):"","formatDistanceToNowStrict",0,e=>e?nL("string"==typeof e?nF(e):e,{locale:lQ()}):"","getLocaleForDateFns",0,lQ],601583);var l0=e.i(192094);let l1=e=>{let{credits:t,lowCreditStatus:i}=(0,i3.useCreditStatus)(),n=(0,i5.useFeatureFlag)("plan-credits"),a=n?.[e]?.monthlyCredits,r=a?d.i18n.number(a):null,o=(a??0)*2,s=o-(t??0)<1500,l="number"==typeof t?d.i18n.number(t):null;return{credits:t??0,lowCreditStatus:i,formattedCredits:l,creditsCap:o,formattedMonthlyCredits:r,isTooCloseToCreditCapForOneTimePurchase:s}};e.s([],188970),e.i(75495),e.i(575329);var l2=e.i(616726),l3=e.i(66657),l5=e.i(403379),l4=e.i(897325);e.i(751482);var l6=e.i(628996),l9=e.i(782064),l8=e.i(344028),l7=e.i(963614);let[de,dt,di,dn]=(0,l8.createDescendantContext)(),[da,dr]=(0,ie.createContext)({name:"TabsContext",errorMessage:"useTabsContext: `context` is undefined. Seems you forgot to wrap all tabs components within "}),[ds,dl]=(0,ie.createContext)({});function dd(e,t){return`${e}--tab-${t}`}function dc(e,t){return`${e}--tabpanel-${t}`}let[du,dp]=(0,ie.createContext)({name:"TabsStylesContext",errorMessage:"useTabsStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),dh=(0,nC.forwardRef)(function(e,t){let i=(0,t9.useMultiStyleConfig)("Tabs",e),{children:n,className:a,...r}=(0,l3.omitThemingProps)(e),{htmlProps:o,descendants:s,...l}=function(e){let{defaultIndex:t,onChange:i,index:n,isManual:a,isLazy:r,lazyBehavior:o="unmount",orientation:s="horizontal",direction:l="ltr",...d}=e,[c,u]=(0,F.useState)(t??0),[p,h]=(0,l5.useControllableState)({defaultValue:t??0,value:n,onChange:i});(0,F.useEffect)(()=>{null!=n&&u(n)},[n]);let m=di(),g=(0,F.useId)(),f=e.id??g;return{id:`tabs-${f}`,selectedIndex:p,focusedIndex:c,setSelectedIndex:h,setFocusedIndex:u,isManual:a,isLazy:r,lazyBehavior:o,orientation:s,descendants:m,direction:l,htmlProps:d}}(r),d=(0,F.useMemo)(()=>l,[l]),{isFitted:c,...u}=o,p={position:"relative",...i.root};return(0,j.jsx)(de,{value:s,children:(0,j.jsx)(da,{value:d,children:(0,j.jsx)(du,{value:i,children:(0,j.jsx)(t7.chakra.div,{className:(0,nv.cx)("chakra-tabs",a),ref:t,...u,__css:p,children:n})})})})});dh.displayName="Tabs",e.s(["Tabs",0,dh,"useTabsStyles",0,dp],595995);let dm=(0,nC.forwardRef)(function(e,t){let i=dp(),n=function(e){let{isDisabled:t=!1,isFocusable:i=!1,...n}=e,{setSelectedIndex:a,isManual:r,id:o,setFocusedIndex:s,selectedIndex:l}=dr(),{index:d,register:c}=dn({disabled:t&&!i}),u=d===l;return{...(0,l7.useClickable)({...n,ref:(0,l4.mergeRefs)(c,e.ref),isDisabled:t,isFocusable:i,onClick:(0,it.callAllHandlers)(e.onClick,()=>{a(d)})}),id:dd(o,d),role:"tab",tabIndex:u?0:-1,type:"button","aria-selected":u,"aria-controls":dc(o,d),onFocus:t?void 0:(0,it.callAllHandlers)(e.onFocus,()=>{s(d);let e=t&&i;r||e||a(d)})}}({...e,ref:t}),a=(0,l2.defineStyle)({outline:"0",display:"flex",alignItems:"center",justifyContent:"center",...i.tab});return(0,j.jsx)(t7.chakra.button,{...n,className:(0,nv.cx)("chakra-tabs__tab",e.className),__css:a})});dm.displayName="Tab",e.s(["Tab",0,dm],865786);let dg=(0,nC.forwardRef)(function(e,t){let i=function(e){let{focusedIndex:t,orientation:i,direction:n}=dr(),a=dt(),r=(0,F.useCallback)(e=>{let r=()=>{let e=a.nextEnabled(t);e&&e.node?.focus()},o=()=>{let e=a.prevEnabled(t);e&&e.node?.focus()},s="horizontal"===i,l="vertical"===i,d={["ltr"===n?"ArrowLeft":"ArrowRight"]:()=>s&&o(),["ltr"===n?"ArrowRight":"ArrowLeft"]:()=>s&&r(),ArrowDown:()=>l&&r(),ArrowUp:()=>l&&o(),Home:()=>{let e=a.firstEnabled();e&&e.node?.focus()},End:()=>{let e=a.lastEnabled();e&&e.node?.focus()}}[e.key];d&&(e.preventDefault(),d(e))},[a,t,i,n]);return{...e,role:"tablist","aria-orientation":i,onKeyDown:(0,it.callAllHandlers)(e.onKeyDown,r)}}({...e,ref:t}),n=dp(),a=(0,l2.defineStyle)({display:"flex",...n.tablist});return(0,j.jsx)(t7.chakra.div,{...i,className:(0,nv.cx)("chakra-tabs__tablist",e.className),__css:a})});dg.displayName="TabList",e.s(["TabList",0,dg],878726);let df=(0,nC.forwardRef)(function(e,t){let i=function(e){let{children:t,...i}=e,{isLazy:n,lazyBehavior:a}=dr(),{isSelected:r,id:o,tabId:s}=dl(),l=(0,F.useRef)(!1);r&&(l.current=!0);let d=(0,l9.lazyDisclosure)({wasSelected:l.current,isSelected:r,enabled:n,mode:a});return{tabIndex:0,...i,children:d?t:null,role:"tabpanel","aria-labelledby":s,hidden:!r,id:o}}({...e,ref:t}),n=dp();return(0,j.jsx)(t7.chakra.div,{outline:"0",...i,className:(0,nv.cx)("chakra-tabs__tab-panel",e.className),__css:n.tabpanel})});df.displayName="TabPanel",e.s(["TabPanel",0,df],260241);let db=(0,nC.forwardRef)(function(e,t){let i=function(e){let{id:t,selectedIndex:i}=dr(),n=(0,l6.getValidChildren)(e.children).map((e,n)=>(0,F.createElement)(ds,{key:e.key??n,value:{isSelected:n===i,id:dc(t,n),tabId:dd(t,n),selectedIndex:i}},e));return{...e,children:n}}(e),n=dp();return(0,j.jsx)(t7.chakra.div,{...i,width:"100%",ref:t,className:(0,nv.cx)("chakra-tabs__tab-panels",e.className),__css:n.tabpanels})});db.displayName="TabPanels",e.s(["TabPanels",0,db],480801);var dx=e.i(620020);e.i(185340);var dy=e.i(576897),dv=e.i(965837),dC=e.i(441224),dw=e.i(306841),dS=e.i(865639),dk=e.i(774314),dA=e.i(760853),dE=e.i(953540);function d_(e){let t=F.Children.only(e.children),{getAnchorProps:i}=(0,dA.usePopoverContext)();return(0,j.jsx)(j.Fragment,{children:(0,F.cloneElement)(t,i(t.props,(0,dE.getElementRef)(t)))})}d_.displayName="PopoverAnchor",e.s(["PopoverAnchor",0,d_],470020);var dI=e.i(882255),dM=e.i(349904),dT=e.i(156518);let[dL,dj]=((t=F.createContext(void 0)).displayName="AutoCompleteContext",[t.Provider,function e(){var i;let n=F.useContext(t);if(!n){let t=Error("useAutoCompleteContext: `context` is undefined. Seems you forgot to wrap all autoomplete components within ``");throw t.name="ContextError",null==(i=Error.captureStackTrace)||i.call(Error,t,e),t}return n},t]);function dP(e){return null!=e&&e.length?e[e.length-1]:void 0}function dD(e,t,i=1,n=!0){if(0===t)return -1;let a=e+i;return -1===e&&(a=i>0?0:t-1),a=n?(a%t+t)%t:Math.max(0,Math.min(a,t-1))}function dN(e){return Array.isArray(e)}function dR(e){return null!==e&&"object"==typeof e&&!dN(e)}function dO(e){return dN(e)?dN(e)&&0===e.length:dR(e)?dR(e)&&0===Object.keys(e).length:null==e||""===e}function dB(e){return typeof e>"u"}function dz(e){return"u">typeof e}function dF(e,t){let i={...e};return t.forEach(e=>{delete i[e]}),i}function dH(e,...t){return"function"==typeof e?e(...t):e}var dW=function(e,t){for(var i,n=F.Children.toArray(e),a=0;a{var t;return null==(t="string"==typeof e||"number"==typeof e?e:e[Object.keys(e)[0]])?void 0:t.toString()},dZ=(e,t,i)=>(null==t?void 0:t.toLowerCase().indexOf(null==e?void 0:e.toLowerCase()))>=0||(null==i?void 0:i.toLowerCase().indexOf(null==e?void 0:e.toLowerCase()))>=0||dG(e,t)>=.5||dG(e,i)>=.5;(0,nC.forwardRef)((e,t)=>{let i=function(e){var t;let{prefocusFirstItem:i=!0,closeOnBlur:n=!0,creatable:a,emphasize:r,emptyState:o=!0,defaultEmptyStateProps:s={},freeSolo:l,isReadOnly:d,listAllValuesOnFocus:c,maxSuggestions:u,multiple:p,closeOnSelect:h=!p,defaultValue:m,defaultValues:g=m?[m]:[],onReady:f,defaultIsOpen:b,disableFilter:x,isLoading:y=!1,placement:v="bottom",restoreOnBlurIfEmpty:C=!l,shouldRenderSuggestions:w=()=>!0,submitKeys:S=[],suggestWhenEmpty:k,value:A,values:E=A?"string"==typeof A?[A]:[...A]:void 0}=e;l=l||!!p||e.freeSolo;let{isOpen:_,onClose:I,onOpen:M}=(0,t6.useDisclosure)({defaultIsOpen:b}),T=(0,F.useMemo)(()=>dH(e.children,{isOpen:_,onClose:I,onOpen:M}),[e.children,_]),L=(0,F.useMemo)(()=>dV(T,e=>{var t;return(null==(t=null==e?void 0:e.type)?void 0:t.displayName)==="AutoCompleteItem"}).map(e=>{var t;let i,n=(t=e.props,i={},["value","label","fixed","disabled"].forEach(e=>{e in t&&(i[e]=t[e])}),i),{getValue:a=d$}=e.props,r=a(n.value);return{...dz(n.label)?n:{...n,label:r},value:r,originalValue:n.value}}),[T]),j=(0,F.useRef)(null),P=(0,F.useRef)(null),D=(0,F.useRef)(null),N=(0,F.useRef)(null),[R,O]=(0,F.useState)(!1),B="";p?B="":dB(g)?dB(E)||(B=E[0]):B=g[0];let[z,H]=(0,F.useState)(B??""),W=(0,F.useMemo)(()=>x?L:L.filter(t=>t.fixed||dH(e.filter||dZ,z,t.value,t.label)||R).filter((e,t)=>!u||e.fixed||t[...W,...U],[W,U]),[G,$]=(0,l5.useControllableState)({defaultValue:g.map(e=>null==e?void 0:e.toString()),value:E,onChange:t=>{let i=V.find(e=>e.value===t[0]);if(!i)return;let n=t.map(e=>V.find(t=>t.value===e));dH(e.onChange,p?t:t[0],p?n:i)}});(0,F.useEffect)(()=>{0===V.length&&!o&&_&&I()},[V.length,o,_]);let[Z,K]=(0,F.useState)(i?null==(t=L[0])?void 0:t.value:null),q=e.maxSelections||G.length+1,Y=V.findIndex(e=>e.value===Z),X=function(e,t,i=!0){let n=dD(e,t.length,1,i);return t[n]}(Y,V,!!e.rollNavigation),Q=function(e,t,i=!0){let n=function(e,t,i=!0){return dD(e,t,-1,i)}(e,t.length,i);return t[n]}(Y,V,!!e.rollNavigation),J=null==V?void 0:V[0],ee=dP(V),et=!V.some(e=>e.value===Z);(0,F.useEffect)(()=>{var e;et&&K(i?null==(e=L[0])?void 0:e.value:null)},[et]),(0,dC.useUpdateEffect)(()=>{i&&K(null==J?void 0:J.value)},[z,null==J?void 0:J.value]),(0,F.useEffect)(()=>{var e;!_&&i&&K(null==(e=L[0])?void 0:e.value)},[_]),(0,F.useEffect)(()=>{_&&c&&O(!0)},[_,c,O]),(0,F.useEffect)(()=>{let t=L.find(e=>e.value===Z);dH(e.onOptionFocus,{item:t,focusMethod:N.current,isNewInput:null==t?void 0:t.creatable})},[Z,e.onOptionFocus]);let ei=t=>{var i,n;let a=V.find(e=>e.value===t),r=(null==a?void 0:a.label)||(null==a?void 0:a.value);H(()=>p?"":r??""),!G.includes(t)&&G.lengthp?[...e,t]:[t]),p&&(null==(i=j.current)||i.focus()),e.focusInputOnSelect&&(null==(n=j.current)||n.focus()),dH(e.onSelectOption,{item:a,selectMethod:N.current,isNewInput:null==a?void 0:a.creatable}),null!=a&&a.creatable&&dH(e.onCreateOption,{item:dF(a,["noFilter"]),selectMethod:N.current}),h&&I()},en=(t,i)=>{var n;$(i=>{let n=L.find(e=>e.value===t);return n||!0!==a||(n={label:t,value:t}),n?(dH(e.onTagRemoved,t,n,i),i.filter(e=>e!==t)):i});let r=L.find(e=>e.value===t);z===((null==r?void 0:r.label)||(null==r?void 0:r.value))&&H(""),i&&(null==(n=j.current)||n.focus())},ea=p?G.map(e=>{var t;return{label:(null==(t=L.find(t=>t.value===(null==e?void 0:e.toString())))?void 0:t.label)||e,onRemove:()=>en(e)}}):[];return(0,F.useEffect)(()=>{dH(f,{tags:ea})},[G]),{autoCompleteProps:e,children:T,filteredList:V,filteredResults:W,focusedValue:Z,defaultEmptyStateProps:s,getEmptyStateProps:e=>{if(V.every(e=>e.noFilter)&&o&&!a)return"boolean"==typeof o?e:dH(o,{query:z})},getGroupProps:e=>{let t,i,n,a,r=(t=e.children,dz(dW(t,e=>{var t,i;let n=dH((null==(t=e.props)?void 0:t.getValue)||d$,(null==(i=e.props)?void 0:i.value)||{});return V.some(e=>e.value===n)})));return{divider:{hasFirstChild:(i=e.children,dW(i,e=>{var t;return(null==(t=null==e?void 0:e.type)?void 0:t.displayName)==="AutoCompleteItem"&&e.props.value===(null==J?void 0:J.value)})),hasLastChild:(n=e.children,a=dP(V.filter(e=>dB(null==e?void 0:e.noFilter))),dW(n,e=>{var t;return(null==(t=null==e?void 0:e.type)?void 0:t.displayName)==="AutoCompleteItem"&&e.props.value===(null==a?void 0:a.value)}))},group:{display:r?"initial":"none"}}},getInputProps:(t,i)=>{let{onBlur:a,onChange:r,onFocus:o,onKeyDown:s,variant:l,...u}=t;return{wrapper:{ref:P,onClick:()=>{var e;null==(e=null==j?void 0:j.current)||e.focus()},...((e,t)=>{let i={},n={},{field:a}=e;return a&&Object.keys(a).forEach(e=>{if(!1===e.startsWith("--input"))i[e]=a[e];else{let t=a[e],i=e.replace("--input-","").replace(/-([a-z])/g,function(e){return e[1].toUpperCase()});-1!==t.indexOf(".")&&(t=t.substring(t.indexOf(".")+1)),n[i]=t}}),{...t&&{...i,...n,_focusWithin:e.field._focus,pos:"relative",minH:9,py:1.5,spacing:3},cursor:"text",h:"fit-content"}})(i,p),...u},input:{isReadOnly:d,onFocus:t=>{dH(o,t),e.openOnFocus&&!d&&M(),e.selectOnFocus&&t.target.select(),c&&O(!0)},onBlur:e=>{var t,i;dH(a,e);let r=e.relatedTarget===(null==D?void 0:D.current)||(null==(t=D.current)?void 0:t.contains(e.relatedTarget)),o=null==(i=P.current)?void 0:i.contains(e.relatedTarget);if(!r&&!o&&(n&&I(),!G.includes(e.target.value)&&C)){let e=dP(G),t=L.find(t=>t.value===e);H((null==t?void 0:t.label)||(null==t?void 0:t.value)||"")}},onChange:e=>{let t=e.target.value;dH(r,e),H(t);let i=dO(t);dH(w,t)&&(!i||k)?M():I(),O(!1)},onKeyDown:e=>{var t;dH(s,e),N.current="keyboard";let{key:i}=e,n=V[Y];if(["Enter",...S].includes(i)){n&&!(null!=n&&n.disabled)&&_?ei(null==n?void 0:n.value):null==(t=j.current)||t.focus(),e.preventDefault();return}if("ArrowDown"===i){_?K(null==X?void 0:X.value):M(),e.preventDefault();return}if("ArrowUp"===i){_?K(null==Q?void 0:Q.value):M(),e.preventDefault();return}if("Tab"===i)return void(_&&n&&!(null!=n&&n.disabled)?ei(null==n?void 0:n.value):I());if("Home"===i){K(null==J?void 0:J.value),e.preventDefault();return}if("End"===i){K(null==ee?void 0:ee.value),e.preventDefault();return}"Escape"===i&&(I(),e.preventDefault())},value:z,variant:p?"unstyled":l,...u}}},getItemProps:(e,t)=>{var i;let{_fixed:n,_focus:a,children:o,disabled:s,label:l,value:d,fixed:c,getValue:u=d$,onClick:p,onMouseOver:h,sx:m,...g}=e,f=t?d:null==(i=u(d))?void 0:i.toString(),b=f===Z,x=V.findIndex(e=>e.value===f)>=0,y=o||l||f;return{item:{..."string"!=typeof y||!r?{children:y}:{dangerouslySetInnerHTML:{__html:"string"!=typeof y||dO(z)?y:y.toString().replace(RegExp(z.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),"gi"),e=>`${e}`)}},"aria-selected":G.includes(f),"aria-disabled":s,_disabled:{opacity:.4,cursor:"not-allowed",userSelect:"none"},onClick:e=>{var t;dH(p,e),s?null==(t=j.current)||t.focus():ei(f)},onMouseOver:e=>{dH(h,e),K(f),N.current="mouse"},sx:{...m,mark:{color:"inherit",bg:"transparent",...dR(r)?r:{fontWeight:r?"extrabold":"inherit"}}},...b&&(a||{bg:"whiteAlpha.100",_light:{bg:"gray.200"}}),...c&&n,...g},root:{isValidSuggestion:x,value:f}}},inputRef:j,interactionRef:N,isLoading:y,isOpen:_,itemList:L,listRef:D,onClose:I,onOpen:M,placement:v,query:z,removeItem:en,resetItems:e=>{var t;$([]),e&&(null==(t=j.current)||t.focus())},setQuery:H,tags:ea,value:A,values:G}}(e),{children:n,isOpen:a,onClose:r,onOpen:o,placement:s,resetItems:l,removeItem:d}=i;(0,F.useImperativeHandle)(t,()=>({resetItems:l,removeItem:d}));let{matchWidth:c=!0}=i.autoCompleteProps;return(0,j.jsx)(dL,{value:i,children:(0,j.jsx)(dw.Popover,{isLazy:!0,isOpen:a,autoFocus:!1,placement:s,closeOnBlur:!0,matchWidth:c,children:(0,j.jsx)(t7.chakra.div,{w:"full",ref:t,children:n})})})}).displayName="AutoComplete",(0,nC.forwardRef)((e,t)=>{let{focusedValue:i,getItemProps:n,interactionRef:a}=dj(),r=(0,F.useRef)(),o=(0,l4.useMergeRefs)(t,r),s=n(e),{isValidSuggestion:l,value:d}=s.root,c=i===d;(0,F.useEffect)(()=>{var e;c&&"keyboard"===a.current&&(null==(e=null==r?void 0:r.current)||e.scrollIntoView({behavior:"smooth",block:"nearest"}))},[c,a]),(0,F.useEffect)(()=>{"string"!=typeof d&&console.warn("wow"),"string"!=typeof d&&dB(e.getValue)&&console.error("You must define the `getValue` prop, when an Item's value is not a string")},[]);let{children:u,dangerouslySetInnerHTML:p,...h}=s.item,m=dF(h,["groupId"]);return l?(0,j.jsx)(N.Flex,{ref:o,...dK,...m,children:u||(0,j.jsx)("span",{dangerouslySetInnerHTML:p})}):null}).displayName="AutoCompleteItem";let dK={mx:"2",px:"2",py:"2",rounded:"md",cursor:"pointer"},dq=(0,nC.forwardRef)((e,t)=>{let{children:i,showDivider:n,...a}=e,r=dF(a,["groupSibling"]),{getGroupProps:o}=dj(),{group:s}=o(e),l=dQ(e);return(0,j.jsxs)(iS.Box,{ref:t,...s,...r,children:[(0,j.jsx)(D.Divider,{...l.top}),i,(0,j.jsx)(D.Divider,{...l.bottom})]})}),dY=(0,nC.forwardRef)((e,t)=>(0,j.jsx)(N.Flex,{...dX,...e,ref:t}));dq.displayName="AutoCompleteGroup",dY.displayName="AutoCompleteGroupTitle";let dX={ml:5,my:1,fontSize:"xs",letterSpacing:"wider",fontWeight:"extrabold",textTransform:"uppercase"},dQ=e=>{let{getGroupProps:t}=dj(),i=e.groupSibling,{divider:{hasFirstChild:n,hasLastChild:a}}=t(e),r={my:2,borderColor:e.dividerColor};return{top:{...r,mb:4,display:!e.showDivider||n?"none":""},bottom:{...r,display:!e.showDivider||a||i?"none":""}}},dJ=(0,nC.forwardRef)((e,t)=>{let{isLoading:i}=dj(),{loadingIcon:n,...a}=e;return(0,j.jsxs)(dv.InputGroup,{children:[(0,j.jsx)(dS.Input,{...a,ref:t}),i&&(0,j.jsx)(dk.InputRightElement,{children:n||(0,j.jsx)(ny.Spinner,{})})]})}),d0=(0,nC.forwardRef)((e,t)=>{let{autoCompleteProps:i,inputRef:n,getInputProps:a,tags:r,setQuery:o,value:s,itemList:l}=dj(),{children:d,isInvalid:c,hidePlaceholder:u,...p}=e,{value:h}=p;(0,F.useEffect)(()=>{if(void 0!==s&&("string"==typeof s||s instanceof String)){let e=l.find(e=>e.value===s);o(void 0===e?s:e.label)}},[s]),(0,F.useEffect)(()=>{void 0!==h&&("string"==typeof h||h instanceof String)&&o(h)},[h]);let{wrapper:m,input:g}=a(p,(0,t9.useMultiStyleConfig)("Input",e)),{ref:f,...b}=m,x=(0,l4.useMergeRefs)(t,n),y=dH(d,{tags:r});u&&(g={...g,placeholder:Array.isArray(y)&&y.length?void 0:g.placeholder});let v=(0,j.jsx)(dJ,{isInvalid:c,...g,ref:x}),C=(0,j.jsxs)(nw,{"aria-invalid":c,...b,ref:f,children:[y,(0,j.jsx)(nS,{as:dJ,...g,ref:x})]});return(0,j.jsx)(d_,{children:i.multiple?C:v})});d0.displayName="Input",d0.id="Input";let d1=e=>{let{getEmptyStateProps:t,defaultEmptyStateProps:i}=dj(),n=t((0,j.jsx)(N.Flex,{...d2,...i,children:"No options found!"}));return(0,j.jsx)(iS.Box,{...e,children:n})},d2={fontSize:"sm",align:"center",justify:"center",fontWeight:"bold",fontStyle:"italic"},d3=["AutoCompleteGroup","AutoCompleteItem","AutoCompleteCreatable"];(0,nC.forwardRef)((e,t)=>{let i,n,{children:a,loadingState:r,...o}=e,{listRef:s,isLoading:l}=dj(),d=(0,l4.useMergeRefs)(t,s),[c,u]=(i=F.default.Children.map(a,(e,t)=>{var i;if((null==(i=null==e?void 0:e.type)?void 0:i.displayName)==="AutoCompleteGroup"){let i=F.default.Children.toArray(a)[t+1];return F.default.cloneElement(e,{groupSibling:!!i&&"AutoCompleteGroup"===i.type.displayName})}return e}),n=F.default.Children.toArray(i).filter(e=>{var t;return!d3.includes(null==(t=null==e?void 0:e.type)?void 0:t.displayName)}),[F.default.Children.toArray(i).filter(e=>{var t;return d3.includes(null==(t=null==e?void 0:e.type)?void 0:t.displayName)}),n]);return(0,j.jsxs)(dI.PopoverContent,{ref:d,w:"inherit",...d5,...o,children:[l&&(0,j.jsx)(dM.Center,{children:r||(0,j.jsx)(ny.Spinner,{size:"md"})}),!l&&(0,j.jsxs)(j.Fragment,{children:[c,(0,j.jsx)(d1,{}),u]})]})}).displayName="AutoCompleteList";let d5={py:"4",opacity:"0",bg:"#232934",rounded:"md",maxH:"350px",border:"none",shadow:"base",zIndex:"popover",overflowY:"auto",_light:{bg:"#ffffff"},_focus:{boxShadow:"none"}},d4=((0,F.memo)(e=>{let{label:t,onRemove:i,disabled:n,...a}=e;return(0,j.jsx)(nS,{children:(0,j.jsxs)(dT.Tag,{borderRadius:"md",fontWeight:"normal",...n&&d4,...a,children:[(0,j.jsx)(dT.TagLabel,{children:t}),(0,j.jsx)(dT.TagCloseButton,{onClick:()=>!n&&dH(i),cursor:"pointer",...n&&d4})]})})}),{cursor:"text",userSelect:"none",opacity:.4,_focus:{boxShadow:"none"}});e.i(490091),e.i(437994),e.i(948408),e.i(816350);var d6=e.i(413479),d9=e.i(700183);e.s(["useLaunchIntercom",0,({initializeViaQuery:e}={initializeViaQuery:!1})=>{let t=(0,ei.useAppDispatch)(),i=(0,F.useCallback)(async()=>{await d6.bootPromise;let e=window.Intercom;e&&(e("show"),t((0,d9.setIsIntercomOpen)({isOpen:!0})))},[t]);return(0,F.useEffect)(()=>{e&&"true"===(0,dy.getExistingQueryParams)()["get-support"]&&i()},[e,i]),i}],267617),e.i(497980),e.i(940709);e.i(788411);iQ.config.CHURNKEY_APP_ID;let d8=(0,nC.forwardRef)(function(e,t){let{size:i,centerContent:n=!0,...a}=e;return(0,j.jsx)(iS.Box,{ref:t,boxSize:i,__css:{...n?{display:"flex",alignItems:"center",justifyContent:"center"}:{},flexShrink:0,flexGrow:0},...a})});d8.displayName="Square";let d7=(0,nC.forwardRef)(function(e,t){let{size:i,...n}=e;return(0,j.jsx)(d8,{size:i,ref:t,borderRadius:"9999px",...n})});d7.displayName="Circle",e.s(["Circle",0,d7],53158),c.faFolder,eS.faFolderOpen;let[ce,ct]=(0,ie.createContext)({name:"AccordionStylesContext",hookName:"useAccordionStyles",providerName:""}),[ci,cn]=(0,ie.createContext)({name:"AccordionItemContext",hookName:"useAccordionItemContext",providerName:""}),[ca,cr,co,cs]=(0,l8.createDescendantContext)();var cl=e.i(368429);let[cd,cc]=(0,ie.createContext)({name:"AccordionContext",hookName:"useAccordionContext",providerName:"Accordion"}),cu=(0,nC.forwardRef)(function({children:e,reduceMotion:t,...i},n){let a=(0,t9.useMultiStyleConfig)("Accordion",i),{htmlProps:r,descendants:o,...s}=function(e){var t,i;let n,a,{onChange:r,defaultIndex:o,index:s,allowMultiple:l,allowToggle:d,...c}=e;a=null!=(n=(t=e).index||t.defaultIndex)&&!Array.isArray(n)&&t.allowMultiple,(0,cl.warn)({condition:!!a,message:`If 'allowMultiple' is passed, then 'index' or 'defaultIndex' must be an array. You passed: ${typeof n},`}),i=e,(0,cl.warn)({condition:!!(i.allowMultiple&&i.allowToggle),message:"If 'allowMultiple' is passed, 'allowToggle' will be ignored. Either remove 'allowToggle' or 'allowMultiple' depending on whether you want multiple accordions visible or not"});let u=co(),[p,h]=(0,F.useState)(-1);(0,F.useEffect)(()=>()=>{h(-1)},[]);let[m,g]=(0,l5.useControllableState)({value:s,defaultValue:()=>l?o??[]:o??-1,onChange:r});return{index:m,setIndex:g,htmlProps:c,getAccordionItemProps:e=>{let t=!1;return null!==e&&(t=Array.isArray(m)?m.includes(e):m===e),{isOpen:t,onChange:t=>{null!==e&&(l&&Array.isArray(m)?g(t?m.concat(e):m.filter(t=>t!==e)):t?g(e):d&&g(-1))}}},focusedIndex:p,setFocusedIndex:h,descendants:u}}((0,l3.omitThemingProps)(i)),l=(0,F.useMemo)(()=>({...s,reduceMotion:!!t}),[s,t]);return(0,j.jsx)(ca,{value:o,children:(0,j.jsx)(cd,{value:l,children:(0,j.jsx)(ce,{value:a,children:(0,j.jsx)(t7.chakra.div,{ref:n,...r,className:(0,nv.cx)("chakra-accordion",i.className),__css:a.root,children:e})})})})});cu.displayName="Accordion";let cp=(0,nC.forwardRef)(function(e,t){let{getButtonProps:i}=cn(),n=i(e,t),a={display:"flex",alignItems:"center",width:"100%",outline:0,...ct().button};return(0,j.jsx)(t7.chakra.button,{...n,className:(0,nv.cx)("chakra-accordion__button",e.className),__css:a})});cp.displayName="AccordionButton";var ch=e.i(427001);function cm(e){let{isOpen:t,isDisabled:i}=cn(),{reduceMotion:n}=cc(),a=(0,nv.cx)("chakra-accordion__icon",e.className),r={opacity:i?.4:1,transform:t?"rotate(-180deg)":void 0,transition:n?void 0:"transform 0.2s",transformOrigin:"center",...ct().icon};return(0,j.jsx)(ch.Icon,{viewBox:"0 0 24 24","aria-hidden":!0,className:a,__css:r,...e,children:(0,j.jsx)("path",{fill:"currentColor",d:"M16.59 8.59L12 13.17 7.41 8.59 6 10l6 6 6-6z"})})}cm.displayName="AccordionIcon";let cg=(0,nC.forwardRef)(function(e,t){let{children:i,className:n}=e,{htmlProps:a,...r}=function(e){var t,i;let{isDisabled:n,isFocusable:a,id:r,...o}=e,{getAccordionItemProps:s,setFocusedIndex:l}=cc(),d=(0,F.useRef)(null),c=(0,F.useId)(),u=r??c,p=`accordion-button-${u}`,h=`accordion-panel-${u}`;t=e,(0,cl.warn)({condition:!!(t.isFocusable&&!t.isDisabled),message:`Using only 'isFocusable', this prop is reserved for situations where you pass 'isDisabled' but you still want the element to receive focus (A11y). Either remove it or pass 'isDisabled' as well. `});let{register:m,index:g,descendants:f}=cs({disabled:n&&!a}),{isOpen:b,onChange:x}=s(-1===g?null:g);i={isOpen:b,isDisabled:n},(0,cl.warn)({condition:i.isOpen&&!!i.isDisabled,message:"Cannot open a disabled accordion item"});let y=(0,F.useCallback)(()=>{x?.(!b),l(g)},[g,l,b,x]),v=(0,F.useCallback)(e=>{let t={ArrowDown:()=>{let e=f.nextEnabled(g);e?.node.focus()},ArrowUp:()=>{let e=f.prevEnabled(g);e?.node.focus()},Home:()=>{let e=f.firstEnabled();e?.node.focus()},End:()=>{let e=f.lastEnabled();e?.node.focus()}}[e.key];t&&(e.preventDefault(),t(e))},[f,g]),C=(0,F.useCallback)(()=>{l(g)},[l,g]),w=(0,F.useCallback)(function(e={},t=null){return{...e,type:"button",ref:(0,l4.mergeRefs)(m,d,t),id:p,disabled:!!n,"aria-expanded":!!b,"aria-controls":h,onClick:(0,it.callAllHandlers)(e.onClick,y),onFocus:(0,it.callAllHandlers)(e.onFocus,C),onKeyDown:(0,it.callAllHandlers)(e.onKeyDown,v)}},[p,n,b,y,C,v,h,m]),S=(0,F.useCallback)(function(e={},t=null){return{...e,ref:t,role:"region",id:h,"aria-labelledby":p,hidden:!b}},[p,b,h]);return{isOpen:b,isDisabled:n,isFocusable:a,onOpen:()=>{x?.(!0)},onClose:()=>{x?.(!1)},getButtonProps:w,getPanelProps:S,htmlProps:o}}(e),o=ct(),s=(0,l2.defineStyle)({...o.container,overflowAnchor:"none"}),l=(0,F.useMemo)(()=>r,[r]);return(0,j.jsx)(ci,{value:l,children:(0,j.jsx)(t7.chakra.div,{ref:t,...a,className:(0,nv.cx)("chakra-accordion__item",n),__css:s,children:"function"==typeof i?i({isExpanded:!!r.isOpen,isDisabled:!!r.isDisabled}):i})})});cg.displayName="AccordionItem";var cf=e.i(970346);let cb=(0,nC.forwardRef)(function(e,t){let{className:i,motionProps:n,...a}=e,{reduceMotion:r}=cc(),{getPanelProps:o,isOpen:s}=cn(),l=o(a,t),d=(0,nv.cx)("chakra-accordion__panel",i),c=ct();r||delete l.hidden;let u=(0,j.jsx)(t7.chakra.div,{...l,__css:c.panel,className:d});return r?u:(0,j.jsx)(cf.Collapse,{in:s,...n,children:u})});function cx(e){return{rechargeEnabled:e?.enabled,rechargeThreshold:e?.enabled?e?.creditsThreshold:void 0,rechargeAmount:e?.enabled?e?.creditsToAdd:void 0,latestPurchaseTime:e?.latestPurchaseTime,latestPurchaseStatus:e?.latestPurchaseStatus}}cb.displayName="AccordionPanel",e.i(96095),e.i(936150);let cy=(e,t)=>{let{data:i,loading:n,error:a,refetch:r}=(0,iW.useCreditsAutoPurchaseQuery)({variables:{workspaceId:e??""},skip:!e,onCompleted:e=>{t?.onCompleted?.(cx(e?.creditsAutoPurchase))}});return{...cx(i?.creditsAutoPurchase),loading:n,error:a,refetch:r}},cv=e=>{let{currentWorkspace:t}=(0,el.useUserContext)(),{data:i}=(0,iW.useGetWorkspaceQuery)({variables:{id:e??t?.id??""},skip:!e&&!t?.id});return e?i?.workspace:{...t,...i?.workspace}};e.s(["useWorkspaceData",0,cv],869557);var cC=e.i(218154),cw=e.i(707065);let[cS,ck]=(0,ie.createContext)({name:"CheckboxGroupContext",strict:!1});function cA(e){return(0,j.jsx)(t7.chakra.svg,{width:"1.2em",viewBox:"0 0 12 10",style:{fill:"none",strokeWidth:2,stroke:"currentColor",strokeDasharray:16},...e,children:(0,j.jsx)("polyline",{points:"1.5 6 4.5 9 10.5 1"})})}function cE(e){return(0,j.jsx)(t7.chakra.svg,{width:"1.2em",viewBox:"0 0 24 24",style:{stroke:"currentColor",strokeWidth:4},...e,children:(0,j.jsx)("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function c_(e){let{isIndeterminate:t,isChecked:i,...n}=e;return i||t?(0,j.jsx)(t7.chakra.div,{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:(0,j.jsx)(t?cE:cA,{...n})}):null}var cI=e.i(458720);let cM={display:"inline-flex",alignItems:"center",justifyContent:"center",verticalAlign:"top",userSelect:"none",flexShrink:0},cT={cursor:"pointer",display:"inline-flex",alignItems:"center",verticalAlign:"top",position:"relative"},cL=(0,cw.keyframes)({from:{opacity:0,strokeDashoffset:16,transform:"scale(0.95)"},to:{opacity:1,strokeDashoffset:0,transform:"scale(1)"}}),cj=(0,cw.keyframes)({from:{opacity:0},to:{opacity:1}}),cP=(0,cw.keyframes)({from:{transform:"scaleX(0.65)"},to:{transform:"scaleX(1)"}}),cD=(0,nC.forwardRef)(function(e,t){let i=ck(),n={...i,...e},a=(0,t9.useMultiStyleConfig)("Checkbox",n),r=(0,l3.omitThemingProps)(e),{spacing:o="0.5rem",className:s,children:l,iconColor:d,iconSize:c,icon:u=(0,j.jsx)(c_,{}),isChecked:p,isDisabled:h=i?.isDisabled,onChange:m,inputProps:g,...f}=r,b=p;i?.value&&r.value&&(b=i.value.includes(r.value));let x=m;i?.onChange&&r.value&&(x=(0,it.callAll)(i.onChange,m));let{state:y,getInputProps:v,getCheckboxProps:C,getLabelProps:w,getRootProps:S}=(0,cI.useCheckbox)({...f,isDisabled:h,isChecked:b,onChange:x}),k=function(e){let[t,i]=(0,F.useState)(e),[n,a]=(0,F.useState)(!1);return e!==t&&(a(!0),i(e)),n}(y.isChecked),A=(0,F.useMemo)(()=>({animation:k?y.isIndeterminate?`${cj} 20ms linear, ${cP} 200ms linear`:`${cL} 200ms linear`:void 0,...a.icon,...(0,cC.compact)({fontSize:c,color:d})}),[d,c,k,y.isIndeterminate,a.icon]),E=(0,F.cloneElement)(u,{__css:A,isIndeterminate:y.isIndeterminate,isChecked:y.isChecked});return(0,j.jsxs)(t7.chakra.label,{__css:{...cT,...a.container},className:(0,nv.cx)("chakra-checkbox",s),...S(),children:[(0,j.jsx)("input",{className:"chakra-checkbox__input",...v(g,t)}),(0,j.jsx)(t7.chakra.span,{__css:{...cM,...a.control},className:"chakra-checkbox__control",...C(),children:E}),l&&(0,j.jsx)(t7.chakra.span,{className:"chakra-checkbox__label",...w(),__css:{marginStart:o,...a.label},children:l})]})});cD.displayName="Checkbox",e.s(["Checkbox",0,cD],819197),e.s(["useLocalizedFunction",0,function(e,t=[]){let i=(0,z.useLingui)();return(0,F.useMemo)(e,[i,e,...t])}],607663),iW.WorkspaceRole.Admin,z.Trans,z.Trans,iW.WorkspaceRole.Member,z.Trans,z.Trans,e.i(182895),e.i(259658),e.i(754640),e.i(188407);var cN=e.i(275316),cR=e.i(917029),cO=e.i(886748),cB=e.i(785501),cz=e.i(860207);function cF(e,t){(0,n_.default)(2,arguments);var i=(0,cz.default)(e),n=(0,cz.default)(t);return i.getTime()===n.getTime()}function cH(e,t){return(0,n_.default)(2,arguments),function(e,t){(0,n_.default)(2,arguments);var i=(0,nE.default)(e),n=(0,nP.default)(t);return isNaN(n)?new Date(NaN):(n&&i.setDate(i.getDate()+n),i)}(e,-(0,nP.default)(t))}e.s(["always",0,()=>!0,"isHourBetween",0,(e,t)=>i=>{let n=i.getHours();return e<=n&&n{let t=e.getDay();return 0===t||6===t},"normalizeDate",0,e=>{try{let t=lQ(),i=nF(e),n=cH(i,0);if(function(e){return(0,n_.default)(1,arguments),cF(e,Date.now())}(i)||function(e){return(0,n_.default)(1,arguments),cF(e,cH(Date.now(),1))}(i))return function(e,t,i){(0,n_.default)(2,arguments);var n,a=(0,nE.default)(e),r=(0,nE.default)(t),o=i||{},s=o.locale,l=void 0===s?nT.default:s,d=o.weekStartsOn,c=void 0===d?0:d;if(!l.localize)throw RangeError("locale must contain localize property");if(!l.formatLong)throw RangeError("locale must contain formatLong property");if(!l.formatRelative)throw RangeError("locale must contain formatRelative property");var u=(0,cR.default)(a,r);if(isNaN(u))throw RangeError("Invalid time value");n=u<-6?"other":u<-1?"lastWeek":u<0?"yesterday":u<1?"today":u<2?"tomorrow":u<7?"nextWeek":"other";var p=(0,cB.default)(a,(0,nA.default)(a)),h=(0,cB.default)(r,(0,nA.default)(r)),m=l.formatRelative(n,p,h,{locale:l,weekStartsOn:c});return(0,cO.default)(a,m,{locale:l,weekStartsOn:c})}(n,new Date,{locale:t});return`${(0,nk.format)(i,"PPp",{locale:t})}`}catch(e){return console.error("[normalizeDate] Error normalizing date:",e),"date unknown"}}],644315);let[cW,cU]=(0,ie.createContext)({name:"TableStylesContext",errorMessage:"useTableStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),cV=(0,nC.forwardRef)((e,t)=>{let i=(0,t9.useMultiStyleConfig)("Table",e),{className:n,layout:a,...r}=(0,l3.omitThemingProps)(e);return(0,j.jsx)(cW,{value:i,children:(0,j.jsx)(t7.chakra.table,{ref:t,__css:{tableLayout:a,...i.table},className:(0,nv.cx)("chakra-table",n),...r})})});cV.displayName="Table",e.s(["Table",0,cV,"useTableStyles",0,cU],280318);let cG=(0,nC.forwardRef)((e,t)=>{let{overflow:i,overflowX:n,className:a,...r}=e;return(0,j.jsx)(t7.chakra.div,{ref:t,className:(0,nv.cx)("chakra-table__container",a),...r,__css:{display:"block",whiteSpace:"nowrap",WebkitOverflowScrolling:"touch",overflowX:i??n??"auto",overflowY:"hidden",maxWidth:"100%"}})});e.s(["TableContainer",0,cG],991154);let c$=(0,nC.forwardRef)((e,t)=>{let i=cU();return(0,j.jsx)(t7.chakra.tbody,{...e,ref:t,__css:i.tbody})});e.s(["Tbody",0,c$],4751);let cZ=(0,nC.forwardRef)(({isNumeric:e,...t},i)=>{let n=cU();return(0,j.jsx)(t7.chakra.td,{...t,ref:i,__css:n.td,"data-is-numeric":e})});e.s(["Td",0,cZ],400506),(0,nC.forwardRef)(({isNumeric:e,...t},i)=>{let n=cU();return(0,j.jsx)(t7.chakra.th,{...t,ref:i,__css:n.th,"data-is-numeric":e})}),(0,nC.forwardRef)((e,t)=>{let i=cU();return(0,j.jsx)(t7.chakra.thead,{...e,ref:t,__css:i.thead})});let cK=(0,nC.forwardRef)((e,t)=>{let i=cU();return(0,j.jsx)(t7.chakra.tr,{...e,ref:t,__css:i.tr})});e.s(["Tr",0,cK],576750),e.i(203828),e.i(159859),e.i(453216);var cq=e.i(335799),cY=e.i(346037);let cX=e=>{let{className:t,...i}=e,n=(0,eg.useMenuStyles)();return(0,j.jsx)(t7.chakra.hr,{"aria-orientation":"horizontal",className:(0,nv.cx)("chakra-menu__divider",t),...i,__css:n.divider})};cX.displayName="MenuDivider",e.s(["MenuDivider",0,cX],826480),e.i(285042);var cQ=e.i(18571),cJ=e.i(173899),c0=e.i(172621),c1=e.i(198311),c2=e.i(498817);let c3={exit:{scale:.85,opacity:0,transition:{opacity:{duration:.15,easings:"easeInOut"},scale:{duration:.2,easings:"easeInOut"}}},enter:{scale:1,opacity:1,transition:{opacity:{easings:"easeOut",duration:.2},scale:{duration:.2,ease:[.175,.885,.4,1.1]}}}};var c5=e.i(782652),c4=e.i(697991),c6=e.i(779040);let c9=e=>e.current?.ownerDocument||document,c8=e=>e.current?.ownerDocument?.defaultView||window,c7="chakra-ui:close-tooltip";var ue=e.i(16120),ut=e.i(935020);let ui=(0,t7.chakra)(c1.motion.div),un=(0,nC.forwardRef)((e,t)=>{let i,n=(0,t9.useStyleConfig)("Tooltip",e),a=(0,l3.omitThemingProps)(e),r=(0,ue.useTheme)(),{children:o,label:s,shouldWrapChildren:l,"aria-label":d,hasArrow:c,bg:u,portalProps:p,background:h,backgroundColor:m,bgColor:g,motionProps:f,animatePresenceProps:b,...x}=a,y=h??m??u??g;if(y){n.bg=y;let e=(0,cQ.getCSSVar)(r,"colors",y);n[c6.cssVars.arrowBg.var]=e}let v=function(e={}){var t,i;let{openDelay:n=0,closeDelay:a=0,closeOnClick:r=!0,closeOnMouseDown:o,closeOnScroll:s,closeOnPointerDown:l=o,closeOnEsc:d=!0,onOpen:c,onClose:u,placement:p,id:h,isOpen:m,defaultIsOpen:g,arrowSize:f=10,arrowShadowColor:b,arrowPadding:x,modifiers:y,isDisabled:v,gutter:C,offset:w,direction:S,...k}=e,{isOpen:A,onOpen:E,onClose:_}=(0,t6.useDisclosure)({isOpen:m,defaultIsOpen:g,onOpen:c,onClose:u}),{referenceRef:I,getPopperProps:M,getArrowInnerProps:T,getArrowProps:L}=(0,t8.usePopper)({enabled:A,placement:p,arrowPadding:x,modifiers:y,gutter:C,offset:w,direction:S}),j=(0,F.useId)(),P=`tooltip-${h??j}`,D=(0,F.useRef)(null),N=(0,F.useRef)(void 0),R=(0,F.useCallback)(()=>{N.current&&(clearTimeout(N.current),N.current=void 0)},[]),O=(0,F.useRef)(void 0),B=(0,F.useCallback)(()=>{O.current&&(clearTimeout(O.current),O.current=void 0)},[]),z=(0,F.useCallback)(()=>{B(),_()},[_,B]),H=(t=D,i=z,(0,F.useEffect)(()=>{let e=c9(t);return e.addEventListener(c7,i),()=>e.removeEventListener(c7,i)},[i,t]),()=>{let e=c9(t),i=c8(t);e.dispatchEvent(new i.CustomEvent(c7))}),W=(0,F.useCallback)(()=>{v||N.current||(A&&H(),N.current=c8(D).setTimeout(E,n))},[H,v,A,E,n]),U=(0,F.useCallback)(()=>{R(),O.current=c8(D).setTimeout(z,a)},[a,z,R]),V=(0,F.useCallback)(()=>{A&&r&&U()},[r,U,A]),G=(0,F.useCallback)(()=>{A&&l&&U()},[l,U,A]),$=(0,F.useCallback)(e=>{A&&"Escape"===e.key&&U()},[A,U]);(0,c5.useEventListener)(()=>c9(D),"keydown",d?$:void 0),(0,c5.useEventListener)(()=>{if(!s)return null;let e=D.current;if(!e)return null;let t=function e(t){return["html","body","#document"].includes(t.localName)?t.ownerDocument.body:(0,c4.isHTMLElement)(t)&&function(e){let{overflow:t,overflowX:i,overflowY:n}=(e.ownerDocument.defaultView||window).getComputedStyle(e);return/auto|scroll|overlay|hidden/.test(t+n+i)}(t)?t:e("html"===t.localName?t:t.assignedSlot||t.parentElement||t.ownerDocument.documentElement)}(e);return"body"===t.localName?c8(D):t},"scroll",()=>{A&&s&&z()},{passive:!0,capture:!0}),(0,F.useEffect)(()=>{v&&(R(),A&&_())},[v,A,_,R]),(0,F.useEffect)(()=>()=>{R(),B()},[R,B]),(0,c5.useEventListener)(()=>D.current,"pointerleave",U);let Z=(0,F.useCallback)((e={},t=null)=>({...e,ref:(0,l4.mergeRefs)(D,t,I),onPointerEnter:(0,it.callAllHandlers)(e.onPointerEnter,e=>{"touch"!==e.pointerType&&W()}),onClick:(0,it.callAllHandlers)(e.onClick,V),onPointerDown:(0,it.callAllHandlers)(e.onPointerDown,G),onFocus:(0,it.callAllHandlers)(e.onFocus,W),onBlur:(0,it.callAllHandlers)(e.onBlur,U),"aria-describedby":A?P:void 0}),[W,U,G,A,P,V,I]),K=(0,F.useCallback)((e={},t=null)=>M({...e,style:{...e.style,[c6.cssVars.arrowSize.var]:f?`${f}px`:void 0,[c6.cssVars.arrowShadowColor.var]:b}},t),[M,f,b]);return{isOpen:A,show:W,hide:U,getTriggerProps:Z,getTooltipProps:(0,F.useCallback)((e={},t=null)=>{let i={...e.style,position:"relative",transformOrigin:c6.cssVars.transformOrigin.varRef};return{ref:t,...k,...e,id:P,role:"tooltip",style:i}},[k,P]),getTooltipPositionerProps:K,getArrowProps:L,getArrowInnerProps:T}}({...x,direction:r.direction});if(!(0,F.isValidElement)(o)||l)i=(0,j.jsx)(t7.chakra.span,{display:"inline-block",tabIndex:0,...v.getTriggerProps(),children:o});else{let e=F.Children.only(o);i=(0,F.cloneElement)(e,v.getTriggerProps(e.props,(0,dE.getElementRef)(e)))}let C=!!d,w=v.getTooltipProps({},t),S=C?(0,cJ.omit)(w,["role","id"]):w,k=(0,c0.pick)(w,["role","id"]);return s?(0,j.jsxs)(j.Fragment,{children:[i,(0,j.jsx)(c2.AnimatePresence,{...b,children:v.isOpen&&(0,j.jsx)(ut.Portal,{...p,children:(0,j.jsx)(t7.chakra.div,{...v.getTooltipPositionerProps(),__css:{zIndex:n.zIndex,pointerEvents:"none"},children:(0,j.jsxs)(ui,{variants:c3,initial:"exit",animate:"enter",exit:"exit",...f,...S,__css:n,children:[s,C&&(0,j.jsx)(t7.chakra.span,{srOnly:!0,...k,children:d}),c&&(0,j.jsx)(t7.chakra.div,{"data-popper-arrow":!0,className:"chakra-tooltip__arrow-wrapper",children:(0,j.jsx)(t7.chakra.div,{"data-popper-arrow-inner":!0,className:"chakra-tooltip__arrow",__css:{bg:n.bg}})})]})})})})]}):(0,j.jsx)(j.Fragment,{children:o})});un.displayName="Tooltip",e.s(["Tooltip",0,un],809701),e.i(818315),e.i(744857).default,e.i(148908),e.i(280411).default,e.i(275885);let{PI:ua}=Math;e.i(547059);let ur={src:e.i(634164).default,width:600,height:325,blurWidth:8,blurHeight:4,blurDataURL:"data:image/webp;base64,UklGRr4AAABXRUJQVlA4TLEAAAAvB8AAAM1VICICHgioEQAAAIAFABoAD1wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABYDwAAeCAgJwAAAADnfwEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAD9/kYeCKANAAAAwPm3A+1OKQDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEPnuF2cYfYgZcAcHvM9eu9+7W67Mc6IyKhFj4hhs2tLQNg0A"};ur.src,ur.src,ur.src,iW.Permission.Manage,iW.Permission.Edit,iW.Permission.Comment,iW.Permission.View;var uo=e.i(996651);let[us,ul]=(0,ie.createContext)({name:"FormErrorStylesContext",errorMessage:"useFormErrorStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "});(0,nC.forwardRef)((e,t)=>{let i=(0,t9.useMultiStyleConfig)("FormError",e),n=(0,l3.omitThemingProps)(e),a=(0,uo.useFormControlContext)();return a?.isInvalid?(0,j.jsx)(us,{value:i,children:(0,j.jsx)(t7.chakra.div,{...a?.getErrorMessageProps(n,t),className:(0,nv.cx)("chakra-form__error-message",e.className),__css:{display:"flex",alignItems:"center",...i.text}})}):null}).displayName="FormErrorMessage",(0,nC.forwardRef)((e,t)=>{let i=ul(),n=(0,uo.useFormControlContext)();if(!n?.isInvalid)return null;let a=(0,nv.cx)("chakra-form__error-icon",e.className);return(0,j.jsx)(ch.Icon,{ref:t,"aria-hidden":!0,...e,__css:i.icon,className:a,children:(0,j.jsx)("path",{fill:"currentColor",d:"M11.983,0a12.206,12.206,0,0,0-8.51,3.653A11.8,11.8,0,0,0,0,12.207,11.779,11.779,0,0,0,11.8,24h.214A12.111,12.111,0,0,0,24,11.791h0A11.766,11.766,0,0,0,11.983,0ZM10.5,16.542a1.476,1.476,0,0,1,1.449-1.53h.027a1.527,1.527,0,0,1,1.523,1.47,1.475,1.475,0,0,1-1.449,1.53h-.027A1.529,1.529,0,0,1,10.5,16.542ZM11,12.5v-6a1,1,0,0,1,2,0v6a1,1,0,1,1-2,0Z"})})}).displayName="FormErrorIcon",e.i(510126),e.i(261991),e.i(305524),e.i(160396);var ud=e.i(847092);function uc(e,t){let i,n="number"!=typeof(i=parseFloat(e))||Number.isNaN(i)?0:i,a=10**(t??10);return n=Math.round(n*a)/a,t?n.toFixed(t):n.toString()}function uu(e){if(!Number.isFinite(e))return 0;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i+=1;return i}e.i(775274),e.i(836241),e.s(["clampValue",0,function(e,t,i){return null==e?e:(i{let{subscription:e,product:t}=(0,iI.useMonetizationContext)(),i=cv(),n=(0,iM.useCanUseProductFeature)("purchase_credits",i),a=(0,i4.useCanManageWorkspace)(),{isTooCloseToCreditCapForOneTimePurchase:r}=l1(t),{rechargeEnabled:o}=cy(e?.workspaceId),s=!!e?.cancellationRequestedTime,l=i?.memberCount===1,d=!o&&n,c=!o&&n&&l&&a,u=r?(0,j.jsx)(z.Trans,{message:"You're currently too close to your plan's credits limit to purchase more credits",id:"RZyYsL"}):null,p=s?(0,j.jsx)(z.Trans,{message:"Reactivate your account to auto-recharge",id:"UcqG0l"}):a?null:(0,j.jsx)(z.Trans,{message:"Only workspace admins can change auto-recharge settings",id:"mRcTRS"});return{buyCredits:{shouldShow:c,isDisabled:r,tooltipContent:u},autoRecharge:{shouldShow:d,isDisabled:!a||s,tooltipContent:p},canBuyOrAutoRecharge:d||c,showAutoRechargeControls:o,isOnePersonWorkspace:l,cancellationRequested:s}},uh=()=>(()=>{let{product:e}=(0,iI.useMonetizationContext)(),t=(0,i5.useFeatureFlag)("plan-credits");if(!e)return(0,j.jsx)(z.Trans,{message:"Credits let you create and edit with AI. Each user in your workspace gets their own credits.",id:"lUUl1i"});let{monthlyCredits:i,maxCredits:n}=t[e],a=i.toLocaleString(),r=n.toLocaleString(),o=iL[e].name;return(0,j.jsx)(z.Trans,{message:"Credits are used for AI features throughout {GAMMA_PROPER_NOUN}. Your {name} plan includes {formattedMonthly} credits per month. Unused credits roll over to the next month, up to {formattedMax} total.",id:"5nr1o9",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN,name:o,formattedMonthly:a,formattedMax:r}})})(),um=({onEditAutoRecharge:e,source:t,...i})=>{let n=(0,dx.useToast)(),a=(0,W.useAnalytics)(),[r]=(0,iW.useUpdateCreditsAutoPurchaseMutation)(),{subscription:o}=(0,iI.useMonetizationContext)(),{rechargeEnabled:s,rechargeThreshold:l,rechargeAmount:d}=cy(o?.workspaceId),{autoRecharge:u,isOnePersonWorkspace:p}=up(),{data:h}=(0,iW.useProductsQuery)({variables:{workspaceId:o?.workspaceId,productType:iW.ProductType.AddOn},skip:!o?.workspaceId}),m=h?.products?.find(e=>"credits"===e.key)?.prices?.[0],g=async()=>{if(o?.workspaceId)try{await r({variables:{input:{workspaceId:o.workspaceId,productPriceId:m?.id,enabled:!1}}}),n({title:(0,j.jsx)(z.Trans,{message:"Auto-recharge disabled",id:"dpCX+6"}),status:"success",position:"top",duration:5e3}),a?.track(H.SegmentEvents.CREDITS_AUTO_RECHARGE_DISABLED,{source:t,current_recharge_enabled:s,current_recharge_threshold:l,current_recharge_amount:d})}catch{n({title:(0,j.jsx)(z.Trans,{message:"Failed to disable auto-recharge",id:"ACf5Uc"}),status:"error",position:"top",duration:5e3,isClosable:!0})}};return(0,j.jsxs)(nr.Stack,{direction:"column",alignItems:"center",justifyContent:"center",spacing:4,flex:"1",bg:"blackAlpha.50",h:"auto",p:4,fontSize:"sm",rounded:"md",...i,children:[(0,j.jsxs)(O.VStack,{alignItems:"start",children:[(0,j.jsxs)(U.HStack,{color:"blue.950",children:[(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faCheckCircle,size:"sm",fixedWidth:!0}),(0,j.jsx)(Z.Text,{children:(0,j.jsx)(z.Trans,{message:"Auto-recharge is on",id:"UJ8nPT"})})]}),(0,j.jsx)(Z.Text,{children:p?(0,j.jsx)(z.Trans,{message:"When your balance drops below <0>{rechargeThreshold}, we'll automatically add <1>{rechargeAmount} to your account.",id:"JdB4HD",values:{rechargeThreshold:l,rechargeAmount:d},components:{0:(0,j.jsx)("strong",{}),1:(0,j.jsx)("strong",{})}}):(0,j.jsx)(z.Trans,{message:"When any workspace member's balance drops below <0>{rechargeThreshold}, we'll automatically add <1>{rechargeAmount} to their account.",id:"WE3qTB",values:{rechargeThreshold:l,rechargeAmount:d},components:{0:(0,j.jsx)("strong",{}),1:(0,j.jsx)("strong",{})}})})]}),(0,j.jsx)(X.GammaTooltip,{placement:"top",label:u.tooltipContent,isDisabled:!u.tooltipContent,children:(0,j.jsx)(P.Button,{variant:"plain",size:"sm",w:"100%",onClick:e,isDisabled:u.isDisabled,children:(0,j.jsx)(z.Trans,{message:"Edit auto-recharge",id:"L4lcVQ"})})}),(0,j.jsx)(X.GammaTooltip,{placement:"top",label:u.tooltipContent,isDisabled:!u.tooltipContent,children:(0,j.jsx)(P.Button,{variant:"link",size:"xs",color:"gray.500",onClick:g,isDisabled:u.isDisabled,children:(0,j.jsx)(z.Trans,{message:"Disable auto-recharge",id:"fiGbaz"})})})]})},ug=({trackingSource:e})=>{let{buyCredits:t,autoRecharge:i,canBuyOrAutoRecharge:n,showAutoRechargeControls:a,cancellationRequested:r}=up(),{subscription:o,product:s,openBuyCreditsModal:u,openAutoRechargeModal:p}=(0,iI.useMonetizationContext)(),h=!!s,m=(0,l0.getLowCreditAttributes)(),{lowCreditStatus:g,credits:f,creditsCap:b}=l1(s),x=d.i18n.date(o?.nextCreditRefillTime),y=d.i18n.number(b),v=lJ(o?.expirationTime,"PPP");return(0,j.jsxs)(nr.Stack,{spacing:4,alignItems:"center",children:[(0,j.jsxs)(nr.Stack,{spacing:2,alignItems:"center",children:[(0,j.jsx)(Z.Text,{fontSize:"md",color:g?m[g].darkColor:void 0,children:g?m[g].description:(0,j.jsx)(z.Trans,{message:"Your credits",id:"PIlvSY"})}),(0,j.jsx)(U.HStack,{children:(0,j.jsx)(nc.Heading,{size:"lg",color:g?m[g].lightColor:void 0,children:null===f?(0,j.jsx)(ny.Spinner,{size:"sm"}):(0,j.jsxs)(nw,{align:"center",children:[(0,j.jsx)(nS,{children:(0,j.jsx)(B.FontAwesomeIcon,{icon:l.faSparkles,fixedWidth:!0})}),(0,j.jsx)(nS,{children:(0,j.jsx)(z.Trans,{message:"{credits, plural, one {# credit} other {# credits}}",id:"T57gLR",values:{credits:f}})})]})})})]}),!r&&h&&(0,j.jsxs)(nr.Stack,{fontSize:"xs",spacing:1,align:"center",textAlign:"center",children:[(0,j.jsxs)(U.HStack,{fontSize:"xs",children:[(0,j.jsx)(iS.Box,{children:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faHourglass,size:"sm",fixedWidth:!0})}),(0,j.jsx)(Z.Text,{children:(0,j.jsx)(z.Trans,{message:"Credits refresh on {nextCreditRefillTime}",id:"/R4cbg",values:{nextCreditRefillTime:x}})})]}),(0,j.jsxs)(U.HStack,{fontSize:"xs",children:[(0,j.jsx)(iS.Box,{children:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faPiggyBank,size:"sm",fixedWidth:!0})}),(0,j.jsx)(Z.Text,{children:(0,j.jsx)(z.Trans,{message:"Unused credits roll over (up to {formattedCreditsCap} max)",id:"6pHWnz",values:{formattedCreditsCap:y}})})]})]}),r&&h&&(0,j.jsxs)(nf.Alert,{status:"error",fontSize:"xs",lineHeight:"base",children:[(0,j.jsx)(nx.AlertIcon,{boxSize:4}),(0,j.jsx)(nb.AlertDescription,{lineHeight:"base",children:(0,j.jsx)(z.Trans,{message:"Heads up: These credits will expire when your subscription ends on {formattedSubscriptionExpirationTime} unless you reactivate.",id:"NFjGKD",values:{formattedSubscriptionExpirationTime:v}})})]}),n&&(0,j.jsxs)(N.Flex,{alignItems:"center",justifyContent:"center",flexWrap:"wrap",gap:2,children:[t.shouldShow&&(0,j.jsx)(X.GammaTooltip,{placement:"top",label:t.tooltipContent,isDisabled:!t.tooltipContent,shouldWrapChildren:!0,children:(0,j.jsx)(P.Button,{size:"sm",variant:"solid",onClick:()=>u(e),isDisabled:t.isDisabled,children:(0,j.jsx)(z.Trans,{message:"Buy credits",id:"34+TCH"})})}),i.shouldShow&&(0,j.jsx)(X.GammaTooltip,{label:i.tooltipContent,isDisabled:!i.tooltipContent,shouldWrapChildren:!0,children:(0,j.jsx)(P.Button,{size:"sm",variant:"plain",onClick:()=>p(e),isDisabled:i.isDisabled,children:(0,j.jsx)(z.Trans,{message:"Enable auto-recharge",id:"tJYKc2"})})})]}),a&&(0,j.jsx)(um,{onEditAutoRecharge:()=>p(e),source:e}),!h&&(0,j.jsx)(Z.Text,{fontSize:"xs",color:"gray.500",w:{base:"100%",lg:"70%"},textAlign:"center",children:(0,j.jsx)(uh,{})})]})},uf=({...e})=>{let t=(0,i5.useFeatureFlag)("ai-credits").enabled,i=l0.FREE_WORKSPACE_MAX_CREDITS.toLocaleString(),n=(0,i5.useFeatureFlag)("ai-credits").signup;return(0,j.jsxs)(cu,{allowMultiple:!0,w:"100%",...e,children:[(0,j.jsx)(ub,{accordionLabel:d.i18n._({id:"FEnrpk",message:"What uses credits?"}),children:(0,j.jsx)(z.Trans,{message:"Credits are used for AI features throughout {GAMMA_PROPER_NOUN}.",id:"lx7AlJ",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}})}),(0,j.jsx)(ub,{accordionLabel:d.i18n._({id:"aY94pc",message:"How many credits do I get?"}),children:(0,j.jsx)(z.Trans,{message:"Your {FREE_PROPER_NOUN} plan gives you {creditsAtSignup} credits at signup.",id:"V4Hmhl",values:{FREE_PROPER_NOUN:iT.FREE_PROPER_NOUN,creditsAtSignup:n}})}),t&&(0,j.jsxs)(ub,{accordionLabel:d.i18n._({id:"1pwdRz",message:"How can I earn more credits?"}),children:[(0,j.jsx)("p",{children:(0,j.jsx)(z.Trans,{message:"Subscribe to a paid plan for more credits that refresh monthly, or invite friends with your referral link to earn credits when they join.",id:"hw9pwF"})}),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("br",{}),(0,j.jsx)("p",{children:(0,j.jsx)(z.Trans,{message:"Free accounts can have up to {maxCreditsLocalizedString} credits at once per user. As you spend credits, you can keep earning more. There's no limit to how much you can earn overall.",id:"zozLpO",values:{maxCreditsLocalizedString:i}})})]})]})]})},ub=({accordionLabel:e,children:t})=>(0,j.jsxs)(cg,{children:[(0,j.jsx)("h2",{children:(0,j.jsxs)(cp,{px:2,py:2,fontSize:"sm",children:[(0,j.jsx)(iS.Box,{as:"span",flex:"1",textAlign:"start",fontWeight:"semibold",children:e}),(0,j.jsx)(cm,{})]})}),(0,j.jsx)(cb,{pb:4,px:2,fontSize:"sm",children:t})]});var ux=e.i(408614);let uy=()=>{let{subscription:e}=(0,iI.useMonetizationContext)(),t=e?.nextCreditRefillTime,i=null!==t?function(e,t){(0,n_.default)(2,arguments);var i=nj(e,t)/6e4;return i>0?Math.floor(i):Math.ceil(i)}(nF(t),new Date):null;return i?(0,ux.formatRefillDuration)(i):null},uv=()=>(0,j.jsx)(Z.Text,{children:(0,j.jsx)(z.Trans,{message:"Credits are used for AI features throughout {GAMMA_PROPER_NOUN}.",id:"lx7AlJ",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}})}),uC=()=>{let{product:e}=(0,iI.useMonetizationContext)(),{monthlyCredits:t,maxCredits:i}=(0,i5.useFeatureFlag)("plan-credits")[e],n=d.i18n.number(t,{useGrouping:!0}),a=d.i18n.number(i,{useGrouping:!0}),r=uy(),o=iL[e].name;return(0,j.jsxs)(nr.Stack,{spacing:4,children:[(0,j.jsx)(Z.Text,{children:(0,j.jsx)(z.Trans,{message:"Your {planName} plan includes {formattedMonthlyCredits} credits per month. Unused credits roll over to the next month, up to {formattedMaxCredits} total.",id:"GpcXel",values:{planName:o,formattedMonthlyCredits:n,formattedMaxCredits:a}})}),r&&(0,j.jsx)(Z.Text,{children:r})]})},uw=()=>{let e=(()=>{let{product:e}=(0,iI.useMonetizationContext)(),t=(0,i5.useFeatureFlag)("plan-credits"),i=d.i18n.number(t.pro.monthlyCredits,{useGrouping:!0}),n=d.i18n.number(t.ultra.monthlyCredits,{useGrouping:!0});switch(e){case"plus":return(0,j.jsx)(z.Trans,{message:"<0>Upgrade your plan: Move to {PRO_PROPER_NOUN} ({formattedProCredits} credits/month) or {ULTRA_PROPER_NOUN} ({formattedUltraCredits} credits/month).",id:"0bdOsj",values:{PRO_PROPER_NOUN:iT.PRO_PROPER_NOUN,formattedProCredits:i,ULTRA_PROPER_NOUN:iT.ULTRA_PROPER_NOUN,formattedUltraCredits:n},components:{0:(0,j.jsx)("strong",{})}});case"pro":return(0,j.jsx)(z.Trans,{message:"<0>Upgrade your plan: Move to {ULTRA_PROPER_NOUN} ({formattedUltraCredits} credits/month).",id:"uPlFN3",values:{ULTRA_PROPER_NOUN:iT.ULTRA_PROPER_NOUN,formattedUltraCredits:n},components:{0:(0,j.jsx)("strong",{})}});default:return null}})(),t=(0,j.jsx)(z.Trans,{message:"<0>Buy more credits: Add more credits whenever you need them.",id:"kHp1NK",components:{0:(0,j.jsx)("strong",{})}});return e?(0,j.jsx)(nr.Stack,{children:(0,j.jsxs)(cY.UnorderedList,{children:[(0,j.jsx)(cY.ListItem,{children:t}),e&&(0,j.jsx)(cY.ListItem,{children:e})]})}):t},uS=()=>(0,j.jsxs)(cu,{allowMultiple:!0,w:"100%",children:[(0,j.jsx)(uk,{question:(0,j.jsx)(z.Trans,{message:"What uses credits?",id:"FEnrpk"}),answer:(0,j.jsx)(uv,{})}),(0,j.jsx)(uk,{question:(0,j.jsx)(z.Trans,{message:"How many credits do I get?",id:"aY94pc"}),answer:(0,j.jsx)(uC,{})}),(0,j.jsx)(uk,{question:(0,j.jsx)(z.Trans,{message:"How can I get more credits?",id:"4Eyi4b"}),answer:(0,j.jsx)(uw,{})})]}),uk=({question:e,answer:t})=>(0,j.jsxs)(cg,{children:[(0,j.jsx)("h2",{children:(0,j.jsxs)(cp,{px:2,py:2,fontSize:"sm",children:[(0,j.jsx)(iS.Box,{as:"span",flex:"1",textAlign:"start",fontWeight:"semibold",children:e}),(0,j.jsx)(cm,{})]})}),(0,j.jsx)(cb,{pb:4,px:2,fontSize:"sm",children:t})]});var uA=e.i(641295);let uE=({url:e,placeholder:t,isDisabled:i=!1,variant:n="plain",customLabel:a,onClick:r,paddingLeft:o=4,...s})=>{let[l,d]=(0,F.useState)(!1),{hasCopied:c,onCopy:u}=(0,ud.useClipboard)(e),p=(0,F.useRef)(null),h=(0,dx.useToast)(),m="link-copied-toast",g=(0,uA.useBreakpointValue)({base:!0,sm:!1},{fallback:"sm"});(0,F.useEffect)(()=>{p.current&&l&&(p.current.focus(),p.current.select())},[l]);let f=(0,F.useCallback)(()=>d(!0),[]),b=(0,F.useCallback)(()=>d(!1),[]),x=(0,F.useCallback)(()=>{u(),h.isActive(m)||h({id:m,title:(0,j.jsx)(z.Trans,{message:"Link copied to clipboard",id:"pQjjYo"}),status:"success",duration:5e3}),r?.()},[r,u,h]),y=a||(0,j.jsx)(z.Trans,{message:"Copy",id:"he3ygx"}),v=!!(g&&void 0!==a),C=(0,j.jsx)(P.Button,{isDisabled:i,onClick:x,variant:n,w:"100%",...v?{}:{height:"2rem",margin:2},...i?{opacity:"1 !important",color:"gray.400",_hover:{opacity:"1"},_active:{boxShadow:"0 none"}}:{},children:c?(0,j.jsx)(z.Trans,{message:"Copied",id:"6V3Ea3"}):y}),w=(0,j.jsx)(dS.Input,{ref:p,type:"text",variant:"filled",paddingLeft:o,direction:"ltr",value:e,isReadOnly:!0,isDisabled:i,placeholder:t||void 0,onClick:f,onBlur:b,pointerEvents:i?"none":void 0,h:"3rem",...s});return v?(0,j.jsxs)(nr.Stack,{w:"100%",children:[w,C]}):(0,j.jsxs)(dv.InputGroup,{dir:"ltr",children:[w,(0,j.jsx)(dk.InputRightElement,{h:"3rem",zIndex:1,w:"unset",children:C})]})},u_=({onCloseCallback:e,onOpenCallback:t,segmentEvent:i,upsellLocation:n})=>{let a=(0,m.useRtlEnabled)(),{user:r,currentWorkspace:o}=(0,el.useUserContext)(),s=(0,i4.useCanManageWorkspace)(),l=(0,iM.useCanUseProductFeature)("unlimited_credits"),[u,p]=(0,F.useState)("buy"),h=(0,i5.useFeatureFlag)("ai-credits"),g=l0.FREE_WORKSPACE_MAX_CREDITS.toLocaleString(),{data:f}=(0,iW.useGetWorkspaceInviteCodeQuery)({variables:{id:o?.id??""},skip:!s||!o?.id}),b=f?.workspaceInviteCode,x=(0,F.useMemo)(()=>r?"teammate"===u&&o&&s&&b?(0,dy.joinWorkspaceUrlWithReferral)(o.id,b,r.id):"friend"===u?(0,dy.gammaReferralUrl)(r.id):"":"",[s,o,u,r,b]),y=h.referralBonus,v={friend:{label:d.i18n._({id:"uU68PM",message:"Copy referral link"})},teammate:{label:d.i18n._({id:"O/k8gF",message:"Copy workspace invite"})},buy:{label:d.i18n._({id:"/2RIKE",message:"Buy more credits"})}}[u],C=a?"friend"===u?44:56:void 0;return(0,j.jsxs)(O.VStack,{spacing:4,children:[(0,j.jsxs)(cq.ButtonGroup,{variant:"ghost",size:"sm",spacing:0,gap:2,justifyContent:"center",flexWrap:"wrap",alignItems:"center",children:[!l&&(0,j.jsx)(P.Button,{onClick:()=>p("buy"),isActive:"buy"===u,color:"buy"===u?void 0:"gray.600",children:(0,j.jsx)(z.Trans,{message:"Get more credits",id:"Et23WT"})}),(0,j.jsx)(P.Button,{onClick:()=>p("friend"),isActive:"friend"===u,color:"friend"===u?void 0:"gray.600",children:(0,j.jsx)(z.Trans,{message:"Refer a friend",id:"KSBmDv"})}),s&&(0,j.jsx)(P.Button,{leftIcon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faUserPlus,fixedWidth:!0}),onClick:()=>p("teammate"),isActive:"teammate"===u,color:"teammate"===u?void 0:"gray.600",children:(0,j.jsx)(z.Trans,{message:"Invite a teammate",id:"dUOpaF"})})]}),("friend"===u||"teammate"===u)&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(U.HStack,{spacing:2,children:[(0,j.jsxs)(Z.Text,{fontSize:"sm",minW:"50%",children:["friend"===u&&(0,j.jsx)(z.Trans,{message:"{referralBonusAmount, plural, one {Give {referralBonusAmount} credit and earn {referralBonusAmount} credit for each new referral who signs up for {GAMMA_PROPER_NOUN}.} other {Give {referralBonusAmount} credits and earn {referralBonusAmount} credits for each new referral who signs up for {GAMMA_PROPER_NOUN}.}}",id:"tBKKYy",values:{referralBonusAmount:y,GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}}),"teammate"===u&&(0,j.jsx)(z.Trans,{message:"{referralBonusAmount, plural, one {Give {referralBonusAmount} credit and earn {referralBonusAmount} credit for each new referral who signs up and joins your workspace.} other {Give {referralBonusAmount} credits and earn {referralBonusAmount} credits for each new referral who signs up and joins your workspace.}}",id:"q8MWFp",values:{referralBonusAmount:y}}),(0,j.jsx)(Z.Text,{fontSize:"xs",color:"gray.500",as:"span",display:"inline-block",children:(0,j.jsx)(z.Trans,{message:"(Free accounts can have up to {maxCreditsLocalizedString} credits at once)",id:"fzvA8p",values:{maxCreditsLocalizedString:g}})})]}),(0,j.jsxs)(iA.Badge,{colorScheme:"green",fontSize:"xs",children:["+"," ",(0,j.jsx)(z.Trans,{message:"{referralBonusAmount, plural, one {# credit} other {# credits}}",id:"NFNFrR",values:{referralBonusAmount:y}})]})]}),(0,j.jsx)(uE,{url:x,paddingLeft:C,customLabel:v.label})]}),"buy"===u&&(0,j.jsx)(nh,{segmentEvent:i,onOpenCallback:e,onCloseCallback:t,title:(0,j.jsx)(z.Trans,{message:"More power, fewer limits",id:"1lwYKC"}),targetFeature:"unlimited_credits",upsellLocation:n})]})},uI=(0,F.memo)(({onClose:e,onOpen:t,upsellLocation:i,segmentEvent:n=nm.SegmentEvents.GAMMA_PRO_UPSELL_CALLOUT_AI_CREDITS})=>{let{product:a,subscription:r}=(0,iI.useMonetizationContext)(),{lowCreditStatus:o,credits:s}=(0,i3.useCreditStatus)(),{currentWorkspace:l}=(0,el.useUserContext)(),d=!a,c=(0,i5.useFeatureFlag)("planCreditsLaunch")&&a&&["plus","pro"].includes(a)&&o===ns.LowCreditStatus.EXHAUSTED;return(0,W.useAnalyticsEffect)(e=>{e.track(nm.SegmentEvents.CREDITS_INFO_MODAL_OPENED,{...ng(l,r),low_credit_status:o,credits:s,upsellLocation:i})},[]),(0,j.jsx)(no.DarkModeProvider,{isDark:!1,children:(0,j.jsxs)(ne.Modal,{isOpen:!0,onClose:()=>{iU.analytics.track(nm.SegmentEvents.CREDITS_INFO_MODAL_CLOSED,{...ng(l,r),low_credit_status:o,credits:s,upsellLocation:i}),e()},size:"xl",returnFocusOnClose:!1,children:[(0,j.jsx)(na.ModalOverlay,{}),(0,j.jsxs)(nn.ModalContent,{overflow:"hidden",children:[(0,j.jsx)(ni.ModalCloseButton,{_hover:{bgColor:"blackAlpha.50"}}),(0,j.jsxs)(nt.ModalBody,{pb:4,p:0,children:[(0,j.jsxs)(iS.Box,{bg:"blue.50",borderBottom:"1px solid",borderColor:"blue.100",children:[(0,j.jsxs)(U.HStack,{spacing:1.5,px:6,pt:4,children:[(0,j.jsx)(i8.Avatar,{src:l?.logoUrl,size:"xs",name:l?.name}),(0,j.jsx)(Z.Text,{fontSize:"xs",children:l?.name})]}),(0,j.jsx)(iS.Box,{w:"100%",p:6,pt:1,children:(0,j.jsx)(ug,{trackingSource:"credits_modal"})})]}),(0,j.jsxs)(nr.Stack,{p:6,spacing:4,alignItems:"center",w:"100%",children:[d?(0,j.jsx)(u_,{onCloseCallback:e,onOpenCallback:t,segmentEvent:n,upsellLocation:i}):c?(0,j.jsx)(nh,{segmentEvent:n,onOpenCallback:e,onCloseCallback:t,targetFeature:"unlimited_credits",upsellLocation:i}):null,d?(0,j.jsx)(uf,{}):(0,j.jsx)(uS,{}),(0,j.jsx)(P.Button,{variant:"link",rightIcon:(0,j.jsx)(i9.ExternalLinkIcon,{}),as:i7.Link,isExternal:!0,href:nl.AI_CREDITS,size:"xs",color:"gray.500",_hover:{color:"gray.700",textDecoration:"none"},children:(0,j.jsx)(z.Trans,{message:"Frequently asked questions",id:"a3pVqb"})})]})]})]})]})})}),uM=({onClose:e,onOpen:t,segmentEvent:i,upsellLocation:n})=>(0,j.jsx)(uI,{onClose:e,onOpen:t,segmentEvent:i,upsellLocation:n}),uT=(0,F.memo)(e=>{let{isOpen:t,...i}=e;return(0,j.jsx)(j.Fragment,{children:t?(0,j.jsx)(uM,{...i}):null})});e.s(["AICreditsModal",0,uT],399839);let uL=(0,F.memo)(({credits:e,lowCreditStatus:t,onClick:i,size:n,iconOnly:a,isDark:r})=>{let o=null===e,{colorMode:s}=(0,R.useColorMode)(),l=(0,j.jsx)(z.Trans,{message:"Learn more about credits",id:"rfczaI"}),c=(({lowCreditStatus:e,isDark:t})=>{if(e===ns.LowCreditStatus.EXHAUSTED)if(t)return{color:"red.500",bg:"transparent",_hover:{bg:"red.300"},_active:{bg:"red.200"}};else return{color:"red.700",bg:"transparent",_hover:{bg:"red.50"},_active:{bg:"red.100"}};if(e===ns.LowCreditStatus.LOW)if(t)return{color:"orange.500 !important",bg:"transparent",_hover:{bg:"orange.200 !important"},_active:{bg:"orange.300 !important"}};else return{color:"orange.700 !important",bg:"transparent",_hover:{bg:"orange.100 !important"},_active:{bg:"orange.200 !important"}};return t?{color:"titanium.300",bg:"transparent",_hover:{bg:"elevation.3"},_active:{bg:"elevation.4"}}:{color:"blue.950",bg:"transparent",_hover:{bg:"blue.50"},_active:{bg:"blue.100"}}})({lowCreditStatus:t,isDark:r??"dark"===s});return a?(0,j.jsx)(X.GammaTooltip,{label:l,children:(0,j.jsx)(ik.IconButton,{size:n??"sm",onClick:i,isDisabled:o,variant:"ghost",...c,"aria-label":d.i18n._({id:"eNAYzo",message:"Open AI credits modal"}),icon:o?(0,j.jsx)(ny.Spinner,{size:"xs"}):(0,j.jsx)(B.FontAwesomeIcon,{icon:eS.faSparkles,fixedWidth:!0})})}):(0,j.jsx)(X.GammaTooltip,{label:l,children:(0,j.jsx)(P.Button,{size:n??"sm",py:4,px:4,onClick:i,isDisabled:o,variant:"ghost",...c,children:o?(0,j.jsx)(ny.Spinner,{size:"xs"}):(0,j.jsx)(nr.Stack,{direction:"column",w:"100%",spacing:.5,children:(0,j.jsxs)(nr.Stack,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,j.jsx)(B.FontAwesomeIcon,{icon:eS.faSparkles,fixedWidth:!0}),(0,j.jsx)(Z.Text,{as:"span",children:(0,j.jsx)(z.Trans,{message:"{credits, plural, one {# credit} other {# credits}}",id:"T57gLR",values:{credits:e}})})]})})})})}),uj=(0,i6.default)(({modalId:e="ai-credits-modal",segmentEvent:t,upsellLocation:i,isDark:n,showForPaidPlans:a=!1,size:r,iconOnly:o,...s})=>{let{hasUnlimitedCredits:l,credits:d,lowCreditStatus:c,onAICreditsModalOpen:u,onAICreditsModalClose:p,isAICreditsModalOpen:h}=((e="ai-credits-modal")=>{let t=(0,iM.useCanUseProductFeature)("unlimited_credits"),{lowCreditStatus:i,credits:n,isCreditsReady:a}=(0,i3.useCreditStatus)(),{onOpen:r,onClose:o,isOpen:s}=(0,t6.useDisclosure)({id:e});return{hasUnlimitedCredits:t,lowCreditStatus:i,credits:n,onAICreditsModalOpen:r,onAICreditsModalClose:o,isAICreditsModalOpen:s,isCreditsReady:a}})(e);return l&&!a?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(N.Flex,{...s,children:(0,j.jsx)(uL,{credits:d,onClick:u,lowCreditStatus:c,isDark:n,size:r,iconOnly:o})}),(0,j.jsx)(uT,{isOpen:h,onOpen:u,onClose:p,segmentEvent:t,upsellLocation:i})]})});e.s(["AICreditsBadgeAndModalWithOfflineCheck",0,uj],400722);var uP=e.i(85583);let uD=e=>cN.featureFlags.get("aiApiHostEnabled")||!0===cN.featureFlags.get("aiApiHostPrompts")[e]?iQ.config.AI_API_HOST:iQ.config.API_HOST,uN=()=>cN.featureFlags.get("aiApiHostEnabledImageGenerate")?iQ.config.AI_API_HOST:iQ.config.API_HOST,uR=()=>cN.featureFlags.get("aiApiHostEnabledMediaGraphql")?{clientName:"gammaAIServiceGraphql"}:{};e.s(["getAiMediaGraphqlContext",0,uR,"getApiHostForChatCompletion",0,uD,"getApiHostForImageEdit",0,()=>cN.featureFlags.get("aiApiHostEnabledImageEdit")?iQ.config.AI_API_HOST:iQ.config.API_HOST,"getApiHostForImageGenerate",0,uN],974994);var uO=e.i(400340);let uB={src:e.i(507349).default,width:2561,height:2256,blurWidth:8,blurHeight:7,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAA0ElEQVR42mVNvQqCYAD8llpaK6ipKXqJ6IcaWxqioSAyhBQJHGxqcJIgENIk8APBQXRwcBVE8CXEyUlBXV10MZECoeE47oc7UBQF+CHLsmYcx526B+rCsqw5QRDPJEnaf4UwDHs0Td8URdmKonhK07Tled6wCvM8b3AchzuOM3Zdd0SS5EPX9bUgCOeqYNv2hOd5XNO0TXkzwzDsRVHUPYqiLgiCoI8gCFRVdQMhPBqGsWIY5oqi6Jtl2QvwfX8gSdJBluX9FzvTNJfl6rTkxQeXOI3Rh1kXyAAAAABJRU5ErkJggg=="},uz={src:e.i(589080).default,width:128,height:128,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAA00lEQVR42gHIADf/AAMEBQQEBRkVGkY7R11OXnFdckNAUgUGCAAEBQYyKzKegJnBmbvGnsDDncJzepkIDhAAGBUZnoCXvpnAmJ2zgpGbe4+XUW93CQ4QAD0zP8Obt6WWvlhrdIV1h5Z/lnZsiBQYIwBPP1rGnLmbj7ZOUWmvmK3Kn72djLUlLEwARTdjupKuso+yfWuNloGbwJezmIewJzFjABgbXnJfi6uFo66KpauKpaaIpIB/oxwzcAADH2gNJ2wyRHpAWH84VX0tTnseRnkML22VNE+efFJHngAAAABJRU5ErkJggg=="},uF={src:e.i(663484).default,width:28,height:28,blurWidth:0,blurHeight:0},uH={src:e.i(989101).default,width:1e3,height:1e3,blurWidth:0,blurHeight:0},uW={src:e.i(670350).default,width:180,height:180,blurWidth:8,blurHeight:8,blurDataURL:"data:image/webp;base64,UklGRoIBAABXRUJQVlA4THUBAAAvB8ABEM1VICICHgiADQIAAID3mPyUCqBCApBABYArEAAAAAAAAAAAAAAAAAAAnHQhIERdQSkAdPIOAADAAwHAQQQAADj/3V1b1bQV1hICAAEAAAAAAAAAAAAAAAAAAAAAAAA8AADAQwAqlNa6Zh4IgA0CAADA+f/b761CJRQBCIIAEIEAAAAAAAAAAAAAAAAAAAAAAAACIvQQPV68nOeBYMAgAAAAnP/CRR7AQQgAABAIAAAgAXQAISrBAQAUKAAACgAAxEkEgFCAAAAQ54kECyCLMIU8ywqR03Jje799jnQq5D8QRGVVdC3C2iltWPaGPenWnO9AwMs6yYJ2obedVY45RCyN8OyurCZpK+3K4lIVCIxVzHi3EpyB0MwEB5M5k/5UlPorQn4KfP8YRtDHcd2NSlViWNrkH7zWwO8Nl3Sc1BL51WsrDh7sdFD87kvjBurg1CPmwYmx/npc5rV/rgXO+m71OA3jPU7T89TXIoNt5E4WAA=="},uU={src:e.i(185734).default,width:773,height:773,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAb0lEQVR42nXNsQpAUBTG8cuCDLJZPYDNQMoTsBsZPYXHsFrIIB7AbPMOXsVfUdyuU786nfPVJ8R3XDhCMSZiNAhVgRwdekTyU0OFEQPSv8CCDS0SWO9QgR0H1ruuhP0EriXDjAk1fOhylYcAxnM8ATWyDdFLteISAAAAAElFTkSuQmCC"},uV={src:e.i(799718).default,width:103,height:128,blurWidth:6,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAYAAADaxo44AAAA00lEQVR42gHIADf/ABmj5P8Wjcf/EJ/h/w6e4f8Udaj/EpTT/wAmotz/H1h//x9+qP8Xdaf/HDhS/xqBtf8AS6TS/zllbv9EaVD/P1xD/yErMf80eJ3/AGWavP8zU1//Lj1I/zFEOv8dIyn/SWqA/wB3l67/ITBL/xwjNP8YHCj/GBkj/0lWYv8Agpil/x8sQv8aHiv/Fhgg/xYWH/85PkX/AHeHkv8dK0T/GSAx/xYYIf8VFR3/Jigv/wBpdoL/HytD/xwjNP8ZHCb/FxYe/xwdJf/FD1s0ErCF9AAAAABJRU5ErkJggg=="},uG={src:e.i(896614).default,width:320,height:320,blurWidth:0,blurHeight:0},u$={src:e.i(83950).default,width:112,height:112,blurWidth:0,blurHeight:0};function uZ(e){return"object"==typeof e&&null!==e&&"error"in e&&"plan_restricted"===e.error}e.s(["isGenerateImagePlanRestriction",0,uZ],486962);let uK="Recraft",uq={creatorLabel:()=>"Ideogram",image:uH,flag:"ideogram",provider:"ideogram"},uY={creatorLabel:()=>"Luma",image:uU,flag:"lumaPhoton",provider:"luma"},uX={"playground-2.5":"flux-1-schnell","stable-diffusion-xl-v1-0":"flux-1-schnell","playground-3":"flux-2-pro","ideogram-v2-turbo":"ideogram-v3-turbo","ideogram-v2":"ideogram-v3","hidream-i1-fast":"flux-2-klein","hidream-i1-dev":"flux-2-klein","hidream-i1-full":"flux-2-klein","qwen-image":"flux-2-klein","qwen-image-fast":"flux-2-klein","imagen-3-pro":"imagen-4-pro","flux-1-pro":"flux-2-pro","flux-kontext-max":"flux-2-flex","flux-1-ultra":"flux-2-max"},uQ={"gemini-2.5-flash-image":{label:()=>"Gemini 2.5 Flash Image",description:()=>d.i18n._({id:"fkCuQM",message:"{GOOGLE_PROPER_NOUN}'s Gemini 2.5 Flash, the faster version of Nano Banana",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_models_plus",flag:"gemini25FlashImage",provider:"google",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1TSz1T",message:"People, colors"}),speed:2,cost:20,isLegacy:!0,supportsMasklessEdit:!0,supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"]},"gemini-3-pro-image":{label:()=>"Nano Banana Pro",description:()=>d.i18n._({id:"NfpkaQ",message:"{GOOGLE_PROPER_NOUN}'s Gemini 3 Pro with 2K resolution for high-quality image generation",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_premium_models",flag:"gemini3ProImage",provider:"google",bestStyle:()=>d.i18n._({id:"RO7y9L",message:"Infographics"}),bestType:()=>d.i18n._({id:"aL+u3T",message:"Text, infographics"}),speed:2,cost:70,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:40,alwaysChargeCredits:!0,supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"]},"gemini-3-pro-image-hd":{label:()=>"Nano Banana Pro HD",description:()=>d.i18n._({id:"58I3+N",message:"{GOOGLE_PROPER_NOUN}'s Gemini 3 Pro with 4K resolution for ultra high-quality images",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_models_ultra",flag:"gemini3ProImage",provider:"google",bestStyle:()=>d.i18n._({id:"RO7y9L",message:"Infographics"}),bestType:()=>d.i18n._({id:"aL+u3T",message:"Text, infographics"}),speed:1,cost:120,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:90,supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"]},"gemini-3.1-flash-image-mini":{label:()=>"Nano Banana 2 Mini",description:()=>d.i18n._({id:"FcnQ/x",message:"{GOOGLE_PROPER_NOUN}'s Gemini 3.1 Flash with 1K resolution",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,flag:"gemini31FlashImageMini",provider:"google",bestStyle:()=>d.i18n._({id:"RO7y9L",message:"Infographics"}),bestType:()=>d.i18n._({id:"aL+u3T",message:"Text, infographics"}),speed:4,cost:34,alwaysChargeCredits:!0,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:20,badge:"new",isRecommended:!0,supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"]},"gemini-3.1-flash-image":{label:()=>"Nano Banana 2",description:()=>d.i18n._({id:"bxrjWo",message:"{GOOGLE_PROPER_NOUN}'s Gemini 3.1 Flash with 2K resolution",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_premium_models",flag:"gemini31FlashImage",provider:"google",bestStyle:()=>d.i18n._({id:"RO7y9L",message:"Infographics"}),bestType:()=>d.i18n._({id:"aL+u3T",message:"Text, infographics"}),speed:3,cost:50,alwaysChargeCredits:!0,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:40,badge:"new",supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"],isRecommended:!0},"gemini-3.1-flash-image-hd":{label:()=>"Nano Banana 2 HD",description:()=>d.i18n._({id:"Qywxv3",message:"{GOOGLE_PROPER_NOUN}'s Gemini 3.1 Flash with 4K resolution for ultra high quality",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_models_ultra",flag:"gemini31FlashImageHd",provider:"google",bestStyle:()=>d.i18n._({id:"RO7y9L",message:"Infographics"}),bestType:()=>d.i18n._({id:"aL+u3T",message:"Text, infographics"}),speed:2,cost:75,alwaysChargeCredits:!0,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:70,badge:"new",supportedAspectRatios:["portrait4x5","portrait9x16","landscape4x3","landscape16x9"]},"flux-1-schnell":{label:()=>"Flux Fast",description:()=>d.i18n._({id:"iksSRU",message:"The fastest {FLUX_PROPER_NOUN} model; gives vivid colors",values:{FLUX_PROPER_NOUN:iT.FLUX_PROPER_NOUN}}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux1Schnell",disabledFlag:"flux1Quick",provider:"baseten",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:4,cost:2},"flux-1-quick":{label:()=>"Flux Fast 1.1",description:()=>d.i18n._({id:"hpqgA9",message:"Fast speed with bright, vivid colors"}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux1Quick",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:4,cost:2,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-kontext-fast":{label:()=>"Flux Kontext Fast",description:()=>d.i18n._({id:"Cw1xXb",message:"Fast new model that supports text within images"}),creatorLabel:()=>"Black Forest",image:uB,flag:"fluxKontextFast",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"UUMdE6",message:"People, faces, text"}),speed:4,cost:2,isLegacy:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-kontext-pro":{label:()=>"Flux Kontext Pro",description:()=>d.i18n._({id:"lM7MEX",message:"Professional quality people, faces, and text"}),creatorLabel:()=>"Black Forest",image:uB,flag:"fluxKontextPro",productFeature:"ai_premium_models",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"UUMdE6",message:"People, faces, text"}),speed:2,cost:20,isLegacy:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-2-pro":{label:()=>"Flux 2 Pro",description:()=>d.i18n._({id:"eMkEZn",message:"Best for production workflows at scale with fast generation"}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux2Pro",productFeature:"ai_models_plus",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"bsUkOQ",message:"People, faces, text, colors"}),speed:3,cost:8,supportsHexPrompts:!0,supportsExactText:!0,supportsMasklessEdit:!0,isRecommended:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-2-flex":{label:()=>"Flux 2 Flex",description:()=>d.i18n._({id:"Tbqd0J",message:"Quality output with flexible generation settings"}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux2Flex",productFeature:"ai_premium_models",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"bsUkOQ",message:"People, faces, text, colors"}),speed:1,cost:20,supportsHexPrompts:!0,supportsExactText:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:60,alwaysChargeCredits:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-2-max":{label:()=>"Flux 2 Max",description:()=>d.i18n._({id:"6Z5kGo",message:"Highest quality {FLUX_PROPER_NOUN} model for final production",values:{FLUX_PROPER_NOUN:iT.FLUX_PROPER_NOUN}}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux2Max",productFeature:"ai_premium_models",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"bsUkOQ",message:"People, faces, text, colors"}),speed:2,cost:20,supportsHexPrompts:!0,supportsExactText:!0,supportsMasklessEdit:!0,estimatedTimeSeconds:15,alwaysChargeCredits:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"flux-2-klein":{label:()=>"Flux 2 Fast",description:()=>d.i18n._({id:"HSVQNg",message:"Fast, lightweight {FLUX_PROPER_NOUN} model with sub-second inference",values:{FLUX_PROPER_NOUN:iT.FLUX_PROPER_NOUN}}),creatorLabel:()=>"Black Forest",image:uB,flag:"flux2Klein",provider:"flux",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:4,cost:2,supportsMasklessEdit:!0,badge:"new",supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"imagen-3-flash":{label:()=>"Imagen 3 Fast",description:()=>d.i18n._({id:"Q9Ah87",message:"The fastest model by {GOOGLE_PROPER_NOUN}; works well with detailed prompts and instructions",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,flag:"imagenFlash",provider:"google",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:4,cost:2,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"imagen-4-fast":{label:()=>"Imagen 4 Fast",description:()=>d.i18n._({id:"3vHhZU",message:"The fastest model by {GOOGLE_PROPER_NOUN}",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_models_plus",flag:"imagen4Fast",provider:"google",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1TSz1T",message:"People, colors"}),speed:2,cost:10,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"imagen-4-pro":{label:()=>"Imagen 4",description:()=>d.i18n._({id:"2YnLm1",message:"The latest model by {GOOGLE_PROPER_NOUN}",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_premium_models",flag:"imagen4",provider:"google",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1TSz1T",message:"People, colors"}),speed:2,supportsExactText:!0,cost:20,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"imagen-4-ultra":{label:()=>"Imagen 4 Ultra",description:()=>d.i18n._({id:"WRAPSR",message:"The most advanced model by {GOOGLE_PROPER_NOUN}",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),creatorLabel:()=>"Google",image:uF,productFeature:"ai_models_ultra",flag:"imagen4",provider:"google",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1TSz1T",message:"People, colors"}),speed:1,supportsExactText:!0,cost:30,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"ideogram-v3-turbo":{...uq,label:()=>"Ideogram 3.0 Turbo",description:()=>d.i18n._({id:"YiuHAi",message:"The fastest v3 model from {IDEOGRAM_PROPER_NOUN}; good balance of speed and quality",values:{IDEOGRAM_PROPER_NOUN:iT.IDEOGRAM_PROPER_NOUN}}),flag:"ideogram3",freeFlag:"ideogramTurboFree",productFeature:"ai_models_plus",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:3,cost:6,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"ideogram-v3-flash":{...uq,label:()=>"Ideogram 3.0 Flash",description:()=>d.i18n._({id:"nzTHCG",message:"Ultra-fast model from {IDEOGRAM_PROPER_NOUN} with lightning speed",values:{IDEOGRAM_PROPER_NOUN:iT.IDEOGRAM_PROPER_NOUN}}),flag:"ideogram3Flash",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:4,cost:3,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"ideogram-v3":{...uq,label:()=>"Ideogram 3.0",description:()=>d.i18n._({id:"pKUvA/",message:"High quality model from {IDEOGRAM_PROPER_NOUN} with improved text handling",values:{IDEOGRAM_PROPER_NOUN:iT.IDEOGRAM_PROPER_NOUN}}),flag:"ideogram3",productFeature:"ai_premium_models",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:2,cost:20,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"ideogram-v3-quality":{...uq,label:()=>"Ideogram 3.0 Quality",description:()=>d.i18n._({id:"XDomDb",message:"Highest quality model from {IDEOGRAM_PROPER_NOUN} with improved text handling",values:{IDEOGRAM_PROPER_NOUN:iT.IDEOGRAM_PROPER_NOUN}}),flag:"ideogram3",productFeature:"ai_models_ultra",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:2,cost:45,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"ideogram-gamma-custom":{...uq,label:()=>"Gamma Style (Ideogram version)",description:()=>d.i18n._({id:"dMiA90",message:"Custom brand model from {IDEOGRAM_PROPER_NOUN} with quality rendering",values:{IDEOGRAM_PROPER_NOUN:iT.IDEOGRAM_PROPER_NOUN}}),flag:"ideogramV3Custom",productFeature:"ai_premium_models",bestStyle:()=>d.i18n._({id:"UEtIGq",message:"Brand styles"}),bestType:()=>d.i18n._({id:"CzrLyb",message:"Brand imagery"}),speed:2,cost:45,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"gpt-image-1-mini-medium":{label:()=>"GPT Image Mini",description:()=>d.i18n._({id:"3XL96d",message:"Great for illustrations with text and complex prompts at lower cost"}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_models_plus",flag:"gpt4oImageLow",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:1,estimatedTimeSeconds:60,supportsExactText:!0,supportsHexPrompts:!0,supportsMasklessEdit:!0,cost:8},"gpt-image-1-mini-low":{label:()=>"GPT Image Mini Fast",description:()=>d.i18n._({id:"d7Juc8",message:"Fastest, lowest-cost GPT Image Mini variant for illustrations with text"}),creatorLabel:()=>"OpenAI",image:uG,flag:"gpt4oImageLow",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:2,estimatedTimeSeconds:40,supportsExactText:!0,supportsHexPrompts:!0,supportsMasklessEdit:!0,cost:3},"gpt-image-1-medium":{label:()=>"GPT Image",description:()=>d.i18n._({id:"8PB+vO",message:"Great for illustrations with text and complex prompts"}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_premium_models",flag:"gpt4oImageMedium",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:1,estimatedTimeSeconds:30,supportsHexPrompts:!0,supportsExactText:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,cost:30},"gpt-image-1-high":{label:()=>"GPT Image Detailed",description:()=>d.i18n._({id:"5XcnJA",message:"Excels at rendering text and following complex prompts, but can take a minute or more to generate"}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_models_ultra",flag:"gpt4oImage",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:1,estimatedTimeSeconds:55,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsExactText:!0,supportsMasklessEdit:!0,cost:120},"gpt-image-1-mini-high":{label:()=>"GPT Image Mini High",description:()=>d.i18n._({id:"1l+ugh",message:"Higher quality mini GPT image option"}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_premium_models",flag:"gpt4oImageMiniHigh",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:1,supportsExactText:!0,supportsHexPrompts:!0,cost:20},"gpt-image-2-mini":{label:()=>"GPT Image 2 Mini",description:()=>d.i18n._({id:"HKeuMp",message:"{OPENAI_PROPER_NOUN}'s GPT Image 2 at 1K resolution",values:{OPENAI_PROPER_NOUN:iT.OPENAI_PROPER_NOUN}}),creatorLabel:()=>"OpenAI",image:uG,flag:"gptImage2Mini",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:3,estimatedTimeSeconds:20,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,alwaysChargeCredits:!0,badge:"new",cost:5,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"gpt-image-2":{label:()=>"GPT Image 2",description:()=>d.i18n._({id:"TxHduA",message:"{OPENAI_PROPER_NOUN}'s GPT Image 2 at 2K resolution with strong text rendering",values:{OPENAI_PROPER_NOUN:iT.OPENAI_PROPER_NOUN}}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_premium_models",flag:"gptImage2",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:2,estimatedTimeSeconds:40,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,isRecommended:!0,alwaysChargeCredits:!0,badge:"new",cost:20,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"gpt-image-2-hd":{label:()=>"GPT Image 2 HD",description:()=>d.i18n._({id:"S5MIBH",message:"{OPENAI_PROPER_NOUN}'s GPT Image 2 at QHD resolution for ultra high quality",values:{OPENAI_PROPER_NOUN:iT.OPENAI_PROPER_NOUN}}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_models_ultra",flag:"gptImage2Hd",provider:"openai",bestStyle:()=>d.i18n._({id:"HSEky6",message:"Illustrations and diagrams"}),bestType:()=>d.i18n._({id:"7uXRvn",message:"Text, fine details"}),speed:1,estimatedTimeSeconds:60,supportsExactText:!0,supportsHexPrompts:!0,supportsFontReferenceImage:!0,supportsMasklessEdit:!0,alwaysChargeCredits:!0,badge:"new",cost:115,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"leonardo-phoenix":{label:()=>"Leonardo Phoenix",description:()=>d.i18n._({id:"iEAL9X",message:"Great for creative styles and text"}),creatorLabel:()=>"Leonardo",image:uW,flag:"leonardoPhoenix",productFeature:"ai_models_plus",provider:"leonardo",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:2,cost:15,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"leonardo-sdxl-gamma-lora":{label:()=>d.i18n._({id:"+U/o8H",message:"{GAMMA_PROPER_NOUN} Style",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}}),description:()=>d.i18n._({id:"IV4GSU",message:"{GAMMA_PROPER_NOUN} branded visual style",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}}),creatorLabel:()=>"Leonardo",image:uz,flag:"leonardoGammaLora",productFeature:"ai_models_plus",provider:"leonardo",bestStyle:()=>d.i18n._({id:"/xRMbA",message:"{GAMMA_PROPER_NOUN} branded",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}}),bestType:()=>d.i18n._({id:"vRaIg9",message:"Presentations, slides"}),speed:2,cost:25},"leonardo-sdxl-mrpeepers-lora":{label:()=>"Mr Peepers",description:()=>d.i18n._({id:"5iX44k",message:"Mr Peepers character style with {GAMMA_PROPER_NOUN} branding",values:{GAMMA_PROPER_NOUN:iT.GAMMA_PROPER_NOUN}}),creatorLabel:()=>"Leonardo",image:uV,flag:"leonardoMrpeepersLora",productFeature:"ai_models_plus",provider:"leonardo",bestStyle:()=>d.i18n._({id:"SEElti",message:"Character art"}),bestType:()=>d.i18n._({id:"rfby1C",message:"Illustrations, mascots"}),speed:2,cost:25},"luma-photon-1":{...uY,label:()=>"Luma Photon",description:()=>d.i18n._({id:"qmMxhc",message:"Good balance of speed and quality"}),flag:"lumaPhoton",productFeature:"ai_models_plus",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:3,cost:10,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"luma-photon-flash-1":{...uY,label:()=>"Luma Photon Flash",description:()=>d.i18n._({id:"eNdOBa",message:"Fast model that can handle basic text"}),flag:"lumaPhoton",bestStyle:()=>d.i18n._({id:"6M03+0",message:"Realistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:4,cost:2,isLegacy:!0,supportedAspectRatios:["portrait9x16","landscape4x3","landscape16x9"]},"recraft-v3":{label:()=>"Recraft V3",description:()=>d.i18n._({id:"z+qo6V",message:"Great for creative styles"}),creatorLabel:()=>"Recraft",image:u$,flag:"recraftModel",productFeature:"ai_premium_models",provider:"recraft",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:2,cost:20,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"recraft-v3-svg":{label:()=>"Recraft V3 Vector",description:()=>d.i18n._({id:"SLi7QF",message:"Great for line art and engravings"}),creatorLabel:()=>"Recraft",image:u$,flag:"recraftSvgModel",productFeature:"ai_premium_models",provider:"recraft",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:2,cost:40,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"recraft-v4":{label:()=>"Recraft V4",description:()=>d.i18n._({id:"/zdlaB",message:"Latest generation {RECRAFT_PROPER_NOUN} model with higher realism",values:{RECRAFT_PROPER_NOUN:uK}}),creatorLabel:()=>"Recraft",image:u$,flag:"recraftV4Model",productFeature:"ai_models_plus",provider:"recraft",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:2,cost:12,badge:"new",isRecommended:!0,supportsExactText:!0,supportsHexPrompts:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"recraft-v4-svg":{label:()=>"Recraft V4 Vector",description:()=>d.i18n._({id:"i6r3Zw",message:"Production-grade vector illustrations with {RECRAFT_PROPER_NOUN} V4",values:{RECRAFT_PROPER_NOUN:uK}}),creatorLabel:()=>"Recraft",image:u$,flag:"recraftV4SvgModel",productFeature:"ai_premium_models",provider:"recraft",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"xeiujy",message:"Text"}),speed:2,cost:40,badge:"new",supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"recraft-v4-pro":{label:()=>"Recraft V4 Pro",description:()=>d.i18n._({id:"hMvJ2e",message:"High-resolution {RECRAFT_PROPER_NOUN} V4 model with 2K output",values:{RECRAFT_PROPER_NOUN:uK}}),creatorLabel:()=>"Recraft",image:u$,flag:"recraftV4ProModel",productFeature:"ai_models_ultra",provider:"recraft",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"1HfW/F",message:"Colors"}),speed:2,cost:125,badge:"new",supportsExactText:!0,supportsHexPrompts:!0,supportedAspectRatios:["portrait9x16","portrait4x5","landscape4x3","landscape16x9"]},"dall-e-3":{label:()=>"DALL·E 3",description:()=>d.i18n._({id:"wPYsgu",message:"The previous generation model from {OPENAI_PROPER_NOUN}; produces highly stylized images",values:{OPENAI_PROPER_NOUN:iT.OPENAI_PROPER_NOUN}}),creatorLabel:()=>"OpenAI",image:uG,productFeature:"ai_premium_models",flag:"dalle3",provider:"azure",bestStyle:()=>d.i18n._({id:"+hJIb3",message:"Artistic styles"}),bestType:()=>d.i18n._({id:"1TSz1T",message:"People, colors"}),speed:1,cost:33},"veo-3.1-fast":{provider:"runway",label:()=>"Veo 3.1 Fast",description:()=>d.i18n._({id:"ipHeu7",message:"Fast video generation with {GOOGLE_PROPER_NOUN} Veo",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),productFeature:"ai_models_ultra",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:2,flag:"veo3Fast",cost:300,isVideoModel:!0,image:uF,creatorLabel:()=>"Google"},"veo-3.1":{provider:"runway",label:()=>"Veo 3.1",description:()=>d.i18n._({id:"KO79Gc",message:"Higher quality video generation with {GOOGLE_PROPER_NOUN} Veo",values:{GOOGLE_PROPER_NOUN:iT.GOOGLE_PROPER_NOUN}}),productFeature:"ai_models_ultra",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:1,flag:"veo3",cost:800,isVideoModel:!0,image:uF,creatorLabel:()=>"Google"},"luma-ray-2-flash":{...uY,label:()=>"Luma Ray 2 Flash",description:()=>d.i18n._({id:"KqsbQV",message:"Fast video generation with Luma Ray"}),productFeature:"ai_models_ultra",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:2,flag:"lumaRay2Flash",cost:120,isVideoModel:!0},"luma-ray-2":{...uY,label:()=>"Luma Ray 2",description:()=>d.i18n._({id:"UAfu4T",message:"Higher quality video generation with Luma Ray"}),productFeature:"ai_models_ultra",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:1,flag:"lumaRay2",cost:350,isVideoModel:!0},"leonardo-motion-2-fast":{label:()=>"Leonardo Motion 2 Fast",description:()=>d.i18n._({id:"Y8CeOV",message:"Fast video generation with Leonardo Motion"}),creatorLabel:()=>"Leonardo",image:uW,flag:"leonardoMotion2",productFeature:"ai_models_ultra",provider:"leonardo",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:2,cost:98,isVideoModel:!0},"leonardo-motion-2":{label:()=>"Leonardo Motion 2",description:()=>d.i18n._({id:"CtoHkW",message:"Higher quality video generation with Leonardo Motion"}),creatorLabel:()=>"Leonardo",image:uW,flag:"leonardoMotion2",productFeature:"ai_models_ultra",provider:"leonardo",bestStyle:()=>d.i18n._({id:"zmt2Qh",message:"Realistic videos"}),bestType:()=>d.i18n._({id:"u1a67H",message:"Animation, motion"}),speed:1,cost:195,isVideoModel:!0}},uJ=()=>cN.featureFlags.get("aiGeneratedImagesDefaultModel"),u0=e=>uQ[e]||uQ[uJ()],u1=async(e,t)=>{let{themeId:i,docId:n,traceparent:a,...r}=e,o=i?{context:iW.SavedMediaContext.Theme,themeId:e.themeId}:n?{context:iW.SavedMediaContext.Doc,docId:e.docId}:{context:e.context},s=uJ(),l=e.model??s,d=`${uN()}/media/images/generate`,c={interactionId:e.interactionId,interface:"generate-image",streaming:!1,inputContent:e.prompt,docId:e.docId,generateImageOptions:e};i0(c);let u=performance.now(),p={"Content-Type":"application/json"};a&&(p["aijsx-traceparent"]=a);try{let e=await (0,uO.handleFetch)(d,{signal:t?.signal,method:"POST",headers:p,body:JSON.stringify({model:l,...r,...o}),credentials:"include"},{parseResponse:e=>e.json(),captureException:e=>{u3(e)||e.logToErrorTracker()}});return i1({...c,latency:performance.now()-u,generateImageUrls:e.map(e=>e.attrs.src)}),e}catch(e){if(e instanceof uO.FetchError&&"forbidden"===e.type&&uZ(e.body))return e.body;throw console.error("(caught) [AIGenerateImage] error:",e),i2({...c,latency:performance.now()-u,errorName:"GenerateImageError",errorMessage:e.message,outputMessage:""}),e}},u2={sexual:()=>d.i18n._({id:"gHG6wD",message:"This prompt was blocked because it could generate sexual imagery."}),violence:()=>d.i18n._({id:"x40BeZ",message:"This prompt was blocked because it could generate violent imagery."}),prohibited:()=>d.i18n._({id:"UiRApc",message:"This prompt was blocked because it could generate inappropriate content."})};function u3(e){return e.body?.code==="prohibited_input"}let u5=["square","portrait","landscape"],u4=e=>{if(!e)return u5;let t=uQ[e],i=t?.supportedAspectRatios;return i?[...u5,...i]:u5},u6=["square","landscape","landscape4x3","portrait","portrait4x5","portrait9x16"],u9=e=>{let t=uQ[e];return!(!t||t.flag&&!cN.featureFlags.get(t.flag)||t.disabledFlag&&cN.featureFlags.get(t.disabledFlag))},u8={REMIX:"remix",MEDIA_DRAWER:"media-drawer",TEMPLATE_EDITOR:"template-editor",GENERATOR:"generator",PLAYGROUND:"playground"},u7=new Set([u8.REMIX,u8.TEMPLATE_EDITOR]),pe=(e,t,i)=>{if(i&&u7.has(i)||i===u8.MEDIA_DRAWER&&(cN.featureFlags.get("alwaysChargeMediaDrawerCredits")||null===t)||i===u8.GENERATOR&&cN.featureFlags.get("chargeGeneratorCredits"))return!0;let n=pt(e),a=u0(e);return"ultra"===n||(a.alwaysChargeCredits??!1)},pt=e=>{let t=uQ[e];return!t||t.freeFlag&&cN.featureFlags.get(t.freeFlag)?"free":t.productFeature?(0,iE.getProductRequiredForFeature)(t.productFeature):"free"};e.s(["IMAGE_GENERATE_MODELS",0,uQ,"IMAGE_SETTINGS_CONTEXT",0,u8,"LEGACY_MODEL_MAPPING",0,uX,"canModelMakeImageCards",0,e=>{let t=uQ[e];return!!t&&!!(t.supportsExactText&&(t.supportsHexPrompts||t.supportsFontReferenceImage))},"fetchGenerateImage",0,u1,"getAspectRatiosForModel",0,u4,"getAspectRatiosForModelDropdown",0,e=>{let t=u4(e);return u6.filter(e=>t.includes(e))},"getDefaultImageModel",0,uJ,"getImageModelInfo",0,u0,"getRequiredPlanForImageModel",0,pt,"imageGenerateErrorMessage",0,function(e){var t;let i;return(e instanceof uO.FetchError&&(i=u3(e)?u2[(t=e.body?.categories??{}).sexual||t["sexual/minors"]?"sexual":t.violence||t["violence/graphic"]?"violence":"prohibited"]():e.userFacingErrorDescription()),i)?d.i18n._({id:"ZJbOi7",message:"There was an issue generating your image. Please try again. {additionalErrorContext}",values:{additionalErrorContext:i}}):d.i18n._({id:"Id+8aq",message:"There was an issue generating your image. Please try again."})},"isImageModelAvailable",0,u9,"orderedImageModelInfos",0,()=>Object.keys(uQ).map(e=>({model:e,...uQ[e]})).sort((e,t)=>e.label().localeCompare(t.label(),"en-US",{sensitivity:"base"})),"shouldShowCostForImageModel",0,pe],297391);var pi=e.i(35585);let pn=({totalCredits:e,...t})=>(0,j.jsx)(X.GammaTooltip,{label:(0,j.jsx)(z.Trans,{message:"{totalCredits, plural, one {This will cost # credit} other {This will cost # credits}}",id:"ryy5zT",values:{totalCredits:e}}),children:(0,j.jsx)(iA.Badge,{colorScheme:"whiteAlpha",bg:"whiteAlpha.300",textTransform:"none",textShadow:"none",fontSize:"xxs",ml:2,...t,children:(0,j.jsxs)(U.HStack,{spacing:1,children:[(0,j.jsx)(Z.Text,{children:e}),(0,j.jsx)(B.FontAwesomeIcon,{icon:l.faSparkles,size:"sm"})]})})});e.s(["CreditCostBadgeWithTooltip",0,pn,"CreditCostIcon",0,({type:e,multiplier:t,...i})=>{let n=(0,i5.useFeatureFlag)("aiDebits");if((0,iM.useCanUseProductFeature)("unlimited_credits"))return null;let a=n[e]??l0.DEFAULT_CREDIT_COSTS[e];return(0,j.jsx)(pn,{totalCredits:a*(t??1),...i})}],23917),e.s(["AIImageCreditCostIcon",0,({model:e,multiplier:t,context:i,...n})=>{let a=(0,ei.useAppSelector)(pi.selectCurrentWorkspace);if(!pe(e,(0,iE.getProductForWorkspace)(a),i))return null;if(!uQ[e])return uP.datadogLogs.logger.error(`[AIImageCreditCostIcon] Invalid model used: ${e} (not in IMAGE_GENERATE_MODELS)`,{event:H.AppMonitoringEvents.ERROR_BOUNDARY_ERROR}),null;let r=uQ[e].cost*(t??1);return 0===r?null:(0,j.jsx)(pn,{totalCredits:r,...n})}],19988),e.s(["CreditWarningTooltip",0,({creditWarning:e,children:t})=>{let i=e?.isBlocking&&!e.cta.onClick?e.cta.tooltip:void 0;return i?(0,j.jsx)(X.GammaTooltip,{label:i,placement:"top",children:(0,j.jsx)(iS.Box,{display:"flex",flexDirection:"column",children:t})}):t}],413399);var pa=e.i(647715);let pr={agent:{estimatedCost:({cost:e=0})=>e,showLowWarning:"always",skipNotEnoughWarnings:!0},"design-anything":{estimatedCost:({cost:e=0})=>e,showLowWarning:"free-only"},"design-anything-chat":{estimatedCost:({cost:e=0})=>e,showLowWarning:"free-only",skipNotEnoughWarnings:!0},"design-anything-edit":{estimatedCost:({cost:e=0})=>e,showLowWarning:"free-only"},"edit-card":{estimatedCost:({cost:e=0})=>e,showLowWarning:"never"},"generate-card":{estimatedCost:({cost:e=0})=>e,showLowWarning:"never",skipAllWarningsForPaid:!0},generator:{estimatedCost:({modelCost:e=0,isFree:t,chargeGeneratorCredits:i=!1})=>t?40:5*e+3*!!i,showLowWarning:"free-only",skipOutWhenFree:!0},"image-drawer":{estimatedCost:({cost:e=0})=>e,showLowWarning:"never"},remix:{estimatedCost:({modelCost:e=0})=>5*e,showLowWarning:"free-only"},studio:{estimatedCost:({modelCost:e=0,isFree:t})=>t?40:5*e,showLowWarning:"free-only"}};var po=e.i(792565);let ps=()=>{let[e,t]=(0,po.useLocalStorage)("lowCreditsWarningDismissed",null);return{isDismissed:(0,F.useMemo)(()=>!(!e||Date.now()-e>864e5),[e]),dismiss:(0,F.useCallback)(()=>{t(Date.now())},[t])}};e.s(["useCreditWarning",0,e=>{var t,i,n,a;let r=(({cost:e,modelCost:t,surface:i})=>{let n=(0,ei.useAppSelector)(pa.selectAvailableCredits),{product:a,isProductLoading:r}=(0,iI.useMonetizationContext)(),{isDismissed:o}=ps(),s=(0,i5.useFeatureFlag)("chargeGeneratorCredits");if(r)return null;let l=null===a,d=l?100:200,c=pr[i],u=c.estimatedCost({cost:e,modelCost:t,isFree:l,chargeGeneratorCredits:s});return null===n||c.skipAllWarningsForPaid&&!l?null:n<=0?c.skipOutWhenFree&&u<=0?null:{level:"out",isBlocking:!0}:n{let{product:i,subscription:n,openUpsellModal:a,openCombinedCreditsUpgradeModal:r}=(0,iI.useMonetizationContext)(),o=(0,i4.useCanManageWorkspace)(),s=null===i?"upgrade":null!==i&&o?"add-more":"contact-admin",l=(0,F.useCallback)(()=>{switch(s){case"upgrade":a({segmentEvent:t.segmentEvent,upsellLocation:t.upsellLocation,targetFeature:"unlimited_credits",insufficientCreditsWarning:"out"===e||"not-enough"===e});break;case"add-more":r({defaultTab:"credits",segmentEvent:t.segmentEvent,upsellLocation:t.upsellLocation,targetFeature:"unlimited_credits",insufficientCreditsWarning:"out"===e||"not-enough"===e})}},[a,r,t.segmentEvent,t.upsellLocation,e,s]),d=n?.managedByUser?.displayName,c=n?.managedByUser?.email;return(0,F.useMemo)(()=>{switch(s){case"upgrade":return{upsellType:s,label:(0,j.jsx)(z.Trans,{message:"Upgrade",id:"NIvZju"}),onClick:l};case"add-more":return{upsellType:s,label:(0,j.jsx)(z.Trans,{message:"Add more",id:"feprS3"}),onClick:l};case"contact-admin":{let e=d?(0,j.jsxs)(j.Fragment,{children:[" ",(0,j.jsx)("b",{style:{whiteSpace:"nowrap"},children:d}),c&&(0,j.jsxs)(j.Fragment,{children:[" ","(",(0,j.jsx)("span",{style:{whiteSpace:"nowrap"},children:c}),")"]})]}):null;return{upsellType:s,label:(0,j.jsx)(z.Trans,{message:"Contact admin",id:"cV8fxE"}),tooltip:(0,j.jsx)(z.Trans,{message:"Contact your billing admin{adminDetails}",id:"ilPIVY",values:{adminDetails:e}})}}}},[s,l,d,c])})({level:o,source:e.source});if(!r)return null;let{level:h,isBlocking:m}=r,g="low"===h?"warning":"error",f=((e,t)=>{switch(e){case"out":return(0,j.jsx)(z.Trans,{message:"You're out of credits.",id:"kmdH9v"});case"not-enough":return(0,j.jsx)(z.Trans,{message:"You don't have enough credits.",id:"2ldQ4C"});case"low":return t?(0,j.jsx)(z.Trans,{message:"You're almost out of credits.",id:"uLRg/A"}):(0,j.jsx)(z.Trans,{message:"You're running low on credits.",id:"IgFyN1"})}})(h,c),b=(t=h,i=c,n=u,a=l,"low"===t?i?(0,j.jsx)(z.Trans,{message:"Upgrade for longer decks, better AI, and more credits that refresh monthly.",id:"eTg5gN"}):null:({upgrade:(0,j.jsx)(z.Trans,{message:"{refreshDuration} Upgrade to continue.",id:"fppL+x",values:{refreshDuration:a}}),"add-more":(0,j.jsx)(z.Trans,{message:"{refreshDuration} Add more credits to continue.",id:"zJH8rr",values:{refreshDuration:a}}),"contact-admin":(0,j.jsx)(z.Trans,{message:"{refreshDuration} Contact your admin to continue.",id:"3ZOYLg",values:{refreshDuration:a}})})[n]);return{level:h,isBlocking:m,status:g,title:f,subtitle:b,cta:p,upsellType:u,onDismiss:"low"===h?s:void 0}}],690310);var pl=e.i(159080),pd=e.i(432171);pl.gql` query StyledImageCostEstimate($input: StyledImageCostEstimateInput!) { styledImageCostEstimate(input: $input) { model creditsPerImage } } `;let pc=pl.gql` query AvailableStyledImageModels($input: AvailableStyledImageModelsInput!) { availableStyledImageModels(input: $input) { autoModelId models { id creditsPerImage productFeature } } } `,pu=pl.gql` mutation GenerateStyledImage($input: GenerateStyledImageInput!) { generateStyledImage(input: $input) { id attrs workspaceId userId } } `,pp=async(e,t)=>{let i=(0,iH.getApolloClient)(),n=e.themeId?iW.SavedMediaContext.Theme:e.docId?iW.SavedMediaContext.Doc:iW.SavedMediaContext.Dashboard,{data:a}=await i.mutate({mutation:pu,variables:{input:{workspaceId:e.workspaceId,docId:e.docId,themeId:e.themeId,interactionId:e.interactionId,prompt:e.prompt,count:e.count||1,aspectRatio:e.aspectRatio,styleReferenceKey:e.styleReferenceKey,context:n,interactionName:e.interactionName,loadImageId:e.loadImageId,modelOverride:e.modelOverride}},context:{...uR(),headers:e.traceparent?{"aijsx-traceparent":e.traceparent}:void 0,fetchOptions:t?{signal:t}:void 0}});return a?.generateStyledImage||[]};e.s(["fetchGenerateStyledImage",0,pp,"useAvailableStyledImageModels",0,({workspaceId:e,styleReferenceKey:t})=>{let{data:i,loading:n}=(0,pd.useQuery)(pc,{variables:{input:{workspaceId:e,styleReferenceKey:t}},context:uR(),skip:!e||!t,onError:()=>{}});return{result:i?.availableStyledImageModels??null,loading:n}}],639243),e.s(["getAutoselectImageModel",0,function({cardContentType:e,imageProvider:t,imageOptions:i}){return"aiAnimation"===t?cN.featureFlags.get("aiGeneratedVideosDefaultModel"):"image"===e?cN.featureFlags.get("imageCardModel"):"custom"===i.artStylePreset&&i.styleReferenceImages?.length?cN.featureFlags.get("styleRefsDefaultModel"):uJ()}],169039);var ph=e.i(164149);class pm extends Error{name="StreamError";code="stream_error";constructor(e,t){super(e),t&&(this.code=t)}}class pg extends pm{name="StreamTimeoutError";code="timeout";constructor(e){super(e)}}class pf extends pm{name="StreamOnOpenError";code="on_open";constructor(e){super(e)}}class pb extends pm{name="StreamUnexpectedCloseError";code="unexpected_close";constructor(e){super(e)}}var px=e.i(501313),py="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol:function(e){return"Symbol("+e+")"};function pv(){}var pC="u">typeof self?self:"u">typeof window?window:e.g;function pw(e){return"object"==typeof e&&null!==e||"function"==typeof e}var pS=Promise,pk=Promise.prototype.then,pA=Promise.resolve.bind(pS),pE=Promise.reject.bind(pS);function p_(e){return new pS(e)}function pI(e,t,i){return pk.call(e,t,i)}function pM(e,t,i){pI(pI(e,t,i),void 0,pv)}function pT(e,t){pM(e,void 0,t)}function pL(e){pI(e,void 0,pv)}var pj=function(){var e=pC&&pC.queueMicrotask;if("function"==typeof e)return e;var t=pA(void 0);return function(e){return pI(t,e)}}();function pP(e,t,i){if("function"!=typeof e)throw TypeError("Argument is not a function");return Function.prototype.apply.call(e,t,i)}function pD(e,t,i){try{var n;return n=pP(e,t,i),pA(n)}catch(e){return pE(e)}}var pN=function(){function e(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.push=function(e){var t=this._back,i=t;16383===t._elements.length&&(i={_elements:[],_next:void 0}),t._elements.push(e),i!==t&&(this._back=i,t._next=i),++this._size},e.prototype.shift=function(){var e=this._front,t=e,i=this._cursor,n=i+1,a=e._elements,r=a[i];return 16384===n&&(t=e._next,n=0),--this._size,this._cursor=n,e!==t&&(this._front=t),a[i]=void 0,r},e.prototype.forEach=function(e){for(var t=this._cursor,i=this._front,n=i._elements;(t!==n.length||void 0!==i._next)&&(t!==n.length||(n=(i=i._next)._elements,t=0,0!==n.length));)e(n[t]),++t},e.prototype.peek=function(){var e=this._front,t=this._cursor;return e._elements[t]},e}();function pR(e,t){var i,n,a;e._ownerReadableStream=t,t._reader=e,"readable"===t._state?pF(e):"closed"===t._state?(pF(i=e),pW(i)):(n=e,a=t._storedError,pF(n),pH(n,a))}function pO(e,t){return mq(e._ownerReadableStream,t)}function pB(e){"readable"===e._ownerReadableStream._state?pH(e,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):function(e,t){pF(e),pH(e,t)}(e,TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),e._ownerReadableStream._reader=void 0,e._ownerReadableStream=void 0}function pz(e){return TypeError("Cannot "+e+" a stream using a released reader")}function pF(e){e._closedPromise=p_(function(t,i){e._closedPromise_resolve=t,e._closedPromise_reject=i})}function pH(e,t){void 0!==e._closedPromise_reject&&(pL(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function pW(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var pU=py("[[AbortSteps]]"),pV=py("[[ErrorSteps]]"),pG=py("[[CancelSteps]]"),p$=py("[[PullSteps]]"),pZ=Number.isFinite||function(e){return"number"==typeof e&&isFinite(e)},pK=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function pq(e,t){if(void 0!==e&&"object"!=typeof e&&"function"!=typeof e)throw TypeError(t+" is not an object.")}function pY(e,t){if("function"!=typeof e)throw TypeError(t+" is not a function.")}function pX(e,t){if(("object"!=typeof e||null===e)&&"function"!=typeof e)throw TypeError(t+" is not an object.")}function pQ(e,t,i){if(void 0===e)throw TypeError("Parameter "+t+" is required in '"+i+"'.")}function pJ(e,t,i){if(void 0===e)throw TypeError(t+" is required in '"+i+"'.")}function p0(e){return Number(e)}function p1(e,t){var i,n,a=Number.MAX_SAFE_INTEGER,r=Number(e);if(!pZ(r=0===(i=r)?0:i))throw TypeError(t+" is not a finite number");if((r=0===(n=pK(r))?0:n)<0||r>a)throw TypeError(t+" is outside the accepted range of 0 to "+a+", inclusive");return pZ(r)&&0!==r?r:0}function p2(e,t){if(!mZ(e))throw TypeError(t+" is not a ReadableStream.")}function p3(e){return new p8(e)}function p5(e,t){e._reader._readRequests.push(t)}function p4(e,t,i){var n=e._reader._readRequests.shift();i?n._closeSteps():n._chunkSteps(t)}function p6(e){return e._reader._readRequests.length}function p9(e){var t=e._reader;return void 0!==t&&!!p7(t)}var p8=function(){function e(e){if(pQ(e,1,"ReadableStreamDefaultReader"),p2(e,"First parameter"),mK(e))throw TypeError("This stream has already been locked for exclusive reading by another reader");pR(this,e),this._readRequests=new pN}return Object.defineProperty(e.prototype,"closed",{get:function(){return p7(this)?this._closedPromise:pE(ht("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return(void 0===e&&(e=void 0),p7(this))?void 0===this._ownerReadableStream?pE(pz("cancel")):pO(this,e):pE(ht("cancel"))},e.prototype.read=function(){if(!p7(this))return pE(ht("read"));if(void 0===this._ownerReadableStream)return pE(pz("read from"));var e,t,i=p_(function(i,n){e=i,t=n});return he(this,{_chunkSteps:function(t){return e({value:t,done:!1})},_closeSteps:function(){return e({value:void 0,done:!0})},_errorSteps:function(e){return t(e)}}),i},e.prototype.releaseLock=function(){if(!p7(this))throw ht("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readRequests.length>0)throw TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");pB(this)}},e}();function p7(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readRequests")&&e instanceof p8}function he(e,t){var i=e._ownerReadableStream;i._disturbed=!0,"closed"===i._state?t._closeSteps():"errored"===i._state?t._errorSteps(i._storedError):i._readableStreamController[p$](t)}function ht(e){return TypeError("ReadableStreamDefaultReader.prototype."+e+" can only be used on a ReadableStreamDefaultReader")}Object.defineProperties(p8.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(p8.prototype,py.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0}),"symbol"==typeof py.asyncIterator&&((o={})[py.asyncIterator]=function(){return this},Object.defineProperty(s=o,py.asyncIterator,{enumerable:!1}));var hi=function(){function e(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}return e.prototype.next=function(){var e=this,t=function(){return e._nextSteps()};return this._ongoingPromise=this._ongoingPromise?pI(this._ongoingPromise,t,t):t(),this._ongoingPromise},e.prototype.return=function(e){var t=this,i=function(){return t._returnSteps(e)};return this._ongoingPromise?pI(this._ongoingPromise,i,i):i()},e.prototype._nextSteps=function(){var e,t,i=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var n=this._reader;if(void 0===n._ownerReadableStream)return pE(pz("iterate"));var a=p_(function(i,n){e=i,t=n});return he(n,{_chunkSteps:function(t){i._ongoingPromise=void 0,pj(function(){return e({value:t,done:!1})})},_closeSteps:function(){i._ongoingPromise=void 0,i._isFinished=!0,pB(n),e({value:void 0,done:!0})},_errorSteps:function(e){i._ongoingPromise=void 0,i._isFinished=!0,pB(n),t(e)}}),a},e.prototype._returnSteps=function(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;var t=this._reader;if(void 0===t._ownerReadableStream)return pE(pz("finish iterating"));if(!this._preventCancel){var i=pO(t,e);return pB(t),pI(i,function(){return{value:e,done:!0}},void 0)}return pB(t),pA({value:e,done:!0})},e}(),hn={next:function(){return ha(this)?this._asyncIteratorImpl.next():pE(hr("next"))},return:function(e){return ha(this)?this._asyncIteratorImpl.return(e):pE(hr("return"))}};function ha(e){if(!pw(e)||!Object.prototype.hasOwnProperty.call(e,"_asyncIteratorImpl"))return!1;try{return e._asyncIteratorImpl instanceof hi}catch(e){return!1}}function hr(e){return TypeError("ReadableStreamAsyncIterator."+e+" can only be used on a ReadableSteamAsyncIterator")}void 0!==s&&Object.setPrototypeOf(hn,s);var ho=Number.isNaN||function(e){return e!=e};function hs(e){return e.slice()}function hl(e,t,i,n,a){new Uint8Array(e).set(new Uint8Array(i,n,a),t)}function hd(e,t,i){if(e.slice)return e.slice(t,i);var n=i-t,a=new ArrayBuffer(n);return hl(a,0,e,t,n),a}function hc(e){return new Uint8Array(hd(e.buffer,e.byteOffset,e.byteOffset+e.byteLength))}function hu(e){var t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function hp(e,t,i){if(!(!("number"!=typeof i||ho(i))&&!(i<0)&&1)||i===1/0)throw RangeError("Size must be a finite, non-NaN, non-negative number.");e._queue.push({value:t,size:i}),e._queueTotalSize+=i}function hh(e){e._queue=new pN,e._queueTotalSize=0}var hm=function(){function e(){throw TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"view",{get:function(){if(!hb(this))throw hz("view");return this._view},enumerable:!1,configurable:!0}),e.prototype.respond=function(e){if(!hb(this))throw hz("respond");if(pQ(e,1,"respond"),e=p1(e,"First parameter"),void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");this._view.buffer,hR(this._associatedReadableByteStreamController,e)},e.prototype.respondWithNewView=function(e){if(!hb(this))throw hz("respondWithNewView");if(pQ(e,1,"respondWithNewView"),!ArrayBuffer.isView(e))throw TypeError("You can only respond with array buffer views");if(void 0===this._associatedReadableByteStreamController)throw TypeError("This BYOB request has been invalidated");e.buffer,hO(this._associatedReadableByteStreamController,e)},e}();Object.defineProperties(hm.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(hm.prototype,py.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var hg=function(){function e(){throw TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"byobRequest",{get:function(){if(!hf(this))throw hF("byobRequest");return hD(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!hf(this))throw hF("desiredSize");return hN(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!hf(this))throw hF("close");if(this._closeRequested)throw TypeError("The stream has already been closed; do not close it again!");var e=this._controlledReadableByteStream._state;if("readable"!==e)throw TypeError("The stream (in "+e+" state) is not in the readable state and cannot be closed");hL(this)},e.prototype.enqueue=function(e){if(!hf(this))throw hF("enqueue");if(pQ(e,1,"enqueue"),!ArrayBuffer.isView(e))throw TypeError("chunk must be an array buffer view");if(0===e.byteLength)throw TypeError("chunk must have non-zero byteLength");if(0===e.buffer.byteLength)throw TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw TypeError("stream is closed or draining");var t=this._controlledReadableByteStream._state;if("readable"!==t)throw TypeError("The stream (in "+t+" state) is not in the readable state and cannot be enqueued to");hj(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!hf(this))throw hF("error");hP(this,e)},e.prototype[pG]=function(e){hy(this),hh(this);var t=this._cancelAlgorithm(e);return hT(this),t},e.prototype[p$]=function(e){var t=this._controlledReadableByteStream;if(this._queueTotalSize>0){var i=this._queue.shift();this._queueTotalSize-=i.byteLength,hA(this);var n=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);e._chunkSteps(n);return}var a=this._autoAllocateChunkSize;if(void 0!==a){var r=void 0;try{r=new ArrayBuffer(a)}catch(t){e._errorSteps(t);return}var o={buffer:r,bufferByteLength:a,byteOffset:0,byteLength:a,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}p5(t,e),hx(this)},e}();function hf(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableByteStream")&&e instanceof hg}function hb(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_associatedReadableByteStreamController")&&e instanceof hm}function hx(e){var t,i;if("readable"===(i=(t=e)._controlledReadableByteStream)._state&&!t._closeRequested&&t._started&&(p9(i)&&p6(i)>0||hU(i)&&hW(i)>0||hN(t)>0)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,pM(e._pullAlgorithm(),function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,hx(e))},function(t){hP(e,t)})}}function hy(e){hE(e),e._pendingPullIntos=new pN}function hv(e,t){var i,n,a,r,o=!1;"closed"===e._state&&(o=!0);var s=hC(t);"default"===t.readerType?p4(e,s,o):(i=e,n=s,a=o,r=i._reader._readIntoRequests.shift(),a?r._closeSteps(n):r._chunkSteps(n))}function hC(e){var t=e.bytesFilled,i=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/i)}function hw(e,t,i,n){e._queue.push({buffer:t,byteOffset:i,byteLength:n}),e._queueTotalSize+=n}function hS(e,t){var i=t.elementSize,n=t.bytesFilled-t.bytesFilled%i,a=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),r=t.bytesFilled+a,o=r-r%i,s=a,l=!1;o>n&&(s=o-t.bytesFilled,l=!0);for(var d=e._queue;s>0;){var c=d.peek(),u=Math.min(s,c.byteLength),p=t.byteOffset+t.bytesFilled;hl(t.buffer,p,c.buffer,c.byteOffset,u),c.byteLength===u?d.shift():(c.byteOffset+=u,c.byteLength-=u),e._queueTotalSize-=u,hk(e,u,t),s-=u}return l}function hk(e,t,i){i.bytesFilled+=t}function hA(e){0===e._queueTotalSize&&e._closeRequested?(hT(e),mY(e._controlledReadableByteStream)):hx(e)}function hE(e){null!==e._byobRequest&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function h_(e){for(;e._pendingPullIntos.length>0;){if(0===e._queueTotalSize)return;var t=e._pendingPullIntos.peek();hS(e,t)&&(hM(e),hv(e._controlledReadableByteStream,t))}}function hI(e,t){var i=e._pendingPullIntos.peek();if(hE(e),"closed"===e._controlledReadableByteStream._state){var n=e._controlledReadableByteStream;if(hU(n))for(;hW(n)>0;)hv(n,hM(e))}else if(hk(e,t,i),!(i.bytesFilled0){var r=i.byteOffset+i.bytesFilled,o=hd(i.buffer,r-a,r);hw(e,o,0,o.byteLength)}i.bytesFilled-=a,hv(e._controlledReadableByteStream,i),h_(e)}hx(e)}function hM(e){return e._pendingPullIntos.shift()}function hT(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function hL(e){var t=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===t._state){if(e._queueTotalSize>0){e._closeRequested=!0;return}if(e._pendingPullIntos.length>0&&e._pendingPullIntos.peek().bytesFilled>0){var i=TypeError("Insufficient bytes to fill elements in the given buffer");throw hP(e,i),i}hT(e),mY(t)}}function hj(e,t){var i=e._controlledReadableByteStream;if(!e._closeRequested&&"readable"===i._state){var n=t.buffer,a=t.byteOffset,r=t.byteLength;if(e._pendingPullIntos.length>0){var o=e._pendingPullIntos.peek();o.buffer,o.buffer=o.buffer}hE(e),p9(i)?0===p6(i)?hw(e,n,a,r):(e._pendingPullIntos.length>0&&hM(e),p4(i,new Uint8Array(n,a,r),!1)):hU(i)?(hw(e,n,a,r),h_(e)):hw(e,n,a,r),hx(e)}}function hP(e,t){var i=e._controlledReadableByteStream;"readable"===i._state&&(hy(e),hh(e),hT(e),mX(i,t))}function hD(e){if(null===e._byobRequest&&e._pendingPullIntos.length>0){var t,i,n,a=e._pendingPullIntos.peek(),r=new Uint8Array(a.buffer,a.byteOffset+a.bytesFilled,a.byteLength-a.bytesFilled),o=Object.create(hm.prototype);t=o,i=e,n=r,t._associatedReadableByteStreamController=i,t._view=n,e._byobRequest=o}return e._byobRequest}function hN(e){var t=e._controlledReadableByteStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function hR(e,t){var i=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t)throw TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(0===t)throw TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(i.bytesFilled+t>i.byteLength)throw RangeError("bytesWritten out of range")}i.buffer=i.buffer,hI(e,t)}function hO(e,t){var i=e._pendingPullIntos.peek();if("closed"===e._controlledReadableByteStream._state){if(0!==t.byteLength)throw TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(0===t.byteLength)throw TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(i.byteOffset+i.bytesFilled!==t.byteOffset)throw RangeError("The region specified by view does not match byobRequest");if(i.bufferByteLength!==t.buffer.byteLength)throw RangeError("The buffer of view has different capacity than byobRequest");if(i.bytesFilled+t.byteLength>i.byteLength)throw RangeError("The region specified by view is larger than byobRequest");var n=t.byteLength;i.buffer=t.buffer,hI(e,n)}function hB(e,t,i,n,a,r,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,hh(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=r,t._pullAlgorithm=n,t._cancelAlgorithm=a,t._autoAllocateChunkSize=o,t._pendingPullIntos=new pN,e._readableStreamController=t,pM(pA(i()),function(){t._started=!0,hx(t)},function(e){hP(t,e)})}function hz(e){return TypeError("ReadableStreamBYOBRequest.prototype."+e+" can only be used on a ReadableStreamBYOBRequest")}function hF(e){return TypeError("ReadableByteStreamController.prototype."+e+" can only be used on a ReadableByteStreamController")}Object.defineProperties(hg.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(hg.prototype,py.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function hH(e,t){e._reader._readIntoRequests.push(t)}function hW(e){return e._reader._readIntoRequests.length}function hU(e){var t=e._reader;return void 0!==t&&!!hG(t)}var hV=function(){function e(e){if(pQ(e,1,"ReadableStreamBYOBReader"),p2(e,"First parameter"),mK(e))throw TypeError("This stream has already been locked for exclusive reading by another reader");if(!hf(e._readableStreamController))throw TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");pR(this,e),this._readIntoRequests=new pN}return Object.defineProperty(e.prototype,"closed",{get:function(){return hG(this)?this._closedPromise:pE(hZ("closed"))},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return(void 0===e&&(e=void 0),hG(this))?void 0===this._ownerReadableStream?pE(pz("cancel")):pO(this,e):pE(hZ("cancel"))},e.prototype.read=function(e){if(!hG(this))return pE(hZ("read"));if(!ArrayBuffer.isView(e))return pE(TypeError("view must be an array buffer view"));if(0===e.byteLength)return pE(TypeError("view must have non-zero byteLength"));if(0===e.buffer.byteLength)return pE(TypeError("view's buffer must have non-zero byteLength"));if(e.buffer,void 0===this._ownerReadableStream)return pE(pz("read from"));var t,i,n=p_(function(e,n){t=e,i=n});return h$(this,e,{_chunkSteps:function(e){return t({value:e,done:!1})},_closeSteps:function(e){return t({value:e,done:!0})},_errorSteps:function(e){return i(e)}}),n},e.prototype.releaseLock=function(){if(!hG(this))throw hZ("releaseLock");if(void 0!==this._ownerReadableStream){if(this._readIntoRequests.length>0)throw TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");pB(this)}},e}();function hG(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readIntoRequests")&&e instanceof hV}function h$(e,t,i){var n=e._ownerReadableStream;n._disturbed=!0,"errored"===n._state?i._errorSteps(n._storedError):function(e,t,i){var n=e._controlledReadableByteStream,a=1;t.constructor!==DataView&&(a=t.constructor.BYTES_PER_ELEMENT);var r=t.constructor,o=t.buffer,s={buffer:o,bufferByteLength:o.byteLength,byteOffset:t.byteOffset,byteLength:t.byteLength,bytesFilled:0,elementSize:a,viewConstructor:r,readerType:"byob"};if(e._pendingPullIntos.length>0){e._pendingPullIntos.push(s),hH(n,i);return}if("closed"===n._state){var l=new r(s.buffer,s.byteOffset,0);i._closeSteps(l);return}if(e._queueTotalSize>0){if(hS(e,s)){var d=hC(s);hA(e),i._chunkSteps(d);return}if(e._closeRequested){var c=TypeError("Insufficient bytes to fill elements in the given buffer");hP(e,c),i._errorSteps(c);return}}e._pendingPullIntos.push(s),hH(n,i),hx(e)}(n._readableStreamController,t,i)}function hZ(e){return TypeError("ReadableStreamBYOBReader.prototype."+e+" can only be used on a ReadableStreamBYOBReader")}function hK(e,t){var i=e.highWaterMark;if(void 0===i)return t;if(ho(i)||i<0)throw RangeError("Invalid highWaterMark");return i}function hq(e){var t=e.size;return t||function(){return 1}}function hY(e,t){pq(e,t);var i,n=null==e?void 0:e.highWaterMark,a=null==e?void 0:e.size;return{highWaterMark:void 0===n?void 0:p0(n),size:void 0===a?void 0:(pY(i=a,t+" has member 'size' that"),function(e){return p0(i(e))})}}function hX(e,t){if(!h1(e))throw TypeError(t+" is not a WritableStream.")}Object.defineProperties(hV.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(hV.prototype,py.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});var hQ="function"==typeof AbortController,hJ=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:pX(e,"First parameter");var i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E=hY(t,"Second parameter"),_=(v="First parameter",pq(y=e,v),C=null==y?void 0:y.abort,w=null==y?void 0:y.close,S=null==y?void 0:y.start,k=null==y?void 0:y.type,A=null==y?void 0:y.write,{abort:void 0===C?void 0:(u=C,p=y,pY(u,v+" has member 'abort' that"),function(e){return pD(u,p,[e])}),close:void 0===w?void 0:(h=w,m=y,pY(h,v+" has member 'close' that"),function(){return pD(h,m,[])}),start:void 0===S?void 0:(g=S,f=y,pY(g,v+" has member 'start' that"),function(e){return pP(g,f,[e])}),write:void 0===A?void 0:(b=A,x=y,pY(b,v+" has member 'write' that"),function(e,t){return pD(b,x,[e,t])}),type:k});if(h0(this),void 0!==_.type)throw RangeError("Invalid type is specified");var I=hq(E);i=this,n=_,a=hK(E,1),r=I,o=Object.create(ml.prototype),s=function(){},l=function(){return pA(void 0)},d=function(){return pA(void 0)},c=function(){return pA(void 0)},void 0!==n.start&&(s=function(){return n.start(o)}),void 0!==n.write&&(l=function(e){return n.write(e,o)}),void 0!==n.close&&(d=function(){return n.close()}),void 0!==n.abort&&(c=function(e){return n.abort(e)}),mc(i,o,s,l,d,c,a,r)}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!h1(this))throw mf("locked");return h2(this)},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){return(void 0===e&&(e=void 0),h1(this))?h2(this)?pE(TypeError("Cannot abort a stream that already has a writer")):h3(this,e):pE(mf("abort"))},e.prototype.close=function(){return h1(this)?h2(this)?pE(TypeError("Cannot close a stream that already has a writer")):h8(this)?pE(TypeError("Cannot close an already-closing stream")):h5(this):pE(mf("close"))},e.prototype.getWriter=function(){var e;if(!h1(this))throw mf("getWriter");return e=this,new mt(e)},e}();function h0(e){e._state="writable",e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new pN,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function h1(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_writableStreamController")&&e instanceof hJ}function h2(e){return void 0!==e._writer}function h3(e,t){if("closed"===e._state||"errored"===e._state)return pA(void 0);e._writableStreamController._abortReason=t,null==(i=e._writableStreamController._abortController)||i.abort();var i,n=e._state;if("closed"===n||"errored"===n)return pA(void 0);if(void 0!==e._pendingAbortRequest)return e._pendingAbortRequest._promise;var a=!1;"erroring"===n&&(a=!0,t=void 0);var r=p_(function(i,n){e._pendingAbortRequest={_promise:void 0,_resolve:i,_reject:n,_reason:t,_wasAlreadyErroring:a}});return e._pendingAbortRequest._promise=r,a||h6(e,t),r}function h5(e){var t,i=e._state;if("closed"===i||"errored"===i)return pE(TypeError("The stream (in "+i+" state) is not in the writable state and cannot be closed"));var n=p_(function(t,i){e._closeRequest={_resolve:t,_reject:i}}),a=e._writer;return void 0!==a&&e._backpressure&&"writable"===i&&mE(a),hp(t=e._writableStreamController,ms,0),mh(t),n}function h4(e,t){"writable"===e._state?h6(e,t):h9(e)}function h6(e,t){var i,n=e._writableStreamController;e._state="erroring",e._storedError=t;var a=e._writer;void 0!==a&&ma(a,t),void 0===(i=e)._inFlightWriteRequest&&void 0===i._inFlightCloseRequest&&n._started&&h9(e)}function h9(e){e._state="errored",e._writableStreamController[pV]();var t=e._storedError;if(e._writeRequests.forEach(function(e){e._reject(t)}),e._writeRequests=new pN,void 0===e._pendingAbortRequest)return void h7(e);var i=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,i._wasAlreadyErroring){i._reject(t),h7(e);return}pM(e._writableStreamController[pU](i._reason),function(){i._resolve(),h7(e)},function(t){i._reject(t),h7(e)})}function h8(e){return void 0!==e._closeRequest||void 0!==e._inFlightCloseRequest}function h7(e){void 0!==e._closeRequest&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);var t=e._writer;void 0!==t&&mC(t,e._storedError)}function me(e,t){var i=e._writer;void 0!==i&&t!==e._backpressure&&(t?mS(i):mE(i)),e._backpressure=t}Object.defineProperties(hJ.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(hJ.prototype,py.toStringTag,{value:"WritableStream",configurable:!0});var mt=function(){function e(e){if(pQ(e,1,"WritableStreamDefaultWriter"),hX(e,"First parameter"),h2(e))throw TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=e,e._writer=this;var t=e._state;if("writable"===t){!h8(e)&&e._backpressure?mS(this):(i=this,mS(i),mE(i)),mv(this)}else if("erroring"===t)mk(this,e._storedError),mv(this);else if("closed"===t){n=this,mS(n),mE(n),a=this,mv(a),mw(a)}else{var i,n,a,r,o,s=e._storedError;mk(this,s),r=this,o=s,mv(r),mC(r,o)}}return Object.defineProperty(e.prototype,"closed",{get:function(){return mi(this)?this._closedPromise:pE(mx("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"desiredSize",{get:function(){var e,t,i;if(!mi(this))throw mx("desiredSize");if(void 0===this._ownerWritableStream)throw my("desiredSize");return e=this,"errored"===(i=(t=e._ownerWritableStream)._state)||"erroring"===i?null:"closed"===i?0:mp(t._writableStreamController)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){return mi(this)?this._readyPromise:pE(mx("ready"))},enumerable:!1,configurable:!0}),e.prototype.abort=function(e){var t,i;if(void 0===e&&(e=void 0),!mi(this))return pE(mx("abort"));if(void 0===this._ownerWritableStream)return pE(my("abort"));return t=this,i=e,h3(t._ownerWritableStream,i)},e.prototype.close=function(){if(!mi(this))return pE(mx("close"));var e=this._ownerWritableStream;return void 0===e?pE(my("close")):h8(e)?pE(TypeError("Cannot close an already-closing stream")):mn(this)},e.prototype.releaseLock=function(){if(!mi(this))throw mx("releaseLock");void 0!==this._ownerWritableStream&&mr(this)},e.prototype.write=function(e){return(void 0===e&&(e=void 0),mi(this))?void 0===this._ownerWritableStream?pE(my("write to")):mo(this,e):pE(mx("write"))},e}();function mi(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_ownerWritableStream")&&e instanceof mt}function mn(e){return h5(e._ownerWritableStream)}function ma(e,t){"pending"===e._readyPromiseState?mA(e,t):mk(e,t)}function mr(e){var t=e._ownerWritableStream,i=TypeError("Writer was released and can no longer be used to monitor the stream's closedness");ma(e,i),"pending"===e._closedPromiseState?mC(e,i):function(e,t){mv(e),mC(e,t)}(e,i),t._writer=void 0,e._ownerWritableStream=void 0}function mo(e,t){var i=e._ownerWritableStream,n=i._writableStreamController,a=function(e,t){try{return e._strategySizeAlgorithm(t)}catch(t){return mm(e,t),1}}(n,t);if(i!==e._ownerWritableStream)return pE(my("write to"));var r=i._state;if("errored"===r)return pE(i._storedError);if(h8(i)||"closed"===r)return pE(TypeError("The stream is closing or closed and cannot be written to"));if("erroring"===r)return pE(i._storedError);var o=p_(function(e,t){i._writeRequests.push({_resolve:e,_reject:t})});return function(e,t,i){try{hp(e,t,i)}catch(t){mm(e,t);return}var n=e._controlledWritableStream;h8(n)||"writable"!==n._state||me(n,function(e){return 0>=mp(e)}(e)),mh(e)}(n,t,a),o}Object.defineProperties(mt.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(mt.prototype,py.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});var ms={},ml=function(){function e(){throw TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"abortReason",{get:function(){if(!md(this))throw mb("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"signal",{get:function(){if(!md(this))throw mb("signal");if(void 0===this._abortController)throw TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),e.prototype.error=function(e){if(void 0===e&&(e=void 0),!md(this))throw mb("error");"writable"===this._controlledWritableStream._state&&mg(this,e)},e.prototype[pU]=function(e){var t=this._abortAlgorithm(e);return mu(this),t},e.prototype[pV]=function(){hh(this)},e}();function md(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledWritableStream")&&e instanceof ml}function mc(e,t,i,n,a,r,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,hh(t),t._abortReason=void 0,t._abortController=function(){if(hQ)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=n,t._closeAlgorithm=a,t._abortAlgorithm=r,me(e,0>=mp(t)),pM(pA(i()),function(){t._started=!0,mh(t)},function(i){t._started=!0,h4(e,i)})}function mu(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function mp(e){return e._strategyHWM-e._queueTotalSize}function mh(e){var t=e._controlledWritableStream;if(e._started&&void 0===t._inFlightWriteRequest){if("erroring"===t._state)return void h9(t);if(0!==e._queue.length){var i=e._queue.peek().value;i===ms?function(e){var t=e._controlledWritableStream;t._inFlightCloseRequest=t._closeRequest,t._closeRequest=void 0,hu(e);var i=e._closeAlgorithm();mu(e),pM(i,function(){var e;t._inFlightCloseRequest._resolve(void 0),t._inFlightCloseRequest=void 0,"erroring"===t._state&&(t._storedError=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._resolve(),t._pendingAbortRequest=void 0)),t._state="closed",void 0!==(e=t._writer)&&mw(e)},function(e){t._inFlightCloseRequest._reject(e),t._inFlightCloseRequest=void 0,void 0!==t._pendingAbortRequest&&(t._pendingAbortRequest._reject(e),t._pendingAbortRequest=void 0),h4(t,e)})}(e):function(e,t){var i=e._controlledWritableStream;i._inFlightWriteRequest=i._writeRequests.shift(),pM(e._writeAlgorithm(t),function(){i._inFlightWriteRequest._resolve(void 0),i._inFlightWriteRequest=void 0;var t=i._state;hu(e),h8(i)||"writable"!==t||me(i,function(e){return 0>=mp(e)}(e)),mh(e)},function(t){"writable"===i._state&&mu(e),i._inFlightWriteRequest._reject(t),i._inFlightWriteRequest=void 0,h4(i,t)})}(e,i)}}}function mm(e,t){"writable"===e._controlledWritableStream._state&&mg(e,t)}function mg(e,t){var i=e._controlledWritableStream;mu(e),h6(i,t)}function mf(e){return TypeError("WritableStream.prototype."+e+" can only be used on a WritableStream")}function mb(e){return TypeError("WritableStreamDefaultController.prototype."+e+" can only be used on a WritableStreamDefaultController")}function mx(e){return TypeError("WritableStreamDefaultWriter.prototype."+e+" can only be used on a WritableStreamDefaultWriter")}function my(e){return TypeError("Cannot "+e+" a stream using a released writer")}function mv(e){e._closedPromise=p_(function(t,i){e._closedPromise_resolve=t,e._closedPromise_reject=i,e._closedPromiseState="pending"})}Object.defineProperties(ml.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(ml.prototype,py.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function mC(e,t){void 0!==e._closedPromise_reject&&(pL(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="rejected")}function mw(e){void 0!==e._closedPromise_resolve&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState="resolved")}function mS(e){e._readyPromise=p_(function(t,i){e._readyPromise_resolve=t,e._readyPromise_reject=i}),e._readyPromiseState="pending"}function mk(e,t){mS(e),mA(e,t)}function mA(e,t){void 0!==e._readyPromise_reject&&(pL(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="rejected")}function mE(e){void 0!==e._readyPromise_resolve&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState="fulfilled")}var m_="u">typeof DOMException?DOMException:void 0,mI=!function(e){if("function"!=typeof e&&"object"!=typeof e)return!1;try{return new e,!0}catch(e){return!1}}(m_)?((r=function(e,t){this.message=e||"",this.name=t||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}).prototype=Object.create(Error.prototype),Object.defineProperty(r.prototype,"constructor",{value:r,writable:!0,configurable:!0}),r):m_;function mM(e,t,i,n,a,r){var o=p3(e),s=new mt(t);e._disturbed=!0;var l=!1,d=pA(void 0);return p_(function(c,u){if(void 0!==r){if(p=function(){var i=new mI("Aborted","AbortError"),r=[];n||r.push(function(){return"writable"===t._state?h3(t,i):pA(void 0)}),a||r.push(function(){return"readable"===e._state?mq(e,i):pA(void 0)}),y(function(){return Promise.all(r.map(function(e){return e()}))},!0,i)},r.aborted)return void p();r.addEventListener("abort",p)}if(x(e,o._closedPromise,function(e){n?v(!0,e):y(function(){return h3(t,e)},!0,e)}),x(t,s._closedPromise,function(t){a?v(!0,t):y(function(){return mq(e,t)},!0,t)}),h=e,m=o._closedPromise,g=function(){i?v():y(function(){var e=s._ownerWritableStream,t=e._state;return h8(e)||"closed"===t?pA(void 0):"errored"===t?pE(e._storedError):mn(s)})},"closed"===h._state?g():pM(m,g),h8(t)||"closed"===t._state){var p,h,m,g,f=TypeError("the destination writable stream closed before all data could be piped to it");a?v(!0,f):y(function(){return mq(e,f)},!0,f)}function b(){var e=d;return pI(d,function(){return e!==d?b():void 0})}function x(e,t,i){"errored"===e._state?i(e._storedError):pT(t,i)}function y(e,i,n){if(!l)if(l=!0,"writable"!==t._state||h8(t))a();else pM(b(),a);function a(){pM(e(),function(){return C(i,n)},function(e){return C(!0,e)})}}function v(e,i){if(!l)if(l=!0,"writable"!==t._state||h8(t))C(e,i);else pM(b(),function(){return C(e,i)})}function C(e,t){mr(s),pB(o),void 0!==r&&r.removeEventListener("abort",p),e?u(t):c(void 0)}pL(p_(function(e,t){!function i(n){n?e():pI(l?pA(!0):pI(s._readyPromise,function(){return p_(function(e,t){he(o,{_chunkSteps:function(t){d=pI(mo(s,t),void 0,pv),e(!1)},_closeSteps:function(){return e(!0)},_errorSteps:t})})}),i,t)}(!1)}))})}var mT=function(){function e(){throw TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!mL(this))throw mH("desiredSize");return mB(this)},enumerable:!1,configurable:!0}),e.prototype.close=function(){if(!mL(this))throw mH("close");if(!mz(this))throw TypeError("The stream is not in a state that permits close");mN(this)},e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!mL(this))throw mH("enqueue");if(!mz(this))throw TypeError("The stream is not in a state that permits enqueue");return mR(this,e)},e.prototype.error=function(e){if(void 0===e&&(e=void 0),!mL(this))throw mH("error");mO(this,e)},e.prototype[pG]=function(e){hh(this);var t=this._cancelAlgorithm(e);return mD(this),t},e.prototype[p$]=function(e){var t=this._controlledReadableStream;if(this._queue.length>0){var i=hu(this);this._closeRequested&&0===this._queue.length?(mD(this),mY(t)):mj(this),e._chunkSteps(i)}else p5(t,e),mj(this)},e}();function mL(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledReadableStream")&&e instanceof mT}function mj(e){if(mP(e)){if(e._pulling){e._pullAgain=!0;return}e._pulling=!0,pM(e._pullAlgorithm(),function(){e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,mj(e))},function(t){mO(e,t)})}}function mP(e){var t=e._controlledReadableStream;return!!mz(e)&&!!e._started&&!!(mK(t)&&p6(t)>0||mB(e)>0)}function mD(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function mN(e){if(mz(e)){var t=e._controlledReadableStream;e._closeRequested=!0,0===e._queue.length&&(mD(e),mY(t))}}function mR(e,t){if(mz(e)){var i=e._controlledReadableStream;if(mK(i)&&p6(i)>0)p4(i,t,!1);else{var n=void 0;try{n=e._strategySizeAlgorithm(t)}catch(t){throw mO(e,t),t}try{hp(e,t,n)}catch(t){throw mO(e,t),t}}mj(e)}}function mO(e,t){var i=e._controlledReadableStream;"readable"===i._state&&(hh(e),mD(e),mX(i,t))}function mB(e){var t=e._controlledReadableStream._state;return"errored"===t?null:"closed"===t?0:e._strategyHWM-e._queueTotalSize}function mz(e){var t=e._controlledReadableStream._state;return!e._closeRequested&&"readable"===t}function mF(e,t,i,n,a,r,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,hh(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=r,t._pullAlgorithm=n,t._cancelAlgorithm=a,e._readableStreamController=t,pM(pA(i()),function(){t._started=!0,mj(t)},function(e){mO(t,e)})}function mH(e){return TypeError("ReadableStreamDefaultController.prototype."+e+" can only be used on a ReadableStreamDefaultController")}function mW(e,t){pq(e,t);var i=null==e?void 0:e.preventAbort,n=null==e?void 0:e.preventCancel,a=null==e?void 0:e.preventClose,r=null==e?void 0:e.signal;return void 0!==r&&function(e,t){if(!function(e){if("object"!=typeof e||null===e)return!1;try{return"boolean"==typeof e.aborted}catch(e){return!1}}(e))throw TypeError(t+" is not an AbortSignal.")}(r,t+" has member 'signal' that"),{preventAbort:!!i,preventCancel:!!n,preventClose:!!a,signal:r}}Object.defineProperties(mT.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(mT.prototype,py.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});var mU=function(){function e(e,t){void 0===e&&(e={}),void 0===t&&(t={}),void 0===e?e=null:pX(e,"First parameter");var i=hY(t,"Second parameter"),n=(p="First parameter",pq(u=e,p),h=null==u?void 0:u.autoAllocateChunkSize,m=null==u?void 0:u.cancel,g=null==u?void 0:u.pull,f=null==u?void 0:u.start,b=null==u?void 0:u.type,{autoAllocateChunkSize:void 0===h?void 0:p1(h,p+" has member 'autoAllocateChunkSize' that"),cancel:void 0===m?void 0:(r=m,o=u,pY(r,p+" has member 'cancel' that"),function(e){return pD(r,o,[e])}),pull:void 0===g?void 0:(s=g,l=u,pY(s,p+" has member 'pull' that"),function(e){return pD(s,l,[e])}),start:void 0===f?void 0:(d=f,c=u,pY(d,p+" has member 'start' that"),function(e){return pP(d,c,[e])}),type:void 0===b?void 0:function(e,t){if("bytes"!=(e=""+e))throw TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamType");return e}(b,p+" has member 'type' that")});if(m$(this),"bytes"===n.type){if(void 0!==i.size)throw RangeError("The strategy for a byte stream cannot have a size function");var a=hK(i,0);!function(e,t,i){var n=Object.create(hg.prototype),a=function(){},r=function(){return pA(void 0)},o=function(){return pA(void 0)};void 0!==t.start&&(a=function(){return t.start(n)}),void 0!==t.pull&&(r=function(){return t.pull(n)}),void 0!==t.cancel&&(o=function(e){return t.cancel(e)});var s=t.autoAllocateChunkSize;if(0===s)throw TypeError("autoAllocateChunkSize must be greater than 0");hB(e,n,a,r,o,i,s)}(this,n,a)}else{var r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S=hq(i),a=hK(i,1);x=a,y=Object.create(mT.prototype),v=function(){},C=function(){return pA(void 0)},w=function(){return pA(void 0)},void 0!==n.start&&(v=function(){return n.start(y)}),void 0!==n.pull&&(C=function(){return n.pull(y)}),void 0!==n.cancel&&(w=function(e){return n.cancel(e)}),mF(this,y,v,C,w,x,S)}}return Object.defineProperty(e.prototype,"locked",{get:function(){if(!mZ(this))throw mQ("locked");return mK(this)},enumerable:!1,configurable:!0}),e.prototype.cancel=function(e){return(void 0===e&&(e=void 0),mZ(this))?mK(this)?pE(TypeError("Cannot cancel a stream that already has a reader")):mq(this,e):pE(mQ("cancel"))},e.prototype.getReader=function(e){var t,i,n;if(void 0===e&&(e=void 0),!mZ(this))throw mQ("getReader");return void 0===(i="First parameter",pq(t=e,i),{mode:void 0===(n=null==t?void 0:t.mode)?void 0:function(e,t){if("byob"!=(e=""+e))throw TypeError(t+" '"+e+"' is not a valid enumeration value for ReadableStreamReaderMode");return e}(n,i+" has member 'mode' that")}).mode?p3(this):new hV(this)},e.prototype.pipeThrough=function(e,t){if(void 0===t&&(t={}),!mZ(this))throw mQ("pipeThrough");pQ(e,1,"pipeThrough");var i,n,a,r=(pq(e,i="First parameter"),pJ(n=null==e?void 0:e.readable,"readable","ReadableWritablePair"),p2(n,i+" has member 'readable' that"),pJ(a=null==e?void 0:e.writable,"writable","ReadableWritablePair"),hX(a,i+" has member 'writable' that"),{readable:n,writable:a}),o=mW(t,"Second parameter");if(mK(this))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(h2(r.writable))throw TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");return pL(mM(this,r.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal)),r.readable},e.prototype.pipeTo=function(e,t){var i;if(void 0===t&&(t={}),!mZ(this))return pE(mQ("pipeTo"));if(void 0===e)return pE("Parameter 1 is required in 'pipeTo'.");if(!h1(e))return pE(TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));try{i=mW(t,"Second parameter")}catch(e){return pE(e)}return mK(this)?pE(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):h2(e)?pE(TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):mM(this,e,i.preventClose,i.preventAbort,i.preventCancel,i.signal)},e.prototype.tee=function(){if(!mZ(this))throw mQ("tee");var e=hf(this._readableStreamController)?function(e){var t,i,n,a,r,o=p3(e),s=!1,l=!1,d=!1,c=!1,u=!1,p=p_(function(e){r=e});function h(e){pT(e._closedPromise,function(t){e===o&&(hP(n._readableStreamController,t),hP(a._readableStreamController,t),c&&u||r(void 0))})}function m(){hG(o)&&(pB(o),h(o=p3(e))),he(o,{_chunkSteps:function(t){pj(function(){l=!1,d=!1;var i=t;if(!c&&!u)try{i=hc(t)}catch(t){hP(n._readableStreamController,t),hP(a._readableStreamController,t),r(mq(e,t));return}c||hj(n._readableStreamController,t),u||hj(a._readableStreamController,i),s=!1,l?f():d&&b()})},_closeSteps:function(){s=!1,c||hL(n._readableStreamController),u||hL(a._readableStreamController),n._readableStreamController._pendingPullIntos.length>0&&hR(n._readableStreamController,0),a._readableStreamController._pendingPullIntos.length>0&&hR(a._readableStreamController,0),c&&u||r(void 0)},_errorSteps:function(){s=!1}})}function g(t,i){p7(o)&&(pB(o),h(o=new hV(e)));var p=i?a:n,m=i?n:a;h$(o,t,{_chunkSteps:function(t){pj(function(){l=!1,d=!1;var n=i?u:c;if(i?c:u)n||hO(p._readableStreamController,t);else{var a=void 0;try{a=hc(t)}catch(t){hP(p._readableStreamController,t),hP(m._readableStreamController,t),r(mq(e,t));return}n||hO(p._readableStreamController,t),hj(m._readableStreamController,a)}s=!1,l?f():d&&b()})},_closeSteps:function(e){s=!1;var t=i?u:c,n=i?c:u;t||hL(p._readableStreamController),n||hL(m._readableStreamController),void 0!==e&&(t||hO(p._readableStreamController,e),!n&&m._readableStreamController._pendingPullIntos.length>0&&hR(m._readableStreamController,0)),t&&n||r(void 0)},_errorSteps:function(){s=!1}})}function f(){if(s)return l=!0,pA(void 0);s=!0;var e=hD(n._readableStreamController);return null===e?m():g(e._view,!1),pA(void 0)}function b(){if(s)return d=!0,pA(void 0);s=!0;var e=hD(a._readableStreamController);return null===e?m():g(e._view,!0),pA(void 0)}function x(){}return n=mG(x,f,function(n){if(c=!0,t=n,u){var a=mq(e,hs([t,i]));r(a)}return p}),a=mG(x,b,function(n){if(u=!0,i=n,c){var a=mq(e,hs([t,i]));r(a)}return p}),h(o),[n,a]}(this):function(e){var t,i,n,a,r,o=p3(e),s=!1,l=!1,d=!1,c=!1,u=p_(function(e){r=e});function p(){return s?(l=!0,pA(void 0)):(s=!0,he(o,{_chunkSteps:function(e){pj(function(){l=!1,d||mR(n._readableStreamController,e),c||mR(a._readableStreamController,e),s=!1,l&&p()})},_closeSteps:function(){s=!1,d||mN(n._readableStreamController),c||mN(a._readableStreamController),d&&c||r(void 0)},_errorSteps:function(){s=!1}}),pA(void 0))}function h(){}return n=mV(h,p,function(n){if(d=!0,t=n,c){var a=mq(e,hs([t,i]));r(a)}return u}),a=mV(h,p,function(n){if(c=!0,i=n,d){var a=mq(e,hs([t,i]));r(a)}return u}),pT(o._closedPromise,function(e){mO(n._readableStreamController,e),mO(a._readableStreamController,e),d&&c||r(void 0)}),[n,a]}(this);return hs(e)},e.prototype.values=function(e){var t,i,n,a;if(void 0===e&&(e=void 0),!mZ(this))throw mQ("values");return i=(pq(t=e,"First parameter"),{preventCancel:!!(null==t?void 0:t.preventCancel)}).preventCancel,n=new hi(p3(this),i),(a=Object.create(hn))._asyncIteratorImpl=n,a},e}();function mV(e,t,i,n,a){void 0===n&&(n=1),void 0===a&&(a=function(){return 1});var r=Object.create(mU.prototype);return m$(r),mF(r,Object.create(mT.prototype),e,t,i,n,a),r}function mG(e,t,i){var n=Object.create(mU.prototype);return m$(n),hB(n,Object.create(hg.prototype),e,t,i,0,void 0),n}function m$(e){e._state="readable",e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function mZ(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_readableStreamController")&&e instanceof mU}function mK(e){return void 0!==e._reader}function mq(e,t){if(e._disturbed=!0,"closed"===e._state)return pA(void 0);if("errored"===e._state)return pE(e._storedError);mY(e);var i=e._reader;return void 0!==i&&hG(i)&&(i._readIntoRequests.forEach(function(e){e._closeSteps(void 0)}),i._readIntoRequests=new pN),pI(e._readableStreamController[pG](t),pv,void 0)}function mY(e){e._state="closed";var t=e._reader;void 0!==t&&(pW(t),p7(t)&&(t._readRequests.forEach(function(e){e._closeSteps()}),t._readRequests=new pN))}function mX(e,t){e._state="errored",e._storedError=t;var i=e._reader;void 0!==i&&(pH(i,t),p7(i)?(i._readRequests.forEach(function(e){e._errorSteps(t)}),i._readRequests=new pN):(i._readIntoRequests.forEach(function(e){e._errorSteps(t)}),i._readIntoRequests=new pN))}function mQ(e){return TypeError("ReadableStream.prototype."+e+" can only be used on a ReadableStream")}function mJ(e,t){pq(e,t);var i=null==e?void 0:e.highWaterMark;return pJ(i,"highWaterMark","QueuingStrategyInit"),{highWaterMark:p0(i)}}Object.defineProperties(mU.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(mU.prototype,py.toStringTag,{value:"ReadableStream",configurable:!0}),"symbol"==typeof py.asyncIterator&&Object.defineProperty(mU.prototype,py.asyncIterator,{value:mU.prototype.values,writable:!0,configurable:!0});var m0=function(e){return e.byteLength};try{Object.defineProperty(m0,"name",{value:"size",configurable:!0})}catch(e){}var m1=function(){function e(e){pQ(e,1,"ByteLengthQueuingStrategy"),e=mJ(e,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!m3(this))throw m2("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!m3(this))throw m2("size");return m0},enumerable:!1,configurable:!0}),e}();function m2(e){return TypeError("ByteLengthQueuingStrategy.prototype."+e+" can only be used on a ByteLengthQueuingStrategy")}function m3(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_byteLengthQueuingStrategyHighWaterMark")&&e instanceof m1}Object.defineProperties(m1.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(m1.prototype,py.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});var m5=function(){return 1};try{Object.defineProperty(m5,"name",{value:"size",configurable:!0})}catch(e){}var m4=function(){function e(e){pQ(e,1,"CountQueuingStrategy"),e=mJ(e,"First parameter"),this._countQueuingStrategyHighWaterMark=e.highWaterMark}return Object.defineProperty(e.prototype,"highWaterMark",{get:function(){if(!m9(this))throw m6("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){if(!m9(this))throw m6("size");return m5},enumerable:!1,configurable:!0}),e}();function m6(e){return TypeError("CountQueuingStrategy.prototype."+e+" can only be used on a CountQueuingStrategy")}function m9(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_countQueuingStrategyHighWaterMark")&&e instanceof m4}Object.defineProperties(m4.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(m4.prototype,py.toStringTag,{value:"CountQueuingStrategy",configurable:!0});var m8=function(){function e(e,t,i){void 0===e&&(e={}),void 0===t&&(t={}),void 0===i&&(i={}),void 0===e&&(e=null);var n,a,r,o,s,l,d,c,u,p,h,m,g,f,b=hY(t,"Second parameter"),x=hY(i,"Third parameter"),y=(c="First parameter",pq(d=e,c),u=null==d?void 0:d.flush,p=null==d?void 0:d.readableType,h=null==d?void 0:d.start,m=null==d?void 0:d.transform,g=null==d?void 0:d.writableType,{flush:void 0===u?void 0:(n=u,a=d,pY(n,c+" has member 'flush' that"),function(e){return pD(n,a,[e])}),readableType:p,start:void 0===h?void 0:(r=h,o=d,pY(r,c+" has member 'start' that"),function(e){return pP(r,o,[e])}),transform:void 0===m?void 0:(s=m,l=d,pY(s,c+" has member 'transform' that"),function(e,t){return pD(s,l,[e,t])}),writableType:g});if(void 0!==y.readableType)throw RangeError("Invalid readableType specified");if(void 0!==y.writableType)throw RangeError("Invalid writableType specified");var v=hK(x,0),C=hq(x),w=hK(b,1),S=hq(b);(function(e,t,i,n,a,r){var o,s,l;function d(){return t}void 0===(o=i)&&(o=1),void 0===(s=n)&&(s=function(){return 1}),h0(l=Object.create(hJ.prototype)),mc(l,Object.create(ml.prototype),d,function(t){var i,n,a;return i=e,n=t,a=i._transformStreamController,i._backpressure?pI(i._backpressureChangePromise,function(){var e=i._writable;if("erroring"===e._state)throw e._storedError;return gs(a,n)},void 0):gs(a,n)},function(){var t,i,n,a;return i=(t=e)._readable,a=(n=t._transformStreamController)._flushAlgorithm(),gr(n),pI(a,function(){if("errored"===i._state)throw i._storedError;mN(i._readableStreamController)},function(e){throw ge(t,e),i._storedError})},function(t){return ge(e,t),pA(void 0)},o,s),e._writable=l,e._readable=mV(d,function(){var t;return gi(t=e,!1),t._backpressureChangePromise},function(t){return gt(e,t),pA(void 0)},a,r),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,gi(e,!0),e._transformStreamController=void 0})(this,p_(function(e){f=e}),w,S,v,C),function(e,t){var i,n,a=Object.create(gn.prototype),r=function(e){try{var t;return go(a,e),t=void 0,pA(t)}catch(e){return pE(e)}},o=function(){return pA(void 0)};void 0!==t.transform&&(r=function(e){return t.transform(e,a)}),void 0!==t.flush&&(o=function(){return t.flush(a)}),i=r,n=o,a._controlledTransformStream=e,e._transformStreamController=a,a._transformAlgorithm=i,a._flushAlgorithm=n}(this,y),void 0!==y.start?f(y.start(this._transformStreamController)):f(void 0)}return Object.defineProperty(e.prototype,"readable",{get:function(){if(!m7(this))throw gd("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"writable",{get:function(){if(!m7(this))throw gd("writable");return this._writable},enumerable:!1,configurable:!0}),e}();function m7(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_transformStreamController")&&e instanceof m8}function ge(e,t){mO(e._readable._readableStreamController,t),gt(e,t)}function gt(e,t){gr(e._transformStreamController),mm(e._writable._writableStreamController,t),e._backpressure&&gi(e,!1)}function gi(e,t){void 0!==e._backpressureChangePromise&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=p_(function(t){e._backpressureChangePromise_resolve=t}),e._backpressure=t}Object.defineProperties(m8.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(m8.prototype,py.toStringTag,{value:"TransformStream",configurable:!0});var gn=function(){function e(){throw TypeError("Illegal constructor")}return Object.defineProperty(e.prototype,"desiredSize",{get:function(){if(!ga(this))throw gl("desiredSize");return mB(this._controlledTransformStream._readable._readableStreamController)},enumerable:!1,configurable:!0}),e.prototype.enqueue=function(e){if(void 0===e&&(e=void 0),!ga(this))throw gl("enqueue");go(this,e)},e.prototype.error=function(e){var t,i;if(void 0===e&&(e=void 0),!ga(this))throw gl("error");t=this,i=e,ge(t._controlledTransformStream,i)},e.prototype.terminate=function(){var e,t;if(!ga(this))throw gl("terminate");e=this,mN((t=e._controlledTransformStream)._readable._readableStreamController),gt(t,TypeError("TransformStream terminated"))},e}();function ga(e){return!!pw(e)&&!!Object.prototype.hasOwnProperty.call(e,"_controlledTransformStream")&&e instanceof gn}function gr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0}function go(e,t){var i=e._controlledTransformStream,n=i._readable._readableStreamController;if(!mz(n))throw TypeError("Readable side is not in a state that permits enqueue");try{mR(n,t)}catch(e){throw gt(i,e),i._readable._storedError}!mP(n)!==i._backpressure&&gi(i,!0)}function gs(e,t){return pI(e._transformAlgorithm(t),void 0,function(t){throw ge(e._controlledTransformStream,t),t})}function gl(e){return TypeError("TransformStreamDefaultController.prototype."+e+" can only be used on a TransformStreamDefaultController")}function gd(e){return TypeError("TransformStream.prototype."+e+" can only be used on a TransformStream")}async function gc(e,t){let i,n=e.getReader();for(;!(i=await n.read()).done;)t(i.value)}function gu(){return{data:"",event:"",id:"",retry:void 0}}Object.defineProperties(gn.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),"symbol"==typeof py.toStringTag&&Object.defineProperty(gn.prototype,py.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});let gp="text/event-stream",gh="last-event-id";function gm(e){let t=e.headers.get("content-type");if(!t?.startsWith(gp))throw Error(`Expected content-type to be ${gp}, Actual: ${t}`)}class gg extends m8{constructor(){super({transform:async(e,t)=>{"error"===e.event?t.error(new pm(`StreamError message received: ${JSON.stringify(e)}`,e.data)):t.enqueue(e)}})}}class gf extends Error{timeout;constructor(e){super(),this.timeout=e}}async function gb(e,t={}){let i=uD(e.promptKey)+"/ai/v2/render-generation",n={"Content-Type":"application/json"};t.traceparent&&(n["aijsx-traceparent"]=t.traceparent);let a={method:"POST",headers:n,body:JSON.stringify(e),signal:t.abortController?.signal};return(await gx(i,a,t)).result}let gx=async(e,t,{timeout:i=null,maxRetries:n=3,retryAttempts:a=0,abortController:r})=>{let o=r||new AbortController,s=null;null!=i&&(s=setTimeout(()=>{o.abort()},i));let l=()=>{s&&clearTimeout(s)},d=await (0,px.vercelIsomorphicFetch)(e,{credentials:"include",...t,signal:o.signal});if(d.ok){let e=await d.json();return l(),e}if(l(),d.status>=400&&d.status<500&&429!==d.status){let e=await d.text().catch(()=>"");throw new pf(`Unable to complete request (${d.status}): ${e||"No details"}`)}if(a++setTimeout(e,o)),gx(e,t,{timeout:i,retryAttempts:a,maxRetries:n,abortController:r})}throw Error("Unable to complete request, status="+d.status)};e.i(413829);var gy=e.i(462480),gv=e.i(65594);e.i(44850),(0,gy.customAlphabet)("0123456789abcdefghijklmnopqrstuvwxyz",16);var gC=e.i(402261);class gw extends m8{content="";constructor(e){super({start:()=>{e.onStart?.()},transform:async(t,i)=>{"content"===t.event&&(this.content+=t.data,e.onContent?.(this.content)),"done"===t.event&&e.onComplete?.(this.content),"cancel"===t.event&&e.onCancel?.(),i.enqueue(t)},flush(){e.onFlush?.()}})}getContent(){return this.content}}var gS=es;let gk=(e,t)=>({generate:(0,F.useCallback)(i=>{let{traceparent:n,...a}=i;return gA({...a,promptKey:e,opts:{...t,traceparent:n}})},[t,e])}),gA=({promptKey:e,opts:t,variables:i,interactionId:n,workspaceId:a})=>{let{cancel:r,stream:o}=function(e,t={}){let i,n,a,r,o,s,l,d,c,u,p,h,m,g=uD(e.promptKey)+"/ai/v2/generation",f={"Content-Type":"application/json"};t.streamId&&(f["gamma-chat-completion-stream-id"]=t.streamId),t.traceparent&&(f["aijsx-traceparent"]=t.traceparent);let b={method:"POST",headers:f,body:JSON.stringify(e),fetch:px.vercelIsomorphicFetch};return i=t.retries||0,n=t.backoff||1e3,a=t.timeout||null,r=t.streamResumingEnabled??!1,o=0,s=new AbortController,l=!1,d=!1,c=!1,u=null,p=!1,h=()=>n*Math.pow(2,Math.max(o-1,0)),m={},r&&(m["gamma-stream-resuming-enabled"]="true"),{stream:new mU({async start(e){null!=a&&(u=setTimeout(()=>{p=!0,s.abort(),e.error(new pg(`Stream timed out after ${a}ms`))},a));let{headers:t,...n}=b;(function(e,{signal:t,headers:i,onopen:n,onmessage:a,onclose:r,onerror:o,openWhenHidden:s,fetch:l,...d}){return new Promise((c,u)=>{let p,h={...i};function m(){p.abort(),document.hidden||v()}h.accept||(h.accept=gp),s||document.addEventListener("visibilitychange",m);let g=1e3,f=0;function b(){document.removeEventListener("visibilitychange",m),window.clearTimeout(f),p.abort()}t?.addEventListener("abort",()=>{b(),c()});let x=l??window.fetch,y=n??gm;async function v(){p=new AbortController;try{var t,i,n;let o,s,l,u,m,f,v,C=await x(e,{...d,headers:h,signal:p.signal});await y(C),await gc(C.body,(t=e=>{e?h[gh]=e:delete h[gh]},i=e=>{g=e},o=gu(),s=new TextDecoder,l=!1,n=function(e,n){if(0===e.length)a?.(o),o=gu(),l=!1;else if(n>0){let a=s.decode(e.subarray(0,n)),r=n+(32===e[n+1]?2:1),d=s.decode(e.subarray(r));switch(a){case"data":l?o.data=o.data+"\n"+d:(o.data=d,l=!0);break;case"event":o.event=d;break;case"id":t(o.id=d);break;case"retry":let c=parseInt(d,10);isNaN(c)||i(o.retry=c)}}},v=!1,function(e){var t,i;let a;void 0===u?(u=e,m=0,f=-1):(t=u,i=e,(a=new Uint8Array(t.length+i.length)).set(t),a.set(i,t.length),u=a);let r=u.length,o=0;for(;m{if(!t.ok||t.headers.get("content-type")!==gp)if(t.status>=400&&t.status<500&&429!==t.status)s.abort(),e.error(new pf("Unable to complete request"));else if(o++{u&&(clearTimeout(u),u=null),c||e.error(t)})}}).pipeThrough(new gg),cancel:()=>{c||(c=!0)}}}({promptKey:e,variables:i,interactionId:n=n||(0,gC.generateAIInteractionId)(),workspaceId:a},{timeout:t.timeout,traceparent:t.traceparent}),s=new gw(t),l=o.pipeThrough(s);return{cancel:r,promise:new Promise((i,a)=>{var r;let o,d;r={onError(i){var r;t.onError?.(i),r={customErrorType:"streamJsxGeneration",promptKey:e,interactionId:n},t.skipCapturingErrors||cN.featureFlags.get("disableAiErrorLogging")||(0,gv.addDatadogError)(i,r),a(i)},onDone(){i(s.getContent())}},o=l.getReader(),(d=async()=>{try{let{done:e,value:t}=await o.read();if(e)r.onDone?.();else{r.onMessage?.(t),d();return}}catch(e){r.onError?.(e instanceof Error?e:Error(e))}})()})}};e.s(["renderJsxPrompt",0,({promptKey:e,variables:t,interactionId:i,workspaceId:n=(0,gS.getCurrentWorkspaceId)(),opts:a={}})=>gb({promptKey:e,interactionId:i=i||(0,gC.generateAIInteractionId)(),workspaceId:n,variables:t,toolCallId:a.toolCallId},a),"streamJsxGeneration",0,gA,"useStreamingJsxGeneration",0,gk],853081),e.i(254884);var gE=e.i(753801),g_=e.i(913369),gI=e.i(379457),gM=e.i(615393),gT=e.i(131339),gL=e.i(85547),gj=e.i(103630);let gP=({pos:e,editor:t})=>{let i=(0,g.findParentNodes)(t.state.doc.resolve(e),gj.isCardNode).map(e=>e.node.attrs.id);(0,gT.setCardCollapsed)(i,!1)},gD=async({cardId:e,pos:t,editor:i,cardEl:n,isNested:a=!1,origin:r="editor"})=>{n?((0,gT.setCardCollapsed)(e,!1),gP({pos:t,editor:i}),await (0,gE.getScrollManager)("editor").scrollElementIntoView({element:n,delay:a?gL.EXPAND_CARD_TRANSITION_TIME:0}),i.commands.command(({tr:e})=>(e.setSelection(p.Selection.near(i.state.doc.resolve(t))).setMeta(g_.SET_SELECTION_ORIGIN_META_KEY,r),!0))):console.error("[scrollToCard] no cardEl specified")},gN=(e,t)=>{let i=(0,g.findDirectChildren)(e,e=>"cardLayoutItem"===e.type.name);return i.length>0?{node:i[0].node,pos:t+i[0].pos+1}:{node:e,pos:t}};e.s(["checkBetweenCardsDropTarget",0,(e,t,i)=>{let n,a,r=t.target;if(r.closest(`.${gL.CARD_BODY_CLASS}`)&&!r.closest("[data-outside-card-body]")||i&&(n=i,!e.state.schema.nodes.card.validContent(n.content)))return null;let o=r.closest(`.${gL.CARD_WRAPPER_CLASS}`);if(!o)return{pos:e.state.doc.content.size-1};let s=o.querySelector(`.${gL.CARD_BODY_CLASS}`),l=s?.getBoundingClientRect();if(!l)return null;let{doc:d}=e.state;try{let t=e.posAtDOM(o,0);if(-1===t)return null;let i=(0,g.findParentNodes)(d.resolve(t),gj.isCardNode);if(0===i.length)return null;a=i[i.length-1]}catch(e){return console.error("(caught) [checkBetweenCardsDropTarget] error finding parent node:",e),null}let{node:c,pos:u}=a;if(!u||!c)return null;let[p]=(0,gI.calculateScroll)(s),h=p+l.top,m=p+l.bottom,f=p+t.clientY;return fm?{pos:u+c.nodeSize}:null},"findCardBody",0,gN,"findCollapsedCardNodeClosestToPos",0,(e,t,i)=>{let n=e=>{let t=(0,gj.isCardNode)(e),n="boolean"!=typeof i||(0,gT.isCardCollapsed)(e)===i;return t&&n},a=e.state.doc.nodeAt(t),r=e.state.doc.resolve(t);return a&&n(a)?{node:a,pos:t,start:r.start,depth:r.depth}:(0,u.findParentNodeClosestToPos)(e.state.doc.resolve(t),n)},"findTopCardNodeParent",0,(e,t)=>{try{let i=(e,t)=>(0,gj.isCardNode)(e)&&t===gL.CARD_DEPTH,n=e.resolve(t),a=e.nodeAt(t);if(a&&i(a,n.depth+1))return{node:a,pos:t};return(0,g.findParentNodeClosestToPosWithDepth)(n,i)}catch(e){console.error("[findTopCardNodeParent] error",e);return}},"goToCard",0,({cardId:e,editor:t})=>{if(!e)return;let i=(0,ei.getStore)();if((0,eo.selectMode)(i.getState())===gM.EditorModeEnum.SLIDE_VIEW)return void t.commands.spotlightCardById(e);let n=document.querySelector(`[data-card-id="${e}"]`);if(!n)return;let{pos:a}=(0,gj.findCardById)(t,e)||{};if(!a)return;let r=t.state.doc.resolve(a).depth>gL.CARD_DEPTH;gD({cardId:e,pos:a,editor:t,cardEl:n,isNested:r})},"openParentCards",0,gP],647031),e.i(24439);var gR=iW,gO=e.i(469305),gB=e.i(52834);let gz=e=>{let t=(0,es.getCurrentWorkspaceId)(),i=(0,ei.useAppSelector)(ea.selectFileWorkspace),n=i?.id,a=(0,es.getDocOrPaidWorkspace)(n)?.id,r=(0,ei.useAppSelector)((0,pi.selectIsMemberOfCurrentDocWorkspace)(n??""));return e!==iW.SavedMediaContext.Dashboard&&r?a:t};e.s(["useWorkspaceIdForAIImageContext",0,gz],897587);let gF=18,gH=[gO.AI_IMAGE_SOURCE_KEY,gO.AI_EDITED_IMAGE_SOURCE_KEY,gO.AI_IMAGE_CARD_SOURCE_KEY,ib.AI_ANIMATION_SOURCE_KEY,gB.AI_INFOGRAPHIC_SOURCE_KEY],gW=["GetUserSavedMedia","GetWorkspaceSavedMedia"],gU=({scope:e,interactionId:t,docId:i,themeId:n,count:a=gF,savedMediaContext:r,mediaTypes:o=[gR.MediaType.Image,gR.MediaType.Video],sources:s=gH})=>{let l={workspaceId:gz(r),types:o,sources:s,first:a,...t?{interactionId:t}:{}},d={...i?{docId:i}:{},...n?{themeId:n}:{}},c=(0,gR.useGetUserSavedMediaQuery)({variables:{...l},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:"user"!==e}),u=(0,gR.useGetWorkspaceSavedMediaQuery)({variables:{...l,...d},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:"doc"!==e});return"user"===e?c:u};e.s(["providerUsesAIImagePanel",0,e=>gH.includes(e),"useAIImageHistory",0,({docId:e,themeId:t,interactionId:i,scope:n,count:a=gF,savedMediaContext:r,mediaTypes:o=[gR.MediaType.Image],sources:s=gH})=>{let{data:l,loading:d,fetchMore:c}=gU({scope:n,docId:e,themeId:t,interactionId:i,count:a,savedMediaContext:r,mediaTypes:o,sources:s}),u=(0,F.useMemo)(()=>{switch(n){case"user":return"userSavedMedia";case"doc":return"workspaceSavedMedia"}},[n]),p=(0,F.useMemo)(()=>(l?.[u]?.edges||[]).map(e=>e.node),[l,u]),h=l?.[u]?.pageInfo,[m,g]=(0,F.useState)(!1),f=(0,F.useCallback)(async()=>{if(h?.hasNextPage&&h?.endCursor){g(!0);try{await c({variables:{after:h.endCursor},updateQuery:(e,{fetchMoreResult:t})=>{if(!t)return e;let i=t[u]?.edges||[],n=[...e[u]?.edges||[],...i];return{...e,[u]:{...t[u],edges:n}}}})}catch(e){console.error("Error loading more images:",e)}finally{g(!1)}}},[c,h,u]),[b,x]=(0,F.useState)(null),[y,v]=(0,F.useState)(!1),[C,w]=(0,F.useState)(!1),[S]=(0,gR.useArchiveSavedMediaMutation)(),[k]=(0,gR.useArchiveManySavedMediaMutation)(),[A]=(0,gR.useUnarchiveManySavedMediaMutation)(),E=(0,F.useCallback)(async e=>{x(e),v(!0);try{await S({variables:{id:e},update:t=>{t.evict({id:t.identify({id:e,__typename:"SavedMedia"})}),t.gc()},refetchQueries:gW})}catch(e){console.error("Error deleting image:",e)}finally{x(null),v(!1)}},[S]),_=(0,F.useCallback)(async e=>{try{await A({variables:{ids:e},refetchQueries:gW})}catch(e){console.error("Error unarchiving images:",e)}},[A]),I=(0,F.useCallback)(async e=>{let t=!1;w(!0);try{await k({variables:{ids:e},update:t=>{e.forEach(e=>{t.evict({id:t.identify({id:e,__typename:"SavedMedia"})})}),t.gc()},refetchQueries:gW})}catch(e){console.error("Error deleting images:",e),t=!0}finally{w(!1)}return t?{success:!1}:{success:!0,undo:()=>_(e)}},[k,_]);return{history:p,loadMore:f,isLoadingMore:m,canLoadMore:!!h?.hasNextPage,isLoading:d,deleteImage:E,deletingId:b,isDeleting:y,isDeletingMany:C,deleteMany:I}},"useScopedImageHistory",0,gU],185635);let gV=e=>e.history[e.history.length-1],gG={load:(e,t)=>({history:[t],ind:0}),push(e,t){return""===gV(e).trim()?this.replace(e,t):{history:[...e.history,t],ind:e.history.length}},replace(e,t){let i=e.history.slice(0,-1);return{history:[...i,t],ind:i.length}},select(e,t){return e.ind===e.history.length-1&&gV(e)===t?e:this.push(e,t)}},g$=()=>{let e=(0,F.useRef)(!1),[t,i]=(0,F.useState)({history:[""],ind:0}),n=(0,F.useCallback)((t,n)=>{"load"===n&&i(e=>gG.load(e,t)),"push"===n&&i(e=>gG.push(e,t)),"update"===n&&(e.current?i(e=>gG.push(e,t)):i(e=>gG.replace(e,t))),"select"===n&&i(e=>gG.select(e,t)),e.current="update"!==n},[]),a=(0,F.useCallback)(()=>{let{ind:e}=t;e<=0||i(e=>({...e,ind:e.ind-1}))},[t]),r=(0,F.useCallback)(()=>{let{history:e,ind:n}=t;n>=e.length-1||i(e=>({...e,ind:e.ind+1}))},[t]),{ind:o,history:s}=t;return{prompt:s[o]||"",addPrompt:n,promptPageInfo:{curr:o+1,total:s.length,canGoNext:o0},nextPrompt:r,prevPrompt:a}},gZ=()=>{let e=(0,ei.useAppSelector)(ea.selectFileWorkspace),t=(0,iM.useCanUseProductFeature)("ai_models_plus",e),i=(0,iM.useCanUseProductFeature)("ai_premium_models",e),n=(0,iM.useCanUseProductFeature)("ai_models_ultra",e)?"ultra":t&&i?"pro":t?"plus":"free";return e=>gK(e,n)},gK=(e,t)=>{let i=pt(e);if(u0(e).isTemporarilyFree)return!0;if(!u9(e))return!1;let n=["free","plus","pro","ultra"];return n.indexOf(t)>=n.indexOf(i)};e.s(["checkModelAvailableForWorkspace",0,(e,t)=>{let i=(0,iM.getCanUseProductFeature)("ai_models_plus",t),n=(0,iM.getCanUseProductFeature)("ai_premium_models",t);return gK(e,(0,iM.getCanUseProductFeature)("ai_models_ultra",t)?"ultra":n?"pro":i?"plus":"free")},"useCheckModelAvailable",0,gZ,"useEnhanceImagePrompt",0,({editor:e,prompt:t,stylePrompt:i,styleReferenceKey:n,addPrompt:a})=>{let r=(0,ei.useAppSelector)(ea.selectFileWorkspace),[o,s]=(0,F.useState)(!1),l=(0,F.useCallback)(()=>{if(!e)return null;let{selection:t}=e.state,i=(0,g.findNodeAndParents)(t.$from,gj.isCardNode)[0],n=i&&gN(i.node,i.pos),{content:a}=e.state.doc.slice(n.pos+1,n.pos+n.node.nodeSize-1),r=(e=>{if(!(e instanceof p.NodeSelection))return null;if("smartLayoutCell"===e.node.type.name&&e.node.textContent?.length>=5)return e.node.content;let t=e.$from;for(;t.depth>0;){let e=t.node(t.depth);if("smartLayoutCell"===e.type.name&&e.textContent?.length>=5)return e.content;t=t.doc.resolve(t.before(t.depth))}return null})(t);return r?r.textBetween(0,r.size).trim()?(0,ph.contentToAiHtml)(e,r,{disableBookmarks:!0}):null:a.textBetween(0,a.size).trim()?(0,ph.contentToAiHtml)(e,a,{disableBookmarks:!0}):null},[e]),d=(0,F.useCallback)(()=>{s(!0),a("","push")},[a]),c=(0,F.useCallback)(e=>{a(e,"update")},[a]),u=(0,F.useCallback)(()=>{s(!1)},[]),h=(0,F.useCallback)(e=>{console.error("Error enhancing image",e),s(!1)},[]),m=!!n,{generate:f}=gk("EnhanceAIImage",{onStart:d,onContent:c,onComplete:u,onError:h,timeout:3e4}),{generate:b}=gk("EnhanceStyledImage",{onStart:d,onContent:c,onComplete:u,onError:h,timeout:3e4}),x=(0,F.useCallback)(()=>{if(o||!r?.id)return;let a=(0,es.getDocOrPaidWorkspace)(r?.id)?.id,s=e?.isSiteNavbarEditor?void 0:l()??void 0;if(e?.isSiteNavbarEditor||s||t.trim())return m?b({variables:{currentPrompt:t,styleReferenceKey:n,cardHtml:s},workspaceId:a}).promise:f({variables:{currentPrompt:t,stylePrompt:i,cardHtml:s},workspaceId:a}).promise},[o,r?.id,m,b,f,t,i,n,e?.isSiteNavbarEditor,l]);return{isEnhancing:o,setIsEnhancing:s,hasCardContent:!!e?.isSiteNavbarEditor||!!l(),runEnhanceImagePrompt:x}},"useGetImageHistoryForInteractionId",0,(e,t)=>{let i=(0,ei.useAppSelector)(ea.selectDocId),n=i&&!e?"doc":"user",a="doc"===n?"workspaceSavedMedia":"userSavedMedia",{data:r,loading:o}=gU({docId:i,interactionId:e,scope:n,count:3});return{savedMedia:(0,F.useMemo)(()=>(r?.[a]?.edges||[]).map(e=>e.node).filter(e=>!t||e?.attrs?.query===t),[r,a,t]),isLoading:o}},"useImageRatingStore",0,()=>{let[e,t]=(0,po.useLocalStorage)("aiImageRatings",{});return{saveImageRating:(0,F.useCallback)((i,n)=>{i.savedMediaId&&(e[i.savedMediaId]=n,t(e))},[]),hasRatedImage:(0,F.useCallback)(t=>!t.savedMediaId||!!e[t.savedMediaId],[])}},"usePromptHistory",0,g$],429693);var gq=e.i(530280),gY=e.i(359227);let gX=()=>{let e=(0,es.getCurrentWorkspaceId)(),t=(0,ei.useAppDispatch)(),{data:i,loading:n}=(0,iW.useGetThemesQuery)({variables:{workspaceId:e,archived:!1},skip:!e,fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),{data:a,loading:r}=(0,iW.useGetThemesQuery)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),o=(0,F.useMemo)(()=>a?.themes||[],[a?.themes]),s=(0,F.useMemo)(()=>i?.themes||[],[i?.themes]);return(0,F.useEffect)(()=>{o.length>0&&t((0,gY.setGlobalThemes)({globalThemes:o}))},[t,o]),(0,F.useEffect)(()=>{s.length>0&&t((0,gY.setWorkspaceThemes)({workspaceThemes:s}))},[t,s]),{isLoadingThemes:n||r,globalThemes:o}};e.s(["useFetchAndStoreThemePickerData",0,gX],957631);var gQ=e.i(794251),gJ=e.i(136234),g0=e.i(312965);let g1={"flux-2-flex":{maxImages:8},"flux-2-max":{maxImages:8},"ideogram-v3":{maxImages:3},"ideogram-v3-quality":{maxImages:3},"gpt-image-1-medium":{maxImages:10},"gpt-image-1-high":{maxImages:10},"gpt-image-1-mini-high":{maxImages:10},"gemini-2.5-flash-image":{maxImages:3},"gemini-3-pro-image":{maxImages:14},"gemini-3-pro-image-hd":{maxImages:14},"gemini-3.1-flash-image-mini":{maxImages:14},"gemini-3.1-flash-image":{maxImages:14},"gemini-3.1-flash-image-hd":{maxImages:14}};function g2(e){return e in g1}e.s(["MAX_STYLE_REFS_FOR_UI",0,4,"getMaxStyleReferenceImages",0,function(e){return g1[e]?.maxImages??0},"supportsStyleReferences",0,g2],352522);let g3=()=>{let e=uJ(),t=gZ(),{user:i,setSettings:n}=(0,el.useUserContext)(),a=i?.settings?.preferredAiImageModel;return a&&a in uX&&(a=uX[a]),[a&&t(a)?a:e,(0,F.useCallback)(e=>{n?.({set:{preferredAiImageModel:e}})},[n])]};e.s(["usePreferredAiImageModel",0,g3,"useSavedOrPreferredAiImageModel",0,e=>{let[t]=g3();return(({savedModel:e,checkModelAvailable:t,preferredAiImageModel:i})=>(e&&e in uX&&(e=uX[e]),e&&t(e))?e:i)({savedModel:e,checkModelAvailable:gZ(),preferredAiImageModel:t})}],75572);let g5="__custom__";function g4(e){return!!e&&!e.visualsMenuEnabled&&e.stylePreset===gQ.StylePresetIds.Custom}e.s(["CUSTOM_STYLE_KEY",0,g5],161334),e.s(["isPreVMCustomImage",0,g4,"useStyledImageMode",0,function({currentAttributes:e,lastUsedImageSettings:t}){var i,n,a,r;let o=(0,i5.useFeatureFlag)("deckStyledImages"),s=(i=e,n=t,i?.aiParams?.styleReferenceKey??n?.styleReferenceKey),l=(a=e,r=t,a?.aiParams?.artStylePreset??r?.artStylePreset),d=!s&&!l&&!!e?.aiParams||g4(e?.aiParams),[c,u]=(0,F.useState)(d?g5:s??(o&&"custom"===l?g5:void 0));return{showNewArtStyleUI:function({deckStyledImagesEnabled:e,persistedStyleKey:t,selectedStyleKey:i,artStylePreset:n}){return!!e&&(!!t||!!i||"custom"===n||!n)}({deckStyledImagesEnabled:o,persistedStyleKey:s,selectedStyleKey:c,artStylePreset:l}),persistedStyleKey:s,selectedStyleKey:c,setSelectedStyleKey:u}}],330185),e.s(["useImageGenerateConfig",0,({contextualTheme:e,lastUsedImageGenerationSettingsInDoc:t,aiParams:i,savedMediaContext:n,visualsMenuEnabled:a=!1,savedCustomArtStyle:r,showNewArtStyleUI:o=!1})=>{let[s,l]=g3(),[d,c]=(0,F.useState)(!i||i.stylePreset===gQ.StylePresetIds.Theme),u=(0,ei.useAppSelector)(eo.selectTheme),p=(0,ei.useAppSelector)(eo.selectImageOptions),h=u?.config?.stylePrompt,m=(0,ei.useAppSelector)(ea.selectFile),{stylePresetOptions:g,getStylePromptFromPreset:f,getThemeNameFromStylePrompt:b,getPresetDisplayMetadata:x}=(({contextualTheme:e})=>{gX();let t=(0,ei.useAppSelector)(gY.selectAllThemes),i=(0,ei.useAppSelector)(eo.selectTheme),n=e||i,a=!!(0,ei.useAppSelector)(ea.selectDoc),r=(0,F.useMemo)(()=>Object.values(gQ.StylePresetCategories).map(e=>({title:e,presets:gQ.STYLE_PRESETS.filter(t=>t.category===e&&!t.hidden&&(a||t.stylePreset!==gQ.StylePresetIds.Custom))})),[a]),o=(0,F.useCallback)(e=>Object.values(gQ.StylePresetIds).includes(e),[]),s=(0,F.useCallback)(e=>o(e)&&o(e)&&gQ.STYLE_PRESETS.find(t=>t.stylePreset===e)?.stylePrompt||"",[o]),l=(0,F.useCallback)((e,t)=>o(e)?e===gQ.StylePresetIds.Theme?n?.config?.stylePrompt||"":e===gQ.StylePresetIds.Custom?t:s(e):"",[o,s,n?.config?.stylePrompt]),d=(0,F.useCallback)(e=>gQ.STYLE_PRESETS.find(t=>t.stylePreset===e),[]);return{stylePresetOptions:r,getStylePromptFromPreset:l,getThemeNameFromStylePrompt:(0,F.useCallback)(e=>t.find(t=>t.config.stylePrompt===e)?.name||"",[t]),getPresetDisplayMetadata:d,getPredefinedStylePrompt:s}})({contextualTheme:e}),{prompt:y,addPrompt:v,promptPageInfo:C,nextPrompt:w,prevPrompt:S}=g$(),[k,A]=(0,F.useState)(()=>!!a&&(i?i.modelAutoselect??!1:p?.modelAutoselect??!1)),E=(0,F.useCallback)(()=>{A(!0)},[]),[_,I]=(0,F.useState)(i?.model??t?.model??s),M=(0,F.useCallback)(e=>{A(!1),I(e)},[]),T=(0,F.useCallback)(e=>{M(e),l(e)},[M,l]),[L,j]=(0,F.useState)(i?.stylePreset??t?.stylePreset??gQ.StylePresetIds.None),[P,D]=(0,F.useState)(f(L,t?.stylePrompt)),[N,R]=(0,F.useState)(i?.aspectRatio??(i?.height&&i?.width?(0,g0.getAspectRatio)({height:i.height,width:i.width}):void 0)??t?.aspectRatio??gJ.DEFAULT_ASPECT_RATIO),[O,B]=(0,F.useState)(()=>g4(i)?"custom":i?.artStylePreset&&i.artStylePreset in gQ.ART_STYLE_PRESETS?i.artStylePreset:t?.artStylePreset&&t.artStylePreset in gQ.ART_STYLE_PRESETS?t.artStylePreset:(0,gq.getDefaultArtStylePreset)()),[z,H]=(0,F.useState)(()=>"custom"===O?r&&void 0!==r.artStylePrompt?r.artStylePrompt:i&&!i.visualsMenuEnabled?i.stylePrompt||"":i?.artStylePrompt??t?.artStylePrompt??"":gQ.ART_STYLE_PRESETS[O].prompt),W=(0,F.useRef)(r?.artStylePrompt??("custom"===O?z:"")),[U,V]=(0,F.useState)(i?.styleReferenceImages??r?.styleReferenceImages??t?.styleReferenceImages??[]),G=(0,F.useRef)(r?.styleReferenceImages??U);(0,F.useEffect)(()=>{"custom"===O&&(W.current=z,G.current=U)},[O,z,U]);let $=(0,F.useCallback)(e=>{B(e),"custom"===e?(H(W.current),V(G.current),G.current.length>0&&!g2(_)&&E()):H(gQ.ART_STYLE_PRESETS[e].prompt)},[B,H,V,_,E]),[Z,K]=(0,F.useState)(i?.count??t?.count??3),q=(0,F.useMemo)(()=>{let e={stylePreset:L,stylePrompt:P};return a&&(e=d?{stylePreset:"Theme",stylePrompt:h}:{stylePreset:"None",stylePrompt:""}),{prompt:y,model:_,aspectRatio:N,count:Z,context:n,artStylePreset:O,artStylePrompt:z,styleReferenceImages:U,modelAutoselect:k,visualsMenuEnabled:a,...e}},[y,_,L,P,N,Z,n,O,z,U,a,d,h,k]),Y=gZ();(0,F.useEffect)(()=>{k||Y(_)||M(s)},[_,s,Y,M,k]);let X=(0,F.useCallback)((e,t)=>{if(R((0,g0.getImageAspectRatio)(e)),!e.aiParams)return;let{prompt:i,stylePreset:n,stylePrompt:a,styleReferenceImages:r,artStylePreset:o,artStylePrompt:s,visualsMenuEnabled:l}=e.aiParams,d=e.aiParams.model;if(i&&v(i,t),a&&D(a),n&&(j(n),c(n===gQ.StylePresetIds.Theme)),g4({visualsMenuEnabled:l,stylePreset:n}))B("custom"),H(a??""),V(r??[]);else if(o)("custom"===o||o in gQ.ART_STYLE_PRESETS)&&B(o),"custom"===o?H(s??""):o in gQ.ART_STYLE_PRESETS&&H(gQ.ART_STYLE_PRESETS[o].prompt),V(r??[]);else if(r?.length)V(r);else if("select"===t){let e=(0,gq.getDefaultArtStylePreset)();B(e),H(gQ.ART_STYLE_PRESETS[e].prompt),V([])}d&&d in uX&&(d=uX[d]),d&&Y(d)&&I(d)},[v,Y]),Q=(0,F.useCallback)(e=>{let{aiParams:i}=e,{model:n,stylePrompt:a,stylePreset:r,prompt:l,styleReferenceImages:d}=i??{};R((0,g0.getImageAspectRatio)(e)),M(n??t?.model??s),D(a??""),j(r??gQ.StylePresetIds.None),V(d??[]),v(o?e.query??"":l??"","load"),c(r===gQ.StylePresetIds.Theme)},[v,M,t?.model,s,o]),J=(0,F.useMemo)(()=>e=>!!e&&!!e.aiParams&&"stylePreset"in e.aiParams&&(y!==(o?e.query??"":e.aiParams.prompt)||_!==e.aiParams.model||N!==(0,g0.getImageAspectRatio)(e)||L!==e.aiParams.stylePreset||d!==(e.aiParams.stylePreset===gQ.StylePresetIds.Theme)),[N,_,L,y,d,o]);return{model:_,setModel:T,modelAutoselect:k,enableModelAutoselect:E,prompt:y,addPrompt:v,promptPageInfo:C,nextPrompt:w,prevPrompt:S,stylePrompt:P,setStylePrompt:D,stylePreset:L,setStylePreset:j,stylePresetOptions:g,getPresetDisplayMetadata:x,getThemeNameFromStylePrompt:b,getStylePromptFromPreset:f,aspectRatio:N,setAspectRatio:R,count:Z,setCount:K,imageGenerateConfig:q,loadImageAiParams:X,resetImageAiParams:Q,isPromptDirty:J,artStylePreset:O,setArtStylePreset:$,artStylePrompt:z,setCustomArtStylePrompt:H,styleReferenceImages:U,setStyleReferenceImages:V,shouldUseThemeColors:m?d:null,setShouldUseThemeColors:m?c:null}}],168982),e.s(["PromptSelector",0,({promptPageInfo:e,nextPrompt:t,prevPrompt:i,isDisabled:n,...a})=>(0,j.jsxs)(U.HStack,{spacing:1,...a,children:[(0,j.jsx)(ik.IconButton,{variant:"ghost",icon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faChevronLeft}),isDisabled:n||!e.canGoPrev,onClick:()=>i(),"aria-label":"left",color:"gray.700",size:"xs"}),(0,j.jsxs)(iS.Box,{as:"span",color:"gray.700",fontSize:"sm",children:[e.curr," / ",e.total]}),(0,j.jsx)(ik.IconButton,{variant:"ghost",icon:(0,j.jsx)(B.FontAwesomeIcon,{icon:c.faChevronRight}),color:"gray.700",isDisabled:n||!e.canGoNext,onClick:()=>t(),"aria-label":"left",size:"xs"})]})],778694);let g6={abstract_waves:{name:()=>d.i18n._({id:"RZZsvO",message:"Waves"}),previewImages:["https://static.gamma.app/images/style-references-sm/abstract_waves--thumb--0-68ba27eb.jpg","https://static.gamma.app/images/style-references-sm/abstract_waves--ref--0-cb3ac8dc.jpg","https://static.gamma.app/images/style-references-sm/abstract_waves--ref--1-b89f7d16.jpg","https://static.gamma.app/images/style-references-sm/abstract_waves--ref--2-b72754d2.jpg","https://static.gamma.app/images/style-references-sm/abstract_waves--ref--3-220d0ab3.jpg"]},abstract_liquid_glass:{name:()=>d.i18n._({id:"qANiKF",message:"Liquid glass"}),previewImages:["https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--thumb--0-8064adc1.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--0-90a1a905.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--1-73c2bace.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--2-9a1b3329.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--3-3e88b61b.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--4-6f2a8ba7.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--5-5e5344f9.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--6-55cec9cb.jpg","https://static.gamma.app/images/style-references-sm/abstract_liquid_glass--ref--7-6f36f761.jpg"]},abstract_mesh:{name:()=>d.i18n._({id:"TUrAyE",message:"Mesh"}),previewImages:["https://static.gamma.app/images/style-references-sm/abstract_mesh--thumb--0-a5c5a00e.jpg","https://static.gamma.app/images/style-references-sm/abstract_mesh--ref--0-ca461732.jpg","https://static.gamma.app/images/style-references-sm/abstract_mesh--ref--1-cc68b311.jpg","https://static.gamma.app/images/style-references-sm/abstract_mesh--ref--2-4fa1a29b.jpg","https://static.gamma.app/images/style-references-sm/abstract_mesh--ref--3-4a6e64df.jpg","https://static.gamma.app/images/style-references-sm/abstract_mesh--ref--4-09d1f451.jpg"]},abstract_paint_swirl:{name:()=>d.i18n._({id:"DMWzw/",message:"Paint swirl"}),previewImages:["https://static.gamma.app/images/style-references-sm/abstract_paint_swirl--thumb--0-68bb07ed.jpg","https://static.gamma.app/images/style-references-sm/abstract_paint_swirl--ref--0-477a335a.jpg","https://static.gamma.app/images/style-references-sm/abstract_paint_swirl--ref--1-b9b68c13.jpg","https://static.gamma.app/images/style-references-sm/abstract_paint_swirl--ref--2-deeab4c9.jpg","https://static.gamma.app/images/style-references-sm/abstract_paint_swirl--ref--3-6233d68d.jpg"]}},g9=new Set(Object.keys(g6));e.s(["ABSTRACT_STYLES",0,g6,"ABSTRACT_STYLE_KEYS",0,g9],733618);let g8=new Set(["gemini-2.5-flash-image","gemini-3-pro-image","gemini-3-pro-image-hd","gemini-3.1-flash-image-mini","gemini-3.1-flash-image","gemini-3.1-flash-image-hd","flux-1-schnell","flux-1-quick","flux-kontext-fast","flux-kontext-pro","flux-2-pro","flux-2-flex","flux-2-max","flux-2-klein","imagen-3-flash","imagen-4-fast","imagen-4-pro","imagen-4-ultra","ideogram-v3-turbo","ideogram-v3-flash","ideogram-v3","ideogram-v3-quality","ideogram-gamma-custom","gpt-image-1-mini-medium","gpt-image-1-medium","gpt-image-1-high","gpt-image-2-mini","gpt-image-2","gpt-image-2-hd","leonardo-phoenix","leonardo-sdxl-gamma-lora","leonardo-sdxl-mrpeepers-lora","recraft-v3","recraft-v4","recraft-v3-svg","recraft-v4-svg","recraft-v4-pro","luma-photon-1","luma-photon-flash-1","dall-e-3"]),g7=new Set(["gemini-3-pro-image","gemini-3-pro-image-hd","gemini-3.1-flash-image-mini","gemini-3.1-flash-image","gemini-3.1-flash-image-hd","flux-2-flex","gpt-image-1-high","gpt-image-2-mini","gpt-image-2","gpt-image-2-hd"]);e.s(["AI_IMAGE_SUPPORTED_MODELS",0,g8,"INFOGRAPHIC_SUPPORTED_MODELS",0,g7],312285),e.s(["useScrollToOnImageNodeLoad",0,e=>(0,F.useCallback)(t=>{if(!e)return;let i=e?.view.domAtPos(t);if(!i)return void console.warn("scrollOnImageLoad could not domAtPos",{pos:t});let n=i.node.childNodes[i.offset];if(!n||!n.querySelector)return void console.warn("scrollOnImageLoad could not find node",{parentNode:i.node,offset:i.offset});let a=n.querySelector("[data-image-node-element] img");if(!a)return void console.warn("scrollOnImageLoad could not find element");let r=()=>{e.chain().selectNodeAtPos(t,!1).focus().scrollIntoView().run(),setTimeout(()=>{e.chain().selectNodeAtPos(t,!1).focus().scrollIntoView().run()},1e3),a.removeEventListener("load",r)};a.addEventListener("load",r)},[e]),"useSetSize",0,()=>{let e=(0,F.useRef)(null),t=(0,F.useRef)(null),[i,n]=(0,F.useState)(0),[a,r]=(0,F.useState)(0),[o,s]=(0,F.useState)(null);return{width:i,height:a,aspectRatio:o,setSize:(0,F.useCallback)(()=>{let i=e.current?.getBoundingClientRect(),a=t.current?.getBoundingClientRect();if(i&&a){let e=a.width/a.height,t=i.width,o=i.width/e;if(0===t||isNaN(t)||0===o||isNaN(o))return;n(t),r(o),s(e)}},[]),containerWrapperRef:e,imageRef:t}}],571790);let fe={src:e.i(762412).default,width:927,height:847,blurWidth:8,blurHeight:7,blurDataURL:"data:image/webp;base64,UklGRl4BAABXRUJQVlA4TFEBAAAvB4ABEM1VICICHghADgIAAICp92SKAJQsExIAAAAAAAAAAAAAAAAAAAAAAWAACoCEAESMCJJU8jcAAAAPBMAGAQAA4Pw99p6/UPsBUpAAwIAoBAeKAAAAAAUAoAAAgAACAAAUAAAEAEBAJUTxQAByEAAAAM7/f/uCp0LGAIDYAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQICnZtq73QAZgEAAAAM5/CQoAAgCCAqAAQAAQQBAnAIAAQEAAAgQBAIAAQCAAAAEAAuCRPEla39uk3id7a9+oCx9tw0WgsR764tq8z40bx+wYlpTLCWvVVy4MXezXfO2OYKrtTWlD0fWoLd48ZbKrUDibN/aaTDQFCIkWtw5YKkFKfuRchy9yP3AY9Iz8UWAE0sBAV+x/zIE/KM9L9P8CIxDms0U1ljmdZNWzP9rlPM163/len+TAK0mPAA=="};e.s(["default",0,fe],326062),e.s(["getScrollbarWidth",0,()=>{let e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);let t=document.createElement("div");e.appendChild(t);let i=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),i}],546257);var ft=e.i(476116);class fi{observedElements=new Map;nextTickCallbacks=new Map;frameId=null;observer=null;constructor(){"u">typeof ResizeObserver&&(this.observer=new ResizeObserver(e=>this.handleResize(e)))}observe(e,t){this.observer?(this.observer.observe(e),this.observedElements.set(e,t)):t(fa)}unobserve(e){this.observer&&(this.observer.unobserve(e),this.observedElements.delete(e),this.nextTickCallbacks.delete(e))}handleResize(e){let t=!1;for(let i of e){let e=this.observedElements.get(i.target);e&&(t=!0,this.nextTickCallbacks.set(i.target,()=>{e(i.contentRect)}))}t&&this.queueProcess()}queueProcess(){this.frameId&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.frameId=requestAnimationFrame(()=>{for(let e of this.nextTickCallbacks.values())e();this.frameId=null})}}let fn=(0,ft.default)(()=>new fi),fa={width:1,height:1,top:0,left:0,fontSize:0};e.s(["useElementSize",0,function(e){let t=(0,F.useRef)(null),[{height:i,width:n},a]=(0,F.useState)(fa);return(0,F.useEffect)(()=>{let e=t.current;return e&&fn().observe(e,a),()=>{e&&fn().unobserve(e)}},[e]),{ref:t,width:n,height:i}},"useElementSizeAndOffset",0,function(e){let t=(0,F.useRef)(null),[{height:i,width:n,top:a,left:r,fontSize:o},s]=(0,F.useState)(fa);return(0,F.useEffect)(()=>{let e=t.current;return e&&fn().observe(e,t=>{s({width:t.width,height:t.height,top:e.offsetTop,left:e.offsetLeft,fontSize:parseFloat(window.getComputedStyle(e).fontSize)??16})}),()=>{e&&fn().unobserve(e)}},[e]),{ref:t,width:n,height:i,top:a,left:r,fontSize:o}}],292632);let fr=(0,q.createIcon)({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"});e.s(["CloseIcon",0,fr],746706)},543315,e=>{"use strict";e.s(["DEFAULT_RESIZE_STATE",0,{clipType:null,clipPath:null,clipAspectRatio:null,width:null},"NON_CLICKABLE_CLASSNAME",0,"non-clickable"])},264274,204319,339739,115664,45646,98155,274560,186003,435669,651261,72382,457626,170138,316276,146553,196277,289712,196427,e=>{"use strict";var t=e.i(391398),i=e.i(428683),n=e.i(613616),a=e.i(818315),r=e.i(96095),o=e.i(887527),s=e.i(358280),l=e.i(191788),d=e.i(326062),c=e.i(546257);e.i(615835);var u=e.i(25747),p=e.i(292632);e.i(905506);var h=e.i(267158),m=e.i(160396),g=e.i(746706),f=e.i(555145),b=e.i(344233),x=e.i(721455),y=e.i(148318),v=e.i(285042),C=e.i(704273),w=e.i(775493),S=e.i(588183),k=e.i(751827),A=e.i(935020),E=e.i(406112),_=e.i(524473),I=e.i(541075),M=e.i(408122),T=e.i(534904),L=e.i(949125),j=e.i(367792),P=e.i(543315);let D=async e=>{try{let t=e.split("/").pop();if(!t)throw Error("No filename found");let i=await fetch(`${j.config.API_HOST||""}/media/images/download`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":j.config.SHARE_TOKEN||""},body:JSON.stringify({url:e,filename:t})});if(!i.ok)throw Error("Download failed");let n=await i.blob(),a=window.URL.createObjectURL(n),r=document.createElement("a");r.href=a,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(a)}catch(e){console.error("Error downloading image:",e)}},N=async e=>{try{let t=await fetch(`${j.config.API_HOST||""}/media/images/download`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":j.config.SHARE_TOKEN||""},body:JSON.stringify({url:e,convertToPng:!0})});if(!t.ok)throw Error("Failed to fetch image for clipboard");let i=await t.blob();if(navigator.clipboard&&navigator.clipboard.write){let e=new ClipboardItem({[i.type]:i});await navigator.clipboard.write([e]),console.log("Image copied with Clipboard API successfully")}}catch(e){console.error("Error copying image to clipboard:",e)}};e.s(["copyImageToClipboard",0,N,"extractImageAttrs",0,e=>{let{id:t,resize:i,href:n,clickBehavior:a,horizontalAlign:r,...o}=e;return o},"extractImageAttrsFromBackground",0,e=>{let{backgroundPos:t,id:i,...n}=e;return n},"getCropAttrsFromResize",0,e=>{let{clipPath:t,clipType:i,clipAspectRatio:n}=e||{};return{clipPath:t||null,clipType:i||null,clipAspectRatio:n||null}},"getTargetImageAspectRatio",0,e=>{let t=e.parent;if(!t?.attrs)return"square";if("smartLayoutCell"===e.type&&"imagesText"===t.attrs.variantKey)return"landscape";if("cardAccentLayoutItem"===e.type){let e=t.attrs.layout;if("left"===e||"right"===e)return"portrait";if("top"===e)return"landscape"}return"gridCell"===t.type&&t.content?.length===1?"square":"landscape"},"hasFormattingApplied",0,e=>{let{resize:t}=e.attrs,{height:i,width:n}=t??{};return!(0,L.default)({resize:t},{resize:P.DEFAULT_RESIZE_STATE})&&null!=i&&null!=n},"normalizeSvg",0,e=>e.replace(/<(?!xlink:)([a-zA-Z0-9_-]+):/g,"<").replace(/<\/(?!xlink:)([a-zA-Z0-9_-]+):/g,"]*)\s+xmlns\s*=\s*(["'])[^"']*\2/g,"$1").replace(/{e.chain().resetImageClip().resetImageScale().command(({commands:e})=>!!e.refreshBubbleMenu?.()).run()},"saveImage",0,D,"setCardLayoutWithImageFromPos",0,({editor:e,cardPos:t,attrs:i,layout:n})=>{let a=e.chain().setCardLayoutWithImage(t,n,i).run();return a&&e.chain().deleteSelectionAndSelectNear().run(),a}],204319);var R=e.i(261442);e.i(144786);var O=e.i(849187),B=e.i(736386),z=e.i(180939);e.i(734710);var F=e.i(78387);let H=()=>{let e=(0,O.useFeatureFlag)("aiStyleReferenceUpsell"),t=(0,z.useCanUseProductFeature)("ai_style_reference"),{openUpsellModal:i}=(0,B.useMonetizationContext)();return{shouldShowUpsell:e&&!t,openUpsell:(0,l.useCallback)(()=>{i({targetFeature:"ai_style_reference",segmentEvent:F.SegmentEvents.GAMMA_PRO_UPSELL_CALLOUT_STYLE_REFERENCE,upsellLocation:"styleReference"})},[i]),canUseFeature:t}};e.s(["useStyleReferenceUpsell",0,H],339739);let W=({currentAttributes:e,deleteImage:n,showDelete:a=!0,onUseAsStyleReference:r,...o})=>{let[d,c]=(0,l.useState)(!1),{shouldShowUpsell:u,openUpsell:p}=H(),h=M.i18n._({id:"cnGeoo",message:"Delete"}),{isOpen:L,onOpen:j,onClose:P}=(0,E.useDisclosure)();return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Box,{...o,...d&&{display:"block"},children:(0,t.jsx)(f.HStack,{spacing:1,onClick:e=>e.stopPropagation(),children:(0,t.jsxs)(x.Menu,{isLazy:!0,onOpen:()=>c(!0),onClose:()=>c(!1),children:[(0,t.jsx)(y.MenuButton,{as:b.IconButton,"aria-label":"more actions",icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faEllipsisVertical}),size:"sm"}),(0,t.jsx)(A.Portal,{children:(0,t.jsxs)(C.MenuList,{zIndex:"modalPopover",children:[r&&(0,t.jsx)(v.MenuItem,{icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faPalette}),onClick:e=>{e.stopPropagation(),u?p():r()},children:(0,t.jsxs)(f.HStack,{width:"100%",justify:"space-between",children:[(0,t.jsx)(s.Trans,{message:"Use as style reference",id:"oeNSDW"}),(0,t.jsx)(T.UpsellProductBadge,{canUseFeature:!u,productFeature:"ai_style_reference"})]})}),(0,t.jsx)(v.MenuItem,{icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faArrowDownToBracket}),onClick:()=>D(e.src??""),children:(0,t.jsx)(s.Trans,{message:"Download image",id:"rs9UOr"})}),(0,t.jsx)(v.MenuItem,{icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faMagnifyingGlassPlus}),onClick:e=>{e.stopPropagation(),j()},children:(0,t.jsx)(s.Trans,{message:"Zoom in",id:"uCMbHN"})}),a&&n&&(0,t.jsx)(v.MenuItem,{icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faTrash}),color:"red.500",onClick:async t=>{t.stopPropagation(),await n(e.savedMediaId??"")},children:h})]})})]})})}),L&&(0,t.jsxs)(w.Modal,{isOpen:L,size:"6xl",onClose:P,isCentered:!0,children:[(0,t.jsx)(k.ModalOverlay,{bg:"blackAlpha.900"}),(0,t.jsxs)(S.ModalContent,{width:"fit-content",children:[(0,t.jsx)(i.Box,{position:"absolute",insetEnd:2,top:2,zIndex:"toast",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,t.jsx)(b.IconButton,{"aria-label":M.i18n._({id:"8qZ5De",message:"Close zoom"}),colorScheme:"gray",size:"md",onClick:P,onMouseDown:R.preventDefaultToAvoidBlur,icon:(0,t.jsx)(g.CloseIcon,{})})}),(0,t.jsx)(m.ImageOrVideo,{src:e.src??"",objectFit:"contain",rounded:"lg",maxH:"90vh",maxW:"90vw"})]})]})]})};e.s(["AIImageActions",0,W],115664);var U=e.i(743373),V=e.i(969641),G=e.i(349904),$=e.i(623184),Z=e.i(857051);e.i(828525);var K=e.i(896620);e.i(185340);var q=e.i(863750),Y=e.i(82050),X=e.i(418755);let Q=(0,l.memo)(({image:e,currentAttributes:n,onImageClick:o,resizeThumbnail:d,h:c,deleteImage:h,isDeleting:g,showQuickActions:f=!0,showAvatar:b=!0,onUseAsStyleReference:x})=>{let[y,v]=(0,l.useState)(!0),{user:C}=(0,u.useUserContext)(),w=(0,X.useAppSelector)(Y.selectDocEditors),S=w?.find(t=>t.user.id===e.userId),k=(0,l.useMemo)(()=>C?.id===e.userId,[C?.id,e.userId]),A=(0,l.useMemo)(()=>x&&e.attrs.src?()=>x(e.attrs.src):void 0,[x,e.attrs.src]),E=(0,l.useMemo)(()=>n?.savedMediaId===e.id,[n?.savedMediaId,e.id]),M=d?(0,m.resizeAndProxyImageUrl)(e.attrs.src,m.THUMBNAIL_RESIZE_JPG_PARAMS,e.attrs.meta):e.attrs.src,{ref:T,width:L}=(0,p.useElementSize)(),j=S&&w&&w.length>1&&b;return(0,t.jsx)(Z.GridItem,{children:(0,t.jsxs)(V.Button,{borderRadius:"base",display:"block",variant:"ghost",opacity:1,width:"100%",ref:T,height:"100%",minHeight:"0",textAlign:"left",pos:"relative",overflow:"hidden",p:0,_hover:{shadow:"outline"},_active:{shadow:"outline"},transition:"box-shadow .2s ease",cursor:"pointer",onClick:()=>o(e),sx:{_focusVisible:{".attribution-container":{opacity:1}},_hover:{".attribution-container":{opacity:1}}},isDisabled:g,"data-testid":"image-search-grid-item",role:"group",children:[(0,t.jsx)(a.Image,{w:"100%",h:c||"100%",src:M,borderRadius:"base",objectFit:"cover",onLoad:()=>v(!1)}),!y&&(0,t.jsx)($.Fade,{in:E,children:(0,t.jsx)(i.Box,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,t.jsx)(G.Center,{h:"100%",w:"100%",children:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faCheck})})})}),L>=125&&f&&(0,t.jsx)(W,{showDelete:k,currentAttributes:e.attrs,deleteImage:h,onUseAsStyleReference:A,position:"absolute",bottom:1,insetEnd:1,display:"none",_groupHover:{display:"block"}}),j&&(0,t.jsx)(K.GammaTooltip,{label:(0,t.jsx)(s.Trans,{message:"Generated by {0} {1}",id:"RMBnNX",values:{0:S.user.displayName,1:k?"(You)":""}}),placement:"top",children:(0,t.jsx)(U.Avatar,{size:"sm",src:S.user.profileImageUrl,name:S.user.displayName,position:"absolute",top:2.5,right:2.5,borderWidth:"2px",borderColor:"gray.200",_hover:{cursor:"pointer"}})}),e.type===q.MediaType.Video&&(0,t.jsx)(i.Box,{pointerEvents:"none",color:"white",position:"absolute",bottom:2,insetEnd:2,bg:"rgba(0,0,0,.6)",borderRadius:"base",px:2,py:1,children:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faFilm})}),!e.attrs.src&&(0,t.jsx)(Z.GridItem,{width:"100%",children:(0,t.jsx)(r.Skeleton,{height:"80px",borderRadius:"base"})})]})},e.id)});Q.displayName="AIImageHistoryItem";var J=e.i(335799),ee=e.i(306841),et=e.i(470645),ei=e.i(760853),en=e.i(24790),ea=e.i(216912);let er=(0,ea.forwardRef)(function(e,i){let{onClose:n}=(0,ei.usePopoverContext)(),a=(0,ei.usePopoverStyles)();return(0,t.jsx)(en.CloseButton,{size:"sm",onClick:n,className:(0,et.cx)("chakra-popover__close-btn",e.className),__css:a.closeButton,ref:i,...e})});er.displayName="PopoverCloseButton",e.s(["PopoverCloseButton",0,er],45646);var eo=e.i(882255),es=e.i(50034),el=e.i(918228),ed=e.i(550530),ec=e.i(620020),eu=e.i(277051),ep=e.i(7301),eh=e.i(283591);let em="25px";e.s(["CARD_DRAG_HANDLE_HEIGHT",0,em,"CARD_LAYOUT_CLASS",0,"card-layout","getDefaultBackgroundDisplayText",0,{accentImage:()=>M.i18n._({id:"YXjp37",message:"Try adding an image from this theme's accent image library or search Unsplash for inspiration. You can also upload your own image here."}),cardBackground:()=>M.i18n._({id:"VShVKA",message:"The page background will show up behind this card. You\n can change the page background using the theme button in\n the toolbar, or add a backdrop specific to this card."})}],98155);let eg=(e,t=!1)=>{let i={borderColor:e?"var(--chakra-colors-elevation-6)":"var(--chakra-colors-gray-200)"};if(!t)return{...i,color:e?"var(--chakra-colors-gray-50)":"var(--chakra-colors-gray-600)",bg:e?"var(--chakra-colors-elevation-3)":"var(--chakra-colors-white)",hoverBg:e?"var(--chakra-colors-elevation-4)":"var(--chakra-colors-gray-100)"};{let t=e?"var(--chakra-colors-elevation-6)":"var(--chakra-colors-blue-100)";return{...i,color:e?"var(--chakra-colors-blue-200)":"var(--chakra-colors-blue-950)",bg:t,hoverBg:t}}},ef=(e=!1)=>{let t=(0,eh.useIsThemeDark)();return(0,l.useMemo)(()=>((e,t=!1)=>t?eg(e,!0):{bg:"var(--global-drag-handle-background)",color:"var(--global-drag-handle-color)",hoverBg:"var(--global-drag-handle-hover-background)",borderColor:"var(--global-drag-handle-border)"})(t,e),[t,e])},eb=(e=!1)=>{let t=ef(e);return{height:em,borderRadius:"base",fontSize:"xs",px:2,shadow:"sm",bg:t.bg,color:t.color,borderColor:t.borderColor,_active:{shadow:"var(--global-drag-handle-shadow-inner)"},_hover:{background:t.hoverBg}}};e.s(["getGlobalHandleCSSVars",0,e=>{let t=eg(e);return{"--global-drag-handle-background":t.bg,"--global-drag-handle-color":t.color,"--global-drag-handle-hover-background":t.hoverBg,"--global-drag-handle-border":t.borderColor}},"useGetColorsForDragHandle",0,ef,"useGetStylesForHandleButtons",0,eb],274560);var ex=e.i(996651);e.i(843946),e.i(963912),s.Trans,_.faFrown,s.Trans,_.faMeh,s.Trans,_.faSmile;let ey=({label:e,isDark:i,isSelected:n})=>(0,t.jsx)(V.Button,{variant:"plain",size:"sm",height:"6",boxShadow:"none",bgGradient:"none",bg:n?i?"purple.500":"purple.100":i?"gray.700":"gray.50",color:n?i?"white":"purple.700":i?"white":"gray.700",borderColor:i?"whiteAlpha.200":"blackAlpha.200",_hover:{color:void 0},cursor:"pointer",children:e}),ev={bg:"red.100",_hover:{bg:"red.200"},borderColor:"red.600",color:"red.600"},eC={bg:"green.100",_hover:{bg:"green.200"},borderColor:"green.600",color:"green.600"},ew=({rating:e,setRating:i,RatingButtons:n,trackFeedback:a,feedbackTags:r,size:d})=>{let{isOpen:c,onOpen:u,onClose:p}=(0,E.useDisclosure)(),h=(0,l.useCallback)(e=>{i(e),u()},[i,u]),[m,g]=(0,l.useState)(""),[f,b]=(0,l.useState)(new Set),x=(0,l.useCallback)(()=>{g(""),b(new Set),p()},[p]),y=(0,ec.useToast)(),v=(0,l.useCallback)(()=>{a?.(e,eu.default.sanitize(m),Array.from(f)),y({title:(0,t.jsx)(s.Trans,{message:"Your feedback has been sent to the team",id:"+Rq0s/"}),status:"success",position:"top",duration:2e3,isClosable:!0}),x()},[m,f,e,a,y,x]);return(0,t.jsxs)(ee.Popover,{isOpen:c,onOpen:u,onClose:x,placement:"top",closeOnBlur:!0,isLazy:!0,variant:"modal",children:[(0,t.jsx)(es.PopoverTrigger,{children:(0,t.jsx)(n,{rating:e,setRating:h,size:d})}),(0,t.jsx)(A.Portal,{children:(0,t.jsxs)(eo.PopoverContent,{borderRadius:"lg",borderWidth:"1px",borderColor:"gray.200",shadow:"xl",p:3,"data-rating-popover":!0,children:[(0,t.jsx)(er,{}),(0,t.jsxs)(el.Stack,{alignItems:"flex-end",children:[(0,t.jsx)(o.Text,{alignSelf:"flex-start",fontSize:"sm",color:"gray.500",children:"good"===e?(0,t.jsx)(s.Trans,{message:"How did we do?",id:"uA8iBc"}):(0,t.jsx)(s.Trans,{message:"What went wrong?",id:"tq89gP"})}),e&&"good"!==e&&r&&r.length>0&&(0,t.jsx)(ed.Wrap,{children:r.map(({key:e,label:i})=>(0,t.jsx)(ed.WrapItem,{onClick:()=>{b(t=>{let i=new Set(t);return i.has(e)?i.delete(e):i.add(e),i})},children:(0,t.jsx)(ey,{label:i,isSelected:f.has(e)})},e))}),(0,t.jsx)(ep.ResizingTextarea,{initialHeight:"4em",value:m,onChange:e=>g(e.target.value),fontSize:"sm",placeholder:M.i18n._({id:"eYeGuP",message:"Optionally, tell us how we did"}),p:1,px:2,borderRadius:"0"}),(0,t.jsxs)(J.ButtonGroup,{size:"sm",children:[(0,t.jsx)(V.Button,{variant:"ghost",onClick:x,children:(0,t.jsx)(s.Trans,{message:"Skip",id:"6Uau97"})}),(0,t.jsx)(V.Button,{variant:"solid",onClick:v,children:(0,t.jsx)(s.Trans,{message:"Submit feedback",id:"1m41/U"})})]})]})]})})]})},eS=(0,ea.forwardRef)(({rating:e,setRating:i,size:n},a)=>{let r=eb();return(0,t.jsxs)(J.ButtonGroup,{spacing:0,p:0,isAttached:!0,ref:a,size:n,children:[(0,t.jsx)(K.GammaTooltip,{label:(0,t.jsx)(s.Trans,{message:"Poor suggestion",id:"kR82DG"}),placement:"top",children:(0,t.jsx)(b.IconButton,{...r,icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faThumbsDown}),"aria-label":M.i18n._({id:"kqV4i0",message:"Rate thumbs down"}),..."poor"===e?ev:{},onClick:()=>i("poor"),position:"relative",zIndex:+("poor"===e)})}),(0,t.jsx)(K.GammaTooltip,{label:(0,t.jsx)(s.Trans,{message:"Good suggestion",id:"y1GvbS"}),placement:"top",children:(0,t.jsx)(b.IconButton,{...r,icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faThumbsUp}),"aria-label":M.i18n._({id:"nnIO9F",message:"Rate thumbs up"}),position:"relative",insetStart:"-1px",..."good"===e?eC:{},onClick:()=>i("good")})})]})});eS.displayName="CardRatingButtons";let ek=(0,ea.forwardRef)(({rating:e,setRating:i,size:n="sm"},a)=>(0,t.jsxs)(J.ButtonGroup,{size:n,ref:a,"data-rating-buttons":!0,children:[(0,t.jsx)(K.GammaTooltip,{label:(0,t.jsx)(s.Trans,{message:"Poor suggestion",id:"kR82DG"}),placement:"top",children:(0,t.jsx)(b.IconButton,{"aria-label":"thumbs down",color:"poor"===e?"red.600":void 0,borderWidth:"1px",borderColor:"poor"===e?"red.600":"transparent",bg:"poor"===e?"red.100":void 0,_hover:{bg:"poor"===e?"red.200":"red.100"},icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faThumbsDown}),onClick:e=>{e.stopPropagation(),i("poor")}})}),(0,t.jsx)(K.GammaTooltip,{label:(0,t.jsx)(s.Trans,{message:"Good suggestion",id:"y1GvbS"}),placement:"top",children:(0,t.jsx)(b.IconButton,{"aria-label":"thumbs up",color:"good"===e?"green.600":void 0,borderWidth:"1px",borderColor:"good"===e?"green.600":"transparent",bg:"good"===e?"green.100":void 0,_hover:{bg:"good"===e?"green.200":"green.100"},icon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faThumbsUp}),onClick:e=>{e.stopPropagation(),i("good")}})})]}));ek.displayName="ImageRatingButtons",e.s(["CardRatingButtons",0,eS,"ImageRatingButtons",0,ek,"ThumbsRating",0,ew],186003);var eA=e.i(929508);let eE=(0,l.memo)(({attrs:e,onRateImage:n})=>{let a=e.aiParams?.interactionId,[r,o]=(0,l.useState)(null);(0,l.useEffect)(()=>{e.savedMediaId&&o(null)},[e.savedMediaId]);let s=(0,l.useCallback)((t,i,n)=>{e.aiParams?.interactionId&&(0,eA.trackAIIImageFeedback)({feedback:i,rating:t,tags:n,aiParams:e.aiParams,imageUrl:e.src,interactionId:e.aiParams.interactionId,savedMediaId:e.savedMediaId})},[e]),d=(0,l.useCallback)(e=>{o(e),n(e)},[n]);return a?(0,t.jsx)(i.Box,{position:"absolute",bottom:2,zIndex:"sticky",right:2,children:(0,t.jsx)(ew,{trackFeedback:s,rating:r||void 0,setRating:d,RatingButtons:ek,feedbackTags:e_},e.savedMediaId)}):null});eE.displayName="AIImageRating";let e_=[{key:"bad-people",label:(0,t.jsx)(s.Trans,{message:"Hands and faces",id:"eft1Pc"})},{key:"bad-text",label:(0,t.jsx)(s.Trans,{message:"Text problems",id:"BNmAIN"})},{key:"didnt-follow-prompt",label:(0,t.jsx)(s.Trans,{message:"Didn't follow prompt",id:"Tq32Jp"})},{key:"wrong-colors",label:(0,t.jsx)(s.Trans,{message:"Wrong colors",id:"Lx0mWG"})},{key:"wrong-style",label:(0,t.jsx)(s.Trans,{message:"Wrong style",id:"HG712W"})},{key:"low-res",label:(0,t.jsx)(s.Trans,{message:"Low resolution",id:"i6Gj9B"})},{key:"inappropriate",label:(0,t.jsx)(s.Trans,{message:"Inappropriate",id:"i/9pR4"})}];var eI=e.i(794251),eM=e.i(185635);let eT=e=>{let t=e?.meta?.width??1,i=e?.meta?.height??1;return t>i?"landscape":i>t?"portrait":"square"},eL=(0,l.memo)(({height:e})=>(0,t.jsx)(i.Box,{bg:"gray.50",w:"100%",h:e,p:5,borderRadius:"lg",border:"1px solid",borderColor:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",children:(0,t.jsxs)(n.Flex,{alignItems:"center",justifyContent:"center",direction:"column",textAlign:"center",children:[(0,t.jsx)(a.Image,{alt:"",src:d.default.src,height:"128px",mb:3}),(0,t.jsx)(o.Text,{fontSize:"xl",fontWeight:"bold",mb:1,color:"blue.950",children:(0,t.jsx)(s.Trans,{message:"Create images with AI",id:"MK/c3O"})}),(0,t.jsx)(o.Text,{fontSize:"sm",color:"gray.600",children:(0,t.jsx)(s.Trans,{message:"Describe what you want to see with a prompt below",id:"ztxdaf"})})]})}));eL.displayName="EmptyState",e.s(["AIImageCarousel",0,({imagesMatchingInteractionId:e,currentAttributes:i,isGenerating:a,isDeleting:o,selectedSavedMediaId:s,selectImage:d,onRateImage:g,deleteImage:f,canShowEmptyState:b,canShowPreviewImage:x})=>{let y,{user:v}=(0,u.useUserContext)(),[C,w]=(0,l.useState)({wA:0,hA:0,wBCD:0,hBCD:0}),S=(0,l.useMemo)(()=>(0,c.getScrollbarWidth)(),[]),{ref:k,width:A}=(0,p.useElementSize)(),E=(0,l.useMemo)(()=>!!a||!!e&&!(e.length<=1)&&!(e=>{if(e.length<=1)return!1;let t=eT(e[0]);return e.some(e=>eT(e)!==t)})([...e.map(e=>e.attrs),i]),[a,e,i]),_=(0,l.useMemo)(()=>{let t=e?.length>0,i=t?e.find(e=>e.id===s):null,n=i?.userId===v?.id;return t&&n},[e,s,v]),I=E?100/3:0;(0,h.useEffectWhen)(()=>{if(a||b||i?.meta?.width&&i?.meta?.height){let t=(({vpWidth:e,gap:t,ratioW:i,ratioH:n,thumbCount:a})=>{let r=i/n,o=r>eI.ASPECT_RATIOS.square?eI.ASPECT_RATIOS.landscape:r=S||Math.abs(t.hA-C.hA)>=S||Math.abs(t.wBCD-C.wBCD)>=S||Math.abs(t.hBCD-C.hBCD)>=S)&&w(t)}},[i,e,A,C,S,a,b],[i,e,A,a]);let M=a||!!i.src||b,T=a||!b||i.src&&(0,eM.providerUsesAIImagePanel)(i.source)?C.hA:250;return a?y=(0,t.jsx)(r.Skeleton,{w:"100%",h:T}):x&&i.src&&(0,eM.providerUsesAIImagePanel)(i.source)?y=(0,t.jsx)(m.ImageOrVideo,{h:C.hA,w:"100%",objectFit:E?"cover":"contain",src:i.src||void 0,fallbackSrc:i.tempUrl||void 0,alt:"",borderRadius:"md"}):b&&(y=(0,t.jsx)(eL,{height:T})),(0,t.jsx)(n.Flex,{dir:"row",w:"100%",ref:k,overflow:"hidden",alignItems:"center",justifyContent:"center",gap:"8px",children:M&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(n.Flex,{justifyContent:"center",position:"relative",overflow:"hidden",h:T,w:`${100-I}%`,children:[y,!a&&i.src&&(0,t.jsx)(W,{currentAttributes:i,position:"absolute",bottom:2,zIndex:"sticky",left:2,deleteImage:f,showDelete:_}),!a&&i.src&&(0,t.jsx)(eE,{attrs:i,onRateImage:g})]}),E&&(0,t.jsx)(n.Flex,{alignItems:"center",justifyContent:"center",direction:"column",overflow:"hidden",gap:"8px",h:C.hA,borderRadius:"base",children:a?Array.from({length:3},(e,i)=>(0,t.jsx)(r.Skeleton,{w:C.wBCD,h:C.hBCD},i)):(0,t.jsx)(t.Fragment,{children:e.slice(0,3).map(e=>(0,t.jsx)(Q,{image:e,currentAttributes:i,onImageClick:d,resizeThumbnail:!0,deleteImage:f,isDeleting:o,h:`${C.hBCD}px`,showQuickActions:!1,showAvatar:!1},e.id))})})]})})}],264274);var ej=e.i(147349),eP=e.i(103104);e.s(["AIImageEnhanceButton",0,({isEnhancingPrompt:e,isGenerating:i,runEnhancePrompt:n})=>(0,t.jsx)(f.HStack,{position:"absolute",bottom:2,right:2,children:(0,t.jsx)(K.GammaTooltip,{placement:"top",label:(0,t.jsx)(s.Trans,{message:"{GAMMA_PROPER_NOUN} will use your card content to enhance your existing prompt or write a new one for you",id:"LwcIt2",values:{GAMMA_PROPER_NOUN:eP.GAMMA_PROPER_NOUN}}),children:(0,t.jsx)(V.Button,{variant:"ghost",rightIcon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faMagicWandSparkles}),isLoading:e,isDisabled:i,"aria-label":M.i18n._({id:"eoAiXB",message:"Enhance prompt"}),onClick:n,zIndex:"sticky",size:"sm",loadingText:M.i18n._({id:"6xU0OU",message:"Enhancing..."}),spinner:(0,t.jsx)(ej.Spinner,{size:"sm",right:2,alignSelf:"flex-end"}),spinnerPlacement:"end",children:(0,t.jsx)(s.Trans,{message:"Enhance prompt",id:"Uehxdq"})})})})],435669);var eD=e.i(941394);let eN=({onSelectImage:e,currentAttributes:a,resizeThumbnails:r,history:d,canLoadMore:c,loadMore:u,isLoadingMore:p,isDeleting:h,deleteImage:m,helpText:g,onUseAsStyleReference:f})=>{let b=l.default.useMemo(()=>d.map(n=>n.attrs?(0,t.jsx)(i.Box,{position:"relative",children:(0,t.jsx)(Q,{image:n,deleteImage:m,isDeleting:h,currentAttributes:a,onImageClick:e,resizeThumbnail:r,showQuickActions:!0,onUseAsStyleReference:f})},n.id):(console.log("Image is missing attrs",n),null)),[d,m,h,a,e,r,f]);return(0,t.jsxs)(n.Flex,{direction:"column",align:"stretch",children:[g&&(0,t.jsx)(o.Text,{fontSize:"xs",color:"gray.500",mb:4,children:g}),(0,t.jsx)(eD.default,{columnsCount:3,gutter:"0.5rem",children:b}),c&&(0,t.jsx)(V.Button,{variant:"plain",onClick:u,mt:4,isLoading:p,children:(0,t.jsx)(s.Trans,{message:"Load more",id:"yQ2kGp"})})]})};e.s(["AIImageHistory",0,eN],651261);var eR=e.i(865786),eO=e.i(878726),eB=e.i(260241),ez=e.i(480801),eF=e.i(595995),eH=e.i(654656),eW=t,eU=e.i(676828),eV=e.i(641295),eG=e.i(707065),e$=s;let eZ={src:e.i(816270).default,width:552,height:721,blurWidth:6,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAICAYAAADaxo44AAAA00lEQVR42gHIADf/AElxTgdvf2hZaJBwtoOLfLljdXRjSHBPCQBof2lQv5aX6Vmedf+kk4//iXWn7lprbFoAkI6Hpc2Ynf9PnXH/qo2P/4lwrP9zZIiwAIuNhqPGmJz/Vpp0/6iFj/9+aaz/eWKFrgBqfmpUrZeX8W6XfP+ce4//c2Kl9WhnaWAATXJQDH2IepGJlIb6hXCS/Wpjg6NNblAQAEdwTABOc1ITfnpql3FmdrRPbVYfR3BMAABHcEwAR3BMAF9uUjNpaldXR3BMAEdwTACrg13ngyOCiAAAAABJRU5ErkJggg=="},eK={src:e.i(159004).default,width:1227,height:560,blurWidth:8,blurHeight:4,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAYAAACzzX7wAAAAj0lEQVR42gGEAHv/AEdwTABUeVgVhJ2FY5Wol4TU1tDppbajlVyAYCJHcEwAAGSFaDKksqem2NnW+NnY1/vh4Nz/5OTc+bzHuLhggmMnALK6udLFxs3+y8vR/8/P0//V1db/4uHd/+bl3v3Ezb/GAK+2uda/wcn5v8HK+MDCyvjDxMz5ysrP+9XV1fvN08ra5Mxa1yzEmAEAAAAASUVORK5CYII="},eq=eG.keyframes` 0% { transform: translateY(0); } 50% { transform: translateY(-5%); } 100% { transform: translateY(0); } `,eY=eG.keyframes` 0% { transform: translateY(0%) translateX(0%); } 25% { transform: translateY(-7%) translateX(5%); } 50% { transform: translateY(-3%) translateX(-5%); } 75% { transform: translateY(5%) translateX(-3%); } 100% { transform: translateY(0%) translateX(0%); } `,eX=({containerSize:e})=>(0,eW.jsxs)(i.Box,{position:"relative",overflow:"visible",w:e,h:e,isolation:"isolate",children:[(0,eW.jsx)(a.Image,{position:"absolute",top:"22%",left:0,width:"50%",src:eK.src,alt:"Upper cloud",animation:`${eY} 12s ease-in-out infinite`,pointerEvents:"none",zIndex:2}),(0,eW.jsx)(a.Image,{position:"absolute",inset:0,margin:"auto",height:"80%",src:eZ.src,alt:"Balloon",animation:`${eq} 5s ease-in-out infinite`,pointerEvents:"none",zIndex:1}),(0,eW.jsx)(a.Image,{position:"absolute",bottom:0,right:0,width:"80%",src:eK.src,alt:"Lower cloud",animation:`${eY} 16s ease-in-out 1s infinite`,pointerEvents:"none",zIndex:0})]}),eQ={xs:{imageWidth:"100px",headingSize:"sm",textSize:"sm",buttonSize:"sm",spacing:2},sm:{imageWidth:"140px",headingSize:"md",textSize:"sm",buttonSize:"sm",spacing:2},md:{imageWidth:"180px",headingSize:"lg",textSize:"md",buttonSize:"md",spacing:4},lg:{imageWidth:"256px",headingSize:"xl",textSize:"md",buttonSize:"md",spacing:6}},eJ=(0,l.memo)(({children:e,title:t=(0,eW.jsx)(e$.Trans,{message:"There's nothing here yet",id:"WkU8TI"}),description:i,size:n,alternateVisual:a,primaryActionLabel:r,onPrimaryAction:s,secondaryActionLabel:l,onSecondaryAction:d,primaryButtonProps:c,secondaryButtonProps:u})=>{let p=(0,eV.useBreakpointValue)({base:"md",lg:"lg"})||"lg",h=eQ[n||p];return(0,eW.jsxs)(eH.VStack,{spacing:h.spacing,w:"100%",children:[a||(0,eW.jsx)(eX,{containerSize:h.imageWidth}),(0,eW.jsxs)(eH.VStack,{spacing:2,children:[(0,eW.jsx)(eU.Heading,{textAlign:"center",size:h.headingSize,css:{textWrap:"balance"},children:t}),(0,eW.jsx)(o.Text,{fontSize:h.textSize,textAlign:"center",children:i})]}),e,(0,eW.jsxs)(f.HStack,{wrap:"wrap",justifyContent:"center",children:[r&&(0,eW.jsx)(V.Button,{onClick:s,size:h.buttonSize,variant:l?"solid":"plain",...c,children:r}),l&&(0,eW.jsx)(V.Button,{onClick:d,size:h.buttonSize,...u,children:l})]})]})});e.s(["EmptyState",0,eJ],72382);let e0={originalTitle:(0,t.jsx)(s.Trans,{message:"There's nothing here yet.",id:"0oUc2U"}),title:(0,t.jsx)(s.Trans,{message:"This space is your blank canvas",id:"0MyRmc"}),description:(0,t.jsx)(s.Trans,{message:"Your AI images will appear here.",id:"s3XYLh"}),image:"https://cdn.gamma.app/zc87vhr30n8uf3n/9f0b4d71d10f4d388e50febe89bb1853/optimized/Sal-Chill-Cloud.svg"},e1=()=>(0,t.jsx)(eH.VStack,{spacing:6,children:(0,t.jsx)(eJ,{size:"md",title:e0.title,description:e0.description})}),e2=l.default.memo(()=>(0,t.jsx)(f.HStack,{spacing:"4",children:(0,t.jsx)(eD.default,{columnsCount:3,gutter:"0.5rem",children:[void 0,void 0,void 0].map((e,i)=>(0,t.jsx)(r.Skeleton,{height:{base:"125px",lg:"200px"},width:"100%"},i))})}));e2.displayName="AIImageHistorySkeleton",e.s(["AIImageHistoryTabs",0,({onSelectImage:e,savedMediaId:n,currentAttributes:a,scope:r,setScope:l,canLoadMore:d,loadMore:c,isLoading:u,isLoadingMore:p,history:h,deleteImage:m,isDeleting:g,onUseAsStyleReference:f})=>{let b=()=>u?(0,t.jsx)(e2,{}):0===h.length?(0,t.jsx)(i.Box,{mt:10,children:(0,t.jsx)(e1,{})}):(0,t.jsx)(eN,{onSelectImage:e,currentAttributes:a,savedMediaId:n,canLoadMore:d,loadMore:c,isLoadingMore:p,history:h,deleteImage:m,isDeleting:g,onUseAsStyleReference:f,helpText:"doc"===r?(0,t.jsx)(s.Trans,{message:"All images generated in this {GAMMA_ARTIFACT_PROPER_NOUN} by you and your collaborators",id:"uNPCE+",values:{GAMMA_ARTIFACT_PROPER_NOUN:eP.GAMMA_ARTIFACT_PROPER_NOUN}}):(0,t.jsx)(s.Trans,{message:"All images generated by you in this workspace",id:"+MrfBb"}),resizeThumbnails:!0});return(0,t.jsxs)(eF.Tabs,{size:"sm",variant:"soft-rounded",onChange:e=>{l&&l(1===e?"user":"doc")},isFitted:!0,children:[(0,t.jsxs)(eO.TabList,{children:[(0,t.jsx)(eR.Tab,{children:(0,t.jsx)(o.Text,{children:(0,t.jsx)(s.Trans,{message:"This {GAMMA_ARTIFACT_PROPER_NOUN}",id:"emHsgB",values:{GAMMA_ARTIFACT_PROPER_NOUN:eP.GAMMA_ARTIFACT_PROPER_NOUN}})})}),(0,t.jsx)(eR.Tab,{children:(0,t.jsx)(o.Text,{children:(0,t.jsx)(s.Trans,{message:"Your AI images",id:"4FBm2s"})})})]}),(0,t.jsxs)(ez.TabPanels,{children:[(0,t.jsx)(eB.TabPanel,{children:b()}),(0,t.jsx)(eB.TabPanel,{children:b()})]})]})}],457626);var e3=e.i(182895),e5=e.i(259658),e4=e.i(297391);let e6={square:_.faSquare,portrait:_.faRectangleVertical,landscape:_.faRectangleWide,portrait4x5:_.faRectangleVertical,portrait9x16:_.faRectangleVertical,landscape4x3:_.faRectangleWide,landscape16x9:_.faRectangleWide},e9={square:{short:"1:1",long:()=>M.i18n._({id:"1DA6ap",message:"Square"})},portrait:{short:"3:4",long:()=>M.i18n._({id:"3bV9gD",message:"Portrait"})},landscape:{short:"16:9",long:()=>M.i18n._({id:"XxIeKn",message:"Landscape"})},portrait4x5:{short:"4:5",long:()=>M.i18n._({id:"3bV9gD",message:"Portrait"})},portrait9x16:{short:"9:16",long:()=>M.i18n._({id:"3bV9gD",message:"Portrait"})},landscape4x3:{short:"4:3",long:()=>M.i18n._({id:"XxIeKn",message:"Landscape"})},landscape16x9:{short:"16:9",long:()=>"Landscape"}},e8=(0,l.memo)(({value:e,setValue:i,isDisabled:a,model:r,usePortal:s})=>{let l=(0,e4.getAspectRatiosForModelDropdown)(r),d=((e,t)=>{if(t.includes(e))return e;let i=e.startsWith("portrait")?"portrait":e.startsWith("landscape")?"landscape":e;return t.includes(i)?i:"square"})(e,l),c=(0,t.jsx)(C.MenuList,{maxH:"290px",overflowY:"auto",overflowX:"hidden",minW:"0",zIndex:s?"popover":void 0,children:(0,t.jsx)(e5.MenuOptionGroup,{value:d,type:"radio",onChange:e=>{i(e)},children:Object.values(l).map(e=>(0,t.jsx)(e3.MenuItemOption,{value:e,children:(0,t.jsxs)(f.HStack,{spacing:2,children:[(0,t.jsx)(n.Flex,{width:"24px",height:"24px",align:"center",justify:"center",children:(0,t.jsx)(I.FontAwesomeIcon,{icon:e6[e],fixedWidth:!0})}),(0,t.jsx)(o.Text,{as:"span",children:e9[e].short})]})},e))})});return(0,t.jsx)(ex.FormControl,{children:(0,t.jsxs)(x.Menu,{isLazy:!0,children:[(0,t.jsx)(y.MenuButton,{as:V.Button,variant:"plain",isDisabled:a,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faChevronDown}),boxShadow:"none",size:"sm",fontWeight:"normal",children:(0,t.jsxs)(f.HStack,{spacing:2,children:[(0,t.jsx)(n.Flex,{width:"24px",height:"24px",align:"center",justify:"center",children:(0,t.jsx)(I.FontAwesomeIcon,{icon:e6[d],fixedWidth:!0})}),(0,t.jsx)(o.Text,{as:"span",flex:1,children:e9[d].short})]})}),s?(0,t.jsx)(A.Portal,{children:c}):c]})})});e8.displayName="AspectRatioSelect",e.s(["AspectRatioSelect",0,e8],170138);let e7=(0,l.memo)(({value:e,setValue:i,isDisabled:n,model:a,credits:r,usePortal:s})=>{let d=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!a)return;let e=d.current,t="ultra"===(0,e4.getRequiredPlanForImageModel)(a);null===e&&t?i(1):null!==e&&"ultra"!==(0,e4.getRequiredPlanForImageModel)(e)&&t&&i(1),d.current=a},[a,i]);let c=(0,l.useMemo)(()=>{if(!a||null===r)return[1,2,3];let e=e4.IMAGE_GENERATE_MODELS[a];return"ultra"===(0,e4.getRequiredPlanForImageModel)(a)&&e?.cost?[1,2,3].filter(t=>{if(1===t)return!0;let i=e.cost*t;return r??0>=i}):[1,2,3]},[a,r]),u=(0,t.jsx)(C.MenuList,{minW:"0",zIndex:s?"popover":void 0,children:(0,t.jsx)(e5.MenuOptionGroup,{value:String(e),type:"radio",onChange:e=>{i(Number(Array.isArray(e)?e[0]:e))},children:c.map(e=>(0,t.jsx)(e3.MenuItemOption,{value:String(e),children:(0,t.jsx)(f.HStack,{spacing:2,children:(0,t.jsx)(o.Text,{as:"span",flex:1,children:e})})},e))})});return(0,t.jsx)(ex.FormControl,{children:(0,t.jsxs)(x.Menu,{isLazy:!0,matchWidth:!0,children:[(0,t.jsx)(y.MenuButton,{as:V.Button,variant:"plain",isDisabled:n,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faChevronDown}),boxShadow:"none",size:"sm",children:(0,t.jsxs)(f.HStack,{spacing:2,children:[(0,t.jsx)(I.FontAwesomeIcon,{icon:_.faImages,fixedWidth:!0}),(0,t.jsx)(o.Text,{as:"span",flex:1,children:e})]})}),s?(0,t.jsx)(A.Portal,{children:u}):u]})})});e7.displayName="CountSelect",e.s(["CountSelect",0,e7],316276);var te=e.i(352522);e.s(["useAsStyleReference",0,({styleReferenceImages:e,setStyleReferenceImages:t,artStylePreset:i,setArtStylePreset:n,model:a,modelAutoselect:r,enableModelAutoselect:o})=>{let s=(0,ec.useToast)();return(0,l.useCallback)(l=>{e.includes(l)?s({title:M.i18n._({id:"IsZsRo",message:"Already added this image as a style reference"}),status:"info",duration:3e3,isClosable:!0}):e.length>=te.MAX_STYLE_REFS_FOR_UI?s({title:M.i18n._({id:"EyNErx",message:"Maximum style references reached"}),status:"warning",duration:3e3,isClosable:!0}):("custom"!==i&&n("custom"),t(e=>[...e,l]),(0,te.supportsStyleReferences)(a)||r||o(),s({title:M.i18n._({id:"guYIZ8",message:"Style reference added"}),status:"success",duration:3e3,isClosable:!0}))},[e,i,n,t,a,r,o,s])}],146553);var tt=e.i(974994),ti=e.i(683989),tn=e.i(159080);let ta=tn.gql` mutation GenerateImageCard($input: GenerateImageCardInput!) { generateImageCard(input: $input) { id attrs workspaceId userId } } `,tr=tn.gql` mutation BeautifyCard($input: BeautifyCardInput!) { beautifyCard(input: $input) { id attrs workspaceId userId } } `;e.s(["BEAUTIFY_CARD_MUTATION",0,tr,"GENERATE_IMAGE_CARD_MUTATION",0,ta],196277);let to=async e=>{let{themeId:t,docId:i,traceparent:n}=e,a=t?{context:q.SavedMediaContext.Theme,themeId:e.themeId}:i?{context:q.SavedMediaContext.Doc,docId:e.docId}:{context:e.context},r={interactionId:e.interactionId,interface:"generate-image",streaming:!1,inputContent:e.prompt,docId:e.docId};(0,eA.trackAIRequestSent)(r);let o=performance.now();try{let t=(0,ti.getApolloClient)(),{data:i}=await t.mutate({mutation:ta,variables:{input:{workspaceId:e.workspaceId,model:e.model,prompt:e.prompt,count:e.count||1,aspectRatio:e.aspectRatio,...a,interactionId:e.interactionId,stylePrompt:e.stylePrompt,artStylePreset:e.artStylePreset,artStylePrompt:e.artStylePrompt,extractText:e.extractText}},context:{...(0,tt.getAiMediaGraphqlContext)(),headers:n?{"aijsx-traceparent":n}:void 0}});return(0,eA.trackAIRequestResponse)({...r,latency:performance.now()-o}),i?.generateImageCard||[]}catch(e){throw console.error("(caught) [AIGenerateImageCard] error:",e),(0,eA.trackAIRequestError)({...r,latency:performance.now()-o,errorName:"GenerateImageCardError",errorMessage:e.message,outputMessage:""}),e}};e.s(["fetchGenerateImageCard",0,to],289712);var ts=e.i(639243),tl=e.i(136234),td=e.i(486962),tc=e.i(295651),tu=e.i(551880),tp=e.i(897587);e.s(["useImageGenerate",0,({selectImage:e,savedMediaContext:t,generateImageInteraction:i,isImageCard:n})=>{let a,r=(0,X.useAppSelector)(Y.selectDocId),o=(0,X.useAppSelector)(tu.selectThemeId),s=(0,X.useAppSelector)(tc.selectEditingThemeId),d=(0,tp.useWorkspaceIdForAIImageContext)(t);"new"===s&&(s=void 0,a=q.SavedMediaContext.Theme);let[c,u]=(0,l.useState)(""),[p,h]=(0,l.useState)(!1),[m,g]=(0,l.useState)(!1),[f,b]=(0,l.useState)(""),[x,y]=(0,l.useState)(null);return{generate:(0,l.useCallback)(async t=>{let l=i.current.id,c=t.model;u(t.prompt),h(!0),g(!1),y(null),b("");let p={...t,aspectRatio:t.aspectRatio||"square",stylePreset:t.stylePreset||eI.StylePresetIds.Theme,stylePrompt:t.stylePrompt||"",docId:t.docId||r,themeId:t.themeId||s,context:t.context||a};try{let a;if(n)a=await to({interactionId:l,workspaceId:d,traceparent:i.current.traceparent,prompt:p.prompt,aspectRatio:p.aspectRatio,model:p.model,count:p.count,docId:p.docId,themeId:p.themeId,context:p.context,stylePrompt:p.stylePrompt,artStylePreset:p.artStylePreset,artStylePrompt:p.artStylePrompt});else if(p.styleReferenceKey&&d)a=await (0,ts.fetchGenerateStyledImage)({interactionId:l,workspaceId:d,traceparent:i.current.traceparent,prompt:p.prompt,count:p.count||1,aspectRatio:(0,tl.aspectRatioKeyToNumeric)(p.aspectRatio||"square"),styleReferenceKey:p.styleReferenceKey,docId:p.docId,themeId:p.themeId||o,modelOverride:t.styledImageModelOverride});else{let e=await (0,e4.fetchGenerateImage)({interactionId:l,workspaceId:d,traceparent:i.current.traceparent,interactionName:"generate-image",...p});if((0,td.isGenerateImagePlanRestriction)(e))throw Error(e.message);a=e}if(h(!1),0===a.length)throw Error("No images generated");let r=a[0]?.attrs?.aiParams?.model;c&&r&&c!==r&&y({requestedModel:c,actualModel:r}),a.length>0&&(e(a[0]),i.current.complete({result:{imageCount:a.length,images:a.map(e=>({imageUrl:e.attrs.src||"",savedMediaId:e.id}))}}))}catch(e){g(!0),b((0,e4.imageGenerateErrorMessage)(e)),h(!1)}h(!1)},[r,o,s,a,d,e,i,n]),isGenerating:p,hasError:m,errorMessage:f,searchQuery:c,fallbackInfo:x,resetFallbackInfo:(0,l.useCallback)(()=>{y(null)},[])}}],196427)},449068,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.renderStyleReferenceCatalog=i.isValidStyleReferenceKey=i.STYLE_CATEGORY_MAP=i.ALL_STYLE_KEYS=i.STYLE_REFERENCE_ENTRIES=i.STYLE_CATEGORIES=void 0,i.STYLE_CATEGORIES=["Scenic","Realistic","Minimal","Playful","Bold","Abstract"],i.STYLE_REFERENCE_ENTRIES=[{key:"narrative_illustration",category:"Scenic"},{key:"flat-corporate",category:"Minimal"},{key:"technical_line",category:"Minimal"},{key:"modern_editorial",category:"Scenic"},{key:"magazine_editorial_cutout",category:"Bold"},{key:"digital_collage",category:"Bold"},{key:"isometric",category:"Playful"},{key:"gouache_paint",category:"Playful"},{key:"spot_color_line_drawing",category:"Minimal"},{key:"doodle",category:"Playful"},{key:"bold_poster_design",category:"Bold"},{key:"continuous_line_art",category:"Minimal"},{key:"watercolor_neat",category:"Playful"},{key:"cutout_collage",category:"Bold"},{key:"bauhaus_photomontage",category:"Bold"},{key:"paper_cutout",category:"Playful"},{key:"felt_craft_illustration",category:"Playful"},{key:"foam_board_models",category:"Playful"},{key:"neon_glow",category:"Bold"},{key:"classic_photo",category:"Realistic"},{key:"cinematic_photo",category:"Realistic"},{key:"lifestyle_photo",category:"Realistic"},{key:"editorial_photo",category:"Realistic"},{key:"still_life_photo",category:"Realistic"},{key:"abstract_waves",category:"Abstract"},{key:"abstract_liquid_glass",category:"Abstract"},{key:"abstract_mesh",category:"Abstract"},{key:"abstract_paint_swirl",category:"Abstract"}],i.ALL_STYLE_KEYS=i.STYLE_REFERENCE_ENTRIES.map(e=>e.key),i.STYLE_CATEGORY_MAP=Object.fromEntries(i.STYLE_REFERENCE_ENTRIES.map(e=>[e.key,e.category])),i.isValidStyleReferenceKey=function(e){return e in i.STYLE_CATEGORY_MAP},i.renderStyleReferenceCatalog=function(){var e;let t=new Map;for(let{key:n,category:a}of i.STYLE_REFERENCE_ENTRIES){let i=null!=(e=t.get(a))?e:[];i.push(n),t.set(a,i)}let n=[];for(let e of i.STYLE_CATEGORIES){let i=t.get(e);i&&0!==i.length&&n.push(`- ${e}: ${i.join(", ")}`)}return n.join("\n")}},261697,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,a)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),a=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),a(e.r(449068),i)},771914,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"useIntersection",{enumerable:!0,get:function(){return l}});let n=e.r(191788),a=e.r(799604),r="function"==typeof IntersectionObserver,o=new Map,s=[];function l({rootRef:e,rootMargin:t,disabled:i}){let d=i||!r,[c,u]=(0,n.useState)(!1),p=(0,n.useRef)(null),h=(0,n.useCallback)(e=>{p.current=e},[]);return(0,n.useEffect)(()=>{if(r){if(d||c)return;let i=p.current;if(i&&i.tagName)return function(e,t,i){let{id:n,observer:a,elements:r}=function(e){let t,i={root:e.root||null,margin:e.rootMargin||""},n=s.find(e=>e.root===i.root&&e.margin===i.margin);if(n&&(t=o.get(n)))return t;let a=new Map;return t={id:i,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=a.get(e.target),i=e.isIntersecting||e.intersectionRatio>0;t&&i&&t(i)})},e),elements:a},s.push(i),o.set(i,t),t}(i);return r.set(e,t),a.observe(e),function(){if(r.delete(e),a.unobserve(e),0===r.size){a.disconnect(),o.delete(n);let e=s.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&s.splice(e,1)}}}(i,e=>e&&u(e),{root:e?.current,rootMargin:t})}else if(!c){let e=(0,a.requestIdleCallback)(()=>u(!0));return()=>(0,a.cancelIdleCallback)(e)}},[d,t,e,c,p.current]),[h,c,(0,n.useCallback)(()=>{u(!1)},[])]}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},468816,(e,t,i)=>{"use strict";function n(e,t){let i=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return I}});let n=e.r(731640),a=e.r(871650),r=e.r(391398),o=a._(e.r(191788)),s=a._(e.r(730943)),l=n._(e.r(280963)),d=e.r(215125),c=e.r(771914),u=e.r(813521),p=e.r(894470),h=e.r(270090),m=e.r(468816),g=e.r(420262);function f(e){return"/"===e[0]?e.slice(1):e}let b="function"==typeof s.preload,x={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1},y=new Set,v="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";"u"t>=e[0]*i),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof i||"fill"===n||"responsive"===n?{widths:e,kind:"w"}:{widths:[...new Set([i,2*i].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,a,n,o),c=l.length-1;return{sizes:o||"w"!==d?o:"100vw",srcSet:l.map((i,n)=>`${s({config:e,src:t,quality:r,width:i})} ${"w"===d?i:n+1}${d}`).join(", "),src:s({config:e,src:t,quality:r,width:l[c]})}}function k(e){return"number"==typeof e?e:"string"==typeof e?parseInt(e,10):void 0}function A(e){let t=e.config?.loader||"default",i=C.get(t);if(i)return i(e);throw Object.defineProperty(Error(`Unknown "loader" found in "next.config.js". Expected: ${d.VALID_LOADERS.join(", ")}. Received: ${t}`),"__NEXT_ERROR_CODE",{value:"E1026",enumerable:!1,configurable:!0})}function E(e,t,i,n,a,r){e&&e.src!==v&&e["data-loaded-src"]!==t&&(e["data-loaded-src"]=t,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentNode&&(y.add(t),"blur"===n&&r(!0),a?.current)){let{naturalWidth:t,naturalHeight:i}=e;a.current({naturalWidth:t,naturalHeight:i})}}))}let _=({imgAttributes:e,heightInt:t,widthInt:i,qualityInt:n,layout:a,className:s,imgStyle:l,blurStyle:d,isLazy:c,placeholder:u,loading:p,srcString:h,config:m,unoptimized:g,loader:f,onLoadingCompleteRef:b,setBlurComplete:x,setIntersection:y,onLoad:v,onError:C,isVisible:w,noscriptSizes:k,...A})=>(p=c?"lazy":p,(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{...A,...e,decoding:"async","data-nimg":a,className:s,style:{...l,...d},ref:(0,o.useCallback)(e=>{y(e),e?.complete&&E(e,h,a,u,b,x)},[y,h,a,u,b,x]),onLoad:e=>{E(e.currentTarget,h,a,u,b,x),v&&v(e)},onError:e=>{"blur"===u&&x(!0),C&&C(e)}}),(c||"blur"===u)&&(0,r.jsx)("noscript",{children:(0,r.jsx)("img",{...A,loading:p,decoding:"async","data-nimg":a,style:l,className:s,...S({config:m,src:h,unoptimized:g,layout:a,width:i,quality:n,sizes:k,loader:f})})})]}));function I({src:e,sizes:t,unoptimized:i=!1,priority:n=!1,loading:a,lazyRoot:s=null,lazyBoundary:h,className:m,quality:g,width:f,height:C,style:E,objectFit:M,objectPosition:T,onLoadingComplete:L,placeholder:j="empty",blurDataURL:P,...D}){var N;let R,O=(0,o.useContext)(u.ImageConfigContext),B=(0,o.useMemo)(()=>{let e=x||O||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),i=e.deviceSizes.sort((e,t)=>e-t),n=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:i,qualities:n,localPatterns:"u"{let{config:i,...n}=t;return e(n)}}delete D.loader}let H="";if("object"==typeof(N=e)&&(w(N)||void 0!==N.src)){let t=w(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(P=P||t.blurDataURL,H=t.src,(!z||"fill"!==z)&&(C=C||t.height,f=f||t.width,!t.height||!t.width))throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0})}e="string"==typeof e?e:H,(0,p.warnOnce)(`Image with src "${e}" is using next/legacy/image which is deprecated and will be removed in a future version of Next.js.`);let W=!n&&("lazy"===a||void 0===a);(e.startsWith("data:")||e.startsWith("blob:"))&&(i=!0,W=!1),"u">typeof window&&y.has(e)&&(W=!1),B.unoptimized&&(i=!0);let[U,V]=(0,o.useState)(!1),[G,$,Z]=(0,c.useIntersection)({rootRef:s,rootMargin:h||"200px",disabled:!W}),K=!W||$,q={boxSizing:"border-box",display:"block",overflow:"hidden",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},Y={boxSizing:"border-box",display:"block",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},X=!1,Q=k(f),J=k(C),ee=k(g),et=Object.assign({},E,{position:"absolute",top:0,left:0,bottom:0,right:0,boxSizing:"border-box",padding:0,border:"none",margin:"auto",display:"block",width:0,height:0,minWidth:"100%",maxWidth:"100%",minHeight:"100%",maxHeight:"100%",objectFit:M,objectPosition:T}),ei="blur"!==j||U?{}:{backgroundSize:M||"cover",backgroundPosition:T||"0% 0%",filter:"blur(20px)",backgroundImage:`url("${P}")`};if("fill"===z)q.display="block",q.position="absolute",q.top=0,q.left=0,q.bottom=0,q.right=0;else if(void 0!==Q&&void 0!==J){let e=J/Q,t=isNaN(e)?"100%":`${100*e}%`;"responsive"===z?(q.display="block",q.position="relative",X=!0,Y.paddingTop=t):"intrinsic"===z?(q.display="inline-block",q.position="relative",q.maxWidth="100%",X=!0,Y.maxWidth="100%",R=`data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20version=%271.1%27%20width=%27${Q}%27%20height=%27${J}%27/%3e`):"fixed"===z&&(q.display="inline-block",q.position="relative",q.width=Q,q.height=J)}let en={src:v,srcSet:void 0,sizes:void 0};K&&(en=S({config:B,src:e,unoptimized:i,layout:z,width:Q,quality:ee,sizes:t,loader:F}));let ea=e,er=b?void 0:{imageSrcSet:en.srcSet,imageSizes:en.sizes,crossOrigin:D.crossOrigin,referrerPolicy:D.referrerPolicy},eo="u"{es.current=L},[L]),eo(()=>{el.current!==e&&(Z(),el.current=e)},[Z,e]);let ed={isLazy:W,imgAttributes:en,heightInt:J,widthInt:Q,qualityInt:ee,layout:z,className:m,imgStyle:et,blurStyle:ei,loading:a,config:B,unoptimized:i,placeholder:j,loader:F,srcString:ea,onLoadingCompleteRef:es,setBlurComplete:V,setIntersection:G,isVisible:K,noscriptSizes:t,...D};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("span",{style:q,children:[X?(0,r.jsx)("span",{style:Y,children:R?(0,r.jsx)("img",{style:{display:"block",maxWidth:"100%",width:"initial",height:"initial",background:"none",opacity:1,border:0,margin:0,padding:0},alt:"","aria-hidden":!0,src:R}):null}):null,(0,r.jsx)(_,{...ed})]}),!b&&n?(0,r.jsx)(l.default,{children:(0,r.jsx)("link",{rel:"preload",as:"image",href:en.srcSet?void 0:en.src,...er},"__nimg-"+en.src+en.srcSet+en.sizes)}):null]})}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},80897,(e,t,i)=>{t.exports=e.r(235588)},117914,(e,t,i)=>{var n=e.r(483722),a=e.r(622986),r=e.r(35190),o=parseFloat,s=Math.min,l=Math.random;t.exports=function(e,t,i){if(i&&"boolean"!=typeof i&&a(e,t,i)&&(t=i=void 0),void 0===i&&("boolean"==typeof t?(i=t,t=void 0):"boolean"==typeof e&&(i=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=r(e),void 0===t?(t=e,e=0):t=r(t)),e>t){var d=e;e=t,t=d}if(i||e%1||t%1){var c=l();return s(e+c*(t-e+o("1e-"+((c+"").length-1))),t)}return n(e,t)}},102544,(e,t,i)=>{var n=e.r(291037),a=e.r(372285),r=Math.max;t.exports=function(e,t,i){var o=null==e?0:e.length;if(!o)return -1;var s=null==i?0:a(i);return s<0&&(s=r(o+s,0)),n(e,t,s)}},878917,486470,268236,138831,376210,412676,268496,828044,391303,988162,514791,812405,635273,698843,97660,572383,896678,e=>{"use strict";var t=e.i(391398),i=e.i(500425),n=e.i(408122);e.i(261991);var a=e.i(469305),r=e.i(52834),o=e.i(771732),s=e.i(999882),l=e.i(393243),d=e.i(872575),c=e.i(265585),u=e.i(383540),p=e.i(987541),h=e.i(556269),m=e.i(612099),g=e.i(167096),f=e.i(727055),b=e.i(996168),x=e.i(114661),y=e.i(308330),v=e.i(93163),C=e.i(76420),w=e.i(955508),S=e.i(72697),k=e.i(812865),A=e.i(268974),E=e.i(859569),_=e.i(787485),I=e.i(789697),M=e.i(917067),T=e.i(929963),L=e.i(872038),j=e.i(954364),P=e.i(333674),D=e.i(973077),N=e.i(96500),R=e.i(147455),O=e.i(829254),B=e.i(694656),z=e.i(288058),F=e.i(188439),H=e.i(68779),W=e.i(547119),U=e.i(586794),V=e.i(198672),G=e.i(98926),$=e.i(40317),Z=e.i(404529),K=e.i(531768),q=e.i(428683),Y=e.i(969641),X=e.i(555145),Q=e.i(382167),J=e.i(887527),ee=e.i(654656),et=e.i(524473),ei=e.i(541075);e.i(828525);var en=e.i(896620),ea=e.i(358280),er=e.i(191788),eo=e.i(162690),es=e.i(7301),el=e.i(973886),ed=e.i(802312),ec=e.i(324886),eu=e.i(929508);e.i(185340);var ep=e.i(863750),eh=e.i(606004),em=e.i(400722),eg=e.i(19988),ef=e.i(23917),eb=e.i(413399),ex=e.i(690310),ey=e.i(389928),ev=e.i(82050),eC=e.i(297391),ew=e.i(639243),eS=e.i(169039),ek=e.i(429693),eA=e.i(168982),eE=e.i(778694),e_=e.i(733618),eI=e.i(312285),eM=e.i(736386),eT=e.i(418755),eL=e.i(78387),ej=e.i(349324),eP=e.i(571790),eD=e.i(35585);e.i(905506);var eN=e.i(84723),eR=e.i(267158),eO=e.i(160396),eB=e.i(264274),ez=e.i(435669),eF=e.i(651261),eH=e.i(457626),eW=e.i(170138),eU=e.i(794251),eV=e.i(316276),eG=e.i(185635),e$=e.i(146553),eZ=e.i(196427),eK=e.i(330185),eq=e.i(620020),eY=e.i(462480),eX=e.i(305524),eQ=e.i(261442),eJ=e.i(466925);let e0=["image/*","application/pdf"],e1=({uploadFiles:e,acceptedMimeTypes:t=e0,onDragStateChange:i})=>{let n=(0,er.useRef)(null),a=(0,er.useCallback)(e=>e.dataTransfer.items&&Array.from(e.dataTransfer.items).some(e=>"file"===e.kind&&t.some(t=>t.endsWith("/*")?e.type.startsWith(t.replace("/*","/")):e.type===t)),[t]),r=(0,er.useCallback)(t=>{t.preventDefault(),n.current?.classList.remove(eJ.DRAGOVER_CLASS),i?.(!1),e(Array.from(t.dataTransfer.files))},[e,i]),o=(0,er.useCallback)(e=>{e.preventDefault(),n.current?.classList.remove(eJ.DRAGOVER_CLASS),i?.(!1)},[i]),s=(0,er.useCallback)(e=>{a(e)&&((0,eQ.preventDefaultToAllowDrop)(e),n.current?.classList.add(eJ.DRAGOVER_CLASS),i?.(!0))},[a,i]);return{ref:n,onDragLeave:o,onDragOver:s,onDrop:r}};e.s(["useFileUploadDragAndDrop",0,e1],486470);var e2=e.i(352522);e.i(615835);var e3=e.i(25747),e5=e.i(339739);let e4=(0,eY.customAlphabet)("1234567890abcdefghijklmnopqrstuvwxyz",16);var e6=e.i(897587),e9=e.i(613616),e8=e.i(996651),e7=e.i(216912),te=e.i(818315),tt=e.i(721455),ti=e.i(148318),tn=e.i(826480),ta=e.i(182895),tr=e.i(704273),to=e.i(259658),ts=e.i(306841),tl=e.i(470020),td=e.i(882255),tc=e.i(50034),tu=e.i(935020),tp=e.i(918228),th=e.i(641295),tm=e.i(244180),tg=e.i(575084),tf=e.i(865799);let tb={beta:{colorScheme:"purple",label:()=>n.i18n._({id:"YBt9YP",message:"Beta"})},new:{colorScheme:"green",label:()=>n.i18n._({id:"isRobC",message:"New"})}},tx=({badge:e,newUntil:i,...n})=>{if(!e||"new"===e&&i&&i{if(t===e)return!0;let i=eC.IMAGE_GENERATE_MODELS[t],n=i?.productFeature;return!n||(0,ty.getCanUseProductFeature)(n)})}e.s(["validateImageModelAccess",0,tv],138831),e.i(989619);var tw=e.i(534904),tS=e.i(842368);e.i(734710);var tk=e.i(256266),tA=e.i(530521),tE=e.i(548402);let t_=({numSegments:e,numFilledSegments:i,startColor:n,endColor:a})=>{let[r,o]=(0,tA.useToken)("colors",[n,a||n]);return(0,t.jsx)(e9.Flex,{gap:1,w:"full",alignItems:"center",children:Array.from({length:e}).map((n,a)=>{let s=a1?a/(e-1):0):"gray.200";return(0,t.jsx)(q.Box,{h:1.5,borderRadius:"sm",flex:1,bg:s,transition:"background 0.2s ease-in-out"},a)})})},tI={src:e.i(63899).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwBNL1KLYHmt1m2nJDgEEYyB/OuarXrW0YUKFLm+H+mf/9k="},tM={src:e.i(199147).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDAAjgiDTO8jMeTtHOOfw615ile8UjdxSXM2f/Z"},tT={src:e.i(860963).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDmYfDlhBbSEM7pIMEMoJUdcj3rmWLlzONtgdJWvc//2Q=="},tL={src:e.i(668503).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDMk0u1ZBzKMrhvmB3fpXlusmk0jV0IK7Z//9k="},tj={src:e.i(697473).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCo13+62AMHAJ3Z614aaaLi2z//2Q=="},tP={src:e.i(502397).default,width:500,height:283,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCne+MNVl003PnMspOwkN2xmuKLfLv1OqXLzbH/2Q=="},tD={src:e.i(272771).default,width:500,height:270,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwB66/qP2V3M2XU7Qxz0OO3TtXkxxFTkvfU63Rp89rH/2Q=="},tN={src:e.i(91947).default,width:500,height:270,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDNWyspIZIzY2wwc7hCua4OeSRF2f/Z"},tR={src:e.i(438021).default,width:500,height:270,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCjbRQtK4MEW3yiduwYzgV5N3ys3tof/9k="},tO={src:e.i(513689).default,width:2752,height:1536,blurWidth:8,blurHeight:4,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAIAAAA8r+mnAAAAb0lEQVR42gFkAJv/AKGAXpVoPbKRbs2rebOIT5hsM4VmM1w+HgCGVjaOYDKgbjqmeUuab0KvfTKdeCd6WCAAk0oqi1E2i10viWRKjGZGnW81cFEjcDUgAJ1ET6NQToVJKZFqKYhKNXFMMnc6L3AnHOY2JUy0vGhoAAAAAElFTkSuQmCC"},tB={src:e.i(576809).default,width:400,height:267,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDEuNauItNivNqGQsYzxjjr9K41Wqv7RXsqfL8J/9k="},tz={src:e.i(121877).default,width:500,height:333,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDAuPEN8DHcFgW2GP8ADrXCpS5N9TRpX2P/2Q=="},tF={src:e.i(650424).default,width:400,height:240,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCte+IZ7iNZmgjUbtm1eB061gqs1G9y3GN7WP/Z"},tH={src:e.i(773436).default,width:400,height:240,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwB7+J7n7Ss3kR4LGPZ2+tQq8+XmB4enflsf/9k="},tW={src:e.i(629181).default,width:400,height:240,blurWidth:8,blurHeight:5,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAFAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwC0fE9w8yXH2eIZby9nOOmc1Ht52bNHg6Tlyn//2Q=="},tU={src:e.i(991847).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDl11vRzp3kDQ03bc7t/Oav61O+yIWHg31P/9k="},tV={src:e.i(289743).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDmbPWo/wCzvISDc0gwTIFIx6dKqWKnG/OH1enOfNFWZ//Z"},tG={src:e.i(789055).default,width:500,height:273,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwBja3qH9kpJ9ofeWKltxzjGfWvN5pez36mv2j//2Q=="},t$={src:e.i(283474).default,width:500,height:273,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCnp/jXWoLEyRSxKVTYAIxjH0rklOTlds6YwgtEj//Z"},tZ={src:e.i(717072).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDjo761+yPEtoo2SgN8owxPQ8enP51CTUNS5te1SSP/2Q=="},tK={src:e.i(574186).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDffxrfFd2flXn7o5+teCsTUS1PU+rU5O1j/9k="},tq={src:e.i(294565).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDKHjvVHfymkfBUEYavClQaj8R63PDm+E//2Q=="},tY={src:e.i(145810).default,width:500,height:279,blurWidth:8,blurHeight:4,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAEAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCISt9nMvG7ft/DGa05ncVlY//Z"},tX={src:e.i(85363).default,width:1820,height:1024,blurWidth:0,blurHeight:0},tQ={"dall-e-3":tI,"flux-1-pro":tM,"flux-1-schnell":tL,"flux-1-ultra":tj,"flux-1-quick":tT,"flux-kontext-pro":tR,"flux-kontext-max":tN,"flux-kontext-fast":tD,"flux-2-pro":tP,"flux-2-flex":tP,"imagen-3-flash":tU,"imagen-3-pro":tV,"imagen-4-pro":tG,"imagen-4-ultra":t$,"leonardo-phoenix":tZ,"luma-photon-1":tK,"luma-photon-flash-1":tq,"recraft-v3":{src:e.i(387134).default,width:616,height:500,blurWidth:8,blurHeight:6,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAGAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwCKX4h67DHHKJgyNzgqAa4oTbk43Lcl0R//2Q=="},"recraft-v3-svg":tX,"gpt-image-1-medium":tz,"gpt-image-1-high":tB,"ideogram-v3-turbo":tH,"ideogram-v3":tW,"ideogram-v3-quality":tF,"gemini-2.5-flash-image":tO,"gemini-3-pro-image":tY,"gemini-3-pro-image-hd":tY,"gemini-3.1-flash-image-mini":tY,"gemini-3.1-flash-image":tY,"gemini-3.1-flash-image-hd":tY},tJ=(0,er.memo)(({model:e,currentWorkspacePlan:i,context:a})=>{let{label:r,creatorLabel:o,description:s,image:l,bestStyle:d,bestType:c,speed:u,cost:p,beforeDiscountCost:h}=e,m=tQ[e.model],g=o(),f=(0,eC.shouldShowCostForImageModel)(e.model,i,a);return(0,t.jsxs)(ee.VStack,{align:"stretch",p:4,spacing:4,children:[(0,t.jsxs)(q.Box,{position:"relative",children:[m&&(0,t.jsx)(te.Image,{src:m.src,alt:r(),borderRadius:"lg",objectFit:"cover",height:"140px",width:"250px"}),(0,t.jsx)(q.Box,{position:"absolute",backgroundColor:(0,tE.colorWithOpacity)("black",.4),bottom:2,left:2,p:1,borderRadius:"sm",children:(0,t.jsx)(J.Text,{color:"gray.50",fontSize:"xs",fontWeight:"medium",lineHeight:"normal",children:n.i18n._({id:"HmI5oK",message:"Example"})})})]}),(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:3,children:[(0,t.jsxs)(X.HStack,{spacing:2,align:"start",children:[(0,t.jsx)(te.Image,{src:l.src,w:"20px",h:"20px",objectFit:"contain"}),(0,t.jsxs)(ee.VStack,{align:"start",spacing:0,children:[(0,t.jsx)(J.Text,{fontWeight:"semibold",fontSize:"md",color:"gray.700",children:r()}),(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:"medium",children:(0,t.jsx)(ea.Trans,{message:"by {creatorLabelStr}",id:"Uno73V",values:{creatorLabelStr:g}})})]})]}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",fontWeight:"medium",children:s()}),(0,t.jsxs)(q.Box,{children:[(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.400",fontWeight:"semibold",mb:2,children:(0,t.jsx)(ea.Trans,{message:"Speed",id:"l9wI00"})}),(0,t.jsx)(t_,{numSegments:4,numFilledSegments:u,startColor:"blue.300",endColor:"blue.600"})]}),f&&(0,t.jsxs)(q.Box,{children:[(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.400",fontWeight:"semibold",children:(0,t.jsx)(ea.Trans,{message:"Cost",id:"I99Miw"})}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.600",children:(0,t.jsx)(ea.Trans,{message:"{cost} credits per image",id:"WAJRyK",values:{cost:p}})}),h&&(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",fontWeight:"medium",children:(0,t.jsx)(ea.Trans,{message:"{0}% promotional discount",id:"qch4N1",values:{0:Math.round((h-p)/h*100)}})})]}),(0,t.jsxs)(q.Box,{children:[(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.400",fontWeight:"semibold",mb:1,children:(0,t.jsx)(ea.Trans,{message:"Best for",id:"uvPTBJ"})}),(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:1,children:[(0,t.jsxs)(X.HStack,{spacing:2,children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faPaintbrushPencil,color:(0,tE.getCSSVarForChakraColor)("blue.400"),size:"xs",width:"0.625rem",height:"0.625rem"}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.600",fontWeight:"medium",children:d()})]}),(0,t.jsxs)(X.HStack,{spacing:2,children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faMeteor,color:(0,tE.getCSSVarForChakraColor)("blue.400"),size:"xs",width:"0.625rem",height:"0.625rem"}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.600",fontWeight:"medium",fontFamily:"body",children:c()})]})]})]})]})]})});tJ.displayName="AIImageModelPopover";let t0=({model:e,currentWorkspacePlan:i,context:n})=>{let a=(0,eC.shouldShowCostForImageModel)(e,i,n),r=(0,eC.getImageModelInfo)(e);return r.cost&&a?(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"{0, plural, one {This will cost # credit per image} other {This will cost # credits per image}}",id:"+ueQYz",values:{0:r.cost}}),children:(0,t.jsxs)(X.HStack,{spacing:1,children:[r.beforeDiscountCost&&(0,t.jsx)(J.Text,{fontSize:"xs",textDecoration:"line-through",color:"gray.500",marginInlineEnd:1,children:r.beforeDiscountCost}),(0,t.jsx)(J.Text,{fontSize:"xs",children:r.cost}),(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faSparkles,size:"xs"})]})}):null},t1=({model:e,currentWorkspacePlan:i,context:n})=>{let a=(0,eC.shouldShowCostForImageModel)(e,i,n),r=(0,eC.getImageModelInfo)(e);if(!r.cost||!a)return null;let o=r.cost;return(0,t.jsxs)(X.HStack,{spacing:1,children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faSparkles,size:"xs"}),(0,t.jsx)(J.Text,{fontSize:"xs",children:(0,t.jsx)(ea.Trans,{message:"{cost} per image",id:"Ch1TQJ",values:{cost:o}})})]})},t2=(0,e7.forwardRef)(({model:e,currentWorkspacePlan:i,isDisabled:n,disabledReason:a,context:r,...o},s)=>{let l=(0,er.createElement)(ta.MenuItemOption,{...o,ref:s,key:e.model,isDisabled:n,cursor:n?"default !important":"pointer"},(0,t.jsx)(e9.Flex,{justify:"space-between",align:{base:"flex-start",md:"center"},width:"100%",direction:{base:"column",md:"row"},children:(0,t.jsxs)(X.HStack,{spacing:4,align:"center",w:"100%",children:[(0,t.jsx)(te.Image,{src:e.image.src,w:"1.5em",h:"1.5em",objectFit:"contain",opacity:n?.5:1}),(0,t.jsxs)(tp.Stack,{spacing:0,direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},justify:"space-between",w:"100%",children:[(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(J.Text,{fontSize:"sm",color:n?"gray.400":void 0,children:e.label()}),(0,t.jsx)(tx,{badge:e.badge})]}),(0,t.jsx)(t0,{model:e.model,currentWorkspacePlan:i,context:r})]})]})}));return n&&a?(0,t.jsx)(tc.PopoverTrigger,{children:(0,t.jsx)(en.GammaTooltip,{label:a,children:l})}):(0,t.jsx)(tc.PopoverTrigger,{children:l})});t2.id="MenuItemOption";let t3=({productKey:e,productFeature:i,canUseTier:n,styles:a})=>(0,t.jsxs)(e9.Flex,{justify:"start",align:"center",width:"100%",children:[(0,t.jsx)(J.Text,{sx:{...a.groupTitle,marginInlineEnd:2},children:(0,tS.descriptionsForAiImageFunctionalityByProductKey)(e).header}),i&&(0,t.jsx)(tw.UpsellProductBadge,{canUseFeature:n,productFeature:i})]}),t5=({availableModels:e,handleModelSelect:i,canUsePlusModels:n,canUseProModels:a,canUseUltraModels:r,selectedModel:o,isDisabled:s,labelId:l,autoselect:d,currentWorkspacePlan:c,context:u,boxShadow:p="sm",hasStyleReferences:h})=>{let m=(0,th.useBreakpointValue)({base:!0,sm:!1}),[g,f]=(0,er.useState)(null),b=(0,tm.useMultiStyleConfig)("Menu",{}),{isUpsellModalOpen:x}=(0,eM.useMonetizationContext)(),y=({tier:t,filterFn:i,includeLegacy:n=!1})=>e.filter(e=>!t||(0,eC.getRequiredPlanForImageModel)(e.model)===t).filter(e=>!i||i(e)).filter(e=>!!n||!e.isLegacy).filter(e=>!h||(0,e2.supportsStyleReferences)(e.model)),v=y({tier:"free"}).length>0,C=y({tier:"plus"}).length>0,w=y({tier:"pro"}).length>0,S=y({tier:"ultra"}).length>0,k=y({filterFn:e=>e.isLegacy??!1,includeLegacy:!0}).length>0,A=({tier:e,filterFn:n,includeLegacy:a})=>y({tier:e,filterFn:n,includeLegacy:a}).map(n=>(0,t.jsx)(t2,{model:n,value:n.model,onClick:()=>i(n.model,e??(0,eC.getRequiredPlanForImageModel)(n.model)),onMouseEnter:()=>f(n),currentWorkspacePlan:c,isDisabled:!1,context:u},n.model));return(0,t.jsx)(e8.FormControl,{children:(0,t.jsxs)(tt.Menu,{isLazy:!0,matchWidth:!!m,children:[(0,t.jsx)(ti.MenuButton,{as:Y.Button,variant:"plain",isDisabled:s,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronDown}),boxShadow:p,size:"sm","aria-labelledby":l,children:(0,t.jsxs)(X.HStack,{spacing:2,justify:"space-between",width:"100%",overflow:"hidden",children:[(0,t.jsxs)(X.HStack,{spacing:2,minW:0,children:[(0,t.jsx)(e9.Flex,{width:"24px",height:"24px",align:"center",justify:"center",flexShrink:0,children:d?.isActive?(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles,size:"sm"}):(0,t.jsx)(te.Image,{src:o.image.src,w:"1.25em",h:"1.25em",objectFit:"contain"})}),(0,t.jsx)(J.Text,{as:"span",isTruncated:!0,children:d?.isActive?(0,t.jsx)(ea.Trans,{message:"Auto-select",id:"/iCiQU"}):o?.label()})]}),(0,t.jsx)(t1,{model:d?.isActive?d?.model:o.model,currentWorkspacePlan:c,context:u})]})}),(0,t.jsx)(tu.Portal,{children:!x&&(0,t.jsxs)(ts.Popover,{isLazy:!0,variant:"modal",placement:"start-start",matchWidth:!1,offset:[0,0],trigger:"hover",children:[(0,t.jsx)(tl.PopoverAnchor,{children:(0,t.jsx)(tr.MenuList,{minWidth:"250px",maxW:"100%",w:m?"100%":"400px",maxH:"350px",overflowY:"auto",overflowX:"hidden",zIndex:"modalPopover",border:"1px solid",borderColor:"gray.200",onMouseLeave:()=>f(null),children:(0,t.jsxs)(to.MenuOptionGroup,{type:"radio",value:d?.isActive?"auto-select":o.model,children:[(0,t.jsx)(e9.Flex,{justify:"start",align:"center",width:"100%",children:(0,t.jsx)(J.Text,{sx:{...b.groupTitle,marginInlineEnd:2},children:(0,t.jsx)(ea.Trans,{message:"Recommended",id:"WEYdDv"})})}),d&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(ta.MenuItemOption,{value:"auto-select",onClick:d.onChooseAutoselect,children:(0,t.jsx)(e9.Flex,{justify:"space-between",align:{base:"flex-start",md:"center"},width:"100%",direction:{base:"column",md:"row"},children:(0,t.jsxs)(X.HStack,{spacing:4,align:"center",w:"100%",children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles,size:"sm"}),(0,t.jsxs)(tp.Stack,{spacing:0,direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},justify:"space-between",w:"100%",children:[(0,t.jsx)(J.Text,{fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"Auto-select",id:"/iCiQU"})}),(0,t.jsx)(t0,{model:d?.model,currentWorkspacePlan:c,context:u})]})]})})})}),A({filterFn:e=>!(!e.isRecommended||tv(e.model)?.error)}),v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(t3,{productKey:"free",canUseTier:!0,styles:b}),A({tier:"free"})]}),C&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(t3,{productKey:"plus",productFeature:"ai_models_plus",canUseTier:n,styles:b}),A({tier:"plus"})]}),w&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(t3,{productKey:"pro",productFeature:"ai_premium_models",canUseTier:a,styles:b}),A({tier:"pro"})]}),S&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(t3,{productKey:"ultra",productFeature:"ai_models_ultra",canUseTier:r,styles:b}),A({tier:"ultra"})]}),k&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(e9.Flex,{justify:"start",align:"center",width:"100%",children:(0,t.jsx)(J.Text,{sx:{...b.groupTitle,marginInlineEnd:2},children:(0,t.jsx)(ea.Trans,{message:"Legacy",id:"Sn1jT8"})})}),A({filterFn:e=>e.isLegacy??!1,includeLegacy:!0})]})]})})}),!(0,tk.isMobileDevice)()&&g&&(0,t.jsx)(td.PopoverContent,{width:"282px",children:(0,t.jsx)(tJ,{model:g,currentWorkspacePlan:c,context:u})})]})})]})})},t4=({value:e,setValue:i,isDisabled:n,labelId:a,autoselect:r,modelFilter:o,boxShadow:s,hasStyleReferences:l,context:d})=>{let c=(0,eC.getImageModelInfo)(e),u=(0,ty.useCanUseProductFeature)("ai_models_plus"),p=(0,ty.useCanUseProductFeature)("ai_premium_models"),h=(0,ty.useCanUseProductFeature)("ai_models_ultra"),{openUpsellModal:m}=(0,eM.useMonetizationContext)(),g=(0,er.useCallback)((e,t)=>{let n=(0,eC.getImageModelInfo)(e);if(n.isTemporarilyFree);else if(n.productFeature&&!(0,ty.getCanUseProductFeature)(n.productFeature))return void m({segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_IMAGE_MODELS,eventProperties:{model:e,requiredProductKey:t},upsellLocation:"aiImageModels",targetFeature:n.productFeature});i(e)},[m,i]);(0,eR.useEffectWhen)(()=>{!(!o||!r||r?.isActive)&&(o({...c,model:e})||r.onChooseAutoselect())},[o,r,c,e],[o]);let f=(0,eT.useAppSelector)(eD.selectCurrentWorkspace),b=(0,tS.getProductForWorkspace)(f);return(0,t.jsx)(t5,{handleModelSelect:g,canUsePlusModels:u,canUseProModels:p,canUseUltraModels:h,availableModels:(0,eC.orderedImageModelInfos)().filter(e=>(0,eC.isImageModelAvailable)(e.model)).filter(e=>o?.(e)??!0),selectedModel:{...c,model:e},isDisabled:n,labelId:a,autoselect:r,currentWorkspacePlan:b,context:d,boxShadow:s,hasStyleReferences:l})};var t6=e.i(819197),t9=e.i(843946),t8=e.i(49202),t7=e.i(349904),ie=e.i(865639),it=e.i(963912),ii=e.i(227909),ia=e.i(641099),ir=e.i(979021),io=e.i(530280);let is=(0,er.memo)(({selectedPreset:e,onSelectPreset:i,columns:n})=>{var a;let r=(0,er.useRef)([[a=(0,io.getDefaultArtStylePreset)(),eU.ART_STYLE_PRESETS[a]],...Object.entries(eU.ART_STYLE_PRESETS).filter(([e])=>e!==a)]);return(0,t.jsx)(ia.SimpleGrid,{columns:n??{base:3,md:6},spacing:1,children:r.current.map(([n,{label:a,imageUrl:r}])=>(0,t.jsx)(il,{stylePreset:n,label:a,imageUrl:r,isSelected:n===e,onSelectPreset:i},n))})});is.displayName="ImageArtStyleGrid";let il=({stylePreset:e,label:i,imageUrl:n,isSelected:a,onSelectPreset:r})=>{let[o,s]=(0,er.useState)(!0),l=(0,er.useRef)(null);return(0,er.useEffect)(()=>{let e=(0,ir.default)(()=>{l.current&&s(l.current.scrollWidth>l.current.clientWidth)},200,{leading:!1,trailing:!0});return e(),window.addEventListener("resize",e),()=>{e.cancel(),window.removeEventListener("resize",e)}},[]),(0,t.jsx)(en.GammaTooltip,{label:i(),hasArrow:!0,placement:"bottom",isDisabled:!o,children:(0,t.jsx)(q.Box,{position:"relative",cursor:"pointer",onClick:()=>r(e),borderRadius:"md",borderColor:a?"blue.600":"transparent",borderWidth:2,overflow:"hidden",aspectRatio:"1/1",_hover:{"& img":{filter:"brightness(60%)",transition:"filter 0.3s ease-in-out"}},children:(0,t.jsxs)(q.Box,{children:[(0,t.jsxs)(q.Box,{position:"relative",children:[(0,t.jsx)(te.Image,{src:n,alt:i(),width:"100%",height:"100%",objectFit:"cover",draggable:!1}),(0,t.jsx)(q.Box,{position:"absolute",top:0,insetStart:0,insetEnd:0,bottom:0,background:"linear-gradient(to bottom, transparent 60%, rgba(0, 0, 0, 0.2) 70%, rgba(0, 0, 0, 0.55) 80%, rgba(0, 0, 0, 0.6) 100%)",pointerEvents:"none"})]}),(0,t.jsxs)(X.HStack,{position:"absolute",bottom:1,insetStart:2,insetEnd:2,spacing:1,children:[a&&(0,t.jsx)(ii.CheckIcon,{w:2,color:"white"}),(0,t.jsx)(J.Text,{fontSize:"2xs",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"white",ref:l,children:i()})]})]})},e)})};var id=e.i(344233),ic=e.i(147349),iu=e.i(198311);let ip=(0,iu.motion)(q.Box),ih=({src:e,alt:i,onRemove:a,isLoading:r=!1,isDisabled:o=!1,skipEntryAnimation:s=!1,boxSize:l="72px",borderColor:d="gray.200",borderWidth:c="1px"})=>(0,t.jsxs)(ip,{layout:!0,initial:!s&&{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},position:"relative",role:"group",flexShrink:0,children:[(0,t.jsx)(te.Image,{src:e,alt:i,boxSize:l,objectFit:"cover",borderRadius:"md",border:`${c} solid`,borderColor:o?"gray.300":d,opacity:r||o?.5:1,filter:o?"grayscale(100%)":void 0}),r&&(0,t.jsx)(q.Box,{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",children:(0,t.jsx)(ic.Spinner,{size:"sm",color:"blue.900"})}),!o&&(0,t.jsx)(id.IconButton,{opacity:+!!r,_groupHover:{opacity:1},transitionProperty:"common",transitionDuration:"normal",position:"absolute",top:"-6px",insetEnd:"-6px",size:"xs",borderRadius:"full",onClick:a,"aria-label":r?n.i18n._({id:"k99j0U",message:"Cancel upload"}):n.i18n._({id:"5ywtDz",message:"Remove image"}),icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faXmark})})]}),im={prefix:"fas",iconName:"image-circle-plus",icon:[640,640,[],"","M128 96C92.7 96 64 124.7 64 160L64 480C64 515.3 92.7 544 128 544L340 544C326.3 525 316 503.3 310 480L152 480C143.1 480 134.8 475 130.7 467.1C126.6 459.2 127.2 449.6 132.3 442.3L188.3 362.3C192.8 355.9 200.1 352.1 208 352.1C215.9 352.1 223.2 355.9 227.7 362.3L254.1 400.1L315.5 299.6C319.9 292.5 327.6 288.1 336 288.1C344.4 288.1 352.1 292.5 356.5 299.6L356.7 300C391.7 263.1 441.2 240.1 496 240.1C501.4 240.1 506.7 240.3 512 240.8L512 160C512 124.7 483.3 96 448 96L128 96zM192 176C218.5 176 240 197.5 240 224C240 250.5 218.5 272 192 272C165.5 272 144 250.5 144 224C144 197.5 165.5 176 192 176zM496 576C575.5 576 640 511.5 640 432C640 352.5 575.5 288 496 288C416.5 288 352 352.5 352 432C352 511.5 416.5 576 496 576zM512 368L512 416L560 416C568.8 416 576 423.2 576 432C576 440.8 568.8 448 560 448L512 448L512 496C512 504.8 504.8 512 496 512C487.2 512 480 504.8 480 496L480 448L432 448C423.2 448 416 440.8 416 432C416 423.2 423.2 416 432 416L480 416L480 368C480 359.2 487.2 352 496 352C504.8 352 512 359.2 512 368z"]},ig=({label:e,...i})=>(0,t.jsx)(Y.Button,{size:"sm",variant:"outline",borderRadius:"full",color:"blue.950",borderColor:"blue.100",leftIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:im,size:"xl"}),...i,children:e??(0,t.jsx)(ea.Trans,{message:"Add reference",id:"noe69S"})}),ib=({onUpload:e,...i})=>{let{shouldShowUpsell:n,openUpsell:a}=(0,e5.useStyleReferenceUpsell)();return(0,t.jsx)(ig,{...i,onClick:n?a:e,flexShrink:0,rightIcon:n?(0,t.jsx)(tw.UpsellProductBadge,{canUseFeature:!1,productFeature:"ai_style_reference",borderRadius:"full"}):void 0})},ix=({preset:e,onPresetChange:i,prompt:a,onArtStylePromptChange:r,columns:o,isDisabled:s,styleReferences:l,hasHistory:d,hidePresetSelector:c})=>{let u=(0,er.useCallback)(()=>{"custom"!==e&&i("custom"),l?.handleUploadClick()},[e,i,l]),p=l?(0,t.jsx)(en.GammaTooltip,{label:n.i18n._({id:"ISKWIA",message:"Upload an image"}),children:(0,t.jsx)(ib,{onUpload:u,isDisabled:s||!l.canAddMore})}):null;return(0,t.jsxs)(ee.VStack,{spacing:1,align:"stretch",children:[!c&&(0,t.jsx)(is,{selectedPreset:e,onSelectPreset:i,columns:o}),l&&(0,t.jsx)(ie.Input,{ref:l.fileInputRef,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp,.heic,.heif",multiple:!0,display:"none",onChange:l.handleFileSelect}),p&&"custom"!==e&&(0,t.jsx)(q.Box,{mt:1,children:p}),"custom"===e&&(0,t.jsx)(iy,{prompt:a,onArtStylePromptChange:r,isDisabled:s,styleReferences:l,addReferenceButton:p,hasHistory:d})]})},iy=({prompt:e,onArtStylePromptChange:i,isDisabled:a,styleReferences:r,addReferenceButton:o,hasHistory:s})=>r?(0,t.jsx)(iv,{prompt:e,onArtStylePromptChange:i,isDisabled:a,styleReferences:r,addReferenceButton:o,hasHistory:s}):(0,t.jsx)(q.Box,{border:"1px solid",borderColor:"gray.200",borderRadius:"md",bg:"white",opacity:a?.6:1,pointerEvents:a?"none":"auto",children:(0,t.jsx)(it.Textarea,{value:e,onChange:e=>i?.(e.target.value),placeholder:n.i18n._({id:"zPao75",message:"Describe your image art style"}),fontSize:"sm",rows:2,resize:"none",border:"none",bg:"transparent",px:2,_focus:{boxShadow:"none"},isDisabled:a})}),iv=({prompt:e,onArtStylePromptChange:i,isDisabled:a,styleReferences:r,addReferenceButton:o,hasHistory:s})=>{let{entries:l,canAddMore:d,isDragging:c,handleUploadClick:u,handleRemove:p,handleCancelUpload:h,uploadFiles:m,dragDropProps:g}=r,f=s?(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Tip: You can upload an image or choose an existing one",id:"hwwMlx"})}):(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Tip: Upload an image to use as a style reference",id:"Z744m3"})}),b=(0,er.useCallback)(e=>{let t=Array.from(e.clipboardData.items).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>null!==e);0!==t.length&&(e.preventDefault(),m(t))},[m]);return(0,t.jsxs)(q.Box,{border:"1px solid",borderColor:c?"blue.400":"gray.200",borderRadius:"md",bg:c?"blue.50":"white",transition:"all 0.2s",opacity:a?.6:1,pointerEvents:a?"none":"auto",...g,children:[(0,t.jsx)(it.Textarea,{value:e,onChange:e=>i?.(e.target.value),onPaste:b,placeholder:n.i18n._({id:"zPao75",message:"Describe your image art style"}),fontSize:"sm",rows:2,resize:"none",border:"none",bg:"transparent",px:2,_focus:{boxShadow:"none"},isDisabled:a}),(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:2,px:2,pb:2,children:[l.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ee.VStack,{align:"start",spacing:0,children:[(0,t.jsxs)(X.HStack,{spacing:1.5,color:"gray.600",textColor:"blue.950",children:[(0,t.jsx)(ei.FontAwesomeIcon,{size:"sm",icon:et.faImage}),(0,t.jsx)(J.Text,{fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"{0, plural, one {# uploaded} other {# uploaded}}",id:"eWJZgA",values:{0:l.length}})})]}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"{0, plural, one {Use the style of this image} other {Use the style of these images}}",id:"I2KyRh",values:{0:l.length}})})]}),(0,t.jsxs)(X.HStack,{spacing:2,children:[l.map((e,i)=>"complete"===e.status?(0,t.jsx)(ih,{src:(0,eO.resizeAndProxyImageUrl)(e.url,eO.THUMBNAIL_RESIZE_JPG_PARAMS),alt:n.i18n._({id:"ydm8tr",message:"Style reference {imageNum}",values:{imageNum:i+1}}),onRemove:()=>p(e.url),skipEntryAnimation:!0,boxSize:"72px",borderColor:"blue.500",borderWidth:"2px"},e.id):(0,t.jsx)(ih,{src:e.previewUrl,alt:n.i18n._({id:"8Z8XOD",message:"Uploading style reference"}),onRemove:()=>h(e.id),isLoading:!0,boxSize:"72px",borderColor:"blue.500",borderWidth:"2px"},e.id)),d&&(0,t.jsx)(t7.Center,{as:"button",boxSize:"72px",borderRadius:"md",border:"2px dashed",borderColor:"gray.300",color:"gray.400",_hover:{borderColor:"gray.400",color:"gray.500"},onClick:u,flexShrink:0,children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faPlus})})]}),f]}),o&&0===l.length&&(0,t.jsxs)(X.HStack,{spacing:1.5,align:"center",flexWrap:"wrap",children:[o,f]})]})]})};var iC=e.i(406112),iw=e.i(261697),iS=e.i(729865);function ik(e){switch(e){case"Scenic":return n.i18n._({id:"eqZcEI",message:"Scenic"});case"Realistic":return n.i18n._({id:"/0TXZD",message:"Realistic"});case"Minimal":return n.i18n._({id:"t+pD4s",message:"Minimal"});case"Playful":return n.i18n._({id:"VAT8DE",message:"Playful"});case"Bold":return n.i18n._({id:"2IHRFf",message:"Bold"});case"Abstract":return n.i18n._({id:"Ur1IhO",message:"Abstract"})}}let iA={...iS.ILLUSTRATION_STYLE_REFERENCES,cinematic_photo:{name:()=>n.i18n._({id:"SP2vYV",message:"Cinematic"}),previewImages:["https://static.gamma.app/images/style-references-sm/cinematic_photo--light--3-24670f6f.jpg","https://static.gamma.app/images/style-references-sm/cinematic_photo--light--0-67ada91b.jpg","https://static.gamma.app/images/style-references-sm/cinematic_photo--light--1-2eadd64d.jpg","https://static.gamma.app/images/style-references-sm/cinematic_photo--light--2-bd6c3fc0.jpg","https://static.gamma.app/images/style-references-sm/cinematic_photo--light--4-fc0f9af1.jpg"]},lifestyle_photo:{name:()=>n.i18n._({id:"Th8A4r",message:"Lifestyle"}),previewImages:["https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--5-35b9a324.jpg","https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--0-0ebbc79b.jpg","https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--1-b1f45a62.jpg","https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--2-1a1cbc58.jpg","https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--3-b183587a.jpg","https://static.gamma.app/images/style-references-sm/lifestyle_photo--light--4-283821c4.jpg"]},editorial_photo:{name:()=>n.i18n._({id:"PN2px0",message:"Editorial"}),previewImages:["https://static.gamma.app/images/style-references-sm/editorial_photo--light--4-ebf2ad71.jpg","https://static.gamma.app/images/style-references-sm/editorial_photo--light--0-4ab0b708.jpg","https://static.gamma.app/images/style-references-sm/editorial_photo--light--1-47e115fa.jpg","https://static.gamma.app/images/style-references-sm/editorial_photo--light--2-05cb4b4e.jpg","https://static.gamma.app/images/style-references-sm/editorial_photo--light--3-79075dad.jpg"]},classic_photo:{name:()=>n.i18n._({id:"7xoMrX",message:"Photo"}),previewImages:["https://static.gamma.app/images/style-references-sm/classic_photo--light--0-373b6441.jpg","https://static.gamma.app/images/style-references-sm/classic_photo--light--1-6968ceb4.jpg","https://static.gamma.app/images/style-references-sm/classic_photo--light--2-9b9ed0ec.jpg","https://static.gamma.app/images/style-references-sm/classic_photo--light--3-0cbd9d36.jpg","https://static.gamma.app/images/style-references-sm/classic_photo--light--4-db9a0be6.jpg"]},still_life_photo:{name:()=>n.i18n._({id:"uKI8JF",message:"Still life"}),previewImages:["https://static.gamma.app/images/style-references-sm/still_life_photo--thumb--0-aa97e271.jpg","https://static.gamma.app/images/style-references-sm/still_life_photo--ref--0-42bf675d.jpg","https://static.gamma.app/images/style-references-sm/still_life_photo--ref--1-cba0b7f4.jpg","https://static.gamma.app/images/style-references-sm/still_life_photo--ref--2-8b6e18c2.jpg","https://static.gamma.app/images/style-references-sm/still_life_photo--ref--3-3371636d.jpg"]},...e_.ABSTRACT_STYLES},iE=Object.fromEntries(iw.STYLE_REFERENCE_ENTRIES.map(({key:e,category:t})=>{let i=iA[e];if(!i)throw Error(`allStyleReferences: missing client display data for style key "${e}". Add it to illustrationStyleReferences, photoStyleReferences, or abstractStyleReferences.`);return[e,{name:i.name,previewImages:i.previewImages,categoryLabel:t}]})),i_=iw.ALL_STYLE_KEYS,iI=["Scenic","Realistic","Minimal","Playful","Bold","Abstract"],iM=["Suggested","Photo","Illustration","Abstract"],iT=new Set(["Realistic"]),iL=new Set(["Scenic","Minimal","Playful","Bold"]),ij=new Set(["Abstract"]),iP=["classic_photo","narrative_illustration","still_life_photo","isometric"],iD=["narrative_illustration","classic_photo","spot_color_line_drawing","still_life_photo"],iN=["classic_photo","cinematic_photo","lifestyle_photo","editorial_photo","still_life_photo"],iR=["spot_color_line_drawing","isometric","narrative_illustration","technical_line"],iO=["abstract_waves","abstract_liquid_glass","abstract_mesh","abstract_paint_swirl"];function iB(e,t={}){let i;switch(e){case"Suggested":i=t.isPaid?iP:iD;break;case"Photo":i=iN;break;case"Illustration":i=iR;break;case"Abstract":i=iO}let n=[...i];if("Suggested"!==e)return n;let a=t.selectedKey??t.lastUsedKey;if(a&&iE[a]){let e=n.filter(e=>e!==a);return[a,...e]}return n}function iz(e){let t=iE[e];if(!t?.categoryLabel)return;let i=t.categoryLabel;return iT.has(i)?"Photo":iL.has(i)?"Illustration":ij.has(i)?"Abstract":void 0}function iF(e){switch(e){case"Suggested":return n.i18n._({id:"KcWAIg",message:"Suggested"});case"Photo":return n.i18n._({id:"HwN4GR",message:"Photo"});case"Illustration":return n.i18n._({id:"j3Q6pj",message:"Illustration"});case"Abstract":return n.i18n._({id:"BQopQW",message:"Abstract"})}}e.s(["ALL_STYLE_KEYS",0,i_,"ALL_STYLE_REFERENCES",0,iE,"STYLE_CATEGORIES",0,iI,"STYLE_FILTER_TABS",0,iM,"getHardcodedKeysForTab",0,iB,"getStyleCategoryLabel",0,ik,"getStyleFilterTabLabel",0,iF,"getTabForStyleKey",0,iz],376210);var iH=e.i(860686),iW=e.i(965837),iU=e.i(774314),iV=e.i(775493),iG=e.i(704077),i$=e.i(112010),iZ=e.i(588183),iK=e.i(75495),iq=e.i(575329),iY=e.i(751827),iX=e.i(156518),iQ=e.i(876533);let iJ=({isOpen:e,onClose:i,selectedKey:a,onSelect:r,excludeCategories:o})=>{let[s,l]=(0,er.useState)(a??null),d=(0,er.useRef)(null),c=(0,er.useRef)(!1),[u,p]=(0,er.useState)(""),[h,m]=(0,er.useState)("All");(0,er.useEffect)(()=>{e&&!c.current&&(d.current=a??null,l(a??null),p(""),m("All")),c.current=e},[e,a]);let g=(0,er.useMemo)(()=>i_.filter(e=>{let t=iE[e];if(!t||o&&t.categoryLabel&&o.includes(t.categoryLabel)||"All"!==h&&t.categoryLabel!==h)return!1;if(u){let i="function"==typeof t.name?t.name():t.name,n=u.toLowerCase();return i.toLowerCase().includes(n)||e.toLowerCase().includes(n)||(t.categoryLabel?.toLowerCase().includes(n)??!1)}return!0}),[h,u,o]),f=s?iE[s]:null,b=()=>{r(d.current),i()},x=(0,th.useBreakpointValue)({base:!0,md:!1})??!1,y=(0,th.useBreakpointValue)({base:3,sm:4,md:6})??6,v=(0,th.useBreakpointValue)({base:"full",md:"5xl"})??"5xl";return(0,t.jsx)(iQ.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(iV.Modal,{isOpen:e,onClose:b,size:v,scrollBehavior:"inside",children:[(0,t.jsx)(iY.ModalOverlay,{}),(0,t.jsxs)(iZ.ModalContent,{maxH:{base:"100vh",md:"90vh"},children:[(0,t.jsx)(i$.ModalCloseButton,{}),(0,t.jsx)(iq.ModalHeader,{borderBottom:"1px solid",borderColor:"gray.200",color:"blue.950",children:(0,t.jsx)(ea.Trans,{message:"Image choices",id:"6FJHeM"})}),(0,t.jsx)(iG.ModalBody,{p:0,overflowY:"hidden",display:"flex",flexDirection:"column",children:(0,t.jsxs)(e9.Flex,{direction:{base:"column",md:"row"},align:"stretch",flex:1,minH:0,children:[(0,t.jsxs)(e9.Flex,{direction:"column",flex:1,minW:0,minH:0,pe:2,overflowY:"auto",children:[(0,t.jsxs)(q.Box,{position:"sticky",top:0,bg:"white",zIndex:1,px:6,pt:4,pb:6,children:[(0,t.jsxs)(iW.InputGroup,{size:"sm",mb:3,children:[(0,t.jsx)(iU.InputLeftElement,{pointerEvents:"none",children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faSearch,color:"var(--chakra-colors-gray-400)",size:"sm"})}),(0,t.jsx)(ie.Input,{placeholder:n.i18n._({id:"azYSeI",message:"Search for a style"}),value:u,onChange:e=>p(e.target.value)})]}),(0,t.jsxs)(X.HStack,{spacing:3,flexWrap:"wrap",children:[(0,t.jsx)(i0,{label:n.i18n._({id:"N40H+G",message:"All"}),isActive:"All"===h,onClick:()=>m("All")}),iI.filter(e=>!o?.includes(e)).map(e=>(0,t.jsx)(i0,{label:ik(e),isActive:h===e,onClick:()=>m(e)},e))]})]}),(0,t.jsx)(q.Box,{px:6,pb:6,children:(0,t.jsx)(iH.Grid,{templateColumns:`repeat(${y}, 1fr)`,gap:{base:2,md:3},children:g.map(e=>{let i=iE[e];if(!i)return null;let n=(i.previewImages||i.urls||[])[0],a=s===e,o="function"==typeof i.name?i.name():i.name;return(0,t.jsxs)(ee.VStack,{w:"100%",minW:0,overflow:"hidden",spacing:0,cursor:"pointer",onClick:()=>{l(e),r(e)},borderRadius:"xl",border:"1px solid",borderColor:a?"blue.500":"gray.200",bg:a?"blue.50":"white",p:2,pb:1.5,transition:"all 0.15s",_hover:{borderColor:a?"blue.500":"gray.400",shadow:"sm"},children:[(0,t.jsx)(q.Box,{w:"100%",position:"relative",sx:{aspectRatio:"1"},borderRadius:"lg",overflow:"hidden",bg:"gray.100",children:n&&(0,t.jsx)(te.Image,{src:n,alt:o,position:"absolute",inset:0,w:"100%",h:"100%",objectFit:"cover"})}),(0,t.jsxs)(X.HStack,{spacing:1.5,justify:"start",w:"100%",mt:1.5,children:[a&&(0,t.jsx)(ii.CheckIcon,{w:2.5,h:"auto",color:"blue.600",flexShrink:0}),(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:"medium",color:a?"blue.600":"gray.700",noOfLines:1,textAlign:"start",children:o})]})]},e)})})})]}),!x&&f&&(0,t.jsx)(i1,{item:f})]})}),(0,t.jsxs)(iK.ModalFooter,{borderTop:"1px solid",borderColor:"gray.200",children:[(0,t.jsx)(Y.Button,{variant:"ghost",me:3,onClick:b,children:(0,t.jsx)(ea.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(Y.Button,{variant:"solid",onClick:()=>{i()},isDisabled:!s,children:(0,t.jsx)(ea.Trans,{message:"Save",id:"y12XkV"})})]})]})]})})},i0=({label:e,isActive:i,onClick:n})=>(0,t.jsx)(iX.Tag,{size:"md",letterSpacing:"normal",cursor:"pointer",colorScheme:i?"blue":void 0,color:i?void 0:"gray.700",bg:i?void 0:"gray.200",onClick:n,_hover:{bg:i?"blue.200":"gray.300"},children:e}),i1=({item:e})=>{let i="function"==typeof e.name?e.name():e.name,n=e.previewImages||e.urls||[];return(0,t.jsxs)(ee.VStack,{w:"240px",minW:"240px",align:"center",justify:"center",spacing:3,bg:"gray.50",p:6,overflowY:"auto",children:[(0,t.jsx)(J.Text,{fontSize:"lg",fontWeight:"semibold",color:"blue.950",textAlign:"center",children:i}),e.categoryLabel&&(0,t.jsx)(iX.Tag,{size:"sm",letterSpacing:"normal",bg:"gray.200",color:"gray.700",children:ik(e.categoryLabel)}),(0,t.jsx)(ia.SimpleGrid,{columns:2,spacing:2,pt:3,w:"100%",children:n.slice(0,8).map((e,n)=>(0,t.jsx)(q.Box,{borderRadius:"md",overflow:"hidden",sx:{aspectRatio:"1"},children:(0,t.jsx)(te.Image,{src:e,alt:`${i} example ${n+1}`,w:"100%",h:"100%",objectFit:"cover"})},n))})]})},i2=({activeTab:e,onTabChange:i,includeSuggested:n=!0,isDisabled:a})=>{let r=n?iM:iM.filter(e=>"Suggested"!==e);return(0,t.jsx)(X.HStack,{spacing:2,flexWrap:"wrap",children:r.map(n=>{let r=e===n;return(0,t.jsx)(iX.Tag,{size:"md",letterSpacing:"normal",cursor:a?"default":"pointer",colorScheme:r?"blue":void 0,color:r?void 0:"gray.700",bg:r?void 0:"gray.200",opacity:a?.6:1,onClick:a?void 0:()=>i(n),_hover:a?void 0:{bg:r?"blue.200":"gray.300"},children:iF(n)},n)})})};e.i(832019);let i3=e=>eC.IMAGE_GENERATE_MODELS[e],i5="__auto__",i4=["free","plus","pro","ultra"],i6=({workspaceId:e,styleReferenceKey:i,selectedModelId:n,onSelectModel:a,isDisabled:r})=>{let{result:o}=(0,ew.useAvailableStyledImageModels)({workspaceId:e,styleReferenceKey:i}),{openUpsellModal:s}=(0,eM.useMonetizationContext)(),l=(0,er.useMemo)(()=>o?.models??[],[o?.models]),d=o?.autoModelId,c=(0,er.useMemo)(()=>l.find(e=>e.id===d),[l,d]);(0,er.useEffect)(()=>{n&&o&&(l.some(e=>e.id===n)||a(void 0))},[n,l,o,a]);let u=n?i3(n):void 0,p=n&&l.some(e=>e.id===n)?n:void 0,h=!p,m=(0,er.useMemo)(()=>{let e=new Map;for(let i of l){var t;let n=(t=i.productFeature)?(0,tS.getProductRequiredForFeature)(t)??"free":"free",a=e.get(n)??[];a.push(i),e.set(n,a)}return i4.filter(t=>e.has(t)).map(t=>({tier:t,models:e.get(t)}))},[l]);return(0,t.jsxs)(tt.Menu,{isLazy:!0,children:[(0,t.jsx)(ti.MenuButton,{as:Y.Button,variant:"plain",isDisabled:r,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronDown}),boxShadow:"sm",size:"sm",children:(0,t.jsxs)(X.HStack,{spacing:2,justify:"space-between",width:"100%",overflow:"hidden",children:[(0,t.jsxs)(X.HStack,{spacing:2,minW:0,children:[(0,t.jsx)(e9.Flex,{width:"20px",height:"20px",align:"center",justify:"center",flexShrink:0,children:h?(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles,size:"sm"}):u?(0,t.jsx)(te.Image,{src:u.image.src,w:"1.25em",h:"1.25em",objectFit:"contain"}):null}),(0,t.jsx)(J.Text,{as:"span",isTruncated:!0,fontSize:"sm",children:h?(0,t.jsx)(ea.Trans,{message:"Auto-select model",id:"rLQ3+5"}):u?.label()??n})]}),h&&c?(0,t.jsx)(ne,{creditsPerImage:c.creditsPerImage}):p?(0,t.jsx)(ne,{creditsPerImage:l.find(e=>e.id===p)?.creditsPerImage??0}):null]})}),(0,t.jsx)(tu.Portal,{children:(0,t.jsx)(tr.MenuList,{minWidth:"250px",maxW:"100%",maxH:"350px",overflowY:"auto",overflowX:"hidden",zIndex:"modalPopover",border:"1px solid",borderColor:"gray.200",children:(0,t.jsxs)(to.MenuOptionGroup,{type:"radio",value:h?i5:p,children:[(0,t.jsx)(q.Box,{px:3,pt:2,pb:1,children:(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:"bold",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Recommended",id:"WEYdDv"})})}),(0,t.jsx)(ta.MenuItemOption,{value:i5,onClick:()=>a(void 0),children:(0,t.jsxs)(X.HStack,{spacing:3,align:"center",w:"100%",children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles,size:"sm"}),(0,t.jsxs)(tp.Stack,{spacing:0,direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},justify:"space-between",w:"100%",children:[(0,t.jsx)(J.Text,{fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"Auto-select model",id:"rLQ3+5"})}),c&&(0,t.jsx)(ne,{creditsPerImage:c.creditsPerImage})]})]})}),m.map(({tier:e,models:i})=>(0,t.jsxs)(q.Box,{children:[(0,t.jsx)(tn.MenuDivider,{}),(0,t.jsx)(q.Box,{px:3,pt:2,pb:1,children:(0,t.jsx)(i8,{tier:e})}),i.map(e=>(0,t.jsx)(i7,{model:e,onClick:()=>{let t;(t=e.productFeature)&&!(0,ty.getCanUseProductFeature)(t)?s({segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_IMAGE_MODELS,eventProperties:{model:e.id},upsellLocation:"aiImageModels",targetFeature:t}):a(e.id)}},e.id))]},e))]})})})]})},i9={free:void 0,plus:"ai_models_plus",pro:"ai_premium_models",ultra:"ai_models_ultra"},i8=({tier:e})=>{let i=i9[e],n=!i||(0,ty.getCanUseProductFeature)(i);return(0,t.jsxs)(e9.Flex,{align:"center",gap:2,children:[(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:"bold",color:"gray.500",children:(0,tS.descriptionsForAiImageFunctionalityByProductKey)(e).header}),i&&(0,t.jsx)(tw.UpsellProductBadge,{canUseFeature:n,productFeature:i})]})},i7=({model:e,onClick:i})=>{let n=i3(e.id),a=n?.label()??e.id,r=n?.image?.src,o=e.productFeature,s=!!o&&!(0,ty.getCanUseProductFeature)(o);return(0,t.jsx)(ta.MenuItemOption,{value:e.id,onClick:i,children:(0,t.jsxs)(X.HStack,{spacing:3,align:"center",w:"100%",children:[(0,t.jsx)(e9.Flex,{width:"20px",height:"20px",align:"center",justify:"center",flexShrink:0,children:r?(0,t.jsx)(te.Image,{src:r,w:"1.25em",h:"1.25em",objectFit:"contain"}):null}),(0,t.jsxs)(tp.Stack,{spacing:0,direction:{base:"column",md:"row"},align:{base:"flex-start",md:"center"},justify:"space-between",w:"100%",children:[(0,t.jsxs)(X.HStack,{spacing:1.5,children:[(0,t.jsx)(J.Text,{fontSize:"sm",children:a}),s&&(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"Requires a higher plan",id:"YF1Y3y"}),children:(0,t.jsx)(q.Box,{as:"span",color:"gray.500",children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faLock,size:"xs"})})})]}),(0,t.jsx)(ne,{creditsPerImage:e.creditsPerImage})]})]})},e.id)},ne=({creditsPerImage:e})=>e?(0,t.jsxs)(X.HStack,{spacing:1,children:[(0,t.jsx)(J.Text,{fontSize:"xs",children:e}),(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faSparkles,size:"xs"})]}):null;var nt=e.i(161334);let ni=(0,er.memo)(({workspaceId:e,artStylePrompt:i,setCustomArtStylePrompt:a,styleReferenceImages:r,styleReferenceUpload:o,model:s,setModel:l,modelAutoselect:d,enableModelAutoselect:c,isGenerating:u,isImageCard:p,persistedStyleKey:h,selectedStyleKey:m,setSelectedStyleKey:g,styledImageModelOverride:f,setStyledImageModelOverride:b})=>{let x=(0,th.useBreakpointValue)({base:3,md:3})??3,y=(0,er.useMemo)(()=>m===nt.CUSTOM_STYLE_KEY,[m]),[v,C]=(0,er.useState)("Suggested"),{product:w}=(0,eM.useMonetizationContext)(),S=null!==w,k=(0,er.useMemo)(()=>iB(v,{isPaid:S,lastUsedKey:h,selectedKey:m}),[v,S,h,m]),A=(0,er.useMemo)(()=>k.slice(0,x),[k,x]),{isOpen:E,onOpen:_,onClose:I}=(0,iC.useDisclosure)();(0,er.useEffect)(()=>{y||m||!(A.length>0)||g(A[0])},[y,m,A,g]);let M=(0,er.useCallback)(e=>{e===nt.CUSTOM_STYLE_KEY?g(nt.CUSTOM_STYLE_KEY):g(e),b(void 0)},[g,b]),T=(0,er.useCallback)(e=>{if(g(e),b(void 0),"Suggested"!==v){let t=iz(e);t&&C(t)}},[g,b,v]);return(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:3,children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:u?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Art style",id:"WpXFiB"})}),(0,t.jsx)(i2,{activeTab:v,onTabChange:C,isDisabled:u}),(0,t.jsxs)(e9.Flex,{gap:2,overflowX:"auto",sx:{"&::-webkit-scrollbar":{display:"none"}},children:[A.map(e=>{let i=iE[e];if(!i)return null;let n=i.previewImages?.[0],a=i.name(),r=!y&&m===e;return(0,t.jsx)(na,{imageUrl:n,label:a,isSelected:r,onClick:()=>M(e),isDisabled:u},e)}),(0,t.jsx)(na,{icon:et.faSliders,label:n.i18n._({id:"E5JYrJ",message:"Custom"}),isSelected:y,onClick:()=>M(nt.CUSTOM_STYLE_KEY),isDisabled:u},nt.CUSTOM_STYLE_KEY),(0,t.jsx)(na,{imageUrl:"/images/view-more-styles.png",imageBg:"white",imageObjectFit:"contain",label:n.i18n._({id:"mbtXQV",message:"View more"}),isSelected:!1,onClick:_,isDisabled:u},"view-more")]}),o&&(0,t.jsx)(ie.Input,{ref:o.fileInputRef,type:"file",accept:"image/*",multiple:!0,display:"none",onChange:o.handleFileSelect}),y&&(0,t.jsx)(nn,{artStylePrompt:i,setCustomArtStylePrompt:a,styleReferenceUpload:o,styleReferenceImages:r,model:s,setModel:l,modelAutoselect:d,enableModelAutoselect:c,isGenerating:u,isImageCard:p}),!y&&(0,t.jsx)(ee.VStack,{align:"stretch",spacing:2,children:(0,t.jsxs)(X.HStack,{spacing:2,align:"stretch",children:[(0,t.jsx)(q.Box,{flex:1,minW:0,children:(0,t.jsx)(i6,{workspaceId:e,styleReferenceKey:m,selectedModelId:f,onSelectModel:b,isDisabled:u})}),(0,t.jsx)(en.GammaTooltip,{label:n.i18n._({id:"ISKWIA",message:"Upload an image"}),children:(0,t.jsx)(ib,{onUpload:()=>{g(nt.CUSTOM_STYLE_KEY),o?.handleUploadClick()},isDisabled:u||!o?.canAddMore,w:"fit-content"})})]})}),(0,t.jsx)(iJ,{isOpen:E,onClose:I,selectedKey:m,onSelect:T})]})});ni.displayName="DeckStyledArtStyleControls";let nn=({artStylePrompt:e,setCustomArtStylePrompt:i,styleReferenceUpload:a,styleReferenceImages:r,model:o,setModel:s,modelAutoselect:l,enableModelAutoselect:d,isGenerating:c,isImageCard:u})=>{let p=a?.entries??[],h=a?.canAddMore??!1,m=a?.isDragging??!1,g=a?.handleUploadClick,f=a?.handleRemove,b=a?.handleCancelUpload,x=a?.uploadFiles,y=a?.dragDropProps??{},v=(0,er.useCallback)(e=>{let t=Array.from(e.clipboardData.items).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>null!==e);0!==t.length&&x&&(e.preventDefault(),x(t))},[x]);return(0,t.jsx)(ee.VStack,{spacing:3,align:"stretch",children:(0,t.jsxs)(q.Box,{border:"1px solid",borderColor:m?"blue.400":"gray.200",borderRadius:"md",bg:m?"blue.50":"white",transition:"all 0.2s",opacity:c?.6:1,pointerEvents:c?"none":"auto",...y,children:[(0,t.jsx)(it.Textarea,{value:e,onChange:e=>i(e.target.value),onPaste:v,placeholder:n.i18n._({id:"zPao75",message:"Describe your image art style"}),fontSize:"sm",rows:2,resize:"none",border:"none",bg:"transparent",px:2,_focus:{boxShadow:"none"},isDisabled:c}),(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:2,px:2,pb:2,children:[p.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(ee.VStack,{align:"start",spacing:0,children:[(0,t.jsxs)(X.HStack,{spacing:1.5,color:"gray.600",textColor:"blue.950",children:[(0,t.jsx)(ei.FontAwesomeIcon,{size:"sm",icon:et.faImage}),(0,t.jsx)(J.Text,{fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"{0, plural, one {# uploaded} other {# uploaded}}",id:"eWJZgA",values:{0:p.length}})})]}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"{0, plural, one {Use the style of this image} other {Use the style of these images}}",id:"I2KyRh",values:{0:p.length}})})]}),(0,t.jsxs)(X.HStack,{spacing:2,children:[p.map((e,i)=>"complete"===e.status?(0,t.jsx)(ih,{src:(0,eO.resizeAndProxyImageUrl)(e.url,eO.THUMBNAIL_RESIZE_JPG_PARAMS),alt:n.i18n._({id:"ydm8tr",message:"Style reference {imageNum}",values:{imageNum:i+1}}),onRemove:()=>f?.(e.url),skipEntryAnimation:!0,boxSize:"72px",borderColor:"blue.500",borderWidth:"2px"},e.id):(0,t.jsx)(ih,{src:e.previewUrl,alt:n.i18n._({id:"8Z8XOD",message:"Uploading style reference"}),onRemove:()=>b?.(e.id),isLoading:!0,boxSize:"72px",borderColor:"blue.500",borderWidth:"2px"},e.id)),h&&(0,t.jsx)(t7.Center,{as:"button",boxSize:"72px",borderRadius:"md",border:"2px dashed",borderColor:"gray.300",color:"gray.400",_hover:{borderColor:"gray.400",color:"gray.500"},onClick:g,flexShrink:0,children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faPlus})})]})]}),(0,t.jsxs)(X.HStack,{spacing:2,justify:"space-between",align:"stretch",children:[0===p.length&&(0,t.jsx)(en.GammaTooltip,{label:n.i18n._({id:"ISKWIA",message:"Upload an image"}),children:(0,t.jsx)(ib,{onUpload:()=>g?.(),isDisabled:c||!h,size:"sm"})}),(0,t.jsx)(q.Box,{flex:1,minW:0,children:(0,t.jsx)(t4,{value:o,setValue:s,isDisabled:c,modelFilter:e=>eI.AI_IMAGE_SUPPORTED_MODELS.has(e.model)&&!e.isVideoModel&&(!u||(0,eC.canModelMakeImageCards)(e.model)),autoselect:{isActive:l,onChooseAutoselect:d,model:(0,eS.getAutoselectImageModel)({imageProvider:"aiGenerated",imageOptions:{artStylePreset:"custom",styleReferenceImages:r}})},hasStyleReferences:r.length>0,context:eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER,boxShadow:"none"})})]})]})]})})},na=({imageUrl:e,icon:i,label:n,isSelected:a,onClick:r,isDisabled:o,imageBg:s,imageObjectFit:l})=>(0,t.jsxs)(ee.VStack,{spacing:0,cursor:o?"default":"pointer",onClick:o?void 0:r,borderRadius:"lg",border:"1px solid",borderColor:a?"blue.500":"gray.200",bg:a?"blue.50":"white",p:1.5,pb:n?1:1.5,transition:"all 0.15s",opacity:o?.6:1,flex:"1 0 0",minW:"56px",_hover:o?void 0:{borderColor:a?"blue.500":"gray.400",shadow:"sm"},children:[(0,t.jsx)(q.Box,{w:"100%",flex:1,sx:{aspectRatio:"1"},borderRadius:"lg",overflow:"hidden",bg:s??"gray.100",display:"flex",alignItems:"center",justifyContent:"center",children:e?(0,t.jsx)(te.Image,{src:e,alt:n??"",w:"100%",h:"100%",objectFit:l??"cover"}):i?(0,t.jsx)(ei.FontAwesomeIcon,{icon:i,size:"lg",color:"var(--chakra-colors-gray-500)"}):null}),n&&(0,t.jsxs)(X.HStack,{spacing:1,justify:"start",w:"100%",mt:1,pl:.5,children:[a&&(0,t.jsx)(ii.CheckIcon,{w:2.5,h:"auto",color:"blue.600",flexShrink:0}),(0,t.jsx)(J.Text,{fontSize:"2xs",fontWeight:a?"semibold":"medium",color:a?"blue.600":"gray.700",noOfLines:1,textAlign:"left",children:n})]})]}),nr=({showNewArtStyleUI:e,workspaceId:i,artStylePreset:a,setArtStylePreset:r,artStylePrompt:o,setCustomArtStylePrompt:s,styleReferenceImages:l,styleReferenceUpload:d,model:c,setModel:u,modelAutoselect:p,enableModelAutoselect:h,isGenerating:m,isImageCard:g,persistedStyleKey:f,selectedStyleKey:b,setSelectedStyleKey:x,styledImageModelOverride:y,setStyledImageModelOverride:v,shouldUseThemeColors:C,setShouldUseThemeColors:w,hasHistory:S,editor:k,closeDrawer:A})=>e?(0,t.jsx)(ni,{workspaceId:i,artStylePrompt:o,setCustomArtStylePrompt:s,styleReferenceImages:l,styleReferenceUpload:d,model:c,setModel:u,modelAutoselect:p,enableModelAutoselect:h,isGenerating:m,isImageCard:g,persistedStyleKey:f,selectedStyleKey:b,setSelectedStyleKey:x,styledImageModelOverride:y,setStyledImageModelOverride:v}):(0,t.jsxs)(ee.VStack,{align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:m?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Art style",id:"WpXFiB"})}),(0,t.jsx)(ix,{preset:a,onPresetChange:r,prompt:o,onArtStylePromptChange:s,isDisabled:m,styleReferences:d,hasHistory:S}),w&&(0,t.jsxs)(X.HStack,{spacing:2,align:"start",alignItems:"center",gap:2,children:[(0,t.jsx)(t6.Checkbox,{id:"use-theme-colors",isChecked:C??void 0,onChange:e=>w(e.target.checked)}),(0,t.jsx)(t9.FormLabel,{htmlFor:"use-theme-colors",mb:0,me:0,children:(0,t.jsx)(J.Text,{fontSize:"xs",children:(0,t.jsx)(ea.Trans,{message:"Use theme style",id:"ge5rTg"})})}),(0,t.jsx)(en.GammaTooltip,{label:n.i18n._({id:"DOIHaY",message:"Images will use the style prompt from your theme"}),children:(0,t.jsx)(ei.FontAwesomeIcon,{size:"xs",icon:et.faCircleInfo})}),k&&A&&(0,t.jsx)(J.Text,{fontSize:"xs",children:(0,t.jsx)(Q.Link,{color:"blue.600",onClick:()=>{A(),t8.TiptapEventBus.emit(t8.EventBusEvent.OPEN_THEME_DRAWER,{})},children:(0,t.jsx)(ea.Trans,{message:"View theme",id:"dIM+cw"})})})]})]}),no=nt.CUSTOM_STYLE_KEY;function ns({showNewArtStyleUI:e,selectedStyleKey:t,artStylePreset:i,artStylePrompt:n,styleReferenceImages:a}){return e?t&&t!==no?{artStylePreset:void 0,artStylePrompt:void 0,styleReferenceImages:[],styleReferenceKey:t}:{artStylePreset:"custom",artStylePrompt:n,styleReferenceImages:a??[],styleReferenceKey:void 0}:{artStylePreset:i,artStylePrompt:n,styleReferenceImages:"custom"===i?a??[]:[],styleReferenceKey:void 0}}let nl=({fallbackInfo:e,modelAutoselect:i,hasStyleReferences:n})=>{let a;if(e&&!i)a=(0,t.jsx)(ea.Trans,{message:"The model you selected is experiencing issues. We've used a different model to generate your image.",id:"TQTcdG"});else{if(!n)return null;a=(0,t.jsx)(ea.Trans,{message:"Not all models support style references. We've selected the best models available.",id:"tiNzcO"})}return(0,t.jsx)(en.GammaTooltip,{label:a,placement:"top",hasArrow:!0,children:(0,t.jsx)(q.Box,{as:"span",color:"blue.950",fontSize:"sm",cursor:"help",children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faCircleInfo})})})},nd=e=>(0,t.jsx)(nc,{canShowEmptyState:"themeBackground"!==e.editType,...e}),nc=({currentAttributes:e,updateAttributes:i,editor:r,contextualTheme:o,savedMediaContext:s,closeDrawer:l,canShowEmptyState:d})=>{let c=(0,ec.useAIInteraction)("generate-image"),u=(0,er.useRef)(null),p=(0,er.useRef)(void 0),h=(0,eT.useAppSelector)(ej.selectSite),m=(0,eT.useAppSelector)(ev.selectDoc),g=(0,eT.useAppSelector)(ev.selectFileWorkspace),f=m?.id,{isInOfflineMode:b}=(0,eh.useHealthCheck)(),x=(0,eT.useAppSelector)((0,eD.selectIsMemberOfCurrentDocWorkspace)(g?.id)),{credits:y}=(0,ey.useCreditStatus)(),{product:v}=(0,eM.useMonetizationContext)(),C=e?.source==="image.ai-image-card",[w,S]=(0,er.useState)(!1),k=(0,er.useMemo)(()=>r?"doc":"user",[r]),[A,E]=(0,er.useState)(k),_=r?.getAttributes("document")?.aiOptions?.imageOptions,{showNewArtStyleUI:I,persistedStyleKey:M,selectedStyleKey:T,setSelectedStyleKey:L}=(0,eK.useStyledImageMode)({currentAttributes:e,lastUsedImageSettings:_}),j=(0,e6.useWorkspaceIdForAIImageContext)(s),P=I&&!!T&&T!==no,{result:D}=(0,ew.useAvailableStyledImageModels)({workspaceId:j,styleReferenceKey:P?T:void 0}),[N,R]=(0,er.useState)(()=>e?.aiParams?.model??void 0),O=(0,er.useRef)(!1);(0,er.useEffect)(()=>{O.current||D?.autoModelId&&(O.current=!0,N===D.autoModelId&&R(void 0))},[D?.autoModelId,N]);let{prompt:B,addPrompt:z,promptPageInfo:F,nextPrompt:H,prevPrompt:W,model:U,setModel:V,stylePrompt:en,aspectRatio:eY,setAspectRatio:eQ,count:eJ,setCount:e0,imageGenerateConfig:e9,loadImageAiParams:e8,resetImageAiParams:e7,isPromptDirty:te,artStylePreset:tt,setArtStylePreset:ti,artStylePrompt:tn,setCustomArtStylePrompt:ta,styleReferenceImages:tr,setStyleReferenceImages:to,shouldUseThemeColors:ts,setShouldUseThemeColors:tl,modelAutoselect:td,enableModelAutoselect:tc}=(0,eA.useImageGenerateConfig)({contextualTheme:o,lastUsedImageGenerationSettingsInDoc:_,aiParams:e?.aiParams??void 0,savedMediaContext:s,visualsMenuEnabled:!0,savedCustomArtStyle:e?.savedCustomArtStyle,showNewArtStyleUI:I}),tu=I&&!!T&&e_.ABSTRACT_STYLE_KEYS.has(T),tp=(0,er.useMemo)(()=>{if(!D)return;let e=N?D.models.find(e=>e.id===N):D.models.find(e=>e.id===D.autoModelId);return e?.creditsPerImage},[D,N]);(0,er.useEffect)(()=>{I&&tl&&ts&&tl(!1)},[I,ts,tl]);let th=(({styleReferenceImages:e,setStyleReferenceImages:t,model:i,isAutoselectEnabled:a,enableModelAutoselect:r})=>{let o=(0,er.useRef)(null),s=(0,er.useRef)(new Map),[l,d]=(0,er.useState)([]),[c,u]=(0,er.useState)(!1),{currentWorkspace:p}=(0,e3.useUserContext)(),h=(0,eq.useToast)(),{shouldShowUpsell:m,openUpsell:g}=(0,e5.useStyleReferenceUpsell)(),f=(0,e2.supportsStyleReferences)(i),b=f?Math.min((0,e2.getMaxStyleReferenceImages)(i),e2.MAX_STYLE_REFS_FOR_UI):e2.MAX_STYLE_REFS_FOR_UI,x=l.length{let t=new Set(l.filter(e=>"complete"===e.status).map(e=>e.url)),i=e.filter(e=>!t.has(e));i.length>0&&d(e=>[...e,...i.map(e=>({status:"complete",id:`existing-${e}`,url:e}))]);let n=new Set(e);l.some(e=>"complete"===e.status&&!n.has(e.url))&&d(e=>e.filter(e=>"complete"!==e.status||n.has(e.url)));let a=l.filter(e=>"uploading"===e.status);a.length>0&&(e.some(e=>!t.has(e))||[...t].some(e=>!n.has(e)))&&(a.forEach(e=>{let t=s.current.get(e.id);t&&t(),s.current.delete(e.id),"uploading"===e.status&&URL.revokeObjectURL(e.previewUrl)}),d(e=>e.filter(e=>"uploading"!==e.status)))},[e]);let y=(0,er.useCallback)(i=>{if(e.length>=b)return;if(i.size>0xa00000)return void h({title:n.i18n._({id:"xYrhQc",message:"Image too large"}),description:n.i18n._({id:"lguPlY",message:"Style reference images must be under {MAX_STYLE_REFERENCE_SIZE_MB}MB.",values:{MAX_STYLE_REFERENCE_SIZE_MB:10}}),status:"error",duration:5e3,isClosable:!0});if("image/svg+xml"===i.type)return void h({title:n.i18n._({id:"b7yPI4",message:"Unsupported file type"}),description:n.i18n._({id:"0IiZGo",message:"SVG files can't be used as style references. Please use a JPEG, PNG, or WebP image."}),status:"error",duration:5e3,isClosable:!0});let o=p?.id;if(!o)return void h({title:n.i18n._({id:"b3Thhd",message:"Upload failed"}),description:n.i18n._({id:"ybEbGY",message:"Could not upload image. Please refresh the page and try again."}),status:"error",duration:5e3,isClosable:!0});f||a||(r(),h({title:n.i18n._({id:"UhKvNp",message:"Model switched"}),description:n.i18n._({id:"Io4InY",message:"The selected model doesn't support style references. Switched to auto-select."}),status:"info",duration:5e3,isClosable:!0,position:"top"}));let l=e4(),c=URL.createObjectURL(i);d(e=>[...e,{status:"uploading",id:l,previewUrl:c}]);let u=(0,eX.uploadFile)(i,o,{onUploadComplete:e=>{s.current.delete(l);let i=!1;t(t=>t.length>=b?t:(i=!0,[...t,e.src])),d(t=>{let n=t.find(e=>e.id===l);return(n&&"uploading"===n.status&&URL.revokeObjectURL(n.previewUrl),i)?t.map(t=>t.id===l?{status:"complete",id:l,url:e.src}:t):t.filter(e=>e.id!==l)})},onUploadFailed:e=>{s.current.delete(l),h({title:n.i18n._({id:"b3Thhd",message:"Upload failed"}),description:e||n.i18n._({id:"mMMUzH",message:"Could not upload style reference image."}),status:"error",duration:5e3,isClosable:!0}),d(e=>{let t=e.find(e=>e.id===l);return t&&"uploading"===t.status&&URL.revokeObjectURL(t.previewUrl),e.filter(e=>e.id!==l)})}});u&&s.current.set(l,u.cancel)},[e.length,b,p?.id,a,f,h,r,t]),v=(0,er.useCallback)(t=>{let i=Array.from(t.target.files||[]).filter(e=>e.type.startsWith("image/"));if(0===i.length)return;let n=b-e.length;i.slice(0,n).forEach(e=>y(e)),o.current&&(o.current.value="")},[y,b,e.length]),C=(0,er.useCallback)(t=>{let i=t.filter(e=>e.type.startsWith("image/"));if(0===i.length)return;if(m)return void g();let n=b-e.length;i.slice(0,n).forEach(e=>y(e))},[y,b,e.length,m,g]),w=e1({uploadFiles:C,acceptedMimeTypes:["image/jpeg","image/png","image/gif","image/webp","image/heic","image/heif"],onDragStateChange:u}),S=(0,er.useCallback)(e=>{t(t=>t.filter(t=>t!==e)),d(t=>t.filter(t=>"complete"!==t.status||t.url!==e))},[t]),k=(0,er.useCallback)(e=>{let i=s.current.get(e);i&&(i(),s.current.delete(e)),d(i=>{let n=i.find(t=>t.id===e);return n&&"uploading"===n.status&&URL.revokeObjectURL(n.previewUrl),n&&"complete"===n.status&&t(e=>e.filter(e=>e!==n.url)),i.filter(t=>t.id!==e)})},[t]);(0,er.useEffect)(()=>()=>{s.current.forEach(e=>e()),s.current.clear()},[]);let A=(0,er.useCallback)(()=>{m?g():o.current?.click()},[m,g]),E=l.some(e=>"uploading"===e.status);return{entries:l,canAddMore:x,isDragging:c,isUploading:E,fileInputRef:o,handleFileSelect:v,handleUploadClick:A,handleRemove:S,handleCancelUpload:k,uploadFiles:C,dragDropProps:w}})({styleReferenceImages:tr,setStyleReferenceImages:to,model:U,enableModelAutoselect:tc,isAutoselectEnabled:td??!1}),tm=th?.isUploading??!1,tg=(0,e$.useAsStyleReference)({styleReferenceImages:tr,setStyleReferenceImages:to,artStylePreset:tt,setArtStylePreset:ti,model:U,modelAutoselect:td,enableModelAutoselect:tc}),tf=(0,er.useCallback)(e=>{L(no),tg(e)},[tg,L]),tb=te(e),tx=(0,eP.useScrollToOnImageNodeLoad)(r),ty=td?(0,eS.getAutoselectImageModel)({imageProvider:"aiGenerated",imageOptions:e9}):U,tv=(0,er.useMemo)(()=>{if(P)return tp?tp*(eJ||1):0;let e=(0,eC.getImageModelInfo)(ty);return(0,eC.shouldShowCostForImageModel)(ty,v,eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER)?(e?.cost||0)*(eJ||1):0},[ty,eJ,v,P,tp]),tC=(0,ex.useCreditWarning)({cost:tv,surface:"image-drawer",source:{segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES,upsellLocation:"credits.images"}}),{isEnhancing:tw,setIsEnhancing:tS,runEnhanceImagePrompt:tk,hasCardContent:tA}=(0,ek.useEnhanceImagePrompt)({editor:r?.parentEditor||r,prompt:r?.isSiteNavbarEditor?`Logo for ${h?.name}`:B,stylePrompt:en,styleReferenceKey:I&&T&&T!==no?T:void 0,addPrompt:z}),{history:tE,loadMore:t_,canLoadMore:tI,isLoading:tM,isLoadingMore:tT,deleteImage:tL,isDeleting:tj}=(0,eG.useAIImageHistory)({docId:f,scope:A,savedMediaContext:s,sources:[a.AI_IMAGE_SOURCE_KEY,a.AI_EDITED_IMAGE_SOURCE_KEY,a.AI_IMAGE_CARD_SOURCE_KEY]}),tP=(0,er.useCallback)(e=>{e.attrs.src&&(0,eu.trackAIImageSelected)({imageUrl:e.attrs.src,interactionId:e.interactionId,image:e.attrs})},[]),tD=(0,eN.useDebounced)(tP,2e3),tN=(0,er.useCallback)(e=>{e8(e.attrs,"select");let t=e.attrs.aiParams;t?.artStylePreset==="custom"||!t?.artStylePreset&&t?.styleReferenceImages?.length||(0,eK.isPreVMCustomImage)(t)?L(no):t?.styleReferenceKey?L(t.styleReferenceKey):L(void 0),i({tempUrl:(0,eO.resizeAndProxyImageUrl)(e.attrs.src,eO.THUMBNAIL_RESIZE_JPG_PARAMS,e.attrs.meta),showPlaceholder:!1,...e.attrs,savedCustomArtStyle:p.current}),r&&tx(r.state.selection.from),tD(e),S(!1)},[r,e8,tx,i,tD,L]),{generate:tR,isGenerating:tO,hasError:tB,errorMessage:tz,fallbackInfo:tF,resetFallbackInfo:tH}=(0,eZ.useImageGenerate)({selectImage:tN,savedMediaContext:s,generateImageInteraction:c,isImageCard:C}),tW=(0,er.useCallback)(e=>{tH(),V(e)},[tH,V]),tU=(0,G.useApolloClient)(),tV=(e?.source===a.AI_IMAGE_SOURCE_KEY||e?.source===a.AI_EDITED_IMAGE_SOURCE_KEY||e?.source===a.AI_IMAGE_CARD_SOURCE_KEY)&&!!e?.src,tG=e?.savedMediaId;(0,eR.useEffectWhen)(()=>{!tO&&(tV&&(e?.aiParams?.prompt||I&&e?.query)?(e8(e,"load"),I&&e?.query&&z(e.query,"load")):!tV&&e?.query&&z(e.query,"load"))},[z,e,tV,e8,tO,I],[e,I]),(0,er.useEffect)(()=>{setTimeout(()=>{b||u.current?.focus()},200)},[]);let t$=(0,er.useMemo)(()=>e?.aiParams?.interactionId||"",[e]),{savedMedia:tZ}=(0,ek.useGetImageHistoryForInteractionId)(t$,(I?e?.query:e?.aiParams?.prompt)||""),tK=(0,er.useCallback)(()=>{if(!r)return null;let{stylePreset:e,model:t,stylePrompt:i,modelAutoselect:n,artStylePreset:a,artStylePrompt:o,count:s,styleReferenceImages:l}=e9,d=r.getAttributes("document"),c={stylePreset:e,model:t,stylePrompt:e===eU.StylePresetIds.Custom?i:d.aiOptions?.imageOptions?.stylePrompt??"",...ns({showNewArtStyleUI:I,selectedStyleKey:T,artStylePreset:a,artStylePrompt:o,styleReferenceImages:l}),modelAutoselect:n,count:s};r.commands.updateNestedAttributesAtPos(0,{aiOptions:{imageOptions:c}})},[r,e9,T,I,N]);(0,er.useEffect)(()=>{tO&&!e?.showPlaceholder&&e?.src?i({showPlaceholder:!0,loadImageStatus:"queued",loadImageParams:{provider:"aiGenerated",query:B,options:e9}}):!tO&&e?.loadImageStatus==="queued"&&e?.src&&i({...e,loadImageStatus:"done"})},[tO]);let tq=(0,er.useCallback)(async()=>{if(!tw&&!tO&&!tm)try{let t={...e9,prompt:B},n=ns({showNewArtStyleUI:I,selectedStyleKey:T,artStylePreset:t.artStylePreset,artStylePrompt:t.artStylePrompt,styleReferenceImages:t.styleReferenceImages});if(t.artStylePreset=n.artStylePreset,t.artStylePrompt=n.artStylePrompt,t.styleReferenceImages=n.styleReferenceImages,t.styleReferenceKey=n.styleReferenceKey,n.styleReferenceKey&&(0,ed.setLastUsedStyleReferenceKey)(n.styleReferenceKey),C&&ts&&e?.aiParams?.themeId&&(t.themeId=e.aiParams.themeId),td&&(t.model=(0,eS.getAutoselectImageModel)({imageProvider:"aiGenerated",imageOptions:t})),0===B.trim().length&&!tu){let e=await tk();e&&(t.prompt=e)}if(c.current.start({input:{prompt:t.prompt,model:t.model,stylePreset:t.stylePreset||"",aspectRatio:t.aspectRatio||"",artStylePreset:t.artStylePreset,artStylePrompt:t.artStylePrompt}}),"custom"===t.artStylePreset||T===no){let e={artStylePrompt:t.artStylePrompt??"",styleReferenceImages:t.styleReferenceImages??[]};i({savedCustomArtStyle:e}),p.current=e}else p.current=e?.savedCustomArtStyle;await tR({...t,styledImageModelOverride:N}),tK()}catch(e){console.error("Error generating AI image",e)}finally{tU.refetchQueries({include:["GetSavedMedia","GetWorkspaceSavedMedia","GetUserSavedMedia"]}),tS(!1)}},[tw,tO,tm,B,c,tK,tk,tR,e9,tU,tS,td,C,e,ts,i,I,T,N]);(0,er.useEffect)(()=>{e?.query||tw||tu||tk()},[]);let tY=(0,ey.useAllowOrUpsell)(tq,"generateImage",eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES),tX=(0,er.useCallback)(()=>{tC?.isBlocking?tC.cta.onClick?.():tY()},[tC,tY]),tQ=(0,er.useCallback)(e=>{"Enter"===e.key&&e.metaKey&&(e.preventDefault(),tX()),e.stopPropagation()},[tX]),{saveImageRating:tJ}=(0,ek.useImageRatingStore)(),t0=(0,er.useCallback)(t=>{e?.aiParams?.interactionId&&((0,eu.trackAIImageRating)({rating:t,aiParams:e.aiParams,imageUrl:e.src,interactionId:e.aiParams.interactionId,savedMediaId:e.savedMediaId}),tJ(e,t))},[e,tJ]),t1=(0,er.useCallback)(async t=>{if(await tL(t),t===tG){let n=tZ.filter(e=>e.id!==t);n.length>0?tN(n[0]):i({...e,savedMediaId:"",src:"",tempUrl:""})}},[tL,e,tZ,tN,tG,i]),t2=(0,eG.providerUsesAIImagePanel)(e?.source),t3=e?.source!=="image.ai-edited"||w;return(0,t.jsxs)(ee.VStack,{spacing:4,align:"stretch",translate:"no",children:[(t2||tO||d)&&(0,t.jsx)(eB.AIImageCarousel,{imagesMatchingInteractionId:t$?tZ:[],currentAttributes:e,isGenerating:tO,isDeleting:tj,selectedSavedMediaId:tG??"",selectImage:tN,onRateImage:t0,deleteImage:t1,canShowEmptyState:d,canShowPreviewImage:!(e?.source==="image.ai-edited"&&t3)}),tB&&(0,t.jsxs)($.Alert,{status:"error",flexDirection:"row",alignItems:"start",justifyContent:"start",borderRadius:"md",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:tz})]}),!t3&&(0,t.jsx)(X.HStack,{spacing:1,align:"center",children:(0,t.jsx)(J.Text,{fontSize:"xs",color:"blue.950",fontWeight:"semibold",children:(0,t.jsx)(ea.Trans,{message:"Image settings unavailable. <0>Generate a new image?",id:"erZYPp",components:{0:(0,t.jsx)(Q.Link,{color:"blue.600",onClick:()=>{S(!0)}})}})})}),t3&&(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:4,children:[(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:1,children:[(0,t.jsx)(X.HStack,{position:"relative",align:"center",justify:"space-between",children:(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:tO?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Prompt",id:"sU1/3l"})})}),(0,t.jsxs)(q.Box,{position:"relative",children:[(0,t.jsx)(es.ResizingTextarea,{ref:u,isDisabled:tO||tu,placeholder:tu?n.i18n._({id:"t+VXet",message:"Prompt is not used for abstract styles"}):tw||s===ep.SavedMediaContext.Theme?"":s===ep.SavedMediaContext.Dashboard?I?n.i18n._({id:"yEbWuM",message:"Describe your image"}):n.i18n._({id:"+VHqP0",message:"Tip: Describe your image and use options below to adjust style and size."}):tA?n.i18n._({id:"1kmNOr",message:'Tip: click "Enhance prompt" to auto generate a prompt based on your card\'s content.'}):n.i18n._({id:"yEbWuM",message:"Describe your image"}),onKeyDown:tQ,value:B,onChange:e=>z(e.target.value,"update"),"data-testid":"image-search-input",rows:5,initialHeight:"65px",bottomSpacing:35,maxLength:ed.MAX_IMAGE_PROMPT_LENGTH}),r&&!tu&&(tA||B.trim())&&(0,t.jsx)(ez.AIImageEnhanceButton,{isEnhancingPrompt:tw,isGenerating:tO,runEnhancePrompt:tk})]}),B.length>=ed.MAX_IMAGE_PROMPT_LENGTH*ed.IMAGE_PROMPT_LENGTH_WARNING_THRESHOLD&&(0,t.jsx)(eo.CharacterLimitDisplay,{length:B.length,maxLength:ed.MAX_IMAGE_PROMPT_LENGTH}),F.total>1&&(0,t.jsx)(eE.PromptSelector,{alignSelf:"end",promptPageInfo:F,nextPrompt:H,prevPrompt:W,isDisabled:tO||tw})]}),(0,t.jsxs)(ee.VStack,{align:"stretch",gap:4,children:[(0,t.jsx)(nr,{showNewArtStyleUI:I,workspaceId:j,artStylePreset:tt,setArtStylePreset:ti,artStylePrompt:tn,setCustomArtStylePrompt:ta,styleReferenceImages:tr,styleReferenceUpload:th,model:U,setModel:tW,modelAutoselect:td,enableModelAutoselect:tc,isGenerating:tO,isImageCard:C,persistedStyleKey:M,selectedStyleKey:T,setSelectedStyleKey:L,styledImageModelOverride:N,setStyledImageModelOverride:R,shouldUseThemeColors:ts,setShouldUseThemeColors:tl,hasHistory:tE.length>0,editor:!!r,closeDrawer:l}),tu&&(0,t.jsxs)($.Alert,{status:"info",borderRadius:"md",fontSize:"sm",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"Abstract styles generate patterns without using a prompt.",id:"f0XG+x"})})]}),(0,t.jsxs)(X.HStack,{w:"100%",children:[eY&&eQ&&(0,t.jsxs)(ee.VStack,{flex:1,align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:tO?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Aspect ratio",id:"iKM2jY"})}),(0,t.jsx)(eW.AspectRatioSelect,{value:eY,setValue:eQ,model:U,isDisabled:tO})]}),null!=eJ&&e0&&(0,t.jsxs)(ee.VStack,{flex:1,align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:tO?"gray.500":"",children:I?(0,t.jsx)(ea.Trans,{message:"Images",id:"CL+904"}):(0,t.jsx)(ea.Trans,{message:"Image count",id:"/6qX5m"})}),(0,t.jsx)(eV.CountSelect,{value:eJ,setValue:e0,isDisabled:tO,model:U,credits:y})]}),!I&&(0,t.jsxs)(ee.VStack,{flex:2,align:"stretch",children:[(0,t.jsxs)(X.HStack,{spacing:1,align:"center",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:tO?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Model",id:"scu3wk"})}),(0,t.jsx)(nl,{fallbackInfo:tF,modelAutoselect:td,hasStyleReferences:"custom"===tt&&tr.length>0})]}),U&&(0,t.jsx)(t4,{value:U,setValue:tW,isDisabled:tO,modelFilter:e=>eI.AI_IMAGE_SUPPORTED_MODELS.has(e.model)&&!e.isVideoModel&&(!C||(0,eC.canModelMakeImageCards)(e.model)),autoselect:{isActive:td,onChooseAutoselect:tc,model:(0,eS.getAutoselectImageModel)({imageProvider:"aiGenerated",imageOptions:{artStylePreset:tt,styleReferenceImages:tr}})},hasStyleReferences:"custom"===tt&&tr.length>0,context:eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER})]})]})]}),tC&&(0,t.jsx)(el.UpsellWarningBox,{status:tC.status,onClick:tC.cta.onClick,title:tC.title,cta:tC.cta.label,ctaTooltip:tC.cta.tooltip}),(0,t.jsxs)(ee.VStack,{spacing:1,align:"stretch",children:[(0,t.jsx)(eb.CreditWarningTooltip,{creditWarning:tC,children:(0,t.jsxs)(Y.Button,{variant:"solid",isLoading:tO,isDisabled:tw||tm,onClick:tX,px:12,children:[(0,t.jsx)(ea.Trans,{message:"Generate",id:"OSaxlZ"}),P?null!=tp&&(0,t.jsx)(ef.CreditCostBadgeWithTooltip,{totalCredits:tp*(eJ||1),position:"absolute",insetEnd:4}):(0,t.jsx)(eg.AIImageCreditCostIcon,{model:ty,position:"absolute",insetEnd:4,multiplier:eJ,context:eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER})]})}),r&&(0,t.jsx)(Y.Button,{onClick:()=>e7(e),leftIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faRotateLeft}),isDisabled:!tb||tO,sx:{opacity:tb?1:.5,transition:"opacity 0.2s ease-in-out",_hover:{color:tb?"trueblue.500":""}},children:(0,t.jsx)(ea.Trans,{message:"Reset to default",id:"L+rMC9"})}),(0,t.jsx)(em.AICreditsBadgeAndModalWithOfflineCheck,{modalId:"ai-credits-modal-message-list",variant:"ghost",justify:"flex-end",segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES,upsellLocation:"credits.images"})]})]}),r&&(x?(0,t.jsx)(eH.AIImageHistoryTabs,{onSelectImage:tN,savedMediaId:tG,currentAttributes:e,scope:A,setScope:E,canLoadMore:tI,loadMore:t_,isLoading:tM,isLoadingMore:tT,history:tE,deleteImage:t1,isDeleting:tj,resizeThumbnails:!0,onUseAsStyleReference:th?tf:void 0}):(0,t.jsx)(eF.AIImageHistory,{onSelectImage:tN,savedMediaId:tG,currentAttributes:e,scope:A,setScope:E,canLoadMore:tI,loadMore:t_,isLoading:tM,isLoadingMore:tT,history:tE,deleteImage:t1,isDeleting:tj,resizeThumbnails:!0,onUseAsStyleReference:th?tf:void 0}))]})};nd.key="image.ai-generated";var nu=e.i(96095);e.i(144786);var np=e.i(275316),nh=e.i(103104),nm=e.i(115664);let ng={src:e.i(292888).default,width:400,height:267,blurWidth:8,blurHeight:5,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAIAAAD38zoCAAAAiElEQVR42gF9AIL/AJiHr5uErJyCq5uBqZh+p5yAqp6ArJ+ArQC5g6m8gKi9fqaibpGYaYq3eqS7fai7fakAxISqx4GpxX2lb0tgWUBPs3Wcw32pxH2pAMqGrcyErMuAqZVgfHZQZat0m7d7prt8qADOh6/Qha3Qg6zPgqvPgKnNf6nNfqjMf6pTMkfgJLRK/wAAAABJRU5ErkJggg=="},nf={src:e.i(727178).default,width:163,height:138,blurWidth:8,blurHeight:7,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAA8klEQVR42gHnABj/ABNFYnkdKjOsEh0kaQsaIj0KExg0ERgdYAUPFBoCCAsMACmIwf4pOEP+Rjw0+FxaNu9HRDTpUGRS7id4p84gb566AC+Iv/89PUv/b1E7/4qaPP9rakL/c5hU/zyUwv8wltP7ADaEuP8sMTj/LCYk/zg0Lf8vKyn/Mzc1/zqEtP85mNX7AEuUzP9sXHH/QjAz/y0lJP8oIR//NTVC/0ONwv9Bm9b7AJuRuvLZhqn5xW+R/ZxVdf+CP2T/iUV+/39zsP9Vlc/7AEMqNEZXMD5ZbDtNb4BEW4eORmWhkD5qubRdhM6UbZzaSsVob96Jw38AAAAASUVORK5CYII="};var nb=e.i(551880),nx=e.i(136234),ny=e.i(312965);let nv=e=>{if(!e)return!1;let t=eC.IMAGE_GENERATE_MODELS[e];return!!t?.isVideoModel};var nC=e.i(454519),nw=e.i(776204),nS=e.i(974994),nk=e.i(295651),nA=e.i(159080);let nE=nA.gql` mutation GenerateAnimation($input: GenerateAnimationInput!) { generateAnimation(input: $input) { id attrs workspaceId userId } } `;e.s(["GENERATE_ANIMATION_MUTATION",0,nE],412676);let n_=(0,er.memo)(({currentAttributes:e,isGenerating:i,showDeleteAction:n,deleteVideo:a,canUseAnimations:r})=>i?(0,t.jsx)(nu.Skeleton,{w:"100%",h:250,borderRadius:"md"}):e.src&&e.source===nC.AI_ANIMATION_SOURCE_KEY?(0,t.jsxs)(e9.Flex,{position:"relative",overflow:"hidden",borderRadius:"md",children:[(0,t.jsx)(eO.ImageOrVideo,{h:250,w:"100%",objectFit:"contain",src:e.src||void 0,fallbackSrc:e.tempUrl||void 0,alt:"",borderRadius:"md"}),!i&&e.src&&n&&(0,t.jsx)(nm.AIImageActions,{currentAttributes:e,position:"absolute",bottom:2,zIndex:"sticky",insetStart:2,deleteImage:a,showDelete:n})]}):(0,t.jsx)(nM,{height:250,canUseAnimations:r}));n_.displayName="VideoDisplay";let nI=nh.ULTRA_PROPER_NOUN.toUpperCase(),nM=(0,er.memo)(({height:e,canUseAnimations:i})=>(0,t.jsx)(q.Box,{bg:"gray.50",w:"100%",h:e,p:5,borderRadius:"lg",border:"1px solid",borderColor:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",children:(0,t.jsx)(e9.Flex,{alignItems:"center",justifyContent:"center",direction:"column",textAlign:"center",children:i?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(te.Image,{alt:"",src:nf.src,height:"128px",mb:3}),(0,t.jsx)(J.Text,{fontSize:"xl",fontWeight:"bold",mb:1,color:"blue.950",children:(0,t.jsx)(ea.Trans,{message:"Create videos with AI",id:"ODfPAV"})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.600",children:(0,t.jsx)(ea.Trans,{message:"Describe what you want to see with a prompt below",id:"ztxdaf"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q.Box,{transform:"skewY(5deg)",overflow:"hidden",borderRadius:8,mb:3,children:(0,t.jsx)(te.Image,{alt:n.i18n._({id:"vUzipW",message:"Upgrade to access AI animations"}),src:ng.src,width:"140px",height:"105px",objectFit:"cover",transform:"skewY(-5deg) scale(1.1)"})}),(0,t.jsx)(J.Text,{fontSize:"lg",fontWeight:"bold",mb:1,color:"blue.950",children:(0,t.jsx)(ea.Trans,{message:"Create AI animations",id:"2flkY7"})}),(0,t.jsx)(J.Text,{fontSize:"xs",color:"gray.600",children:(0,t.jsx)(ea.Trans,{message:"Upgrade your plan to {ULTRA_PROPER_NOUN_UPPER} to begin creating AI animations.",id:"lsrs2d",values:{ULTRA_PROPER_NOUN_UPPER:nI}})})]})})}));nM.displayName="EmptyState";let nT=({currentAttributes:e,updateAttributes:i,editor:a,contextualTheme:r,savedMediaContext:o,closeDrawer:s})=>{let l=(0,G.useApolloClient)(),d=(0,ec.useAIInteraction)("generate-image"),{user:c}=(0,e3.useUserContext)(),{isInOfflineMode:u}=(0,eh.useHealthCheck)(),p=(0,ty.useCanUseProductFeature)("ai_models_ultra"),{openUpsellModal:h}=(0,eM.useMonetizationContext)(),m=(0,eT.useAppSelector)(nb.selectThemeId),g=(0,eT.useAppSelector)(ev.selectDoc),f=(0,eT.useAppSelector)(ev.selectFileWorkspace),b=g?.id,x=(0,eT.useAppSelector)((0,eD.selectIsMemberOfCurrentDocWorkspace)(f?.id)),y=(0,er.useRef)(null),v=(0,er.useMemo)(()=>a?"doc":"user",[a]),[C,w]=(0,er.useState)(v),{prompt:S,setPrompt:k,model:A,setModel:E,aspectRatio:_,setAspectRatio:I,artStylePreset:M,setArtStylePreset:T,artStylePrompt:L,setCustomArtStylePrompt:j,modelAutoselect:P,enableModelAutoselect:D,shouldUseThemeColors:N,setShouldUseThemeColors:R,videoGenerateConfig:O,loadVideoAiParams:B,resetVideoAiParams:z,isPromptDirty:F}=(({lastUsedVideoGenerationSettingsInDoc:e,aiParams:t})=>{let[i,n]=(0,er.useState)(t?.prompt??""),[a,r]=(0,er.useState)(!0),[o,s]=(0,er.useState)(()=>t?t.modelAutoselect??!1:e?.modelAutoselect??!1),l=(0,er.useCallback)(()=>{s(!0)},[]),d=nv(t?.model)?t?.model:void 0,c=nv(e?.model)?e?.model:void 0,[u,p]=(0,er.useState)(d??c??np.featureFlags.get("aiGeneratedVideosDefaultModel")),h=(0,er.useCallback)(e=>{s(!1),p(e)},[]),[m,g]=(0,er.useState)(t?.aspectRatio??(t?.height&&t?.width?(0,ny.getAspectRatio)({height:t.height,width:t.width}):void 0)??e?.aspectRatio??nx.DEFAULT_ASPECT_RATIO),[f,b]=(0,er.useState)(()=>t?.artStylePreset&&t.artStylePreset in eU.ART_STYLE_PRESETS?t.artStylePreset:e?.artStylePreset&&e.artStylePreset in eU.ART_STYLE_PRESETS?e.artStylePreset:(0,io.getDefaultArtStylePreset)()),[x,y]=(0,er.useState)(()=>"custom"===f?t?.artStylePrompt??"":eU.ART_STYLE_PRESETS[f]?.prompt??""),v=(0,er.useCallback)(e=>{b(e),y(eU.ART_STYLE_PRESETS[e].prompt)},[b,y]),C=(0,er.useCallback)(e=>{y(e)},[]),w=(0,er.useMemo)(()=>({prompt:i,model:u,aspectRatio:m,artStylePreset:f,artStylePrompt:x,modelAutoselect:o,stylePreset:a?"Theme":"None"}),[i,u,m,f,x,o,a]),S=(0,er.useCallback)(e=>{g((0,ny.getImageAspectRatio)(e)),e.aiParams&&(n(e.aiParams.prompt??""),e.aiParams.model&&nv(e.aiParams.model)&&h(e.aiParams.model),"artStylePreset"in e.aiParams&&e.aiParams.artStylePreset&&v(e.aiParams.artStylePreset),"artStylePrompt"in e.aiParams&&e.aiParams.artStylePrompt&&y(e.aiParams.artStylePrompt))},[]),k=(0,er.useCallback)(e=>{e&&(g((0,ny.getImageAspectRatio)(e)),e.aiParams&&(n(e.aiParams.prompt??""),e.aiParams.model&&nv(e.aiParams.model)&&h(e.aiParams.model),"artStylePreset"in e.aiParams&&e.aiParams.artStylePreset&&v(e.aiParams.artStylePreset),"artStylePrompt"in e.aiParams&&e.aiParams.artStylePrompt&&y(e.aiParams.artStylePrompt)))},[]),A=(0,er.useCallback)(e=>{if(!e?.aiParams)return!1;let t=e.aiParams,n="artStylePreset"in t?t.artStylePreset:void 0,a="artStylePrompt"in t?t.artStylePrompt:void 0;return i!==(t.prompt??"")||u!==t.model||m!==(0,ny.getImageAspectRatio)(e)||f!==n||x!==a},[i,u,m,f,x]);return{prompt:i,setPrompt:n,model:u,setModel:h,aspectRatio:m,setAspectRatio:g,artStylePreset:f,setArtStylePreset:v,artStylePrompt:x,setCustomArtStylePrompt:C,modelAutoselect:o,enableModelAutoselect:l,shouldUseThemeColors:a,setShouldUseThemeColors:r,videoGenerateConfig:w,loadVideoAiParams:S,resetVideoAiParams:k,isPromptDirty:A}})({contextualTheme:r,lastUsedVideoGenerationSettingsInDoc:a?.getAttributes("document")?.aiOptions?.videoOptions,aiParams:e?.aiParams??void 0,savedMediaContext:o}),H=F(e),W=(0,eP.useScrollToOnImageNodeLoad)(a),{history:U,loadMore:V,canLoadMore:eo,isLoading:ed,isLoadingMore:eu,deleteImage:em,isDeleting:eg}=(0,eG.useAIImageHistory)({docId:b,scope:C,savedMediaContext:o,mediaTypes:[ep.MediaType.Video],sources:["image.ai-animated"]}),ef=(0,er.useCallback)(e=>{B(e.attrs,"select");let t={...e.attrs,source:nC.AI_ANIMATION_SOURCE_KEY};i({tempUrl:(0,eO.resizeAndProxyImageUrl)(e.attrs.src,eO.THUMBNAIL_RESIZE_JPG_PARAMS,e.attrs.meta),showPlaceholder:!1,...t}),a&&W(a.state.selection.from)},[a,B,W,i]),{generate:ey,isGenerating:ew,hasError:eS,errorMessage:ek}=(({selectImage:e,savedMediaContext:t,generateImageInteraction:i})=>{let n,a=(0,eT.useAppSelector)(ev.selectDocId),r=(0,eT.useAppSelector)(nk.selectEditingThemeId),o=(0,e6.useWorkspaceIdForAIImageContext)(t);"new"===r&&(r=void 0,n=ep.SavedMediaContext.Theme);let[s,l]=(0,er.useState)(""),[d,c]=(0,er.useState)(!1),[u,p]=(0,er.useState)(!1),[h,m]=(0,er.useState)(""),[g]=(0,nw.useMutation)(nE);return{generate:(0,er.useCallback)(async t=>{let s=i.current.id;l(t.prompt),c(!0),p(!1),m("");let d=t.themeId||r,u=t.docId||a,h=t.context||n;try{let{data:n}=await g({variables:{input:{workspaceId:o,docId:u,themeId:d,interactionId:s,prompt:t.prompt,count:t.count||1,aspectRatio:t.aspectRatio,context:h,model:t.model,sourceImageUrl:t.sourceImageUrl,stylePreset:t.stylePreset,artStylePreset:t.artStylePreset,artStylePrompt:t.artStylePrompt}},context:{...(0,nS.getAiMediaGraphqlContext)(),headers:{"aijsx-traceparent":i.current.traceparent}}});c(!1);let a=n?.generateAnimation||[];if(0===a.length)throw Error("No videos generated");a.length>0&&(e(a[0]),i.current.complete({result:{imageCount:a.length,images:a.map(e=>({imageUrl:e.attrs.src||"",savedMediaId:e.id}))}}))}catch(e){p(!0),m((0,eC.imageGenerateErrorMessage)(e)),c(!1)}},[a,r,n,o,e,i,g]),isGenerating:d,hasError:u,errorMessage:h,searchQuery:s}})({selectImage:ef,savedMediaContext:void 0,generateImageInteraction:d});(0,eR.useEffectWhen)(()=>{!ew&&e?.src&&B(e,"load")},[e,B,ew],[e]),(0,er.useEffect)(()=>{setTimeout(()=>{u||y.current?.focus()},200)},[]);let eA=(0,ex.useCreditWarning)({cost:A?(0,eC.getImageModelInfo)(A).cost:0,surface:"image-drawer",source:{segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES,upsellLocation:"credits.animation"}}),eE=(0,er.useCallback)(async()=>{if(!p)return void h({targetFeature:"ai_models_ultra",segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_ANIMATIONS,upsellLocation:"aiAnimations"});if(eA?.isBlocking)return void eA.cta.onClick?.();if(!ew)try{let e={prompt:S.trim(),aspectRatio:_,model:A,themeId:m,artStylePreset:M,artStylePrompt:L,stylePreset:O.stylePreset,workspaceId:f?.id};d.current.start({input:{prompt:e.prompt,model:e.model,stylePreset:e.stylePreset,aspectRatio:e.aspectRatio||"",artStylePreset:e.artStylePreset,artStylePrompt:e.artStylePrompt}}),await ey(e)}catch(e){console.error("Error generating AI video",e)}finally{l.refetchQueries({include:["GetSavedMedia","GetWorkspaceSavedMedia","GetUserSavedMedia"]})}},[p,h,eA,ew,S,_,A,m,M,L,O.stylePreset,d,ey,f?.id,l]),e_=(0,er.useCallback)(e=>{"Enter"===e.key&&e.metaKey&&(e.preventDefault(),eE()),e.stopPropagation()},[eE]),eI=S.trim().length>0&&!ew,ej=e?.source===nC.AI_ANIMATION_SOURCE_KEY&&!!e?.src,eN=e?.savedMediaId,eB=(0,er.useCallback)(async t=>{await em(t),t===eN&&i({...e,savedMediaId:"",src:"",tempUrl:""})},[em,e,eN,i]),ez=(0,er.useMemo)(()=>ej&&!!c?.id,[ej,c]);return(0,t.jsxs)(ee.VStack,{spacing:4,align:"stretch",translate:"no",children:[(0,t.jsx)(n_,{currentAttributes:e,isGenerating:ew,showDeleteAction:ez,deleteVideo:eB,canUseAnimations:p}),eS&&(0,t.jsxs)($.Alert,{status:"error",flexDirection:"row",alignItems:"start",justifyContent:"start",borderRadius:"md",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:ek})]}),u&&(0,t.jsxs)($.Alert,{status:"warning",borderRadius:"md",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"Video generation is not available while offline. Please check your connection.",id:"208K0n"})})]}),(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:1,children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:ew?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Prompt",id:"sU1/3l"})}),(0,t.jsx)(q.Box,{position:"relative",children:(0,t.jsx)(es.ResizingTextarea,{ref:y,isDisabled:ew,placeholder:n.i18n._({id:"0MQ4vW",message:"Describe the video you want to generate..."}),onKeyDown:e_,value:S,onChange:e=>k(e.target.value),"data-testid":"video-search-input",rows:5,initialHeight:"65px"})})]}),(0,t.jsxs)(ee.VStack,{align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:ew?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Art style",id:"hx6ved"})}),(0,t.jsx)(is,{selectedPreset:M,onSelectPreset:T}),"custom"===M&&(0,t.jsx)(it.Textarea,{value:L,onChange:e=>j(e.target.value),placeholder:n.i18n._({id:"arj7P5",message:"Describe your video art style"}),fontSize:"sm",rows:2,resize:"none"}),a&&(0,t.jsxs)(X.HStack,{spacing:2,align:"start",alignItems:"center",gap:2,children:[(0,t.jsx)(t6.Checkbox,{id:"use-theme-colors-video",isChecked:N,onChange:e=>R(e.target.checked)}),(0,t.jsx)(t9.FormLabel,{htmlFor:"use-theme-colors-video",mb:0,me:0,children:(0,t.jsx)(J.Text,{fontSize:"xs",children:(0,t.jsx)(ea.Trans,{message:"Use theme style",id:"ge5rTg"})})}),(0,t.jsx)(en.GammaTooltip,{label:n.i18n._({id:"1dBL9E",message:"Videos will use the style prompt from your theme"}),children:(0,t.jsx)(ei.FontAwesomeIcon,{size:"xs",icon:et.faCircleInfo})}),(0,t.jsx)(J.Text,{fontSize:"xs",children:(0,t.jsx)(Q.Link,{color:"blue.600",onClick:()=>{s?.(),t8.TiptapEventBus.emit(t8.EventBusEvent.OPEN_THEME_DRAWER,{})},children:(0,t.jsx)(ea.Trans,{message:"View theme",id:"dIM+cw"})})})]})]}),(0,t.jsxs)(X.HStack,{w:"100%",children:[(0,t.jsxs)(ee.VStack,{align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:ew?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Aspect ratio",id:"iKM2jY"})}),(0,t.jsx)(eW.AspectRatioSelect,{value:_,setValue:I,model:A,isDisabled:ew})]}),(0,t.jsxs)(ee.VStack,{flex:1,align:"stretch",children:[(0,t.jsx)(J.Text,{fontSize:"sm",fontWeight:"semibold",color:ew?"gray.500":"",children:(0,t.jsx)(ea.Trans,{message:"Model",id:"scu3wk"})}),A&&(0,t.jsx)(t4,{hasStyleReferences:!1,value:A,setValue:E,isDisabled:ew,modelFilter:e=>!!e.isVideoModel,autoselect:{isActive:P,onChooseAutoselect:D,model:np.featureFlags.get("aiGeneratedVideosDefaultModel")},context:eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER})]})]}),eA&&p&&(0,t.jsx)(el.UpsellWarningBox,{status:eA.status,onClick:eA.cta.onClick,title:eA.title,cta:eA.cta.label,ctaTooltip:eA.cta.tooltip}),(0,t.jsxs)(ee.VStack,{spacing:1,align:"stretch",children:[(0,t.jsx)(eb.CreditWarningTooltip,{creditWarning:p?eA:null,children:(0,t.jsxs)(Y.Button,{variant:"solid",isLoading:ew,isDisabled:!!p&&(!eI||u),onClick:eE,px:12,children:[(0,t.jsx)(ea.Trans,{message:"Generate",id:"p+BwAm"}),(0,t.jsx)(tw.UpsellProductBadge,{canUseFeature:p,productFeature:"ai_models_ultra",marginInlineStart:2,lightGradient:!0})]})}),a&&(0,t.jsx)(Y.Button,{onClick:()=>z(e),leftIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faRotateLeft}),isDisabled:!H||ew,sx:{opacity:H?1:.5,transition:"opacity 0.2s ease-in-out",_hover:{color:H?"trueblue.500":""}},children:(0,t.jsx)(ea.Trans,{message:"Reset to default",id:"L+rMC9"})})]}),a&&(x?(0,t.jsx)(eH.AIImageHistoryTabs,{onSelectImage:ef,savedMediaId:eN,currentAttributes:e,scope:C,setScope:w,canLoadMore:eo,loadMore:V,isLoading:ed,isLoadingMore:eu,history:U,deleteImage:eB,isDeleting:eg,resizeThumbnails:!0}):null)]})};nT.key=nC.AI_ANIMATION_SOURCE_KEY;var nL=e.i(775274),nj=e.i(849187),nP=e.i(838825),nD=e.i(379557);let nN=({itemKeys:e,items:i,selectedKey:n,onSelect:a,categoryLabel:r})=>(0,t.jsxs)(q.Box,{children:[r&&(0,t.jsx)(J.Text,{fontSize:"lg",fontWeight:"semibold",mb:3,children:r}),(0,t.jsx)(iH.Grid,{templateColumns:"repeat(8, 1fr)",gap:3,children:e.map(e=>{let r=i[e];if(!r)return null;let o=(r.previewImages||r.urls||[])[0],s=n===e,l="function"==typeof r.name?r.name():r.name;return(0,t.jsxs)(ee.VStack,{spacing:2,w:"110px",alignItems:"start",children:[(0,t.jsx)(q.Box,{cursor:"pointer",onClick:()=>a(e),borderRadius:"md",overflow:"hidden",border:"2px solid",borderColor:s?"blue.500":"gray.200",bg:"gray.100",transition:"all 0.2s",w:"100%",_hover:{borderColor:"blue.400",shadow:"md"},children:(0,t.jsx)(q.Box,{w:"110px",h:"110px",children:o&&(0,t.jsx)(te.Image,{src:o,alt:l,w:"100%",h:"100%",objectFit:"contain",opacity:s?1:.85,transition:"opacity 0.2s"})})}),(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:s?"bold":"medium",noOfLines:1,whiteSpace:"nowrap",textAlign:"start",lineHeight:"1.2",w:"100%",children:l})]},e)})})]}),nR={src:e.i(883811).default,width:300,height:300,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAA00lEQVR42gHIADf/AB5/vBiAvBKBuxCAuBF/txJ+txR9txh8tQAZgb4Vgr0tjK1cmpVQlZcnhqwRf7cWfLYAFYPAL4ivjpGFtpWRnm2EaV6GL3mwFH64ABWFwGqWnrGAhqlXcppSa3tIemNaoRp9uAAYhsCUl6rYfpTLUnWxRG2GSYR8TJYpeLQAFoG7ppWq43+X1l2AwUV1mT+Gh0eTP2yrADaCqsmcoOSDmtxsi8tQeqs+fY1Cj31QlQCLlqXhmaHkiZ3geJPYWXu9PnOVP4mTQ47GNl+z6BH5/wAAAABJRU5ErkJggg=="};e.s(["default",0,nR],268496);let nO=({text:e})=>(0,t.jsx)(q.Box,{border:"1px dashed",borderColor:"gray.300",borderRadius:"md",p:3,children:(0,t.jsxs)(e9.Flex,{direction:"row",align:"center",gap:6,children:[(0,t.jsx)(q.Box,{border:"1px solid",borderColor:"blackAlpha.100",bg:"blackAlpha.50",borderRadius:"md",boxShadow:"sm",p:2,flexShrink:0,children:(0,t.jsxs)(tp.Stack,{maxW:"100%",alignItems:"center",children:[(0,t.jsx)(q.Box,{borderRadius:"md",overflow:"hidden",w:"90px",children:(0,t.jsx)(te.Image,{src:nR.src,alt:"",h:"5em",objectFit:"cover",w:"100%"})}),(0,t.jsx)(J.Text,{fontSize:"xs",textAlign:"center",color:"gray.700",fontWeight:"semibold",lineHeight:"1.2",children:(0,t.jsx)(ea.Trans,{message:"Nothing here!",id:"nUBsbk"})})]})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",flex:1,fontWeight:"semibold",children:e})]})}),nB=({recentlyUsedKeys:e,items:i,selectedKey:n,onSelect:a,emptyStateText:r})=>{let o=e.length>0;return(0,t.jsxs)(tp.Stack,{spacing:3,children:[(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faClock,fixedWidth:!0}),(0,t.jsx)(J.Text,{fontSize:"lg",fontWeight:"semibold",children:(0,t.jsx)(ea.Trans,{message:"Recently used",id:"uabU9X"})})]}),o?(0,t.jsx)(iH.Grid,{templateColumns:"repeat(8, 1fr)",gap:3,children:e.map(e=>{let r=i[e];if(!r)return null;let o=(r.previewImages||r.urls||[])[0],s=n===e,l="function"==typeof r.name?r.name():r.name;return(0,t.jsxs)(tp.Stack,{spacing:2,w:"110px",alignItems:"start",children:[(0,t.jsx)(q.Box,{cursor:"pointer",onClick:()=>a(e),borderRadius:"md",overflow:"hidden",border:"2px solid",borderColor:s?"blue.500":"gray.200",bg:"gray.100",transition:"all 0.2s",w:"100%",_hover:{borderColor:"blue.400",shadow:"md"},children:(0,t.jsx)(q.Box,{w:"110px",h:"110px",children:o&&(0,t.jsx)(te.Image,{src:o,alt:l,w:"100%",h:"100%",objectFit:"contain",opacity:s?1:.85,transition:"opacity 0.2s"})})}),(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:s?"bold":"medium",noOfLines:1,whiteSpace:"nowrap",textAlign:"start",lineHeight:"1.2",w:"100%",children:l})]},e)})}):(0,t.jsx)(nO,{text:r})]})},nz={src:e.i(917509).default,width:200,height:200,blurWidth:0,blurHeight:0},nF={src:e.i(91180).default,width:200,height:200,blurWidth:0,blurHeight:0},nH={src:e.i(812359).default,width:200,height:200,blurWidth:0,blurHeight:0},nW={src:e.i(928265).default,width:200,height:200,blurWidth:0,blurHeight:0},nU={src:e.i(359062).default,width:200,height:200,blurWidth:0,blurHeight:0},nV={src:e.i(326486).default,width:200,height:200,blurWidth:0,blurHeight:0},nG={src:e.i(590291).default,width:200,height:200,blurWidth:0,blurHeight:0},n$={src:e.i(281280).default,width:200,height:200,blurWidth:0,blurHeight:0},nZ={src:e.i(908484).default,width:240,height:240,blurWidth:8,blurHeight:8,blurDataURL:"data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/wAARCAAIAAgDAREAAhEBAxEB/9sAQwAKBwcIBwYKCAgICwoKCw4YEA4NDQ4dFRYRGCMfJSQiHyIhJis3LyYpNCkhIjBBMTQ5Oz4+PiUuRElDPEg3PT47/9sAQwEKCwsODQ4cEBAcOygiKDs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD1P5t/+zikM//Z"},nK={src:e.i(826557).default,width:200,height:200,blurWidth:0,blurHeight:0},nq={src:e.i(806980).default,width:200,height:200,blurWidth:0,blurHeight:0},nY={src:e.i(438302).default,width:200,height:200,blurWidth:0,blurHeight:0},nX={src:e.i(721476).default,width:200,height:200,blurWidth:0,blurHeight:0},nQ={src:e.i(423261).default,width:200,height:200,blurWidth:0,blurHeight:0},nJ={src:e.i(788083).default,width:200,height:200,blurWidth:0,blurHeight:0},n0={src:e.i(190588).default,width:200,height:200,blurWidth:0,blurHeight:0},n1={src:e.i(616059).default,width:200,height:200,blurWidth:0,blurHeight:0},n2={src:e.i(664441).default,width:200,height:200,blurWidth:0,blurHeight:0},n3={src:e.i(712264).default,width:200,height:200,blurWidth:0,blurHeight:0},n5={src:e.i(413176).default,width:200,height:200,blurWidth:0,blurHeight:0},n4={automatic:{name:()=>n.i18n._({id:"XBecWB",message:"Automatic"}),previewImages:[nZ.src]},none:{name:()=>n.i18n._({id:"SIrxZ3",message:"No layout"}),previewImages:[nZ.src]},flywheel:{name:()=>n.i18n._({id:"o4NK/7",message:"Flywheel"}),previewImages:[nU.src]},pieChart:{name:()=>n.i18n._({id:"K4Gy6E",message:"Pie Chart"}),previewImages:[n$.src]},pyramid:{name:()=>n.i18n._({id:"N2x0zy",message:"Pyramid"}),previewImages:[nK.src]},road:{name:()=>n.i18n._({id:"xClgwv",message:"Road"}),previewImages:[nY.src]},flow:{name:()=>n.i18n._({id:"gz3HDR",message:"Flow"}),previewImages:[nW.src]},funnel:{name:()=>n.i18n._({id:"7XbWut",message:"Funnel"}),previewImages:[nV.src]},hub:{name:()=>n.i18n._({id:"SaWF5S",message:"Hub and Spoke"}),previewImages:[nG.src]},timeline:{name:()=>n.i18n._({id:"/8POsT",message:"Timeline"}),previewImages:[n2.src]},collage:{name:()=>n.i18n._({id:"M3Fs4a",message:"Collage"}),previewImages:[nF.src]},venn:{name:()=>n.i18n._({id:"81vaiL",message:"Venn diagram"}),previewImages:[n5.src]},tile:{name:()=>n.i18n._({id:"fJC0Qn",message:"Tile Grid"}),previewImages:[n1.src]},tree:{name:()=>n.i18n._({id:"IBvBVM",message:"Tree Diagram"}),previewImages:[n3.src]},split:{name:()=>n.i18n._({id:"rlthLL",message:"Split Comparison"}),previewImages:[nQ.src]},staircase:{name:()=>n.i18n._({id:"gDHPrt",message:"Staircase/Steps"}),previewImages:[nJ.src]},swot:{name:()=>n.i18n._({id:"qK8Rjt",message:"Quadrant"}),previewImages:[nq.src]},chevron:{name:()=>n.i18n._({id:"lsUXRS",message:"Chevron/Arrow Chain"}),previewImages:[nz.src]},segmented:{name:()=>n.i18n._({id:"fmlUYy",message:"Segmented Bar"}),previewImages:[nX.src]},swimlanes:{name:()=>n.i18n._({id:"EPfBr5",message:"Process Flow with Swimlanes"}),previewImages:[n0.src]},fishbone:{name:()=>n.i18n._({id:"cpYfXp",message:"Fishbone/Ishikawa"}),previewImages:[nH.src]}},n6=Object.keys(n4),n9="automatic",n8="none",n7={automatic:()=>n.i18n._({id:"uyPoCz",message:"We choose the best layout for you based on your prompt"}),none:()=>n.i18n._({id:"UdZ3yP",message:"Generate freely without a preset structure"}),flywheel:()=>n.i18n._({id:"ax02Hf",message:"A cycle of ideas"}),pieChart:()=>n.i18n._({id:"Or0/Dd",message:"Infographic of ideas divided into slices"}),pyramid:()=>n.i18n._({id:"PMkrqY",message:"Stacked tiers from a wide foundation to a narrow top"}),road:()=>n.i18n._({id:"ewqgYb",message:"Winding path with alternating nodes or milestones"}),flow:()=>n.i18n._({id:"Mcco7K",message:"Smooth path of connecting nodes"}),funnel:()=>n.i18n._({id:"hIQGuO",message:"Progressive filtering through stages"}),hub:()=>n.i18n._({id:"iVVa1k",message:"Central circle as focal point with points radiating out"}),timeline:()=>n.i18n._({id:"5Io3sV",message:"Linear chronological progression of events"}),collage:()=>n.i18n._({id:"2jVjOz",message:"Clustered arrangement of ideas"}),venn:()=>n.i18n._({id:"H97S2q",message:"Two or more circles overlapping in the center"}),tile:()=>n.i18n._({id:"ed22UG",message:"Uniform grid of blocks arranged in rows and columns"}),tree:()=>n.i18n._({id:"4/pJEi",message:"Hierarchical branching structure"}),split:()=>n.i18n._({id:"vl4ivU",message:"Side-by-side comparison"}),staircase:()=>n.i18n._({id:"8QlHRY",message:"Upward progression of ideas"}),chevron:()=>n.i18n._({id:"Y4vrik",message:"Sequence of arrows for directional flow of ideas"}),segmented:()=>n.i18n._({id:"X3Uz3D",message:"Continuous bar divided into sections"}),swimlanes:()=>n.i18n._({id:"w3biU6",message:"Lanes representing different categories"}),fishbone:()=>n.i18n._({id:"+01Kg0",message:"Central idea showing cause-and-effect relationships"})},ae=({isOpen:e,onClose:i,itemKeys:a,selectedKey:r,onSelect:o,recentlyUsedKeys:s})=>{let[l,d]=(0,er.useState)(r??null);return(0,er.useEffect)(()=>{e&&d(r??null)},[e,r]),(0,t.jsx)(iQ.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(iV.Modal,{isOpen:e,onClose:i,size:{base:"5xl","2xl":"6xl"},scrollBehavior:"inside",children:[(0,t.jsx)(iY.ModalOverlay,{}),(0,t.jsxs)(iZ.ModalContent,{maxH:"90vh",children:[(0,t.jsx)(i$.ModalCloseButton,{}),(0,t.jsx)(iq.ModalHeader,{children:(0,t.jsx)(ea.Trans,{message:"Layout (optional)",id:"ZJw1ZC"})}),(0,t.jsx)(iG.ModalBody,{pb:6,overflowY:"auto",children:(0,t.jsxs)(tp.Stack,{spacing:6,children:[(0,t.jsx)(nB,{recentlyUsedKeys:s,items:n4,selectedKey:l,onSelect:d,emptyStateText:n.i18n._({id:"puArLt",message:"You haven't used a layout option yet!"})}),(0,t.jsx)(nN,{itemKeys:a,items:n4,selectedKey:l,onSelect:d})]})}),(0,t.jsxs)(iK.ModalFooter,{borderTop:"1px solid",borderColor:"gray.200",children:[(0,t.jsx)(Y.Button,{variant:"ghost",me:3,onClick:()=>{i()},children:(0,t.jsx)(ea.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(Y.Button,{variant:"solid",onClick:()=>{l&&o(l),i()},isDisabled:!l,children:(0,t.jsx)(ea.Trans,{message:"Select layout",id:"Szg6OU"})})]})]})]})})};var at=e.i(792565);let ai=({isOpen:e,onClose:i,items:a,selectedKey:r,onSelect:o,recentlyUsedKeys:s,title:l})=>{let[d,c]=(0,er.useState)(r??null);return(0,er.useEffect)(()=>{e&&c(r??null)},[e,r]),(0,t.jsx)(iQ.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(iV.Modal,{isOpen:e,onClose:i,size:{base:"5xl","2xl":"6xl"},scrollBehavior:"inside",children:[(0,t.jsx)(iY.ModalOverlay,{}),(0,t.jsxs)(iZ.ModalContent,{maxH:"90vh",children:[(0,t.jsx)(i$.ModalCloseButton,{}),(0,t.jsx)(iq.ModalHeader,{children:l||(0,t.jsx)(ea.Trans,{message:"Illustration styles",id:"2aWPEL"})}),(0,t.jsx)(iG.ModalBody,{pb:6,overflowY:"auto",children:(0,t.jsxs)(tp.Stack,{spacing:6,children:[(0,t.jsx)(nB,{recentlyUsedKeys:s,items:a,selectedKey:d,onSelect:c,emptyStateText:n.i18n._({id:"ia26ej",message:"You haven't used an illustration style yet!"})}),(0,t.jsx)(nN,{itemKeys:Object.keys(iS.BRUSH_STYLES),items:a,selectedKey:d,onSelect:c,categoryLabel:n.i18n._({id:"jy7SNP",message:"Brush styles"})}),(0,t.jsx)(nN,{itemKeys:Object.keys(iS.REALISTIC_STYLES),items:a,selectedKey:d,onSelect:c,categoryLabel:n.i18n._({id:"eO+Ga0",message:"Realistic styles"})}),(0,t.jsx)(nN,{itemKeys:Object.keys(iS.COLLAGE_STYLES),items:a,selectedKey:d,onSelect:c,categoryLabel:n.i18n._({id:"pgLRrs",message:"Collage styles"})}),(0,t.jsx)(nN,{itemKeys:Object.keys(iS.VECTOR_STYLES),items:a,selectedKey:d,onSelect:c,categoryLabel:n.i18n._({id:"RKiz4d",message:"Vector styles"})})]})}),(0,t.jsxs)(iK.ModalFooter,{borderTop:"1px solid",borderColor:"gray.200",children:[(0,t.jsx)(Y.Button,{variant:"ghost",me:3,onClick:()=>{i()},children:(0,t.jsx)(ea.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(Y.Button,{variant:"solid",onClick:()=>{d&&o(d),i()},isDisabled:!d,children:(0,t.jsx)(ea.Trans,{message:"Select style",id:"qULvu1"})})]})]})]})})},an={base:6,sm:6,md:6,lg:6,xl:6,"2xl":8},aa=({selectedKey:e,onSelect:i,itemKeys:a=[],items:r={},title:o,modalTitle:s,showHoverPreview:l=!1,modalType:d,localStorageKey:c,columns:u})=>{let p=(0,nD.useBreakpoint)({ssr:!1})||"base",h=u??(an[p]||8),[m,g]=(0,er.useState)(()=>(e=>{if(!e)return 0;let t=a.indexOf(e);return -1===t?0:Math.floor(t/h)})(e)),[f,b]=(0,er.useState)(null),x=(0,er.useRef)({}),{isOpen:y,onOpen:v,onClose:C}=(0,iC.useDisclosure)(),{recentlyUsedKeys:w,updateRecentlyUsed:S}=((e,t)=>{let[i,n]=(0,at.useLocalStorage)(e,[]),a=(0,er.useCallback)(e=>{n([e,...i.filter(t=>t!==e)].slice(0,6))},[i,n]);return{recentlyUsedKeys:(0,er.useMemo)(()=>i.filter(e=>!!t[e]),[i,t]),updateRecentlyUsed:a}})(c??"",r),k=(0,er.useCallback)(e=>{i?.(e),d&&S&&S(e)},[i,d,S]);(0,er.useEffect)(()=>{if(e){let t=a.indexOf(e);-1!==t&&g(Math.floor(t/h))}},[e,h,a]),(0,er.useEffect)(()=>{let e=Math.ceil(a.length/h);m>=e&&g(Math.max(0,e-1))},[h,a.length,m]);let A=Math.ceil(a.length/h),E=m*h,_=E+h,I=a.slice(E,_);return(0,t.jsxs)(q.Box,{children:[(0,t.jsxs)(X.HStack,{justify:"space-between",mb:1,children:[(0,t.jsx)(J.Text,{fontSize:"md",fontWeight:"semibold",children:o||n.i18n._({id:"xLvZnW",message:"Select reference"})}),(0,t.jsxs)(X.HStack,{spacing:1,children:[d&&(0,t.jsx)(Q.Link,{fontSize:"sm",color:"blue.500",fontWeight:"semibold",onClick:v,cursor:"pointer",children:n.i18n._({id:"V1fa9u",message:"See more"})}),(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(id.IconButton,{"aria-label":"Previous page",icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronLeft}),size:"sm",variant:"ghost",onClick:()=>{g(e=>Math.max(0,e-1))},isDisabled:0===m}),(0,t.jsxs)(J.Text,{fontSize:"sm",color:"gray.600",textAlign:"center",children:[m+1," / ",A]}),(0,t.jsx)(id.IconButton,{"aria-label":"Next page",icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronRight}),size:"sm",variant:"ghost",onClick:()=>{g(e=>Math.min(A-1,e+1))},isDisabled:m===A-1})]})]})]}),(0,t.jsx)(ia.SimpleGrid,{columns:u??{base:6,"2xl":8},spacing:1,children:I.map(i=>{let n=r[i],a=(n.previewImages||n.urls||[])[0],o=e===i,s="function"==typeof n.name?n.name():n.name;return(0,t.jsxs)(ee.VStack,{ref:e=>{e&&(x.current[i]=e)},onMouseEnter:()=>l&&b(i),onMouseLeave:()=>l&&b(null),w:u?"100%":"70px",children:[(0,t.jsx)(q.Box,{cursor:"pointer",onClick:()=>k(i),borderRadius:"md",overflow:"hidden",border:"1px solid",borderColor:o?"blue.500":"gray.200",bg:"gray.100",transition:"all 0.2s",_hover:{borderColor:"blue.500",shadow:"md"},w:"100%",children:(0,t.jsx)(q.Box,{w:u?"100%":"70px",h:u?void 0:"70px",sx:u?{aspectRatio:"1"}:void 0,children:a&&(0,t.jsx)(te.Image,{src:a,alt:s,w:"100%",h:"100%",objectFit:"contain",opacity:o?1:.85,transition:"opacity 0.2s"})})}),(0,t.jsx)(J.Text,{fontSize:"xxs",fontWeight:o?"bold":"medium",noOfLines:1,w:"100%",whiteSpace:"nowrap",children:s})]},i)})}),l&&f&&(()=>{let e=r[f];if(!e)return null;let i=(e.previewImages||e.urls||[])[0];if(!i)return null;let n="function"==typeof e.name?e.name():e.name,a=x.current[f];if(!a)return null;let o=a.getBoundingClientRect();return(0,t.jsx)(tu.Portal,{children:(0,t.jsx)(q.Box,{position:"fixed",bg:"white",borderRadius:"lg",boxShadow:"0 8px 32px rgba(0, 0, 0, 0.3)",width:"200px",pointerEvents:"none",zIndex:9999,style:{left:`${o.left-200-10}px`,top:`${o.top-50}px`},children:(0,t.jsxs)(ee.VStack,{spacing:0,w:"100%",borderRadius:"lg",overflow:"hidden",children:[(0,t.jsx)(q.Box,{w:"100%",h:"200px",children:(0,t.jsx)(te.Image,{src:i,alt:n||"",w:"100%",h:"100%",objectFit:"contain",loading:"eager"})}),(0,t.jsx)(q.Box,{w:"100%",bg:"blackAlpha.800",p:2,children:(0,t.jsx)(J.Text,{fontSize:"xs",fontWeight:"bold",color:"white",noOfLines:1,children:n})})]})})})})(),"illustration"===d&&(0,t.jsx)(ai,{isOpen:y,onClose:C,itemKeys:a,items:r,selectedKey:e,onSelect:k,recentlyUsedKeys:w,title:s}),"layout"===d&&(0,t.jsx)(ae,{isOpen:y,onClose:C,itemKeys:a,items:r,selectedKey:e,onSelect:k,recentlyUsedKeys:w})]})};var ar=e.i(803433),ao=e.i(907839);let as={src:e.i(589470).default,width:640,height:488,blurWidth:8,blurHeight:6,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAA0UlEQVR42gHGADn/AGOs1fg+lsbtNYm23DB+pcotcpe1MmmGnkRjdYVBV2NuAK/I2v+awdT/mcSy/3Wyof+Kt9D/kbrU/5/A1f+fwNT8ADx9m/+Aq6z/fbZ5/0ycaf9IhZb/O4Sb/zuFm/9Bh5f/AFJ5d/+dvZj/WqZl/0ibX/9De3D/QXJz/0VzcP9OeGr/AH2QgvyJuoP/Rp5f/0WaX/9Lgmf/X3Vo/2h7av9rfmz/AFlMSG5BW0KFKVw/nTNgTbROW2TJe2x83LWQluzZp6b4hdRyCB8irpYAAAAASUVORK5CYII="},al={src:e.i(936761).default,width:316,height:242,blurWidth:8,blurHeight:6,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAYAAAD+Bd/7AAAA0UlEQVR42gHGADn/AJVurPmNaKPtbVN+3TIvOso7MkO2IyEonz0yRodOOD9wAHl5sv9zb7L/WVB0/1hZWf9hYGD/S0pM/2JYYP/Rj2L9AGCEj/9oeIj/PEFM/05PUP9WU1T/Q0FD/1FAMv/dkkr/AIWZaP+Eek3/Ojs4/zIzNP8sLDH/LCww/y8sK/+fbj7/AH6QaPxLUkr+QEhE/0NeVf8tMTT/OTY5/zgzNP9ZRTT/AEM5Kmo8KiiBNjE2mRlZZLATWGXFI1Fd2GhKVemTZmz1OJ1ansUCddoAAAAASUVORK5CYII="};var ad=e.i(853081),ac=e.i(647031),au=e.i(977581);e.i(24439);var ap=e.i(103630),ah=e.i(195305);let am=nA.gql` mutation GenerateInfographic($input: GenerateInfographicInput!) { generateInfographic(input: $input) { id attrs workspaceId userId } } `;e.s(["GENERATE_INFOGRAPHIC_MUTATION",0,am],828044);let ag=e=>eI.INFOGRAPHIC_SUPPORTED_MODELS.has(e.model),af=({currentAttributes:e,updateAttributes:i,editor:a})=>{let o=(0,G.useApolloClient)(),s=(0,ec.useAIInteraction)("generate-image"),{isInOfflineMode:l}=(0,eh.useHealthCheck)(),d=(0,eT.useAppSelector)(nb.selectThemeId),c=(0,eT.useAppSelector)(ev.selectDoc),u=(0,eT.useAppSelector)(ev.selectFileWorkspace),p=c?.id,h=(0,eT.useAppSelector)((0,eD.selectIsMemberOfCurrentDocWorkspace)(u?.id)),m=(0,er.useMemo)(()=>a?"doc":"user",[a]),[g,f]=(0,er.useState)(m),b=e?.loadImageParams?.options,x=e?.aiParams?.prompt||e?.loadImageParams?.query||"",y=(0,nj.useFeatureFlag)("infographicModel"),[v,C]=(0,er.useState)(()=>{let t=e?.aiParams;return t&&"model"in t&&t.model&&eI.INFOGRAPHIC_SUPPORTED_MODELS.has(t.model)?t.model:b?.model&&eI.INFOGRAPHIC_SUPPORTED_MODELS.has(b.model)?b.model:y}),[w,S]=(0,er.useState)(x),[k,A]=(0,er.useState)(()=>{let t=e?.aiParams;if(t&&"styleReferenceKey"in t){let e=t.styleReferenceKey;return e&&nP.INFOGRAPHIC_STYLE_KEYS.includes(e)?e:nP.DEFAULT_INFOGRAPHIC_STYLE_KEY}return b?.styleReferenceKey&&nP.INFOGRAPHIC_STYLE_KEYS.includes(b.styleReferenceKey)?b.styleReferenceKey:nP.DEFAULT_INFOGRAPHIC_STYLE_KEY}),[E,_]=(0,er.useState)(()=>{let t=e?.aiParams;return t&&"layout"in t?t.layout||n9:b?.layout?b.layout:n9}),[I,M]=(0,er.useState)(()=>{if(!e)return"landscape";let t=e.aiParams;return t&&"aspectRatio"in t&&t.aspectRatio?t.aspectRatio:b?.aspectRatio?b.aspectRatio:e.meta?.width&&e.meta?.height?(0,ny.getImageAspectRatio)(e):"landscape"}),{isEnhancing:T,runEnhanceInfographicPrompt:L}=(({editor:e,prompt:t})=>{let[i,n]=(0,er.useState)(!1),a=(0,er.useCallback)(()=>{if(!e)return null;let{selection:t,doc:i}=e.state,n=(0,au.findNodeAndParents)(t.$from,ap.isCardNode)[0],a=n&&(0,ac.findCardBody)(n.node,n.pos);if(a){let e=a.pos+1,n=t.from;if(n>e){let t=i.textBetween(e,n,"\n").trim();if(t.length>=50)return t}let r=a.node.textContent?.trim();if(r)return r}let r=i.textContent?.trim();return r?r.slice(0,2e3):null},[e]),r=(0,er.useRef)(null),o=(0,er.useCallback)(async()=>{if(i)return null;let o=(0,ah.getCurrentWorkspaceId)();if(!o)return null;n(!0),r.current=new AbortController;try{let i=e?.isSiteNavbarEditor?void 0:a()??void 0,n=t.trim().length>0;var s=await (0,ad.renderJsxPrompt)({promptKey:n?"EnhanceInfographic":"VisualizeTextAsInfographic",variables:n?{currentPrompt:t,context:i}:{context:i??""},workspaceId:o,opts:{timeout:3e4,abortController:r.current}});try{let e=s.match(/\{[\s\S]*\}/);if(!e)return null;let t=JSON.parse(e[0]);if("string"==typeof t.prompt&&"string"==typeof t.layout)return{prompt:t.prompt,layout:t.layout};if("string"==typeof t.prompt)return{prompt:t.prompt,layout:""};return null}catch{return null}}catch(e){return console.error("Error enhancing infographic prompt",e),null}finally{n(!1),r.current=null}},[i,t,e?.isSiteNavbarEditor,a]);return{isEnhancing:i,runEnhanceInfographicPrompt:o}})({editor:a?.parentEditor||a,prompt:w}),j=(0,er.useCallback)(e=>{e&&(S(e.prompt),e.layout&&E===n9&&_(e.layout))},[E]);(0,er.useEffect)(()=>{x||L().then(j)},[]);let P=(0,eP.useScrollToOnImageNodeLoad)(a),{history:D,loadMore:N,canLoadMore:R,isLoading:O,isLoadingMore:B,deleteImage:z,isDeleting:F}=(0,eG.useAIImageHistory)({docId:p,scope:g,sources:[r.AI_INFOGRAPHIC_SOURCE_KEY]}),H=(0,er.useCallback)(e=>{i({tempUrl:(0,eO.resizeAndProxyImageUrl)(e.attrs.src,eO.THUMBNAIL_RESIZE_JPG_PARAMS,e.attrs.meta),showPlaceholder:!1,...e.attrs}),a&&P(a.state.selection.from)},[a,P,i]),{generate:W,isGenerating:U,hasError:V,errorMessage:$}=(({selectImage:e,savedMediaContext:t,generateImageInteraction:i})=>{let n,a=(0,eT.useAppSelector)(ev.selectDocId),r=(0,eT.useAppSelector)(nk.selectEditingThemeId),o=(0,e6.useWorkspaceIdForAIImageContext)(t);"new"===r&&(r=void 0,n=ep.SavedMediaContext.Theme);let[s,l]=(0,er.useState)(""),[d,c]=(0,er.useState)(!1),[u,p]=(0,er.useState)(!1),[h,m]=(0,er.useState)(""),[g]=(0,nw.useMutation)(am);return{generate:(0,er.useCallback)(async t=>{let s=i.current.id;l(t.prompt),c(!0),p(!1),m("");let d=t.themeId||r,u=t.docId||a,h=t.context||n;try{let{data:n}=await g({variables:{input:{workspaceId:o,docId:u,themeId:d,interactionId:s,prompt:t.prompt,stylePrompt:t.stylePrompt||"",count:t.count||1,aspectRatio:t.aspectRatio,styleReferenceKey:t.styleReferenceKey,layout:t.layout,context:h,model:t.model||"gemini-3-pro-image",extractText:np.featureFlags.get("extractInfographicText"),interactionName:"generate-image"}},context:{...(0,nS.getAiMediaGraphqlContext)(),headers:{"aijsx-traceparent":i.current.traceparent}}});c(!1);let a=n?.generateInfographic||[];if(0===a.length)throw Error("No images generated");a.length>0&&(e(a[0]),i.current.complete({result:{imageCount:a.length,images:a.map(e=>({imageUrl:e.attrs.src||"",savedMediaId:e.id}))}}))}catch(e){p(!0),m((0,eC.imageGenerateErrorMessage)(e)),c(!1)}},[a,r,n,o,e,i,g]),isGenerating:d,hasError:u,errorMessage:h,searchQuery:s}})({selectImage:H,savedMediaContext:void 0,generateImageInteraction:s}),Z=v?(0,eC.getImageModelInfo)(v).estimatedTimeSeconds:void 0,[K,Q]=(0,er.useState)(0);(0,er.useEffect)(()=>{let e;if(!U||!Z)return void Q(0);let t=Date.now(),i=1e3*Z,n=()=>{let a=Math.min((Date.now()-t)/i,1);Q(100*(0,ar.easeOutQuad)(a)),a<1&&(e=requestAnimationFrame(n))};return n(),()=>{cancelAnimationFrame(e)}},[U,Z]);let en=(0,ex.useCreditWarning)({cost:(0,eC.getImageModelInfo)(v).cost,surface:"image-drawer",source:{segmentEvent:eL.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES,upsellLocation:"credits.infographic"}}),eo=(0,er.useCallback)(async()=>{if(en?.isBlocking)return void en.cta.onClick?.();if(!w.trim())return;let e=E;if(e===n9){let t=await L();t?.layout&&_(e=t.layout)}let t=e===n9||e===n8?void 0:e;i({showPlaceholder:!0,loadImageStatus:"queued",loadImageParams:{provider:"aiInfographic",query:w,options:{model:v}}});try{await W({prompt:w,model:v,aspectRatio:I,styleReferenceKey:k,layout:t,count:1,themeId:d})}finally{i({loadImageStatus:null,loadImageParams:null,showPlaceholder:!1}),o.refetchQueries({include:["GetSavedMedia","GetWorkspaceSavedMedia","GetUserSavedMedia"]})}},[en,w,v,k,E,I,W,d,o,i,L]),ed=e?.savedMediaId,eu=(0,er.useCallback)(async t=>{await z(t),t===ed&&i({...e,savedMediaId:"",src:"",tempUrl:""})},[z,e,ed,i]),em=V&&!U,eg=e?.src&&!U&&!V,ef=!e?.src&&!U&&!V;nh.PRO_PROPER_NOUN.toUpperCase();let ey=n4[E]?.previewImages?.[0]||n4[n9].previewImages?.[0],ew=n4[E]?.name()||n4[n9].name(),eS=[...n6.filter(e=>e!==n8),n8];return(0,t.jsxs)(ee.VStack,{spacing:4,align:"stretch",height:"100%",children:[U&&(0,t.jsx)(q.Box,{bg:"gray.50",borderRadius:"lg",p:8,textAlign:"center",border:"1px solid",borderColor:"gray.200",children:(0,t.jsxs)(ee.VStack,{spacing:4,children:[(0,t.jsxs)(q.Box,{position:"relative",w:"180px",h:"140px",children:[(0,t.jsx)(q.Box,{as:"svg",position:"absolute",w:"0",h:"0",overflow:"hidden","aria-hidden":"true",children:(0,t.jsx)("defs",{children:(0,t.jsx)("clipPath",{id:"loading-clip",clipPathUnits:"objectBoundingBox",children:(0,t.jsx)("path",{d:"M0.032,0.887 L0.968,0.995 C0.986,0.997 1,0.979 1,0.955 L1,0.154 C1,0.131 0.986,0.11 0.968,0.108 L0.032,0 C0.014,-0.002 0,0.016 0,0.04 L0,0.84 C0,0.864 0.014,0.885 0.032,0.887 Z"})})})}),(0,t.jsx)(q.Box,{as:"video",src:"/media/ai-infographic/loading_fish.mp4",autoPlay:!0,loop:!0,muted:!0,playsInline:!0,w:"100%",h:"100%",objectFit:"cover",sx:{clipPath:"url(#loading-clip)"}})]}),(0,t.jsx)(J.Text,{fontSize:"xl",fontWeight:"bold",color:"gray.900",children:(0,t.jsx)(ea.Trans,{message:"Generating...",id:"NOdFZR"})}),Z&&(0,t.jsx)(q.Box,{w:"100%",px:4,children:(0,t.jsx)(nL.Progress,{value:K,size:"sm",colorScheme:"blue",bg:"gray.200",borderRadius:"md"})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"You can close this panel while your infographic is generating.",id:"wlmjAO"})})]})}),em&&(0,t.jsx)(q.Box,{bg:"gray.50",borderRadius:"lg",p:8,textAlign:"center",border:"1px solid",borderColor:"gray.200",children:(0,t.jsxs)(ee.VStack,{spacing:1,children:[(0,t.jsx)(te.Image,{src:al.src,alt:n.i18n._({id:"VhXqKX",message:"Error state - cat at desk"}),w:"140px",h:"140px",objectFit:"contain"}),(0,t.jsx)(J.Text,{fontSize:"xl",fontWeight:"bold",color:"gray.900",children:(0,t.jsx)(ea.Trans,{message:"Uh oh! Something went wrong.",id:"oOeQIc"})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Please try again.",id:"fuwKpE"})})]})}),ef&&(0,t.jsx)(q.Box,{bg:"gray.50",borderRadius:"lg",p:5,textAlign:"center",border:"1px solid",borderColor:"gray.200",children:(0,t.jsxs)(ee.VStack,{spacing:1,children:[(0,t.jsx)(te.Image,{src:as.src,alt:n.i18n._({id:"oTG3Yd",message:"Empty state - cat looking out over a horizon"}),w:"140px",h:"140px",objectFit:"contain"}),(0,t.jsxs)(X.HStack,{spacing:2,align:"center",children:[(0,t.jsx)(J.Text,{fontSize:"xl",fontWeight:"bold",color:"gray.900",children:(0,t.jsx)(ea.Trans,{message:"Create an infographic",id:"w5q0yf"})}),(0,t.jsx)(tx,{badge:"beta",fontSize:"xs"})]}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.600",children:(0,t.jsx)(ea.Trans,{message:"Describe what you want to see by selecting a style and prompt",id:"AAL1Al"})})]})}),eg&&e?.src&&(0,t.jsx)(q.Box,{borderRadius:"lg",overflow:"hidden",border:"1px solid",borderColor:"gray.200",bg:"gray.50",children:(0,t.jsx)(te.Image,{src:e.src,alt:"Generated infographic",w:"100%",objectFit:"contain",maxH:"200px"})}),(0,t.jsxs)(e8.FormControl,{children:[(0,t.jsx)(t9.FormLabel,{fontSize:"md",fontWeight:"semibold",mb:1,children:(0,t.jsx)(ea.Trans,{message:"Prompt",id:"W9uQXX"})}),(0,t.jsxs)(q.Box,{position:"relative",children:[(0,t.jsx)(es.ResizingTextarea,{value:w,onChange:e=>S(e.target.value),placeholder:n.i18n._({id:"EZdgCX",message:"Describe the infographic content you want to generate..."}),isDisabled:U,minH:"70px",initialHeight:"70px",bottomSpacing:35}),a&&(0,t.jsx)(ez.AIImageEnhanceButton,{isEnhancingPrompt:T,isGenerating:U,runEnhancePrompt:()=>{L().then(j)}})]})]}),(0,t.jsx)(q.Box,{children:(0,t.jsx)(aa,{selectedKey:k,onSelect:A,itemKeys:nP.INFOGRAPHIC_STYLE_KEYS,items:nP.INFOGRAPHIC_ILLUSTRATION_STYLE_REFERENCES,title:n.i18n._({id:"UT7O72",message:"Illustration style"}),modalTitle:n.i18n._({id:"2aWPEL",message:"Illustration styles"}),localStorageKey:ao.USER_SETTINGS_CONSTANTS.recentlyUsedIllustrationStyles,showHoverPreview:!0,modalType:"illustration"})}),(0,t.jsxs)(e8.FormControl,{children:[(0,t.jsx)(t9.FormLabel,{fontSize:"md",fontWeight:"semibold",mb:1,children:(0,t.jsx)(ea.Trans,{message:"Layout",id:"wmmwSM"})}),(0,t.jsxs)(tt.Menu,{isLazy:!0,matchWidth:!0,children:[(0,t.jsx)(ti.MenuButton,{as:Y.Button,variant:"plain",isDisabled:U,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronDown}),boxShadow:"none",size:"sm",fontWeight:"normal",children:(0,t.jsxs)(X.HStack,{spacing:2,overflow:"hidden",children:[E===n9?(0,t.jsx)(q.Box,{boxSize:"20px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles,size:"xs"})}):(0,t.jsx)(te.Image,{src:ey,alt:n.i18n._({id:"qKdEPj",message:"Selected infographic layout"}),boxSize:"20px",objectFit:"cover",borderRadius:"sm",border:"1px solid",borderColor:"gray.200",flexShrink:0}),(0,t.jsx)(J.Text,{as:"span",noOfLines:1,fontWeight:"semibold",children:ew})]})}),(0,t.jsx)(tr.MenuList,{maxH:"290px",overflowY:"auto",overflowX:"hidden",minW:"0",children:(0,t.jsx)(to.MenuOptionGroup,{value:E,type:"radio",onChange:e=>{"string"==typeof e&&_(e)},children:eS.map(e=>(0,t.jsx)(ta.MenuItemOption,{value:e,h:"54px",opacity:1,p:"4px",ps:"4px",iconSpacing:0,_hover:{bg:"blue.50"},_focus:{bg:"blue.50"},_checked:{bg:"blue.50"},sx:{".chakra-menu__icon-wrapper":{width:0,marginInlineEnd:0}},children:(0,t.jsxs)(X.HStack,{spacing:"10px",children:[e===n9?(0,t.jsx)(q.Box,{boxSize:"46px",borderRadius:"4px",border:"1px solid",borderColor:"gray.200",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:tg.faWandMagicSparkles})}):(0,t.jsx)(te.Image,{src:n4[e].previewImages[0],alt:n4[e].name(),boxSize:"46px",objectFit:"cover",borderRadius:"4px",border:"1px solid",borderColor:"gray.200",flexShrink:0}),(0,t.jsxs)(ee.VStack,{spacing:0,align:"start",children:[(0,t.jsx)(J.Text,{as:"span",fontWeight:700,fontSize:"12px",color:"gray.900",children:n4[e].name()}),(0,t.jsx)(J.Text,{as:"span",fontWeight:500,fontSize:"10px",color:"gray.600",children:n7[e]?.()||""})]})]})},e))})})]})]}),(0,t.jsxs)(ee.VStack,{spacing:3,align:"stretch",children:[(0,t.jsxs)(X.HStack,{spacing:2,align:"flex-start",children:[(0,t.jsxs)(q.Box,{flex:1,children:[(0,t.jsx)(t9.FormLabel,{fontSize:"md",fontWeight:"semibold",mb:1,children:(0,t.jsx)(ea.Trans,{message:"Aspect ratio",id:"iKM2jY"})}),(0,t.jsx)(eW.AspectRatioSelect,{value:I,setValue:M,isDisabled:U,model:v})]}),(0,t.jsxs)(q.Box,{flex:2,children:[(0,t.jsx)(t9.FormLabel,{fontSize:"md",fontWeight:"semibold",mb:1,children:(0,t.jsx)(ea.Trans,{message:"Model",id:"scu3wk"})}),(0,t.jsx)(t4,{hasStyleReferences:!1,value:v,setValue:C,isDisabled:U,modelFilter:ag,context:eC.IMAGE_SETTINGS_CONTEXT.MEDIA_DRAWER})]})]}),en&&(0,t.jsx)(el.UpsellWarningBox,{status:en.status,onClick:en.cta.onClick,title:en.title,cta:en.cta.label,ctaTooltip:en.cta.tooltip}),(0,t.jsx)(eb.CreditWarningTooltip,{creditWarning:en,children:(0,t.jsx)(Y.Button,{onClick:eo,isDisabled:!w.trim()||U||T||l,isLoading:U,loadingText:n.i18n._({id:"NOdFZR",message:"Generating..."}),variant:"solid",w:"100%",size:"lg",children:(0,t.jsx)(ea.Trans,{message:"Generate",id:"ziAjHi"})})})]}),a&&h&&(0,t.jsx)(eH.AIImageHistoryTabs,{onSelectImage:H,savedMediaId:ed,currentAttributes:e,scope:g,setScope:f,canLoadMore:R,loadMore:N,isLoading:O,isLoadingMore:B,history:D,deleteImage:eu,isDeleting:F,resizeThumbnails:!0})]})};af.key=r.AI_INFOGRAPHIC_SOURCE_KEY;var ab=e.i(329860),ax=e.i(403225),ay=e.i(235704);let av=({editor:e,updateAttributes:i,currentAttributes:n,urlPlaceholder:a,embedTip:r})=>{let o=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:o,updateAttributes:i,placeholder:a||"https://..."}),r,o&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};var aC=e.i(29215);let aw=({guideLink:e,extraMessage:i,providerName:n})=>(0,t.jsxs)($.Alert,{status:"info",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"Follow <0>this guide<1/> to find the URL or embed code for {providerName}. {extraMessage}",id:"qBttXb",values:{providerName:n,extraMessage:i},components:{0:(0,t.jsx)(Q.Link,{href:e,textDecoration:"underline",isExternal:!0}),1:(0,t.jsx)(aC.ExternalLinkIcon,{mx:"2px"})}})})]}),aS=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://airtable.com/...",embedTip:(0,t.jsx)(aw,{guideLink:"https://support.airtable.com/docs/embedding-airtable-views",providerName:"Airtable",extraMessage:(0,t.jsx)(ea.Trans,{message:"You can paste in the private link, or the full embed code.",id:"gsZDsS"})})});aS.key="embed.airtable";let ak=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",enableSearch:!0,enablePagination:!1,provider:"bing",resultsPerPage:aA.BING_IMAGE_DEFAULTS.count,mediaSearchQuery:n,setMediaSearchQuery:a});a_.key="image.bing";let aI=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://calendly.com/..."});aI.key="embed.calendly";var aM=e.i(358003),aT=e.i(676828),aL=e.i(175863),aj=e.i(283591),aP=e.i(929362),aD=e.i(372764),aN=e.i(697240),aR=e.i(146626),aO=e.i(357790),aB=e.i(755453),az=e.i(297194),aF=e.i(4877),aH=e.i(71259);let aW=aB.Extension.create({name:"mediaUpload",addCommands(){return{cancelImageUploadsOnLoad:()=>({tr:e,state:t})=>!!this.editor.isEditable&&((0,aB.findChildren)(t.doc,e=>{let t=(0,aH.getNodeImageAttrs)(e);return!!(t&&t.uploadStatus===az.UploadStatus.Uploading)}).forEach(t=>{let i=(0,aH.getNodeImageAttrs)(t.node),n=(0,aH.mergeImageAttrs)(t.node,i?.src?{uploadStatus:az.UploadStatus.Done}:{tempUrl:null,uploadStatus:az.UploadStatus.Error});e.setNodeMarkup(t.pos,null,n).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),!0),uploadBlobsOnLoad:()=>({tr:e,state:t})=>!!this.storage.orgId&&!!this.editor.isEditable&&((0,aB.findChildren)(t.doc,e=>{let t=(0,aH.getNodeImageAttrs)(e);return!!t?.src&&"string"==typeof t.src&&t.src.startsWith("blob:")}).forEach(t=>{let i=(0,aH.getNodeImageAttrs)(t.node);if(!i)return;let n=i.src,a=(0,aH.mergeImageAttrs)(t.node,(0,aH.getUploadingImageAttrs)(n));e.setNodeMarkup(t.pos,null,a).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,aF.uploadImageBlobUrl)(this.editor,n)}),!0),uploadRemoteUrlsOnLoad:()=>({tr:e,state:t})=>!!this.storage.orgId&&!!this.editor.isEditable&&((0,aB.findChildren)(t.doc,e=>{let t=(0,aH.getNodeImageAttrs)(e);return!!t?.src&&"string"==typeof t.src&&t.src.startsWith("http")&&aO.shouldUploadRemoteUrl(t.src)&&t.uploadStatus!==az.UploadStatus.Done}).forEach(t=>{let i=(0,aH.getNodeImageAttrs)(t.node);if(!i)return;let n=i.src,a=(0,aH.mergeImageAttrs)(t.node,{uploadStatus:az.UploadStatus.Uploading,source:i.source??"image.custom",tempUrl:n});e.setNodeMarkup(t.pos,null,a).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,aF.uploadImageFileOrUrl)(this.editor,n,void 0,!0)}),!0),uploadDataUrlsOnLoad:()=>({tr:e,state:t})=>!!this.storage.orgId&&!!this.editor.isEditable&&((0,aB.findChildren)(t.doc,e=>{let t=(0,aH.getNodeImageAttrs)(e);return!!t?.src&&"string"==typeof t.src&&t.src.startsWith("data:")}).forEach(t=>{let i=(0,aH.getNodeImageAttrs)(t.node);if(!i)return;let n=(0,eO.dataURLtoFile)(i.src);if(!n)return;let a=URL.createObjectURL(n),r=(0,aH.mergeImageAttrs)(t.node,(0,aH.getUploadingImageAttrs)(a));e.setNodeMarkup(t.pos,null,r).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,aF.uploadImageFileOrUrl)(this.editor,a,n)}),!0),initializeUploadExtension:e=>({chain:t})=>(this.storage.orgId=e,t().cancelImageUploadsOnLoad().uploadBlobsOnLoad().uploadDataUrlsOnLoad().uploadRemoteUrlsOnLoad().revokeAllImageTempURLs().run(),!0),revokeAllImageTempURLs:()=>({tr:e,state:t})=>((0,aB.findChildren)(t.doc,e=>{let t=(0,aH.getNodeImageAttrs)(e);return!!(t&&t.tempUrl&&t.src&&"string"==typeof t?.src&&t.uploadStatus===az.UploadStatus.Done)}).forEach(t=>{let i=(0,aH.mergeImageAttrs)(t.node,{tempUrl:null});e.setNodeMarkup(t.pos,null,i).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),!0),revokeImageTempURLs:e=>({tr:t,state:i})=>((0,aB.findChildren)(i.doc,t=>{let i=(0,aH.getNodeImageAttrs)(t);return!!i&&i.tempUrl===e}).forEach(e=>{let i=(0,aH.mergeImageAttrs)(e.node,{tempUrl:null});t.setNodeMarkup(e.pos,null,i).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),URL.revokeObjectURL(e),!0),updateImageOnUploadFailure:(e,t=!1)=>({tr:i,state:n})=>{let a=n.doc.nodeAt(e);if(!a||!a.attrs)return!1;let r=(0,aH.getNodeImageAttrs)(a),o=t?{...r,uploadStatus:az.UploadStatus.Done}:(0,aH.getUploadedImageAttrs)({isError:!0}),s=(0,aH.mergeImageAttrs)(a,o);return i.setNodeMarkup(e,void 0,s).setMeta("imageUploadUpdateAttrs",!0).setMeta("addToHistory",!1).setMeta("annotationEvent",{type:"update-node-attrs",pos:e}),!0},updateImageOnUploadSuccess:(e,t)=>({tr:i,state:n})=>{let a=n.doc.nodeAt(e);if(!a||!a.attrs)return!1;let r=(0,aH.getUploadedImageAttrs)({isError:!1,result:t,attrs:a.attrs}),o=(0,ab.resizeImageToFitViewport)(r),s=(0,aH.mergeImageAttrs)(a,o);return i.setNodeMarkup(e,void 0,s).setMeta("imageUploadUpdateAttrs",!0).setMeta("addToHistory",!1).setMeta("annotationEvent",{type:"update-node-attrs",pos:e}),!0}}},addStorage:()=>({orgId:void 0,completedUploads:{}}),addProseMirrorPlugins(){return[(0,aF.generateUploadPlugin)(this.editor)]}});e.s(["MediaUpload",0,aW],391303),e.s([],988162);let aU=({updateAttributes:e,editType:t,editor:i,source:n})=>{let a=(0,eT.useAppSelector)(ev.selectWorkspaceId),{currentWorkspace:r}=(0,e3.useUserContext)(),{orgId:o,templateId:s}=(0,aj.useStandardThemeImageBucket)(a||r?.id,t),l=(0,er.useRef)(null),d=(0,er.useCallback)(({tempUrl:t,attributes:i})=>{e({uploadStatus:az.UploadStatus.Uploading,showPlaceholder:!1,tempUrl:t,src:null,...i}),l.current=t},[e]),c=(0,er.useCallback)((a,r)=>{let o=l.current||r;if(o){if("node"!==t||!i)return void e({...(0,aH.getUploadedImageAttrs)({result:a,isError:!1}),source:n});(0,aH.handleImageUploadSuccess)(i,o,a),l.current=null}},[i,t,e,n]),u=(0,er.useCallback)(t=>{l.current&&i?(0,aH.handleImageUploadFailed)(i,l.current,t):e((0,aH.getUploadedImageAttrs)({isError:!0}))},[i,e]),p=(0,er.useCallback)(e=>{if(!o)return void console.error("[CustomImagePanel] saveImageFromDataURL - No orgId!");d({tempUrl:e});try{let i=(0,eO.dataURLtoFile)(e,"image");if(!i)return void u();(0,eX.uploadFile)(i,o,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:u},t,void 0,s)}catch(e){u()}},[t,o,u,d,c,s]),h=(0,er.useCallback)(e=>{if(!o)return void console.error("[CustomImagePanel] saveImageFromUrl - No orgId!");d({tempUrl:e});try{(0,eX.uploadFileFromUrl)(e,o,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:u},t,s)}catch(e){u()}},[t,o,u,d,c,s]),m=(0,er.useCallback)(async({blob:e,attributes:i})=>{if(!o)return void console.error("[QRCodePanel] saveImageFromDataBlob - No orgId!");d({tempUrl:window.URL.createObjectURL(e),attributes:i});try{let i=(0,eO.dataBlobToFile)({blob:e,filename:"image",ext:"svg"});(0,eX.uploadFile)(i,o,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:u},t)}catch(e){u()}},[t,o,u,d,c]),g=(0,er.useCallback)(({file:e,tempUrl:t})=>{e.type&&(0,eO.isHEICFileType)(e.type)?d({tempUrl:`HEIC_tempId_${(0,eY.nanoid)()}`,attributes:{showPlaceholder:!0}}):d({tempUrl:t})},[d]);return{setTempUrl:d,setUploadedImage:c,saveImageFromDataURL:p,saveImageFromUrl:h,saveImageFromDataBlob:m,onUploadStart:g,setUploadFailed:(0,er.useCallback)(()=>{e((0,aH.getUploadedImageAttrs)({isError:!0}))},[e])}},aV=({dimensions:e})=>{let i=e?.width,n=e?.height,a=e?.ratioLabel;return(0,t.jsxs)($.Alert,{status:"info",size:"xs",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:i&&n&&a?(0,t.jsx)(ea.Trans,{message:"Upload a PNG, JPG, or WebP file (max 5MB). For best results, match the <0>{ratioLabel} aspect ratio, for example {width} × {height}px.",id:"XywxuL",values:{ratioLabel:a,width:i,height:n},components:{0:(0,t.jsx)(q.Box,{as:"span",textTransform:"lowercase",fontWeight:"semibold"})}}):(0,t.jsx)(ea.Trans,{message:"Upload a PNG, JPG, or WebP file (max 5MB).",id:"MQn2em"})})]})},aG=({editor:e,editType:i,updateAttributes:a,currentAttributes:r,resetToPlaceholder:o})=>{let{onUploadStart:s,setUploadedImage:l,saveImageFromUrl:d,saveImageFromDataURL:c,setUploadFailed:u}=aU({updateAttributes:a,editor:e,editType:i,source:"image.custom"}),p=(0,eT.useAppSelector)(ev.selectWorkspaceId),{currentWorkspace:h}=(0,e3.useUserContext)(),{isInOfflineMode:m}=(0,eh.useHealthCheck)(),{orgId:g,templateId:f,useStandardThemeBucket:b}=(0,aj.useStandardThemeImageBucket)(p||h?.id,i),x=(e=>{if(!e)return!1;let{selection:t}=e.state;return t instanceof aL.NodeSelection&&(0,ap.isCardImageItemNode)(t.node)})(e),y=x?(e=>{if(!e)return null;let{aspectRatio:t,label:i,buttonLabel:n}=(0,aP.getCardDimensions)((0,aD.getCardDimensionsKey)(e));return null==t?null:{width:t>=1?1920:Math.round(1920*t),height:t>=1?Math.round(1920/t):1920,ratioLabel:n?.()??i()}})(e):null,{src:v,tempUrl:C,meta:w,name:S,showPlaceholder:k,uploadStatus:A}=r,E=v?(0,eO.resizeAndProxyImageUrl)(v,{width:500}):void 0;return(v||C||k)&&(r?.source==="image.custom"||A===az.UploadStatus.Uploading)?(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[A===az.UploadStatus.Uploading&&(0,t.jsxs)($.Alert,{status:"info",size:"sm",children:[(0,t.jsx)(K.AlertIcon,{as:ic.Spinner,w:5,h:5}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"This image is uploading. Don't close this window until the upload is complete.",id:"MEDU34"})})]}),k?(0,t.jsx)(aN.MediaPlaceholderImage,{isUploading:A===az.UploadStatus.Uploading,hasUploadError:A===az.UploadStatus.Error,width:"100%",height:"200px",borderRadius:"md"}):(0,eO.isMp4Url)(v)?(0,t.jsx)(aM.chakra.video,{src:v,poster:w?.poster,autoPlay:!0,muted:!0,loop:!0,width:"100%",height:"200px",borderRadius:"md"}):(0,t.jsx)(te.Image,{src:E||C,alt:"",ignoreFallback:!0,borderRadius:"md"}),w&&w.width&&w.height&&(0,t.jsxs)(J.Text,{children:[w.width,"×",w.height,"px"]}),S&&(0,t.jsx)(J.Text,{children:S}),(0,t.jsx)(Y.Button,{onClick:o,mt:2,w:"100%",children:(0,t.jsx)(ea.Trans,{message:"Replace Image",id:"HUPV+K"})})]}):(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:4,children:[b&&(0,t.jsxs)($.Alert,{status:"warning",size:"sm",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:"[Admin] Theme images will be uploaded to production theme_images bucket"})]}),A===az.UploadStatus.Error&&(0,t.jsxs)($.Alert,{status:"error",size:"sm",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"This image failed to upload. Please try uploading again.",id:"GymiXM"})})]}),(0,t.jsx)(aT.Heading,{size:"md",children:(0,t.jsx)(ea.Trans,{message:"URL",id:"IagCbF"})}),(0,t.jsx)(ay.URLFetcher,{currentUrl:"",placeholder:n.i18n._({id:"jurEzE",message:"Paste or enter image URL"}),handleSubmit:d,handleDataSubmit:c,noHeader:!0}),!m&&(0,t.jsx)(aT.Heading,{size:"md",children:(0,t.jsx)(ea.Trans,{message:"Upload",id:"ONWvwQ"})}),g&&(0,t.jsx)(aR.UploadBox,{onUploadSuccess:l,onUploadStart:s,onUploadFailed:u,orgId:g,uploadType:"image",editType:i,templateId:f,tipText:n.i18n._({id:"x4Ts51",message:"Tip: You can also drag or paste images anywhere in a card"})}),x&&(0,t.jsx)(aV,{dimensions:y})]})};aG.key="image.custom";let a$=({editor:e,updateAttributes:i,currentAttributes:a})=>{let r=(0,ab.getMediaEmbedUrl)(a);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:r,updateAttributes:i,placeholder:n.i18n._({id:"gzZk6e",message:"Enter a URL here"})}),r&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:a})]})};a$.key="video.custom";let aZ=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://www.figma.com/file/..."}),(0,t.jsx)(aw,{guideLink:"https://help.figma.com/hc/en-us/articles/360039827134-Embed-files-and-prototypes",providerName:"Figma/FigJam"}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};aZ.key="embed.figma";let aK=({editor:e,updateAttributes:i,currentAttributes:a})=>{let r=(0,eT.useAppSelector)(ev.selectWorkspaceId),o=(0,ab.getMediaEmbedUrl)(a),{isInOfflineMode:s}=(0,eh.useHealthCheck)(),l=(0,er.useRef)(null),d=(0,er.useCallback)(({tempUrl:e,file:t})=>{let n=(0,aH.getTempPDFAttrs)(t);l.current=e,i({...n,url:e})},[i]),c=(0,er.useCallback)((t,i)=>{if(!e)return;let n=l.current;(0,aH.handleFileUploadSuccess)(e,n||i,t),l.current=null},[e]);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:o,updateAttributes:i,placeholder:n.i18n._({id:"gzZk6e",message:"Enter a URL here"})}),o&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:a}),!s&&(0,t.jsx)(aT.Heading,{size:"md",children:(0,t.jsx)(ea.Trans,{message:"Upload",id:"ONWvwQ"})}),r&&(0,t.jsx)(aR.UploadBox,{onUploadSuccess:c,onUploadStart:d,orgId:r,uploadType:"all",dropHereText:n.i18n._({id:"F+/kPw",message:"Drag a .pdf, .docx, .pptx, or .csv file or {0}",values:{0:"%{browse}"}}),editType:"node"})]})};aK.key="embed.pdf";var aq=e.i(470645),aY=e.i(724836);let aX=(0,e7.forwardRef)(function(e,i){let{ratio:n=4/3,children:a,className:r,...o}=e,s=er.Children.only(a),l=(0,aq.cx)("chakra-aspect-ratio",r);return(0,t.jsx)(aM.chakra.div,{ref:i,position:"relative",className:l,_before:{height:0,content:'""',display:"block",paddingBottom:(0,aY.mapResponsive)(n,e=>`${1/e*100}%`)},__css:{"& > *:not(style)":{overflow:"hidden",position:"absolute",top:"0",right:"0",bottom:"0",left:"0",display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},"& > img, & > video":{objectFit:"cover"}},...o,children:s})});aX.displayName="AspectRatio",e.s(["AspectRatio",0,aX],514791);var aQ=e.i(857051),aJ=e.i(521689),a0=e.i(501027);let a1="60px",a2=(0,er.memo)(({icon:e,isSelected:i,onIconClick:n})=>{let a=(0,er.useMemo)(()=>({__html:e.html}),[e.html]);return(0,t.jsx)(aQ.GridItem,{height:a1,width:a1,children:(0,t.jsx)(Y.Button,{borderRadius:"base",bgColor:i?"trueblue.100":void 0,color:"gray.800",display:"block",width:"100%",height:"100%",maxH:"100%",pos:"relative",_hover:{bgColor:i?"trueblue.100":"trueblue.50"},_active:{bgColor:"trueblue.100"},transition:"box-shadow .2s ease",variant:"ghost",cursor:"pointer",onClick:()=>n(e),"data-testid":"icon-search-grid-item",children:(0,t.jsx)(q.Box,{height:"100%",maxH:"100%",sx:{svg:{width:"100%",height:"100%"}},dangerouslySetInnerHTML:a})})},e.id)});a2.displayName="ImageSearchGridItem";let a3=({searchQuery:e,currentAttributes:i,updateAttributes:n})=>{let{isInOfflineMode:a}=(0,eh.useHealthCheck)(),[r,o]=(0,er.useState)([]),[s,l]=(0,er.useState)(!0),[d,c]=(0,er.useState)(!1),[u,p]=(0,er.useState)(1),h=(0,er.useCallback)(async t=>{if(a)return;let i=`/api/icons/search?count=100&query=${e}&page=${t}`;l(!0),c(!1);try{let e=await fetch(i,{credentials:"include"}),t=await e.json();if(l(!1),!(t?.data?.length>=0))throw Error(t);o(t.data)}catch(e){c(!0),l(!1),console.error("(caught) [ImageSearchGrid] fetchResults:",e)}},[a,e]);(0,er.useEffect)(()=>{o([]),p(1),h(1)},[e,h]),(0,er.useCallback)(()=>{h(u+1),p(u+1)},[h,u]);let m=i?.src,g=(0,er.useCallback)(async t=>{n({src:t.src,tempUrl:m,meta:{height:t.height,width:t.width},providerMeta:{name:t.provider,id:t.id},query:e})},[e,n,m]),f=r.map((e,n)=>{let a=e.id===i?.providerMeta?.id&&e.provider===i?.providerMeta?.name;return(0,t.jsx)(a2,{provider:e.provider,icon:e,isSelected:a,onIconClick:g},n)});return(0,t.jsxs)(e9.Flex,{direction:"column",align:"stretch",children:[(0,t.jsxs)(ia.SimpleGrid,{gap:2,columns:{base:4,"2xl":6},children:[f,s&&!a&&(0,t.jsx)(a5,{})]}),!1,0===r.length&&!s&&(0,t.jsx)(q.Box,{width:"100%",textAlign:"center",padding:"10px",children:(0,t.jsx)(J.Text,{style:{color:"gray"},children:(0,t.jsx)(ea.Trans,{message:'No icons found for "{searchQuery}"',id:"2AY48J",values:{searchQuery:e}})})}),d&&(0,t.jsxs)($.Alert,{status:"error",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(ea.Trans,{message:"Error searching for icons.",id:"5hlcZg"})]})]})},a5=()=>(0,t.jsx)(t.Fragment,{children:(0,aJ.default)(100).map((e,i)=>(0,t.jsx)(aQ.GridItem,{height:a1,children:(0,t.jsx)(aX,{ratio:1,children:(0,t.jsx)(nu.Skeleton,{borderRadius:"base"})})},i))}),a4=(0,iu.motion)(id.IconButton),a6=({currentAttributes:e,updateAttributes:i,defaultQuery:a="",randomQueries:r,mediaSearchQuery:o,setMediaSearchQuery:s})=>{let[l,d]=(0,er.useState)(a),[c,u]=(0,er.useState)("");(0,er.useEffect)(()=>{s&&l!==o&&s(l)},[l,s,o]),(0,er.useEffect)(()=>{u(a),d(a)},[a]);let p=(0,er.useCallback)(()=>{let e=(0,a0.default)(r);for(;e===l;)e=(0,a0.default)(r);e&&(d(e),u(""))},[r,l]),h=(0,eN.useDebounced)(d,500);return(0,t.jsxs)(ee.VStack,{spacing:4,align:"stretch",translate:"no",children:[(0,t.jsxs)(iW.InputGroup,{size:"md",children:[(0,t.jsx)(iU.InputLeftElement,{pointerEvents:"none",children:(0,t.jsx)(q.Box,{color:"gray.400",children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faSearch})})}),(0,t.jsx)(ie.Input,{placeholder:l||n.i18n._({id:"oMAM3/",message:"Find an icon"}),value:c,onChange:e=>{u(e.target.value),h(e.target.value)},"data-testid":"image-search-input"}),r&&(0,t.jsx)(iU.InputRightElement,{children:(0,t.jsx)(en.GammaTooltip,{placement:"top",label:(0,t.jsx)(ea.Trans,{message:"Surprise me",id:"OVjfHO"}),children:(0,t.jsx)(a4,{icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faDice}),"aria-label":n.i18n._({id:"OVjfHO",message:"Surprise me"}),variant:"ghost",onClick:p,size:"sm",whileTap:{y:"-5px"},onMouseDown:eQ.preventDefaultToAvoidBlur})})})]}),(0,t.jsx)(a3,{currentAttributes:e,updateAttributes:i,searchQuery:l||""})]})},a9=["animals","arrows","business","party","nature","food"],a8=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsx)(a6,{updateAttributes:e,currentAttributes:i,currentIconUrl:i.src,defaultQuery:i.query||"",randomQueries:a9,mediaSearchQuery:n,setMediaSearchQuery:a});a8.key="image.icon";let a7=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://gamma.app/docs/..."}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};a7.key="embed.gamma";var re=e.i(80897);let rt=["funny","surprise","hooray","welcome","excited","nope","fail","sad","cry","angry","teamwork","cats","dogs","high five"],ri=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",randomQueries:rt,provider:"giphy",mediaSearchQuery:n,setMediaSearchQuery:a}),(0,t.jsx)(e9.Flex,{width:"100%",justify:"center",padding:"10px",paddingTop:"30px",children:(0,t.jsx)(q.Box,{maxW:"150px",children:(0,t.jsx)(re.default,{src:"/images/powered-by-giphy.png",width:"150",height:"17",alt:"Powered by GIPHY"})})})]});ri.key="image.giphy";let rn=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://docs.google.com/...",embedTip:(0,t.jsx)(aw,{guideLink:"https://support.google.com/docs/answer/183965?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cedit-embedded-spreadsheets%2Cembed-a-document-spreadsheet-or-presentation",extraMessage:(0,t.jsx)(ea.Trans,{message:"You don't need to publish to embed, but if you don't, anyone you share this {GAMMA_ARTIFACT_PROPER_NOUN} with will need to be shared on the file to see it.",id:"G6PCHK",values:{GAMMA_ARTIFACT_PROPER_NOUN:nh.GAMMA_ARTIFACT_PROPER_NOUN}}),providerName:"Google Sheets, Docs, or Slides"})});rn.key="embed.gdrive";let ra=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://docs.google.com/forms/..."});ra.key="embed.google.form";let rr=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",provider:"google",mediaSearchQuery:n,setMediaSearchQuery:a})});rr.key="image.google";var ro=e.i(335799),rs=e.i(117914),rl=e.i(304521),rd=e.i(413829);let rc={soft:{name:"Soft",spin:[0,-40,40],lighten:[0,0,0]},duo:{name:"Duo",spin:[0,180],lighten:[0,0]},crescent:{name:"Crescent",spin:[0,-45,45,-90,90],lighten:[0,0,0,0,0]},wisp:{name:"Wisp",spin:[0,72,216],lighten:[0,0,0]},mono:{name:"Mono",spin:[0,0,0],lighten:[0,20,40]},cosmos:{name:"Cosmos",spin:[0,72,144,216,288],lighten:[0,0,0,0,0]}},ru=(e,t)=>{let i,n,a,r,o=(i=rc[e],n=[],i.spin.forEach(e=>{let i=(0,rl.default)(t.toHsv()).spin(e);n.push(i)}),i.lighten.forEach((e,t)=>{n[t].lighten(e)}),n),s=(a=[],o.forEach((e,t)=>{let i=e.setAlpha(1),n=i.toHsl().h*t,r=`radial-gradient(circle at ${2*n%360/360*50}% ${3*n%360/360*50}%, ${i.setAlpha(.5).toHex8String()} 0, ${i.setAlpha(0).toHex8String()} ${n%360/360*50+50}%)`;a.push(r)}),r=o[0].setAlpha(.5).toHex8String(),a.push(`linear-gradient(0deg, ${r} 0%, ${r} 100%)`),{backgroundImage:a.join(",")});return{colors:o,gradient:s}},rp=(0,er.forwardRef)(function({isPrimary:e=!1,noTransition:i=!1},n){return(0,t.jsx)(q.Box,{ref:n,borderRadius:"full",boxSize:e?7:5,pos:"absolute",zIndex:e?2:1,shadow:"base",border:"2px solid white",pointerEvents:"none",transitionProperty:i?"none":"transform",transitionDuration:"normal"})}),rh=(0,er.memo)(({updateColor:e,colors:i})=>{let n=(0,er.useRef)(null),a=(0,er.useRef)(null),r=(0,er.useRef)(null),o=(0,er.useRef)(null),s=(0,er.useRef)(null),l=(0,er.useRef)(null),d=(0,er.useMemo)(()=>[a,r,o,s,l],[]);(0,er.useEffect)(()=>{var e;let t=d.map(e=>e.current);e=n.current,t.forEach(e=>{e&&(e.style.opacity="0")}),i.forEach((i,n)=>{var a,r;let o,s,l,d,c=t[n];if(!c||!e)return;let u=(a=e,r=i,o=a.offsetWidth,l=Math.PI/180*(s=(0,rl.default)(r)).toHsl().h,d=-(s.toHsl().l*o)+o,{x:o/2-d*Math.cos(l),y:o/2-d*Math.sin(l)});c.style.transform=`translate(calc(${u.x}px - 50%),calc(${u.y}px - 50%))`,c.style.backgroundColor=i.toHexString(),c.style.opacity="1"})},[i,d]);let c=(0,er.useCallback)(t=>{if(!n.current)return;let i=n.current.getBoundingClientRect();(t.clientX||t.clientY)&&e(function(e,t,i){var n;let a,r,o,s=e.current.offsetWidth,l=e.current.offsetHeight,d=s/2,c=l/2,u=(n=s/2,a=d-t,o=Math.sqrt((r=c-i)*r+a*a),(0,rd.default)(o,0,n)),p=180/Math.PI*Math.atan2(c-i,d-t),h=p+360*Math.ceil(-p/360)+1,m=Math.abs(-u/s+1);return rl.default.fromRatio({h:h,s:1,l:m})}(n,t.clientX-i.left,t.clientY-i.top))},[e]),u=(0,er.useCallback)(()=>{document.removeEventListener("mousemove",c)},[c]),p=(0,er.useCallback)(e=>{document.addEventListener("mousemove",c),document.addEventListener("mouseup",u,{once:!0}),c(e)},[c,u]);return(0,t.jsxs)(q.Box,{onMouseDown:p,p:4,m:-4,position:"relative",children:[(0,t.jsx)(rp,{ref:a,noTransition:!0,isPrimary:!0}),(0,t.jsx)(rp,{ref:r}),(0,t.jsx)(rp,{ref:o}),(0,t.jsx)(rp,{ref:s}),(0,t.jsx)(rp,{ref:l}),(0,t.jsx)(aX,{ratio:1,children:(0,t.jsxs)(e9.Flex,{ref:n,position:"relative",borderRadius:"full",shadow:"lg",children:[(0,t.jsx)(e9.Flex,{pos:"absolute",borderRadius:"full",bg:"radial-gradient(circle closest-side, rgb(255, 255, 255), transparent)",inset:0,zIndex:1}),(0,t.jsx)(e9.Flex,{pos:"absolute",inset:0,bg:"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)",transform:"rotateZ(270deg)",borderRadius:"full"})]})})]})}),rm={vibe:"mono",primaryColor:"#75d8ff",css:{}},rg=({value:e,updateValue:i,isDark:a})=>{let{vibe:r,primaryColor:o}={...rm,...e},[s,l]=(0,er.useState)((0,rl.default)(o)),{colors:d,gradient:c}=(0,er.useMemo)(()=>ru(r,s),[r,s]),u=(0,er.useCallback)(e=>{let{gradient:t}=ru(r,e);i({vibe:r,primaryColor:e.toHexString(),css:t})},[r,i]),p=(0,eN.useThrottled)(u,100),h=(0,er.useCallback)(e=>{l(e),p(e)},[p]);return(0,t.jsxs)(X.HStack,{spacing:4,alignItems:"stretch",wrap:"wrap",children:[(0,t.jsx)(q.Box,{flex:"1",minW:"120px",children:(0,t.jsx)(rh,{vibe:rc[r],color:s,updateColor:h,colors:d})}),(0,t.jsxs)(tp.Stack,{flex:"2",spacing:4,minW:"180px",children:[(0,t.jsx)(e9.Flex,{backgroundColor:a?"black":"white",...c,opacity:1,flex:"1",borderRadius:"md",shadow:"md",minH:"80px",mt:2}),(0,t.jsxs)(X.HStack,{children:[(0,t.jsxs)(tt.Menu,{children:[(0,t.jsx)(ti.MenuButton,{w:"100%",as:Y.Button,size:"sm",variant:"plain",textAlign:"start",rightIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronDown}),children:rc[r].name}),(0,t.jsx)(tr.MenuList,{minWidth:"240px",zIndex:"dropdown",children:(0,t.jsx)(to.MenuOptionGroup,{onChange:e=>{let{gradient:t}=ru(e,s);i({vibe:e,primaryColor:s.toHexString(),css:t})},value:r,title:n.i18n._({id:"4lXZ8R",message:"Style"}),type:"radio",children:Object.entries(rc).map(([e,{name:i}])=>(0,t.jsx)(ta.MenuItemOption,{value:e,children:i},e))})})]}),(0,t.jsx)(ro.ButtonGroup,{size:"sm",variant:"plain",children:(0,t.jsx)(en.GammaTooltip,{placement:"top",label:(0,t.jsx)(ea.Trans,{message:"Surprise me",id:"OVjfHO"}),children:(0,t.jsx)(id.IconButton,{icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faDice}),"aria-label":n.i18n._({id:"OVjfHO",message:"Surprise me"}),onClick:()=>{h(rl.default.fromRatio({h:(0,rs.default)(0,360),s:1,l:(0,rs.default)(.5,.8)}))}})})})]})]})]})},rf=({updateAttributes:e,currentAttributes:i,isDark:n})=>(0,t.jsx)(rg,{value:i,updateValue:e,isDark:n});rf.key="color.gradient";let rb=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://www.instagram.com/..."}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rb.key="embed.instagram";let rx=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://form.jotform.com/..."});rx.key="embed.jotform";let ry=["wallpaper","textures","background","nature","gradient","relax","sky","water","pattern","abstract"],rv=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",randomQueries:ry,provider:"lexica",enablePagination:!0,mediaSearchQuery:n,setMediaSearchQuery:a}),(0,t.jsx)(q.Box,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Photos from <0>Lexica AI",id:"rbDrRg",components:{0:(0,t.jsx)(Q.Link,{href:"https://lexica.art",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]});rv.key="image.lexica";let rC=er.default.lazy(()=>e.A(824334).then(e=>({default:e.LoomPanel}))),rw=e=>(0,t.jsx)(er.Suspense,{fallback:(0,t.jsx)(ic.Spinner,{size:"md"}),children:(0,t.jsx)(rC,{...e})});rw.key="video.loom";let rS=({editor:e,updateAttributes:i,currentAttributes:a})=>{let r=(0,ab.getMediaEmbedUrl)(a);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:r,updateAttributes:i,placeholder:n.i18n._({id:"ORLSr4",message:"Paste a URL or {let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://www.miro.com/..."}),(0,t.jsx)(aw,{guideLink:"https://help.miro.com/hc/en-us/articles/360016335640-How-to-embed-editable-boards-into-websites",providerName:"Miro"}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rk.key="embed.miro";let rA=["wallpaper","textures","architecture","background","nature","gradient","experimental","animals","california","flowers","relax","sky","water","pattern","abstract"],rE=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query,randomQueries:rA,provider:"pexels",mediaSearchQuery:n,setMediaSearchQuery:a}),(0,t.jsx)(q.Box,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Photos from <0>{PEXELS_PROPER_NOUN}",id:"5Mmw5f",values:{PEXELS_PROPER_NOUN:"Pexels"},components:{0:(0,t.jsx)(Q.Link,{href:"https://pexels.com",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]});rE.key="image.pexels";let r_=["business","rocket","graphs","build","gradient","sky","water"],rI=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",randomQueries:r_,provider:"pictographic",enablePagination:!0,mediaSearchQuery:n,setMediaSearchQuery:a}),(0,t.jsx)(q.Box,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Illustrations from <0>Pictographic",id:"wOdKZR",components:{0:(0,t.jsx)(Q.Link,{href:"https://pictographic.io",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]});rI.key="image.pictographic";let rM=["teamwork","presentation","growth","education","learning","goal","innovation","training","success","planning"],rT=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",randomQueries:rM,provider:"pictographicIcons",enablePagination:!0,resultsPerPage:100,resultEntityType:"icon",mediaSearchQuery:n,setMediaSearchQuery:a,displayAsGrid:!0})});rT.key="image.pictographic.icon";let rL=({editor:e,updateAttributes:i,currentAttributes:a})=>{let r=(0,ab.getMediaEmbedUrl)(a);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:r,updateAttributes:i,placeholder:n.i18n._({id:"ORLSr4",message:"Paste a URL or {let i=(await e.A(580392)).default,{text:n,foregroundColor:a,backgroundColor:r,logoUrl:o,dotOption:s}=t;return new i({width:300,height:300,type:"svg",data:n,image:o,margin:10,dotsOptions:{color:a||"#000",type:s},backgroundOptions:{color:r||"#fff"},imageOptions:{crossOrigin:"anonymous",imageSize:.4,margin:0}}).getRawData("svg")},rP=({editor:e,editType:i,updateAttributes:a,currentAttributes:r})=>{let{saveImageFromDataBlob:o}=aU({updateAttributes:a,editor:e,editType:i,source:"image.qrCode"}),[s,l]=(0,er.useState)(!1),d="#000000",c="#FFFFFF",u="square",[p,h]=(0,er.useState)(r?.meta?.title),[m,g]=(0,er.useState)(r?.src),f=(0,er.useRef)(void 0),b=(0,er.useCallback)(()=>{l(!0)},[]),x=(0,er.useCallback)(async()=>{if(!p)return;let e=await rj({text:p,foregroundColor:d,backgroundColor:c,dotOption:u});e&&(g(window.URL.createObjectURL(e)),f.current=e)},[p,d,c,u]);(0,er.useEffect)(()=>{x()},[u,c,d,p,p,x]);let{src:y,tempUrl:v,meta:C,showPlaceholder:w,uploadStatus:S}=r,k=y?(0,eO.resizeAndProxyImageUrl)(y,{width:500}):void 0,A=!s&&!!(y||v||w),E=(0,er.useCallback)(async()=>{f.current&&(l(!0),await o({blob:f.current,attributes:{meta:{title:p,foregroundColor:d,backgroundColor:c,dotOption:u}}}),l(!1))},[o,p,d,c,u]);return A?(0,t.jsxs)(ee.VStack,{align:"center",spacing:4,children:[S===az.UploadStatus.Uploading&&(0,t.jsxs)($.Alert,{status:"info",size:"sm",children:[(0,t.jsx)(K.AlertIcon,{as:ic.Spinner,w:5,h:5}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"This image is uploading. Don't close this window until the upload is complete.",id:"MEDU34"})})]}),w?(0,t.jsx)(aN.MediaPlaceholderImage,{isUploading:S===az.UploadStatus.Uploading,hasUploadError:S===az.UploadStatus.Error,width:"100%",height:"200px",borderRadius:"md"}):(0,t.jsx)(te.Image,{src:k||v,alt:"",ignoreFallback:!0,borderRadius:"md"}),C?.title&&(0,t.jsx)(J.Text,{textAlign:"left",w:"100%",children:C.title}),S!==az.UploadStatus.Uploading&&(0,t.jsx)(Y.Button,{onClick:b,mt:2,w:"100%",children:(0,t.jsx)(ea.Trans,{message:"Edit QR code",id:"4uW88M"})})]}):(0,t.jsxs)(ee.VStack,{align:"stretch",spacing:4,children:[S===az.UploadStatus.Error&&(0,t.jsxs)($.Alert,{status:"error",size:"sm",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"This image failed to upload. Please try uploading again.",id:"GymiXM"})})]}),(0,t.jsxs)(e8.FormControl,{id:"qr-url",children:[(0,t.jsx)(t9.FormLabel,{children:(0,t.jsx)(ea.Trans,{message:"URL",id:"IagCbF"})}),(0,t.jsx)(iW.InputGroup,{size:"lg",children:(0,t.jsx)(ie.Input,{id:"qr-url",value:p,placeholder:n.i18n._({id:"qf63PF",message:"Enter URL"}),type:"url",onChange:e=>{h(e.target.value)}})})]}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(q.Box,{p:4,py:2,bg:"gray.50",borderRadius:"md",children:(0,t.jsxs)(tp.Stack,{spacing:2,children:[(0,t.jsx)(J.Text,{children:(0,t.jsx)(ea.Trans,{message:"Live preview",id:"a37vfH"})}),(0,t.jsx)(e9.Flex,{align:"center",justify:"center",h:"200px",p:1,border:"1px solid",borderColor:"gray.200",borderRadius:"md",overflow:"hidden",bg:"white",children:m?(0,t.jsx)(tp.Stack,{h:"100%",children:(0,t.jsx)(te.Image,{src:m,maxH:"100%"})}):(0,t.jsx)(q.Box,{p:2,children:(0,t.jsx)(J.Text,{size:"xs",color:"gray.500",textAlign:"center",children:(0,t.jsx)(ea.Trans,{message:"Your QR code will appear here",id:"eu7KCb"})})})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.600",children:(0,t.jsx)(ea.Trans,{message:"Scan the live preview to test the QR code.",id:"wjRHQb"})})]})}),(0,t.jsx)(en.GammaTooltip,{isDisabled:!!m,shouldWrapChildren:!0,label:(0,t.jsx)(ea.Trans,{message:"Enter a URL",id:"Y1WnIF"}),children:(0,t.jsx)(Y.Button,{onClick:E,w:"100%",variant:"solid",tabIndex:0,isDisabled:!m,children:(0,t.jsx)(ea.Trans,{message:"Insert QR code",id:"IChvxB"})})})]})]})};rP.key="image.qrCode";let rD=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a||"",updateAttributes:i,placeholder:"https://open.spotify.com/..."}),(0,t.jsx)(aw,{guideLink:"https://artists.spotify.com/en/help/article/embedded-players-follow-buttons",providerName:"Spotify",extraMessage:(0,t.jsx)(ea.Trans,{message:"You can also paste a URL straight to a podcast episode.",id:"ItAUcI"})}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rD.key="video.spotify";let rN=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://app.streamalive.com/...",embedTip:(0,t.jsxs)($.Alert,{status:"info",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"Follow <0>this guide<1/> to learn how to embed a StreamAlive interaction and make a {GAMMA_PROPER_NOUN} card interactive.",id:"SFjNuv",values:{GAMMA_PROPER_NOUN:nh.GAMMA_PROPER_NOUN},components:{0:(0,t.jsx)(Q.Link,{href:"https://streamalive.com/gamma-embed",textDecoration:"underline",isExternal:!0}),1:(0,t.jsx)(aC.ExternalLinkIcon,{mx:"2px"})}})})]})});rN.key="embed.streamalive";let rR=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://tally.so/..."});rR.key="embed.tally";let rO=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://www.tiktok.com/..."}),(0,t.jsx)(aw,{guideLink:"https://developers.tiktok.com/doc/embed-videos/",providerName:"TikTok"}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rO.key="video.tiktok";let rB=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://twitter.com/..."}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rB.key="embed.twitter";let rz=e=>(0,t.jsx)(av,{...e,urlPlaceholder:"https://typeform.com/..."});rz.key="embed.typeform";let rF=["wallpaper","textures","architecture","background","nature","gradient","experimental","animals","california","flowers","relax","sky","water","pattern","abstract"],rH=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query,randomQueries:rF,provider:"unsplash",mediaSearchQuery:n,setMediaSearchQuery:a}),(0,t.jsx)(q.Box,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Photos from <0>{UNSPLASH_PROPER_NOUN}",id:"k16iQH",values:{UNSPLASH_PROPER_NOUN:"Unsplash"},components:{0:(0,t.jsx)(Q.Link,{href:"https://unsplash.com",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]});rH.key="image.unsplash";let rW=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://vimeo.com/..."}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rW.key="video.vimeo";let rU=["modern office workspace","sustainable energy landscape","vintage automobile collection","future technology concept","tropical beach paradise","urban street art","classical music instruments","mountain hiking adventure","wildlife safari","space exploration visuals","ancient ruins aerial view","deep sea marine life","high fashion runway event","robotics in manufacturing","gourmet food presentation","winter sports scene","abstract art paintings","traditional village festival","modern architecture landmarks","digital art fantasy worlds"],rV=({updateAttributes:e,currentAttributes:i,mediaSearchQuery:n,setMediaSearchQuery:a})=>(0,t.jsx)(aE.ImageSearch,{updateAttributes:e,currentImageUrl:i.src,defaultQuery:i.query||"",enablePagination:!0,enableLicenseFilter:!0,provider:"web",resultsPerPage:48,randomQueries:rU,resizeThumbnails:!0,mediaSearchQuery:n,setMediaSearchQuery:a});rV.key="image.web";let rG=({editor:e,updateAttributes:i,currentAttributes:a})=>{let{proxy:r,displayStyle:o}=a,s=(0,ab.getMediaEmbedUrl)(a);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:s||"",updateAttributes:i,placeholder:n.i18n._({id:"gzZk6e",message:"Enter a URL here"})}),s&&o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(t6.Checkbox,{isChecked:r,onChange:e=>i({proxy:e.target.checked}),children:(0,t.jsx)(ea.Trans,{message:"Load through a proxy",id:"Fl9cgp"})}),(0,t.jsx)(J.Text,{fontSize:"sm",color:"gray.500",mt:-2,children:(0,t.jsx)(ea.Trans,{message:"Tip: try this setting if pages aren't loading. It works best with static web pages, not interactive apps.",id:"J87/8N"})})]}),s&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:a})]})};rG.key="embed.custom";let r$=({editor:e,updateAttributes:i,currentAttributes:n})=>{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"{let a=(0,ab.getMediaEmbedUrl)(n);return(0,t.jsxs)(ee.VStack,{align:"flex-start",spacing:4,children:[(0,t.jsx)(ay.URLFetcher,{currentUrl:a,updateAttributes:i,placeholder:"https://www.youtube.com/watch?v=..."}),a&&(0,t.jsx)(ax.EmbedMetadata,{editor:e,updateAttributes:i,currentAttributes:n})]})};rZ.key="video.youtube";let rK=Object.fromEntries(Object.values([a_,ri,rr,rV,rv,rH,rE,rZ,rw,aZ,ra,rn,rG,aG,rP,nd,af,nT,rS,rL,rB,rW,a$,aK,rk,aS,ak,r$,rD,rO,rb,rf,a8,aI,rz,rx,rR,rN,a7,rI,rT]).flat().map(e=>[e.key,e]));var rq=e.i(120604),rY=e.i(623184),rX=e.i(397068);let rQ=({accentImages:e,isDark:i,handleDelete:a,handleItemClick:r,currentAttributes:o,editType:s})=>{let l=(0,er.useCallback)(e=>t=>{a&&(t.stopPropagation(),a(e))},[a]),d=(0,er.useCallback)(e=>()=>{r&&r(e)},[r]);return(0,t.jsx)(ia.SimpleGrid,{gap:2,columns:{base:2,"2xl":3},children:e.map(e=>{let c=(0,rX.getBackgroundProps)(e,i,eO.THUMBNAIL_RESIZE_JPG_PARAMS),u=("node"===s||"accessory"===s)&&e.image,p=u?{...e.image,source:e.source}:e,h=u?o?.src===e.image.src:o?.accentId===e.accentId;return(0,t.jsx)(aQ.GridItem,{children:(0,t.jsxs)(q.Box,{as:Y.Button,variant:"unstyled",backgroundColor:i?"black":"white",cursor:r?"pointer":void 0,...c,opacity:1,width:"100%",borderRadius:"base",shadow:"md",minH:"100px",position:"relative",role:"group",onClick:d(p),children:[a&&(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"Delete accent image",id:"Rz0Yis"}),placement:"top",children:(0,t.jsx)(id.IconButton,{"aria-label":n.i18n._({id:"Rz0Yis",message:"Delete accent image"}),icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faTrash}),onClick:l(e),isRound:!0,position:"absolute",top:1,insetEnd:1,size:"sm",color:"red.600",opacity:0,_hover:{color:"red.600"},_groupHover:{opacity:1}})}),o&&(0,t.jsx)(rY.Fade,{in:h,children:(0,t.jsx)(q.Box,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,t.jsx)(t7.Center,{h:"100%",w:"100%",children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faCheck})})})})]})},e.accentId)})})};var rJ=e.i(686296);e.i(420945);var r0=e.i(949488),r1=e.i(891494),r2=e.i(865786),r3=e.i(878726),r5=e.i(260241),r4=e.i(480801),r6=e.i(595995),r9=e.i(402818),r8=e.i(66657),r7=e.i(233924),oe=e.i(836241),ot=e.i(403379);function oi(e){let t=(0,er.useRef)(null);return t.current=e,t}var on=e.i(441224),oa=e.i(601428);function or(e,t="page"){return e.touches?function(e,t="page"){let i=e.touches[0]||e.changedTouches[0];return{x:i[`${t}X`],y:i[`${t}Y`]}}(e,t):function(e,t="page"){return{x:e[`${t}X`],y:e[`${t}Y`]}}(e,t)}function oo(e,t,i,n){var a;return a=function(e,t=!1){function i(t){e(t,{point:or(t)})}return t?e=>{let t,n=void 0!==(t=(0,oa.getEventWindow)(e)).PointerEvent&&e instanceof t.PointerEvent?"mouse"===e.pointerType:e instanceof t.MouseEvent;(!n||n&&0===e.button)&&i(e)}:i}(i,"pointerdown"===t),e.addEventListener(t,a,n),()=>{e.removeEventListener(t,a,n)}}let os=1/60*1e3,ol="u">typeof performance?()=>performance.now():()=>Date.now(),od="u">typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(ol()),os),oc=!0,ou=!1,op=!1,oh={delta:0,timestamp:0},om=["read","update","preRender","render","postRender"],og=om.reduce((e,t)=>{var i;let n,a,r,o,s,l,d;return e[t]=(i=()=>ou=!0,n=[],a=[],r=0,o=!1,s=!1,l=new WeakSet,d={schedule:(e,t=!1,i=!1)=>{let s=i&&o,d=s?n:a;return t&&l.add(e),-1===d.indexOf(e)&&(d.push(e),s&&o&&(r=n.length)),e},cancel:e=>{let t=a.indexOf(e);-1!==t&&a.splice(t,1),l.delete(e)},process:e=>{if(o){s=!0;return}if(o=!0,[n,a]=[a,n],a.length=0,r=n.length)for(let t=0;t{let i=og[t];return e[t]=(e,t=!1,n=!1)=>(ou||ov(),i.schedule(e,t,n)),e},{}),ob=om.reduce((e,t)=>(e[t]=og[t].cancel,e),{});om.reduce((e,t)=>(e[t]=()=>og[t].process(oh),e),{});let ox=e=>og[e].process(oh),oy=e=>{ou=!1,oh.delta=oc?os:Math.max(Math.min(e-oh.timestamp,40),1),oh.timestamp=e,op=!0,om.forEach(ox),op=!1,ou&&(oc=!1,od(oy))},ov=()=>{ou=!0,oc=!0,op||od(oy)};var oC=Object.defineProperty,ow=(e,t,i)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?oC(e,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[n]=i,i};class oS{constructor(e,t,i){if(ow(this,"history",[]),ow(this,"startEvent",null),ow(this,"lastEvent",null),ow(this,"lastEventInfo",null),ow(this,"handlers",{}),ow(this,"removeListeners",()=>{}),ow(this,"threshold",3),ow(this,"win"),ow(this,"updatePoint",()=>{var e,t;if(!(this.lastEvent&&this.lastEventInfo))return;let i=oA(this.lastEventInfo,this.history),n=null!==this.startEvent,a=(e=i.offset,t={x:0,y:0},("number"==typeof e&&"number"==typeof t?o_(e,t):oI(e)&&oI(t)?Math.sqrt(o_(e.x,t.x)**2+o_(e.y,t.y)**2):0)>=this.threshold);if(!n&&!a)return;let{timestamp:r}=oh;this.history.push({...i.point,timestamp:r});let{onStart:o,onMove:s}=this.handlers;n||(o?.(this.lastEvent,i),this.startEvent=this.lastEvent),s?.(this.lastEvent,i)}),ow(this,"onPointerMove",(e,t)=>{this.lastEvent=e,this.lastEventInfo=t,of.update(this.updatePoint,!0)}),ow(this,"onPointerUp",(e,t)=>{let i=oA(t,this.history),{onEnd:n,onSessionEnd:a}=this.handlers;a?.(e,i),this.end(),n&&this.startEvent&&n?.(e,i)}),this.win=e.view??window,function(e){return!!e.touches&&e.touches.length>1}(e))return;this.handlers=t,i&&(this.threshold=i),e.stopPropagation(),e.preventDefault();const n={point:or(e)},{timestamp:a}=oh;this.history=[{...n.point,timestamp:a}];const{onSessionStart:r}=t;r?.(e,oA(n,this.history)),this.removeListeners=function(...e){return t=>e.reduce((e,t)=>t(e),t)}(oo(this.win,"pointermove",this.onPointerMove),oo(this.win,"pointerup",this.onPointerUp),oo(this.win,"pointercancel",this.onPointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners?.(),ob.update(this.updatePoint)}}function ok(e,t){return{x:e.x-t.x,y:e.y-t.y}}function oA(e,t){return{point:e.point,delta:ok(e.point,t[t.length-1]),offset:ok(e.point,t[0]),velocity:function(e){if(e.length<2)return{x:0,y:0};let t=e.length-1,i=null,n=e[e.length-1];for(;t>=0&&(i=e[t],!(n.timestamp-i.timestamp>oE(.1)));)t--;if(!i)return{x:0,y:0};let a=(n.timestamp-i.timestamp)/1e3;if(0===a)return{x:0,y:0};let r={x:(n.x-i.x)/a,y:(n.y-i.y)/a};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}(t)}}let oE=e=>1e3*e;function o_(e,t){return Math.abs(e-t)}function oI(e){return"x"in e&&"y"in e}var oM=e.i(897325),oT=e.i(315965),oL=e.i(988082),oj=e.i(455902);function oP(e){let{orientation:t,vertical:i,horizontal:n}=e;return"vertical"===t?i:n}var oD=e.i(16120);let[oN,oR]=(0,r7.createContext)({name:"SliderContext",hookName:"useSliderContext",providerName:""}),[oO,oB]=(0,r7.createContext)({name:"SliderStylesContext",hookName:"useSliderStyles",providerName:""}),oz=(0,e7.forwardRef)((e,i)=>{let n={...e,orientation:e?.orientation??"horizontal"},a=(0,tm.useMultiStyleConfig)("Slider",n),r=(0,r8.omitThemingProps)(n),{direction:o}=(0,oD.useTheme)();r.direction=o;let{getInputProps:s,getRootProps:l,...d}=function(e){var t,i;let{min:n=0,max:a=100,onChange:r,value:o,defaultValue:s,isReversed:l,direction:d="ltr",orientation:c="horizontal",id:u,isDisabled:p,isReadOnly:h,onChangeStart:m,onChangeEnd:g,step:f=1,getAriaValueText:b,"aria-valuetext":x,"aria-label":y,"aria-labelledby":v,name:C,focusThumbOnChange:w=!0,...S}=e,k=(0,oe.useCallbackRef)(m),A=(0,oe.useCallbackRef)(g),E=(0,oe.useCallbackRef)(b),_=function(e){let{isReversed:t,direction:i,orientation:n}=e;return"ltr"===i||"vertical"===n?t:!t}({isReversed:l,direction:d,orientation:c}),[I,M]=(0,ot.useControllableState)({value:o,defaultValue:s??(t=n,(i=a){if(!U.current)return;let t=W.current;t.eventSource="pointer";let i=U.current.getBoundingClientRect(),{clientX:n,clientY:a}=e.touches?.[0]??e,r=(H?i.bottom-a:n-i.left)/(H?i.height:i.width);_&&(r=1-r);let o=(0,oT.percentToValue)(r,t.min,t.max);return t.step&&(o=parseFloat((0,oT.roundValueToStep)(o,t.min,t.step))),o=(0,oT.clampValue)(o,t.min,t.max)},[H,_,W]),X=(0,er.useCallback)(e=>{let t=W.current;t.isInteractive&&(e=parseFloat((0,oT.roundValueToStep)(e,t.min,R)),M(e=(0,oT.clampValue)(e,t.min,t.max)))},[R,M,W]),Q=(0,er.useMemo)(()=>({stepUp(e=R){X(_?O-e:O+e)},stepDown(e=R){X(_?O+e:O-e)},reset(){X(s||0)},stepTo(e){X(e)}}),[X,_,O,R,s]),J=(0,er.useCallback)(e=>{let t=W.current,i={ArrowRight:()=>Q.stepUp(),ArrowUp:()=>Q.stepUp(),ArrowLeft:()=>Q.stepDown(),ArrowDown:()=>Q.stepDown(),PageUp:()=>Q.stepUp(N),PageDown:()=>Q.stepDown(N),Home:()=>X(t.min),End:()=>X(t.max)}[e.key];i&&(e.preventDefault(),e.stopPropagation(),i(e),t.eventSource="keyboard")},[Q,X,N,W]),ee=E?.(O)??x,{getThumbStyle:et,rootStyle:ei,trackStyle:en,innerTrackStyle:ea}=(0,er.useMemo)(()=>(function(e){let{orientation:t,thumbPercents:i,isReversed:n}=e,a={position:"absolute",...oP({orientation:t,vertical:{left:"50%",transform:"translateX(-50%)",height:"100%"},horizontal:{top:"50%",transform:"translateY(-50%)",width:"100%"}})},r=1===i.length,o=[0,n?100-i[0]:i[0]],s=r?o:i,l=s[0];!r&&n&&(l=100-l);let d=Math.abs(s[s.length-1]-s[0]),c={...a,...oP({orientation:t,vertical:n?{height:`${d}%`,top:`${l}%`}:{height:`${d}%`,bottom:`${l}%`},horizontal:n?{width:`${d}%`,right:`${l}%`}:{width:`${d}%`,left:`${l}%`}})};return{trackStyle:a,innerTrackStyle:c,rootStyle:{position:"relative",touchAction:"none",WebkitTapHighlightColor:"rgba(0,0,0,0)",userSelect:"none",outline:0},getThumbStyle:e=>({position:"absolute",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",touchAction:"none",...oP({orientation:t,vertical:{bottom:`${i[e]}%`,transform:"translate(-50%, 50%) scale(var(--slider-thumb-scale, 1))"},horizontal:{left:`${i[e]}%`,transform:"translate(-50%, -50%) scale(var(--slider-thumb-scale, 1))"}})})}})({isReversed:_,orientation:W.current.orientation,thumbPercents:[F]}),[_,F,W]),eo=(0,er.useCallback)(()=>{W.current.focusThumbOnChange&&setTimeout(()=>V.current?.focus())},[W]);function es(e){let t=Y(e);null!=t&&t!==W.current.value&&M(t)}(0,on.useUpdateEffect)(()=>{let e=W.current;eo(),"keyboard"===e.eventSource&&A?.(e.value)},[O,A]),function(e,t){let{onPan:i,onPanStart:n,onPanEnd:a,onPanSessionStart:r,onPanSessionEnd:o,threshold:s}=t,l=!!(i||n||a||r||o),d=(0,er.useRef)(null),c=oi({onSessionStart:r,onSessionEnd:o,onStart:n,onMove:i,onEnd(e,t){d.current=null,a?.(e,t)}});(0,er.useEffect)(()=>{d.current?.updateHandlers(c.current)}),(0,er.useEffect)(()=>{let t=e.current;if(t&&l)return oo(t,"pointerdown",function(e){d.current=new oS(e,c.current,s)})},[e,l,c,s]),(0,er.useEffect)(()=>()=>{d.current?.end(),d.current=null},[])}(G,{onPanSessionStart(e){let t=W.current;t.isInteractive&&(L(!0),eo(),es(e),k?.(t.value))},onPanSessionEnd(){let e=W.current;e.isInteractive&&(L(!1),A?.(e.value))},onPan(e){W.current.isInteractive&&es(e)}});let el=(0,er.useCallback)((e={},t=null)=>({...e,...S,ref:(0,oM.mergeRefs)(t,G),tabIndex:-1,"aria-disabled":(0,oL.ariaAttr)(p),"data-focused":(0,oL.dataAttr)(j),style:{...e.style,...ei}}),[S,p,j,ei]),ed=(0,er.useCallback)((e={},t=null)=>({...e,ref:(0,oM.mergeRefs)(t,U),id:q,"data-disabled":(0,oL.dataAttr)(p),style:{...e.style,...en}}),[p,q,en]),ec=(0,er.useCallback)((e={},t=null)=>({...e,ref:t,style:{...e.style,...ea}}),[ea]),eu=(0,er.useCallback)((e={},t=null)=>({...e,ref:(0,oM.mergeRefs)(t,V),role:"slider",tabIndex:D?0:void 0,id:K,"data-active":(0,oL.dataAttr)(T),"aria-valuetext":ee,"aria-valuemin":n,"aria-valuemax":a,"aria-valuenow":O,"aria-orientation":c,"aria-disabled":(0,oL.ariaAttr)(p),"aria-readonly":(0,oL.ariaAttr)(h),"aria-label":y,"aria-labelledby":y?void 0:v,style:{...e.style,...et(0)},onKeyDown:(0,oj.callAllHandlers)(e.onKeyDown,J),onFocus:(0,oj.callAllHandlers)(e.onFocus,()=>P(!0)),onBlur:(0,oj.callAllHandlers)(e.onBlur,()=>P(!1))}),[D,K,T,ee,n,a,O,c,p,h,y,v,et,J]),ep=(0,er.useCallback)((e,t=null)=>{let i=!(e.valuea),r=O>=e.value,o=(0,oT.valueToPercent)(e.value,n,a),s={position:"absolute",pointerEvents:"none",...function(e){let{orientation:t,vertical:i,horizontal:n}=e;return"vertical"===t?i:n}({orientation:c,vertical:{bottom:_?`${100-o}%`:`${o}%`},horizontal:{left:_?`${100-o}%`:`${o}%`}})};return{...e,ref:t,role:"presentation","aria-hidden":!0,"data-disabled":(0,oL.dataAttr)(p),"data-invalid":(0,oL.dataAttr)(!i),"data-highlighted":(0,oL.dataAttr)(r),style:{...e.style,...s}}},[p,_,a,n,c,O]),eh=(0,er.useCallback)((e={},t=null)=>({...e,ref:t,type:"hidden",value:O,name:C}),[C,O]);return{state:{value:O,isFocused:j,isDragging:T},actions:Q,getRootProps:el,getTrackProps:ed,getInnerTrackProps:ec,getThumbProps:eu,getMarkerProps:ep,getInputProps:eh}}(r),c=l(),u=s({},i);return(0,t.jsx)(oN,{value:d,children:(0,t.jsx)(oO,{value:a,children:(0,t.jsxs)(aM.chakra.div,{...c,className:(0,aq.cx)("chakra-slider",n.className),__css:a.container,children:[n.children,(0,t.jsx)("input",{...u})]})})})});oz.displayName="Slider";let oF=(0,e7.forwardRef)((e,i)=>{let{getThumbProps:n}=oR(),a=oB(),r=n(e,i);return(0,t.jsx)(aM.chakra.div,{...r,className:(0,aq.cx)("chakra-slider__thumb",e.className),__css:a.thumb})});oF.displayName="SliderThumb";let oH=(0,e7.forwardRef)((e,i)=>{let{getTrackProps:n}=oR(),a=oB(),r=n(e,i);return(0,t.jsx)(aM.chakra.div,{...r,className:(0,aq.cx)("chakra-slider__track",e.className),__css:a.track})});oH.displayName="SliderTrack";let oW=(0,e7.forwardRef)((e,i)=>{let{getInnerTrackProps:n}=oR(),a=oB(),r=n(e,i);return(0,t.jsx)(aM.chakra.div,{...r,className:(0,aq.cx)("chakra-slider__filled-track",e.className),__css:a.filledTrack})});oW.displayName="SliderFilledTrack",(0,e7.forwardRef)((e,i)=>{let{getMarkerProps:n}=oR(),a=oB(),r=n(e,i);return(0,t.jsx)(aM.chakra.div,{...r,className:(0,aq.cx)("chakra-slider__marker",e.className),__css:a.mark})}).displayName="SliderMark",e.s(["Slider",0,oz,"SliderFilledTrack",0,oW,"SliderThumb",0,oF,"SliderTrack",0,oH],812405);var oU=e.i(892194),oV=e.i(102544),oG=e.i(770127);let o$=(0,e7.forwardRef)(({color:e,name:i,isActive:n,size:a=8,onClick:r,buttonProps:o},s)=>{let l=(0,oU.useColorModeValue)("gray.200","gray.600"),d=(0,rJ.isThemeColorDark)(e)?"white":"black";return(0,t.jsx)(en.GammaTooltip,{label:i,placement:"top",isDisabled:!i,children:(0,t.jsx)(Y.Button,{display:"inline-block",alignSelf:"center",boxSize:a,borderRadius:"md",border:"1px solid",borderColor:l,color:d,css:(0,rJ.getThemeColorBackgroundCss)(e),onClick:()=>r?.(e),variant:"unstyled",minW:a,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",ref:s,...o,children:n&&(0,t.jsx)(ii.CheckIcon,{})})})});o$.displayName="ThemeColorIcon";let oZ=({mode:e,setMode:i})=>(0,t.jsxs)(tt.Menu,{children:[(0,t.jsx)(ti.MenuButton,{as:Y.Button,size:"sm",rightIcon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faChevronDown,size:"sm"}),minW:24,textAlign:"start",children:e}),(0,t.jsx)(tr.MenuList,{children:(0,t.jsx)(to.MenuOptionGroup,{defaultValue:e,value:e,title:n.i18n._({id:"YDWhuY",message:"Color mode"}),type:"radio",onChange:i,children:["HEX","RGB","HSL"].map(e=>(0,t.jsx)(ta.MenuItemOption,{value:e,children:e},e))})})]}),oK={type:"solid",color:"#FF0000"},oq=e=>{let[i,n]=(0,er.useState)("HEX"),a=e.color||e.defaultColor||oK,r=(0,rJ.getThemeColorSolid)(a),{updateColor:o}=e,s=(0,er.useCallback)(e=>{o({type:"solid",color:e})},[o]);return(0,t.jsxs)(ee.VStack,{align:"start",spacing:4,children:[(0,t.jsx)(si,{...e}),(0,t.jsxs)(ee.VStack,{children:[(0,t.jsx)(o0,{color:r,onChange:s}),(0,t.jsxs)(X.HStack,{w:"100%",spacing:4,children:[(0,t.jsx)(o$,{color:a}),(0,t.jsx)(oJ,{color:r,onChange:s}),(0,t.jsx)(o1,{color:r,onChange:s})]}),(0,t.jsxs)(X.HStack,{flex:1,w:"100%",children:[(0,t.jsx)(oZ,{mode:i,setMode:n}),"HEX"===i&&(0,t.jsx)(oY,{initialFocusRef:e.initialFocusRef,color:r,updateColor:s,placeholder:oK.color}),"HSL"===i&&(0,t.jsx)(oX,{color:r,updateColor:s}),"RGB"===i&&(0,t.jsx)(oQ,{color:r,updateColor:s})]})]})]})},oY=({color:e,updateColor:i,placeholder:n,initialFocusRef:a})=>{let[r,o]=(0,er.useState)(e),[s,l]=(0,er.useState)(!1);(0,er.useEffect)(()=>{o(e.toUpperCase())},[e]);let d=(0,er.useCallback)(e=>{let t=e.target.value;o(t),(0,tE.isSolidHexColor)(t)&&i(t)},[i]),c=(0,er.useCallback)(e=>{let t=e.target.value,n=(0,tE.colorNameToHex)(t);if(null!==n)return void i(n);let a=sn(t);(0,tE.isSolidHexColor)(a)?i(a):i("#000000")},[i]);return(0,er.useEffect)(()=>{a&&!s&&(a.current?.select(),l(!0))},[s,a]),(0,t.jsx)(ie.Input,{ref:a,size:"sm",type:"text",value:r,onChange:d,onBlur:c,onKeyDown:e=>{"Enter"===e.key&&c(e)},fontFamily:"mono",placeholder:n,"data-testid":"color-picker-text-input-hex"})},oX=({color:e,updateColor:i})=>{let n=(0,rl.default)(e).toHsl(),[a,r,o]=[n.h,100*n.s,100*n.l];return(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:Math.round(a),onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({h:t,s:r/100,l:o/100}).toHexString())},min:0,max:360,step:1,flex:1}),(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:Math.round(r),onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({h:a,s:t/100,l:o/100}).toHexString())},min:0,max:100,step:1,flex:1}),(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:Math.round(o),onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({h:a,s:r/100,l:t/100}).toHexString())},min:0,max:100,step:1,flex:1})]})},oQ=({color:e,updateColor:i})=>{let n=(0,rl.default)(e).toRgb(),[a,r,o]=[n.r,n.g,n.b];return(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:a,onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({r:t,g:r,b:o}).toHexString())},min:0,max:255,step:1,flex:1}),(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:r,onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({r:a,g:t,b:o}).toHexString())},min:0,max:255,step:1,flex:1}),(0,t.jsx)(ie.Input,{size:"sm",type:"number",value:o,onChange:e=>{var t;return t=Number(e.target.value),void i((0,rl.default)({r:a,g:r,b:t}).toHexString())},min:0,max:255,step:1,flex:1})]})},oJ=({color:e,onChange:i})=>{let n=(0,rl.default)(e).toHsv(),[a,r]=(0,er.useState)(n.h);return(0,er.useEffect)(()=>{r(n.h)},[n.h]),(0,t.jsxs)(oz,{min:0,max:360,defaultValue:a,value:a,size:"lg",onChange:e=>{r(e),i((0,rl.default)({h:e,s:n.s,v:n.v}).toHexString())},step:.1,focusThumbOnChange:!1,children:[(0,t.jsx)(oH,{h:3,borderRadius:"full",bgGradient:"linear(to-r, hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(360, 100%, 50%))"}),(0,t.jsx)(oF,{borderWidth:3,borderColor:"white",bg:`hsl(${n.h}, 100%, 50%)`,boxSize:"24px",shadow:"md",outline:"1px solid",outlineColor:"blackAlpha.200"})]})},o0=({color:e,onChange:i})=>{let[n,a]=(0,er.useState)(!1),r=(0,er.useRef)(null),o=(0,er.useRef)(null),s=(0,er.useRef)(null),l=(0,rl.default)(e).toHsv(),d=(0,rl.default)({h:l.h,s:100,v:100}),c=(0,er.useCallback)((e,t)=>{if(!r.current)return;let i=e/r.current.width,n=1-t/r.current.height;return l.s=i,l.v=n,l},[l]),u=(0,er.useCallback)(e=>{if(!r.current)return{x:0,y:0};let t=(0,rl.default)(e).toHsv(),i=t.s,n=t.v;return{x:i*r.current.width,y:(1-n)*r.current.height}},[]),p=(0,er.useCallback)(()=>{let e=r.current,t=e?.getContext("2d");if(!e||!t)return;let i=e.width,n=e.height,a=t.createLinearGradient(0,0,i,0);a.addColorStop(0,"white"),a.addColorStop(1,d.toHexString()),t.fillStyle=a,t.fillRect(0,0,i,n);let o=t.createLinearGradient(0,0,0,n);o.addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"black"),t.fillStyle=o,t.fillRect(0,0,i,n)},[d]),h=(0,er.useCallback)((e,t)=>{if(!r.current||!o.current)return{x:0,y:0};let i=r.current.clientWidth,n=r.current.clientHeight,a=(0,rd.default)(e,0,i),s=(0,rd.default)(t,0,n);return o.current.style.left=`${a}px`,o.current.style.top=`${s}px`,{x:a,y:s}},[]);(0,er.useEffect)(()=>{p();let{x:t,y:i}=u(e);h(t,i)},[e,u,p,h]);let m=(0,er.useCallback)(e=>{if(!s.current)return;let t=s.current.getBoundingClientRect(),{x:n,y:a}=h(e.clientX-t.left,e.clientY-t.top),r=c(n,a);r&&(i((0,rl.default)(r).toHexString()),e.preventDefault())},[i,c,h]),g=(0,er.useCallback)(e=>{a(!1),e.preventDefault()},[]),f=(0,er.useCallback)(e=>{a(!0),m(e),e.preventDefault()},[m]);return(0,er.useEffect)(()=>{if(n)return document.addEventListener("mousemove",m),document.addEventListener("mouseup",g),()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",g)}},[m,g,n]),(0,t.jsxs)(q.Box,{pos:"relative",ref:s,onMouseDown:f,children:[(0,t.jsx)(q.Box,{ref:o,pos:"absolute",w:5,h:5,border:"2px solid white",borderRadius:"full",transform:`translate(-50%, -50%) scale(${n?1.2:1})`,boxShadow:"md",transitionProperty:"transform",transitionDuration:"normal",bg:(0,rl.default)(e).toHexString(),outline:"1px solid",outlineColor:"blackAlpha.200"}),(0,t.jsx)(q.Box,{as:"canvas",ref:r,width:"100%",height:"150px",borderRadius:"md",shadow:"base",border:"1px solid",borderColor:"gray.200"})]})},o1=({onChange:e})=>{let i=(0,er.useCallback)(()=>{new window.EyeDropper().open().then(t=>{e(t.sRGBHex)}).catch(e=>{console.error("Eyedropper error:",e)})},[e]);return"EyeDropper"in window?(0,t.jsx)(id.IconButton,{size:"sm",icon:(0,t.jsx)(ei.FontAwesomeIcon,{fixedWidth:!0,icon:et.faEyeDropper}),onClick:i,variant:"ghost","aria-label":n.i18n._({id:"A94+Ww",message:"Pick color"})}):null},o2=e=>{let[i,n]=(0,er.useState)("HEX"),{updateColor:a,color:r}=e,[o,s]=(0,er.useState)(0),l=r.stops[o],d=(0,er.useCallback)((e,t)=>{let i=[...r.stops];void 0===t?(i.splice(e,1),s(Math.min(e,i.length-1))):(i[e]=t,s(e)),a({...r,stops:i})},[r,a]),c=(0,er.useCallback)(e=>{let t=[...r.stops];t.push(e),t.sort((e,t)=>e.position-t.position),s((0,oV.default)(t,e)),a({...r,stops:t})},[r,a]),u=(0,er.useCallback)(e=>{d(o,{...l,color:e})},[l,o,d]);return(0,t.jsxs)(ee.VStack,{align:"start",spacing:4,children:[(0,t.jsx)(o3,{...e,addStop:c,currentStop:l,updateStop:d,currentStopIndex:o,setCurrentStopIndex:s}),(0,t.jsx)(si,{...e,updateColor:e=>{"linear-gradient"===e.type?a(e):u(e?.color)}}),(0,t.jsx)(r9.Divider,{}),(0,t.jsxs)(ee.VStack,{children:[(0,t.jsx)(o0,{color:l.color,onChange:u}),(0,t.jsxs)(X.HStack,{w:"100%",spacing:4,children:[(0,t.jsx)(o$,{color:r}),(0,t.jsx)(oJ,{color:l.color,onChange:u}),(0,t.jsx)(o1,{color:l.color,onChange:u})]}),(0,t.jsxs)(X.HStack,{flex:1,w:"100%",children:[(0,t.jsx)(oZ,{mode:i,setMode:n}),"HEX"===i&&(0,t.jsx)(oY,{initialFocusRef:e.initialFocusRef,color:l.color,updateColor:u,placeholder:oK.color}),"HSL"===i&&(0,t.jsx)(oX,{color:l.color,updateColor:u}),"RGB"===i&&(0,t.jsx)(oQ,{color:l.color,updateColor:u})]}),(0,t.jsx)(o5,{...e})]})]})},o3=({color:e,updateStop:i,currentStopIndex:a,setCurrentStopIndex:r,addStop:o})=>{let s=(0,oU.useColorModeValue)("gray.200","gray.600"),{stops:l}=e,d=l.length>2,c=l.length<5;return(0,t.jsxs)(X.HStack,{w:"100%",spacing:0,children:[(0,t.jsx)(e9.Flex,{borderRadius:"full",background:(0,oG.getGradientCss)({...e,angle:90}),pos:"relative",h:3,border:"1px solid",borderColor:s,flex:1,me:2,children:l.map((e,n)=>{let o=n===a;return(0,t.jsx)(e9.Flex,{pos:"absolute",inset:0,top:-1.5,children:(0,t.jsxs)(oz,{size:"lg",value:e.position,min:0,max:100,step:1,onChange:t=>{i(n,{...e,position:t})},onClick:()=>r(n),children:[(0,t.jsx)(oH,{bg:"transparent",h:3}),(0,t.jsx)(oF,{borderWidth:3,borderColor:"white",boxSize:"24px",shadow:"md",outline:o?"2px solid":"1px solid",outlineColor:o?"trueblue.300":"blackAlpha.200",bg:e.color})]})},n)})}),(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"Remove this stop",id:"VztmP9"}),children:(0,t.jsx)(id.IconButton,{icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faTrash}),"aria-label":n.i18n._({id:"VztmP9",message:"Remove this stop"}),onClick:()=>i(a,void 0),size:"sm",variant:"ghost",isDisabled:!d})}),(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"Add stop",id:"MKajKJ"}),children:(0,t.jsx)(id.IconButton,{icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faPlus}),"aria-label":n.i18n._({id:"MKajKJ",message:"Add stop"}),onClick:()=>{o(o4(e))},size:"sm",variant:"ghost",isDisabled:!c,"data-testid":"theme-add-item-button"})})]})},o5=e=>{let i=(0,oU.useColorModeValue)("gray.500","gray.400"),{color:n,updateColor:a}=e;return(0,t.jsxs)(ee.VStack,{align:"start",w:"100%",children:[(0,t.jsx)(J.Text,{fontWeight:"600",fontSize:"sm",color:i,children:(0,t.jsx)(ea.Trans,{message:"Angle",id:"YMybpT"})}),(0,t.jsx)(ia.SimpleGrid,{columns:4,spacing:2,w:"100%",children:o6.map(e=>{let i=n.angle===e.value;return(0,t.jsx)(o$,{color:{...n,angle:e.value},onClick:()=>a({...n,angle:e.value}),isActive:i,buttonProps:{w:"100%"},name:e.label},e.value)})})]})},o4=e=>{let t=e.stops[0],i=e.stops[1],n=e.stops.reduce((n,a,r)=>{let o=e.stops[r+1];if(!o)return n;let s=o.position-a.position;return s>n.distance?(t=a,i=o,{distance:s,position:a.position+s/2}):n},{distance:0,position:0});return{color:(0,tE.lerpColor)(t.color,i.color,n.position/100),position:n.position}},o6=[{label:"0°",value:0},{label:"45°",value:45},{label:"90°",value:90},{label:"135°",value:135},{label:"180°",value:180},{label:"225°",value:225},{label:"270°",value:270},{label:"315°",value:315}],o9=(0,e7.forwardRef)(({color:e,updateColor:i,defaultColor:a={type:"solid",color:"#000000"},onClick:r,canReset:o,dataTestId:s},l)=>{let d=(0,oU.useColorModeValue)("white","elevation.2");return(0,t.jsxs)(iW.InputGroup,{size:"md","data-testid":s,children:[(0,t.jsx)(ie.Input,{type:"text",placeholder:a?`${(0,rJ.getThemeColorLabel)(a)} ${n.i18n._({id:"P9Cyl9",message:"(default)"})}`:n.i18n._({id:"ovBPCi",message:"Default"}),value:e?(0,rJ.getThemeColorLabel)(e):"",readOnly:!0,fontFamily:"monospace",bg:d,onFocus:r}),(0,t.jsx)(iU.InputLeftElement,{children:(0,t.jsx)(o$,{color:e||a,ref:l,onClick:r,size:7})}),o&&(0,t.jsx)(iU.InputRightElement,{children:(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(ea.Trans,{message:"Reset to default",id:"L+rMC9"}),placement:"top",children:(0,t.jsx)(id.IconButton,{"aria-label":n.i18n._({id:"cnGeoo",message:"Delete"}),variant:"ghost",onClick:()=>i(void 0),icon:(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faUndo}),size:"sm",colorScheme:"red"})})})]})});o9.displayName="ThemeColorPickerInput";let o8=e=>{let i=(0,er.useRef)(null);return(0,t.jsxs)(ts.Popover,{isLazy:!0,strategy:"fixed",modifiers:[{name:"preventOverflow",options:{altAxis:!0}}],initialFocusRef:i,children:[(0,t.jsx)(tc.PopoverTrigger,{children:(0,t.jsx)(o9,{...e,canReset:!!(e.color&&e.defaultColor)})}),(0,t.jsx)(td.PopoverContent,{zIndex:"modalPopover",border:"1px solid",borderColor:"gray.50",children:(0,t.jsx)(r1.PopoverBody,{children:(0,t.jsx)(st,{...e,initialFocusRef:i})})})]})},o7=e=>(0,t.jsx)(o8,{...e,solidOnly:!0}),se=["solid","linear-gradient"],st=e=>{let{color:i,updateColor:n,solidOnly:a}=e,r=i?.type||"solid",o=se.indexOf(r),s=(0,er.useCallback)(e=>{let t=se[e];if(r===t)return;let a=(0,rJ.getThemeColorSolid)(i||oK);"solid"===t?n({color:a,...i,type:"solid"}):"linear-gradient"===t&&n({stops:[{color:a,position:0},{color:(0,tE.brightenColor)(a,(0,tE.isColorDark)(a)?20:-20),position:100}],angle:45,...i,type:"linear-gradient"})},[r,i,n]);return a?(0,t.jsx)(oq,{...e}):(0,t.jsxs)(r6.Tabs,{variant:"soft-rounded",size:"sm",isFitted:!0,isLazy:!0,index:o,onChange:s,children:[(0,t.jsxs)(r3.TabList,{children:[(0,t.jsx)(r2.Tab,{children:(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faSwatchbook,fixedWidth:!0}),(0,t.jsx)(ea.Trans,{message:"Solid",id:"5bi1la"})]})}),(0,t.jsx)(r2.Tab,{children:(0,t.jsxs)(X.HStack,{children:[(0,t.jsx)(ei.FontAwesomeIcon,{icon:et.faPaintRoller,fixedWidth:!0}),(0,t.jsx)(ea.Trans,{message:"Gradient",id:"/S8bMP"})]})})]}),(0,t.jsxs)(r4.TabPanels,{children:[(0,t.jsx)(r5.TabPanel,{p:0,pt:4,children:(0,t.jsx)(oq,{...e})}),(0,t.jsx)(r5.TabPanel,{p:0,pt:4,children:(0,t.jsx)(o2,{...e,color:i})})]})]})},si=({theme:e,color:i,updateColor:n,solidOnly:a=!1,palette:r="theme"})=>{let o=[];return("theme"===r?o=(0,rJ.getThemePalette)(e,a):"accent"===r&&(o=(0,rJ.getThemeAccentColors)(e)),a&&(o=o.filter(rJ.isThemeColorSolid)),0===o.length)?null:(0,t.jsxs)(ee.VStack,{align:"start",children:[(0,t.jsx)(J.Text,{fontWeight:"600",fontSize:"sm",color:"gray.500",children:(0,t.jsx)(ea.Trans,{message:"Theme palette",id:"DNUgpN"})}),(0,t.jsx)(X.HStack,{wrap:"wrap",children:o.map((e,a)=>(0,t.jsx)(o$,{name:(0,rJ.isThemeColorSolid)(e)?(0,rJ.getThemeColorLabel)(e):void 0,color:e,onClick:n,isActive:i&&(0,rJ.checkThemeColorsEqual)(i,e)},a))})]})},sn=e=>{let t=e.replaceAll("#","").replaceAll(/[^A-Fa-f0-9]/g,"").slice(0,6).toLowerCase();if(!/^([0-9a-f]{3}|[0-9a-f]{6})$/.test(t))return"";let i=3===t.length?t.split("").map(e=>e+e).join(""):t;return`#${i.toUpperCase()}`};var sa=e.i(338538);let sr="default",so="color.solid",ss={Default:[{label:()=>n.i18n._({id:"EdQY6l",message:"None"}),availableOffline:!0,key:sr,backgroundType:sa.BackgroundType.NONE}],Image:[{...u.CustomImageProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE,priority:10},{...S.LexicaProvider,nodeName:"image",disabled:!0,backgroundType:sa.BackgroundType.IMAGE},{...H.WebImageProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...d.BingImageProvider,nodeName:"image",disabled:!0,backgroundType:sa.BackgroundType.IMAGE},{...a.AIGeneratedImageProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...r.AIInfographicProvider,nodeName:"graphic"},{...a.AIGeneratedImageProvider,key:a.AI_EDITED_IMAGE_SOURCE_KEY,nodeName:"image",disabled:!0,backgroundType:sa.BackgroundType.IMAGE},{...o.AiAnimationProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...a.AIGeneratedImageProvider,key:a.AI_IMAGE_CARD_SOURCE_KEY,nodeName:"image",disabled:!0,backgroundType:sa.BackgroundType.IMAGE},{...z.UnsplashProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...I.PexelsProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...f.GiphyProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...T.PictographicProvider,nodeName:"image",backgroundType:sa.BackgroundType.IMAGE},{...m.FontawesomeIconProvider,nodeName:"image"},{...M.PictographicIconProvider,nodeName:"image"},{...y.GoogleImageProvider,nodeName:"image",disabled:!0,backgroundType:sa.BackgroundType.IMAGE},{...j.QRCodeImageProvider,nodeName:"image"},{label:()=>n.i18n._({id:"COXEr5",message:"Accent images"}),key:rq.ACCENT_IMAGE_SOURCE_KEY,availableOffline:!0,icon:i.faImages,backgroundType:sa.BackgroundType.IMAGE,nodeName:"image",keywords:["accent image"]}],Video:[{...p.CustomVideoProvider,nodeName:"video"},{...k.LoomProvider,nodeName:"video"},{...V.YoutubeProvider,nodeName:"video"},{...F.VimeoProvider,nodeName:"video"},{...U.WistiaProvider,nodeName:"video"},{...R.TikTokProvider,nodeName:"video"},{...P.SpotifyProvider,nodeName:"video"}],Embed:[{...W.WebpageProvider,nodeName:"embed",priority:10},{...g.GammaProvider,nodeName:"embed"},{..._.PDFProvider,nodeName:"embed"},{...b.GoogleDriveProvider,nodeName:"embed"},{...h.FigmaProvider,nodeName:"embed"},{...C.InstagramProvider,nodeName:"embed"},{...O.TwitterProvider,nodeName:"embed"},{...E.MiroProvider,nodeName:"embed"},{...s.AirtableProvider,nodeName:"embed"},{...c.CalendlyProvider,nodeName:"embed"},{...B.TypeformProvider,nodeName:"embed"},{...w.JotformProvider,nodeName:"embed"},{...x.GoogleFormProvider,nodeName:"embed"},{...N.TallyProvider,nodeName:"embed"},{...D.StreamAliveProvider,nodeName:"embed"},{...l.AmplitudeProvider,nodeName:"embed"},{...A.MicrosoftOfficeProvider,nodeName:"embed"},{...L.PowerBIProvider,nodeName:"embed"}],Color:[{label:()=>n.i18n._({id:"iFeLoB",message:"Solid Color"}),key:so,availableOffline:!0,icon:i.faPalette,backgroundType:sa.BackgroundType.COLOR,keywords:["solid color"]},{...v.GradientProvider,availableOffline:!0,backgroundType:sa.BackgroundType.GRADIENT}]},sl=Object.fromEntries(Object.values(ss).flat().map(e=>[e.key,e])),sd={...rK,[sr]:()=>(0,t.jsx)(t.Fragment,{}),[rq.ACCENT_IMAGE_SOURCE_KEY]:({currentAttributes:e,updateAttributes:i,editType:n})=>{let a=(0,eT.useAppSelector)(nb.selectTheme),{accentBackgrounds:r}=a.config;return(0,t.jsxs)(ee.VStack,{align:"stretch",children:[r&&(0,t.jsx)(rQ,{currentAttributes:e,accentImages:r,isDark:(0,rJ.isThemeDark)(a),handleItemClick:i,editType:n}),(0,t.jsxs)($.Alert,{status:"info",children:[(0,t.jsx)(K.AlertIcon,{}),(0,t.jsx)(Z.AlertDescription,{children:(0,t.jsx)(ea.Trans,{message:"Accent images can be managed in the theme editor.",id:"zOCB9A"})})]})]})},[so]:({currentAttributes:e,updateAttributes:i,contextualTheme:n})=>{let a=(0,r0.useSelector)(nb.selectTheme),r=(0,er.useCallback)(e=>i({hex:(0,rJ.getThemeColorSolid)(e)}),[i]);if("string"==typeof e)return r(e),(0,t.jsx)(t.Fragment,{});let{hex:o}=e;return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(o7,{color:{type:"solid",color:o},updateColor:r,theme:n||a,palette:"theme"})})},[a.AI_EDITED_IMAGE_SOURCE_KEY]:nd,[a.AI_IMAGE_CARD_SOURCE_KEY]:nd};e.s(["MediaPanelsMap",0,sd,"MediaSources",0,ss,"MediaSourcesMap",0,sl,"NO_BACKGROUND_SOURCE_KEY",0,sr,"getMediaSourceGroupDisplayName",0,{Default:()=>n.i18n._({id:"ovBPCi",message:"Default"}),Image:()=>n.i18n._({id:"hG89Ed",message:"Image"}),Video:()=>n.i18n._({id:"vSJd18",message:"Video"}),Embed:()=>n.i18n._({id:"KKBlUU",message:"Embed"}),Color:()=>n.i18n._({id:"jZlrte",message:"Color"})}],878917);var sc=e.i(337130);e.s(["ImageGenerationErrorPlaceholder",0,({onRetry:e,isRetryDisabled:n,retryDisabledReason:a,...r})=>{let o=(0,aj.useIsThemeDark)();return(0,t.jsx)(t7.Center,{color:"gray.400",bg:o?sc.PH_COLOR.DARK_BG:sc.PH_COLOR.LIGHT_BG,w:"100%",sx:{containerType:"size","@container (width < 150px) or (height < 140px)":{".error-text":{display:"none"},".retry-button":{transform:"scale(0.8)"}},"@container (width < 100px) or (height < 100px)":{".retry-button":{display:"none"}}},...r,children:(0,t.jsxs)(ee.VStack,{spacing:1,textAlign:"center",children:[(0,t.jsx)(q.Box,{sx:{"@container (width <= 80px) or (height < 100px)":{fontSize:"lg"},"@container (80px < width <= 150px)":{fontSize:"2xl"},fontSize:"3xl"},children:(0,t.jsx)(ei.FontAwesomeIcon,{icon:i.faTriangleExclamation})}),e&&(0,t.jsx)(en.GammaTooltip,{label:n?a:void 0,placement:"top",children:(0,t.jsx)(Y.Button,{className:"retry-button",size:"sm",px:8,onClick:()=>e?.(),isDisabled:n,children:(0,t.jsx)(ea.Trans,{message:"Retry",id:"6gRgw8"})})}),(0,t.jsx)(J.Text,{className:"error-text",fontSize:"sm",children:(0,t.jsx)(ea.Trans,{message:"There was an error generating this image",id:"CIIL4F"})})]})})}],635273),e.s(["useOptimizedImage",0,({src:e,tempUrl:t,meta:i,context:n,customParams:a,skipOptimization:r=!1})=>{let o=(0,er.useMemo)(()=>"custom"===n?a:"thumbnail"===n?eO.THUMBNAIL_RESIZE_PARAMS:"logo"===n?eO.LOGO_RESIZE_PARAMS:"accent-side"===n?{width:1200}:{width:2e3},[n,a]),s=(0,er.useMemo)(()=>e&&!r&&o?(0,eO.resizeAndProxyImageUrl)(e,o,i):e,[e,r,o,i]);return{src:s,fallbackSrc:s?void 0:t,resizeParams:o}}],698843);var su=e.i(157888),sp=e.i(131526),sh=e.i(650292),sm=e.i(595408),sg=e.i(218378),sf=e.i(108634),sb=e.i(826521);let sx=({cardColor:e,config:t,theme:i})=>{let n="linear-gradient"===e.type,a=(0,rJ.getThemeColorSolid)(e),r=(0,rJ.isThemeColorDark)(e),o=(0,rJ.isThemeGlassy)(t),s=(sh.isPptExport||sh.isPdfExport)&&"frosted"===t.cardTransparency?.95:.75,l=sm.ROUNDNESS_OPTIONS[t.roundness].cardRadius,{cardBorderEm:d,cardShadowSizeEm:c}=sm.BORDER_OPTIONS[t.cardBorder],u=(0,rJ.getThemeColorSolid)((0,rJ.getThemeCardBorderColor)(i)),p=d>0&&"sm"===t.roundness?"1px":`${l}em`,{shadow:h,pdfShadow:m}=sm.CARD_SHADOW_OPTIONS[t.cardShadow||"default"],g=sh.isPdfExport&&!m?void 0:"soft3d"===t.cardShadow?(0,sb.getSoft3DShadow)(a):h,f=0===d?void 0:`0 0 0 ${d}em ${u}`,b=r?(0,tE.brightenColor)(a,20):(0,tE.brightenColor)(a,-5);return{"--card-background-color":o&&!n?(0,tE.colorWithOpacity)(a,s):a,"--card-background-image":n?(0,oG.getGradientCss)(e):"none","--card-border-color":u,"--card-backdrop-filter":"frosted"!==t.cardTransparency||sh.isPptExport||sh.isPdfExport?"none":"blur(20px) saturate(170%)","--card-border":0===d?void 0:"var(--card-border-width) solid var(--card-border-color)","--card-border-width":`${d}em`,"--card-border-radius":p,"--card-shadow-distance":`${c}em`,"--card-border-shadow":f,"--card-box-shadow":g,"--card-shadow":[f,g].filter(e=>!!e).join(", "),"--clickable-background-color":"none"===t.shapeFill?(0,tE.colorWithOpacity)(b,.4):(0,tE.colorWithOpacity)(b,.6)}};e.s(["CardFullBleedSx",0,{backdropFilter:"var(--card-backdrop-filter)",backgroundColor:"var(--card-background-color)",backgroundImage:"var(--card-background-image)",borderRadius:"0"},"CardSx",0,{boxShadow:"var(--card-shadow)",backdropFilter:"var(--card-backdrop-filter)",backgroundColor:"var(--card-background-color)",backgroundImage:"var(--card-background-image)",borderRadius:"var(--card-border-radius)","@media print":{boxShadow:"var(--card-box-shadow)",border:"var(--card-border)"}},"getCardVars",0,sx],97660);var sy=e.i(754851);let sv=(e,t)=>{let i=void 0!==t,n=!e.config.disableReadabilityAdjustment||i,a=i?sm.CONTRAST_RATIO_CHANGED:rJ.DEFAULT_CONTRAST_RATIO,r=i?4.5:3,o=t?"string"==typeof t?{type:"solid",color:t}:t:(0,rJ.getThemeCardColor)(e),s=(0,rJ.getThemeColorSolid)(o),l=t?(0,tE.isColorDark)(s):(0,rJ.isThemeDark)(e),d=(0,rJ.getThemeAccentColors)(e)[0],c=(0,rJ.getThemeColorSolid)(d),u=n?(0,rJ.makeThemeColorReadable)(d,s,r,!1):d,p=(0,rJ.getThemeLinkColor)(e),h=n?(0,rJ.makeThemeColorReadable)(p,s,r,!1):p,m=(0,rJ.getThemeColorSolid)(h),g=(0,rJ.getThemeButtonColor)(e),f=n?(0,rJ.makeThemeColorReadable)(g,s,r,!1):g,b=(0,rJ.getThemeColorSolid)(f),x=(0,rJ.getThemeBodyColor)(e),y=n?(0,rJ.makeThemeColorReadable)(x,s,a,i):x,v=(0,rJ.getThemeColorSolid)(y),C=(0,tE.isColorDark)(v),w=(0,rJ.getThemeHeadingColor)(e),S=n?(0,rJ.makeThemeColorReadable)(w,s,r,i):w,k=(0,rJ.getThemeColorSolid)(S);return{bodyColorReadable:y,bodyColorSolid:v,isBodyColorDark:C,headingColorReadable:S,headingColorSolid:k,linkColorReadable:h,linkColorSolid:m,buttonColorReadable:f,buttonColorSolid:b,primaryColor:d,primaryColorReadable:u,primaryColorSolid:c,cardColor:o,cardColorSolid:s,isCardDark:l}},sC=(0,su.default)((e,t)=>{let{bodyFont:i,headingFont:n,fonts:a}=e,r=(0,sf.getFontName)(a,i)||sm.DEFAULT_FONTS.bodyFont,o=(0,sf.getFontName)(a,n)||sm.DEFAULT_FONTS.headingFont,{bodyColorReadable:s,bodyColorSolid:l,isBodyColorDark:d,headingColorReadable:c,primaryColorReadable:u,primaryColorSolid:p,primaryColor:h,linkColorSolid:m,buttonColorReadable:g,buttonColorSolid:f,cardColorSolid:b,cardColor:x,isCardDark:y}=sv(e,t),v=(0,sg.getThemeKnobsV3)(e),C=sx({cardColor:x,config:v,theme:e}),w=(0,sy.getShapeColorVars)({bodyColor:s,cardColor:x,config:v,theme:e}),S=(0,sy.getShapeBorderVars)({config:v}),k=(0,sy.getShapeShadowVars)({cardColor:x,config:v}),A="linear-gradient"!==h.type?void 0:"semi"===v.shapeFill?(0,oG.blendedGradient)(h,b,.5):h,E=(0,oG.lightenedGradient)(A,y?.25:.9);return{...C,...S,...w,...k,"--body-font":`"${r}"`,"--heading-font":`"${o}"`,"--heading-font-weight":(0,sf.getFontWeight)(e,"heading"),"--body-font-weight":(0,sf.getFontWeight)(e,"body"),"--letter-spacing-body":sh.isPptExport?0:e.config.letterSpacingBody?`${e.config.letterSpacingBody}em`:void 0,"--letter-spacing-heading":sh.isPptExport?0:e.config.letterSpacingHeading?`${e.config.letterSpacingHeading}em`:void 0,"--line-height-body":e.config.lineHeightBody??sp.BODY_LINE_HEIGHT,"--line-height-heading":e.config.lineHeightHeading??sp.HEADING_LINE_HEIGHT,"--heading-transform":e.config.headingTransform,"--accent-color":p,"--accent-color-readable":(0,rJ.getThemeColorSolid)(u),"--accent-gradient":(0,oG.getGradientCss)(u),"--accent-gradient-fill":(0,oG.getGradientCss)(h),"--accent-gradient-background":(0,oG.getGradientCss)(E),"--accent-color-background-muted":y?(0,tE.colorWithLightness)(p,.15):(0,tE.colorWithLightness)(p,.9),"--expandable-hover-background":(0,tE.colorWithOpacity)(m,.1),"--neutral-border-color":y?"var(--chakra-colors-whiteAlpha-400)":"var(--chakra-colors-blackAlpha-200)","--neutral-background-color":y?(0,tE.brightenColor)(b,5):(0,tE.brightenColor)(b,-5),"--button-color":f,"--button-gradient":(0,oG.getGradientCss)(g),"--button-color-inverted":(0,tE.isColorDark)(f)?"#fff":"#000","--link-color":m,"--link-color-hover":(0,tE.isColorDark)(m)?(0,tE.lightenColor)(m,10):(0,tE.lightenColor)(m,-10),"--link-box-shadow":`0 0 0px 3px ${(0,tE.colorWithOpacity)(m,1)}`,"--body-color":l,"--body-color-muted":(0,tE.colorWithOpacity)(l,.5),"--body-color-inverted":y?"#000":"#fff","--link-color-inverted":(0,tE.isColorDark)(m)?"#fff":"#000","--highlight-color-dark":y?"var(--body-color)":"var(--body-color-inverted)","--highlight-color-light":y?"var(--body-color-inverted)":"var(--body-color)","--highlight-link-color-hover-dark":y?(0,tE.lightenColor)(l,d?10:-10):(0,tE.lightenColor)("#fff",-10),"--highlight-link-color-hover-light":y?(0,tE.lightenColor)("#000",10):(0,tE.lightenColor)(l,d?10:-10),"--heading-color":(0,rJ.getThemeColorSolid)(c),"--heading-gradient":(0,oG.getGradientCss)(c),"--card-color":b,"--card-color-mask":(0,tE.colorWithOpacity)(b,(0,tE.isColorDark)(b)?.8:.85),"--placeholder-button-bg-color":y?(0,tE.getCSSVarForChakraColor)("gray.700"):(0,tE.getCSSVarForChakraColor)("gray.200"),"--placeholder-button-bg-hover-color":y?(0,tE.getCSSVarForChakraColor)("gray.600"):(0,tE.getCSSVarForChakraColor)("gray.300"),"--placeholder-button-text-color":y?(0,tE.getCSSVarForChakraColor)("gray.300"):(0,tE.getCSSVarForChakraColor)("gray.400"),"--placeholder-button-text-hover-color":y?(0,tE.getCSSVarForChakraColor)("gray.200"):(0,tE.getCSSVarForChakraColor)("gray.700")}}),sw=(0,su.default)(sv);e.s(["getThemeCSSVars",0,sC,"getThemeColorsForCard",0,sw],572383),e.s(["isPositionedBoxNode",0,e=>"positionedTextbox"===e.type.name||"positionedContentBox"===e.type.name],896678)},809755,398358,144621,892684,313399,462931,703460,525903,957883,269662,197258,662752,565647,536788,890003,496911,380442,143863,179015,408553,706923,591378,152561,436910,957734,400551,241894,194279,157965,466511,666916,774193,509504,e=>{"use strict";e.s(["GridTemplateCommands",()=>n5],809755),e.i(601019);var t=e.i(494075);e.s(["checkSmartLayoutDropTarget",()=>nJ,"checkSmartLayoutImageDropTarget",()=>nQ,"checkSmartLayoutVariantDropTarget",()=>n0,"getImageFile",()=>nX,"getSmartLayoutDirection",()=>nY,"getSmartLayoutOptions",()=>nq,"selectParentLayout",()=>n1],591378);var i=e.i(755453),n=e.i(175863),a=e.i(977581),r=e.i(379457),o=e.i(160396),s=e.i(423444),l=e.i(4877),d=e.i(45954);e.s(["getSmartLayoutVariant",()=>nZ,"getSmartLayoutVariants",()=>n$],706923);var c=e.i(16840),u=e.i(803597),p=e.i(231),h=e.i(578011),m=e.i(391398),g=e.i(428683),f=e.i(613616),b=e.i(860686),x=e.i(524473),y=e.i(408122),v=e.i(191788),C=e.i(612099),w=e.i(595408),S=e.i(754851);e.i(477893);var k=e.i(218378),A=e.i(864935),E=e.i(641295),_=e.i(957881);e.s(["BulletMarker",()=>eM],525903);var I=e.i(349904),M=e.i(470645),T=e.i(772177),L=e.i(131526),j=e.i(387111),P=e.i(500425),D=e.i(541075);e.i(828525);var N=e.i(896620);e.i(144786);var R=e.i(275316);e.i(261991);var O=e.i(917067),B=e.i(418755),z=e.i(750526),F=e.i(786928),H=e.i(551880),W=e.i(256266),U=e.i(397068),V=e.i(329860),G=e.i(277051),$=e.i(281997),Z=e.i(783197),K=e.i(136484),q=e.i(517103),Y=e.i(820773),X=e.i(878917),Q=e.i(635273),J=e.i(697240),ee=e.i(267971),et=e.i(698843),ei=e.i(572383),en=e.i(615505),ea=e.i(392164),er=e.i(338538),eo=e.i(548402),es=e.i(6419),el=e.i(896678),ed=e.i(854861),ec=e.i(647031),eu=e.i(503108),ep=e.i(103630);let eh=e=>null!==e.lastChild&&"cardNotes"===e.lastChild.type.name,em=e=>{if(0===e.childCount)return!0;let t=!1;return e.content.nodesBetween(0,e.content.size,e=>!e.isAtom||!!e.isText||(t=!0,!1)),0===e.textContent.trim().length&&!t};e.s(["addCardNotes",0,(e,t)=>{let i=e.state.doc.nodeAt(t);if(!i||i.lastChild?.type.name==="cardNotes")return;let n=t+i.nodeSize-1,a={type:"cardNotes",content:[{type:"paragraph"}]};i.firstChild&&(0,ep.isCardLayoutItemNode)(i.firstChild)?e.chain().insertContentAt({from:n,to:n},{type:"cardNotes",content:[{type:"paragraph"}]},{updateSelection:!1}).noUndo().run():e.chain().command(({tr:i})=>{(0,eu.setCardLayoutCommand)(e,i,t,"blank");let r=i.mapping.map(n);return i.insert(r,e.schema.nodeFromJSON(a)),!0}).noUndo().run()},"findCardNotes",0,e=>{let t=null;return e.nodeAfter.descendants((i,n)=>"cardNotes"!==i.type.name||(t={node:i,pos:n+e.pos+1},!1)),t},"hasCardNotes",0,eh,"isCardNotesEditor",0,e=>"cardNotes"==e.schema.topNodeType.name,"isNodeEmptyOrHasWhitespaceOnly",0,em,"isSelectionWithinTopCardAtPos",0,(e,t)=>{let i=(0,ec.findTopCardNodeParent)(e.doc,t);if(!i||!i.pos)return!1;let a=e.doc.resolve(i.pos).pos,r=a+i.node.nodeSize,{selection:o}=e,s=o instanceof n.TextSelection?o.to=a&&s}],398358),e.i(85547);class eg{dragging;constructor(e=null){this.dragging=e}}let ef=new n.PluginKey("cardPlugin"),eb=["card","calloutBox","image","cardLayoutItem","cardAccentLayoutItem","cardImageItem","cardNotes","chart","graphyChart","smartLayoutCell","smartDiagram","tableOfContents","codeBlock"],ex={isCardDecoration:!0,cardId:void 0,isNested:!1,hasLayoutItem:!1,hasAccentImage:!1,nestedDepth:0,isFirstCard:!1,isLastCard:!1,displayLayout:"blank",cardContentType:"responsive",hasImageCardSrc:!1,insideSideLayout:!1,hasCardNotesNode:!1,hasNonEmptyCardNotes:!1,hasHiddenCardMargins:!1,hasPositionedBoxes:!1},ey=e=>{let t=e.find(e=>e.spec.isCardDecoration);return t?t.spec:ex};e.s(["CardPlugin",0,e=>new n.Plugin({key:ef,state:{init:()=>new eg,apply:(e,t)=>t},props:{decorations:({doc:e})=>{let t,n=(t=[],e.descendants((n,r,o,s)=>{if(eb.includes(n.type.name)){let l=e.resolve(r),d=(0,ep.isCardNode)(n),c=(0,a.findParentNodes)(l,ep.isCardNode),u=c.slice(+!d).map(e=>e.node),{node:p,pos:h}=c[0]||{},m=h?e.resolve(h):null,g=d?n:p||n,f=d?o.childCount:m?.parent.childCount,b=d?s:m?.index(),x=u.length,y=x>0,v=(0,ep.getClosestParentContainerOption)(u,"width"),C=(0,ep.getCardContentType)(g),w="image"===C&&!!(g.firstChild?.attrs?.image?.src||g.firstChild?.attrs?.image?.tempUrl),S=!!(g.firstChild&&(0,ep.isCardLayoutItemNode)(g.firstChild)),k=(0,ed.findCardAccentBackground)(g),A=!!k&&k.type!==er.BackgroundType.NONE,E=k?.mask?.effect,_=k?.mask?.intensity,I=(0,U.getBackgroundColor)(g.attrs.container?.background),M=I?(0,eo.isColorDark)(I):void 0,T=(0,ea.selectShouldRenderMobile)((0,B.getStore)().getState()),L=(0,ed.getDisplayLayout)({layout:g.attrs.layout,parentCards:u,isMobileDevice:T}),j=null!==g.lastChild&&eh(g),P=j&&!em(g.lastChild),D=!!g.attrs.cardMarginSettings?.isHidden,N=(0,i.findChildren)(g,el.isPositionedBoxNode).length>0,R={isCardDecoration:!0,cardId:g.attrs.id,nestedDepth:x,isNested:y,isFirstCard:!y&&0===b,isLastCard:!y&&"number"==typeof f&&b===f-1,hasLayoutItem:S,hasAccentImage:A,cardContentType:C,hasImageCardSrc:w,cardAccentBackgroundMaskEffect:E,cardAccentBackgroundMaskIntensity:_,isCardDark:M,cardColorOverride:I,displayLayout:L,insideSideLayout:(0,ed.checkInsideSideLayout)(u),inheritContainerWidth:v,hasCardNotesNode:j,hasNonEmptyCardNotes:P,hasHiddenCardMargins:D,hasPositionedBoxes:N};t.push(en.Decoration.node(r,r+n.nodeSize,{},R))}}),t);return n.length>0?en.DecorationSet.create(e,n):en.DecorationSet.empty},handleDOMEvents:{drop(e){let t=e.dragging?.annotations,i=ef.getState(e.state);if(!i)return!1;i.dragging=t}},handleDrop:(t,i,n)=>{let a=ef.getState(t.state),r=a?.dragging;a&&(a.dragging=null);let o=(0,ec.checkBetweenCardsDropTarget)(t,i,n);if(!o)return!1;let s=n.content.toJSON();if(!s)return!1;let l=s[0]?.type==="card";if(l&&r)return e.commands.rearrangeCards({from:r.origNodePos,to:o.pos,position:"above"});let d=l?s:{type:"card",content:s},{selection:c}=t.state,u=!c.empty;try{return e.chain().insertContentAt(o.pos,d,{updateSelection:!1}).command(({tr:i})=>{if(u&&i.deleteSelection(),r){let n=(0,es.computeInsertCardMoveInstructions)({view:t,tr:i,cardWrapOffset:+!l,dragging:r,dropPos:o.pos});requestAnimationFrame(()=>{e.commands.moveAnnotations?.(n)})}return!0}).focusMapped(o.pos,1).run()}catch(e){return console.error("(caught) [Cardplugin] handleDrop error:",e),!0}},handlePaste:(t,n,a)=>{let r=a.content.toJSON();if(!r)return!1;if(r[0]?.type==="card"){let r=t.state.selection,o=(0,i.findParentNode)(ep.isCardNode)(r);if(o){n.preventDefault();let t=o.pos+o.node.nodeSize;return e.commands.insertContentAt(t,a.content.toJSON()),!0}}return!1}}}),"findCardPluginDecoration",0,ey],144621);let ev=e=>{let t=(0,B.useAppSelector)(H.selectTheme),{cardColorSolid:i,bodyColorSolid:n,primaryColorSolid:a,isCardDark:r}=eC(e,t),{accentColorLight:o}=(0,S.getShapeColors)({cardColor:{type:"solid",color:i},bodyColor:{type:"solid",color:n},config:(0,k.getThemeKnobsV3)(t),theme:t});return{theme:t,isDark:r,cardColor:i,bodyColor:n,primaryColor:a,primaryColorLight:o}},eC=(e,t)=>{let{cardColorOverride:i}=ey(e);return(0,ei.getThemeColorsForCard)(t,i)};e.s(["getCardColorMode",0,eC,"useCardColorMode",0,ev],892684);let ew=({src:e,tempUrl:t,decorations:i,skipRecolor:n=!1})=>{let{bodyColor:a,primaryColor:r,primaryColorLight:s,isDark:l,cardColor:d}=ev(i);return{src:(0,v.useMemo)(()=>!e||n?e:(0,o.recolorImageUrl)(e,{bodyColor:a,accentColor:r,accentColorLight:s}),[e,n,a,r,s]),tempUrl:t,colors:{bodyColor:a,accentColor:r,accentColorLight:s},isDark:l,cardColor:d}};e.s(["useRecoloredImage",0,ew],313399);var eS=e.i(204319);let ek=({image:e,editor:t,getPos:i,imageShape:n,imageSx:a,node:r,decorations:s,handleEditableClick:l,handleEditableDoubleClick:d,hasQuickActions:c=!1,isInlineColorableSvg:u=!1,editWithoutSelection:p=!1})=>{let h=(0,ee.useSelectAndFocus)(t,i),b=(0,K.useEditorUpdateDuringSelection)(),x=(0,v.useMemo)(()=>t.state.selection.from===i(),[t,i,b]),y=(0,o.isSVGUrl)(e?.src||e?.tempUrl),C=(0,o.isMp4Url)(e?.src),w=(0,Z.useIsThumbnailView)(),{src:S,colors:k,isDark:A}=(({src:e,tempUrl:t,meta:i,decorations:n,optimizationContext:a,customParams:r,skipRecolor:o=!1,skipOptimization:s=!1})=>{let{src:l,colors:d,isDark:c,cardColor:u}=ew({src:e,tempUrl:t,decorations:n,skipRecolor:o}),{src:p,fallbackSrc:h}=(0,et.useOptimizedImage)({src:l,tempUrl:t,meta:i,context:a,customParams:r,skipOptimization:s});return{src:p,fallbackSrc:h,colors:d,isDark:c,cardColor:u,meta:i}})({src:e?.src,tempUrl:e?.tempUrl,decorations:s,optimizationContext:t.isSiteNavbarEditor?"logo":"custom",skipOptimization:w||C,meta:e?.meta,customParams:{width:1e3,height:1e3}}),E=!e||e.showPlaceholder||!e.src&&!e.tempUrl,_=(e&&e.loadImageParams?.provider)??void 0,I=e&&"queued"===e.loadImageStatus&&!w,M=e&&"error"===e.loadImageStatus&&!w,{tempUrl:T,uploadStatus:L,meta:j}=e||{},D=(0,B.useAppSelector)(H.selectEditable),N=r.attrs.source,R=(0,o.backgroundImageFromUrls)(S,S?void 0:T),O={backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundImage:u||E?void 0:R,backgroundPosition:(0,U.getBackgroundPosFromBackgroundImageAttrs)(e),width:"100%",height:"100%",borderRadius:"circle"!==n||u?"var(--box-border-radius)":"full",transitionProperty:"border-radius",transitionDuration:"normal",...a};return(0,m.jsxs)(g.Box,{position:"relative",cursor:x||p&&D?"pointer":"default",contentEditable:!1,h:"100%",onClick:D?l:void 0,onDoubleClick:D?d:void 0,transitionProperty:"filter background",transitionDuration:"normal",_hover:D&&x?{filter:A?"brightness(1.15)":"brightness(0.85)",bg:y?A?"whiteAlpha.100":"blackAlpha.100":void 0}:void 0,children:[M?(0,m.jsx)(Q.ImageGenerationErrorPlaceholder,{...O,onRetry:D?d:void 0,h:"100%"}):E?(0,m.jsx)(J.MediaPlaceholderImage,{...O,isLoading:!!I,loadingProvider:_,icon:X.MediaSourcesMap["image.custom"]?.icon||P.faImage,h:"100%",hasQuickActions:c,onSelectAndFocus:()=>{D&&h()},defaultSource:N,cursor:x||p?"pointer":"default"}):C?(0,m.jsx)(o.Mp4Video,{src:S||T||"",poster:j?.poster,w:"100%",h:"100%",objectFit:"cover","data-content-reference":!0}):u?(0,m.jsx)(eA,{image:e,src:S||T||"",imageShape:n,imageStyles:O}):(0,m.jsx)(f.Flex,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",position:"relative",sx:O}),(0,m.jsx)(Y.MediaUploadIndicators,{uploadStatus:L??void 0,isEditable:D})]})},eA=({image:e,src:t,imageShape:i,imageStyles:n})=>{let a=q.ImageShapeStyles[i||"square"]??q.ImageShapeStyles.square,{meta:r}=e||{},o=(0,V.getSrcUrlForInlineSvg)(t,"accessory-img-inline-svg"),[s,l]=(0,v.useState)(void 0),d=(0,v.useRef)(null),c=r?.width&&r?.height?`0 0 ${r.width} ${r.height}`:void 0,u=(0,v.useCallback)(()=>{let e=d.current?.querySelector("svg");e&&requestAnimationFrame(()=>{let t=(e=>{try{let t=e.getBBox();if(0===t.width||0===t.height)return;return`${t.x} ${t.y} ${t.width} ${t.height}`}catch(e){console.error("Error calculating viewBox:",e);return}})(e);t&&l(t)})},[]),p=e&&(0,V.isPictographicIconSource)(e);return(0,m.jsx)(I.Center,{...n,objectFit:"contain",ref:d,sx:{svg:{width:"100%",aspectRatio:a?.aspectRatio,height:"unset"}},children:(0,m.jsx)($.default,{src:o,viewBox:c||s||(p?"0 0 1024 1024":"0 0 512 512"),className:"colorable-icon","data-export-recolorable-svg":!0,onLoad:c?void 0:u,preProcessor:e=>{let t=(0,eS.normalizeSvg)(e);return G.default.sanitize(t,{USE_PROFILES:{svg:!0,svgFilters:!0},PARSER_MEDIA_TYPE:"image/svg+xml",ALLOWED_NAMESPACES:["http://www.w3.org/2000/svg"]})},overflow:"visible"})})},eE=({image:e})=>{if(e.src&&(0,V.isRecolorableSvg)(e))return(0,m.jsx)(eA,{image:e,src:e.src});let{tempUrl:t,meta:i,src:n}=e||{},a=n&&(0,o.resizeAndProxyImageUrl)(n,o.THUMBNAIL_RESIZE_PARAMS,i),r=(0,o.backgroundImageFromUrls)(a,a?void 0:t),s=(0,U.getBackgroundPosFromBackgroundImageAttrs)(e);return(0,m.jsx)(f.Flex,{sx:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundImage:r,backgroundPosition:s,width:"100%",aspectRatio:"1/1",objectFit:"contain",transitionProperty:"border-radius",transitionDuration:"normal",borderRadius:"calc(var(--box-border-radius) / 2)"}})};e.s(["AccessoryIcon",0,eE],462931);let e_=({image:e,iconSize:t,boxProps:i,number:n,selectCell:a,placeholderIfEmpty:r,isNumbered:o,textAlign:s,fontWeight:l,color:d="currentColor"})=>{let{hasIcon:c,handleChangeIcon:u,isEditable:p}=eI({image:e,selectCell:a}),h=r&&!c,f=o&&!c;return(0,m.jsx)(N.GammaTooltip,{placement:"top",label:c?y.i18n._({id:"yBP2Ki",message:"Change icon"}):y.i18n._({id:"zFIUaq",message:"Add icon"}),isDisabled:!p||f,children:(0,m.jsxs)(I.Center,{className:(0,M.cx)("image"),h:"calc(1em * var(--line-height-heading))",w:"1em",whiteSpace:"nowrap",fontSize:`${t}em`,fontWeight:l,textAlign:s,role:"group",pos:"relative","data-smart-layout-image-drop-target":"true","data-smart-layout-auto-number":f?"true":void 0,onClick:p&&!f?u:void 0,css:(0,z.getRecolorableIconSx)(d),...i,children:[c?(0,m.jsx)(eE,{image:e}):n?`${n}`:null,(p&&!f||h)&&!(0,W.isSafari)()&&(0,m.jsx)(g.Box,{bg:"var(--placeholder-button-bg-color)",color:"var(--placeholder-button-text-color)",opacity:+!!h,_groupHover:{opacity:1},pos:"absolute",fontSize:"0.8em",p:"0.5em",borderRadius:"md",cursor:"pointer",children:(0,m.jsx)(D.FontAwesomeIcon,{icon:P.faIcons,fixedWidth:!0})})]})})},eI=({image:e,selectCell:t,disableEditing:i})=>{let n=(0,B.useAppSelector)(H.selectEditable)&&!i&&t,a=e?.src||e?.tempUrl,{setMediaDrawerSourceKeyAction:r}=(0,ee.useDrawerSourceKey)();return{hasIcon:a,handleChangeIcon:(0,v.useCallback)(i=>{i.stopPropagation(),t?.();let n=R.featureFlags.get("pictographicIconsSearch")?O.PictographicIconProvider.key:C.FontawesomeIconProvider.key;r(e?.source||n,!0),setTimeout(()=>{(0,F.openMediaDrawer)(!1)},30)},[t,r,e?.source]),isEditable:n}};e.s(["SmartLayoutIconOrNumber",0,e_],703460);let eM=e=>{let{cellProps:t,positionProps:i,markerProps:n,markerFontSize:a="h3",children:r}=e,{index:o,theme:s,layoutOptions:l,cellOptions:d,getPos:c,editor:u,selectCell:p}=t,h=d?.icon,b=(0,K.useShouldRenderMobileVersion)(),x=l.numbered??!0,y=(0,j.getBulletSizeEm)(b,a??"h3"),C=(0,v.useCallback)(()=>{if(!u.isEditable)return;let e=c();if("number"!=typeof e)return;let t=u.state.doc.resolve(e);n1(u,t)},[c,u]),w=(0,v.useMemo)(()=>(0,L.getFontSizeStyles)(a,s),[a,s]),{colorVars:k}=(0,_.useCellColor)({layoutColorOverride:l.color,cellColorOverride:d?.color,index:o}),A={...(0,W.isSafari)()?(0,T.resetHeadingStylesheet)():void 0};return(0,m.jsxs)(f.Flex,{...i,contentEditable:!1,userSelect:"none",onMouseDown:C,cursor:"default",css:k,children:[(0,m.jsx)(I.Center,{h:`${y}em`,w:`${y}em`,className:S.HTML_SHAPE_BACKGROUND_CLASS,sx:A,pos:"relative",...n,children:(0,m.jsx)(g.Box,{sx:w,className:(0,M.cx)(T.HEADING_CLASS),textAlign:"center",style:{lineHeight:1},pos:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",children:(0,m.jsx)(e_,{image:h,number:x?o+1:void 0,isNumbered:x,iconSize:1,selectCell:p})})}),r]})};var eT=e.i(878410),eL=e.i(650292),ej=e.i(576281);let eP={boxes:{name:()=>y.i18n._({id:"61H/21",message:"Boxes"}),icon:x.faInputText},bullets:{name:()=>y.i18n._({id:"RYtHky",message:"Bullets"}),icon:x.faList},sequence:{name:()=>y.i18n._({id:"ipQKNM",message:"Sequence"}),icon:x.faArrowRight},images:{name:()=>y.i18n._({id:"an5hVd",message:"Images"}),icon:x.faImage},numbers:{name:()=>y.i18n._({id:"3xKsW7",message:"Numbers"}),icon:x.faPercent},circles:{name:()=>y.i18n._({id:"pzzFVX",message:"Circles"}),icon:x.faArrowsSpin},quotes:{name:()=>y.i18n._({id:"eWLklq",message:"Quotes"}),icon:x.faQuoteLeft},steps:{name:()=>y.i18n._({id:"A9onc2",message:"Steps"}),icon:x.faStairs}};e.s(["CELL_PADDING",0,"1em","DefaultCellContent",0,(e=4)=>[ej.templateHelpers.heading(y.i18n._({id:"HX5SVx",message:"Item"}),{level:e}),ej.templateHelpers.paragraph(y.i18n._({id:"Nu4oKW",message:"Description"}))],"SmartLayoutFamilies",0,eP],957883);let eD="1.5em",eN=({containerSize:e,columnsNeeded:t})=>{let i=(0,K.useShouldRenderMobileVersion)(),n=(0,E.useBreakpointValue)({base:1,sm:2,md:3,xl:4})||2;return(eL.isPuppeteer?4:i?2:n)*e{let{children:t,layoutOptions:i,flexProps:n,...a}=e,{index:r,direction:o}=a,{colorVars:s}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:e.cellOptions?.color,index:r,forceTransparent:!0,isColoringCell:!0}),l=(0,A.getAlignStylesParent)("rtl"===o?"right":"left",e.direction),d=(0,K.useShouldRenderMobileVersion)(),c=(0,j.matchBulletTextAlignment)(e.theme,d,"h4",e.firstChildSize),u=(0,eT.scaleWithFontScale)("1em");return(0,m.jsxs)(f.Flex,{direction:"row",align:"flex-start",gap:u,w:"100%","data-selection-ring":!0,"data-content-reference":!0,pos:"relative",...n,children:[(0,m.jsx)(eM,{cellProps:e,markerFontSize:"h4"}),(0,m.jsx)(g.Box,{flex:"1",minW:"0",className:S.SHAPE_OUTSIDE_TEXT_CLASS,css:s,pt:`${c}em`,sx:l,children:t})]})});eR.displayName="StackedSmartLayoutCell";var eO=e.i(822311),eB=e.i(266652),ez=e.i(613914);let eF={ring:{thickness:.075,padAngle:0,roundness:0,iconSize:1,circleScale:.8,numberBackground:!0},flower:{thickness:.97,padAngle:3,roundness:.2,iconSize:1.25,circleScale:1},cycle:{thickness:.6,padAngle:2,roundness:0,pointiness:.33,iconSize:1.33,circleScale:1},circle:{thickness:.6,padAngle:3,iconSize:1.33,circleScale:1},semiCircle:{thickness:.5,padAngle:2,iconSize:1.5,circleScale:1}},eH=(0,v.memo)((0,v.forwardRef)(({flexProps:e,coords:t,...i},n)=>{let{image:a,selectCell:r,layoutOptions:o,cellOptions:s,index:l,numCells:d,variant:c}=i,u=o.numbered&&d>1,{iconSize:p,numberBackground:h}=eF[c.key],{colorVars:b}=(0,_.useCellColor)({layoutColorOverride:o.color,cellColorOverride:s?.color,index:l}),{arcPath:x,circleWidth:y}=t;return(0,m.jsxs)(f.Flex,{pos:"relative",ref:n,aspectRatio:"1/1","data-smart-layout-emphasis":!0,css:{contain:"layout"},pointerEvents:"none",...e,children:[(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:0,viewBox:`0 0 ${y} ${y}`,overflow:"visible",className:S.SVG_SHAPE_BACKGROUND_CLASS,css:b,children:(0,m.jsx)(g.Box,{as:"path",d:x,transform:`translate(${y/2}px, ${y/2}px) scale(${y})`,style:{vectorEffect:"non-scaling-stroke"}})}),(0,m.jsx)(f.Flex,{className:h?S.HTML_SHAPE_BACKGROUND_CLASS:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,top:`${t.centroidTop}px`,left:`${t.centroidLeft}px`,pos:"absolute",contentEditable:!1,transform:"translate(-50%, -50%)",borderRadius:"999px !important",aspectRatio:"1/1",h:"2.5em",align:"center",direction:"column",justify:"center",css:b,children:(0,m.jsx)(g.Box,{className:(0,M.cx)(T.HEADING_CLASS),pointerEvents:"auto",children:(0,m.jsx)(e_,{image:a,number:u?l+1:void 0,isNumbered:o.numbered,iconSize:1.125*p,selectCell:r})})})]})}));eH.displayName="CircleSegment";var eW=e.i(157888),eU=e.i(292632),eV=e.i(653356),eG=e.i(629593),e$=e.i(59384);function eZ(e){var t,i,n,a,r,o,s,l=void 0===e?{}:e,d=l.innerRadius,c=l.outerRadius,u=l.cornerRadius,p=l.startAngle,h=l.endAngle,m=l.padAngle,g=l.padRadius,f=(0,eV.arc)();return null!=d&&(t=f.innerRadius,t(d)),null!=c&&(i=f.outerRadius,i(c)),null!=u&&(n=f.cornerRadius,n(u)),null!=p&&(a=f.startAngle,a(p)),null!=h&&(r=f.endAngle,r(h)),null!=m&&(o=f.padAngle,o(m)),null!=g&&(s=f.padRadius,s(g)),f}e.s(["arc",0,eZ,"line",0,function(e){var t,i,n=void 0===e?{}:e,a=n.x,r=n.y,o=n.defined,s=n.curve,l=(0,eG.line)();return a&&(t=l.x,t(a)),r&&(i=l.y,i(r)),o&&l.defined(o),s&&l.curve(s),l},"pie",0,function(e){var t,i,n,a=void 0===e?{}:e,r=a.startAngle,o=a.endAngle,s=a.padAngle,l=a.value,d=a.sort,c=a.sortValues,u=(0,e$.pie)();return null===d?u.sort(d):null!=d&&u.sort(d),null===c?u.sortValues(c):null!=c&&u.sortValues(c),null!=l&&u.value(l),null!=s&&(t=u.padAngle,t(s)),null!=r&&(i=u.startAngle,i(r)),null!=o&&(n=u.endAngle,n(o)),u}],269662);let eK=(0,eW.default)(eZ);function eq(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function eY(e,t,i,n,a=0){let r=a>1e-9?Math.sin(a/2)*(t-e)*(2*n):0,[o,s]=eq((e+t)/2-r,i-a/2),l=(t-e)*n;return[o+l*Math.cos(i),s+l*Math.sin(i)]}let eX=(0,eW.default)(function(e){let{innerRadius:t=0,outerRadius:i=0,startAngle:n=0,endAngle:a=2*Math.PI,pointStrength:r=.5,padAngle:o=0}=e,{innerStartAngle:s,innerEndAngle:l,outerStartAngle:d,outerEndAngle:c,innerArcSpan:u,outerArcSpan:p,isClockwise:h}=function(e,t,i,n,a){let r=n>i,o=Math.abs(n-i),s=i,l=n,d=i,c=n,u=o,p=o;if(a>1e-9){let o=a/2,h=Math.sqrt(e*e+t*t),m=0;e>1e-9&&(m=Math.asin(h/e*Math.sin(o)));let g=0;t>1e-9&&(g=Math.asin(h/t*Math.sin(o))),(u-=2*m)>1e-9?r?(s+=m,l-=m):(s-=m,l+=m):s=l=(i+n)/2,(p-=2*g)>1e-9?r?(d+=g,c-=g):(d-=g,c+=g):d=c=(i+n)/2}return{isClockwise:r,innerStartAngle:s,innerEndAngle:l,outerStartAngle:d,outerEndAngle:c,innerArcSpan:u,outerArcSpan:p}}(t,i,n,a,o),m=eq(i,d),g=eq(i,c),f=eq(t,s),b=eq(t,l),x=r*(h?1:-1),y=r>0,v=eY(t,i,d,x,h?0:o),C=eY(t,i,c,x,h?o:0),w=+(u>=Math.PI),S=+(p>=Math.PI);return{arcPath:[`M ${m[0]} ${m[1]}`,y&&`L ${v[0]} ${v[1]}`,`L ${f[0]} ${f[1]}`,`A ${t} ${t} 0 ${w} ${+!!h} ${b[0]} ${b[1]}`,y&&`L ${C[0]} ${C[1]}`,`L ${g[0]} ${g[1]}`,`A ${i} ${i} 0 ${S} ${+!h} ${m[0]} ${m[1]}`,"Z"].filter(Boolean).join(" "),centroid:eq((t+i)/2,((s+l)/2+(d+c)/2)/2+x*Math.PI/6)}}),eQ={1:90,2:-180,3:-150,4:-90,5:-90,6:-60,7:-60,8:-45},eJ=(0,eW.default)(({index:e,numCells:t,variant:i,direction:n,semi:a,themeRoundness:r})=>{let o,s,l=(a?-90:eQ[t]??0)*("rtl"===n?-1:1),d=(a?180:360)/t*("rtl"===n?-1:1),c=e*d+l,u=c+d,p=(c+u)/2,h=Math.PI/180*((90-p)%360),{thickness:m,padAngle:g,roundness:f=r,pointiness:b}=eF[i],x=.5*(1-m);if(b){let e=eX({innerRadius:x,outerRadius:.5,startAngle:c*Math.PI/180,endAngle:u*Math.PI/180,padAngle:g*Math.PI/180,pointStrength:b});o=e.arcPath,s=e.centroid}else{let e=eK({innerRadius:x,outerRadius:.5,startAngle:c*Math.PI/180,endAngle:u*Math.PI/180,padAngle:g*Math.PI/180,cornerRadius:f});o=e()||"",s=e.centroid()}let y=s[0],v=s[1],C=.5*Math.cos(h),w=(p+360)%360;return{outsideX:C,outsideY:.5*Math.sin(h),centroidX:y,centroidY:v,arcPath:o,sideX:w>0&&w<=180?"right":"left",sideY:w>90&&w<=270?"bottom":"top",startAngle:c,midpointAngle:p,endAngle:u}}),e0=({index:e,numCells:t,variant:i,direction:n,semi:a=!1,themeRoundness:r})=>{let{width:o,height:s,ref:l}=(0,eU.useElementSize)(),d=eJ({index:e,numCells:t,variant:i,direction:n,semi:a,themeRoundness:r}),{outsideX:c,outsideY:u,centroidX:p,centroidY:h}=d,m=s*(.5-u)*(a?2:1),g=s*(.5+h)*(a?2:1),f=s*(.5+c)*(a?2:1),b=s*(.5+p)*(a?2:1);return{...d,outsideTop:m,outsideLeft:f,centroidTop:g,centroidLeft:b,circleRef:l,circleWidth:o,circleHeight:s}},e1=(0,eW.default)(e=>{let t=360/e,i=eQ[e]??0,n=[],a=[],r=[];for(let o=0;o0&&s<=180?"right":"left",d=(90-e)%360*Math.PI/180,c=Math.sin(d),u={index:o,angle:e,sideX:l,sideY:s>90&&s<=270?"bottom":"top",x:Math.cos(d),y:c,columnPosition:-1};"left"===l?n.push(u):a.push(u),r.push(u)}return n.sort((e,t)=>t.y-e.y),a.sort((e,t)=>t.y-e.y),n.forEach((e,t)=>{e.columnPosition=t}),a.forEach((e,t)=>{e.columnPosition=t}),{items:r,leftItems:n,rightItems:a}}),e2=(0,v.memo)(({children:e,containerSize:t,variant:i,onContextMenu:n,selectLayoutForElementProps:a})=>{let r=eN({containerSize:t,columnsNeeded:3}),{circleScale:o}=eF[i.key];return(0,m.jsx)(b.Grid,{pos:"relative","data-selection-ring":"padded",templateColumns:`1fr calc(${100*(r?.8:.35*o)}% * var(--media-scale, 1)) 1fr`,autoRows:"auto",rowGap:r?eD:"1.5em",dir:"ltr",onContextMenu:n,...a,children:e})});e2.displayName="CircleWrapper";let e3=(0,v.memo)(e=>eN({containerSize:e.layoutContainerSize,columnsNeeded:3})?(0,m.jsx)(e4,{...e}):(0,m.jsx)(e5,{...e}));e3.displayName="CircleCell";let e5=(0,v.memo)(e=>{let{children:t,index:i,numCells:n,dragHandle:a,variant:r,direction:o,theme:s,selectCellForElementProps:l}=e,{roundness:d}=(0,k.getThemeKnobsV3)(s),{pathRounding:c}=w.ROUNDNESS_OPTIONS[d],{circleRef:u,...p}=e0({index:i,numCells:n,variant:r.key,direction:o,themeRoundness:c}),h="right"===p.sideX,b=h?"left":"right",x=(0,A.getAlignStyles)(b),y=(p.midpointAngle+360)%180==90,{rowStart:v,rowSpan:C,numRows:E,verticalAlign:_}=((e,t)=>{var i,n;let{items:a,rightItems:r,leftItems:o}=e1(t),{columnPosition:s,sideX:l}=a[e],d=(i=r.length,Math.abs(i*(n=o.length))/function(e,t){for(;0!==t;){let i=t;t=e%t,e=i}return e}(i,n)),c="right"===l?r.length:o.length,u=1===t?3:d/c;return{rowStart:s*u+1,rowSpan:u,numRows:d,verticalAlign:"center"}})(i,n),I=y?"2em":"flower"===r.key?"0em":E%2==0?"1.5em":"1em";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f.Flex,{gridColumn:h?3:1,gridRow:`${v} / span ${C}`,zIndex:"1",sx:{...x,...(0,A.getAlignStylesParent)(b,"ltr"),...h?{pl:I}:{pr:I}},direction:"column",justify:_,className:S.SHAPE_OUTSIDE_TEXT_CLASS,minW:"0",...l,children:(0,m.jsxs)(g.Box,{"data-content-reference":!0,"data-smart-layout-emphasis":!0,"data-selection-ring":"padded",pos:"relative",w:"100%",cursor:"text",children:[t,a]})}),(0,m.jsx)(eH,{...e,flexProps:{gridColumn:2,gridRow:`1 / span ${E}`,alignSelf:"center"},coords:p,ref:u})]})});e5.displayName="CircleCellSide";let e4=(0,v.memo)(e=>{let{index:t,numCells:i,direction:n,variant:a,theme:r}=e,{roundness:o}=(0,k.getThemeKnobsV3)(r),{pathRounding:s}=w.ROUNDNESS_OPTIONS[o],{circleRef:l,...d}=e0({index:t,numCells:i,variant:a.key,direction:n,themeRoundness:s});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eH,{...e,flexProps:{gridRow:1,gridColumn:2},coords:d,ref:l}),(0,m.jsx)(eR,{flexProps:{gridColumn:"1 / span 3",gridRow:"auto",dir:n},...e})]})});e4.displayName="CircleCellStacked";let e6=()=>({key:"circle",name:()=>y.i18n._({id:"7xMmki",message:"Circle"}),icon:x.faLifeRing,keywords:["circle","ring","radial","donut","circular"],options:[eO.ColorOption,ez.NumberedOptionWithoutIcons],cellOptions:[eO.ColorOption,eB.EmphasisOption],presetConfigurations:[{name:()=>y.i18n._({id:"7xMmki",message:"Circle"}),options:{numbered:!0}}],Wrapper:e2,Cell:e3,addDirection:()=>"bottom",defaultAttrs:{image:{source:C.FontawesomeIconProvider.key}},htmlTag:"circle",imageSlot:"optional",imageType:"icon",family:"circles"}),e9=(0,v.memo)(({children:e,containerSize:t,onContextMenu:i,selectLayoutForElementProps:n})=>eN({containerSize:t,columnsNeeded:3})?(0,m.jsx)(b.Grid,{pos:"relative","data-selection-ring":"padded",templateColumns:"1fr",templateRows:"auto auto",rowGap:eD,onContextMenu:i,...n,dir:"ltr",children:e}):(0,m.jsx)(b.Grid,{pos:"relative","data-selection-ring":"padded",onContextMenu:i,...n,autoColumns:"1fr",autoRows:"auto",columnGap:"1.5em",rowGap:"2em",children:e}));e9.displayName="SemiCircleWrapper";let e8=(0,v.memo)(e=>eN({containerSize:e.layoutContainerSize,columnsNeeded:3})?(0,m.jsx)(te,{...e}):(0,m.jsx)(e7,{...e}));e8.displayName="SemiCircleCell";let e7=(0,v.memo)(e=>{let{children:t,index:i,numCells:n,dragHandle:a,variant:r,direction:o,theme:s,selectCellForElementProps:l}=e,d=(0,A.getAlignStyles)("center"),{roundness:c}=(0,k.getThemeKnobsV3)(s),{pathRounding:u}=w.ROUNDNESS_OPTIONS[c],{circleRef:p,...h}=e0({index:i,numCells:n,variant:r.key,direction:o,semi:!0,themeRoundness:u}),g=n>4?"70%":"60%";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(f.Flex,{direction:"column",align:"center",justify:"flex-end",pos:"relative",zIndex:"1","data-content-reference":!0,"data-smart-layout-emphasis":!0,"data-selection-ring":"padded",sx:{...d,...(0,A.getAlignStylesParent)("center","ltr")},mb:n>2?`-${.6*h.outsideTop}px`:void 0,...l,cursor:"text",children:[t,a]}),(0,m.jsx)(eH,{...e,flexProps:{gridRow:2,gridColumn:`1 / span ${n}`,alignSelf:"start",justifySelf:"center",aspectRatio:"2/1",width:`calc(${g} * var(--media-scale, 1))`},coords:h,ref:p})]})});e7.displayName="SemiCircleCellTop";let te=(0,v.memo)(e=>{let{index:t,numCells:i,direction:n,variant:a,theme:r}=e,{roundness:o}=(0,k.getThemeKnobsV3)(r),{pathRounding:s}=w.ROUNDNESS_OPTIONS[o],{circleRef:l,...d}=e0({index:t,numCells:i,variant:a.key,direction:n,semi:!0,themeRoundness:s});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eH,{...e,flexProps:{gridRow:1,gridColumn:1,alignSelf:"start",justifySelf:"center",aspectRatio:"2/1",width:"calc(100% * var(--media-scale, 1))"},coords:d,ref:l}),(0,m.jsx)(eR,{flexProps:{gridColumn:1,gridRow:"auto",dir:n},...e})]})});te.displayName="SemiCircleCellStacked";var tt=e.i(555145),ti=e.i(812405),tn=e.i(887527),ta=e.i(654656);let tr=()=>({sm:{targetColumns:4,label:()=>y.i18n._({id:"4Revpc",message:"Small"}),width:10},md:{targetColumns:3,label:()=>y.i18n._({id:"agPptk",message:"Medium"}),width:15},lg:{targetColumns:2,label:()=>y.i18n._({id:"k7rCa/",message:"Large"}),width:20},xl:{targetColumns:1,label:()=>y.i18n._({id:"vp6Yr4",message:"Extra Large"}),width:25}}),to={key:"cellSize",defaultValue:()=>tr().md.width,Control:({value:e,updateValue:t,option:i})=>{let n=Object.values(tr()).find(t=>t.width===e);return(0,m.jsxs)(tt.HStack,{spacing:2,me:2,children:[(0,m.jsx)(N.GammaTooltip,{placement:"top",label:(0,m.jsxs)(ta.VStack,{spacing:0,children:[(0,m.jsx)(tn.Text,{color:"gray.400",children:i.name()}),(0,m.jsx)(tn.Text,{children:n?.label()})]}),children:(0,m.jsx)(tn.Text,{fontSize:"sm",fontWeight:"600",children:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faColumns3})})}),(0,m.jsxs)(ti.Slider,{min:tr().sm.width,max:tr().xl.width,step:5,value:e,onChange:t,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,m.jsx)(ti.SliderTrack,{children:(0,m.jsx)(ti.SliderFilledTrack,{})}),n?(0,m.jsx)(N.GammaTooltip,{placement:"top",label:(0,m.jsxs)(ta.VStack,{spacing:0,children:[(0,m.jsx)(tn.Text,{color:"gray.400",children:i.name()}),(0,m.jsx)(tn.Text,{children:n.label()})]}),children:(0,m.jsx)(ti.SliderThumb,{background:"trueblue.500"})}):(0,m.jsx)(ti.SliderThumb,{background:"trueblue.500"})]})]})},ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:x.faColumns3,items:Object.entries(tr()).map(([i,n])=>({key:`cell-size-${i}`,label:n.label(),icon:n.width===e?x.faCheck:void 0,onClick:()=>{t(n.width)}}))}),getDefaultOnParse:e=>e.childElementCount%2==0?tr().lg.width:tr().md.width,checkEnabled:({options:e})=>"vertical"!==e.orientation,name:()=>y.i18n._({id:"LNoaEH",message:"Column size"}),validator:e=>Object.values(tr()).some(t=>t.width===e)};var ts=e.i(581074);let tl=e=>{let{additionalOptions:t=[],additionalCellOptions:i=[],defaultOptions:n={},presetConfigurations:a=[]}=e;return{...e,options:(0,ts.mergeOptions)([eO.ColorOption,to],t),cellOptions:(0,ts.mergeOptions)([eO.ColorOption,eB.EmphasisOption],i),presetConfigurations:a,addDirection:e=>"vertical"===e.orientation?"bottom":"right",isFullWidth:e=>"horizontal"===e.orientation,defaultOptions:n}};e.s(["createGridVariant",0,tl],197258);var td=e.i(109834);e.s(["GridItem",()=>tF],380442);var tc=e.i(413829),tu=e.i(615393);e.s(["DEFAULT_ITEM_WIDTH",0,20,"FLEXIBLE_GRID_CROSS_SPAN_TOTAL",0,60,"FLEXIBLE_GRID_FLOW_SPAN_TOTAL",0,60,"GAP",0,1,"MAX_ITEM_WIDTH",0,60,"MIN_ITEM_WIDTH",0,10,"NODE_NAME",0,"grid","PROXIMITY_THRESHOLD",0,25],662752);let tp=e=>"flexible"===e,th=({gridStyle:e})=>"flex_grid"===e?"flex":"center",tm=({gridStyle:e})=>"balanced_grid"===e||"steps"===e,tg=({gridStyle:e})=>"steps"===e?{horizontal:"cascade",vertical:"oscillating"}:void 0;e.s(["getForceBalance",0,tm,"getStaggeringConfig",0,tg,"getUnevenBehavior",0,th,"isFlexibleGrid",0,tp],565647);let tf=({cellSize:e,horizontalAlign:t,orientation:i,numCells:n,containerSize:a,forceBalance:r,gridStyle:o})=>{let s=(0,K.useShouldRenderMobileVersion)(),{columns:l,lastRowAligner:d}=(({containerSize:e,numCells:t,mobileMaxColumns:i=1,forceBalance:n=!1,cellSize:a,horizontalAlign:r,gridStyle:o})=>{let s,l=(0,K.useShouldRenderMobileVersion)(),d=(0,B.useAppSelector)(H.selectMode)===tu.EditorModeEnum.SLIDE_VIEW,c=(0,B.useAppSelector)(H.selectDocZoomToFit),u=Object.values(tr()).find(e=>e.width===a)?.targetColumns||3,p=40/u,h=(0,E.useBreakpointValue)({base:i,sm:2,md:3,xl:4},{fallback:l?"base":"xl"})||i;if(tp(o))return{columns:60,lastRowAligner:void 0};let f=eL.isPuppeteer||d||c?4:l?i:h,b=(0,tc.default)(40*e,10,10*f),x=Math.max(1,Math.floor(b/p)),y=Math.min(x,t);if(n&&t>y&&t<=4)for(;y>=1&&t%y!=0;y--);let v=Math.ceil(t/y),C=t%y;if(C&&"center"===r){let e=(y-C)/2;s=(0,m.jsx)(g.Box,{gridColumn:`span ${6*e}`,gridRow:`${v}`,className:"grid-offset"})}else if(C&&"right"===r){let e=y-C;s=(0,m.jsx)(g.Box,{gridColumn:`span ${6*e}`,gridRow:`${v}`,className:"grid-offset"})}return{maxWidth:b,targetWidth:p,targetColumns:u,maxColumns:x,columns:y,lastRowAligner:s}})({containerSize:a,numCells:n,cellSize:e,horizontalAlign:t,forceBalance:r,gridStyle:o});return"vertical"===i||s||n>1&&1===l?{columns:1,isHorizontal:!1}:{columns:l,isHorizontal:!0,lastRowAligner:d}};e.s(["useLayoutIsHorizontal",0,tf],536788);e.s(["CellStyleMap",()=>tB],496911),e.s(["StyledGridCell",()=>tR],890003);let tb=e=>{switch(e){case"small":break;case"medium":return 4;case"large":return 6}return 2},tx=e=>(0,m.jsx)(g.Box,{contentEditable:!1,userSelect:"none",pointerEvents:"none",...e,children:(0,m.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",className:S.SVG_SHAPE_FILL_CLASS,style:{filter:"drop-shadow(0.25em 0 0em var(--card-color)) drop-shadow(0 0.25em 0em var(--card-color))"},children:(0,m.jsx)("path",{d:"M14.017 21v-7.391c0-5.704 3.731-9.57 8.983-10.609l.995 2.151c-2.432.917-3.995 3.638-3.995 5.849h4v10h-10zm-14.017 0v-7.391c0-5.704 3.748-9.57 9-10.609l.996 2.151c-2.433.917-3.996 3.638-3.996 5.849h4v10h-10z"})})}),ty=e=>(0,m.jsx)(g.Box,{contentEditable:!1,userSelect:"none",pointerEvents:"none",...e,children:(0,m.jsx)("svg",{width:"100%",height:"100%",viewBox:"0 0 24 24",className:S.SVG_SHAPE_FILL_CLASS,style:{filter:"drop-shadow(-0.25em 0 0em var(--card-color)) drop-shadow(0 -0.25em 0em var(--card-color))"},children:(0,m.jsx)("path",{d:"M9.983 3v7.391c0 5.704-3.731 9.57-8.983 10.609l-.995-2.151c2.432-.917 3.995-3.638 3.995-5.849h-4V3h10zm14.017 0v7.391c0 5.704-3.748 9.57-9 10.609l-.996-2.151c2.433-.917 3.996-3.638 3.996-5.849h-4V3h10z"})})}),tv={fullLine:{component:({cellProps:e,cellStyle:t,decorSize:i,decorPosition:n})=>{let{layoutOptions:a,cellOptions:r,index:o,direction:s}=e,{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:a.color,cellColorOverride:r?.color,index:o,forceTransparent:!1}),d=tb(i);return(0,m.jsx)(f.Flex,{position:"absolute",top:"side"===n?"calc(var(--line-thickness) * -1)":"top"===n?"0":void 0,bottom:"side"===n?"calc(var(--line-thickness) * -1)":"bottom"===n?"0":void 0,left:"top"===n?"calc(var(--line-thickness) * -1)":void 0,right:"top"===n?"calc(var(--line-thickness) * -1)":void 0,insetInlineStart:"ltr"===s?"calc(var(--line-thickness) * -1)":void 0,insetInlineEnd:"rtl"===s?"calc(var(--line-thickness) * -1)":void 0,width:"side"===n?`calc(var(--line-thickness) * ${d})`:void 0,height:"top"===n||"bottom"===n?`calc(var(--line-thickness) * ${d})`:void 0,className:S.HTML_SHAPE_FILL_CLASS,borderInlineStartRadius:"none"===t?void 0:"var(--box-border-radius)",sx:l,contentEditable:!1})},stylesFunction:({cellStyle:e,decorSize:t,decorPosition:i})=>{let n=tb(t);return{borderInlineStartWidth:"0px !important",borderStartStartRadius:`calc(var(--line-thickness) * ${n}) !important`,borderEndStartRadius:`calc(var(--line-thickness) * ${n}) !important`,paddingInlineStart:"side"===i?`calc(var(--line-thickness) * ${n} + 1em)`:void 0,paddingTop:"top"===i?`calc(var(--line-thickness) * ${n} + 1em)`:void 0}}},quotes:{component:({cellProps:e,cellStyle:t})=>{let{layoutOptions:i,cellOptions:n,index:a,direction:r}=e,{colorVars:o}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a,forceTransparent:!1});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tx,{position:"absolute",top:"-0.6em",insetStart:"-0.6em",width:"1.2em",height:"1.2em",css:o}),(0,m.jsx)(ty,{position:"absolute",bottom:"-0.6em",insetEnd:"-0.6em",width:"1.2em",height:"1.2em",css:o})]})},stylesFunction:()=>({p:"calc(1em + 0.5em)"})}},tC=2/3*3,tw=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,direction:r,selectCellForElementProps:o}=e,{colorVars:s}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a}),{width:l,height:d,fontSize:c,ref:u}=(0,eU.useElementSizeAndOffset)(),p=((e,t,i,n,a="ltr")=>{let r=tC*i,o=3*i;if(!n){let i=.75*t,n=(e-r)/2,a=n+r,s=(e-o)/2;return`M ${n} 0 L ${a} 0 L ${a} ${i} L ${s+o} ${i} L ${e/2} ${t} L ${s} ${i} L ${n} ${i} Z`}let s=t/2,l=(t-r)/2,d=l+r,c=(t-o)/2,u=c+o;if("rtl"===a){let t=2.5*i;return`M 0 ${s} L ${t} ${c} L ${t} ${l} L ${e} ${l} L ${e} ${d} L ${t} ${d} L ${t} ${u} Z`}let p=e-2.5*i;return`M 0 ${l} L ${p} ${l} L ${p} ${c} L ${e} ${s} L ${p} ${u} L ${p} ${d} L 0 ${d} Z`})(l,d,c,t,r),h=t?{width:"100%",height:"3em"}:{minWidth:"3em",width:"3em",height:"100%"};return(0,m.jsx)(f.Flex,{contentEditable:!1,align:"center",justify:"center",position:"relative",sx:s,...o,ref:u,...h,children:(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:"0",w:"100%",overflow:"visible","data-testid":"arrow-svg",...o,children:(0,m.jsx)(g.Box,{as:"path",d:p,className:S.SVG_SHAPE_BACKGROUND_CLASS})})})});tw.displayName="ArrowLabel";let tS=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let i,n,{layoutOptions:a,cellOptions:r,index:o,direction:s,selectCell:l,selectCellForElementProps:d}=e,c=r?.icon,{colorVars:u}=(0,_.useCellColor)({layoutColorOverride:a.color,cellColorOverride:r?.color,index:o}),{width:p,height:h,fontSize:b,ref:x}=(0,eU.useElementSizeAndOffset)(),y=(i=(t?4:5)*b,n=+b,t?"rtl"===s?` M ${n} 0 L 0 ${i/2} L ${n} ${i} L ${p} ${i} L ${p-n} ${i/2} L ${p} 0 Z`:` M ${p-n} 0 L ${p} ${i/2} L ${p-n} ${i} L 0 ${i} L ${n} ${i/2} L 0 0 Z`:` M 0 ${h-n} L ${i/2} ${h} L ${i} ${h-n} L ${i} 0 L ${i/2} ${n} L 0 0 Z`);return(0,m.jsxs)(f.Flex,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...u,...(0,A.getAlignStyles)("center")},...t?{width:"100%",height:"4em"}:{width:"5em",height:"100%"},ref:x,"data-export-as-image":!0,className:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,children:[(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:"0",w:"100%",overflow:"visible","data-testid":"arrow-svg",...d,children:(0,m.jsx)(g.Box,{as:"path",d:y,className:S.SVG_SHAPE_BACKGROUND_CLASS})}),(0,m.jsx)(f.Flex,{fontSize:"1.5em",pos:"absolute",my:"0.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:c,number:a.numbered?o+1:void 0,isNumbered:a.numbered,iconSize:1,selectCell:l})})]})});tS.displayName="ChevronLabel";let tk=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,selectCell:r,selectCellForElementProps:o}=e,s=n?.icon,{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a});return(0,m.jsx)(f.Flex,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...l},style:t?{borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopRightRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderTopWidth:"0px",borderLeftWidth:"0px",borderRightWidth:"0px"}:{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopWidth:"0px",borderLeftWidth:"0px",borderBottomWidth:"0px"},...t?{width:"100%",height:"3em"}:{width:"4em",height:"100%",minHeight:"4em"},className:(0,M.cx)(S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),...o,children:(0,m.jsx)(f.Flex,{fontSize:"1.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:s,number:i.numbered?a+1:void 0,isNumbered:i.numbered,iconSize:1,selectCell:r})})})});tk.displayName="FlushLabel";let tA=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,direction:r,selectCell:o,selectCellForElementProps:s,theme:l,firstChildSize:d}=e,c=n?.icon,{colorVars:u}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a}),p=(0,K.useShouldRenderMobileVersion)(),h=(0,j.matchBulletTextAlignment)(l,p,"h1",d);return(0,m.jsxs)(f.Flex,{width:t?"100%":"3em",height:t?"3em":"100%",align:"center",justify:"center",position:"relative",direction:t?"row":"column",contentEditable:!1,children:[(0,m.jsx)(f.Flex,{borderRadius:"50% !important",width:"3em",height:"3em",position:"absolute",left:"rtl"===r?void 0:0,right:"rtl"===r?0:void 0,top:t?"50%":`${h}em`,transform:t?"translateY(-50%)":void 0,zIndex:"1",sx:{...u},className:(0,M.cx)(S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),justify:"center",align:"center",children:(0,m.jsx)(f.Flex,{fontSize:"1.5em",my:"0.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:c,number:i.numbered?a+1:void 0,isNumbered:i.numbered,iconSize:1,selectCell:o})})}),(0,m.jsx)(f.Flex,{align:"center",justify:"center",position:"relative",sx:u,...t?{width:"calc(100% - 1.5em)",height:"1em",marginInlineStart:"1.5em"}:{minWidth:"1em",width:"1em",height:"calc(100% - 1.5em)",marginTop:"1.5em"},className:S.HTML_SHAPE_BACKGROUND_CLASS,...s})]})});tA.displayName="IconCircleWithSimpleLineLabel";let tE=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,selectCell:r,selectCellForElementProps:o}=e,s=n?.icon,{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a});return(0,m.jsx)(f.Flex,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...l},style:{borderRadius:"12em"},...t?{width:"100%",height:"3em"}:{width:"4em",height:"100%",minHeight:"4em"},className:(0,M.cx)(S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),...o,children:(0,m.jsx)(f.Flex,{fontSize:"1.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:s,number:i.numbered?a+1:void 0,isNumbered:i.numbered,iconSize:1,selectCell:r})})})});tE.displayName="PillsLabel";let t_=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,selectCellForElementProps:r}=e,{colorVars:o}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a});return(0,m.jsx)(f.Flex,{contentEditable:!1,align:"center",justify:"center",position:"relative",sx:o,style:t?{borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopRightRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderTopWidth:"0px",borderLeftWidth:"0px",borderRightWidth:"0px"}:{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopWidth:"0px",borderLeftWidth:"0px",borderBottomWidth:"0px"},...t?{width:"100%",height:"1em"}:{minWidth:"1em",width:"1em",height:"100%"},className:S.HTML_SHAPE_BACKGROUND_CLASS,...r})});t_.displayName="SimpleLineFlushLabel";let tI=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,selectCellForElementProps:r}=e,{colorVars:o}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a});return(0,m.jsx)(f.Flex,{contentEditable:!1,align:"center",justify:"center",position:"relative",sx:o,...t?{width:"100%",height:"1em"}:{minWidth:"1em",width:"1em",height:"100%"},className:S.HTML_SHAPE_BACKGROUND_CLASS,...r})});tI.displayName="SimpleLineLabel";let tM=(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let i,n,{layoutOptions:a,cellOptions:r,index:o,direction:s,selectCell:l,selectCellForElementProps:d}=e,c=r?.icon,{colorVars:u}=(0,_.useCellColor)({layoutColorOverride:a.color,cellColorOverride:r?.color,index:o}),{width:p,height:h,fontSize:b,ref:x}=(0,eU.useElementSizeAndOffset)(),y=(i=(t?4:5)*b,n=1.5*b,t?"rtl"===s?` M ${n} 0 L ${p} 0 L ${p-n} ${i} L 0 ${i} Z`:` M ${n} 0 L ${p} 0 L ${p-n} ${i} L 0 ${i} Z`:` M 0 ${h} L 0 ${n} L ${i} 0 L ${i} ${h-n} Z`);return(0,m.jsxs)(f.Flex,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...u,...(0,A.getAlignStyles)("center")},...t?{width:"100%",height:"4em"}:{width:"5em",height:"100%"},ref:x,"data-export-as-image":!0,className:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,children:[(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:"0",w:"100%",overflow:"visible","data-testid":"arrow-svg",...d,children:(0,m.jsx)(g.Box,{as:"path",d:y,className:S.SVG_SHAPE_BACKGROUND_CLASS})}),(0,m.jsx)(f.Flex,{fontSize:"1.5em",pos:"absolute",my:"0.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:c,number:a.numbered?o+1:void 0,isNumbered:a.numbered,iconSize:1,selectCell:l})})]})});tM.displayName="SlantedLabel";let tT={chevron:tS,flush:tk,pills:tE,slanted:tM,simpleLine:tI,arrow:tw,iconCircleWithSimpleLine:tA,simpleLineFlush:t_},tL=({innerLabelConfig:e,cellProps:t,isHorizontal:i})=>{if(!e)return null;let n=e?tT[e.labelType]:void 0;return n?(0,m.jsx)(n,{cellProps:t,isHorizontal:i}):null},tj=(0,v.memo)(({cellProps:e})=>{let{layoutOptions:t,cellOptions:i,index:n,selectCell:a,selectCellForElementProps:r}=e,o=i?.icon,{colorVars:s}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:n,forceTransparent:!1});return(0,m.jsx)(f.Flex,{width:"3em",height:"3em",align:"center",justify:"center",contentEditable:!1,sx:s,className:(0,M.cx)(S.HTML_SHAPE_FILL_CLASS,S.SHAPE_TEXT_OVER_FILL_CLASS),style:{borderRadius:"9999px"},...r,children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:o,number:t.numbered?n+1:void 0,isNumbered:t.numbered,iconSize:1.35,selectCell:a})})})});tj.displayName="IconCircleMarker";let tP={iconCircle:tj,smallBullet:({cellProps:e})=>{let{layoutOptions:t,cellOptions:i,index:n}=e,{colorVars:a}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:n,forceTransparent:!1,isColoringCell:!0});return(0,m.jsx)(g.Box,{width:"0.5em",height:"0.5em",borderRadius:"50%",transform:"translateY(-50%)",className:S.HTML_SHAPE_FILL_CLASS,flexShrink:0,sx:a,contentEditable:!1})},bigBullet:eM},tD=({markerConfig:e,cellProps:t,matchBulletPadding:i})=>{if(!e)return null;let n=tP[e.markerType];if(!n)return null;let a=((e,t)=>{if(!e)return{};let{markerPosition:i}=e;return"left"===i?{mt:t&&t<0?`${-1*t}em`:void 0}:{}})(e,i);return(0,m.jsx)(g.Box,{sx:{...a},children:(0,m.jsx)(n,{cellProps:t,markerFontSize:e.markerFontSize})})},tN=e=>{switch(e){case"solid":return`${S.SHAPE_OUTSIDE_TEXT_CLASS} ${S.HTML_SHAPE_BACKGROUND_CLASS}`;case"outline":return`${S.SHAPE_OUTSIDE_TEXT_CLASS} ${S.HTML_SHAPE_OUTLINE_CLASS}`;case"none":return S.SHAPE_OUTSIDE_TEXT_CLASS}},tR=({children:e,cellStyle:t="none",cellContentPropOverrides:i,colorVars:n,alignStyles:a,cellProps:r,theme:o,markerConfig:s,innerLabelConfig:l,cellDecorConfig:d,cursor:c,onClick:u,onDragOver:p,onDragLeave:h,onDrop:f,className:b})=>{let x,{layoutOptions:y,direction:v,numCells:C,layoutContainerSize:w,firstChildSize:S}=r,{isHorizontal:k}=tf({cellSize:y.cellSize||0,horizontalAlign:y.horizontalAlign||"center",orientation:y.orientation||"horizontal",numCells:C,containerSize:w,forceBalance:!1}),A=(0,K.useShouldRenderMobileVersion)();s&&(x=(0,j.matchBulletTextAlignment)(o,A,s.markerFontSize||null,S));let E=(({isHorizontal:e,markerConfig:t,innerLabelConfig:i,direction:n,layoutOptions:a})=>{let r=t?(e=>{if(!e)return{};let{markerPosition:t}=e,i={display:"flex",gap:(0,eT.scaleWithFontScale)("1em")};return"left"===t?{...i,flexDirection:"row",alignItems:"start"}:{...i,flexDirection:"column"}})(t):null,o=i?(({isHorizontal:e,direction:t,layoutOptions:i,gap:n})=>({display:"flex",flexDirection:e?"column":"rtl"===t&&"left"===i.horizontalAlign||"ltr"===t&&"right"===i.horizontalAlign?"row-reverse":"row",gap:n,minH:e?void 0:"6em",h:"100%",borderRadius:"var(--box-border-radius)"}))({isHorizontal:e,direction:n,layoutOptions:a,gap:(0,eT.scaleWithFontScale)("1em")}):null;return r||o})({isHorizontal:k,markerConfig:s,innerLabelConfig:l,direction:v,layoutOptions:y}),_=(({isHorizontal:e,innerLabelConfig:t,markerConfig:i,matchBulletPadding:n,cellContentPropOverrides:a})=>{let r=i?((e,t)=>{if(!e)return{};let{markerPosition:i}=e;return"left"===i?{mt:t&&t>0?`${t}em`:void 0}:{}})(i,n):null,o=t?(({isHorizontal:e,innerLabelConfig:t})=>e?{minW:0,transformOrigin:"center top",p:"1em",pt:0,...t?.labelStyles}:{transformOrigin:"left center",p:"1em",px:0,...t?.labelStyles})({isHorizontal:e,innerLabelConfig:t}):null,s=r||o;return s?{...s,...a}:a})({isHorizontal:k,innerLabelConfig:l,markerConfig:s,matchBulletPadding:x,cellContentPropOverrides:i}),I=d?tv[d.decorType]:void 0,T=I?.component,L=I?.stylesFunction({cellStyle:t,decorSize:d?.decorSize,decorPosition:d?.decorPosition,cellProps:r,isHorizontal:k}),P="none"===t||l;return(0,m.jsxs)(g.Box,{"data-grid-item":!0,cursor:c||"text",onClick:u,position:"relative",p:P?0:"1em",flex:"1",minW:"0",onDragOver:p,onDragLeave:h,onDrop:f,...i,sx:{...n,...E,...a,...L,...i?.sx},className:(0,M.cx)(tN(t),"styled-grid-cell",b),children:[T&&(0,m.jsx)(T,{cellProps:r,isHorizontal:k,cellStyle:t,decorSize:d?.decorSize,decorPosition:d?.decorPosition}),(0,m.jsx)(tD,{markerConfig:s,cellProps:r,matchBulletPadding:x}),(0,m.jsx)(tL,{innerLabelConfig:l,cellProps:r,isHorizontal:k}),s||l?(0,m.jsx)(g.Box,{flex:"1",w:"100%",minW:"0",sx:{..._},cursor:"text",children:e}):e]})},tO=(0,v.memo)(({layoutOptions:e,index:t,image:i,selectCell:n,selectCellForElementProps:a,cellOptions:r})=>{let o,s=e.numbered||r.marker?.type==="number";return o=s?t+1<10?`0${t+1}`:`${t+1}`:void 0,(0,m.jsx)(f.Flex,{className:S.SHAPE_OUTSIDE_TEXT_CLASS,flexDirection:"column",alignItems:"right"!==e.horizontalAlign?e.horizontalAlign:"end",opacity:1,contentEditable:!1,...a,children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),mb:"0.25em",children:(0,m.jsx)(e_,{image:i,number:o,isNumbered:s,iconSize:1,selectCell:n,fontWeight:"light",boxProps:s&&!i?.src?{minW:"2em",justifyContent:"start"}:void 0})})})});tO.displayName="TopBorderIconOrNumber";let tB={none:{component:null,name:()=>y.i18n._({id:"EdQY6l",message:"None"})},solid:{component:null,name:()=>y.i18n._({id:"5bi1la",message:"Solid"})},outline:{component:null,name:()=>y.i18n._({id:"dD7NPy",message:"Outline"})},processStep:{component:e=>{let{children:t,colorVars:i,alignStyles:n,cellProps:a}=e,{layoutOptions:r,cellOptions:o,index:s,selectCellForElementProps:l,selectCell:d}=a,c=o?.icon,u=o?.marker?.iconData,{colorVars:p}=(0,_.useCellColor)({layoutColorOverride:r.color,cellColorOverride:o?.color,index:s,forceTransparent:!1});return(0,m.jsxs)(tR,{"data-selection-ring":!0,cursor:l.cursor||"text",onClick:l.onClick,cellProps:a,theme:a.theme,cellStyle:"none",cellContentPropOverrides:{textAlign:"start",mb:"0.75em",sx:{borderRadius:0,borderWidth:0}},children:[(0,m.jsx)(tO,{layoutOptions:r,cellOptions:o,index:s,image:c||u,selectCell:d,selectCellForElementProps:l}),(0,m.jsx)(f.Flex,{position:"relative",top:"calc(var(--line-thickness) * -1)",marginTop:"0.2em",marginBottom:"0.5em",opacity:1,height:"calc(var(--line-thickness) * 1)",className:S.HTML_SHAPE_FILL_CLASS,borderRadius:0,sx:p,contentEditable:!1}),t]})},name:()=>y.i18n._({id:"RTzAdC",message:"Process Step"})},speechBubble:{component:e=>{var t,i,n;let a,r,o,s,l,d,{children:c,colorVars:u,alignStyles:p,cellProps:h}=e,{layoutOptions:b,cellOptions:x,index:y,selectCellForElementProps:v}=h,{colorVars:C}=(0,_.useCellColor)({layoutColorOverride:b.color,cellColorOverride:x?.color,index:y}),{width:w,height:k,fontSize:E,ref:I}=(0,eU.useElementSizeAndOffset)(),M=(t=w,i=k,a=1.2*(n=E),r=.5*n,o=t-0,s=i-a-0,l=2*t/3,d=0+s,` M ${0+r} 0 L ${0+o-r} 0 Q ${0+o} 0 ${0+o} ${0+r} L ${0+o} ${0+s-r} Q ${0+o} ${0+s} ${0+o-r} ${0+s} L ${l+a/2} ${d} L ${l+a/2} ${d+a} L ${l-a/2} ${d} L ${0+r} ${0+s} Q 0 ${0+s} 0 ${0+s-r} L 0 ${0+r} Q 0 0 ${0+r} 0 Z`);return(0,m.jsx)(tR,{"data-selection-ring":!0,cursor:v.cursor||"text",onClick:v.onClick,cellProps:h,theme:h.theme,cellStyle:"none",children:(0,m.jsxs)(f.Flex,{position:"relative",css:C,width:"100%",h:"100%",minHeight:"4em",ref:I,className:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,children:[(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:"0",w:"100%",h:"100%",overflow:"visible","data-testid":"speech-bubble-svg",...v,children:(0,m.jsx)(g.Box,{as:"path",d:M,className:S.SVG_SHAPE_BACKGROUND_CLASS})}),(0,m.jsx)(g.Box,{pos:"relative",p:"1em",pb:"2.2em",w:"100%",zIndex:1,sx:(0,A.getAlignStyles)(b.horizontalAlign||"left"),children:c})]})})},name:()=>y.i18n._({id:"RMiFar",message:"Speech Bubble"})}},tz=({children:e,className:t})=>(0,m.jsx)(g.Box,{h:"100%",w:"100%",display:"flex",flexDirection:"column",css:{"--media-maxH":"100%","--media-maxW":"100%","[data-node-view-content]":{display:"contents",'[data-node-view-content-inner="gridItem"]':{display:"contents",".block-image, .block-smartDiagram":{height:"100%",width:"100%",display:"flex",flexDirection:"column",justifyContent:"center"}}}},"data-grid-item":!0,className:t,children:e}),tF=(0,v.memo)(({cellProps:e,children:t,forceBalanceOverride:i,cellStyle:n="none",cellContentPropOverrides:a,markerConfig:r,innerLabelConfig:o,cellDecorConfig:s,gridStyle:l="standard",dragHandle:d,addButton:c,onDragOver:u,onDragLeave:p,onDrop:h,className:g})=>{var b;let x,y,{layoutOptions:v,cellOptions:C,index:w,selectCellForElementProps:S,numCells:k,layoutContainerSize:E,direction:I,theme:T,isFullBleed:L,stretchedHorizontalColumn:j,stretchedHorizontalRow:P,stretchedVerticalRow:D,stretchedVerticalColumn:N,parentGridId:R}=e,O=i||tm({gridStyle:l}),B=th({gridStyle:l}),z=tg({gridStyle:l}),{colorVars:F}=(0,_.useCellColor)({layoutColorOverride:v.color,cellColorOverride:C?.color,index:w,forceTransparent:!0}),H=C?.horizontalAlign||v.horizontalAlign,W=a?.alignItems?void 0:{...(0,A.getAlignStyles)(H,I),...(0,A.getAlignStylesParent)(H,I)},U=(b=C?.verticalAlign)?{justifyContent:({top:"flex-start",center:"center",bottom:"flex-end"})[b],display:"flex",flexDirection:"column"}:{},V={...W,...U},{isHorizontal:G,columns:$}=tf({cellSize:v.cellSize||0,horizontalAlign:v.horizontalAlign||"center",orientation:v.orientation||"horizontal",numCells:k,containerSize:E,forceBalance:O,gridStyle:l}),Z=(({index:e,numCells:t,columns:i,unevenBehavior:n="center",gridStyle:a="standard",layoutOptions:r,cellOptions:o,stretchedHorizontalColumn:s,stretchedHorizontalRow:l,stretchedVerticalRow:d,stretchedVerticalColumn:c})=>{let u=a||"standard",p=Math.floor(e/i),h=Math.ceil(t/i),m="flexible"===u?1:6;return tp(u)?(({cellOptions:e,stretchedHorizontalColumn:t,stretchedHorizontalRow:i,stretchedVerticalRow:n,stretchedVerticalColumn:a,layoutOptions:r})=>{let{gridDirection:o="horizontal"}=r;if("horizontal"===o){let n=t??e?.horizontalColumnSpan??20,a=i??e?.horizontalRowSpan;return{columnSpan:+Math.max(10,Math.min(60,n)),rowSpan:a?Math.max(10,Math.min(60,a)):void 0}}{let t=n??e?.verticalRowSpan??20,i=a??e?.verticalColumnSpan,r=i?Math.max(10,Math.min(60,i)):void 0;return{rowSpan:+Math.max(10,Math.min(60,t)),columnSpan:r?+r:void 0}}})({layoutOptions:r,cellOptions:o,stretchedHorizontalColumn:s,stretchedHorizontalRow:l,stretchedVerticalRow:d,stretchedVerticalColumn:c}):"steps"===u?{columnSpan:m}:p===h-1&&"flex"===n?{columnSpan:((e,t,i,n)=>{let a=t%i||i,r=e%i;if(r>=a)return 0;let o=i*n,s=Math.floor(o/a);return r{let a={};if(e){if(n&&"cascade"===e.horizontal){let e=t%i+1;a.paddingTop=`${(i-e)*1.5}em`,a.paddingBottom=0}else{let i;n||"oscillating"!==e.vertical||(a.paddingInlineStart=`${(i=t%6)<=3?1.5*i:4.5-(i-3)*1.5}em`)}n&&"function"==typeof e.horizontal?a.paddingTop=e.horizontal(t,i):n||"function"!=typeof e.vertical||(a.paddingInlineStart=e.vertical(t))}return a})(z,w,$,G):void 0,q=v.gridDirection??"horizontal",Y={gridColumn:Z.columnStart?`${Z.columnStart} / span ${Z.columnSpan}`:"horizontal"===q?`span var(--grid-${R}-item-${w}-resize-flow, ${Z.columnSpan})`:"vertical"===q?`span var(--grid-${R}-item-${w}-resize-cross, ${Z.columnSpan})`:`span ${Z.columnSpan}`,...K};Z.rowStart?Y.gridRow=Z.rowSpan?`${Z.rowStart} / span ${Z.rowSpan}`:`${Z.rowStart}`:Z.rowSpan&&(Y.gridRow="vertical"===q?`span var(--grid-${R}-item-${w}-resize-flow, ${Z.rowSpan})`:"horizontal"===q?`span var(--grid-${R}-item-${w}-resize-cross, ${Z.rowSpan})`:`span ${Z.rowSpan}`);let X=tB[n]?.component;("none"===n||"solid"===n||"outline"===n)&&(x=(0,m.jsxs)(tR,{cellContentPropOverrides:a,colorVars:F,alignStyles:V,cellStyle:n,cellProps:e,theme:T,cursor:S.cursor||"text",onClick:S.onClick,cellDecorConfig:s,markerConfig:r,innerLabelConfig:o,onDragOver:u,onDragLeave:p,onDrop:h,className:g,children:[t,d,c]})),L&&(x=(0,m.jsx)(tz,{className:g,children:t})),X&&(x=(0,m.jsxs)(X,{colorVars:F,alignStyles:V,cellProps:e,onDragOver:u,onDragLeave:p,onDrop:h,className:g,children:[t,d,c]}));let Q=[...(y=["grid-item"],"vertical"===q?y.push("grid-item-vertical"):y.push("grid-item-horizontal"),"none"===n&&y.push("grid-item-cell-style-none"),L&&y.push("grid-item-full-bleed"),y),...g?[g]:[]];return(0,m.jsx)(f.Flex,{"data-content-reference":!0,sx:{...Y},h:"100%",position:"relative",className:(0,M.cx)(...Q),"data-selection-ring":!0,children:x})});tF.displayName="GridItem";var tH=e.i(641099),tW=e.i(731378);let tU=(0,v.memo)(({children:e,cellSize:t,horizontalAlign:i,orientation:n,gridDirection:a="horizontal",numCells:r,containerSize:o,onContextMenu:s,selectLayoutForElementProps:l,spacing:d="medium",wrapperStyle:c="none",gridStyle:u="standard",forceBalanceOverride:p,crossEdgeControl:h,isFullBleedNestedGrid:f,className:b})=>{let x=p||tm({gridStyle:u}),y=th({gridStyle:u}),{isHorizontal:v,columns:C,lastRowAligner:w}=tf({cellSize:t,horizontalAlign:i,orientation:n,numCells:r,containerSize:o,forceBalance:x,gridStyle:u}),{rowGap:S,columnGap:k}=(e=>{switch(e){case"none":return{rowGap:"0em",columnGap:"0em"};case"small":return{rowGap:(0,eT.scaleWithFontScale)("1em"),columnGap:(0,eT.scaleWithFontScale)("1em")};case"medium":default:return{rowGap:(0,eT.scaleWithFontScale)("2em"),columnGap:(0,eT.scaleWithFontScale)("1.25em")};case"large":return{rowGap:(0,eT.scaleWithFontScale)("2em"),columnGap:(0,eT.scaleWithFontScale)("2em")}}})(tp(u)?"none":d),A=(({gridStyle:e,isHorizontal:t,columns:i,rowGap:n,columnGap:a,numCells:r,gridDirection:o})=>{let s="flexible"===e?1:6;return"vertical"===o&&tp(e)?{gridTemplateColumns:"repeat(60, 1fr)",gridTemplateRows:"repeat(60, auto)",gridAutoFlow:"column",rowGap:n,columnGap:a}:t?{columns:i*s,rowGap:tp(e)?0:n,columnGap:tp(e)?0:a}:{columns:+s,rowGap:tp(e)?0:n}})({gridStyle:u,isHorizontal:v,columns:C,rowGap:S,columnGap:k,numCells:r,gridDirection:a}),E=(0,B.useAppSelector)(tW.selectShowGridItemDebugOverlay),_="vertical"===a&&tp(u),I=(0,m.jsxs)(tH.SimpleGrid,{"data-selection-ring":!0,...A,onContextMenu:s,...l,className:(0,M.cx)(tN(c),b),sx:{...E&&{border:"1px solid blue"}},children:[e,"center"===y&&w]});return _?(0,m.jsxs)(g.Box,{pos:"relative",height:f?"100%":void 0,children:[I,h&&(0,m.jsx)(tH.SimpleGrid,{contentEditable:!1,position:"absolute",inset:0,pointerEvents:"none",gridTemplateColumns:A.gridTemplateColumns,gridTemplateRows:A.gridTemplateRows,columnGap:A.columnGap,rowGap:A.rowGap,zIndex:10,className:"grid-resize-overlay",children:h})]}):(0,m.jsx)(m.Fragment,{children:I})});tU.displayName="GridWrapper",e.s(["GridWrapper",0,tU],143863);let tV=(0,v.memo)(({children:e,...t})=>{let{layoutOptions:i,cellOptions:n,index:a,firstChildSize:r,theme:o}=t,s=(0,K.useShouldRenderMobileVersion)(),{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a,forceTransparent:!0}),{color:d,colorVars:c}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a,forceTransparent:!0}),u=(0,j.matchBulletTextAlignment)(o,s,null,r),p={...t.image&&(0,V.isRecolorableSvg)(t.image)?(0,z.getRecolorableIconSx)(d??"var(--accent-color-readable)"):{}};return(0,m.jsxs)(tF,{cellProps:t,gridStyle:"flex_grid",cellStyle:"none",dragHandle:t.dragHandle,cellContentPropOverrides:{display:"flex",flexDirection:"row",alignItems:"start",gap:"1em",pt:`${-1*u}em`},children:[(0,m.jsx)(g.Box,{width:"2.25em",height:"2.25em",transform:"translateY(-50%)",flexShrink:0,sx:{...c,...p},contentEditable:!1,display:"flex",alignItems:"center",justifyContent:"center",children:(0,m.jsx)(e_,{image:t.image,iconSize:1.5,placeholderIfEmpty:!1,selectCell:t.selectCell,isNumbered:!1})}),(0,m.jsx)(g.Box,{flex:"1",minW:"0",className:S.SHAPE_OUTSIDE_TEXT_CLASS,css:l,mt:`${u}em`,cursor:"text",children:e})]})});tV.displayName="IconBulletsCell";let tG=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,gridStyle:"flex_grid",spacing:"medium"}));tG.displayName="IconBulletsWrapper";let t$=()=>tl({key:"bigBullets",name:()=>y.i18n._({id:"OsVXoX",message:"Large bullets"}),icon:x.faList,keywords:["bullets","layout","list","bullet"],htmlTag:"bullets",family:"bullets",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons],presetConfigurations:[{name:()=>y.i18n._({id:"UIxZV9",message:"Numbered bullets"}),options:{numbered:!0},zoomIn:!0},{name:()=>y.i18n._({id:"EJnrtJ",message:"Empty bullets"}),options:{numbered:!1},zoomIn:!0}],imageSlot:"optional",imageType:"icon",config:{wrapperConfig:{spacing:"medium",gridStyle:"flex_grid"},cellConfig:{cellStyle:"none",marker:{markerType:"bigBullet",markerFontSize:"h3",markerPosition:"left"}}},isFullWidth:()=>!0,addDirection:()=>"right"});var tZ=e.i(912711);let tK=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,gridStyle:"flex_grid",cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));tK.displayName="OutlineBoxesWithTopCircleWrapper";let tq=(0,v.memo)(({layoutOptions:e,cellOptions:t,index:i,image:n,selectCell:a,selectCellForElementProps:r})=>{let{colorVars:o}=(0,_.useCellColor)({layoutColorOverride:e.color,cellColorOverride:t?.color,index:i});return(0,m.jsx)(f.Flex,{position:"absolute",top:"-1.5em",left:"50%",transform:"translateX(-50%)",width:"3em",height:"3em",align:"center",justify:"center",contentEditable:!1,sx:{...o},className:(0,M.cx)(S.HTML_SHAPE_FILL_CLASS,S.SHAPE_TEXT_OVER_FILL_CLASS),style:{borderRadius:"100%"},...r,children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:n,number:e.numbered?i+1:void 0,isNumbered:e.numbered,iconSize:1.2000000000000002,selectCell:a})})})});tq.displayName="TopCircle";let tY=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,index:n}=e,{colorVars:a}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:n,forceTransparent:!1});return(0,m.jsxs)(tF,{cellProps:e,cellStyle:"outline",gridStyle:"flex_grid",dragHandle:e.dragHandle,cellContentPropOverrides:{pos:"relative",mt:"1.5em",pt:"calc(1em + 1.5em)",style:{borderTopWidth:"0px",borderTopLeftRadius:"calc(var(--line-thickness) * 4)",borderTopRightRadius:"calc(var(--line-thickness) * 4)"}},children:[(0,m.jsx)(f.Flex,{position:"absolute",top:"calc(var(--line-thickness) * -1)",left:"calc(var(--line-thickness) * -1)",right:"calc(var(--line-thickness) * -1)",height:"calc(var(--line-thickness) * 4)",className:S.HTML_SHAPE_FILL_CLASS,borderTopRadius:"var(--box-border-radius)",sx:a,contentEditable:!1}),(0,m.jsx)(tq,{...e}),e.children]})});tY.displayName="OutlineBoxesWithTopCircleCell";let tX=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,gridStyle:"flex_grid",cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));tX.displayName="ProcessStepsWrapper";let tQ=(0,v.memo)(e=>(0,m.jsx)(tF,{cellProps:e,cellStyle:"processStep",gridStyle:"flex_grid",dragHandle:e.dragHandle,children:e.children}));tQ.displayName="ProcessStepsCell";let tJ=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small",gridStyle:"flex_grid"}));tJ.displayName="SpeechBubblesWrapper";let t0=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,index:n,selectCellForElementProps:a,children:r}=e;return(0,m.jsx)(tF,{cellProps:e,gridStyle:"flex_grid",dragHandle:e.dragHandle,cellStyle:"speechBubble",children:r})});t0.displayName="SpeechBubblesCell";let t1=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,gridStyle:"flex_grid",cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));t1.displayName="SolidBoxesWrapper";let t2=(0,v.memo)(e=>{let{colorVars:t}=(0,_.useCellColor)({layoutColorOverride:e.layoutOptions.color,cellColorOverride:e.cellOptions?.color,index:e.index});return(0,m.jsx)(tF,{cellProps:e,gridStyle:"flex_grid",cellStyle:"solid",dragHandle:e.dragHandle,cellContentPropOverrides:{sx:t},children:e.children})});t2.displayName="SolidBoxesCell";let t3=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,gridStyle:"flex_grid",cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));t3.displayName="SolidBoxesWithIconsInsideWrapper";let t5=(0,v.memo)(e=>(0,m.jsx)(tF,{cellProps:e,gridStyle:"flex_grid",cellStyle:"solid",dragHandle:e.dragHandle,markerConfig:{markerType:"iconCircle",markerFontSize:null,markerPosition:"top"},children:e.children}));t5.displayName="SolidBoxesWithIconsInsideCell";let t4=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"none",gridStyle:"flex_grid",wrapperStyle:"solid"}));t4.displayName="SolidJoinedBoxesWrapper";let t6=(0,v.memo)(e=>{let{index:t,layoutOptions:i,numCells:n,layoutContainerSize:a,cellOptions:r,children:o}=e,{columns:s}=tf({cellSize:i.cellSize||0,horizontalAlign:i.horizontalAlign||"center",orientation:i.orientation||"horizontal",numCells:n,containerSize:a,forceBalance:!1}),{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:r?.color,index:t,forceTransparent:!1,optOutOfPalette:!0}),{colorVars:d}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:r?.color,index:t,forceTransparent:!1}),c=0===t,u=t%s==0,p=t>=s,h=t===s-1,f=t===Math.floor((n-1)/s)*s,b=t===n-1;return(0,m.jsxs)(tF,{cellProps:e,gridStyle:"flex_grid",dragHandle:e.dragHandle,cellContentPropOverrides:{p:"1em",css:{...l},borderStartStartRadius:c?"var(--box-border-radius)":"0",borderEndStartRadius:f?"var(--box-border-radius)":"0",borderStartEndRadius:h?"var(--box-border-radius)":"0",borderEndEndRadius:b?"var(--box-border-radius)":"0",backgroundColor:"var(--shape-bg-color-override, var(--shape-bg-color-alpha))"},children:[!c&&!u&&(0,m.jsx)(g.Box,{position:"absolute",top:"0",contentEditable:!1,zIndex:0,height:"100%",width:"var(--line-thickness)",insetStart:"0",className:S.LINE_CLASS,css:d}),p&&(0,m.jsx)(g.Box,{position:"absolute",top:"0",contentEditable:!1,zIndex:0,width:"100%",height:"var(--line-thickness)",insetStart:"0",className:S.LINE_CLASS,css:d}),o]})});t6.displayName="SolidJoinedBoxesCell";let t9=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"none",wrapperStyle:"solid",gridStyle:"flex_grid"}));t9.displayName="SolidJoinedBoxesWrapper";let t8=(0,eT.scaleWithFontScale)("1em"),t7=(0,eT.scaleWithFontScale)("2.5em"),ie=(0,v.memo)(e=>{let t,i,{direction:n,index:a,layoutOptions:r,numCells:o,layoutContainerSize:s,cellOptions:l,children:d,image:c,selectCell:u}=e,{columns:p,isHorizontal:h}=tf({cellSize:r.cellSize||0,horizontalAlign:r.horizontalAlign||"center",orientation:r.orientation||"horizontal",numCells:o,containerSize:s,forceBalance:!1}),{colorVars:b}=(0,_.useCellColor)({layoutColorOverride:r.color,cellColorOverride:l?.color,index:a,forceTransparent:!1,optOutOfPalette:!0}),{colorVars:x}=(0,_.useCellColor)({layoutColorOverride:r.color,cellColorOverride:l?.color,index:a,forceTransparent:!1}),y="rtl"===n?a===p-1:0===a,v="rtl"===n?(a+1)%p==0:a%p==0,C="rtl"===n?a%p==0:(a+1)%p==0||a===o-1,w=a>=p,k=h?v?`${t8} ${t7} ${t8} ${t8}`:C?`${t8} ${t8} ${t8} ${t7}`:`${t8} ${t7} ${t8} ${t7}`:0===a?`${t8} ${t8} ${t7} ${t8}`:a===o-1?`${t7} ${t8} ${t8} ${t8}`:`${t7} ${t8} ${t7} ${t8}`,A=(t="rtl"===n?a===o-1:a===Math.floor((o-1)/p)*p,i="rtl"===n?a===Math.floor((o-1)/p)*p:a===o-1,{borderStartStartRadius:("rtl"===n?a===p-1:0===a)?"var(--box-border-radius)":"0",borderEndStartRadius:t?"var(--box-border-radius)":"0",borderStartEndRadius:("rtl"===n?0===a:a===p-1)?"var(--box-border-radius)":"0",borderEndEndRadius:i?"var(--box-border-radius)":"0"});return(0,m.jsxs)(tF,{cellProps:e,gridStyle:"flex_grid",dragHandle:e.dragHandle,cellContentPropOverrides:{p:k,css:{...b},...A,backgroundColor:"var(--shape-bg-color-override, var(--shape-bg-color-alpha))"},children:[!y&&!v&&h&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(g.Box,{position:"absolute",top:"0",contentEditable:!1,zIndex:0,height:"100%",width:"var(--line-thickness)",left:"0",className:S.LINE_CLASS,css:x}),(0,m.jsx)(f.Flex,{position:"absolute",top:"50%",left:"calc(-1.25em)",transform:"translateY(-50%)",width:"2.5em",height:"2.5em",align:"center",justify:"center",contentEditable:!1,zIndex:1,sx:x,borderRadius:"50%",className:(0,M.cx)(S.HTML_SHAPE_OUTLINE_CLASS,S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:c,number:r.numbered?a+1:void 0,isNumbered:r.numbered,iconSize:1.25,selectCell:u})})})]}),w&&(0,m.jsx)(g.Box,{position:"absolute",top:"0",contentEditable:!1,zIndex:0,width:"100%",height:"var(--line-thickness)",left:"0",className:S.LINE_CLASS,css:x,children:!h&&(0,m.jsx)(f.Flex,{position:"absolute",top:"50%",left:"calc(50% - 1.25em)",transform:"translateY(-50%)",width:"2.5em",height:"2.5em",align:"center",justify:"center",contentEditable:!1,zIndex:1,sx:x,borderRadius:"50%",className:(0,M.cx)(S.HTML_SHAPE_OUTLINE_CLASS,S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:c,number:r.numbered?a+1:void 0,isNumbered:r.numbered,iconSize:1.25,selectCell:u})})})}),d]})});ie.displayName="SolidJoinedBoxesCell";let it=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,gridStyle:"flex_grid",cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));it.displayName="SolidLeafBoxesWrapper";let ii=(0,v.memo)(e=>{let{colorVars:t}=(0,_.useCellColor)({layoutColorOverride:e.layoutOptions.color,cellColorOverride:e.cellOptions?.color,index:e.index});return(0,m.jsx)(tF,{cellProps:e,gridStyle:"flex_grid",cellStyle:"solid",dragHandle:e.dragHandle,cellContentPropOverrides:{sx:t,style:{borderRadius:"2em 0 2em 0"}},children:e.children})});ii.displayName="SolidLeafBoxesCell",(0,v.memo)(({cellProps:e,isHorizontal:t})=>{let{layoutOptions:i,cellOptions:n,index:a,selectCell:r,selectCellForElementProps:o}=e,s=n?.icon,{colorVars:l}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:a});return(0,m.jsx)(f.Flex,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...l},style:t?{borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopRightRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderTopWidth:"0px",borderLeftWidth:"0px",borderRightWidth:"0px"}:{borderTopRightRadius:"0px",borderBottomRightRadius:"0px",borderTopLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderBottomLeftRadius:"calc(var(--box-border-radius) - var(--line-thickness))",borderTopWidth:"0px",borderLeftWidth:"0px",borderBottomWidth:"0px"},...t?{width:"100%",height:"3em"}:{width:"4em",height:"100%",minHeight:"4em"},className:(0,M.cx)(S.HTML_SHAPE_BACKGROUND_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),...o,children:(0,m.jsx)(f.Flex,{fontSize:"1.5em",alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:s,number:i.numbered?a+1:void 0,isNumbered:i.numbered,iconSize:1,selectCell:r})})})}).displayName="OutlineBoxesWithLabelLabel";let ia=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small",gridStyle:"balanced_grid"}));ia.displayName="OutlineBoxesWithLabelWrapper";let ir=(0,v.memo)(e=>(0,m.jsx)(tF,{cellProps:e,dragHandle:e.dragHandle,cellContentPropOverrides:{borderRadius:"var(--box-border-radius)"},innerLabelConfig:{labelType:"flush",labelStyles:{paddingInlineEnd:"1em"}},cellStyle:"outline",children:e.children}));ir.displayName="OutlineBoxesWithLabelCell";let io=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small",gridStyle:"steps"}));io.displayName="StepsWrapper";let is=(0,v.memo)(e=>(0,m.jsx)(tF,{cellProps:e,gridStyle:"steps",dragHandle:e.dragHandle,cellContentPropOverrides:{borderRadius:"var(--box-border-radius)"},innerLabelConfig:{labelType:"simpleLineFlush"},cellStyle:"outline",children:e.children}));is.displayName="StepsCell";var il=e.i(66657),id=e.i(859621),ic=e.i(233924);let[iu,ip]=(0,ic.createContext)({name:"EditableStylesContext",errorMessage:"useEditableStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),[ih,im]=(0,ic.createContext)({name:"EditableContext",errorMessage:"useEditableContext: context is undefined. Seems you forgot to wrap the editable components in ``"});var ig=e.i(836241),ib=e.i(403379),ix=e.i(53294),iy=e.i(751482),iv=e.i(441224),iC=e.i(897325),iw=e.i(988082),iS=e.i(455902);function ik(e,t){return!!e&&(e===t||e.contains(t))}var iA=e.i(216912),iE=e.i(244180),i_=e.i(358003);let iI=(0,iA.forwardRef)(function(e,t){let i=(0,iE.useMultiStyleConfig)("Editable",e),{htmlProps:n,...a}=function(e={}){let{onChange:t,onCancel:i,onSubmit:n,onBlur:a,value:r,isDisabled:o,defaultValue:s,startWithEditView:l,isPreviewFocusable:d=!0,submitOnBlur:c=!0,selectAllOnFocus:u=!0,placeholder:p,onEdit:h,finalFocusRef:m,...g}=e,f=(0,ig.useCallbackRef)(h),b=!!(l&&!o),[x,y]=(0,v.useState)(b),[C,w]=(0,ib.useControllableState)({defaultValue:s||"",value:r,onChange:t}),[S,k]=(0,v.useState)(C),A=(0,v.useRef)(null),E=(0,v.useRef)(null),_=(0,v.useRef)(null),I=(0,v.useRef)(null),M=(0,v.useRef)(null);(0,ix.useFocusOnPointerDown)({ref:A,enabled:x,elements:[I,M]});let T=!x&&!o;(0,iy.useSafeLayoutEffect)(()=>{x&&(A.current?.focus(),u&&A.current?.select())},[]),(0,iv.useUpdateEffect)(()=>{x?(A.current?.focus(),u&&A.current?.select(),f?.()):m?m.current?.focus():_.current?.focus()},[x,f,u]);let L=(0,v.useCallback)(()=>{T&&y(!0)},[T]),j=(0,v.useCallback)(()=>{k(C)},[C]),P=(0,v.useCallback)(()=>{y(!1),w(S),i?.(S),a?.(S)},[i,a,w,S]),D=(0,v.useCallback)(()=>{y(!1),k(C),n?.(C),a?.(S)},[C,n,a,S]);(0,v.useEffect)(()=>{if(x)return;let e=A.current;e?.ownerDocument.activeElement===e&&e?.blur()},[x]);let N=(0,v.useCallback)(e=>{w(e.currentTarget.value)},[w]),R=(0,v.useCallback)(e=>{let t={Escape:P,Enter:e=>{e.shiftKey||e.metaKey||D()}}[e.key];t&&(e.preventDefault(),t(e))},[P,D]),O=(0,v.useCallback)(e=>{let t={Escape:P}[e.key];t&&(e.preventDefault(),t(e))},[P]),B=0===C.length,z=(0,v.useCallback)(e=>{if(!x)return;let t=e.currentTarget.ownerDocument,i=e.relatedTarget??t.activeElement,n=ik(I.current,i),a=ik(M.current,i);n||a||(c?D():P())},[c,D,P,x]),F=(0,v.useCallback)((e={},t=null)=>{let i=T&&d?0:void 0;return{...e,ref:(0,iC.mergeRefs)(t,E),children:B?p:C,hidden:x,"aria-disabled":(0,iw.ariaAttr)(o),tabIndex:i,onFocus:(0,iS.callAllHandlers)(e.onFocus,L,j)}},[o,x,T,d,B,L,j,p,C]),H=(0,v.useCallback)((e={},t=null)=>({...e,hidden:!x,placeholder:p,ref:(0,iC.mergeRefs)(t,A),disabled:o,"aria-disabled":(0,iw.ariaAttr)(o),value:C,onBlur:(0,iS.callAllHandlers)(e.onBlur,z),onChange:(0,iS.callAllHandlers)(e.onChange,N),onKeyDown:(0,iS.callAllHandlers)(e.onKeyDown,R),onFocus:(0,iS.callAllHandlers)(e.onFocus,j)}),[o,x,z,N,R,j,p,C]),W=(0,v.useCallback)((e={},t=null)=>({...e,hidden:!x,placeholder:p,ref:(0,iC.mergeRefs)(t,A),disabled:o,"aria-disabled":(0,iw.ariaAttr)(o),value:C,onBlur:(0,iS.callAllHandlers)(e.onBlur,z),onChange:(0,iS.callAllHandlers)(e.onChange,N),onKeyDown:(0,iS.callAllHandlers)(e.onKeyDown,O),onFocus:(0,iS.callAllHandlers)(e.onFocus,j)}),[o,x,z,N,O,j,p,C]),U=(0,v.useCallback)((e={},t=null)=>({"aria-label":"Edit",...e,type:"button",onClick:(0,iS.callAllHandlers)(e.onClick,L),ref:(0,iC.mergeRefs)(t,_),disabled:o}),[L,o]),V=(0,v.useCallback)((e={},t=null)=>({...e,"aria-label":"Submit",ref:(0,iC.mergeRefs)(M,t),type:"button",onClick:(0,iS.callAllHandlers)(e.onClick,D),disabled:o}),[D,o]),G=(0,v.useCallback)((e={},t=null)=>({"aria-label":"Cancel",id:"cancel",...e,ref:(0,iC.mergeRefs)(I,t),type:"button",onClick:(0,iS.callAllHandlers)(e.onClick,P),disabled:o}),[P,o]);return{isEditing:x,isDisabled:o,isValueEmpty:B,value:C,onEdit:L,onCancel:P,onSubmit:D,getPreviewProps:F,getInputProps:H,getTextareaProps:W,getEditButtonProps:U,getSubmitButtonProps:V,getCancelButtonProps:G,htmlProps:g}}((0,il.omitThemingProps)(e)),{isEditing:r,onSubmit:o,onCancel:s,onEdit:l}=a,d=(0,M.cx)("chakra-editable",e.className),c=(0,id.runIfFn)(e.children,{isEditing:r,onSubmit:o,onCancel:s,onEdit:l});return(0,m.jsx)(ih,{value:a,children:(0,m.jsx)(iu,{value:i,children:(0,m.jsx)(i_.chakra.div,{ref:t,...n,className:d,children:c})})})});iI.displayName="Editable";let iM={fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent"},iT=(0,iA.forwardRef)(function(e,t){let{getInputProps:i}=im(),n=ip(),a=i(e,t),r=(0,M.cx)("chakra-editable__input",e.className);return(0,m.jsx)(i_.chakra.input,{...a,__css:{outline:0,...iM,...n.input},className:r})});iT.displayName="EditableInput";let iL=(0,iA.forwardRef)(function(e,t){let{getPreviewProps:i}=im(),n=ip(),a=i(e,t),r=(0,M.cx)("chakra-editable__preview",e.className);return(0,m.jsx)(i_.chakra.span,{...a,__css:{cursor:"text",display:"inline-block",...iM,...n.preview},className:r})});iL.displayName="EditablePreview";let ij=({updateAttributes:e,value:t,placeholder:i,inputProps:n,...a})=>{let r=(0,v.useCallback)(t=>{e&&e({label:""===t?null:t})},[e]),o=(0,B.useAppSelector)(H.selectContentEditable)&&e;return(0,m.jsxs)(iI,{value:t||"",placeholder:i,onChange:r,isDisabled:!o,...a,children:[(0,m.jsx)(iL,{width:"100%",h:"1em",py:0,noOfLines:1,userSelect:o?void 0:"none",lineHeight:1}),(0,m.jsx)(iT,{width:"100%",my:-1,py:1,lineHeight:1,...n})]})};e.s(["VisualGridCell",()=>iP],179015);let iP=(0,v.memo)(({children:e,visual:t,visualPosition:i="top",visualSize:n="100%",visualMaxSize:a,visualBoxProps:r,gap:o="1.25em",alignContent:s,forceBalance:l,cellProps:d,textboxProps:c,cellStyle:u="none",dragHandle:p})=>{let{layoutOptions:h,cellOptions:f,isContentEmpty:b,isLayoutFocused:x,direction:y,index:v}=d,C=(0,eT.scaleWithFontScale)(o),w="left"===i,S=s||(w?"rtl"===y?"right":"left":h.horizontalAlign),{colorVars:k}=(0,_.useCellColor)({layoutColorOverride:h.color,cellColorOverride:f?.color,index:v,forceTransparent:!0});return(0,m.jsxs)(tF,{cellProps:d,cellStyle:u,dragHandle:p,cellContentPropOverrides:{p:0,gap:b&&!x?0:C,display:"flex",flexDirection:w?"right"===S&&"rtl"!==y?"row-reverse":"row":"column",alignItems:w?"flex-start":void 0,justifyContent:"center",h:"100%"},children:[(0,m.jsx)(g.Box,{w:`calc(${n} * var(--media-scale))`,maxW:a,flex:w?1:void 0,...r,children:t}),(0,m.jsx)(g.Box,{minW:w?"6em":"100%",maxW:"100%",flex:w?1.618:1,"data-content-empty":b,css:{...k,...w?(0,A.forceFlexAlignParent)("flex-start"):{}},cursor:"text",...c,children:e})]})});iP.displayName="VisualGridCell";var iD=e.i(296690);let iN={key:"imagePosition",defaultValue:()=>"top",Control:({value:e,updateValue:t,option:i})=>(0,m.jsx)(iD.ToolbarButton,{label:i.name(),onClick:()=>t("top"===e?"left":"top"),isActive:"left"===e,icon:"top"===e?x.faSquareUp:x.faSquareLeft,testId:"smart-layout-orientation-option"}),ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:"top"===e?x.faSquareUp:x.faSquareLeft,items:[{key:"top",label:y.i18n._({id:"WWy8TN",message:"Top"}),icon:"top"===e?x.faCheck:void 0,onClick:()=>t("top")},{key:"left",label:y.i18n._({id:"lg7+vk",message:"Side"}),icon:"left"===e?x.faCheck:void 0,onClick:()=>t("left")}]}),name:()=>y.i18n._({id:"BWUDJY",message:"Sideways layout"})},iR=[{label:()=>y.i18n._({id:"yrC1Cd",message:"Extra Small"}),key:"xs"},{label:()=>y.i18n._({id:"4Revpc",message:"Small"}),key:"sm"},{label:()=>y.i18n._({id:"agPptk",message:"Medium"}),key:"md"},{label:()=>y.i18n._({id:"k7rCa/",message:"Large"}),key:"lg"},{label:()=>y.i18n._({id:"vp6Yr4",message:"Extra Large"}),key:"xl"},{label:()=>y.i18n._({id:"CK1KXz",message:"Max"}),key:"full"}],iO={key:"shapeSize",defaultValue:()=>null,Control:({value:e,updateValue:t,option:i})=>{let n=iR.findIndex(t=>t.key===e);-1===n&&(n=3);let{label:a}=iR[n],r=(0,v.useCallback)(e=>{let{key:i}=iR[e];t(i)},[t]);return(0,m.jsxs)(tt.HStack,{spacing:2,me:2,children:[(0,m.jsx)(N.GammaTooltip,{placement:"top",label:(0,m.jsxs)(ta.VStack,{spacing:0,children:[(0,m.jsx)(tn.Text,{color:"gray.400",children:i.name()}),(0,m.jsx)(tn.Text,{children:a()})]}),children:(0,m.jsx)(tn.Text,{fontSize:"sm",fontWeight:"600",children:(0,m.jsx)(D.FontAwesomeIcon,{icon:i.icon,fixedWidth:!0})})}),(0,m.jsxs)(ti.Slider,{min:0,max:iR.length-1,step:1,value:n,onChange:r,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,m.jsx)(ti.SliderTrack,{children:(0,m.jsx)(ti.SliderFilledTrack,{})}),(0,m.jsx)(N.GammaTooltip,{placement:"top",label:(0,m.jsxs)(ta.VStack,{spacing:0,children:[(0,m.jsx)(tn.Text,{color:"gray.400",children:i.name()}),(0,m.jsx)(tn.Text,{children:a()})]}),children:(0,m.jsx)(ti.SliderThumb,{background:"trueblue.500"})})]})]})},ControlMenu:(e,t,i)=>({key:i.key,label:i.name(),icon:x.faArrowUpBigSmall,items:iR.map(i=>({key:i.key,label:i.label(),icon:i.key===e?x.faCheck:void 0,onClick:()=>t(i.key)}))}),name:()=>y.i18n._({id:"FeDgKA",message:"Shape size"}),icon:x.faArrowUpBigSmall,validator:e=>null===e||iR.some(t=>t.key===e)},iB=({label:e,basis:t=100})=>{let i=iW(e);return i?(0,tc.default)(i/t,0,1):0},iz=/[0-9,.]+/g,iF=/[,.](?=\d{3})/g,iH=/([0-9]+)\s?\/\s?([0-9]+)/g,iW=e=>{if(e){if("number"==typeof e)return e;try{let t=e.match(iH)?.[0];if(t){let[e,i]=t.split("/").map(e=>e.trim());return 100*parseFloat(e)/parseFloat(i)}let i=e.match(iz)?.[0],n=i?.replaceAll(iF,"");return n?parseFloat(n):void 0}catch(t){console.error(`[SmartLayout] Failed to parse label number: ${e}`,t);return}}};e.s(["getStatsPercent",0,iB,"parseLabelNumber",0,iW],408553);let iU=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));iU.displayName="CircleStatsWrapper";let iV={xs:.35,sm:.48,md:.61,lg:.74,xl:.87,full:1},iG=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=iB(e),c=eZ({innerRadius:41,outerRadius:50}),u=c({startAngle:0,endAngle:2*d*Math.PI}),p=c({startAngle:0,endAngle:2*Math.PI}),h=iV[i.shapeSize]||1,b=`min(100%, ${15*h}em)`,x=(0,K.useShouldRenderMobileVersion)()||"left"===i.imagePosition?`${2*h}em`:`${2.5*h}em`,{colorOverride:y}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:v}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:C}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:w,shouldRecolorTrack:E}=i$(l,y),I=(0,m.jsxs)(f.Flex,{direction:"column",align:"center",justify:"center",width:"100%",maxW:b,pos:"relative",contentEditable:!1,py:"0.25em",...s,children:[(0,m.jsx)(ij,{value:a||"",updateAttributes:r,pos:"absolute",insetStart:"9%",className:(0,M.cx)(T.HEADING_CLASS),fontSize:x,lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)("center"),style:{width:`${82}%`},cursor:"text"}),(0,m.jsxs)("svg",{width:"100%",viewBox:"-50 -50 100 100",overflow:"visible",onClick:e=>{s.onClick(e)},cursor:s.cursor,children:[(0,m.jsx)(g.Box,{as:"path",d:p||void 0,className:S.SVG_SHAPE_BACKGROUND_CLASS,style:{fill:w?"var(--card-color)":void 0},"data-testid":"stats-track",css:E?v:void 0,...s}),(0,m.jsx)(g.Box,{as:"path",d:u||void 0,className:S.SVG_SHAPE_FILL_CLASS,"data-testid":"stats-fill",css:C,...s})]})]});return(0,m.jsx)(iP,{visual:I,visualPosition:i.imagePosition,visualSize:`${100*h}%`,visualMaxSize:b,visualBoxProps:"left"===i.imagePosition?{flex:"var(--media-scale)"}:void 0,gap:"1em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});iG.displayName="CircleStatsCell";let i$=(e,t)=>{let i="default"!==e.shapeColorScheme;return{useTransparentTrack:"none"===e.shapeFill||"solid"===e.shapeFill&&"custom"===e.shapeColorScheme||t&&i,shouldRecolorTrack:i}},iZ=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));iZ.displayName="BarStatsWrapper";let iK=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=i.horizontalAlign,c=iB(e),{colorOverride:u}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:p}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:h}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:b,shouldRecolorTrack:x}=i$(l,u),y=(0,m.jsxs)(f.Flex,{direction:"row",align:"center",justify:"stretch",width:"100%",pos:"relative",contentEditable:!1,gap:"0.75em",...s,children:[(0,m.jsxs)(g.Box,{flex:"1",my:"0.5em",pos:"relative",borderRadius:"var(--box-border-radius)",...s,children:[(0,m.jsx)(g.Box,{pos:"absolute",inset:"0",className:S.HTML_SHAPE_BACKGROUND_CLASS,style:b?{background:"var(--card-color)"}:void 0,css:x?p:void 0,...s}),(0,m.jsx)(g.Box,{w:`${100*c}%`,h:"1.25em",pos:"relative",className:S.HTML_SHAPE_FILL_CLASS,borderRadius:"inherit",css:h,...s})]}),(0,m.jsx)(ij,{value:a||"",updateAttributes:r,className:(0,M.cx)(T.HEADING_CLASS),lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)(d),fontSize:"1.25em",inputProps:{textAlign:"right",width:"4em",py:0},minW:"1em"})]});return(0,m.jsx)(iP,{visual:y,visualPosition:"top",gap:"0.75em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});iK.displayName="BarStatsCell";let iq=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));iq.displayName="CircleWithBoldLineStatsWrapper";let iY={xs:.35,sm:.48,md:.61,lg:.74,xl:.87,full:1},iX=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=iB(e),c=9,u=eZ({innerRadius:41,outerRadius:50})({startAngle:0,endAngle:2*d*Math.PI}),p=eZ({innerRadius:44.55,outerRadius:45})({startAngle:0,endAngle:2*Math.PI}),h=iY[i.shapeSize]||1,b=`min(100%, ${15*h}em)`,x=(0,K.useShouldRenderMobileVersion)()||"left"===i.imagePosition?`${2*h}em`:`${2.5*h}em`,{colorOverride:y}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:v}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:C}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:w,shouldRecolorTrack:E}=iQ(l,y),I=(0,m.jsxs)(f.Flex,{direction:"column",align:"center",justify:"center",width:"100%",maxW:b,pos:"relative",contentEditable:!1,py:"0.25em",...s,children:[(0,m.jsx)(ij,{value:a||"",updateAttributes:r,pos:"absolute",insetStart:`${c}%`,className:(0,M.cx)(T.HEADING_CLASS),fontSize:x,lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)("center"),style:{width:`${100-2*c}%`},cursor:"text"}),(0,m.jsxs)("svg",{width:"100%",viewBox:"-50 -50 100 100",overflow:"visible",onClick:e=>{s.onClick(e)},cursor:s.cursor,children:[(0,m.jsx)(g.Box,{as:"path",d:p||void 0,className:S.SVG_SHAPE_OUTLINE_CLASS,style:{fill:w?"var(--card-color)":void 0},"data-testid":"stats-track",css:{...E?v:void 0,"--shape-border-width":"0.125em"},...s}),(0,m.jsx)(g.Box,{as:"path",d:u||void 0,className:S.SVG_SHAPE_FILL_CLASS,"data-testid":"stats-fill",css:C,...s})]})]});return(0,m.jsx)(iP,{visual:I,visualPosition:i.imagePosition,visualSize:`${100*h}%`,visualMaxSize:b,visualBoxProps:"left"===i.imagePosition?{flex:"var(--media-scale)"}:void 0,gap:"1em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});iX.displayName="CircleWithBoldLineStatsCell";let iQ=(e,t)=>{let i="default"!==e.shapeColorScheme;return{useTransparentTrack:"none"===e.shapeFill||"solid"===e.shapeFill&&"custom"===e.shapeColorScheme||t&&i,shouldRecolorTrack:i}},iJ=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));iJ.displayName="CircleWithExternalBoldLineStatsWrapper";let i0={xs:.35,sm:.48,md:.61,lg:.74,xl:.87,full:1},i1=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=iB(e),c=9,u=eZ({innerRadius:41,outerRadius:50})({startAngle:0,endAngle:2*d*Math.PI}),p=eZ({innerRadius:34.65,outerRadius:35})({startAngle:0,endAngle:2*Math.PI}),h=i0[i.shapeSize]||1,b=`min(100%, ${15*h}em)`,x=(0,K.useShouldRenderMobileVersion)()||"left"===i.imagePosition?`${2*h}em`:`${2.5*h}em`,{colorOverride:y}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:v}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:C}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:w,shouldRecolorTrack:E}=i2(l,y),I=(0,m.jsxs)(f.Flex,{direction:"column",align:"center",justify:"center",width:"100%",maxW:b,pos:"relative",contentEditable:!1,py:"0.25em",...s,children:[(0,m.jsx)(ij,{value:a||"",updateAttributes:r,pos:"absolute",insetStart:`${c}%`,className:(0,M.cx)(T.HEADING_CLASS),fontSize:x,lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)("center"),style:{width:`${100-2*c}%`},cursor:"text"}),(0,m.jsxs)("svg",{width:"100%",viewBox:"-50 -50 100 100",overflow:"visible",onClick:e=>{s.onClick(e)},cursor:s.cursor,children:[(0,m.jsx)(g.Box,{as:"path",d:p||void 0,className:S.SVG_SHAPE_OUTLINE_CLASS,style:{fill:w?"var(--card-color)":void 0},"data-testid":"stats-track",css:{...E?v:void 0,"--shape-border-width":"0.125em"},...s}),(0,m.jsx)(g.Box,{as:"path",d:u||void 0,className:S.SVG_SHAPE_FILL_CLASS,"data-testid":"stats-fill",css:C,...s})]})]});return(0,m.jsx)(iP,{visual:I,visualPosition:i.imagePosition,visualSize:`${100*h}%`,visualMaxSize:b,visualBoxProps:"left"===i.imagePosition?{flex:"var(--media-scale)"}:void 0,gap:"1em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});i1.displayName="CircleWithExternalBoldLineStatsCell";let i2=(e,t)=>{let i="default"!==e.shapeColorScheme;return{useTransparentTrack:"none"===e.shapeFill||"solid"===e.shapeFill&&"custom"===e.shapeColorScheme||t&&i,shouldRecolorTrack:i}},i3=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));i3.displayName="DotGridStatsWrapper";let i5=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=i.horizontalAlign,c=iB(e),{colorOverride:u}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:p}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:h}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:x,shouldRecolorTrack:y}=i$(l,u),v=Math.round(100*c),C=Array.from({length:100},(e,t)=>{let i=Math.floor(t/10),n=t%10,a=Math.floor(v/10),r=i>=10-a||i===10-a-1&&n(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));i4.displayName="DotLineStatsWrapper";let i6=(0,v.memo)(e=>{let{theme:t,layoutOptions:i,cellOptions:n,label:a,updateAttributes:r,index:o,selectCellForElementProps:s}=e,l=(0,k.getThemeKnobsV3)(t),d=i.horizontalAlign,c=iB(e),{colorOverride:u}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!0}),{colorVars:p}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o}),{colorVars:h}=(0,_.useCellColor)({layoutColorOverride:i.color,cellColorOverride:n?.color,index:o,forceTransparent:!1}),{useTransparentTrack:x,shouldRecolorTrack:y}=i$(l,u),v=Math.round(5*c),C=Array.from({length:5},(e,t)=>{let i=t(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));i9.displayName="PlainStatsWrapper";let i8={xs:2,sm:2.65,md:3.3,lg:3.95,xl:4.6,full:5.25},i7=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,label:n,updateAttributes:a,index:r}=e,{headingColorCss:o}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:r,forceTransparent:!0}),s=t.horizontalAlign,l=i8[t.shapeSize||"md"],d=(0,K.useShouldRenderMobileVersion)(),c=(0,m.jsx)(f.Flex,{direction:"column",align:"center",justify:"center",width:"100%",pos:"relative",contentEditable:!1,py:"0.5em",css:o,fontSize:d?"0.75em":"1em",children:(0,m.jsx)(ij,{value:n||"",updateAttributes:a,className:(0,M.cx)(T.HEADING_CLASS),fontSize:`${l}em`,lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)(s||"center"),style:{width:"100%"},placeholder:"—",cursor:"text"})});return(0,m.jsx)(iP,{visual:c,visualPosition:"top",gap:"0.75em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});i7.displayName="PlainStatsCell";var ne=e.i(575084);let nt=(0,v.memo)(({fillAmount:e,trackColorVars:t,fillColorVars:i,size:n})=>e<.01?(0,m.jsx)(g.Box,{sx:{...t,path:{fill:"inherit"}},children:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faStar,fontSize:n,style:{strokeWidth:"1em"},className:S.SVG_SHAPE_OUTLINE_CLASS})}):e>.99?(0,m.jsx)(g.Box,{sx:{...i,path:{fill:"inherit"}},children:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faStar,fontSize:n,className:S.SVG_SHAPE_FILL_CLASS})}):(0,m.jsxs)(g.Box,{position:"relative",sx:{...t,path:{fill:"inherit"}},children:[(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faStar,className:S.SVG_SHAPE_OUTLINE_CLASS,style:{strokeWidth:"1em"},fontSize:n}),(0,m.jsx)(g.Box,{position:"absolute",top:"0",insetStart:"0",width:`${100*e}%`,height:"100%",overflow:"hidden",sx:{...i,path:{fill:"inherit"}},children:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faStar,className:S.SVG_SHAPE_FILL_CLASS,fontSize:n})})]}));nt.displayName="StarIcon";let ni=(0,v.memo)(({rating:e,trackColorVars:t,fillColorVars:i,size:n})=>{let a=[];for(let r=1;r<=5;r++){let o=(0,tc.default)(e-r+1,0,1);a.push((0,m.jsx)(g.Box,{children:(0,m.jsx)(nt,{size:n,fillAmount:o,trackColorVars:t,fillColorVars:i},r)}))}return(0,m.jsx)(f.Flex,{gap:"0.25em",align:"center",children:a})});ni.displayName="StarRating";let nn=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"medium"}));nn.displayName="StarStatsWrapper";let na=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,label:n,updateAttributes:a,index:r,selectCellForElementProps:o}=e,s=t.horizontalAlign,l=iB({label:n,basis:5}),{colorVars:d}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:r}),{colorVars:c}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:r,forceTransparent:!1}),u=(0,m.jsx)(f.Flex,{width:"100%",justify:"center"===s?"center":"right"===s?"flex-end":"flex-start",children:(0,m.jsxs)(f.Flex,{direction:"row",align:"center",justify:"stretch",pos:"relative",contentEditable:!1,gap:"0.75em",...o,children:[(0,m.jsx)(g.Box,{display:"flex",alignItems:"center",justifyContent:"flex-start",...o,children:(0,m.jsx)(ni,{rating:100*l/100*5,size:10===t.cellSize?"1.25em":"1.5em",trackColorVars:d,fillColorVars:c})}),(0,m.jsx)(ij,{value:n||"",updateAttributes:a,className:(0,M.cx)(T.HEADING_CLASS),lineHeight:1,display:"flex",alignItems:"center",sx:(0,A.getAlignStyles)(s),fontSize:"1.25em",inputProps:{textAlign:"left",width:"2em",py:0},minW:"1em"})]})});return(0,m.jsx)(iP,{visual:u,visualPosition:"top",gap:"0.75em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});na.displayName="StarStatsCell";let nr=(e,t,i,n,a)=>({top:i,left:n,orientation:a}),no=(e,t)=>!(e.rect.bottom<=t.rect.top||t.rect.bottom<=e.rect.top)&&(e.rect.right<=t.rect.left+5&&e.rect.right>=t.rect.left-50||t.rect.right<=e.rect.left+5&&t.rect.right>=e.rect.left-50),ns=(e,t)=>!(e.rect.right<=t.rect.left||t.rect.right<=e.rect.left)&&(e.rect.bottom<=t.rect.top+5&&e.rect.bottom>=t.rect.top-50||t.rect.bottom<=e.rect.top+5&&t.rect.bottom>=e.rect.top-50),nl=(0,v.memo)(({top:e,left:t,orientation:i})=>{let n="horizontal"===i?{width:"1em",height:"2em","-webkit-mask":`radial-gradient(circle 0.5em at 50% 0%,transparent 99%,#000), radial-gradient(circle 0.5em at 50% 100%,transparent 99%,#000)`,"-webkit-mask-composite":"destination-in",maskComposite:"destination-in"}:{width:"2em",height:"1em","-webkit-mask":`radial-gradient(circle 0.5em at 0 50%,transparent 99%,#000), radial-gradient(circle 0.5em at 100% 50%,transparent 99%,#000)`,"-webkit-mask-composite":"destination-in",maskComposite:"destination-in"};return(0,m.jsx)(g.Box,{contentEditable:!1,position:"absolute",top:`${e}px`,insetStart:`${t}px`,backgroundColor:"var(--shape-border-color)",pointerEvents:"none",zIndex:1,transform:"translate(-50%, -50%)",sx:n})});nl.displayName="CellConnector";let nd=(0,v.memo)(e=>{let[t,i]=(0,v.useState)([]),{ref:n,width:a,height:r}=(0,eU.useElementSize)(),o=(0,v.useCallback)(()=>{if(!n.current)return;let e=n.current,t=e.querySelectorAll("[data-cell-index]"),a=[];t.forEach((t,i)=>{let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),o={left:n.left-r.left,top:n.top-r.top,right:n.right-r.left,bottom:n.bottom-r.top,width:n.width,height:n.height};a.push({rect:o,index:i,el:t})});let r=[];for(let e=0;e0){let a=i.rect.left0){let a=i.rect.top{a&&r&&o()},[a,r,o,e.numCells]),(0,m.jsxs)(g.Box,{position:"relative",ref:n,children:[(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}),t.map((e,t)=>(0,m.jsx)(nl,{...e},`${e.orientation}-${e.top}-${e.left}-${t}`))]})});nd.displayName="ConnectedBoxesWrapper";let nc=(0,v.memo)(e=>(0,m.jsx)(tF,{cellProps:e,cellStyle:"solid","data-cell-index":e.index,dragHandle:e.dragHandle,children:e.children}));nc.displayName="ConnectedBoxesCell";let nu=({selectCell:e,isFocused:t})=>{let i=(0,F.useToggleMediaDrawer)();return{handleClick:(0,v.useCallback)(()=>{t?i({isOpen:!0}):e?.()},[e,i,t]),handleDoubleClick:(0,v.useCallback)(()=>{e?.(),i({isOpen:!0})},[e,i])}},np={xs:.3,sm:.44,md:.58,lg:.72,xl:.86,full:1},nh=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign}));nh.displayName="ImagesWithTextWrapper";let nm=(0,v.memo)(e=>{let{image:t,layoutOptions:i,numCells:n,layoutContainerSize:a,isFocused:r,selectCell:o,...s}=e,l=i.imageShape??"square",d=q.ImageShapeStyles[l]||q.ImageShapeStyles.landscape,c=t?.meta?.has_transparency,u=!i.shapeSize&&i.imageSize?i.imageSize:np[i.shapeSize||"full"],p="left"===i.imagePosition,{columns:h}=tf({cellSize:i.cellSize||0,horizontalAlign:i.horizontalAlign||"center",orientation:i.orientation||"horizontal",containerSize:a,numCells:n,forceBalance:!1}),f=1===h?`min(100%, ${15*u}em)`:"100%",b=c?{...d}:{...z.ImageSx,...d},{handleClick:x,handleDoubleClick:y}=nu({selectCell:o,isFocused:r}),v=(0,m.jsx)(g.Box,{"data-smart-layout-image-drop-target":"true",className:"image",w:"100%",h:"100%",overflow:"hidden",sx:b,contentEditable:!1,children:(0,m.jsx)(ek,{image:t,imageShape:l,handleEditableClick:x,handleEditableDoubleClick:y,hasQuickActions:!0,...s})});return(0,m.jsx)(iP,{visual:v,visualPosition:i.imagePosition,visualSize:`${100*(p?.5*u:u)}%`,visualMaxSize:f,visualBoxProps:p?{flex:"none",flexShrink:0}:void 0,gap:i.shapeSize<=np.xs?"1em":"1.25em",cellProps:e,dragHandle:e.dragHandle,children:e.children})});nm.displayName="ImagesWithTextCell";let ng=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));ng.displayName="QuoteBoxesWithFacesWrapper";let nf=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,index:n,selectCell:a,isFocused:r,image:o}=e,{colorVars:s}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:n,forceTransparent:!1}),{handleClick:l,handleDoubleClick:d}=nu({selectCell:a,isFocused:r}),c=t.imageShape??"circle",u=q.ImageShapeStyles[c],p=o?.meta?.has_transparency,h=5*(!t.shapeSize&&t.imageSize?t.imageSize:np[t.shapeSize||"md"]),g=h/q.ImageShapeAspectRatios[c],b=p?{...u}:{...z.ImageSx,...u};return(0,m.jsx)(f.Flex,{position:"absolute",top:`-${g}em`,left:"50%",transform:"translateX(-50%)",width:`${2*h}em`,align:"center",justify:"center",contentEditable:!1,sx:{...s,"> div":{width:"100%"}},style:b,className:(0,M.cx)(S.HTML_SHAPE_OUTLINE_CLASS),overflow:"hidden",children:(0,m.jsx)(ek,{...e,imageShape:c,hasQuickActions:!0,handleEditableClick:l,handleEditableDoubleClick:d})})});nf.displayName="FaceCircle";let nb=(0,v.memo)(e=>{let{layoutOptions:t}=e,i=5*(!t.shapeSize&&t.imageSize?t.imageSize:np[t.shapeSize||"md"])/q.ImageShapeAspectRatios[t.imageShape];return(0,m.jsxs)(tF,{cellProps:e,cellStyle:"outline",dragHandle:e.dragHandle,cellContentPropOverrides:{mt:`${i}em`,pt:`calc(1em + ${i}em)`},children:[(0,m.jsx)(nf,{...e}),e.children]})});nb.displayName="QuoteBoxesWithFacesCell";let nx={1:["face-smile"],2:["face-frown","face-smile"],3:["face-frown","face-meh","face-smile"],4:["face-sad-tear","face-frown","face-smile","face-laugh"],5:["face-sad-tear","face-frown","face-meh","face-smile","face-laugh-beam"]},ny=e=>{let{numCells:t,index:i}=e,n=nx[Math.min(5,Math.max(1,t))],a=n[i%n.length],r=e.image&&e.image.src?e.image:{source:"image.icon",src:`https://cdn-staging.gamma.app/_app_static/icons/v0/${a}.svg`};return(0,m.jsx)(tV,{...e,image:r})},nv=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:"small"}));nv.displayName="SolidBoxesWithTopIconsWrapper";let nC=(0,v.memo)(({layoutOptions:e,cellOptions:t,index:i,image:n,selectCell:a,selectCellForElementProps:r})=>{let{colorVars:o}=(0,_.useCellColor)({layoutColorOverride:e.color,cellColorOverride:t?.color,index:i,forceTransparent:!1});return(0,m.jsx)(f.Flex,{position:"absolute",top:"-1.5em",insetStart:"left"===e.horizontalAlign?"1.5em":"right"===e.horizontalAlign?"calc(100% - 4.5em)":"50%",transform:"center"!==e.horizontalAlign&&e.horizontalAlign?void 0:"translateX(-50%)",width:"3em",height:"3em",align:"center",justify:"center",contentEditable:!1,sx:{...o},className:(0,M.cx)(S.HTML_SHAPE_FILL_CLASS,S.SHAPE_TEXT_OVER_FILL_CLASS),borderRadius:"var(--box-border-radius)",...r,children:(0,m.jsx)(f.Flex,{alignItems:"center",justifyContent:"center",className:(0,M.cx)(T.HEADING_CLASS),children:(0,m.jsx)(e_,{image:n,number:e.numbered?i+1:void 0,isNumbered:e.numbered,iconSize:1.5,selectCell:a})})})});nC.displayName="TopIcon";let nw=(0,v.memo)(e=>{let{layoutOptions:t,cellOptions:i,index:n}=e,{colorVars:a}=(0,_.useCellColor)({layoutColorOverride:t.color,cellColorOverride:i?.color,index:n,forceTransparent:!0});return(0,m.jsxs)(tF,{cellProps:e,cellStyle:"solid",dragHandle:e.dragHandle,cellContentPropOverrides:{mt:"1.5em",pt:"calc(1em + 1.5em)",sx:a},children:[(0,m.jsx)(nC,{...e}),e.children]})});nw.displayName="SolidBoxesWithTopIconsCell";var nS=e.i(233365);let nk={xs:.15,sm:.2,md:.25,lg:.3,xl:.35,full:.4},nA={xs:"lg",sm:"h3",md:"h2",lg:"h1",xl:"h1",full:"title"},nE=(0,v.memo)(e=>(0,m.jsx)(tU,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,forceBalanceOverride:!0}));nE.displayName="IconsWithTextWrapper";let n_=(0,v.memo)(e=>{let{image:t,layoutOptions:i,cellOptions:n,selectCell:a,theme:r,firstChildSize:o}=e,s=nk[i.shapeSize||"md"],l="left"===i.imagePosition,d=s<=nk.xs,c=n?.color??i.color;t&&(0,V.isRecolorableSvg)(t);let u=(0,v.useMemo)(()=>(0,nS.getShapeColorCss)(c,0),[c]),p={aspectRatio:"1 / 1",...d&&l&&{mt:".175em"}},h=`min(100%, ${10*s}em)`,f=(0,K.useShouldRenderMobileVersion)(),b=(0,j.matchBulletTextAlignment)(r,f,nA[i.shapeSize||"md"],o,2),x=(0,m.jsx)(g.Box,{"data-smart-layout-image-drop-target":"true",className:"image",w:"100%",h:"100%",sx:p,css:u,contentEditable:!1,children:(0,m.jsx)(e_,{image:t,placeholderIfEmpty:!0,iconSize:5*s,boxProps:{w:"100%",h:"100%"},selectCell:a,isNumbered:i.numbered,color:c??"url(#theme-accent-gradient-linear) var(--accent-color-readable)"})});return(0,m.jsx)(iP,{visual:x,visualPosition:i.imagePosition,visualSize:`${100*s}%`,visualMaxSize:h,gap:d?"1em":"1.25em",cellProps:e,dragHandle:e.dragHandle,textboxProps:{pt:l?`${b}em`:0},forceBalance:!0,children:e.children})});n_.displayName="IconsWithTextCell";let nI="40em",nM="0.25em",nT={key:"outsideText",defaultValue:()=>!0,Control:({value:e,updateValue:t,option:i})=>(0,m.jsx)(iD.ToolbarButton,{label:i.name(),onClick:()=>t(!e),isActive:e,icon:x.faParagraphLeft}),ControlMenu:(e,t,i)=>({key:i.key,label:e?y.i18n._({id:"W0lrhO",message:"Inside text"}):y.i18n._({id:"OtsbQu",message:"Outside text"}),icon:x.faParagraphLeft,onClick:()=>t(!e)}),name:()=>y.i18n._({id:"OtsbQu",message:"Outside text"})};var nL=e.i(521689);let nj=(0,v.memo)(({Step:e=nO,node:t,...i})=>{let{children:n,numCells:a,options:r,theme:o,direction:s}=i,l=r.horizontalAlign||"center",d=(0,A.getAlignStyles)(l,s),c="funnel"===i.variant.key,u="staircase"===i.variant.key,p=(0,nL.default)(a).map(i=>{let n=t.maybeChild(i);if(!n)return null;let d=n.attrs.options,p=n.attrs.image;return(0,m.jsx)(nP,{index:i,numCells:a,theme:o,isFunnel:c,alignment:l,direction:s,isStepped:u,cellOptions:d,layoutOptions:r,Step:e,image:p},i)});return(0,m.jsxs)(f.Flex,{direction:"column","data-selection-ring":!0,align:"stretch",gap:"1em",onContextMenu:i.onContextMenu,...i.selectLayoutForElementProps,children:[(0,m.jsx)(f.Flex,{direction:"column",sx:d,contentEditable:!1,gap:nM,"data-alternate-colors":!0,...i.selectLayoutForElementProps,children:p}),(0,m.jsx)(f.Flex,{gap:eD,direction:"column",...i.selectLayoutForElementProps,children:n})]})});nj.displayName="StackedPyramidWrapper";let nP=({index:e,numCells:t,cellOptions:i,layoutOptions:n,isFunnel:a,alignment:r,direction:o,isStepped:s,Step:l,image:d})=>{let c=!s&&a&&e===t-1?{pos:"relative",bottom:"0.25em"}:s||a||0!==e?{}:{pos:"relative",top:"0.25em"},{colorVars:u}=(0,_.useCellColor)({layoutColorOverride:n.color,cellColorOverride:i?.color,index:e,forceTransparent:!1});return(0,m.jsx)(l,{index:e,numCells:t,isOutside:!0,isNumbered:n.numbered,isStacked:!0,isFunnel:a,alignment:r,direction:o,stepSx:u,image:d,children:(0,m.jsx)(nR,{index:e,image:d,isNumbered:n.numbered,...c})},e)},nD=(0,v.memo)(e=>{let t=eN({containerSize:e.containerSize,columnsNeeded:e.options.outsideText&&!e.scaleContentToFit?3:2}),{colorVars:i}=(0,_.useCellColor)({layoutColorOverride:e.options.color,forceTransparent:!0});return t?(0,m.jsx)(nj,{...e}):(0,m.jsx)(tH.SimpleGrid,{columns:1,autoRows:"1fr","data-selection-ring":!0,gap:nM,onContextMenu:e.onContextMenu,...e.selectLayoutForElementProps,sx:e.options.outsideText?i:void 0,children:e.children})});nD.displayName="PyramidWrapper";let nN=(0,v.memo)(({Step:e=nO,isFunnel:t=!1,isStepped:i=!1,alignment:n="center",...a})=>{let{children:r,layoutOptions:o,index:s,numCells:l,dragHandle:d,direction:c}=a,u=o.outsideText,p=eN({containerSize:a.layoutContainerSize,columnsNeeded:u&&!a.scaleContentToFit?3:2}),{colorVars:h}=(0,_.useCellColor)({layoutColorOverride:o.color,cellColorOverride:a.cellOptions?.color,index:s}),{colorVars:b}=(0,_.useCellColor)({layoutColorOverride:o.color,cellColorOverride:a.cellOptions?.color,index:s,forceTransparent:!0});if(p)return(0,m.jsx)(eR,{...a});let x=o.numbered,y="right"===n?"right":"left"===n||"ltr"===c?"left":"right",v={...(0,A.getAlignStyles)(y,c),...(0,A.getAlignStylesParent)(y,c)},C=i?{bottom:"-1px"}:t?{top:`calc(-1px - ${nM} / 2 )`}:{bottom:`calc(-1px - ${nM} / 2 )`},w=t?0===s:s===l-1,k=i?"0.5em":nM,E=x&&u&&!i,I=E&&t&&s===l-1?{pos:"relative",bottom:"15%"}:E&&!t&&0===s?{pos:"relative",top:"15%"}:{},M="rtl"===c&&"left"===n||"ltr"===c&&"right"===n?"row-reverse":"row";return(0,m.jsxs)(f.Flex,{"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",w:"100%",direction:M,justify:u||"center"!==n?void 0:"center",...a.selectCellForElementProps,children:[(0,m.jsxs)(e,{numCells:l,index:s,isFunnel:t,isOutside:u,isNumbered:x,alignment:n,selectCell:a.selectCell,selectCellForElementProps:a.selectCellForElementProps,stepSx:h,direction:c,image:a.image,children:[u?(0,m.jsx)(nR,{index:s,image:a.image,isNumbered:x,selectCell:a.selectCell,...I}):r,d]}),u&&(0,m.jsxs)(f.Flex,{direction:"column",justify:"center",minW:0,flex:1,px:"1em",py:"1em",pos:"relative",sx:v,className:S.SHAPE_OUTSIDE_TEXT_CLASS,css:b,cursor:"text",children:[r,!w&&(0,m.jsx)(g.Box,{contentEditable:!1,position:"absolute",...C,insetStart:k,insetEnd:k,h:"var(--line-thickness)",transform:"scaleY(0.5)",className:S.LINE_CLASS})]})]})});nN.displayName="PyramidCell";let nR=(0,v.memo)(({index:e,image:t,selectCell:i,isNumbered:n,...a})=>(0,m.jsx)(g.Box,{className:(0,M.cx)(T.HEADING_CLASS,S.SHAPE_TEXT_OVER_BACKGROUND_CLASS),fontSize:"1.25em",display:"flex",sx:(0,A.getAlignStyles)("center"),pos:"relative",contentEditable:!1,...a,children:(0,m.jsx)(e_,{image:t,number:n?e+1:void 0,isNumbered:n,iconSize:1.125,selectCell:i})}));nR.displayName="PyramidLabel";let nO=(0,v.memo)(({numCells:e,index:t,isFunnel:i,isOutside:n,isStacked:a,children:r,alignment:o,selectCellForElementProps:s,stepSx:l,direction:d})=>{let c=i?e-t-1:t,{width:u,height:p,ref:h}=(0,eU.useElementSize)(),g=45*!n,b=n&&!a?50:100,x=nz(e,c,g),y=.99*nz(e,c+1,g),v=b/100*y,C=(0,A.getAlignStyles)(o,d),w=(0,A.getAlignStylesParent)(o,d),k=a?void 0:n?{ms:"center"===o?`${(b-v)/2}%`:void 0}:{maxW:`calc(${nI} * ${v/100})`};return(0,m.jsxs)(f.Flex,{direction:"column",ref:h,"data-testid":"pyramid-step",pos:"relative",w:`${v}%`,sx:{...C,...w,...l},contentEditable:!n&&void 0,...k,children:[(0,m.jsx)(nB,{width:u,height:p,alignment:o,topSize:i?1:x/y,bottomSize:i?x/y:1,selectCellForElementProps:s}),(0,m.jsx)(f.Flex,{direction:"column",justify:"center",h:"100%",p:n?"0.5em":"1em",boxSizing:"border-box",sx:{...C,alignItems:n?C.alignItems:"stretch"},className:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,w:`${(x+y)/2/y*100}%`,minW:"3em",cursor:"text",children:r})]})});nO.displayName="PyramidStep";let nB=(0,v.memo)(({width:e,height:t,topSize:i,bottomSize:n,alignment:a,selectCellForElementProps:r})=>{let o=e*(1-i)/2,s=e*(1-n)/2,l="left"===a?` M 0 0 L ${e-2*o} 0 L ${e-2*s} ${t} L 0 ${t} L 0 0 Z`:"right"===a?` M ${2*o} 0 L ${e} 0 L ${e} ${t} L ${2*s} ${t} L ${2*o} 0 Z`:` M ${o} 0 L ${e-o} 0 L ${e-s} ${t} L ${s} ${t} L ${o} 0 Z`;return(0,m.jsx)(g.Box,{as:"svg",pos:"absolute",inset:"0",overflow:"visible",contentEditable:!1,"data-testid":"trapezoid-svg",w:`${e}px`,h:`${t}px`,...r,children:(0,m.jsx)(g.Box,{as:"path",d:l,className:S.SVG_SHAPE_BACKGROUND_CLASS,...r})})});nB.displayName="TrapezoidSVG";let nz=(e,t,i)=>i+t/e*(100-i),nF={...ez.NumberedOption,checkEnabled:({options:e,node:t})=>{let n=t&&(0,i.findChildren)(t,d.isSmartLayoutCellNode);return e.outsideText&&(n?.every(e=>!e?.node?.attrs?.image||0===Object.keys(e?.node?.attrs?.image).length)||!0===e.numbered)}},nH=()=>({key:"pyramid",name:()=>y.i18n._({id:"MYceoI",message:"Pyramid"}),icon:x.faChartPyramid,options:[nT,nF,eO.ColorOption],cellOptions:[eO.ColorOption,eB.EmphasisOption],presetConfigurations:[{name:()=>y.i18n._({id:"Ud6L0K",message:"Inside text pyramid"}),options:{outsideText:!1}},{name:()=>y.i18n._({id:"q9tXj9",message:"Outside text pyramid"}),options:{numbered:!0,outsideText:!0}}],Wrapper:nD,Cell:nN,addDirection:()=>"bottom",htmlTag:"pyramid",imageSlot:"optional",imageType:"icon",family:"steps"}),nW=(0,v.memo)(e=>(0,m.jsx)(nN,{...e,isFunnel:!0}));nW.displayName="FunnelCell";let nU=(0,v.memo)(e=>{let{children:t,options:i,containerSize:n,onContextMenu:a,selectLayoutForElementProps:r}=e,o=(0,A.getAlignStyles)(i.horizontalAlign||"left"),{colorVars:s}=(0,_.useCellColor)({layoutColorOverride:i.color,isColoringCell:!1});if(eN({containerSize:n,columnsNeeded:e.options.outsideText&&!e.scaleContentToFit?3:2}))return(0,m.jsx)(nj,{...e,Step:nV});let l={...o,...i.outsideText?s:{}};return(0,m.jsx)(f.Flex,{direction:"column","data-selection-ring":!0,gap:"0.5em",sx:l,onContextMenu:a,...r,children:t})});nU.displayName="StaircaseWrapper";let nV=(0,v.memo)(({numCells:e,index:t,isOutside:i,isStacked:n,children:a,alignment:r,direction:o,selectCell:s,stepSx:l})=>{let d={...(0,A.getAlignStyles)(r,o),alignItems:i?"center":"stretch",...l},c=i&&!n?50:100,u=c/100*nz(e,t+1,45*!i),p=n?void 0:i?{ms:"center"===r?`${(c-u)/2}%`:void 0}:{maxW:`calc(${nI} * ${u/100})`};return(0,m.jsx)(f.Flex,{py:i?"0.5em":"1em",px:"1em",sx:d,className:S.HTML_SHAPE_BACKGROUND_CLASS,w:`${u}%`,boxSizing:"border-box",...p,direction:"column",justify:"center",contentEditable:!i&&void 0,onClick:i?s:void 0,pos:"relative",children:a})});nV.displayName="StaircaseStep";let nG=(0,v.memo)(e=>{let t=e.layoutOptions.horizontalAlign;return(0,m.jsx)(nN,{...e,Step:nV,isFunnel:!1,isStepped:!0,alignment:t})});nG.displayName="StaircaseCell";let n$=()=>{let e;return[t$(),tl({key:"smallBullets",name:()=>y.i18n._({id:"XY2IHD",message:"Small bullets"}),icon:x.faListUl,keywords:["small","bullets","layout","list","bullet"],htmlTag:"smallBullets",family:"bullets",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"XY2IHD",message:"Small bullets"}),options:{},zoomIn:!0}],config:{wrapperConfig:{spacing:"medium",gridStyle:"flex_grid"},cellConfig:{cellStyle:"none",marker:{markerType:"smallBullet",markerFontSize:null,markerPosition:"left"}}},isFullWidth:()=>!0,addDirection:()=>"right"}),tl({key:"iconBullets",name:()=>y.i18n._({id:"Xl0g8o",message:"Icon bullets"}),icon:x.faIcons,keywords:["icon","bullets","layout","list","icon bullets"],htmlTag:"iconBullets",family:"bullets",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"Xl0g8o",message:"Icon bullets"}),options:{},zoomIn:!0}],defaultAttrs:{image:{source:"image.icon",src:"https://cdn-staging.gamma.app/_app_static/icons/v0/star.svg"}},imageSlot:"optional",imageType:"icon",Wrapper:tG,Cell:tV,isFullWidth:()=>!0,addDirection:()=>"right",featureFlag:"smartLayoutSkins"}),tl({key:"arrowBullets",name:()=>y.i18n._({id:"KFruYJ",message:"Arrow bullets"}),icon:x.faArrowRight,keywords:["arrow","bullets","layout","list","arrow bullets"],htmlTag:"arrowBullets",family:"bullets",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"KFruYJ",message:"Arrow bullets"}),options:{},zoomIn:!0}],defaultAttrs:{image:{source:"image.icon",src:"https://cdn-staging.gamma.app/_app_static/icons/v0/arrow-right.svg"}},imageSlot:"optional",imageType:"icon",Wrapper:tG,Cell:tV,isFullWidth:()=>!0,addDirection:()=>"right"}),tl({key:"satisfaction",name:()=>y.i18n._({id:"/IniW+",message:"Satisfaction scale"}),icon:x.faFaceSmile,keywords:["satisfaction","emoji","scale","rating"],htmlTag:"satisfaction",family:"bullets",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"/IniW+",message:"Satisfaction scale"}),options:{},zoomIn:!0}],imageSlot:"optional",imageType:"icon",Wrapper:tG,Cell:ny,isFullWidth:()=>!0,addDirection:()=>"right",featureFlag:"smartLayoutSkins",maxCells:5,disabled:!0}),tl({key:"solidBoxes",name:()=>y.i18n._({id:"fN02hl",message:"Solid boxes"}),icon:P.faSquare,keywords:["solid","boxes","layout","filled","text boxes"],htmlTag:"solid-boxes",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"fN02hl",message:"Solid boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],Wrapper:t1,Cell:t2,isFullWidth:()=>!0}),tl({key:"solidBoxesWithIconsInside",name:()=>y.i18n._({id:"X7s5I1",message:"Solid boxes with icons"}),icon:P.faSquareCheck,keywords:["solid","boxes","layout","icons","inside","filled","text boxes"],htmlTag:"solid-boxes-with-icons-inside",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"WH8tvt",message:"Solid boxes with numbers"}),options:{horizontalAlign:"center",numbered:!0}},{name:()=>y.i18n._({id:"X7s5I1",message:"Solid boxes with icons"}),options:{horizontalAlign:"center",numbered:!1}}],additionalOptions:[tZ.HorizontalAlignOption,ez.NumberedOptionWithoutIcons],imageSlot:"optional",imageType:"icon",Wrapper:t3,Cell:t5,isFullWidth:()=>!0,dragHandlePlacement:"top"}),tl({key:"outlineBoxes",name:()=>y.i18n._({id:"f43cMT",message:"Outline boxes"}),icon:x.faSquare,keywords:["outline","boxes","layout","border"],htmlTag:"outline-boxes",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"f43cMT",message:"Outline boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],config:{wrapperConfig:{spacing:"small",gridStyle:"flex_grid"},cellConfig:{cellStyle:"outline"}},isFullWidth:()=>!0}),tl({key:"outlineBoxesWithSideLine",name:()=>y.i18n._({id:"6NYS8b",message:"Side line boxes"}),icon:P.faBorderLeft,keywords:["outline","boxes","layout","sidebar","line","border"],htmlTag:"outline-boxes-with-line",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"6NYS8b",message:"Side line boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],config:{wrapperConfig:{gridStyle:"balanced_grid",spacing:"small"},cellConfig:{cellStyle:"outline",cellDecor:{decorType:"fullLine",decorSize:"medium",decorPosition:"side"}}},isFullWidth:()=>!0}),tl({key:"sideLineText",name:()=>y.i18n._({id:"BYRhzB",message:"Side line text"}),icon:P.faBorderLeft,keywords:["boxes","layout","line","border"],htmlTag:"side-line-with-text",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"BYRhzB",message:"Side line text"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],config:{wrapperConfig:{gridStyle:"flex_grid",spacing:"medium"},cellConfig:{cellStyle:"none",cellDecor:{decorType:"fullLine",decorPosition:"side",decorSize:"small"}}},isFullWidth:()=>!0}),tl({key:"topLineText",name:()=>y.i18n._({id:"3uRuGe",message:"Top line text"}),icon:P.faBorderLeft,keywords:["boxes","layout","line","border"],htmlTag:"top-line-with-text",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"3uRuGe",message:"Top line text"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],config:{wrapperConfig:{gridStyle:"flex_grid",spacing:"medium"},cellConfig:{cellStyle:"none",cellDecor:{decorType:"fullLine",decorPosition:"top",decorSize:"small"}}},isFullWidth:()=>!0}),tl({key:"outlineBoxesWithTopCircle",name:()=>y.i18n._({id:"bFvflC",message:"Top circle boxes"}),icon:x.faCircleCheck,keywords:["outline","boxes","layout","circle","top","stripe","badge"],htmlTag:"outline-boxes-with-top-circle",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"duDvK9",message:"Outline boxes with top circle"}),options:{horizontalAlign:"center",numbered:!0}},{name:()=>y.i18n._({id:"wLSSrc",message:"Outline boxes with top icons"}),options:{horizontalAlign:"center",numbered:!1}}],additionalOptions:[tZ.HorizontalAlignOption,ez.NumberedOptionWithoutIcons],imageSlot:"optional",imageType:"icon",Wrapper:tK,Cell:tY,isFullWidth:()=>!0,dragHandlePlacement:"left"}),tl({key:"connectedBoxes",name:()=>y.i18n._({id:"u6HATE",message:"Connected boxes"}),icon:P.faSquare,keywords:["connected","boxes","layout","filled","connectors","flow"],htmlTag:"connected-boxes",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"u6HATE",message:"Connected boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],Wrapper:nd,Cell:nc,isFullWidth:()=>!0,featureFlag:"smartLayoutSkins"}),tl({key:"solidJoinedBoxes",name:()=>y.i18n._({id:"6zAXOC",message:"Joined boxes"}),icon:P.faTableLayout,keywords:["solid","boxes","layout","filled","text boxes"],htmlTag:"solid-joined-boxes",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"6zAXOC",message:"Joined boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],Wrapper:t4,Cell:t6,isFullWidth:()=>!0}),tl({key:"solidJoinedBoxesWithIcons",name:()=>y.i18n._({id:"riEUxW",message:"Joined boxes with icons"}),icon:P.faTableLayout,keywords:["solid","boxes","layout","filled","text boxes","icons"],htmlTag:"solid-joined-boxes-with-icons",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"riEUxW",message:"Joined boxes with icons"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],imageSlot:"always",imageType:"icon",Wrapper:t9,Cell:ie,isFullWidth:()=>!0,dragHandlePlacement:"top"}),tl({key:"solidBoxesWithTopIcons",name:()=>y.i18n._({id:"YcdSxJ",message:"Solid boxes with top icons"}),icon:P.faCheckToSlot,keywords:["solid","boxes","layout","icons","top","filled","text boxes"],htmlTag:"solid-boxes-with-top-icons",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"YcdSxJ",message:"Solid boxes with top icons"}),options:{}}],additionalOptions:[tZ.HorizontalAlignOption],imageSlot:"always",imageType:"icon",Wrapper:nv,Cell:nw,isFullWidth:()=>!0,dragHandlePlacement:"left",featureFlag:"smartLayoutSkins"}),tl({key:"solidLeafBoxes",name:()=>y.i18n._({id:"gVDJjb",message:"Leaf boxes"}),icon:x.faLeaf,keywords:["solid","leaf","boxes","layout","filled","text boxes","rounded"],htmlTag:"solid-leaf-boxes",family:"boxes",presetConfigurations:[{name:()=>y.i18n._({id:"gVDJjb",message:"Leaf boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],Wrapper:it,Cell:ii,isFullWidth:()=>!0}),tl({key:"quoteBoxes",name:()=>y.i18n._({id:"dXQ/Ao",message:"Quote boxes"}),icon:x.faQuoteLeft,keywords:["quote","quotes","boxes","layout","testimonial","quotation"],htmlTag:"quote-boxes",family:"quotes",presetConfigurations:[{name:()=>y.i18n._({id:"dXQ/Ao",message:"Quote boxes"}),options:{horizontalAlign:"center"}}],additionalOptions:[tZ.HorizontalAlignOption],config:{wrapperConfig:{gridStyle:"flex_grid",spacing:"small"},cellConfig:{cellStyle:"outline",cellDecor:{decorType:"quotes"}}},isFullWidth:()=>!0}),tl({key:"quoteBoxesWithFaces",name:()=>y.i18n._({id:"lDxgZ6",message:"Quote boxes with faces"}),icon:x.faCircleDot,keywords:["quote","quotes","testimonial","faces","circle"],htmlTag:"quote-boxes-with-faces",family:"quotes",presetConfigurations:[{name:()=>y.i18n._({id:"duDvK9",message:"Outline boxes with top circle"}),options:{horizontalAlign:"center",numbered:!0,imageShape:"circle",shapeSize:"md"}},{name:()=>y.i18n._({id:"wLSSrc",message:"Outline boxes with top icons"}),options:{horizontalAlign:"center",numbered:!1,imageShape:"square",shapeSize:"sm"}}],additionalOptions:[tZ.HorizontalAlignOption,{...iO,icon:x.faImage,name:()=>y.i18n._({id:"8J92vb",message:"Image size"})},q.ImageShapeOption],defaultOptions:{imageShape:"circle"},imageSlot:"optional",imageType:"image",Wrapper:ng,Cell:nb,isFullWidth:()=>!0,dragHandlePlacement:"left",featureFlag:"smartLayoutSkins",disabled:!0}),tl({key:"processSteps",name:()=>y.i18n._({id:"uFRM59",message:"Process steps"}),icon:x.faListOl,keywords:["boxes","layout","border","top","outline","badge","header","process","agenda","step"],htmlTag:"process-steps",family:"bullets",presetConfigurations:[{name:()=>y.i18n._({id:"uFRM59",message:"Process steps"}),options:{horizontalAlign:"center",numbered:!0}},{name:()=>y.i18n._({id:"cO9Sj8",message:"Process steps with icons"}),options:{horizontalAlign:"center",numbered:!1}}],additionalOptions:[tZ.HorizontalAlignOption,ez.NumberedOptionWithoutIcons],imageSlot:"optional",imageType:"icon",Wrapper:tX,Cell:tQ,isFullWidth:()=>!0,dragHandlePlacement:"top"}),tl({key:"outlineBoxesWithLabel",name:()=>y.i18n._({id:"VWjsp7",message:"Labeled boxes"}),icon:x.faWindowMaximize,keywords:["outline","boxes","label","sequence","ordered","headers"],htmlTag:"outline-boxes-with-label",family:"boxes",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons],presetConfigurations:[{name:()=>y.i18n._({id:"yTTyHb",message:"Horizontal labeled boxes"}),options:{orientation:"horizontal"},hideIfVertical:!0},{name:()=>y.i18n._({id:"UifYfm",message:"Vertical labeled boxes"}),options:{orientation:"vertical"}}],imageSlot:"optional",imageType:"icon",Wrapper:ia,Cell:ir}),{...e=tl({key:"imagesText",name:()=>y.i18n._({id:"cDxTeG",message:"Images with text"}),keywords:["team","caption","images","text","layout"],icon:x.faAddressCard,htmlTag:"images",family:"images",additionalOptions:[iN,{...to,getDefaultOnParse:()=>10},{...iO,icon:x.faImage,name:()=>y.i18n._({id:"8J92vb",message:"Image size"})},q.ImageShapeOption,{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left"),checkEnabled({options:e,deco:t}){let i=e.imagePosition;return t?.direction==="rtl"?"right"!==i:"left"!==i}}],presetConfigurations:[{name:()=>y.i18n._({id:"10G7S6",message:"Square images"}),options:{imageShape:"square",shapeSize:"lg",horizontalAlign:"center"}},{name:()=>y.i18n._({id:"VVRqpK",message:"Circular images"}),options:{imageShape:"circle",shapeSize:"lg",horizontalAlign:"center"}}],addDirection:e=>"left"===e.imagePosition?"bottom":"right",defaultOptions:{imageShape:"landscape"},imageSlot:"always",imageType:"image",Wrapper:nh,Cell:nm}),options:e.options.filter(e=>"color"!==e.key),cellOptions:e.cellOptions.filter(e=>"color"!==e.key)},tl({key:"iconsText",name:()=>y.i18n._({id:"joUkNe",message:"Icons with text"}),icon:x.faIcons,keywords:["icons","text","layout"],htmlTag:"icons",family:"images",additionalOptions:[iN,eO.ColorOption,to,{...iO,icon:x.faImage,name:()=>y.i18n._({id:"bwZEQG",message:"Icon size"}),defaultValue:()=>"md"},{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left"),checkEnabled({options:e,deco:t}){let i=e.imagePosition;return t?.direction==="rtl"?"right"!==i:"left"!==i}}],additionalCellOptions:[{...eO.ColorOption,checkEnabled:({attrs:e})=>!e.image||(0,V.isRecolorableSvg)(e.image)}],presetConfigurations:[{name:()=>y.i18n._({id:"pG60n/",message:"Top icons"}),options:{imagePosition:"top",shapeSize:"lg"}},{name:()=>y.i18n._({id:"hscPGi",message:"Left icons"}),options:{imagePosition:"left",shapeSize:"lg"}}],addDirection:e=>"left"===e.imagePosition?"bottom":"right",defaultAttrs:{image:{source:C.FontawesomeIconProvider.key}},imageSlot:"always",imageType:"icon",Wrapper:nE,Cell:n_}),(0,h.getTimeline)(),(0,c.getMinimalTimeline)(),(0,u.getMinimalTimelineWithBoxes)(),tl({key:"arrows",name:()=>y.i18n._({id:"YUGjgn",message:"Arrows"}),icon:x.faForward,keywords:["sequence","ordered","arrows","chevrons","roadmap"],htmlTag:"arrows",family:"sequence",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons,{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"QI5FSO",message:"Horizontal arrows"}),options:{orientation:"horizontal"},hideIfVertical:!0},{name:()=>y.i18n._({id:"KphBeD",message:"Vertical arrows"}),options:{orientation:"vertical"}}],imageSlot:"optional",imageType:"icon",config:{wrapperConfig:{spacing:"none",gridStyle:"balanced_grid"},cellConfig:{innerLabel:{labelType:"chevron"}}}}),tl({key:"pills",name:()=>y.i18n._({id:"OOCfU+",message:"Pills"}),icon:x.faToggleOff,keywords:["pills","capsules","chips","sequence","ordered","rounded"],htmlTag:"pills",family:"sequence",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons],presetConfigurations:[{name:()=>y.i18n._({id:"D17j6n",message:"Horizontal pills"}),options:{orientation:"horizontal"},hideIfVertical:!0},{name:()=>y.i18n._({id:"gJEEpm",message:"Vertical pills"}),options:{orientation:"vertical"}}],imageSlot:"optional",imageType:"icon",config:{wrapperConfig:{spacing:"small",gridStyle:"balanced_grid"},cellConfig:{innerLabel:{labelType:"pills"}}}}),tl({key:"speechBubbles",name:()=>y.i18n._({id:"H+n8Qp",message:"Speech bubbles"}),icon:x.faComment,keywords:["speech","bubbles","quotes","conversation","dialogue"],htmlTag:"speechBubbles",family:"quotes",additionalOptions:[ez.NumberedOptionWithoutIcons,{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"btb61s",message:"Left aligned"}),options:{horizontalAlign:"left"}},{name:()=>y.i18n._({id:"9WPD2t",message:"Center aligned"}),options:{horizontalAlign:"center"}},{name:()=>y.i18n._({id:"HbrV/u",message:"Right aligned"}),options:{horizontalAlign:"right"}}],imageSlot:"optional",Wrapper:tJ,Cell:t0}),tl({key:"slantedLabels",name:()=>y.i18n._({id:"J0xtcw",message:"Slanted labels"}),icon:P.faRhombus,keywords:["sequence","ordered","arrows","chevrons","roadmap"],htmlTag:"slantedLabels",family:"sequence",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons,{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"gA8+s2",message:"Horizontal slanted labels"}),options:{orientation:"horizontal"},hideIfVertical:!0},{name:()=>y.i18n._({id:"ryugXN",message:"Vertical slanted labels"}),options:{orientation:"vertical"}}],imageSlot:"optional",imageType:"icon",config:{wrapperConfig:{spacing:"none",gridStyle:"balanced_grid"},cellConfig:{innerLabel:{labelType:"slanted"},cellContentOverrides:{pt:0,pb:"1em"}}}}),tl({key:"stats",name:()=>y.i18n._({id:"29Hx9U",message:"Stats"}),icon:x.faPercent,keywords:["stats"],htmlTag:"numbers",family:"numbers",additionalOptions:[{...iO,name:()=>y.i18n._({id:"IfKwpr",message:"Number size"}),icon:x.faTextSize},{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("center")}],presetConfigurations:[{name:()=>y.i18n._({id:"cYvymx",message:"Plain number"}),options:{shapeSize:"lg"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",defaultOptions:{cellSize:10},Wrapper:i9,Cell:i7}),tl({key:"circleStats",name:()=>y.i18n._({id:"mvpFPS",message:"Circle stats"}),icon:x.faCircleQuarterStroke,keywords:["stats","circle"],htmlTag:"circleStats",family:"numbers",additionalOptions:[{...iN,checkEnabled:({options:e})=>"vertical"!==e.orientation},{...iO,name:()=>y.i18n._({id:"1C+7U1",message:"Circle size"}),icon:x.faCircle},{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("center"),checkEnabled:({options:e})=>"left"!==e.imagePosition}],presetConfigurations:[{name:()=>y.i18n._({id:"MpKR5P",message:"Number in circle"}),options:{shapeSize:"lg"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:iU,Cell:iG}),tl({key:"barStats",name:()=>y.i18n._({id:"LYRXtx",message:"Bar stats"}),icon:x.faBarsProgress,keywords:["stats","bar","progress","number","percentage"],htmlTag:"percentages",family:"numbers",additionalOptions:[{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"oWD4zD",message:"Bar stats (left)"}),options:{horizontalAlign:"left"},cellAttrs:{label:"75"}},{name:()=>y.i18n._({id:"HEnTGz",message:"Bar stats (right)"}),options:{horizontalAlign:"right"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:iZ,Cell:iK}),tl({key:"starStats",name:()=>y.i18n._({id:"omSCb1",message:"Star rating"}),icon:ne.faStar,keywords:["stats","star","rating","number","percentage"],htmlTag:"ratings",family:"numbers",additionalOptions:[{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"NGIe/7",message:"Star rating (left)"}),options:{horizontalAlign:"left"},cellAttrs:{label:"4.5"}},{name:()=>y.i18n._({id:"AeN6Ey",message:"Star rating (right)"}),options:{horizontalAlign:"right"},cellAttrs:{label:"4.5"}}],defaultAttrs:{label:"3.5"},addDirection:()=>"right",Wrapper:nn,Cell:na}),tl({key:"dotGridStats",name:()=>y.i18n._({id:"iW6hrR",message:"Dot grid stats"}),icon:P.faBraille,keywords:["stats","dot","grid","number","percentage"],htmlTag:"percentages",family:"numbers",additionalOptions:[{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"OCJYne",message:"Dot stats (left)"}),options:{horizontalAlign:"left"},cellAttrs:{label:"75"}},{name:()=>y.i18n._({id:"Ho9/Bu",message:"Dot stats (right)"}),options:{horizontalAlign:"right"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:i3,Cell:i5}),tl({key:"dotLineStats",name:()=>y.i18n._({id:"Z+uBD/",message:"Dot line stats"}),icon:P.faEllipsis,keywords:["stats","bar","progress","number","percentage"],htmlTag:"percentages",family:"numbers",additionalOptions:[{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"kpy3OF",message:"Dot Line stats (left)"}),options:{horizontalAlign:"left"},cellAttrs:{label:"75"}},{name:()=>y.i18n._({id:"YT7LWI",message:"Dot Line stats (right)"}),options:{horizontalAlign:"right"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:i4,Cell:i6}),{...nH(),key:"staircase",name:()=>y.i18n._({id:"CFVHFO",message:"Staircase"}),options:[...nH().options,{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("left")}],presetConfigurations:[{name:()=>y.i18n._({id:"y9fkH/",message:"Inside text staircase"}),options:{outsideText:!1}},{name:()=>y.i18n._({id:"nGMGDy",message:"Outside text staircase"}),options:{numbered:!0,outsideText:!0}}],icon:x.faStairs,Wrapper:nU,Cell:nG,htmlTag:"staircase",imageSlot:"optional",imageType:"icon",family:"steps"},tl({key:"steps",name:()=>y.i18n._({id:"A9onc2",message:"Steps"}),icon:x.faBarsSort,keywords:["steps","sequence","ordered"],htmlTag:"steps",family:"steps",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"087akc",message:"Horizontal steps"}),options:{orientation:"horizontal",horizontalAlign:"left"},hideIfVertical:!0},{name:()=>y.i18n._({id:"DCkonM",message:"Vertical steps"}),options:{orientation:"vertical",horizontalAlign:"left"}}],config:{wrapperConfig:{spacing:"small",gridStyle:"steps"},cellConfig:{innerLabel:{labelType:"simpleLine"}}}}),tl({key:"stepsWithOutlineBoxes",name:()=>y.i18n._({id:"bKc2b/",message:"Box steps"}),icon:P.faSignalBars,keywords:["steps","outline","boxes","sequence","ordered"],htmlTag:"steps",family:"steps",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"pi32P5",message:"Horizontal box steps"}),options:{orientation:"horizontal",horizontalAlign:"left"},hideIfVertical:!0},{name:()=>y.i18n._({id:"T9MVOK",message:"Vertical box steps"}),options:{orientation:"vertical",horizontalAlign:"left"}}],Wrapper:io,Cell:is}),tl({key:"stepsWithArrow",name:()=>y.i18n._({id:"kQwqXh",message:"Arrow steps"}),icon:x.faArrowTurnRight,keywords:["steps","arrow","sequence","ordered"],htmlTag:"steps",family:"steps",additionalOptions:[td.OrientationOption],presetConfigurations:[{name:()=>y.i18n._({id:"wFgEzK",message:"Horizontal arrow steps"}),options:{orientation:"horizontal",horizontalAlign:"left"},hideIfVertical:!0},{name:()=>y.i18n._({id:"WkYYLP",message:"Vertical arrow steps"}),options:{orientation:"vertical",horizontalAlign:"left"}}],config:{wrapperConfig:{spacing:"small",gridStyle:"steps"},cellConfig:{innerLabel:{labelType:"arrow"}}}}),tl({key:"stepsWithIcons",name:()=>y.i18n._({id:"q8HKHP",message:"Steps with icons"}),icon:x.faBarsStaggered,keywords:["steps","icons","sequence","ordered"],htmlTag:"stepsWithIcons",family:"steps",additionalOptions:[td.OrientationOption,ez.NumberedOptionWithoutIcons],presetConfigurations:[{name:()=>y.i18n._({id:"lPCKsX",message:"Horizontal steps with icons"}),options:{orientation:"horizontal",horizontalAlign:"left"},hideIfVertical:!0},{name:()=>y.i18n._({id:"wNI9DR",message:"Vertical steps with icons"}),options:{orientation:"vertical",horizontalAlign:"left"}}],imageSlot:"optional",imageType:"icon",config:{wrapperConfig:{spacing:"small",gridStyle:"steps"},cellConfig:{innerLabel:{labelType:"iconCircleWithSimpleLine"}}}}),nH(),{...nH(),key:"funnel",name:()=>y.i18n._({id:"n6KuKd",message:"Vertical funnel"}),icon:x.faFilterList,htmlTag:"funnel",Cell:nW,presetConfigurations:[{name:()=>y.i18n._({id:"rSrvFr",message:"Inside text funnel"}),options:{outsideText:!1}},{name:()=>y.i18n._({id:"dXD9N4",message:"Outside text funnel"}),options:{numbered:!0,outsideText:!0}}]},{...e6(),key:"cycle",name:()=>y.i18n._({id:"qicHbX",message:"Cycle"}),icon:x.faArrowsSpin,htmlTag:"cycle",keywords:["cyclical","flywheel","circle","circular","recycle"],presetConfigurations:[{name:()=>y.i18n._({id:"qicHbX",message:"Cycle"}),options:{numbered:!0}}]},{...e6(),key:"flower",name:()=>y.i18n._({id:"abEdHK",message:"Flower"}),icon:x.faFlower,keywords:["petals","clover","butterfly"],htmlTag:"flower",presetConfigurations:[{name:()=>y.i18n._({id:"abEdHK",message:"Flower"}),options:{numbered:!0}}]},e6(),{...e6(),key:"ring",name:()=>y.i18n._({id:"EKlSR5",message:"Ring"}),icon:x.faCircle,keywords:["ring","circle","circular"],htmlTag:"ring",presetConfigurations:[{name:()=>y.i18n._({id:"EKlSR5",message:"Ring"}),options:{numbered:!0}}]},{...e6(),key:"semiCircle",name:()=>y.i18n._({id:"r9sPHK",message:"Semi-circle"}),Wrapper:e9,Cell:e8,addDirection:()=>"right",htmlTag:"semicircle",keywords:["semicircle","arc","circle","radial"],icon:x.faSunrise,presetConfigurations:[{name:()=>y.i18n._({id:"r9sPHK",message:"Semi-circle"}),options:{numbered:!0}}]},tl({key:"circleStatsWithBoldLine",name:()=>y.i18n._({id:"kSnmN+",message:"Circle stats with middle bold line"}),icon:x.faCircleQuarterStroke,keywords:["stats","circle"],htmlTag:"circle-stats-with-bold-line",family:"numbers",additionalOptions:[{...iN,checkEnabled:({options:e})=>"vertical"!==e.orientation},{...iO,name:()=>y.i18n._({id:"1C+7U1",message:"Circle size"}),icon:x.faCircle},{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("center"),checkEnabled:({options:e})=>"left"!==e.imagePosition}],presetConfigurations:[{name:()=>y.i18n._({id:"MpKR5P",message:"Number in circle"}),options:{shapeSize:"lg"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:iq,Cell:iX}),tl({key:"circleStatsWithExternalBoldLine",name:()=>y.i18n._({id:"L3jtjR",message:"Circle stats with external bold line"}),icon:x.faCircleQuarterStroke,keywords:["stats","circle"],htmlTag:"circle-stats-with-external-bold-line",family:"numbers",additionalOptions:[{...iN,checkEnabled:({options:e})=>"vertical"!==e.orientation},{...iO,name:()=>y.i18n._({id:"1C+7U1",message:"Circle size"}),icon:x.faCircle},{...tZ.HorizontalAlignOption,defaultValue:(0,A.getDefaultHorizontalAlignment)("center"),checkEnabled:({options:e})=>"left"!==e.imagePosition}],presetConfigurations:[{name:()=>y.i18n._({id:"MpKR5P",message:"Number in circle"}),options:{shapeSize:"lg"},cellAttrs:{label:"75"}}],defaultAttrs:{label:"50%"},addDirection:()=>"right",Wrapper:iJ,Cell:i1}),(0,p.getSolidBoxesAlternating)(),tl({key:"solidBoxSmallBullets",name:()=>y.i18n._({id:"4N8X2T",message:"Solid box small bullets"}),icon:x.faListUl,keywords:["small","bullets","layout","list","bullet"],htmlTag:"solidBoxSmallBullets",family:"bullets",presetConfigurations:[{name:()=>y.i18n._({id:"4N8X2T",message:"Solid box small bullets"}),options:{},zoomIn:!0}],additionalOptions:[td.OrientationOption],config:{wrapperConfig:{spacing:"medium",gridStyle:"flex_grid"},cellConfig:{cellStyle:"solid",marker:{markerType:"smallBullet",markerPosition:"left",markerFontSize:null}}},isFullWidth:()=>!0,addDirection:()=>"right"})]},nZ=e=>{if(!e)return t$();nK[e]&&(e=nK[e]);let t=n$().reduce((e,t)=>(e[t.key]=t,e),{})[e];return t||t$()},nK={textBoxes:"solidBoxes",bullets:"bigBullets"},nq=(e,t="ltr")=>{let i=nZ(e.variantKey),n={};return i.options.forEach(({key:i,defaultValue:a})=>{n[i]=e.options[i]??a?.({dir:t})}),n},nY=e=>{let t=nZ(e.variantKey),i=nq(e);return t.addDirection?.(i)||"right"},nX=e=>{let t=(0,l.getDataTransferFiles)(e).filter(e=>(0,o.isImageMimeType)(e.type));return 1===t.length&&t[0]},nQ=(e,t,i)=>{let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let o=e.state.doc.resolve(n.inside),l=(0,a.findNodeAndParents)(o,d.isSmartLayoutCellNode)[0],c=(0,a.findNodeAndParents)(o,d.isSmartLayoutNode)[0],u=i&&(0,s.sliceSingleNode)(i),p=nX(t);if(!l&&!c||u&&"image"!==u.type.name||!p)return null;let h=(0,r.findInBetween)(t.target,e.dom,e=>e.hasAttribute("data-smart-layout-image-drop-target"));if(h){let e=h.getBoundingClientRect();return{pos:n.inside,node:u,rect:e,image:{src:u?.attrs.src,source:u?.attrs.source,query:u?.attrs.query,name:u?.attrs.name,uploadStatus:u?.attrs.uploadStatus}}}return null},nJ=(e,t,n)=>{let a;if(!n||!e.state.schema.nodes.smartLayout.validContent(n.content))return null;let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r||-1==r.inside)return null;let{doc:o}=e.state,s=o.nodeAt(r.pos),l=o.nodeAt(r.inside);if(l&&(0,d.isSmartLayoutCellNode)(l))a={node:l,pos:r.inside};else if(s&&(0,d.isSmartLayoutCellNode)(s))a={node:s,pos:r.pos};else{let e=o.resolve(r.inside);a=(0,i.findParentNodeClosestToPos)(e,d.isSmartLayoutCellNode)}let c=a&&e.nodeDOM(a.pos),u=c?.querySelector("[data-content-reference]"),p=u?.getBoundingClientRect();if(!a||!p)return null;let h=o.resolve(a.pos).parent;if(!h||!(0,d.isSmartLayoutNode)(h))return null;let m="right"===nY(h.attrs)?t.clientX>p.left+p.width/2?"right":"left":t.clientY>p.top+p.height/2?"bottom":"top";return{pos:a.pos,node:a.node,rect:p,side:m}},n0=(e,t,a)=>{if(!a)return null;let r=a.content.toJSON(),o=r?.[0];if(e.state.selection instanceof n.NodeSelection&&"smartLayout"===e.state.selection.node.type.name||!o||o?.type!=="smartLayout")return null;let s=o.attrs?.variantKey,l=e.posAtCoords({left:t.clientX,top:t.clientY});if(!l||-1==l.inside)return null;let{doc:c}=e.state,u=c.resolve(l.inside),p=(0,i.findParentNodeClosestToPos)(u,d.isSmartLayoutNode);if(!p)return null;let h=e.nodeDOM(p.pos),m=h?.getBoundingClientRect();return m?{pos:p.pos,node:p.node,variantKey:s,rect:m}:null},n1=(e,t)=>{let n=(0,i.findParentNodeClosestToPos)(t,d.isSmartLayoutNode);n&&e.commands.selectNodeAtPos(n.pos)},n2=(e=4)=>[ej.templateHelpers.heading(y.i18n._({id:"HX5SVx",message:"Item"}),{level:e}),ej.templateHelpers.paragraph(y.i18n._({id:"Nu4oKW",message:"Description"}))],n3=e=>{let{key:i,name:n,keywords:a,description:r,icon:o,featureFlag:s,wrapperOptions:l,gridItems:d}=e,c={type:"grid",attrs:{options:l},content:d};return{key:`grid-${i}`,name:n,keywords:[...a,"grid"],description:r,nodeName:"grid",icon:o,execute:e=>{e.chain().focus().insertContentAndSelect(c).run()},dragStartFn:e=>(0,t.setDraggingContent)({editor:e,content:c}),dragEndFn:e=>{n1(e,e.state.selection.$from)},featureFlag:s||"gridNode"}},n5=()=>[{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"horizontal"},gridItems:[{type:"gridItem",content:n2(),attrs:{options:{horizontalColumnSpan:20,cellStyle:"none"}}},{type:"gridItem",content:n2(),attrs:{options:{horizontalColumnSpan:40,cellStyle:"none"}}}],key:"sidebarLeft",name:()=>y.i18n._({id:"Y8QFhf",message:"Sidebar left grid template"}),keywords:["sidebar","left","navigation","grid","1/3","2/3"],description:()=>y.i18n._({id:"BMAaoJ",message:"Narrow sidebar on left, wide content on right"}),icon:P.faSidebarFlip,featureFlag:"gridNode"},{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"vertical"},gridItems:[...(0,nL.default)(2).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:30,verticalColumnSpan:30,cellStyle:"none"}}})),...(0,nL.default)(3).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:20,cellStyle:"none"}}}))],key:"splitLeft",name:()=>y.i18n._({id:"ietjKS",message:"Split left grid template"}),keywords:["split","heroes","dual","left","grid"],description:()=>y.i18n._({id:"VjMR0K",message:"Multiple hero items on left with content on right"}),icon:P.faSquareList,featureFlag:"gridNode"},{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"vertical"},gridItems:[{type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:60,verticalColumnSpan:30,cellStyle:"none"}}},...(0,nL.default)(4).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:15,cellStyle:"none"}}}))],key:"heroLeft",name:()=>y.i18n._({id:"NtxUxV",message:"Hero left grid template"}),keywords:["hero","left","focal","grid"],description:()=>y.i18n._({id:"c3eNjh",message:"Large hero item on left with content stacked on right"}),icon:P.faSquareLeft,featureFlag:"gridNode"},{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"vertical"},gridItems:[...(0,nL.default)(4).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:15,cellStyle:"none"}}})),{type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:60,verticalColumnSpan:30,cellStyle:"none"}}}],key:"heroRight",name:()=>y.i18n._({id:"ZhHMOn",message:"Hero right grid template"}),keywords:["hero","right","focal","grid"],description:()=>y.i18n._({id:"25zgSg",message:"Large hero item on right with content stacked on left"}),icon:P.faSquareRight,featureFlag:"gridNode"},{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"vertical"},gridItems:[...(0,nL.default)(2).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:30,cellStyle:"none"}}})),{type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:60,verticalColumnSpan:30,cellStyle:"none"}}},...(0,nL.default)(2).map(()=>({type:"gridItem",content:n2(),attrs:{options:{verticalRowSpan:30,cellStyle:"none"}}}))],key:"heroCenter",name:()=>y.i18n._({id:"xj9P6a",message:"Hero center grid template"}),keywords:["hero","center","focal","grid"],description:()=>y.i18n._({id:"PwhQbH",message:"Large hero item centered with content on both sides"}),icon:P.faSquare,featureFlag:"gridNode"},{wrapperOptions:{gridStyle:"flexible",spacing:"small",gridDirection:"horizontal"},gridItems:[{type:"gridItem",content:n2(),attrs:{options:{horizontalRowSpan:30,horizontalColumnSpan:60,cellStyle:"none"}}},...(0,nL.default)(3).map(()=>({type:"gridItem",content:n2(),attrs:{options:{horizontalColumnSpan:20,cellStyle:"none"}}}))],key:"heroTop",name:()=>y.i18n._({id:"+RZODA",message:"Hero top grid template"}),keywords:["hero","top","focal","grid"],description:()=>y.i18n._({id:"bdzANz",message:"Large hero item on top with content flowing below"}),icon:P.faSquareUp,featureFlag:"gridNode"}].map(n3);e.s(["MediaCommands",0,()=>Object.entries(X.MediaSourcesMap).filter(([e,t])=>t.nodeName&&!t.disabled).map(([e,i])=>({key:e,name:i.label,nodeName:i.nodeName||"mediaPlaceholder",execute:e=>e.commands.insertMediaBlock(i.key),dragStartFn:e=>{(0,t.setDraggingContent)({editor:e,content:{type:"mediaPlaceholder",attrs:{source:i.key}}})},dragEndFn:()=>{(0,F.openMediaDrawer)()},description:i.description,icon:i.icon,image:i.image,testId:i.key,keywords:i.keywords,featureFlag:i.featureFlag,priority:i.priority,categories:i.categories,checkDisabled:i.checkDisabled,badge:i.badge}))],152561),e.s(["DiagramKeys",0,["venn","rings","bullseye","ribbon_arrows","ideas","inputs","quadrants","swoosh","versus","infinity","square_arrows","puzzle","bubble_steps","nested_diamond","packed_circles","pinwheel","iceberg","slope","arrow_bars","hot_air_balloons","circle_hero_pic","solar_system","signs","text_box_collage","concentric_circles","funnel_3d","road","isometric_building","isometric_globe","isometric_dashed_squares","gears","pillar","orbit","circle_post_it","round_rect_and_square_image","oval_stroke_image","left_rounded_edge_rect_image","leaf_image","image_arc","accent_circle","semi_circle","semi_circle_road","target","minimal_road","linear_venn","linear_venn_filled","diamonds","minimal_funnel","connected_circles","orbit_fill"]],436910),e.s(["addStepToData",()=>ad,"canAddStepToData",()=>ao,"canRemoveStepFromData",()=>as,"canToggleIcons",()=>al,"checkAnyItemInStepSelected",()=>at,"getDataForElement",()=>n7,"getDefaultDataForTemplate",()=>au,"getKeyPathForElement",()=>ae,"getStepData",()=>n6,"getUpdatedDataForElement",()=>an,"hasEmphasizedSteps",()=>n9,"isStepEmphasized",()=>n8,"parseClassNames",()=>ar,"removeStepFromData",()=>ac],957734);var n4=e.i(990272);let n6=(e,t)=>{let i,{stepNumber:n,generalNumber:a}=e;if(null!==n&&t.step?i=t.step[n]:null!==a&&t.general&&(i=t.general[a]),i){var r,o;return r=i,o=e.type,r.image&&!r.icon&&"icon"===o?{...r,icon:r.image,image:void 0}:r}},n9=e=>{let t=e.step?.some(e=>e?.isEmphasized)||!1,i=e.general?.some(e=>e?.isEmphasized)||!1;return t||i},n8=(e,t)=>{let i=n6(e,t);return i?.isEmphasized||!1},n7=(e,t)=>{let i=n6(e,t);if(!i)return;let{type:n}=e;switch(n){case"text":return i.text;case"icon":return i.icon||i.image;case"image":return i.image;default:return""}},ae=e=>{let{stepNumber:t,generalNumber:i,type:n}=e;return"number"!=typeof t||isNaN(t)?"number"!=typeof i||isNaN(i)?"":`general.${i}.${n}`:`step.${t}.${n}`},at=(e,t)=>{let{stepNumber:i}=e;return!("number"!=typeof i||isNaN(i))&&t.startsWith(`step.${i}`)},ai={text:void 0,icon:void 0,image:void 0},an=(e,t,i)=>{let{stepNumber:n,generalNumber:a,type:r}=e,o={...t};if(null!==n){for(o.step||(o.step=[]);o.step.length<=n;)o.step.push(void 0);o.step[n]||(o.step[n]=ai),aa(o.step[n],r,i)}if(null!==a){for(o.general||(o.general=[]);o.general.length<=a;)o.general.push(void 0);o.general[a]||(o.general[a]=ai),aa(o.general[a],r,i)}return o};function aa(e,t,i){switch(t){case"text":e.text=i;break;case"icon":e.icon={source:"image.icon",src:i},e.image&&(e.image=void 0);break;case"image":e.image={source:"image",src:i}}}let ar=e=>{let t=Array.from(e).find(e=>e.startsWith("step-")),i=Array.from(e).find(e=>e.startsWith("general-"));return{stepNumber:t?parseInt(t.split("-")[1])-1:null,generalNumber:i?parseInt(i.split("-")[1])-1:null}},ao=(e,t)=>{let i=(0,n4.getSmartDiagramTemplate)(e);if(!i||!ah(i))return!1;let{stepSvgData:n}=i;return!!n&&!!t.step&&t.step.length{if("quadrants"===e)return!1;let i=(0,n4.getSmartDiagramTemplate)(e);if(!i||!ah(i))return!1;let{stepSvgData:n}=i;return!!n&&!!t.step&&t.step.length>ap(n).min},al=e=>{let t=(0,n4.getSmartDiagramTemplate)(e);return!!t&&!!ah(t)&&t.canToggleIcons},ad=(e,t)=>{let i={...e};if(e.step){let n=[...e.step],a=n.some(e=>e?.text),r=n.some(e=>e?.icon||e?.image);n.splice(t,0,{text:a?"

Item

":void 0,icon:r?{source:"image.icon",src:""}:void 0,color:void 0,isEmphasized:!1}),i.step=n}return i},ac=(e,t)=>{let i={...e};if(e.step){let n=[...e.step];n.splice(t,1),i.step=n}return i},au=e=>{let t=Math.min(...e.keys()),i=Math.max(...e.keys());return{step:Array.from({length:t===i?t:Math.floor((t+i)*3/4)},()=>ai),general:[]}},ap=e=>({min:Math.min(...e.keys()),max:Math.max(...e.keys())}),ah=e=>"stepSvgData"in e&&void 0!==e.stepSvgData;e.s(["ComposableSVGDiagramFormattingMenu",()=>aG],774193);var am=e.i(969641),ag=e.i(358280);e.i(734710);var af=e.i(430378),ab=e.i(78387),ax=e.i(402818);let ay=()=>(0,m.jsx)(I.Center,{h:"20px",children:(0,m.jsx)(ax.Divider,{mx:1,borderColor:"gray.300",orientation:"vertical"})});e.s(["FormattingMenuDivider",0,ay],400551),e.s(["SmartDiagramFormattingMenu",()=>aV],666916);var av=e.i(335799),aC=e.i(261442);let aw=({editor:e,handleDelete:t,hasText:i=!1})=>{let n=(0,v.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]);return i?(0,m.jsx)(am.Button,{variant:"toolbar",onClick:t||n,color:"red.500",onMouseDown:aC.preventDefaultToAvoidBlur,size:"md",leftIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faTrash}),children:(0,m.jsx)(ag.Trans,{message:"Delete",id:"cnGeoo"})}):(0,m.jsx)(iD.ToolbarButton,{label:(0,m.jsx)(ag.Trans,{message:"Delete",id:"cnGeoo"}),icon:x.faTrash,onClick:t||n,testId:"delete-node-button",color:"red.500"})};e.s(["DeleteNodeButton",0,aw],241894);var aS=e.i(148318);let ak=.25*!eL.isPuppeteer,aA={monochrome:{label:()=>y.i18n._({id:"VvdC4u",message:"Monochrome"})},spin:{label:()=>y.i18n._({id:"0LFzg9",message:"Spin"})},complement:{label:()=>y.i18n._({id:"2HDXEj",message:"Alt Complement"})},complement2:{label:()=>y.i18n._({id:"XTxqsS",message:"Complement"})},alternating:{label:()=>y.i18n._({id:"K+2OGd",message:"Alternating"})}},aE={monochrome:{label:()=>y.i18n._({id:"VvdC4u",message:"Monochrome"})},alternating:{label:()=>y.i18n._({id:"K+2OGd",message:"Alternating"})},theme:{label:()=>y.i18n._({id:"FEr96N",message:"Theme"})},spin:{label:()=>y.i18n._({id:"0LFzg9",message:"Spin"})},complement:{label:()=>y.i18n._({id:"2HDXEj",message:"Alt Complement"})},complement2:{label:()=>y.i18n._({id:"XTxqsS",message:"Complement"})}},a_={...aA,...aE},aI=e=>e?aE:aA,aM="monochrome",aT=Object.freeze({pie:{icon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faChartPie}),selectedIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faChartPie}),label:()=>y.i18n._({id:"RT6aCN",message:"Pie"})},donut:{icon:(0,m.jsxs)(i_.chakra.span,{className:"fa-layers fa-fw",children:[(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faCrosshairsSimple}),(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faCircleSmall})]}),selectedIcon:(0,m.jsxs)(i_.chakra.span,{className:"fa-layers fa-fw",children:[(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faCrosshairsSimple}),(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faCircleSmall})]}),label:()=>y.i18n._({id:"Cn5cfQ",message:"Donut"})},line:{icon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faChartLine}),selectedIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faChartLine}),label:()=>y.i18n._({id:"MZW+2G",message:"Line"})},bar:{icon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faChartSimple}),selectedIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faChartSimple}),label:()=>y.i18n._({id:"EzalDc",message:"Column"})},"horizontal-bar":{icon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faChartSimpleHorizontal}),selectedIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faChartSimpleHorizontal}),label:()=>y.i18n._({id:"CeeoKy",message:"Bar"})}});e.s(["ANIMATION_DURATION",0,ak,"CHART_COLORS_SCHEMES",0,a_,"CHART_TYPES",0,aT,"DEFAULT_COLOR_SCHEME",0,aM,"DEFAULT_MARGIN",0,{top:0,right:0,bottom:0,left:0},"getChartColorSchemes",0,aI],194279);var aL=e.i(686296),aj=e.i(363278),aP=e.i(721455),aD=e.i(182895),aN=e.i(704273),aR=e.i(259658),aO=e.i(304521),aB=e.i(962666);function az({chartColorSchemes:e,useNewChartingColorSet:t,themeAccentColors:i,steps:n=5,theme:a,accentColor:r}){let o={},s=Array(n).fill(0).map((e,t)=>t);return Object.entries(e).filter(([e])=>"monochrome"!==e&&("theme"!==e||t&&i.length>=3)).forEach(([e,{label:t}])=>{o[e]={label:t,scale:(0,aB.makeColorScale)(r,s,e,{theme:a})}}),((e,t,i)=>{let n=(0,aL.getThemeAccentColors)(e),a=[],r=t?n:[n[0]].filter(Boolean);if(r.length>0&&r.forEach((e,t)=>{let n=(0,aL.getThemeColorSolid)(e),r=0===t?"monochrome":`monochrome-${t+1}`;a.push({key:r,label:()=>0===t?y.i18n._({id:"VvdC4u",message:"Monochrome"}):y.i18n._({id:"oC5JOi",message:"Monochrome {monochromeNumber}",values:{monochromeNumber:t+1}}),scale:(0,aB.makeColorScale)(n,i,"monochrome"),interpolate:e=>(0,aB.getMonochromeColorAtFraction)(n,e)})}),t&&n.length<=1){let e=+(n.length>0);aB.FALLBACK_MONOCHROME_COLORS.forEach((t,n)=>{let r=e+n,o=0===r?"monochrome":`monochrome-${r+1}`,s=r+1;a.some(e=>e.key===o)||a.push({key:o,label:()=>0===r?y.i18n._({id:"VvdC4u",message:"Monochrome"}):y.i18n._({id:"oC5JOi",message:"Monochrome {monochromeNumber}",values:{monochromeNumber:s}}),scale:(0,aB.makeColorScale)(t,i,"monochrome"),interpolate:e=>(0,aB.getMonochromeColorAtFraction)(t,e)})})}return a})(a,t,s).forEach(e=>{o[e.key]={label:e.label,scale:e.scale,interpolate:e.interpolate}}),o}e.s(["filterColorSchemesByContrast",0,(e,t,i,n=1.5)=>e.filter(([e,{scale:a}])=>[...a.values()].map(e=>aO.default.readability(e,t)).reduce((e,t)=>Math.max(e,t),0)>=n||e===i),"getFullColorSchemesList",0,az,"prepareColorSchemeOptions",0,(e,t)=>Object.entries({default:{...e[aM],label:()=>t},...e}).sort(([e],[t])=>{let i=e=>"default"===e?0:"theme"===e?1:"monochrome"===e?2:e.startsWith("monochrome-")?2+parseInt(e.split("-")[1],10)/100:"alternating"===e?3:"spin"===e?4:"complement"===e?5:"complement2"===e?6:999;return i(e)-i(t)})],157965);var aF=e.i(849187);let aH=({accentColor:e,selected:t,onChange:i,steps:n=5,menuButton:a})=>{let r=(0,B.useAppSelector)(H.selectTheme),o=(0,aL.getThemeAccentColors)(r),s=Array(n).fill(0).map((e,t)=>t),l=(0,aF.useFeatureFlag)("useNewChartingColorSet"),d=aI(l),c=(0,v.useMemo)(()=>az({chartColorSchemes:d,useNewChartingColorSet:l,themeAccentColors:o,steps:n,theme:r,accentColor:e}),[e,o,r,l,d,n]);t&&!c[t]&&(t=void 0);let u=y.i18n._({id:"ovBPCi",message:"Default"});return(0,m.jsxs)(aP.Menu,{isLazy:!0,children:[a||(0,m.jsx)(aS.MenuButton,{as:am.Button,variant:"plain",size:"sm",w:40,boxShadow:"none",textAlign:"start",rightIcon:(0,m.jsx)(aj.ChevronDownIcon,{}),sx:{"span:first-of-type":{overflow:"clip",textOverflow:"ellipsis"}},children:t?c[t].label():u}),(0,m.jsx)(aN.MenuList,{zIndex:"modalPopover",maxH:"200px",overflowY:"auto",children:(0,m.jsx)(aR.MenuOptionGroup,{value:t||"default",type:"radio",onChange:e=>{i("default"===e?void 0:e)},children:Object.entries({default:{...c[aM],label:()=>u},...c}).sort(([e],[t])=>{let i=e=>"default"===e?0:"theme"===e?1:"monochrome"===e?2:e.startsWith("monochrome-")?2+parseInt(e.split("-")[1],10)/100:"alternating"===e?3:"spin"===e?4:"complement"===e?5:"complement2"===e?6:999;return i(e)-i(t)}).map(([i,{label:n,scale:a}])=>1.5>[...a.values()].map(t=>aO.default.readability(t,e)).reduce((e,t)=>Math.max(e,t),0)&&i!==t?null:(0,m.jsx)(aD.MenuItemOption,{value:i,children:(0,m.jsx)(tt.HStack,{children:(0,m.jsx)(aW,{scale:a,data:s})})},i))})})]})},aW=({scale:e,data:t})=>(0,m.jsx)(tt.HStack,{spacing:0,borderRadius:"md",overflow:"hidden",children:t.map(t=>(0,m.jsx)(g.Box,{bg:e.get(t)??"black",width:9,height:5},t))});e.s(["ColorSchemeDropdown",0,aH],466511);let aU=({selected:e,onChange:t,steps:i,templateKey:n})=>{let{defaultColorScheme:a}=(0,n4.getSmartDiagramTemplate)(n),r=(0,B.useAppSelector)(H.selectTheme),o=(0,aL.getThemeColorSolid)((0,aL.getThemePrimaryAccentColor)(r)),s=y.i18n._({id:"ovBPCi",message:"Default"});return(0,m.jsx)(aH,{accentColor:o,selected:e,onChange:e=>{t(void 0===e?a:e)},steps:i,menuButton:(0,m.jsx)(aS.MenuButton,{as:am.Button,variant:"toolbar",size:"sm",boxShadow:"none",leftIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faPalette,fixedWidth:!0}),rightIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:ne.faChevronDown,size:"xs",fixedWidth:!0}),sx:{textTransform:"capitalize"},children:e&&"string"==typeof e?a_[e]?.label()||e.replace("-"," "):s})})},aV=({editor:e,selection:t,children:i})=>{let n=t.node.type.name,{templateKey:a,data:r}=t.node.attrs;return(0,m.jsxs)(av.ButtonGroup,{spacing:0,size:"sm",alignItems:"center",dir:"ltr",children:[A.AlignmentCommands.map(({name:t,icon:i,checkActive:n,apply:r})=>{if(n&&r)return(0,m.jsx)(iD.ToolbarButton,{label:t(),icon:i,onClick:()=>{r(e),af.analytics.track(ab.SegmentEvents.SMART_DIAGRAM_ALIGNMENT_CHANGED,{templateKey:a,alignmentType:t()})},isActive:n(e)},t())}),(0,m.jsx)(ay,{}),(0,m.jsx)(aU,{selected:r.colorScheme,onChange:t=>{e.commands.updateAttributes(n,{data:{...r,colorScheme:t}}),af.analytics.track(ab.SegmentEvents.SMART_DIAGRAM_COLOR_SCHEME_CHANGED,{templateKey:a,previousColorScheme:r.colorScheme,newColorScheme:t})},steps:5,templateKey:a}),(0,m.jsx)(ay,{}),i,(0,m.jsx)(aw,{editor:e})]})},aG=({editor:e,decorations:t,selection:i})=>{let{data:n,templateKey:a,showIcons:r}=i.node.attrs,o=(0,v.useCallback)(t=>{try{let a=t({...n});e.commands.updateAttributesAtPos(i.from,{data:a})}catch(e){console.error("Error updating smart diagram data",e)}},[n,e.commands,i.from]),s=(0,v.useCallback)(()=>{e.commands.updateAttributesAtPos(i.from,{showIcons:!r}),af.analytics.track(ab.SegmentEvents.SMART_DIAGRAM_ICONS_TOGGLED,{templateKey:a,showIcons:!r})},[e.commands,i.from,r,a]),l=ao(a,n),d=as(a,n),c=al(a);return(0,m.jsxs)(aV,{editor:e,selection:i,decorations:t,children:[c&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(tt.HStack,{ps:2,children:(0,m.jsx)(am.Button,{size:"sm",variant:"toolbar",onClick:()=>s(),leftIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faIcons}),children:r?(0,m.jsx)(ag.Trans,{message:"Hide icons",id:"dBrmK7"}):(0,m.jsx)(ag.Trans,{message:"Show icons",id:"TMFk/9"})})}),(0,m.jsx)(ay,{})]}),(l||d)&&(0,m.jsxs)(tt.HStack,{ps:2,children:[(0,m.jsx)(am.Button,{size:"sm",disabled:!d,variant:"toolbar",onClick:()=>{var e;return e=n.step?.length-1||0,void(o(t=>ac(t,e)),af.analytics.track(ab.SegmentEvents.SMART_DIAGRAM_STEPS_UPDATED,{templateKey:a,action:"remove",stepIndex:e,totalSteps:n.steps?.length||0}))},leftIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faCircleMinus}),children:(0,m.jsx)(ag.Trans,{message:"Remove step",id:"pUON+Q"})}),(0,m.jsx)(am.Button,{size:"sm",disabled:!l,variant:"toolbar",onClick:()=>{var e;return e=n.step?.length-1||0,void(o(t=>ad(t,e)),af.analytics.track(ab.SegmentEvents.SMART_DIAGRAM_STEPS_UPDATED,{templateKey:a,action:"add",stepIndex:e,totalSteps:n.steps?.length||0}))},leftIcon:(0,m.jsx)(D.FontAwesomeIcon,{icon:x.faCirclePlus}),children:(0,m.jsx)(ag.Trans,{message:"Add step",id:"xK4Xoz"})}),(0,m.jsx)(ay,{})]})]})};e.s(["FocusAbsorber",0,()=>(0,m.jsx)("text",{x:0,y:0,fontSize:"0",fill:"transparent",style:{opacity:0},"aria-hidden":"true",tabIndex:-1,children:"​ "},"focus-absorber")],509504)},420404,(e,t,i)=>{"use strict";var n={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0},a=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];function r(e){return e>=48&&e<=57}function o(e){this.index=0,this.path=e,this.max=e.length,this.result=[],this.param=0,this.err="",this.segmentStart=0,this.data=[]}function s(e){for(var t;e.index=5760&&a.indexOf(t)>=0);)e.index++}function l(e){var t,i=(t=e.path[e.segmentStart]).toLowerCase(),a=e.data;if("m"===i&&a.length>2&&(e.result.push([t,a[0],a[1]]),a=a.slice(2),i="l",t="m"===t?"l":"L"),"r"===i)e.result.push([t].concat(a));else for(;a.length>=n[i]&&(e.result.push([t].concat(a.splice(0,n[i]))),n[i]););}t.exports=function(e){var t=new o(e),i=t.max;for(s(t);t.index0;c--){if(a&&(3===c||4===c)?!function(e){var t=e.path.charCodeAt(e.index);if(48===t){e.param=0,e.index++;return}if(49===t){e.param=1,e.index++;return}e.err="SvgPath: arc flag can be 0 or 1 only (at pos "+e.index+")"}(e):!function(e){var t,i=e.index,n=i,a=e.max,o=!1,s=!1,l=!1,d=!1;if(n>=a){e.err="SvgPath: missed param (at pos "+n+")";return}if((43===(t=e.path.charCodeAt(n))||45===t)&&(t=++n=e.max||!((t=e.path.charCodeAt(e.index))>=48&&t<=57||43===t||45===t||46===t)))break}l(e)}(t);return t.result.length&&(0>"mM".indexOf(t.result[0][0])?(t.err="SvgPath: string should start with `M` or `m`",t.result=[]):t.result[0][0]="M"),{err:t.err,segments:t.result}}},294875,(e,t,i)=>{"use strict";function n(){if(!(this instanceof n))return new n;this.queue=[],this.cache=null}n.prototype.matrix=function(e){return 1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5]||(this.cache=null,this.queue.push(e)),this},n.prototype.translate=function(e,t){return(0!==e||0!==t)&&(this.cache=null,this.queue.push([1,0,0,1,e,t])),this},n.prototype.scale=function(e,t){return(1!==e||1!==t)&&(this.cache=null,this.queue.push([e,0,0,t,0,0])),this},n.prototype.rotate=function(e,t,i){var n,a,r;return 0!==e&&(this.translate(t,i),a=Math.cos(n=e*Math.PI/180),r=Math.sin(n),this.queue.push([a,r,-r,a,0,0]),this.cache=null,this.translate(-t,-i)),this},n.prototype.skewX=function(e){return 0!==e&&(this.cache=null,this.queue.push([1,0,Math.tan(e*Math.PI/180),1,0,0])),this},n.prototype.skewY=function(e){return 0!==e&&(this.cache=null,this.queue.push([1,Math.tan(e*Math.PI/180),0,1,0,0])),this},n.prototype.toArray=function(){if(this.cache)return this.cache;if(!this.queue.length)return this.cache=[1,0,0,1,0,0],this.cache;if(this.cache=this.queue[0],1===this.queue.length)return this.cache;for(var e,t,i=1;i{"use strict";var n=e.r(294875),a={matrix:!0,scale:!0,rotate:!0,translate:!0,skewX:!0,skewY:!0},r=/\s*(matrix|translate|scale|rotate|skewX|skewY)\s*\(\s*(.+?)\s*\)[\s,]*/,o=/[\s,]+/;t.exports=function(e){var t,i,s=new n;return e.split(r).forEach(function(e){if(e.length){if(void 0!==a[e]){t=e;return}switch(i=e.split(o).map(function(e){return+e||0}),t){case"matrix":6===i.length&&s.matrix(i);return;case"scale":1===i.length?s.scale(i[0],i[0]):2===i.length&&s.scale(i[0],i[1]);return;case"rotate":1===i.length?s.rotate(i[0],0,0):3===i.length&&s.rotate(i[0],i[1],i[2]);return;case"translate":1===i.length?s.translate(i[0],0):2===i.length&&s.translate(i[0],i[1]);return;case"skewX":1===i.length&&s.skewX(i[0]);return;case"skewY":1===i.length&&s.skewY(i[0]);return}}}),s}},875509,(e,t,i)=>{"use strict";var n=2*Math.PI;function a(e,t,i,n){var a=e*i+t*n;return a>1&&(a=1),a<-1&&(a=-1),(e*n-t*i<0?-1:1)*Math.acos(a)}t.exports=function(e,t,i,r,o,s,l,d,c){var u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E=Math.sin(c*n/360),_=Math.cos(c*n/360),I=_*(e-i)/2+E*(t-r)/2,M=-E*(e-i)/2+_*(t-r)/2;if(0===I&&0===M||0===l||0===d)return[];var T=I*I/((l=Math.abs(l))*l)+M*M/((d=Math.abs(d))*d);T>1&&(l*=Math.sqrt(T),d*=Math.sqrt(T));var L=(u=l,p=d,h=_*(e-i)/2+E*(t-r)/2,m=-E*(e-i)/2+_*(t-r)/2,g=u*u,f=p*p,b=h*h,(y=g*f-g*(x=m*m)-f*b)<0&&(y=0),y/=g*x+f*b,v=(y=Math.sqrt(y)*(o===s?-1:1))*u/p*m,C=-(y*p)/u*h,k=a(1,0,w=(h-v)/u,S=(m-C)/p),A=a(w,S,(-h-v)/u,(-m-C)/p),0===s&&A>0&&(A-=n),1===s&&A<0&&(A+=n),[_*v-E*C+(e+i)/2,E*v+_*C+(t+r)/2,k,A]),j=[],P=L[2],D=L[3],N=Math.max(Math.ceil(Math.abs(D)/(n/4)),1);D/=N;for(var R=0;R{"use strict";var n=Math.PI/180;function a(e,t,i){if(!(this instanceof a))return new a(e,t,i);this.rx=e,this.ry=t,this.ax=i}a.prototype.transform=function(e){var t=Math.cos(this.ax*n),i=Math.sin(this.ax*n),a=[this.rx*(e[0]*t+e[2]*i),this.rx*(e[1]*t+e[3]*i),this.ry*(-e[0]*i+e[2]*t),this.ry*(-e[1]*i+e[3]*t)],r=a[0]*a[0]+a[2]*a[2],o=a[1]*a[1]+a[3]*a[3],s=((a[0]-a[3])*(a[0]-a[3])+(a[2]+a[1])*(a[2]+a[1]))*((a[0]+a[3])*(a[0]+a[3])+(a[2]-a[1])*(a[2]-a[1])),l=(r+o)/2;if(s<1e-10*l)return this.rx=this.ry=Math.sqrt(l),this.ax=0,this;var d=a[0]*a[1]+a[2]*a[3],c=l+(s=Math.sqrt(s))/2,u=l-s/2;return this.ax=1e-10>Math.abs(d)&&1e-10>Math.abs(c-o)?90:180*Math.atan(Math.abs(d)>Math.abs(c-o)?(c-r)/d:d/(c-o))/Math.PI,this.ax>=0?(this.rx=Math.sqrt(c),this.ry=Math.sqrt(u)):(this.ax+=90,this.rx=Math.sqrt(u),this.ry=Math.sqrt(c)),this},a.prototype.isDegenerate=function(){return this.rx<1e-10*this.ry||this.ry<1e-10*this.rx},t.exports=a},974728,(e,t,i)=>{"use strict";var n=e.r(420404),a=e.r(113336),r=e.r(294875),o=e.r(875509),s=e.r(636537);function l(e){if(!(this instanceof l))return new l(e);var t=n(e);this.segments=t.segments,this.err=t.err,this.__stack=[]}l.from=function(e){if("string"==typeof e)return new l(e);if(e instanceof l){var t=new l("");return t.err=e.err,t.segments=e.segments.map(function(e){return e.slice()}),t.__stack=e.__stack.map(function(e){return r().matrix(e.toArray())}),t}throw Error("SvgPath.from: invalid param type "+e)},l.prototype.__matrix=function(e){var t,i=this;e.queue.length&&this.iterate(function(n,a,r,o){var l,d,c,u;switch(n[0]){case"v":d=0===(l=e.calc(0,n[1],!0))[0]?["v",l[1]]:["l",l[0],l[1]];break;case"V":d=(l=e.calc(r,n[1],!1))[0]===e.calc(r,o,!1)[0]?["V",l[1]]:["L",l[0],l[1]];break;case"h":d=0===(l=e.calc(n[1],0,!0))[1]?["h",l[0]]:["l",l[0],l[1]];break;case"H":d=(l=e.calc(n[1],o,!1))[1]===e.calc(r,o,!1)[1]?["H",l[0]]:["L",l[0],l[1]];break;case"a":case"A":var p=e.toArray(),h=s(n[1],n[2],n[3]).transform(p);if(p[0]*p[3]-p[1]*p[2]<0&&(n[5]=n[5]?"0":"1"),l=e.calc(n[6],n[7],"a"===n[0]),"A"===n[0]&&n[6]===r&&n[7]===o||"a"===n[0]&&0===n[6]&&0===n[7]){d=["a"===n[0]?"l":"L",l[0],l[1]];break}d=h.isDegenerate()?["a"===n[0]?"l":"L",l[0],l[1]]:[n[0],h.rx,h.ry,h.ax,n[4],n[5],l[0],l[1]];break;case"m":u=a>0,d=["m",(l=e.calc(n[1],n[2],u))[0],l[1]];break;default:for(t=1,d=[c=n[0]],u=c.toLowerCase()===c;t=0;)e.matrix(this.__stack[t].toArray());this.__matrix(e),this.__stack=[]}},l.prototype.toString=function(){var e="",t="",i=!1;this.__evaluateStack();for(var n=0,a=this.segments.length;n=0&&(e+=" "):l>=0&&(e+=" "),e+=l}t=o}return e},l.prototype.translate=function(e,t){return this.__stack.push(r().translate(e,t||0)),this},l.prototype.scale=function(e,t){return this.__stack.push(r().scale(e,t||0===t?t:e)),this},l.prototype.rotate=function(e,t,i){return this.__stack.push(r().rotate(e,t||0,i||0)),this},l.prototype.skewX=function(e){return this.__stack.push(r().skewX(e)),this},l.prototype.skewY=function(e){return this.__stack.push(r().skewY(e)),this},l.prototype.matrix=function(e){return this.__stack.push(r().matrix(e)),this},l.prototype.transform=function(e){return e.trim()&&this.__stack.push(a(e)),this},l.prototype.round=function(e){var t,i=0,n=0,a=0,r=0;return e=e||0,this.__evaluateStack(),this.segments.forEach(function(o){var s=o[0].toLowerCase()===o[0];switch(o[0]){case"H":case"h":s&&(o[1]+=a),a=o[1]-o[1].toFixed(e),o[1]=+o[1].toFixed(e);return;case"V":case"v":s&&(o[1]+=r),r=o[1]-o[1].toFixed(e),o[1]=+o[1].toFixed(e);return;case"Z":case"z":a=i,r=n;return;case"M":case"m":s&&(o[1]+=a,o[2]+=r),a=o[1]-o[1].toFixed(e),r=o[2]-o[2].toFixed(e),i=a,n=r,o[1]=+o[1].toFixed(e),o[2]=+o[2].toFixed(e);return;case"A":case"a":s&&(o[6]+=a,o[7]+=r),a=o[6]-o[6].toFixed(e),r=o[7]-o[7].toFixed(e),o[1]=+o[1].toFixed(e),o[2]=+o[2].toFixed(e),o[3]=+o[3].toFixed(e+2),o[6]=+o[6].toFixed(e),o[7]=+o[7].toFixed(e);return;default:t=o.length,s&&(o[t-2]+=a,o[t-1]+=r),a=o[t-2]-o[t-2].toFixed(e),r=o[t-1]-o[t-1].toFixed(e),o.forEach(function(t,i){i&&(o[i]=+o[i].toFixed(e))});return}}),this},l.prototype.iterate=function(e,t){var i,n,a,r=this.segments,o={},s=!1,l=0,d=0,c=0,u=0;if(t||this.__evaluateStack(),r.forEach(function(t,i){var n=e(t,i,l,d);Array.isArray(n)&&(o[i]=n,s=!0);var a=t[0]===t[0].toLowerCase();switch(t[0]){case"m":case"M":l=t[1]+(a?l:0),d=t[2]+(a?d:0),c=l,u=d;return;case"h":case"H":l=t[1]+(a?l:0);return;case"v":case"V":d=t[1]+(a?d:0);return;case"z":case"Z":l=c,d=u;return;default:l=t[t.length-2]+(a?l:0),d=t[t.length-1]+(a?d:0)}}),!s)return this;for(i=0,a=[];i{"use strict";t.exports=e.r(974728)},830284,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.AI_LOCALES=i.AI_LOCALE_KEYS=void 0,i.AI_LOCALE_KEYS=["en","en-gb","en-in","es","es-es","es-mx","es-419","ca","fr","zh-cn","zh-tw","ko","ja","ja-da","pt-br","pt-pt","de","it","ru","pl","uk","ro","hu","cs","el","tr","ar","ar-sa","he","fa","nl","sv","da","nb","fi","id","vi","hi","gu","mr","te","bn","ta","ur","kn","ml","th","sr","hr","sq","bg","sl","bs","mk","sw","ha","yo","tl","ms","kk","uz","af","lv","lt","et","is","cy"],i.AI_LOCALES={en:{englishName:"English (US)"},"en-gb":{englishName:"English (UK)"},"en-in":{englishName:"English (India)"},es:{englishName:"Spanish"},"es-es":{englishName:"Spanish (Spain)"},"es-mx":{englishName:"Spanish (Mexico)"},"es-419":{englishName:"Spanish (Latin America)"},ca:{englishName:"Catalan"},fr:{englishName:"French"},"zh-cn":{englishName:"Simplified Chinese"},"zh-tw":{englishName:"Traditional Chinese"},ko:{englishName:"Korean"},ja:{englishName:"Japanese (です/ます style)"},"ja-da":{englishName:"Japanese (だ/である style)"},"pt-br":{englishName:"Portuguese (Brazil)"},"pt-pt":{englishName:"Portuguese (Portugal)"},de:{englishName:"German"},it:{englishName:"Italian"},ru:{englishName:"Russian"},pl:{englishName:"Polish"},uk:{englishName:"Ukrainian"},ro:{englishName:"Romanian"},hu:{englishName:"Hungarian"},cs:{englishName:"Czech"},el:{englishName:"Greek"},tr:{englishName:"Turkish"},ar:{englishName:"Arabic"},"ar-sa":{englishName:"Arabic (Saudi Arabia)"},he:{englishName:"Hebrew"},fa:{englishName:"Persian"},nl:{englishName:"Dutch"},sv:{englishName:"Swedish"},da:{englishName:"Danish"},nb:{englishName:"Norwegian"},fi:{englishName:"Finnish"},id:{englishName:"Indonesian"},vi:{englishName:"Vietnamese"},hi:{englishName:"Hindi"},gu:{englishName:"Gujarati"},mr:{englishName:"Marathi"},te:{englishName:"Telugu"},bn:{englishName:"Bengali"},ta:{englishName:"Tamil"},ur:{englishName:"Urdu"},kn:{englishName:"Kannada"},ml:{englishName:"Malayalam"},th:{englishName:"Thai"},sr:{englishName:"Serbian"},hr:{englishName:"Croatian"},sq:{englishName:"Albanian"},bg:{englishName:"Bulgarian"},sl:{englishName:"Slovenian"},bs:{englishName:"Bosnian"},mk:{englishName:"Macedonian"},sw:{englishName:"Swahili"},ha:{englishName:"Hausa"},yo:{englishName:"Yoruba"},tl:{englishName:"Tagalog"},ms:{englishName:"Malay"},kk:{englishName:"Kazakh"},uz:{englishName:"Uzbek"},af:{englishName:"Afrikaans"},lv:{englishName:"Latvian"},lt:{englishName:"Lithuanian"},et:{englishName:"Estonian"},is:{englishName:"Icelandic"},cy:{englishName:"Welsh"}}},134499,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,a)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),a=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),a(e.r(830284),i)},89227,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.validateCsvContent=i.CSV_MAX_ROWS=i.CSV_MAX_COLUMNS=i.CSV_MAX_SIZE_BYTES=void 0,i.CSV_MAX_SIZE_BYTES=102400,i.CSV_MAX_COLUMNS=6,i.CSV_MAX_ROWS=1e3,i.validateCsvContent=function(e,t={}){let{filename:n="file",maxSizeBytes:a=i.CSV_MAX_SIZE_BYTES,maxColumns:r=i.CSV_MAX_COLUMNS,maxRows:o=i.CSV_MAX_ROWS}=t;if(new TextEncoder().encode(e).length>a)return{valid:!1,error:`CSV file "${n}" exceeds maximum size of ${a/1024} KB`};let s=e.split(/\r?\n/).filter(e=>""!==e.trim());if(s.length>o)return{valid:!1,error:`CSV file "${n}" exceeds maximum of ${o} rows (found ${s.length})`};let l=0;for(let e of s)l=Math.max(l,e.split(",").length);return l>r?{valid:!1,error:`CSV file "${n}" exceeds maximum of ${r} columns (found ${l})`}:{valid:!0}}},70940,(e,t,i)=>{var n=e.r(518219),a=e.r(305792),r=e.r(372285),o=Math.max;t.exports=function(e,t,i){var s=null==e?0:e.length;if(!s)return -1;var l=null==i?0:r(i);return l<0&&(l=o(s+l,0)),n(e,a(t,3),l)}},271015,498201,131363,928286,166292,550963,837438,940126,616820,846443,196444,829814,343902,935150,955300,446924,74056,564246,896416,197071,622758,161268,951190,376257,807727,492812,889601,176636,280484,77606,946107,384392,694801,957897,833431,658729,234867,419087,147313,979504,459014,24066,745914,558247,892493,372030,555027,689130,663025,322830,643940,395993,178428,311996,773194,210792,303236,919352,457776,305463,140753,417692,240178,13556,46453,417416,104056,50044,444577,257549,360137,414556,296753,210104,15647,87959,643292,346312,312086,139809,343094,729088,250332,602235,707188,394305,948714,263582,753128,811477,471194,534316,297036,321791,192984,792276,425605,348258,e=>{"use strict";e.s(["ResizeableWrapper",()=>w],271015);var t,i,n,a,r,o,s,l,d=e.i(391398),c=e.i(428683),u=e.i(613616),p=e.i(470645),h=e.i(413829),m=e.i(783197),g=e.i(864935),f=e.i(685290),b=e.i(529545),x=e.i(51913),y=e.i(256266),v=e.i(755161),C=e.i(136484);let w=({children:e,svgWidthPercent:t=100,...i})=>{let{isNodeSelected:n,editor:a,selectNode:r,updateResizeAttrs:o,attrs:s,alignDirection:l,isEditable:w,layoutContainerSize:S,isFullBleed:k}=i,A=(0,C.useShouldRenderMobileVersion)(),E=(0,m.useIsThumbnailView)(),_=t?(0,h.default)(t/100/Math.min(S,1),0,1):1,{ref:I,setIsResizing:M,resizeableSx:T}=(0,b.useResizeable)(a),L={color:"var(--body-color)",".pptx-exporting-image":{".smart-diagram-textbox":{visibility:"hidden"}},".smart-diagram-wrapper":{"foreignObject *":(0,y.isSafari)()?{position:"static !important"}:void 0,".smart-diagram-textbox":{position:"relative",height:"100%",paddingX:"0.25em",display:"flex",flexDirection:"column",outlineWidth:"1px",outlineStyle:"none",outlineColor:"var(--grid-outline-color)",cursor:"text",".ProseMirror":{width:"100%",height:"100%",display:"flex",flexDirection:"column",gap:"0.5rem","--flex-align":"var(--horizontal-align)",alignItems:"var(--horizontal-align)",justifyContent:"var(--vertical-align)","--line-height-body":"1.25",".block":{my:"0rem",width:"100%"}}},".block-heading, .block-title":{...(0,x.HEADING_MARGINS)(A).tight,"*":{overflowWrap:"break-word",wordBreak:"normal"}},".block-paragraph":{...(0,x.PARAGRAPH_MARGINS)(A).tight,"*":{overflowWrap:"break-word",wordBreak:"normal"}},[`&.is-focused, &:hover, &[${v.HANDLE_HOVERING_ATTR}]`]:w?{".smart-diagram-textbox, .smart-diagram-selection-box":{outlineStyle:"solid"}}:void 0}},j=(0,g.getAlignStyles)(s.horizontalAlign);return(0,d.jsx)(u.Flex,{dir:l,w:"100%",className:f.MOVEABLE_WRAPPER_CLASSNAME,css:j,sx:{...T,...L},direction:"column",onMouseDown:r,children:(0,d.jsxs)(c.Box,{ref:I,className:(0,p.cx)("smart-diagram-wrapper",n?"is-focused":""),"data-drag-handle":!E||void 0,"data-content-reference":!0,"data-selection-ring":!0,w:s.width?`calc((${s.width} * var(--font-size) / 16) * ${_})`:k?"100%":`calc(${100*_}% * var(--media-scale))`,maxW:"100%",position:"relative",children:[w&&n&&!k&&!E&&(0,d.jsx)(b.ResizableControls,{imageWrapperRef:I,setIsResizing:M,updateResizeAttrs:e=>{let t=e.width??s.width;t&&o({...s,...e,width:t/_})},refreshDeps:[s]}),e]})})};var S=e.i(754851);let k={SUBTLE_IMAGE:".subtle.icon",SUBTLE_TEXT:".subtle.textbox",ACCENT_TEXT:".accent.textbox",ACCENT_IMAGE:".accent.icon",BODY_TEXT:".card.textbox",LINE:".line",ACCENT_NO_BORDER:".accent.no-border",ACCENT_DIM:".accent.dim",ACCENT_LIGHT:".accent.light",ACCENT:".accent",SUBTLE_LIGHT:".subtle.light",SUBTLE_DIM:".subtle.dim",SUBTLE:".subtle",NEUTRAL:".neutral"},A={[k.SUBTLE_IMAGE]:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,[k.SUBTLE_TEXT]:S.SHAPE_TEXT_OVER_BACKGROUND_CLASS,[k.ACCENT_NO_BORDER]:(0,p.cx)(S.SVG_SHAPE_FILL_CLASS),[k.ACCENT_DIM]:(0,p.cx)(S.SVG_SHAPE_FILL_DIM_CLASS,S.SVG_SHAPE_BACKGROUND_CLASS),[k.ACCENT_LIGHT]:(0,p.cx)(S.SVG_SHAPE_FILL_LIGHT_CLASS,S.SVG_SHAPE_BACKGROUND_CLASS),[k.ACCENT]:(0,p.cx)(S.SVG_SHAPE_FILL_CLASS,S.SVG_SHAPE_BACKGROUND_CLASS),[k.SUBTLE]:S.SVG_SHAPE_BACKGROUND_CLASS,[k.SUBTLE_DIM]:S.SVG_SHAPE_BACKGROUND_DIM_CLASS,[k.SUBTLE_LIGHT]:S.SVG_SHAPE_BACKGROUND_LIGHT_CLASS,[k.LINE]:S.SVG_LINE_CLASS,[k.ACCENT_TEXT]:S.SHAPE_TEXT_OVER_FILL_CLASS,[k.ACCENT_IMAGE]:S.SHAPE_TEXT_OVER_FILL_CLASS,[k.BODY_TEXT]:S.SHAPE_OUTSIDE_TEXT_CLASS,[k.NEUTRAL]:S.SVG_NEUTRAL_BACKGROUND_CLASS},E={...A,[k.ACCENT_NO_BORDER]:(0,p.cx)(S.SVG_SHAPE_FILL_RTL_CLASS),[k.ACCENT_DIM]:(0,p.cx)(S.SVG_SHAPE_FILL_DIM_RTL_CLASS,S.SVG_SHAPE_BACKGROUND_RTL_CLASS),[k.ACCENT_LIGHT]:(0,p.cx)(S.SVG_SHAPE_FILL_LIGHT_RTL_CLASS,S.SVG_SHAPE_BACKGROUND_RTL_CLASS),[k.ACCENT]:(0,p.cx)(S.SVG_SHAPE_FILL_RTL_CLASS,S.SVG_SHAPE_BACKGROUND_RTL_CLASS),[k.SUBTLE]:S.SVG_SHAPE_BACKGROUND_RTL_CLASS},_=(e,t="ltr")=>{for(let i of Object.values(k))if(e.matches(i)){let n=A[i];if("rtl"===t&&I(e))return E[i];return n}return""},I=e=>["path","circle","ellipse","rect","polygon","polyline"].includes(e.tagName.toLowerCase());e.s(["getBaseClassnameForElement",0,_],498201),e.s(["createIconLabel",()=>P],928286);var M=e.i(233365),T=e.i(703460);let L=({x:e,y:t,width:i,height:n,image:a,iconSize:r=2,isEditable:o,selectItem:s,className:l,style:u})=>(0,d.jsx)("g",{style:u,children:(0,d.jsx)("foreignObject",{x:e,y:t,width:i,height:n,style:{overflow:"visible"},children:(0,d.jsx)(c.Box,{width:"100%",height:"100%",className:l,css:{fill:"var(--body-color)"},children:(0,d.jsx)(T.SmartLayoutIconOrNumber,{image:a||null,selectCell:o?s:void 0,iconSize:r,boxProps:{w:"100%",h:"100%"}})})})});e.s(["SvgIconLabel",0,L],131363);var j=e.i(957734);let P=({element:e,id:t,data:i,isEditable:n,selectItem:a,dataLookupInfo:r,isNodeSelected:o,selectedKeyPath:s})=>{let l=parseFloat(e.getAttribute("x")||"0"),c=parseFloat(e.getAttribute("y")||"0"),u=parseFloat(e.getAttribute("width")||"0"),p=parseFloat(e.getAttribute("height")||"0"),h=u<50?u:50,m=p<50?p:50;if("icon"!==r.type)return{component:null};let g=(0,j.getDataForElement)(r,i),f=(0,j.getKeyPathForElement)(r),b=o&&s===f,x=(0,j.hasEmphasizedSteps)(i),y=1;x&&((0,j.isStepEmphasized)(r,i)||(y=.5));let v=_(e),C={};if((v.includes(S.SHAPE_TEXT_OVER_FILL_CLASS)||v.includes(S.SHAPE_TEXT_OVER_BACKGROUND_CLASS))&&null!==r.stepNumber){let e=i.step?.[r.stepNumber];if(e?.color){let{textColorVars:t}=(0,M.getTextColorVarsForBackground)(e.color);t&&(C=t)}}let w={...1!==y?{opacity:y}:{},...C};return{component:(0,d.jsx)(L,{id:t,x:l+(u-h)/2,y:c+(p-m)/2,width:h,height:m,image:g,isEditable:n,selectItem:()=>{a(f)},isItemSelected:b,style:Object.keys(w).length>0?w:void 0,className:v},f)}};e.s(["createImageElement",()=>U],166292);var D=e.i(524473),N=e.i(541075),R=e.i(462480),O=e.i(281864);function B(e){let t=Math.min(e[0],e[2]),i=Math.max(e[0],e[2]);if(e[1]>=e[0]?e[2]>=e[1]:e[2]<=e[1])return[t,i];let n=(e[0]*e[2]-e[1]*e[1])/(e[0]-2*e[1]+e[2]);return nMath.abs(t))return e[0]===e[3]&&e[0]===e[1]?[e[0],e[3]]:B([e[0],-.5*e[0]+1.5*e[1],e[0]-3*e[1]+3*e[2]]);let i=-e[0]*e[2]+e[0]*e[3]-e[1]*e[2]-e[1]*e[3]+e[1]*e[1]+e[2]*e[2];if(i<=0)return[Math.min(e[0],e[3]),Math.max(e[0],e[3])];let n=Math.sqrt(i),a=Math.min(e[0],e[3]),r=Math.max(e[0],e[3]),o=e[0]-2*e[1]+e[2];for(let i=(o+n)/t,s=1;s<=2;i=(o-n)/t,s++)if(i>0&&i<1){let t=e[0]*(1-i)*(1-i)*(1-i)+3*e[1]*(1-i)*(1-i)*i+3*e[2]*(1-i)*i*i+e[3]*i*i*i;tr&&(r=t)}return[a,r]}var F=e.i(786928),H=e.i(697240),W=e.i(160396);let U=({colors:e,element:t,id:i,data:n,isEditable:a,selectItem:r,dataLookupInfo:o,isNodeSelected:s,selectedKeyPath:l,direction:u="ltr"})=>{let h,m=(0,j.getKeyPathForElement)(o),g=e=>{e?.stopPropagation(),r(m),setTimeout(()=>{(0,F.openMediaDrawer)(!1)},30)},f=(e=>{let t;switch("circle"===(t=e.tagName.toLowerCase())?"circle":"rect"===t?"rect":"path"===t?"path":"unknown"){case"circle":{let t=parseFloat(e.getAttribute("cx")||"0"),i=parseFloat(e.getAttribute("cy")||"0"),n=parseFloat(e.getAttribute("r")||"0");return{type:"circle",x:t-n,y:i-n,width:2*n,height:2*n,clipPath:``}}case"path":{let t=e.getAttribute("d")||"",i=function(e){let t,i,[n,a,r,o]=(t=[1/0,1/0],i=[-1/0,-1/0],O.default.from(e).abs().unarc().unshort().iterate((e,n,a,r)=>{switch(e[0]){case"M":case"L":t[0]>e[1]&&(t[0]=e[1]),t[1]>e[2]&&(t[1]=e[2]),i[0]e[1]&&(t[0]=e[1]),i[0]e[1]&&(t[1]=e[1]),i[1]n[0]&&(t[0]=n[0]),i[0]o[0]&&(t[1]=o[0]),i[1]n[0]&&(t[0]=n[0]),i[0]o[0]&&(t[1]=o[0]),i[1]`}}default:return{type:"rect",x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0"),clipPath:void 0}}})(t),{x:b,y:x,width:y,height:v,clipPath:C}=f,w=(0,j.getDataForElement)(o,n),S=w?.src?(0,W.recolorImageUrl)(w.src,e):w?.src,k=w?.loadImageStatus,A="queued"===k||"loading"===k,E=w?.src,_=!E,I=C?`clip-${(0,R.nanoid)(8)}`:void 0;C&&I&&(h=(0,d.jsxs)("clipPath",{id:I,children:["circle"===f.type&&(0,d.jsx)("circle",{cx:f.x+f.width/2,cy:f.y+f.height/2,r:f.width/2}),"path"===f.type&&(0,d.jsx)("path",{d:t.getAttribute("d")||""}),"rect"===f.type&&(0,d.jsx)("rect",{x:f.x,y:f.y,width:f.width,height:f.height})]},I));let M="rtl"===u?{transform:"scaleX(-1)",transformOrigin:`${b+y/2}px ${x+v/2}px`}:void 0;if(A||!E&&"error"!==k)return{component:(0,d.jsxs)("g",{style:M,children:[(0,d.jsx)("foreignObject",{x:b,y:x,width:y,height:v,style:{overflow:"visible"},clipPath:C?`url(#${I})`:void 0,children:(0,d.jsx)(H.MediaPlaceholderImage,{width:y,height:v,isLoading:A,loadingProvider:"aiGenerated",cursor:a?"pointer":"default"})},`loading-${m}`),a&&(0,d.jsx)("foreignObject",{x:b,y:x,width:y,height:v,style:{overflow:"visible"},children:(0,d.jsx)(c.Box,{className:(0,p.cx)("image"),h:"100%",w:"100%",role:"group",pos:"relative",onMouseDown:e=>{a&&g(e)},children:(0,d.jsx)(c.Box,{bg:"var(--placeholder-button-bg-color)",color:"var(--placeholder-button-text-color)",opacity:+!!_,_groupHover:{opacity:1},pos:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"1.5em",p:"0.5em",borderRadius:"md",cursor:"pointer",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faIcons,fixedWidth:!0})})})})]}),clipPathDef:h};let T=(0,W.isMp4Url)(S);return{component:(0,d.jsxs)("g",{style:M,children:[T?(0,d.jsx)("foreignObject",{x:b,y:x,width:y,height:v,clipPath:C?`url(#${I})`:void 0,children:(0,d.jsx)(W.Mp4Video,{src:S||"",width:"100%",height:"100%",objectFit:"cover"})},`video-${i}`):(0,d.jsx)("image",{x:b,y:x,width:y,height:v,href:S||"",preserveAspectRatio:"xMidYMid slice",clipPath:C?`url(#${I})`:void 0},`image-${i}`),a&&(0,d.jsx)("foreignObject",{x:b,y:x,width:y,height:v,style:{overflow:"visible"},children:(0,d.jsx)(c.Box,{className:(0,p.cx)("image"),h:"100%",w:"100%",role:"group",pos:"relative",onMouseDown:e=>{a&&g(e)},children:(0,d.jsx)(c.Box,{bg:"var(--placeholder-button-bg-color)",color:"var(--placeholder-button-text-color)",opacity:+!!_,_groupHover:{opacity:1},pos:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",fontSize:"1.5em",p:"0.5em",borderRadius:"md",cursor:"pointer",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faIcons,fixedWidth:!0})})})})]}),clipPathDef:h}};e.s(["createSelectionBox",()=>eZ],955300);var V=e.i(969641),G=e.i(358280),$=e.i(296690),Z=e.i(400551);e.s(["SvgSelectionBox",()=>e$],935150);var K=e.i(555145),q=e.i(306841),Y=e.i(470020),X=e.i(882255),Q=e.i(935020),J=e.i(575084),ee=e.i(408122),et=e.i(191788);e.i(734710);var ei=e.i(430378),en=e.i(78387),ea=e.i(442136);let er=e=>!!e&&("image.icon"===e||"image.pictographic.icon"===e);e.s(["isIconSource",0,er],550963);var eo=e.i(758568),es=e.i(308822),el=e.i(175863);class ed extends el.Selection{keyPath;node;context;constructor(e,t){const i=e.nodeAfter,n=e.node(0).resolve(e.pos+i.nodeSize);super(e,n),this.keyPath=t,this.node=i,this.context=this.parseKeyPath(t)}parseKeyPath(e){let t=e.split(".");if(t.length>=2&&("step"===t[0]||"general"===t[0])){let i,n=t[0],a=parseInt(t[1]),r=t[2];if(isNaN(a))return{keyPath:e,selectionType:"property",propertyName:e};switch(r){case"text":i="text";break;case"image":i="image";break;case"icon":i="icon";break;default:i="step"}return{keyPath:e,selectionType:i,..."step"===n?{stepIndex:a}:{generalIndex:a},elementType:r||"selection"}}return{keyPath:e,selectionType:"property",propertyName:e}}map(e,t){let{deleted:i,pos:n}=t.mapResult(this.anchor),a=e.resolve(n);return i?el.Selection.near(a):new ed(a,this.keyPath)}content(){let e=this.getItemData();switch(this.context.selectionType){case"text":case"property":if("string"==typeof e){let t=this.node.type.schema.text(e);return new es.Slice(es.Fragment.from(t),0,0)}break;case"icon":case"image":case"step":if(e&&"object"==typeof e)return new es.Slice(es.Fragment.empty,0,0)}return new es.Slice(es.Fragment.from(this.node),0,0)}getItemData(){if(!this.node.attrs.data)return null;let e=this.node.attrs.data;switch(this.context.selectionType){case"step":if(void 0!==this.context.stepIndex)return e.step?.[this.context.stepIndex];if(void 0!==this.context.generalIndex)return e.general?.[this.context.generalIndex];break;case"text":if(void 0!==this.context.stepIndex)return e.step?.[this.context.stepIndex]?.text;if(void 0!==this.context.generalIndex)return e.general?.[this.context.generalIndex]?.text;break;case"image":if(void 0!==this.context.stepIndex)return e.step?.[this.context.stepIndex]?.image;if(void 0!==this.context.generalIndex)return e.general?.[this.context.generalIndex]?.image;break;case"icon":if(void 0!==this.context.stepIndex)return e.step?.[this.context.stepIndex]?.icon||e.step?.[this.context.stepIndex]?.image;if(void 0!==this.context.generalIndex)return e.general?.[this.context.generalIndex]?.icon||e.general?.[this.context.generalIndex]?.image}return(0,eo.default)(e,this.keyPath)}getSelectionBounds(){return{type:this.context.selectionType,keyPath:this.keyPath,isTextSelection:"text"===this.context.selectionType,isImageSelection:"image"===this.context.selectionType,isIconSelection:"icon"===this.context.selectionType,isStepSelection:"step"===this.context.selectionType,isPropertySelection:"property"===this.context.selectionType}}isInlineEditable(){return"text"===this.context.selectionType||"property"===this.context.selectionType}getSelectionDescription(){switch(this.context.selectionType){case"text":if(void 0!==this.context.stepIndex)return`Step ${this.context.stepIndex+1} text`;if(void 0!==this.context.generalIndex)return`General element ${this.context.generalIndex+1} text`;return"Text element";case"image":if(void 0!==this.context.stepIndex)return`Step ${this.context.stepIndex+1} image`;if(void 0!==this.context.generalIndex)return`General element ${this.context.generalIndex+1} image`;return"Image element";case"icon":if(void 0!==this.context.stepIndex)return`Step ${this.context.stepIndex+1} icon`;if(void 0!==this.context.generalIndex)return`General element ${this.context.generalIndex+1} icon`;return"Icon element";case"step":if(void 0!==this.context.stepIndex)return`Step ${this.context.stepIndex+1}`;if(void 0!==this.context.generalIndex)return`General element ${this.context.generalIndex+1}`;return"Step element";case"property":return`Property: ${this.context.propertyName||this.keyPath}`;default:return`Selection: ${this.keyPath}`}}eq(e){return e instanceof ed&&e.anchor==this.anchor&&e.keyPath==this.keyPath}toJSON(){return{type:"diagramItem",anchor:this.anchor,key:this.keyPath,selectionType:this.context.selectionType}}static fromJSON(e,t){if("number"!=typeof t.anchor||"string"!=typeof t.key)throw RangeError("Invalid input for DiagramItemSelection.fromJSON");return new ed(e.resolve(t.anchor),t.key)}static create(e,t,i){return new this(e.resolve(t),i)}static isSelectable(e){return"smartDiagram"===e.type.name&&e.attrs.data}static createStepSelection(e,t,i){return new this(e.resolve(t),`step.${i}.selection`)}static createTextSelection(e,t,i){return new this(e.resolve(t),`step.${i}.text`)}static createImageSelection(e,t,i){return new this(e.resolve(t),`step.${i}.image`)}static createIconSelection(e,t,i){return new this(e.resolve(t),`step.${i}.icon`)}static createPropertySelection(e,t,i){return new this(e.resolve(t),i)}}if(ed.prototype.visible=!1,!ed.prototype.jsonID)try{el.Selection.jsonID("diagramItem",ed)}catch(e){}e.s(["DiagramItemSelection",0,ed],837438);var ec=e.i(325059),eu=e.i(418755),ep=e.i(349904);e.i(828525);var eh=e.i(896620),em=e.i(274560);let eg=(0,et.forwardRef)(({icon:e="⋮",isVisible:t,isSelected:i,label:n,onClick:a,onDragStart:r,...o},s)=>{let{color:l,bg:c,hoverBg:u,borderColor:p}=(0,em.useGetColorsForDragHandle)(i);return(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:i?void 0:n,children:(0,d.jsx)(ep.Center,{ref:s,position:"absolute",width:"16px",height:"22px",fontWeight:"900",fontFamily:"body",background:c,backdropFilter:"blur(8px)",border:"1px solid",borderColor:p,color:l,borderRadius:"base",boxShadow:"sm",fontSize:"16px",cursor:"pointer",opacity:i||t?1:0,_hover:{background:u,opacity:1},...o,className:"drag-handle",onClick:a,onDragStart:r,draggable:!0,contentEditable:!1,_after:{position:"absolute",content:'""',inset:-2},children:e})})});eg.displayName="BaseDragHandle",e.s(["BaseDragHandle",0,eg],940126),e.s(["ContainerDragHandle",()=>eU,"DRAG_HANDLE_PLACEMENT_STYLES",()=>eW],343902);var ef=e.i(551880),eb=e.i(899611);e.s(["findTableFocusDeco",()=>eS,"findTableHoverDeco",()=>ew,"hasAnnotatableHoverDeco",()=>ek,"hasBlockHoverDeco",()=>eA],616820);var ex=e.i(977581);e.i(6419);var ey=e.i(85547),ev=e.i(103630);e.i(29110),e.i(528403);var eC=e.i(625878);new el.PluginKey("BlockHoverKey");let ew=e=>e.find(e=>e.spec.isTableHover)?.spec||{},eS=e=>e.find(e=>e.spec.isTableFocus)?.spec||{},ek=e=>e.some(e=>e.spec.isAnnotatableHover),eA=e=>e.some(e=>e.spec.isBlockHover);e.s(["FocusedNodes",()=>eF,"isCanvasMultiSelectingNode",()=>ez,"isCanvasSelectingNode",()=>eB,"isFocusedAndEditable",()=>eN,"isFocusedInside",()=>eR,"isSelectingNode",()=>eO],196444);var eE=e.i(755453),e_=e.i(615505),eI=e.i(15272),eM=el;class eT extends eM.Selection{positions;constructor(e,t){if(0===t.length)throw RangeError("CanvasSelection requires at least one position");const i=[...t].sort((e,t)=>e-t),n=i.map(t=>{let i=e.resolve(t),n=i.nodeAfter;if(!n)throw RangeError(`No node at position ${t}`);let a=e.resolve(t+n.nodeSize);return new eM.SelectionRange(i,a)});super(n[0].$from,n[0].$to,n),this.positions=i}map(e,t){let i=[];for(let n of this.positions){let a=t.mapResult(n);if(!a.deleted){let t=e.resolve(a.pos).nodeAfter;t&&eL(t)&&i.push(a.pos)}}if(i.length>0)return new eT(e,i);let n=e.resolve(t.map(this.positions[0]));return eM.Selection.near(n)}content(){let e=this.$from.node(0),t=[];for(let i of this.positions){let n=e.nodeAt(i);n&&t.push(n)}return new es.Slice(es.Fragment.from(t),0,0)}eq(e){return e instanceof eT&&e.positions.length===this.positions.length&&this.positions.every((t,i)=>t===e.positions[i])}toJSON(){return{type:"canvas",positions:this.positions}}static fromJSON(e,t){if(!Array.isArray(t.positions)||0===t.positions.length)throw RangeError("Invalid input for CanvasSelection.fromJSON");return new eT(e,t.positions)}static create(e,t){return new eT(e,t)}static single(e,t){return new eT(e,[t])}static isSelectable(e){return eL(e)}get count(){return this.positions.length}get isMulti(){return this.positions.length>1}togglePosition(e,t){let i=this.positions.indexOf(t);if(!(i>=0))return new eT(e,[...this.positions,t]);{let t=this.positions.filter((e,t)=>t!==i);return 0===t.length?this:new eT(e,t)}}addPosition(e,t){return this.positions.includes(t)?this:new eT(e,[...this.positions,t])}hasPosition(e){return this.positions.includes(e)}}function eL(e){return e.type.spec.group?.includes("positionedBox")??!1}if(eT.prototype.visible=!1,!eT.prototype.jsonID)try{eM.Selection.jsonID("canvas",eT)}catch(e){}e.s(["CanvasSelection",0,eT],846443);var ej=e.i(832300),eP=e.i(714273),eD=e.i(265304);let eN=e=>e.some(e=>e.spec.focusedNode),eR=e=>e.some(e=>e.spec.isFocusedInside),eO=e=>e.some(e=>e.spec.isSelectingNode),eB=e=>e.some(e=>e.spec.isCanvasSelectingNode),ez=e=>e.some(e=>e.spec.isCanvasMultiSelectingNode),eF=eE.Extension.create({name:"focusedNodes",addProseMirrorPlugins(){let e=this.editor;return[new el.Plugin({props:{decorations(t){if(!e.isEditable||!(0,ex.editorHasFocus)(e)||document.activeElement?.tagName==="IFRAME")return;let i=t.selection,n=[],{from:a,to:r}=function(e){if(e.ranges.length<=1)return{from:e.from,to:e.to};let t=e.from,i=e.to;for(let n of e.ranges)t=Math.min(t,n.$from.pos),i=Math.max(i,n.$to.pos);return{from:t,to:i}}(i);return t.doc.nodesBetween(a,r,(e,t,o)=>{if(e.isLeaf||["paragraph","table","tableRow","tableCell","gridLayout","gridCell","heading","title","card","cardLayoutItem","cardAccentLayoutItem","cardImageItem","button","buttonGroup","label","labelGroup","gallery","blockquote","calloutBox","smartLayout","smartLayoutCell","toggle","navbar","navbarLinks","grid","gridItem","positionedTextbox","positionedContentBox","positionedHtmlBox","htmlTextItem","htmlContainerItem","graphic"].includes(e.type.name)){let s=i instanceof eP.CellSelection2&&"tableRow"===e.type.name&&i.getTableNode()===o&&i.isRowSelection()&&!i.isColSelection(),l=i instanceof eP.CellSelection2&&(0,eD.isTableNode)(e)&&i.getTableNode()===e&&i.isSelectingAllCells(),d=i instanceof eT&&i.hasPosition(t),c=d&&i.isMulti,u={focusedNode:!0,isSelected:a<=t,isFocusedInside:a>t||r=t+e.nodeSize&&!(i instanceof el.NodeSelection)},p=[u.focusedNode?"is-focused":"",u.isSelected?"is-selected":"",u.isFocusedInside?"is-focused-inside":"",u.isSelectingNode?"is-selecting-node":"",u.isSelectingAround?"is-selecting-around":""].join(" ");n.push(e_.Decoration.node(t,t+e.nodeSize,{class:p},u))}if((0,eI.isGalleryNode)(e)&&i.from<=t&&i.from<=t)return!1;if("table"===e.type.name&&i instanceof eP.CellSelection2&&i.isColSelection()&&!i.isSelectingAllCells()){let a=i.$anchorCell.pos,{left:r}=ej.TableMap.get(e).findCell(a-(t+1));n.push(e_.Decoration.node(t,t+e.nodeSize,{},{isColumnSelected:!0,colNumber:r}))}}),e_.DecorationSet.create(t.doc,n)}}})]}}),eH=e=>e.some(e=>e.spec.isFocusedInside);e.s(["isFocusedInside",0,eH,"isNonEmptyTextSelection",0,e=>{let t=e.state.selection;return t instanceof el.TextSelection&&!t.empty},"isSelectingNodeOrInside",0,e=>e.some(e=>e.spec.isSelectingNode||e.spec.isFocusedInside)],829814);let eW=e=>({top:{top:"0",insetInlineStart:"50%",height:"16px",width:"26px",pt:"1px",icon:"⋯",zIndex:"3",transform:`translateY(-50%) translateX(${e?"50%":"-50%"})`,fontSize:"15px"},left:{top:"50%",insetInlineStart:"0",height:"26px",width:"16px",zIndex:"3",transform:`translateY(-50%) translateX(${e?"50%":"-50%"})`,fontSize:"15px"},outside:{top:0,insetInlineStart:-6},inside:{top:2,insetInlineStart:3},custom:{}}),eU=({handlePlacement:e,editor:t,getPos:i,decorations:n,isVisible:a,onClick:r,onDragStart:o,node:s,selected:l,extension:u,updateAttributes:p,deleteNode:h,view:g,innerDecorations:f,HTMLAttributes:b,...x})=>{let y=(0,eu.useAppSelector)(ef.selectEditable),v=(0,ec.useRtlEnabled)(),C=(0,m.useIsThumbnailView)(),w=(0,et.useCallback)(e=>{let n=i();"number"==typeof n&&(t.commands.selectNodeAtPos(n),e.stopPropagation())},[t,i]),S=(0,et.useCallback)(e=>{let n=i();if("number"!=typeof n)return;let a=e.target.closest("[data-node-view-wrapper]")?.querySelector("[data-selection-ring]")||void 0;(0,eb.handleDragStart)(t,e.nativeEvent,n,a),e.stopPropagation()},[t,i]),k=o||S;if(!y||C)return null;let A=eA(n),E=eH(n),_=eO(n);return(a??=A||E,"outside"===e)?(0,d.jsx)(c.Box,{position:"absolute",...eW(v).outside,bottom:0,width:6,children:(0,d.jsx)(eg,{isSelected:_,isVisible:a,onClick:r||w,onDragStart:k,top:0,insetInlineStart:0,...x})}):(0,d.jsx)(eg,{isSelected:_,isVisible:a,onClick:r||w,onDragStart:k,...eW(v)[e],...x})},eV=(0,et.forwardRef)(({handlePlacement:e="outside",onClick:t,isSelected:i},n)=>{let a=(0,eu.useAppSelector)(ef.selectEditable),r=(0,ec.useRtlEnabled)(),o=(0,et.useCallback)(e=>{},[]),s=(0,et.useCallback)(e=>{t?.(),e.stopPropagation()},[t]);return a?(0,d.jsx)(eg,{ref:n,isSelected:i,isVisible:!0,onMouseDown:s,onDragStart:o,...eW(r)[e]}):null});eV.displayName="SelectionHandle";let eG=({hasFocus:e,onClickHandle:t,stepAttributes:i,updateStep:n,children:a,editor:r,selectItem:o,dataLookupInfo:s})=>{let l=(0,F.useToggleMediaDrawer)(),c=!!r,u=i?.icon,p=!!u?.src,h=(0,et.useMemo)(()=>u?er(u.source)?"icon":"image":"icon",[u]),m=(0,et.useCallback)(()=>{n&&n({icon:null,image:null})},[n]),g=(0,et.useCallback)(e=>{o&&s?(o((0,j.getKeyPathForElement)({...s,type:"icon"})),r&&r.view.focus(),l({isOpen:!0}),e.stopPropagation()):r&&(r.view.focus(),l({isOpen:!0}),e.stopPropagation())},[o,s,r,l]);return(0,d.jsxs)(q.Popover,{isOpen:e,autoFocus:!1,closeOnBlur:!1,closeOnEsc:!1,placement:"top",children:[(0,d.jsx)(Y.PopoverAnchor,{children:(0,d.jsx)(eV,{handlePlacement:"top",onClick:t,isSelected:e})}),(0,d.jsx)(Q.Portal,{children:(0,d.jsx)(X.PopoverContent,{width:"fit-content",children:(0,d.jsxs)(K.HStack,{"data-in-editor-focus":!0,children:[r&&(0,d.jsx)($.ToolbarButton,{onClick:()=>{if(r&&r.state.selection instanceof ed){let e=r.state.selection.anchor;r.commands.selectNodeAtPos(e)}},label:ee.i18n._({id:"yGxcio",message:"Select parent"}),children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faArrowTurnUp,flip:"horizontal"})}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(ea.ColorButton,{color:i?.color,setColor:e=>{n?.({color:e}),ei.analytics.track(en.SegmentEvents.SMART_DIAGRAM_OPTION_UPDATED,{optionType:"elementColor",previousValue:i?.color,newValue:e})},analyticsSource:"SmartDiagram"}),(0,d.jsx)($.ToolbarButton,{label:ee.i18n._({id:"m1crrt",message:"Emphasize"}),onClick:()=>{let e=!i?.isEmphasized;n?.({isEmphasized:e}),ei.analytics.track(en.SegmentEvents.SMART_DIAGRAM_OPTION_UPDATED,{optionType:"elementEmphasis",previousValue:i?.isEmphasized,newValue:e})},icon:i?.isEmphasized?J.faStar:D.faStar,isActive:!1,"data-in-editor-focus":!0}),c&&(0,d.jsxs)(d.Fragment,{children:[p?(0,d.jsx)($.ToolbarButton,{label:"icon"===h?(0,d.jsx)(G.Trans,{message:"Edit icon...",id:"JE/4q/"}):(0,d.jsx)(G.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:"icon"===h?D.faIcons:D.faEdit,onClick:g,"data-in-editor-focus":!0}):(0,d.jsx)($.ToolbarButton,{label:"icon"===h?(0,d.jsx)(G.Trans,{message:"Add icon...",id:"1SYZRR"}):(0,d.jsx)(G.Trans,{message:"Add image...",id:"pVb3uA"}),icon:"icon"===h?D.faIcons:D.faImage,onClick:g,"data-in-editor-focus":!0}),p&&(0,d.jsx)($.ToolbarButton,{label:"icon"===h?(0,d.jsx)(G.Trans,{message:"Remove icon",id:"+4mjS6"}):(0,d.jsx)(G.Trans,{message:"Reset image",id:"EyVcag"}),icon:D.faImageSlash,color:"red.500",onClick:m,"data-in-editor-focus":!0})]}),a]})})})]})},e$=({x:e,y:t,width:i,height:n,isEditable:a,selectItem:r,selectItemWithKeyPath:o,isItemSelected:s,isStepSelected:l,stepAttributes:u,updateStep:p,formattingMenuItems:h,editor:g,shouldShowMenu:f=s,dataLookupInfo:b})=>{let x=(0,m.useIsThumbnailView)();return(0,d.jsxs)("foreignObject",{x:e,y:t,width:i,height:n,style:{overflow:"visible"},children:[(0,d.jsx)(c.Box,{width:"100%",height:"100%",onMouseDown:e=>{a&&(r(),e.stopPropagation())},borderRadius:"var(--box-border-radius)",css:{outlineStyle:s||l?"solid":"none",outlineColor:s?"var(--chakra-colors-trueblue-300)":"var(--grid-outline-color)",outlineWidth:s?"2px":"1px"},className:"smart-diagram-selection-box"}),f&&!x&&(0,d.jsx)(eG,{hasFocus:f,onClickHandle:r,stepAttributes:u,updateStep:p,editor:g,selectItem:o,dataLookupInfo:b,children:h})]})},eZ=({element:e,id:t,data:i,editor:n,isEditable:a,updateData:r,selectItem:o,dataLookupInfo:s,_isNodeSelected:l,selectedKeyPath:c,modifyingFns:u,isTextMenuVisible:p})=>{let h=parseFloat(e.getAttribute("x")||"0"),m=parseFloat(e.getAttribute("y")||"0"),g=parseFloat(e.getAttribute("width")||"0"),f=parseFloat(e.getAttribute("height")||"0");if("selection"!==s.type)return null;let b=(0,j.getKeyPathForElement)(s),x=c===b,y=!!c&&(0,j.checkAnyItemInStepSelected)(s,c),v=x&&!p,C=(0,j.getStepData)(s,i);return(0,d.jsx)(e$,{id:t,x:h,y:m,width:g,height:f,isEditable:a,selectItem:()=>{o(b)},selectItemWithKeyPath:o,isItemSelected:x,shouldShowMenu:v,isStepSelected:y,stepAttributes:C||void 0,updateStep:e=>{r(t=>{let{stepNumber:i,generalNumber:n}=s;return!0===e.isEmphasized?(t.step&&(t.step=t.step.map((e,t)=>({...e,isEmphasized:t===i}))),t.general&&(t.general=t.general.map((e,t)=>({...e,isEmphasized:t===n})))):(null!==i&&t.step&&(t.step=[...t.step],t.step[i]={...t.step[i],...e}),null!==n&&t.general&&(t.general=[...t.general],t.general[n]={...t.general[n],...e})),t})},editor:n,dataLookupInfo:s,formattingMenuItems:(0,d.jsx)(eK,{canAddStep:u.canAddStep,canRemoveStep:u.canRemoveStep,addStep:u.addStep,removeStep:u.removeStep,dataLookupInfo:s})},b)},eK=({canAddStep:e,canRemoveStep:t,addStep:i,removeStep:n,dataLookupInfo:a})=>(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(V.Button,{disabled:!e,size:"sm",variant:"toolbar",onClick:()=>null!==a.stepNumber&&i(a.stepNumber),leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faCirclePlus}),ms:2,children:(0,d.jsx)(G.Trans,{message:"Add before",id:"hfkdR8"})}),(0,d.jsx)(V.Button,{disabled:!e,size:"sm",variant:"toolbar",onClick:()=>null!==a.stepNumber&&i(a.stepNumber+1),leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faCirclePlus}),children:(0,d.jsx)(G.Trans,{message:"Add after",id:"Y1oj5r"})}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)($.ToolbarButton,{disabled:!t,label:(0,d.jsx)(G.Trans,{message:"Delete",id:"cnGeoo"}),onClick:()=>n(a.stepNumber),icon:D.faTrash,color:"red.500"})]});e.s(["applyCssVars",0,(e,t)=>{t&&Object.entries(t).forEach(([t,i])=>{void 0!==i&&e.style.setProperty(t,i.toString())})},"getFlexAlign",0,e=>"middle"===e?"center":e,"getTextAlign",0,e=>({start:"left",middle:"center",end:"right"})[e]],446924),e.s(["BASE_FONT_SIZE",0,18],74056),e.i(879075),e.i(609e3),e.i(144320),e.i(533109),e.i(30736);var eq=e.i(53500),eY=e.i(586484);function eX(){return(0,et.useContext)(eY.EditorStateContext)}e.s(["useEditorState",0,eX],564246),e.i(218557),e.i(653689),e.i(350879),e.i(774929),e.s(["useIsEditorStatic",0,function(){return(0,et.useContext)(eq.EditorContext)?.isStatic??!1}],896416),e.i(234907),e.i(772777),e.i(300700),e.s([],197071),e.s(["adjustColWidthsInRearrange",()=>tr,"canColumnContainSlice",()=>e8,"checkColumnDropTarget",()=>e3,"getColIndex",()=>ta,"getLayoutCellResolvedPos",()=>tn,"getLayoutChildren",()=>tt,"getParentLayout",()=>te,"isLayoutCellNode",()=>e2,"isLayoutNode",()=>e1],622758);var eQ=e.i(24439);let eJ=["card","document","gridLayout","gallery"],e0=e=>e.isBlock&&!eJ.includes(e.type.name)&&!(e.isTextblock&&(0,ex.isNodeEmpty)(e)),e1=e=>"gridLayout"===e.type.name,e2=e=>"gridCell"===e.type.name,e3=(e,t,i)=>{if(((e,t,i)=>{let n,a=e.posAtCoords({left:t.clientX,top:t.clientY})?.inside;if(null==a||-1===a)return!1;try{n=e.state.doc.resolve(a)}catch{return!1}return!!(0,eI.isNodeInGallery)(n)&&(!i||!!(0,eI.canGalleryContainSlice)(i,e.state.schema))})(e,t,i))return null;let n=i&&e5(e,i,t);if(n)return n;if(i&&!e8(i,e.state.schema))return null;let a=e4(e,t,"right")||e4(e,t,"left");return!a||i&&i.content.firstChild===a.node?null:a},e5=(e,t,i)=>{if(!e7(t,e.state.schema))return null;let n=e.posAtCoords({left:i.clientX,top:i.clientY})?.inside;if(!n||-1==n)return null;let{doc:a}=e.state,r=a.resolve(n),o=a.nodeAt(n),s=o&&e2(o)?{node:o,pos:n}:(0,eE.findParentNodeClosestToPos)(r,e2),l=s?.pos&&(0,ex.rectAtPos)(s.pos,e);if(!s||!l)return null;let d=i.clientX>l.left+l.width/2?"right":"left";return{pos:s.pos,node:s.node,rect:l,side:d}},e4=(e,t,i)=>{let n=e.posAtCoords({left:t.clientX+("left"==i?30:-30),top:t.clientY})?.inside;if(!n||-1==n)return null;let{doc:a,schema:r}=e.state,o=a.resolve(n),s=a.nodeAt(n),l=s&&e0(s)?{node:s,pos:n}:(0,eE.findParentNodeClosestToPos)(o,e0);if(!l)return null;let d=(0,ex.rectAtPos)(n,e);if(!d)return null;let c="left"==i?t.clientX-d.left:d.right-t.clientX,u=c<0,p=30*(s?.type.name!=="gridCell");if(!(u&&c>-p||"right"==i&&c<(d.right-d.left)*.15))return null;let h=a.resolve(l.pos),m=s?.type.name==="gridCell"&&e6(h,r)||e9(h,r);if(u||!m){let t=(0,eE.findParentNodeClosestToPos)(o,e=>"gridCell"===e.type.name);if(t&&e6(a.resolve(t.pos),r)){let n=(0,ex.rectAtPos)(t.pos,e);return n?{pos:t.pos,node:t.node,side:i,rect:n}:null}}return m?{pos:l.pos,rect:d,node:l.node,side:i}:null},e6=(e,t)=>e.parent.canReplaceWith(e.index(),e.index(),t.nodes.gridCell),e9=(e,t)=>e.parent.canReplaceWith(e.index(),e.indexAfter(),t.nodes.gridLayout),e8=(e,t)=>t.nodes.gridCell.validContent(e.content),e7=(e,t)=>t.nodes.gridLayout.validContent(e.content),te=e=>ti(e,"gridLayout"),tt=e=>{let t=ti(e,"gridLayout");if(!t||!t.nodeAfter)throw Error("No layout found");let i=t.nodeAfter,n=[],a=t.start(t.depth+1);for(let e=0;e{if(e.nodeAfter?.type.name===t)return e;let i=e.doc;for(let n=e.depth;n>0;n--)if(e.node(n).type.name===t)return i.resolve(e.before(n));return null},tn=(e,t)=>{let i=tt(e),n=i[-1===t?i.length-1:t];return n?e.doc.resolve(n.pos):null},ta=e=>tt(e).findIndex(t=>t.pos===e.pos),tr=(e,t,i)=>{let n=(0,eQ.getDecorationsForNode)(i,e).find(e=>e.spec.isLayoutCellDecoration)?.spec.colIndex,a=(0,eQ.getDecorationsForNode)(i,t).find(e=>e.spec.isLayoutCellDecoration)?.spec.colIndex,r=i.state.doc.resolve(e),o=(0,eE.findParentNodeClosestToPos)(r,e1);if(!o)return;let s=i.state.doc.resolve(t),l=(0,eE.findParentNodeClosestToPos)(s,e1);if(!l||l.pos!==o.pos)return;let d=[...o.node.attrs.colWidths],[c]=d.splice(n,1);return d.splice(a,0,c),{colWidths:d,parentPos:o.pos}};e.s(["NAVBAR_BACKDROP_CLASS",0,"navbar-view-backdrop","NAVBAR_CONTENT_CLASS",0,"navbar-view-content","NAVBAR_HEIGHT",0,"75px","NAVBAR_HEIGHT_PX",0,75,"NAVBAR_PADDING_PX",0,10,"NAVBAR_TOGGLE_CLOSED_ATTR",0,"data-navbar-closed-toggle"],161268),e.s(["CellSelection",()=>eP.CellSelection2],951190),e.i(314572);var to=e.i(835128),ts=e.i(24316);function tl(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function td(e){var t=tl(e).Element;return e instanceof t||e instanceof Element}function tc(e){var t=tl(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function tu(e){if("u"0&&(n=tm(i.width)/o||1),r>0&&(a=tm(i.height)/r||1)}return{width:i.width/n,height:i.height/a,top:i.top/a,right:i.right/n,bottom:i.bottom/a,left:i.left/n,x:i.left/n,y:i.top/a}}function tf(e){var t=tl(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function tb(e){return e?(e.nodeName||"").toLowerCase():null}function tx(e){return((td(e)?e.ownerDocument:e.document)||window.document).documentElement}function ty(e){return tg(tx(e)).left+tf(e).scrollLeft}function tv(e){return tl(e).getComputedStyle(e)}function tC(e){var t=tv(e),i=t.overflow,n=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+a+n)}function tw(e){var t=tg(e),i=e.offsetWidth,n=e.offsetHeight;return 1>=Math.abs(t.width-i)&&(i=t.width),1>=Math.abs(t.height-n)&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function tS(e){return"html"===tb(e)?e:e.assignedSlot||e.parentNode||(tu(e)?e.host:null)||tx(e)}function tk(e,t){void 0===t&&(t=[]);var i,n=function e(t){return["html","body","#document"].indexOf(tb(t))>=0?t.ownerDocument.body:tc(t)&&tC(t)?t:e(tS(t))}(e),a=n===(null==(i=e.ownerDocument)?void 0:i.body),r=tl(n),o=a?[r].concat(r.visualViewport||[],tC(n)?n:[]):n,s=t.concat(o);return a?s:s.concat(tk(tS(o)))}function tA(e){return tc(e)&&"fixed"!==tv(e).position?e.offsetParent:null}function tE(e){for(var t=tl(e),i=tA(e);i&&["table","td","th"].indexOf(tb(i))>=0&&"static"===tv(i).position;)i=tA(i);return i&&("html"===tb(i)||"body"===tb(i)&&"static"===tv(i).position)?t:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&tc(e)&&"fixed"===tv(e).position)return null;for(var i=tS(e);tc(i)&&0>["html","body"].indexOf(tb(i));){var n=tv(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}var t_="bottom",tI="right",tM="left",tT="auto",tL=["top",t_,tI,tM],tj="start",tP="viewport",tD="popper",tN=tL.reduce(function(e,t){return e.concat([t+"-"+tj,t+"-end"])},[]),tR=[].concat(tL,[tT]).reduce(function(e,t){return e.concat([t,t+"-"+tj,t+"-end"])},[]),tO=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function tB(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&tu(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function tz(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function tF(e,t){var i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x;return t===tP?tz((i=tl(e),n=tx(e),a=i.visualViewport,r=n.clientWidth,o=n.clientHeight,s=0,l=0,a&&(r=a.width,o=a.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(s=a.offsetLeft,l=a.offsetTop)),{width:r,height:o,x:s+ty(e),y:l})):td(t)?((d=tg(t)).top=d.top+t.clientTop,d.left=d.left+t.clientLeft,d.bottom=d.top+t.clientHeight,d.right=d.left+t.clientWidth,d.width=t.clientWidth,d.height=t.clientHeight,d.x=d.left,d.y=d.top,d):tz((c=tx(e),p=tx(c),h=tf(c),m=null==(u=c.ownerDocument)?void 0:u.body,g=tp(p.scrollWidth,p.clientWidth,m?m.scrollWidth:0,m?m.clientWidth:0),f=tp(p.scrollHeight,p.clientHeight,m?m.scrollHeight:0,m?m.clientHeight:0),b=-h.scrollLeft+ty(c),x=-h.scrollTop,"rtl"===tv(m||p).direction&&(b+=tp(p.clientWidth,m?m.clientWidth:0)-g),{width:g,height:f,x:b,y:x}))}function tH(e){return e.split("-")[0]}function tW(e){return e.split("-")[1]}function tU(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function tV(e){var t,i=e.reference,n=e.element,a=e.placement,r=a?tH(a):null,o=a?tW(a):null,s=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(r){case"top":t={x:s,y:i.y-n.height};break;case t_:t={x:s,y:i.y+i.height};break;case tI:t={x:i.x+i.width,y:l};break;case tM:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var d=r?tU(r):null;if(null!=d){var c="y"===d?"height":"width";switch(o){case tj:t[d]=t[d]-(i[c]/2-n[c]/2);break;case"end":t[d]=t[d]+(i[c]/2-n[c]/2)}}return t}function tG(){return{top:0,right:0,bottom:0,left:0}}function t$(e){return Object.assign({},tG(),e)}function tZ(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}function tK(e,t){void 0===t&&(t={});var i,n,a,r,o,s,l,d,c,u=t,p=u.placement,h=void 0===p?e.placement:p,m=u.boundary,g=u.rootBoundary,f=u.elementContext,b=void 0===f?tD:f,x=u.altBoundary,y=u.padding,v=void 0===y?0:y,C=t$("number"!=typeof v?v:tZ(v,tL)),w=e.rects.popper,S=e.elements[void 0!==x&&x?b===tD?"reference":tD:b],k=(i=td(S)?S:S.contextElement||tx(e.elements.popper),n=void 0===m?"clippingParents":m,a=void 0===g?tP:g,d=(l=[].concat("clippingParents"===n?(r=tk(tS(i)),!td(s=(o=["absolute","fixed"].indexOf(tv(i).position)>=0)&&tc(i)?tE(i):i)?[]:r.filter(function(e){return td(e)&&tB(e,s)&&"body"!==tb(e)&&(!o||"static"!==tv(e).position)})):[].concat(n),[a]))[0],(c=l.reduce(function(e,t){var n=tF(i,t);return e.top=tp(n.top,e.top),e.right=th(n.right,e.right),e.bottom=th(n.bottom,e.bottom),e.left=tp(n.left,e.left),e},tF(i,d))).width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c),A=tg(e.elements.reference),E=tV({reference:A,element:w,strategy:"absolute",placement:h}),_=tz(Object.assign({},w,E)),I=b===tD?_:A,M={top:k.top-I.top+C.top,bottom:I.bottom-k.bottom+C.bottom,left:k.left-I.left+C.left,right:I.right-k.right+C.right},T=e.modifiersData.offset;if(b===tD&&T){var L=T[h];Object.keys(M).forEach(function(e){var t=[tI,t_].indexOf(e)>=0?1:-1,i=["top",t_].indexOf(e)>=0?"y":"x";M[e]+=L[i]*t})}return M}var tq={placement:"bottom",modifiers:[],strategy:"absolute"};function tY(){for(var e=arguments.length,t=Array(e),i=0;i=(A.devicePixelRatio||1)?"translate("+x+"px, "+v+"px)":"translate3d("+x+"px, "+v+"px, 0)",r)):Object.assign({},M,((a={})[k]=w?v+"px":"",a[S]=C?x+"px":"",a.transform="",a))}let t0={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},a=t.elements[e];tc(a)&&tb(a)&&(Object.assign(a.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?a.removeAttribute(e):a.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],a=t.attributes[e]||{},r=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});tc(n)&&tb(n)&&(Object.assign(n.style,r),Object.keys(a).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};var t1={left:"right",right:"left",bottom:"top",top:"bottom"};function t2(e){return e.replace(/left|right|bottom|top/g,function(e){return t1[e]})}var t3={start:"end",end:"start"};function t5(e){return e.replace(/start|end/g,function(e){return t3[e]})}function t4(e,t,i){return tp(e,th(t,i))}function t6(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function t9(e){return["top",tI,t_,tM].some(function(t){return e[t]>=0})}var t8=(n=void 0===(i=(t={defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,a=n.scroll,r=void 0===a||a,o=n.resize,s=void 0===o||o,l=tl(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return r&&d.forEach(function(e){e.addEventListener("scroll",i.update,tX)}),s&&l.addEventListener("resize",i.update,tX),function(){r&&d.forEach(function(e){e.removeEventListener("scroll",i.update,tX)}),s&&l.removeEventListener("resize",i.update,tX)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=tV({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,a=i.adaptive,r=i.roundOffsets,o=void 0===r||r,s={placement:tH(t.placement),variation:tW(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:void 0===n||n,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,tJ(Object.assign({},s,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:void 0===a||a,roundOffsets:o})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,tJ(Object.assign({},s,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:o})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},t0,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,a=i.offset,r=void 0===a?[0,0]:a,o=tR.reduce(function(e,i){var n,a,o,s,l,d;return e[i]=(n=t.rects,o=[tM,"top"].indexOf(a=tH(i))>=0?-1:1,l=(s="function"==typeof r?r(Object.assign({},n,{placement:i})):r)[0],d=s[1],l=l||0,d=(d||0)*o,[tM,tI].indexOf(a)>=0?{x:d,y:l}:{x:l,y:d}),e},{}),s=o[t.placement],l=s.x,d=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=d),t.modifiersData[n]=o}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var a=i.mainAxis,r=void 0===a||a,o=i.altAxis,s=void 0===o||o,l=i.fallbackPlacements,d=i.padding,c=i.boundary,u=i.rootBoundary,p=i.altBoundary,h=i.flipVariations,m=void 0===h||h,g=i.allowedAutoPlacements,f=t.options.placement,b=tH(f)===f,x=l||(b||!m?[t2(f)]:function(e){if(tH(e)===tT)return[];var t=t2(e);return[t5(e),t,t5(t)]}(f)),y=[f].concat(x).reduce(function(e,i){var n,a,r,o,s,l,p,h,f,b,x,y;return e.concat(tH(i)===tT?(a=(n={placement:i,boundary:c,rootBoundary:u,padding:d,flipVariations:m,allowedAutoPlacements:g}).placement,r=n.boundary,o=n.rootBoundary,s=n.padding,l=n.flipVariations,h=void 0===(p=n.allowedAutoPlacements)?tR:p,0===(x=(b=(f=tW(a))?l?tN:tN.filter(function(e){return tW(e)===f}):tL).filter(function(e){return h.indexOf(e)>=0})).length&&(x=b),Object.keys(y=x.reduce(function(e,i){return e[i]=tK(t,{placement:i,boundary:r,rootBoundary:o,padding:s})[tH(i)],e},{})).sort(function(e,t){return y[e]-y[t]})):i)},[]),v=t.rects.reference,C=t.rects.popper,w=new Map,S=!0,k=y[0],A=0;A=0,T=M?"width":"height",L=tK(t,{placement:E,boundary:c,rootBoundary:u,altBoundary:p,padding:d}),j=M?I?tI:tM:I?t_:"top";v[T]>C[T]&&(j=t2(j));var P=t2(j),D=[];if(r&&D.push(L[_]<=0),s&&D.push(L[j]<=0,L[P]<=0),D.every(function(e){return e})){k=E,S=!1;break}w.set(E,D)}if(S)for(var N=m?3:1,R=function(e){var t=y.find(function(t){var i=w.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return k=t,"break"},O=N;O>0&&"break"!==R(O);O--);t.placement!==k&&(t.modifiersData[n]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,a=i.mainAxis,r=i.altAxis,o=i.boundary,s=i.rootBoundary,l=i.altBoundary,d=i.padding,c=i.tether,u=void 0===c||c,p=i.tetherOffset,h=void 0===p?0:p,m=tK(t,{boundary:o,rootBoundary:s,padding:d,altBoundary:l}),g=tH(t.placement),f=tW(t.placement),b=!f,x=tU(g),y="x"===x?"y":"x",v=t.modifiersData.popperOffsets,C=t.rects.reference,w=t.rects.popper,S="function"==typeof h?h(Object.assign({},t.rects,{placement:t.placement})):h,k="number"==typeof S?{mainAxis:S,altAxis:S}:Object.assign({mainAxis:0,altAxis:0},S),A=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(v){if(void 0===a||a){var _,I="y"===x?"top":tM,M="y"===x?t_:tI,T="y"===x?"height":"width",L=v[x],j=L+m[I],P=L-m[M],D=u?-w[T]/2:0,N=f===tj?C[T]:w[T],R=f===tj?-w[T]:-C[T],O=t.elements.arrow,B=u&&O?tw(O):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:tG(),F=z[I],H=z[M],W=t4(0,C[T],B[T]),U=b?C[T]/2-D-W-F-k.mainAxis:N-W-F-k.mainAxis,V=b?-C[T]/2+D+W+H+k.mainAxis:R+W+H+k.mainAxis,G=t.elements.arrow&&tE(t.elements.arrow),$=G?"y"===x?G.clientTop||0:G.clientLeft||0:0,Z=null!=(_=null==A?void 0:A[x])?_:0,K=t4(u?th(j,L+U-Z-$):j,L,u?tp(P,L+V-Z):P);v[x]=K,E[x]=K-L}if(void 0!==r&&r){var q,Y,X="x"===x?"top":tM,Q="x"===x?t_:tI,J=v[y],ee="y"===y?"height":"width",et=J+m[X],ei=J-m[Q],en=-1!==["top",tM].indexOf(g),ea=null!=(Y=null==A?void 0:A[y])?Y:0,er=en?et:J-C[ee]-w[ee]-ea+k.altAxis,eo=en?J+C[ee]+w[ee]-ea-k.altAxis:ei,es=u&&en?(q=t4(er,J,eo))>eo?eo:q:t4(u?er:et,J,u?eo:ei);v[y]=es,E[y]=es-J}t.modifiersData[n]=E}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,a=e.options,r=i.elements.arrow,o=i.modifiersData.popperOffsets,s=tH(i.placement),l=tU(s),d=[tM,tI].indexOf(s)>=0?"height":"width";if(r&&o){var c,u=(c=a.padding,t$("number"!=typeof(c="function"==typeof c?c(Object.assign({},i.rects,{placement:i.placement})):c)?c:tZ(c,tL))),p=tw(r),h="y"===l?"top":tM,m="y"===l?t_:tI,g=i.rects.reference[d]+i.rects.reference[l]-o[l]-i.rects.popper[d],f=o[l]-i.rects.reference[l],b=tE(r),x=b?"y"===l?b.clientHeight||0:b.clientWidth||0:0,y=u[h],v=x-p[d]-u[m],C=x/2-p[d]/2+(g/2-f/2),w=t4(y,C,v);i.modifiersData[n]=((t={})[l]=w,t.centerOffset=w-C,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;if(null!=n){if("string"==typeof n&&!(n=t.elements.popper.querySelector(n))||!tB(t.elements.popper,n))return;t.elements.arrow=n}},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,a=t.rects.popper,r=t.modifiersData.preventOverflow,o=tK(t,{elementContext:"reference"}),s=tK(t,{altBoundary:!0}),l=t6(o,n),d=t6(s,a,r),c=t9(l),u=t9(d);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:d,isReferenceHidden:c,hasPopperEscaped:u},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":u})}}]}).defaultModifiers)?[]:i,r=void 0===(a=t.defaultOptions)?tq:a,function(e,t,i){void 0===i&&(i=r);var a,o,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},tq,r),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],d=!1,c={state:s,setOptions:function(i){var a,o,d,p,h,m,g="function"==typeof i?i(s.options):i;u(),s.options=Object.assign({},r,s.options,g),s.scrollParents={reference:td(e)?tk(e):e.contextElement?tk(e.contextElement):[],popper:tk(t)};var f=(o=Object.keys(a=[].concat(n,s.options.modifiers).reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{})).map(function(e){return a[e]}),d=new Map,p=new Set,h=[],o.forEach(function(e){d.set(e.name,e)}),o.forEach(function(e){p.has(e.name)||function e(t){p.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!p.has(t)){var i=d.get(t);i&&e(i)}}),h.push(t)}(e)}),m=h,tO.reduce(function(e,t){return e.concat(m.filter(function(e){return e.phase===t}))},[]));return s.orderedModifiers=f.filter(function(e){return e.enabled}),s.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=e.effect;if("function"==typeof n){var a=n({state:s,name:t,instance:c,options:void 0===i?{}:i});l.push(a||function(){})}}),c.update()},forceUpdate:function(){if(!d){var e,t,i,n,a,r,o,l,u,p,h,m=s.elements,g=m.reference,f=m.popper;if(tY(g,f)){s.rects={reference:(e=tE(f),t="fixed"===s.options.strategy,i=tc(e),o=tc(e)&&(a=tm((n=e.getBoundingClientRect()).width)/e.offsetWidth||1,r=tm(n.height)/e.offsetHeight||1,1!==a||1!==r),l=tx(e),u=tg(g,o),p={scrollLeft:0,scrollTop:0},h={x:0,y:0},(i||!i&&!t)&&(("body"!==tb(e)||tC(l))&&(p=function(e){return e!==tl(e)&&tc(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:tf(e)}(e)),tc(e)?(h=tg(e,!0),h.x+=e.clientLeft,h.y+=e.clientTop):l&&(h.x=ty(l))),{x:u.left+p.scrollLeft-h.x,y:u.top+p.scrollTop-h.y,width:u.width,height:u.height}),popper:tw(f)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach(function(e){return s.modifiersData[e.name]=Object.assign({},e.data)});for(var b=0;b-1}function is(e,t){return"function"==typeof e?e.apply(void 0,t):e}function il(e,t){var i;return 0===t?e:function(n){clearTimeout(i),i=setTimeout(function(){e(n)},t)}}function id(e){return[].concat(e)}function ic(e,t){-1===e.indexOf(t)&&e.push(t)}function iu(e){return[].slice.call(e)}function ip(e){return Object.keys(e).reduce(function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t},{})}function ih(){return document.createElement("div")}function im(e){return["Element","Fragment"].some(function(t){return io(e,t)})}function ig(e,t){e.forEach(function(e){e&&(e.style.transitionDuration=t+"ms")})}function ib(e,t){e.forEach(function(e){e&&e.setAttribute("data-state",t)})}function ix(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(t){e[n](t,i)})}function iy(e,t){for(var i,n=t;n;){if(e.contains(n))return!0;n=null==n.getRootNode||null==(i=n.getRootNode())?void 0:i.host}return!1}var iv={isTouch:!1},iC=0;function iw(){!iv.isTouch&&(iv.isTouch=!0,window.performance&&document.addEventListener("mousemove",iS))}function iS(){var e=performance.now();e-iC<20&&(iv.isTouch=!1,document.removeEventListener("mousemove",iS)),iC=e}function ik(){var e=document.activeElement;if(e&&e._tippy&&e._tippy.reference===e){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var iA=!!("u">typeof window&&"u">typeof document)&&!!window.msCrypto,iE=Object.assign({appendTo:ia,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},{animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),i_=Object.keys(iE);function iI(e){var t=(e.plugins||[]).reduce(function(t,i){var n,a=i.name,r=i.defaultValue;return a&&(t[a]=void 0!==e[a]?e[a]:null!=(n=iE[a])?n:r),t},{});return Object.assign({},e,t)}function iM(e,t){var i,n=Object.assign({},t,{content:is(t.content,[e])},t.ignoreAttributes?{}:((i=t.plugins)?Object.keys(iI(Object.assign({},iE,{plugins:i}))):i_).reduce(function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t},{}));return n.aria=Object.assign({},iE.aria,n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function iT(e,t){e.innerHTML=t}function iL(e){var t=ih();return!0===e?t.className=ie:(t.className=it,im(e)?t.appendChild(e):iT(t,e)),t}function ij(e,t){im(t.content)?(iT(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?iT(e,t.content):e.textContent=t.content)}function iP(e){var t=e.firstElementChild,i=iu(t.children);return{box:t,content:i.find(function(e){return e.classList.contains(t7)}),arrow:i.find(function(e){return e.classList.contains(ie)||e.classList.contains(it)}),backdrop:i.find(function(e){return e.classList.contains("tippy-backdrop")})}}function iD(e){var t=ih(),i=ih();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=ih();function a(i,n){var a=iP(t),r=a.box,o=a.content,s=a.arrow;n.theme?r.setAttribute("data-theme",n.theme):r.removeAttribute("data-theme"),"string"==typeof n.animation?r.setAttribute("data-animation",n.animation):r.removeAttribute("data-animation"),n.inertia?r.setAttribute("data-inertia",""):r.removeAttribute("data-inertia"),r.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?r.setAttribute("role",n.role):r.removeAttribute("role"),(i.content!==n.content||i.allowHTML!==n.allowHTML)&&ij(o,e.props),n.arrow?s?i.arrow!==n.arrow&&(r.removeChild(s),r.appendChild(iL(n.arrow))):r.appendChild(iL(n.arrow)):s&&r.removeChild(s)}return n.className=t7,n.setAttribute("data-state","hidden"),ij(n,e.props),t.appendChild(i),i.appendChild(n),a(e.props,e.props),{popper:t,onUpdate:a}}iD.$$tippy=!0;var iN=1,iR=[],iO=[];function iB(e,t){void 0===t&&(t={});var i,n=iE.plugins.concat(t.plugins||[]);document.addEventListener("touchstart",iw,ii),window.addEventListener("blur",ik);var a=Object.assign({},t,{plugins:n}),r=(im(i=e)?[i]:io(i,"NodeList")?iu(i):Array.isArray(i)?i:iu(document.querySelectorAll(i))).reduce(function(e,t){var i=t&&function(e,t){var i,n,a,r,o,s,l,d,c=iM(e,Object.assign({},iE,iI(ip(t)))),u=!1,p=!1,h=!1,m=!1,g=[],f=il(G,c.interactiveDebounce),b=iN++,x=(i=c.plugins).filter(function(e,t){return i.indexOf(e)===t}),y={id:b,reference:e,popper:ih(),popperInstance:null,props:c,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:x,clearDelayTimeouts:function(){clearTimeout(n),clearTimeout(a),cancelAnimationFrame(r)},setProps:function(t){if(!y.state.isDestroyed){L("onBeforeUpdate",[y,t]),U();var i=y.props,n=iM(e,Object.assign({},i,ip(t),{ignoreAttributes:!0}));y.props=n,W(),i.interactiveDebounce!==n.interactiveDebounce&&(D(),f=il(G,n.interactiveDebounce)),i.triggerTarget&&!n.triggerTarget?id(i.triggerTarget).forEach(function(e){e.removeAttribute("aria-expanded")}):n.triggerTarget&&e.removeAttribute("aria-expanded"),P(),T(),w&&w(i,n),y.popperInstance&&(q(),X().forEach(function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})),L("onAfterUpdate",[y,t])}},setContent:function(e){y.setProps({content:e})},show:function(){var t=y.state.isVisible,i=y.state.isDestroyed,n=!y.state.isEnabled,a=iv.isTouch&&!y.props.touch,r=ir(y.props.duration,0,iE.duration);if(!(t||i||n||a||(d||e).hasAttribute("disabled"))&&(L("onShow",[y],!1),!1!==y.props.onShow(y))){if(y.state.isVisible=!0,_()&&(C.style.visibility="visible"),T(),B(),y.state.isMounted||(C.style.transition="none"),_()){var o,s,c,u=iP(C);ig([u.box,u.content],0)}l=function(){var e;if(y.state.isVisible&&!m){if(m=!0,C.offsetHeight,C.style.transition=y.props.moveTransition,_()&&y.props.animation){var t=iP(C),i=t.box,n=t.content;ig([i,n],r),ib([i,n],"visible")}j(),P(),ic(iO,y),null==(e=y.popperInstance)||e.forceUpdate(),L("onMount",[y]),y.props.animation&&_()&&F(r,function(){y.state.isShown=!0,L("onShown",[y])})}},s=y.props.appendTo,c=d||e,(o=y.props.interactive&&s===ia||"parent"===s?c.parentNode:is(s,[c])).contains(C)||o.appendChild(C),y.state.isMounted=!0,q()}},hide:function(){var e=!y.state.isVisible,t=y.state.isDestroyed,i=!y.state.isEnabled,n=ir(y.props.duration,1,iE.duration);if(!e&&!t&&!i&&(L("onHide",[y],!1),!1!==y.props.onHide(y))){if(y.state.isVisible=!1,y.state.isShown=!1,m=!1,u=!1,_()&&(C.style.visibility="hidden"),D(),z(),T(!0),_()){var a,r=iP(C),o=r.box,s=r.content;y.props.animation&&(ig([o,s],n),ib([o,s],"hidden"))}(j(),P(),y.props.animation)?_()&&(a=y.unmount,F(n,function(){!y.state.isVisible&&C.parentNode&&C.parentNode.contains(C)&&a()})):y.unmount()}},hideWithInteractivity:function(e){I().addEventListener("mousemove",f),ic(iR,f),f(e)},enable:function(){y.state.isEnabled=!0},disable:function(){y.hide(),y.state.isEnabled=!1},unmount:function(){y.state.isVisible&&y.hide(),y.state.isMounted&&(Y(),X().forEach(function(e){e._tippy.unmount()}),C.parentNode&&C.parentNode.removeChild(C),iO=iO.filter(function(e){return e!==y}),y.state.isMounted=!1,L("onHidden",[y]))},destroy:function(){y.state.isDestroyed||(y.clearDelayTimeouts(),y.unmount(),U(),delete e._tippy,y.state.isDestroyed=!0,L("onDestroy",[y]))}};if(!c.render)return y;var v=c.render(y),C=v.popper,w=v.onUpdate;C.setAttribute("data-tippy-root",""),C.id="tippy-"+y.id,y.popper=C,e._tippy=y,C._tippy=y;var S=x.map(function(e){return e.fn(y)}),k=e.hasAttribute("aria-expanded");return W(),P(),T(),L("onCreate",[y]),c.showOnCreate&&Q(),C.addEventListener("mouseenter",function(){y.props.interactive&&y.state.isVisible&&y.clearDelayTimeouts()}),C.addEventListener("mouseleave",function(){y.props.interactive&&y.props.trigger.indexOf("mouseenter")>=0&&I().addEventListener("mousemove",f)}),y;function A(){var e=y.props.touch;return Array.isArray(e)?e:[e,0]}function E(){return"hold"===A()[0]}function _(){var e;return!!(null!=(e=y.props.render)&&e.$$tippy)}function I(){var t,i,n=(d||e).parentNode;return n&&null!=(i=id(n)[0])&&null!=(t=i.ownerDocument)&&t.body?i.ownerDocument:document}function M(e){return y.state.isMounted&&!y.state.isVisible||iv.isTouch||o&&"focus"===o.type?0:ir(y.props.delay,+!e,iE.delay)}function T(e){void 0===e&&(e=!1),C.style.pointerEvents=y.props.interactive&&!e?"":"none",C.style.zIndex=""+y.props.zIndex}function L(e,t,i){if(void 0===i&&(i=!0),S.forEach(function(i){i[e]&&i[e].apply(i,t)}),i){var n;(n=y.props)[e].apply(n,t)}}function j(){var t=y.props.aria;if(t.content){var i="aria-"+t.content,n=C.id;id(y.props.triggerTarget||e).forEach(function(e){var t=e.getAttribute(i);if(y.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var a=t&&t.replace(n,"").trim();a?e.setAttribute(i,a):e.removeAttribute(i)}})}}function P(){!k&&y.props.aria.expanded&&id(y.props.triggerTarget||e).forEach(function(t){y.props.interactive?t.setAttribute("aria-expanded",y.state.isVisible&&t===(d||e)?"true":"false"):t.removeAttribute("aria-expanded")})}function D(){I().removeEventListener("mousemove",f),iR=iR.filter(function(e){return e!==f})}function N(t){if(!iv.isTouch||!h&&"mousedown"!==t.type){var i=t.composedPath&&t.composedPath()[0]||t.target;if(!(y.props.interactive&&iy(C,i))){if(id(y.props.triggerTarget||e).some(function(e){return iy(e,i)})){if(iv.isTouch||y.state.isVisible&&y.props.trigger.indexOf("click")>=0)return}else L("onClickOutside",[y,t]);!0===y.props.hideOnClick&&(y.clearDelayTimeouts(),y.hide(),p=!0,setTimeout(function(){p=!1}),y.state.isMounted||z())}}}function R(){h=!0}function O(){h=!1}function B(){var e=I();e.addEventListener("mousedown",N,!0),e.addEventListener("touchend",N,ii),e.addEventListener("touchstart",O,ii),e.addEventListener("touchmove",R,ii)}function z(){var e=I();e.removeEventListener("mousedown",N,!0),e.removeEventListener("touchend",N,ii),e.removeEventListener("touchstart",O,ii),e.removeEventListener("touchmove",R,ii)}function F(e,t){var i=iP(C).box;function n(e){e.target===i&&(ix(i,"remove",n),t())}if(0===e)return t();ix(i,"remove",s),ix(i,"add",n),s=n}function H(t,i,n){void 0===n&&(n=!1),id(y.props.triggerTarget||e).forEach(function(e){e.addEventListener(t,i,n),g.push({node:e,eventType:t,handler:i,options:n})})}function W(){E()&&(H("touchstart",V,{passive:!0}),H("touchend",$,{passive:!0})),y.props.trigger.split(/\s+/).filter(Boolean).forEach(function(e){if("manual"!==e)switch(H(e,V),e){case"mouseenter":H("mouseleave",$);break;case"focus":H(iA?"focusout":"blur",Z);break;case"focusin":H("focusout",Z)}})}function U(){g.forEach(function(e){var t=e.node,i=e.eventType,n=e.handler,a=e.options;t.removeEventListener(i,n,a)}),g=[]}function V(e){var t,i=!1;if(!(!y.state.isEnabled||K(e))&&!p){var n=(null==(t=o)?void 0:t.type)==="focus";o=e,d=e.currentTarget,P(),!y.state.isVisible&&io(e,"MouseEvent")&&iR.forEach(function(t){return t(e)}),"click"===e.type&&(0>y.props.trigger.indexOf("mouseenter")||u)&&!1!==y.props.hideOnClick&&y.state.isVisible?i=!0:Q(e),"click"===e.type&&(u=!i),i&&!n&&J(e)}}function G(t){var i,n,a,r=t.target,o=(d||e).contains(r)||C.contains(r);("mousemove"!==t.type||!o)&&(i=X().concat(C).map(function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:c}:null}).filter(Boolean),n=t.clientX,a=t.clientY,i.every(function(e){var t=e.popperRect,i=e.popperState,r=e.props.interactiveBorder,o=i.placement.split("-")[0],s=i.modifiersData.offset;if(!s)return!0;var l="bottom"===o?s.top.y:0,d="top"===o?s.bottom.y:0,c="right"===o?s.left.x:0,u="left"===o?s.right.x:0,p=t.top-a+l>r,h=a-t.bottom-d>r,m=t.left-n+c>r,g=n-t.right-u>r;return p||h||m||g})&&(D(),J(t)))}function $(e){if(!(K(e)||y.props.trigger.indexOf("click")>=0&&u)){if(y.props.interactive)return void y.hideWithInteractivity(e);J(e)}}function Z(t){0>y.props.trigger.indexOf("focusin")&&t.target!==(d||e)||y.props.interactive&&t.relatedTarget&&C.contains(t.relatedTarget)||J(t)}function K(e){return!!iv.isTouch&&E()!==e.type.indexOf("touch")>=0}function q(){Y();var t=y.props,i=t.popperOptions,n=t.placement,a=t.offset,r=t.getReferenceClientRect,o=t.moveTransition,s=_()?iP(C).arrow:null,c=r?{getBoundingClientRect:r,contextElement:r.contextElement||d||e}:e,u=[{name:"offset",options:{offset:a}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(_()){var i=iP(C).box;["placement","reference-hidden","escaped"].forEach(function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)}),t.attributes.popper={}}}}];_()&&s&&u.push({name:"arrow",options:{element:s,padding:3}}),u.push.apply(u,(null==i?void 0:i.modifiers)||[]),y.popperInstance=t8(c,C,Object.assign({},i,{placement:n,onFirstUpdate:l,modifiers:u}))}function Y(){y.popperInstance&&(y.popperInstance.destroy(),y.popperInstance=null)}function X(){return iu(C.querySelectorAll("[data-tippy-root]"))}function Q(e){y.clearDelayTimeouts(),e&&L("onTrigger",[y,e]),B();var t=M(!0),i=A(),a=i[0],r=i[1];iv.isTouch&&"hold"===a&&r&&(t=r),t?n=setTimeout(function(){y.show()},t):y.show()}function J(e){if(y.clearDelayTimeouts(),L("onUntrigger",[y,e]),!y.state.isVisible)return void z();if(!(y.props.trigger.indexOf("mouseenter")>=0&&y.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0)||!u){var t=M(!1);t?a=setTimeout(function(){y.state.isVisible&&y.hide()},t):r=requestAnimationFrame(function(){y.hide()})}}}(t,a);return i&&e.push(i),e},[]);return im(e)?r[0]:r}iB.defaultProps=iE,iB.setDefaultProps=function(e){Object.keys(e).forEach(function(t){iE[t]=e[t]})},iB.currentInput=iv,Object.assign({},t0,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),iB.setDefaultProps({render:iD}),e.s(["default",0,iB],376257);var iz=e.i(379457),iF=e.i(161385);let iH=new iF.EventEmitter,iW=new el.PluginKey("menuFormattingBubble");class iU{editor;element;view;preventHide=!1;tippy;onHide;isEditable;isMouseDownOutsideMenu;cleanupPanelLifecycle;boundHideHandler;constructor({editor:e,view:t}){this.editor=e,this.isEditable=e.isEditable,this.view=t}initialize({element:e,tippyOptions:t,panelLifecycle:i,onHide:n,targetElement:a}){e?(this.onHide=n,this.element=e,this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.view.dom.addEventListener("dragend",this.dragendHandler),this.view.dom.addEventListener("drop",this.dragendHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.createTooltip(t,a),this.element.style.visibility="visible",document.addEventListener("mousedown",this.mousedownDocumentHandler,!0),document.addEventListener("mouseup",this.mouseupDocumentHandler,!0),this.boundHideHandler=this.hide.bind(this),iH.on("hide",this.boundHideHandler),i&&(this.cleanupPanelLifecycle=i.on("resize",()=>{this.tippy.popperInstance?.update()}))):console.warn("[FormattingBubbleMenuView] initialize. No element provided")}mousedownDocumentHandler=e=>{this.element.contains(e.target)?this.isMouseDownOutsideMenu=!1:this.isMouseDownOutsideMenu=!0};mouseupDocumentHandler=()=>{this.isMouseDownOutsideMenu=!1,this.update(this.editor.view)};mousedownHandler=()=>{this.preventHide=!0};dragstartHandler=()=>{this.hide()};dragendHandler=()=>{this.isMouseDownOutsideMenu=!1,setTimeout(()=>this.update(this.editor.view))};focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))};blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||this.hide()};createTooltip(e={},t){let i=t||this.view.dom.parentElement;this.tippy=iB(i,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...e}),this.editor.commands.command(({tr:e})=>(e.setMeta(iW,{tippyInstance:this.tippy}),!0))}update(e,t){let i=t&&iW.getState(t),n=iW.getState(e.state),{state:a,composing:r}=e,{doc:o,selection:s}=a,l=t&&t.doc.eq(o)&&t.selection.eq(s)&&this.isEditable===this.editor.isEditable&&i?.forceHide===n.forceHide;if(!this.element){if(!n.element)return;this.initialize(n)}if(this.isEditable=this.editor.isEditable,!this.editor.isEditable||!0===n.forceHide)return void this.hide();if(r||l)return;let{empty:d,ranges:c}=s,u=Math.min(...c.map(e=>e.$from.pos)),p=Math.max(...c.map(e=>e.$to.pos)),h=!o.textBetween(u,p).length&&(0,eE.isTextSelection)(e.state.selection);if(d||h){let e=s.$anchor.marks().some(e=>"link"===e.type.name)||"button"===s.$anchor.parent.type.name||"label"===s.$anchor.parent.type.name,t=(0,eE.findChildrenInRange)(o,{from:u,to:p},e=>"emoji"===e.type.name);if(!e&&t?.length===0)return void this.hide()}this.tippy.setProps({getReferenceClientRect:()=>{if(!(0,eE.isNodeSelection)(e.state.selection))return(0,eE.posToDOMRect)(e,u,p);let t=e.nodeDOM(u);return t&&(0,iz.isHTMLElement)(t)?(iG(t,".drag-handle")||iG(t,"[data-content-reference]")||t).getBoundingClientRect():(0,eE.posToDOMRect)(e,u,p)}}),!this.isMouseDownOutsideMenu&&(0,ex.editorHasFocus)(this.editor)&&this.show()}show(){this.tippy.show(),document.body.classList.add("formatting-menu-open")}hide(){this.onHide&&"function"==typeof this.onHide&&this.onHide(),this.tippy.hide(),document.body.classList.remove("formatting-menu-open")}destroy(){this.tippy?.destroy(),this.element?.removeEventListener("mousedown",this.mousedownHandler),document.removeEventListener("mousedown",this.mousedownDocumentHandler,!0),document.removeEventListener("mouseup",this.mouseupDocumentHandler,!0),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.boundHideHandler&&iH.off("hide",this.boundHideHandler),this.cleanupPanelLifecycle&&this.cleanupPanelLifecycle()}}let iV=eE.Extension.create({name:"formattingBubbleMenu",addCommands:()=>({forceHideBubbleMenu:e=>({tr:t})=>(t.setMeta(iW,{forceHide:e}),!0),refreshBubbleMenu:()=>({state:e})=>{let{tippyInstance:t}=iW.getState(e);return t?.popperInstance?.forceUpdate(),!0}}),addProseMirrorPlugins(){let{editor:e}=this;return[new el.Plugin({key:iW,state:{init:()=>({element:null,forceHide:!1,onHide:()=>{},tippyOptions:{},tippyInstance:null}),apply(e,t){let i=e.getMeta(iW);return i?{...t,...i}:t}},view:t=>new iU({view:t,editor:e})})]}}),iG=(e,t)=>{let i=e.querySelector(t),n=e.querySelector("[data-node-view-wrapper]");return i&&n&&(0,iz.findInBetween)(i,e,e=>e.hasAttribute("data-node-view-wrapper"))===n?i:null};e.s(["FormattingBubbleMenu",0,iV,"FormattingBubbleMenuPluginKey",0,iW],807727),e.s(["FormattingBubbleMenu",0,e=>{let t=(0,et.useRef)(null),i=(0,ts.usePanelLifecycle)(),{tippyOptions:n,onHide:a,targetElement:r}=e;return(0,to.useTiptapEditorEffect)(e=>{e.commands.command(({tr:e})=>(e.setMeta(iW,{element:t.current,tippyOptions:n,panelLifecycle:i,onHide:a,targetElement:r}),!0))},[n,i,a,r]),(0,d.jsx)("div",{ref:t,className:e.className,style:{visibility:"hidden"},id:"gamma-formatting-bubble-menu",children:e.children})}],492812);var i$=e.i(335799),iZ=e.i(887527),iK=e.i(500425),iq=e.i(661619),iY=e.i(85901),iX=e.i(989458);let iQ=e=>{let t=1;try{for(let i=e.depth;i>0;i--){let n=e.node(i),a=e.index(i-1);if("gridCell"===n.type.name){let n=e.node(i-1).attrs.colWidths;n&&n[a]&&(t*=parseInt(n[a])/100)}if("card"===n.type.name){let{layout:i,layoutTemplateColumns:a,container:r}=n.attrs;if("left"===i){let e=a?parseInt(a.split(" ")[1])/100:iX.SIDE_BODY_WIDTH;t*=e}if("right"===i){let e=a?parseInt(a.split(" ")[0])/100:iX.SIDE_BODY_WIDTH;t*=e}let o=e.doc.firstChild.attrs,s=r.width??o.settings.defaultContentWidth;"lg"===s?t*=iY.WIDE_CONTENT_WIDTH_CHARS/iY.NORMAL_CONTENT_WIDTH_CHARS:"sm"===s&&(t*=iY.NARROW_CONTENT_WIDTH_CHARS/iY.NORMAL_CONTENT_WIDTH_CHARS);break}}}catch(e){console.error("[SmartLayout] Error getting container size decoration",e)}return t};e.s(["getContainerSize",0,iQ],889601);var iJ=e.i(662752);function i0(e,t,i){if(i&&e.selection instanceof el.NodeSelection&&e.selection.node===i)return!0;let n=i1(e,t);return!!n&&e.selection instanceof el.NodeSelection&&e.selection.node===n.node}function i1(e,t){let i=e.doc.resolve(t);for(let e=i.depth;e>0;e--){let t=i.node(e);if("grid"===t.type.name&&!(e>1&&"gridItem"===i.node(e-1).type.name))return{pos:i.before(e),node:t}}return null}function i2(e,t){let i=e.pos+1;for(let n=0;n{let r=i2(t,a),o=e.mapping.map(r),s=e.doc.nodeAt(o);if(s){var l,d,c;let t=(l=s.attrs.options,d=n,c=i,"horizontal"===d?{...l,horizontalColumnSpan:c}:{...l,verticalRowSpan:c});e.setNodeMarkup(o,void 0,{...s.attrs,options:t})}})},"createEmptyGridItem",0,function(e,t={}){return e.nodes.gridItem.create({options:t},e.nodes.paragraph.create())},"findGridContainingSelection",0,e=>{let{from:t}=e.selection,i=e.doc.resolve(t);if(e.selection instanceof el.NodeSelection){let i=e.selection.node;if("grid"===i.type.name)return{pos:t,node:i}}let n=(0,eE.findParentNodeClosestToPos)(i,e=>"grid"===e.type.name);return n?{pos:n.pos,node:n.node}:null},"findRootGridAtPos",0,i1,"findRootGridContainingSelection",0,e=>{let t=e.doc.resolve(e.selection.from);if(e.selection instanceof el.NodeSelection&&"grid"===e.selection.node.type.name)return{pos:e.selection.from,node:e.selection.node};let i=(0,eE.findParentNodeClosestToPos)(t,e=>"grid"===e.type.name);if(!i)return null;let n=i1(e,i.pos);return n||null},"getCellPosInGrid",0,i2,"getCrossSpan",0,function(e,t){return"horizontal"===t?e.horizontalRowSpan:e.verticalColumnSpan},"getFlowSpan",0,function(e,t){return"horizontal"===t?e.horizontalColumnSpan??12:e.verticalRowSpan??12},"getGridContext",0,function(e,t){let i=e.doc.resolve(t),n=(0,eE.findParentNodeClosestToPos)(i,e=>"grid"===e.type.name);if(!n)return null;let a=i.index(n.depth),r=n.node.attrs.options?.gridStyle||"standard";return{gridParent:n,cellIndex:a,gridStyle:r}},"isRootGridSelectedAtPos",0,i0,"unwrapGridIfNeeded",0,function(e,t){let i=e.doc.nodeAt(t);if(!i||"grid"!==i.type.name||1!==i.childCount)return!1;let n=e.doc.resolve(t);if((0,eE.findParentNodeClosestToPos)(n,e=>"gridItem"===e.type.name))return function(e,t){let i=e.doc.nodeAt(t);if(!i||"grid"!==i.type.name||1!==i.childCount)return!1;let n=e.doc.resolve(t),a=(0,eE.findParentNodeClosestToPos)(n,e=>"gridItem"===e.type.name);if(!a)return!1;let r=i.firstChild;if(!r)return!1;let o=r.content,s=r.attrs.options?.cellStyle;return e.setNodeMarkup(a.pos,void 0,{...a.node.attrs,options:{...a.node.attrs.options,cellStyle:s}}),e.replaceWith(t,t+i.nodeSize,o),!0}(e,t);let a=i.firstChild;if(a&&1===a.childCount){let n=a.firstChild;if(n&&"grid"===n.type.name)return e.replaceWith(t,t+i.nodeSize,n),!0}return!1}],176636),e.s(["getGridDirection",0,i3,"getGridId",0,function(e){return e.attrs?.id||"unknown"},"getGridMetadata",0,function(e){return{direction:e.attrs?.options?.gridDirection||"horizontal",style:e.attrs?.options?.gridStyle||"standard",id:e.attrs?.id||"unknown"}}],280484);var i5=e.i(565647);let i4=(e,t)=>{let i=[],n={indices:[],spanTotal:0},a=iJ.FLEXIBLE_GRID_FLOW_SPAN_TOTAL;return e.forEach((e,r,o)=>{let s=t?.get(o)??e.attrs.options?.horizontalColumnSpan??iJ.DEFAULT_ITEM_WIDTH;n.spanTotal+s>a&&n.indices.length>0?(i.push(n),n={indices:[o],spanTotal:s}):(n.indices.push(o),n.spanTotal+=s)}),n.indices.length>0&&i.push(n),i},i6=e=>{let t=new Map,i=e.attrs.options,n=i?.gridStyle||"standard";if(!(0,i5.isFlexibleGrid)(n))return new Map;let a=i4(e),r=iJ.FLEXIBLE_GRID_FLOW_SPAN_TOTAL;return a.forEach(i=>{if(i.spanTotal0){let n=i.indices[i.indices.length-1],a=e.child(n),o=a.attrs.options?.horizontalColumnSpan||iJ.DEFAULT_ITEM_WIDTH,s=r-i.spanTotal;t.set(n,o+s)}}),t},i9=(e,t)=>{let i=[],n={indices:[],spanTotal:0},a=iJ.FLEXIBLE_GRID_FLOW_SPAN_TOTAL;return e.forEach((e,r,o)=>{let s=t?.get(o)??e.attrs.options?.verticalRowSpan??iJ.DEFAULT_ITEM_WIDTH;n.spanTotal+s>a&&n.indices.length>0?(i.push(n),n={indices:[o],spanTotal:s}):(n.indices.push(o),n.spanTotal+=s)}),n.indices.length>0&&i.push(n),i},i8=e=>{let t=new Map,i=e.attrs.options,n=i?.gridStyle||"standard";if(!(0,i5.isFlexibleGrid)(n))return new Map;let a=i9(e),r=iJ.FLEXIBLE_GRID_FLOW_SPAN_TOTAL;return a.forEach(i=>{if(i.spanTotal0){let n=i.indices[i.indices.length-1],a=e.child(n),o=a.attrs.options?.verticalRowSpan||iJ.DEFAULT_ITEM_WIDTH,s=r-i.spanTotal;t.set(n,o+s)}}),t},i7=(e,t)=>{let i,n=new Map,a=e.attrs.options,r=a?.gridStyle||"standard";if(!(0,i5.isFlexibleGrid)(r))return new Map;let o=i9(e),s=o.map(i=>{let n=0;return i.indices.forEach(i=>{let a=e.child(i),r=t?.get(i)??a.attrs.options?.verticalColumnSpan;void 0!==r&&r>n&&(n=r)}),n}),l=s.map(e=>0===e?iJ.MIN_ITEM_WIDTH:e),d=l.reduce((e,t)=>e+t,0);if(d===iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL)i=l;else if(d>iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL){let e=iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL/d,t=(i=l.map(t=>Math.floor(t*e))).reduce((e,t)=>e+t,0),n=iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL-t;if(n>0){let e=l.map((e,t)=>({width:e,index:t})).sort((e,t)=>t.width-e.width);for(let t=0;t0===e).length,t=s.reduce((e,t)=>e+t,0),n=iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL-t;if(e>0){let t=Math.floor(n/e),a=(i=s.map(e=>0===e?t:e)).reduce((e,t)=>e+t,0),r=iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL-a,o=0;for(let e=0;et+e)).reduce((e,t)=>e+t,0),a=iJ.FLEXIBLE_GRID_CROSS_SPAN_TOTAL-t;for(let e=0;e{let a=i[t];e.indices.forEach(e=>{n.set(e,a)})}),n},ne=e=>{let t,i,n;return"horizontal"===i3(e)?(t=i6(e),i=new Map,n=new Map):(t=new Map,i=i8(e),n=i7(e)),{stretchedHorizontalColumns:t,stretchedVerticalRows:i,stretchedVerticalColumns:n}},nt=e=>"horizontal"===i3(e)?i4(e):i9(e);e.s(["calculateStretchedHorizontalColumns",0,i6,"calculateStretchedVerticalColumns",0,i7,"calculateStretchedVerticalRows",0,i8,"getFlowGroups",0,nt,"getStretchedSpans",0,ne,"getVerticalColumnGroupings",0,i9],77606);let ni=["image","smartDiagram"],nn=e=>{let t=e.find(e=>e.spec.isGridDecoration);return t?t.spec:(console.error("[Grid] Decoration not found. This should never happen!",e),{isGridDecoration:!0,direction:"ltr",numCells:0,containerSize:1,gridId:"unknown"})};e.s(["decorateGrids",0,e=>{let{doc:t}=e,i=[];return t.descendants((n,a,r)=>{if(n.type.name===iJ.NODE_NAME){let o,s=iQ(t.resolve(a)),l=(0,g.getDirectionDecoration)(e,a,a+n.nodeSize),d=r?.type.name==="gridItem",c=i0(e,a,n),u=(0,iq.getTextDirectionForNode)(n)||l||(0,ec.getPreferredTextDirection)();n.forEach((e,t,i)=>{e.attrs.options.isEmphasized&&(o=i)});let p=d&&r?.childCount===1&&r?.firstChild?.type.name==="grid",h=d&&r?.childCount>1,m=n.attrs.id||"unknown",f={isGridDecoration:!0,direction:u,numCells:n.childCount,containerSize:s,isNestedGrid:h,isSubgrid:p,gridId:m},b=[],x=[];i.push(e_.Decoration.node(a,a+n.nodeSize,{},f));let{stretchedHorizontalColumns:y,stretchedVerticalRows:v,stretchedVerticalColumns:C}=ne(n),w=nt(n),S=new Set(w.map(e=>e.indices[e.indices.length-1])),k=new Set(w[w.length-1]?.indices||[]);n.forEach((e,t,r)=>{let l=a+1+t,d=1===e.childCount&&e.firstChild?.type.name==="grid",p={isGridItemDecoration:!0,direction:u,index:r,numCells:n.childCount,layoutContainerSize:s,emphasizedIndex:o,layoutOptions:n.attrs.options,isRootGridSelected:c,stretchedHorizontalColumn:y.get(r),stretchedVerticalRow:v.get(r),stretchedVerticalColumn:C.get(r),isSubgridParent:d,isLastCellInGroup:S.has(r),isInFinalGroup:k.has(r),parentGridId:m};b.push(e.attrs.options.cellStyle),x.push(e.attrs.options.marker),(({gridItem:e,gridItemPos:t,decorations:i,cellDeco:n})=>{let a=e.childCount;e.forEach((e,r,o)=>{if(ni.includes(e.type.name)){let o=t+1+r;if(1===a){let t=e_.Decoration.node(o,o+e.nodeSize,{},{isFullBleed:!0});i.push(t),n.isFullBleed=!0}}})})({gridItem:e,gridItemPos:l,decorations:i,cellDeco:p}),i.push(e_.Decoration.node(l,l+e.nodeSize,{},p))});let A=b.every(e=>e===b[0]);f.markerType=x.every(e=>e?.type===x[0]?.type)?x[0]?.type:null,f.cellStyle=A?b[0]:null}}),e_.DecorationSet.create(t,i)},"findGridDecoration",0,nn,"findGridItemDecoration",0,e=>{let t=e.find(e=>e.spec.isGridItemDecoration);return t?t.spec:(console.error("[GridItem] Decoration not found. This should never happen!",e),{isGridItemDecoration:!0,direction:"ltr",isRootGridSelected:!1,numCells:0,index:0,layoutContainerSize:1,layoutOptions:{},parentGridId:"unknown"})}],946107);var na=e.i(227909),nr=e.i(802150),no=e.i(496911);let ns=["none","solid","outline"],nl=({currentCellStyle:e,updateCellOptions:t})=>{let i=(0,et.useMemo)(()=>ns.map(e=>({value:e,label:no.CellStyleMap[e].name()})),[]),n=i.find(t=>t.value===e);return(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(nr.Dropdown,{isLazy:!0,children:[(0,d.jsx)(nr.DropdownButton,{as:V.Button,variant:"toolbar",rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown}),size:"sm","data-testid":"grid-item-cell-style-dropdown",children:(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faPaintbrushPencil}),(0,d.jsx)(iZ.Text,{fontSize:"sm",fontWeight:"600",children:"Style"})]})}),(0,d.jsx)(nr.DropdownList,{"data-in-editor-focus":!0,fontSize:"md",children:i.map(({value:e,label:i})=>(0,d.jsx)(nr.DropdownItem,{"data-testid":`cell-style-${e}`,icon:n?.value===e?(0,d.jsx)(na.CheckIcon,{w:"1rem"}):(0,d.jsx)(iZ.Text,{w:"1rem"}),onClick:()=>t({cellStyle:e}),children:i},e))})]})})},nd=[{value:"standard",label:"Standard Grid"},{value:"flexible",label:"Flexible Grid"},{value:"flex_grid",label:"Flex Grid"},{value:"balanced_grid",label:"Balanced Grid"},{value:"steps",label:"Stepped Grid"}];e.s(["GridFormattingMenu",0,({editor:e,selection:t,decorations:i})=>{let{node:n}=t,a=n.attrs.options?.gridStyle||"standard",r=nn(i).cellStyle||"mixed",o=nd.find(e=>e.value===a),s=(0,et.useCallback)(i=>{let a=(0,ex.findDirectChildren)(n,e=>"gridItem"===e.type.name),r=e.chain();a.forEach(({node:e,pos:n})=>{let a=t.from+n+1;r=r.updateNestedAttributesAtPos(a,{options:i})}),r.selectNodeAtPos(t.from).focus().run()},[e,n,t.from]);return(0,d.jsxs)(i$.ButtonGroup,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:iK.faTableLayout}),(0,d.jsx)(iZ.Text,{fontSize:"sm",fontWeight:"600",children:o?.label})]}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(nl,{currentCellStyle:r,updateCellOptions:s})]})}],384392);var nc=e.i(402818),nu=e.i(241894);let np=[{value:"left",icon:D.faAlignLeft,label:()=>ee.i18n._({id:"UlKSMd",message:"Left"})},{value:"center",icon:D.faAlignCenter,label:()=>ee.i18n._({id:"VTRXqB",message:"Center"})},{value:"right",icon:D.faAlignRight,label:()=>ee.i18n._({id:"nOPbWJ",message:"Right"})}],nh=[{value:"top",icon:D.faArrowUpToLine,label:()=>ee.i18n._({id:"WWy8TN",message:"Top"})},{value:"center",icon:D.faArrowsToLine,label:()=>ee.i18n._({id:"S1g3Ds",message:"Middle"})},{value:"bottom",icon:D.faArrowDownToLine,label:()=>ee.i18n._({id:"zsiX7I",message:"Bottom"})}],nm=({currentAlign:e,onAlignChange:t})=>{let i=np.find(t=>t.value===e),n=i?.icon||D.faAlignLeft;return(0,d.jsxs)(nr.Dropdown,{isLazy:!0,children:[(0,d.jsx)(nr.DropdownButton,{as:V.Button,variant:"toolbar",leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:n}),rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faChevronDown,size:"xs"}),size:"sm","data-testid":"horizontal-align-dropdown"}),(0,d.jsx)(nr.DropdownList,{"data-in-editor-focus":!0,fontSize:"md",children:np.map(({value:i,icon:n,label:a})=>(0,d.jsxs)(nr.DropdownItem,{"data-testid":`horizontal-align-${i}`,icon:e===i?(0,d.jsx)(na.CheckIcon,{w:"1rem"}):(0,d.jsx)(iZ.Text,{w:"1rem"}),onClick:()=>t(i),children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:n,fixedWidth:!0})," ",a()]},i))})]})},ng=({currentAlign:e,onAlignChange:t})=>{let i=nh.find(t=>t.value===e),n=i?.icon||D.faArrowUpToLine;return(0,d.jsxs)(nr.Dropdown,{isLazy:!0,children:[(0,d.jsx)(nr.DropdownButton,{as:V.Button,variant:"toolbar",leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:n}),rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faChevronDown,size:"xs"}),size:"sm","data-testid":"vertical-align-dropdown"}),(0,d.jsx)(nr.DropdownList,{"data-in-editor-focus":!0,fontSize:"md",children:nh.map(({value:i,icon:n,label:a})=>(0,d.jsxs)(nr.DropdownItem,{"data-testid":`vertical-align-${i}`,icon:e===i?(0,d.jsx)(na.CheckIcon,{w:"1rem"}):(0,d.jsx)(iZ.Text,{w:"1rem"}),onClick:()=>t(i),children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:n,fixedWidth:!0})," ",a()]},i))})]})};e.s(["GridItemFormattingMenu",0,({editor:e,selection:t})=>{let{node:i}=t,n=i.attrs.options?.cellStyle||"none",a=i.attrs.options?.horizontalAlign,r=i.attrs.options?.verticalAlign,o=i3(t.$from.parent),s=(0,et.useCallback)(n=>{e.chain().updateAttributesAtPos(t.from,{options:{...i.attrs.options,...n}}).selectNodeAtPos(t.from).focus().run()},[e,i.attrs.options,t.from]),l=(0,et.useCallback)(e=>{s({horizontalAlign:e})},[s]),c=(0,et.useCallback)(e=>{s({verticalAlign:e})},[s]),u=(0,et.useCallback)(()=>{e.chain().handleDeleteOnGridItem(!1,!0,!0).run()},[e]),p=(0,et.useCallback)(()=>{"horizontal"===o?e.commands.addGridItemWithRedistribution(t.from,"before"):e.commands.convertGridItemToNestedGrid(t.from,"before")},[e,t.from,o]),h=(0,et.useCallback)(()=>{"horizontal"===o?e.commands.addGridItemWithRedistribution(t.from,"after"):e.commands.convertGridItemToNestedGrid(t.from,"after")},[e,t.from,o]),m=(0,et.useCallback)(()=>{"horizontal"===o?e.commands.convertGridItemToNestedGrid(t.from,"before"):e.commands.addGridItemWithRedistribution(t.from,"before")},[e,t.from,o]),g=(0,et.useCallback)(()=>{"horizontal"===o?e.commands.convertGridItemToNestedGrid(t.from,"after"):e.commands.addGridItemWithRedistribution(t.from,"after")},[e,t.from,o]);return(0,d.jsxs)(i$.ButtonGroup,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faTableLayout}),(0,d.jsx)(iZ.Text,{fontSize:"sm",fontWeight:"600",children:"Cell"})]}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(nl,{currentCellStyle:n,updateCellOptions:s}),(0,d.jsx)(nc.Divider,{orientation:"vertical",h:"24px"}),(0,d.jsx)(nm,{currentAlign:a,onAlignChange:l}),(0,d.jsx)(ng,{currentAlign:r,onAlignChange:c}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)($.ToolbarButton,{label:ee.i18n._({id:"FPPYe7",message:"Add cell left"}),icon:D.faDiagramCells,iconRotation:270,onClick:p,testId:"add-grid-cell-left-button"}),(0,d.jsx)($.ToolbarButton,{label:ee.i18n._({id:"Cx6q9z",message:"Add cell right"}),icon:D.faDiagramCells,iconRotation:90,onClick:h,testId:"add-grid-cell-right-button"}),(0,d.jsx)($.ToolbarButton,{label:ee.i18n._({id:"YN9u/4",message:"Add cell above"}),icon:D.faDiagramCells,onClick:m,testId:"add-grid-cell-above-button"}),(0,d.jsx)($.ToolbarButton,{label:ee.i18n._({id:"cuIdse",message:"Add cell below"}),icon:D.faDiagramCells,iconRotation:180,onClick:g,testId:"add-grid-cell-below-button"}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(nu.DeleteNodeButton,{editor:e,handleDelete:u})]})}],694801),e.s(["PositionedBoxFormattingMenu",()=>nG],419087);var nf=e.i(721455),nb=e.i(148318),nx=e.i(704273),ny=e.i(873082),nv=e.i(918228),nC=e.i(865786),nw=e.i(878726),nS=e.i(260241),nk=e.i(480801),nA=e.i(595995),nE=e.i(304521),n_=e.i(892194);let nI=({color:e,isDefaultColor:t,isMixed:i=!1,...n})=>{let a=(0,n_.useColorModeValue)("gray.300","gray.600");return(0,d.jsx)(nb.MenuButton,{as:V.Button,variant:"plain",size:"sm",boxShadow:"none",minW:"fit-content",textAlign:"start",rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{fixedWidth:!0,icon:J.faChevronDown,size:"xs"}),...n,children:(0,d.jsxs)(nv.Stack,{direction:"row",spacing:2,align:"center",children:[(0,d.jsx)(c.Box,{as:"span",alignSelf:"center",boxSize:5,borderRadius:"md",border:"2px solid",borderColor:a,bgColor:e}),(0,d.jsx)(iZ.Text,{fontFamily:t||i?void 0:"mono",textTransform:t||i?void 0:"uppercase",fontSize:"sm",children:i?(0,d.jsx)(G.Trans,{message:"Mixed",id:"+UN6+J"}):t?(0,d.jsx)(G.Trans,{message:"Default",id:"ovBPCi"}):(0,nE.default)(e).toHexString()})]})})};e.s(["ColorMenuButton",0,nI],957897);var nM=e.i(549022);let nT=(e,t,i)=>((e,t)=>{let i=new Set;for(let n of e)if(i.add(n[t]),i.size>1)return!1;return[...i][0]})(function(e,t){let i=function(e,t){if("string"==typeof e){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}(t,e.schema),{from:n,to:a,empty:r}=e.selection,o=[];return r?(e.storedMarks&&o.push(...e.storedMarks),o.push(...e.selection.$head.marks())):e.doc.nodesBetween(n,a,e=>{o.push(...e.marks)}),o.filter(e=>e.type.name===i.name).map(e=>({...e.attrs}))}(e,t),i);var nL=e.i(261442);let nj=({editor:e,defaultTextColor:t,testId:i,disabled:n,useMenuButton:a=!1,isLinkText:r=!1})=>{let{textColor:o,highlightColor:s,setHighlightColor:l,setTextColor:c,resetColorAndHighlight:u}=(({editor:e,isLinkText:t,defaultTextColor:i})=>{let n=nP(i,t),a=nD(e,t),r=t&&e.state.selection.empty,o=(0,et.useCallback)(t=>{r?e.chain().focus().extendMarkRange("link").setHighlightColor(t).setTextSelection({from:e.state.selection.from,to:e.state.selection.to}).run():e.chain().focus().setHighlightColor(t).run()},[e,r]),s=(0,et.useCallback)(t=>{r?e.chain().focus().extendMarkRange("link").setTextColor(t).setTextSelection({from:e.state.selection.from,to:e.state.selection.to}).run():e.chain().focus().setTextColor(t).run()},[e,r]);return{highlightColor:a,resetColorAndHighlight:(0,et.useCallback)(()=>{r?e.chain().focus().extendMarkRange("link").unsetMark("textColor").unsetMark("highlight").setTextSelection({from:e.state.selection.from,to:e.state.selection.to}).run():e.chain().focus().unsetMark("textColor").unsetMark("highlight").run()},[e,r]),setHighlightColor:o,setTextColor:s,textColor:n}})({editor:e,isLinkText:r,defaultTextColor:t});return(0,d.jsxs)(nf.Menu,{isLazy:!0,onClose:()=>(0,ny.focusEditorOnMenuClose)(e),children:[a?(0,d.jsx)(nI,{color:s.color||o.color||void 0,isDefaultColor:!s.color&&"default"===o.state,disabled:n,"data-testid":i,isMixed:"mixed"===s.state||"mixed"===o.state}):(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:(0,d.jsx)(G.Trans,{message:"Text color...",id:"76ESgh"}),children:(0,d.jsx)(nb.MenuButton,{isDisabled:n,as:V.Button,variant:"toolbar",rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown,transform:"shrink-6"}),"data-testid":i,onMouseDown:nL.preventDefaultToAvoidBlur,size:"sm",children:(0,d.jsx)(nN,{color:s.color||o.color||void 0})})}),(0,d.jsx)(nx.MenuList,{overflow:"hidden",children:(0,d.jsxs)(nA.Tabs,{isFitted:!0,variant:"soft-rounded",size:"md",defaultIndex:+!!s.color,children:[(0,d.jsxs)(nw.TabList,{children:[(0,d.jsx)(nC.Tab,{children:(0,d.jsx)(eh.GammaTooltip,{label:(0,d.jsx)(G.Trans,{message:"Text",id:"xeiujy"}),placement:"top",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faFont})})}),(0,d.jsx)(nC.Tab,{children:(0,d.jsx)(eh.GammaTooltip,{label:(0,d.jsx)(G.Trans,{message:"Highlight",id:"gtEbeW"}),placement:"top",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faHighlighterLine})})})]}),(0,d.jsxs)(nk.TabPanels,{children:[(0,d.jsx)(nS.TabPanel,{p:0,pt:2,children:(0,d.jsx)(nM.ColorPickerMenuInner,{currentColor:o.color||null,setColor:c,unsetColor:u,source:"TextColor"})}),(0,d.jsx)(nS.TabPanel,{p:0,pt:2,children:(0,d.jsx)(nM.ColorPickerMenuInner,{currentColor:s.color||"",setColor:l,unsetColor:u,source:"TextHighlight"})})]})]})})]})},nP=(e,t)=>{let i=eX(),[n,a]=(0,et.useState)({state:null,color:null});return(0,to.useTiptapEditorEffect)(i=>{let{selection:n,doc:r,schema:o}=i.state,{from:s,to:l}=n,d=t?(0,ex.markHasRangeWithEmptySelection)(r,s,l,o.marks.highlight):r.rangeHasMark(s,l,o.marks.highlight),c=t?(0,ex.markHasRangeWithEmptySelection)(r,s,l,o.marks.textColor):r.rangeHasMark(s,l,o.marks.textColor);if(d)a({state:null,color:null});else if(c){let t=nT(i.state,"textColor","hex");a(t?{state:null,color:t}:{state:"mixed",color:e||null})}else a({state:"default",color:e||(e=>{let{from:t}=e.state.selection,i=e.view.domAtPos(t),n=i.node instanceof HTMLElement?i.node:i.node.parentElement;if(!n)return null;let a=getComputedStyle(n).getPropertyValue("color");return a&&"rgba(0, 0, 0, 0)"!==a?(0,nE.default)(a).toHexString().toUpperCase():null})(i)})},[i]),n},nD=(e,t)=>{let{selection:i,doc:n,schema:a}=e.state,{from:r,to:o}=i,s=t?(0,ex.markHasRangeWithEmptySelection)(n,r,o,a.marks.highlight):n.rangeHasMark(r,o,a.marks.highlight);if(t?(0,ex.markHasRangeWithEmptySelection)(n,r,o,a.marks.textColor):n.rangeHasMark(r,o,a.marks.textColor))return{state:null,color:null};{if(!s)return{state:"default",color:null};let t=nT(e.state,"highlight","hex");return t?{state:null,color:t}:{state:"mixed",color:null}}},nN=({color:e,fixedWidth:t,isChecked:i})=>(0,d.jsxs)(nv.Stack,{spacing:"2px",children:[(0,d.jsx)(iZ.Text,{children:i?(0,d.jsx)(na.CheckIcon,{}):(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faFont,fixedWidth:t,size:e?"sm":void 0,transform:{y:3*!!e}})}),e&&(0,d.jsx)(u.Flex,{w:5,h:1.5,bg:e,borderRadius:"sm",borderWidth:"1px",borderColor:"blackAlpha.400"})]});e.s(["TextColorMenu",0,nj],833431),e.s(["canBringForward",()=>nH,"canSendBackward",()=>nW,"getCurrentFontSize",()=>nU],234867),e.s(["BASE_FONT_SIZE",()=>nO,"DEFAULT_VIEWBOX_WIDTH",()=>nR,"getPositionedBoxStyles",()=>nB],658729);let nR=1e3,nO=16,nB=({isEditable:e})=>{let t={".pptx-exporting-image":{".positioned-box":{visibility:"hidden"}},".positioned-html-box, .html-container-item":{"> [data-node-view-content]":{display:"contents"},'[data-node-view-content-inner="positionedHtmlBox"], [data-node-view-content-inner="htmlContainerItem"]':{display:"contents"},".react-renderer.node-htmlTextItem, .react-renderer.node-htmlImageItem, .react-renderer.node-htmlContainerItem":{display:"contents"}},".html-text-item":{".block":{my:0,color:"inherit",fontFamily:"inherit",fontWeight:"inherit"}},"@keyframes canvasIntroDots":{"0%":{opacity:1,clipPath:"inset(0 0 100% 0)"},"35%":{opacity:1,clipPath:"inset(0 0 0% 0)"},"75%":{opacity:1,clipPath:"inset(0 0 0% 0)"},"100%":{opacity:0,clipPath:"inset(0 0 0% 0)"}},"@keyframes canvasIntroBorder":{"0%":{boxShadow:"inset 0 0 0 0 rgba(99, 102, 241, 0)"},"20%":{boxShadow:"inset 0 0 0 2px rgba(99, 102, 241, 0.9), 0 0 18px 4px rgba(99, 102, 241, 0.45)"},"60%":{boxShadow:"inset 0 0 0 2px rgba(99, 102, 241, 0.6), 0 0 12px 2px rgba(99, 102, 241, 0.25)"},"100%":{boxShadow:"inset 0 0 0 0 rgba(99, 102, 241, 0)"}},"&[data-canvas-intro]":{"&::after":{content:'""',position:"absolute",inset:0,pointerEvents:"none",backgroundImage:"radial-gradient(circle, rgba(99, 102, 241, 0.45) 1px, transparent 1.6px)",backgroundSize:"14px 14px",opacity:0,animation:"canvasIntroDots 1400ms cubic-bezier(0.4, 0, 0.2, 1) forwards",zIndex:1},".positioned-box":{animation:"canvasIntroBorder 800ms cubic-bezier(0.4, 0, 0.2, 1) forwards",animationDelay:"var(--canvas-intro-delay, 0ms)"}},".positioned-box-content":{"[data-node-view-content]":{width:"100%"},".first-block":{mt:"0rem"},".last-block":{mb:"0rem"},".themed-heading":{width:"100%"},".block":{color:"inherit",fontFamily:"inherit"}},".positioned-textbox .positioned-box-content":{"--line-height-body":"1.25",".block-heading, .block-title":{mt:"0.5em",mb:"0.5em"},".block":{my:"0.5em"}}};return e&&(t[`&.is-focused, &:hover, &[${v.HANDLE_HOVERING_ATTR}]`]={".positioned-box":{outlineStyle:"solid"}}),t},nz=e=>"positionedTextbox"===e||"positionedContentBox"===e,nF=e=>{let{selection:t,doc:i}=e.state;if(!(t instanceof el.NodeSelection))return null;let n=t.node;if(!nz(n.type.name))return null;let a=t.from,r=i.resolve(a),o=r.before(r.depth),s=r.parent,l=0,d=0;return s.forEach((e,t)=>{nz(e.type.name)&&(o+t+1===a&&(l=d),d++)}),{node:n,pos:a,$pos:r,parentPos:o,parent:s,index:l,siblingCount:d}},nH=e=>{let t=nF(e);return!!t&&t.index{let t=nF(e);return!!t&&t.index>0},nU=e=>{let{selection:t}=e.state;if(!(t instanceof el.NodeSelection))return null;let i=t.node;return nz(i.type.name)?i.attrs.fontSize??nO:null},nV=[{value:"top",icon:D.faArrowUpToLine,label:()=>ee.i18n._({id:"WWy8TN",message:"Top"})},{value:"center",icon:D.faArrowsToLine,label:()=>ee.i18n._({id:"S1g3Ds",message:"Middle"})},{value:"bottom",icon:D.faArrowDownToLine,label:()=>ee.i18n._({id:"zsiX7I",message:"Bottom"})}],nG=({editor:e,selection:t})=>{let{verticalAlign:i,horizontalAlign:n}=t.node.attrs,a=nU(e),r=(0,et.useCallback)(i=>{e.chain().focus().updateAttributesAtPos(t.from,{verticalAlign:i}).selectNodeAtPos(t.from).run()},[e,t.from]),o=(0,et.useCallback)(i=>{let n=t.from;e.chain().updateAttributesAtPos(n,{horizontalAlign:i}).toggleHorizontalAlign(i).selectNodeAtPos(n).run()},[e,t.from,n]),s=g.AlignmentCommands.find(t=>t.checkActive?.(e)),l=s?.icon||D.faAlignCenter,c=nV.find(e=>e.value===i),u=c?.icon||D.faArrowUpToLine;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(nj,{editor:e}),(0,d.jsxs)(i$.ButtonGroup,{spacing:0,onMouseDown:nL.preventDefaultToAvoidBlur,children:[(0,d.jsx)($.ToolbarButton,{icon:D.faMinus,label:(0,d.jsx)(G.Trans,{message:"Decrease font size",id:"p1hcK1"}),onClick:()=>e.commands.updatePositionedBoxFontSize(-1),testId:"font-size-decrease"}),(0,d.jsx)($.ToolbarTooltip,{label:(0,d.jsx)(G.Trans,{message:"Font size",id:"q3il6U"}),children:(0,d.jsx)(V.Button,{variant:"toolbar",size:"sm",minW:"32px",onMouseDown:nL.preventDefaultToAvoidBlur,children:a?Math.round(a):"—"})}),(0,d.jsx)($.ToolbarButton,{icon:D.faPlus,label:(0,d.jsx)(G.Trans,{message:"Increase font size",id:"a/oQVj"}),onClick:()=>e.commands.updatePositionedBoxFontSize(1),testId:"font-size-increase"})]}),(0,d.jsxs)(nf.Menu,{isLazy:!0,onClose:()=>(0,ny.focusEditorOnMenuClose)(e),children:[(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:(0,d.jsx)(G.Trans,{message:"Horizontal align",id:"EvYSar"}),children:(0,d.jsx)(nb.MenuButton,{as:V.Button,variant:"toolbar",size:"sm",onMouseDown:nL.preventDefaultToAvoidBlur,rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown,transform:"shrink-6"}),"data-testid":"h-align-dropdown",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:l})})}),(0,d.jsx)(Q.Portal,{children:(0,d.jsx)(nx.MenuList,{minW:"auto",zIndex:"modalPopover",dir:"ltr",children:g.AlignmentCommands.map(e=>(0,d.jsx)($.ToolbarButton,{icon:e.icon,label:e.name(),onClick:()=>o(e.alignment),isActive:n===e.alignment,testId:`h-align-${e.key}`,shortcut:e.shortcut},e.key))})})]}),(0,d.jsxs)(nf.Menu,{isLazy:!0,onClose:()=>(0,ny.focusEditorOnMenuClose)(e),children:[(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:(0,d.jsx)(G.Trans,{message:"Vertical align",id:"TWP/UJ"}),children:(0,d.jsx)(nb.MenuButton,{as:V.Button,variant:"toolbar",size:"sm",onMouseDown:nL.preventDefaultToAvoidBlur,rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown,transform:"shrink-6"}),"data-testid":"v-align-dropdown",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:u})})}),(0,d.jsx)(Q.Portal,{children:(0,d.jsx)(nx.MenuList,{minW:"auto",zIndex:"modalPopover",children:(0,d.jsx)(K.HStack,{spacing:0,p:1,children:nV.map(({value:e,icon:t,label:n})=>(0,d.jsx)($.ToolbarButton,{icon:t,label:n(),onClick:()=>r(e),isActive:i===e,testId:`v-align-${e}`},e))})})})]}),(0,d.jsxs)(nf.Menu,{isLazy:!0,onClose:()=>(0,ny.focusEditorOnMenuClose)(e),children:[(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:(0,d.jsx)(G.Trans,{message:"Layer order",id:"ECHjfh"}),children:(0,d.jsx)(nb.MenuButton,{as:V.Button,variant:"toolbar",size:"sm",onMouseDown:nL.preventDefaultToAvoidBlur,rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown,transform:"shrink-6"}),"data-testid":"layer-order-dropdown",children:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faBringFront})})}),(0,d.jsx)(Q.Portal,{children:(0,d.jsx)(nx.MenuList,{minW:"auto",zIndex:"modalPopover",children:(0,d.jsxs)(K.HStack,{spacing:0,p:1,children:[(0,d.jsx)($.ToolbarButton,{icon:D.faBringFront,label:ee.i18n._({id:"IS9/i3",message:"Bring to front"}),onClick:()=>e.commands.bringToFront(),disabled:!nH(e),testId:"layer-bring-to-front"}),(0,d.jsx)($.ToolbarButton,{icon:D.faBringForward,label:ee.i18n._({id:"i4A317",message:"Bring forward"}),onClick:()=>e.commands.bringForward(),disabled:!nH(e),testId:"layer-bring-forward"}),(0,d.jsx)($.ToolbarButton,{icon:D.faSendBackward,label:ee.i18n._({id:"yWNAen",message:"Send backward"}),onClick:()=>e.commands.sendBackward(),disabled:!nW(e),testId:"layer-send-backward"}),(0,d.jsx)($.ToolbarButton,{icon:D.faSendBack,label:ee.i18n._({id:"WMIp7w",message:"Send to back"}),onClick:()=>e.commands.sendToBack(),disabled:!nW(e),testId:"layer-send-to-back"})]})})})]}),(0,d.jsx)($.ToolbarButton,{icon:D.faTrash,label:(0,d.jsx)(G.Trans,{message:"Delete",id:"cnGeoo"}),onClick:()=>e.commands.deletePositionedBox(),color:"red.500",testId:"positioned-box-delete"})]})};var n$=e.i(860766);let nZ=({editor:e,attrs:t,selection:i})=>{let n=(0,n$.getCalloutBoxOptions)(),a=n[t.variant],r=a?a.icon:D.faStickyNote;return(0,d.jsxs)(nf.Menu,{isLazy:!0,onClose:()=>(0,ny.focusEditorOnMenuClose)(e),children:[(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:(0,d.jsx)(G.Trans,{message:"Style...",id:"H8b4pf"}),"aria-label":ee.i18n._({id:"H8b4pf",message:"Style..."}),children:(0,d.jsx)(nb.MenuButton,{as:V.Button,variant:"toolbar",rightIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faChevronDown,transform:"shrink-6"}),size:"sm",onMouseDown:nL.preventDefaultToAvoidBlur,children:(0,d.jsx)(N.FontAwesomeIcon,{icon:r})})}),(0,d.jsx)(nx.MenuList,{maxW:"auto",children:(0,d.jsxs)(i$.ButtonGroup,{flex:"row",alignItems:"center",children:[Object.entries(n).map(([n,{name:a,icon:r}])=>(0,d.jsx)($.ToolbarButton,{label:a,icon:r,isActive:t.icon&&t.variant===n,onClick:()=>{e.chain().focus().updateAttributes("calloutBox",{variant:n,icon:!0}).selectNodeAtPos(i.from).run()}},a)),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)($.ToolbarButton,{label:t.icon?(0,d.jsx)(G.Trans,{message:"Hide icon",id:"Cs6LHm"}):(0,d.jsx)(G.Trans,{message:"Show icon",id:"pjF2Hd"}),icon:D.faBan,isActive:!t.icon,onClick:()=>{e.chain().focus().updateAttributes("calloutBox",{icon:!t.icon}).selectNodeAtPos(i.from).run()}},"icon")]})})]})};e.s(["CalloutBoxFormattingMenu",0,({editor:e,selection:t})=>{let i=t.node.attrs;return(0,d.jsxs)(i$.ButtonGroup,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,d.jsx)(nZ,{editor:e,attrs:i,selection:t}),(0,d.jsx)(ea.ColorButton,{color:i.color||void 0,setColor:i=>{e.chain().focus().updateAttributes("calloutBox",{color:i}).selectNodeAtPos(t.from).run()},editor:e,analyticsSource:"CalloutBox"}),(0,d.jsx)(Z.FormattingMenuDivider,{}),(0,d.jsx)(nu.DeleteNodeButton,{editor:e})]})}],147313);var nK=e.i(468738),nq=e.i(854861),nY=e.i(501027);let nX=e=>{let t,{editor:i,getPos:n,findParentCard:a=!1,source:r="card-styling-menu"}=e,o=(t=(0,eu.useAppSelector)(ef.selectTheme),(0,et.useCallback)(()=>(0,nY.default)(t.config.accentBackgrounds),[t])),s=(0,nK.useAnalytics)();return(0,et.useCallback)(e=>{let t;try{let e=n();if("number"!=typeof e)return;if(a){let n=(0,eE.findParentNodeClosestToPos)(i.state.doc.resolve(e),ev.isCardNode);t=n?.pos}else t=e}catch(e){console.error(e);return}if("number"!=typeof t)return;let l=t,{selection:d}=i.state;(0,eE.isNodeSelection)(d)&&(0,nq.isBodyCardLayoutItem)(d.node)&&i.commands.selectNodeAtPos(l),"blank"===e?i.commands.setCardLayout(l,e):i.commands.setCardLayout(l,e,o),s?.track(en.SegmentEvents.CARD_LAYOUT_UPDATED,{source:r,layout:e})},[i,r,n,a,o,s])};e.s(["useSetLayout",0,nX],979504);let nQ=new iF.EventEmitter;e.s(["eventEmitter",0,nQ],459014);var nJ=e.i(788411),n0=e.i(338538);let n1=(e,t)=>{let{background:i,fitType:n}=e,{allowFit:a}=(0,nq.findLayoutPreset)(t);return a?n||(i?.image?.meta?.has_transparency?"fit":"fill"):"fill"},n2=(e,t)=>{let{allowFit:i}=(0,nq.findLayoutPreset)(t);return i&&e.background?.type===n0.BackgroundType.IMAGE},n3=e=>"blank"===e?ee.i18n._({id:"6JcK6b",message:"No layout"}):"behind"===e?ee.i18n._({id:"SQOVlA",message:"Background layout"}):ee.i18n._({id:"T8aKxO",message:"{0} layout",values:{0:(0,nJ.default)(e)}});e.s(["canChangeAccentImageFitType",0,n2,"getAccentImageFitType",0,n1,"getLayoutLabel",0,n3,"removeAccentImage",0,(e,t,i)=>{let n=(0,eE.findParentNodeClosestToPos)(e.state.doc.resolve(t),ev.isCardNode);t&&(i?e.commands.updateAttributesAtPos(t,{background:{type:n0.BackgroundType.NONE}}):n?.pos&&(e.commands.setCardLayout(n.pos,"blank"),e.commands.selectInsideCardBody(n.pos)))}],24066),e.i(144786);var n5=e.i(849187);let n4=e=>!(!e||!e.src||e.src.startsWith("blob:"));e.s(["isImageEditableWithAI",0,n4],745914);let n6=e=>(0,n5.useFeatureFlag)("aiImageEditing")&&n4(e);e.s(["useCanEditImageWithAI",0,n6],558247);var n9=e.i(562409);e.s(["useCardAccentBackground",0,(e,t)=>{let i=e.background,{src:n,tempUrl:a}=i?.image||{},r=i?.type===n0.BackgroundType.IMAGE,o=i&&i.type!==n0.BackgroundType.NONE,s=n6(i?.image),l=(0,n9.findCardLayoutDecorationSpec)(t),d=l?.layout,c=n1(e,d),u=n2(e,d),p=r&&i?.image&&!(0,W.isMp4Url)(i?.image.src),h=(0,W.isSVGUrl)(n||a||void 0);return{background:i,canChangeFit:u,canEditImageWithAI:s,cardLayoutDeco:l,displayLayout:d,fitType:c,hasAccentImage:o,hasImage:r,isImageMp4:(0,W.isMp4Url)(n||a||void 0),isImageSVG:h,showChangeFocusPoint:p,src:n,tempUrl:a}}],892493);var n8=e.i(344233);let n7=["blank","top","left","right","behind"],ae=({layout:e,isSelected:t})=>{let i=t?"trueblue.400":"gray.300",n=null;return"top"===e?n=(0,d.jsx)(c.Box,{height:"0.375rem",width:"100%",background:i}):"left"===e?n=(0,d.jsxs)(u.Flex,{height:"100%",minH:"100%",children:[(0,d.jsx)(c.Box,{width:"0.625rem",minH:"100%",background:i}),(0,d.jsx)(c.Box,{flex:"1",minH:"100%"})]}):"right"===e&&(n=(0,d.jsxs)(u.Flex,{height:"100%",minH:"100%",children:[(0,d.jsx)(c.Box,{flex:"1",minH:"100%"}),(0,d.jsx)(c.Box,{width:"0.625rem",minH:"100%",background:i})]})),(0,d.jsx)(c.Box,{boxSizing:"border-box",height:"1.25rem",width:"1.75rem",border:"2px solid",borderRadius:"sm",borderColor:i,background:"behind"===e?i:"none",children:n})};e.s(["CARD_LAYOUTS",0,n7,"CardLayoutIcon",0,ae,"CardLayoutSelector",0,({layout:e,editor:t,getPos:i,edgeLayoutsEnabled:n})=>{let a=nX({editor:t,getPos:i}),r=n7.filter(e=>n||["blank","behind"].includes(e));return(0,d.jsx)(i$.ButtonGroup,{mb:2,dir:"ltr",children:r.map(t=>{let i=n3(t);return(0,d.jsx)(eh.GammaTooltip,{label:i,placement:"top",children:(0,d.jsx)(n8.IconButton,{"aria-label":i,flex:1,variant:"plain",size:"md",onClick:()=>a(t),icon:(0,d.jsx)(ae,{layout:t,isSelected:e===t}),boxShadow:"none",background:e===t?"trueblue.50":"white"})},t)})})}],372030),e.s(["useImageCardActionsMenuItems",0,({disabled:e=!1,canSetAsAccent:t=!0,canTurnIntoCard:i=!0,canSetAsBackground:n=!0,onTurnIntoCard:a,onSetCardLayout:r,selectedLayout:o,isAccentImage:s=!1})=>{let l=(0,n5.useFeatureFlag)("imageCardsUX"),c=l&&!e;return{imageCardActionsMenuItems:(0,et.useMemo)(()=>c?[...i?[{key:"turn-into-card",label:(0,d.jsx)(G.Trans,{message:"Turn into image card",id:"jUkA2U"}),icon:D.faExpand,onClick:a}]:[],...t?[{key:"set-as-accent",label:s?(0,d.jsx)(G.Trans,{message:"Change layout",id:"TGTgli"}):(0,d.jsx)(G.Trans,{message:"Set as accent",id:"Dm4dwd"}),icon:D.faSidebarFlip,items:n7.filter(e=>"blank"!==e&&"behind"!==e).map(e=>({key:e,label:n3(e),icon:(0,d.jsx)(ae,{layout:e,isSelected:!!o&&o===e}),onClick:()=>{r(e)}}))}]:[],...n?[{key:"use-as-card-background",label:(0,d.jsx)(G.Trans,{message:"Use as card background",id:"HWxTPM"}),icon:D.faImage,onClick:()=>{r("behind")}}]:[]]:[],[c,t,i,n,a,r,o,s]),showImageCardOptions:c,imageCardsUXEnabled:l}}],555027),e.s(["BuddyImageEditDropdownMenu",()=>dZ],425605);var at=e.i(406112),ai=e.i(853081),an=e.i(134499),aa=e.i(148908),ar=e.i(175440);e.i(203828);var ao=e.i(35585),as=e.i(514945),al=e.i(616358),ad=e.i(405054);e.i(816350),e.i(792565);let ac=()=>{var e,t;let i,n,a=(0,eu.getStore)();return e=(0,ao.selectUserLocale)(a.getState()),t=(0,al.getGammaLocaleCookie)(),i=(0,ad.getSupportedLocaleKeyFromNavigatorLanguageOrUseFallback)(),n=(0,ad.isNavigatorLanguageGA)(),e||t||(n?i:ar.DEFAULT_GAMMA_LOCALE)},au={en:{displayName:"English (US)",displayNameLocalized:()=>ee.i18n._({id:"cJWHou",message:"English (US)"})},"en-gb":{displayName:"English (UK)",displayNameLocalized:()=>ee.i18n._({id:"KDEMVl",message:"English (UK)"})},"en-in":{displayName:"English (India)",displayNameLocalized:()=>ee.i18n._({id:"mqnttg",message:"English (India)"})},es:{displayName:"Español",displayNameLocalized:()=>ee.i18n._({id:"65A04M",message:"Spanish"})},"es-es":{displayName:"Español (España)",displayNameLocalized:()=>ee.i18n._({id:"UYPXPZ",message:"Spanish (Spain)"})},"es-mx":{displayName:"Español (México)",displayNameLocalized:()=>ee.i18n._({id:"CdooNf",message:"Spanish (Mexico)"})},"es-419":{displayName:"Español (Latinoamérica)",displayNameLocalized:()=>ee.i18n._({id:"Ni47Oh",message:"Spanish (Latin America)"})},ca:{displayName:"Català",displayNameLocalized:()=>ee.i18n._({id:"M1RLfx",message:"Catalan"})},fr:{displayName:"Français",displayNameLocalized:()=>ee.i18n._({id:"nLC6tu",message:"French"})},"zh-cn":{displayName:"简体中文",displayNameLocalized:()=>ee.i18n._({id:"QBySSi",message:"Simplified Chinese"})},"zh-tw":{displayName:"繁體中文",displayNameLocalized:()=>ee.i18n._({id:"Mpms0p",message:"Traditional Chinese"})},ko:{displayName:"한국어",displayNameLocalized:()=>ee.i18n._({id:"h6S9Yz",message:"Korean"})},ja:{displayName:"日本語 (です/ます体)",displayNameLocalized:()=>ee.i18n._({id:"I9nscg",message:"Japanese (です/ます style)"})},"ja-da":{displayName:"日本語 (だ/である体)",displayNameLocalized:()=>ee.i18n._({id:"GMG8Tf",message:"Japanese (だ/である style)"})},"pt-br":{displayName:"Português (Brasil)",displayNameLocalized:()=>ee.i18n._({id:"R7+D0/",message:"Portuguese (Brazil)"})},"pt-pt":{displayName:"Português (Portugal)",displayNameLocalized:()=>ee.i18n._({id:"512Uma",message:"Portuguese (Portugal)"})},de:{displayName:"Deutsch",displayNameLocalized:()=>ee.i18n._({id:"DDcvSo",message:"German"})},it:{displayName:"Italiano",displayNameLocalized:()=>ee.i18n._({id:"Lj7sBL",message:"Italian"})},ru:{displayName:"Русский",displayNameLocalized:()=>ee.i18n._({id:"nji0/X",message:"Russian"})},pl:{displayName:"Polski",displayNameLocalized:()=>ee.i18n._({id:"trnWaw",message:"Polish"})},uk:{displayName:"Українська",displayNameLocalized:()=>ee.i18n._({id:"V9+2pH",message:"Ukrainian"})},ro:{displayName:"Română",displayNameLocalized:()=>ee.i18n._({id:"uJc01W",message:"Romanian"})},hu:{displayName:"Magyar",displayNameLocalized:()=>ee.i18n._({id:"mkWad2",message:"Hungarian"})},cs:{displayName:"Čeština",displayNameLocalized:()=>ee.i18n._({id:"w9VTXG",message:"Czech"})},el:{displayName:"Ελληνικά",displayNameLocalized:()=>ee.i18n._({id:"CZXzs4",message:"Greek"})},tr:{displayName:"Türkçe",displayNameLocalized:()=>ee.i18n._({id:"Kz91g/",message:"Turkish"})},ar:{displayName:"العربية",displayNameLocalized:()=>ee.i18n._({id:"8HV3WN",message:"Arabic"})},"ar-sa":{displayName:"العربية (السعودية)",displayNameLocalized:()=>ee.i18n._({id:"9E6cqp",message:"Arabic (Saudi Arabia)"})},he:{displayName:"עברית",displayNameLocalized:()=>ee.i18n._({id:"3oTCgM",message:"Hebrew"})},fa:{displayName:"فارسی",displayNameLocalized:()=>ee.i18n._({id:"JFI3iH",message:"Persian"})},nl:{displayName:"Nederlands",displayNameLocalized:()=>ee.i18n._({id:"KIjvtr",message:"Dutch"})},sv:{displayName:"Svenska",displayNameLocalized:()=>ee.i18n._({id:"UaISq3",message:"Swedish"})},da:{displayName:"Dansk",displayNameLocalized:()=>ee.i18n._({id:"Fo2vDn",message:"Danish"})},nb:{displayName:"Norsk",displayNameLocalized:()=>ee.i18n._({id:"1IipHp",message:"Norwegian"})},fi:{displayName:"Suomi",displayNameLocalized:()=>ee.i18n._({id:"USZ2N6",message:"Finnish"})},id:{displayName:"Bahasa Indonesia",displayNameLocalized:()=>ee.i18n._({id:"BQukYF",message:"Indonesian"})},vi:{displayName:"Tiếng Việt",displayNameLocalized:()=>ee.i18n._({id:"fROFIL",message:"Vietnamese"})},hi:{displayName:"हिन्दी",displayNameLocalized:()=>ee.i18n._({id:"tGjibo",message:"Hindi"})},gu:{displayName:"ગુજરાતી",displayNameLocalized:()=>ee.i18n._({id:"sGpqyx",message:"Gujarati"})},mr:{displayName:"मराठी",displayNameLocalized:()=>ee.i18n._({id:"vKSpmV",message:"Marathi"})},te:{displayName:"తెలుగు",displayNameLocalized:()=>ee.i18n._({id:"2SnOmG",message:"Telugu"})},bn:{displayName:"বাংলা",displayNameLocalized:()=>ee.i18n._({id:"Hds3Bq",message:"Bengali"})},ta:{displayName:"தமிழ்",displayNameLocalized:()=>ee.i18n._({id:"fb427h",message:"Tamil"})},ur:{displayName:"اردو",displayNameLocalized:()=>ee.i18n._({id:"tmwuH9",message:"Urdu"})},kn:{displayName:"ಕನ್ನಡ",displayNameLocalized:()=>ee.i18n._({id:"ffJEXe",message:"Kannada"})},ml:{displayName:"മലയാളം",displayNameLocalized:()=>ee.i18n._({id:"WQrafy",message:"Malayalam"})},th:{displayName:"ภาษาไทย",displayNameLocalized:()=>ee.i18n._({id:"SUr44j",message:"Thai"})},sr:{displayName:"Српски",displayNameLocalized:()=>ee.i18n._({id:"9aBtdW",message:"Serbian"})},hr:{displayName:"Hrvatski",displayNameLocalized:()=>ee.i18n._({id:"0aMWde",message:"Croatian"})},sq:{displayName:"Shqip",displayNameLocalized:()=>ee.i18n._({id:"pVxf7b",message:"Albanian"})},bg:{displayName:"Български",displayNameLocalized:()=>ee.i18n._({id:"KhEBDR",message:"Bulgarian"})},sl:{displayName:"Slovenščina",displayNameLocalized:()=>ee.i18n._({id:"LSdcWW",message:"Slovenian"})},bs:{displayName:"Bosanski",displayNameLocalized:()=>ee.i18n._({id:"oI7LTM",message:"Bosnian"})},mk:{displayName:"Македонски",displayNameLocalized:()=>ee.i18n._({id:"0MMlCU",message:"Macedonian"})},sw:{displayName:"Kiswahili",displayNameLocalized:()=>ee.i18n._({id:"Yz+oFV",message:"Swahili"})},ha:{displayName:"Hausa",displayNameLocalized:()=>ee.i18n._({id:"MvvYTW",message:"Hausa"})},yo:{displayName:"Yorùbá",displayNameLocalized:()=>ee.i18n._({id:"FcCBes",message:"Yoruba"})},tl:{displayName:"Tagalog",displayNameLocalized:()=>ee.i18n._({id:"ISVD3+",message:"Tagalog"})},ms:{displayName:"Bahasa Melayu",displayNameLocalized:()=>ee.i18n._({id:"tF97tn",message:"Malay"})},kk:{displayName:"Қазақ тілі",displayNameLocalized:()=>ee.i18n._({id:"F/vx72",message:"Kazakh"})},uz:{displayName:"O'zbek tili",displayNameLocalized:()=>ee.i18n._({id:"b1dG47",message:"Uzbek"})},af:{displayName:"Afrikaans",displayNameLocalized:()=>ee.i18n._({id:"1Cox/a",message:"Afrikaans"})},lv:{displayName:"Latviešu",displayNameLocalized:()=>ee.i18n._({id:"/0YsGP",message:"Latvian"})},lt:{displayName:"Lietuvių",displayNameLocalized:()=>ee.i18n._({id:"Ot2qtY",message:"Lithuanian"})},et:{displayName:"Eesti",displayNameLocalized:()=>ee.i18n._({id:"l2pzUk",message:"Estonian"})},is:{displayName:"Íslenska",displayNameLocalized:()=>ee.i18n._({id:"rJl8hp",message:"Icelandic"})},cy:{displayName:"Cymraeg",displayNameLocalized:()=>ee.i18n._({id:"4w9b2x",message:"Welsh"})}},ap=Object.keys(an.AI_LOCALES).map(e=>{let t=au[e];return{key:e,englishName:an.AI_LOCALES[e].englishName,displayName:t.displayName,displayNameLocalized:t.displayNameLocalized}}),ah=e=>{let t=e?.toLowerCase();return ap.find(e=>e.key.toLowerCase()===t)||null},am=e=>{let t=ah(e);if(t)return t;let i=ar.FALLBACK_LOCALES[e],n=i&&ah(i);if(n)return n;let[a]=e?e.toLowerCase().split("-"):[],r=a&&ah(a);return r||null},ag=e=>{let t=am(e);if(t)return t;let i=ab(e);if(i)return i;let n=am(ac());return n||af},af={key:"en",englishName:"English (US)",displayName:"English (US)",displayNameLocalized:()=>ee.i18n._({id:"cJWHou",message:"English (US)"})},ab=e=>{let t=ac();try{let i=new Intl.DisplayNames([t],{type:"language",fallback:"none"}),n=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"}).of(e),a=i.of(e);if(!n||!a)return null;return{key:e.toLowerCase(),englishName:n,displayName:a,displayNameLocalized:()=>a}}catch(e){return null}};e.s(["AI_LOCALE_OPTIONS",0,ap,"getAILocale",0,ag,"getAiLocaleOptionsSorted",0,()=>(0,aa.default)(ap,e=>e.displayNameLocalized())],689130);var ax=e.i(195305);e.i(905506);var ay=e.i(267158);let av={},aC=e=>{let[t,i]=(0,et.useState)([]),[n,a]=(0,et.useState)("ready"),{generate:r}=(0,ai.useStreamingJsxGeneration)("SuggestImageEdits",{onStart(){a("generating"),i([])},onContent(e){i(aw(e))},onComplete(e){i(aw(e)),a("done")},onError(e){console.error("Error generating suggestions",e),a("error")},timeout:2e4}),o=ag((0,eu.useAppSelector)(as.selectDisplayLocale)),s=(0,et.useCallback)(()=>{let t=(0,ax.getCurrentWorkspaceId)(),n=e?.src?.split(".").pop();if(!e?.src||!t||!n)return void i([]);let s=av[e.src];if(s){i(s),a("done");return}let{promise:l}=r({variables:{imageUrl:e.src,originalPrompt:e.query??void 0,language:o.englishName},workspaceId:t});l.then(t=>{av[e.src]=aw(t)}),l.catch(e=>{console.error("Error generating suggestions",e),i([]),a("error")})},[r,e,o]);return(0,ay.useEffectWhen)(()=>{s()},[e?.src,s],[e?.src]),{suggestions:t,generateSuggestionsStatus:n}},aw=e=>e.split("\n").filter(Boolean);e.s(["useSuggestImageEdits",0,aC],663025);var aS=e.i(275885),ak=e.i(949125),aA=e.i(844290);e.i(988162);var aE=e.i(71259),a_=e.i(921679),aI=e.i(45954),aM=e.i(706923),aT=e.i(329860);let aL=({editor:e,pos:t,attrs:i})=>{if(!e)return;let n=e.state.doc.nodeAt(t);if(!n)return;let a=n.type.spec.imageKeyPath;if(!["image","mediaPlaceholder","graphic"].includes(n.type.name)&&!a)return void console.warn(`[updateSelectedMedia] Node ${n.type.name} is not compatible with updateSelectedMedia`);let r=e.chain();a?(r.updateAttributeKeyPathAtPos(t,a,i),a.startsWith("background.")&&(r.updateAttributeKeyPathAtPos(t,"background.source",i.source),r.updateAttributeKeyPathAtPos(t,"background.type",n0.BackgroundType.IMAGE))):"mediaPlaceholder"===n.type.name?r.insertContentAt({from:t,to:t+n.nodeSize},{type:"image",attrs:i},{updateSelection:!0}):r.updateAttributesAtPos(t,i),r.focus().scrollIntoView().run()};e.s(["getSelectedMedia",0,({editor:e,selection:t,freshNode:i})=>{if(!t||!(t instanceof el.NodeSelection||t instanceof ed))return null;let n=i??t.node;if(t.$from,(0,aT.isMediaNodeType)(n.type)){let e;return{mediaType:(e=n.attrs.source)?er(e)?"icon":e.startsWith("image.")?"image":e.startsWith("video.")||e.startsWith("embed.")?"embed":"image":"image",area:"node",attrs:(0,a_.default)(n.attrs),node:n,id:n.attrs.id}}if("cardAccentLayoutItem"===n.type.name){let e=n.attrs;return e.background?.type===n0.BackgroundType.IMAGE&&e.background.image?{mediaType:"image",area:"background",attrs:(0,a_.default)(e.background.image),node:n,id:n.attrs.id,imgKeyPath:"background.image"}:null}if((0,ev.isCardImageItemNode)(n))return{mediaType:"image",area:"node",attrs:(0,a_.default)(n.attrs.image),node:n,id:n.attrs.id,imgKeyPath:"image"};if("gridItem"===n.type.name){let e=n.attrs.options?.marker?.iconData;return e?{mediaType:"icon",area:"accessory",attrs:(0,a_.default)(e),node:n,id:n.attrs.id,imgKeyPath:"options.marker.iconData"}:null}let a=n.type.spec.accessoryImageKey;if(a){let e={...n.attrs[a]},i="image";return(0,aI.isSmartLayoutNode)(t.$from.parent)&&"icon"===(0,aM.getSmartLayoutVariant)(t.$from.parent.attrs.variantKey).imageType&&(i="icon"),{attrs:(0,a_.default)(e),node:n,mediaType:i,id:n.attrs.id,area:"accessory",imgKeyPath:a}}if(t instanceof ed){let e="icon";return"image"===t.context.selectionType?e="image":"icon"===t.context.selectionType&&(e="icon"),{attrs:(0,a_.default)(t.getItemData()??{}),node:n,mediaType:e,id:n.attrs.id,area:"accessory",imgKeyPath:t.keyPath}}return null},"updateSelectedMedia",0,aL],322830);let aj=(e,t)=>{let i;try{e.state.doc.descendants((n,a)=>{if(n.attrs.id===t){let r=(0,aE.getNodeImageAttrs)(n),o=(0,eC.absoluteToRelativePos)(e.state,a);throw r&&o&&(i={attrs:r,id:t,relativePosition:o}),Error("found matching node id")}return!0})}catch(e){}if(!i)throw Error(`Could not find image with id ${t}`);return i};e.i(586044);var aP=e.i(365808),aD=e.i(297391),aN=e.i(136234);e.i(204319),e.i(397068),e.i(548402);var aR=e.i(923284);let aO=(e,t)=>aB(e,t)[0],aB=(e,t)=>{let i=new DOMParser().parseFromString(e,"text/html");return(0,aP.parseGmlFromDocument)(i,{bookmarks:t})};e.s(["aiHtmlWithLayoutsToCardJSONContent",0,aO],643940);var az=e.i(686296),aF=e.i(372764),aH=e.i(189938);let aW=e=>{let t=e.getState(),i=(0,ef.selectCardIdMap)(t),n=(0,aH.selectCardTextMap)(t);return Object.keys(i.tree).map(e=>n[e]?.title).filter(e=>!!e).join("\n")},aU=e=>({accentColors:(e?(0,az.getThemeAccentColors)(e):[]).slice(0,10).map(e=>(0,az.getThemeColorSolid)(e))});e.s(["ChangeThemeSuggestion",()=>sv],104056),e.s(["BuddyEditorInterface",()=>sn],13556);var aV=e.i(182535),aG=e.i(164149);e.s(["lazyLoadAsyncJSONContent",()=>o9,"lazyLoadAsyncNodes",()=>o6],240178);var a$=e.i(402261),aZ=e.i(413754);class aK{usedImages=new Set;results=new Map;requestPromises=new Map;validImagePromises=new Map;debugRequests=[];generateImagePromises=new Map;foundImages=new Map;getKey({query:e,provider:t,options:i}){return`${t}__${e}__${JSON.stringify(i)}`}markUsed(e){this.usedImages.add(e)}isUsed(e){return this.usedImages.has(e)}async findImage(e,t=!0){let i;if(e.loadImageId){let t=this.foundImages.get(e.loadImageId);if(t)return t}await this.loadImageResults(e);let n=this.getKey(e);return this.validImagePromises.has(n)?(i=this.validImagePromises.get(n).then(()=>this.findValidImage(e)),this.validImagePromises.set(n,i)):i=this.findValidImage(e),this.validImagePromises.set(n,i),i.then(i=>(i&&t&&this.markUsed(i.imageUrl),i&&e.loadImageId&&this.foundImages.set(e.loadImageId,i),i))}async findValidImage(e){let t=this.getKey(e);for(let e of this.results.get(t)){let{image:t}=e;if(!this.isUsed(t.imageUrl)&&(void 0===e.isValid&&(e.isValid=await (0,W.isDownloadableImageSrc)(t.imageUrl)),e.isValid))return e.image}return null}async loadImageResults(e){let{query:t,provider:i,options:n,count:a}=e,r=this.getKey({query:t,provider:i,options:n});if(this.results.has(r))return;if(this.requestPromises.has(r))return void await this.requestPromises.get(r);this.debugRequests.push(r);let o=(0,aZ.fetchImageSearchResults)({query:t,count:a,options:n,provider:i}).then(e=>e.filter(e=>(0,W.isValidImageString)(e.imageUrl))).then(e=>{let t=e.map(e=>({image:e,isValid:void 0}));return this.results.set(r,t),e});this.requestPromises.set(r,o),await o}debugInfo(){return{requests:this.debugRequests}}}e.s(["StreamImageSearchStore",0,aK],395993);var aq=e.i(929508),aY=e.i(275316),aX=e.i(974994);e.i(185340);var aQ=e.i(863750),aJ=e.i(683989),a0=e.i(412676);let a1=async e=>{let{themeId:t,docId:i,traceparent:n}=e,a=t?{context:aQ.SavedMediaContext.Theme,themeId:e.themeId}:i?{context:aQ.SavedMediaContext.Doc,docId:e.docId}:{context:e.context},r={interactionId:e.interactionId,interface:"generate-image",streaming:!1,inputContent:e.prompt,docId:e.docId};(0,aq.trackAIRequestSent)(r);let o=performance.now();try{let t=(0,aJ.getApolloClient)(),{data:i}=await t.mutate({mutation:a0.GENERATE_ANIMATION_MUTATION,variables:{input:{workspaceId:e.workspaceId,model:e.model,prompt:e.prompt,count:e.count||1,aspectRatio:e.aspectRatio,sourceImageUrl:e.sourceImageUrl,stylePreset:e.stylePreset,artStylePreset:e.artStylePreset,artStylePrompt:e.artStylePrompt,...a,interactionId:e.interactionId}},context:{...(0,aX.getAiMediaGraphqlContext)(),headers:n?{"aijsx-traceparent":n}:void 0}});return(0,aq.trackAIRequestResponse)({...r,latency:performance.now()-o}),i?.generateAnimation||[]}catch(e){throw console.error("(caught) [AIGenerateAnimation] error:",e),(0,aq.trackAIRequestError)({...r,latency:performance.now()-o,errorName:"GenerateAnimationError",errorMessage:e.message,outputMessage:""}),e}};var a2=e.i(828044);let a3=async e=>{let t=(0,aJ.getApolloClient)(),i=e.themeId?aQ.SavedMediaContext.Theme:e.docId?aQ.SavedMediaContext.Doc:e.context||aQ.SavedMediaContext.Doc,{data:n}=await t.mutate({mutation:a2.GENERATE_INFOGRAPHIC_MUTATION,variables:{input:{workspaceId:e.workspaceId,docId:e.docId,themeId:e.themeId,interactionId:e.interactionId,prompt:e.prompt,language:e.language,stylePrompt:e.stylePrompt||"",count:e.count||1,aspectRatio:e.aspectRatio,styleReferenceKey:e.styleReferenceKey,layout:e.layout,context:i,model:e.model,extractText:e.extractText,interactionName:e.interactionName,loadImageId:e.loadImageId}},context:{...(0,aX.getAiMediaGraphqlContext)(),headers:e.traceparent?{"aijsx-traceparent":e.traceparent}:void 0}});return n?.generateInfographic||[]};var a5=e.i(639243),a4=e.i(204708),a6=e.i(486962),a9=e.i(297194),a8=e.i(312965),a7=e.i(391736);let re=async({loadImageId:e,loadImageParams:t,context:i,imageStore:n})=>{let{query:a,options:r,provider:o}=t,{interactionId:s,interactionName:l,...d}=i;try{if("aiGenerated"===o){if(r.styleReferenceKey&&aY.featureFlags.get("deckStyledImages")){let t=await (0,a5.fetchGenerateStyledImage)({interactionId:s||(0,a$.generateAIInteractionId)(),workspaceId:d.workspaceId,docId:d.docId,themeId:d.themeId||i.theme?.id,prompt:a,count:1,aspectRatio:(0,aN.aspectRatioKeyToNumeric)(r.aspectRatio||aN.DEFAULT_ASPECT_RATIO),styleReferenceKey:r.styleReferenceKey,traceparent:i.traceparent,interactionName:l,loadImageId:e});if(!t[0])return{loadImageStatus:"error"};return{...t[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}let t={...r,interactionId:s||(0,a$.generateAIInteractionId)(),steps:30,...d,prompt:a,count:1,loadImageId:e,interactionName:l},n=await (0,aD.fetchGenerateImage)(t);if((0,a6.isGenerateImagePlanRestriction)(n)||!n[0])return{loadImageStatus:"error"};return{...n[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}if("aiAnimation"===o){let t={...r,interactionId:s||(0,a$.generateAIInteractionId)(),...d,prompt:a,count:1,loadVideoId:e,aspectRatio:r.aspectRatio||aN.DEFAULT_ASPECT_RATIO},i=await a1(t);if(!i[0])return{loadImageStatus:"error"};return{...i[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}if("aiInfographic"===o){let t=r.language,n=r.aspectRatio||aN.DEFAULT_ASPECT_RATIO,o=r.styleReferenceKey,c=r.layout,u=r.model||aY.featureFlags.get("infographicModel");if(!o)return console.error("[loadImageFromAttrs] Missing styleReferenceKey for infographic"),{loadImageStatus:"error"};let p={interactionId:s||(0,a$.generateAIInteractionId)(),workspaceId:d.workspaceId,docId:d.docId,themeId:d.themeId||i.theme?.id,prompt:a,language:t,stylePrompt:r.stylePrompt||"",count:1,aspectRatio:n,styleReferenceKey:o,layout:c,model:u,traceparent:i.traceparent,interactionName:l,loadImageId:e},h=await a3(p);if(!h[0])return{loadImageStatus:"error"};return{...h[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}else if("accentTheme"===o){let t=i.theme.config.accentBackgrounds,n=(0,aR.sampleWithSeed)(t,e);return{...n.image,source:n.image?.source||"image.custom",loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}else if("icon"===o){let{primary:i,fallback:r}=rt(),o=i,s=await n.findImage({query:a,provider:o,options:t.options,loadImageId:e,count:5});if(s||(o=r,s=await n.findImage({query:a,provider:o,options:t.options,loadImageId:e,count:5})),!s)return{query:a,source:a4.ImageSearchProvidersToMediaProviderKey[i],loadImageStatus:"error"};return{...(0,a8.imageResultToImageAttrs)(s,a,o),loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}else{let i=await n.findImage({query:a,provider:o,options:t.options,loadImageId:e});if(!i)return{query:a,source:a4.ImageSearchProvidersToMediaProviderKey[o],loadImageStatus:"error"};return{...(0,a8.imageResultToImageAttrs)(i,a,o),loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}}catch(e){return console.error(`[AIStream] An error occurred while fetching image: ${e.message}`,e.stack),{loadImageStatus:"error"}}},rt=()=>{let e=aY.featureFlags.get("aiIconProvider");return{primary:e,fallback:"pictographicIcons"===e?"fontawesome":"pictographicIcons"}};class ri{nodeType="cardCodeItem";selector=`img[${aP.AI_PARSED_ATTRIBUTE}], icon[${aP.AI_PARSED_ATTRIBUTE}]`;detectNode(e){if(e.type.name!==this.nodeType)return!1;let t=e.attrs.code;return!!t&&this.findQueuedPlaceholders(t).length>0}getNodeId(e){if(e.type.name!==this.nodeType)return null;let t=e.attrs.code||"",i=this.findQueuedPlaceholders(t).map(e=>this.parsePlaceholderAttrs(e).loadImageId).filter(e=>!!e).sort();return i.length>0?`cardCodeItem__${i.join(",")}`:e.attrs?.id||null}getCacheKey(e,t){return`${t.interactionId}__${this.nodeType}__${this.getNodeId(e)??"unknown"}`}async processNode(e,t){let i=e.attrs,n=this.parseFragment(i.code),a=Array.from(n.content.querySelectorAll(this.selector));return await Promise.all(a.map(e=>this.resolvePlaceholder(e,t))),{...i,aiGenerateStatus:"done",code:n.innerHTML}}parseFragment(e){let t=document.createElement("template");return t.innerHTML=e,t}findQueuedPlaceholders(e){return Array.from(this.parseFragment(e).content.querySelectorAll(this.selector)).filter(e=>"done"!==this.parsePlaceholderAttrs(e).loadImageStatus)}parsePlaceholderAttrs(e){let t=e.getAttribute(aP.AI_PARSED_ATTRIBUTE);if(!t)return{};try{let e=JSON.parse(t);return e&&"object"==typeof e?e:{}}catch{return{}}}async resolvePlaceholder(e,t){let i=this.parsePlaceholderAttrs(e),{loadImageId:n,loadImageParams:a}=i;if("done"!==i.loadImageStatus){if(!n||!a)return void this.writeStatus(e,i,"error");try{let r=await re({loadImageId:n,loadImageParams:a,context:{workspaceId:t.workspaceId,docId:t.docId,themeId:t.themeId,theme:t.theme,interactionId:t.interactionId,interactionName:t.interactionName,traceparent:t.traceparent},imageStore:t.imageStore}),o=r.src||r.tempUrl||"",s=r.query||a.query||"";o?(e.setAttribute("src",o),s&&e.setAttribute("alt",s),this.writeStatus(e,i,"done")):this.writeStatus(e,i,"error")}catch(t){console.error("[CodeCardImageProcessor] Failed to load image:",t),this.writeStatus(e,i,"error")}}}writeStatus(e,t,i){let n={...t,loadImageStatus:i};e.setAttribute(aP.AI_PARSED_ATTRIBUTE,JSON.stringify(n))}}var rn=e.i(235704);class ra{nodeType;constructor(e){this.nodeType=e}detectNode(e){return!!(e.type.name===this.nodeType&&this.getNodeId(e)&&e.attrs&&!e.attrs.embed&&e.attrs.embedFetchStatus===aT.EMBED_FETCH_STATUS_UNFETCHED)}getNodeId(e){return e.attrs?.id||null}getCacheKey(e,t){let i=this.getNodeId(e),n=t.interactionId;return`${n}__${this.nodeType}__${i}`}async processNode(e){try{if(e.attrs.embed||e.attrs.embedFetchStatus!==aT.EMBED_FETCH_STATUS_UNFETCHED)return e.attrs;let t=(0,aT.getMediaSourceUrl)(e.attrs);if(!t)return e.attrs;let i=await (0,rn.fetchEmbedAttrsForUrl)(t);return{...e.attrs,embedFetchStatus:aT.EMBED_FETCH_STATUS_COMPLETE,embed:i.embed}}catch(t){return console.error(`[EmbedFetchNodeProcessor] Error processing ${this.nodeType}:`,t),{...e.attrs,embedFetchStatus:aT.EMBED_FETCH_STATUS_COMPLETE}}}}var rr=e.i(950094);let ro=(e,t,i)=>{let n=t.state.doc.nodeAt(i);if(!n||0===n.childCount)return e;let a=i+1,r=i+n.nodeSize-1;return a{try{let r=t.state.doc.nodeAt(i);if(!r)return console.error("[addPositionedTextboxesToChain] Could not find node at position",i),e;let o=a?.clearExisting&&r.childCount>0;o&&(e=ro(e,t,i));let s=n.elements.filter(e=>"text"===e.elementType&&e.html);if(0===s.length)return e;let l=o?i+1:i+r.nodeSize-1,d=s.map(e=>((e,t)=>{let{boundingBox:i,html:n,fontSize:a}=e,r=n?(0,rr.parseExternalHtml)(n,t):null,o=r?r.content.toJSON():[];return r&&r.content.firstChild?.isInline&&(o=[{type:"paragraph",content:o}]),{type:"positionedTextbox",attrs:{x:i.x,y:i.y,w:i.width,h:i.height,...a&&{fontSize:a}},content:o}})(e,t.schema));return e.insertContentAt(l,d),e}catch(t){return console.error("[addPositionedTextboxesToChain] Error adding positioned textboxes:",t),e}};e.s(["addPositionedTextboxesToChain",0,rs,"clearPositionedTextboxesFromChain",0,ro],178428);class rl{nodeType="graphic";detectNode(e){if("graphic"!==e.type.name)return!1;let t=e.attrs;return!!("queued"===t.loadImageStatus&&t.loadImageId&&t.loadImageParams)}getNodeId(e){return e.attrs.id}getCacheKey(e,t){let i=this.getNodeId(e);return`graphic:${i}`}async processNode(e,t){let i=e.attrs,n=i.loadImageParams,a=n.options,r=a.styleReferenceKey;if(!r)return console.error("[GraphicProcessor] Missing styleReferenceKey for infographic"),{...i,loadImageStatus:"error"};let o=a.aspectRatio||aN.DEFAULT_ASPECT_RATIO,s=a.model||aY.featureFlags.get("infographicModel");try{let e=await a3({prompt:n.query,aspectRatio:o,model:s,layout:a.layout,language:a.language,stylePrompt:a.stylePrompt||"",styleReferenceKey:r,interactionId:t.interactionId,docId:t.docId,themeId:t.theme?.id,workspaceId:t.workspaceId,traceparent:t.traceparent,extractText:aY.featureFlags.get("extractInfographicText"),interactionName:t.interactionName,loadImageId:i.loadImageId??void 0,count:1});if(!e[0])return{...i,loadImageStatus:"error"};return{...i,...e[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}}catch(e){return console.error("[GraphicProcessor] Error generating infographic:",e),{...i,loadImageStatus:"error"}}}updateNode(e,t,i){let n=e.chain();(n=n.updateAttributesAtPos(t,i)).noUndo&&(n=n.noUndo()),i.extraction&&(n=rs(n,e,t,i.extraction,{clearExisting:!0})),n.run()}}var rd=e.i(289712),rc=e.i(929362),ru=e.i(158046);class rp{nodeType="image";detectNode(e){if((0,ev.isCardImageItemNode)(e))return!1;let t=(0,aE.getNodeImageAttrs)(e);return!!(t&&"queued"===t.loadImageStatus&&t.loadImageId&&t.loadImageParams)}getNodeId(e){let t=(0,aE.getNodeImageAttrs)(e);return t?.loadImageId||null}getCacheKey(e,t){let i=this.getNodeId(e),n=t.interactionId,a=(0,aE.getNodeImageAttrs)(e),r=a.loadImageParams?.query;return r||console.error("[ImageProcesor.getCacheKey] No query for in loadImageParams"),`${n}__${this.nodeType}__${i}__${r}`}async processNode(e,t){let i=(0,aE.getNodeImageAttrs)(e);try{let n=i.loadImageParams,a=await re({loadImageId:i.loadImageId,loadImageParams:n,context:{workspaceId:t.workspaceId,docId:t.docId,themeId:t.themeId,interactionId:t.interactionId,traceparent:t.traceparent,theme:t.theme,interactionName:t.interactionName},imageStore:t.imageStore});return(0,aE.mergeImageAttrs)(e,a)}catch(i){if(console.error(`[ImageProcessor] Error processing ${this.nodeType}:`,i),"cardAccentLayoutItem"===e.type.name&&t.theme)return{...e.attrs,background:(0,ru.getRandomThemeAccentBg)(t.theme,t.cardId)};return(0,aE.mergeImageAttrs)(e,{loadImageStatus:"error"})}}}class rh extends rp{nodeType="cardImageItem";detectNode(e){if(!(0,ev.isCardImageItemNode)(e))return!1;let t=(0,aE.getNodeImageAttrs)(e);return!!(t&&"queued"===t.loadImageStatus&&t.loadImageId&&t.loadImageParams)}async processNode(e,t){let i=(0,aE.getNodeImageAttrs)(e);try{let n=await rm({context:t,imageAttrs:i,loadImageId:i.loadImageId});return(0,aE.mergeImageAttrs)(e,n)}catch(t){return console.error(`[ImageCardProcessor] Error processing ${this.nodeType}:`,t),(0,aE.mergeImageAttrs)(e,{loadImageStatus:"error"})}}updateNode(e,t,i){let n=e.chain();(n=n.updateAttributesAtPos(t,i)).noUndo&&(n=n.noUndo()),i.image?.extraction&&(n=rs(n,e,t,i.image.extraction,{clearExisting:!0})),n.run()}}let rm=async({context:e,imageAttrs:t,loadImageId:i})=>{let n=t.loadImageParams,a=n.options,r=(0,rc.getCardDimensions)(e.cardDimensions);if("aiAnimation"===n.provider){let t=await a1({prompt:n.query,aspectRatio:r.targetImageAspectRatio,model:a.model||aY.featureFlags.get("aiGeneratedVideosDefaultModel"),interactionId:e.interactionId,docId:e.docId,themeId:e.theme?.id,workspaceId:e.workspaceId,traceparent:e.traceparent,loadVideoId:i,count:1,stylePreset:"Theme"});return t[0]?{...t[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}:{loadImageStatus:"error"}}a.model&&(0,aD.canModelMakeImageCards)(a.model)||(a.model=aY.featureFlags.get("imageCardModel"));let o=await (0,rd.fetchGenerateImageCard)({prompt:n.query,aspectRatio:r.targetImageAspectRatio,model:a.model,interactionId:e.interactionId,docId:e.docId,themeId:e.theme?.id,workspaceId:e.workspaceId,traceparent:e.traceparent,loadImageId:i,count:1,stylePrompt:a.stylePrompt,artStylePreset:a.artStylePreset,artStylePrompt:a.artStylePrompt,extractText:aY.featureFlags.get("imageCardGenerateWithText")});return o[0]?{...o[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:a9.UploadStatus.Queued}:{loadImageStatus:"error"}};e.s(["ImageCardProcessor",0,rh,"loadImageCardFromAttrsAndContext",0,rm],311996);var rg=e.i(990272);e.s(["createSmartDiagramGenerateData",()=>o0,"generateSmartDiagramData",()=>oJ,"triggerSmartDiagramGeneration",()=>o1],417692);var rf=e.i(61143);function rb(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}e.s(["handleMarkdownPaste",()=>oG,"parseMarkdownToSlice",()=>o$,"rangeToMarkdown",()=>oK],305463);let rx=rb(),ry=/[&<>"']/,rv=/[&<>"']/g,rC=/[<>"']|&(?!#?\w+;)/,rw=/[<>"']|&(?!#?\w+;)/g,rS={"&":"&","<":"<",">":">",'"':""","'":"'"},rk=e=>rS[e];function rA(e,t){if(t){if(ry.test(e))return e.replace(rv,rk)}else if(rC.test(e))return e.replace(rw,rk);return e}let rE=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r_(e){return e.replace(rE,(e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):"")}let rI=/(^|[^\[])\^/g;function rM(e,t){e="string"==typeof e?e:e.source,t=t||"";let i={replace:(t,n)=>(n=(n=n.source||n).replace(rI,"$1"),e=e.replace(t,n),i),getRegex:()=>new RegExp(e,t)};return i}let rT=/[^\w:]/g,rL=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function rj(e,t,i){var n,a;let r;if(e){let e;try{e=decodeURIComponent(r_(i)).replace(rT,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!rL.test(i)&&(n=t,a=i,rP[" "+n]||(rD.test(n)?rP[" "+n]=n+"/":rP[" "+n]=rF(n,"/",!0)),r=-1===(n=rP[" "+n]).indexOf(":"),i="//"===a.substring(0,2)?r?a:n.replace(rN,"$1")+a:"/"!==a.charAt(0)?n+a:r?a:n.replace(rR,"$1")+a);try{i=encodeURI(i).replace(/%25/g,"%")}catch(e){return null}return i}let rP={},rD=/^[^:]+:\/*[^/]*$/,rN=/^([^:]+:)[\s\S]*$/,rR=/^([^:]+:\/*[^/]*)[\s\S]*$/,rO={exec:function(){}};function rB(e){let t=1,i,n;for(;t{let n=!1,a=t;for(;--a>=0&&"\\"===i[a];)n=!n;return n?"|":" |"}).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function rU(e,t,i,n){let a=t.href,r=t.title?rA(t.title):null,o=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;let e={type:"link",raw:i,href:a,title:r,text:o,tokens:n.inlineTokens(o,[])};return n.state.inLink=!1,e}return{type:"image",raw:i,href:a,title:r,text:rA(o)}}class rV{constructor(e){this.options=e||rx}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:rF(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],i=function(e,t){let i=e.match(/^(\s+)(?:```)/);if(null===i)return t;let n=i[1];return t.split("\n").map(e=>{let t=e.match(/^\s+/);if(null===t)return e;let[i]=t;return i.length>=n.length?e.slice(n.length):e}).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:i}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=rF(e,"#");this.options.pedantic?e=t.trim():(!t||/ $/.test(t))&&(e=t.trim())}let i={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,n,a,r,o,s,l,d,c,u,p,h,m=t[1].trim(),g=m.length>1,f={type:"list",raw:"",ordered:g,start:g?+m.slice(0,-1):"",loose:!1,items:[]};m=g?`\\d{1,9}\\${m.slice(-1)}`:`\\${m}`,this.options.pedantic&&(m=g?m:"[*+-]");let b=RegExp(`^( {0,3}${m})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(h=!1,!(!(t=b.exec(e))||this.rules.block.hr.test(e)));){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,p=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,p=d.slice(r),r+=t[1].length),s=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),h=!0),!h){let t=RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),n=RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),a=RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),o=RegExp(`^ {0,${Math.min(3,r-1)}}#`);for(;e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(a.test(d)||o.test(d)||t.test(d)||n.test(e)));){if(d.search(/[^ ]/)>=r||!d.trim())p+="\n"+d.slice(r);else if(s)break;else p+="\n"+d;s||d.trim()||(s=!0),i+=u+"\n",e=e.substring(u.length+1)}}!f.loose&&(l?f.loose=!0:/\n *\n *$/.test(i)&&(l=!0)),this.options.gfm&&(n=/^\[[ xX]\] /.exec(p))&&(a="[ ] "!==n[0],p=p.replace(/^\[[ xX]\] +/,"")),f.items.push({type:"list_item",raw:i,task:!!n,checked:a,loose:!1,text:p}),f.raw+=i}f.items[f.items.length-1].raw=i.trimRight(),f.items[f.items.length-1].text=p.trimRight(),f.raw=f.raw.trimRight();let x=f.items.length;for(o=0;o"space"===e.type),t=e.every(e=>{let t=e.raw.split(""),i=0;for(let e of t)if("\n"===e&&(i+=1),i>1)return!0;return!1});!f.loose&&e.length&&t&&(f.loose=!0,f.items[o].loose=!0)}return f}}html(e){let t=this.rules.block.html.exec(e);if(t){let e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):rA(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){let t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){let t=this.rules.block.table.exec(e);if(t){let e={type:"table",header:rz(t[1]).map(e=>({text:e})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){let i,n,a,r;e.raw=t[0];let o=e.align.length;for(i=0;i({text:e}));for(n=0,o=e.header.length;n/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):rA(t[0]):t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^$/.test(e))return;let t=rF(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e){if(-1===e.indexOf(")"))return -1;let t=e.length,i=0,n=0;for(;n-1){let i=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,i).trim(),t[3]=""}}let i=t[2],n="";if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);e&&(i=e[1],n=e[3])}else n=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(e)?i.slice(1):i.slice(1,-1)),rU(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:n?n.replace(this.rules.inline._escapes,"$1"):n},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let e=(i[2]||i[1]).replace(/\s+/g," ");if(!(e=t[e.toLowerCase()])||!e.href){let e=i[0].charAt(0);return{type:"text",raw:e,text:e}}return rU(i,e,i[0],this.lexer)}}emStrong(e,t,i=""){let n=this.rules.inline.emStrong.lDelim.exec(e);if(!n||n[3]&&i.match(/[\p{L}\p{N}]/u))return;let a=n[1]||n[2]||"";if(!a||a&&(""===i||this.rules.inline.punctuation.exec(i))){let i=n[0].length-1,a,r,o=i,s=0,l="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+i);null!=(n=l.exec(t));){if(!(a=n[1]||n[2]||n[3]||n[4]||n[5]||n[6]))continue;if(r=a.length,n[3]||n[4]){o+=r;continue}if((n[5]||n[6])&&i%3&&!((i+r)%3)){s+=r;continue}if((o-=r)>0)continue;if(Math.min(i,r=Math.min(r,r+o+s))%2){let t=e.slice(1,i+n.index+r);return{type:"em",raw:e.slice(0,i+n.index+r+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}let t=e.slice(2,i+n.index+r-1);return{type:"strong",raw:e.slice(0,i+n.index+r+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," "),i=/[^ ]/.test(e),n=/^ /.test(e)&&/ $/.test(e);return i&&n&&(e=e.substring(1,e.length-1)),e=rA(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){let i=this.rules.inline.autolink.exec(e);if(i){let e,n;return n="@"===i[2]?"mailto:"+(e=rA(this.options.mangle?t(i[1]):i[1])):e=rA(i[1]),{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let e,n;if("@"===i[2])n="mailto:"+(e=rA(this.options.mangle?t(i[0]):i[0]));else{let t;do t=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(t!==i[0])e=rA(i[0]),n="www."===i[1]?"http://"+e:e}return{type:"link",raw:i[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){let i=this.rules.inline.text.exec(e);if(i){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):rA(i[0]):i[0]:rA(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:e}}}}let rG={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:rO,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};rG._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,rG._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,rG.def=rM(rG.def).replace("label",rG._label).replace("title",rG._title).getRegex(),rG.bullet=/(?:[*+-]|\d{1,9}[.)])/,rG.listItemStart=rM(/^( *)(bull) */).replace("bull",rG.bullet).getRegex(),rG.list=rM(rG.list).replace(/bull/g,rG.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+rG.def.source+")").getRegex(),rG._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",rG._comment=/|$)/,rG.html=rM(rG.html,"i").replace("comment",rG._comment).replace("tag",rG._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rG.paragraph=rM(rG._paragraph).replace("hr",rG.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rG._tag).getRegex(),rG.blockquote=rM(rG.blockquote).replace("paragraph",rG.paragraph).getRegex(),rG.normal=rB({},rG),rG.gfm=rB({},rG.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),rG.gfm.table=rM(rG.gfm.table).replace("hr",rG.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rG._tag).getRegex(),rG.gfm.paragraph=rM(rG._paragraph).replace("hr",rG.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",rG.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",rG._tag).getRegex(),rG.pedantic=rB({},rG.normal,{html:rM("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",rG._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:rO,paragraph:rM(rG.normal._paragraph).replace("hr",rG.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",rG.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});let r$={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:rO,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:rO,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),t+="&#"+n+";";return t}r$._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",r$.punctuation=rM(r$.punctuation).replace(/punctuation/g,r$._punctuation).getRegex(),r$.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,r$.escapedEmSt=/\\\*|\\_/g,r$._comment=rM(rG._comment).replace("(?:-->|$)","-->").getRegex(),r$.emStrong.lDelim=rM(r$.emStrong.lDelim).replace(/punct/g,r$._punctuation).getRegex(),r$.emStrong.rDelimAst=rM(r$.emStrong.rDelimAst,"g").replace(/punct/g,r$._punctuation).getRegex(),r$.emStrong.rDelimUnd=rM(r$.emStrong.rDelimUnd,"g").replace(/punct/g,r$._punctuation).getRegex(),r$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,r$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,r$._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,r$.autolink=rM(r$.autolink).replace("scheme",r$._scheme).replace("email",r$._email).getRegex(),r$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,r$.tag=rM(r$.tag).replace("comment",r$._comment).replace("attribute",r$._attribute).getRegex(),r$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,r$._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,r$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,r$.link=rM(r$.link).replace("label",r$._label).replace("href",r$._href).replace("title",r$._title).getRegex(),r$.reflink=rM(r$.reflink).replace("label",r$._label).replace("ref",rG._label).getRegex(),r$.nolink=rM(r$.nolink).replace("ref",rG._label).getRegex(),r$.reflinkSearch=rM(r$.reflinkSearch,"g").replace("reflink",r$.reflink).replace("nolink",r$.nolink).getRegex(),r$.normal=rB({},r$),r$.pedantic=rB({},r$.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:rM(/^!?\[(label)\]\((.*?)\)/).replace("label",r$._label).getRegex(),reflink:rM(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",r$._label).getRegex()}),r$.gfm=rB({},r$.normal,{escape:rM(r$.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\t+" ".repeat(i.length));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),1===i.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),(n=t[t.length-1])&&("paragraph"===n.type||"text"===n.type)?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if((i=this.tokenizer.fences(e))||(i=this.tokenizer.heading(e))||(i=this.tokenizer.hr(e))||(i=this.tokenizer.blockquote(e))||(i=this.tokenizer.list(e))||(i=this.tokenizer.html(e))){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),(n=t[t.length-1])&&("paragraph"===n.type||"text"===n.type)?(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if((i=this.tokenizer.table(e))||(i=this.tokenizer.lheading(e))){e=e.substring(i.raw.length),t.push(i);continue}if(a=e,this.options.extensions&&this.options.extensions.startBlock){let t,i=1/0,n=e.slice(1);this.options.extensions.startBlock.forEach(function(e){"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(i=Math.min(i,t))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){n=t[t.length-1],r&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),r=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let i,n,a,r,o,s,l=e;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(l));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,r.index)+"["+rW("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(l));)l=l.slice(0,r.index)+"["+rW("a",r[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(l));)l=l.slice(0,r.index)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(o||(s=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if((i=this.tokenizer.emStrong(e,l,s))||(i=this.tokenizer.codespan(e))||(i=this.tokenizer.br(e))||(i=this.tokenizer.del(e))||(i=this.tokenizer.autolink(e,rK))||!this.state.inLink&&(i=this.tokenizer.url(e,rK))){e=e.substring(i.raw.length),t.push(i);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline){let t,i=1/0,n=e.slice(1);this.options.extensions.startInline.forEach(function(e){"number"==typeof(t=e.call({lexer:this},n))&&t>=0&&(i=Math.min(i,t))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(i=this.tokenizer.inlineText(a,rZ)){e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(s=i.raw.slice(-1)),o=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}}class rY{constructor(e){this.options=e||rx}code(e,t,i){let n=(t||"").match(/\S*/)[0];if(this.options.highlight){let t=this.options.highlight(e,n);null!=t&&t!==e&&(i=!0,e=t)}return(e=e.replace(/\n$/,"")+"\n",n)?'
'+(i?e:rA(e,!0))+"
\n":"
"+(i?e:rA(e,!0))+"
\n"}blockquote(e){return`
${e}
`}html(e){return e}heading(e,t,i,n){if(this.options.headerIds){let a=this.options.headerPrefix+n.slug(i);return`${e} `}return`${e} `}hr(){return this.options.xhtml?"
\n":"
\n"}list(e,t,i){let n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"}listitem(e){return`
  • ${e}
  • `}checkbox(e){return" "}paragraph(e){return`

    ${e}

    `}table(e,t){return t&&(t=`
    ${t}`),"
    \n\n"+e+"\n"+t+"
    \n"}tablerow(e){return` ${e} `}tablecell(e,t){let i=t.header?"th":"td";return(t.align?`<${i} align="${t.align}">`:`<${i}>`)+e+` `}strong(e){return`${e}`}em(e){return`${e}`}codespan(e){return`${e}`}br(){return this.options.xhtml?"
    ":"
    "}del(e){return`${e}`}link(e,t,i){if(null===(e=rj(this.options.sanitize,this.options.baseUrl,e)))return i;let n='"}image(e,t,i){if(null===(e=rj(this.options.sanitize,this.options.baseUrl,e)))return i;let n=`${i}":">"}text(e){return e}}class rX{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}}class rQ{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do i=e+"-"+ ++n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){let i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}class rJ{constructor(e){this.options=e||rx,this.options.renderer=this.options.renderer||new rY,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new rX,this.slugger=new rQ}static parse(e,t){return new rJ(t).parse(e)}static parseInline(e,t){return new rJ(t).parseInline(e)}parse(e,t=!0){let i="",n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w=e.length;for(n=0;n0&&"paragraph"===b.tokens[0].type?(b.tokens[0].text=v+" "+b.tokens[0].text,b.tokens[0].tokens&&b.tokens[0].tokens.length>0&&"text"===b.tokens[0].tokens[0].type&&(b.tokens[0].tokens[0].text=v+" "+b.tokens[0].tokens[0].text)):b.tokens.unshift({type:"text",text:v}):f+=v),f+=this.parse(b.tokens,g),u+=this.renderer.listitem(f,y,x);i+=this.renderer.list(u,h,m);continue;case"html":i+=this.renderer.html(p.text);continue;case"paragraph":i+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(u=p.tokens?this.parseInline(p.tokens):p.text;n+1{a(e.text,e.lang,function(t,i){if(t)return r(t);null!=i&&i!==e.text&&(e.text=i,e.escaped=!0),0==--o&&r()})},0))}),void(0===o&&r())}try{let i=rq.lex(e,t);return t.walkTokens&&r0.walkTokens(i,t.walkTokens),rJ.parse(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+rA(e.message+"",!0)+"
    ";throw e}}function r1(e,t){return Array(t+1).join(e)}r0.options=r0.setOptions=function(e){return rB(r0.defaults,e),rx=r0.defaults,r0},r0.getDefaults=rb,r0.defaults=rx,r0.use=function(...e){let t,i=rB({},...e),n=r0.defaults.extensions||{renderers:{},childTokens:{}};e.forEach(e=>{if(e.extensions&&(t=!0,e.extensions.forEach(e=>{if(!e.name)throw Error("extension name required");if(e.renderer){let t=n.renderers?n.renderers[e.name]:null;t?n.renderers[e.name]=function(...i){let n=e.renderer.apply(this,i);return!1===n&&(n=t.apply(this,i)),n}:n.renderers[e.name]=e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)})),e.renderer){let t=r0.defaults.renderer||new rY;for(let i in e.renderer){let n=t[i];t[i]=(...a)=>{let r=e.renderer[i].apply(t,a);return!1===r&&(r=n.apply(t,a)),r}}i.renderer=t}if(e.tokenizer){let t=r0.defaults.tokenizer||new rV;for(let i in e.tokenizer){let n=t[i];t[i]=(...a)=>{let r=e.tokenizer[i].apply(t,a);return!1===r&&(r=n.apply(t,a)),r}}i.tokenizer=t}if(e.walkTokens){let t=r0.defaults.walkTokens;i.walkTokens=function(i){e.walkTokens.call(this,i),t&&t.call(this,i)}}t&&(i.extensions=n),r0.setOptions(i)})},r0.walkTokens=function(e,t){for(let i of e)switch(t.call(r0,i),i.type){case"table":for(let e of i.header)r0.walkTokens(e.tokens,t);for(let e of i.rows)for(let i of e)r0.walkTokens(i.tokens,t);break;case"list":r0.walkTokens(i.items,t);break;default:r0.defaults.extensions&&r0.defaults.extensions.childTokens&&r0.defaults.extensions.childTokens[i.type]?r0.defaults.extensions.childTokens[i.type].forEach(function(e){r0.walkTokens(i[e],t)}):i.tokens&&r0.walkTokens(i.tokens,t)}},r0.parseInline=function(e,t){if(null==e)throw Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");rH(t=rB({},r0.defaults,t||{}));try{let i=rq.lexInline(e,t);return t.walkTokens&&r0.walkTokens(i,t.walkTokens),rJ.parseInline(i,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"

    An error occurred:

    "+rA(e.message+"",!0)+"
    ";throw e}},r0.Parser=rJ,r0.parser=rJ.parse,r0.Renderer=rY,r0.TextRenderer=rX,r0.Lexer=rq,r0.lexer=rq.lex,r0.Tokenizer=rV,r0.Slugger=rQ,r0.parse=r0,r0.options,r0.setOptions,r0.use,r0.walkTokens,r0.parseInline,rJ.parse,rq.lex,e.s(["marked",0,r0],773194);var r2=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function r3(e){return r9(e,r2)}var r5=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function r4(e){return r9(e,r5)}var r6=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function r9(e,t){return t.indexOf(e.nodeName)>=0}function r8(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var r7={};function oe(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function ot(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function oi(e,t,i){for(var n=0;n-1)return!0}else if("function"==typeof n){if(n.call(e,t,i))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}(a,t,i))return a}}function on(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function oa(e,t,i){return e&&e.parentNode===t||i(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}r7.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},r7.lineBreak={filter:"br",replacement:function(e,t,i){return i.br+"\n"}},r7.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,i){var n=Number(t.nodeName.charAt(1));if("setext"!==i.headingStyle||!(n<3))return"\n\n"+r1("#",n)+" "+e+"\n\n";var a=r1(1===n?"=":"-",e.length);return"\n\n"+e+"\n"+a+"\n\n"}},r7.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},r7.list={filter:["ul","ol"],replacement:function(e,t){var i=t.parentNode;return"LI"===i.nodeName&&i.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},r7.listItem={filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var n=i.bulletListMarker+" ",a=t.parentNode;if("OL"===a.nodeName){var r=a.getAttribute("start"),o=Array.prototype.indexOf.call(a.children,t);n=(r?Number(r)+o:o+1)+". "}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}},r7.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},r7.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,i){for(var n,a=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],r=t.firstChild.textContent,o=i.fence.charAt(0),s=3,l=RegExp("^"+o+"{3,}","gm");n=l.exec(r);)n[0].length>=s&&(s=n[0].length+1);var d=r1(o,s);return"\n\n"+d+a+"\n"+r.replace(/\n$/,"")+"\n"+d+"\n\n"}},r7.horizontalRule={filter:"hr",replacement:function(e,t,i){return"\n\n"+i.hr+"\n\n"}},r7.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var i=t.getAttribute("href"),n=oe(t.getAttribute("title"));return n&&(n=' "'+n+'"'),"["+e+"]("+i+n+")"}},r7.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,i){var n,a,r=t.getAttribute("href"),o=oe(t.getAttribute("title"));switch(o&&(o=' "'+o+'"'),i.linkReferenceStyle){case"collapsed":n="["+e+"][]",a="["+e+"]: "+r+o;break;case"shortcut":n="["+e+"]",a="["+e+"]: "+r+o;break;default:var s=this.references.length+1;n="["+e+"]["+s+"]",a="["+s+"]: "+r+o}return this.references.push(a),n},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},r7.emphasis={filter:["em","i"],replacement:function(e,t,i){return e.trim()?i.emDelimiter+e+i.emDelimiter:""}},r7.strong={filter:["strong","b"],replacement:function(e,t,i){return e.trim()?i.strongDelimiter+e+i.strongDelimiter:""}},r7.code={filter:function(e){var t=e.previousSibling||e.nextSibling,i="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!i},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",i="`",n=e.match(/`+/gm)||[];-1!==n.indexOf(i);)i+="`";return i+t+e+t+i}},r7.image={filter:"img",replacement:function(e,t){var i=oe(t.getAttribute("alt")),n=t.getAttribute("src")||"",a=oe(t.getAttribute("title"));return n?"!["+i+"]("+n+(a?' "'+a+'"':"")+")":""}},ot.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){var t;return e.isBlank?this.blankRule:(t=oi(this.array,e,this.options))||(t=oi(this._keep,e,this.options))||(t=oi(this._remove,e,this.options))?t:this.defaultRule},forEach:function(e){for(var t=0;ttypeof window?window:{},oo=!function(){var e=or.DOMParser,t=!1;try{new e().parseFromString("","text/html")&&(t=!0)}catch(e){}return t}()?(o=function(){},!function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(t){window.ActiveXObject&&(e=!0)}return e}()?o.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t}:o.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t},o):or.DOMParser;function os(e,t){var i;return!function(e){var t=e.element,i=e.isBlock,n=e.isVoid,a=e.isPre||function(e){return"PRE"===e.nodeName};if(!(!t.firstChild||a(t))){for(var r=null,o=!1,s=null,l=oa(null,t,a);l!==t;){if(3===l.nodeType||4===l.nodeType){var d=l.data.replace(/[ \r\n\t]+/g," ");if((!r||/ $/.test(r.data))&&!o&&" "===d[0]&&(d=d.substr(1)),!d){l=on(l);continue}l.data=d,r=l}else if(1===l.nodeType)i(l)||"BR"===l.nodeName?(r&&(r.data=r.data.replace(/ $/,"")),r=null,o=!1):n(l)||a(l)?(r=null,o=!0):r&&(o=!1);else{l=on(l);continue}var c=oa(s,l,a);s=l,l=c}r&&(r.data=r.data.replace(/ $/,""),r.data||on(r))}}({element:i="string"==typeof e?(l=l||new oo).parseFromString(''+e+"","text/html").getElementById("turndown-root"):e.cloneNode(!0),isBlock:r3,isVoid:r4,isPre:t.preformattedCode?ol:null}),i}function ol(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function od(e,t){var i;return e.isBlock=r3(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=!r4(i=e)&&!r9(i,r6)&&/^\s*$/i.test(i.textContent)&&!r8(i,r5)&&!r8(i,r6),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var i,n={leading:(i=e.textContent.match(/^(([ \t\r\n]*)(\s*))[\s\S]*?((\s*?)([ \t\r\n]*))$/))[1],leadingAscii:i[2],leadingNonAscii:i[3],trailing:i[4],trailingNonAscii:i[5],trailingAscii:i[6]};return n.leadingAscii&&oc("left",e,t)&&(n.leading=n.leadingNonAscii),n.trailingAscii&&oc("right",e,t)&&(n.trailing=n.trailingNonAscii),{leading:n.leading,trailing:n.trailing}}(e,t),e}function oc(e,t,i){var n,a,r;return"left"===e?(n=t.previousSibling,a=/ $/):(n=t.nextSibling,a=/^ /),n&&(3===n.nodeType?r=a.test(n.nodeValue):i.preformattedCode&&"CODE"===n.nodeName?r=!1:1!==n.nodeType||r3(n)||(r=a.test(n.textContent))),r}var ou=Array.prototype.reduce,op=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function oh(e){if(!(this instanceof oh))return new oh(e);this.options=function(e){for(var t=1;t0&&"\n"===e[t-1];)t--;return e.substring(0,t)}(e),n=t.replace(/^\n*/,""),a=Math.max(e.length-i.length,t.length-n.length);return i+"\n\n".substring(0,a)+n}oh.prototype={turndown:function(e){var t;if(!(null!=(t=e)&&("string"==typeof t||t.nodeType&&(1===t.nodeType||9===t.nodeType||11===t.nodeType))))throw TypeError(e+" is not a string, or an element/document/fragment node.");return""===e?"":og.call(this,om.call(this,new os(e,this.options)))},use:function(e){if(Array.isArray(e))for(var t=0;toz,"sliceLooksLikeLink",()=>oH,"textLooksLikeLink",()=>oF],457776);var ox=e.i(54182),oy=e.i(242349),ov=e.i(576897),oC=e.i(285598);e.s(["Link",()=>oB],919352);var ow=e.i(952660);e.i(601019);var oS=e.i(144294),ok=e.i(903986),oA=e.i(767730),oE=e.i(438106),o_=e.i(878917);let oI=["tel","mailto"];e.i(500711);var oM=e.i(500190),oT=e.i(830269);let oL=(e,t,i)=>{if(!i)return;let n=(0,ex.getTopCenterPosPct)(e,100);n&&(0,oM.replaceState)({data:{fromPos:n.pos,fromPct:n.pct},emitChange:!1}),(0,oT.updateCardHash)({cardId:i,method:"push",data:{fromPos:null,fromPct:null}})};e.s(["navigateToCardLink",0,oL],210792);let oj=new el.PluginKey("linkKeyboardNav");function oP(e,t,i){if(t<0||t>e.doc.content.size)return!1;let n=e.doc.resolve(t);if(i.isInSet(n.marks()))return!0;let a=n.nodeAfter;if(a&&a.marks&&i.isInSet(a.marks))return!0;let r=n.nodeBefore;return!!(r&&r.marks&&i.isInSet(r.marks))}let oD=e=>!!e.includes("://"),oN=(e,t)=>{oO(e)||(0,rn.fetchAndUpdateEmbedAttrsForUrlAndUploadThumbnail)(e,i=>{let{doc:n,schema:a,tr:r}=t.state;(0,ok.findChildrenByMark)(n,t.schema.marks.link).forEach(({node:t,pos:n})=>{let o=t.marks.find(t=>"link"===t.type.name&&t.attrs.href==e);o&&r.removeMark(n,n+t.nodeSize,o).addMark(n,n+t.nodeSize,a.marks.link.create({...o.attrs,...i}))}),t.view.dispatch(r)}).catch(e=>{console.error("[Link.fetchUrlThenUpdateMarks]",e)})},oR=e=>e.attrs.source||e.attrs.meta||e.attrs.embed,oO=e=>{if(!e)return!1;let t=e&&e.toLowerCase();for(let e of oI)if(t.startsWith(e+":"))return!0;return!1};e.s(["fetchUrlThenUpdateMarks",0,oN,"isOtherSupportedProtocol",0,oO,"isValidAutoLink",0,oD,"linkHasMetadata",0,oR],303236);let oB=(0,oA.extendTiptapMark)(ow.default,"link",{priority:oE.ExtensionPriorityMap.Link,inclusive:!1,excludes:"underline footnoteLabel link",onCreate(){let e=(0,eu.getStore)().getState(),t=(0,ef.selectEditable)(e),i=(0,ao.selectUser)(e);if(!(t&&i))return;let{view:n,state:a}=this.editor,{doc:r,schema:o,tr:s}=a;try{let e=!1;(0,ok.findChildrenByMark)(r,o.marks.link).forEach(({node:t,pos:i})=>{let n=t.marks.find(e=>"link"===e.type.name);n&&"string"!=typeof n.attrs.href&&(e=!0,s.removeMark(i,i+t.nodeSize,n).addMark(i,i+t.nodeSize,o.marks.link.create({...n.attrs,href:String(n.attrs.href)})))}),e&&n.dispatch(s)}catch(e){console.error("[Link.onCreate] error",e)}},renderHTML({HTMLAttributes:e,mark:t}){let i=t.attrs.href,n=(0,oA.renderJSONAttrs)(t.attrs,"source","thumbnail","embed","meta");return"string"==typeof i&&i.startsWith("javascript:")?["a",(0,eE.mergeAttributes)(this.options.HTMLAttributes,e,n,{href:""}),0]:i?["a",(0,eE.mergeAttributes)(this.options.HTMLAttributes,e,n,{href:i}),0]:["a",(0,eE.mergeAttributes)(this.options.HTMLAttributes,e,n),0]},parseHTML:()=>[{tag:'a[href]:not([href *= "javascript:" i])',getAttrs:e=>({href:e.getAttribute("href")||"",source:(0,oA.parseJSONAttr)(e,"source")??null,thumbnail:(0,oA.parseJSONAttr)(e,"thumbnail")??null,embed:(0,oA.parseJSONAttr)(e,"embed")??null,meta:(0,oA.parseJSONAttr)(e,"meta")??null})}],addCommands(){return{...this.parent?.(),convertLinkToMedia:e=>({chain:t,editor:i})=>{let{href:n,...a}=i.getAttributes("link");if(!n||oO(n))return!1;if(!a.source)return t().extendMarkRange("link").insertEmbedAndFetchMetadata(n,e,!1).run(),!0;let r=o_.MediaSourcesMap[a.source],o=r?.nodeName||"embed";return t().extendMarkRange("link").insertContent({type:o,attrs:{...a,sourceUrl:n,url:n,displayStyle:e}}).selectInsertedNode().run(),!0},convertMediaToLink:()=>({state:e,chain:t})=>{if(!(e.selection instanceof el.NodeSelection))return!1;let{from:i,to:n,node:a}=e.selection;if(!(0,aT.isMediaEmbedNode)(a))return!1;let{sourceUrl:r,meta:o}=a.attrs,s=o?.title||r||"link",l={from:i+1,to:i+1+s.length};return t().insertContentAt({from:i,to:n},[{type:"paragraph",attrs:{},content:[{type:"text",text:s}]}],{updateSelection:!0}).setTextSelection(l).setMark(oB.name,{...a.attrs,href:r}).run(),!0},convertLinkToButton:()=>({editor:e,chain:t})=>{let{href:i=""}=e.getAttributes("link");return t().extendMarkRange("link").deleteSelection().insertContentAndSelect((0,oS.EMPTY_NODES)().buttonGroup).updateAttributes("button",{href:i}).run(),!0},convertButtonToLink:()=>({chain:e,state:t,editor:i})=>{let{selection:n}=t,a=(0,eE.findParentNode)(e=>"button"===e.type.name)(n),r=(0,eE.findParentNode)(e=>"buttonGroup"===e.type.name)(n);if(!r||!a)return!1;let{node:o,pos:s}=a,{node:l,pos:d}=r;if(!o)return!1;let c={type:"paragraph",content:o.content.toJSON()},u=l.maybeChild(0)===o,p=u?d:s,h=p+(u?1:2),m=h+es.Node.fromJSON(i.schema,c).content.size,g=e();return 1===l.childCount?g.deleteNode("buttonGroup"):g.deleteNode("button"),g.insertContentAt(p,c,{updateSelection:!1}).setTextSelection({from:h,to:m}).setMark(oB.name,{href:o.attrs.href}).focus().run(),!0},convertButtonToMedia:e=>({chain:t,state:i})=>{let{selection:n}=i,a=(0,eE.findParentNode)(e=>"button"===e.type.name)(n),r=(0,eE.findParentNode)(e=>"buttonGroup"===e.type.name)(n);if(!a||!r)return!1;let{node:o,pos:s}=a,{node:l,pos:d}=r;if(!o||!l)return!1;let{href:c}=o.attrs;if(!c||oO(c))return!1;if(l.maybeChild(0)===o){let i=[];l.forEach(e=>{"button"===e.type.name&&e!==o&&i.push(e.toJSON())});let n=t();n.setNodeSelection(d).deleteNode("buttonGroup").insertEmbedAndFetchMetadata(c,e,!1),1!==l.childCount&&i.length>0&&n.insertContentAt(d+1,{type:"buttonGroup",content:i},{updateSelection:!1}),n.focus().run()}else t().setNodeSelection(s).insertEmbedAndFetchMetadata(c,e,!1).selectInsertedNode().focus().run();return!0},convertMediaToButton:()=>({chain:e,state:t})=>{if(!(t.selection instanceof el.NodeSelection))return!1;let{node:i}=t.selection;if(!(0,aT.isMediaEmbedNode)(i))return!1;let{sourceUrl:n=""}=i.attrs;return e().deleteSelection().insertContentAt(t.selection.from,(0,oS.EMPTY_NODES)().buttonGroup).updateAttributes("button",{href:n}).focus().run(),!0},updateSurroundingLink:e=>({state:t,chain:i,editor:n})=>{let{from:a,to:r}=t.selection;return oN(e,n),i().extendMarkRange(oB.name).unsetMark(oB.name).setMark(oB.name,{href:e}).setMeta("preventAutolink",!0).setTextSelection({from:a,to:r}),!0},convertLinkToDocMention:()=>({chain:e,editor:t})=>{let{href:i=""}=t.getAttributes("link"),n=(0,ov.getDocIdFromUrl)(i||"");return!!n&&(e().extendMarkRange("link").command(({state:e,commands:t})=>{let{from:i,to:a}=e.selection;return t.addDocMention({id:n},{from:i,to:a}),!0}).run(),!0)},removeSurroundingLink:()=>({state:e,chain:t})=>{let{from:i,to:n}=e.selection;return t().extendMarkRange("link").unsetMark("link").setMeta("preventAutolink",!0).setTextSelection({from:i,to:n}).focus(),!0}}},addKeyboardShortcuts(){return{"Mod-k":({editor:e})=>{let{selection:t}=e.state;return!t.empty&&e.commands.toggleMark(this.name)}}},addProseMirrorPlugins(){let e,t=this.parent?.()||[];return t.push((e=this.editor,new el.Plugin({key:new el.PluginKey("handleCmdClickLink"),props:{handleDOMEvents:{click:(t,i)=>{let n=(0,eu.getStore)(),a=(0,ef.selectEditable)(n.getState()),r=i.target?.closest("a"),o=r?.href;if(!o||r?.closest("[data-comments-wrapper]"))return!1;i.preventDefault();let s=i.ctrlKey||i.metaKey,l=(0,ex.getCardIdFromHash)(o),d=(0,ef.selectCardIds)(n.getState()),c=(0,ex.doesMemoContainGivenCardFromUrl)(o,d);if(a){if(!s)return!1;if(c)return oL(e,i,l),!1}else if(!s&&c)return oL(e,i,l),!1;return window.open(o,"_blank"),!1}}}}))),t.push(new el.Plugin({key:oj,props:{handleKeyDown(e,t){let i,n;if("ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return!1;let{state:a}=e,{selection:r}=a;if(!(r instanceof el.TextSelection))return!1;let o="ArrowLeft"===t.key?-1:1,s=t.metaKey||t.ctrlKey,l=t.shiftKey,d=t.altKey,c=r.head,u=a.doc.resolve(c),p=u.start(u.depth),h=u.end(u.depth);if(o>0&&c>=h){let t=h+1;if(t<=a.doc.content.size)try{let i=a.doc.resolve(t),n=el.TextSelection.near(i,1);if(n.from>c)return e.dispatch(a.tr.setSelection(n).scrollIntoView()),!0}catch(e){}return!1}if(o<0&&c<=p){let t=p-1;if(t>=0)try{let i=a.doc.resolve(t),n=el.TextSelection.near(i,-1);if(n.from0?e.end(e.depth):e.start(e.depth)}else if(d){let e="ArrowLeft"===t.key?c-1:c+1,n=function(e,t,i){let n=e.resolve(t).marks().find(e=>e.type===i);if(!n)return null;let a=t-1,r=t+1;for(let r=t-1;r>=0;r--)try{if(!e.resolve(r).marks().some(e=>e.type===i&&e.eq(n))){a=r;break}0===r&&(a=0)}catch(e){break}for(let a=t;a<=e.content.size;a++)try{if(!e.resolve(a).marks().some(e=>e.type===i&&e.eq(n))){r=a;break}a===e.content.size&&(r=e.content.size)}catch(e){r=a;break}return{from:a,to:r}}(a.doc,e,m);if(!n)return!1;i="ArrowLeft"===t.key?n.from:n.to}else i=c+o;return(i=Math.max(0,Math.min(i,a.doc.content.size)))!==c&&!(ih)&&(n=l?el.TextSelection.create(a.doc,r.anchor,i):el.TextSelection.create(a.doc,i),e.dispatch(a.tr.setSelection(n).scrollIntoView()),!0)}}})),t}}).configure({HTMLAttributes:{target:void 0,rel:"noopener noreferrer",class:"link"},validate:oD,protocols:oI,linkOnPaste:!1}),oz=(e,t,i)=>{let n=oU(i);if(n.length>0)return n.forEach(({mark:t})=>{oR(t)||oN(t.attrs.href,e)}),!1;let a=t.clipboardData?.getData("text/plain");if(!a||!oF(a))return!1;let{selection:r}=e.state;if(r instanceof el.TextSelection&&!r.empty)return t.preventDefault(),oW(e,a),!0;if(a.match(ov.GAMMA_DOC_REGEX)||(0,oy.isImageUrl)(a))return!1;if(!e.schema.nodes.embed)return oN(a,e),!1;let o=r instanceof ox.GapCursor,s=r.empty&&["paragraph","heading","title"].includes(r.$from.parent.type.name)&&(0,ex.isNodeEmpty)(r.$from.parent),l="gallery"===r.$from.parent.type.name,d=(0,eE.isNodeSelection)(r)&&"gallery"===r.node.type.name;if(!(s||l||d||o))return oN(a,e),!1;let c=r.from-1,u=d?{from:r.to-1,to:r.to-1}:s?{from:c,to:c+r.$from.parent.nodeSize}:{from:r.from,to:r.to};return e.chain().setTextSelection(u).insertEmbedAndFetchMetadata(a,void 0,!0).command(({tr:e})=>{let t=(0,oC.createSelectionNearLastTo)(e);return t&&e.setSelection(t),!0}).run(),!0},oF=e=>(0,oy.startsWithHttp)(e)&&!e.includes("\n")&&(0,oy.isValidUrl)(e),oH=e=>1===e.content.childCount&&e.content.firstChild.isTextblock&&oF(e.content.firstChild.textContent),oW=(e,t)=>{e.commands.setMark(oB.name,{href:t}),oN(t,e)},oU=e=>{let t=[];return e.content.descendants((e,i)=>{e.marks.filter(e=>"link"===e.type.name).forEach(e=>{t.push({mark:e,pos:i})})}),t};var oV=e.i(858895);let oG=(e,t)=>{if(!e.isEditable||!t.clipboardData)return!1;let i=t.clipboardData.getData("text/plain");if(!i||oF(i))return!1;let n=t.clipboardData.getData("text/html");if(n?.includes("data-pm-slice"))return!1;let{state:a}=e;if(a.selection.$from.parent.type.spec.code){let t=a.tr.insertText(i);return e.view.dispatch(t),!0}let r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,s=o?.mode;if(!(!n||"markdown"===s||oZ(i)))return!1;let{from:l,to:d}=a.selection;return t.preventDefault(),e.commands.insertMarkdownAt({from:l,to:d},i)},o$=(e,t,i)=>{let n=r0.parse(e),{slice:a}=(0,rr.parseExternalHtml)(n,t,i,{preserveWhitespace:!1});return a},oZ=e=>{let t=e.match(/^```/gm);if(t&&t.length>1||e.match(/\[[^]+\]\(https?:\/\/\S+\)/gm)||e.match(/\[[^]+\]\(\/\S+\)/gm)||e.match(/^#{1,6}\s+\S+/gm))return!0;let i=e.match(/^\s*[\d-*].\s\S+/gm);return!!(i&&i.length>1||e.match(/^\s*-{3,}\s*$/gm))},oK=(e,t,i,n,a)=>{try{let r=e.slice(t,i).content,o=(0,oV.serializeFragment)(r,e.type.schema),s=document.createElement("div");s.appendChild(o);let l=s.innerHTML;return((e,t,i=oY)=>{t&&(oh.prototype.escape=e=>e);let n=i.turndown(e);return t&&(oh.prototype.escape=oX),n})(l,n,a)}catch(n){return console.error("[caught] rangeToMarkdown: ",t,i,e.nodeSize,n),""}},oq=(e,t)=>{try{return e.getAttribute(t)}catch(e){return null}},oY=new oh({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced",hr:"---"}).remove(["style"]).addRule("list",{filter:["ul","ol"],replacement:function(e,t){let i=t.parentNode;return(i?.nodeName.match(/^(UL|OL)$/i)&&(e=" "+e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ")),i?.nodeName==="LI"&&i.lastElementChild===t)?"\n"+e:"\n\n"+e+"\n\n"}}).addRule("listItem",{filter:"li",replacement:function(e,t,i){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");let n=i.bulletListMarker||"-",a=n+" ",r=t.parentNode,o=oq(t,"indent");if(null!==o){let e=parseInt(o,10);!isNaN(e)&&e>0&&(a=" ".repeat(e)+a)}let s=oq(t,"variant");if(1===t.children.length&&t.children[0].nodeName.match(/^(UL|OL)$/i)&&t.textContent===t.children[0].textContent)a=" ";else if(r?.nodeName==="OL"){let e=r.getAttribute("start"),i=Array.prototype.indexOf.call(Array.prototype.filter.call(r.children,e=>"LI"===e.nodeName),t),o=e?Number(e)+i:i+1;a=a.replace(n,o+".")}else if("numbered"===s){let e=oq(t,"start")||1;a=a.replace(n,e+".")}return a+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}}),oX=oh.prototype.escape;function oQ(e){let t=ac();return ag((0,aF.getDocLocaleSetting)(e.state.doc)||t).englishName}async function oJ({prompt:e,language:t,variant:i,sectionContext:n,diagramType:a,context:r}){let o=JSON.parse(await (0,ai.renderJsxPrompt)({promptKey:"GenerateDiagram",variables:{variant:i,prompt:e,language:t,blockFlags:(0,aA.getBlockFlags)(),sectionContext:n,diagramType:a},workspaceId:r.workspaceId,opts:{traceparent:r.traceparent}}));if(!o.variant||!o.data)throw Error("Invalid response format from GenerateDiagram prompt");return o}e.s(["getLanguageForDiagrams",0,oQ,"preserveExistingIconsAndImages",0,(e,t)=>{let i={...t};return e.step&&t.step&&Array.isArray(e.step)&&Array.isArray(t.step)&&(i.step=t.step.map((t,i)=>{let n=e.step[i],a={...t};return n?.icon&&(a.icon=n.icon),n?.image&&(a.image=n.image),a})),e.general&&t.general&&Array.isArray(e.general)&&Array.isArray(t.general)&&(i.general=t.general.map((t,i)=>{let n=e.general[i],a={...t};return n?.icon&&(a.icon=n.icon),n?.image&&(a.image=n.image),a})),i}],140753);let o0=(e,t)=>{let i=oQ(e),n=t,{state:a}=e,{selection:r}=a,o=oK(a.doc,Math.max(r.from-1e3,0),r.from),s=(0,rf.stringToTokens)(o).slice(-200),l=(0,rf.tokensToString)(s);return t||(n=l),{aiGenerateParams:{prompt:`Generate a smart diagram based on the following text: ${n}`,language:i,context:t?l:void 0},aiGenerateStatus:"queued"}},o1=(e,t,i)=>{let n=(0,eE.findParentNodeClosestToPos)(t.doc.resolve(i),ev.isCardNode);return!!n&&(o6({editor:e,rootNode:n.node,interactionId:(0,a$.generateAIInteractionId)(),cardDimensions:(0,aF.getDocAttrs)(e).settings?.cardDimensions}),!0)};class o2{nodeType="smartDiagram";detectNode(e){if(e.type.name!==this.nodeType||!this.getNodeId(e))return!1;let t=e.attrs;return!!(t&&t.aiGenerateParams&&"queued"===t.aiGenerateStatus)}getNodeId(e){return e.attrs?.id||null}getCacheKey(e,t){let i=this.getNodeId(e),n=t.interactionId,a=e.attrs,r=a.templateKey,o=a.aiGenerateParams?.prompt;return o||console.error("[SmartDiagramProcessor.getCacheKey] No prompt in aiGenerateParams"),`${n}__${this.nodeType}__${i}__${r}__${o}`}async populateIcons(e,t){if(Array.isArray(e))await Promise.all(e.map(e=>this.populateIcons(e,t)));else if(e&&"object"==typeof e){if(e.icon&&"object"==typeof e.icon&&e.icon.query)try{let i={provider:"icon",query:e.icon.query,options:{}},n=await re({loadImageId:`icon-${Date.now()}-${Math.random()}`,loadImageParams:i,context:{docId:t.docId,workspaceId:t.workspaceId,interactionId:t.interactionId,traceparent:t.traceparent},imageStore:t.imageStore});n.src&&(e.icon=n)}catch(t){console.error("Error fetching icon:",e.icon.query,t)}await Promise.all(Object.values(e).map(e=>this.populateIcons(e,t)))}}async processNode(e,t){let i=e.attrs||{};try{let e=(0,eu.getStore)().getState(),n=(0,ef.selectImageOptions)(e)||{},a=(0,ef.selectTheme)(e),r={license:n.license,provider:n.provider,stylePrompt:n.generateStyle||a?.config?.stylePrompt,model:n.model,stylePreset:n.stylePreset,visualsMenuEnabled:n.visualsMenuEnabled,artStylePreset:n.artStylePreset,artStylePrompt:n.artStylePrompt},o=await oJ({prompt:i.aiGenerateParams.prompt,language:i.aiGenerateParams.language,variant:i.templateKey,sectionContext:i.aiGenerateParams.sectionContext,diagramType:i.aiGenerateParams.diagramType,context:{docId:t.docId,workspaceId:t.workspaceId,interactionId:t.interactionId,traceparent:t.traceparent}});await this.populateIcons(o.data,t),await this.processImagesInData(o.data,t,r);let s=(0,rg.getSmartDiagramTemplate)(o.variant);return{...i,templateKey:o.variant,aiGenerateStatus:"done",horizontalAlign:"center",data:{...o.data,colorScheme:s?.defaultColorScheme}}}catch(t){console.error(`[SmartDiagramProcessor] Error processing ${this.nodeType}:`,t);let e=i.templateKey?(0,rg.getSmartDiagramTemplate)(i.templateKey):void 0;return{...i,aiGenerateStatus:"error",data:{colorScheme:e?.defaultColorScheme}}}}async processImagesInData(e,t,i){if(Array.isArray(e))await Promise.all(e.map(e=>this.processImagesInData(e,t,i)));else if(e&&"object"==typeof e){if(e.image&&"object"==typeof e.image&&e.image.query&&!e.image.loadImageParams&&!e.image.src)try{let n=(({query:e,provider:t,license:i,model:n,aspectRatio:a,stylePreset:r,stylePrompt:o,artStylePreset:s,artStylePrompt:l,styleReferenceImages:d,visualsMenuEnabled:c})=>{if(!e)return{loadImageStatus:"error"};let u=(0,aA.isAiProvider)(t);return"web"===t&&(e=e.split(", ")[0]),{loadImageParams:{provider:t,query:e,options:u?{model:n,aspectRatio:a,stylePreset:r,stylePrompt:o,artStylePreset:s,artStylePrompt:l,styleReferenceImages:d,visualsMenuEnabled:c}:{license:i}},loadImageStatus:"queued",loadImageId:(0,a7.generateMediaId)(),source:a4.ImageSearchProvidersToMediaProviderKey[t]}})({...i,query:e.image.query,provider:e.image.provider||i.provider}),a=await re({loadImageId:n.loadImageId,loadImageParams:n.loadImageParams,context:{docId:t.docId,themeId:t.themeId,workspaceId:t.workspaceId,interactionId:t.interactionId,traceparent:t.traceparent},imageStore:t.imageStore});Object.assign(e.image,n,a,{loadImageStatus:"done"})}catch(t){console.error("[SmartDiagramProcessor] Error processing image:",e.image.query,t),Object.assign(e.image,{loadImageStatus:"error"})}await Promise.all(Object.values(e).map(e=>this.processImagesInData(e,t,i)))}}}let o3=new Map,o5=new Map,o4=new iF.EventEmitter,o6=async({editor:e,rootNode:t,theme:i,interactionId:n,traceparent:a,workspaceId:r,docId:o,startPos:s,endPos:l,cardDimensions:d,interactionName:c})=>{let u=[new o2,new rh,new rl,new rp,new ri,new ra("video"),new ra("embed")],p=new aK;t.descendants((t,h)=>{if((!s||!(hl)))for(let s of u){if(!s.detectNode(t))continue;let l=s.getNodeId(t);if(!l)continue;let u={docId:o||e.gammaDocId,workspaceId:r||e.gammaOrgId||(0,ax.getCurrentWorkspaceId)(),interactionId:n,theme:i,cardDimensions:d,imageStore:p,traceparent:a,interactionName:c},h=s.getCacheKey(t,u);if(o5.has(h)){o8(e,l,s,o5.get(h));continue}if(o3.has(h)){o3.get(h).then(t=>{o8(e,l,s,t)});continue}let m=s.processNode(t,u);o3.set(h,m),m.then(i=>{o5.set(h,i),o8(e,l,s,i),o4.emit("processed",{node:t,attrs:i,processor:s,interactionId:u.interactionId,docId:u.docId})});break}})},o9=async({editor:e,content:t,theme:i,interactionId:n,workspaceId:a,docId:r,traceparent:o,cardDimensions:s,interactionName:l})=>{let d=es.Node.fromJSON(e.state.schema,t);o6({editor:e,rootNode:d,theme:i,interactionId:n,traceparent:o,workspaceId:a,docId:r,cardDimensions:s,interactionName:l})},o8=(e,t,i,n)=>{let a=(0,eE.findChildren)(e.state.doc,e=>i.getNodeId(e)===t)[0];if(!a)return void console.error(`[updateAsyncNodeAttrs] Could not find node with id=${t}`);if(i.updateNode)return void i.updateNode(e,a.pos,n);let r=e.chain();r.updateAttributesAtPos(a.pos,n),r.noUndo&&r.noUndo(),r.run()};var o7=e.i(753801),se=e.i(647031),st=e.i(840733);let si=st.z.object({id:st.z.string(),source:st.z.string(),src:st.z.string().nullish(),tempUrl:st.z.string().nullish(),query:st.z.string().optional(),sourceUrl:st.z.string().nullish(),meta:st.z.object({height:st.z.number(),width:st.z.number(),aspectRatio:st.z.number().nullish()}).nullish(),aiParams:st.z.object({model:st.z.string().nullish(),stylePrompt:st.z.string().nullish(),stylePreset:st.z.string().nullish(),artStylePreset:st.z.string().nullish(),artStylePrompt:st.z.string().nullish(),styleReferenceImages:st.z.array(st.z.string().url()).nullish()}).nullish()});class sn{static DEFAULT_APPLIED_FIRST_POS=2;static applyResultVariation(e,t){sn.loadCheckpoint(e,t.toApplyCheckpointId,t.messageId),e.agent.setChosenResultVariation({messageId:t.messageId,variationId:t.id}),e.agent.emit("save",{flush:!0})}static async loadCheckpoint(e,t,i,n){let{editor:a,agent:r}=e,o=r.store.getState().checkpoints[t]??(r.currentBeforeCheckpoint?.id===t?r.currentBeforeCheckpoint:void 0);if(!o)throw Error(`Cannot find checkpoint with id ${t}`);let s=a.state.selection.from;await new Promise(e=>queueMicrotask(e)),a.chain().setContent(o.jsonContent).command(({tr:e})=>{try{let t=e.doc.resolve(s),i=(0,oC.findSelectionNearOrGapCursor)(t);i&&e.setSelection(i)}catch(e){}return!0}).restoreAnnotations(o.annotationsAbsolute??{}).run(),n?.skipTheme||await e.applyTheme?.(o.themeId);let l=(0,ef.selectTheme)((0,eu.getStore)().getState());o6({editor:a,rootNode:a.state.doc,theme:l,interactionId:i,cardDimensions:(0,aF.getCardDimensionsKey)(a),interactionName:"buddy-chat"})}static async ensureCardInView(e,t,i=0){let n=(0,o7.getScrollManager)("editor"),a=document.querySelector((0,ey.getCardScrollerSelector)(t)),r=(0,o7.isInViewport)(a,500);!r?.yAxisInView&&(n.scrollElementIntoView({element:a}),i>0&&await new Promise(e=>setTimeout(e,i)))}static focusResultVariation(e,t){let{editor:i}=e,n=t.scrollToCardId;if(!n)return;let a=sn.findCardById(i,n);setTimeout(()=>{sn.ensureCardInView(e,n);let t=i.state.selection.from;(ta.pos+a.node.nodeSize)&&i.chain().selectInsideCardBody(a.pos).focus().run()},0)}static findCardById(e,t,i=!1){let n=this.findTopLevelCards(e).find(e=>e.cardId===t);if(!n)throw Error(`Cannot find card with id ${t}`);return i&&this.focusCard(e,n.pos),n}static checkCardById(e,t){let i=this.findTopLevelCards(e).find(e=>e.cardId===t);return i||null}static async removeCardById(e,t){let{cardId:i}=e,{editor:n}=t,a=sn.checkCardById(n,i),r=a?.pos,o=a?n.state.doc.nodeAt(a.pos):null;return!!r&&!!o&&(n.chain().deleteCard(r).run(),!0)}static async replaceCardHTMLById(e,t){let{cardId:i,cardHtml:n,messageId:a}=e,{editor:r,theme:o}=t,s=(0,aA.parseFencedCodeResponse)(n),l=aO(s,t.bookmarks),d=sn.checkCardById(r,i),c=d?.pos,u=d?r.state.doc.nodeAt(d.pos):null;if(!c||!u)return null;let p={from:c,to:c+u.nodeSize};return l.attrs.id=i,r.chain().setMeta("cardNotesHandled",!0).insertContentAt(p,l).selectInsideCardBody(c).run(),o9({editor:r,content:l,theme:o,interactionId:a,cardDimensions:(0,aF.getCardDimensionsKey)(r),interactionName:"buddy-chat"}),{oldHtml:n,newHtml:s,replaceRange:p}}static replaceCardJSONById(e,t,i=!0){let{cardId:n,cardJson:a,messageId:r}=e,{editor:o}=t,s=sn.checkCardById(o,n),l=s?.pos,d=s?o.state.doc.nodeAt(s.pos):null;if(!l||!d)return null;let c={from:l,to:l+d.nodeSize},u=o.chain().setMeta("cardNotesHandled",!0).insertContentAt(c,a);if(i){let e=t.editor.state.selection.from;(ec.to)&&u.selectInsideCardBody(l)}return u.run(),o9({editor:o,content:a,theme:t.theme,interactionId:r,cardDimensions:(0,aF.getCardDimensionsKey)(o),interactionName:"buddy-chat"}),{replaceRange:c}}static getCurrentFocusedCard(e,t){let i=e.state.selection,n=(0,se.findTopCardNodeParent)(e.state.doc,i.from);if(!n)throw Error("Cannot find currently focused card");let a=n.node.attrs.id,r=this.findCardNum(e,a);return{cardId:a,cardNum:r,html:(0,aG.contentToAiHtml)(e,n.node,{bookmarks:t})}}static focusCard(e,t){e.chain().selectInsideCardBody(t).focus().scrollIntoView().run()}static getDeckInfo(e,t){let{editor:i,agent:n,bookmarks:a,theme:r}=e,o=n.store.getState(),s=o.cardsInView.filter(e=>"full"===e.inView||"partial"===e.inView).map(e=>({cardId:e.cardId,inView:e.inView,pos:e.pos})),l=(0,o7.getScrollManager)("editor"),d=document.querySelector(l.scrollSelector);if(!d)throw Error("Cannot find container element");let c=t?.initiatingCardId,u=((e,t,i)=>{if(!i)return;if("image"===i.type){var n;let e;return{type:"image",imageSelection:(n=i.attrs,(e=si.safeParse(n)).success?e.data:n),cursorInCardId:i.cardId,nodeId:i.id}}if("text"===i.type&&i.length>5)return{type:"text",selectionStartCardId:i.cardId,textSelection:i.text};let{selection:a}=e.state,{overlap:r}=((e,t)=>{let{top:i,bottom:n}=t.getBoundingClientRect(),{from:a,to:r}=e.state.selection,o=e.view.coordsAtPos(a),s=e.view.coordsAtPos(r),l=Math.min(o.top,s.top),d=Math.max(o.bottom,s.bottom),c=d-l;return dn?{position:"below",overlap:0}:l=i&&d>n?{position:"endsBelow",overlap:(n-l)/c}:ln?{position:"spansContainer",overlap:1}:{position:"within",overlap:1}})(e,t);if(0===r)return;let o=a instanceof el.NodeSelection;if((!o||!(r<.5))&&(o||!(r<.33)))return"card"===i.type?{type:"card",selectedCardId:i.cardId}:{type:"none",cursorInCardId:i.cardId}})(i,d,o.editorSelection??null);return{currentThemeName:r?.name||"",docHtml:this.getDocHtml(i,{cardsInView:s,initiatingCardId:c,selection:u},aY.featureFlags.get("buddyTokenLimits"),a),cardsInView:s,initiatingCardId:c,selection:u}}static getDocHtml(e,t,i,n){let a=this.findTopLevelCards(e,n),r=a.map(e=>e.cardHtml).join("\n"),o=sa(r=`
    ${r}
    `);if(console.log(`[buddy] allHtml estTokens: ${o}`),o0)for(let{cardId:i}of t.cardsInView){let t=this.findCardById(e,i);s.addCardHtml(i,t.cardHtml)}if(t.selection){let i;if(i="card"===t.selection.type?t.selection.selectedCardId:"text"===t.selection.type?t.selection.selectionStartCardId:t.selection.cursorInCardId){let t=this.findCardById(e,i);s.addCardHtml(i,t.cardHtml)}}return console.log(`[buddy] partial html estTokens: ${s.curEstTokens}`),s.docHtml()}static getTopLevelCardIdsFromJson(e){let t=[],i=(e,n)=>{if("card"===e.type&&n&&e.attrs?.id)return void t.push(e.attrs.id);let a="document"===e.type;if(Array.isArray(e.content))for(let t of e.content)i(t,n||a)};return i(e,!1),t}static findTopLevelCards(e,t){return(0,eE.findChildren)(e.state.doc,e=>(0,ev.isCardNode)(e)).filter(t=>1===e.state.doc.resolve(t.pos).depth).map((i,n)=>({pos:i.pos,node:i.node,cardNum:n+1,cardId:i.node.attrs.id,cardJson:i.node.toJSON(),cardHtml:t?(0,aG.contentToAiHtml)(e,i.node,{bookmarks:t}):(0,aG.contentToAiHtml)(e,i.node,{disableBookmarks:!0})}))}static findCardNum(e,t){let i=this.findTopLevelCards(e).find(e=>e.cardId===t);if(!i)throw Error(`Cannot find card with id ${t}`);return i.cardNum}static findCreateCardInsertRange(e,t){let i=this.findTopLevelCards(e),n=t-1,a=i[n];if(n>=i.length){let t=i.length-1,n=e.state.doc.nodeAt(i[t].pos),a=i[t].pos+n.nodeSize;return{from:a,to:a,relativeRange:{from:(0,eC.absoluteToRelativePos)(e.state,a),to:(0,eC.absoluteToRelativePos)(e.state,a)}}}if(!a)throw Error(`Cannot find card with index ${n}`);return{from:a.pos,to:a.pos,relativeRange:{from:(0,eC.absoluteToRelativePos)(e.state,a.pos),to:(0,eC.absoluteToRelativePos)(e.state,a.pos)}}}static findCardInsertRange(e,t,i){let n=this.findCardById(e,t);if(!n)throw Error(`Cannot find card with id ${t}`);if("before"===i)return{from:n.pos,to:n.pos,relativeRange:{from:(0,eC.absoluteToRelativePos)(e.state,n.pos),to:(0,eC.absoluteToRelativePos)(e.state,n.pos)}};{let t=n.pos+n.node.nodeSize;return{from:t,to:t,relativeRange:{from:(0,eC.absoluteToRelativePos)(e.state,t),to:(0,eC.absoluteToRelativePos)(e.state,t)}}}}static findFallbackPositionCard(e,t,i,n,a){if(!t||0===t.length)return null;let r=t.indexOf(i);if(-1===r)return null;let o=new Set(this.findTopLevelCards(e).map(e=>e.cardId)),s=e=>e!==a&&o.has(e);if("after"===n){for(let e=r-1;e>=0;e--){let i=t[e];if(s(i))return{cardId:i,position:"after"}}for(let e=r+1;e=0;e--){let i=t[e];if(s(i))return{cardId:i,position:"after"}}}return null}static findFallbackInsertRange(e,t,i,n){let a=this.findFallbackPositionCard(e,t,i,n);if(a)return this.findCardInsertRange(e,a.cardId,a.position);let r=this.findTopLevelCards(e);if(r.length>0){let e=r[r.length-1],t=e.pos+e.node.nodeSize;return{from:t,to:t}}return{from:1,to:1}}static getImages(e){let t=[];return e.state.doc.descendants(e=>{if("card"==e.type.name)return!0;let i=(0,aE.getNodeImageAttrs)(e);return!i||!i||!e.attrs.id||(t.push({nodeId:e.attrs.id,attrs:i,nodeType:e.type.name}),!1)}),t}static selectImage(e,t){let i=aj(e,t);if(!i)return{success:!1};let n=(0,eC.relativeToAbsolutePos)(e.state,i.relativePosition);if(!n)return{success:!1};e.commands.setNodeSelection(n);let a=(0,ev.findCardNodeClosestToPos)(e,n)?.node.attrs.id;return this.ensureCardInView({editor:e},a),{success:!0,imageAttrs:i.attrs,imagePosition:n}}}function sa(e){return Math.floor(e.length/3.5)}class sr{config;curEstTokens;outline;cardsToPopulate;constructor(e,t){this.config=t,this.outline=[],this.cardsToPopulate=new Map;const i=function(e){return Math.floor(3.5*e)}(this.config.cardPreviewMaxTokens);this.outline=e.map(e=>({cardId:e.cardId,title:(0,aV.getCardTitle)(e.cardJson)??"none",cardHtmlPreview:e.cardHtml.slice(0,i)})),this.curEstTokens=this.outline.reduce((e,t)=>e+sa(t.cardHtmlPreview),0)}addCardHtml(e,t){let i=sa(t);return!this.cardsToPopulate.has(e)&&!(this.curEstTokens+i>this.config.maxTokens)&&(this.cardsToPopulate.set(e,t),this.curEstTokens+=i,!0)}docHtml(){return{type:"partial",content:this.outline.map(e=>{let t=this.cardsToPopulate.get(e.cardId);return{cardId:e.cardId,title:e.title,cardHtml:t,cardHtmlPreview:null==t?e.cardHtmlPreview:void 0}})}}}e.s(["combineConflictingSuggestions",()=>sy,"filterImageEditsByCardId",()=>sf,"hasCardId",()=>sp,"mapWith",()=>sm,"mapWithout",()=>sg,"updateImageInJson",()=>sb,"withState",()=>sh],417416);class so{_cardIds;index;constructor(e){this._cardIds=e,this.index=0}current(){return this._cardIds[this.index]}take(e=3){return this._cardIds.slice(this.index,this.index+e)}goto(e,t=0){let i=this._cardIds.findIndex(t=>t===e);return -1===i&&(this.index=0),i+t<0?this.index=0:i+t>this._cardIds.length-1?this.index=this._cardIds.length-1:this.index=i+t,this}scrollAndSelect(e){let t=this.current();sn.ensureCardInView({editor:e},t);let i=(0,ev.findCardById)(e,t);i&&e.chain().selectInsideCardBody(i.pos).focus().run()}}let ss=e=>new so((0,eE.findChildren)(e.state.doc,e=>(0,ev.isCardNode)(e)).filter(t=>1===e.state.doc.resolve(t.pos).depth).map(e=>e.node.attrs?.id));var sl=((s={}).Card="card",s.Doc="doc",s.Image="image",s.Theme="theme",s.CardRemoval="card-removal",s.CardCreation="card-creation",s.CardMove="card-move",s);e.s(["BuddySuggestionPreviewType",()=>sl],46453);class sd{input;type;messageId;cardId;cardJson;get id(){return this.input.toolCallId}constructor(e){this.input=e,this.type="createCard",this.messageId=e.messageId,this.cardJson=this.input.cardJson,this.cardId=this.cardJson.attrs?.id}withCardJson(e){return new sd({...this.input,cardJson:e})}findFallbackPositionCard(e){let{createPositionCardId:t,createPosition:i,originalAllCardIds:n}=this.input;return n?sn.findFallbackPositionCard(e,n,t,i):null}preview(e,t){return{previewType:sl.CardCreation,cardId:this.cardId,cardJson:this.cardJson,originalContextCardIds:this.getOriginalPreviewCardIds(e),modifiedContextCardIds:this.getModifiedPreviewCardIds(t),appliedFirstPos:this.getAppliedFirstPos(t),originalScrollToCardId:this.originalCardToSelect({editor:e.editor}),modifiedScrollToCardId:this.modifiedCardToSelect({editor:t.editor})}}apply(e){let t,{editor:i}=e;sn.checkCardById(i,this.cardId)||(t=sn.checkCardById(i,this.input.createPositionCardId)?sn.findCardInsertRange(i,this.input.createPositionCardId,this.input.createPosition):sn.findFallbackInsertRange(i,this.input.originalAllCardIds??[],this.input.createPositionCardId,this.input.createPosition),i.chain().insertContentAt(t,this.cardJson,{updateSelection:!1}).run(),o9({editor:i,content:this.cardJson,theme:e.theme,interactionId:this.messageId,traceparent:this.input.traceparent,cardDimensions:(0,aF.getCardDimensionsKey)(i),interactionName:"buddy-chat"}))}async focus(e){await sn.ensureCardInView(e,this.cardId)}applyOriginal(e){}async focusOriginal(e){let t=this.originalCardToSelect({editor:e.editor});t&&await sn.ensureCardInView(e,t)}getAppliedFirstPos(e){let t=sn.findTopLevelCards(e.editor);return t.find(e=>e.cardId===this.cardId)?.pos??sn.DEFAULT_APPLIED_FIRST_POS}getOriginalPreviewCardIds(e){let{createPositionCardId:t,createPosition:i}=this.input;if(sn.checkCardById(e.editor,t))return ss(e.editor).goto(t,"before"===i?-1:0).take(3);let n=this.findFallbackPositionCard(e.editor);return n?ss(e.editor).goto(n.cardId,-1).take(3):sn.findTopLevelCards(e.editor).map(e=>e.cardId).slice(-3)}getModifiedPreviewCardIds(e){return ss(e.editor).goto(this.cardId,-1).take(3)}originalCardToSelect(e){let{createPositionCardId:t,createPosition:i}=this.input;if(sn.checkCardById(e.editor,t))return ss(e.editor).goto(t,"before"===i?-1:0).current();let n=this.findFallbackPositionCard(e.editor);if(n)return n.cardId;let a=sn.findTopLevelCards(e.editor);return a[a.length-1]?.cardId??""}modifiedCardToSelect(e){return this.cardId}mergeInto(e){return sh(e,{createByCardId:sm(e.createByCardId,this.cardId,this)})}serialize(){return{type:this.type,input:this.input}}}let sc=e=>(e.attrs?.id!==void 0&&delete e.attrs.id,e.content?.forEach(sc),e);class su{input;type;messageId;cardId;insertPositionCardId;insertPosition;duplicatedCardId;get id(){return this.input.toolCallId}constructor(e){this.input=e,this.type="duplicateCard",this.messageId=e.messageId,this.cardId=e.cardId,this.duplicatedCardId=e.duplicatedCardId,this.insertPositionCardId=e.insertPositionCardId,this.insertPosition=e.insertPosition}preview(e,t){return{previewType:sl.CardCreation,cardId:this.duplicatedCardId,cardJson:this.input.cardJson,originalContextCardIds:this.getOriginalPreviewCardIds(e),modifiedContextCardIds:this.getModifiedPreviewCardIds(t),appliedFirstPos:this.getAppliedFirstPos(t),originalScrollToCardId:this.originalCardToSelect(),modifiedScrollToCardId:this.modifiedCardToSelect()}}apply(e){let t,{editor:i}=e;if(sn.checkCardById(i,this.duplicatedCardId))return;let n=sc((0,a_.default)(this.input.cardJson));n.attrs||(n.attrs={}),n.attrs.id=this.duplicatedCardId,t=sn.checkCardById(i,this.insertPositionCardId)?sn.findCardInsertRange(i,this.insertPositionCardId,this.insertPosition):sn.findFallbackInsertRange(i,this.input.originalAllCardIds,this.insertPositionCardId,this.insertPosition),i.chain().insertContentAt(t.from,n,{updateSelection:!1}).run()}async focus(e){await sn.ensureCardInView(e,this.duplicatedCardId)}applyOriginal(e){}async focusOriginal(e){await sn.ensureCardInView(e,this.cardId)}getAppliedFirstPos(e){let t=sn.findTopLevelCards(e.editor);return t.find(e=>e.cardId===this.duplicatedCardId)?.pos??sn.DEFAULT_APPLIED_FIRST_POS}getOriginalPreviewCardIds(e){return ss(e.editor).goto(this.cardId,-1).take(3)}getModifiedPreviewCardIds(e){return ss(e.editor).goto(this.duplicatedCardId,-1).take(3)}originalCardToSelect(){return this.cardId}modifiedCardToSelect(){return this.duplicatedCardId}mergeInto(e){let t={...this.input.cardJson,attrs:{...this.input.cardJson.attrs,id:this.duplicatedCardId}};return new sd({toolCallId:this.id,messageId:this.messageId,cardJson:t,cardId:this.duplicatedCardId,createPositionCardId:this.insertPositionCardId,createPosition:this.insertPosition,originalAllCardIds:this.input.originalAllCardIds}).mergeInto(e)}serialize(){return{type:this.type,input:this.input}}}function sp(e){return"cardId"in e&&"string"==typeof e.cardId}let sh=(e,t)=>({...e,...t}),sm=(e,t,i)=>new Map(e).set(t,i),sg=(e,t)=>{let i=new Map(e);return i.delete(t),i},sf=(e,t)=>{let i=new Map;for(let[n,a]of e)n.startsWith(`${t}:`)||i.set(n,a);return i};function sb(e,t,i){return"image"===e.type&&e.attrs?.id===t?{...e,attrs:{...e.attrs,...i}}:e.content?{...e,content:e.content.map(e=>sb(e,t,i))}:e}function sx(e,t){if("removeCard"!==t.type){let i=sp(t)?t.cardId:null,n=t instanceof su?t.duplicatedCardId:i;if(n&&e.removeByCardId.has(n))return e}return t.mergeInto(e)}function sy(e){let t={removeByCardId:new Map,createByCardId:new Map,editByCardId:new Map,moveByCardId:new Map,imageEditByKey:new Map,themeSuggestion:null,otherSuggestions:[]},i=e.reduce(sx,t);return[...i.removeByCardId.values(),...i.createByCardId.values(),...i.editByCardId.values(),...i.moveByCardId.values(),...i.imageEditByKey.values(),...i.themeSuggestion?[i.themeSuggestion]:[],...i.otherSuggestions]}class sv{input;id;type;previewType;messageId;constructor(e){this.input=e,this.type="suggestThemes",this.previewType=sl.Theme,this.messageId=e.messageId,this.id=e.toolCallId}preview(e,t){return{previewType:sl.Theme,originalScrollToCardId:"",modifiedScrollToCardId:"",appliedFirstPos:sn.DEFAULT_APPLIED_FIRST_POS,originalThemeId:this.input.originalThemeId,newThemeId:this.input.newThemeId,themeName:this.input.themeName}}apply(e){e.applyTheme?.(this.input.newThemeId)}async focus(e){}applyOriginal(e){e.applyTheme?.(this.input.originalThemeId)}async focusOriginal(e){}getAppliedFirstPos(e){return sn.DEFAULT_APPLIED_FIRST_POS}mergeInto(e){let t=e.themeSuggestion;return t?sh(e,{themeSuggestion:new sv({messageId:this.messageId,toolCallId:this.id,originalThemeId:t.input.originalThemeId,newThemeId:this.input.newThemeId,themeName:this.input.themeName,suggestedThemes:this.input.suggestedThemes})}):sh(e,{themeSuggestion:this})}serialize(){return{type:this.type,input:this.input}}}e.i(615835),aQ.DeductCreditsV2Operation.ImageEditRemoveBackground,aQ.DeductCreditsV2Operation.ImageEditVectorize,aQ.DeductCreditsV2Operation.ImageEditUpscale,aQ.DeductCreditsV2Operation.ImageEditMaskless,aQ.DeductCreditsV2Operation.ImageEditAnimate;var sC=e.i(82050),sw=e.i(196277);e.i(400340);e.i(794251),e.i(376210),e.i(138831);let sS=e=>!!(e.src&&!(0,W.isMp4Url)(e.src)&&!(0,W.isSVGUrl)(e.src)&&!(e.meta?.frame_count&&e.meta?.frame_count>1));e.s(["isRasterImage",0,sS],50044);var sk=e.i(180939),sA=(e.i(359227),e.i(555999));e.i(566358);var sE=e.i(907648);let s_={generate:(0,R.customAlphabet)("0123456789abcdefghijklmnopqrstuvwxyz",15)},sI=new el.PluginKey("UniqueCardId"),sM=e=>{let t=e.type===ey.CARD_NODE_NAME?{...e.attrs,id:s_.generate()}:e.attrs,i=e.content?.map(e=>sM(e));return{...e,...t&&{attrs:t},...i&&{content:i}}},sT=sE.UniqueAttribute.extend({name:"UniqueCardId"}).configure({attributeName:"id",initialValue:()=>s_.generate(),syncWithFilmstrip:()=>aY.featureFlags.get("transactionalFilmstrip"),filterTransaction:sA.isLocalTransaction,pluginKey:sI,transformPasted:(e,t,i)=>{let{types:n,initialValue:a,attributeName:r}=t,o={},s=e=>{let t=[];return e.forEach(e=>{if(e.isText)return void t.push(e);if(!n.includes(e.type.name))return void t.push(e.copy(s(e.content)));let i=a(),l=e.type.create({...e.attrs,[r]:i},s(e.content),e.marks);e.type.name===ey.CARD_NODE_NAME&&(o={...o,[e.attrs.id]:i}),t.push(l)}),es.Fragment.from(t)},l=e=>{let t=[];return e.forEach(e=>{if(e.isText)return void t.push(e);if("cardMention"===e.type.name){let n=o[e.attrs.id];if(n){let a=e.type.create({...e.attrs,...n?{id:n}:{},docId:i});t.push(a)}else t.push(e);return}t.push(e.copy(l(e.content)))}),es.Fragment.from(t)},d=l(s(e.content));return new es.Slice(d,e.openStart,e.openEnd)}});function sL(e,t){if(null!=e)return e;let i=Error(void 0!==t?t:"Got unexpected "+e);throw i.framesToPop=1,i}e.s(["UniqueCardId",0,sT,"assignCardIds",0,sM,"assignCardIdsToChildren",0,e=>{let t=e=>e.content?.map(e=>{if(!e.content||e.type!==ey.CARD_NODE_NAME)return e;let i={...e,attrs:{...e.attrs,id:s_.generate()}};return i.content=t(i),i});return Object.assign({},e,{content:t(e)})},"cardNanoid",0,s_],444577),e.s(["nullthrows",0,sL],257549),e.s(["getPreviousCardsGml",()=>sQ,"useGenerateCard",()=>sY,"useSuggestCardTopics",()=>sX],210104);var sj=e.i(918331),sP=e.i(606004),sD=e.i(842368),sN=e.i(192094),sR=e.i(647715);let sO=async(e,t,i)=>{let n=(0,sk.getCanUseProductFeature)("unlimited_credits",t),a=aY.featureFlags.get("aiDebits")[e]??sN.DEFAULT_CREDIT_COSTS[e];if(sB(e,t,i),0===a)return;let r=t?.id||(0,ax.getCurrentWorkspaceId)();if(!r)return;let o=(0,aJ.getApolloClient)(),s=await o.mutate({mutation:aQ.DeductCreditsDocument,variables:{value:a,workspaceId:r}}),l=s.data?.deductCredits;return l?(ei.analytics.track(en.SegmentEvents.AI_CREDITS_DEDUCTED,{operation:e,used:n?0:a,remaining:l.credits,interactionId:i,workspaceId:r,plan:(0,sD.getProductForWorkspace)(t)}),(0,eu.getStore)().dispatch((0,sR.setCredits)({availableCredits:l.credits})),l.credits):null},sB=(e,t,i)=>{let n=(0,sk.getCanUseProductFeature)("unlimited_credits",t),a=aY.featureFlags.get("aiDebits")[e]??sN.DEFAULT_CREDIT_COSTS[e];ei.analytics.track(en.SegmentEvents.AI_CREDITS_USED,{operation:e,used:a,has_unlimited_ai:n,interactionId:i,workspaceId:t?.id,plan:(0,sD.getProductForWorkspace)(t)})};e.s(["deductCredits",0,sO,"trackAiCreditsUsed",0,sB],360137);var sz=e.i(75572);let sF=()=>{let e=(0,eu.useAppSelector)(sC.selectDoc),t=(0,eu.useAppSelector)(ef.selectTheme),i=(0,sz.useSavedOrPreferredAiImageModel)(e?.docGenerateInput?.settings?.imageModel),n=e?.docGenerateInput?.settings?.imageProvider||aY.featureFlags.get("aiGeneratorDefaultImageProvider"),a=e?.docGenerateInput?.settings?.imageStyle;!a&&"aiGenerated"===n&&t&&(a=(0,ru.getThemeStyleDescription)(t));let r=e?.docGenerateInput?.settings?.artStylePreset?String(e?.docGenerateInput?.settings?.artStylePreset):void 0,o=e?.docGenerateInput?.settings?.artStylePrompt?String(e?.docGenerateInput?.settings?.artStylePrompt):void 0,s=e?.docGenerateInput?.settings?.styleReferenceImages;return{imageProvider:n,imageOptions:{model:i,stylePrompt:a,artStylePrompt:o,artStylePreset:r,styleReferenceImages:s?.length?s:void 0},imageModel:i,imageStyle:a}};e.s(["useDocGenerateInputImageSettings",0,sF],414556);var sH=e.i(334784);let sW={src:e.i(334759).default,width:92,height:47,blurWidth:0,blurHeight:0},sU={src:e.i(963613).default,width:92,height:47,blurWidth:0,blurHeight:0},sV={src:e.i(412569).default,width:91,height:49,blurWidth:0,blurHeight:0},sG={src:e.i(873092).default,width:92,height:69,blurWidth:0,blurHeight:0},s$={src:e.i(725312).default,width:92,height:55,blurWidth:0,blurHeight:0},sZ={src:e.i(82618).default,width:92,height:45,blurWidth:0,blurHeight:0},sK=()=>[{name:ee.i18n._({id:"RYtHky",message:"Bullets"}),key:"bullets",image:s$,aiDescription:"Use the bullets smart layout for small amounts of text or a list of UL/OL/LI tags for large amounts."},{name:ee.i18n._({id:"m2tQ9E",message:"Paragraphs"}),key:"paragraphs",image:sZ,aiDescription:"Write in paragraphs with no additional layout blocks."},{name:ee.i18n._({id:"61H/21",message:"Boxes"}),key:"boxes",image:sV,aiDescription:"Use one of the boxes smart layouts."},{name:ee.i18n._({id:"2abZdy",message:"Two column with image"}),key:"twoColImage",image:sU,aiDescription:"Use a columns layout with text in one column and an image in the other."},{name:ee.i18n._({id:"cDxTeG",message:"Images with text"}),key:"imagesWithText",image:sG,aiDescription:"Use the images with text smart layout."},{name:ee.i18n._({id:"leAzzX",message:"Image card"}),key:"imageCard",image:sW,aiDescription:"Generate an image card",featureFlag:"aiStudioMode",basePromptKey:"GenerateImageCard",serverChargesCredits:!0,minProductFeature:sH.STUDIO_MODE_REQUIRED_FEATURE}];e.s(["AI_CARD_TEMPLATES",0,sK],296753);let sq={language:"English (US)",textAmount:"md",tone:"",audience:"",format:"deck",imageProvider:"aiGenerated"},sY=({editor:e,getPos:t,theme:i,input:n})=>{let a=(0,eu.useAppSelector)(sC.selectDoc),r=(0,eu.useAppSelector)(sC.selectFileWorkspace),o=(0,eu.useAppSelector)((0,ao.selectDocOrPaidWorkspaceForUser)(r?.id)),s=(0,eu.useAppSelector)(ao.selectUserLocale),[l,d]=(0,et.useState)(!1),c=(0,eu.useAppStore)(),{imageProvider:u,imageOptions:p}=sF(),{template:h,settings:m}=n,g=(0,et.useCallback)(async t=>{var i,n;let s,l;if(!a||!r)throw Error("Doc or organization not found");let{templateText:d,input:m="",interactionId:g}=t,f=performance.now(),b=(i=e,n=c,s=(0,aF.getDocAttrs)(i),l=(0,aF.getDocFormatKey)(s),{blockFlags:(0,aA.getBlockFlags)(s.aiOptions),format:l,outline:aW(n),theme:aU((0,ef.selectTheme)(n.getState()))}),x={...sq,...b,...t.settings,input:m,templateText:d,previous:t.previous,textMode:"generate",imageOptions:p,imageProvider:u},y={interface:"add-card",interactionId:g,inputContent:m,inputData:{...t.settings,template:h},product:(0,sD.getProductForWorkspace)(r),docId:a.id};(0,aq.trackAIRequestSent)(y);let v=await (0,ai.renderJsxPrompt)({promptKey:"GenerateCardWithLayout",variables:x,workspaceId:o.id,interactionId:g}),C=(0,aA.parseFencedCodeResponse)(v),w=aO(C);return(0,aq.trackAIRequestResponse)({...y,outputContent:C,latency:performance.now()-f}),t.serverChargesCredits||sO("generateCard",o,g),w},[a,c,o,r,u,p,h,e]),f=ag(m.locale||(0,aF.getDocLocaleSetting)(e.state.doc)||a?.docGenerateInput?.settings?.locale||s||"en");return{isGenerating:l,getContextAndGenerate:(0,et.useCallback)(async n=>{if(!e)return;let a=t();if("number"!=typeof a)return;let r=e.view.state.doc.nodeAt(a),o=r&&(0,ev.isCardNode)(r)?r:(0,eE.findParentNodeClosestToPos)(e.state.doc.resolve(a),ev.isCardNode)?.node;if(!o)return void console.error("[AICard] Cannot append card. Node unknown");let s=sQ(e,a);d(!0);try{let t=(0,a$.generateAIInteractionId)(),r=sK().find(e=>e.key===h),l=r?.aiDescription,d=r?.basePromptKey,c=await g({input:n,templateText:l,previous:s,settings:{language:f.englishName,basePromptKey:d},interactionId:t,serverChargesCredits:r?.serverChargesCredits});c.attrs={...o.attrs,...c.attrs,container:{...o.attrs.container,...c.attrs.container},generatorInput:{...o.attrs.generatorInput,prompt:n,template:h,settings:m,status:"done",interactionId:t}};let u=(0,eE.findChildren)(e.state.doc,e=>(0,ev.isCardNode)(e)&&e.attrs.id===o.attrs.id)[0];if(!u)return void console.warn("[useGenerateCard] Card not found. It may have been deleted while generating.");e.chain().insertContentAt({from:u.pos,to:u.pos+u.node.nodeSize},c).setMeta("isGenerateCard",!0).selectInsideCardBody(a).run(),o9({editor:e,content:c,theme:i,interactionId:t})}catch(e){console.error("[GenerateCard] Error generating card",e)}d(!1)},[e,t,g,h,f.englishName,m,i]),updateInput:(0,et.useCallback)(i=>{let n=t();if("number"!=typeof n)return;let a=e.view.state.doc.nodeAt(n);a?.attrs.generatorInput&&e.commands.updateNestedAttributesAtPos(n,{generatorInput:i})},[e,t]),locale:f}},sX=(e,t)=>{let{isInOfflineMode:i}=(0,sP.useHealthCheck)(),[n,a]=(0,et.useState)([]),[r,o]=(0,et.useState)("ready"),{generate:s}=(0,ai.useStreamingJsxGeneration)("SuggestCardTopics",{onStart(){o("generating"),a([])},onContent(e){a(e.split("\n").filter(Boolean))},onComplete(e){a(e.split("\n").filter(Boolean)),o("done")},onError(e){console.error("Error generating suggestions",e),o("error")},timeout:3e4}),l=(0,eu.useAppSelector)(sC.selectDoc),d=(0,eu.useAppSelector)(sC.selectFileWorkspace),c=(0,eu.useAppSelector)((0,ao.selectDocOrPaidWorkspaceForUser)(d?.id)),u=(0,aF.getDocAttrs)(e),p=(0,aF.getDocFormatKey)(u),h=(0,eu.useAppStore)();return(0,et.useEffect)(()=>{if(!i&&t&&"ready"===r){let e=aW(h);e.trim().split("\n").length<3||s({variables:{outline:e,format:p},workspaceId:c.id})}},[r,s,i,t,h,p,l,c]),{suggestions:n,generateSuggestionsStatus:r}},sQ=(e,t)=>(0,sj.rangeToAiHtml)(e,Math.max(t-5e3,0),t);var sJ=e.i(367792);e.i(169039),e.i(352522);e.s(["isBeautifyCardAvailable",0,()=>aY.featureFlags.get("beautifyCard")&&(0,sk.getCanUseProductFeature)("ai_premium_models")],15647);let s0=()=>(0,sk.getCanUseProductFeature)("animate_image"),s1=()=>(0,sk.getCanUseProductFeature)("vectorize_image"),s2=()=>(0,sk.getCanUseProductFeature)("upscale_image");e.s(["BuddyChatPopover",()=>dG],792276);var s3=e.i(891494),s5=e.i(50034),s4=e.i(340560),s6=e.i(44850),s9=e.i(690310),s8=e.i(412809);function s7(){let e=(0,eu.useAppSelector)(s8.selectActiveBuddyAgent);if(!e)throw Error("useBuddyAgent requires an active agent; gate callers on useBuddyIsReady()");return e}function le(){return(0,eu.useAppSelector)(s8.selectActiveBuddyAgent)}function lt(e,t){let i=le(),n=(0,et.useRef)(t);n.current=t;let a=(0,et.useCallback)(e=>i?.store.subscribe(e)??(()=>{}),[i]),r=(0,et.useCallback)(()=>i?i.store.getState()[e]:n.current,[i,e]),o=(0,et.useCallback)(()=>n.current,[]);return(0,et.useSyncExternalStore)(a,r,o)}e.s(["useBuddyAgent",0,s7,"useBuddyAgentOrNull",0,le,"useBuddyIsReady",0,function(){return null!==(0,eu.useAppSelector)(s8.selectActiveBuddyAgent)},"useBuddyResetChat",0,function(){let e=s7();return(0,et.useCallback)(()=>e.resetChat(),[e])},"useBuddyStore",0,function(e){return function(e,t=e=>e){let i=et.default.useSyncExternalStore(e.subscribe,et.default.useCallback(()=>t(e.getState()),[e,t]),et.default.useCallback(()=>t(e.getInitialState()),[e,t]));return et.default.useDebugValue(i),i}(s7().store,t=>t[e])},"useBuddyStoreOrDefault",0,lt],87959);let li=()=>{let e=(0,eu.useAppSelector)(sC.selectDocId),t=lt("totalTokensUsed",0),i=(0,eu.useAppSelector)((0,s6.selectStreamRunningForDoc)(e)),n=(0,s4.shouldChargeForInteraction)("buddy-chat"),a=(0,s9.useCreditWarning)({cost:sN.DEFAULT_CREDIT_COSTS.chatSuggestion,surface:"agent",source:{segmentEvent:en.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_BUDDY_EDIT_CHAT,upsellLocation:"credits.buddyEditChat"}}),r=n?a:null,o="not-full";t>18e4?o="full":t>15e4&&(o="almost-full");let s=null;return i?s="stillStreaming":r?.isBlocking?s="credits":"full"===o&&(s="contextWindow"),{contextWindowStatus:o,creditWarning:r,disabledReason:s}};e.s(["useBuddyNotificationState",0,li],643292);var ln=e.i(620020),la=e.i(89227);let lr=e=>"text/csv"===e||"application/csv"===e,lo=e=>"application/pdf"===e.type||e.name.toLowerCase().endsWith(".pdf"),ls=e=>lr(e.type)||e.name.toLowerCase().endsWith(".csv"),ll=e=>e.type.startsWith("image/")||lo(e)||ls(e);e.s(["isAllowedChatFile",0,ll,"isCsvMimeType",0,lr,"isFileCsv",0,ls,"isFilePdf",0,lo,"isImageMimeType",0,e=>e?.startsWith("image/")??!1,"isPdfMimeType",0,e=>"application/pdf"===e],346312),e.i(261991);var ld=e.i(305524);let lc={width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},lu=({handleFilesCallback:e,handleError:t,multiple:i=!1,accept:n=ld.imageTypes.join(","),maxFiles:a})=>{let r=(0,et.useRef)(null);return{inputElement:(0,et.useMemo)(()=>(0,d.jsx)("input",{ref:r,className:"gamma-FileInput-input","data-testid":"hidden-file-input",style:lc,type:"file",name:"gamma-file-input",multiple:i,accept:n,onChange:i=>{let n=i.target;if(!n||!n.files)return;let r=Array.from(n.files);if("number"==typeof a&&r.length>a){t?.({type:"maxFiles"}),n.value=null;return}e(r),n.value=null}}),[n,e,t,a,i]),onClick:(0,et.useCallback)(()=>{r.current?.click()},[])}};e.s(["useHiddenFileInput",0,lu],312086);var lp=e.i(486470);let lh=["image/*","application/pdf","text/csv","application/csv",".csv"],lm=10,lg=async e=>{if(e.size>la.CSV_MAX_SIZE_BYTES){let t=la.CSV_MAX_SIZE_BYTES/1024;return{valid:!1,error:`CSV file "${e.name}" exceeds maximum size of ${t} KB`}}return new Promise(t=>{let i=new FileReader;i.onload=i=>{let n=i.target?.result;n?t((0,la.validateCsvContent)(n,{filename:e.name})):t({valid:!0})},i.onerror=()=>{t({valid:!0})},i.readAsText(e)})},lf=(0,R.customAlphabet)("1234567890abcdefghijklmnopqrstuvwxyz",16),lb=({focusInput:e,acceptedMimeTypes:t=lh,maxFiles:i=lm})=>{let n=(0,eu.useAppStore)(),a=(0,ln.useToast)(),r=(0,et.useRef)(new Map),o=(0,et.useRef)(!1),[s,l]=(0,et.useState)([]),c=(0,et.useCallback)(()=>{o.current=!0,r.current.forEach(e=>e.cancel()),r.current.clear(),l([])},[]),u=(0,et.useCallback)(e=>{let t=r.current.get(e);t&&(t.cancel(),r.current.delete(e)),l(t=>{let i=t.find(t=>t.id===e);return i?.isUploading&&i.src&&URL.revokeObjectURL(i.src),t.filter(t=>t.id!==e)})},[]);(0,et.useEffect)(()=>()=>{o.current=!0,r.current.forEach(e=>e.cancel()),r.current.clear()},[]);let p=s.some(e=>!!e.isUploading),h=(0,et.useCallback)(t=>{let c=(0,sC.selectFile)(n.getState()),p=(0,ax.getCurrentWorkspaceId)(),h=c?.workspace?.id||p;if(!h)return void console.error("Could not find current file's workspace id");if(0===t.length)return;let m=t.filter(ll);if(0===m.length)return;let g=i-s.length;if(g<=0)return void a({title:(0,d.jsx)(G.Trans,{message:"File upload limit reached",id:"ff3IAf"}),description:(0,d.jsx)(G.Trans,{message:"You can upload up to {maxFiles} files at once",id:"MrKfLe",values:{maxFiles:i}}),status:"warning",duration:3e3,isClosable:!0,position:"bottom-right"});let f=m.slice(0,g);e(),o.current=!1;let b=(e,t,i)=>{l(e=>[...e,t]);let n=(0,ld.uploadFile)(e,h,{onUploadComplete:e=>{r.current.delete(t.id),l(i=>i.map(i=>i.id===t.id?{...i,src:e.src,isUploading:!1}:i))},onUploadFailed:()=>{r.current.delete(t.id),u(t.id)}},"node",i);n&&r.current.set(t.id,n)};f.forEach(e=>{if(lo(e)){let t={id:lf(),src:"",name:e.name,mimeType:e.type,isUploading:!0,size:e.size};b(e,t,"importPdf")}else if(ls(e))lg(e).then(t=>{if(o.current)return;if(!t.valid)return void a({title:ee.i18n._({id:"C8ineB",message:"CSV file rejected"}),description:t.error,status:"error",duration:5e3,isClosable:!0,position:"bottom-right"});let i={id:lf(),src:"",name:e.name,mimeType:"text/csv",isUploading:!0,isCsv:!0,size:e.size};b(e,i,"importCsv")});else{let t=URL.createObjectURL(e),i={id:lf(),src:t,name:e.name,mimeType:e.type,isUploading:!0,size:e.size};l(e=>[...e,i]);let n=(0,ld.uploadFile)(e,h,{onUploadComplete:e=>{r.current.delete(i.id),URL.revokeObjectURL(t),l(t=>t.map(t=>t.id===i.id?{...t,src:e.src,isUploading:!1}:t))},onUploadFailed:()=>{r.current.delete(i.id),URL.revokeObjectURL(t),u(i.id)}},"node");n&&r.current.set(i.id,n)}})},[e,i,u,n,s.length,a]),{inputElement:m,onClick:g}=lu({handleFilesCallback:h,multiple:!0,accept:t.join(",")});return{uploadedFiles:s,hiddenFileInput:m,uploadFiles:h,openFilePicker:g,removeFile:u,resetFiles:c,isUploading:p}},lx=({uploadFiles:e,acceptedMimeTypes:t})=>({onPaste:(0,et.useCallback)(i=>{let n=i.clipboardData?.items;if(!n)return;let a=[];Array.from(n).forEach(e=>{if("file"===e.kind&&(t?t.some(t=>t.endsWith("/*")?e.type.startsWith(t.replace("/*","/")):e.type===t):e.type.startsWith("image/"))){let t=e.getAsFile();t&&a.push(t)}}),a.length>0&&(i.preventDefault(),e(a))},[e,t])}),ly=lp.useFileUploadDragAndDrop;e.s(["useChatFileUploadDragAndDrop",0,ly,"useChatFileUploadPaste",0,lx,"useChatFileUploads",0,lb],139809);var lv=e.i(49202);let lC=()=>(0,et.useCallback)(e=>{lv.TiptapEventBus.emit("queueBuddyEditMessage",e)},[]);e.s(["useSendQueuedBuddyMessage",0,lC],343094);var lw=e.i(399839);e.s(["BuddyChatUniInput",()=>dV],192984);var lS=e.i(970346),lk=e.i(864860),lA=e.i(147349),lE=e.i(654656),l_=e.i(98398),lI=e.i(498817),lM=e.i(7301),lT=e.i(24790),lL=e.i(818315),lj=e.i(704077),lP=e.i(75495),lD=e.i(575329),lN=e.i(775493),lR=e.i(588183),lO=e.i(751827),lB=e.i(963912),lz=e.i(382167),lF=e.i(550530),lH=e.i(85583),lW=e.i(131339),lU=e.i(524617);class lV{hasChanges=!1;duplicateCardIds=[];value=null;compute(e){let t,i,n=(t=[],i={tree:{},parents:{},treeArray:[]},e.doc.descendants((n,a)=>{if(!(0,ev.isCardNode)(n))return;let r=e.doc.resolve(a),o=n.attrs.id;t.push(o);let s=(0,ex.findParentNodes)(r,ev.isCardNode).reverse().map(({node:e})=>e.attrs.id),l=[...s,o];l.reduce((e,t)=>(e[t]=e[t]||{},e[t]),i.tree),i.parents[o]=s,l.reduce((e,t)=>{let i=e.find(e=>e.id===t);return i?i.children:(e.push({id:o,children:[]}),e)},i.treeArray)}),{cardIds:t,cardIdMap:i});(0,ak.default)(this.value,n)||(this.hasChanges=!0);let a=n.cardIds.filter(Boolean),r=a.filter((e,t)=>a.includes(e,t+1));return this.duplicateCardIds=r.filter(e=>!this.duplicateCardIds.includes(e)),this.value=n,this}apply(e,t){return e.docChanged&&this.compute(t),this}processChanges(e){this.hasChanges&&this.value&&e((0,ef.setCardIds)(this.value)),this.hasChanges=!1}}let lG=new el.PluginKey("cardIds"),l$=eE.Extension.create({name:"cardIds",priority:oE.ExtensionPriorityMap.CardIds,addOptions:()=>({enabled:!0}),addProseMirrorPlugins(){return this.options.enabled?[new el.Plugin({key:lG,state:{init:()=>new lV,apply:(e,t,i,n)=>t.apply(e,n)},appendTransaction:(e,t,i)=>{let n=lG.getState(i);if(!n?.value?.cardIds)return null;if(e.some(e=>e.docChanged)&&n.duplicateCardIds.length&&!this.editor.isThumbnail){let t={duplicateIds:JSON.stringify(n.duplicateCardIds),transactions:JSON.stringify(lZ(e)),isThumbnail:this.editor.isThumbnail};ei.analytics?.track(en.AppMonitoringEvents.DUPLICATE_CARD_IDS,{...t}),aS.captureException("[generateCardIdMap] Duplicate cardIds detected. This is unexpected and will cause spotlight issues. Additional metadata:",{extra:t})}return null}})]:[]}}),lZ=e=>e.map(e=>{let t=e.steps.map(e=>{if(e instanceof lU.ReplaceStep||e instanceof lU.ReplaceAroundStep){let t=e.slice.toJSON()?.content?.[0]||{},i={type:t.type,attrs:t.attrs,contentLength:t.content?.length};return{name:e.constructor.name,from:e.from,to:e.to,sliceContentSimple:i}}return e instanceof lU.AttrStep?{name:e.constructor.name,pos:e.pos,attr:e.attr}:{name:e.constructor.name}}),i=Object.fromEntries(Object.entries(e.meta).map(([e,t])=>"annotationEvent"===e?[e,{type:t.type,droppedBlockPos:t.droppedBlockPos,dragging:{inBlockLength:t.dragging?.inBlock?.length,inCardLength:t.dragging?.inCard?.length,origNodePos:t.dragging?.origNodePos}}]:"uiEvent"===e?[e,t]:[e,"object"==typeof t?"object":t]));return{stepsData:t,docChanged:e.docChanged,selection:{from:e.selection.from,to:e.selection.to},selectionSet:e.selectionSet,metaData:i}});e.s(["CardIdsExtension",0,l$,"CardIdsPluginKey",0,lG],729088);class lK{hasChanges=!1;value=null;compute(e){let t=e.firstChild;if(!t)return this;let i=t.attrs;return(0,ak.default)(i,this.value)||(this.hasChanges=!0),this.value=i,this}apply(e,t){return e.docChanged&&this.compute(e.doc),this}processChanges(e){this.hasChanges&&this.value&&e((0,ef.setDocAttrs)({docAttrs:this.value})),this.hasChanges=!1}}let lq=new el.PluginKey("documentAttrs"),lY=eE.Extension.create({name:"documentAttrs",addProseMirrorPlugins:()=>[new el.Plugin({key:lq,state:{init:()=>new lK,apply:(e,t,i,n)=>t.apply(e,n)}})]});function lX(e,t){let i=void 0===t?e.state.doc.firstChild?.content:e.state.doc.firstChild?.content.content[t];if(i)return(0,aG.contentToAiHtml)(e,i,{disableBookmarks:!0})}function lQ(e){let t=(0,ax.getCurrentUser)();if(!t||!e)return"";let i=Date.now(),n=i-36e5,a=new URLSearchParams({query:`@user.id:${t.id} resource_name:buddy-chat @docId:${e}`,agg_m:"count",agg_m_source:"base",agg_t:"count",cols:"core_service,core_resource_name,log_duration,log_http.method,log_http.status_code,%40input.content",fromUser:"false",graphType:"waterfall",historicalData:"true",messageDisplay:"inline",query_translation_version:"v0",shouldShowLegend:"true",sort:"desc",spanType:"all",spanViewType:"metadata",storage:"hot",traceQuery:"",view:"spans",start:n.toString(),end:i.toString(),paused:"true"});return`https://app.datadoghq.com/apm/traces?${a.toString()}`}function lJ(e){let t=(0,ax.getCurrentUser)();if(!t)return"";let i=Date.now(),n=i-36e5,a=new URLSearchParams({query:`@usr.id:${t.id} @logId:${e} @event:${en.AppMonitoringEvents.BUDDY_FEEDBACK_DEBUG}`,agg_m:"count",agg_m_source:"base",agg_t:"count",clustering_pattern_field_path:"message",cols:"host,service",messageDisplay:"inline",refresh_mode:"sliding",storage:"hot",stream_sort:"desc",viz:"stream",from_ts:n.toString(),to_ts:i.toString(),live:"true"});return`https://app.datadoghq.com/logs?${a.toString()}`}function l0(e){if(!e)return"";let t=(0,R.nanoid)(10),i=lX(e);return lH.datadogLogs.logger.info("[BUDDY] debug info",{content:i,event:en.AppMonitoringEvents.BUDDY_FEEDBACK_DEBUG,logId:t}),t}e.s(["DocumentAttrsExtension",0,lY,"DocumentAttrsPluginKey",0,lq],250332),e.s(["debugContentToAiHtml",0,lX,"initializeState",0,(e,t)=>{lq.getState(e.state)?.compute(e.state.doc).processChanges(t),lG.getState(e.state)?.compute(e.state).processChanges(t),e.commands.command(()=>((0,lW.setDefaultCardCollapse)(e.state.doc,t),!0))}],602235);let l1=({isOpen:e,onClose:t,docId:i,logId:n})=>{let a=lQ(i),r=lJ(n),o=(0,ln.useToast)(),s=(0,eu.useAppStore)(),[l,u]=(0,et.useState)(""),[p,h]=(0,et.useState)(!1),[m,g]=(0,et.useState)([]),f=(0,et.useCallback)(e=>{let t=(0,sC.selectFileWorkspace)(s.getState()),i=t?.id??(0,ax.getCurrentWorkspaceId)();i&&e.forEach(e=>{if(!e.type.startsWith("image/"))return;let t=(0,R.nanoid)(10),n=URL.createObjectURL(e);g(e=>[...e,{id:t,previewUrl:n,isUploading:!0}]),(0,ld.uploadFile)(e,i,{onUploadComplete:e=>{URL.revokeObjectURL(n),g(i=>i.map(i=>i.id===t?{...i,uploadedUrl:e.src,previewUrl:e.src,isUploading:!1}:i))},onUploadFailed:()=>{URL.revokeObjectURL(n),g(e=>e.filter(e=>e.id!==t)),o({title:"Screenshot upload failed",status:"error",position:"top",duration:3e3,isClosable:!0})}},"node")})},[s,o]),b=(0,et.useCallback)(e=>{g(t=>{let i=t.find(t=>t.id===e);return i?.isUploading&&i.previewUrl&&URL.revokeObjectURL(i.previewUrl),t.filter(t=>t.id!==e)})},[]),{inputElement:x,onClick:y}=lu({handleFilesCallback:f,multiple:!0,accept:"image/*"}),v=m.some(e=>e.isUploading),C=(0,et.useCallback)(async()=>{if(l.trim()){h(!0);try{let e=m.map(e=>e.uploadedUrl).filter(Boolean),n=await fetch(`${sJ.config.API_HOST}/ai/debug-feedback`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({notes:l,traceUrl:a||void 0,deckContentLogUrl:r||void 0,docId:i,screenshotUrls:e.length>0?e:void 0})});if(!n.ok)throw Error(`Server error: ${n.status}`);o({title:"Feedback sent to #buddy-feedback",status:"success",position:"top",duration:3e3,isClosable:!0}),u(""),g([]),t()}catch(e){o({title:"Failed to send feedback",description:e instanceof Error?e.message:"Unknown error",status:"error",position:"top",duration:5e3,isClosable:!0})}finally{h(!1)}}},[l,a,r,i,t,o,m]);return(0,d.jsxs)(lN.Modal,{isOpen:e,onClose:t,children:[(0,d.jsx)(lO.ModalOverlay,{}),(0,d.jsxs)(lR.ModalContent,{children:[(0,d.jsxs)(lD.ModalHeader,{children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faBug})," [EMPLOYEE ONLY] Buddy Feedback"]}),(0,d.jsx)(lj.ModalBody,{children:(0,d.jsxs)(nv.Stack,{spacing:3,children:[(0,d.jsx)(iZ.Text,{fontSize:"sm",children:"✏️ Describe the issue below. Debug info will be automatically included and sent to #buddy-feedback."}),(0,d.jsx)(lB.Textarea,{placeholder:"What went wrong? What did you expect?",size:"sm",rows:4,value:l,onChange:e=>u(e.target.value),autoFocus:!0}),x,(0,d.jsxs)(c.Box,{children:[(0,d.jsx)(V.Button,{size:"xs",variant:"ghost",leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faImage}),onClick:y,children:"Attach screenshots"}),m.length>0&&(0,d.jsx)(lF.Wrap,{mt:2,spacing:2,children:m.map(e=>(0,d.jsxs)(lF.WrapItem,{position:"relative",children:[(0,d.jsx)(lL.Image,{src:e.previewUrl,alt:"Screenshot",boxSize:"60px",objectFit:"cover",borderRadius:"md",opacity:e.isUploading?.5:1}),(0,d.jsx)(lT.CloseButton,{size:"sm",position:"absolute",top:"-1",insetEnd:"-1",bg:"gray.700",color:"white",borderRadius:"full",onClick:()=>b(e.id)})]},e.id))})]}),(0,d.jsxs)(nv.Stack,{borderColor:"gray.200",border:"1px solid",borderRadius:"md",p:2,spacing:1,children:[a&&(0,d.jsx)(iZ.Text,{maxW:"100%",overflow:"hidden",textOverflow:"ellipsis",noOfLines:1,fontSize:"xs",children:(0,d.jsx)(lz.Link,{href:a,target:"_blank",color:"blue.600",children:"🐶 Datadog Trace"})}),r&&(0,d.jsx)(iZ.Text,{maxW:"100%",overflow:"hidden",textOverflow:"ellipsis",noOfLines:1,fontSize:"xs",children:(0,d.jsx)(lz.Link,{href:r,target:"_blank",color:"blue.600",children:"🗂️Deck Content"})})]})]})}),(0,d.jsxs)(lP.ModalFooter,{children:[(0,d.jsx)(V.Button,{size:"sm",variant:"ghost",onClick:t,me:2,children:"Cancel"}),(0,d.jsx)(V.Button,{size:"sm",colorScheme:"blue",onClick:C,isLoading:p,isDisabled:!l.trim()||v,children:"Send to Slack"})]})]})]})};e.s(["BuddyBugModal",0,l1,"getBuddyTraceUrl",0,lQ,"getDeckContentLogUrl",0,lJ,"uploadDeckToDatadog",0,l0],707188);var l2=e.i(25747),l3=e.i(23917),l5=e.i(534904),l4=e.i(736386);let l6=({operation:e,handleQuickAction:t,...i})=>{let{openUpsellModal:n}=(0,l4.useMonetizationContext)(),a=(0,n_.useColorModeValue)({bg:"blackAlpha.100",color:"blue.950",sx:{"&:hover":{bg:"blackAlpha.300"},"&:disabled:hover":{bg:"blackAlpha.100"}},colorScheme:"blackAlpha"},{bg:"whiteAlpha.100",color:"whiteAlpha.800",sx:{"&:hover":{bg:"whiteAlpha.300"},"&:disabled:hover":{bg:"whiteAlpha.100"}},colorScheme:"whiteAlpha"}),r=(0,et.useMemo)(()=>!e.productFeature||(0,sk.getCanUseProductFeature)(e.productFeature),[e.productFeature]),o=(0,et.useCallback)(()=>{r?t(e):n({targetFeature:e.productFeature??"unlimited_credits",segmentEvent:e.upsellModalSegmentEvent||en.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_BUDDY_EDIT_CHAT,upsellLocation:e.upsellLocation||"credits.buddyEditChat"})},[r,t,n,e]);return(0,d.jsxs)(V.Button,{leftIcon:e.icon?(0,d.jsx)(N.FontAwesomeIcon,{icon:e.icon}):(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faSparkle}),onClick:o,borderRadius:"full",variant:"ghost",...a,size:"xs",isTruncated:!0,flexShrink:0,...i,children:[e.label(),e.productFeature&&!r&&(0,d.jsx)(l5.UpsellProductBadge,{productFeature:e.productFeature,canUseFeature:r,ms:2}),r&&e.creditCostType&&(0,d.jsx)(l3.CreditCostIcon,{type:e.creditCostType,colorScheme:"blackAlpha",color:"blackAlpha.600",fontSize:"xs",ms:2})]})},l9=({actionGroups:e,onQuickAction:t,wrapProps:i})=>{let{disabledReason:n}=li(),a=null!==n,r=lC(),o=(0,n_.useColorModeValue)(a?"gray.300":"gray.600",a?"gray.700":"gray.400"),s=(0,et.useCallback)(e=>{t?t(e):e.onQuickAction(r,e)},[t,r]);return(0,d.jsx)(d.Fragment,{children:e.map(e=>{let t=e.operations.filter(e=>!e.checkEnabled||e.checkEnabled());return 0===t.length?null:(0,d.jsxs)(nv.Stack,{children:[e.label&&(0,d.jsx)(iZ.Text,{fontSize:"xs",fontWeight:"semibold",color:o,children:e.label()}),(0,d.jsx)(lF.Wrap,{spacing:1.5,...i,children:t.map(e=>(0,d.jsx)(lF.WrapItem,{children:(0,d.jsx)(l6,{operation:e,handleQuickAction:s,disabled:a})},e.key))})]},e.key)})})};e.s(["BuddyQuickActionGroups",0,l9],394305);let l8=(0,et.createContext)({bottomInsetPx:0,setBottomInsetPx:()=>void 0,isInSheet:!1}),l7=()=>(0,et.useContext)(l8);e.s(["useSheetOcclusion",0,l7],948714);let de=()=>[{key:"research",icon:D.faSearch,title:(0,d.jsx)(G.Trans,{message:"Research",id:"EjSFZQ"}),description:(0,d.jsx)(G.Trans,{message:"Search the web, and pull in citations",id:"JSQfiS"}),operations:[{key:"add-evidence",label:()=>ee.i18n._({id:"B+T9Iu",message:"Add evidence from the web with citations"}),onQuickAction:e=>{e({message:ee.i18n._({id:"11uZc0",message:"Add supporting evidence or data points from credible sources on the web with citations. If you're not going to directly edit, offer me 2-3 concrete next steps to choose from."})})}},{key:"find-opposing-data",label:()=>ee.i18n._({id:"aDOMCy",message:"Find opposing data"}),onQuickAction:e=>{e({message:ee.i18n._({id:"ti8fJS",message:"Find opposing data points from credible sources on the web with citations. If you're not going to directly edit, offer me 2-3 concrete next steps to choose from."})})}},{key:"find-related-case-studies",label:()=>ee.i18n._({id:"SZDtf5",message:"Find related case studies"}),onQuickAction:e=>{e({message:ee.i18n._({id:"WWwmK1",message:"Find competitor examples and related case studies from credible sources on the web with citations. If you're not going to directly edit, offer me 2-3 concrete next steps to choose from."})})}}]},{key:"refine",icon:D.faFeather,title:(0,d.jsx)(G.Trans,{message:"Refine",id:"OVxbCx"}),description:(0,d.jsx)(G.Trans,{message:"Strengthen arguments, structure, and polish",id:"j6aXEY"}),operations:[{key:"spot-weak-arguments",label:()=>ee.i18n._({id:"F/ErIP",message:"Spot weak arguments and suggest solutions"}),onQuickAction:e=>{e({message:ee.i18n._({id:"zATYnM",message:"Spot weak arguments and strengthen my logic. If you're going to add evidence, only add facts from credible sources with citations. If you're not going to directly edit, offer me 2-3 concrete next steps to choose from."})})}},{key:"add-executive-summary",label:()=>ee.i18n._({id:"UhEWCe",message:"Add an executive summary"}),onQuickAction:e=>{e({message:ee.i18n._({id:"F7Lf+a",message:"Add a concise and scannable executive summary to the beginning right after the title card"})})}},{key:"add-more-cards",label:()=>ee.i18n._({id:"qJsz/J",message:"Add 2 more cards"}),onQuickAction:e=>{e({message:ee.i18n._({id:"U4sGTF",message:"Add 2 more cards to expand and deepen the content. Make them relevant to the existing material."})})}},{key:"find-fix-typos",label:()=>ee.i18n._({id:"tUnhM5",message:"Find and fix typos"}),onQuickAction:e=>{e({message:ee.i18n._({id:"6W2bAf",message:"Find and fix typos and grammatical errors. Only fix them if you can find any."})})}}]},{key:"restyle",icon:D.faPalette,title:(0,d.jsx)(G.Trans,{message:"Restyle",id:"06QchB"}),description:(0,d.jsx)(G.Trans,{message:"Transform your entire deck's look with a simple request",id:"L1+Y4n"}),operations:[{key:"recommend-theme",label:()=>ee.i18n._({id:"n1G/3U",message:"Recommend a theme based on my content"}),onQuickAction:e=>{e({message:ee.i18n._({id:"VupN4Y",message:"Recommend and apply a theme that matches the content and tone"})})}},{key:"move-accent-images-to-left",label:()=>ee.i18n._({id:"gP7jlg",message:"Move all accent images to the left"}),onQuickAction:e=>{e({message:ee.i18n._({id:"eqyQ8K",message:"Move all accent images to the left"})})}},{key:"visualize-text-heavy-cards",label:()=>ee.i18n._({id:"iq/+ac",message:"Visualize text-heavy cards"}),onQuickAction:e=>{e({message:ee.i18n._({id:"X1e29T",message:"Replace text blocks in text-heavy cards with: bullet points, charts, icons, or diagrams to make the content more digestible"})})}}]}],dt=({onSuggestionSelect:e})=>{let t=lC(),i=(0,et.useCallback)(i=>{i.onQuickAction(t,i),e()},[e,t]),n=(0,n_.useColorModeValue)("gray.200","gray.600"),a=(0,n_.useColorModeValue)("gray.900","gray.300"),r=(0,n_.useColorModeValue)("gray.600","gray.500"),o=(0,et.useMemo)(()=>de(),[]);return(0,d.jsx)(nv.Stack,{spacing:2,divider:(0,d.jsx)(nc.Divider,{borderColor:n}),children:o.map(({key:e,icon:t,title:n,description:o,operations:s})=>(0,d.jsxs)(nv.Stack,{p:2,spacing:3,children:[(0,d.jsxs)(nv.Stack,{spacing:1,children:[(0,d.jsxs)(K.HStack,{color:a,spacing:1,alignItems:"center",children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:t,fixedWidth:!0,size:"sm"}),(0,d.jsx)(iZ.Text,{fontSize:"xs",fontWeight:"bold",children:n})]}),(0,d.jsx)(iZ.Text,{fontSize:"xs",color:r,children:o})]}),(0,d.jsx)(l9,{actionGroups:[{key:e,operations:s}],onQuickAction:i})]},e))})},di=({isDisabled:e})=>{let{isOpen:t,onOpen:i,onClose:n}=(0,at.useDisclosure)(),a=(0,n_.useColorModeValue)(void 0,"gray.600"),{isInSheet:r}=l7(),o=(0,d.jsx)(X.PopoverContent,{minW:{base:"min(100vw - 16px, 380px)",md:"380px"},p:0,borderColor:a,children:(0,d.jsx)(s3.PopoverBody,{p:2,children:(0,d.jsx)(dt,{onSuggestionSelect:n})})});return(0,d.jsxs)(q.Popover,{placement:r?"top-end":"bottom-end",strategy:r?"absolute":"fixed",isOpen:t,onOpen:i,onClose:n,children:[(0,d.jsx)(s5.PopoverTrigger,{children:(0,d.jsx)(V.Button,{size:"xs",variant:"plain",leftIcon:(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faSparkles}),isDisabled:e,children:(0,d.jsx)(G.Trans,{message:"Quick edits",id:"o+CsiR"})})}),r?o:(0,d.jsx)(Q.Portal,{children:o})]})};e.s(["BuddyChatSuggestionsPopover",0,di,"getCategorizedChatSuggestions",0,de],263582);var dn=e.i(809701),da=e.i(707065);let dr=da.keyframes` 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-3px) } 40% { transform: translateX(3px) } 60% { transform: translateX(-2px) } 80% { transform: translateX(2px) } `,ds={1:[0],2:[-10,12],3:[-10,12,-4],4:[-12,4,16,-8]},dl={1:[0],2:[5,-2],3:[3,0,0],4:[2,4,4,0]},dd={1:[0],2:[2,20],3:[1,6,6],4:[11,0,16,4]},dc=({images:e,selectionLimitHit:t,goTo:i,onKeyDown:n,ref:a})=>{let r=(0,n_.useColorModeValue)("blue.50","gray.600"),o=(0,n_.useColorModeValue)("blue.600","blue.300"),s=e.length;if(0===s)return null;let l=3===s||4===s,u=4===s?3:3===s?2:s,p=(56+(u-1)*12)/u*(s>=3?.95:1),h=ds[s]||ds[3],m=dl[s]||dl[3],g=dd[s]||dd[3];return(0,d.jsx)(eh.GammaTooltip,{label:ee.i18n._({id:"RMuCMb",message:"Max 4 at a time — make 'em count!"}),isOpen:t,placement:"top",children:(0,d.jsx)(lE.VStack,{ref:a,spacing:1,align:"flex-start",w:"56px",flexShrink:0,tabIndex:0,cursor:"pointer",borderRadius:"md",onKeyDown:n,_focus:{outline:"2px solid",outlineColor:o,borderRadius:"md"},onClick:i,animation:t?`${dr} 0.4s ease-in-out`:void 0,children:(0,d.jsx)(c.Box,{w:"56px",h:"56px",position:"relative",isolation:"isolate",children:e.map((t,i)=>(0,d.jsx)(c.Box,{position:"absolute",top:l&&i===s-1?56-p-6:0,h:`${p}px`,zIndex:e.length-i,transformOrigin:"center bottom",transition:"all 0.3s cubic-bezier(0.34, 1.2, 0.64, 1)",style:{insetInlineStart:l&&i===s-1?(56-p)/2:i*(p-12),width:p,transform:`rotate(${h[i]??0}deg) translate(${m[i]??0}px, ${g[i]??0}px)`},children:(0,d.jsx)(dn.Tooltip,{label:t.label,placement:"top",hasArrow:!0,children:(0,d.jsxs)(c.Box,{position:"relative",w:"100%",h:"100%",children:[t.url?(0,d.jsx)(lL.Image,{src:t.url,alt:t.label,w:"100%",h:"100%",objectFit:"cover",borderRadius:"md",border:"2px solid",borderColor:r,shadow:"md",bg:"gray.100",opacity:t.isLoading?.6:1}):(0,d.jsx)(c.Box,{w:"100%",h:"100%",borderRadius:"md",border:"2px solid",borderColor:r,shadow:"md",bg:"gray.100"}),t.isLoading&&(0,d.jsx)(c.Box,{position:"absolute",inset:0,display:"flex",justifyContent:"center",alignItems:"center",children:(0,d.jsx)(lA.Spinner,{size:"sm",color:"blue.900"})})]})})},t.id))})})})},du=(0,et.memo)(({onClick:e})=>(0,d.jsx)(n8.IconButton,{position:"absolute",top:"-12px",insetEnd:"-12px",boxSize:6,size:"xs",minW:"auto",p:0,opacity:0,_groupHover:{opacity:1,pointerEvents:"auto"},pointerEvents:"none",tabIndex:-1,transitionProperty:"common",transitionDuration:"normal",borderRadius:"full",borderColor:"transparent",boxShadow:"md","aria-label":ee.i18n._({id:"iVDkQl",message:"Remove selected image"}),icon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faXmark,fontSize:"14px"}),onClick:e}));du.displayName="CloseButton";let dp=({editorSelection:e,onKeyDown:t,selectionLimitHit:i,ref:n})=>{let a={bg:(0,n_.useColorModeValue)("blue.50","gray.600")},r=(0,n_.useColorModeValue)("blue.800","blue.50"),o=(0,n_.useColorModeValue)("white","elevation.5"),s=(0,n_.useColorModeValue)("blue.600","blue.300");return e?"image"===e.type?(0,d.jsx)(d.Fragment,{children:(0,d.jsxs)(c.Box,{ref:n,position:"relative",role:"group",tabIndex:0,onKeyDown:t,_focus:{outline:"2px solid",outlineColor:s,borderRadius:"md"},children:[(0,d.jsx)(W.ImageOrVideo,{draggable:!1,cursor:"pointer",src:e.attrs.src||void 0,alt:ee.i18n._({id:"i5qRUs",message:"the selected image"}),w:14,h:14,objectFit:"cover",borderRadius:"md",border:"2px solid",borderColor:a.bg,shadow:"md",bg:"gray.100",onMouseDown:e=>{e.preventDefault()},onClick:e.goTo}),(0,d.jsx)(du,{onClick:e.remove})]})}):"text"===e.type&&e.text.length>0?(0,d.jsxs)(c.Box,{position:"relative",role:"group",children:[(0,d.jsx)(c.Box,{ref:n,w:20,p:"0.375rem",fontSize:".6rem",lineHeight:".75rem",borderRadius:"md",border:"2px solid",borderColor:a.bg,shadow:"md",bg:o,onMouseDown:e=>{e.preventDefault()},onClick:e.goTo,cursor:"pointer",tabIndex:0,onKeyDown:t,_focus:{outline:"2px solid",outlineColor:s,borderRadius:"md"},children:(0,d.jsx)(iZ.Text,{fontSize:"xs",noOfLines:2,wordBreak:"break-all",color:r,children:e.text.slice(0,50)})}),(0,d.jsx)(du,{onClick:e.remove})]}):"images"===e.type&&e.images.length>0?(0,d.jsxs)(c.Box,{position:"relative",role:"group",children:[(0,d.jsx)(dc,{ref:n,images:e.images,selectionLimitHit:i,goTo:e.goTo,onKeyDown:t}),(0,d.jsx)(du,{onClick:e.remove})]}):null:null};var dh=e.i(865799),dm=e.i(96095),dg=e.i(198311);e.s([],297036);var df=e.i(275561);let db=(0,df.createIcon)({d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z",displayName:"ChevronLeftIcon"}),dx=(0,df.createIcon)({d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",displayName:"ChevronRightIcon"});var dy=e.i(70940),dv=e.i(507535);e.i(312434);var dC=e.i(487914),dw=e.i(650292);let dS={type:"spring",duration:.5,bounce:0},dk=(0,y.isMobileDevice)()?"0.75rem":"2.5rem";var dA=e.i(746706),dE=e.i(28561);e.i(420945);var d_=e.i(33823),dI=e.i(328573),dM=e.i(422583),dT=e.i(392164);let dL=(0,dg.motion)(c.Box),dj=({children:e,isZoomed:t,exitZoom:i,editor:n})=>{let a=(0,d_.useDispatch)(),r=(()=>{let e=(0,eu.useAppSelector)(dT.selectPreviewEnabled),{inPreviewContext:t}=(0,dM.usePreviewContext)();return e&&!t})();(0,et.useEffect)(()=>{if(!r)return dC.keyboardHandler.on("keydown","ZOOMABLE_OVERLAY",e=>t&&["ArrowDown","ArrowUp"].includes(e.key)?(e.preventDefault(),!0):!!((0,dE.isHotkey)("Esc")(e)||(0,dE.isHotkey)("Enter")(e))&&!!t&&(i(),e.preventDefault(),e.stopPropagation(),!0))},[i,t,r]),(0,et.useEffect)(()=>{r||a((0,dI.setModalOpen)({id:"zoomableOverlay",isOpen:t}))},[a,t,r]);let o=(0,et.useRef)(null);return((0,ay.useEffectWhen)(()=>{n?.isEditable&&(t?o.current?.focus():n.commands.focus())},[n,t],[t],!1),r)?null:(0,d.jsx)(Q.Portal,{children:t&&(0,d.jsxs)(c.Box,{position:"fixed",inset:0,padding:dk,zIndex:"modal",userSelect:"none",onClick:e=>{!(0,y.isMobileOrTabletDevice)()&&(e.target.closest(".image")||e.target.closest("[data-carousel-filmstrip]")||i())},onMouseDown:nL.preventDefaultToAvoidBlur,"data-in-editor-focus":!0,"data-testid":"zoomable-overlay",children:[(0,d.jsx)(dL,{position:"absolute",inset:0,initial:{opacity:0},animate:{opacity:(0,y.isMobileDevice)()?.9:.86},transition:dS,backgroundColor:"black"},"shade"),(0,d.jsx)(c.Box,{position:"absolute",right:2,top:2,zIndex:"docked",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,d.jsx)(n8.IconButton,{"aria-label":ee.i18n._({id:"8qZ5De",message:"Close zoom"}),colorScheme:"whiteAlpha",color:"whiteAlpha.800",size:"md",onClick:i,onMouseDown:nL.preventDefaultToAvoidBlur,icon:(0,d.jsx)(dA.CloseIcon,{}),variant:"ghost",className:"exit-button",ref:o})}),(0,d.jsx)(u.Flex,{position:"relative",zIndex:"1",h:"100%",w:"100%",pt:"2.8rem",align:"center",justify:"center",direction:"column",css:{"--overlay-maxH":`calc(100vh - 2 * ${dk})`,"--overlay-maxW":`calc(100vw - 2 * ${dk})`,"--media-maxH":"var(--overlay-maxH)","--media-maxW":"var(--overlay-maxW)"},children:e})]})})};e.s(["ZoomableOverlay",0,dj],753128);let dP=(0,dg.motion)(u.Flex),dD="80px";e.s(["ZoomableCarousel",0,({children:e,zoomedId:t,isZoomComplete:i,setZoomedId:n,isZoomed:a,exitZoom:r,editor:o})=>{let s=(0,dy.default)(e,e=>e.id===t),l=e[s],p=(0,et.useRef)(null),h=(0,et.useCallback)(()=>{n((e[s+1]||e[0]).id)},[s,e,n]),m=(0,et.useCallback)(()=>{n((e[s-1]||(0,dv.default)(e)).id)},[s,e,n]);return((0,et.useEffect)(()=>{if(a&&!(e.length<2))return dC.keyboardHandler.on("keydown","ZOOMABLE_OVERLAY",e=>{switch(e.key){case"ArrowLeft":return m(),!0;case"ArrowRight":return h(),!0;default:return!1}})},[r,a,n,e,s,h,m]),(0,et.useEffect)(()=>{if(p.current&&i){let e=p.current.querySelector(`[data-thumb-id="${t}"]`);e?.scrollIntoView({inline:"center",behavior:"smooth"})}},[t,i]),dw.isPuppeteer)?null:(0,d.jsxs)(dj,{isZoomed:a,exitZoom:r,editor:o,children:[(0,d.jsx)(u.Flex,{flex:1,w:"100%",justify:"center",align:"center","data-testid":"zoomable-carousel-expanded",pos:"relative",children:(0,d.jsx)(lI.AnimatePresence,{children:l&&(0,d.jsx)(dP,{css:{"--media-maxH":`calc(var(--overlay-maxH) - ${dD} - ${dk})`},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},position:"absolute",transition:dS,w:"100%",h:"100%",children:l.full},l.id)})}),e.length>1&&(0,d.jsx)(K.HStack,{w:"100vw",mt:dk,px:dk,gap:0,"data-carousel-filmstrip":!0,children:(0,d.jsxs)(u.Flex,{overflowX:"auto",width:"100%",justify:"center",align:"stretch",overflow:"hidden",children:[(0,d.jsx)(n8.IconButton,{icon:(0,d.jsx)(db,{boxSize:"24px"}),"aria-label":ee.i18n._({id:"MHk+7g",message:"Previous image"}),colorScheme:"whiteAlpha",variant:"ghost",size:"md",color:"whiteAlpha.900",borderColor:"whiteAlpha.200",borderWidth:"2px",borderStyle:"solid",onClick:m,_hover:{bg:"whiteAlpha.200",borderColor:"whiteAlpha.400"},h:"auto",mr:2}),(0,d.jsx)(K.HStack,{spacing:1,onClick:nL.stopPropagation,"data-testid":"zoomable-carousel-thumbnails",ref:p,overflow:"scroll",sx:{"::-webkit-scrollbar":{display:"none"}},children:e.map(e=>{let i=e.id===t;return(0,d.jsx)(c.Box,{border:i?"2px solid white":"2px solid transparent",boxSizing:"content-box",borderRadius:"md",overflow:"hidden",onClick:()=>n(e.id),transitionProperty:"border",transitionDuration:"normal",h:dD,css:{"--media-maxH":dD,"--media-maxW":"200px",flexShrink:0},"data-thumb-id":e.id,cursor:"pointer",padding:"2px",_hover:{borderColor:!i&&"whiteAlpha.500"},children:(0,d.jsx)(c.Box,{w:"100%",h:"100%",borderRadius:"sm",overflow:"hidden",children:e.thumbnail})},e.id)})}),(0,d.jsx)(n8.IconButton,{icon:(0,d.jsx)(dx,{boxSize:"24px"}),"aria-label":ee.i18n._({id:"EatZYJ",message:"Next image"}),colorScheme:"whiteAlpha",variant:"ghost",size:"md",color:"whiteAlpha.900",borderColor:"whiteAlpha.200",borderWidth:"2px",borderStyle:"solid",onClick:h,_hover:{bg:"whiteAlpha.200",borderColor:"whiteAlpha.400"},h:"auto",ml:2})]})})]})}],811477),e.s(["ClickCapture",()=>dR,"ZoomClickCapture",()=>dN],471194);let dN=({enterZoom:e,doubleClickNonZoomHandler:t,...i})=>{let n=(0,eu.useAppSelector)(ef.selectEditable),a=!n,r=n&&!t;return sJ.config.GAMMA_PUPPETEER_SERVICE?null:(0,d.jsx)(c.Box,{inset:0,w:"100%",h:"100%",position:"absolute",zIndex:1,cursor:a?"zoom-in":"default",onDoubleClick:r?e:t,onClick:a?e:void 0,"data-testid":"zoom-click-capture","data-zoom-click-capture":!0,draggable:n,opacity:0,...i})},dR=({decorations:e,node:t,editor:i})=>{let n=eN(e)||!(0,ex.editorHasFocus)(i),a=(0,eu.useAppSelector)(ef.selectEditable),{displayStyle:r}=t.attrs;return(0,d.jsx)(c.Box,{position:"absolute",inset:0,zIndex:1,pointerEvents:a&&!n&&"inline"===r?"auto":"none",cursor:"default"})},dO=e=>{let t=(0,d_.useDispatch)(),i=(0,eu.useAppSelector)(t=>!!e&&(0,ef.selectExpandedMediaId)(t)===e),n=(0,et.useCallback)(i=>{t((0,ef.setMediaNodeExpanded)({nodeId:i?e:null}))},[t,e]),a=(0,et.useCallback)(()=>n(!0),[n]),r=(0,et.useCallback)(()=>n(!1),[n]);return{isZoomed:i,setIsZoomed:n,enterZoom:a,exitZoom:r}};e.s(["useCarouselZoom",0,e=>{let t=(0,d_.useDispatch)(),i=(0,eu.useAppSelector)(t=>{let i=(0,ef.selectExpandedMediaId)(t);return i&&e.includes(i)?i:null}),n=!!i,a=(0,et.useCallback)(e=>{t((0,ef.setMediaNodeExpanded)({nodeId:e}))},[t]),r=(0,et.useCallback)(()=>a(null),[a]),[o,s]=(0,et.useState)(n);return(0,et.useEffect)(()=>{let e;return n?e=window.setTimeout(()=>{s(!0)},1e3*dS.duration):s(!1),()=>clearTimeout(e)},[n]),{isZoomed:n,isZoomComplete:o,zoomedId:i,setZoomedId:a,exitZoom:r}},"useMediaZoom",0,dO],534316);var dB=e.i(669288);let dz=({children:e,label:t,icon:i,isCollapsedByDefault:n=!1,...a})=>{let[r,o]=(0,et.useState)(!n),[s,l]=(0,et.useState)(!1),p=(0,ec.useRtlEnabled)(),h=(0,et.useRef)(null),m=(0,et.useCallback)(()=>{let e=h.current;if(!e)return;let{scrollLeft:t,scrollWidth:i,clientWidth:n}=e,a=i-n;l(p?t<=-a:t>=a)},[l,p]),g=(0,et.useCallback)(()=>{o(e=>!e)},[o]),f=(0,n_.useColorModeValue)("white","elevation.3"),b=(0,n_.useColorModeValue)("gray.200","gray.600"),x=(0,n_.useColorModeValue)("gray.600","gray.300"),y=(0,n_.useColorModeValue)("rgba(255,255,255,1)","var(--chakra-colors-elevation-3z)"),v=(0,n_.useColorModeValue)("rgba(255,255,255,0)","rgba(26, 27, 29, 0.00)");return(0,d.jsxs)(nv.Stack,{spacing:0,p:2,bgColor:f,border:"1px solid",borderColor:b,borderRadius:"md",...a,children:[(0,d.jsxs)(K.HStack,{as:V.Button,spacing:1.5,variant:"unstyled",h:"auto",fontWeight:"normal",color:x,onClick:g,children:[(0,d.jsx)(N.FontAwesomeIcon,{size:"sm",icon:i}),(0,d.jsx)(iZ.Text,{as:"span",fontSize:"sm",children:t}),(0,d.jsx)(c.Box,{as:"span",transform:r?"rotate(-180deg)":void 0,transition:"transform 0.2s",transformOrigin:"center",cursor:"pointer",marginStart:"auto",children:(0,d.jsx)(N.FontAwesomeIcon,{size:"sm",icon:D.faChevronDown})})]}),(0,d.jsx)(lS.Collapse,{in:r,children:(0,d.jsxs)(c.Box,{position:"relative",children:[(0,d.jsx)(K.HStack,{as:dg.motion.div,layout:!0,opacity:+!!r,spacing:2,pt:2,overflowX:"auto",ref:h,onScroll:m,children:(0,d.jsx)(lI.AnimatePresence,{initial:!1,children:e})}),(0,d.jsx)(u.Flex,{position:"absolute",zIndex:1,pointerEvents:"none",opacity:+!s,transitionProperty:"opacity",transitionDuration:"normal",top:0,insetEnd:0,bottom:0,w:4,bg:p?`linear-gradient(90deg, ${y} 50%, ${v} 100%)`:`linear-gradient(-90deg, ${y} 50%, ${v} 100%)`})]})})]})};e.s(["CollapsibleMediaRowWrapper",0,dz],321791);let dF=(0,dg.motion)(c.Box),dH=({file:e,removeFile:t,boxSize:i})=>{let{isZoomed:n,enterZoom:a,exitZoom:r}=dO(e.id),o=(0,n_.useColorModeValue)("gray.50","gray.700"),s=(0,n_.useColorModeValue)("gray.200","gray.600"),l=(0,dB.isImageFile)(e.mimeType,e.name),p=(0,et.useCallback)(()=>{l&&!e.isUploading&&a()},[l,e.isUploading,a]);return(0,d.jsxs)(dF,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},position:"relative",role:"group",flexShrink:0,children:[l?(0,d.jsx)(c.Box,{position:"relative",children:e.isUploading?(0,d.jsxs)(u.Flex,{boxSize:i,borderRadius:"md",border:"1px solid",borderColor:s,bg:o,direction:"column",justify:"flex-start",p:2,children:[(0,d.jsx)(dm.Skeleton,{"data-testid":"buddy-upload-skeleton",h:"8px",w:"75%",borderRadius:"sm",startColor:"gray.100",endColor:"gray.300"}),(0,d.jsx)(dm.Skeleton,{h:"8px",w:"50%",borderRadius:"sm",mt:2,startColor:"gray.100",endColor:"gray.300"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(lL.Image,{src:(0,W.resizeAndProxyImageUrl)(e.src,W.THUMBNAIL_RESIZE_PARAMS),fallbackSrc:e.src,alt:e.name,boxSize:i,objectFit:"cover",borderRadius:"md",border:"1px solid",borderColor:"gray.200",cursor:"zoom-in",onClick:p}),(0,d.jsx)(dj,{isZoomed:n,exitZoom:r,editor:null,children:(0,d.jsx)(u.Flex,{justify:"center",align:"center",h:"100%",w:"100%",children:(0,d.jsx)(lL.Image,{src:e.src,alt:e.name,maxW:"90vw",maxH:"90vh",objectFit:"contain"})})})]})}):(0,d.jsx)(u.Flex,{boxSize:i,borderRadius:"md",border:"1px solid",borderColor:s,bg:o,display:"flex",flexDir:"column",justifyContent:e.isUploading?"flex-start":void 0,p:2,children:e.isUploading?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(dm.Skeleton,{"data-testid":"buddy-upload-skeleton",h:"8px",w:"75%",borderRadius:"sm",startColor:"gray.100",endColor:"gray.300"}),(0,d.jsx)(dm.Skeleton,{h:"8px",w:"50%",borderRadius:"sm",mt:2,startColor:"gray.100",endColor:"gray.300"})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(iZ.Text,{fontSize:"xxs",fontWeight:"semibold",noOfLines:1,children:e.name}),(0,d.jsx)(iZ.Text,{fontSize:"xxs",mt:0,color:"gray.600",children:(0,dB.formatBytes)(e.size||0,0)}),(0,d.jsx)(lk.Spacer,{}),(0,d.jsx)(K.HStack,{children:(0,d.jsx)(dh.Badge,{fontSize:"xxs",colorScheme:"gray",children:(0,dB.getDocumentTypeLabel)(e.mimeType,e.name)})})]})}),(0,d.jsx)(n8.IconButton,{opacity:0,_groupHover:{opacity:1},transitionProperty:"common",transitionDuration:"normal",position:"absolute",top:"-6px",insetEnd:"-6px",size:"xs",onClick:()=>t(e.id),"aria-label":ee.i18n._({id:"cILfnJ",message:"Remove file"}),icon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faXmark})})]})},dW=({uploadedFiles:e,removeFile:t,boxSize:i,...n})=>0===e.length?null:(0,d.jsx)(dz,{label:(0,d.jsx)(G.Trans,{message:"{0, plural, one {# file attached} other {# files attached}}",id:"XaxFx6",values:{0:e.length}}),icon:D.faPaperclip,...n,children:e.map(e=>(0,d.jsx)(dH,{file:e,removeFile:t,boxSize:i},e.id))}),dU=({isLoading:e,handleSubmit:t,handleStop:i,canStop:n,isDisabled:a,...r})=>(0,d.jsxs)(u.Flex,{...r,children:[(0,d.jsx)(lA.Spinner,{boxSize:6,position:"absolute",zIndex:10,pointerEvents:"none",color:"blue.950",opacity:+!!e,transitionProperty:"common",transitionDuration:"normal"}),(0,d.jsx)(eh.GammaTooltip,{placement:"top",label:n?(0,d.jsx)(lE.VStack,{spacing:0,children:(0,d.jsx)(G.Trans,{message:"Stop",id:"ygCKqB"})}):(0,d.jsxs)(lE.VStack,{spacing:0,children:[(0,d.jsx)(G.Trans,{message:"Send to AI",id:"9p1o+z"}),(0,d.jsx)(l_.ShortcutText,{shortcut:"Enter"})]}),children:(0,d.jsx)(n8.IconButton,{size:"xs",icon:n?(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faStop}):(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faPaperPlaneTop}),isDisabled:a,"aria-label":ee.i18n._({id:"hQRttt",message:"Submit"}),"data-testid":"buddy-chat-submit-button","data-loading":e?"true":"false",onClick:e=>{if(n){e.stopPropagation(),i?.();return}t()}})})]}),dV=({placeholder:e,onSubmit:t,onStop:i,inputRef:n,input:a,setInput:r,onUploadClick:o,isLoading:s,canStop:l,uploadedFiles:p,uploadFiles:h,removeFile:m,canSubmit:g,editor:f,isDisabled:b,actionGroups:x,onQuickAction:y,showChatSuggestions:v=!1,acceptedMimeTypes:C,editorSelection:w,selectionLimitHit:S,onKeyDown:k,customInput:A,beforeControls:E,flatFileUploads:_,animatedTextarea:I})=>{let M=(0,n_.useColorModeValue)("blue.100","gray.700"),T=(0,n_.useColorModeValue)("gray.200","gray.800"),[L,j]=(0,et.useState)(""),{isGammaOrgUser:P}=(0,l2.useUserContext)(),{isOpen:R,onOpen:O,onClose:B}=(0,at.useDisclosure)(),z=(0,et.useCallback)(()=>{f&&(j(l0(f)),O())},[O,f]),F=(0,n_.useColorModeValue)("blue.600","blue.300"),H=(0,n_.useColorModeValue)("white","elevation.1"),W=(0,n_.useColorModeValue)("rgba(255, 255, 255, 0.8)","rgba(0, 0, 0, 0.8)"),U=ee.i18n._({id:"OHwVfR",message:"Drop files here"}),V=(0,eu.useAppSelector)(sC.selectDocId),$=(0,et.useRef)(null),Z=(0,et.useMemo)(()=>w?{...w,remove:()=>{w.remove(),n.current?.focus()}}:null,[w,n]),{onPaste:q}=lx({uploadFiles:h,acceptedMimeTypes:C}),{...Y}=ly({uploadFiles:h,acceptedMimeTypes:C});return(0,d.jsxs)(u.Flex,{as:"form",onSubmit:e=>{e.preventDefault(),g&&t()},direction:"column",children:[(0,d.jsx)(l1,{isOpen:R,onClose:B,docId:V,logId:L}),(0,d.jsx)(nv.Stack,{spacing:0,children:(0,d.jsx)(nv.Stack,{...Y,spacing:1,position:"relative",borderRadius:"xl",border:"2px solid",borderColor:b?T:M,transitionDuration:"normal",transitionProperty:"border-color","data-drop-text":U,sx:{"&:focus-within":{borderColor:F,boxShadow:"md"},"&.is-dragging-over":{"&::before":{content:"attr(data-drop-text)",position:"absolute",inset:0,bg:W,backdropFilter:"blur(8px)",borderRadius:"xl",pointerEvents:"none",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center",fontSize:"lg",fontWeight:"semibold",color:"blue.600"}}},bg:H,children:(0,d.jsxs)(c.Box,{borderRadius:"md",border:"none",p:2,pt:2,position:"relative",children:[(0,d.jsxs)(K.HStack,{alignItems:"top",children:[Z&&(0,d.jsx)(dp,{ref:$,editorSelection:Z,selectionLimitHit:S,onKeyDown:e=>{"Delete"===e.key||"Backspace"===e.key?(e.preventDefault(),Z.remove()):"ArrowRight"===e.key&&(e.preventDefault(),n.current?.focus())}}),(0,d.jsx)(c.Box,{position:"relative",flex:1,onPaste:q,children:A||(0,d.jsx)(lM.ResizingTextarea,{ref:n,placeholder:e||ee.i18n._({id:"xOHKQG",message:"What do you want to do?"}),value:a,onChange:e=>r(e.target.value),onKeyDown:e=>{k?.(e),!e.defaultPrevented&&("Enter"!==e.key||e.shiftKey?("Backspace"===e.key||"ArrowLeft"===e.key)&&""===a&&Z&&$.current?(e.preventDefault(),$.current.focus()):"Escape"===e.key&&s&&i&&(i(),e.preventDefault(),e.stopPropagation()):(e.preventDefault(),e.currentTarget.form?.requestSubmit()))},onMouseDown:nL.stopPropagation,initialHeight:"30px",resizeOnMount:!1,animated:I,fontSize:"sm",m:0,p:0,maxHeight:"16rem",overflowY:"auto",borderRadius:"none",border:"none",sx:{"&:focus":{border:"none",outline:"none",boxShadow:"none"},"&:disabled, &:disabled:hover":{bg:"transparent"}},bg:H,_hover:{bg:"transparent"},_focus:{bg:"transparent"},isDisabled:b})})]}),x&&x.length>0&&(0,d.jsx)(c.Box,{my:2,children:(0,d.jsx)(l9,{actionGroups:x,onQuickAction:y})}),_?p.length>0&&(0,d.jsx)(K.HStack,{my:"12px",spacing:2,flexWrap:"wrap",children:(0,d.jsx)(lI.AnimatePresence,{initial:!1,children:p.map(e=>(0,d.jsx)(dH,{file:e,removeFile:m,boxSize:"4.5rem"},e.id))})}):(0,d.jsx)(lS.Collapse,{in:p.length>0,animateOpacity:!0,children:(0,d.jsx)(dW,{uploadedFiles:p,removeFile:m,my:2,boxSize:"4.5rem"})}),E,(0,d.jsxs)(K.HStack,{mt:2,zIndex:1,h:8,children:[(0,d.jsx)(eh.GammaTooltip,{label:(0,d.jsx)(G.Trans,{message:"Upload",id:"ONWvwQ"}),isDisabled:b,placement:"top",children:(0,d.jsx)(n8.IconButton,{colorScheme:"gray","aria-label":"Upload files","data-testid":"buddy-chat-upload-button",size:"xs",icon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faPlus}),onClick:o,isDisabled:b})}),v&&(0,d.jsx)(di,{isDisabled:!!b}),P&&f&&(0,d.jsx)(eh.GammaTooltip,{label:"[EMPLOYEE ONLY] Submit feedback",placement:"top",children:(0,d.jsx)(n8.IconButton,{icon:(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faBug}),"aria-label":"submit a bug",size:"xs",color:"orange.600",onClick:z})}),(0,d.jsx)(lk.Spacer,{}),(0,d.jsx)(dU,{isLoading:s,handleSubmit:t,handleStop:i,canStop:l??s,isDisabled:!g&&!s||!!b,top:"1.5",insetEnd:"2",zIndex:10,spacing:2})]})]})})})]})},dG=({title:e,placeholder:t,trigger:i,triggerWrapperProps:n,placement:a="bottom-start",actionGroups:r,editor:o,selectImage:s,isOpen:l,onOpen:u,onClose:p,initiatingCardId:h,creditWarning:m})=>{let g=li(),f=m?.isBlocking?"credits":g.disabledReason,{isOpen:b,onOpen:x,onClose:y}=(0,at.useDisclosure)(),[v,C]=(0,et.useState)(""),w=(0,et.useRef)(null),S=(0,et.useCallback)(()=>{w.current?.focus()},[]),k=(0,et.useCallback)(()=>{u()},[u]),{uploadedFiles:A,uploadFiles:E,openFilePicker:_,removeFile:I,resetFiles:M,isUploading:T,hiddenFileInput:L}=lb({focusInput:S}),j=lC(),P=(0,et.useCallback)(()=>{C(""),M(),p()},[p,M]),D=(0,et.useMemo)(()=>!T&&(""!==v.trim()||A.length>0),[v,T,A.length]),N=(0,et.useCallback)(()=>{D&&(s&&s(),j({message:v,uploadedFiles:A,context:{initiatingCardId:h}}),P())},[D,h,v,P,s,j,A]);(0,et.useEffect)(()=>{l&&requestAnimationFrame(()=>w.current?.focus())},[l]),(0,nK.useAnalyticsEffect)(e=>{l&&e.track(en.SegmentEvents.BUDDY_CHAT_POPOVER_OPENED)},[l]);let R=(0,n_.useColorModeValue)("blue.950","gray.400"),O=(0,n_.useColorModeValue)("blue.950","gray.400"),B=(0,n_.useColorModeValue)("gray.600","gray.400"),z=(0,n_.useColorModeValue)({border:"blue.100",bg:"white"},{border:"gray.700",bg:"elevation.1"}),F=(0,et.useCallback)(async e=>{s&&s(),e.onQuickAction(j,e),P()},[P,s,j]),H=(0,d.jsx)(l9,{actionGroups:r,onQuickAction:F,wrapProps:{spacing:2}}),W=f?({stillStreaming:(0,d.jsx)(iZ.Text,{fontSize:"xs",color:O,fontWeight:"semibold",children:(0,d.jsx)(G.Trans,{message:"Please wait your deck to finish generating before editing",id:"rtdKMi"})}),credits:m?.isBlocking?(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(iZ.Text,{fontSize:"xs",color:R,fontWeight:"semibold",children:m.title}),(0,d.jsx)(eh.GammaTooltip,{label:m.cta.tooltip,isDisabled:!m.cta.tooltip,children:(0,d.jsx)(V.Button,{size:"xs",variant:"solid",onClick:()=>{m.cta.onClick?.()},children:m.cta.label})})]}):(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(iZ.Text,{fontSize:"xs",color:R,fontWeight:"semibold",children:(0,d.jsx)(G.Trans,{message:"You're out of credits",id:"Cthpec"})}),(0,d.jsx)(V.Button,{size:"xs",variant:"solid",onClick:()=>{x()},children:(0,d.jsx)(G.Trans,{message:"Get more",id:"6v0nlS"})})]}),contextWindow:(0,d.jsx)(iZ.Text,{fontSize:"xs",color:"blue.950",fontWeight:"semibold",children:(0,d.jsx)(G.Trans,{message:"Chat is full. Next message will clear the chat.",id:"EFVil9"})})})[f]:null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(q.Popover,{placement:a,isOpen:l,onOpen:k,onClose:p,closeOnBlur:!0,returnFocusOnClose:!0,children:[(0,d.jsx)(s5.PopoverTrigger,{children:(0,d.jsx)(c.Box,{as:"span",display:"inline-flex",alignItems:"stretch",position:"relative",zIndex:1e3,pointerEvents:"auto",role:"button",tabIndex:0,"aria-haspopup":"dialog",onMouseDown:e=>{e.stopPropagation()},onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),k())},...n,children:i})}),(0,d.jsx)(Q.Portal,{children:(0,d.jsx)(X.PopoverContent,{_focus:{boxShadow:"md"},borderColor:z.border,bg:z.bg,w:{base:"sm",md:"lg"},maxW:"calc(100vw - 2rem)",zIndex:1500,pointerEvents:"auto",children:(0,d.jsxs)(s3.PopoverBody,{children:[L,(0,d.jsxs)(nv.Stack,{children:[(e||W)&&(0,d.jsxs)(K.HStack,{justify:"space-between",children:[e&&(0,d.jsx)(iZ.Text,{fontSize:"xs",fontWeight:"semibold",color:B,children:e}),W]}),(0,d.jsx)(dV,{isDisabled:null!==f,placeholder:t,editor:o,onSubmit:N,inputRef:w,input:v,setInput:C,onUploadClick:_,isLoading:T,uploadedFiles:A,uploadFiles:E,removeFile:I,canSubmit:D,editorSelection:null}),H]})]})})})]}),(0,d.jsx)(lw.AICreditsModal,{onClose:y,onOpen:x,isOpen:b,segmentEvent:en.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_BUDDY_EDIT_DOOR,upsellLocation:"credits.buddyEditDoor"})]})};var d$=e.i(103104);let dZ=({editor:e,attrs:t,buttonProps:i})=>{let{isOpen:n,onOpen:a,onClose:r}=(0,at.useDisclosure)(),o=(({attrs:e})=>{let{suggestions:t}=aC(e);return(0,et.useMemo)(()=>[{key:"quick-actions",label:()=>ee.i18n._({id:"7kAwBx",message:"Quick actions"}),operations:[{key:"remove-bg",label:()=>ee.i18n._({id:"ylbfBl",message:"Remove background"}),creditCostType:"removeBackground",icon:D.faEraser,checkEnabled:()=>!0,onQuickAction:e=>{e({message:ee.i18n._({id:"42ujz4",message:"Remove the background on this image"})})}},{key:"upscale",label:()=>ee.i18n._({id:"OcutTC",message:"Upscale"}),creditCostType:"imageChat",icon:D.faExpand,productFeature:"ai_models_plus",upsellModalSegmentEvent:en.SegmentEvents.GAMMA_PRO_UPSELL_CALLOUT_BUDDY_IMAGE_EDIT,checkEnabled:()=>s2()&&sS(e),onQuickAction:e=>{e({message:ee.i18n._({id:"GCpteZ",message:"Upscale this image"})})}},{key:"vectorize",label:()=>ee.i18n._({id:"ZF+2pT",message:"Vectorize"}),creditCostType:"imageChat",icon:D.faFileVector,productFeature:"vectorize_image",upsellModalSegmentEvent:en.SegmentEvents.GAMMA_PRO_UPSELL_CALLOUT_BUDDY_IMAGE_EDIT,checkEnabled:()=>s1()&&sS(e),onQuickAction:e=>{e({message:ee.i18n._({id:"D9i9Zm",message:"Vectorize this image"})})}},{key:"animate",label:()=>ee.i18n._({id:"2qLe/y",message:"Animate"}),creditCostType:"animateImage",icon:D.faFilm,productFeature:"animate_image",upsellModalSegmentEvent:en.SegmentEvents.GAMMA_PRO_UPSELL_CALLOUT_BUDDY_IMAGE_EDIT,checkEnabled:()=>s0()&&sS(e),onQuickAction:e=>{e({message:ee.i18n._({id:"B3oBCQ",message:"Animate this image"})})}}]},{key:"suggested",label:()=>ee.i18n._({id:"nyQWMb",message:"Suggested"}),operations:t.map(e=>({key:e,label:()=>e,onQuickAction:t=>{t({message:ee.i18n._({id:"ZI5Cdm",message:"Edit this image. {s}",values:{s:e}})})}}))}],[t,e])})({attrs:t});return(0,d.jsx)(dG,{title:ee.i18n._({id:"b0eJco",message:"Edit this image"}),placeholder:ee.i18n._({id:"wm/Yby",message:"How would you like to edit this image?"}),editor:e,isOpen:n,onOpen:a,onClose:r,trigger:(0,d.jsx)(eh.GammaTooltip,{label:(0,d.jsx)(G.Trans,{message:"Edit with {AGENT_PROPER_NOUN}",id:"0aK6vE",values:{AGENT_PROPER_NOUN:d$.AGENT_PROPER_NOUN}}),placement:"top",children:(0,d.jsx)(n8.IconButton,{"aria-label":ee.i18n._({id:"0aK6vE",message:"Edit with {AGENT_PROPER_NOUN}",values:{AGENT_PROPER_NOUN:d$.AGENT_PROPER_NOUN}}),icon:(0,d.jsxs)(K.HStack,{children:[(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faSparkles,fixedWidth:!0}),(0,d.jsx)(N.FontAwesomeIcon,{icon:J.faChevronDown,size:"xs",fixedWidth:!0})]}),variant:"toolbar",size:"sm",px:2,...i})}),triggerWrapperProps:{display:"flex",flex:1},placement:"bottom",actionGroups:o})};e.s(["CardAccentImageFitButton",0,({editor:e,selection:t,decorations:i})=>{let{node:n,from:a}=t,r=n.attrs,o=(0,n9.findCardLayoutDecorationSpec)(i),s=n1(r,o?.layout),l=(0,et.useCallback)(t=>{a&&e.commands.updateAttributesAtPos(a,{fitType:t})},[e,a]),c="fit"===s;return(0,d.jsx)(eh.GammaTooltip,{label:c?(0,d.jsx)(G.Trans,{message:"Remove image fitting",id:"sShDhp"}):(0,d.jsx)(G.Trans,{message:"Fit image",id:"VPxUGR"}),placement:"top",children:(0,d.jsx)(n8.IconButton,{variant:c?"activeToolbar":"toolbar",size:"sm",icon:(0,d.jsx)(N.FontAwesomeIcon,{icon:D.faArrowsMinimize}),onClick:()=>l(c?"fill":"fit"),boxSize:7,p:0,my:0,"aria-label":ee.i18n._({id:"l1XNCT",message:"Apply image fitting"}),isActive:c})})}],348258)},698380,213284,e=>{"use strict";var t=e.i(755453),i=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,n=t.Node.create({name:"image",addOptions:()=>({inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes:()=>({src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}),parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",(0,t.mergeAttributes)(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,i,n,a,r,o;let s=null!=(i=null==(t=e.attrs)?void 0:t.src)?i:"",l=null!=(a=null==(n=e.attrs)?void 0:n.alt)?a:"",d=null!=(o=null==(r=e.attrs)?void 0:r.title)?o:"";return d?`![${l}](${s} "${d}")`:`![${l}](${s})`},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||"u"{let l=document.createElement("img");Object.entries(s).forEach(([e,t])=>{if(null!=t)switch(e){case"width":case"height":break;default:l.setAttribute(e,t)}}),l.src=s.src;let d=new t.ResizableNodeView({element:l,node:r,getPos:o,onResize:(e,t)=>{l.style.width=`${e}px`,l.style.height=`${t}px`},onCommit:(e,t)=>{let i=o();void 0!==i&&this.editor.chain().setNodeSelection(i).updateAttributes(this.name,{width:e,height:t}).run()},onUpdate:(e,t,i)=>e.type===r.type,options:{directions:e,min:{width:i,height:n},preserveAspectRatio:!0===a}}),c=d.dom;return c.style.visibility="hidden",c.style.pointerEvents="none",l.onload=()=>{c.style.visibility="",c.style.pointerEvents=""},d}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[(0,t.nodeInputRule)({find:i,type:this.type,getAttributes:e=>{let[,,t,i,n]=e;return{src:i,alt:t,title:n}}})]}});e.s(["default",0,n],698380);var a=e.i(391398),r=e.i(191788),o=e.i(730943);let s=({contentComponent:e})=>{let t=(0,r.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,a.jsx)(a.Fragment,{children:Object.values(t)})};class l extends r.default.Component{editorContentRef;portalComponent;constructor(e){super(e),this.editorContentRef=r.default.createRef(),this.portalComponent=e.portalComponent||s}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.options.element){let t,i;if(e.contentComponent)return;let n=this.editorContentRef.current;n.append(e.view.dom),e.setOptions({element:n}),t=new Set,i={},e.contentComponent={subscribe:e=>(t.add(e),()=>{t.delete(e)}),getSnapshot:()=>i,getServerSnapshot:()=>i,setRenderer(e,n){i={...i,[e]:o.default.createPortal(n.reactElement,n.element,e)},t.forEach(e=>e())},removeRenderer(e){let n={...i};delete n[e],i=n,t.forEach(e=>e())}},e.createNodeViews(),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null;try{if(!e.view.dom?.firstChild)return;let t=document.createElement("div");t.append(e.view.dom),e.setOptions({element:t})}catch{}}}render(){let{editor:e,portalComponent:t,innerRef:i,...n}=this.props;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:((...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})})(i,this.editorContentRef),...n}),e?.contentComponent&&(0,a.jsx)(this.portalComponent,{contentComponent:e.contentComponent})]})}}let d=(0,r.forwardRef)((e,t)=>{let i=r.default.useMemo(()=>Math.floor(0xffffffff*Math.random()).toString(),[e.editor]);return r.default.createElement(l,{key:i,innerRef:t,...e})});d.displayName="EditorContentWithKey";let c=r.default.memo(d);e.s(["EditorContent",0,c,"PureEditorContent",0,l],213284)},432247,605245,108724,e=>{"use strict";e.s(["NodeViewContent",()=>x],432247);var t=e.i(391398);e.i(314572);var i=e.i(296446),n=e.i(361183),a=e.i(335884);e.s(["NodeViewContent",()=>b],108724);var r=e.i(470645),o=e.i(755453),s=e.i(308822),l=e.i(191788);e.i(838054);let d=(0,l.createContext)({onDragStart:void 0}),c=()=>(0,l.useContext)(d);e.s(["ReactNodeViewContext",0,d,"useReactNodeView",0,c],605245);var u=e.i(977581),p=e.i(24439);let h=(e,i,n,a)=>{let r=Array.from(Object.entries(n.contentComponent?.getServerSnapshot()??{})).find(([t,i])=>i.children.props.node===e);if(!r)return null;let[o,s]=r,d=s.children,c=l.default.cloneElement(d,d.props,a),u=s.containerInfo,p=u.nodeName.toLowerCase()||"div",{style:h,...m}=(e=>{let t={};for(let i of e.attributes){let e=i.name;"class"===e?t.className=i.value:"contenteditable"===e&&"false"===i.value||(t[e]=i.value)}return t})(u);return(0,t.jsx)(p,{"data-pos":i,...m,STYLE:`white-space: inherit;${h}`,children:c},o)};function m(e,t){let i={name:t.name,options:t.options,storage:t.storage,editor:e};return(0,o.getExtensionField)(t,"renderHTMLforSSR",i)??(0,o.getExtensionField)(t,"renderHTML",i)??null}let g=(e,t)=>{let i,n,a=(0,u.findExtensionFromNodeType)(e,t.type);if(!a)return null;let r=e.extensionManager.attributes.filter(e=>e.type===t.type.name),l=(0,o.getRenderedAttributes)(t,r);if(t instanceof s.Mark){let n=m(e,a);if(!n)return null;i=n({HTMLAttributes:l,mark:t})}else{let n=m(e,a);if(!n)return null;i=n({HTMLAttributes:l,node:t})}if(!f(i))return null;let[d,c,p]=i;return[d,(n={...c},n?.style&&(n.STYLE=n.style,delete n.style),n?.class&&(n.className=n.class,delete n.class),n?.colspan&&(n.colSpan=n.colspan,delete n.colspan),n?.rowspan&&(n.rowSpan=n.rowspan,delete n.rowspan),n),p]},f=e=>Array.isArray(e)&&"string"==typeof e[0]&&"object"==typeof e[1]&&!Array.isArray(e[1])&&null!==e[1]&&e.length<=3,b=l.default.memo(e=>{let{node:i,editor:n,getPos:a}=c();if(!i||!n)return null;let o=e.as||"div",d=i.isInline||i instanceof s.Mark?"span":"div",u=[],m=a?.(),f="number"==typeof m?m:null,b=(e,i,a)=>{let o=(null===f?0:f)+i+1,s=h(e,o,n);if(s)return s;let d=t=>Array.from(e.marks).reverse().reduce((e,t)=>{let i=h(t,o,n,e);if(i)return i;let r=g(n,t);if(r){let[t,i,n]=r;return l.default.createElement(t,{key:a,...i},e)}return e},t),c=null===f?[]:(0,p.getDecorationsForNode)(n,o),u=g(n,e);if(u){let[t,n]=u,s=3===u.length?u[2]:void 0,p=null;if(0===s){let t=[];e.forEach((e,n,r)=>{t.push(b(e,i+n,`${a}_${r}`))}),p=t,console.debug("[SSR NodeViewContent] HOLE",t)}else"string"==typeof s&&(console.debug("[SSR NodeViewContent] children plain",s),p=s);let{nodeName:h,...m}=c.map(e=>e.type?.attrs).reduce((e,t)=>({...e,...t}),{}),g={...n,...m,className:(0,r.cx)(m.class,n.class),"data-pos":o};return delete g.class,console.debug("[SSR NodeViewContent] non-nodeview:",a,g,s),d(l.default.createElement(t,{key:a,...g},p))}return e.isText?d((0,t.jsx)(l.default.Fragment,{children:e.textContent},a)):null};return i.forEach((e,t)=>{let n=u.length+1,a=b(e,t,`${n}`);a?u.push(a):console.warn("%c [Simple NodeViewContent] UNKNOWN NODE $$$$$$$$$$$$$$$$$$$$$$$$$","background-color: aqua; font-weight: bold",{unknownNode:e,parentNode:i})}),(0,t.jsx)(o,{...e,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:(0,t.jsx)(d,{"data-node-view-content-inner":i.type.name,style:{whiteSpace:"inherit"},children:0===u.length?null:1===u.length?u[0]:u})})});b.displayName="NodeViewContent";let x=e=>{let r=(0,a.useShouldUsePublishedVersion)();return(0,i.useIsInReactProseMirror)()?(0,t.jsx)(n.NodeViewContent,{...e}):r?(0,t.jsx)(b,{...e}):(0,t.jsx)(y,{...e})},y=e=>{let i=e.as||"div",{nodeViewContentRef:n}=c(),a=e["data-testid"];return(0,t.jsx)(i,{...e,ref:n,"data-node-view-content":"","data-testid":a||"node-view-content",style:{whiteSpace:"pre-wrap",...e.style}})}},838054,452330,408767,554670,e=>{"use strict";e.s([],838054),e.i(213284),e.i(432247);var t=e.i(391398),i=e.i(755453),n=e.i(191788),a=e.i(256266),r=e.i(899611),o=e.i(730943);class s{id;editor;component;element;props;reactElement;ref=null;updateWrapperEl;constructor(e,{editor:t,props:i={},as:n="div",className:a="",attrs:r,updateWrapperEl:s}){this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=i,this.updateWrapperEl=s,this.element=document.createElement(n),this.element.classList.add("react-renderer"),a&&this.element.classList.add(...a.split(" ")),r&&Object.keys(r).forEach(e=>{this.element.setAttribute(e,r[e])}),this.editor.isEditorContentInitialized?(0,o.flushSync)(()=>{this.render()}):this.render()}render(){let e=this.component,t=this.props,i=this.editor;("function"==typeof e&&e.prototype&&e.prototype.isReactComponent||"object"==typeof e&&e.$$typeof?.toString()==="Symbol(react.forward_ref)")&&(t.ref=e=>{this.ref=e}),this.reactElement=n.default.createElement(e,t),this.updateWrapperEl&&this.updateWrapperEl(this.element,t),i?.contentComponent?.setRenderer(this.id,this)}updateProps(e={}){this.props={...this.props,...e},this.render()}destroy(){let e=this.editor;e?.contentComponent?.removeRenderer(this.id)}}e.s(["ReactRenderer",0,s],452330);var l=e.i(605245);class d extends i.NodeView{stopEvent(e){return"contextmenu"!==e.type&&i.NodeView.prototype.stopEvent.call(this,e)}updateAttributes(e){this.editor.commands.command(({tr:t})=>{let i=this.getPos();if(void 0===i)return!1;let n={type:"move",insertPos:i,insertPosRaw:i,pos:i,end:i+this.node.content.size+1};try{t.setNodeMarkup(i,void 0,{...this.node.attrs,...e}).setMeta("annotationEvent",n)}catch(e){console.error("(caught) [ReactNodeView updateAttributes]: setNodeMarkup",e)}return!0})}mount(){let e={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extension,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(e={})=>this.updateAttributes(e),deleteNode:()=>this.deleteNode(),ref:(0,n.createRef)()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let i={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)},node:this.node,editor:this.editor,getPos:()=>this.getPos()},a=this.component,r=n.default.memo(e=>(0,t.jsx)(l.ReactNodeViewContext.Provider,{value:i,children:n.default.createElement(a,e)}));r.displayName="ReactNodeView",this.node.isLeaf?this.contentDOMElement=null:this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.contentDOMElement.setAttribute("data-node-view-content-inner",this.node.type.name));let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);let{className:d=""}=this.options;this.renderer=new s(r,{editor:this.editor,props:e,as:o,className:`node-${this.node.type.name} ${d}`.trim(),attrs:this.options.attrs,updateWrapperEl:this.options.updateWrapperEl})}get dom(){if(this.renderer.element.firstElementChild&&!this.renderer.element.firstElementChild?.hasAttribute("data-node-view-wrapper"))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t,i){let n=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let a=this.node,r=this.decorations,o=this.innerDecorations;return this.node=e,this.decorations=t,this.innerDecorations=i,this.options.update({oldNode:a,oldDecorations:r,newNode:e,newDecorations:t,oldInnerDecorations:o,innerDecorations:i,updateProps:()=>n({node:e,decorations:t,innerDecorations:i})})}return e===this.node&&this.decorations===t&&this.innerDecorations===i||(this.node=e,this.decorations=t,this.innerDecorations=i,n({node:e,decorations:t,innerDecorations:i}),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}ignoreMutation(e){return!this.dom||!this.contentDOM||"function"==typeof this.options.ignoreMutation&&this.options.ignoreMutation({mutation:e})||this.defaultIgnoreMutation(e)}defaultIgnoreMutation(e){return!!(!this.dom||!this.contentDOM||this.node.isLeaf||this.node.isAtom||"selection"===e.type&&e.target.closest("[data-comments-wrapper]"))||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(0,a.isiOS)()&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}onDragStart(e){let t=e.target,i=t.querySelector("[data-drag-handle]");if(i||(i=t.closest("[data-drag-handle]")),!this.dom||!i)return void e.preventDefault();try{let t=this.editor.view.posAtDOM(i,0);if(!t||-1==t||!this.editor.state.doc.nodeAt(t))return;(0,r.handleDragStart)(this.editor,e,t,i)}catch(e){console.warn("(caught) [ReactNodeViewRenderer] onDragStart error moving annotations",e)}}}e.s(["ReactNodeViewRenderer",0,function(e,t){return i=>i.editor.contentComponent?new d(e,i,t):{}}],408767),e.i(350461);var c=e.i(867752),u=e.i(191604);class p{transactionNumber=0;lastTransactionNumber=0;lastSnapshot;editor;subscribers=new Set;constructor(e){this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e=()=>{this.transactionNumber+=1,this.subscribers.forEach(e=>e())},t=this.editor;return t.on("transaction",e),()=>{t.off("transaction",e)}}}}let h=!!window.next,m=c.setTimeout,g=c.clearTimeout;class f{editor=null;options;subscriptions=new Set;scheduledDestructionTimeout;isComponentMounted=!1;previousDeps=null;instanceId="";constructor(e){this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){return void 0===this.options.current.immediatelyRender?h?null:this.createEditor():this.options.current.immediatelyRender?this.createEditor():null}createEditor(){let e={...this.options.current,onBeforeCreate:(...e)=>this.options.current.onBeforeCreate?.(...e),onBlur:(...e)=>this.options.current.onBlur?.(...e),onCreate:(...e)=>this.options.current.onCreate?.(...e),onDestroy:(...e)=>this.options.current.onDestroy?.(...e),onFocus:(...e)=>this.options.current.onFocus?.(...e),onSelectionUpdate:(...e)=>this.options.current.onSelectionUpdate?.(...e),onTransaction:(...e)=>this.options.current.onTransaction?.(...e),onUpdate:(...e)=>this.options.current.onUpdate?.(...e),onContentError:(...e)=>this.options.current.onContentError?.(...e)};return new i.Editor(e)}getEditor(){return this.editor}getServerSnapshot(){return this.editor}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}onRender(e){return()=>(this.isComponentMounted=!0,this.scheduledDestructionTimeout&&g(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&0===e.length?this.editor.setOptions(this.options.current):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(null===this.previousDeps){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,i)=>t===e[i]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=m(()=>{if(this.isComponentMounted&&this.instanceId===e){t&&t.setOptions(this.options.current);return}t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}}e.s(["useEditor",0,function(e={},t=[]){(0,n.useMemo)(()=>{},[]);let i=(0,n.useRef)(e);i.current=e;let[a]=(0,n.useState)(()=>new f(i)),r=(0,n.useSyncExternalStore)(a.subscribe,a.getEditor,a.getServerSnapshot);return(0,n.useDebugValue)(r),(0,n.useEffect)(a.onRender(t)),!function(e){let[t]=(0,n.useState)(()=>new p(e.editor)),i=(0,u.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn);(0,n.useEffect)(()=>t.watch(e.editor),[e.editor,t]),(0,n.useDebugValue)(i)}({editor:r,selector:({transactionNumber:t})=>!1===e.shouldRerenderOnTransaction?null:e.immediatelyRender&&0===t?0:t+1}),r}],554670)},577281,342047,e=>{"use strict";e.i(144786);var t=e.i(275316);e.i(131339);let i=(e,t)=>{let i=e.filter(e=>Object.keys(e.spec).length>0),n=t.filter(e=>Object.keys(e.spec).length>0);return i.length!==n.length||JSON.stringify(i.map(e=>e.spec))!==JSON.stringify(n.map(e=>e.spec))},n=({oldNode:e,oldDecorations:n,newNode:a,newDecorations:r,updateProps:o})=>{if(JSON.stringify(a.attrs)!==JSON.stringify(e.attrs))return o(),!0;if(i(n,r)){if(t.featureFlags.get("debugLogging")){let e,t,i,o,s=(e=n.filter(e=>Object.keys(e.spec).length>0),t=r.filter(e=>Object.keys(e.spec).length>0),i=e.map(e=>JSON.stringify(e.spec)),o=t.map(e=>JSON.stringify(e.spec)),{removed:i.filter(e=>!o.includes(e)),added:o.filter(e=>!i.includes(e))});console.debug("============== decos ================"),console.debug("decos changed",a.type.name),s.removed.length>0&&console.debug(`%c decos removed: ${s.removed.join(" ")} `,"color: red"),s.added.length>0&&console.debug(`%c decos added: ${s.added.join(" ")} `,"color: green")}o()}return!0};e.s(["attrsOrDecorationsChanged",0,n,"didDecorationsSpecChange",0,i,"numChildrenOrAttrsOrDecorationsChanged",0,e=>{let{newNode:t,oldNode:i,updateProps:a}=e;return t.content.childCount!==i.content.childCount?(a(),!0):n(e)}],577281);var a=e.i(175863),r=e.i(615505);let o=new a.PluginKey("convertToGridLayout");e.s(["ConvertMediaToGridLayoutPlugin",0,()=>new a.Plugin({key:o,props:{decorations:({doc:e})=>{let t=[];return e.descendants((e,i,n)=>{("image"===e.type.name||"graphic"===e.type.name)&&"cardLayoutItem"===n.type.name&&t.push(r.Decoration.node(i,i+e.nodeSize,{},{isTopLevel:!0}))}),r.DecorationSet.create(e,t)}}})],342047)},723740,311524,e=>{"use strict";e.s(["ImageDropPlugin",()=>a],723740);var t=e.i(175863);e.s(["checkImageReplacementDropTarget",()=>n],311524);var i=e.i(15272);let n=(e,t,n,a="insert")=>{let r;if("replace"!==a)return null;let o=e.posAtCoords({left:t.clientX,top:t.clientY});if(!o)return null;let{doc:s}=e.state,{pos:l}=o,d=s.resolve(l);if((0,i.findParentGallery)(d))return null;l=o.inside;try{r=s.resolve(l).nodeAfter}catch(e){return null}if(!r||r==n?.content.firstChild||"image"!==r.type.name)return null;let c=e.nodeDOM(l),u=c?.querySelector("[data-node-image-testid]")?.getBoundingClientRect();return u?{pos:l,rect:u,node:r}:null},a=e=>new t.Plugin({key:new t.PluginKey("imageDrop"),props:{handleDOMEvents:{drop:t=>{let i,a=t.dragging?.operation||"insert";if("replace"!==a)return!1;let r=t.dragging?.slice;try{if(!(i=n(t,event,r,a)))return!1}catch(e){return console.error("(caught) [ImagePlugin] handleDrop error:",e),!1}try{let t=r?.content.toJSON(),{pos:n,node:a}=i;e.chain().insertContentAt({from:n,to:n+a.nodeSize},t[0],{updateSelection:!1}).run()}catch(e){return!1}return!0}}}})},19654,e=>{"use strict";var t=e.i(175863),i=e.i(191788);e.i(58124);var n=e.i(232278);e.i(682917);var a=e.i(324314),r=e.i(418755),o=e.i(551880);e.s(["useEditorContextMenu",0,({contextMenuItems:e,editor:s,getPos:l})=>{let d=(0,r.useAppSelector)(o.selectEditable),c=(0,r.useAppSelector)(a.selectContextMenuOpen),u=(0,r.useAppDispatch)(),{onContextMenu:p,menuProps:h}=(0,n.useContextMenu)(),{onClose:m,isOpen:g,position:f}=h,b=(0,i.useCallback)(e=>{if(!d)return;if(c)return void e.preventDefault();let i=l();"number"==typeof i&&(s.view.dispatch(s.view.state.tr.setSelection(t.NodeSelection.create(s.view.state.doc,i))),p(e))},[d,c,s.view,l,p]);return(0,i.useEffect)(()=>{g?u((0,a.setContextMenuState)({isOpen:!0,position:f,menuItems:e})):(u((0,a.setContextMenuClosed)()),m())},[f,u,g]),{onOpenContextMenu:b}}])},320037,(e,t,i)=>{var n=e.r(398629),a=e.r(316666),r=Object.prototype.hasOwnProperty;t.exports=a(function(e,t,i){r.call(e,i)?e[i].push(t):n(e,i,[t])})},182447,(e,t,i)=>{var n=e.r(648346),a=e.r(305792),r=e.r(171239),o=e.r(448684);t.exports=function(e,t){return(o(e)?n:r)(e,a(t,3))}},484742,(e,t,i)=>{var n=e.r(966762),a=e.r(182447);t.exports=function(e,t){return n(a(e,t),1)}},131010,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sanitizeRedirectUrl=void 0,i.sanitizeRedirectUrl=e=>{if(e){if(e.startsWith("/")&&!e.startsWith("//"))return e;try{let{hostname:t}=new URL(e);if("gamma.app"===t||t.endsWith(".gamma.app")||t.endsWith("-gamma-app.vercel.app")||"localhost"===t)return e}catch(e){}}}},915161,(e,t,i)=>{"use strict";var n,a;Object.defineProperty(i,"__esModule",{value:!0}),i.AccountAccessErrorCode=void 0,(a=n||(i.AccountAccessErrorCode=n={})).INVALID_SIGNUP_CODE="invalid_signup_code",a.INVALID_RESET_CODE="invalid_reset_code",a.SIGNUP_ERROR="signup_error"},263765,(e,t,i)=>{"use strict";var n,a,r,o;Object.defineProperty(i,"__esModule",{value:!0}),i.PasswordErrorCode=i.validatePassword=i.PasswordValidationError=void 0,(r=n||(i.PasswordValidationError=n={})).TOO_SHORT="password_too_short",r.NO_UPPERCASE="password_no_uppercase",r.NO_LOWERCASE="password_no_lowercase",r.NO_NUMBER="password_no_number",r.NO_SYMBOL="password_no_symbol",i.validatePassword=e=>{let t=[];return e.length<8&&t.push(n.TOO_SHORT),e.match(/[A-Z]/)||t.push(n.NO_UPPERCASE),e.match(/[a-z]/)||t.push(n.NO_LOWERCASE),e.match(/[0-9]/)||t.push(n.NO_NUMBER),e.match(/[\^$*.[\]{}()?"!@#%&/\\,><':;|_~`=+-]/)||t.push(n.NO_SYMBOL),t},(o=a||(i.PasswordErrorCode=a={})).INCORRECT_PASSWORD_ENTERED="incorrect_password_entered",o.PASSWORD_CHANGE_ERROR="password_change_error"},210738,(e,t,i)=>{"use strict";var n,a,r,o;Object.defineProperty(i,"__esModule",{value:!0}),i.SSOErrorCode=i.SSOStatus=void 0,(r=n||(i.SSOStatus=n={})).SSO_ENABLED="sso_enabled",r.SSO_NOT_FOUND="sso_not_found",r.SSO_ERROR="sso_error",r.SSO_MISSING_TOKEN="sso_missing_token",r.SSO_INVALID_TOKEN="sso_invalid_token",(o=a||(i.SSOErrorCode=a={})).SSO_REQUIRED="sso_required",o.SSO_REQUIRED_REDIRECT="sso_required_redirect",o.SSO_REQUIRED_FOR_JOIN="sso_required_for_join"},99981,(e,t,i)=>{"use strict";var n,a;Object.defineProperty(i,"__esModule",{value:!0}),i.WorkspaceErrorCode=void 0,(a=n||(i.WorkspaceErrorCode=n={})).OTHER_WORKSPACE_MEMBER="other_workspace_member",a.PAID_WORKSPACE_JOIN_LINK_BLOCKED="paid_workspace_join_link_blocked"},633022,(e,t,i)=>{class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function a(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...t){let i=Object.create(null);for(let t in e)i[t]=e[t];return t.forEach(function(e){for(let t in e)i[t]=e[t]}),i}class o{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=a(e)}openNode(e){if(!e.scope)return;let t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let i=e.split(".");return[`${t}${i.shift()}`,...i.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){e.scope&&(this.buffer+="")}value(){return this.buffer}span(e){this.buffer+=``}}let s=(e={})=>{let t={children:[]};return Object.assign(t,e),t};class l{constructor(){this.rootNode=s(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){let t=s({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"==typeof e||e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{l._collapse(e)}))}}class d extends l{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){let i=e.root;t&&(i.scope=`language:${t}`),this.add(i)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function c(e){return e?"string"==typeof e?e:e.source:null}function u(e){return m("(?=",e,")")}function p(e){return m("(?:",e,")*")}function h(e){return m("(?:",e,")?")}function m(...e){return e.map(e=>c(e)).join("")}function g(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>c(e)).join("|")+")"}function f(e){return RegExp(e.toString()+"|").exec("").length-1}let b=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function x(e,{joinWith:t}){let i=0;return e.map(e=>{let t=i+=1,n=c(e),a="";for(;n.length>0;){let e=b.exec(n);if(!e){a+=n;break}a+=n.substring(0,e.index),n=n.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?a+="\\"+String(Number(e[1])+t):(a+=e[0],"("===e[0]&&i++)}return a}).map(e=>`(${e})`).join(t)}let y="[a-zA-Z]\\w*",v="[a-zA-Z_]\\w*",C="\\b\\d+(\\.\\d+)?",w="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",S="\\b(0b[01]+)",k={begin:"\\\\[\\s\\S]",relevance:0},A=function(e,t,i={}){let n=r({scope:"comment",begin:e,end:t,contains:[]},i);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let a=g("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:m(/[ ]+/,"(",a,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},E=A("//","$"),_=A("/\\*","\\*/"),I=A("#","$");var M=Object.freeze({__proto__:null,APOS_STRING_MODE:{scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[k]},BACKSLASH_ESCAPE:k,BINARY_NUMBER_MODE:{scope:"number",begin:S,relevance:0},BINARY_NUMBER_RE:S,COMMENT:A,C_BLOCK_COMMENT_MODE:_,C_LINE_COMMENT_MODE:E,C_NUMBER_MODE:{scope:"number",begin:w,relevance:0},C_NUMBER_RE:w,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:I,IDENT_RE:y,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+v,relevance:0},NUMBER_MODE:{scope:"number",begin:C,relevance:0},NUMBER_RE:C,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:{scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[k]},REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[k,{begin:/\[/,end:/\]/,relevance:0,contains:[k]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=m(t,/.*\b/,e.binary,/\b.*/)),r({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:y,relevance:0},UNDERSCORE_IDENT_RE:v,UNDERSCORE_TITLE_MODE:{scope:"title",begin:v,relevance:0}});function T(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function L(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function j(e,t){!t||e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=T,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function P(e,t){Array.isArray(e.illegal)&&(e.illegal=g(...e.illegal))}function D(e,t){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function N(e,t){void 0===e.relevance&&(e.relevance=1)}let R=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let i=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=i.keywords,e.begin=m(i.beforeMatch,u(i.begin)),e.starts={relevance:0,contains:[Object.assign(i,{endsParent:!0})]},e.relevance=0,delete i.beforeMatch},O=["of","and","for","in","not","or","if","then","parent","list","value"],B={},z=e=>{console.error(e)},F=(e,...t)=>{console.log(`WARN: ${e}`,...t)},H=(e,t)=>{B[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),B[`${e}/${t}`]=!0)},W=Error();function U(e,t,{key:i}){let n=0,a=e[i],r={},o={};for(let e=1;e<=t.length;e++)o[e+n]=a[e],r[e+n]=!0,n+=f(t[e-1]);e[i]=o,e[i]._emit=r,e[i]._multi=!0}function V(e){if(e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw z("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),W;if("object"!=typeof e.beginScope||null===e.beginScope)throw z("beginScope must be object"),W;U(e,e.begin,{key:"beginScope"}),e.begin=x(e.begin,{joinWith:""})}if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw z("skip, excludeEnd, returnEnd not compatible with endScope: {}"),W;if("object"!=typeof e.endScope||null===e.endScope)throw z("endScope must be object"),W;U(e,e.end,{key:"endScope"}),e.end=x(e.end,{joinWith:""})}}class G extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}let $=Symbol("nomatch"),Z=function(e){let t=Object.create(null),i=Object.create(null),o=[],s=!0,l="Could not find the language '{}', did you forget to load/include a language module?",b={disableAutodetect:!0,name:"Plain text",contains:[]},y={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function v(e){return y.noHighlightRe.test(e)}function C(e,t,i){let n="",a="";"object"==typeof t?(n=e,i=t.ignoreIllegals,a=t.language):(H("10.7.0","highlight(lang, code, ...args) has been deprecated."),H("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),a=e,n=t),void 0===i&&(i=!0);let r={code:n,language:a};B("before:highlight",r);let o=r.result?r.result:w(r.language,r.code,i);return o.code=r.code,B("after:highlight",o),o}function w(e,i,o,d){let u=Object.create(null);function p(){if(!I.keywords)return void T.addText(F);let e=0;I.keywordPatternRe.lastIndex=0;let t=I.keywordPatternRe.exec(F),i="";for(;t;){i+=F.substring(e,t.index);let n=k.case_insensitive?t[0].toLowerCase():t[0],a=I.keywords[n];if(a){let[e,r]=a;if(T.addText(i),i="",u[n]=(u[n]||0)+1,u[n]<=7&&(H+=r),e.startsWith("_"))i+=t[0];else{let i=k.classNameAliases[e]||e;m(t[0],i)}}else i+=t[0];e=I.keywordPatternRe.lastIndex,t=I.keywordPatternRe.exec(F)}i+=F.substring(e),T.addText(i)}function h(){null!=I.subLanguage?function(){if(""===F)return;let e=null;if("string"==typeof I.subLanguage){if(!t[I.subLanguage])return T.addText(F);e=w(I.subLanguage,F,!0,M[I.subLanguage]),M[I.subLanguage]=e._top}else e=S(F,I.subLanguage.length?I.subLanguage:null);I.relevance>0&&(H+=e.relevance),T.__addSublanguage(e._emitter,e.language)}():p(),F=""}function m(e,t){""!==e&&(T.startScope(t),T.addText(e),T.endScope())}function g(e,t){let i=1,n=t.length-1;for(;i<=n;){if(!e._emit[i]){i++;continue}let n=k.classNameAliases[e[i]]||e[i],a=t[i];n?m(a,n):(F=a,p(),F=""),i++}}function b(e,t){return e.scope&&"string"==typeof e.scope&&T.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(F,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),F=""):e.beginScope._multi&&(g(e.beginScope,t),F="")),I=Object.create(e,{parent:{value:I}})}let v={};function C(t,a){let r=a&&a[0];if(F+=t,null==r)return h(),0;if("begin"===v.type&&"end"===a.type&&v.index===a.index&&""===r){if(F+=i.slice(a.index,a.index+1),!s){let t=Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=a,"begin"===a.type){let e=a[0],t=a.rule,i=new n(t);for(let n of[t.__beforeBegin,t["on:begin"]])if(n&&(n(a,i),i.isMatchIgnored))return 0===I.matcher.regexIndex?(F+=e[0],1):(G=!0,0);return t.skip?F+=e:(t.excludeBegin&&(F+=e),h(),t.returnBegin||t.excludeBegin||(F=e)),b(t,a),t.returnBegin?0:e.length}if("illegal"!==a.type||o){if("end"===a.type){let e=function(e){let t=e[0],a=i.substring(e.index),r=function e(t,i,a){var r;let o,s=(r=t.endRe,(o=r&&r.exec(a))&&0===o.index);if(s){if(t["on:end"]){let e=new n(t);t["on:end"](i,e),e.isMatchIgnored&&(s=!1)}if(s){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,i,a)}(I,e,a);if(!r)return $;let o=I;I.endScope&&I.endScope._wrap?(h(),m(t,I.endScope._wrap)):I.endScope&&I.endScope._multi?(h(),g(I.endScope,e)):o.skip?F+=t:(o.returnEnd||o.excludeEnd||(F+=t),h(),o.excludeEnd&&(F=t));do I.scope&&T.closeNode(),I.skip||I.subLanguage||(H+=I.relevance),I=I.parent;while(I!==r.parent)return r.starts&&b(r.starts,e),o.returnEnd?0:t.length}(a);if(e!==$)return e}}else{let e=Error('Illegal lexeme "'+r+'" for mode "'+(I.scope||"")+'"');throw e.mode=I,e}if("illegal"===a.type&&""===r)return F+="\n",1;if(U>1e5&&U>3*a.index)throw Error("potential infinite loop, way more iterations than matches");return F+=r,r.length}let k=_(e);if(!k)throw z(l.replace("{}",e)),Error('Unknown language: "'+e+'"');let A=function(e){function t(t,i){return RegExp(c(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(i?"g":""))}class i{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=f(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);let e=this.regexes.map(e=>e[1]);this.matcherRe=t(x(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;let t=this.matcherRe.exec(e);if(!t)return null;let i=t.findIndex((e,t)=>t>0&&void 0!==e),n=this.matchIndexes[i];return t.splice(0,i),Object.assign(t,n)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];let t=new i;return this.rules.slice(e).forEach(([e,i])=>t.addRule(e,i)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){let t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let i=t.exec(e);if(this.resumingScanAtSamePosition())if(i&&i.index===this.lastIndex);else{let t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,i=t.exec(e)}return i&&(this.regexIndex+=i.position+1,this.regexIndex===this.count&&this.considerAll()),i}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=r(e.classNameAliases||{}),function i(a,o){let s;if(a.isCompiled)return a;[L,D,V,R].forEach(e=>e(a,o)),e.compilerExtensions.forEach(e=>e(a,o)),a.__beforeBegin=null,[j,P,N].forEach(e=>e(a,o)),a.isCompiled=!0;let l=null;return"object"==typeof a.keywords&&a.keywords.$pattern&&(a.keywords=Object.assign({},a.keywords),l=a.keywords.$pattern,delete a.keywords.$pattern),l=l||/\w+/,a.keywords&&(a.keywords=function e(t,i,n="keyword"){let a=Object.create(null);return"string"==typeof t?r(n,t.split(" ")):Array.isArray(t)?r(n,t):Object.keys(t).forEach(function(n){Object.assign(a,e(t[n],i,n))}),a;function r(e,t){i&&(t=t.map(e=>e.toLowerCase())),t.forEach(function(t){var i,n,r;let o=t.split("|");a[o[0]]=[e,(i=o[0],(n=o[1])?Number(n):+(r=i,!O.includes(r.toLowerCase())))]})}}(a.keywords,e.case_insensitive)),a.keywordPatternRe=t(l,!0),o&&(a.begin||(a.begin=/\B|\b/),a.beginRe=t(a.begin),a.end||a.endsWithParent||(a.end=/\B|\b/),a.end&&(a.endRe=t(a.end)),a.terminatorEnd=c(a.end)||"",a.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(a.end?"|":"")+o.terminatorEnd)),a.illegal&&(a.illegalRe=t(a.illegal)),a.contains||(a.contains=[]),a.contains=[].concat(...a.contains.map(function(e){var t;return((t="self"===e?a:e).variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map(function(e){return r(t,{variants:null},e)})),t.cachedVariants)?t.cachedVariants:!function e(t){return!!t&&(t.endsWithParent||e(t.starts))}(t)?Object.isFrozen(t)?r(t):t:r(t,{starts:t.starts?r(t.starts):null})})),a.contains.forEach(function(e){i(e,a)}),a.starts&&i(a.starts,o),s=new n,a.contains.forEach(e=>s.addRule(e.begin,{rule:e,type:"begin"})),a.terminatorEnd&&s.addRule(a.terminatorEnd,{type:"end"}),a.illegal&&s.addRule(a.illegal,{type:"illegal"}),a.matcher=s,a}(e)}(k),E="",I=d||A,M={},T=new y.__emitter(y),B=[];for(let e=I;e!==k;e=e.parent)e.scope&&B.unshift(e.scope);B.forEach(e=>T.openNode(e));let F="",H=0,W=0,U=0,G=!1;try{if(k.__emitTokens)k.__emitTokens(i,T);else{for(I.matcher.considerAll();;){U++,G?G=!1:I.matcher.considerAll(),I.matcher.lastIndex=W;let e=I.matcher.exec(i);if(!e)break;let t=i.substring(W,e.index),n=C(t,e);W=e.index+n}C(i.substring(W))}return T.finalize(),E=T.toHTML(),{language:e,value:E,relevance:H,illegal:!1,_emitter:T,_top:I}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:a(i),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:W,context:i.slice(W-100,W+100),mode:t.mode,resultSoFar:E},_emitter:T};if(s)return{language:e,value:a(i),illegal:!1,relevance:0,errorRaised:t,_emitter:T,_top:I};throw t}}function S(e,i){let n;i=i||y.languages||Object.keys(t);let r=((n={value:a(e),illegal:!1,relevance:0,_top:b,_emitter:new y.__emitter(y)})._emitter.addText(e),n),o=i.filter(_).filter(T).map(t=>w(t,e,!1));o.unshift(r);let[s,l]=o.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(_(e.language).supersetOf===t.language)return 1;else if(_(t.language).supersetOf===e.language)return -1}return 0});return s.secondBest=l,s}function k(e){var t;let n,a=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";let i=y.languageDetectRe.exec(t);if(i){let t=_(i[1]);return t||(F(l.replace("{}",i[1])),F("Falling back to no-highlight mode for this block.",e)),t?i[1]:"no-highlight"}return t.split(/\s+/).find(e=>v(e)||_(e))}(e);if(v(a))return;if(B("before:highlightElement",{el:e,language:a}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(y.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),y.throwUnescapedHTML))throw new G("One of your code blocks includes unescaped HTML.",e.innerHTML);let r=e.textContent,o=a?C(r,{language:a,ignoreIllegals:!0}):S(r);e.innerHTML=o.value,e.dataset.highlighted="yes",t=o.language,n=a&&i[a]||t,e.classList.add("hljs"),e.classList.add(`language-${n}`),e.result={language:o.language,re:o.relevance,relevance:o.relevance},o.secondBest&&(e.secondBest={language:o.secondBest.language,relevance:o.secondBest.relevance}),B("after:highlightElement",{el:e,result:o,text:r})}let A=!1;function E(){if("loading"===document.readyState){A||window.addEventListener("DOMContentLoaded",function(){E()},!1),A=!0;return}document.querySelectorAll(y.cssSelector).forEach(k)}function _(e){return t[e=(e||"").toLowerCase()]||t[i[e]]}function I(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{i[e.toLowerCase()]=t})}function T(e){let t=_(e);return t&&!t.disableAutodetect}function B(e,t){o.forEach(function(i){i[e]&&i[e](t)})}for(let n in Object.assign(e,{highlight:C,highlightAuto:S,highlightAll:E,highlightElement:k,highlightBlock:function(e){return H("10.7.0","highlightBlock will be removed entirely in v12.0"),H("10.7.0","Please use highlightElement now."),k(e)},configure:function(e){y=r(y,e)},initHighlighting:()=>{E(),H("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){E(),H("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(i,n){let a=null;try{a=n(e)}catch(e){if(z("Language definition for '{}' could not be registered.".replace("{}",i)),s)z(e);else throw e;a=b}a.name||(a.name=i),t[i]=a,a.rawDefinition=n.bind(null,e),a.aliases&&I(a.aliases,{languageName:i})},unregisterLanguage:function(e){for(let n of(delete t[e],Object.keys(i)))i[n]===e&&delete i[n]},listLanguages:function(){return Object.keys(t)},getLanguage:_,registerAliases:I,autoDetection:T,inherit:r,addPlugin:function(e){var t;(t=e)["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))}),o.push(e)},removePlugin:function(e){let t=o.indexOf(e);-1!==t&&o.splice(t,1)}}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString="11.11.1",e.regex={concat:m,lookahead:u,either:g,optional:h,anyNumberOfTimes:p},M)"object"==typeof M[n]&&function e(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach(i=>{let n=t[i],a=typeof n;"object"!==a&&"function"!==a||Object.isFrozen(n)||e(n)}),t}(M[n]);return Object.assign(e,M),e},K=Z({});K.newInstance=()=>Z({}),t.exports=K,K.HighlightJS=K,K.default=K},154471,(e,t,i)=>{"use strict";function n(e,t,i,n){return!1}Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"getDomainLocale",{enumerable:!0,get:function(){return n}}),e.r(270090),("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},663230,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(191788);function a(e,t){let i=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=i.current;e&&(i.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(i.current=r(e,n)),t&&(a.current=r(t,n))},[e,t])}function r(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let i=e(t);return"function"==typeof i?i:()=>e(null)}}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},548735,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},539149,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n={default:function(){return k},useLinkStatus:function(){return S}};for(var a in n)Object.defineProperty(i,a,{enumerable:!0,get:n[a]});let r=e.r(871650),o=e.r(391398),s=r._(e.r(191788)),l=e.r(160472),d=e.r(471112),c=e.r(728169),u=e.r(889129),p=e.r(514862),h=e.r(425479),m=e.r(771914),g=e.r(154471),f=e.r(344113),b=e.r(663230);e.r(548735);let x=new Set;function y(e,t,i,n){if(!("u"{})}}function v(e){return"string"==typeof e?e:(0,c.formatUrl)(e)}let C=s.default.forwardRef(function(e,t){let i,n,{href:a,as:r,children:c,prefetch:x=null,passHref:C,replace:w,shallow:S,scroll:k,locale:A,onClick:E,onNavigate:_,onMouseEnter:I,onTouchStart:M,legacyBehavior:T=!1,transitionTypes:L,...j}=e;i=c,T&&("string"==typeof i||"number"==typeof i)&&(i=(0,o.jsx)("a",{children:i}));let P=s.default.useContext(h.RouterContext),D=!1!==x,{href:N,as:R}=s.default.useMemo(()=>{if(!P){let e=v(a);return{href:e,as:r?v(r):e}}let[e,t]=(0,l.resolveHref)(P,a,!0);return{href:e,as:r?(0,l.resolveHref)(P,r):t||e}},[P,a,r]),O=s.default.useRef(N),B=s.default.useRef(R);T&&(n=s.default.Children.only(i));let z=T?n&&"object"==typeof n&&n.ref:t,[F,H,W]=(0,m.useIntersection)({rootMargin:"200px"}),U=s.default.useCallback(e=>{(B.current!==R||O.current!==N)&&(W(),B.current=R,O.current=N),F(e)},[R,N,W,F]),V=(0,b.useMergedRef)(U,z);s.default.useEffect(()=>{!P||H&&D&&y(P,N,R,{locale:A})},[R,N,H,A,D,P?.locale,P]);let G={ref:V,onClick(e){T||"function"!=typeof E||E(e),T&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),!P||e.defaultPrevented||function(e,t,i,n,a,r,o,s,l){let c,{nodeName:u}=e.currentTarget;if(!("A"===u.toUpperCase()&&((c=e.currentTarget.getAttribute("target"))&&"_self"!==c||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)||e.currentTarget.hasAttribute("download"))){if(!(0,d.isLocalURL)(i)){a&&(e.preventDefault(),location.replace(i));return}e.preventDefault(),(()=>{if(l){let e=!1;if(l({preventDefault:()=>{e=!0}}),e)return}let e=o??!0;"beforePopState"in t?t[a?"replace":"push"](i,n,{shallow:r,locale:s,scroll:e}):t[a?"replace":"push"](n||i,{scroll:e})})()}}(e,P,N,R,w,S,k,A,_)},onMouseEnter(e){T||"function"!=typeof I||I(e),T&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),P&&y(P,N,R,{locale:A,priority:!0,bypassPrefetchedCheck:!0})},onTouchStart:function(e){T||"function"!=typeof M||M(e),T&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),P&&y(P,N,R,{locale:A,priority:!0,bypassPrefetchedCheck:!0})}};if((0,u.isAbsoluteUrl)(R))G.href=R;else if(!T||C||"a"===n.type&&!("href"in n.props)){let e=void 0!==A?A:P?.locale;G.href=P?.isLocaleDomain&&(0,g.getDomainLocale)(R,e,P?.locales,P?.domainLocales)||(0,f.addBasePath)((0,p.addLocale)(R,e,P?.defaultLocale))}return T?s.default.cloneElement(n,G):(0,o.jsx)("a",{...j,...G,children:i})}),w=(0,s.createContext)({pending:!1}),S=()=>(0,s.useContext)(w),k=C;("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},41158,(e,t,i)=>{t.exports=e.r(539149)},981721,959022,287396,135537,533663,590955,17031,830075,287163,732231,998493,127020,619256,702424,314240,72634,438109,985718,978864,485992,218025,43887,222625,307591,264333,743241,493731,503117,288294,364146,431026,516480,309847,272690,343857,500446,338812,569962,539106,13948,639014,643092,922128,681116,645315,809069,623275,824718,e=>{"use strict";e.s(["CARD_EDITOR_ID",0,"ai-card-editor"],981721);var t,i,n,a=e.i(391398);e.i(314572);var r=e.i(717834),o=e.i(296446),s=e.i(361183),l=e.i(191788),d=e.i(899611);let c=l.default.forwardRef(function(e,t){let i=e.as||"div",n=(0,r.useTiptapEditorEventCallback)((e,t)=>{let i=t.target,n=i.querySelector("[data-drag-handle]");if(n||(n=i.closest("[data-drag-handle]")),!n)return void t.preventDefault();try{let i=e.view.posAtDOM(n,0);if(!i||-1==i||!e.state.doc.nodeAt(i))return;(0,d.handleDragStart)(e,t,i,n)}catch(e){console.warn("(caught) [ReactNodeViewRenderer] onDragStart error moving annotations",e)}});return(0,a.jsx)(i,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:n,style:{whiteSpace:"normal",...e.style}})}),u=l.default.forwardRef(function(e,t){return(0,o.useIsInReactProseMirror)()?(0,a.jsx)(c,{ref:t,...e}):(0,a.jsx)(s.NodeViewWrapper,{ref:t,...e})});e.s(["NodeViewWrapper",0,u],959022),e.s(["useMobileAddCommentPos",0,({editor:e,decorations:t})=>{let i=t.filter(e=>!!e.spec.isMobileAnnotation),[n,a]=(0,l.useState)(null),r=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if(0===i.length){null!==r.current&&(document.removeEventListener("touchstart",r.current),r.current=null,a(null));return}r.current||(a({left:i[0].spec.offsetX,top:i[0].spec.offsetY}),r.current=t=>{t.target.closest(".mobile-add-comment-widget")||e.commands.setMobileAddBlockComment(null)},document.addEventListener("touchstart",r.current))},[e,i]),n}],287396),e.s(["useAnnotationComments",()=>W,"useAnnotationReactions",()=>K,"useDraftCommentsFromDecorations",()=>U,"useDraftReply",()=>Z,"useListenForCreateCommentFromSelection",()=>G,"useListenForOpenComment",()=>$,"useOnCommentSave",()=>V],590955);var p=e.i(620020),h=e.i(408122),m=e.i(755453),g=e.i(320037),f=e.i(148908),b=e.i(484742),x=e.i(949125);e.i(420945);var y=e.i(33823);e.i(185340);var v=e.i(863750),C=e.i(82050),w=e.i(418755),S=e.i(49202),k=e.i(551880),A=e.i(215531),E=e.i(24439),_=e.i(103630),I=e.i(625878);e.i(615835);var M=e.i(25747),T=e.i(159080);T.gql` query SearchMention( $workspaceId: ID! $query: String! $types: [SearchType!] = [user, doc] ) { search(orgId: $workspaceId, query: $query, types: $types) { __typename ... on DocResult { ...DocResultFragment } ... on User { id displayName email profileImageUrl } } } `;let L=T.gql` fragment ReactionFields on Reaction { emoji count targetId targetType docId users { id displayName profileImageUrl } } `,j=T.gql` fragment CommentAuthorFields on User { id displayName profileImageUrl email } `,P=T.gql` ${L} ${j} fragment ReplyFields on Comment { id commentId content createdTime updatedTime archived user { ...CommentAuthorFields } reactions { ...ReactionFields } } `;T.gql` ${P} ${L} ${j} fragment CommentFields on Comment { id docId cardId content targetText targetHtml createdTime updatedTime archived targetId status user { ...CommentAuthorFields } replies { ...ReplyFields } reactions { ...ReactionFields } } `,T.gql` query GetDocRobots($id: ID!) { doc(id: $id) { id title createdTime updatedTime searchEngineIndexingAllowed canonicalUrl currentSnapshot { id docId content } previewUrl organization { id name products # NB: Need this so that useCan works properly. __typename } createdBy { displayName id email } links { url nodeType status } theme { ...DefaultThemeFields } } } `,T.gql` mutation InviteMembers($workspaceId: ID!, $invitees: [InvitationInput!]!) { inviteMembers(orgId: $workspaceId, invitees: $invitees) { id name invitations { email } } } `,T.gql` ${P} ${L} ${j} mutation CreateComment($input: CreateCommentInput) { createComment(input: $input) { id docId cardId content targetText targetHtml createdTime updatedTime commentId archived targetId status user { ...CommentAuthorFields } replies { ...ReplyFields } reactions { ...ReactionFields } } } `,T.gql` mutation UpdateComment($input: UpdateCommentInput!) { updateComment(input: $input) { id docId content updatedTime } } `,T.gql` mutation UpdateCommentStatus($input: UpdateCommentStatusInput!) { updateCommentStatus(input: $input) { id status updatedTime } } `,T.gql` mutation RemoveComment($id: ID!) { archiveComment(id: $id) { id archived } } `,T.gql` ${L} fragment DocReactionsCreate on Doc { reactions { ...ReactionFields } } `;let D=T.gql` ${P} ${j} fragment DocCommentsCreate on Doc { comments { id docId cardId content targetText targetHtml createdTime updatedTime archived targetId status user { ...CommentAuthorFields } } } fragment DocRepliesCreate on Doc { comments { id replies { ...ReplyFields } } } fragment DocCommentsUpdate on Doc { comments { id docId content updatedTime reactions { ...ReactionFields } } } fragment DocRepliesUpdate on Doc { comments { id replies { id docId content updatedTime reactions { ...ReactionFields } } } } fragment DocCommentsRemove on Doc { comments { id archived } } fragment DocRepliesRemove on Doc { comments { id replies { id archived } } } `;T.gql` ${L} mutation AddReaction($reactionInput: AddReactionInput!) { addReaction(input: $reactionInput) { ...ReactionFields } } `,T.gql` ${L} mutation RemoveReaction($reactionInput: RemoveReactionInput!) { removeReaction(input: $reactionInput) { ...ReactionFields } } `,T.gql` query GetMemoAnalytics($memoId: ID!) { memoStats(id: $memoId) { memoId uniqueViewers uniqueEditors cardCount lastOpened viewers { user { id displayName email profileImageUrl } visitorId lastOpened cardsViewed } dailyViews { dayCount timezone everyone { date uniqueVisitors } viewers { date uniqueVisitors } } } } query GetDocCardsAnalytics($docId: ID!, $userId: ID) { docCardsStats(docId: $docId, userId: $userId) { docId uniqueVisitors uniqueEditors cardCount everyone { cardId viewTimePercent viewersPercent } viewers { cardId viewTimePercent viewersPercent } } } `,T.gql` mutation UpdateSearchEngineIndexing($fileId: ID!, $enable: Boolean!) { updateSearchEngineIndexing(fileId: $fileId, enable: $enable) { id searchEngineIndexingEnabled } } `,T.gql` query GetPublicDoc($docId: ID!) { publicDoc(id: $docId) { id logoUrl } } `,T.gql` query GetDocCurrentSnapshotId($id: ID!) { doc(id: $id) { id currentSnapshotId } } `,T.gql` query GetDocCurrentSnapshot($id: ID!, $password: String) { doc(id: $id, password: $password) { id currentSnapshot { content __typename } } } `,e.s(["DOC_COMMENTS_FRAGMENTS",0,D],135537);var N=e.i(256266),R=e.i(437994);let O=(e,t)=>{for(let i of e){if(i.id===t)return t;for(let e of i.replies||[])if(e.id===t)return i.id}return null},B=e=>(0,R.default)(e.reactions.flatMap(e=>e.users),"id");e.s(["getBlockReactionUsers",0,B,"getExistingReaction",0,({reactions:e,emoji:t})=>{let i=e.find(e=>e.emoji===t);return i&&i.reactions.find(e=>e.emoji===t)||null},"getNewComment",0,(e,t)=>{let i=(0,g.default)(e,"id"),n=[];return t.forEach(e=>{i[e.id]||n.push(e)}),n[0]||null},"getParentCommentId",0,O,"hasUserReacted",0,({reactions:e,emoji:t,user:i})=>!!(({reactions:e,emoji:t,user:i})=>{let n=e.find(e=>e.emoji===t);return n&&n.reactions.find(e=>e.emoji===t&&e.users?.find(e=>e.id===i?.id))||null})({reactions:e,emoji:t,user:i})],533663);let z=(0,N.isMobileDevice)()?"bottom":"top";function F(e){return e?e.reduce((e,t)=>(t.targetId&&(e[t.targetId]?e[t.targetId].push(t):e[t.targetId]=[t]),e),{}):null}let H=e=>e.filter(e=>!!e.spec.isAnnotation),W=e=>(0,w.useAppSelector)(t=>{let i=(0,C.selectDoc)(t),n=F((i?.comments||[]).filter(e=>e.status===v.CommentStatus.Open));if(!n)return[];let a=H(e);return(0,b.default)(a,({spec:e})=>n[e.id]).filter(Boolean)},x.default),U=e=>e.filter(e=>!!e.spec.isDraftComment).map(e=>e.spec.comment),V=({draftComment:e,clearDraftComment:t,editor:i})=>{let[n]=(0,v.useCreateCommentMutation)(),a=(0,p.useToast)(),r=i.gammaDocId,{user:o}=(0,M.useUserContext)();return s=>{if(!e)return;let{relativePos:l,targetId:d}=e,c=(0,I.relativeToAbsolutePos)(i.state,l);if(!c)throw Error("Could not save comment, null pos from relativePos");let u=(0,m.findParentNodeClosestToPos)(i.state.doc.resolve(c),_.isCardNode),p=i.view.state.doc.nodeAt(c),g=e.targetHtml||(0,A.generateHtmlFromNode)(p,["footnote","footnoteLabel","cardNotes"]),f=e.targetHtml||(0,A.generateTextFromNode)(p,["footnote","footnoteLabel","cardNotes"]);i.commands.addAnnotation({id:d,pos:c});let b={targetId:d,docId:r,cardId:u?.node?.attrs.id,content:s,targetHtml:g,targetText:f};n({variables:{input:b},update:(e,{data:t})=>{e.writeFragment({id:`Doc:${r}`,fragment:D,fragmentName:"DocCommentsCreate",data:{comments:[t?.createComment]}})},optimisticResponse:{createComment:{id:"temp-id",commentId:"",__typename:"Comment",...b,content:JSON.parse(JSON.stringify(s)),user:o,archived:!1,reactions:[],replies:[],status:v.CommentStatus.Open,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),a({title:h.i18n._({id:"4kSebh",message:"Comment posted."}),status:"success",duration:5e3,isClosable:!1,position:z}),t()}},G=(e,t)=>{(0,l.useEffect)(()=>{let i=!0,n=({selectionPos:n,parentPos:a,text:r})=>{i&&e()===a&&t({targetHtml:r,getPos:()=>n})};return S.TiptapEventBus.on(S.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,n),()=>{S.TiptapEventBus.on(S.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,n),i=!1}},[e,t])},$=({showComment:e,comments:t,blockAllowsCommenting:i,highlightDuration:n=4e3})=>{let[a,r]=(0,l.useState)(null);return(0,l.useEffect)(()=>{let a=!0,o=({commentId:o,highlightComment:s=!1})=>{if(!a||!i)return;let l=O(t,o);l&&(e(l),s&&(r(o),setTimeout(()=>{a&&r(null)},n)))};return S.TiptapEventBus.on(S.EventBusEvent.OPEN_POPUP_COMMENT,o),()=>{S.TiptapEventBus.off(S.EventBusEvent.OPEN_POPUP_COMMENT,o),a=!1}},[t,i,n,e]),a},Z=e=>{let t=(0,y.useDispatch)(),i=(0,w.useAppSelector)((0,k.selectDraftCommentReplyForCommentId)(e)),n=(0,l.useRef)(i??null),[a,r]=(0,l.useState)(!!i),o=(0,l.useCallback)(e=>{n.current=e,r(!!e)},[]),s=(0,l.useCallback)(()=>{n.current&&n.current.text?.length?t((0,k.updateDraftReply)({id:e,reply:n.current})):t((0,k.deleteDraftReply)({id:e}))},[e,t]),d=(0,l.useRef)(s);return(0,l.useEffect)(()=>{d.current=s},[s]),(0,l.useEffect)(()=>()=>{d.current()},[]),{hasLocalDraftReply:a,initialDraftReply:n.current,updateLocalDraftReply:o}},K=e=>(0,w.useAppSelector)(t=>{let i=(0,C.selectDoc)(t),n=F(i?.reactions||[]);if(!n)return[];let a=H(e),r=(0,b.default)(a,({spec:e})=>n[e.id]).filter(Boolean),o=(0,g.default)(r,"emoji"),s=[];for(let[e,t]of Object.entries(o)){let i=t.reduce((e,t)=>e+t.count,0);s.push({emoji:e,count:i,reactions:t})}return(0,f.default)(s.filter(e=>e.count>0),"count").reverse()},x.default);var q=e.i(428683),Y=e.i(555145),X=e.i(575084),Q=e.i(970346),J=e.i(613616),ee=e.i(918228),et=e.i(524473),ei=e.i(358280),en=e.i(498817),ea=e.i(325059),er=e.i(261442),eo=e.i(969641),es=e.i(865799),el=e.i(541075);e.i(828525);var ed=e.i(896620);let ec=(0,l.memo)(({isMobile:e,icon:t,badgeCount:i,tooltip:n,children:r,...o})=>{e&&delete o._hover;let s=(0,a.jsx)(Y.HStack,{className:"block-comment-button-wrapper",children:(0,a.jsxs)(eo.Button,{variant:"custom",borderRadius:"full",size:"sm",bgGradient:"none",color:"yellow.600",boxSize:e?10:8,border:e?"":"1px solid white",transitionProperty:"common",transitionDuration:"normal",_hover:e?{}:{bgGradient:"linear(to-b, yellow.300, yellow.400)",color:"yellow.700"},...o,children:[t&&(0,a.jsx)(el.FontAwesomeIcon,{size:e?"lg":"sm",icon:t}),r&&r,void 0!==i&&(0,a.jsx)(es.Badge,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,right:-1,shadow:"base","data-testid":"badge-count",children:i})]})});return n?(0,a.jsx)(ed.GammaTooltip,{placement:"left",label:n,children:s}):s});ec.displayName="GenericBlockCommentButton";var eu=e.i(865080);let ep="350px";e.s(["COMMENT_POPUP_WIDTH",0,ep,"MAX_POPUP_OFFSET_TOP",0,128,"MEMO_LEVEL_COMMENT_ABS_POS",0,1,"NEW_COMMENT_TEMP_ID",0,"temp-id"],17031);var eh=e.i(428624),em=e.i(53158);let eg=(0,l.memo)(({nodeName:e})=>{let t=(0,ea.useRtlEnabled)(),i="gridLayout"===e||"gallery"===e?"-1 * var(--grid-padding)":"0px",n=`calc(${i} + var(--comment-padding) + 50%)`;return(0,a.jsx)(em.Circle,{contentEditable:!1,userSelect:"none",insetEnd:0,size:4,top:(e=>{if("cardImageItem"===e)return"var(--card-inner-padding-y)"})(e),transform:`translate(calc(${n} * ${t?"-1":"1"}),calc(50%)) scale(1)`,position:"absolute",bgGradient:"linear(to-b, yellow.200, yellow.300)",border:"1px solid white",shadow:"0 0 0 1px rgb(0 0 0 / 10%)",className:"block-comments-circle",zIndex:"1"})});eg.displayName="BlockCommentsCircle";let ef="comments-wrapper",eb=(0,l.forwardRef)(function(e,t){let{nodeName:i,isPopupOpen:n,onKeyDown:r,buttonRef:o,side:s,isMobile:l,hasCommentsOrReactions:d,children:c,isEmpty:u,...p}=e;return(0,a.jsxs)(q.Box,{ref:t,contentEditable:!1,suppressContentEditableWarning:!0,pointerEvents:"none","data-comments-wrapper":!0,"data-is-popup-open":n,className:ef,alignSelf:"start",onKeyDown:r,"data-print-hidden":!0,children:[!u&&!l&&(0,a.jsx)(eg,{nodeName:i}),(0,a.jsx)(Y.HStack,{contentEditable:!1,suppressContentEditableWarning:!0,...l?d?{pt:4}:{}:{position:"absolute",ms:"after"===s?"0":"100%",top:"cardImageItem"===i?"var(--card-inner-padding-y)":0,height:"100%",align:"flex-start"},className:`controls-wrapper controls-wrapper__${i}`,children:(0,a.jsx)(J.Flex,{direction:"row",ref:o,contentEditable:!1,suppressContentEditableWarning:!0,transitionProperty:"common",transitionDuration:"fast",zIndex:n?eh.DOC_Z_INDEXES.commentsStackOpen:eh.DOC_Z_INDEXES.commentsStack,"data-controls-toggle-button":!0,ms:[0,"-17px"],...p,children:c})})]})});e.s(["BlockCommentsWrapper",0,eb,"COMMENTS_WRAPPER_CLASSNAME",0,ef],830075);let ex=({comments:e,reactions:t,draftComment:i})=>{let n=(({comments:e,reactions:t,draftComment:i})=>{if(i&&i.text.trim().length>0)return"draft";if(0===e.length)return 0===t.length?"fresh":"reactions-only";if(1===e.length)return"single-thread";if(e.length>1)return"multiple-threads";throw Error("Invalid button state")})({comments:e,reactions:t,draftComment:i});return{state:n,allCount:e.reduce((e,t)=>e+(t.replies?.length||0),0)+t.reduce((e,t)=>e+t.count,0)+e.length,overflowReactionCount:Math.max(0,t.length-7)}},ey=({comments:e,reactions:t})=>{let i=t.flatMap(e=>e.reactions.map(e=>e.users)).flat(),n=e.map(e=>e.user).concat(e.map(e=>e.replies.map(e=>e.user)).flat()).filter(Boolean),a=(({comments:e,reactions:t})=>{let i={};return e.forEach(e=>{i[e.id]=[e.user],e.replies.forEach(t=>{i[e.id].push(t.user)})}),Object.entries(i).forEach(([e,t])=>{i[e]=(0,R.default)(t,"id")}),i})({comments:e,reactions:t}),r=(0,R.default)([...n,...i],"id"),o=[],s=(({reactions:e})=>{let t={};return e.forEach(e=>{t[e.emoji]=(0,R.default)(e.reactions.flatMap(e=>e.users),"id")}),t})({reactions:t});return e.forEach(e=>{o.push(a[e.id])}),{allAvatars:r,reactionAvatars:s,commentAvatars:o}},ev=({editor:e,getPos:t})=>{let i=t(),n="number"==typeof i?e.view.nodeDOM(i):null,[a,r]=(0,l.useState)(null);return((0,l.useLayoutEffect)(()=>{r(n instanceof HTMLElement?n.offsetHeight:100)},[]),null===a)?null:Math.min(a,128)};e.s(["REACTION_COUNT_TO_SHOW",0,7,"useAvatarGroupData",0,ey,"useBlockCommentsButtonData",0,ex,"useClickOutsideToHide",0,({isOpen:e,popupRef:t,onClose:i})=>{(0,eu.useOutsideClick)({ref:t,handler:t=>{(0,N.isMobileOrTabletDevice)()&&!t?.target?.closest(`.${ef} [data-controls-toggle-button]`)||!e||t?.target?.closest("[data-controls-toggle-button]")||t?.target?.closest('[data-target-name="emoji-list"]')||t?.target?.closest('[data-target-name="mention-list"]')||t?.target?.closest('[data-target-name="reaction-emoji-picker"]')||t?.target?.closest(".chakra-menu__menu-list")||t?.target?.closest('[data-target-name="doc-mention-popup"]')||i()}})},"useDomNodeOffsetFromTop",0,ev,"useExpandedAndHideOthers",0,({popup:e,isMobile:t,isHovered:i,comments:n,reactions:a,draftComment:r,enableReactions:o})=>{let{state:s}=ex({comments:n,reactions:a,draftComment:r}),d=t||o&&i||!o&&i&&"fresh"!==s||null!==e;return(0,l.useEffect)(()=>{t||(d?document.body.classList.add("is-taking-action"):document.body.classList.remove("is-taking-action"))},[d,t]),{isExpanded:d}}],287163);var eC=e.i(147349),ew=e.i(887527),eS=e.i(198311);let ek=30,eA=({users:e,selfUserId:t})=>((e,t=ek)=>e.length?1===e.length?e[0]:2===e.length?e.join(" and "):e.length<=t?`${[e.slice(0,e.length-1).join(", "),e[e.length-1]].join(", and ")}`:`${[e.slice(0,t).join(", "),`${e.length-t} ${e.length-t>1?"others":"other"}`].join(", and ")}`:null)(e?[...e].sort(e=>e?.id===t?-1:1).map(e=>e?.id===t?"You":e?.displayName||""):[]);e.s(["generateNamePhrase",0,eA],732231);let eE=(0,eS.motion)(q.Box),e_=(0,l.memo)(({emojis:e,rtlEnabled:t})=>(0,a.jsx)(a.Fragment,{children:e?.map((i,n)=>0===n?(0,a.jsx)(eE,{initial:{x:t?"-6px":"6px",y:"5px"},textShadow:e?.length>1?"0px 1px 3px rgba(0,0,0,.4)":"none",fontSize:"20px",position:"absolute",zIndex:1,children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:i})},n):1===n?(0,a.jsx)(eE,{zIndex:0,initial:{x:t?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"10deg",x:t?"-18px":"18px",y:"-3px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:i})},n):2===n?(0,a.jsx)(eE,{zIndex:0,initial:{x:t?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:t?"3px":"-3px",y:"16px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:i})},n):3===n?(0,a.jsx)(eE,{zIndex:0,initial:{x:t?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:t?"3px":"-3px",y:"-3px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:i})},n):null)}));e_.displayName="EmojiCluster";let eI=(0,eS.motion)(q.Box),eM=(0,l.memo)(({emoji:e,emojiCluster:t,isMobile:i,user:n,canReact:r,reaction:o,badgeCount:s,onClick:d,...c})=>{let u=(0,ea.useRtlEnabled)(),p=B(o),h=!!p.find(e=>e.id===n?.id),m=eA({users:p,selfUserId:n?.id||""}),g=(0,a.jsxs)(q.Box,{alignContent:"center",children:[(0,a.jsx)(ei.Trans,{message:"{usersLabel} <0>reacted with :{emoji}:",id:"mRnNF/",values:{usersLabel:m,emoji:e},components:{0:(0,a.jsx)(ew.Text,{as:"span",color:"gray.300"})}}),r&&(0,a.jsx)(ew.Text,{display:"block",color:"gray.500",children:h?(0,a.jsx)(ei.Trans,{message:"Click to remove",id:"fb/FjL"}):(0,a.jsx)(ei.Trans,{message:"Click to react",id:"AG3H1y"})})]}),f=(0,a.jsx)(Y.HStack,{className:"block-comment-button-wrapper",children:(0,a.jsxs)(eo.Button,{variant:"ghost",borderRadius:"full",size:"sm",boxSize:i?10:8,transitionProperty:"common",transitionDuration:"normal",...h?{bg:"gray.50",borderColor:i?"blackAlpha.200":"gray.200"}:{},...c,onClick:e=>{r&&d&&d(e)},pos:"relative",children:[(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(eC.Spinner,{size:"sm"}),children:(0,a.jsxs)(ew.Text,{pos:"absolute",inset:0,as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"},":hover::before":i?{}:{backgroundColor:"transparent"}}},fontSize:i?"1.5em":"1.25em",children:[!t&&(0,a.jsx)(eI,{initial:{x:u?"-6px":"6px",y:"5px"},fontSize:"20px",position:"absolute",zIndex:1,children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:e})}),(0,a.jsx)(en.AnimatePresence,{children:(0,a.jsx)(e_,{emojis:t,rtlEnabled:u})})]})}),void 0!==s&&(0,a.jsx)(es.Badge,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,insetEnd:-1,shadow:"base",zIndex:1,children:s})]})});return g?(0,a.jsx)(ed.GammaTooltip,{placement:"left",label:g,children:f}):f});eM.displayName="ReactionButton",e.s(["ReactionButton",0,eM],998493);let eT={bg:"yellow.600",color:"yellow.100",_hover:{bg:"yellow.600",color:"yellow.100"}},eL={bg:"yellow.100",color:"yellow.800"},ej="linear(to-b, yellow.200, yellow.300)",eP=e=>{e.stopPropagation()},eD=(0,l.memo)(({user:e,userCanComment:t,isExpanded:i,isMobile:n,comments:r,reactions:o,draftComment:s,onClickThread:l,onClickAddComment:d,onClickAddReaction:c,onClickReactionsOverflow:u,onClickExistingReaction:p,onClosePopup:h,hideAddCommentButton:m=!1,viewingCommentId:g,enableReactions:f,blockAllowsCommenting:b,onCommentButtonHover:x,...y})=>{let v=(0,ea.useRtlEnabled)(),{state:C,allCount:w,overflowReactionCount:S}=ex({comments:r,reactions:o,draftComment:s}),k=[];if(!i)switch(C){case"draft":k.push((0,a.jsx)(ec,{isMobile:n,icon:et.faCommentLines,onClick:d,bg:i?"gray.50":"white",_hover:eL,color:"gray.600"},"draft"));break;case"fresh":k.push((0,a.jsx)(ec,{isMobile:n,icon:X.faCommentPlus,bg:i?"gray.50":"white",_hover:eL,color:"gray.600",bgGradient:ej,tooltip:(0,a.jsx)(ei.Trans,{message:"Add comment",id:"oFsfkI"}),"data-testid":"create-comment-button",onClick:d},"fresh"));break;case"reactions-only":if(o.length>0){let i=o[0],r=o.reduce((e,t)=>(e.push(t.emoji),e),[]);k.push((0,a.jsx)(eM,{isMobile:n,onClick:e=>{p(i),e.stopPropagation()},reaction:i,user:e,badgeCount:w,emoji:i.emoji,"data-testid":`reaction-${i.emoji}`,emojiCluster:r,canReact:t&&b},i.emoji))}break;case"single-thread":k.push((0,a.jsx)(ec,{isMobile:n,icon:X.faComment,bgGradient:ej,badgeCount:w,"data-testid":"single-thread",onMouseEnter:x?()=>x(r[0]):void 0,onMouseLeave:x?()=>x(null):void 0},"first-thread"));break;case"multiple-threads":k.push((0,a.jsx)(ec,{isMobile:n,bgGradient:ej,icon:X.faComments,badgeCount:w,"data-testid":"multiple-threads",onMouseEnter:x?()=>x(r[0]):void 0,onMouseLeave:x?()=>x(null):void 0},"first-thread"))}return(i&&(r.forEach((e,t)=>{let i=null!==g&&e.id===g,r=i?()=>h():()=>l(e);k.push((0,a.jsx)(ec,{isMobile:n,icon:X.faComment,badgeCount:e.replies.length+1,bgGradient:ej,onClick:r,"data-testid":`thread-${t}`,onMouseEnter:x?()=>x(e):void 0,onMouseLeave:x?()=>x(null):void 0,...i?eT:{}},0===t?"first-thread":`thread-${t}`))}),f&&(o.slice(0,7).forEach(i=>{k.push((0,a.jsx)(eM,{isMobile:n,onClick:e=>{p(i),e.stopPropagation()},"data-testid":`reaction-${i.emoji}`,reaction:i,user:e,badgeCount:i.count,emoji:i.emoji,canReact:t&&b},i.emoji))}),S>0&&k.push((0,a.jsxs)(ec,{isMobile:n,onClick:()=>{u()},bg:"gray.50",color:"yellow.800",_hover:eL,children:["+",S]},"reactions-overflow"))),"draft"===C?k.push((0,a.jsx)(ec,{isMobile:n,icon:et.faCommentLines,tooltip:(0,a.jsx)(ei.Trans,{message:"Edit draft comment",id:"x8Zuns"}),onClick:d,bg:i?"gray.50":"white",_hover:eL,"data-testid":"create-comment-button-draft",color:"gray.600"},"draft")):m||n||k.push((0,a.jsx)(ec,{isMobile:n,icon:X.faCommentPlus,transform:v?"scaleX(-1)":"",bgGradient:ej,tooltip:(0,a.jsx)(ei.Trans,{message:"Add comment",id:"oFsfkI"}),onClick:d,bg:i?"gray.50":"white",_hover:eL,"data-testid":"create-comment-button",color:"gray.600"},"fresh")),f&&t&&!m&&!n&&k.push((0,a.jsx)(ec,{isMobile:n,icon:X.faSmilePlus,transform:v?"scaleX(-1)":"",bgGradient:ej,onClick:()=>{c()},tooltip:(0,a.jsx)(ei.Trans,{message:"Add reaction",id:"9OEgyT"}),"data-testid":"add-reaction-button",bg:"gray.50",_hover:eL,color:"gray.600"},"add-reaction"))),n)?(0,a.jsx)(J.Flex,{className:"block-comments-inner-stack",userSelect:"none",transitionProperty:"all",transitionDuration:"fast",flexDir:"row",flexWrap:"wrap",onClick:eP,children:k}):(0,a.jsxs)(ee.Stack,{className:"block-comments-inner-stack",userSelect:"none",spacing:0,width:"34px",transitionProperty:"all",transitionDuration:"fast",onClick:eP,borderRadius:"full",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white",border:"1px solid transparent",onMouseDown:er.preventDefaultToAvoidBlur,"data-testid":"block-comments-buttons",...y,children:[(0,a.jsx)(q.Box,{children:k[0]}),(0,a.jsx)(Q.Collapse,{in:i,startingHeight:0,transitionEnd:{enter:{overflow:"initial"}},children:(0,a.jsx)(en.AnimatePresence,{children:k.length>1&&(0,a.jsx)(ee.Stack,{spacing:1,children:k.slice(1)})})})]})});eD.displayName="BlockCommentsButtons",e.s(["BlockCommentsButtons",0,eD,"YELLOW_BG_GRADIENT",0,ej,"YELLOW_HOVER_STYLES",0,eL],127020);let eN=(0,l.memo)(({onClickAddComment:e,onClickAddReaction:t,...i})=>(0,a.jsx)(q.Box,{className:"mobile-add-comment-widget",pos:"absolute",transform:"translate(-50%,-50%) scale(1)",mt:-6,background:"white",p:"4px",borderRadius:"full",shadow:"lg",transitionProperty:"common",transitionDuration:"normal",transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1);",zIndex:9,...i,children:(0,a.jsxs)(Y.HStack,{spacing:1,children:[(0,a.jsx)(ec,{isMobile:!0,icon:X.faCommentPlus,bg:"white",_hover:eL,color:"gray.600",bgGradient:ej,onClick:()=>{e()}},"fresh"),(0,a.jsx)(ec,{isMobile:!0,icon:X.faSmilePlus,bgGradient:ej,onClick:()=>{t()},bg:"white",_hover:eL,color:"gray.600"},"add-reaction")]})}));eN.displayName="MobileAddCommentWidget",e.s(["MobileAddCommentWidget",0,eN],619256);var eR=e.i(314305),eO=e.i(743373);let eB=(0,l.memo)(({comments:e,reactions:t,isExpanded:i,avatarMax:n=4})=>{let{allAvatars:r,reactionAvatars:o,commentAvatars:s}=ey({comments:e,reactions:t});return(0,a.jsxs)(ee.Stack,{className:"avatar-group-popup",spacing:1,transitionProperty:"common",transitionDuration:"fast",onClick:e=>{e.stopPropagation()},p:"1px",ps:3,userSelect:"none",children:[!i&&(0,a.jsx)(eR.AvatarGroup,{max:n,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:r.map((e,t)=>(0,a.jsx)(eO.Avatar,{zIndex:r.length-t,me:-3,name:e?.displayName,src:e?.profileImageUrl,shadow:"base",ignoreFallback:!0},`unexpanded-${e?.id}`))}),i&&(0,a.jsxs)(a.Fragment,{children:[s.map((e,t)=>(0,a.jsx)(eR.AvatarGroup,{max:n,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:e.map((e,t)=>(0,a.jsx)(eO.Avatar,{zIndex:r.length-t,me:-3,name:e?.displayName,src:e?.profileImageUrl,shadow:"base",ignoreFallback:!0},`comment-${e?.id}`))},`comment-${t}`)),t.slice(0,7).map((e,t)=>(0,a.jsx)(eR.AvatarGroup,{max:n,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:o[e.emoji].map((e,t)=>(0,a.jsx)(eO.Avatar,{zIndex:r.length-t,me:-3,name:e?.displayName,src:e?.profileImageUrl,shadow:"base",ignoreFallback:!0},`reaction-${e?.id}`))},`reaction-${t}`))]})]})});eB.displayName="AvatarGroupPopup",e.s(["AvatarGroupPopup",0,eB],702424),e.s(["EmojiToast",0,({isMobile:e,emoji:t})=>{let i=h.i18n._({id:"r2ONxg",message:"reaction added"});return(0,a.jsx)(l.Suspense,{fallback:(0,a.jsx)(eC.Spinner,{size:"sm"}),children:(0,a.jsxs)(ew.Text,{as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"}}},children:[(0,a.jsx)("em-emoji",{size:0,native:!0,id:t})," ",i,"."]})})}],314240),e.s(["AddCommentPopup",()=>rj],623275),e.s([],438109);var ez=e.i(676828),eF=e.i(382167),eH=e.i(654656),eW=e.i(277395),eU=e.i(132421),eV=e.i(367792),eG=e.i(980349),e$=e.i(948408);let eZ=null,eK=null;(t={}).LOGIN_COMPLETE="loginComplete",t.LOGIN_FAILURE="loginFailure",t.SIGNUP_COMPLETE="signupComplete";var eq=((i={}).ACCEPT_DOC_INVITATION="accept-doc-invitation",i.ACCEPT_WORKSPACE_INVITATION="accept-workspace-invitation",i.DOC_ACCESS_LINK="doc-access-link",i.JOIN_WITH_CODE="join-with-code",i.DEFAULT_LOGIN="login",i.SIGNUP="signup",i),eY=e.i(85583),eX=e.i(131010),eQ=e.i(915161),eJ=e.i(263765),e0=e.i(210738),e1=e.i(99981),e2=e.i(203828),e3=e.i(103104);let e5={[eQ.AccountAccessErrorCode.INVALID_SIGNUP_CODE]:{title:(0,a.jsx)(ei.Trans,{message:"Hmm... We couldn't sign you up for {GAMMA_PROPER_NOUN}.",id:"F6yt1L",values:{GAMMA_PROPER_NOUN:e3.GAMMA_PROPER_NOUN}}),description:(0,a.jsx)(ei.Trans,{message:"The link that you followed is no longer valid. Please try signing up again.",id:"hVNvhu"}),message:(0,a.jsx)(ei.Trans,{message:"Invalid signup code. Please try signing up again.",id:"gpu6pk"})},[eQ.AccountAccessErrorCode.INVALID_RESET_CODE]:{title:(0,a.jsx)(ei.Trans,{message:"Hmm... We couldn't reset your password.",id:"SvShcH"}),description:(0,a.jsx)(ei.Trans,{message:"The link that you followed is no longer valid. Please try resetting your password again.",id:"Vm3y4h"})},[eQ.AccountAccessErrorCode.SIGNUP_ERROR]:{title:"",description:"",message:(0,a.jsx)(ei.Trans,{message:"Couldn't complete sign up. Contact support at {GAMMA_SUPPORT_EMAIL_ADDRESS} so we can help fix things for you.",id:"jgYgJi",values:{GAMMA_SUPPORT_EMAIL_ADDRESS:e3.GAMMA_SUPPORT_EMAIL_ADDRESS}})},[e0.SSOErrorCode.SSO_REQUIRED]:{title:(0,a.jsx)(ei.Trans,{message:"Sign in with SSO.",id:"g4GJrR"}),description:(0,a.jsx)(()=>{let e=(0,e2.useRouter)(),t=(0,p.useToast)(),{query:i}=e,n=(0,eX.sanitizeRedirectUrl)(i.redirect_to);return i.redirect_to&&!n&&eY.datadogLogs.logger.warn(`Unsafe redirect URL detected, rejecting redirect_to: ${i.redirect_to}`),(0,a.jsx)(ei.Trans,{message:"Your email domain uses Single Sign-On authentication. <0>Please sign in with SSO to continue.",id:"ujLUuZ",components:{0:(0,a.jsx)(eF.Link,{textDecoration:"underline",onClick:()=>{let i=n?`/sso?redirect_to=${encodeURIComponent(n)}`:"/sso";e.push(i),t.closeAll()},cursor:"pointer"})}})},{}),message:(0,a.jsx)(ei.Trans,{message:"Your email domain uses Single Sign-On authentication. Please use SSO to login.",id:"hdccS0"})},[e0.SSOErrorCode.SSO_REQUIRED_REDIRECT]:{title:"",description:""},[e0.SSOErrorCode.SSO_REQUIRED_FOR_JOIN]:{title:(0,a.jsx)(ei.Trans,{message:"SSO authentication required",id:"hVMOTu"}),description:(0,a.jsx)(ei.Trans,{message:"This workspace requires SSO authentication to join. Please sign in with SSO to continue.",id:"fbXAMA"})},[eJ.PasswordErrorCode.INCORRECT_PASSWORD_ENTERED]:{title:(0,a.jsx)(ei.Trans,{message:"Failed to update password",id:"WOLn0C"}),description:(0,a.jsx)(ei.Trans,{message:"Incorrect password entered. Please try again.",id:"d9sUlC"})},[eJ.PasswordErrorCode.PASSWORD_CHANGE_ERROR]:{title:(0,a.jsx)(ei.Trans,{message:"Failed to update password",id:"WOLn0C"}),description:(0,a.jsx)(ei.Trans,{message:"Couldn't change password. Contact support at {GAMMA_SUPPORT_EMAIL_ADDRESS} so we can help fix things for you.",id:"eHB0n7",values:{GAMMA_SUPPORT_EMAIL_ADDRESS:e3.GAMMA_SUPPORT_EMAIL_ADDRESS}})},[e1.WorkspaceErrorCode.OTHER_WORKSPACE_MEMBER]:{title:(0,a.jsx)(ei.Trans,{message:"Hmm... We can't add you to this workspace.",id:"J5F9Vo"}),description:(0,a.jsx)(ei.Trans,{message:"{GAMMA_PROPER_NOUN} currently only supports membership in a single workspace. Let us know at {GAMMA_SUPPORT_EMAIL_ADDRESS} if you need access to more than one workspace.",id:"KiZr3u",values:{GAMMA_PROPER_NOUN:e3.GAMMA_PROPER_NOUN,GAMMA_SUPPORT_EMAIL_ADDRESS:e3.GAMMA_SUPPORT_EMAIL_ADDRESS}})},[e1.WorkspaceErrorCode.PAID_WORKSPACE_JOIN_LINK_BLOCKED]:{title:(0,a.jsx)(ei.Trans,{message:"This join link is invalid",id:"HsMv0H"}),description:(0,a.jsx)(ei.Trans,{message:"Request workspace admin to invite you by email.",id:"pqY17S"})}};e.i(500711);var e4=e.i(500190),e6=e.i(994633);e.i(905506);var e9=e.i(84723);let e8=()=>{if(""===eV.config.SHARE_TOKEN)return;let{searchParams:e}=new URL(window.location.href);e.delete("token");let t=Object.fromEntries(e.entries());(0,e4.replaceState)({query:t})},e7=(e,t)=>{if(!e||t)return null;let i=e?.accessLinks?.find(e=>e.token===eV.config.SHARE_TOKEN);return i&&i.permission?i:null};e.s(["checkAccessLinkForLoggedOutUser",0,e7,"clearShareToken",0,e8,"useAccessLinkCollaborator",0,e=>{let{user:t,isGammaAdminUser:i}=(0,M.useUserContext)(),[n,{error:a}]=(0,v.useAddFileCollaboratorByAccessLinkMutation)();(0,e9.useHandleError)("[useAccessLinkCollaborator]: Error updating collaborator.",a),(0,l.useEffect)(()=>{if(!t||!e)return;let a=e.accessLinks?.find(e=>e.token===eV.config.SHARE_TOKEN);if(!a)return;let r=e6.abilityFactory.createForUser({...t,__typename:"User"});a.permission&&a.permission!==v.Permission.View&&r.cannot(a.permission,e)&&!i?n({variables:{fileId:e.id}}).then(()=>{e8(),(0,eV.setConfigValue)("SHARE_TOKEN","")}).catch(e=>console.error("[useAccessLinkCollaborator]: Error adding collaborator.",e)):e8()},[n,e,t,i])}],72634);let te=({accessLink:e,doc:t,refetchFn:i,...n})=>{let r=!(0,N.isWebview)(),o=(0,p.useToast)(),{refetch:s}=(0,M.useUserContext)(),l=i||s,d=e=>{let{title:t,description:i}=e5[e]||{title:(0,a.jsx)(ei.Trans,{message:"Unexpected Error",id:"U7nnQt"}),description:e};o.isActive(e)||o({title:t,description:i,position:"top",id:e,status:"error",isClosable:!0,duration:null})},c=e?.permission??"view",u={manage:(0,a.jsx)(ei.Trans,{message:"You can now comment on and edit this {GAMMA_ARTIFACT_PROPER_NOUN}",id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),edit:(0,a.jsx)(ei.Trans,{message:"You can now comment on and edit this {GAMMA_ARTIFACT_PROPER_NOUN}",id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),comment:(0,a.jsx)(ei.Trans,{message:"You can now view and add comments on this {GAMMA_ARTIFACT_PROPER_NOUN}",id:"gu6c+c",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),view:(0,a.jsx)(ei.Trans,{message:"You can now access this {GAMMA_ARTIFACT_PROPER_NOUN} later",id:"LoR9yH",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}})}[c],m={manage:(0,a.jsx)(ei.Trans,{message:"You've been invited to edit",id:"MEeXaP"}),edit:(0,a.jsx)(ei.Trans,{message:"You've been invited to edit",id:"MEeXaP"}),comment:(0,a.jsx)(ei.Trans,{message:"You've been invited to comment",id:"dx3Kfr"}),view:(0,a.jsx)(ei.Trans,{message:"You've been invited to view",id:"R2ZEYO"})}[c],g={manage:{icon:X.faPencil,colorScheme:"blue"},edit:{icon:X.faPencil,colorScheme:"blue"},comment:{icon:X.faComment,colorScheme:"yellow"},view:{icon:X.faFolder,colorScheme:"green"}},f=t?.editors?.map(e=>e.user.displayName)??[],b=(()=>{switch(c){case"manage":case"edit":switch(f.length){case 0:return(0,a.jsx)(ei.Trans,{message:"Get started in seconds <0>⚡️. Sign in to get <1>edit access to this {GAMMA_ARTIFACT_PROPER_NOUN}.",id:"bspMVx",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN},components:{0:(0,a.jsx)("span",{role:"img","aria-label":h.i18n._({id:"JGFG6q",message:"lightning-bolt"})}),1:(0,a.jsx)("strong",{})}});case 1:return(0,a.jsx)(ei.Trans,{message:"Get started in seconds <0>⚡️. Sign in to collaborate with <1>{0} on this {GAMMA_ARTIFACT_PROPER_NOUN}.",id:"w49thS",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN,0:f[0]},components:{0:(0,a.jsx)("span",{role:"img","aria-label":h.i18n._({id:"JGFG6q",message:"lightning-bolt"})}),1:(0,a.jsx)("strong",{})}});case 2:return(0,a.jsx)(ei.Trans,{message:"Join the party <0>🎉. Sign in to collaborate with <1>{0} and <2>{1}.",id:"Tz4Wi7",values:{0:f[0],1:f[1]},components:{0:(0,a.jsx)("span",{role:"img","aria-label":h.i18n._({id:"7Lrnj6",message:"party"})}),1:(0,a.jsx)("strong",{}),2:(0,a.jsx)("strong",{})}});default:return(0,a.jsx)(ei.Trans,{message:"Join the party <0>🎉. Sign in to collaborate with <1>{0} and {1} others.",id:"VhIJ/j",values:{0:f[0],1:f.length-1},components:{0:(0,a.jsx)("span",{role:"img","aria-label":h.i18n._({id:"7Lrnj6",message:"party"})}),1:(0,a.jsx)("strong",{})}})}case"comment":return(0,a.jsx)(ei.Trans,{message:"Join the conversation <0>💬. Sign in to add <1>comments and <2>reactions.",id:"vIOI7i",components:{0:(0,a.jsx)("span",{role:"img","aria-label":h.i18n._({id:"OoNfwA",message:"speech-bubble"})}),1:(0,a.jsx)("strong",{}),2:(0,a.jsx)("strong",{})}});default:return(0,a.jsx)(ei.Trans,{message:"Sign in to be able to <0>access this {GAMMA_ARTIFACT_PROPER_NOUN} later from your workspace.",id:"k/HcwJ",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN},components:{0:(0,a.jsx)("strong",{})}})}})(),x=async()=>{l&&(await l(),e8()),o.isActive("login-complete")||o({title:(0,a.jsx)(ei.Trans,{message:"You're logged in.",id:"yFvQAN"}),description:u,position:"top",id:"login-complete",status:"success",isClosable:!0,duration:5e3})};return(0,a.jsxs)(eH.VStack,{align:"stretch",...n,children:[(0,a.jsxs)(Y.HStack,{spacing:4,me:6,children:[(0,a.jsx)(tt,{icon:(0,a.jsx)(el.FontAwesomeIcon,{icon:g[c].icon}),colorScheme:g[c].colorScheme}),(0,a.jsx)(ez.Heading,{as:"p",size:"sm",children:m})]}),(0,a.jsx)(ew.Text,{fontSize:"sm",children:b}),(0,a.jsxs)(ee.Stack,{children:[r&&(0,a.jsx)(eo.Button,{variant:"solid",leftIcon:(0,a.jsx)(el.FontAwesomeIcon,{icon:eW.faGoogle}),size:"md",onClick:()=>{(({type:e,params:t,errorCallback:i,redirectTo:n,doneCallback:a})=>{let r=((e,t)=>{switch(e){case"join-with-code":{let{workspaceId:e,inviteCode:i,referredByUserId:n,identity_provider:a}=t,r=new URL(`${eV.config.API_HOST||"https://gamma.app"}/organizations/${e}/join/${i}`);return n&&r.searchParams.set("referredByUserId",n),a&&r.searchParams.set("identity_provider",a),r.toString()}case"accept-doc-invitation":{let{docId:e,email:i,inviteCode:n,identity_provider:a}=t,r=new URL(`${eV.config.API_HOST}/invitations/docs/${e}/`);return n&&r.searchParams.set("inviteCode",n),i&&r.searchParams.set("email",i),a&&r.searchParams.set("identity_provider",a),r.toString()}case"accept-workspace-invitation":{let{workspaceId:e,email:i,inviteCode:n,identity_provider:a}=t,r=new URL(`${eV.config.API_HOST}/invitations/workspaces/${e}`);return n&&r.searchParams.set("inviteCode",n),i&&r.searchParams.set("email",i),a&&r.searchParams.set("identity_provider",a),r.toString()}case"doc-access-link":{let{docId:e,shareToken:i,identity_provider:n}=t,a=new URL(`${eV.config.API_HOST}/access-links/docs/${e}/`);return i&&a.searchParams.set("token",i),n&&a.searchParams.set("identity_provider",n),a.toString()}case"signup":{let{inviteCode:e,referredByUserId:i,partnerStackClickId:n,partnerStackPartnerId:a,identity_provider:r}=t,o=new URL(`${eV.config.API_HOST||"https://gamma.app"}/signup`);return e&&o.searchParams.set("inviteCode",e),i&&o.searchParams.set("referredByUserId",i),n&&o.searchParams.set("partnerStackClickId",n),a&&o.searchParams.set("partnerStackPartnerId",a),r&&o.searchParams.set("identity_provider",r),o.toString()}default:{let e=new URL(`${eV.config.API_HOST}/login`);return t?.identity_provider&&e.searchParams.set("identity_provider",t.identity_provider),e.toString()}}})(e,t),o="toolbar=no, menubar=no, width=600, height=700, top=100, left=100";null===eZ||eZ.closed?eZ=window.open(r,e,o):eK!==r?null!==(eZ=window.open(r,e,o))&&eZ.focus():eZ.focus(),e$.loginBroadcastChannel.get().addEventListener("message",e=>{(({event:e,errorCallback:t,redirectTo:i,doneCallback:n})=>{let{data:a}=e;if("loginComplete"===a.type&&(0,eG.handleLoginComplete)({data:a?.payload?.data,redirectTo:i,doneCallback:n,shouldClientSideRedirect:!0,googleMethod:"POPUP"}),"signupComplete"===a.type&&(0,eG.handleSignupComplete)({data:a?.payload?.data,redirectTo:i,doneCallback:n,shouldClientSideRedirect:!0,googleMethod:"POPUP"}),"loginFailure"===a.type){let i=e?.data?.payload?.code,n=e?.data?.payload?.emailDomain;if(!t)return console.error("No error callback defined");if(!i)return console.error("No code defined");t(i,n)}})({event:e,errorCallback:i,redirectTo:n,doneCallback:a})}),eK=r})({type:eq.DOC_ACCESS_LINK,params:{docId:t?.id,shareToken:e.token},errorCallback:d,doneCallback:x})},children:(0,a.jsx)(ei.Trans,{message:"Continue with Google",id:"oZyG4C"})}),(0,a.jsx)(eo.Button,{variant:"plain",as:eF.Link,target:"_blank",leftIcon:(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faEnvelope}),href:"/signup",children:(0,a.jsx)(ei.Trans,{message:"Sign up with email",id:"yrlCvg"})}),(0,a.jsx)(ew.Text,{fontSize:"xs",color:"gray.600",children:(0,a.jsx)(ei.Trans,{message:"By clicking this link, you agree to {GAMMA_PROPER_NOUN}'s <0>Terms of Service and <1>Privacy Policy.",id:"oXChp6",values:{GAMMA_PROPER_NOUN:e3.GAMMA_PROPER_NOUN},components:{0:(0,a.jsx)(eF.Link,{href:eU.TERMS_OF_SERVICE_URL,isExternal:!0,fontWeight:"bold"}),1:(0,a.jsx)(eF.Link,{href:eU.PRIVACY_POLICY_URL,isExternal:!0,fontWeight:"bold"})}})})]})]})},tt=({icon:e,colorScheme:t})=>(0,a.jsxs)(em.Circle,{size:10,bg:`linear-gradient(to bottom, var(--chakra-colors-${t}-200), var(--chakra-colors-${t}-300))`,position:"relative",children:[(0,a.jsx)(q.Box,{color:`${t}.600`,display:"block",mt:"0.5",textAlign:"center",children:e}),(0,a.jsx)(em.Circle,{size:5,position:"absolute",bottom:-1,right:-1,color:`${t}.800`,bg:`${t}.100`,boxShadow:"base",fontSize:"xs",children:(0,a.jsx)(el.FontAwesomeIcon,{icon:X.faPlus})})]});e.i(24790),e.i(11507);var ti=e.i(402818);let tn=({accessLink:e,doc:t,className:i,showDivider:n=!0})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(te,{accessLink:e,doc:t,p:6,spacing:4,className:i}),n&&(0,a.jsx)(ti.Divider,{})]});e.s(["CommentSignUp",0,tn],985718),e.s([],922128),e.s(["CommentEditor",()=>rA],643092);var ta=a,tr=e.i(864860),to=e.i(892194),ts=et,tl=el;e.i(197071);var td=e.i(564246),tc=e.i(133350),tu=e.i(636339),tp=e.i(723641),th=e.i(955312),tm=e.i(835128),tg=ei,tf=e.i(28561),tb=e.i(949488);e.s(["CodeBlock",()=>i0,"CodeBlockView",()=>iJ,"LegacyCodeBlock",()=>i1],978864);var tx=e.i(335799),ty=e.i(344233),tv=e.i(721455),tC=e.i(148318),tw=e.i(826480),tS=e.i(182895),tk=e.i(704273),tA=e.i(259658),tE=e.i(935020),t_=e.i(175863),tI=/^```([a-z]+)?[\s\n]$/,tM=/^~~~([a-z]+)?[\s\n]$/,tT=m.Node.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:4,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:i}=this.options;if(!i)return null;let n=[...(null==(t=e.firstElementChild)?void 0:t.classList)||[]].filter(e=>e.startsWith(i)).map(e=>e.replace(i,""))[0];return n||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,m.mergeAttributes)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var i;return(null==(i=e.raw)?void 0:i.startsWith("```"))===!1&&"indented"!==e.codeBlockStyle?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var i;let n=(null==(i=e.attrs)?void 0:i.language)||"";return e.content?[`\`\`\`${n}`,t.renderChildren(e.content),"```"].join("\n"):`\`\`\`${n} \`\`\``},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,i=1===t.pos;return!!e&&t.parent.type.name===this.name&&(!!i||!t.parent.textContent.length)&&this.editor.commands.clearNodes()},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let i=null!=(t=this.options.tabSize)?t:4,{state:n}=e,{selection:a}=n,{$from:r,empty:o}=a;if(r.parent.type!==this.type)return!1;let s=" ".repeat(i);return o?e.commands.insertContent(s):e.commands.command(({tr:e})=>{let{from:t,to:i}=a,r=n.doc.textBetween(t,i,"\n","\n").split("\n").map(e=>s+e).join("\n");return e.replaceWith(t,i,n.schema.text(r)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let i=null!=(t=this.options.tabSize)?t:4,{state:n}=e,{selection:a}=n,{$from:r,empty:o}=a;return r.parent.type===this.type&&(o?e.commands.command(({tr:e})=>{var t;let{pos:a}=r,o=r.start(),s=r.end(),l=n.doc.textBetween(o,s,"\n","\n").split("\n"),d=0,c=0,u=a-o;for(let e=0;e=u){d=e;break}c+=l[e].length+1}let p=Math.min(((null==(t=l[d].match(/^ */))?void 0:t[0])||"").length,i);if(0===p)return!0;let h=o;for(let e=0;e{let{from:t,to:r}=a,o=n.doc.textBetween(t,r,"\n","\n").split("\n").map(e=>{var t;let n=Math.min(((null==(t=e.match(/^ */))?void 0:t[0])||"").length,i);return e.slice(n)}).join("\n");return e.replaceWith(t,r,n.schema.text(o)),!0}))},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:i}=t,{$from:n,empty:a}=i;if(!a||n.parent.type!==this.type)return!1;let r=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith("\n\n");return!!r&&!!o&&e.chain().command(({tr:e})=>(e.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:i,doc:n}=t,{$from:a,empty:r}=i;if(!r||a.parent.type!==this.type||a.parentOffset!==a.parent.nodeSize-2)return!1;let o=a.after();return void 0!==o&&(n.nodeAt(o)?e.commands.command(({tr:e})=>(e.setSelection(t_.Selection.near(n.resolve(o))),!0)):e.commands.exitCode())}}},addInputRules(){return[(0,m.textblockTypeInputRule)({find:tI,type:this.type,getAttributes:e=>({language:e[1]})}),(0,m.textblockTypeInputRule)({find:tM,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new t_.Plugin({key:new t_.PluginKey("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let i=t.clipboardData.getData("text/plain"),n=t.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,r=null==a?void 0:a.mode;if(!i||!r)return!1;let{tr:o,schema:s}=e.state,l=s.text(i.replace(/\r\n?/g,"\n"));return o.replaceSelectionWith(this.type.create({language:r},l)),o.selection.$from.parent.type!==this.type&&o.setSelection(t_.TextSelection.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),e.dispatch(o),!0}}})]}}),tL=e.i(596523),tj=e.i(767730);e.i(838054);var tP=e.i(432247),tD=e.i(408767),tN=e.i(194552),tR=e.i(892684),tO=e.i(438106),tB=e.i(577281);let tz=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],tF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),tH=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),tW=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),tU=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();var tV="[0-9](_*[0-9])*",tG=`\\.(${tV})`,t$="[0-9a-fA-F](_*[0-9a-fA-F])*",tZ={className:"number",variants:[{begin:`(\\b(${tV})((${tG})|\\.)?|(${tG}))[eE][+-]?(${tV})[fFdD]?\\b`},{begin:`\\b(${tV})((${tG})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${tG})[fFdD]?\\b`},{begin:`\\b(${tV})[fFdD]\\b`},{begin:`\\b0[xX]((${t$})\\.?|(${t$})?\\.(${t$}))[pP][+-]?(${tV})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t$})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};let tK="[A-Za-z$_][0-9A-Za-z$_]*",tq=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tY=["true","false","null","undefined","NaN","Infinity"],tX=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],tQ=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],tJ=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],t0=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],t1=[].concat(tJ,tX,tQ);var t2="[0-9](_*[0-9])*",t3=`\\.(${t2})`,t5="[0-9a-fA-F](_*[0-9a-fA-F])*",t4={className:"number",variants:[{begin:`(\\b(${t2})((${t3})|\\.)?|(${t3}))[eE][+-]?(${t2})[fFdD]?\\b`},{begin:`\\b(${t2})((${t3})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${t3})[fFdD]?\\b`},{begin:`\\b(${t2})[fFdD]\\b`},{begin:`\\b0[xX]((${t5})\\.?|(${t5})?\\.(${t5}))[pP][+-]?(${t2})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t5})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};let t6=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],t9=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),t8=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),t7=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),ie=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),it=t8.concat(t7).sort().reverse(),ii=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],ia=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),ir=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),io=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),is=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function il(e){return e?"string"==typeof e?e:e.source:null}function id(e){return ic("(?=",e,")")}function ic(...e){return e.map(e=>il(e)).join("")}function iu(...e){let t;return"("+(("object"==typeof(t=e[e.length-1])&&t.constructor===Object?(e.splice(e.length-1,1),t):{}).capture?"":"?:")+e.map(e=>il(e)).join("|")+")"}let ip=e=>ic(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ih=["Protocol","Type"].map(ip),im=["init","self"].map(ip),ig=["Any","Self"],ib=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ix=["false","nil","true"],iy=["assignment","associativity","higherThan","left","lowerThan","none","right"],iv=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],iC=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],iw=iu(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),iS=iu(iw,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ik=ic(iw,iS,"*"),iA=iu(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),iE=iu(iA,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),i_=ic(iA,iE,"*"),iI=ic(/[A-Z]/,iE,"*"),iM=["attached","autoclosure",ic(/convention\(/,iu("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",ic(/objc\(/,i_,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],iT=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"],iL="[A-Za-z$_][0-9A-Za-z$_]*",ij=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],iP=["true","false","null","undefined","NaN","Infinity"],iD=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],iN=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],iR=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],iO=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],iB=[].concat(iR,iD,iN),iz={arduino:function(e){let t,i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b=(t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="[a-zA-Z_]\\w*::",r="(?!struct)("+(n="decltype\\(auto\\)")+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},u=t.optional(a)+e.IDENT_RE+"\\s*\\(",g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},contains:(m=[h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},d,o,i,e.C_BLOCK_COMMENT_MODE,l,s]).concat([{begin:/\(/,end:/\)/,keywords:p,contains:m.concat(["self"]),relevance:0}]),relevance:0},f={className:"function",begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:p,relevance:0},{begin:u,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,i,e.C_BLOCK_COMMENT_MODE,d]},{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"",keywords:p,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}),x=b.keywords;return x.type=[...x.type,"boolean","byte","word","String"],x.literal=[...x.literal,"DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"],x.built_in=[...x.built_in,"KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],x._hints=["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],b.name="Arduino",b.aliases=["ino"],b.supersetOf="cpp",b},bash:function(e){let t=e.regex,i={};Object.assign(i,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},{begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[i]}]}]});let n={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},a=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),r={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},o={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,i,n]};n.contains.push(o);let s={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,i]},l=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),d={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),d,s,a,r,{match:/(\/[a-z._-]+)+/},o,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},i]}},c:function(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",r="("+n+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},u=t.optional(a)+e.IDENT_RE+"\\s*\\(",p={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[d,o,i,e.C_BLOCK_COMMENT_MODE,l,s],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:h.concat([{begin:/\(/,end:/\)/,keywords:p,contains:h.concat(["self"]),relevance:0}]),relevance:0},g={begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:p,relevance:0},{begin:u,returnBegin:!0,contains:[e.inherit(c,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,i,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C",aliases:["h"],keywords:p,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:d,strings:s,keywords:p}}},cpp:function(e){let t=e.regex,i=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),n="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",r="(?!struct)("+n+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},d={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},i,e.C_BLOCK_COMMENT_MODE]},c={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},u=t.optional(a)+e.IDENT_RE+"\\s*\\(",p={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},m=[h,d,o,i,e.C_BLOCK_COMMENT_MODE,l,s],g={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:p,contains:m.concat([{begin:/\(/,end:/\)/,keywords:p,contains:m.concat(["self"]),relevance:0}]),relevance:0},f={className:"function",begin:"("+r+"[\\*&\\s]+)+"+u,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:p,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:n,keywords:p,relevance:0},{begin:u,returnBegin:!0,contains:[c],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[i,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:["self",i,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,i,e.C_BLOCK_COMMENT_MODE,d]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:p,illegal:"",keywords:p,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:p},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},csharp:function(e){let t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),n={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},a={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},r=e.inherit(a,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:t},s=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,s]},d={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},c=e.inherit(d,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]});o.contains=[d,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.C_BLOCK_COMMENT_MODE],s.contains=[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,n,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let u={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d,l,a,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",m={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},u,n,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[i,p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,p],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[u,n,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},m]}},css:function(e){let t=e.regex,i={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},n=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[i.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},i.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+tH.join("|")+")"},{begin:":(:)?("+tW.join("|")+")"}]},i.CSS_VARIABLE,{className:"attribute",begin:"\\b("+tU.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[i.BLOCK_COMMENT,i.HEXCOLOR,i.IMPORTANT,i.CSS_NUMBER_MODE,...n,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...n,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},i.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:tF.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...n,i.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+tz.join("|")+")\\b"}]}},diff:function(e){let t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},go:function(e){let t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"e(t,i,n-1))}("(?:<"+i+"~~~(?:\\s*,\\s*"+i+"~~~)*>)?",/~~~/g,2),a={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},r={className:"meta",begin:"@"+i,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:a,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,i],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,i),/\s+/,i,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,i],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+n+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:a,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:a,relevance:0,contains:[r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,tZ,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},tZ,r]}},javascript:function(e){var t;let i=e.regex,n=/<[A-Za-z0-9\\._:-]+/,a=/\/[A-Za-z0-9\\._:-]+>|\/>/,r={$pattern:tK,keyword:tq,literal:tY,built_in:t1,"variable.language":t0},o="[0-9](_?[0-9])*",s=`\\.(${o})`,l="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${l})((${s})|\\.)?|(${s}))[eE][+-]?(${o})\\b`},{begin:`\\b(${l})\\b((${s})\\b|\\.)?|(${s})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},c={className:"subst",begin:"\\$\\{",end:"\\}",keywords:r,contains:[]},u={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"css"}},h={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,c],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,c]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:tK+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,p,h,m,{match:/\$\d+/},d];c.contains=f.concat({begin:/\{/,end:/\}/,keywords:r,contains:["self"].concat(f)});let b=[].concat(g,c.contains),x=b.concat([{begin:/(\s*)\(/,end:/\)/,keywords:r,contains:["self"].concat(b)}]),y={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:x},v={variants:[{match:[/class/,/\s+/,tK,/\s+/,/extends/,/\s+/,i.concat(tK,"(",i.concat(/\./,tK),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,tK],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:i.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...tX,...tQ]}},w={match:i.concat(/\b/,(t=[...tJ,"super","import"].map(e=>`${e}\\s*\\(`),i.concat("(?!",t.join("|"),")")),tK,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},S={begin:i.concat(/\./,i.lookahead(i.concat(tK,/(?![0-9A-Za-z$_(])/))),end:tK,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},k="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,tK,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(k)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[y]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:x,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,p,h,m,g,{match:/\$\d+/},d,C,{scope:"attr",match:tK+i.lookahead(":"),relevance:0},A,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:k,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:x}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:n,"on:begin":(e,t)=>{let i,n=e[0].length+e.index,a=e.input[n];if("<"===a||","===a)return void t.ignoreMatch();">"!==a||((e,{after:t})=>{let i="/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,l],relevance:0},e.C_LINE_COMMENT_MODE,l,o,s,r,e.C_NUMBER_MODE]},l]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,s]},r,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},t4]}},less:function(e){let t={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},i="[\\w-]+",n="("+i+"|@\\{"+i+"\\})",a=[],r=[],o=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},s=function(e,t,i){return{className:e,begin:t,relevance:i}},l={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:t9.join(" ")};r.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,o("'"),o('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,{begin:"\\(",end:"\\)",contains:r,keywords:l,relevance:0},s("variable","@@?"+i,10),s("variable","@\\{"+i+"\\}"),s("built_in","~?`[^`]*?`"),{className:"attribute",begin:i+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);let d=r.concat({begin:/\{/,end:/\}/,contains:a}),c={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(r)},u={begin:n+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ie.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:r}}]},p={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:n,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,c,s("keyword","all\\b"),s("variable","@\\{"+i+"\\}"),{begin:"\\b("+t6.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,s("selector-tag",n,0),s("selector-id","#"+n),s("selector-class","\\."+n,0),s("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+t8.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t7.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:d},{begin:"!important"},t.FUNCTION_DISPATCH]},h={begin:i+":(:)?"+`(${it.join("|")})`,returnBegin:!0,contains:[p]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:l,returnEnd:!0,contains:r,relevance:0}},{className:"variable",variants:[{begin:"@"+i+"\\s*:",relevance:15},{begin:"@"+i}],starts:{end:"[;}]",returnEnd:!0,contains:d}},h,u,p,c,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}},lua:function(e){let t="\\[=*\\[",i="\\]=*\\]",n={begin:t,end:i,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,i,{contains:[n],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:i,contains:[n],relevance:5}])}},makefile:function(e){let t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=e.inherit(a,{contains:[]}),s=e.inherit(r,{contains:[]});a.contains.push(s),r.contains.push(o);let l=[i,n];return[a,r,o,s].forEach(e=>{e.contains=e.contains.concat(l)}),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:l=l.concat(a,r)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:l}]}]},i,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,r,{className:"quote",begin:"^>\\s+",contains:l,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},objectivec:function(e){let t=/[a-zA-Z@][a-zA-Z0-9_]*/,i={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+i.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:i,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},perl:function(e){let t=e.regex,i=/[dualxmsipngr]{0,12}/,n={$pattern:/[\w.]+/,keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot class close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl field fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map method mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0"},a={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},r={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},s={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},d=[e.BACKSLASH_ESCAPE,a,s],c=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],u=(e,n,a="\\1")=>{let r="\\1"===a?a:t.concat(a,n);return t.concat(t.concat("(?:",e,")"),n,/(?:\\.|[^\\\/])*?/,r,/(?:\\.|[^\\\/])*?/,a,i)},p=(e,n,a)=>t.concat(t.concat("(?:",e,")"),n,/(?:\\.|[^\\\/])*?/,a,i),h=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),r,{className:"string",contains:d,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:u("s|tr|y",t.either(...c,{capture:!0}))},{begin:u("s|tr|y","\\(","\\)")},{begin:u("s|tr|y","\\[","\\]")},{begin:u("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:p("(?:m|qr)?",/\//,/\//)},{begin:p("m|qr",t.either(...c,{capture:!0}),/\1/)},{begin:p("m|qr",/\(/,/\)/)},{begin:p("m|qr",/\[/,/\]/)},{begin:p("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return a.contains=h,r.contains=h,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:h}},php:function(e){let t,i=e.regex,n=/(?![A-Za-z0-9])(?![$])/,a=i.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),r=i.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=i.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+a},l={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(l)}),u={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(l),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},p=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),h="[ \n]",m={scope:"string",variants:[c,d,u,p]},g={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},f=["false","null","true"],b=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],x=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],y={keyword:b,literal:(t=[],f.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t),built_in:x},v=e=>e.map(e=>e.replace(/\|\d+$/,"")),C={variants:[{match:[/new/,i.concat(h,"+"),i.concat("(?!",v(x).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},w=i.concat(a,"\\b(?!\\()"),S={variants:[{match:[i.concat(/::/,i.lookahead(/(?!class\b)/)),w],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,i.concat(/::/,i.lookahead(/(?!class\b)/)),w],scope:{1:"title.class",3:"variable.constant"}},{match:[r,i.concat("::",i.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},k={scope:"attr",match:i.concat(a,i.lookahead(":"),i.lookahead(/(?!::)/))},A={relevance:0,begin:/\(/,end:/\)/,keywords:y,contains:[k,s,S,e.C_BLOCK_COMMENT_MODE,m,g,C]},E={relevance:0,match:[/\b/,i.concat("(?!fn\\b|function\\b|",v(b).join("\\b|"),"|",v(x).join("\\b|"),"\\b)"),a,i.concat(h,"*"),i.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[A]};A.contains.push(E);let _=[k,S,e.C_BLOCK_COMMENT_MODE,m,g,C],I={begin:i.concat(/#\[\s*\\?/,i.either(r,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:f,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:f,keyword:["new","array"]},contains:["self",..._]},..._,{scope:"meta",variants:[{match:r},{match:o}]}]};return{case_insensitive:!1,keywords:y,contains:[I,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},s,E,S,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},C,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:y,contains:["self",I,s,S,e.C_BLOCK_COMMENT_MODE,m,g]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},m,g]}},"php-template":function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}},plaintext:function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}},python:function(e){let t=e.regex,i=/[\p{XID_Start}_]\p{XID_Continue}*/u,n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},r={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},s={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,r,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,r,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},d="[0-9](_?[0-9])*",c=`(\\b(${d}))?\\.(${d})|\\b(${d})\\.`,u=`\\b|${n.join("|")}`,p={className:"number",relevance:0,variants:[{begin:`(\\b(${d})|(${c}))[eE][+-]?(${d})[jJ]?(?=${u})`},{begin:`(${c})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${u})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${u})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${u})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${u})`},{begin:`\\b(${d})[jJ](?=${u})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},m={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",r,p,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,p,r],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[r,p,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[m]},{variants:[{match:[/\bclass/,/\s+/,i,/\s*/,/\(\s*/,i,/\s*\)/]},{match:[/\bclass/,/\s+/,i]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[p,m,l]}]}},"python-repl":function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}},r:function(e){let t=e.regex,i=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,n=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,r=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:i,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:i},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,n]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,n]},{scope:{1:"punctuation",2:"number"},match:[r,n]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,n]}]},{scope:{3:"operator"},match:[i,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:r},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},ruby:function(e){let t=e.regex,i="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",n=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(n,/(::\w+)*/),r={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],d={className:"subst",begin:/#\{/,end:/\}/,keywords:r},c={className:"string",contains:[e.BACKSLASH_ESCAPE,d],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,d]})]}]},u="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${u}))?([eE][+-]?(${u})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:r}]},m=[c,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:r},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:r},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:n,scope:"title.class"},{match:[/def/,/\s+/,i],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[c,{begin:i}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:r},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,d],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);d.contains=m,h.contains=m;let g=[{begin:/^\s*=>/,starts:{end:"$",contains:m}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:r,contains:m}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:r,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(g).concat(l).concat(m)}},rust:function(e){let t=e.regex,i=/(r#)?/,n=t.concat(i,e.UNDERSCORE_IDENT_RE),a=t.concat(i,e.IDENT_RE),r={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:s},illegal:""},r]}},scss:function(e){let t={IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}},i="@[a-z-]+",n={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ii.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+ir.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+io.join("|")+")"},n,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+is.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,n,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ia.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},n,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}},shell:function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}},sql:function(e){let t=e.regex,i=e.COMMENT("--","$"),n=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],a=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!n.includes(e)),r={match:t.concat(/\b/,t.either(...n),/\s*\(/),relevance:0,keywords:{built_in:n}};function o(e){return t.concat(/\b/,t.either(...e.map(e=>e.replace(/\s+/,"\\s+"))),/\b/)}let s={scope:"keyword",match:o(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:i}={}){return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:i(e)?`${e}|0`:e)}(a,{when:e=>e.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:o(["double precision","large object","with timezone","without timezone"])},s,r,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,i,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},swift:function(e){let t={match:/\s+/,relevance:0},i=e.COMMENT("/\\*","\\*/",{contains:["self"]}),n=[e.C_LINE_COMMENT_MODE,i],a={match:[/\./,iu(...ih,...im)],className:{2:"keyword"}},r={match:ic(/\./,iu(...ib)),relevance:0},o=ib.filter(e=>"string"==typeof e).concat(["_|0"]),s={variants:[{className:"keyword",match:iu(...ib.filter(e=>"string"!=typeof e).concat(ig).map(ip),...im)}]},l={$pattern:iu(/\b\w+/,/#\w+/),keyword:o.concat(iv),literal:ix},d=[a,r,s],c=[{match:ic(/\./,iu(...iC)),relevance:0},{className:"built_in",match:ic(/\b/,iu(...iC),/(?=\()/)}],u={match:/->/,relevance:0},p=[u,{className:"operator",relevance:0,variants:[{match:ik},{match:`\\.(\\.|${iS})+`}]}],h="([0-9]_*)+",m="([0-9a-fA-F]_*)+",g={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${m})(\\.(${m}))?([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},f=(e="")=>({className:"subst",variants:[{match:ic(/\\/,e,/[0\\tnr"']/)},{match:ic(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",label:"interpol",begin:ic(/\\/,e,/\(/),end:/\)/}),x=(e="")=>({begin:ic(e,/"""/),end:ic(/"""/,e),contains:[f(e),((e="")=>({className:"subst",match:ic(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}))(e),b(e)]}),y=(e="")=>({begin:ic(e,/"/),end:ic(/"/,e),contains:[f(e),b(e)]}),v={className:"string",variants:[x(),x("#"),x("##"),x("###"),y(),y("#"),y("##"),y("###")]},C=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],w=e=>{let t=ic(e,/\//),i=ic(/\//,e);return{begin:t,end:i,contains:[...C,{scope:"comment",begin:`#(?!.*${i})`,end:/$/}]}},S={scope:"regexp",variants:[w("###"),w("##"),w("#"),{begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:C}]},k={match:ic(/`/,i_,/`/)},A=[k,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${iE}+`}],E=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:iT,contains:[...p,g,v]}]}},{scope:"keyword",match:ic(/@/,iu(...iM),id(iu(/\(/,/\s+/)))},{scope:"meta",match:ic(/@/,i_)}],_={match:id(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:ic(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,iE,"+")},{className:"type",match:iI,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:ic(/\s+&\s+/,id(iI)),relevance:0}]},I={begin://,keywords:l,contains:[...n,...d,...E,u,_]};_.contains.push(I);let M={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:ic(i_,/\s*:/),keywords:"_|0",relevance:0},...n,S,...d,...c,...p,g,v,...A,...E,_]},T={begin://,keywords:"repeat each",contains:[...n,_]},L={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:iu(id(ic(i_,/\s*:/)),id(ic(i_,/\s+/,i_,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:i_}]},...n,...d,...p,g,v,...E,_,M],endsParent:!0,illegal:/["']/},j={match:[/(func|macro)/,/\s+/,iu(k.match,i_,ik)],className:{1:"keyword",3:"title.function"},contains:[T,L,t],illegal:[/\[/,/%/]},P={begin:[/precedencegroup/,/\s+/,iI],className:{1:"keyword",3:"title"},contains:[_],keywords:[...iy,...ix],end:/}/},D={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,i_,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[T,...d,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:iI},...d],relevance:0}]};for(let e of v.variants){let t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;let i=[...d,...c,...p,g,v,...A];t.contains=[...i,{begin:/\(/,end:/\)/,contains:["self",...i]}]}return{name:"Swift",keywords:l,contains:[...n,j,{match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[T,L,t],illegal:/\[|%/},{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},D,{match:[/operator/,/\s+/,ik],className:{1:"keyword",3:"title"}},P,{beginKeywords:"import",end:/$/,contains:[...n],relevance:0},S,...d,...c,...p,g,v,...A,...E,_,M]}},typescript:function(e){var t;let i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E,_=e.regex,I=(i=e.regex,n=/<[A-Za-z0-9\\._:-]+/,a=/\/[A-Za-z0-9\\._:-]+>|\/>/,r=(e,t)=>{let i,n=e[0].length+e.index,a=e.input[n];if("<"===a||","===a)return void t.ignoreMatch();">"!==a||((e,{after:t})=>{let i="`${e}\\s*\\(`),i.concat("(?!",t.join("|"),")")),iL,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},k={begin:i.concat(/\./,i.lookahead(i.concat(iL,/(?![0-9A-Za-z$_(])/))),end:iL,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",E={match:[/const|var|let/,/\s+/,iL,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[v]},{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:w},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,h,m,g,f,{match:/\$\d+/},c,w,{scope:"attr",match:iL+i.lookahead(":"),relevance:0},E,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[f,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:n,"on:begin":r,end:a}],subLanguage:"xml",contains:[{begin:n,end:a,skip:!0,contains:["self"]}]}]},{variants:[{match:[/function/,/\s+/,iL,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[v],illegal:/%/},{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[v,e.inherit(e.TITLE_MODE,{begin:iL,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+iL,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[v]},S,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},C,{match:[/get|set/,/\s+/,iL,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},v]},{match:/\$[(.]/}]}),M=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],T={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},L={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:M},contains:[I.exports.CLASS_REFERENCE]},j={$pattern:iL,keyword:ij.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:iP,built_in:iB.concat(M),"variable.language":iO},P={className:"meta",begin:"@"+iL},D=(e,t,i)=>{let n=e.contains.findIndex(e=>e.label===t);if(-1===n)throw Error("can not find mode to replace");e.contains.splice(n,1,i)};Object.assign(I.keywords,j),I.exports.PARAMS_CONTAINS.push(P);let N=I.contains.find(e=>"attr"===e.scope),R=Object.assign({},N,{match:_.concat(iL,_.lookahead(/\s*\?:/))});return I.exports.PARAMS_CONTAINS.push([I.exports.CLASS_REFERENCE,N,R]),I.contains=I.contains.concat([P,T,L,R]),D(I,"shebang",e.SHEBANG()),D(I,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),I.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(I,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),I},vbnet:function(e){let t=e.regex,i=/\d{1,2}\/\d{1,2}\/\d{4}/,n=/\d{4}-\d{1,2}-\d{1,2}/,a=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,r=/\d{1,2}(:\d{1,2}){1,2}/,o={className:"literal",variants:[{begin:t.concat(/# */,t.either(n,i),/ *#/)},{begin:t.concat(/# */,r,/ *#/)},{begin:t.concat(/# */,a,/ *#/)},{begin:t.concat(/# */,t.either(n,i),/ +/,t.either(a,r),/ *#/)}]},s=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},s,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},wasm:function(e){e.regex;let t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},xml:function(e){let t=e.regex,i=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),n={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},a={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},r=e.inherit(a,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[a,s,o,r,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[a,r,s,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},n,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:i,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(i,/>/))),contains:[{className:"name",begin:i,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},yaml:function(e){let t="true false yes no null",i="[\\w#;/?:@&=+$,.~*'()[\\]]+",n={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},a=e.inherit(n,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),r={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},o=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+i},{className:"type",begin:"!<"+i+">"},{className:"type",begin:"!"+i},{className:"type",begin:"!!"+i},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},{begin:/\{/,end:/\}/,contains:[r],illegal:"\\n",relevance:0},{begin:"\\[",end:"\\]",contains:[r],illegal:"\\n",relevance:0},{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},n],s=[...o];return s.pop(),s.push(a),r.contains=s,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:o}}};function iF(){}let iH=e.i(633022).default,iW={};class iU{constructor(e){this.options=e,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(e){if(""===e)return;let t=this.stack[this.stack.length-1],i=t.children[t.children.length-1];i&&"text"===i.type?i.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){let i=this.stack[this.stack.length-1],n=e.root.children;t?i.children.push({type:"element",tagName:"span",properties:{className:[t]},children:n}):i.children.push(...n)}openNode(e){let t=this,i=e.split(".").map(function(e,i){return i?e+"_".repeat(i):t.options.classPrefix+e}),n=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:i},children:[]};n.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}let iV={plaintext:"Plain text",bash:"Bash",c:"C",cpp:"C++",csharp:"C#",css:"CSS",diff:"Diff",go:"Go",graphql:"GraphQL",java:"Java",javascript:"JavaScript",json:"JSON",kotlin:"Kotlin",less:"Less",lua:"Lua",makefile:"Makefile",markdown:"Markdown",objectivec:"Objective-C",perl:"Perl",php:"PHP",python:"Python",r:"R",ruby:"Ruby",rust:"Rust",scss:"SCSS",shell:"Shell",sql:"SQL",swift:"Swift",typescript:"TypeScript",xml:"XML/HTML",yaml:"YAML"},iG=Object.keys(iV),i$=new Set(iG),iZ=function(e){let t=iH.newInstance();return e&&a(e),{highlight:i,highlightAuto:function(e,a){let r;iF("string"==typeof e,"expected `string` as `value`");let o=(a||iW).subset||n(),s=-1,l=0;for(;++sl&&(l=d.data.relevance,r=d)}return r||{type:"root",children:[],data:{language:void 0,relevance:l}}},listLanguages:n,register:a,registerAlias:function(e,i){if("string"==typeof e)iF(void 0!==i),t.registerAliases("string"==typeof i?i:[...i],{languageName:e});else{let i;for(i in e)if(Object.hasOwn(e,i)){let n=e[i];t.registerAliases("string"==typeof n?n:[...n],{languageName:i})}}},registered:function(e){return!!t.getLanguage(e)}};function i(e,i,n){iF("string"==typeof e,"expected `string` as `name`"),iF("string"==typeof i,"expected `string` as `value`");let a=n||iW,r="string"==typeof a.prefix?a.prefix:"hljs-";if(!t.getLanguage(e))throw Error("Unknown language: `"+e+"` is not registered");t.configure({__emitter:iU,classPrefix:r});let o=t.highlight(i,{ignoreIllegals:!0,language:e});if(o.errorRaised)throw Error("Could not highlight with `Highlight.js`",{cause:o.errorRaised});let s=o._emitter.root,l=s.data;return l.language=o.language,l.relevance=o.relevance,s}function n(){return t.listLanguages()}function a(e,i){if("string"==typeof e)iF(void 0!==i,"expected `grammar`"),t.registerLanguage(e,i);else{let i;for(i in e)Object.hasOwn(e,i)&&t.registerLanguage(i,e[i])}}}(Object.fromEntries(iG.filter(e=>e in iz).map(e=>[e,iz[e]])));var iK=e.i(615505);function iq(e,t,i){return(0,m.findChildren)(e,e=>e.type.name===t).map(e=>{let t=e.node.textContent,n=e.node.attrs.language??null,a=e.node.nodeSize,r=i.find(e=>e.content===t&&e.language===n);return r?{...r,pos:e.pos,nodeSize:a}:{pos:e.pos,nodeSize:a,...function(e){let t,i=e.node.textContent,n=e.node.attrs.language??null;if(i.length>1e4)return{content:i,language:n,detectedLanguage:null,highlightingDisabled:!0,ast:null};let a=null;if(n&&iZ.registered(n))t=iZ.highlight(n,i).children;else{let e=iZ.highlightAuto(i);t=e.children;let n=e.data?.language;n&&i$.has(n)&&(a=n)}return{content:i,language:n,detectedLanguage:a,highlightingDisabled:!1,ast:t}}(e)}})}let iY=new t_.PluginKey("lowlight"),iX={isLowlightDecoration:!0,detectedLanguage:null,highlightingDisabled:!1},iQ="__auto__",iJ=e=>{let t,i,{node:n,updateAttributes:r,decorations:o}=e,s=(0,w.useAppSelector)(k.selectEditable),d=(0,p.useToast)(),{isDark:c}=(0,tR.useCardColorMode)(o),{language:u}=n.attrs,{detectedLanguage:m,highlightingDisabled:g}=(i=o.find(e=>e.spec.isLowlightDecoration),i?.spec??iX),f=m?iV[m]:"Plain text";t=null!==u?iV[u]??u:(0,a.jsx)(ei.Trans,{message:"{autoLabel} (Auto)",id:"ZxvbXL",values:{autoLabel:f}});let b=null===u?iQ:u,x=(0,l.useCallback)(e=>{let t=Array.isArray(e)?e[0]:e;t===iQ?r({language:null}):r({language:t})},[r]),y=(0,l.useCallback)(()=>{let e=n.textContent;navigator.clipboard.writeText(e).then(()=>{d({title:(0,a.jsx)(ei.Trans,{message:"Code copied to clipboard",id:"80c4+P"}),status:"success",duration:2e3,position:"top",isClosable:!0})},e=>{console.error("Failed to copy code:",e),d({title:(0,a.jsx)(ei.Trans,{message:"Failed to copy code contents",id:"nQd+uR"}),status:"error",position:"top",duration:3e3,isClosable:!0})})},[n,d]),v={height:6,bg:"var(--neutral-background-color)",borderColor:c?"whiteAlpha.600":"blackAlpha.600",color:c?"whiteAlpha.800":"blackAlpha.800",_hover:{bg:c?"whiteAlpha.100":"blackAlpha.50"},_active:{bg:c?"whiteAlpha.200":"blackAlpha.200"}};return(0,a.jsx)(tN.AnnotatableNodeViewWrapper,{...e,children:(0,a.jsxs)(q.Box,{as:"pre",position:"relative","data-code-theme":c?"dark":"light",sx:{containerType:"inline-size"},children:[s&&(0,a.jsxs)(q.Box,{contentEditable:!1,userSelect:"none",position:"absolute",display:"flex",gap:1,bg:"var(--neutral-background-color)",borderRadius:"full",top:1.5,p:1.5,pt:0,insetEnd:0,zIndex:1,opacity:0,pointerEvents:"none",transitionProperty:"opacity",transitionDuration:"normal",sx:{"@container (max-width: 360px)":{display:"none"},'.block-codeBlock:hover &, .block-codeBlock:focus-within &, &:has([aria-expanded="true"])':{opacity:1,pointerEvents:"auto"}},children:[g&&(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"Syntax highlighting is disabled for code blocks over 10,000 characters long.",id:"MQSupz"}),placement:"top",children:(0,a.jsx)(q.Box,{height:6,fontSize:"xs",fontFamily:"var(--chakra-fonts-body)",fontWeight:"600",bg:"yellow.100",color:"yellow.900",borderRadius:"md",px:2,py:1,display:"flex",alignContent:"center",justifyContent:"center",children:(0,a.jsxs)(Y.HStack,{spacing:1,children:[(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faTriangleExclamation,fixedWidth:!0}),(0,a.jsx)(ei.Trans,{message:"Syntax highlighting disabled",id:"Y3rzRg"})]})})}),(0,a.jsxs)(tx.ButtonGroup,{isAttached:!0,variant:"outline",size:"xs",children:[(0,a.jsxs)(tv.Menu,{isLazy:!0,autoSelect:!1,children:[(0,a.jsx)(tC.MenuButton,{as:eo.Button,...v,isDisabled:g,rightIcon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faChevronDown,size:"xs"}),children:t}),(0,a.jsx)(tE.Portal,{children:(0,a.jsx)(tk.MenuList,{maxH:"300px",overflowY:"auto",children:(0,a.jsxs)(tA.MenuOptionGroup,{type:"radio",value:b,onChange:x,children:[(0,a.jsx)(tS.MenuItemOption,{value:iQ,children:(0,a.jsx)(ei.Trans,{message:"Auto-detect",id:"pEb1UY"})}),(0,a.jsx)(tw.MenuDivider,{}),iG.map(e=>(0,a.jsx)(tS.MenuItemOption,{value:e,children:iV[e]},e))]})})})]}),(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"Copy code",id:"NmPNJJ"}),placement:"top",children:(0,a.jsx)(ty.IconButton,{...v,px:3,"aria-label":h.i18n._({id:"NmPNJJ",message:"Copy code"}),icon:(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faCopy}),onClick:y})})]})]}),(0,a.jsx)(tP.NodeViewContent,{as:"code"})]})})},i0=(0,tj.extendTiptapNode)(tT,"codeBlock",{selectable:!1,isolating:!0,addOptions(){return{...this.parent?.(),exitOnTripleEnter:!1,enableTabIndentation:!0,tabSize:2}},addInputRules(){return[(0,tL.textblockTypeInputRule)({find:/^```$/,type:this.type}),(0,tL.textblockTypeInputRule)({find:/^~~~$/,type:this.type})]},addProseMirrorPlugins(){var e;let t,i,n;return[...this.parent?.()??[],(e=this.name,t=[],i=iK.DecorationSet.empty,n=new t_.Plugin({key:iY,state:{init:(t,{doc:i})=>iq(i,e,[]),apply:(t,i,n,a)=>t.docChanged?iq(a.doc,e,i):i},props:{decorations(e){let a=n.getState(e)??[];if(a===t)return i;let r=[];for(let e of a)r.push(iK.Decoration.node(e.pos,e.pos+e.nodeSize,{},{isLowlightDecoration:!0,detectedLanguage:e.detectedLanguage,highlightingDisabled:e.highlightingDisabled})),r.push(...function(e){let t=[];if(e.highlightingDisabled||!e.ast)return t;let i=e.pos+1;return(function e(t,i=[]){return t.flatMap(t=>{if("element"===t.type){let n=[...i,...t.properties?.className??[]];if(t.children)return e(t.children,n)}return{text:t.value,classes:i}})})(e.ast).forEach(e=>{let n=i+e.text.length;e.classes.length&&t.push(iK.Decoration.inline(i,n,{class:e.classes.join(" ")})),i=n}),t}(e));return t=a,i=iK.DecorationSet.create(e.doc,r)}}}))]},addNodeView:()=>(0,tD.ReactNodeViewRenderer)(iJ,{update:tB.attrsOrDecorationsChanged}),priority:tO.ExtensionPriorityMap.CodeBlock}),i1=tT.extend({selectable:!1,isolating:!0,addOptions(){return{...this.parent?.(),exitOnTripleEnter:!1}},addInputRules(){return[(0,tL.textblockTypeInputRule)({find:/^```$/,type:this.type}),(0,tL.textblockTypeInputRule)({find:/^~~~$/,type:this.type})]},priority:tO.ExtensionPriorityMap.CodeBlock});e.i(419217),e.s(["SimpleImage",()=>nl],43887);var i2=e.i(698380);e.s(["SimpleImageView",()=>ns],218025);var i3=e.i(818315),i5=e.i(820773);e.s(["MediaPlaceholderBlock",()=>no,"MediaPlaceholderView",()=>nr],485992);var i4=e.i(500425),i6=e.i(783197),i9=e.i(297194),i8=e.i(786928),i7=e.i(864935),ne=e.i(15272),nt=e.i(878917),ni=e.i(635273),nn=e.i(697240),na=e.i(267971);let nr=e=>(0,a.jsx)(tN.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,a.jsx)(no,{...e})}),no=e=>{let{node:t,decorations:i,editor:n}=e,{source:r,horizontalAlign:o,uploadStatus:s,loadImageParams:d,loadImageStatus:c}=t.attrs,{getPos:u}=e,p=r&&nt.MediaSourcesMap[r]?.icon||i4.faImage,h=(0,ne.isNodeViewInGallery)(e),m=(0,na.useSelectAndFocus)(n,u),g=(0,w.useAppSelector)(k.selectEditable),f=(0,i8.useToggleMediaDrawer)(),b=(0,l.useCallback)(()=>{m(),f({isOpen:!0})},[f,m]),x=(0,i6.useIsThumbnailView)();return"error"!==c||x?(0,a.jsx)(J.Flex,{w:"100%",h:"100%",dir:(0,i7.getAlignDirection)(i,o),direction:"column",sx:(0,i7.getAlignStyles)(o),children:(0,a.jsx)(nn.MediaPlaceholderImage,{hasUploadError:s===i9.UploadStatus.Error&&!x,isUploading:s===i9.UploadStatus.Uploading,isLoading:"queued"===c&&!x,loadingProvider:d?.provider,"data-content-reference":!0,icon:p,width:h?"100%":"18em",maxW:"100%",h:h?"100%":"10em",maxH:"100%",onSelectAndFocus:m,defaultSource:r??void 0,"data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0,borderRadius:"var(--box-border-radius)",hasQuickActions:!x,handleDoubleClick:g?b:void 0})}):(0,a.jsx)(J.Flex,{w:"100%",h:"100%",dir:(0,i7.getAlignDirection)(i,o),direction:"column",sx:(0,i7.getAlignStyles)(o),children:(0,a.jsx)(ni.ImageGenerationErrorPlaceholder,{onRetry:g?b:void 0,width:h?"100%":"18em",maxW:"100%",h:h?"100%":"10em",maxH:"100%",borderRadius:"var(--box-border-radius)","data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0})})},ns=e=>{let{node:t}=e,{src:i,tempUrl:n,uploadStatus:r,showPlaceholder:o}=t.attrs;return(0,a.jsxs)(u,{as:"div",children:[o&&(0,a.jsx)(no,{...e}),!o&&(i||n)&&(0,a.jsxs)(q.Box,{position:"relative",w:"100%",children:[(0,a.jsx)(eF.Link,{className:"image-link",href:i||n||"",target:"_blank",children:(0,a.jsx)(i3.Image,{src:i||n||""})}),(0,a.jsx)(i5.MediaUploadIndicators,{uploadStatus:r??void 0,isEditable:!0})]})]})};ns.displayName="simple-image-view";let nl=i2.default.extend({selectable:!0,draggable:!0,group:"block media",priority:tO.ExtensionPriorityMap.Image,addOptions(){return{...this.parent?.(),placeholders:{}}},addNodeView:()=>(0,tD.ReactNodeViewRenderer)(ns,{update:tB.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"img[src], img[tempUrl]"}],renderHTML:({HTMLAttributes:e})=>["img",(0,m.mergeAttributes)(e,{class:"gamma-simple-image"})],addAttributes:()=>({src:{},tempUrl:{},uploadStatus:{},source:{},showPlaceholder:{}})});var nd=e.i(66657),nc=e.i(470645),nu=e.i(216912),np=e.i(244180),nh=e.i(358003);let nm=(0,nu.forwardRef)(function(e,t){let i=(0,np.useStyleConfig)("Kbd",e),{className:n,...r}=(0,nd.omitThemingProps)(e);return(0,a.jsx)(nh.chakra.kbd,{ref:t,className:(0,nc.cx)("chakra-kbd",n),...r,__css:{fontFamily:"mono",...i}})});nm.displayName="Kbd",e.s(["Kbd",0,nm],222625);var ng=e.i(308822),nf=e.i(189938),nb=e.i(335884);let nx={card:et.faRectangle,doc:et.faRectangleHistory,user:et.faAt},ny=({type:e})=>{let t=nx[e];return(0,a.jsx)(q.Box,{as:"span",display:"inline-flex",className:"mention",minW:"5em",opacity:"0.6",borderRadius:"sm",color:"gray.700",children:(0,a.jsx)(q.Box,{display:"inline-flex",py:"0.125em",children:(0,a.jsx)(el.FontAwesomeIcon,{icon:t,style:{marginLeft:"0.5em",alignSelf:"center"}})})})};var nv=e.i(210792),nC=e.i(940709),nw=e.i(576897);e.s([],364146),e.s(["MENTION_SUGGESTION_CHARACTER",()=>n5,"MentionSuggestionMenu",()=>n4],288294);var nS=e.i(525053),nk=e.i(78608),nA=e.i(277051),nE=e.i(788411),n_=e.i(606004);let nI={padding:{sm:4,md:4,lg:6},fontSize:{sm:"sm",md:"md",lg:"lg"},iconSize:{sm:"lg",md:"2x",lg:"3x"},labelFontSize:{sm:"xs",md:"sm",lg:"md"},spacing:{sm:1,md:2,lg:3}},nM=(0,l.memo)(({description:e,heading:t,isInOfflineMode:i=!1,size:n="lg",...r})=>{let o=(0,to.useColorModeValue)("gray.50","whiteAlpha.100");if(!i)return null;let{spacing:s,padding:l,iconSize:d,fontSize:c,labelFontSize:u}=nI;return(0,a.jsxs)(ee.Stack,{spacing:s[n],p:l[n],borderRadius:"lg",bg:o,textAlign:"center",alignItems:"center",...r,children:[(0,a.jsx)(q.Box,{opacity:.5,children:(0,a.jsx)(el.FontAwesomeIcon,{icon:i4.faCloudSlash,size:d[n]})}),(0,a.jsx)(ew.Text,{fontWeight:"600",fontSize:c[n],mt:2,children:t||(0,a.jsx)(ei.Trans,{message:"You're offline",id:"ysdDIA"})}),(0,a.jsx)(ew.Text,{color:"gray.500",fontSize:u[n],children:e})]})});nM.displayName="OfflineInfoBox",e.s(["OfflineInfoBox",0,nM],307591);let nT=(0,nu.forwardRef)(function(e,t){let{isExternal:i,target:n,rel:r,className:o,...s}=e;return(0,a.jsx)(nh.chakra.a,{...s,ref:t,className:(0,nc.cx)("chakra-linkbox__overlay",o),rel:i?"noopener noreferrer":r,target:i?"_blank":n,__css:{position:"static","&::before":{content:"''",cursor:"inherit",display:"block",position:"absolute",top:0,left:0,zIndex:0,width:"100%",height:"100%"}}})}),nL=(0,nu.forwardRef)(function(e,t){let{className:i,...n}=e;return(0,a.jsx)(nh.chakra.div,{ref:t,position:"relative",...n,className:(0,nc.cx)("chakra-linkbox",i),__css:{"a[href]:not(.chakra-linkbox__overlay), abbr[title]":{position:"relative",zIndex:1}}})});e.s(["LinkBox",0,nL,"LinkOverlay",0,nT],264333);var nj=e.i(662727),nP=e.i(372966);e.i(144786);var nD=e.i(849187);let nN=({text:e})=>{let t=e.split(/(.*?<\/em>)/g);return(0,a.jsx)(a.Fragment,{children:t.map((e,t)=>{if(e.startsWith("")&&e.endsWith("")){let i=e.slice(4,-5);return(0,a.jsx)("em",{children:i},t)}return(0,a.jsx)(l.Fragment,{children:e},t)})})};e.s(["HighlightedText",0,nN],743241);var nR=e.i(644315);let nO=({result:e,isActive:t,focusedItemEl:i,onMouseMove:n,onMouseEnter:r,onClick:o,context:s="globalSearch"})=>{let l=(0,to.useColorModeValue)("gray.50","elevation.2"),d=(0,to.useColorModeValue)("gray.200","whiteAlpha.200"),c=(0,to.useColorModeValue)("gray.700","whiteAlpha.800"),u=(0,nD.useFeatureFlag)("screenshotsEnabled"),{title:p,text:h,previewUrl:m,editors:g,editedTime:f,id:b,createdBy:x,file:y}=e,v="mentionsList"===s,C=y?.isTemplate,w=y?.mainPageId&&b!==y.mainPageId;return(0,a.jsx)(nL,{children:(0,a.jsxs)(Y.HStack,{ref:t?i:null,className:"search-result",wordBreak:"break-word",onMouseMove:n,onMouseEnter:r,p:v?0:[2,3],py:v?.5:void 0,align:"flex-start",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",bg:t?l:"transparent",cursor:"pointer",color:c,borderWidth:"1px",borderColor:t?d:"transparent",spacing:{base:0,sm:4},sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},onClick:o,children:[(0,a.jsx)(i3.Image,{display:{base:"none",xs:"block"},h:"100%",src:u?m:nP.default.src,w:{base:"0px",sm:"25%"},border:"1px solid",borderColor:d,borderRadius:"md",shadow:"lg",fallbackSrc:nP.default.src}),(0,a.jsxs)(ee.Stack,{spacing:(0,N.isMobileDevice)()?1:2,flex:"1",children:[(0,a.jsxs)(nT,{href:"globalSearch"===s?(0,nw.generateDocUrl)({docId:b}):void 0,children:[w&&y?.title&&(0,a.jsx)(ew.Text,{noOfLines:1,fontSize:"xs",color:"gray.500",children:y.title}),(0,a.jsxs)(Y.HStack,{alignItems:"flex-start",spacing:"3",children:[(0,a.jsx)(ew.Text,{fontSize:"md",fontWeight:"600",noOfLines:v?1:2,children:(0,a.jsx)(nN,{text:p||""})}),C&&(0,a.jsx)(es.Badge,{fontSize:"sm",w:"fit-content",colorScheme:"purple",textTransform:"none",children:(0,a.jsxs)(Y.HStack,{spacing:1,children:[(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faLayerGroup}),(0,a.jsx)(ei.Trans,{message:"Template",id:"/K2CvV"})]})})]}),x?.displayName&&(0,a.jsx)(ew.Text,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,a.jsx)(ei.Trans,{message:"Created by {0}",id:"ab98Hp",values:{0:x?.displayName}})})]}),(0,a.jsx)(ew.Text,{fontSize:v?"xs":"sm",noOfLines:2,whiteSpace:"normal",wordBreak:"break-word",children:(0,a.jsx)(nN,{text:h||""})}),(0,a.jsxs)(Y.HStack,{children:[g&&g.length>0&&(0,a.jsx)(eR.AvatarGroup,{size:"xs",fontSize:"xs",max:5,children:g?.map(({user:e})=>{let{id:t,displayName:i,profileImageUrl:n}=e;return(0,a.jsx)(nj.TooltipAvatar,{label:i,src:n,shadow:"base"},t)})}),f&&(0,a.jsx)(ew.Text,{fontSize:"xs",color:c,fontWeight:"500",children:(0,a.jsx)(ei.Trans,{message:"Edited {0}",id:"5cC8f2",values:{0:(0,nR.normalizeDate)(f)}})})]})]})]})})},nB=new t_.PluginKey("suggestion"),nz={from:0,to:0};var nF=e.i(180962),nH=e.i(413829),nW=e.i(376257),nU=e.i(379457),nV=e.i(452330);let nG=({ref:e,selectItem:t,options:i})=>{let[n,a]=(0,l.useState)(0),r=(0,l.useRef)(null),o=(0,l.useRef)({selectedIndex:n,options:i,selectItem:t});return o.current={selectedIndex:n,options:i,selectItem:t},(0,l.useImperativeHandle)(e,()=>({onKeyDown:({event:e})=>!!["ArrowUp","ArrowDown","Enter","Tab"].includes(e.key)&&(e=>{let{key:t}=e,r=o.current;return"ArrowUp"===t?(e.preventDefault(),r.selectedIndex<=0?a(i.length-1):a((0,nH.default)(r.selectedIndex-1,0,r.options.length-1))):"ArrowDown"===t?(e.preventDefault(),r.selectedIndex>=r.options.length-1?a(0):a((0,nH.default)(r.selectedIndex+1,0,r.options.length-1))):("Enter"===t||"Tab"===t)&&(e.preventDefault(),r.options.length>0&&r.selectItem(n)),e.stopPropagation(),e.preventDefault(),!0})(e)})),(0,l.useEffect)(()=>{let e=r.current;if(!e)return;let t=e.parentElement;t&&(0,nU.scrollIntoViewWithinContainer)({container:t,child:e,block:"nearest",behavior:"smooth"})},[n]),{selectedIndex:n,selectedItemEl:r}},n$=({char:e,MenuComponent:t,pluginKey:i,command:n,allowSpaces:a=!1,...r})=>m.Extension.create({...r,addOptions:()=>({HTMLAttributes:{},suggestion:{char:e,pluginKey:i,allowSpaces:a,startOfLine:!1,command:n,render:()=>{let e=null,n=null;return{onStart:i=>{if(n&&e){e.updateProps(i),n.setProps({getReferenceClientRect:i.clientRect}),n.show();return}e=new nV.ReactRenderer(t,{props:i,editor:i.editor});let a=i.editor.view.dom.parentElement;n=(0,nW.default)(a,{getReferenceClientRect:i.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:nF.themeWithRebrand.zIndices.dropdown,popperOptions:{modifiers:[{name:"preventOverflow",options:{padding:{bottom:8}}},{name:"flip",options:{fallbackPlacements:["auto-start"]}}]}})},onUpdate(t){e?.updateProps(t),n?.setProps({getReferenceClientRect:t.clientRect})},onKeyDown:t=>"Escape"===t.event.key?(n?.destroy(),e?.destroy(),n=null,e=null,!0):e?.ref?.onKeyDown(t),onExit(t){!0!==i.getState(t.editor.view.state).active&&(n?.destroy(),e?.destroy(),n=null,e=null)}}}}}),addProseMirrorPlugins(){return[function({pluginKey:e=nB,editor:t,char:i="@",allowSpaces:n=!1,prefixSpace:a=!0,startOfLine:r=!1,decorationTag:o="span",decorationClass:s="suggestion",command:l=()=>null,items:d=()=>[],render:c=()=>({}),allow:u=()=>!0}){let p,h=c?.();return new t_.Plugin({key:e,view(){return{update:async(e,i)=>{let n=this.key?.getState(i),a=this.key?.getState(e.state),r=n.active&&a.active&&n.range.from!==a.range.from,o=!n.active&&a.active,s=n.active&&!a.active,c=!o&&!s&&n.query!==a.query,u=o||r,m=c&&!r,g=s||r;if(!u&&!m&&!g)return;let f=g&&!u?n:a,b=document.querySelector(`[data-decoration-id="${f.decorationId}"]`);p={editor:t,range:f.range,query:f.query,text:f.text,items:m||u?await d({editor:t,query:f.query}):[],command:e=>{l({editor:t,range:f.range,props:e})},decorationNode:b,clientRect:b?()=>{let{decorationId:e}=this.key?.getState(t.state)??{};return document.querySelector(`[data-decoration-id="${e}"]`).getBoundingClientRect()}:null},g&&h?.onExit?.(p),m&&h?.onUpdate?.(p),u&&h?.onStart?.(p)},destroy:()=>{p&&h?.onExit?.(p)}}},state:{init:()=>({active:!1,decorationId:"",range:nz,key:null,query:null,text:null,composing:!1}),apply(o,s,l,d){let c;c=o.getMeta(e)?{...o.getMeta(e)}:{...s};let{isEditable:p}=t,{composing:h}=t.view,{selection:g}=o,{empty:f,from:b}=g;if(c.composing=h,!c.active&&c.key!==i)return c;if(c.active&&c.key===i)return c.key=null,c;if(p&&(f||t.view.composing)){s.range&&(bs.range.to)&&!h&&!s.composing&&(c.active=!1);let e=function(e){let{char:t,allowSpaces:i,prefixSpace:n,startOfLine:a,$position:r}=e,o=(0,m.escapeForRegEx)(t),s=RegExp(`\\s${o}$`),l=a?"^":"",d=i?RegExp(`${l}${o}.*?(?=\\s${o}|$)`,"gm"):RegExp(`${l}(?:^)?${o}[^\\s${o}]*`,"gm"),c=r.nodeBefore?.text;if(!c)return null;let u=r.pos-c.length,p=Array.from(c.matchAll(d)).pop();if(!p||void 0===p.input||void 0===p.index)return null;let h=p.input.slice(Math.max(0,p.index-1),p.index),g=/^[\s\0]?$/.test(h);if(n&&!g)return null;let f=u+p.index,b=f+p[0].length;return(i&&s.test(c.slice(b-1,b+1))&&(p[0]+=" ",b+=1),f=r.pos)?{range:{from:f,to:b},query:p[0].slice(t.length),text:p[0]}:null}({char:i,allowSpaces:n,prefixSpace:a,startOfLine:r,$position:g.$from}),o=`id_${Math.floor(0xffffffff*Math.random())}`;e&&u({editor:t,state:d,range:e.range})?(c.active=!0,c.decorationId=s.decorationId?s.decorationId:o,c.range=e.range,c.query=e.query,c.text=e.text):c.active=!1}else c.active=!1;return c.active||(c.decorationId=null,c.range=nz,c.query=null,c.text=null),c}},props:{handleKeyDown(t,n){let a=t.state.tr,r=this.getState(t.state);if(!r)return!1;let{active:o,range:s}=r;if(!s)return!1;if(o||n.key!==i||n.metaKey){if(!o)return!1;"Escape"===n.key&&t.dispatch(t.state.tr.setMeta(e,{active:!1,decorationId:"",key:null,range:nz,query:null,text:null,composing:!1}))}else{let i={...r};i.active=!0,i.key=n.key,i.query="",t.dispatch(a.setMeta(e,i))}return h?.onKeyDown?.({view:t,event:n,range:s})||!1},decorations(e){let t=this.getState(e);if(!t)return null;let{active:i,range:n,decorationId:a}=t;return i&&n?iK.DecorationSet.create(e.doc,[iK.Decoration.inline(n.from,n.to,{nodeName:o,class:s,"data-decoration-id":a||""})]):null}}})}({editor:this.editor,...this.options.suggestion})]}});e.s(["createSuggestionExtension",0,n$,"useSuggestionKeyboardHandler",0,nG],493731),e.s([],503117);let nZ=(e,t,i)=>RegExp(t?e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):e,i?"gu":"gui"),nK=()=>(0,a.jsx)(ei.Trans,{message:"Type to mention a person or a {GAMMA_ARTIFACT_PROPER_NOUN}",id:"eZHH8X",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),nq=({html:e})=>(0,a.jsx)(ew.Text,{paddingInlineStart:"0.2rem",wordBreak:"break-word",noOfLines:1,maxW:300,lineHeight:"1.5",dangerouslySetInnerHTML:{__html:e?nA.default.sanitize(e):""}}),nY=({result:e})=>{let{__typename:t}=e;return"User"===t?(0,a.jsxs)(Y.HStack,{children:[(0,a.jsx)(eO.Avatar,{size:"2xs",minWidth:4,m:0,name:e.displayName&&e.displayName.replace(/(|<\/em>)/g,""),src:e.profileImageUrl}),(0,a.jsx)(nq,{html:e.displayName})]}):"Card"===t?(0,a.jsxs)(Y.HStack,{children:[(0,a.jsx)(J.Flex,{color:"gray.600",minWidth:4,justifyContent:"flex-end",children:(0,a.jsx)(el.FontAwesomeIcon,{icon:X.faCircleSmall,transform:{size:6}})}),(0,a.jsx)(nq,{html:e.title})]}):"DocResult"===t?(0,a.jsx)(nO,{result:e,context:"mentionsList"}):(console.warn("[MentionList] Invalid __typename for search result:",e.__typename),null)},nX=(0,l.forwardRef)(({result:e,index:t,selectedIndex:i,selectItem:n,...r},o)=>(0,a.jsx)(nS.ListBoxItem,{ref:o,tabIndex:t===i?0:-1,onClick:()=>n(t),onMouseDown:er.preventDefaultToAvoidBlur,...r,children:(0,a.jsx)(nY,{result:e})},t)),nQ=(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faRectangle}),nJ=(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faRectangleHistory}),n0=(0,a.jsx)(el.FontAwesomeIcon,{icon:et.faCircleUser}),n1={Card:{title:(0,a.jsx)(ei.Trans,{message:"Cards in this {GAMMA_ARTIFACT_PROPER_NOUN}",id:"gXnPmp",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),iconComponent:nQ},DocResult:{title:(0,nE.default)(e3.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL),iconComponent:nJ},User:{title:(0,a.jsx)(ei.Trans,{message:"People",id:"1wdjme"}),iconComponent:n0}},n2=(0,l.forwardRef)(({editor:e,query:t,command:i},n)=>{let{isInOfflineMode:r}=(0,n_.useHealthCheck)(),o=(0,w.useAppSelector)(C.selectDoc),s=(0,l.useMemo)(()=>{let e=o?.collaborators;return e?.map(e=>e.user)||[]},[o]),{user:d,currentWorkspace:c}=(0,M.useUserContext)(),{data:u,previousData:p,loading:h}=function(e,t){let{isInOfflineMode:i}=(0,n_.useHealthCheck)(),n=!e||!t||i;var a=[(0,v.useSearchMentionQuery)({variables:{workspaceId:t,types:[v.SearchType.User],query:e},skip:n}),(0,v.useSearchMentionQuery)({variables:{workspaceId:t,types:[v.SearchType.Doc],query:e},skip:n})];function r(e,t,i){i&&(e[t]||(e[t]={search:[]}),e[t].search=[...e[t].search,...i.search])}return a.reduce((e,{data:t,previousData:i,error:n,loading:a})=>(!t&&a&&i&&(t=i),r(e,"data",t),r(e,"previousData",i),a&&(e.loading=!0),n&&(e.error=n),e),{})}(t,d?.workspaceMemberships?.find(t=>t.workspace?.id===e.gammaOrgId)?.workspace?.id||c?.id),{searchDocs:m,searchUsers:g}=(0,l.useMemo)(()=>{let e=nZ(t,!0,!1),i=(u?u.search:p?p.search:[]).filter(e=>"User"===e.__typename),n=(u?u.search:p?p.search:[]).filter(e=>"DocResult"===e.__typename),a=s.filter(e=>!i.find(t=>t.id===e.id)).filter(e=>e.email?.startsWith(t.toLowerCase())||e.displayName?.toLowerCase().includes(t.toLowerCase())),r=[...i,...a].map(t=>({...t,displayName:t.displayName?.replace(e,"$&")}));return{searchDocs:t?[...n]:[],searchUsers:t?r:[]}},[u,p,t,s]),f=(0,w.useAppSelector)(nf.selectComputedCards),b=[...g,...(0,l.useMemo)(()=>{let e=nZ(t,!0,!1);return t?f.map(t=>{let i=t.title||"";if(i.match(e)){let n=i.replace(e,"$&");return{...t,title:n,__typename:"Card"}}return null}).filter(Boolean):[]},[f,t]),...m],x=t=>{let n=b[t]?{...b[t]}:null;n&&("User"===n.__typename&&n.displayName&&(n.displayName=n.displayName.replace(/(|<\/em>)/g,"")),"Card"===n.__typename&&(n.docId=e.gammaDocId),i({item:n,user:d}))},{selectedIndex:y,selectedItemEl:S}=nG({ref:n,selectItem:x,options:b}),k=e.state.selection,A=!k.$anchor.parent.isLeaf&&k.$anchor.parent.textContent===n5;return 0===t.length&&A?(0,a.jsx)(J.Flex,{w:"100%",p:1,align:"flex-start",justify:"flex-start",flex:"1",mt:-9,marginStart:3,"data-testid":"mention-list-empty",children:(0,a.jsx)(ew.Text,{fontSize:"md",color:"gray.400",children:(0,a.jsx)(nK,{})})}):(0,a.jsx)(nS.ListBox,{"data-testid":"mention-list",children:(0,a.jsxs)(nS.ListBoxList,{"data-target-name":"mention-list",w:"540px",maxW:"90vw",overflowY:"auto",maxH:"65vh",sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,a.jsx)(nM,{isInOfflineMode:r,description:(0,a.jsx)(ei.Trans,{message:"Mentions are only available when you're online.",id:"KnLL/m"})}),0===t.length?(0,a.jsx)(J.Flex,{p:1,align:"center",justify:"center",flex:"1",minH:12,"data-testid":"mention-list-empty",children:(0,a.jsx)(ew.Text,{fontSize:"md",color:"gray.400",children:(0,a.jsx)(nK,{})})}):!h&&t.length>1&&0===b.length?(0,a.jsx)(J.Flex,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,a.jsx)(ew.Text,{fontSize:"sm",color:"gray.500",children:(0,a.jsx)(ei.Trans,{message:"No results for this query.",id:"0+jt9a"})})}):null,b.map((e,t)=>{let i=b.findIndex(t=>t.__typename===e.__typename)===t&&e.__typename?n1[e.__typename]:null;return(0,a.jsxs)(l.default.Fragment,{children:[i&&(0,a.jsxs)(Y.HStack,{mt:4,mb:2,color:"gray.500",children:[i.iconComponent,(0,a.jsx)(nk.SectionTitle,{children:i.title})]}),(0,a.jsx)(nX,{"data-testid":`mention-list-item-${e.id}`,ref:t===y?S:null,result:e,index:t,selectedIndex:y,selectItem:x},t)]},e.id)}),h&&(0,a.jsx)(J.Flex,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,a.jsx)(eC.Spinner,{opacity:"0.8",size:"xs"})})]})})}),n3=new t_.PluginKey("MentionGamma"),n5="@",n4=n$({name:"GammaMention",char:n5,pluginKey:n3,allowSpaces:!0,MenuComponent:n2,priority:tO.ExtensionPriorityMap.MentionSuggestionMenu,command:({editor:e,range:t,props:i})=>{let{item:n,user:a}=i;if("User"===n.__typename){let{id:i,displayName:r,profileImageUrl:o}=n,{id:s}=a;e.commands.addUserMention({id:i,label:r,profileImageUrl:o,mentionedById:s},t)}else if("Card"===n.__typename){let{id:i,docId:r}=n,{id:o}=a;e.commands.addCardMention({id:i,docId:r,mentionedById:o},t)}else if("DocResult"===n.__typename){let{id:i}=n,{id:r}=a;e.commands.addDocMention({id:i,mentionedById:r},t)}}}),n6=({filterFn:e,getAttributesFn:t})=>i=>(function(e){let{type:t}=e;if(!t.isInline)throw Error("[nodePasteRule] This paste rule was only designed to consider inline nodes.");return new m.PasteRule({find:e.find,handler:({state:t,range:i,match:n})=>{let{tr:a}=t,r=i.from,o=i.to,s=(0,m.callOrReturn)(e.getAttributes,void 0,n)||{};a.replaceWith(r,o,e.type.create(s))}})})({find:t=>{let i=[...t.matchAll(nw.GAMMA_DOC_REGEX)];return i?i.map(e=>({index:e.index??-1,text:e[0],match:e})).filter(t=>{let i=(0,nw.getDocIdFromUrl)(t.text),{cardId:n}=(0,nw.parseUrlHash)(t.text);return e(i,n,t)}):[]},type:i,getAttributes:e=>{let i=(0,nw.getDocIdFromUrl)(e[0]),{cardId:n}=(0,nw.parseUrlHash)(e[0]);return t({match:e,docId:i,cardId:n})}});var n9=e.i(41158);let n8={borderRadius:"md",padding:"0.05em 0.1em",display:"inline",color:"gray.700"},n7=(0,l.forwardRef)(({mentionLabel:e,mentionIcon:t,mentionTargetUrl:i,onClick:n,hasError:r=!1,isSimpleLinkVersion:o=!1,...s},l)=>{let d=o?n9.default:"span";return(0,a.jsxs)(q.Box,{ref:l,position:"relative","data-selection-ring":!0,className:"mention",onClick:n,...n8,color:r?"gray.600":n8.color,...s,as:d,...{href:o?i:void 0,cursor:(n||o)&&!r?"pointer":"default"},children:[(0,a.jsxs)(Y.HStack,{display:"inline-flex",spacing:0,children:[t&&(0,a.jsx)(q.Box,{display:"inline-block",textAlign:"center",minWidth:4,children:(0,a.jsx)(el.FontAwesomeIcon,{icon:t,fixedWidth:!0,size:"sm",style:{marginInlineStart:"0.1em",marginInlineEnd:"0.3em"}})}),(0,a.jsx)(ew.Text,{noOfLines:1,whiteSpace:"normal",wordBreak:"break-all",flex:1,lineHeight:"normal",children:e})]}),eV.config.GAMMA_PUPPETEER_SERVICE&&i&&(0,a.jsx)(eF.Link,{href:i,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0,top:"0",left:"0"})]})});n7.displayName="MentionTag";let ae=()=>(0,a.jsx)(q.Box,{as:"span",className:"mention",...n8,children:(0,a.jsx)(eC.Spinner,{size:"xs",opacity:"0.8",margin:"0 0.1em"})}),at="Untitled",ai=({node:e,editor:t})=>{let{id:i,docId:n}=e.attrs,r=(0,w.useAppSelector)((0,nf.selectCardTitle)(i)),o=(0,w.useAppSelector)(k.selectCardIds).includes(i),s=(0,w.useAppSelector)(k.selectEditable);(0,l.useEffect)(()=>{t.storage[aa.name][i]=r},[r,t.storage,i]);let d=(0,l.useCallback)(e=>{(0,nv.navigateToCardLink)(t,e,i)},[t,i]),c=(0,nb.useShouldUsePublishedVersion)(),p=(0,l.useMemo)(()=>{let e=(0,nw.getCardUrl)({cardId:i,docId:n||t.gammaDocId});return c?(0,nC.getRelativeOrAbsoluteUrl)({url:e}):e},[i,n,t,c]);return(0,a.jsx)(u,{as:"span",children:o?(0,a.jsx)(n7,{"data-testid":"card-mention",onClick:s?void 0:d,onDoubleClick:s?d:void 0,mentionLabel:r||at,mentionIcon:et.faRectangle,mentionTargetUrl:p}):(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ew.Text,{children:(0,a.jsx)(ei.Trans,{message:"Please use the <0>@ key to recreate the card mention.",id:"HAIPtO",components:{0:(0,a.jsx)(nm,{fontSize:"sm",color:"blackAlpha.800"})}})}),children:(0,a.jsx)(n7,{"data-testid":"card-mention",hasError:!0,mentionLabel:"Cannot find referenced card",mentionIcon:X.faRectangleXmark})})})},an=e=>(0,a.jsx)(u,{as:"span",children:(0,a.jsx)(ny,{type:"card"})}),aa=(0,tj.createTiptapNode)("cardMention",{addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:n5}}),priority:tO.ExtensionPriorityMap.CardMention,selectable:!0,addPasteRules(){return[n6({filterFn:(e,t)=>e===this.editor.gammaDocId&&!!t,getAttributesFn:({docId:e,cardId:t})=>({id:t,docId:e})})(this.type)]},addCommands(){return{addCardMention:({id:e,docId:t,mentionedById:i},n)=>({chain:a,tr:r})=>{let o=r.doc.resolve(n.to).nodeAfter;o?.text?.startsWith(" ")&&(n.to+=1);let{schema:s}=this.editor,l=ng.Fragment.fromArray([s.nodeFromJSON({type:this.name,attrs:{id:e,docId:t,mentionedById:i}}),s.text(" ")]);return a().focus().command(({tr:e,dispatch:t})=>(t&&e.replaceWith(n.from,n.to,l),!0)).run(),!0}}},parseHTML(){return[{tag:`a[data-type="${this.name}"]`,priority:51,getAttrs:e=>({docId:e.getAttribute("data-doc-id")||null,mentionedById:e.getAttribute("data-mentioned-by-id")||null})}]},renderHTML({HTMLAttributes:e,node:t}){let{id:i,docId:n}=t.attrs,a=this.storage[i]||at;return["a",(0,m.mergeAttributes)({"data-type":this.name,"data-doc-id":n||void 0,"data-mentioned-by-id":t.attrs.mentionedById||void 0,href:(0,nw.getCardUrl)({docId:n,cardId:i})},this.options.HTMLAttributes,e),a]},renderText({node:e}){let{id:t,docId:i}=e.attrs,n=this.storage[t]||at,a=(0,nw.getCardUrl)({docId:i,cardId:t});return`[${n}](${a})`},addNodeView(){return this.editor.isThumbnail?(0,tD.ReactNodeViewRenderer)(an,{update:tB.attrsOrDecorationsChanged}):(0,tD.ReactNodeViewRenderer)(ai,{update:tB.attrsOrDecorationsChanged})}});e.s(["CardMention",0,aa,"CardMentionNodeView",0,ai],431026);var ar=e.i(275316);e.i(860686);let ao=()=>{let e=(0,to.useColorModeValue)("gray.50","gray.700"),t=(0,to.useColorModeValue)("gray.600","gray.400");return(0,a.jsx)(es.Badge,{pos:"absolute",size:"xs",bottom:2,insetEnd:2,colorScheme:"blackAlpha",bg:e,color:t,textTransform:"none",children:(0,a.jsxs)(Y.HStack,{spacing:1,children:[(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faGlobeAmericas}),(0,a.jsx)(ew.Text,{children:(0,a.jsx)(ei.Trans,{message:"Site",id:"ebQKK7"})})]})})};ao.displayName="SiteBadge";var as=e.i(609589);let al=e=>e&&e.length?e:h.i18n._({id:"7ZviFu",message:"Untitled {GAMMA_ARTIFACT_PROPER_NOUN}",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}});var ad=e.i(285042),ac=e.i(847092),au=e.i(406112),ap=e.i(550530),ah=((n={}).NO_PERMISSION="no_permission",n.ORG_MANAGED="org_managed",n),am=e.i(601583),ag=e.i(534904),af=e.i(180939),ab=e.i(514791),ax=e.i(857051);let ay=()=>({bgColor:(0,to.useColorModeValue)("white","elevation.2"),borderColor:(0,to.useColorModeValue)("gray.200","gray.800"),internalBorderColor:(0,to.useColorModeValue)("blackAlpha.50","whiteAlpha.50"),hoverBgColor:(0,to.useColorModeValue)("gray.50","elevation.4"),primaryColor:(0,to.useColorModeValue)("gray.900","white"),secondaryColor:(0,to.useColorModeValue)("gray.500","gray.400"),thumbnailBgColor:(0,to.useColorModeValue)("gray.50","gray.700"),padding:3}),av=40/21,aC=({href:e,target:t,children:i})=>(0,a.jsx)(nT,{as:n9.default,outline:"none",href:e,target:t,"data-card-link":!0,children:i});aC.displayName="CardLinkWrapper";let aw=l.default.forwardRef(({id:e,children:t,dataAttribute:i},n)=>{let{bgColor:r,borderColor:o,hoverBgColor:s}=ay();return(0,a.jsx)(nL,{overflow:"hidden",ref:n,...i&&{[i]:e},bg:r,borderRadius:"md",borderColor:o,borderWidth:"1px",shadow:"sm",as:ax.GridItem,cursor:"pointer",_hover:{bg:s},sx:{"&:has([data-card-link]:focus)":{shadow:"outline"}},transition:"background-color 0.2s ease",role:"group",children:(0,a.jsx)(J.Flex,{direction:"column",height:"100%",children:t})},e)});aw.displayName="GridCardContainer";let aS=({href:e,target:t,thumbnailSrc:i,thumbnailFallbackSrc:n,createdByName:r,createdByProfileImageUrl:o,showAvatar:s=!0,badges:l})=>{let{internalBorderColor:d,thumbnailBgColor:c}=ay();return(0,a.jsx)(aC,{href:e,target:t,children:(0,a.jsxs)(q.Box,{bgColor:c,overflow:"hidden",position:"relative",borderBottomWidth:"1px",borderBottomColor:d,children:[(0,a.jsx)(ab.AspectRatio,{ratio:av,children:(0,a.jsx)(i3.Image,{src:i,fallbackSrc:n||nP.default.src,objectFit:"cover",w:"100%",h:"100%"})}),s&&r&&(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"Created by {createdByName}",id:"pS1F3d",values:{createdByName:r}}),placement:"top",children:(0,a.jsx)(eO.Avatar,{zIndex:1,position:"absolute",bottom:2,borderWidth:"1px",insetStart:2,size:"xs",cursor:"help",name:r,src:o})}),l,(0,a.jsx)(q.Box,{position:"absolute",inset:0,bg:"blackAlpha.50",opacity:0,transition:"opacity 0.2s ease",_groupHover:{opacity:1},pointerEvents:"none"})]})})};aS.displayName="GridCardThumbnail";let ak=({timestampDescription:e,menu:t})=>{let{secondaryColor:i}=ay();return(0,a.jsxs)(J.Flex,{align:"end",justify:"space-between",gap:1,children:[e&&(0,a.jsx)(ew.Text,{fontSize:"xxs",color:i,flexShrink:0,lineHeight:"short",children:e}),(0,a.jsx)(tr.Spacer,{}),t&&(0,a.jsx)(q.Box,{position:"relative",zIndex:1,children:t})]})};ak.displayName="GridCardFooter";let aA=({title:e,subtitle:t,badge:i})=>{let{primaryColor:n}=ay();return(0,a.jsxs)(q.Box,{children:[(0,a.jsxs)(J.Flex,{align:"flex-start",justify:"space-between",gap:1.5,w:"100%",children:[(0,a.jsx)(ew.Text,{noOfLines:t?1:2,fontSize:"sm",mb:t?"1":void 0,fontWeight:"medium",lineHeight:"short",minH:t?void 0:"2.75em",color:n,children:e}),i]}),t]})};aA.displayName="GridCardTitleSection",e.s(["GridCardContainer",0,aw,"GridCardFooter",0,ak,"GridCardThumbnail",0,aS,"GridCardTitleSection",0,aA,"useGridCardStyling",0,ay],516480);var aE=e.i(156518);let a_=({icon:e,label:t})=>e?(0,a.jsxs)(aE.TagLabel,{wordBreak:"break-all",children:[(0,a.jsx)(aE.TagLeftIcon,{boxSize:"12px",as:el.FontAwesomeIcon,icon:e,"aria-hidden":!0}),t]}):(0,a.jsx)(aE.TagLabel,{wordBreak:"break-all",children:t}),aI=({href:e,label:t,icon:i,onClick:n,isDisabled:r,color:o,colorScheme:s,...l})=>{let d=(0,to.useColorModeValue)("blackAlpha.50","whiteAlpha.100"),c=(0,to.useColorModeValue)("blackAlpha.200","whiteAlpha.200"),u=(0,to.useColorModeValue)("blackAlpha.800","whiteAlpha.800"),p=(0,to.useColorModeValue)("gray.500","gray.400"),h=!r&&(n||e),m={size:"sm",fontSize:"xs",maxW:"20ch",_hover:{bg:h?c:void 0}};return h?(0,a.jsx)(aE.Tag,{as:n9.default,href:e,"data-testid":"link-tag",onClick:n,bg:d,color:u,...m,...l,children:(0,a.jsx)(a_,{label:t,icon:i})}):(0,a.jsx)(aE.Tag,{"data-testid":"link-tag",bg:d,pointerEvents:"none",color:p,...m,...l,children:(0,a.jsx)(a_,{label:t,icon:i})})},aM=({href:e,title:t,createdByName:i,createdByEmail:n,createdTime:r,isDuplicateEnabled:o,isRenameEnabled:s,isShareEnabled:l,isTrashed:d,isFavorited:c,isTrashAndRestoreEnabled:u,isRemoveFromChannelEnabled:h,onDuplicate:m,onFavorite:g,onUnfavorite:f,onTrash:b,onPermanentDelete:x,onRestore:y,onShareClick:v,onRename:C,onRemoveFromChannel:w,onRemixThis:S,isRemixLoading:k,onCopyAsTemplate:A,isSiteCreationDisabledByAdmin:E=!1,tags:_=[],disabledPermanentDeletionReason:I})=>{let M=(0,a.jsx)(ei.Trans,{message:"This feature has been disabled by your workspace admin",id:"jZRVGl"}),{onCopy:T}=(0,ac.useClipboard)(`${window.location.origin}${e}`),L=(0,af.useCanUseProductFeature)("workspace_templates"),j=(0,to.useColorModeValue)("gray.500","gray.400"),P=(0,p.useToast)(),{secondaryColor:D}=ay(),{isOpen:N,onOpen:R,onClose:O}=(0,au.useDisclosure)(),B=(0,am.formatDate)(r,"MMMM do, yyyy");return(0,a.jsxs)(tv.Menu,{isLazy:!0,closeOnSelect:!1,modifiers:[{name:"flip",enabled:!0,options:{fallbackPlacements:["bottom","bottom-start","bottom-end","right-start","left-start","right-end","left-end","top-start","top-end"]}}],children:[(0,a.jsx)(tC.MenuButton,{"data-dashboard-doc-menu":!0,colorScheme:"alpha",as:ty.IconButton,size:"xs",variant:"ghost",borderRadius:"full",onClick:R,icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faEllipsisH}),color:D,children:(0,a.jsx)(ei.Trans,{message:"Actions",id:"7L01XJ"})}),N&&(0,a.jsx)(tE.Portal,{children:(0,a.jsxs)(tk.MenuList,{maxW:"sm",zIndex:"overlay",children:[(0,a.jsxs)(q.Box,{px:4,py:0,wordBreak:"break-word",children:[(0,a.jsx)(ew.Text,{noOfLines:2,children:t}),(0,a.jsx)(ew.Text,{fontSize:"xs",color:j,noOfLines:1,children:(0,a.jsx)(ei.Trans,{message:"Created {formattedCreatedTime}",id:"OCEFcZ",values:{formattedCreatedTime:B}})}),n&&i&&(0,a.jsx)(ed.GammaTooltip,{label:n,children:(0,a.jsx)(ew.Text,{display:"inline-block",fontSize:"xs",color:j,noOfLines:1,children:(0,a.jsx)(ei.Trans,{message:"by {createdByName}",id:"Wpe4mQ",values:{createdByName:i}})})})]}),_.length>0&&(0,a.jsx)(q.Box,{px:4,py:2,children:(0,a.jsx)(ap.Wrap,{children:_.map(({id:e,label:t,href:i,icon:n,color:r,colorScheme:o})=>(0,a.jsx)(aI,{id:e,label:t,icon:n,href:i,color:r,colorScheme:o},e))})}),(0,a.jsx)(tw.MenuDivider,{}),!d&&(0,a.jsxs)(a.Fragment,{children:[h&&(0,a.jsx)(ad.MenuItem,{onClick:w,icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faBan}),children:(0,a.jsx)(ei.Trans,{message:"Remove from folder",id:"bv+Frh"})}),l&&(0,a.jsx)(ad.MenuItem,{onClick:v,icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faShare}),children:(0,a.jsx)(ei.Trans,{message:"Share...",id:"iyga2M"})}),s&&(0,a.jsx)(ad.MenuItem,{onClick:C,icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faPenField}),children:(0,a.jsx)(ei.Trans,{message:"Rename...",id:"Cg4Iup"})}),(0,a.jsx)(tw.MenuDivider,{}),g?c?(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(q.Box,{color:"yellow.400",children:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:X.faStar})}),onClick:f,children:(0,a.jsx)(ei.Trans,{message:"Remove from favorites",id:"T/pF0Z"})}):(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faStar}),onClick:g,children:(0,a.jsx)(ei.Trans,{message:"Add to favorites",id:"pBsoKL"})}):null,o&&!!m&&(0,a.jsx)(ed.GammaTooltip,{label:M,isDisabled:!E,placement:"right",children:(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faClone}),onClick:E?void 0:m,isDisabled:E,children:(0,a.jsx)(ei.Trans,{message:"Duplicate",id:"euc6Ns"})})}),(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faShareSquare}),onClick:()=>{T(),P({title:(0,a.jsx)(ei.Trans,{message:"URL copied.",id:"h5GS+N"}),status:"success",duration:3e3,position:"top"})},children:(0,a.jsx)(ei.Trans,{message:"Copy link",id:"y1eoq1"})}),S&&(0,a.jsx)(ed.GammaTooltip,{label:M,isDisabled:!E,placement:"right",children:(0,a.jsx)(ad.MenuItem,{onClick:E?void 0:S,isDisabled:E||k,icon:k&&!E?(0,a.jsx)(eC.Spinner,{size:"sm"}):(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faSplit}),children:(0,a.jsx)(J.Flex,{gap:2,w:"100%",children:(0,a.jsx)(ei.Trans,{message:"Create from this (Remix)",id:"Qaqur9"})})})}),A&&o&&(0,a.jsx)(ed.GammaTooltip,{label:M,isDisabled:!E,placement:"right",children:(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faLayerGroup}),onClick:E?void 0:A,isDisabled:E,children:(0,a.jsxs)(J.Flex,{gap:2,w:"100%",children:[(0,a.jsx)(ei.Trans,{message:"Save copy as template",id:"FZQC0K"}),!E&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tr.Spacer,{}),(0,a.jsx)(ag.UpsellProductBadge,{canUseFeature:L,productFeature:"workspace_templates"})]})]})})})]}),u&&(0,a.jsx)(tw.MenuDivider,{}),u?d?(0,a.jsx)(ad.MenuItem,{icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:X.faRotateLeft}),onClick:y,children:(0,a.jsx)(ei.Trans,{message:"Restore",id:"yKu/3Y"})}):(0,a.jsx)(ad.MenuItem,{color:"red.500",icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faTrash}),onClick:()=>{O(),b?.()},children:(0,a.jsx)(ei.Trans,{message:"Send to trash",id:"1C/Yjq"})}):null,d&&I===ah.ORG_MANAGED&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tw.MenuDivider,{}),(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"Because this workspace is managed by an organization, members cannot permanently delete documents. You can ask an admin (listed in Settings → Members) to delete it for you. Before an admin can permanently delete the document, they must have at least view access.",id:"L5AOSm"}),children:(0,a.jsx)(ad.MenuItem,{isDisabled:!0,icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faTrash}),children:(0,a.jsx)(ei.Trans,{message:"Permanently delete",id:"0Lbaux"})})})]}),d&&!I&&x&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tw.MenuDivider,{}),(0,a.jsx)(ad.MenuItem,{color:"red.500",icon:(0,a.jsx)(el.FontAwesomeIcon,{fixedWidth:!0,icon:et.faTrash}),onClick:x,children:(0,a.jsx)(ei.Trans,{message:"Permanently delete",id:"0Lbaux"})})]})]})})]})},aT=({isFavorited:e,onFavorite:t,onUnfavorite:i,disableInteractions:n=!1,...r})=>{let[o,s]=(0,l.useState)(!1),d=(0,l.useCallback)(()=>{t&&i?e?(s(!1),i()):(s(!0),setTimeout(()=>{s(!1)},1e3),t()):console.error("[FavoriteButton] onFavorite or onUnfavorite is not defined")},[e,t,i]);return(0,a.jsx)(ed.GammaTooltip,{label:e?(0,a.jsx)(ei.Trans,{message:"Remove from favorites",id:"T/pF0Z"}):(0,a.jsx)(ei.Trans,{message:"Add to favorites",id:"pBsoKL"}),placement:"top",children:(0,a.jsx)(ty.IconButton,{...r,...n?{tabIndex:-1,pointerEvents:"none"}:{},zIndex:"1","data-favorite-button":!0,"aria-label":h.i18n._({id:"pBsoKL",message:"Add to favorites"}),className:`star-wrapper ${o?"active":""}`,onClick:d,variant:"ghost",colorScheme:"alpha",size:"xs",borderRadius:"full",icon:(0,a.jsxs)(q.Box,{as:"span",children:[(0,a.jsx)(el.FontAwesomeIcon,{icon:e?X.faStar:et.faStar}),(0,a.jsxs)(q.Box,{fontSize:"2.5px",children:[(0,a.jsxs)("div",{className:"star",children:[(0,a.jsx)("div",{className:"tl"}),(0,a.jsx)("div",{className:"tr"}),(0,a.jsx)("div",{className:"bl"}),(0,a.jsx)("div",{className:"br"})]}),(0,a.jsx)("div",{className:"ring"}),(0,a.jsx)("div",{className:"circles"})]})]}),...e?{color:"yellow.400",_hover:{color:"yellow.500"},bg:"yellow.50"}:{color:"gray.400",_hover:{color:"gray.500",bg:"gray.50"}}})})},aL=({favicon:e,children:t})=>{let{secondaryColor:i}=ay();return(0,a.jsxs)(J.Flex,{align:"center",gap:1,minW:0,children:[e&&(0,a.jsx)(i3.Image,{maxW:"12px",maxH:"12px",src:e,flexShrink:0}),(0,a.jsx)(ew.Text,{noOfLines:1,color:i,fontSize:"xxs",fontFamily:"mono",wordBreak:"break-all",children:t})]})};aL.displayName="SiteSubtitle";let aj=({ref:e,id:t,title:i,thumbnailImageUrl:n,href:r,createdByYou:o,createdByName:s,createdByEmail:l,createdByProfileImageUrl:d,createdTime:c,isDuplicateEnabled:u=!0,isRenameEnabled:p=!1,isShareEnabled:h=!1,isTrashAndRestoreEnabled:m=!0,isRemoveFromChannelEnabled:g=!1,isTrashed:f=!1,isFavorited:b=!1,site:x,onDuplicate:y,onFavorite:v,onUnfavorite:C,onTrash:w,onPermanentDelete:S,onRestore:k,disabledPermanentDeletionReason:A,onShareClick:E,onRename:_,onRemoveFromChannel:I,onRemixThis:M,isRemixLoading:T,onCopyAsTemplate:L,isSiteCreationDisabledByAdmin:j=!1,menuEnabled:P=!1,openInNewWindow:D=!1,timestampDescription:R,isOffline:O,tags:B=[],visibilityBadge:z})=>{let{secondaryColor:F,padding:H}=ay(),W=(0,as.sortDomainsByCreatedDate)((0,as.filterVerifiedDomains)(x?.domains))?.at(0)?.name;return(0,a.jsxs)(aw,{ref:e,id:t,dataAttribute:"data-doc-grid-item-id",children:[n&&(0,a.jsx)(aS,{href:r,target:D?"_blank":void 0,thumbnailSrc:n?.src,thumbnailFallbackSrc:n?.fallbackSrc,createdByName:o?void 0:s,createdByProfileImageUrl:o?void 0:d,showAvatar:!o,badges:x?.enabled?(0,a.jsx)(ao,{}):void 0}),(0,a.jsxs)(J.Flex,{p:H,direction:"column",gap:1,children:[(0,a.jsx)(aA,{title:al(i),subtitle:x?.enabled&&(0,a.jsx)(aL,{favicon:x.faviconUrl,children:W}),badge:z&&z.icon?(0,a.jsx)(ed.GammaTooltip,{label:z.label,placement:"top",children:(0,a.jsx)(q.Box,{color:F,fontSize:"xs",flexShrink:0,cursor:"help",zIndex:1,children:(0,a.jsx)(el.FontAwesomeIcon,{icon:z.icon,fixedWidth:!0})})}):void 0}),(0,a.jsx)(ak,{timestampDescription:R,menu:P&&(0,a.jsx)(aM,{href:r,title:al(i),createdByName:s,createdByEmail:l,createdTime:c,isDuplicateEnabled:u,isRenameEnabled:p,isShareEnabled:h,isTrashAndRestoreEnabled:m,isRemoveFromChannelEnabled:g,isTrashed:f,isFavorited:b,onDuplicate:y,onFavorite:v,onUnfavorite:C,onTrash:w,onPermanentDelete:S,onRestore:k,disabledPermanentDeletionReason:A,onShareClick:E,onRename:_,onRemoveFromChannel:I,onRemixThis:M,isRemixLoading:T,onCopyAsTemplate:L,isSiteCreationDisabledByAdmin:j,tags:B})})]}),!!v&&!!C&&(0,a.jsx)(q.Box,{position:"absolute",top:3,insetEnd:3,zIndex:3,children:(0,a.jsx)(aT,{isFavorited:b,onFavorite:v,onUnfavorite:C,opacity:b?1:+!!(0,N.isMobileDevice)(),_groupHover:(0,N.isMobileDevice)()||O&&!b?void 0:{opacity:1},_focus:O?void 0:{opacity:1,shadow:"outline"},disableInteractions:O})})]})};var aP=e.i(392164),aD=e.i(45652);let aN=({url:e,nonPublishedUrl:t})=>{let{push:i}=(0,e2.useRouter)(),n=(0,aD.useSSRMounted)(),a=(0,w.useAppSelector)(C.selectDoc),r=(0,w.useAppSelector)(C.selectFile),o=(0,nb.useShouldUsePublishedVersion)(),s=(0,w.useAppSelector)(aP.selectPreviewEnabled),d=o?(0,nC.getRelativeOrAbsoluteUrl)({url:e,doc:a,file:r,previewEnabled:s}):t||e,c=n&&(0,nC.isLinkToCurrentPage)(e,a,r),u=(0,l.useCallback)(e=>{(0,as.urlMatchesSitePreviewRoute)(d)&&(e.preventDefault(),i(d,void 0,{shallow:!0}))},[d,i]);return(0,l.useMemo)(()=>({linkUrl:d,handleClick:s?u:void 0,isCurrentPage:c}),[u,d,s,c])};e.s(["useSiteEnabledLink",0,aN],309847);var aR=e.i(437769);let aO=()=>h.i18n._({id:"NJnubC",message:"Private {GAMMA_ARTIFACT_PROPER_NOUN}",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),aB=(0,eS.motion)(q.Box),az=({node:e,editor:t})=>{let{id:i}=e.attrs,n=(0,nD.useFeatureFlag)("screenshotsEnabled"),r=(0,nb.useShouldUsePublishedVersion)(),{user:o}=(0,M.useUserContext)(),[s]=(0,v.useFavoriteDocMutation)(),d=(0,aD.useSSRMounted)(),{data:c,error:p,loading:h,subscribeToMore:m}=(0,v.useGetDocMentionQuery)({variables:{id:i},skip:r||!i}),g=!!(!r&&o);(0,l.useEffect)(()=>{if(g)return m({document:v.SubscribeToDocMentionDocument,variables:{id:i},updateQuery:(e,{subscriptionData:t})=>t.data&&t.data.doc?{doc:{...e.doc,...t.data.doc,__typename:"Doc"}}:e,onError:e=>{}})},[i,p,m,g]);let{title:f,createdTime:b,createdBy:x,editedTime:y,editors:C,docUser:w}=c?.doc||{},{linkUrl:S,handleClick:k}=aN({url:(0,nw.generateDocUrl)({docId:i,docTitle:f,absolute:!0}),nonPublishedUrl:(0,nw.generateDocUrl)({docId:i,docTitle:f})});(0,l.useEffect)(()=>{t.storage.docMention[i]=p?aO():f},[f,t.storage,i,p]);let A={src:n?c?.doc?.previewUrl:nP.default.src,fallbackSrc:nP.default.src},E=e=>()=>{if(!o)return;let t={input:{docId:i,userId:o.id,favorited:e}};s({variables:t,update:(e,{data:t})=>{e.writeFragment({id:`Doc:${i}`,fragment:v.DocUserUpdateFragmentDoc,data:{docUser:t?.updateDocUser}})},optimisticResponse:{updateDocUser:{...w,favorited:t.input.favorited,__typename:"DocUser"}}})},{popperRef:_,referenceRef:I,isHovering:T,onMouseOver:L,onMouseOut:j,getPopperProps:P}=(0,aR.useLightPopover)();return(0,a.jsxs)(u,{as:"span",children:[h?(0,a.jsx)(ae,{}):p?(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"You don't have access to the linked {GAMMA_ARTIFACT_PROPER_NOUN}. Try asking the owner for access.",id:"MnhVwn",values:{GAMMA_ARTIFACT_PROPER_NOUN:e3.GAMMA_ARTIFACT_PROPER_NOUN}}),children:(0,a.jsx)(n7,{hasError:!0,mentionLabel:aO(),mentionIcon:et.faLock})}):S?(0,a.jsx)(n7,{onMouseOver:r?void 0:L,onMouseOut:r?void 0:j,onClick:k,ref:I,isSimpleLinkVersion:r,mentionLabel:f||"",mentionIcon:et.faRectangleHistory,mentionTargetUrl:S}):null,(0,a.jsx)(tE.Portal,{children:!p&&T&&c&&c.doc&&!r&&(0,a.jsx)(aB,{width:"320px","data-target-name":"doc-mention-popup",border:"1px solid",borderColor:"gray.200",borderRadius:"lg",overflow:"hidden",shadow:"lg",maxW:"80vw",zIndex:"tooltip",ref:_,onMouseOver:L,onMouseOut:j,...P(),...aR.LightPopoverMotionProps,children:(0,a.jsx)(aj,{createdByYou:x?.id===o?.id,title:f||"",timestampDescription:d?(0,a.jsx)(ei.Trans,{message:"Edited {0} ago",id:"yxz5Og",values:{0:(0,am.formatDistanceToNowStrict)(y)}}):"---",NextLink:null,href:S,onClick:k,id:i,createdByName:x?.displayName||"",createdByEmail:x?.email||"",createdByProfileImageUrl:x?.profileImageUrl||"",createdTime:b,thumbnailImageUrl:A,editors:C,isFavorited:!!w?.favorited,onFavorite:E(new Date),onUnfavorite:E(null),menuEnabled:!1,openInNewWindow:!0})})})]})},aF=e=>(0,a.jsx)(u,{as:"span",children:(0,a.jsx)(ny,{type:"doc"})});e.s(["DocMentionNodeView",0,az,"DocMentionThumbnailView",0,aF],272690);let aH=`Unknown ${e3.GAMMA_ARTIFACT_PROPER_NOUN}`,aW=(0,tj.createTiptapNode)("docMention",{addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:n5}}),priority:tO.ExtensionPriorityMap.DocMention,selectable:!0,addPasteRules(){return ar.featureFlags.get("disableDocMentionPasteRule")?[]:[n6({filterFn:(e,t)=>e!==this.editor.gammaDocId||!t,getAttributesFn:({docId:e})=>({id:e})})(this.type)]},addCommands(){return{addDocMention:({id:e,mentionedById:t},i)=>({chain:n,tr:a})=>{let r=a.doc.resolve(i.to).nodeAfter;r?.text?.startsWith(" ")&&(i.to+=1);let{schema:o}=this.editor,s=ng.Fragment.fromArray([o.nodeFromJSON({type:this.name,attrs:{id:e,mentionedById:t}}),o.text(" ")]);return n().focus().command(({tr:e,dispatch:t})=>(t&&e.replaceWith(i.from,i.to,s),!0)).run(),!0}}},parseHTML(){return[{tag:`a[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e,node:t}){let i=this.storage[t.attrs.id]||aH;return["a",(0,m.mergeAttributes)({"data-type":this.name,href:(0,nw.generateDocUrl)({docId:t.attrs.id,absolute:!0})},this.options.HTMLAttributes,e),i]},renderText({node:e}){let t=this.storage[e.attrs.id]||aH,i=(0,nw.generateDocUrl)({docId:e.attrs.id,absolute:!0});return`[${t}](${i})`},addNodeView(){return this.editor.isThumbnail?(0,tD.ReactNodeViewRenderer)(aF,{update:tB.attrsOrDecorationsChanged}):(0,tD.ReactNodeViewRenderer)(az,{update:tB.attrsOrDecorationsChanged})}});e.s(["DocMention",0,aW],343857);let aU=({node:e})=>{let{label:t}=e.attrs;return(0,a.jsx)(u,{as:"span",children:(0,a.jsx)(n7,{mentionLabel:`@${t}`})})},aV=e=>(0,a.jsx)(u,{as:"span",children:(0,a.jsx)(ny,{type:"user"})}),aG=(0,tj.createTiptapNode)("mention",{addOptions:()=>({HTMLAttributes:{},renderLabel:({options:e,node:t})=>`${e.suggestion.char}${t.attrs.label??t.attrs.id}`,suggestion:{char:n5}}),priority:tO.ExtensionPriorityMap.UserMention,selectable:!0,addCommands(){return{addUserMention:({id:e,label:t,profileImageUrl:i,mentionedById:n},a)=>({chain:r,tr:o})=>{let s=o.doc.resolve(a.to).nodeAfter;s?.text?.startsWith(" ")&&(a.to+=1);let{schema:l}=this.editor,d=ng.Fragment.fromArray([l.nodeFromJSON({type:this.name,attrs:{id:e,label:t,profileImageUrl:i,mentionedById:n}}),l.text(" ")]);return r().focus().command(({tr:e,dispatch:t})=>(t&&e.replaceWith(a.from,a.to,d),!0)).run(),!0}}},parseHTML(){return[{tag:`span[data-type="${this.name}"]`,getAttrs:e=>({id:e.getAttribute("data-id"),label:e.getAttribute("data-label"),profileImageUrl:e.getAttribute("data-profile-image-url"),mentionedById:e.getAttribute("data-mentioned-by-id")})}]},renderHTML({node:e,HTMLAttributes:t}){let i={};return e.attrs.id&&(i["data-id"]=e.attrs.id),e.attrs.label&&(i["data-label"]=e.attrs.label),e.attrs.profileImageUrl&&(i["data-profile-image-url"]=e.attrs.profileImageUrl),e.attrs.mentionedById&&(i["data-mentioned-by-id"]=e.attrs.mentionedById),["span",(0,m.mergeAttributes)({"data-type":this.name},this.options.HTMLAttributes,t,i),this.options.renderLabel({options:this.options,node:e})]},renderText({node:e}){return this.options.renderLabel({options:this.options,node:e})},addNodeView(){return this.editor.isThumbnail?(0,tD.ReactNodeViewRenderer)(aV,{update:tB.attrsOrDecorationsChanged}):(0,tD.ReactNodeViewRenderer)(aU,{update:tB.attrsOrDecorationsChanged})}});e.s(["UserMention",0,aG,"UserMentionNodeView",0,aU],500446),e.s([],338812);var a$=e.i(977581),aZ=e.i(482279),aK=e.i(8518),aq=/(^|[^`])`([^`]+)`(?!`)$/,aY=/(^|[^`])`([^`]+)`(?!`)/g,aX=m.Mark.create({name:"code",addOptions:()=>({HTMLAttributes:{}}),excludes:"_",code:!0,exitable:!0,parseHTML:()=>[{tag:"code"}],renderHTML({HTMLAttributes:e}){return["code",(0,m.mergeAttributes)(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t)=>e.content?`\`${t.renderChildren(e.content)}\``:"",addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[(0,m.markInputRule)({find:aq,type:this.type})]},addPasteRules(){return[(0,m.markPasteRule)({find:aY,type:this.type})]}});e.s(["Code",0,aX,"default",0,aX],569962);var aQ=e.i(154258),aJ=e.i(295189),a0=e.i(399685),a1=m.Node.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{},nextNodeType:"paragraph"}),group:"block",parseHTML:()=>[{tag:"hr"}],renderHTML({HTMLAttributes:e}){return["hr",(0,m.mergeAttributes)(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!(0,m.canInsertNode)(t,t.schema.nodes[this.name]))return!1;let{selection:i}=t,{$to:n}=i,a=e();return(0,m.isNodeSelection)(i)?a.insertContentAt(n.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({state:e,tr:t,dispatch:i})=>{if(i){let{$to:i}=t.selection,n=i.end();if(i.nodeAfter)i.nodeAfter.isTextblock?t.setSelection(t_.TextSelection.create(t.doc,i.pos+1)):i.nodeAfter.isBlock?t.setSelection(t_.NodeSelection.create(t.doc,i.pos)):t.setSelection(t_.TextSelection.create(t.doc,i.pos));else{let a=e.schema.nodes[this.options.nextNodeType]||i.parent.type.contentMatch.defaultType,r=null==a?void 0:a.create();r&&(t.insert(n,r),t.setSelection(t_.TextSelection.create(t.doc,n+1)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,m.nodeInputRule)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}}),a2=e.i(676095),a3=e.i(952660),a5=e.i(570752),a4=e.i(936265),a6=e.i(562931),a9=e.i(383865),a8=e.i(520100),a7=e.i(388773),re=m.Extension.create({name:"starterKit",addExtensions(){var e,t,i,n;let a=[];return!1!==this.options.bold&&a.push(aK.Bold.configure(this.options.bold)),!1!==this.options.blockquote&&a.push(aZ.Blockquote.configure(this.options.blockquote)),!1!==this.options.bulletList&&a.push(a5.BulletList.configure(this.options.bulletList)),!1!==this.options.code&&a.push(aX.configure(this.options.code)),!1!==this.options.codeBlock&&a.push(tT.configure(this.options.codeBlock)),!1!==this.options.document&&a.push(aQ.Document.configure(this.options.document)),!1!==this.options.dropcursor&&a.push(a7.Dropcursor.configure(this.options.dropcursor)),!1!==this.options.gapcursor&&a.push(a7.Gapcursor.configure(this.options.gapcursor)),!1!==this.options.hardBreak&&a.push(aJ.HardBreak.configure(this.options.hardBreak)),!1!==this.options.heading&&a.push(a0.Heading.configure(this.options.heading)),!1!==this.options.undoRedo&&a.push(a7.UndoRedo.configure(this.options.undoRedo)),!1!==this.options.horizontalRule&&a.push(a1.configure(this.options.horizontalRule)),!1!==this.options.italic&&a.push(a2.Italic.configure(this.options.italic)),!1!==this.options.listItem&&a.push(a5.ListItem.configure(this.options.listItem)),!1!==this.options.listKeymap&&a.push(a5.ListKeymap.configure(null==(e=this.options)?void 0:e.listKeymap)),!1!==this.options.link&&a.push(a3.Link.configure(null==(t=this.options)?void 0:t.link)),!1!==this.options.orderedList&&a.push(a5.OrderedList.configure(this.options.orderedList)),!1!==this.options.paragraph&&a.push(a4.Paragraph.configure(this.options.paragraph)),!1!==this.options.strike&&a.push(a6.Strike.configure(this.options.strike)),!1!==this.options.text&&a.push(a9.Text.configure(this.options.text)),!1!==this.options.underline&&a.push(a8.Underline.configure(null==(i=this.options)?void 0:i.underline)),!1!==this.options.trailingNode&&a.push(a7.TrailingNode.configure(null==(n=this.options)?void 0:n.trailingNode)),a}});function rt(){return({tr:e,commands:t})=>t.setTextSelection({from:0,to:e.doc.content.size})}e.i(601019),e.s(["selectAllText",0,rt],539106);var ri=t_;class rn extends ri.Plugin{decorateNode;constructor({key:e,decorateNode:t,options:i={}}){super({key:e,state:{init(e,{doc:t}){return{decorations:this.decorateDoc(t)}},apply(e,t){let n=i.processEntireDoc?.(),a=i.shouldProcessStep??a$.isReplaceStep,r=t.decorations;if(!e.steps.length&&!n)return{...t,decorations:r.map(e.mapping,e.doc)};if(n||(0,a$.isReplaceDoc)(e))return{...t,decorations:this.decorateDoc(e.doc)};let o=[];e.steps.forEach((t,i)=>{if(a(t))return this.processStep(t,e,o,i)});let s=this.removeOverlappingDecorations(r.map(e.mapping,e.doc),o).add(e.doc,o);return{...t,decorations:s}}},props:{decorations:t=>e.getState(t)?.decorations}}),this.decorateNode=t}removeOverlappingDecorations(e,t){let i=this.getDecorationsRanges(t),n=e.find(i.from,i.to).filter(e=>i.hasRange(e));return e.remove(n)}getDecorationsRanges(e){let t=1/0,i=-1/0,n=new Set;return e.forEach(({from:e,to:a})=>{ei&&(i=a),n.add(`${e}:${a}`)}),{from:t,to:i,hasRange:({from:e,to:t})=>n.has(`${e}:${t}`)}}decorateDoc(e){let t=[];return e.descendants(this.decorateNode.bind(this,t)),iK.DecorationSet.create(e,t)}processStep(e,t,i,n){let a=t.doc,r=t.mapping.slice(n+1),o=r.map("from"in e?e.from:e.pos),s="to"in e?r.map(e.to):o,l="slice"in e?e.slice.content.size:0;a.descendants((e,t,n,a)=>!(t+e.nodeSizes+l)&&("document"===e.type.name||!n||this.decorateNode(i,e,t,n,a)))}}var ra=e.i(6419),rr=e.i(854861);function ro(e,t,i,n,a){if((0,ra.isAnnotatableParent)(n)&&e.push(iK.Decoration.node(i,i+t.nodeSize,{},{isAnnotatable:!0})),(0,E.isBlockNode)(t))e.push(iK.Decoration.node(i,i+t.nodeSize,{class:(0,nc.cx)("block",`block-${t.type.name}`,0===a&&"first-block",a===n.childCount-1&&"last-block")})),0===a&&((0,_.isCardNode)(n)||(0,rr.isBodyCardLayoutItem)(n))&&e.push(iK.Decoration.node(i,i+t.nodeSize,{class:"first-block-in-card"},{isFirstBlockInCard:!0}));else{if(!t.isLeaf&&!t.isBlock)return!1;e.push(iK.Decoration.node(i,i+t.nodeSize,{class:`node-${t.type.name}`}))}return!0}let rs=m.Extension.create({name:"blockClass",addOptions:()=>({blockClass:"block"}),addProseMirrorPlugins:()=>[new rn({key:new t_.PluginKey("blockClass"),decorateNode:ro,options:{processEntireDoc:()=>!ar.featureFlags.get("useTransactionBlockPlugin")}})]});e.s(["BlockClass",0,rs,"findFirstBlockInCardDeco",0,e=>!!e.find(e=>e.spec.isFirstBlockInCard)],13948),e.i(791060);var rl=e.i(57606),rd=e.i(777590),rc=e.i(749e3);let ru=(0,l.forwardRef)(({query:e,onSelect:t},i)=>{let n=(0,w.useAppSelector)(C.selectFile),r=(0,rc.useCanEditableFile)("edit",n),[o,s]=(0,l.useState)(null),d=(0,l.useCallback)(e=>{if(s(e),e.shadowRoot){let t=document.createElement("style");t.innerHTML="nav + div.padding-lr { display: none }",e.shadowRoot.appendChild(t)}e.addEventListener("mousedown",er.preventDefaultToAvoidBlur)},[]);(({ref:e,pickerInstance:t})=>{(0,l.useImperativeHandle)(e,()=>({onKeyDown:({event:e})=>!!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"].includes(e.key)&&(e=>{let i=t.component?.refs?.searchInput?.current;if(i){let{key:t,code:n}=e;i.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:n}))}return e.stopPropagation(),e.preventDefault(),!0})(e)}))})({ref:i,pickerInstance:o}),(0,l.useEffect)(()=>{if(!o)return;let t=o.component?.refs?.searchInput?.current;t&&(t.value=e,t.dispatchEvent(new Event("input",{bubbles:!0})))},[o,e]);let c=(0,l.useCallback)(e=>{let i=(0,rl.getEmojiObjectFromId)(e.id);i&&t(i)},[t]);return r?(0,a.jsx)(rd.EmojiPicker,{onCreate:d,perLine:9,searchPosition:"sticky",handlePick:c,shouldFocusSearch:!1,dataTargetName:"emoji-list"}):(0,a.jsx)(a.Fragment,{})});var rp=e.i(53574);let rh=/:([a-zA-Z0-9_+-]+):$/,rm=new t_.PluginKey("EmojiMenu"),rg=(0,tj.createTiptapNode)("emoji",{selectable:!1,addStorage:()=>({hasMigrated:!1,isMigrationScheduled:!1}),parseHTML:()=>[{tag:"span.emoji:not([id])",skip:!0},{tag:"span[class=emoji]"}],addCommands(){return{openEmojiPicker:(e=!0)=>({commands:t,tr:i,editor:n})=>(((e,t)=>{let a={...e.getState(n.view.state)};a.active=!0,a.key=t,a.query="",i.setMeta(e,a)})(rm,":"),!e||t.insertContent(":")),migrateNativeEmojis:()=>({editor:e})=>!this.storage.hasMigrated&&!this.storage.isMigrationScheduled&&(this.storage.isMigrationScheduled=!0,rl.emojisReadyPromise.then(()=>{e.commands.command(({tr:e,state:t})=>{let{doc:i,schema:n}=t;return i.descendants((t,i,a)=>{rb({node:t,pos:i,parent:a,tr:e,schema:n})}),this.storage.hasMigrated=!0,this.storage.isMigrationScheduled=!1,!0})}),!0)}},addInputRules:()=>[new m.InputRule({find:rh,handler:({range:e,match:t,commands:i})=>{let n,a=t[1],r=(0,rl.getEmojiObjectFromId)(a);if(!r)return;let o=(n=(0,rl.getNativeFromEmojiObject)(r),{id:r.id,native:n});i.insertContentAt(e,{type:"emoji",attrs:o})}})],renderHTML:({HTMLAttributes:e,node:t})=>["span",(0,m.mergeAttributes)(e,{class:"emoji",id:t.attrs.id,native:t.attrs.native}),`${t.attrs.native||"�"}`],renderText:({node:e})=>`${e.attrs.native||"�"}`,addProseMirrorPlugins:()=>[new t_.Plugin({key:new t_.PluginKey("emojiTransform"),appendTransaction:(e,t,i)=>(0,a$.processTransactionsChangedNodes)(e,i,rb)})]}),rf=n$({name:"emojiShortcuts",char:":",pluginKey:rm,MenuComponent:(0,l.forwardRef)(({query:e,editor:t},i)=>t.isEditable?(0,a.jsx)(ru,{ref:i,query:e,onSelect:i=>{let{id:n}=i,a=(0,rl.getNativeFromEmojiObject)(i),r=t.state.selection;t.chain().deleteRange({from:r.from-e.length-1,to:r.to}).insertContent({type:"emoji",attrs:{id:n,native:a}}).insertContent(" ").run()}}):null),priority:tO.ExtensionPriorityMap.EmojiShortcuts}),rb=({node:e,pos:t,tr:i,schema:n})=>{if(!(0,rl.isEmojiDataLoaded)())return!1;if(!e.isText||!e.text)return!0;let a=e.marks.map(e=>e.toJSON()),{replaced:r,nodes:o}=(0,rp.handleReplaceNativeEmojis)(e.text,a);try{r&&i.replaceWith(i.mapping.map(t),i.mapping.map(t+e.nodeSize),o.map(e=>n.nodeFromJSON(e)))}catch(i){console.error("[migratePlugin] Error migrating emoji",{err:i,pos:t,text:e.text,node:e,nodes:o})}return!0};e.s(["EmojiNode",0,rg,"EmojiShortcuts",0,rf],639014),e.i(988162);var rx=e.i(391303),ry=e.i(196444);let rv=a4.default.extend({parseHTML:()=>[{tag:"p"}],renderHTML:({HTMLAttributes:e})=>["p",(0,m.mergeAttributes)(e,{dir:"auto"}),0]}),rC=(0,tf.isHotkey)("mod+Enter"),rw=(0,tf.isHotkey)("mod+a"),rS=({commentEditor:e,initialContent:t})=>((0,tm.useTiptapEditorEffect)(e=>{e.commands.setContent(t,{emitUpdate:!1})},[t]),(0,ta.jsx)(tc.TiptapEditorContent,{editor:e})),rk=({alwaysShowButtons:e,commentEditor:t,handleKeydown:i,isLight:n,borderProps:a,placeholder:r,onCancelEditingClick:o,handleCommentCancel:s,handleCommentSave:l,saveButtonIcon:d,saveButtonText:c})=>{let u=(0,td.useEditorState)(),p=(0,m.isNodeEmpty)(u.doc),h=(0,w.useAppSelector)(C.selectWorkspaceId);return(0,tm.useTiptapEditorEffect)(e=>{e&&!e.isDestroyed&&h&&e.commands.initializeUploadExtension?.(h)},[h]),(0,tm.useTiptapEditorEffect)(e=>{!e||e.isDestroyed||e.isEditable||e.setEditable(!0)},[]),(0,ta.jsxs)(ta.Fragment,{children:[(0,ta.jsx)(q.Box,{tabIndex:0,w:"100%",onKeyDownCapture:i,onKeyPressCapture:i,className:"comment-editor",color:n?"gray.700":"gray.200",bg:n?"white":"gray.700",...a,sx:{"p:first-of-type::before":p?{content:`"${r}"`,float:"left",color:n?"gray.400":"gray.500",pointerEvents:"none",height:"0"}:""},fontSize:"sm",children:(0,ta.jsx)(tc.TiptapEditorContent,{editor:t,className:"comment-editor",style:{wordBreak:"break-word",width:"100%"}})}),(0,ta.jsxs)(Q.Collapse,{in:!!(e||!p),children:[(0,ta.jsx)(q.Box,{h:3,children:(0,ta.jsx)(ta.Fragment,{})}),(0,ta.jsxs)(Y.HStack,{children:[(0,ta.jsx)(tr.Spacer,{}),!!o&&(0,ta.jsx)(ed.GammaTooltip,{label:(0,ta.jsx)(tg.Trans,{message:"Cancel writing comment",id:"zeQdHz"}),placement:"top",children:(0,ta.jsx)(eo.Button,{size:"sm",variant:"hazardous",onClick:s,children:(0,ta.jsx)(tg.Trans,{message:"Cancel",id:"dEgA5A"})})}),(0,ta.jsx)(eo.Button,{size:"sm",variant:"solid",leftIcon:d,isDisabled:p||(0,a$.hasImageNodeWithNoSrc)(t.state.doc),onClick:l,"data-testid":"post-comment",children:c})]})]})]})},rA=l.default.memo(({clearContentOnSave:e=!1,editable:t=!0,saveButtonText:i=(0,ta.jsx)(tg.Trans,{message:"Save",id:"tfDRzk"}),saveButtonIcon:n=(0,ta.jsx)(tl.FontAwesomeIcon,{icon:ts.faPaperPlane}),initialContent:a="",placeholder:r="Reply",showBorder:o=!0,onCancelEditingClick:d,onCommentSave:c,onCreate:p=()=>{},onUpdate:h=()=>{},shouldFocus:g=!0,alwaysShowButtons:f=!1,...b})=>{let x=(0,l.useMemo)(()=>({codeBlock:(0,tp.tiptapNodeView)({component:function(e){return(0,ta.jsx)(u,{...e,children:(0,ta.jsx)("pre",{children:(0,ta.jsx)(s.NodeViewContent,{as:"code"})})})},extension:i1}),mention:(0,tp.tiptapNodeView)({component:aU,extension:aG}),image:(0,tp.tiptapNodeView)({component:ns,extension:nl}),docMention:(0,tp.tiptapNodeView)({component:az,extension:aW}),cardMention:(0,tp.tiptapNodeView)({component:ai,extension:aa})}),[]),y=(0,l.useMemo)(()=>[m.Extension.create({addCommands:()=>({selectAllText:rt})}),re.configure({horizontalRule:!1,codeBlock:!1,link:{openOnClick:!1},paragraph:!1,underline:!1,trailingNode:!1,listKeymap:!1}),rv,n4,i1,nl,aG,aW,aa,rg,rs,rf,rx.MediaUpload,ry.FocusedNodes],[]),v=(0,tb.useSelector)(C.selectDocId),w=(0,tb.useSelector)(C.selectWorkspaceId),S=(0,th.useTiptapEditor)({extensions:y,content:a,onCreate:({editor:e})=>{p({editor:e}),e.gammaDocId=v,e.gammaOrgId=w},onUpdate:({editor:e,transaction:t,appendedTransactions:i})=>{h({editor:e,transaction:t,appendedTransactions:i})},editable:t,immediatelyRender:!0,autofocus:g&&t}),{colorMode:k}=(0,to.useColorMode)(),A="light"===k,E=()=>{!c||!S||(0,a$.isTreeEmpty)(S.state.doc)||(0,a$.hasImageNodeWithNoSrc)(S.state.doc)||(c(S.getJSON()),e&&S.commands.clearContent(!0))};return t?(0,ta.jsx)(J.Flex,{"data-gamma-child-tiptap-editor":"comment-editor",direction:"column",...b,children:(0,ta.jsx)(tu.TiptapEditorView,{editor:S,nodeViewComponents:x,children:(0,ta.jsx)(rk,{alwaysShowButtons:f,commentEditor:S,handleKeydown:e=>{rw(e)&&(e.preventDefault(),S.commands.selectAllText()),rC(e)&&(e.preventDefault(),e.stopPropagation(),E())},isLight:A,borderProps:o?{border:"1px solid",borderColor:A?"gray.200":"gray.600",borderRadius:"md"}:{},handleCommentCancel:()=>{d&&d(),S.commands.clearContent(!0)},handleCommentSave:E,onCancelEditingClick:d,placeholder:r,saveButtonIcon:n,saveButtonText:i})})}):(0,ta.jsx)(q.Box,{fontSize:"sm",children:(0,ta.jsx)(tu.TiptapEditorView,{editor:S,nodeViewComponents:x,children:(0,ta.jsx)(rS,{commentEditor:S,initialContent:a})})})});rA.displayName="CommentEditor";var rE=e.i(763896);let r_=({targetHtml:e,onTargetClick:t,isSourceContentAvailable:i,instanceType:n})=>{let[r,o]=(0,l.useState)(!1),[s,d]=(0,l.useState)(!1),c=(0,l.useRef)(null),u=(0,rE.useTooltipPortalRef)(),p=r?et.faChevronCircleUp:et.faChevronCircleDown,m=r?h.i18n._({id:"vLyv1R",message:"Hide"}):h.i18n._({id:"fMPkxb",message:"Show more"});(0,l.useEffect)(()=>{c.current&&d(!(!r&&c.current.scrollHeight<=c.current?.clientHeight))},[r]);let g=(0,l.useMemo)(()=>({__html:e?nA.default.sanitize(e):""}),[e]);return(0,a.jsxs)(J.Flex,{className:"block-target-html",ps:3,mb:2,borderInlineStartWidth:"4px",borderInlineStartStyle:"solid",borderInlineStartColor:"yellow.200",direction:"row",alignItems:"flex-end",cursor:i&&"feed"===n?"pointer":"auto",onClick:t,children:[(0,a.jsx)(ed.GammaTooltip,{label:(0,a.jsx)(ei.Trans,{message:"Source content no longer exists",id:"/oHV5h"}),isDisabled:!("feed"===n&&!i),portalProps:{containerRef:u},children:(0,a.jsx)(q.Box,{flex:1,ms:-3,ps:3,w:"100%",fontSize:"sm",noOfLines:r?void 0:3,dangerouslySetInnerHTML:g,ref:c,_hover:{bgColor:"feed"===n?i?"yellow.100":"gray.50":void 0}})}),s&&(0,a.jsx)(ed.GammaTooltip,{label:m,portalProps:{containerRef:u},children:(0,a.jsx)(ty.IconButton,{variant:"ghost",size:"xs","aria-label":m,icon:(0,a.jsx)(el.FontAwesomeIcon,{icon:p}),onClick:()=>{o(e=>!e)},"data-target-name":"comment-target-expand-button",isRound:!0})})]})};e.s(["CommentTargetContent",0,r_],681116);let rI=({draftComment:e,showUser:t=!0,showBorder:i=!0,user:n,onCommentDraftUpdate:r,onCommentSave:o,commentIdToHighlight:s,alwaysShowButtons:l=!1,...d})=>(0,a.jsxs)(J.Flex,{direction:"column",...d,children:[t&&(0,a.jsxs)(Y.HStack,{mb:3,pt:3,children:[(0,a.jsx)(eO.Avatar,{src:n?.profileImageUrl,size:"sm"}),(0,a.jsx)(ee.Stack,{children:(0,a.jsx)(ew.Text,{fontWeight:"bold",fontSize:"sm",children:(0,a.jsx)(ei.Trans,{message:"{0} (You)",id:"866PMb",values:{0:n?.displayName}})})})]}),e&&e?.targetHtml&&(0,a.jsx)(r_,{targetHtml:e.targetHtml}),(0,a.jsx)(rA,{onUpdate:r,initialContent:e?.json||null,clearContentOnSave:!0,editable:!0,saveButtonText:(0,a.jsx)(ei.Trans,{message:"Post comment",id:"26iNma"}),placeholder:h.i18n._({id:"UkDQUD",message:"Say something"}),onCommentSave:o,showBorder:i,shouldFocus:!!(!(0,N.isMobileOrTabletDevice)()&&!s),alwaysShowButtons:l})]}),rM="80vh";e.s(["DOCUMENT_BOTTOM_PADDING_COMMENT_OPEN",0,rM,"DOCUMENT_BOTTOM_PADDING_DEFAULT",0,"10vh","DOCUMENT_BOTTOM_PADDING_INSERT_WIDGET_BOTTOM",0,"20vh"],645315);let rT="block-comments-container",rL=({offsetFromTop:e,children:t})=>{let i=(0,ea.useRtlEnabled)();return(0,a.jsx)(J.Flex,{contentEditable:!1,suppressContentEditableWarning:!0,color:"gray.800",className:rT,direction:"column",bg:"white",borderRadius:"xl",shadow:"xl",overflowY:"auto",transitionProperty:"common",transitionDuration:"normal",zIndex:eh.DOC_Z_INDEXES.commentsPopup,bottom:{top:"0px","2xl":"auto"},top:{top:"0px","2xl":"auto"},insetEnd:{base:"44px","2xl":0},width:{base:ep,"2xl":ep},maxW:{base:"90vw",md:"80vw","2xl":ep},transform:{base:`translate(0, ${e}px)`,"2xl":`translate(calc(${i?"-100% - 10px":"100% + 10px"}), 0)`},wordBreak:"break-word",height:"fit-content",maxHeight:`calc(${rM} - 8em)`,position:"absolute",children:t})};e.s(["BLOCK_COMMENTS_CONTAINER_SELECTOR",0,rT,"BaseCommentPopup",0,rL],809069);let rj=({onCancel:e,editor:t,commentIdToHighlight:i,userCanComment:n,blockAllowsCommenting:r,getPos:o,draftComment:s,onCommentDraftUpdate:l,onCommentSave:d,isMobile:c})=>{let{user:u}=(0,M.useUserContext)(),p=(0,w.useAppSelector)(C.selectDoc),h=e7((0,w.useAppSelector)(C.selectFile),u),m=ev({editor:t,getPos:o}),g=h&&!u&&r;if(null===m)return null;let f=(0,a.jsxs)(J.Flex,{overflowY:"auto",direction:"column",className:"comments-list",p:c||g?0:4,children:[g&&p&&(0,a.jsx)(tn,{accessLink:h,doc:p,className:"comments-sign-up",showDivider:!1}),n&&(0,a.jsx)(rI,{draftComment:s,user:u,showUser:c,showBorder:c,onCommentDraftUpdate:l,onCommentSave:d,commentIdToHighlight:i,alwaysShowButtons:c})]});return c?f:(0,a.jsx)(rL,{offsetFromTop:m,children:f})};e.s(["AddReactionPopup",0,({isMobile:e,editor:t,onReactionClick:i,getPos:n})=>{let r=ev({editor:t,getPos:n});if(null===r)return null;let o=(0,a.jsx)(J.Flex,{bg:"white",p:"0",zIndex:"tooltip","data-testid":"add-reaction-popup","data-target-name":"reaction-emoji-picker",boxShadow:"none",sx:{".emoji-mart":{border:"none"}},overflow:"hidden",justify:"center",children:(0,a.jsx)(rd.EmojiPicker,{perLine:9,handlePick:i,shouldFocusSearch:!e})});return e?o:(0,a.jsx)(rL,{offsetFromTop:r,children:o})}],824718)},96953,e=>{"use strict";var t=e.i(112010);e.s(["DrawerCloseButton",()=>t.ModalCloseButton])},194552,339891,e=>{"use strict";e.s(["AnnotatableNodeViewWrapper",()=>ti],194552);var t=e.i(391398),i=e.i(428683),n=e.i(470645);e.i(828525);var a=e.i(180962);e.i(197071);var r=e.i(896416),o=e.i(462480),s=e.i(191788),l=e.i(981721),d=e.i(606004);e.i(144786);var c=e.i(849187),u=e.i(783197),p=e.i(418755),h=e.i(335884),m=e.i(959022),g=e.i(136484),f=e.i(551880),b=e.i(548402),x=e.i(256266);e.i(905506);var y=e.i(512164),v=e.i(616820),C=e.i(287396),w=e.i(620020),S=e.i(876533);e.i(420945);var k=e.i(33823),A=e.i(949488),E=e.i(49202),_=e.i(647031);e.i(615835);var I=e.i(25747),M=e.i(590955),T=e.i(619256),L=e.i(702424),j=e.i(127020),P=e.i(287163),D=e.i(830075),N=e.i(314240),R=e.i(623275),O=e.i(824718),B=e.i(52307),z=e.i(281107),F=e.i(285256),H=e.i(96953),W=e.i(387451),U=e.i(809069);let V=(0,s.forwardRef)(function(e,n){let{isMobile:a,children:r,closePopup:o,drawerMinHeight:s}=e;if(a){let e=s||"calc(calc(100vh - calc(100vh - 100%)) - 1rem)";return(0,t.jsxs)(B.Drawer,{placement:"bottom",isOpen:!0,onClose:o,children:[(0,t.jsx)(F.DrawerOverlay,{}),(0,t.jsxs)(z.DrawerContent,{minH:e,maxH:e,borderTopRadius:"xl",className:"comments-wrapper","data-block-comments-popup":!0,children:[(0,t.jsx)(W.DrawerBody,{p:6,pb:2,className:U.BLOCK_COMMENTS_CONTAINER_SELECTOR,children:r}),(0,t.jsx)(H.DrawerCloseButton,{})]})]})}return(0,t.jsx)(i.Box,{ref:n,children:r})});var G=e.i(613616),$=e.i(676828),Z=e.i(918228),K=e.i(358280),q=e.i(998493);let Y=({onCancel:e,reactions:i,onClickExistingReaction:n,editor:a,getPos:r,user:o,userCanComment:l,blockAllowsCommenting:d,isMobile:c})=>{let u=(0,P.useDomNodeOffsetFromTop)({editor:a,getPos:r}),p=i.slice(c?0:P.REACTION_COUNT_TO_SHOW),h=p.map(e=>(0,t.jsx)(q.ReactionButton,{isMobile:!0,onClick:t=>{n(e),t.stopPropagation()},mr:2,mb:4,reaction:e,user:o,canReact:l&&d,badgeCount:e.count,emoji:e.emoji},e.emoji));if((0,s.useEffect)(()=>{0===p.length&&e()},[e,p]),null===u)return null;let m=(0,t.jsxs)(Z.Stack,{spacing:4,children:[(0,t.jsx)($.Heading,{size:"md",children:(0,t.jsx)(K.Trans,{message:"Reactions:",id:"7ZMg79"})}),(0,t.jsx)(G.Flex,{flexWrap:"wrap",children:h})]});return c?m:(0,t.jsx)(U.BaseCommentPopup,{offsetFromTop:u,children:(0,t.jsx)(G.Flex,{p:4,px:2,pb:0,flexWrap:"wrap",children:h})})};e.i(438109);var X=e.i(72634),Q=e.i(82050),J=e.i(743373),ee=e.i(970346),et=e.i(555145),ei=e.i(382167),en=e.i(887527),ea=e.i(892194),er=e.i(524473),eo=e.i(541075),es=e.i(408122);e.i(185340);var el=e.i(863750);e.i(254884);var ed=e.i(753801);e.i(922128);var ec=e.i(643092),eu=e.i(17031),ep=e.i(85547),eh=e.i(103630),em=e.i(977581),eg=e.i(135537),ef=e.i(453216),eb=e.i(576897),ex=e.i(615393),ey=e.i(763498),ev=e.i(344233),eC=e.i(550530),ew=e.i(896620),eS=e.i(732231),ek=e.i(261442),eA=e.i(935020),eE=e.i(406112),e_=e.i(243521),eI=e.i(865080),eM=e.i(54302);e.i(791060);var eT=e.i(777590);let eL=(e,t)=>e===t||null!=e.parentElement&&eL(e.parentElement,t),ej=({setPopperElement:e,onPopoverClose:n,handleReactionClick:a,popperElement:r,openerElement:o,usePortal:s,isMobile:l,placement:d,...c})=>{(0,eI.useOutsideClick)({ref:{current:r},handler(e){o&&eL(e.target,o)||n()}});let u=(0,t.jsx)(i.Box,{mx:3*!l,mt:l?0:"-110px",shadow:"lg",bg:"white",p:"0",w:"auto",minW:"0px",zIndex:"tooltip","data-target-name":"reaction-emoji-picker",ref:e,...c,children:(0,t.jsx)(eT.EmojiPicker,{perLine:l?9:12,handlePick:e=>{a(e.id),n()},shouldFocusSearch:!(0,x.isMobileDevice)()})});return s?(0,t.jsx)(eA.Portal,{children:u}):u},eP=({size:e,colorScheme:n,handleReactionClick:a,placement:r,usePortal:o=!0})=>{let[l]=(0,e_.useMediaQuery)(["(max-width: 840px)","(min-width: 841px)"]),d=l?"auto":`${r}-start`,{isOpen:c,onToggle:u,onClose:p}=(0,eE.useDisclosure)(),[h,m]=(0,s.useState)(!1),[g,f]=(0,s.useState)(null),[b,x]=(0,s.useState)(null),{styles:y,attributes:v,forceUpdate:C}=(0,eM.usePopper)(g,b,{placement:d,strategy:"fixed"});return(0,s.useEffect)(()=>{C&&setTimeout(()=>{C()},0)},[C]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ew.GammaTooltip,{placement:eO,label:(0,t.jsx)(K.Trans,{message:"Add reaction",id:"9OEgyT"}),isOpen:h,children:(0,t.jsx)(i.Box,{display:"flex",onMouseEnter:()=>{m(!0)},onMouseLeave:()=>m(!1),children:(0,t.jsx)(ev.IconButton,{colorScheme:n,float:"inline-start","aria-label":es.i18n._({id:"9OEgyT",message:"Add reaction"}),variant:"ghost",onClick:e=>{u(),e.stopPropagation()},size:e||"sm",ref:f,isRound:!0,icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faSmilePlus})})})}),c&&(0,t.jsx)(ej,{usePortal:o,setPopperElement:x,onPopoverClose:p,handleReactionClick:a,popperElement:b,isPopoverOpen:c,openerElement:g,style:y.popper,isMobile:l,placement:r,...v.popper})]})};var eD=e.i(969641),eN=e.i(182463);let eR=({colorScheme:e,size:n,emoji:a,label:r,count:o,hasSelfReacted:l,handleReactionClick:d,readOnly:c})=>{let{colorMode:u}=(0,ea.useColorMode)(),p="light"===u,h=(0,s.useCallback)(e=>{c||d(a,e)},[a,d,c]);return(0,t.jsx)(ew.GammaTooltip,{placement:eO,label:(0,t.jsxs)(i.Box,{alignContent:"center",children:[r,!c&&(0,t.jsx)(en.Text,{display:"block",color:p?"gray.500":"gray.600",children:l?(0,t.jsx)(K.Trans,{message:"Click to remove",id:"fb/FjL"}):(0,t.jsx)(K.Trans,{message:"Click to react",id:"AG3H1y"})})]}),children:(0,t.jsxs)(eD.Button,{cursor:c?"default":"cursor","data-testid":`reaction-button-${a}`,size:n||"sm",color:p?"gray.500":"gray.300",bg:l?p?"gray.50":"gray.600":"none",borderWidth:"1px",borderStyle:"solid",colorScheme:e,borderColor:l?p?"gray.200":"gray.500":"transparent",_hover:{bg:p?"gray.200":"gray.600"},variant:"ghost",borderRadius:"full",px:2,onClick:h,children:[(0,t.jsx)(eN.EmojiIcon,{emojiId:a,fontSize:"sm"===n?"lg":"sm"}),(0,t.jsx)(en.Text,{as:"span",fontSize:n,ms:1.5,children:o})]})})},eO="bottom",eB=({size:e,colorScheme:i,placement:n="right",usePortal:a,reactions:r,docId:o,cardId:s,commentId:l,parentCommentId:d,targetType:c,readOnly:u,innerPaddingY:p,...h})=>{let{addReactionFn:m,removeReactionFn:g}=(({docId:e,cardId:t,commentId:i,parentCommentId:n,targetType:a})=>{let[r]=(0,el.useAddReactionMutation)(),[o]=(0,el.useRemoveReactionMutation)();function s(r,o,s,l){let d={targetId:a===el.TargetType.Comment?i:t,docId:e,emoji:o,cardId:t};return("addReaction"===r&&(d={...d,targetType:a}),a===el.TargetType.Comment)?{variables:{reactionInput:d},update:(t,{data:a})=>{t.writeFragment({id:`Doc:${e}`,fragment:el.DocCommentsUpdateFragmentDoc,fragmentName:"DocCommentsUpdate",data:{comments:[n?{id:n,replies:[{id:i,reactions:[a[r]],__typename:"Comment"}],reactions:[],__typename:"Comment"}:{id:i,replies:[],reactions:[a[r]],__typename:"Comment"}]}})},optimisticResponse:{[r]:{commentId:i,count:s,emoji:o,users:l,cardId:t,__typename:"Reaction"}}}:void console.error(`[useReactionUpdate] Invalid targetType: ${a}`)}return{addReactionFn:(e,t,i)=>{r(s("addReaction",e,t,i))},removeReactionFn:(e,t,i)=>{o(s("removeReaction",e,t,i))}}})({docId:o,commentId:l,parentCommentId:d,cardId:s,targetType:c}),{user:f}=(0,I.useUserContext)(),b=r?.reduce((e,t)=>(t.count&&(e[t.emoji]=t),e),{})||{},x=!u&&c===el.TargetType.Card&&!b.heart,y=Object.keys(b).length>0,v=(e,t)=>{if(!(c===el.TargetType.Comment&&l||c===el.TargetType.Card&&s))throw Error(`[Reactions.handleReactionClick] Invalid targetType. Args: targetType: ${c}, commentId: ${l}, cardId: ${s}`);if(b[e]?.users.find(e=>e.id===f?.id)?.id){let t=b?.[e]?.count-1,i=b?.[e]?.users?b[e].users.filter(e=>e.id!==f?.id):[];g(e,t,i)}else{let t=b?.[e]?.count?b[e].count+1:1,i=b?.[e]?.users?b[e].users.concat(f):[f];m(e,t,i)}t?.stopPropagation()};return(0,t.jsxs)(G.Flex,{direction:"row",cursor:"default",contentEditable:!1,onMouseDown:ek.preventDefaultToAvoidBlur,mb:p?`-${p/1.5}rem`:void 0,...h,children:[x&&(0,t.jsx)(ew.GammaTooltip,{label:(0,t.jsx)(K.Trans,{message:"Like",id:"W9FRBT"}),placement:eO,children:(0,t.jsx)(ev.IconButton,{colorScheme:i,float:"inline-start","aria-label":"",variant:"ghost",onClick:e=>{v("heart",e)},size:e,isRound:!0,mr:2,icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faHeart})})}),!u&&(0,t.jsx)(eP,{size:e,colorScheme:i,handleReactionClick:v,usePortal:a,placement:n}),y&&(0,t.jsx)(eC.Wrap,{spacing:"sm"===e?2:1,mr:2,className:"reactions-row",children:y&&Object.entries(b).map(([n,a])=>{let r=a?.users,o=!!r?.find(e=>e?.id===f?.id),s=(0,eS.generateNamePhrase)({users:r,selfUserId:f?.id});return(0,t.jsx)(eR,{colorScheme:i,size:e,emoji:n,readOnly:u,label:(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(K.Trans,{message:"{usersLabel} <0>reacted with :{emoji}:",id:"mRnNF/",values:{usersLabel:s,emoji:n},components:{0:(0,t.jsx)(en.Text,{as:"span",color:"gray.300"})}})}),count:r?.length,hasSelfReacted:o,handleReactionClick:v},n)})})]})},ez=s.default.memo(({docId:e,reactions:i,cardId:n,commentId:a,size:r,parentCommentId:o,placement:s="right",usePortal:l=!0,userCanComment:d,...c})=>(0,t.jsx)(eB,{size:r,cardId:n,usePortal:l,placement:s,reactions:i,parentCommentId:o,docId:e,commentId:a,targetType:el.TargetType.Comment,readOnly:!d,...c}));var eF=e.i(721455),eH=e.i(148318),eW=e.i(826480),eU=e.i(285042),eV=e.i(704273),eG=e.i(864860),e$=e.i(847092),eZ=e.i(788411),eK=e.i(644315);let eq=()=>({[el.CommentStatus.Open]:{label:es.i18n._({id:"9ggh96",message:"Mark as closed"}),icon:er.faCheckCircle,successMessage:es.i18n._({id:"1INZuT",message:"Comment marked as closed"})},[el.CommentStatus.Closed]:{label:es.i18n._({id:"pL38RI",message:"Mark as open"}),icon:er.faDotCircle,successMessage:es.i18n._({id:"gieGvY",message:"Comment reopened"})}}),eY=({status:e,handleCommentStatusUpdate:i})=>(0,t.jsx)(ew.GammaTooltip,{label:eq()[e].label,"aria-label":eq()[e].label,children:(0,t.jsx)(ev.IconButton,{variant:"ghost",size:"sm",borderRadius:"full",isDisabled:!1,"aria-label":eq()[e].label,icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:eq()[e].icon}),onClick:()=>i(e)})}),eX=({comment:e,selfUser:n,isInPanel:a,isSourceContentAvailable:r,showCopyCommentLink:o,showLinkToTargetContent:s,hasCommentBeenUpdated:l,onTargetClick:d,commentUrl:c,isReply:u,userCanComment:p,handleCommentStatusUpdate:h,toastPosition:m,isEditing:g,handleEditCommentClick:f,handleDeleteCommentClick:b})=>{let{user:x,createdTime:y,updatedTime:v,status:C=el.CommentStatus.Open}=e,{email:S,displayName:k,profileImageUrl:A}=x,E=n?.id===x?.id,{onCopy:_}=(0,e$.useClipboard)(c),I=(0,ea.useColorModeValue)("red.500","red.300"),M=(0,w.useToast)();return(0,t.jsxs)(et.HStack,{spacing:2,align:"top",mb:3,_before:a?{content:"''",position:"absolute",w:"9px",h:"9px",mt:"15px",insetStart:u?"12px":"36px",bg:"gray.50",borderRadius:"full"}:{},children:[(0,t.jsx)(ew.GammaTooltip,{label:S,"aria-label":S,children:(0,t.jsx)(J.Avatar,{mt:1,size:"sm",name:k,src:A,ignoreFallback:!0})}),(0,t.jsxs)(Z.Stack,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:[(0,t.jsxs)(en.Text,{fontWeight:"600",mb:0,fontSize:"sm",children:[k," ",E?(0,t.jsx)(K.Trans,{message:"(You)",id:"dDUgzP"}):null]}),(0,t.jsx)(G.Flex,{direction:"row",w:"100%",alignItems:"flex-start",children:(0,t.jsx)(i.Box,{flex:"1",children:(0,t.jsx)(ew.GammaTooltip,{isDisabled:!l,label:`Updated ${(0,eK.normalizeDate)(v)}`,placement:"top",children:(0,t.jsxs)(et.HStack,{children:[(0,t.jsx)(en.Text,{my:"0 !important",className:"comment-date",fontSize:"xs",color:"gray.500",children:(0,eZ.default)((0,eK.normalizeDate)(y))}),l&&(0,t.jsx)(i.Box,{color:"gray.500",children:(0,t.jsx)(eo.FontAwesomeIcon,{size:"xs",icon:er.faSquarePen})})]})})})})]}),(0,t.jsx)(eG.Spacer,{}),(0,t.jsxs)(et.HStack,{spacing:1,children:[s&&(0,t.jsx)(ew.GammaTooltip,{label:r?(0,t.jsx)(K.Trans,{message:"Go to",id:"LmLruJ"}):(0,t.jsx)(K.Trans,{message:"Source content no longer exists",id:"/oHV5h"}),shouldWrapChildren:!0,children:(0,t.jsx)(ev.IconButton,{size:"sm",borderRadius:"full",variant:"ghost",isDisabled:!r,"aria-label":r?es.i18n._({id:"LmLruJ",message:"Go to"}):es.i18n._({id:"/oHV5h",message:"Source content no longer exists"}),onClick:d,icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faArrowCircleRight})})}),!u&&p&&(0,t.jsx)(eY,{status:C,handleCommentStatusUpdate:()=>h(e.status)}),(0,t.jsxs)(eF.Menu,{isLazy:!0,children:[(0,t.jsx)(eH.MenuButton,{as:ev.IconButton,size:"sm",variant:"ghost",borderRadius:"full","data-testid":"comment-header-menu",icon:(0,t.jsx)(eo.FontAwesomeIcon,{fixedWidth:!0,icon:er.faEllipsisH}),children:(0,t.jsx)(K.Trans,{message:"Actions",id:"7L01XJ"})}),(0,t.jsx)(eA.Portal,{children:(0,t.jsxs)(eV.MenuList,{zIndex:"modal","data-testid":"comment-header-menulist",children:[o&&(0,t.jsx)(eU.MenuItem,{icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faLink}),onClick:()=>{_(),M({title:es.i18n._({id:"h5GS+N",message:"URL copied."}),status:"success",duration:3e3,position:m})},children:(0,t.jsx)(K.Trans,{message:"Copy comment link",id:"qhJCCi"})}),p&&!g&&E&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eW.MenuDivider,{}),(0,t.jsx)(eU.MenuItem,{icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faEdit}),onClick:f,children:(0,t.jsx)(K.Trans,{message:"Edit",id:"ePK91l"})}),(0,t.jsx)(eU.MenuItem,{icon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faTrash}),color:I,onClick:()=>{b()},"data-testid":"delete-thread",children:u?(0,t.jsx)(K.Trans,{message:"Delete reply",id:"FjzXBu"}):(0,t.jsx)(K.Trans,{message:"Delete thread",id:"xOviNB"})})]})]})})]})]})]})};var eQ=e.i(681116);let eJ=(0,s.memo)(({comment:e,editor:n,selfUser:a,docId:r,commentIdToHighlight:o,userCanComment:l,instanceType:d,editorMode:c,isRootComment:u=!1,onClose:p,closePopup:h,...m})=>{let g="feed"===d,b="drawer"===d,y=(0,x.isMobileDevice)()?"bottom":"top",{content:v,targetHtml:C,targetId:S,createdTime:A,updatedTime:I,id:T,replies:L,reactions:j}=e,P=(0,k.useDispatch)(),{initialDraftReply:D,updateLocalDraftReply:N,hasLocalDraftReply:R}=(0,M.useDraftReply)(T),O=(0,s.useRef)(new ef.Deferred),B=o===T,z=(0,eb.generateCommentUrl)({docId:r,id:T}),F=(0,s.useRef)(null),[H,W]=(0,s.useState)(!1),[U,V]=(0,s.useState)(u);(0,s.useEffect)(()=>{R&&!U&&V(!0)},[R,U]);let[$]=(0,el.useCreateCommentMutation)(),[q]=(0,el.useUpdateCommentMutation)(),[Y]=(0,el.useUpdateCommentStatusMutation)(),[X]=(0,el.useRemoveCommentMutation)(),Q=(0,w.useToast)(),ev=(0,ed.useScrollManager)("editor"),eC=(0,s.useCallback)(()=>{W(!0)},[]),ew=(0,s.useCallback)(()=>{N(null)},[N]),eS=[.25,.1,.25,1];(0,s.useLayoutEffect)(()=>{B&&F.current&&ev.scrollElementIntoView({element:F.current})},[ev,B]);let ek=e=>{let i=e===el.CommentStatus.Open?el.CommentStatus.Closed:el.CommentStatus.Open,n={id:T,docId:r,status:i};Y({variables:{input:n},update:(e,{data:t})=>{let i={id:`Doc:${r}`,fragment:eg.DOC_COMMENTS_FRAGMENTS,fragmentName:"DocCommentsUpdate",data:{comments:[t?.updateCommentStatus]}};e.writeFragment(i)},optimisticResponse:{updateCommentStatus:{...n,__typename:"Comment",updatedTime:new Date().toISOString()}}}).then(()=>{Q({title:(0,t.jsxs)(en.Text,{children:[eq()[e].successMessage,"."," ",(0,t.jsx)(ei.Link,{textDecoration:"underline",onClick:()=>ek(i),children:es.i18n._({id:"9uI/rE",message:"Undo"})})]}),status:"success",duration:5e3,isClosable:!1,position:y})}).catch(e=>{console.error("[CommentComponent]: Error changing comment status",e),Q({title:es.i18n._({id:"+Q5eww",message:"There was an error changing the comment status: {0}",values:{0:e.message}}),status:"error",isClosable:!0,position:y})}).finally(()=>{"popup"===d&&h&&h(!0)})},eA=(0,ea.useColorModeValue)("yellow.100","yellow.800"),eE=ey.AnnotationPluginKey.getState(n.state),e_=(0,s.useMemo)(()=>eE?.annotations.find(e=>e.id===S),[eE?.annotations,S]),{pos:eI}=e_||{},eM=!!e_?.pos,eT="notification"!==d&&e.id!==eu.NEW_COMMENT_TEMP_ID,eL=("notification"===d||"feed"===d)&&eI!==eu.MEMO_LEVEL_COMMENT_ABS_POS,ej=(0,s.useCallback)(e=>{if(!(!S||!e_||!eI||e?.target?.closest('[data-target-name="comment-target-expand-button"]'))){if("notification"===d)E.TiptapEventBus.emit(E.EventBusEvent.OPEN_POPUP_COMMENT,{commentId:T,highlightComment:!0});else if("feed"===d){let e=ep.EXPAND_CARD_TRANSITION_TIME,t=(0,em.getDomNodeFromPos)(n,eI);if(c===ex.EditorModeEnum.DOC_VIEW)(0,_.openParentCards)({pos:eI,editor:n});else if(c===ex.EditorModeEnum.SLIDE_VIEW){let[t]=(0,em.findParentNodes)(n.state.doc.resolve(eI),eh.isCardNode);n.commands.spotlightCardById(t.node.attrs.id),P((0,f.setFollowingAttached)({attached:!1})),e=ep.BETWEEN_CARD_TRANSITION_TIME}(0,x.isMobileDevice)()&&p&&setTimeout(p,300),ev.scrollElementIntoView({element:t,delay:e})}}},[n,ev,S,d,T,e_,eI,c,P,p]),eP=(0,s.useMemo)(()=>new Date(I).getTime()-new Date(A).getTime()>100,[I,A]),eD=!!e.commentId,eN=!!L&&L.length>0;return(0,t.jsxs)(G.Flex,{flexDir:"column",ref:F,id:`comment-${T}`,className:"comment highlight-mask","data-target-id":`comment-${T}`,borderRadius:B?"md":"0px",position:"relative",borderBottomWidth:u?"1px":"0px",borderBottomColor:"gray.200",_after:g&&eN?{content:"''",position:"absolute",w:"9px",h:"9px",insetStart:"36px",bottom:9,bg:"gray.50",borderRadius:"full",transitionProperty:"common",transitionDuration:"normal"}:{},_before:eN&&g?{content:"''",position:"absolute",w:"3px",top:7,bottom:9,insetStart:"39px",bg:"gray.50",borderRadius:"full"}:{},...m,overflowY:"hidden",children:[(0,t.jsxs)(Z.Stack,{backgroundColor:B?eA:"auto",transitionProperty:"border, background",transitionDuration:"normal",transitionTimingFunction:"ease",role:"group",spacing:8,children:[(0,t.jsxs)(i.Box,{ps:eD&&g?10:0,children:[(0,t.jsx)(eX,{isInPanel:g,comment:e,selfUser:a,isSourceContentAvailable:eM,showCopyCommentLink:eT,showLinkToTargetContent:eL,hasCommentBeenUpdated:eP,onTargetClick:ej,commentUrl:z,isReply:eD,userCanComment:l,handleCommentStatusUpdate:ek,toastPosition:y,isEditing:H,handleEditCommentClick:eC,handleDeleteCommentClick:()=>{let t=!!e.commentId;X({variables:{id:T},update:(i,{data:n})=>{i.writeFragment({id:`Doc:${r}`,fragment:eg.DOC_COMMENTS_FRAGMENTS,fragmentName:t?"DocRepliesRemove":"DocCommentsRemove",data:{comments:[t?{id:e.commentId,replies:[n?.archiveComment],__typename:"Comment"}:n?.archiveComment]}})},optimisticResponse:{archiveComment:{id:T,__typename:"Comment",archived:!0}}}),!t&&e.targetId&&n.commands.deleteAnnotation(e.targetId),"popup"===d&&h&&h(!0),Q({title:es.i18n._({id:"Ho/Jvc",message:"Comment deleted."}),status:"success",duration:5e3,isClosable:!1,position:y})}}),(0,t.jsxs)(i.Box,{ps:eN&&g?10:0,overflowY:"hidden",children:[C&&C.length&&(0,t.jsx)(eQ.CommentTargetContent,{targetHtml:C,onTargetClick:ej,isSourceContentAvailable:eM,instanceType:d}),(0,t.jsx)(ec.CommentEditor,{initialContent:v,editable:H,onCancelEditingClick:()=>W(!1),saveButtonText:(0,t.jsx)(K.Trans,{message:"Save comment",id:"yY7Bil"}),saveButtonIcon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faCheck}),onCommentSave:t=>{let i=!!e.commentId,n={id:T,docId:r,content:t};q({variables:{input:n},update:(t,{data:n})=>{let a={id:`Doc:${r}`,fragment:eg.DOC_COMMENTS_FRAGMENTS,fragmentName:i?"DocRepliesUpdate":"DocCommentsUpdate",data:{comments:[i?{id:e.commentId,replies:[n?.updateComment],__typename:"Comment"}:n?.updateComment]}};t.writeFragment(a)},optimisticResponse:{updateComment:{...n,__typename:"Comment",updatedTime:new Date().toISOString()}}}),Q({title:es.i18n._({id:"kibWwZ",message:"Comment updated."}),status:"success",duration:5e3,isClosable:!1,position:y}),W(!1)}}),!H&&(0,t.jsx)(ez,{mt:2,docId:r,cardId:e.cardId,commentId:e.id,parentCommentId:e.commentId,reactions:j,size:"sm",placement:"right",usePortal:!0,userCanComment:l})]})]}),L&&L.length>0&&L.map(e=>(0,t.jsx)(eJ,{instanceType:d,userCanComment:l,commentIdToHighlight:o,comment:e,docId:r,selfUser:a,editor:n,editorMode:c,ps:0,p:0,pb:0},e?.id))]}),l&&(0,t.jsxs)(ee.Collapse,{in:U&&!H,unmountOnExit:!0,transition:{enter:{when:"afterChildren",height:{duration:.3,ease:eS},opacity:{duration:.4,ease:eS}},exit:{when:"beforeChildren",height:{duration:.2,ease:eS},opacity:{duration:.3,ease:eS}}},children:[b&&(0,t.jsxs)(et.HStack,{align:"center",mb:3,pt:6,children:[(0,t.jsx)(J.Avatar,{mt:1,size:"sm",name:a?.displayName,src:a?.profileImageUrl,ignoreFallback:!0}),(0,t.jsx)(Z.Stack,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:(0,t.jsx)(en.Text,{fontWeight:"600",mb:0,fontSize:"sm",children:(0,t.jsx)(K.Trans,{message:"{0} (You)",id:"866PMb",values:{0:a?.displayName}})})})]}),(0,t.jsx)(ec.CommentEditor,{ps:g&&eN?8:0,pt:6*!b,initialContent:D?.json||"",clearContentOnSave:!0,editable:!0,saveButtonText:(0,t.jsx)(K.Trans,{message:"Reply",id:"ImOQa9"}),saveButtonIcon:(0,t.jsx)(eo.FontAwesomeIcon,{icon:er.faReply}),placeholder:es.i18n._({id:"ImOQa9",message:"Reply"}),onCommentSave:t=>{let i={targetId:e.targetId,commentId:T,docId:r,content:t,cardId:e.cardId};$({variables:{input:i},update:(e,{data:t})=>{e.writeFragment({id:`Doc:${r}`,fragment:eg.DOC_COMMENTS_FRAGMENTS,fragmentName:"DocRepliesCreate",data:{comments:[{id:T,replies:[t?.createComment],__typename:"Comment"}]}})},optimisticResponse:{createComment:{id:eu.NEW_COMMENT_TEMP_ID,__typename:"Comment",...i,user:a,archived:!1,reactions:[],createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),V(!1),N(null),P((0,f.deleteDraftReply)({id:T})),Q({title:es.i18n._({id:"yPok8v",message:"Reply posted."}),status:"success",duration:5e3,isClosable:!1,position:y})},onCancelEditingClick:ew,onUpdate:({editor:e})=>{N({commentId:T,json:e.view.state.doc.toJSON(),text:e.view.state.doc.textContent})},onCreate:e=>{O.current.resolve(e)},alwaysShowButtons:b,shouldFocus:"popup"===d&&!(0,x.isMobileDevice)()})]})]})});var e0=e.i(985718);let e1=({comment:e,editor:i,commentIdToHighlight:n,userCanComment:a,blockAllowsCommenting:r,getPos:o,isMobile:s,closePopup:l})=>{let d=i.gammaDocId,{user:c}=(0,I.useUserContext)(),u=(0,A.useSelector)(f.selectMode),h=(0,p.useAppSelector)(Q.selectDoc),m=(0,p.useAppSelector)(Q.selectFile),g=(0,X.checkAccessLinkForLoggedOutUser)(m,c),b=(0,P.useDomNodeOffsetFromTop)({editor:i,getPos:o});if(null===b||!e)return null;let x=(0,t.jsxs)(G.Flex,{direction:"column",className:"comments-list","data-testid":"thread-view-popup",children:[g&&!c&&h&&r&&(0,t.jsx)(e0.CommentSignUp,{accessLink:g,doc:h,className:"comments-sign-up"}),(0,t.jsx)(eJ,{instanceType:s?"drawer":"popup",userCanComment:a,commentIdToHighlight:n,editor:i,comment:e,selfUser:c,docId:d,editorMode:u,isRootComment:!0,borderBottomWidth:"none",closePopup:l,p:4*!s,pb:4},e.id)]});return s?x:(0,t.jsx)(U.BaseCommentPopup,{offsetFromTop:b,children:x})},e2={generate:(0,o.customAlphabet)("0123456789abcdefghijklmnopqrstuvwxyz",15)};var e3=e.i(533663);let e5={"add-comment":"350px","add-reaction":"350px","reactions-overflow":"350px"},e4=({nodeName:e,isVisible:i,editor:a,getPos:r,comments:o,side:l,reactions:d,createDraftComment:c,cleanupDraftComment:u,onCommentDraftUpdate:h,draftComment:m,onCommentSave:g,userCanComment:b,blockAllowsCommenting:v,blockCommentId:C,enableReactions:B,mobileAddCommentPos:z,setHighlightTarget:F,firstRowCommentTargetIds:H})=>{let W="table"===e,U=(0,s.useMemo)(()=>W&&H?[...o].sort((e,t)=>{let i=!!e.targetId&&H.has(e.targetId);return i===(!!t.targetId&&H.has(t.targetId))?0:i?1:-1}):o,[W,o,H]),G=(0,w.useToast)(),$=(0,x.isMobileDevice)(),Z=(0,k.useDispatch)(),{user:K,isUserLoading:q}=(0,I.useUserContext)(),{isHovering:X,delayedClose:Q,...J}=(0,y.useIsHovering)({enterDelay:30,leaveDelay:100}),ee=!!X,et=(0,s.useRef)(null),ei=(0,s.useRef)(void 0),en=(0,A.useSelector)((0,f.selectIsOtherBlockCommentOpen)(C)),ea=(0,s.useRef)(null),[er,eo]=(0,s.useState)(null),es=null!==er,ed=(0,p.useAppSelector)(f.selectViewingCommentId),ec=o.find(e=>e.id===ed)||null,eu=(0,s.useCallback)(e=>{eo("thread"),Z((0,f.setCommentReactionOpen)({isOpen:!0,blockCommentId:C,viewingCommentId:e.id}))},[C,Z]),ep=(0,s.useCallback)(e=>{eo("add-comment"),Z((0,f.setCommentReactionOpen)({isOpen:!0,blockCommentId:C,viewingCommentId:null})),c(e)},[C,Z,c]),eh=(0,s.useCallback)(()=>{eo("add-reaction"),Z((0,f.setCommentReactionOpen)({isOpen:!0,blockCommentId:C,viewingCommentId:null}))},[C,Z]),em=(0,s.useCallback)((e=!1)=>{eo(null),u(),Z((0,f.setCommentReactionOpen)({isOpen:!1,blockCommentId:C,viewingCommentId:null})),e&&Q(1e3)},[C,u,Q,Z]),{addReactionFn:eg,removeReactionFn:ef}=(({getPos:e,editor:t,reactions:i})=>{let{user:n}=(0,I.useUserContext)(),[a]=(0,el.useAddReactionMutation)(),[r]=(0,el.useRemoveReactionMutation)(),o=(0,s.useCallback)(({reaction:e})=>{if(!n)return;let i=e.docId;1===e.count&&t.commands.deleteAnnotation(e.targetId);let a=e.count-1,o=e.users.filter(e=>e?.id!==n?.id);r({variables:{reactionInput:{docId:i,targetId:e.targetId,emoji:e.emoji}},update:(e,{data:t})=>{e.writeFragment({id:`Doc:${i}`,fragment:el.DocReactionsCreateFragmentDoc,fragmentName:"DocReactionsCreate",data:{reactions:[t?.removeReaction]}})},optimisticResponse:{removeReaction:{docId:i,targetId:e.targetId,targetType:el.TargetType.Decoration,count:a,emoji:e.emoji,users:o,__typename:"Reaction"}}})},[t,r,n]);return{addReactionFn:(0,s.useCallback)(({emoji:r})=>{let o=e();if("number"!=typeof o||(0,e3.hasUserReacted)({emoji:r,user:n,reactions:i})||!n)return;let s=t.gammaDocId,l=(0,e3.getExistingReaction)({reactions:i,emoji:r}),d=e2.generate(),c=(l?.count||0)+1,u=[];l?(d=l.targetId,u=[...l.users]):t.commands.addAnnotation({id:d,pos:o}),u.unshift(n),u.sort((e,t)=>e.id>t.id?1:-1),a({variables:{reactionInput:{docId:s,targetId:d,targetType:el.TargetType.Decoration,emoji:r}},update:(e,{data:t})=>{e.writeFragment({id:`Doc:${s}`,fragment:el.DocReactionsCreateFragmentDoc,fragmentName:"DocReactionsCreate",data:{reactions:[t?.addReaction]}})},optimisticResponse:{addReaction:{docId:s,targetId:d,targetType:el.TargetType.Decoration,count:c,emoji:r,users:u,__typename:"Reaction"}}})},[a,t,e,i,n]),removeReactionFn:o}})({editor:a,getPos:r,reactions:d}),eb=(0,s.useCallback)(e=>{b&&(eg({emoji:e.id}),G({title:(0,t.jsx)(N.EmojiToast,{emoji:e.id,isMobile:$}),status:"success",duration:5e3,isClosable:!1,position:$?"bottom":"top"}),em(!0))},[eg,em,$,G,b]),ex=(0,s.useCallback)(e=>{g(e),em(!0)},[g,em]),ey=(0,s.useCallback)(e=>{if(!b)return;let t=e.reactions.find(e=>e.users?.find(e=>e.id===K?.id));t?ef({reaction:t}):eg({emoji:e.emoji})},[eg,ef,K,b]),ev=(0,s.useCallback)(()=>{eo("reactions-overflow"),Z((0,f.setCommentReactionOpen)({isOpen:!0,blockCommentId:C,viewingCommentId:null}))},[C,Z]);(0,P.useClickOutsideToHide)({isOpen:es,popupRef:ea,onClose:em});let{isExpanded:eC}=(0,P.useExpandedAndHideOthers)({popup:er,isMobile:$,isHovered:ee,comments:o,reactions:d,draftComment:m,enableReactions:B});(0,s.useEffect)(()=>{!$&&(H||F(ee?"table":null))},[ee,$,F,H]);let ew=(0,s.useCallback)(e=>{e?F(e.targetId&&H?.has(e.targetId)?"firstRow":"table"):F(null)},[H,F]);(0,M.useListenForCreateCommentFromSelection)(r,ep);let eS=(0,M.useListenForOpenComment)({comments:o,blockAllowsCommenting:v,showComment:(0,s.useCallback)(e=>{let t=r();"number"==typeof t&&((0,_.openParentCards)({pos:t,editor:a}),eu({id:e}))},[a,r,eu])});(0,s.useEffect)(()=>{E.TiptapEventBus.emit(E.EventBusEvent.POPUP_COMMENT_TOGGLED,{open:es})},[es]);let ek=(0,s.useCallback)(e=>{"Escape"===e.key&&em()},[em]);if(!i||q)return null;let eA=!!K&&!b,eE=0===o.length&&0===d.length;if((eA||!v)&&eE)return null;let e_=eA||!v;return(0,t.jsxs)(S.DarkModeProvider,{isDark:!1,children:[$&&z&&(0,t.jsx)(T.MobileAddCommentWidget,{onClickAddComment:ep,onClickAddReaction:eh,top:z.top,left:z.left}),(0,t.jsxs)(D.BlockCommentsWrapper,{nodeName:e,side:l,className:(0,n.cx)("block-comments-stack",eC&&"is-expanded",eC&&"is-taking-action",eE&&"is-empty",!$&&en&&"other-comment-open"),isMobile:$,isEmpty:eE,isPopupOpen:es,...J,buttonRef:et,onKeyDown:ek,hasCommentsOrReactions:!eE,children:[(0,t.jsx)(j.BlockCommentsButtons,{isExpanded:eC,isMobile:$,user:K,userCanComment:b,blockAllowsCommenting:v,draftComment:m,reactions:d,comments:U,onClickThread:eu,onClickAddComment:ep,onClickAddReaction:eh,onClickExistingReaction:ey,onClickReactionsOverflow:ev,hideAddCommentButton:e_,onClosePopup:em,viewingCommentId:ed,enableReactions:B,onCommentButtonHover:H?ew:void 0}),!es&&!$&&(0,t.jsx)(L.AvatarGroupPopup,{isExpanded:eC,comments:U,reactions:d}),es&&(0,t.jsxs)(V,{isMobile:$,ref:ea,closePopup:em,drawerMinHeight:e5[er],children:["thread"===er&&(0,t.jsx)(e1,{isMobile:$,comment:ec,closePopup:em,editor:a,getPos:r,commentIdToHighlight:eS,commentsPanelRef:ei,userCanComment:b,blockAllowsCommenting:v}),"add-comment"===er&&(0,t.jsx)(R.AddCommentPopup,{isMobile:$,onCancel:()=>{em()},editor:a,getPos:r,commentIdToHighlight:eS,userCanComment:b,blockAllowsCommenting:v,onCommentSave:ex,draftComment:m,onCommentDraftUpdate:h}),"add-reaction"===er&&(0,t.jsx)(O.AddReactionPopup,{isMobile:$,onReactionClick:eb,editor:a,getPos:r}),"reactions-overflow"===er&&(0,t.jsx)(Y,{isMobile:$,onCancel:()=>{em()},onClickExistingReaction:ey,editor:a,getPos:r,user:K,userCanComment:b,blockAllowsCommenting:v,reactions:d})]})]})]})};var e6=e.i(625878),e9=e.i(175863),e8=(e.i(816256),e.i(89081),e.i(755453),e.i(615505));e.i(555999),new e9.PluginKey("draftComments");let e7=(e,t,i)=>({targetId:e2.generate(),targetHtml:i,json:null,text:"",relativePos:(0,e6.absoluteToRelativePos)(t.state,e)}),te=new e9.PluginKey("tableDecorationPlugin"),tt=e=>{let t=e.find(e=>e.spec.isTableDecoration);return t?.spec.tablePos};e.s(["TableDecorationPlugin",0,()=>new e9.Plugin({key:te,props:{decorations:({doc:e})=>{let t,i=(t=[],e.descendants((e,i)=>{if("table"===e.type.name){t.push(e8.Decoration.node(i,i+e.nodeSize,{},{isTableDecoration:!0,tablePos:i}));let n=e.firstChild;if(n){let e=i+1;t.push(e8.Decoration.node(e,e+n.nodeSize,{},{isFirstTableRow:!0}))}}return!0}),t);return i.length>0?e8.DecorationSet.create(e,i):e8.DecorationSet.empty}}}),"getTableDecoPos",0,tt,"hasFirstTableRowDeco",0,e=>e.some(e=>e.spec.isFirstTableRow)],339891);let ti=({children:e,commentStackPosition:i="before",as:n,className:a,dir:o,style:s,hideComments:d=!1,readOnly:c=!1,...p})=>{let{decorations:g,editor:f}=p,b=(0,h.useShouldUsePublishedVersion)(),x=(0,r.useIsEditorStatic)(),y=g.some(e=>e.spec.isAnnotatable),v=(0,u.useIsThumbnailView)();return!y||v||b||f.editorId===l.CARD_EDITOR_ID?(0,t.jsx)(m.NodeViewWrapper,{as:n,className:a,dir:o,style:s,"data-pos":(()=>{if(x&&b)return p.getPos()})(),children:e}):(0,t.jsx)(tn,{as:n,className:a,dir:o,style:s,hideComments:d,readOnly:c,commentStackPosition:i,...p,children:e})},tn=({children:e,decorations:r,editor:l,getPos:h,as:w,className:S,dir:k,style:A,hideComments:E,readOnly:_,node:I,commentStackPosition:T="before"})=>{let{isInOfflineMode:L}=(0,d.useHealthCheck)(),j=(0,v.hasAnnotatableHoverDeco)(r),P=(0,C.useMobileAddCommentPos)({editor:l,decorations:r}),D=(0,c.useFeatureFlag)("blockReactions"),N=(0,g.useCanWithSelectFile)("comment"),R=(0,p.useAppSelector)(f.selectCommentsEnabled),O=(0,s.useMemo)(()=>(0,o.nanoid)(5),[]),B=(0,p.useAppSelector)((0,f.selectIsBlockCommentOpen)(O)),[z,F]=(0,s.useState)(null),H=(0,c.useFeatureFlag)("debugComments"),W=(0,M.useDraftCommentsFromDecorations)(r),U=W[0]||null,[V,G]=(0,s.useState)(null),$=(0,p.useAppDispatch)(),Z=(0,s.useCallback)(()=>l.commands,[l]),K=(0,s.useCallback)(e=>{let t=(e?.getPos||h)();if("number"!=typeof t)return;let i=e?.targetHtml,n=U;if(n)e&&(n={...n,targetHtml:i,relativePos:(0,e6.absoluteToRelativePos)(l.state,t)});else n=e7(t,l,i),Z().createDraftComment?.(n);G(n),$((0,f.setFollowingAttached)({attached:!1}))},[$,l,Z,h,U]),q=(0,s.useCallback)(()=>{V&&V?.text?.trim()?.length>0?Z().createDraftComment?.(V):Z().removeDraftComments?.(W),G(null)},[W,Z,V]),Y=(0,s.useRef)(B);Y.current=B,(0,s.useEffect)(()=>()=>{Y.current&&$((0,f.setCommentReactionOpen)({isOpen:!1,blockCommentId:O,viewingCommentId:null}))},[O,$]);let X=(0,M.useOnCommentSave)({draftComment:V,clearDraftComment(){let e=h();if("number"!=typeof e)return;V&&Z().removeDraftComments?.([V,...W]);let t=e7(e,l);Z().createDraftComment?.(t),G(t)},editor:l}),Q=(0,M.useAnnotationComments)(r),J=Q.length>0&&!E,ee=V||U,et=ee?.text?.length>0,[ei,en]=(0,y.useHover)(),ea=(0,M.useAnnotationReactions)(r);D||(ea=[]);let er=ea.length>0,eo=(0,u.useIsThumbnailView)(),es=R&&!E&&N&&!eo,el=(0,x.isMobileDevice)()&&(B||J||er||!!P)||!(0,x.isMobileDevice)()&&(en||j||B||J||er||et),ed=N&&!L,ec=B||P||null!==z?(0,b.colorWithOpacity)(a.themeWithRebrand.colors.yellow[200],.25):void 0,eu=!!ec,{isTable:ep,firstRowCommentTargetIds:eh,effectiveBgHighlight:em}=function({node:e,decorations:t,editor:i,highlightTarget:n,bgHighlight:a}){let r="table"===e.type.name,o=null!==n,l=(0,s.useMemo)(()=>{if(!r)return;let n=tt(t);if(void 0===n)return;let a=e.firstChild;if(!a)return;let o=ey.AnnotationPluginKey.getState(i.state);if(!o)return;let s=n+1+a.nodeSize;return new Set(o.getAnnotationsBetween(i.state,n+1,s).map(e=>e.id))},[r,t,i,e]),d=!r||"table"===n||!o;return{isTable:r,firstRowCommentTargetIds:l,shouldHighlightSelf:d,effectiveBgHighlight:a&&d?a:void 0,isButtonStackHovered:o}}({node:I,decorations:r,editor:l,highlightTarget:z,bgHighlight:ec}),eg="tableRow"===I.type.name,ef=(0,x.isMobileDevice)()&&ec&&!eg?(0,t.jsx)(i.Box,{bgColor:ec,children:e}):e;return(0,t.jsxs)(m.NodeViewWrapper,{as:w,style:{...A,position:"relative",backgroundColor:(0,x.isMobileDevice)()?void 0:em,"--comment-highlight-bg":ec},className:(0,n.cx)(S,"annotatable-node-view-wrapper",(0,x.isMobileDevice)()&&"is-mobile",eu&&"is-comment-highlighted",ep&&"firstRow"===z&&"is-first-row-comment-highlighted",H?"debug-comments":""),dir:k,ref:ei,children:["after"===T?ef:null,es&&(0,t.jsx)(e4,{nodeName:I.type.name,side:T,isVisible:el,reactions:ea,blockCommentId:O,userCanComment:ed,blockAllowsCommenting:!E&&!_,onCommentDraftUpdate:({editor:e})=>{G(t=>t?{...t,json:e.view.state.doc.toJSON(),text:e.view.state.doc.textContent}:t)},cleanupDraftComment:q,createDraftComment:K,editor:l,getPos:h,comments:Q,draftComment:ee,onCommentSave:X,enableReactions:D,mobileAddCommentPos:P,setHighlightTarget:F,firstRowCommentTargetIds:eh}),"before"===T?ef:null]})}},92714,(e,t,i)=>{var n=e.r(849057);t.exports=function(e,t,i){for(var a=-1,r=e.length;++a{t.exports=function(e,t){return e>t}},321350,(e,t,i)=>{var n=e.r(92714),a=e.r(778336),r=e.r(625975);t.exports=function(e){return e&&e.length?n(e,r,a):void 0}},55889,912228,571202,e=>{"use strict";e.s(["ignoreDataMutation",0,({mutation:e})=>!!("attributes"===e.type&&e.attributeName?.startsWith("data-"))],55889);var t=e.i(285598);e.s(["deleteLayoutCell",0,(e,i,n=!1)=>{let a=i.nodeAfter;if(!a)return!1;e.deleteRange(i.pos,i.pos+a.nodeSize);let r=e.doc.nodeAt(i.pos),o=i.pos,s=1;(!n&&i.nodeBefore||n&&!r&&i.nodeBefore)&&(o=i.pos-i.nodeBefore.nodeSize,s=-1);let l=e.doc.resolve(o+1),d=(0,t.findSelectionNearOrGapCursor)(e.doc.resolve(s>0?l.pos:l.end()),s);return d&&e.setSelection(d),!0}],912228),e.s(["SmartLayoutPlugin",()=>u],571202);var i=e.i(175863),n=e.i(423444),a=e.i(597456),r=e.i(4877),o=e.i(932132),s=e.i(45954),l=e.i(591378);class d{dragging;constructor(e=null){this.dragging=e}}let c=new i.PluginKey("smartLayoutPlugin"),u=e=>new i.Plugin({key:c,state:{init:()=>new d,apply:(e,t)=>t},props:{decorations:e=>(0,o.decorateLayouts)(e),handleDOMEvents:{drop(e){let t=e.dragging?.annotations,i=c.getState(e.state);if(!i)return!1;i.dragging=t}},handleDrop:(t,i,n)=>{let a=c.getState(t.state),r=a?.dragging;return a&&(a.dragging=null),!!(h(e,t,i,n)||m(e,t,i,n,r)||p(e,t,i,n))},handlePaste:(t,a,o)=>{let{selection:l}=t.state;if(!(l instanceof i.NodeSelection&&(0,s.isSmartLayoutCellNode)(l.node)))return!1;let d=(0,r.handleImagePaste)(e,a,o),c=(0,n.sliceSingleNode)(o);if(c&&"image"!==c.type.name&&!d)return!1;let u=d?d.attrs:c?.attrs;return e.commands.updateNestedAttributesAtPos(l.from,{image:u}),d&&d.upload(),!0},handleTextInput:(e,t,n,a)=>{let{selection:r}=e.state;return!!(r instanceof i.NodeSelection&&(0,s.isSmartLayoutCellNode)(r.node))}}}),p=(e,t,i,n)=>{let r=(0,l.checkSmartLayoutImageDropTarget)(t,i,n);if(!r)return!1;let o=(0,l.getImageFile)(i),s=null,d=r.image;o&&(d=(s=(0,a.setupImageUpload)(o,e)).content.attrs);let c=t.state.tr;return c.setNodeAttribute(r.pos,"image",d),s?.upload(),c.deleteSelection(),t.dispatch(c),!0},h=(e,t,i,n)=>{let a=(0,l.checkSmartLayoutVariantDropTarget)(t,i,n);if(!a)return!1;let r=t.state.tr;return r.setNodeAttribute(a.pos,"variantKey",a.variantKey),t.dispatch(r),e.commands.selectNodeAtPos(a.pos),!0},m=(e,t,i,n,a)=>{let r=null;try{if(!(r=(0,l.checkSmartLayoutDropTarget)(t,i,n)))return!1}catch(e){return!1}try{let{selection:i}=t.state,o=!i.empty,{node:s,pos:l,side:d}=r;if(l>i.from&&l(o&&e.deleteSelection(),a&&e.setMeta("annotationEvent",{type:"drop",dragging:a,droppedBlockPos:u+1}),!0)).focusMapped(u,1).run()}catch(e){console.error("(caught) [SmartLayoutPlugin] handleDrop error:",e)}return!0}},932132,273141,18547,922712,113669,747355,843002,693252,e=>{"use strict";e.s(["decorateLayouts",()=>eC,"findFullBleedDecoration",()=>ek,"findSmartLayoutCellDecoration",()=>eS,"findSmartLayoutDecoration",()=>ew],932132);var t=e.i(321350),i=e.i(175863),n=e.i(615505),a=e.i(661619),r=e.i(325059),o=e.i(889601),s=e.i(977581),l=e.i(372764),d=e.i(864935),c=e.i(45954);e.s(["SmartLayout",()=>ey],693252);var u=e.i(755453),p=e.i(55889),h=e.i(767730);e.i(838054);var m=e.i(408767),g=e.i(438106),f=e.i(912228),b=e.i(577281),x=e.i(957883),y=e.i(571202);e.s(["SmartLayoutView",()=>ex],843002);var v=e.i(391398),C=e.i(470645),w=e.i(408122),S=e.i(191788),k=e.i(783197),A=e.i(418755),E=e.i(19654),_=e.i(432247),I=e.i(551880),M=e.i(194552),T=e.i(343902);e.i(197258),e.i(179015);var L=e.i(380442);let j=e=>e?.wrapperConfig?.gridStyle==="alternating_tight"||e?.wrapperConfig?.gridStyle==="alternating_loose";var P=e.i(613616),D=e.i(957881),N=e.i(890003),R=e.i(136484),O=e.i(525903),B=e.i(428683),z=e.i(754851),F=e.i(387111);let H=(0,S.memo)(({children:e,positionProps:t,cellProps:i,markerFontSize:n})=>{let{direction:a,layoutOptions:r,cellOptions:o,index:s}=i,{colorVars:l}=(0,D.useCellColor)({layoutColorOverride:r.color,cellColorOverride:o?.color,index:s,forceTransparent:!1,isColoringCell:!0}),d=(0,R.useShouldRenderMobileVersion)(),c=n?(0,F.getBulletSizeEm)(d,n):void 0;return(0,v.jsxs)(B.Box,{...t,height:c?`${c}em`:void 0,css:l,children:[(0,v.jsx)(B.Box,{position:"absolute",transform:`translate(${"rtl"===a?"50%":"-50%"}, -50%)`,width:"0.75em",height:"0.75em",borderRadius:"50%",className:z.HTML_SHAPE_FILL_CLASS,zIndex:2,top:"50%"}),e]})});H.displayName="SmallBulletLineMarker";let W={smallBullet:H,bigBullet:O.BulletMarker};var U=O,V=e.i(878410),G=e.i(188407);let $={base:!1,md:!0},Z={base:!1,md:!0},K=e=>{let t=(0,G.useGammaBreakpointValue)($)||!1,i=(0,G.useGammaBreakpointValue)(Z)||!1,n="horizontal"===e.orientation&&i,a=e.twoSided&&(n||t);return{isHorizontal:n,isTwoSided:a}},q=(0,S.memo)(({cellProps:e,markerSize:t,lineLength:i,verticalAlign:n="top",MarkerWrapper:r=U.BulletMarker,markerFontSize:o})=>{let{direction:s,index:l,layoutOptions:d}=e,{isHorizontal:c,isTwoSided:u}=K(d),p=d.hasLine?"inside":"none",h=(0,R.useShouldRenderMobileVersion)(),m=((e,t,i,n,r,o)=>{let s=!t*n,l=t&&i%2==0,[d,c]=(0,a.getInsetProps)(r),u="center"===o?"50%":0;return e?l?{bottom:`${s}em`,transform:"translateY(50%)"}:{top:`${s}em`,transform:"translateY(-50%)"}:l?{[c]:`${s}em`,transform:`translateX(${"rtl"===r?"-50":"50"}%)`,top:u}:{[d]:`${s}em`,transform:`translateX(${"rtl"===r?"50":"-50"}%)`,top:u}})(c,u,l,t,s,n),g=((e,t,i,n,r)=>{let o=t&&i%2==0,[s,l]=(0,a.getInsetProps)(r),d="number"==typeof n?`${n}em`:n;return e?{height:d,width:"var(--line-thickness)",[s]:"50%",top:o?void 0:"50%",bottom:o?"50%":void 0,transform:`translateX(${"rtl"===r?"50":"-50"}%)`}:{width:d,height:"var(--line-thickness)",top:"50%",transform:"translateY(-50%)",[s]:o?void 0:"calc(100% - var(--line-thickness))",[l]:o?"calc(100% - var(--line-thickness))":void 0}})(c,u,l,"none"===p?0:"inside"===p?`${h?i/2:i}em`:"100%",s);return(0,v.jsx)(r,{cellProps:e,positionProps:{...m,position:"absolute"},markerFontSize:o,children:"none"!==p&&(0,v.jsx)(B.Box,{position:"absolute",zIndex:"-1","data-testid":"timeline-line",...g,className:z.LINE_CLASS})})});q.displayName="AlternatingMarker";let Y=(0,S.memo)(({children:e,distanceFromLine:t=2,minCellSize:i=8,testIdPrefix:n="timeline-item",cellContentPropOverrides:a,css:r,lineMarker:o,cellStyle:s="none",gridStyle:l,...c})=>{var u;let p,h,m,g,f,b,x,{layoutOptions:y,index:C,dragHandle:w,cellOptions:S,direction:k,selectCellForElementProps:A,theme:E}=c,{markerType:_,markerFontSize:I,markerSize:M,lineLength:T,verticalAlign:L}=o||{},j=_?W[_]:void 0,{isHorizontal:O,isTwoSided:B}=K(y),z=B&&(C+1)%2==1,{colorVars:H}=(0,D.useCellColor)({layoutColorOverride:y.color,cellColorOverride:S?.color,index:C,forceTransparent:!0}),U=(0,R.useShouldRenderMobileVersion)(),V=(p=y.hasLine?"inside":"none",h=T||0,m=M||0,`${("inside"===p?U?h/2:h:0)+("none"===p?m:0)+(O?t/2:t)+(B?0:m)}em`),G=(u=`${t/2}em`,f={align:"flex-start",transformOrigin:(g=B&&(C+1)%2==1)?"right center":"left center",ps:g?void 0:V,pe:g?V:void 0,gridColumn:g?1:3,height:"fit-content"},b={gridRow:g?1:3,align:g?"flex-end":"flex-start",justify:"center",transformOrigin:g?"center bottom":"center top",pt:g?void 0:V,pb:g?V:void 0,px:u},"alternating_loose"===l?O?{gridColumn:C+1,...b}:{gridRow:C+1,...f}:O?{gridColumn:"span 2",...b}:{gridRow:"span 2",...f}),$={right:"rtl"===k?"left":"right",left:"rtl"===k?"right":"left"},Z=(0,F.matchBulletTextAlignment)(c.theme,U,I||null,c.firstChildSize),Y=O?{minW:`min(100%, ${i}em)`,...(0,d.getAlignStyles)("center"),...H}:{minH:B?`${i}em`:void 0,...(0,d.getAlignStyles)(z?$.right:$.left),...(0,d.getAlignStylesParent)(z?$.right:$.left,k),...j&&I&&{mt:`${Z}em`},...H},X="0em"===V?(x=(C+1)%2==1,O?x&&B?{borderBottomLeftRadius:"0 !important",borderBottomRightRadius:"0 !important",borderBottom:"none !important"}:{borderTopLeftRadius:"0 !important",borderTopRightRadius:"0 !important",borderTop:"none !important",top:"var(--line-thickness) !important"}:("ltr"===k?!B||!x:B&&x)?{borderTopLeftRadius:"0 !important",borderBottomLeftRadius:"0 !important",borderLeft:"none !important",left:"var(--line-thickness) !important"}:{borderTopRightRadius:"0 !important",borderBottomRightRadius:"0 !important",borderRight:"none !important",right:"var(--line-thickness) !important"}):{},Q={...a,sx:Y,flex:"1",maxW:"100%",...A,...X};return(0,v.jsxs)(P.Flex,{minW:"0",position:"relative",transitionProperty:"border, padding, right, margin","data-selection-ring":"padded","data-content-reference":!0,...A,...G,[`data-test-${n}`]:C,css:{...r},...(e=>{switch(e.verticalAlign||"top"){case"center":return{alignItems:"center"};case"bottom":return{alignItems:"flex-end"};default:return{alignItems:"flex-start"}}})(y),children:[j&&(0,v.jsx)(q,{cellProps:c,markerSize:M||0,lineLength:T||0,markerFontSize:I,MarkerWrapper:j,verticalAlign:L}),(0,v.jsxs)(N.StyledGridCell,{cellContentPropOverrides:Q,cellStyle:s,cellProps:c,theme:E,children:[e,w]})]})});Y.displayName="AlternatingGridCell";let X=(0,S.memo)(({children:e,...t})=>{let i=t.variant?.config;if(j(i)){let n=i.wrapperConfig,a=i.cellConfig;return(0,v.jsx)(Y,{...t,...a,gridStyle:n.gridStyle||"alternating_tight",children:e})}let n=i?.wrapperConfig,a=t.variant?.config?.cellConfig;if(!a||!n)return console.warn("No config found for variant",t.variant),null;let r="marker"in a?a.marker:void 0,o="innerLabel"in a?a.innerLabel:void 0;return(0,v.jsx)(L.GridItem,{cellProps:t,cellStyle:a.cellStyle||"none",markerConfig:r,innerLabelConfig:o,cellContentPropOverrides:a.cellContentOverrides,cellDecorConfig:a.cellDecor,gridStyle:n.gridStyle,dragHandle:t.dragHandle,children:e})});X.displayName="ConfigurableSmartLayoutCell",e.s(["ConfigurableSmartLayoutCell",0,X],273141);var Q=e.i(143863),J=e.i(349904),ee=e.i(860686);let et=(0,S.memo)(({children:e,options:t,direction:i,onContextMenu:n,selectLayoutForElementProps:a,markerSize:r=1.125,lineColor:o,css:s})=>{let{isHorizontal:l,isTwoSided:d}=K(t),c=(0,S.useMemo)(()=>l?{templateRows:"auto 0px auto",gridAutoColumns:"1fr",gridAutoFlow:"column",justifyContent:"center",columnGap:(0,V.scaleWithFontScale)("1.25em")}:{templateColumns:d?"1fr 0px 1fr":"0px 0px 1fr",autoRows:"auto",justifyContent:"center",rowGap:(0,V.scaleWithFontScale)("2em")},[l,d]),{colorVars:u}=(0,D.useCellColor)({layoutColorOverride:t.color,isColoringCell:!1});return"accent"===o&&((u=u?{...u}:{})["--line-color"]="var(--shape-border-color-override, var(--shape-border-color))"),(0,v.jsxs)(ee.Grid,{...c,"data-selection-ring":"padded",pos:"relative",onContextMenu:n,...a,css:s,children:[(0,v.jsx)(ei,{isHorizontal:l,isTwoSided:d,direction:i,markerSize:r,colorVars:u}),e,d&&(0,v.jsx)(en,{isHorizontal:l,selectLayoutForElementProps:a})]})});et.displayName="AlternatingGridWrapper";let ei=(0,S.memo)(({isHorizontal:e,isTwoSided:t,direction:i,markerSize:n,colorVars:a})=>e?(0,v.jsx)(B.Box,{gridRow:2,gridColumn:1,"data-spotlight-dim":!0,contentEditable:!1,css:a,children:(0,v.jsx)(B.Box,{position:"absolute",height:"var(--line-thickness)",width:"100%",insetX:"0",insetBlockStart:t?void 0:`${n}em`,className:z.LINE_CLASS})}):(0,v.jsx)(J.Center,{gridColumn:2,gridRow:1,"data-spotlight-dim":!0,contentEditable:!1,css:a,children:(0,v.jsx)(B.Box,{position:"absolute",width:"var(--line-thickness)",insetY:"0",left:t||"rtl"===i?void 0:"0",right:t||"ltr"===i?void 0:"0",className:z.LINE_CLASS,ms:t?void 0:`${n}em`})}));ei.displayName="AlternatingCenterLine";let en=(0,S.memo)(({isHorizontal:e,selectLayoutForElementProps:t})=>{let i="4em";return(0,v.jsx)(B.Box,{...e?{gridColumn:"1 / span 1",gridRow:3,minW:"0.5fr"}:{gridColumn:3,gridRow:"1 / span 1",minH:i},contentEditable:!1,...t})});en.displayName="AlternatingStaggerElement";let ea=(0,S.memo)(e=>{let t=e.variant?.config;if(!t)return console.warn("No config found for variant",e.variant),null;if(j(t)){let i=t.wrapperConfig,n=t.cellConfig;return(0,v.jsx)(et,{...e,...i,markerSize:n?.lineMarker?.markerSize})}let i=t.wrapperConfig;return(0,v.jsx)(Q.GridWrapper,{...e,cellSize:e.options.cellSize,orientation:e.options.orientation,horizontalAlign:e.options.horizontalAlign,spacing:i.spacing,wrapperStyle:i.wrapperStyle,gridStyle:i.gridStyle})});ea.displayName="ConfigurableSmartLayoutWrapper",e.i(187587),e.s([],18547);var er=e.i(227909),eo=e.i(500425),es=e.i(524473),el=e.i(358280);e.i(734710);var ed=e.i(430378),ec=e.i(78387),eu=e.i(204319);let ep=({editor:e,node:t,getPos:i,includeCut:n=!0,imageSrc:a})=>(0,S.useMemo)(()=>[...n?[{key:"cut",label:(0,v.jsx)(el.Trans,{message:"Cut",id:"cCd8Bs"}),icon:es.faScissors,onClick:()=>{let n=i();"number"==typeof n&&e.commands.basicCut({from:n,to:n+t.nodeSize})}}]:[],{key:"copy",label:(0,v.jsx)(el.Trans,{message:"Copy",id:"he3ygx"}),icon:es.faCopy,onClick:()=>{let n=i();"number"==typeof n&&e.commands.copy({from:n,to:n+t.nodeSize})}},...a?[{key:"copy-image-address",label:(0,v.jsx)(el.Trans,{message:"Copy image address",id:"XfEsUn"}),icon:es.faLink,onClick:()=>{navigator.clipboard.writeText(a)}},{key:"open-image-in-new-tab",label:(0,v.jsx)(el.Trans,{message:"Open image in new tab",id:"cOAVCo"}),icon:es.faExternalLink,onClick:()=>{window.open(a,"_blank")}},{key:"download-image",label:(0,v.jsx)(el.Trans,{message:"Download image",id:"dhu12h"}),icon:es.faDownload,onClick:()=>{(0,eu.saveImage)(a)}}]:[]],[n,e,t,i,a]);e.s(["useEditorContextMenuItems",0,ep],922712),e.i(144786);var eh=e.i(275316),em=e.i(706923);let eg=(e,t)=>`${e}-${JSON.stringify(t)}`;e.s(["hashKeyAndOptions",0,eg,"parseKeyAndOptions",0,e=>{let[t,i]=e.split("-");return{key:t,options:JSON.parse(i)}}],113669);let ef=()=>{let e=(0,em.getSmartLayoutVariants)();return Object.entries(x.SmartLayoutFamilies).map(([t,i])=>{let n=e.filter(({disabled:e,featureFlag:i,family:n})=>!e&&(!i||eh.featureFlags.get(i))&&n===t).map(e=>{let t=e.presetConfigurations,i=[];return t&&t.forEach(t=>{i.push({...t,icon:e.icon,variantKey:e.key,key:eg(e.key,t.options),visible:!0})}),{variant:e,options:i}});return{family:{key:t,...i},variants:n,visible:!0}}).filter(e=>e.variants.length>0)};e.s(["getAllVariantsByKeyAndOptionHash",0,()=>ef().flatMap(e=>e.variants.flatMap(e=>e.options)).reduce((e,t)=>(e[eg(t.variantKey,t.options)]=t,e),{}),"getAvailableVariants",0,ef,"getAvailableVariantsByFamily",0,()=>ef().reduce((e,t)=>(e[t.family.key]={family:t.family,variants:t.variants},e),{})],747355);var eb=e.i(591378);let ex=e=>{let{node:t,decorations:i,editor:n,getPos:a}=e,r=t.attrs,o=(0,em.getSmartLayoutVariant)(r.variantKey),s=o.config?ea:o.Wrapper,l=ew(i),d=(0,eb.getSmartLayoutOptions)(r,l.direction),c=(0,A.useAppSelector)(I.selectEditable),u=(0,k.useIsThumbnailView)(),p=(0,A.useAppSelector)(I.selectTheme),{contextMenuItems:h}=(({editor:e,node:t,getPos:i,options:n})=>{let{variantKey:a}=t.attrs,r=(0,em.getSmartLayoutVariant)(a),o=(0,S.useCallback)(t=>{let n=i();"number"==typeof n&&e.commands.updateNestedAttributesAtPos(n,t)},[e,i]),s=(0,S.useCallback)(e=>{ed.analytics.track(ec.SegmentEvents.SMART_LAYOUT_VARIANT_CHANGED,{previousVariant:a,newVariant:e,method:"context-menu"}),o({variantKey:e})},[o,a]),l=(0,S.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]),d=(0,S.useMemo)(()=>{let s=t.attrs;return r.options.map(r=>{if(r.checkEnabled&&!r.checkEnabled({options:n,attrs:s,node:t}))return null;let l=n[r.key]??r.defaultValue?.({ctx:"menu"});return r.ControlMenu?r.ControlMenu(l,(s,d)=>{if(o({options:{...n,[r.key]:s}}),ed.analytics.track(ec.SegmentEvents.SMART_LAYOUT_OPTION_UPDATED,{variantKey:a,optionKey:r.key,previousValue:l,newValue:s,updateChildren:d,method:"context-menu"}),d){let n=i();"number"==typeof n&&t.forEach((t,i)=>{e.commands.updateNestedAttributesAtPos(n+i+1,{options:{...t.attrs.options,[r.key]:s}})})}},r):null}).filter(e=>null!==e)},[r.options,a,t,n,o,e.commands,i]),c=ep({editor:e,getPos:i,node:t,includeCut:!1}),u=(0,S.useMemo)(()=>ef().map(e=>({key:`family-${e.family.key}`,label:e.family.name(),icon:e.family.icon,items:e.variants.map(e=>{let t=e.variant,i=a===t.key;return{key:`variant-${t.key}`,label:t.name(),icon:i?(0,v.jsx)(er.CheckIcon,{}):void 0,onClick:()=>s(t.key)}})})),[a,s]);return{contextMenuItems:[{key:"title",title:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(el.Trans,{message:"Smart layout:",id:"kLxOTV"})," ",r.name()]})},{divider:!0},...c,{divider:!0},...d.length?[...d,{key:"divider",divider:!0}]:[],{key:"switch-layout",label:(0,v.jsx)(el.Trans,{message:"Switch layout",id:"FRoFGK"}),icon:eo.faTableLayout,items:u},{divider:!0},{key:"delete",label:(0,v.jsx)(el.Trans,{message:"Delete",id:"cnGeoo"}),icon:es.faTrash,onClick:l,color:"red.500"}]}})({editor:n,node:t,getPos:a,options:d}),{onOpenContextMenu:m}=(0,E.useEditorContextMenu)({editor:n,contextMenuItems:h,getPos:a}),g=(0,S.useMemo)(()=>({onClick:e=>{if(e.currentTarget===e.target){let e=a();"number"==typeof e&&n.commands.selectNodeAtPos(e)}},cursor:c?"auto":"default"}),[n,a,c]);return(0,v.jsxs)(M.AnnotatableNodeViewWrapper,{...e,dir:l.direction,className:(0,C.cx)(c&&!u&&"is-editable"),style:{position:"relative",display:"grid",gridTemplateColumns:"100%"},children:[s&&(0,v.jsx)(s,{...l,onContextMenu:m,options:d,theme:p,variant:o,node:t,selectLayoutForElementProps:g,children:(0,v.jsx)(_.NodeViewContent,{"data-node-view-content-outer":"smartLayout"})}),(0,v.jsx)(T.ContainerDragHandle,{...e,handlePlacement:"outside",label:w.i18n._({id:"Szg6OU",message:"Select layout"}),"data-testid":"smart-layout-drag-handle"})]})},ey=(0,h.createTiptapNode)("smartLayout",{isolating:!0,containerHandle:!0,defining:!0,priority:g.ExtensionPriorityMap.SmartLayout,requiredAttrs:["variantKey"],parseHTML:()=>[{tag:"div[class=smart-layout]",getAttrs:e=>({variantKey:e.getAttribute("data-variantkey")||null,options:(0,h.parseJSONAttr)(e,"options")??{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,u.mergeAttributes)(t,{class:"smart-layout",...e.attrs.variantKey&&{"data-variantkey":e.attrs.variantKey},...(0,h.renderJSONAttrs)(e.attrs,"options")}),0],addNodeView:()=>(0,m.ReactNodeViewRenderer)(ex,{update:b.attrsOrDecorationsChanged,ignoreMutation:p.ignoreDataMutation}),addProseMirrorPlugins(){return[(0,y.SmartLayoutPlugin)(this.editor)]},addCommands:()=>({insertSmartLayoutCell:e=>({chain:t,state:i})=>{let n=i.doc.resolve(e),a=(0,u.findParentNodeClosestToPos)(n,e=>"smartLayout"===e.type.name),r=a?.node.lastChild;if(!a||!r)return!1;let o=r.attrs,s=(0,x.DefaultCellContent)(r.firstChild?.attrs.level),l="arrowBullets"===a.node.attrs.variantKey?o.image:{source:o.image?.source};return t().insertContentAt(e,{type:"smartLayoutCell",content:s,attrs:{image:l}}).selectInsertedNode().run(),!0},handleSmartLayoutDelete:(e,t=!0)=>({dispatch:n,state:a,tr:r,chain:o})=>{if(!n)return!0;let{selection:s}=a,l=s instanceof i.NodeSelection&&(0,c.isSmartLayoutCellNode)(s.node)?{node:s.node,pos:s.from}:(0,u.findParentNode)(e=>"smartLayoutCell"===e.type.name)(a.selection);if(e&&l&&l.pos!==s.from)return!1;let d=(0,u.findParentNode)(e=>"smartLayout"===e.type.name)(a.selection);if(!l||!d)return!1;if(1==d.node.childCount)o().selectNodeAtPos(d.pos).deleteSelectionAndSelectNear(t?1:-1).run();else{let e=r.doc.resolve(l.pos);(0,f.deleteLayoutCell)(r,e,t)}return!0},handleEmphasizeCell:(e,t)=>({chain:i,state:n})=>{let a=n.doc.resolve(e),r=(0,u.findParentNodeClosestToPos)(a,e=>"smartLayout"===e.type.name),o=r?.pos;return r?.node.forEach((n,a)=>{if(!o)return!1;let r=n.attrs.options,s=o+1+a;return i().updateNestedAttributesAtPos(s,{options:{...r,isEmphasized:s===e&&t}}).run(),!0}),!0}})});var ev=e.i(408553);let eC=e=>{let{doc:u}=e,p=[];return u.descendants((h,m,g)=>{if(h.type.name===ey.name){let c,g=(0,t.default)((0,s.fragmentToArray)(h.content).map(e=>(0,ev.parseLabelNumber)(e.attrs.label))),f=(0,o.getContainerSize)(u.resolve(m)),b=(0,d.getDirectionDecoration)(e,m,m+h.nodeSize),x=(0,a.getTextDirectionForNode)(h)||b||(0,r.getPreferredTextDirection)(),y=e.selection instanceof i.NodeSelection&&e.selection.node===h||e.selection.from>m&&e.selection.to{e.attrs.options.isEmphasized&&(c=i)});let v=(0,l.getDocSettingFromDocument)(u,"scaleContentToFit"),C={isSmartLayoutDecoration:!0,direction:x,numCells:h.childCount,containerSize:f,scaleContentToFit:!!v};p.push(n.Decoration.node(m,m+h.nodeSize,{},C)),h.forEach((e,t,i)=>{let a=m+1+t,r={isSmartLayoutCellDecoration:!0,direction:x,index:i,numCells:h.childCount,maxLabelValue:g,smartLayoutAttrs:h.attrs,layoutContainerSize:f,isContentEmpty:(0,s.isTreeEmpty)(e),isLayoutFocused:y,emphasizedIndex:c,scaleContentToFit:!!v};p.push(n.Decoration.node(a,a+e.nodeSize,{},r))})}if(("image"===h.type.name||"smartDiagram"===h.type.name)&&(0,c.isSmartLayoutCellNode)(g)){let e=g.attrs.options.fullBleedContent,t=n.Decoration.node(m,m+h.nodeSize,{},{isFullBleed:e});p.push(t)}}),n.DecorationSet.create(u,p)},ew=e=>{let t=e.find(e=>e.spec.isSmartLayoutDecoration);return t?t.spec:(console.error("[SmartLayout] Decoration not found. This should never happen!",e),{isSmartLayoutDecoration:!0,direction:"ltr",numCells:0,containerSize:1})},eS=e=>{let t=e.find(e=>e.spec.isSmartLayoutCellDecoration);return t?t.spec:(console.error("[SmartLayoutCell] Decoration not found. This should never happen!",e),{isSmartLayoutCellDecoration:!0,direction:"ltr",numCells:0,index:0,smartLayoutAttrs:{options:{}},layoutContainerSize:1,isContentEmpty:!1,isLayoutFocused:!1})},ek=e=>{let t=e.find(e=>e.spec.isFullBleed);return t?.spec||{}}},321071,e=>{"use strict";e.s(["checkMediaDropTarget",()=>n,"getDropSide",()=>a,"getGridLayoutContentToInsert",()=>r,"getGridLayoutFocusOffset",()=>o]);var t=e.i(379457),i=e.i(622758);let n=(e,n,r)=>{if(r&&!(0,i.canColumnContainSlice)(r,e.state.schema)||!(n.target?.hasAttribute("data-media-node-wrapper")||(0,t.findInBetween)(n.target,e.dom,e=>e.hasAttribute("data-media-node-wrapper"))))return null;let o=(({view:e,event:t})=>{let i=e.posAtCoords({left:t.clientX,top:t.clientY})?.inside;if(!i||-1==i)return null;let{doc:n}=e.state,a=n.nodeAt(i);return{pos:i,node:a}})({view:e,event:n});if(!o||r&&r.content.firstChild===o.node)return null;let s=a(n.target,e);return s&&o.node?{pos:o.pos,node:o.node,side:s}:null},a=(e,i)=>{let n=(0,t.findNearestElementWithAttribute)(e,i.dom,"data-media-add-side");return n?.getAttribute("data-media-add-side")},r=({side:e,pasteContent:t,node:i})=>({type:"gridLayout",content:[{type:"gridCell",content:"left"===e?t:[i.toJSON()]},{type:"gridCell",content:"left"===e?[i.toJSON()]:t}]}),o=({side:e,node:t})=>"left"===e?2:t.nodeSize+4},490800,e=>{"use strict";var t=e.i(921679),i=e.i(379457),n=e.i(576281),a=e.i(864935),r=e.i(204319);let o=(e,t)=>{let n=(0,i.findInBetween)(e,t.dom,e=>e.hasAttribute("data-media-add-side"));return n?.getAttribute("data-media-add-side")};e.s(["getHorizontalAlign",0,({view:e,from:t,to:i,node:n})=>{let r=(0,a.getDirectionDecoration)(e.state,t,i);return n.attrs.horizontalAlign||("rtl"===r?"right":"left")},"getMediaGridLayoutContentToInsert",0,({horizontalAlign:e,eventTarget:i,node:a,newContent:s,editor:l})=>{let d=i.closest("[data-media-node-wrapper]"),c=Math.round((d?.querySelector("img")?.clientWidth||100)/(d?.clientWidth||100)*100),u=[n.templateHelpers.paragraph()],p=o(i,l.view),h=(0,t.default)(a.toJSON());return"image"===h.type&&h.attrs?.resize&&(h.attrs.resize=(0,r.getCropAttrsFromResize)(h.attrs.resize)),{type:"gridLayout",attrs:{colWidths:(()=>{switch(e){case"center":return[(100-c)/2,c,(100-c)/2];case"right":return[100-c,c];default:return[c,100-c]}})()},content:(()=>{switch(e){case"center":return[{type:"gridCell",content:"left"===p&&s?s:u},{type:"gridCell",content:[h]},{type:"gridCell",content:"right"===p&&s?s:u}];case"right":return[{type:"gridCell",content:s||u},{type:"gridCell",content:[h]}];default:return[{type:"gridCell",content:[h]},{type:"gridCell",content:s||u}]}})()}},"getMediaGridLayoutFocusOffset",0,({eventTarget:e,horizontalAlign:t,nodeSize:i,editor:n})=>{let a=o(e,n.view);switch(t){case"right":return 2;case"center":return"left"===a?2:i+7;default:return i+4}},"getNewImagePos",0,({horizontalAlign:e,prevPos:t})=>{switch(e){case"center":case"right":return t+4;default:return t+2}}])},604956,e=>{"use strict";e.s(["MediaViewWrapper",()=>v]);var t=e.i(391398),i=e.i(428683),n=e.i(613616),a=e.i(216912),r=e.i(887527),o=e.i(358280),s=e.i(408122),l=e.i(191788),d=e.i(325059),c=e.i(418755),u=e.i(551880),p=e.i(24439),h=e.i(864935),m=e.i(321071),g=e.i(490800),f=e.i(753748),b=e.i(685290);let x=new Set(["image","graphic"]),y=e=>e.some(e=>e.spec.isTopLevel),v=(0,a.forwardRef)(({children:e,resizeableSx:a,alignStyles:r,horizontalAlign:o,decorations:s,editor:d,node:v,isDark:S,isResizing:k,getPos:A,onContextMenu:E,..._},I)=>{let M=v.attrs.id,T=(0,c.useAppSelector)((0,f.selectIsIdCropping)(M)),L=y(s),j=(0,c.useAppSelector)(u.selectContentEditable),P=j&&L&&!T&&("right"===o||"center"===o),D=j&&L&&!T&&(!o||"left"===o||"center"===o),[N,R]=(0,l.useState)({side:null,id:null});return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(n.Flex,{dir:(0,h.getAlignDirection)(s,o),"data-media-node-wrapper":!0,"data-testid":"media-node-wrapper",onContextMenu:E,ref:I,h:"100%",w:"100%",direction:P||D?"row":"column",className:b.MOVEABLE_WRAPPER_CLASSNAME,sx:{...a},onClick:e=>{(({editor:e,event:t,isCropping:i,getPos:n})=>{if(!e.isEditable)return;let a=n();if(void 0===a)return;let r=e.view.state.doc.nodeAt(a);if(!r||!x.has(r.type.name))return;let o=t.target,s=o.getAttribute("data-media-add-text"),l=y((0,p.getDecorationsForNode)(e,a));if(!s||!l||i)return;let d=a+r.nodeSize,c=e.view,u=(0,g.getHorizontalAlign)({view:c,from:a,to:d,node:r}),h=(0,g.getMediaGridLayoutContentToInsert)({horizontalAlign:u,eventTarget:o,node:r,editor:e}),m=(0,g.getMediaGridLayoutFocusOffset)({eventTarget:o,horizontalAlign:u,nodeSize:r.nodeSize,editor:e}),f=(0,g.getNewImagePos)({horizontalAlign:u,prevPos:a});return e.chain().insertContentAt({from:a,to:d},h,{updateSelection:!1}).setMeta("annotationEvent",{type:"move",insertPos:f,insertPosRaw:f,pos:a,end:d}).focusMapped(a,m).run()})({editor:d,event:e,isCropping:T,getPos:A})},css:{...r,...P||D?{alignItems:"stretch"}:{}},onDragOver:e=>{if(e.preventDefault(),!N){let t=(0,m.checkMediaDropTarget)(d.view,e,d.view.dragging?.slice),i=(0,m.getDropSide)(e.target,d.view),n=t?.node.attrs.id;t&&i&&n&&(R({side:i,id:n}),setTimeout(()=>{R(null)},5e3))}},onDragEnd:e=>{e.preventDefault(),N&&R(null)},onDragLeave:e=>{e.preventDefault(),R(null)},..._,children:[P&&(0,t.jsx)(i.Box,{"data-media-add-side":"left",flex:"1",pos:"relative",css:{containerType:"size"},children:N?.side==="left"&&N?.id===v.attrs.id?(0,t.jsx)(w,{me:4}):(0,t.jsx)(C,{side:"left",me:4,isDark:S,isResizing:k})}),e,D&&(0,t.jsx)(i.Box,{"data-media-add-side":"right",flex:"1",pos:"relative",css:{containerType:"size"},children:N?.side==="right"&&N?.id===v.attrs.id?(0,t.jsx)(w,{ms:4}):(0,t.jsx)(C,{side:"right",ms:4,isDark:S,isResizing:k})})]})})}),C=({side:e,isDark:n,isResizing:a,...r})=>{let o=(0,d.useRtlEnabled)();return(0,t.jsx)(i.Box,{p:2,flex:"1",borderRadius:"lg","data-media-add-text":!0,opacity:0,height:"100%",transitionProperty:"common",transitionDuration:"normal",...r,cursor:"text",css:{"@container (width < 150px)":{display:"none"},"&:after":{position:"absolute",top:0,..."left"===e?{right:"var(--chakra-space-4)"}:{left:"var(--chakra-space-4)"},backgroundColor:n?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",color:n?"var(--chakra-colors-whiteAlpha-700)":"var(--chakra-colors-gray-600)",zIndex:1,borderRadius:"var(--chakra-radii-lg)",content:`"${s.i18n._({id:"HpUrSQ",message:"Click to add text"})}"`,textAlign:o?"right":"left",fontSize:"var(--chakra-fontSizes-sm)",padding:"var(--chakra-space-2)",width:"calc(100% - var(--chakra-space-4) - var(--chakra-space-2) - var(--chakra-space-2))",height:"calc(100% - var(--chakra-space-2) - var(--chakra-space-2))"},"&:hover":{opacity:+!a}}})},w=e=>(0,t.jsx)(i.Box,{p:2,flex:"1",height:"100%",borderRadius:"lg",transitionProperty:"common",transitionDuration:"normal",background:"var(--chakra-ring-color)",color:"var(--chakra-colors-whiteAlpha-900)",display:"flex",alignItems:"center",justifyContent:"center",...e,css:{"@container (width < 150px)":{display:"none"}},children:(0,t.jsx)(r.Text,{fontSize:"sm",fontWeight:"medium",children:(0,t.jsx)(o.Trans,{message:"Drop to add a column",id:"Wv5uRs"})})})},263726,159911,e=>{"use strict";e.s(["ImageClickHandler",()=>s],263726);var t=e.i(391398),i=e.i(191788),n=e.i(783197),a=e.i(786928),r=e.i(329860);e.i(297036);var o=e.i(471194);let s=({isEditable:e,clickBehavior:s,shouldContainImage:l,isCropping:d,isResizing:c,onEnterZoom:u})=>{let p=e?"expand":(0,r.getImageClickBehavior)(s),h=(0,n.useIsThumbnailView)(),m=(0,a.useToggleMediaDrawer)(),g=(0,i.useMemo)(()=>{if(!l&&e)return()=>m({isOpen:!0})},[l,e,m]),f=(0,i.useCallback)(()=>{d||c||u()},[u,d,c]);return h||"expand"!==p?null:(0,t.jsx)(o.ZoomClickCapture,{enterZoom:f,doubleClickNonZoomHandler:g})};var l=e.i(865799),d=e.i(428683),c=e.i(887527);e.s(["ImageUrlDebugger",0,({imageAttrs:e})=>(0,t.jsxs)(d.Box,{position:"absolute",as:"span",maxW:"95%",zIndex:1,bottom:0,m:1,children:[(0,t.jsx)(l.Badge,{maxW:"100%",colorScheme:"green",m:0,children:(0,t.jsxs)(c.Text,{isTruncated:!0,whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:"10px",maxW:"100%",children:["url: ",e.src]})}),(0,t.jsx)(l.Badge,{maxW:"100%",colorScheme:"yellow",children:(0,t.jsxs)(c.Text,{isTruncated:!0,whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:"10px",maxW:"100%",children:["tempUrl: ",e.tempUrl]})})]})],159911)},304977,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.KNOWN_BAD_HOSTNAMES=i.KNOWN_GOOD_HOSTNAMES=i.KNOWN_GOOD_TLDS=i.TRUSTED_WORKSPACE_IDS=i.GAMMA_WORKSPACE_ID_PRODUCTION=i.GAMMA_WORKSPACE_ID_STAGING=i.isTrustedTLD=i.removeWWWPrefix=void 0,i.removeWWWPrefix=e=>e.replace(/^www\./,""),i.isTrustedTLD=e=>i.KNOWN_GOOD_TLDS.some(t=>e===t||e.endsWith(`.${t}`)),i.GAMMA_WORKSPACE_ID_STAGING="QWjS6fBfpt",i.GAMMA_WORKSPACE_ID_PRODUCTION="zc87vhr30n8uf3n",i.TRUSTED_WORKSPACE_IDS=["acme",i.GAMMA_WORKSPACE_ID_STAGING,i.GAMMA_WORKSPACE_ID_PRODUCTION],i.KNOWN_GOOD_TLDS=["gamma.app","gamma.site","gammastaging.site","wikipedia.org"],i.KNOWN_GOOD_HOSTNAMES=["gamma.app","gamma.site","cdn.gamma.app","staging.gamma.app","cdn-staging.gamma.app","careers.gamma.app","design.gamma.site","orzo.gamma.site","www.markdownguide.org","www.youtube.com","www.linkedin.com","www.instagram.com","twitter.com","x.com","www.tiktok.com","help.gamma.app","gamma.new","join.slack.com","www.google.com","www.facebook.com","groups.google.com","en.wikipedia.org","replit.com","www.bea.gov","doi.org","es.wikipedia.org","app.stotles.com","docs.google.com","www.figma.com","www.ncbi.nlm.nih.gov","github.com","youtu.be","tr.wikipedia.org","uk.wikipedia.org","ru.wikipedia.org","ro.wikipedia.org","pt.wikipedia.org","example.com","zh.wikipedia.org","www.sciencedirect.com","fr.wikipedia.org","colab.research.google.com","player.fm","m.facebook.com","www.britannica.com","www.amazon.com","www.podcasts.com","ko.wikipedia.org","www.example.com","vi.wikipedia.org","www.notion.so","chat.openai.com","calendly.com","www.bing.com","pubmed.ncbi.nlm.nih.gov","open.spotify.com","de.wikipedia.org","id.wikipedia.org","www.researchgate.net","techcrunch.com","www.cnn.com","pl.wikipedia.org","api.whatsapp.com","youtube.com","hbr.org","podcasters.spotify.com","ar.wikipedia.org","th.wikipedia.org","dictionary.cambridge.org","www.kaggle.com","es.surveymonkey.com","www.canva.com","www.forbes.com","lookerstudio.google.com","unsplash.com","www.cdc.gov","az.wikipedia.org","it.wikipedia.org","www.investopedia.com","www.pinterest.com","music.amazon.com","kk.wikipedia.org","scholar.google.com","www.nature.com","www.producthunt.com","creativecommons.org","www.masterclass.com","fa.wikipedia.org","www.bbc.com","www.nytimes.com","en.m.wikipedia.org","sr.wikipedia.org","uz.wikipedia.org","ieeexplore.ieee.org","play.google.com","es.m.wikipedia.org","cloud.google.com","www.imdb.com","www.mckinsey.com","aws.amazon.com","www.microsoft.com","chrome.google.com","www.businessinsider.com","bing.com","www.porsche.com","www.apple.com"].map(i.removeWWWPrefix),i.KNOWN_BAD_HOSTNAMES=["trixmovie.com","luna-3d.com","luna-3d.com:443","kiladkoerm.com","movie.geoflix.me","wtach.club","movstream.fun","novelastv.me","xzc.one","srv1.iyxwfree.my.id","followme.tribe.so","xzc.icu","marcolinks.click","multilibb.cc","exl-trk.com","uk.ebookarea.xyz","wemovietv.com","123moviesdb.com","www.realpdfdumps.com","pede.4tv.live","voxmovie.com","stream.evmovies.com","dmovie.fun","pdfhost.io","megavids.online","www.pdfdumpspro.com","gomovie.stream","dmovie.fun:443","go123.stream","ca.ebookarea.xyz","movie4you.online","www.123movieslink.com","moviedaily.site","maxstream.site","ftmovies.xyz","moviescreen.biz","moviesfox.site","morthenfile.web.app"].map(i.removeWWWPrefix)},921495,(e,t,i)=>{"use strict";var n=e.e&&e.e.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var a=Object.getOwnPropertyDescriptor(t,i);(!a||("get"in a?!t.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,a)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),a=e.e&&e.e.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),a(e.r(304977),i),a(e.r(131010),i)},479886,e=>{"use strict";var t=e.i(921495),i=e.i(367792);let n=(e,i=[],n=[])=>{if(!e)return"unknown";try{let a=new URL(e),r=(0,t.removeWWWPrefix)(a.hostname);if(n.includes(r))return"trusted";let o=i.find(t=>t.url===e);if(!o)return"unknown";if(3===o.status)return"untrusted";if(2===o.status)return"unknown";if(1===o.status)return"trusted";o.status}catch(t){console.error("[getLinkTrustLevel] Error checking link",e,t)}return"unknown"};e.s(["getLinkTrustLevel",0,n,"getSafeUrl",0,(e,t=[],a=[])=>{if(!e)return"";let r=n(e,t,a);return"trusted"===r?e:"untrusted"===r?`${i.config.FRONTEND_URL}/[untrusted-url]`:`${i.config.FRONTEND_URL}/external-link?url=[${encodeURIComponent(e)}]`}])},695192,e=>{"use strict";var t=e.i(949125),i=e.i(191788);e.i(144786);var n=e.i(849187),a=e.i(82050),r=e.i(180939),o=e.i(418755),s=e.i(335884);e.i(615835);var l=e.i(25747),d=e.i(650292),c=e.i(593058),u=e.i(479886);e.s(["useLinkInterstitial",0,(e,p)=>{let{showLinkInterstitial:h}=(0,c.useLinkInterstitialContext)(),m=(0,o.useAppSelector)(a.selectFileWorkspace),g=(0,o.useAppSelector)(a.selectFile),f=g?.site?.hasCustomDomain??!1,b=(0,o.useAppSelector)(a.selectCurrentPageLinks,(...e)=>(0,t.default)(...e)),x=(0,r.useCanSkipLinkInterstitial)(m),y=(0,n.useFeatureFlag)("knownGoodHostnames"),v=!!(0,l.useUserContext)().user,C=(0,s.useShouldUsePublishedVersion)(),w=e?.startsWith("/")||e?.startsWith("#"),S=d.isPuppeteer||x,k=d.isPuppeteer||f||w,A=C?k:S,E=(0,i.useMemo)(()=>A?"trusted":(0,u.getLinkTrustLevel)(e,b,y),[e,b,y,A]),_=(0,i.useMemo)(()=>A||v&&"unknown"===E?e:(0,u.getSafeUrl)(e,b,y),[A,e,v,E,b,y]);return{interceptLinkClick:(0,i.useCallback)(t=>{if(e&&"trusted"!==E&&(!v||"unknown"!==E))return(t.preventDefault(),t.stopPropagation(),"untrusted"===E)?console.warn("[interceptLinkClick] Untrusted link clicked",e):h?.(e,p),!0},[e,E,v,h,p]),linkUrlSafe:_,linkTrustLevel:E,linkInterceptEnabled:!1===A,isUntrusted:"untrusted"===E}}])},59936,e=>{"use strict";var t=e.i(391398),i=e.i(428683),n=e.i(818315),a=e.i(191788),r=e.i(335884),o=e.i(160396),s=e.i(697240),l=e.i(382167),d=e.i(695192),c=e.i(418755),u=e.i(309847),p=e.i(551880);let h=({link:e,children:i,...n})=>{let r=(0,c.useAppSelector)(p.selectEditable),{linkUrl:o,handleClick:s}=(0,u.useSiteEnabledLink)({url:e||""}),{interceptLinkClick:h,linkUrlSafe:m,isUntrusted:g,linkInterceptEnabled:f}=(0,d.useLinkInterstitial)(o),b=(0,a.useCallback)(e=>{if(s?.(e),!r)return f?h(e):void 0;e.preventDefault()},[r,s,h,f]);return e&&!g?(0,t.jsx)(l.Link,{href:f?m||"":o,isExternal:!0,onClick:b,rel:"noopener nofollow",...n,children:i}):(0,t.jsx)(t.Fragment,{children:i})};var m=e.i(456389);let g=(0,a.forwardRef)(({imageAttrs:{src:e,tempUrl:a,resize:l,meta:d},isCroppingThisImage:c=!1,isZoomed:u=!1,objectFit:p="contain",containerWidth:g,intrinsicAspectRatio:f,isThumbnail:b,linkHref:x,containerProps:y,shouldUseImgProxyCrop:v,colors:C,...w},S)=>{C&&e&&(e=(0,o.recolorImageUrl)(e,C));let k=(0,r.useShouldUsePublishedVersion)(),A=d?.frame_count&&d.frame_count>1,E=u||!e||A?e:(0,o.resizeAndProxyImageUrl)(e,b?{height:400}:{width:2e3},d),_=g||d?.width||1,I=g&&f?g/f:d?.height||1,{scaleCrop:M,scaleY:T,clipPathCSSString:L,translateX:j,translateY:P,aspectRatio:D,referenceXOffset:N,referenceYOffset:R}=(0,m.getCustomClipData)(l,_,I,f||(d?.width&&d?.height?d.width/d.height:1))||{},O=!c&&(0,m.isValidClipPath)(l?.clipPath),B=`${O?D:""}`,z=c?"":`scale(${M}) translate(-${j}%, -${P}%)`,F=(0,o.isSVGUrl)(e||a),H=(0,o.isMp4Url)(e||a),W=(({w:e,h:t,clipPath:i,clipType:n,src:a})=>{let r,s,l,d,c;if(!(0,m.isValidClipPath)(i)||!n||!a)return null;if("inset"===n){let e=.01*parseFloat(i[0]),t=.01*parseFloat(i[1]),n=.01*parseFloat(i[2]),a=.01*parseFloat(i[3]);r=a+t===0?0:1-(a+t),s=e+n===0?0:1-(e+n),l=a,d=e}else{var u;u=parseFloat(i[0]),s=r=u/100*(Math.sqrt(e*e+t*t)/Math.sqrt(2))*2;let n=r/2;l=(.01*parseFloat(i[2])-n/e)*e,d=(.01*parseFloat(i[3])-n/t)*t,c=!0}return{url:(0,o.resizeAndProxyImageUrl)(a,(({crop:{cropWidth:e,cropHeight:t},gravity:{xOffset:i,yOffset:n}})=>({crop:`${e}:${t}:nowe:${i}:${n}`,resizing_type:"auto"}))({crop:{cropWidth:r,cropHeight:s},gravity:{xOffset:l,yOffset:d}})),isCircle:c}})({w:_,h:I,clipPath:l?.clipPath,clipType:l?.clipType,src:e});return(0,t.jsx)(h,{link:x,w:u?void 0:"100%",children:(0,t.jsx)(i.Box,{css:{aspectRatio:B},className:"image cropped-image","data-content-reference":`${N},${R}`,"data-export-link":x,"data-drag-preview":!0,"data-scale-preview":!0,maxH:"var(--media-maxH)",maxW:"var(--media-maxW)",overflow:"hidden",w:u?void 0:"100%",h:"cover"==p?"100%":void 0,sx:{"@media print":{height:"unset"}},...y,children:H?(0,t.jsx)(o.Mp4Video,{src:e||a||void 0,poster:d?.poster,objectFit:p,maxH:`calc(var(--media-maxH) * ${T||1})`,minH:"cover"==p?`calc(var(--media-maxH) / ${M||1})`:void 0,...w}):v&&W?.url?(0,t.jsx)(n.Image,{alt:"",objectFit:p,maxH:`calc(var(--media-maxH) * ${T||1})`,minH:"cover"==p?`calc(var(--media-maxH) / ${M||1})`:void 0,ref:S,...e||a?{}:s.mediaPlaceholderStyleProps,src:W?.url||E||a||void 0,...w}):(0,t.jsx)(n.Image,{alt:"",objectFit:p,maxH:`calc(var(--media-maxH) * ${T||1})`,minH:"cover"==p?`calc(var(--media-maxH) / ${M||1})`:void 0,transformOrigin:"left top",clipPath:c?"":L,ignoreFallback:u||k,transform:z,src:E||a||void 0,fallbackSrc:a||void 0,ref:S,w:F?"100%":void 0,...e||a?{}:s.mediaPlaceholderStyleProps,...w})})})});g.displayName="CroppedImage",e.s(["CroppedImage",0,g],59936)},495433,e=>{"use strict";e.s(["ImageZoomOverlay",()=>s]);var t=e.i(391398),i=e.i(160396);e.i(297036);var n=e.i(534316),a=e.i(753128),r=e.i(59936),o=e.i(313399);let s=({id:e,node:s,editor:l,decorations:d,enabled:c})=>{let{isZoomed:u,exitZoom:p}=(0,n.useMediaZoom)(e),{colors:h,cardColor:m}=(0,o.useRecoloredImage)({src:s.attrs.src,tempUrl:s.attrs.tempUrl,decorations:d}),g=(0,i.isSVGUrl)(s.attrs.src||s.attrs.tempUrl);return c?(0,t.jsx)(a.ZoomableOverlay,{isZoomed:u,exitZoom:p,editor:l,children:(0,t.jsx)(r.CroppedImage,{imageAttrs:s.attrs,backgroundColor:m,colors:h,w:g?"80vw":void 0,isZoomed:!0})}):null}},210956,e=>{"use strict";e.s(["useCroppingControls",()=>r]);var t=e.i(191788),i=e.i(418755);e.i(419217);var n=e.i(753748),a=e.i(316353);let r=e=>{let r=(0,i.useAppDispatch)(),o=(0,t.useCallback)(({clipType:e})=>{e&&r((0,n.setClipType)({clipType:e}))},[r]),s=(0,t.useCallback)(({id:t})=>{a.eventEmitter.emit("endClip",{id:t,confirm:!1}),r((0,n.endCropping)()),e.commands.resetImageClip()},[r,e]),l=(0,t.useCallback)(({id:e})=>{a.eventEmitter.emit("endClip",{id:e,confirm:!1}),r((0,n.endCropping)())},[r]),d=(0,t.useCallback)(({id:e})=>{a.eventEmitter.emit("endClip",{id:e,confirm:!0}),r((0,n.endCropping)())},[r]);return{cancelCrop:l,startCrop:(0,t.useCallback)(({id:e,clipType:t})=>{r((0,n.startCropping)({id:e,clipType:t})),a.eventEmitter.emit("startCrop",{id:e})},[r]),confirmCrop:d,resetCrop:s,setCropClipType:o}}},502585,e=>{"use strict";e.s(["useGallerySizing",()=>n]);var t=e.i(191788),i=e.i(15272);let n=({nodeViewProps:e,inGallery:n,inGridGallery:a,inLogoGallery:r,isSvg:o,isAnimatedGif:s})=>({sizingAttrs:(0,t.useMemo)(()=>{if(!r)return{};let t=(0,i.getGalleryThumbHeight)(e),n=(0,i.getGalleryThumbSpacing)(e);return{height:(0,i.getGalleryLogoThumbHeightValue)(t,n),padding:`${n/2}em ${n}em`}},[r,e]),shouldContainImage:n,shouldUseImgProxyCrop:a&&!s&&!o})},216518,(e,t,i)=>{"use strict";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s={},l={SYMBOL_FOR_REQ_CONTEXT:()=>c,getContext:()=>u};for(var d in l)n(s,d,{get:l[d],enumerable:!0});t.exports=((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of r(t))o.call(e,l)||l===i||n(e,l,{get:()=>t[l],enumerable:!(s=a(t,l))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);let c=Symbol.for("@vercel/request-context");function u(){let e=globalThis;return e[c]?.get?.()??{}}},52897,(e,t,i)=>{"use strict";var n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,s={},l={getContext:()=>c.getContext,getVercelOidcToken:()=>u,getVercelOidcTokenSync:()=>p};for(var d in l)n(s,d,{get:l[d],enumerable:!0});t.exports=((e,t,i,s)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let l of r(t))o.call(e,l)||l===i||n(e,l,{get:()=>t[l],enumerable:!(s=a(t,l))||s.enumerable});return e})(n({},"__esModule",{value:!0}),s);var c=e.r(216518);async function u(){return""}function p(){return""}},357454,802448,212206,605233,789719,171084,996324,986271,237060,713677,985050,166549,31397,816390,865208,127050,836465,366273,703136,303254,702692,943946,273845,179658,613110,891892,477245,902349,359603,905859,317870,364450,370379,741783,271047,276137,700652,579359,472413,737504,594226,762721,927509,e=>{"use strict";let t,i,n,a;var r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A,E,_,I,M,T,L,j,P,D,N,R,O,B,z,F=e.i(350461),H=e.i(221168),W="vercel.ai.error",U=Symbol.for(W),V=class e extends(l=Error,s=U,l){constructor({name:e,message:t,cause:i}){super(t),this[s]=!0,this.name=e,this.cause=i}static isInstance(t){return e.hasMarker(t,W)}static hasMarker(e,t){let i=Symbol.for(t);return null!=e&&"object"==typeof e&&i in e&&"boolean"==typeof e[i]&&!0===e[i]}},G="AI_APICallError",$=`vercel.ai.error.${G}`,Z=Symbol.for($),K=class extends(c=V,d=Z,c){constructor({message:e,url:t,requestBodyValues:i,statusCode:n,responseHeaders:a,responseBody:r,cause:o,isRetryable:s=null!=n&&(408===n||409===n||429===n||n>=500),data:l}){super({name:G,message:e,cause:o}),this[d]=!0,this.url=t,this.requestBodyValues=i,this.statusCode=n,this.responseHeaders=a,this.responseBody=r,this.isRetryable=s,this.data=l}static isInstance(e){return V.hasMarker(e,$)}},q="AI_EmptyResponseBodyError",Y=`vercel.ai.error.${q}`,X=Symbol.for(Y),Q=class extends(p=V,u=X,p){constructor({message:e="Empty response body"}={}){super({name:q,message:e}),this[u]=!0}static isInstance(e){return V.hasMarker(e,Y)}};function J(e){return null==e?"unknown error":"string"==typeof e?e:e instanceof Error?e.message:JSON.stringify(e)}var ee="AI_InvalidArgumentError",et=`vercel.ai.error.${ee}`,ei=Symbol.for(et),en=class extends(m=V,h=ei,m){constructor({message:e,cause:t,argument:i}){super({name:ee,message:e,cause:t}),this[h]=!0,this.argument=i}static isInstance(e){return V.hasMarker(e,et)}},ea=Symbol.for("vercel.ai.error.AI_InvalidPromptError");Symbol.for("vercel.ai.error.AI_InvalidResponseDataError");var er="AI_JSONParseError",eo=`vercel.ai.error.${er}`,es=Symbol.for(eo),el=class extends(f=V,g=es,f){constructor({text:e,cause:t}){super({name:er,message:`JSON parsing failed: Text: ${e}. Error message: ${J(t)}`,cause:t}),this[g]=!0,this.text=e}static isInstance(e){return V.hasMarker(e,eo)}},ed=Symbol.for("vercel.ai.error.AI_LoadAPIKeyError");Symbol.for("vercel.ai.error.AI_LoadSettingError");Symbol.for("vercel.ai.error.AI_NoContentGeneratedError");Symbol.for("vercel.ai.error.AI_NoSuchModelError");Symbol.for("vercel.ai.error.AI_TooManyEmbeddingValuesForCallError");var ec="AI_TypeValidationError",eu=`vercel.ai.error.${ec}`,ep=Symbol.for(eu),eh=class e extends(x=V,b=ep,x){constructor({value:e,cause:t,context:i}){let n="Type validation failed";if((null==i?void 0:i.field)&&(n+=` for ${i.field}`),(null==i?void 0:i.entityName)||(null==i?void 0:i.entityId)){n+=" (";const e=[];i.entityName&&e.push(i.entityName),i.entityId&&e.push(`id: "${i.entityId}"`),n+=e.join(", "),n+=")"}super({name:ec,message:`${n}: Value: ${JSON.stringify(e)}. Error message: ${J(t)}`,cause:t}),this[b]=!0,this.value=e,this.context=i}static isInstance(e){return V.hasMarker(e,eu)}static wrap({value:t,cause:i,context:n}){var a,r,o;return e.isInstance(i)&&i.value===t&&(null==(a=i.context)?void 0:a.field)===(null==n?void 0:n.field)&&(null==(r=i.context)?void 0:r.entityName)===(null==n?void 0:n.entityName)&&(null==(o=i.context)?void 0:o.entityId)===(null==n?void 0:n.entityId)?i:new e({value:t,cause:i,context:n})}},em=Symbol.for("vercel.ai.error.AI_UnsupportedFunctionalityError");let eg=Object.freeze({status:"aborted"});function ef(e,t,i){function n(i,n){var a;for(let r in Object.defineProperty(i,"_zod",{value:i._zod??{},enumerable:!1}),(a=i._zod).traits??(a.traits=new Set),i._zod.traits.add(e),t(i,n),o.prototype)r in i||Object.defineProperty(i,r,{value:o.prototype[r].bind(i)});i._zod.constr=o,i._zod.def=n}let a=i?.Parent??Object;class r extends a{}function o(e){var t;let a=i?.Parent?new r:this;for(let i of(n(a,e),(t=a._zod).deferred??(t.deferred=[]),a._zod.deferred))i();return a}return Object.defineProperty(r,"name",{value:e}),Object.defineProperty(o,"init",{value:n}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>!!i?.Parent&&t instanceof i.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}let eb=Symbol("zod_brand");class ex extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}let ey={};function ev(e){return e&&Object.assign(ey,e),ey}function eC(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,i])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function ew(e,t="|"){return e.map(e=>eF(e)).join(t)}function eS(e,t){return"bigint"==typeof t?t.toString():t}function ek(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function eA(e){return null==e}function eE(e){let t=+!!e.startsWith("^"),i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function e_(e,t){let i=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=i>n?i:n;return Number.parseInt(e.toFixed(a).replace(".",""))%Number.parseInt(t.toFixed(a).replace(".",""))/10**a}function eI(e,t,i){Object.defineProperty(e,t,{get(){{let n=i();return e[t]=n,n}},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function eM(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function eT(e){return JSON.stringify(e)}e.s(["$ZodAsyncError",0,ex,"$brand",0,eb,"$constructor",0,ef,"NEVER",0,eg,"config",0,ev,"globalConfig",0,ey],616696);let eL=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ej(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let eP=ek(()=>{if("u">typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function eD(e){if(!1===ej(e))return!1;let t=e.constructor;if(void 0===t)return!0;let i=t.prototype;return!1!==ej(i)&&!1!==Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")}let eN=new Set(["string","number","symbol"]),eR=new Set(["string","number","bigint","boolean","symbol","undefined"]);function eO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eB(e,t,i){let n=new e._zod.constr(t??e._zod.def);return(!t||i?.parent)&&(n._zod.parent=e),n}function ez(e){if(!e)return{};if("string"==typeof e)return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");e.error=e.message}return(delete e.message,"string"==typeof e.error)?{...e,error:()=>e.error}:e}function eF(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function eH(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let eW={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},eU={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function eV(e,t=0){for(let i=t;i(t.path??(t.path=[]),t.path.unshift(e),t))}function e$(e){return"string"==typeof e?e:e?.message}function eZ(e,t,i){let n={...e,path:e.path??[]};return e.message||(n.message=e$(e.inst?._zod.def?.error?.(e))??e$(t?.error?.(e))??e$(i.customError?.(e))??e$(i.localeError?.(e))??"Invalid input"),delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function eK(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function eq(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function eY(...e){let[t,i,n]=e;return"string"==typeof t?{message:t,code:"custom",input:i,inst:n}:{...t}}e.s(["BIGINT_FORMAT_RANGES",0,eU,"Class",0,class{constructor(...e){}},"NUMBER_FORMAT_RANGES",0,eW,"aborted",0,eV,"allowsEval",0,eP,"assert",0,function(e){},"assertEqual",0,function(e){return e},"assertIs",0,function(e){},"assertNever",0,function(e){throw Error()},"assertNotEqual",0,function(e){return e},"assignProp",0,eM,"cached",0,ek,"captureStackTrace",0,eL,"cleanEnum",0,function(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])},"cleanRegex",0,eE,"clone",0,eB,"createTransparentProxy",0,function(e){let t;return new Proxy({},{get:(i,n,a)=>(t??(t=e()),Reflect.get(t,n,a)),set:(i,n,a,r)=>(t??(t=e()),Reflect.set(t,n,a,r)),has:(i,n)=>(t??(t=e()),Reflect.has(t,n)),deleteProperty:(i,n)=>(t??(t=e()),Reflect.deleteProperty(t,n)),ownKeys:i=>(t??(t=e()),Reflect.ownKeys(t)),getOwnPropertyDescriptor:(i,n)=>(t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)),defineProperty:(i,n,a)=>(t??(t=e()),Reflect.defineProperty(t,n,a))})},"defineLazy",0,eI,"esc",0,eT,"escapeRegex",0,eO,"extend",0,function(e,t){if(!eD(t))throw Error("Invalid input to extend: expected a plain object");let i={...e._zod.def,get shape(){let i={...e._zod.def.shape,...t};return eM(this,"shape",i),i},checks:[]};return eB(e,i)},"finalizeIssue",0,eZ,"floatSafeRemainder",0,e_,"getElementAtPath",0,function(e,t){return t?t.reduce((e,t)=>e?.[t],e):e},"getEnumValues",0,eC,"getLengthableOrigin",0,eq,"getParsedType",0,e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return"promise";if("u">typeof Map&&e instanceof Map)return"map";if("u">typeof Set&&e instanceof Set)return"set";if("u">typeof Date&&e instanceof Date)return"date";if("u">typeof File&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},"getSizableOrigin",0,eK,"isObject",0,ej,"isPlainObject",0,eD,"issue",0,eY,"joinValues",0,ew,"jsonStringifyReplacer",0,eS,"merge",0,function(e,t){return eB(e,{...e._zod.def,get shape(){let i={...e._zod.def.shape,...t._zod.def.shape};return eM(this,"shape",i),i},catchall:t._zod.def.catchall,checks:[]})},"normalizeParams",0,ez,"nullish",0,eA,"numKeys",0,function(e){let t=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&t++;return t},"omit",0,function(e,t){let i={...e._zod.def.shape},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return eB(e,{...e._zod.def,shape:i,checks:[]})},"optionalKeys",0,eH,"partial",0,function(e,t,i){let n=t._zod.def.shape,a={...n};if(i)for(let t in i){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);i[t]&&(a[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)a[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return eB(t,{...t._zod.def,shape:a,checks:[]})},"pick",0,function(e,t){let i={},n=e._zod.def;for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(i[e]=n.shape[e])}return eB(e,{...e._zod.def,shape:i,checks:[]})},"prefixIssues",0,eG,"primitiveTypes",0,eR,"promiseAllObject",0,function(e){let t=Object.keys(e);return Promise.all(t.map(t=>e[t])).then(e=>{let i={};for(let n=0;n{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get:()=>JSON.stringify(t,eS,2),enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},eQ=ef("$ZodError",eX),eJ=ef("$ZodError",eX,{Parent:Error});function e0(e,t=e=>e.message){let i={},n=[];for(let a of e.issues)a.path.length>0?(i[a.path[0]]=i[a.path[0]]||[],i[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:i}}function e1(e,t){let i=t||function(e){return e.message},n={_errors:[]},a=e=>{for(let t of e.issues)if("invalid_union"===t.code&&t.errors.length)t.errors.map(e=>a({issues:e}));else if("invalid_key"===t.code)a({issues:t.issues});else if("invalid_element"===t.code)a({issues:t.issues});else if(0===t.path.length)n._errors.push(i(t));else{let e=n,a=0;for(;a{var r,o;for(let s of e.issues)if("invalid_union"===s.code&&s.errors.length)s.errors.map(e=>a({issues:e},s.path));else if("invalid_key"===s.code)a({issues:s.issues},s.path);else if("invalid_element"===s.code)a({issues:s.issues},s.path);else{let e=[...t,...s.path];if(0===e.length){n.errors.push(i(s));continue}let a=n,l=0;for(;le.path.length-t.path.length))t.push(`✖ ${i.message}`),i.path?.length&&t.push(` → at ${e3(i.path)}`);return t.join("\n")}e.s(["$ZodError",0,eQ,"$ZodRealError",0,eJ,"flattenError",0,e0,"formatError",0,e1,"prettifyError",0,e5,"toDotPath",0,e3,"treeifyError",0,e2],936582);let e4=e=>(t,i,n,a)=>{let r=n?Object.assign(n,{async:!1}):{async:!1},o=t._zod.run({value:i,issues:[]},r);if(o instanceof Promise)throw new ex;if(o.issues.length){let t=new(a?.Err??e)(o.issues.map(e=>eZ(e,r,ev())));throw eL(t,a?.callee),t}return o.value},e6=e4(eJ),e9=e=>async(t,i,n,a)=>{let r=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:i,issues:[]},r);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(a?.Err??e)(o.issues.map(e=>eZ(e,r,ev())));throw eL(t,a?.callee),t}return o.value},e8=e9(eJ),e7=e=>(t,i,n)=>{let a=n?{...n,async:!1}:{async:!1},r=t._zod.run({value:i,issues:[]},a);if(r instanceof Promise)throw new ex;return r.issues.length?{success:!1,error:new(e??eQ)(r.issues.map(e=>eZ(e,a,ev())))}:{success:!0,data:r.value}},te=e7(eJ),tt=e=>async(t,i,n)=>{let a=n?Object.assign(n,{async:!0}):{async:!0},r=t._zod.run({value:i,issues:[]},a);return r instanceof Promise&&(r=await r),r.issues.length?{success:!1,error:new e(r.issues.map(e=>eZ(e,a,ev())))}:{success:!0,data:r.value}},ti=tt(eJ);e.s(["_parse",0,e4,"_parseAsync",0,e9,"_safeParse",0,e7,"_safeParseAsync",0,tt,"parse",0,e6,"parseAsync",0,e8,"safeParse",0,te,"safeParseAsync",0,ti],735571);let tn=(e,t)=>{eQ.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>e1(e,t)},flatten:{value:t=>e0(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get:()=>0===e.issues.length}})},ta=ef("ZodError",tn),tr=ef("ZodError",tn,{Parent:Error});e.s(["ZodError",0,ta,"ZodRealError",0,tr],854264);let to=e4(tr),ts=e9(tr),tl=e7(tr),td=tt(tr);e.s(["parse",0,to,"parseAsync",0,ts,"safeParse",0,tl,"safeParseAsync",0,td],684029);let tc=Symbol("ZodOutput"),tu=Symbol("ZodInput");class tp{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let i=t[0];if(this._map.set(e,i),i&&"object"==typeof i&&"id"in i){if(this._idmap.has(i.id))throw Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let i={...this.get(t)??{}};return delete i.id,{...i,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}}function th(){return new tp}let tm=th();e.s(["$ZodRegistry",0,tp,"$input",0,tu,"$output",0,tc,"globalRegistry",0,tm,"registry",0,th],268808);class tg{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??tm,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,t={path:[],schemaPath:[]}){var i;let n=e._zod.def,a=this.seen.get(e);if(a)return a.count++,t.schemaPath.includes(e)&&(a.cycle=t.path),a.schema;let r={schema:{},count:1,cycle:void 0,path:t.path};this.seen.set(e,r);let o=e._zod.toJSONSchema?.();if(o)r.schema=o;else{let i={...t,schemaPath:[...t.schemaPath,e],path:t.path},a=e._zod.parent;if(a)r.ref=a,this.process(a,i),this.seen.get(a).isParent=!0;else{let t=r.schema;switch(n.type){case"string":{t.type="string";let{minimum:i,maximum:n,format:a,patterns:o,contentEncoding:s}=e._zod.bag;if("number"==typeof i&&(t.minLength=i),"number"==typeof n&&(t.maxLength=n),a&&(t.format=({guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""})[a]??a,""===t.format&&delete t.format),s&&(t.contentEncoding=s),o&&o.size>0){let e=[...o];1===e.length?t.pattern=e[0].source:e.length>1&&(r.schema.allOf=[...e.map(e=>({..."draft-7"===this.target?{type:"string"}:{},pattern:e.source}))])}break}case"number":{let{minimum:i,maximum:n,format:a,multipleOf:r,exclusiveMaximum:o,exclusiveMinimum:s}=e._zod.bag;"string"==typeof a&&a.includes("int")?t.type="integer":t.type="number","number"==typeof s&&(t.exclusiveMinimum=s),"number"==typeof i&&(t.minimum=i,"number"==typeof s&&(s>=i?delete t.minimum:delete t.exclusiveMinimum)),"number"==typeof o&&(t.exclusiveMaximum=o),"number"==typeof n&&(t.maximum=n,"number"==typeof o&&(o<=n?delete t.maximum:delete t.exclusiveMaximum)),"number"==typeof r&&(t.multipleOf=r);break}case"boolean":case"success":t.type="boolean";break;case"bigint":if("throw"===this.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema");break;case"symbol":if("throw"===this.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema");break;case"null":t.type="null";break;case"any":case"unknown":break;case"undefined":if("throw"===this.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema");break;case"void":if("throw"===this.unrepresentable)throw Error("Void cannot be represented in JSON Schema");break;case"never":t.not={};break;case"date":if("throw"===this.unrepresentable)throw Error("Date cannot be represented in JSON Schema");break;case"array":{let{minimum:a,maximum:r}=e._zod.bag;"number"==typeof a&&(t.minItems=a),"number"==typeof r&&(t.maxItems=r),t.type="array",t.items=this.process(n.element,{...i,path:[...i.path,"items"]});break}case"object":{t.type="object",t.properties={};let e=n.shape;for(let n in e)t.properties[n]=this.process(e[n],{...i,path:[...i.path,"properties",n]});let a=new Set([...new Set(Object.keys(e))].filter(e=>{let t=n.shape[e]._zod;return"input"===this.io?void 0===t.optin:void 0===t.optout}));a.size>0&&(t.required=Array.from(a)),n.catchall?._zod.def.type==="never"?t.additionalProperties=!1:n.catchall?n.catchall&&(t.additionalProperties=this.process(n.catchall,{...i,path:[...i.path,"additionalProperties"]})):"output"===this.io&&(t.additionalProperties=!1);break}case"union":t.anyOf=n.options.map((e,t)=>this.process(e,{...i,path:[...i.path,"anyOf",t]}));break;case"intersection":{let e=this.process(n.left,{...i,path:[...i.path,"allOf",0]}),a=this.process(n.right,{...i,path:[...i.path,"allOf",1]}),r=e=>"allOf"in e&&1===Object.keys(e).length;t.allOf=[...r(e)?e.allOf:[e],...r(a)?a.allOf:[a]];break}case"tuple":{t.type="array";let a=n.items.map((e,t)=>this.process(e,{...i,path:[...i.path,"prefixItems",t]}));if("draft-2020-12"===this.target?t.prefixItems=a:t.items=a,n.rest){let e=this.process(n.rest,{...i,path:[...i.path,"items"]});"draft-2020-12"===this.target?t.items=e:t.additionalItems=e}n.rest&&(t.items=this.process(n.rest,{...i,path:[...i.path,"items"]}));let{minimum:r,maximum:o}=e._zod.bag;"number"==typeof r&&(t.minItems=r),"number"==typeof o&&(t.maxItems=o);break}case"record":t.type="object",t.propertyNames=this.process(n.keyType,{...i,path:[...i.path,"propertyNames"]}),t.additionalProperties=this.process(n.valueType,{...i,path:[...i.path,"additionalProperties"]});break;case"map":if("throw"===this.unrepresentable)throw Error("Map cannot be represented in JSON Schema");break;case"set":if("throw"===this.unrepresentable)throw Error("Set cannot be represented in JSON Schema");break;case"enum":{let e=eC(n.entries);e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),t.enum=e;break}case"literal":{let e=[];for(let t of n.values)if(void 0===t){if("throw"===this.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof t)if("throw"===this.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");else e.push(Number(t));else e.push(t);if(0===e.length);else if(1===e.length){let i=e[0];t.type=null===i?"null":typeof i,t.const=i}else e.every(e=>"number"==typeof e)&&(t.type="number"),e.every(e=>"string"==typeof e)&&(t.type="string"),e.every(e=>"boolean"==typeof e)&&(t.type="string"),e.every(e=>null===e)&&(t.type="null"),t.enum=e;break}case"file":{let i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:n,maximum:a,mime:r}=e._zod.bag;void 0!==n&&(i.minLength=n),void 0!==a&&(i.maxLength=a),r?1===r.length?(i.contentMediaType=r[0],Object.assign(t,i)):t.anyOf=r.map(e=>({...i,contentMediaType:e})):Object.assign(t,i);break}case"transform":if("throw"===this.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema");break;case"nullable":t.anyOf=[this.process(n.innerType,i),{type:"null"}];break;case"nonoptional":case"promise":case"optional":this.process(n.innerType,i),r.ref=n.innerType;break;case"default":this.process(n.innerType,i),r.ref=n.innerType,t.default=JSON.parse(JSON.stringify(n.defaultValue));break;case"prefault":this.process(n.innerType,i),r.ref=n.innerType,"input"===this.io&&(t._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break;case"catch":{let e;this.process(n.innerType,i),r.ref=n.innerType;try{e=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}t.default=e;break}case"nan":if("throw"===this.unrepresentable)throw Error("NaN cannot be represented in JSON Schema");break;case"template_literal":{let i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");t.type="string",t.pattern=i.source;break}case"pipe":{let e="input"===this.io?"transform"===n.in._zod.def.type?n.out:n.in:n.out;this.process(e,i),r.ref=e;break}case"readonly":this.process(n.innerType,i),r.ref=n.innerType,t.readOnly=!0;break;case"lazy":{let t=e._zod.innerType;this.process(t,i),r.ref=t;break}case"custom":if("throw"===this.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")}}}let s=this.metadataRegistry.get(e);return s&&Object.assign(r.schema,s),"input"===this.io&&function e(t,i){let n=i??{seen:new Set};if(n.seen.has(t))return!1;n.seen.add(t);let a=t._zod.def;switch(a.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":case"custom":case"success":case"catch":return!1;case"array":return e(a.element,n);case"object":for(let t in a.shape)if(e(a.shape[t],n))return!0;return!1;case"union":for(let t of a.options)if(e(t,n))return!0;return!1;case"intersection":return e(a.left,n)||e(a.right,n);case"tuple":for(let t of a.items)if(e(t,n))return!0;if(a.rest&&e(a.rest,n))return!0;return!1;case"record":case"map":return e(a.keyType,n)||e(a.valueType,n);case"set":return e(a.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":case"default":case"prefault":return e(a.innerType,n);case"lazy":return e(a.getter(),n);case"transform":return!0;case"pipe":return e(a.in,n)||e(a.out,n)}throw Error(`Unknown schema type: ${a.type}`)}(e)&&(delete r.schema.examples,delete r.schema.default),"input"===this.io&&r.schema._prefault&&((i=r.schema).default??(i.default=r.schema._prefault)),delete r.schema._prefault,this.seen.get(e).schema}emit(e,t){let i={cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0},n=this.seen.get(e);if(!n)throw Error("Unprocessed schema. This is a bug in Zod.");let a=e=>{let t="draft-2020-12"===this.target?"$defs":"definitions";if(i.external){let n=i.external.registry.get(e[0])?.id,a=i.external.uri??(e=>e);if(n)return{ref:a(n)};let r=e[1].defId??e[1].schema.id??`schema${this.counter++}`;return e[1].defId=r,{defId:r,ref:`${a("__shared")}#/${t}/${r}`}}if(e[1]===n)return{ref:"#"};let a=`#/${t}/`,r=e[1].schema.id??`__schema${this.counter++}`;return{defId:r,ref:a+r}},r=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:i,defId:n}=a(e);t.def={...t.schema},n&&(t.defId=n);let r=t.schema;for(let e in r)delete r[e];r.$ref=i};if("throw"===i.cycles)for(let e of this.seen.entries()){let t=e[1];if(t.cycle)throw Error(`Cycle detected: #/${t.cycle?.join("/")}/ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let t of this.seen.entries()){let n=t[1];if(e===t[0]){r(t);continue}if(i.external){let n=i.external.registry.get(t[0])?.id;if(e!==t[0]&&n){r(t);continue}}if(this.metadataRegistry.get(t[0])?.id||n.cycle||n.count>1&&"ref"===i.reused){r(t);continue}}let o=(e,t)=>{let i=this.seen.get(e),n=i.def??i.schema,a={...n};if(null===i.ref)return;let r=i.ref;if(i.ref=null,r){o(r,t);let e=this.seen.get(r).schema;e.$ref&&"draft-7"===t.target?(n.allOf=n.allOf??[],n.allOf.push(e)):(Object.assign(n,e),Object.assign(n,a))}i.isParent||this.override({zodSchema:e,jsonSchema:n,path:i.path??[]})};for(let e of[...this.seen.entries()].reverse())o(e[0],{target:this.target});let s={};if("draft-2020-12"===this.target?s.$schema="https://json-schema.org/draft/2020-12/schema":"draft-7"===this.target?s.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),i.external?.uri){let t=i.external.registry.get(e)?.id;if(!t)throw Error("Schema is missing an `id` property");s.$id=i.external.uri(t)}Object.assign(s,n.def);let l=i.external?.defs??{};for(let e of this.seen.entries()){let t=e[1];t.def&&t.defId&&(l[t.defId]=t.def)}i.external||Object.keys(l).length>0&&("draft-2020-12"===this.target?s.$defs=l:s.definitions=l);try{return JSON.parse(JSON.stringify(s))}catch(e){throw Error("Error converting schema to JSON.")}}}function tf(e,t){if(e instanceof tp){let i=new tg(t),n={};for(let t of e._idmap.entries()){let[e,n]=t;i.process(n)}let a={},r={registry:e,uri:t?.uri,defs:n};for(let n of e._idmap.entries()){let[e,o]=n;a[e]=i.emit(o,{...t,external:r})}return Object.keys(n).length>0&&(a.__shared={["draft-2020-12"===i.target?"$defs":"definitions"]:n}),{schemas:a}}let i=new tg(t);return i.process(e),i.emit(e,t)}e.s(["JSONSchemaGenerator",0,tg,"toJSONSchema",0,tf],87434);var tb=e.i(710378);class tx extends Error{constructor(e,t){super(e),this.name="ParseError",this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}}function ty(e){}class tv extends TransformStream{constructor({onError:e,onRetry:t,onComment:i}={}){let n;super({start(a){n=function(e){if("function"==typeof e)throw TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:t=ty,onError:i=ty,onRetry:n=ty,onComment:a}=e,r="",o=!0,s,l="",d="";function c(e){if(""===e)return void(l.length>0&&t({id:s,event:d||void 0,data:l.endsWith(` `)?l.slice(0,-1):l}),s=void 0,l="",d="");if(e.startsWith(":")){a&&a(e.slice(e.startsWith(": ")?2:1));return}let i=e.indexOf(":");if(-1!==i){let t=e.slice(0,i),n=" "===e[i+1]?2:1;u(t,e.slice(i+n),e);return}u(e,"",e)}function u(e,t,a){switch(e){case"event":d=t;break;case"data":l=`${l}${t} `;break;case"id":s=t.includes("\0")?void 0:t;break;case"retry":/^\d+$/.test(t)?n(parseInt(t,10)):i(new tx(`Invalid \`retry\` value: "${t}"`,{type:"invalid-retry",value:t,line:a}));break;default:i(new tx(`Unknown field "${e.length>20?`${e.slice(0,20)}\u2026`:e}"`,{type:"unknown-field",field:e,value:t,line:a}))}}return{feed:function(e){let t=o?e.replace(/^\xEF\xBB\xBF/,""):e,[i,n]=function(e){let t=[],i="",n=0;for(;n{a.enqueue(e)},onError(t){"terminate"===e?a.error(t):"function"==typeof e&&e(t)},onRetry:t,onComment:i})},transform(e){n.feed(e)}})}}function tC(...e){return e.reduce((e,t)=>({...e,...null!=t?t:{}}),{})}function tw(e){return Object.fromEntries([...e.headers])}var{btoa:tS,atob:tk}=globalThis;function tA(e){let t="";for(let i=0;ii)throw new tM({url:t,message:`Download of ${t} exceeded maximum size of ${i} bytes (Content-Length: ${e}).`})}let a=e.body;if(null==a)return new Uint8Array(0);let r=a.getReader(),o=[],s=0;try{for(;;){let{done:e,value:n}=await r.read();if(e)break;if((s+=n.length)>i)throw new tM({url:t,message:`Download of ${t} exceeded maximum size of ${i} bytes.`});o.push(n)}}finally{try{await r.cancel()}finally{r.releaseLock()}}let l=new Uint8Array(s),d=0;for(let e of o)l.set(e,d),d+=e.length;return l}var tL=({prefix:e,size:t=16,alphabet:i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{let a=()=>{let e=i.length,n=Array(t);for(let a=0;a`${e}${n}${a()}`};function tj(e){return(e instanceof Error||e instanceof DOMException)&&("AbortError"===e.name||"ResponseAborted"===e.name||"TimeoutError"===e.name)}tL();var tP=["fetch failed","failed to fetch"],tD=["ConnectionRefused","ConnectionClosed","FailedToOpenSocket","ECONNRESET","ECONNREFUSED","ETIMEDOUT","EPIPE"];function tN({error:e,url:t,requestBodyValues:i}){if(tj(e))return e;if(e instanceof TypeError&&tP.includes(e.message.toLowerCase())){let n=e.cause;if(null!=n)return new K({message:`Cannot connect to API: ${n.message}`,cause:n,url:t,requestBodyValues:i,isRetryable:!0})}return!function(e){if(!(e instanceof Error))return!1;let t=e.code;return!!("string"==typeof t&&tD.includes(t))}(e)?e:new K({message:`Cannot connect to API: ${e.message}`,cause:e,url:t,requestBodyValues:i,isRetryable:!0})}function tR(e=globalThis){var t,i,n;return e.window?"runtime/browser":(null==(t=e.navigator)?void 0:t.userAgent)?`runtime/${e.navigator.userAgent.toLowerCase()}`:(null==(n=null==(i=e.process)?void 0:i.versions)?void 0:n.node)?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function tO(e,...t){let i=new Headers(function(e){if(null==e)return{};let t={};if(e instanceof Headers)e.forEach((e,i)=>{t[i.toLowerCase()]=e});else for(let[i,n]of(Array.isArray(e)||(e=Object.entries(e)),e))null!=n&&(t[i.toLowerCase()]=n);return t}(e)),n=i.get("user-agent")||"";return i.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(i.entries())}var tB="4.0.15",tz=()=>globalThis.fetch,tF=async({url:e,headers:t={},successfulResponseHandler:i,failedResponseHandler:n,abortSignal:a,fetch:r=tz()})=>{try{let o=await r(e,{method:"GET",headers:tO(t,`ai-sdk/provider-utils/${tB}`,tR()),signal:a}),s=tw(o);if(!o.ok){let t;try{t=await n({response:o,url:e,requestBodyValues:{}})}catch(t){if(tj(t)||K.isInstance(t))throw t;throw new K({message:"Failed to process error response",cause:t,statusCode:o.status,url:e,responseHeaders:s,requestBodyValues:{}})}throw t.value}try{return await i({response:o,url:e,requestBodyValues:{}})}catch(t){if(t instanceof Error&&(tj(t)||K.isInstance(t)))throw t;throw new K({message:"Failed to process successful response",cause:t,statusCode:o.status,url:e,responseHeaders:s,requestBodyValues:{}})}}catch(t){throw tN({error:t,url:e,requestBodyValues:{}})}};function tH({settingValue:e,environmentVariableName:t}){return"string"==typeof e?e:null!=e||void 0===F.default?void 0:null!=(e=F.default.env[t])&&"string"==typeof e?e:void 0}var tW=/"__proto__"\s*:/,tU=/"constructor"\s*:/;function tV(e){let t=JSON.parse(e);return null===t||"object"!=typeof t||!1===tW.test(e)&&!1===tU.test(e)?t:function(e){let t=[e];for(;t.length;){let e=t;for(let i of(t=[],e)){if(Object.prototype.hasOwnProperty.call(i,"__proto__")||Object.prototype.hasOwnProperty.call(i,"constructor")&&Object.prototype.hasOwnProperty.call(i.constructor,"prototype"))throw SyntaxError("Object contains forbidden prototype property");for(let e in i){let n=i[e];n&&"object"==typeof n&&t.push(n)}}}return e}(t)}function tG(e){let{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch(t){return tV(e)}try{return tV(e)}finally{Error.stackTraceLimit=t}}function t$(e){if("object"===e.type||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;let{properties:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=tZ(t[e])}null!=e.items&&(e.items=Array.isArray(e.items)?e.items.map(tZ):tZ(e.items)),null!=e.anyOf&&(e.anyOf=e.anyOf.map(tZ)),null!=e.allOf&&(e.allOf=e.allOf.map(tZ)),null!=e.oneOf&&(e.oneOf=e.oneOf.map(tZ));let{definitions:t}=e;if(null!=t)for(let e of Object.keys(t))t[e]=tZ(t[e]);return e}function tZ(e){return"boolean"==typeof e?e:t$(e)}var tK=Symbol("Let zodToJsonSchema decide on which parser to use"),tq={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function tY(e,t){return il(e.type._def,t)}var tX=void 0,tQ=/^[cC][^\s-]{8,}$/,tJ=/^[0-9a-z]+$/,t0=/^[0-9A-HJKMNP-TV-Z]{26}$/,t1=/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,t2=()=>(void 0===tX&&(tX=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),tX),t3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,t5=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,t4=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,t6=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,t9=/^[a-zA-Z0-9_-]{21}$/,t8=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;function t7(e,t){let i={type:"string"};if(e.checks)for(let n of e.checks)switch(n.kind){case"min":i.minLength="number"==typeof i.minLength?Math.max(i.minLength,n.value):n.value;break;case"max":i.maxLength="number"==typeof i.maxLength?Math.min(i.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":ii(i,"email",n.message,t);break;case"format:idn-email":ii(i,"idn-email",n.message,t);break;case"pattern:zod":ia(i,t1,n.message,t)}break;case"url":ii(i,"uri",n.message,t);break;case"uuid":ii(i,"uuid",n.message,t);break;case"regex":ia(i,n.regex,n.message,t);break;case"cuid":ia(i,tQ,n.message,t);break;case"cuid2":ia(i,tJ,n.message,t);break;case"startsWith":ia(i,RegExp(`^${ie(n.value,t)}`),n.message,t);break;case"endsWith":ia(i,RegExp(`${ie(n.value,t)}$`),n.message,t);break;case"datetime":ii(i,"date-time",n.message,t);break;case"date":ii(i,"date",n.message,t);break;case"time":ii(i,"time",n.message,t);break;case"duration":ii(i,"duration",n.message,t);break;case"length":i.minLength="number"==typeof i.minLength?Math.max(i.minLength,n.value):n.value,i.maxLength="number"==typeof i.maxLength?Math.min(i.maxLength,n.value):n.value;break;case"includes":ia(i,RegExp(ie(n.value,t)),n.message,t);break;case"ip":"v6"!==n.version&&ii(i,"ipv4",n.message,t),"v4"!==n.version&&ii(i,"ipv6",n.message,t);break;case"base64url":ia(i,t6,n.message,t);break;case"jwt":ia(i,t8,n.message,t);break;case"cidr":"v6"!==n.version&&ia(i,t3,n.message,t),"v4"!==n.version&&ia(i,t5,n.message,t);break;case"emoji":ia(i,t2(),n.message,t);break;case"ulid":ia(i,t0,n.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":ii(i,"binary",n.message,t);break;case"contentEncoding:base64":i.contentEncoding="base64";break;case"pattern:zod":ia(i,t4,n.message,t)}break;case"nanoid":ia(i,t9,n.message,t)}return i}function ie(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let i=0;ie.format))?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...i&&n.errorMessages&&{errorMessage:{format:i}}})):e.format=t}function ia(e,t,i,n){var a;e.pattern||(null==(a=e.allOf)?void 0:a.some(e=>e.pattern))?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:ir(t,n),...i&&n.errorMessages&&{errorMessage:{pattern:i}}})):e.pattern=ir(t,n)}function ir(e,t){var i;if(!t.applyRegexFlags||!e.flags)return e.source;let n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},a=n.i?e.source.toLowerCase():e.source,r="",o=!1,s=!1,l=!1;for(let e=0;e{var n,a,r,o,s,l;switch(t){case tb.ZodFirstPartyTypeKind.ZodString:return t7(e,i);case tb.ZodFirstPartyTypeKind.ZodNumber:let d={type:"number"};if(!e.checks)return d;for(let t of e.checks)switch(t.kind){case"int":d.type="integer";break;case"min":t.inclusive?d.minimum=t.value:d.exclusiveMinimum=t.value;break;case"max":t.inclusive?d.maximum=t.value:d.exclusiveMaximum=t.value;break;case"multipleOf":d.multipleOf=t.value}return d;case tb.ZodFirstPartyTypeKind.ZodObject:return function(e,t){let i={type:"object",properties:{}},n=[],a=e.shape();for(let e in a){let r=a[e];if(void 0===r||void 0===r._def)continue;let o=function(e){try{return e.isOptional()}catch(e){return!0}}(r),s=il(r._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==s&&(i.properties[e]=s,o||n.push(e))}n.length&&(i.required=n);let r=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return il(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==r&&(i.additionalProperties=r),i}(e,i);case tb.ZodFirstPartyTypeKind.ZodBigInt:let c={type:"integer",format:"int64"};if(!e.checks)return c;for(let t of e.checks)switch(t.kind){case"min":t.inclusive?c.minimum=t.value:c.exclusiveMinimum=t.value;break;case"max":t.inclusive?c.maximum=t.value:c.exclusiveMaximum=t.value;break;case"multipleOf":c.multipleOf=t.value}return c;case tb.ZodFirstPartyTypeKind.ZodBoolean:return{type:"boolean"};case tb.ZodFirstPartyTypeKind.ZodDate:return function e(t,i,n){let a=null!=n?n:i.dateStrategy;if(Array.isArray(a))return{anyOf:a.map((n,a)=>e(t,i,n))};switch(a){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var r=t;let o={type:"integer",format:"unix-time"};for(let e of r.checks)switch(e.kind){case"min":o.minimum=e.value;break;case"max":o.maximum=e.value}return o}}(e,i);case tb.ZodFirstPartyTypeKind.ZodUndefined:return{not:{}};case tb.ZodFirstPartyTypeKind.ZodNull:return{type:"null"};case tb.ZodFirstPartyTypeKind.ZodArray:let u;return u={type:"array"},(null==(r=e.type)?void 0:r._def)&&(null==(s=null==(o=e.type)?void 0:o._def)?void 0:s.typeName)!==tb.ZodFirstPartyTypeKind.ZodAny&&(u.items=il(e.type._def,{...i,currentPath:[...i.currentPath,"items"]})),e.minLength&&(u.minItems=e.minLength.value),e.maxLength&&(u.maxItems=e.maxLength.value),e.exactLength&&(u.minItems=e.exactLength.value,u.maxItems=e.exactLength.value),u;case tb.ZodFirstPartyTypeKind.ZodUnion:case tb.ZodFirstPartyTypeKind.ZodDiscriminatedUnion:let p,h=e.options instanceof Map?Array.from(e.options.values()):e.options;if(h.every(e=>e._def.typeName in is&&(!e._def.checks||!e._def.checks.length))){let e=h.reduce((e,t)=>{let i=is[t._def.typeName];return i&&!e.includes(i)?[...e,i]:e},[]);return{type:e.length>1?e:e[0]}}if(h.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=h.reduce((e,t)=>{let i=typeof t._def.value;switch(i){case"string":case"number":case"boolean":return[...e,i];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===h.length){let t=e.filter((e,t,i)=>i.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:h.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(h.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:h.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return n=e,a=i,(p=(n.options instanceof Map?Array.from(n.options.values()):n.options).map((e,t)=>il(e._def,{...a,currentPath:[...a.currentPath,"anyOf",`${t}`]})).filter(e=>!!e&&(!a.strictUnions||"object"==typeof e&&Object.keys(e).length>0))).length?{anyOf:p}:void 0;case tb.ZodFirstPartyTypeKind.ZodIntersection:let m,g;return m=[il(e.left._def,{...i,currentPath:[...i.currentPath,"allOf","0"]}),il(e.right._def,{...i,currentPath:[...i.currentPath,"allOf","1"]})].filter(e=>!!e),g=[],m.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)g.push(...e.allOf);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:i,...n}=e;t=n}g.push(t)}}),g.length?{allOf:g}:void 0;case tb.ZodFirstPartyTypeKind.ZodTuple:return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((e,t)=>il(e._def,{...i,currentPath:[...i.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:il(e.rest._def,{...i,currentPath:[...i.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((e,t)=>il(e._def,{...i,currentPath:[...i.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case tb.ZodFirstPartyTypeKind.ZodRecord:return io(e,i);case tb.ZodFirstPartyTypeKind.ZodLiteral:let f;return"bigint"!=(f=typeof e.value)&&"number"!==f&&"boolean"!==f&&"string"!==f?{type:Array.isArray(e.value)?"array":"object"}:{type:"bigint"===f?"integer":f,const:e.value};case tb.ZodFirstPartyTypeKind.ZodEnum:return{type:"string",enum:Array.from(e.values)};case tb.ZodFirstPartyTypeKind.ZodNativeEnum:let b,x,y;return b=e.values,{type:1===(y=Array.from(new Set((x=Object.keys(e.values).filter(e=>"number"!=typeof b[b[e]]).map(e=>b[e])).map(e=>typeof e)))).length?"string"===y[0]?"string":"number":["string","number"],enum:x};case tb.ZodFirstPartyTypeKind.ZodNullable:if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[is[e.innerType._def.typeName],"null"]};let v=il(e.innerType._def,{...i,currentPath:[...i.currentPath,"anyOf","0"]});return v&&{anyOf:[v,{type:"null"}]};case tb.ZodFirstPartyTypeKind.ZodOptional:if(i.currentPath.toString()===(null==(l=i.propertyPath)?void 0:l.toString()))return il(e.innerType._def,i);let C=il(e.innerType._def,{...i,currentPath:[...i.currentPath,"anyOf","1"]});return C?{anyOf:[{not:{}},C]}:{};case tb.ZodFirstPartyTypeKind.ZodMap:if("record"===i.mapStrategy)return io(e,i);return{type:"array",maxItems:125,items:{type:"array",items:[il(e.keyType._def,{...i,currentPath:[...i.currentPath,"items","items","0"]})||{},il(e.valueType._def,{...i,currentPath:[...i.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case tb.ZodFirstPartyTypeKind.ZodSet:let w;return w={type:"array",uniqueItems:!0,items:il(e.valueType._def,{...i,currentPath:[...i.currentPath,"items"]})},e.minSize&&(w.minItems=e.minSize.value),e.maxSize&&(w.maxItems=e.maxSize.value),w;case tb.ZodFirstPartyTypeKind.ZodLazy:return()=>e.getter()._def;case tb.ZodFirstPartyTypeKind.ZodPromise:return il(e.type._def,i);case tb.ZodFirstPartyTypeKind.ZodNaN:case tb.ZodFirstPartyTypeKind.ZodNever:return{not:{}};case tb.ZodFirstPartyTypeKind.ZodEffects:return"input"===i.effectStrategy?il(e.schema._def,i):{};case tb.ZodFirstPartyTypeKind.ZodAny:case tb.ZodFirstPartyTypeKind.ZodUnknown:return{};case tb.ZodFirstPartyTypeKind.ZodDefault:return{...il(e.innerType._def,i),default:e.defaultValue()};case tb.ZodFirstPartyTypeKind.ZodBranded:return tY(e,i);case tb.ZodFirstPartyTypeKind.ZodReadonly:case tb.ZodFirstPartyTypeKind.ZodCatch:return il(e.innerType._def,i);case tb.ZodFirstPartyTypeKind.ZodPipeline:if("input"===i.pipeStrategy)return il(e.in._def,i);if("output"===i.pipeStrategy)return il(e.out._def,i);let S=il(e.in._def,{...i,currentPath:[...i.currentPath,"allOf","0"]}),k=il(e.out._def,{...i,currentPath:[...i.currentPath,"allOf",S?"1":"0"]});return{allOf:[S,k].filter(e=>void 0!==e)};case tb.ZodFirstPartyTypeKind.ZodFunction:case tb.ZodFirstPartyTypeKind.ZodVoid:case tb.ZodFirstPartyTypeKind.ZodSymbol:default:return}})(e,e.typeName,t),s="function"==typeof o?il(o(),t):o;if(s&&ic(e,t,s),t.postProcess){let i=t.postProcess(s,e,t);return r.jsonSchema=s,i}return r.jsonSchema=s,s}var id=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:((e,t)=>{let i=0;for(;it.currentPath[i]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},ic=(e,t,i)=>(e.description&&(i.description=e.description),i),iu=Symbol.for("vercel.ai.schema");function ip(e){let t;return()=>(null==t&&(t=e()),t)}function ih(e,{validate:t}={}){return{[iu]:!0,_type:void 0,get jsonSchema(){return"function"==typeof e&&(e=e()),e},validate:t}}function im(e){var t;return null==e?ih({properties:{},additionalProperties:!1}):"object"==typeof e&&null!==e&&iu in e&&!0===e[iu]&&"jsonSchema"in e&&"validate"in e?e:"~standard"in e?"zod"===e["~standard"].vendor?ig(e):(t=e,ih(()=>t$(t["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async e=>{let i=await t["~standard"].validate(e);return"value"in i?{success:!0,value:i.value}:{success:!1,error:new eh({value:e,cause:i.issues})}}})):e()}function ig(e,t){var i,n;let a;if("_zod"in e){let n;return n=null!=(i=null==t?void 0:t.useReferences)&&i,ih(()=>t$(tf(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async t=>{let i=await td(e,t);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}return a=null!=(n=null==t?void 0:t.useReferences)&&n,ih(()=>((e,t)=>{var i;let n,a,r=(a=void 0!==(n="string"==typeof t?{...tq,name:t}:{...tq,...t}).name?[...n.basePath,n.definitionPath,n.name]:n.basePath,{...n,currentPath:a,propertyPath:void 0,seen:new Map(Object.entries(n.definitions).map(([e,t])=>[t._def,{def:t._def,path:[...n.basePath,n.definitionPath,e],jsonSchema:void 0}]))}),o="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,i])=>{var n;return{...e,[t]:null!=(n=il(i._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0))?n:{}}},{}):void 0,s="string"==typeof t?t:(null==t?void 0:t.nameStrategy)==="title"||null==t?void 0:t.name,l=null!=(i=il(e._def,void 0===s?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))?i:{},d="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==d&&(l.title=d);let c=void 0===s?o?{...l,[r.definitionPath]:o}:l:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...o,[s]:l}};return c.$schema="http://json-schema.org/draft-07/schema#",c})(e,{$refStrategy:a?"root":"none"}),{validate:async t=>{let i=await e.safeParseAsync(t);return i.success?{success:!0,value:i.data}:{success:!1,error:i.error}}})}async function ib({value:e,schema:t,context:i}){let n=await ix({value:e,schema:t,context:i});if(!n.success)throw eh.wrap({value:e,cause:n.error,context:i});return n.value}async function ix({value:e,schema:t,context:i}){let n=im(t);try{if(null==n.validate)return{success:!0,value:e,rawValue:e};let t=await n.validate(e);if(t.success)return{success:!0,value:t.value,rawValue:e};return{success:!1,error:eh.wrap({value:e,cause:t.error,context:i}),rawValue:e}}catch(t){return{success:!1,error:eh.wrap({value:e,cause:t,context:i}),rawValue:e}}}async function iy({text:e,schema:t}){try{let i=tG(e);if(null==t)return i;return ib({value:i,schema:t})}catch(t){if(el.isInstance(t)||eh.isInstance(t))throw t;throw new el({text:e,cause:t})}}async function iv({text:e,schema:t}){try{let i=tG(e);if(null==t)return{success:!0,value:i,rawValue:i};return await ix({value:i,schema:t})}catch(t){return{success:!1,error:el.isInstance(t)?t:new el({text:e,cause:t}),rawValue:void 0}}}var iC=()=>globalThis.fetch,iw=async({url:e,headers:t,body:i,failedResponseHandler:n,successfulResponseHandler:a,abortSignal:r,fetch:o})=>iS({url:e,headers:{"Content-Type":"application/json",...t},body:{content:JSON.stringify(i),values:i},failedResponseHandler:n,successfulResponseHandler:a,abortSignal:r,fetch:o}),iS=async({url:e,headers:t={},body:i,successfulResponseHandler:n,failedResponseHandler:a,abortSignal:r,fetch:o=iC()})=>{try{let s=await o(e,{method:"POST",headers:tO(t,`ai-sdk/provider-utils/${tB}`,tR()),body:i.content,signal:r}),l=tw(s);if(!s.ok){let t;try{t=await a({response:s,url:e,requestBodyValues:i.values})}catch(t){if(tj(t)||K.isInstance(t))throw t;throw new K({message:"Failed to process error response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:i.values})}throw t.value}try{return await n({response:s,url:e,requestBodyValues:i.values})}catch(t){if(t instanceof Error&&(tj(t)||K.isInstance(t)))throw t;throw new K({message:"Failed to process successful response",cause:t,statusCode:s.status,url:e,responseHeaders:l,requestBodyValues:i.values})}}catch(t){throw tN({error:t,url:e,requestBodyValues:i.values})}};function ik({id:e,inputSchema:t,outputSchema:i,supportsDeferredResults:n}){return({execute:a,needsApproval:r,toModelOutput:o,onInputStart:s,onInputDelta:l,onInputAvailable:d,...c})=>({type:"provider",id:e,args:c,inputSchema:t,outputSchema:i,execute:a,needsApproval:r,toModelOutput:o,onInputStart:s,onInputDelta:l,onInputAvailable:d,supportsDeferredResults:n})}async function iA(e){return"function"==typeof e&&(e=e()),Promise.resolve(e)}var iE=({errorSchema:e,errorToMessage:t,isRetryable:i})=>async({response:n,url:a,requestBodyValues:r})=>{let o=await n.text(),s=tw(n);if(""===o.trim())return{responseHeaders:s,value:new K({message:n.statusText,url:a,requestBodyValues:r,statusCode:n.status,responseHeaders:s,responseBody:o,isRetryable:null==i?void 0:i(n)})};try{let l=await iy({text:o,schema:e});return{responseHeaders:s,value:new K({message:t(l),url:a,requestBodyValues:r,statusCode:n.status,responseHeaders:s,responseBody:o,data:l,isRetryable:null==i?void 0:i(n,l)})}}catch(e){return{responseHeaders:s,value:new K({message:n.statusText,url:a,requestBodyValues:r,statusCode:n.status,responseHeaders:s,responseBody:o,isRetryable:null==i?void 0:i(n)})}}},i_=e=>async({response:t,url:i,requestBodyValues:n})=>{let a=await t.text(),r=await iv({text:a,schema:e}),o=tw(t);if(!r.success)throw new K({message:"Invalid JSON response",cause:r.error,statusCode:t.status,responseHeaders:o,responseBody:a,url:i,requestBodyValues:n});return{responseHeaders:o,value:r.value,rawValue:r.rawValue}};function iI(){let e,t;return{localeError:(e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Invalid input: expected ${eF(i.values[0])}`;return`Invalid option: expected one of ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Too big: expected ${i.origin??"value"} to have ${t}${i.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${i.origin??"value"} to be ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Too small: expected ${i.origin} to have ${t}${i.minimum.toString()} ${n.unit}`;return`Too small: expected ${i.origin} to be ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Invalid string: must start with "${i.prefix}"`;if("ends_with"===i.format)return`Invalid string: must end with "${i.suffix}"`;if("includes"===i.format)return`Invalid string: must include "${i.includes}"`;if("regex"===i.format)return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${t[i.format]??i.format}`;case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`}})}}ev(iI()),e.s([],260952),e.i(260952),e.s([],747129),e.i(747129),e.i(616696),e.i(735571),e.i(936582);let iM=/^[cC][^\s-]{8,}$/,iT=/^[0-9a-z]+$/,iL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ij=/^[0-9a-vA-V]{20}$/,iP=/^[A-Za-z0-9]{27}$/,iD=/^[a-zA-Z0-9_-]{21}$/,iN=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,iR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,iO=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,iB=iO(4),iz=iO(6),iF=iO(7),iH=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,iW="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function iU(){return RegExp(iW,"u")}let iV=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,iG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,i$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,iZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iK=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iq=/^[A-Za-z0-9_-]*$/,iY=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,iX=/^\+(?:[0-9]){6,14}[0-9]$/,iQ="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",iJ=RegExp(`^${iQ}$`);function i0(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function i1(e){return RegExp(`^${i0(e)}$`)}function i2(e){let t=i0({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-]\\d{2}:\\d{2})");let n=`${t}(?:${i.join("|")})`;return RegExp(`^${iQ}T(?:${n})$`)}let i3=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},i5=/^\d+n?$/,i4=/^\d+$/,i6=/^-?\d+(?:\.\d+)?/i,i9=/true|false/i,i8=/null/i,i7=/undefined/i,ne=/^[^A-Z]*$/,nt=/^[^a-z]*$/;e.s(["_emoji",0,iW,"base64",0,iK,"base64url",0,iq,"bigint",0,i5,"boolean",0,i9,"browserEmail",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"cidrv4",0,i$,"cidrv6",0,iZ,"cuid",0,iM,"cuid2",0,iT,"date",0,iJ,"datetime",0,i2,"domain",0,/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,"duration",0,iN,"e164",0,iX,"email",0,iH,"emoji",0,iU,"extendedDuration",0,/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,"guid",0,iR,"hostname",0,iY,"html5Email",0,/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,"integer",0,i4,"ipv4",0,iV,"ipv6",0,iG,"ksuid",0,iP,"lowercase",0,ne,"nanoid",0,iD,"null",0,i8,"number",0,i6,"rfc5322Email",0,/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,"string",0,i3,"time",0,i1,"ulid",0,iL,"undefined",0,i7,"unicodeEmail",0,/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,"uppercase",0,nt,"uuid",0,iO,"uuid4",0,iB,"uuid6",0,iz,"uuid7",0,iF,"xid",0,ij],559217);let ni=ef("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),nn={number:"number",bigint:"bigint",object:"date"},na=ef("$ZodCheckLessThan",(e,t)=>{ni.init(e,t);let i=nn[typeof t.value];e._zod.onattach.push(e=>{let i=e._zod.bag,n=(t.inclusive?i.maximum:i.exclusiveMaximum)??1/0;t.value{(t.inclusive?n.value<=t.value:n.value{ni.init(e,t);let i=nn[typeof t.value];e._zod.onattach.push(e=>{let i=e._zod.bag,n=(t.inclusive?i.minimum:i.exclusiveMinimum)??-1/0;t.value>n&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:i,code:"too_small",minimum:t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),no=ef("$ZodCheckMultipleOf",(e,t)=>{ni.init(e,t),e._zod.onattach.push(e=>{var i;(i=e._zod.bag).multipleOf??(i.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof i.value?i.value%t.value===BigInt(0):0===e_(i.value,t.value))||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),ns=ef("$ZodCheckNumberFormat",(e,t)=>{ni.init(e,t),t.format=t.format||"float64";let i=t.format?.includes("int"),n=i?"int":"number",[a,r]=eW[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=a,n.maximum=r,i&&(n.pattern=i4)}),e._zod.check=o=>{let s=o.value;if(i){if(!Number.isInteger(s))return void o.issues.push({expected:n,format:t.format,code:"invalid_type",input:s,inst:e});if(!Number.isSafeInteger(s))return void(s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,continue:!t.abort}))}sr&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:r,inst:e})}}),nl=ef("$ZodCheckBigIntFormat",(e,t)=>{ni.init(e,t);let[i,n]=eU[t.format];e._zod.onattach.push(e=>{let a=e._zod.bag;a.format=t.format,a.minimum=i,a.maximum=n}),e._zod.check=a=>{let r=a.value;rn&&a.issues.push({origin:"bigint",input:r,code:"too_big",maximum:n,inst:e})}}),nd=ef("$ZodCheckMaxSize",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let i=e._zod.bag.maximum??1/0;t.maximum{let n=i.value;n.size<=t.maximum||i.issues.push({origin:eK(n),code:"too_big",maximum:t.maximum,input:n,inst:e,continue:!t.abort})}}),nc=ef("$ZodCheckMinSize",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let i=e._zod.bag.minimum??-1/0;t.minimum>i&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;n.size>=t.minimum||i.issues.push({origin:eK(n),code:"too_small",minimum:t.minimum,input:n,inst:e,continue:!t.abort})}}),nu=ef("$ZodCheckSizeEquals",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let i=e._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=i=>{let n=i.value,a=n.size;if(a===t.size)return;let r=a>t.size;i.issues.push({origin:eK(n),...r?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),np=ef("$ZodCheckMaxLength",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let i=e._zod.bag.maximum??1/0;t.maximum{let n=i.value;if(n.length<=t.maximum)return;let a=eq(n);i.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nh=ef("$ZodCheckMinLength",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let i=e._zod.bag.minimum??-1/0;t.minimum>i&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=i=>{let n=i.value;if(n.length>=t.minimum)return;let a=eq(n);i.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),nm=ef("$ZodCheckLengthEquals",(e,t)=>{var i;ni.init(e,t),(i=e._zod.def).when??(i.when=e=>{let t=e.value;return!eA(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let i=e._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=i=>{let n=i.value,a=n.length;if(a===t.length)return;let r=eq(n),o=a>t.length;i.issues.push({origin:r,...o?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:i.value,inst:e,continue:!t.abort})}}),ng=ef("$ZodCheckStringFormat",(e,t)=>{var i,n;ni.init(e,t),e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),nf=ef("$ZodCheckRegex",(e,t)=>{ng.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,t.pattern.test(i.value)||i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),nb=ef("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ne),ng.init(e,t)}),nx=ef("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nt),ng.init(e,t)}),ny=ef("$ZodCheckIncludes",(e,t)=>{ni.init(e,t);let i=eO(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${i}`:i);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),nv=ef("$ZodCheckStartsWith",(e,t)=>{ni.init(e,t);let i=RegExp(`^${eO(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),e._zod.check=i=>{i.value.startsWith(t.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:i.value,inst:e,continue:!t.abort})}}),nC=ef("$ZodCheckEndsWith",(e,t)=>{ni.init(e,t);let i=RegExp(`.*${eO(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),e._zod.check=i=>{i.value.endsWith(t.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:i.value,inst:e,continue:!t.abort})}});function nw(e,t,i){e.issues.length&&t.issues.push(...eG(i,e.issues))}let nS=ef("$ZodCheckProperty",(e,t)=>{ni.init(e,t),e._zod.check=e=>{let i=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(i instanceof Promise)return i.then(i=>nw(i,e,t.property));nw(i,e,t.property)}}),nk=ef("$ZodCheckMimeType",(e,t)=>{ni.init(e,t);let i=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{i.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e})}}),nA=ef("$ZodCheckOverwrite",(e,t)=>{ni.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});e.s(["$ZodCheck",0,ni,"$ZodCheckBigIntFormat",0,nl,"$ZodCheckEndsWith",0,nC,"$ZodCheckGreaterThan",0,nr,"$ZodCheckIncludes",0,ny,"$ZodCheckLengthEquals",0,nm,"$ZodCheckLessThan",0,na,"$ZodCheckLowerCase",0,nb,"$ZodCheckMaxLength",0,np,"$ZodCheckMaxSize",0,nd,"$ZodCheckMimeType",0,nk,"$ZodCheckMinLength",0,nh,"$ZodCheckMinSize",0,nc,"$ZodCheckMultipleOf",0,no,"$ZodCheckNumberFormat",0,ns,"$ZodCheckOverwrite",0,nA,"$ZodCheckProperty",0,nS,"$ZodCheckRegex",0,nf,"$ZodCheckSizeEquals",0,nu,"$ZodCheckStartsWith",0,nv,"$ZodCheckStringFormat",0,ng,"$ZodCheckUpperCase",0,nx],770012);class nE{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),i=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(i)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}e.s(["Doc",0,nE],334861);let n_={major:4,minor:0,patch:0};e.s(["version",0,n_],588606);let nI=ef("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=n_;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let i of t._zod.onattach)i(e);if(0===n.length)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,i)=>{let n,a=eV(e);for(let r of t){if(r._zod.def.when){if(!r._zod.def.when(e))continue}else if(a)continue;let t=e.issues.length,o=r._zod.check(e);if(o instanceof Promise&&i?.async===!1)throw new ex;if(n||o instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(a||(a=eV(e,t)))});else{if(e.issues.length===t)continue;a||(a=eV(e,t))}}return n?n.then(()=>e):e};e._zod.run=(i,a)=>{let r=e._zod.parse(i,a);if(r instanceof Promise){if(!1===a.async)throw new ex;return r.then(e=>t(e,n,a))}return t(r,n,a)}}e["~standard"]={validate:t=>{try{let i=te(e,t);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return ti(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),nM=ef("$ZodString",(e,t)=>{nI.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??i3(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch(e){}return"string"==typeof i.value||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),nT=ef("$ZodStringFormat",(e,t)=>{ng.init(e,t),nM.init(e,t)}),nL=ef("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=iR),nT.init(e,t)}),nj=ef("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=iO(e))}else t.pattern??(t.pattern=iO());nT.init(e,t)}),nP=ef("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=iH),nT.init(e,t)}),nD=ef("$ZodURL",(e,t)=>{nT.init(e,t),e._zod.check=i=>{try{let n=i.value,a=new URL(n),r=a.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(a.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:iY.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(a.protocol.endsWith(":")?a.protocol.slice(0,-1):a.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&r.endsWith("/")?i.value=r.slice(0,-1):i.value=r;return}catch(n){i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),nN=ef("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=iU()),nT.init(e,t)}),nR=ef("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iD),nT.init(e,t)}),nO=ef("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=iM),nT.init(e,t)}),nB=ef("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=iT),nT.init(e,t)}),nz=ef("$ZodULID",(e,t)=>{t.pattern??(t.pattern=iL),nT.init(e,t)}),nF=ef("$ZodXID",(e,t)=>{t.pattern??(t.pattern=ij),nT.init(e,t)}),nH=ef("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=iP),nT.init(e,t)}),nW=ef("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=i2(t)),nT.init(e,t)}),nU=ef("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=iJ),nT.init(e,t)}),nV=ef("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=i1(t)),nT.init(e,t)}),nG=ef("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=iN),nT.init(e,t)}),n$=ef("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=iV),nT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv4"})}),nZ=ef("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=iG),nT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.format="ipv6"}),e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),nK=ef("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=i$),nT.init(e,t)}),nq=ef("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=iZ),nT.init(e,t),e._zod.check=i=>{let[n,a]=i.value.split("/");try{if(!a)throw Error();let e=Number(a);if(`${e}`!==a||e<0||e>128)throw Error();new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function nY(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let nX=ef("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=iK),nT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64"}),e._zod.check=i=>{nY(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function nQ(e){if(!iq.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return nY(t.padEnd(4*Math.ceil(t.length/4),"="))}let nJ=ef("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=iq),nT.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding="base64url"}),e._zod.check=i=>{nQ(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),n0=ef("$ZodE164",(e,t)=>{t.pattern??(t.pattern=iX),nT.init(e,t)});function n1(e,t=null){try{let i=e.split(".");if(3!==i.length)return!1;let[n]=i;if(!n)return!1;let a=JSON.parse(atob(n));if("typ"in a&&a?.typ!=="JWT"||!a.alg||t&&(!("alg"in a)||a.alg!==t))return!1;return!0}catch{return!1}}let n2=ef("$ZodJWT",(e,t)=>{nT.init(e,t),e._zod.check=i=>{n1(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),n3=ef("$ZodCustomStringFormat",(e,t)=>{nT.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),n5=ef("$ZodNumber",(e,t)=>{nI.init(e,t),e._zod.pattern=e._zod.bag.pattern??i6,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=Number(i.value)}catch(e){}let a=i.value;if("number"==typeof a&&!Number.isNaN(a)&&Number.isFinite(a))return i;let r="number"==typeof a?Number.isNaN(a)?"NaN":Number.isFinite(a)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:a,inst:e,...r?{received:r}:{}}),i}}),n4=ef("$ZodNumber",(e,t)=>{ns.init(e,t),n5.init(e,t)}),n6=ef("$ZodBoolean",(e,t)=>{nI.init(e,t),e._zod.pattern=i9,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=!!i.value}catch(e){}let a=i.value;return"boolean"==typeof a||i.issues.push({expected:"boolean",code:"invalid_type",input:a,inst:e}),i}}),n9=ef("$ZodBigInt",(e,t)=>{nI.init(e,t),e._zod.pattern=i5,e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=BigInt(i.value)}catch(e){}return"bigint"==typeof i.value||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:e}),i}}),n8=ef("$ZodBigInt",(e,t)=>{nl.init(e,t),n9.init(e,t)}),n7=ef("$ZodSymbol",(e,t)=>{nI.init(e,t),e._zod.parse=(t,i)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),ae=ef("$ZodUndefined",(e,t)=>{nI.init(e,t),e._zod.pattern=i7,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,i)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),at=ef("$ZodNull",(e,t)=>{nI.init(e,t),e._zod.pattern=i8,e._zod.values=new Set([null]),e._zod.parse=(t,i)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),ai=ef("$ZodAny",(e,t)=>{nI.init(e,t),e._zod.parse=e=>e}),an=ef("$ZodUnknown",(e,t)=>{nI.init(e,t),e._zod.parse=e=>e}),aa=ef("$ZodNever",(e,t)=>{nI.init(e,t),e._zod.parse=(t,i)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),ar=ef("$ZodVoid",(e,t)=>{nI.init(e,t),e._zod.parse=(t,i)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}}),ao=ef("$ZodDate",(e,t)=>{nI.init(e,t),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=new Date(i.value)}catch(e){}let a=i.value,r=a instanceof Date;return r&&!Number.isNaN(a.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:a,...r?{received:"Invalid Date"}:{},inst:e}),i}});function as(e,t,i){e.issues.length&&t.issues.push(...eG(i,e.issues)),t.value[i]=e.value}let al=ef("$ZodArray",(e,t)=>{nI.init(e,t),e._zod.parse=(i,n)=>{let a=i.value;if(!Array.isArray(a))return i.issues.push({expected:"array",code:"invalid_type",input:a,inst:e}),i;i.value=Array(a.length);let r=[];for(let e=0;eas(t,i,e))):as(s,i,e)}return r.length?Promise.all(r).then(()=>i):i}});function ad(e,t,i){e.issues.length&&t.issues.push(...eG(i,e.issues)),t.value[i]=e.value}function ac(e,t,i,n){e.issues.length?void 0===n[i]?i in n?t.value[i]=void 0:t.value[i]=e.value:t.issues.push(...eG(i,e.issues)):void 0===e.value?i in n&&(t.value[i]=void 0):t.value[i]=e.value}let au=ef("$ZodObject",(e,t)=>{let i,n;nI.init(e,t);let a=ek(()=>{let e=Object.keys(t.shape);for(let i of e)if(!(t.shape[i]instanceof nI))throw Error(`Invalid element at key "${i}": expected a Zod schema`);let i=eH(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(i)}});eI(e._zod,"propValues",()=>{let e=t.shape,i={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(i[t]??(i[t]=new Set),n.values))i[t].add(e)}return i});let r=!ey.jitless,o=r&&eP.value,s=t.catchall;e._zod.parse=(l,d)=>{n??(n=a.value);let c=l.value;if(!ej(c))return l.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),l;let u=[];if(r&&o&&d?.async===!1&&!0!==d.jitless)i||(i=(e=>{let t=new nE(["shape","payload","ctx"]),i=a.value,n=e=>{let t=eT(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let r=Object.create(null),o=0;for(let e of i.keys)r[e]=`key_${o++}`;for(let e of(t.write("const newResult = {}"),i.keys))if(i.optionalKeys.has(e)){let i=r[e];t.write(`const ${i} = ${n(e)};`);let a=eT(e);t.write(` if (${i}.issues.length) { if (input[${a}] === undefined) { if (${a} in input) { newResult[${a}] = undefined; } } else { payload.issues = payload.issues.concat( ${i}.issues.map((iss) => ({ ...iss, path: iss.path ? [${a}, ...iss.path] : [${a}], })) ); } } else if (${i}.value === undefined) { if (${a} in input) newResult[${a}] = undefined; } else { newResult[${a}] = ${i}.value; } `)}else{let i=r[e];t.write(`const ${i} = ${n(e)};`),t.write(` if (${i}.issues.length) payload.issues = payload.issues.concat(${i}.issues.map(iss => ({ ...iss, path: iss.path ? [${eT(e)}, ...iss.path] : [${eT(e)}] })));`),t.write(`newResult[${eT(e)}] = ${i}.value`)}t.write("payload.value = newResult;"),t.write("return payload;");let s=t.compile();return(t,i)=>s(e,t,i)})(t.shape)),l=i(l,d);else{l.value={};let e=n.shape;for(let t of n.keys){let i=e[t],n=i._zod.run({value:c[t],issues:[]},d),a="optional"===i._zod.optin&&"optional"===i._zod.optout;n instanceof Promise?u.push(n.then(e=>a?ac(e,l,t,c):ad(e,l,t))):a?ac(n,l,t,c):ad(n,l,t)}}if(!s)return u.length?Promise.all(u).then(()=>l):l;let p=[],h=n.keySet,m=s._zod,g=m.def.type;for(let e of Object.keys(c)){if(h.has(e))continue;if("never"===g){p.push(e);continue}let t=m.run({value:c[e],issues:[]},d);t instanceof Promise?u.push(t.then(t=>ad(t,l,e))):ad(t,l,e)}return(p.length&&l.issues.push({code:"unrecognized_keys",keys:p,input:c,inst:e}),u.length)?Promise.all(u).then(()=>l):l}});function ap(e,t,i,n){for(let i of e)if(0===i.issues.length)return t.value=i.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(e=>e.issues.map(e=>eZ(e,n,ev())))}),t}let ah=ef("$ZodUnion",(e,t)=>{nI.init(e,t),eI(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),eI(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),eI(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),eI(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>eE(e.source)).join("|")})$`)}}),e._zod.parse=(i,n)=>{let a=!1,r=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},n);if(t instanceof Promise)r.push(t),a=!0;else{if(0===t.issues.length)return t;r.push(t)}}return a?Promise.all(r).then(t=>ap(t,i,e,n)):ap(r,i,e,n)}}),am=ef("$ZodDiscriminatedUnion",(e,t)=>{ah.init(e,t);let i=e._zod.parse;eI(e._zod,"propValues",()=>{let e={};for(let i of t.options){let n=i._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[t,i]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),i))e[t].add(n)}return e});let n=ek(()=>{let e=t.options,i=new Map;for(let n of e){let e=n._zod.propValues[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(i.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);i.set(t,n)}}return i});e._zod.parse=(a,r)=>{let o=a.value;if(!ej(o))return a.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),a;let s=n.value.get(o?.[t.discriminator]);return s?s._zod.run(a,r):t.unionFallback?i(a,r):(a.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:o,path:[t.discriminator],inst:e}),a)}}),ag=ef("$ZodIntersection",(e,t)=>{nI.init(e,t),e._zod.parse=(e,i)=>{let n=e.value,a=t.left._zod.run({value:n,issues:[]},i),r=t.right._zod.run({value:n,issues:[]},i);return a instanceof Promise||r instanceof Promise?Promise.all([a,r]).then(([t,i])=>af(e,t,i)):af(e,a,r)}});function af(e,t,i){if(t.issues.length&&e.issues.push(...t.issues),i.issues.length&&e.issues.push(...i.issues),eV(e))return e;let n=function e(t,i){if(t===i||t instanceof Date&&i instanceof Date&&+t==+i)return{valid:!0,data:t};if(eD(t)&&eD(i)){let n=Object.keys(i),a=Object.keys(t).filter(e=>-1!==n.indexOf(e)),r={...t,...i};for(let n of a){let a=e(t[n],i[n]);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r[n]=a.data}return{valid:!0,data:r}}if(Array.isArray(t)&&Array.isArray(i)){if(t.length!==i.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let a=0;a{nI.init(e,t);let i=t.items,n=i.length-[...i].reverse().findIndex(e=>"optional"!==e._zod.optin);e._zod.parse=(a,r)=>{let o=a.value;if(!Array.isArray(o))return a.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];let s=[];if(!t.rest){let t=o.length>i.length,r=o.length=o.length&&l>=n)continue;let t=e._zod.run({value:o[l],issues:[]},r);t instanceof Promise?s.push(t.then(e=>ax(e,a,l))):ax(t,a,l)}if(t.rest)for(let e of o.slice(i.length)){l++;let i=t.rest._zod.run({value:e,issues:[]},r);i instanceof Promise?s.push(i.then(e=>ax(e,a,l))):ax(i,a,l)}return s.length?Promise.all(s).then(()=>a):a}});function ax(e,t,i){e.issues.length&&t.issues.push(...eG(i,e.issues)),t.value[i]=e.value}let ay=ef("$ZodRecord",(e,t)=>{nI.init(e,t),e._zod.parse=(i,n)=>{let a=i.value;if(!eD(a))return i.issues.push({expected:"record",code:"invalid_type",input:a,inst:e}),i;let r=[];if(t.keyType._zod.values){let o,s=t.keyType._zod.values;for(let e of(i.value={},s))if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){let o=t.valueType._zod.run({value:a[e],issues:[]},n);o instanceof Promise?r.push(o.then(t=>{t.issues.length&&i.issues.push(...eG(e,t.issues)),i.value[e]=t.value})):(o.issues.length&&i.issues.push(...eG(e,o.issues)),i.value[e]=o.value)}for(let e in a)s.has(e)||(o=o??[]).push(e);o&&o.length>0&&i.issues.push({code:"unrecognized_keys",input:a,inst:e,keys:o})}else for(let o of(i.value={},Reflect.ownKeys(a))){if("__proto__"===o)continue;let s=t.keyType._zod.run({value:o,issues:[]},n);if(s instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(s.issues.length){i.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(e=>eZ(e,n,ev())),input:o,path:[o],inst:e}),i.value[s.value]=s.value;continue}let l=t.valueType._zod.run({value:a[o],issues:[]},n);l instanceof Promise?r.push(l.then(e=>{e.issues.length&&i.issues.push(...eG(o,e.issues)),i.value[s.value]=e.value})):(l.issues.length&&i.issues.push(...eG(o,l.issues)),i.value[s.value]=l.value)}return r.length?Promise.all(r).then(()=>i):i}}),av=ef("$ZodMap",(e,t)=>{nI.init(e,t),e._zod.parse=(i,n)=>{let a=i.value;if(!(a instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:a,inst:e}),i;let r=[];for(let[o,s]of(i.value=new Map,a)){let l=t.keyType._zod.run({value:o,issues:[]},n),d=t.valueType._zod.run({value:s,issues:[]},n);l instanceof Promise||d instanceof Promise?r.push(Promise.all([l,d]).then(([t,r])=>{aC(t,r,i,o,a,e,n)})):aC(l,d,i,o,a,e,n)}return r.length?Promise.all(r).then(()=>i):i}});function aC(e,t,i,n,a,r,o){e.issues.length&&(eN.has(typeof n)?i.issues.push(...eG(n,e.issues)):i.issues.push({origin:"map",code:"invalid_key",input:a,inst:r,issues:e.issues.map(e=>eZ(e,o,ev()))})),t.issues.length&&(eN.has(typeof n)?i.issues.push(...eG(n,t.issues)):i.issues.push({origin:"map",code:"invalid_element",input:a,inst:r,key:n,issues:t.issues.map(e=>eZ(e,o,ev()))})),i.value.set(e.value,t.value)}let aw=ef("$ZodSet",(e,t)=>{nI.init(e,t),e._zod.parse=(i,n)=>{let a=i.value;if(!(a instanceof Set))return i.issues.push({input:a,inst:e,expected:"set",code:"invalid_type"}),i;let r=[];for(let e of(i.value=new Set,a)){let a=t.valueType._zod.run({value:e,issues:[]},n);a instanceof Promise?r.push(a.then(e=>aS(e,i))):aS(a,i)}return r.length?Promise.all(r).then(()=>i):i}});function aS(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let ak=ef("$ZodEnum",(e,t)=>{nI.init(e,t);let i=eC(t.entries);e._zod.values=new Set(i),e._zod.pattern=RegExp(`^(${i.filter(e=>eN.has(typeof e)).map(e=>"string"==typeof e?eO(e):e.toString()).join("|")})$`),e._zod.parse=(t,n)=>{let a=t.value;return e._zod.values.has(a)||t.issues.push({code:"invalid_value",values:i,input:a,inst:e}),t}}),aA=ef("$ZodLiteral",(e,t)=>{nI.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?eO(e):e?e.toString():String(e)).join("|")})$`),e._zod.parse=(i,n)=>{let a=i.value;return e._zod.values.has(a)||i.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),i}}),aE=ef("$ZodFile",(e,t)=>{nI.init(e,t),e._zod.parse=(t,i)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}}),a_=ef("$ZodTransform",(e,t)=>{nI.init(e,t),e._zod.parse=(e,i)=>{let n=t.transform(e.value,e);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(t=>(e.value=t,e));if(n instanceof Promise)throw new ex;return e.value=n,e}}),aI=ef("$ZodOptional",(e,t)=>{nI.init(e,t),e._zod.optin="optional",e._zod.optout="optional",eI(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),eI(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eE(e.source)})?$`):void 0}),e._zod.parse=(e,i)=>"optional"===t.innerType._zod.optin?t.innerType._zod.run(e,i):void 0===e.value?e:t.innerType._zod.run(e,i)}),aM=ef("$ZodNullable",(e,t)=>{nI.init(e,t),eI(e._zod,"optin",()=>t.innerType._zod.optin),eI(e._zod,"optout",()=>t.innerType._zod.optout),eI(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${eE(e.source)}|null)$`):void 0}),eI(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,i)=>null===e.value?e:t.innerType._zod.run(e,i)}),aT=ef("$ZodDefault",(e,t)=>{nI.init(e,t),e._zod.optin="optional",eI(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,i)=>{if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,i);return n instanceof Promise?n.then(e=>aL(e,t)):aL(n,t)}});function aL(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let aj=ef("$ZodPrefault",(e,t)=>{nI.init(e,t),e._zod.optin="optional",eI(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,i)=>(void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,i))}),aP=ef("$ZodNonOptional",(e,t)=>{nI.init(e,t),eI(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(i,n)=>{let a=t.innerType._zod.run(i,n);return a instanceof Promise?a.then(t=>aD(t,e)):aD(a,e)}});function aD(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let aN=ef("$ZodSuccess",(e,t)=>{nI.init(e,t),e._zod.parse=(e,i)=>{let n=t.innerType._zod.run(e,i);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}}),aR=ef("$ZodCatch",(e,t)=>{nI.init(e,t),e._zod.optin="optional",eI(e._zod,"optout",()=>t.innerType._zod.optout),eI(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,i)=>{let n=t.innerType._zod.run(e,i);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>eZ(e,i,ev()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>eZ(e,i,ev()))},input:e.value}),e.issues=[]),e)}}),aO=ef("$ZodNaN",(e,t)=>{nI.init(e,t),e._zod.parse=(t,i)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),aB=ef("$ZodPipe",(e,t)=>{nI.init(e,t),eI(e._zod,"values",()=>t.in._zod.values),eI(e._zod,"optin",()=>t.in._zod.optin),eI(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(e,i)=>{let n=t.in._zod.run(e,i);return n instanceof Promise?n.then(e=>az(e,t,i)):az(n,t,i)}});function az(e,t,i){return eV(e)?e:t.out._zod.run({value:e.value,issues:e.issues},i)}let aF=ef("$ZodReadonly",(e,t)=>{nI.init(e,t),eI(e._zod,"propValues",()=>t.innerType._zod.propValues),eI(e._zod,"values",()=>t.innerType._zod.values),eI(e._zod,"optin",()=>t.innerType._zod.optin),eI(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(e,i)=>{let n=t.innerType._zod.run(e,i);return n instanceof Promise?n.then(aH):aH(n)}});function aH(e){return e.value=Object.freeze(e.value),e}let aW=ef("$ZodTemplateLiteral",(e,t)=>{nI.init(e,t);let i=[];for(let e of t.parts)if(e instanceof nI){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=+!!t.startsWith("^"),a=t.endsWith("$")?t.length-1:t.length;i.push(t.slice(n,a))}else if(null===e||eR.has(typeof e))i.push(eO(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${i.join("")}$`),e._zod.parse=(t,i)=>("string"!=typeof t.value?t.issues.push({input:t.value,inst:e,expected:"template_literal",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(t.value)||t.issues.push({input:t.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source})),t)}),aU=ef("$ZodPromise",(e,t)=>{nI.init(e,t),e._zod.parse=(e,i)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},i))}),aV=ef("$ZodLazy",(e,t)=>{nI.init(e,t),eI(e._zod,"innerType",()=>t.getter()),eI(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),eI(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),eI(e._zod,"optin",()=>e._zod.innerType._zod.optin),eI(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(t,i)=>e._zod.innerType._zod.run(t,i)}),aG=ef("$ZodCustom",(e,t)=>{ni.init(e,t),nI.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=i=>{let n=i.value,a=t.fn(n);if(a instanceof Promise)return a.then(t=>a$(t,i,n,e));a$(a,i,n,e)}});function a$(e,t,i,n){if(!e){let e={code:"custom",input:i,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(eY(e))}}e.s(["$ZodAny",0,ai,"$ZodArray",0,al,"$ZodBase64",0,nX,"$ZodBase64URL",0,nJ,"$ZodBigInt",0,n9,"$ZodBigIntFormat",0,n8,"$ZodBoolean",0,n6,"$ZodCIDRv4",0,nK,"$ZodCIDRv6",0,nq,"$ZodCUID",0,nO,"$ZodCUID2",0,nB,"$ZodCatch",0,aR,"$ZodCustom",0,aG,"$ZodCustomStringFormat",0,n3,"$ZodDate",0,ao,"$ZodDefault",0,aT,"$ZodDiscriminatedUnion",0,am,"$ZodE164",0,n0,"$ZodEmail",0,nP,"$ZodEmoji",0,nN,"$ZodEnum",0,ak,"$ZodFile",0,aE,"$ZodGUID",0,nL,"$ZodIPv4",0,n$,"$ZodIPv6",0,nZ,"$ZodISODate",0,nU,"$ZodISODateTime",0,nW,"$ZodISODuration",0,nG,"$ZodISOTime",0,nV,"$ZodIntersection",0,ag,"$ZodJWT",0,n2,"$ZodKSUID",0,nH,"$ZodLazy",0,aV,"$ZodLiteral",0,aA,"$ZodMap",0,av,"$ZodNaN",0,aO,"$ZodNanoID",0,nR,"$ZodNever",0,aa,"$ZodNonOptional",0,aP,"$ZodNull",0,at,"$ZodNullable",0,aM,"$ZodNumber",0,n5,"$ZodNumberFormat",0,n4,"$ZodObject",0,au,"$ZodOptional",0,aI,"$ZodPipe",0,aB,"$ZodPrefault",0,aj,"$ZodPromise",0,aU,"$ZodReadonly",0,aF,"$ZodRecord",0,ay,"$ZodSet",0,aw,"$ZodString",0,nM,"$ZodStringFormat",0,nT,"$ZodSuccess",0,aN,"$ZodSymbol",0,n7,"$ZodTemplateLiteral",0,aW,"$ZodTransform",0,a_,"$ZodTuple",0,ab,"$ZodType",0,nI,"$ZodULID",0,nz,"$ZodURL",0,nD,"$ZodUUID",0,nj,"$ZodUndefined",0,ae,"$ZodUnion",0,ah,"$ZodUnknown",0,an,"$ZodVoid",0,ar,"$ZodXID",0,nF,"isValidBase64",0,nY,"isValidBase64URL",0,nQ,"isValidJWT",0,n1],621169),e.i(621169),e.s(["$ZodAny",0,ai,"$ZodArray",0,al,"$ZodBase64",0,nX,"$ZodBase64URL",0,nJ,"$ZodBigInt",0,n9,"$ZodBigIntFormat",0,n8,"$ZodBoolean",0,n6,"$ZodCIDRv4",0,nK,"$ZodCIDRv6",0,nq,"$ZodCUID",0,nO,"$ZodCUID2",0,nB,"$ZodCatch",0,aR,"$ZodCustom",0,aG,"$ZodCustomStringFormat",0,n3,"$ZodDate",0,ao,"$ZodDefault",0,aT,"$ZodDiscriminatedUnion",0,am,"$ZodE164",0,n0,"$ZodEmail",0,nP,"$ZodEmoji",0,nN,"$ZodEnum",0,ak,"$ZodFile",0,aE,"$ZodGUID",0,nL,"$ZodIPv4",0,n$,"$ZodIPv6",0,nZ,"$ZodISODate",0,nU,"$ZodISODateTime",0,nW,"$ZodISODuration",0,nG,"$ZodISOTime",0,nV,"$ZodIntersection",0,ag,"$ZodJWT",0,n2,"$ZodKSUID",0,nH,"$ZodLazy",0,aV,"$ZodLiteral",0,aA,"$ZodMap",0,av,"$ZodNaN",0,aO,"$ZodNanoID",0,nR,"$ZodNever",0,aa,"$ZodNonOptional",0,aP,"$ZodNull",0,at,"$ZodNullable",0,aM,"$ZodNumber",0,n5,"$ZodNumberFormat",0,n4,"$ZodObject",0,au,"$ZodOptional",0,aI,"$ZodPipe",0,aB,"$ZodPrefault",0,aj,"$ZodPromise",0,aU,"$ZodReadonly",0,aF,"$ZodRecord",0,ay,"$ZodSet",0,aw,"$ZodString",0,nM,"$ZodStringFormat",0,nT,"$ZodSuccess",0,aN,"$ZodSymbol",0,n7,"$ZodTemplateLiteral",0,aW,"$ZodTransform",0,a_,"$ZodTuple",0,ab,"$ZodType",0,nI,"$ZodULID",0,nz,"$ZodURL",0,nD,"$ZodUUID",0,nj,"$ZodUndefined",0,ae,"$ZodUnion",0,ah,"$ZodUnknown",0,an,"$ZodVoid",0,ar,"$ZodXID",0,nF,"clone",0,eB,"isValidBase64",0,nY,"isValidBase64URL",0,nQ,"isValidJWT",0,n1],403682),e.i(403682),e.i(770012),e.i(588606);var aZ=e.i(139604),aK=e.i(559217);function aq(e,t,i,n){let a=Math.abs(e),r=a%10,o=a%100;return o>=11&&o<=19?n:1===r?t:r>=2&&r<=4?i:n}function aY(e,t,i,n){let a=Math.abs(e),r=a%10,o=a%100;return o>=11&&o<=19?n:1===r?t:r>=2&&r<=4?i:n}e.s([],292021),e.i(292021),e.s(["ar",0,function(){let e,t;return{localeError:(e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}},t={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},i=>{switch(i.code){case"invalid_type":return`مدخلات غير مقبولة: يفترض إدخال ${i.expected}، ولكن تم إدخال ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`مدخلات غير مقبولة: يفترض إدخال ${eF(i.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return` أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${t} ${i.maximum.toString()} ${n.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${i.origin??"القيمة"} ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${t} ${i.minimum.toString()} ${n.unit}`;return`أصغر من اللازم: يفترض لـ ${i.origin} أن يكون ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`نَص غير مقبول: يجب أن يبدأ بـ "${i.prefix}"`;if("ends_with"===i.format)return`نَص غير مقبول: يجب أن ينتهي بـ "${i.suffix}"`;if("includes"===i.format)return`نَص غير مقبول: يجب أن يتضمَّن "${i.includes}"`;if("regex"===i.format)return`نَص غير مقبول: يجب أن يطابق النمط ${i.pattern}`;return`${t[i.format]??i.format} غير مقبول`;case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${i.divisor}`;case"unrecognized_keys":return`معرف${i.keys.length>1?"ات":""} غريب${i.keys.length>1?"ة":""}: ${ew(i.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${i.origin}`;case"invalid_union":default:return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${i.origin}`}})}},"az",0,function(){let e,t;return{localeError:(e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}},t={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Yanlış dəyər: g\xf6zlənilən ${i.expected}, daxil olan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Yanlış dəyər: g\xf6zlənilən ${eF(i.values[0])}`;return`Yanlış se\xe7im: aşağıdakılardan biri olmalıdır: ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${i.origin??"dəyər"} ${t}${i.maximum.toString()} ${n.unit??"element"}`;return`\xc7ox b\xf6y\xfck: g\xf6zlənilən ${i.origin??"dəyər"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`\xc7ox ki\xe7ik: g\xf6zlənilən ${i.origin} ${t}${i.minimum.toString()} ${n.unit}`;return`\xc7ox ki\xe7ik: g\xf6zlənilən ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Yanlış mətn: "${i.prefix}" ilə başlamalıdır`;if("ends_with"===i.format)return`Yanlış mətn: "${i.suffix}" ilə bitməlidir`;if("includes"===i.format)return`Yanlış mətn: "${i.includes}" daxil olmalıdır`;if("regex"===i.format)return`Yanlış mətn: ${i.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${t[i.format]??i.format}`;case"not_multiple_of":return`Yanlış ədəd: ${i.divisor} ilə b\xf6l\xfcnə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan a\xe7ar${i.keys.length>1?"lar":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`${i.origin} daxilində yanlış a\xe7ar`;case"invalid_union":default:return"Yanlış dəyər";case"invalid_element":return`${i.origin} daxilində yanlış dəyər`}})}},"be",0,function(){let e,t;return{localeError:(e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}},t={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},i=>{switch(i.code){case"invalid_type":return`Няправільны ўвод: чакаўся ${i.expected}, атрымана ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"лік";case"object":if(Array.isArray(e))return"масіў";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Няправільны ўвод: чакалася ${eF(i.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n){let e=aq(Number(i.maximum),n.unit.one,n.unit.few,n.unit.many);return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна ${n.verb} ${t}${i.maximum.toString()} ${e}`}return`Занадта вялікі: чакалася, што ${i.origin??"значэнне"} павінна быць ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n){let e=aq(Number(i.minimum),n.unit.one,n.unit.few,n.unit.many);return`Занадта малы: чакалася, што ${i.origin} павінна ${n.verb} ${t}${i.minimum.toString()} ${e}`}return`Занадта малы: чакалася, што ${i.origin} павінна быць ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Няправільны радок: павінен пачынацца з "${i.prefix}"`;if("ends_with"===i.format)return`Няправільны радок: павінен заканчвацца на "${i.suffix}"`;if("includes"===i.format)return`Няправільны радок: павінен змяшчаць "${i.includes}"`;if("regex"===i.format)return`Няправільны радок: павінен адпавядаць шаблону ${i.pattern}`;return`Няправільны ${t[i.format]??i.format}`;case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${i.keys.length>1?"ключы":"ключ"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${i.origin}`;case"invalid_union":default:return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${i.origin}`}})}},"ca",0,function(){let e,t;return{localeError:(e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}},t={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i=>{switch(i.code){case"invalid_type":return`Tipus inv\xe0lid: s'esperava ${i.expected}, s'ha rebut ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Valor inv\xe0lid: s'esperava ${eF(i.values[0])}`;return`Opci\xf3 inv\xe0lida: s'esperava una de ${ew(i.values," o ")}`;case"too_big":{let t=i.inclusive?"com a màxim":"menys de",n=e[i.origin]??null;if(n)return`Massa gran: s'esperava que ${i.origin??"el valor"} contingu\xe9s ${t} ${i.maximum.toString()} ${n.unit??"elements"}`;return`Massa gran: s'esperava que ${i.origin??"el valor"} fos ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"com a mínim":"més de",n=e[i.origin]??null;if(n)return`Massa petit: s'esperava que ${i.origin} contingu\xe9s ${t} ${i.minimum.toString()} ${n.unit}`;return`Massa petit: s'esperava que ${i.origin} fos ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Format inv\xe0lid: ha de comen\xe7ar amb "${i.prefix}"`;if("ends_with"===i.format)return`Format inv\xe0lid: ha d'acabar amb "${i.suffix}"`;if("includes"===i.format)return`Format inv\xe0lid: ha d'incloure "${i.includes}"`;if("regex"===i.format)return`Format inv\xe0lid: ha de coincidir amb el patr\xf3 ${i.pattern}`;return`Format inv\xe0lid per a ${t[i.format]??i.format}`;case"not_multiple_of":return`N\xfamero inv\xe0lid: ha de ser m\xfaltiple de ${i.divisor}`;case"unrecognized_keys":return`Clau${i.keys.length>1?"s":""} no reconeguda${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Clau inv\xe0lida a ${i.origin}`;case"invalid_union":default:return"Entrada invàlida";case"invalid_element":return`Element inv\xe0lid a ${i.origin}`}})}},"cs",0,function(){let e,t;return{localeError:(e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}},t={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},i=>{switch(i.code){case"invalid_type":return`Neplatn\xfd vstup: oček\xe1v\xe1no ${i.expected}, obdrženo ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"číslo";case"string":return"řetězec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":if(Array.isArray(e))return"pole";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Neplatn\xfd vstup: oček\xe1v\xe1no ${eF(i.values[0])}`;return`Neplatn\xe1 možnost: oček\xe1v\xe1na jedna z hodnot ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Hodnota je př\xedliš velk\xe1: ${i.origin??"hodnota"} mus\xed m\xedt ${t}${i.maximum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš velk\xe1: ${i.origin??"hodnota"} mus\xed b\xfdt ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Hodnota je př\xedliš mal\xe1: ${i.origin??"hodnota"} mus\xed m\xedt ${t}${i.minimum.toString()} ${n.unit??"prvků"}`;return`Hodnota je př\xedliš mal\xe1: ${i.origin??"hodnota"} mus\xed b\xfdt ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Neplatn\xfd řetězec: mus\xed zač\xednat na "${i.prefix}"`;if("ends_with"===i.format)return`Neplatn\xfd řetězec: mus\xed končit na "${i.suffix}"`;if("includes"===i.format)return`Neplatn\xfd řetězec: mus\xed obsahovat "${i.includes}"`;if("regex"===i.format)return`Neplatn\xfd řetězec: mus\xed odpov\xeddat vzoru ${i.pattern}`;return`Neplatn\xfd form\xe1t ${t[i.format]??i.format}`;case"not_multiple_of":return`Neplatn\xe9 č\xedslo: mus\xed b\xfdt n\xe1sobkem ${i.divisor}`;case"unrecognized_keys":return`Nezn\xe1m\xe9 kl\xedče: ${ew(i.keys,", ")}`;case"invalid_key":return`Neplatn\xfd kl\xedč v ${i.origin}`;case"invalid_union":default:return"Neplatný vstup";case"invalid_element":return`Neplatn\xe1 hodnota v ${i.origin}`}})}},"de",0,function(){let e,t;return{localeError:(e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}},t={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i=>{switch(i.code){case"invalid_type":return`Ung\xfcltige Eingabe: erwartet ${i.expected}, erhalten ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"Zahl";case"object":if(Array.isArray(e))return"Array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Ung\xfcltige Eingabe: erwartet ${eF(i.values[0])}`;return`Ung\xfcltige Option: erwartet eine von ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Zu gro\xdf: erwartet, dass ${i.origin??"Wert"} ${t}${i.maximum.toString()} ${n.unit??"Elemente"} hat`;return`Zu gro\xdf: erwartet, dass ${i.origin??"Wert"} ${t}${i.maximum.toString()} ist`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Zu klein: erwartet, dass ${i.origin} ${t}${i.minimum.toString()} ${n.unit} hat`;return`Zu klein: erwartet, dass ${i.origin} ${t}${i.minimum.toString()} ist`}case"invalid_format":if("starts_with"===i.format)return`Ung\xfcltiger String: muss mit "${i.prefix}" beginnen`;if("ends_with"===i.format)return`Ung\xfcltiger String: muss mit "${i.suffix}" enden`;if("includes"===i.format)return`Ung\xfcltiger String: muss "${i.includes}" enthalten`;if("regex"===i.format)return`Ung\xfcltiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ung\xfcltig: ${t[i.format]??i.format}`;case"not_multiple_of":return`Ung\xfcltige Zahl: muss ein Vielfaches von ${i.divisor} sein`;case"unrecognized_keys":return`${i.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Ung\xfcltiger Schl\xfcssel in ${i.origin}`;case"invalid_union":default:return"Ungültige Eingabe";case"invalid_element":return`Ung\xfcltiger Wert in ${i.origin}`}})}},"en",0,iI,"eo",0,function(){let e,t;return{localeError:(e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}},t={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendiĝis ${i.expected}, riceviĝis ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":if(Array.isArray(e))return"tabelo";if(null===e)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Nevalida enigo: atendiĝis ${eF(i.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()} ${n.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${i.origin??"valoro"} havu ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Tro malgranda: atendiĝis ke ${i.origin} havu ${t}${i.minimum.toString()} ${n.unit}`;return`Tro malgranda: atendiĝis ke ${i.origin} estu ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Nevalida karaktraro: devas komenciĝi per "${i.prefix}"`;if("ends_with"===i.format)return`Nevalida karaktraro: devas finiĝi per "${i.suffix}"`;if("includes"===i.format)return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if("regex"===i.format)return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${t[i.format]??i.format}`;case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} ŝlosilo${i.keys.length>1?"j":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${i.origin}`;case"invalid_union":default:return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`}})}},"es",0,function(){let e,t;return{localeError:(e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}},t={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i=>{switch(i.code){case"invalid_type":return`Entrada inv\xe1lida: se esperaba ${i.expected}, recibido ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":if(Array.isArray(e))return"arreglo";if(null===e)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Entrada inv\xe1lida: se esperaba ${eF(i.values[0])}`;return`Opci\xf3n inv\xe1lida: se esperaba una de ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Demasiado grande: se esperaba que ${i.origin??"valor"} tuviera ${t}${i.maximum.toString()} ${n.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${i.origin??"valor"} fuera ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Demasiado peque\xf1o: se esperaba que ${i.origin} tuviera ${t}${i.minimum.toString()} ${n.unit}`;return`Demasiado peque\xf1o: se esperaba que ${i.origin} fuera ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cadena inv\xe1lida: debe comenzar con "${i.prefix}"`;if("ends_with"===i.format)return`Cadena inv\xe1lida: debe terminar en "${i.suffix}"`;if("includes"===i.format)return`Cadena inv\xe1lida: debe incluir "${i.includes}"`;if("regex"===i.format)return`Cadena inv\xe1lida: debe coincidir con el patr\xf3n ${i.pattern}`;return`Inv\xe1lido ${t[i.format]??i.format}`;case"not_multiple_of":return`N\xfamero inv\xe1lido: debe ser m\xfaltiplo de ${i.divisor}`;case"unrecognized_keys":return`Llave${i.keys.length>1?"s":""} desconocida${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Llave inv\xe1lida en ${i.origin}`;case"invalid_union":default:return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido en ${i.origin}`}})}},"fa",0,function(){let e,t;return{localeError:(e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}},t={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},i=>{switch(i.code){case"invalid_type":return`ورودی نامعتبر: می‌بایست ${i.expected} می‌بود، ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"عدد";case"object":if(Array.isArray(e))return"آرایه";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)} دریافت شد`;case"invalid_value":if(1===i.values.length)return`ورودی نامعتبر: می‌بایست ${eF(i.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${ew(i.values,"|")} می‌بود`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`خیلی بزرگ: ${i.origin??"مقدار"} باید ${t}${i.maximum.toString()} ${n.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${i.origin??"مقدار"} باید ${t}${i.maximum.toString()} باشد`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`خیلی کوچک: ${i.origin} باید ${t}${i.minimum.toString()} ${n.unit} باشد`;return`خیلی کوچک: ${i.origin} باید ${t}${i.minimum.toString()} باشد`}case"invalid_format":if("starts_with"===i.format)return`رشته نامعتبر: باید با "${i.prefix}" شروع شود`;if("ends_with"===i.format)return`رشته نامعتبر: باید با "${i.suffix}" تمام شود`;if("includes"===i.format)return`رشته نامعتبر: باید شامل "${i.includes}" باشد`;if("regex"===i.format)return`رشته نامعتبر: باید با الگوی ${i.pattern} مطابقت داشته باشد`;return`${t[i.format]??i.format} نامعتبر`;case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${i.divisor} باشد`;case"unrecognized_keys":return`کلید${i.keys.length>1?"های":""} ناشناس: ${ew(i.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${i.origin}`;case"invalid_union":default:return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${i.origin}`}})}},"fi",0,function(){let e,t;return{localeError:(e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}},t={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i=>{switch(i.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${i.expected}, oli ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Virheellinen sy\xf6te: t\xe4ytyy olla ${eF(i.values[0])}`;return`Virheellinen valinta: t\xe4ytyy olla yksi seuraavista: ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Liian suuri: ${n.subject} t\xe4ytyy olla ${t}${i.maximum.toString()} ${n.unit}`.trim();return`Liian suuri: arvon t\xe4ytyy olla ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Liian pieni: ${n.subject} t\xe4ytyy olla ${t}${i.minimum.toString()} ${n.unit}`.trim();return`Liian pieni: arvon t\xe4ytyy olla ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy alkaa "${i.prefix}"`;if("ends_with"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy loppua "${i.suffix}"`;if("includes"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy sis\xe4lt\xe4\xe4 "${i.includes}"`;if("regex"===i.format)return`Virheellinen sy\xf6te: t\xe4ytyy vastata s\xe4\xe4nn\xf6llist\xe4 lauseketta ${i.pattern}`;return`Virheellinen ${t[i.format]??i.format}`;case"not_multiple_of":return`Virheellinen luku: t\xe4ytyy olla luvun ${i.divisor} monikerta`;case"unrecognized_keys":return`${i.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${ew(i.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}})}},"fr",0,function(){let e,t;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i=>{switch(i.code){case"invalid_type":return`Entr\xe9e invalide : ${i.expected} attendu, ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombre";case"object":if(Array.isArray(e))return"tableau";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)} re\xe7u`;case"invalid_value":if(1===i.values.length)return`Entr\xe9e invalide : ${eF(i.values[0])} attendu`;return`Option invalide : une valeur parmi ${ew(i.values,"|")} attendue`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Trop grand : ${i.origin??"valeur"} doit ${n.verb} ${t}${i.maximum.toString()} ${n.unit??"élément(s)"}`;return`Trop grand : ${i.origin??"valeur"} doit \xeatre ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Trop petit : ${i.origin} doit ${n.verb} ${t}${i.minimum.toString()} ${n.unit}`;return`Trop petit : ${i.origin} doit \xeatre ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cha\xeene invalide : doit commencer par "${i.prefix}"`;if("ends_with"===i.format)return`Cha\xeene invalide : doit se terminer par "${i.suffix}"`;if("includes"===i.format)return`Cha\xeene invalide : doit inclure "${i.includes}"`;if("regex"===i.format)return`Cha\xeene invalide : doit correspondre au mod\xe8le ${i.pattern}`;return`${t[i.format]??i.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xe9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${ew(i.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${i.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`}})}},"frCA",0,function(){let e,t;return{localeError:(e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}},t={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},i=>{switch(i.code){case"invalid_type":return`Entr\xe9e invalide : attendu ${i.expected}, re\xe7u ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Entr\xe9e invalide : attendu ${eF(i.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"≤":"<",n=e[i.origin]??null;if(n)return`Trop grand : attendu que ${i.origin??"la valeur"} ait ${t}${i.maximum.toString()} ${n.unit}`;return`Trop grand : attendu que ${i.origin??"la valeur"} soit ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"≥":">",n=e[i.origin]??null;if(n)return`Trop petit : attendu que ${i.origin} ait ${t}${i.minimum.toString()} ${n.unit}`;return`Trop petit : attendu que ${i.origin} soit ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Cha\xeene invalide : doit commencer par "${i.prefix}"`;if("ends_with"===i.format)return`Cha\xeene invalide : doit se terminer par "${i.suffix}"`;if("includes"===i.format)return`Cha\xeene invalide : doit inclure "${i.includes}"`;if("regex"===i.format)return`Cha\xeene invalide : doit correspondre au motif ${i.pattern}`;return`${t[i.format]??i.format} invalide`;case"not_multiple_of":return`Nombre invalide : doit \xeatre un multiple de ${i.divisor}`;case"unrecognized_keys":return`Cl\xe9${i.keys.length>1?"s":""} non reconnue${i.keys.length>1?"s":""} : ${ew(i.keys,", ")}`;case"invalid_key":return`Cl\xe9 invalide dans ${i.origin}`;case"invalid_union":default:return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${i.origin}`}})}},"he",0,function(){let e,t;return{localeError:(e={string:{unit:"אותיות",verb:"לכלול"},file:{unit:"בייטים",verb:"לכלול"},array:{unit:"פריטים",verb:"לכלול"},set:{unit:"פריטים",verb:"לכלול"}},t={regex:"קלט",email:"כתובת אימייל",url:"כתובת רשת",emoji:"אימוג'י",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"תאריך וזמן ISO",date:"תאריך ISO",time:"זמן ISO",duration:"משך זמן ISO",ipv4:"כתובת IPv4",ipv6:"כתובת IPv6",cidrv4:"טווח IPv4",cidrv6:"טווח IPv6",base64:"מחרוזת בבסיס 64",base64url:"מחרוזת בבסיס 64 לכתובות רשת",json_string:"מחרוזת JSON",e164:"מספר E.164",jwt:"JWT",template_literal:"קלט"},i=>{switch(i.code){case"invalid_type":return`קלט לא תקין: צריך ${i.expected}, התקבל ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`קלט לא תקין: צריך ${eF(i.values[0])}`;return`קלט לא תקין: צריך אחת מהאפשרויות ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`גדול מדי: ${i.origin??"value"} צריך להיות ${t}${i.maximum.toString()} ${n.unit??"elements"}`;return`גדול מדי: ${i.origin??"value"} צריך להיות ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`קטן מדי: ${i.origin} צריך להיות ${t}${i.minimum.toString()} ${n.unit}`;return`קטן מדי: ${i.origin} צריך להיות ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`מחרוזת לא תקינה: חייבת להתחיל ב"${i.prefix}"`;if("ends_with"===i.format)return`מחרוזת לא תקינה: חייבת להסתיים ב "${i.suffix}"`;if("includes"===i.format)return`מחרוזת לא תקינה: חייבת לכלול "${i.includes}"`;if("regex"===i.format)return`מחרוזת לא תקינה: חייבת להתאים לתבנית ${i.pattern}`;return`${t[i.format]??i.format} לא תקין`;case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${i.divisor}`;case"unrecognized_keys":return`מפתח${i.keys.length>1?"ות":""} לא מזוה${i.keys.length>1?"ים":"ה"}: ${ew(i.keys,", ")}`;case"invalid_key":return`מפתח לא תקין ב${i.origin}`;case"invalid_union":default:return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${i.origin}`}})}},"hu",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}},t={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},i=>{switch(i.code){case"invalid_type":return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${i.expected}, a kapott \xe9rt\xe9k ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"szám";case"object":if(Array.isArray(e))return"tömb";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`\xc9rv\xe9nytelen bemenet: a v\xe1rt \xe9rt\xe9k ${eF(i.values[0])}`;return`\xc9rv\xe9nytelen opci\xf3: valamelyik \xe9rt\xe9k v\xe1rt ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`T\xfal nagy: ${i.origin??"érték"} m\xe9rete t\xfal nagy ${t}${i.maximum.toString()} ${n.unit??"elem"}`;return`T\xfal nagy: a bemeneti \xe9rt\xe9k ${i.origin??"érték"} t\xfal nagy: ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${i.origin} m\xe9rete t\xfal kicsi ${t}${i.minimum.toString()} ${n.unit}`;return`T\xfal kicsi: a bemeneti \xe9rt\xe9k ${i.origin} t\xfal kicsi ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`\xc9rv\xe9nytelen string: "${i.prefix}" \xe9rt\xe9kkel kell kezdődnie`;if("ends_with"===i.format)return`\xc9rv\xe9nytelen string: "${i.suffix}" \xe9rt\xe9kkel kell v\xe9gződnie`;if("includes"===i.format)return`\xc9rv\xe9nytelen string: "${i.includes}" \xe9rt\xe9ket kell tartalmaznia`;if("regex"===i.format)return`\xc9rv\xe9nytelen string: ${i.pattern} mint\xe1nak kell megfelelnie`;return`\xc9rv\xe9nytelen ${t[i.format]??i.format}`;case"not_multiple_of":return`\xc9rv\xe9nytelen sz\xe1m: ${i.divisor} t\xf6bbsz\xf6r\xf6s\xe9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`\xc9rv\xe9nytelen kulcs ${i.origin}`;case"invalid_union":default:return"Érvénytelen bemenet";case"invalid_element":return`\xc9rv\xe9nytelen \xe9rt\xe9k: ${i.origin}`}})}},"id",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}},t={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Input tidak valid: diharapkan ${i.expected}, diterima ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Input tidak valid: diharapkan ${eF(i.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Terlalu besar: diharapkan ${i.origin??"value"} memiliki ${t}${i.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: diharapkan ${i.origin??"value"} menjadi ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Terlalu kecil: diharapkan ${i.origin} memiliki ${t}${i.minimum.toString()} ${n.unit}`;return`Terlalu kecil: diharapkan ${i.origin} menjadi ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if("ends_with"===i.format)return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if("includes"===i.format)return`String tidak valid: harus menyertakan "${i.includes}"`;if("regex"===i.format)return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${t[i.format]??i.format} tidak valid`;case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${i.origin}`;case"invalid_union":default:return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${i.origin}`}})}},"it",0,function(){let e,t;return{localeError:(e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}},t={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Input non valido: atteso ${i.expected}, ricevuto ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"numero";case"object":if(Array.isArray(e))return"vettore";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Input non valido: atteso ${eF(i.values[0])}`;return`Opzione non valida: atteso uno tra ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Troppo grande: ${i.origin??"valore"} deve avere ${t}${i.maximum.toString()} ${n.unit??"elementi"}`;return`Troppo grande: ${i.origin??"valore"} deve essere ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Troppo piccolo: ${i.origin} deve avere ${t}${i.minimum.toString()} ${n.unit}`;return`Troppo piccolo: ${i.origin} deve essere ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Stringa non valida: deve iniziare con "${i.prefix}"`;if("ends_with"===i.format)return`Stringa non valida: deve terminare con "${i.suffix}"`;if("includes"===i.format)return`Stringa non valida: deve includere "${i.includes}"`;if("regex"===i.format)return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Invalid ${t[i.format]??i.format}`;case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${i.divisor}`;case"unrecognized_keys":return`Chiav${i.keys.length>1?"i":"e"} non riconosciut${i.keys.length>1?"e":"a"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${i.origin}`;case"invalid_union":default:return"Input non valido";case"invalid_element":return`Valore non valido in ${i.origin}`}})}},"ja",0,function(){let e,t;return{localeError:(e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}},t={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},i=>{switch(i.code){case"invalid_type":return`無効な入力: ${i.expected}が期待されましたが、${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"数値";case"object":if(Array.isArray(e))return"配列";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}が入力されました`;case"invalid_value":if(1===i.values.length)return`無効な入力: ${eF(i.values[0])}が期待されました`;return`無効な選択: ${ew(i.values,"、")}のいずれかである必要があります`;case"too_big":{let t=i.inclusive?"以下である":"より小さい",n=e[i.origin]??null;if(n)return`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${n.unit??"要素"}${t}必要があります`;return`大きすぎる値: ${i.origin??"値"}は${i.maximum.toString()}${t}必要があります`}case"too_small":{let t=i.inclusive?"以上である":"より大きい",n=e[i.origin]??null;if(n)return`小さすぎる値: ${i.origin}は${i.minimum.toString()}${n.unit}${t}必要があります`;return`小さすぎる値: ${i.origin}は${i.minimum.toString()}${t}必要があります`}case"invalid_format":if("starts_with"===i.format)return`無効な文字列: "${i.prefix}"で始まる必要があります`;if("ends_with"===i.format)return`無効な文字列: "${i.suffix}"で終わる必要があります`;if("includes"===i.format)return`無効な文字列: "${i.includes}"を含む必要があります`;if("regex"===i.format)return`無効な文字列: パターン${i.pattern}に一致する必要があります`;return`無効な${t[i.format]??i.format}`;case"not_multiple_of":return`無効な数値: ${i.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${i.keys.length>1?"群":""}: ${ew(i.keys,"、")}`;case"invalid_key":return`${i.origin}内の無効なキー`;case"invalid_union":default:return"無効な入力";case"invalid_element":return`${i.origin}内の無効な値`}})}},"kh",0,function(){let e,t;return{localeError:(e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}},t={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},i=>{switch(i.code){case"invalid_type":return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${i.expected} ប៉ុន្តែទទួលបាន ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"មិនមែនជាលេខ (NaN)":"លេខ";case"object":if(Array.isArray(e))return"អារេ (Array)";if(null===e)return"គ្មានតម្លៃ (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${eF(i.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${t} ${i.maximum.toString()} ${n.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${i.origin??"តម្លៃ"} ${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`តូចពេក៖ ត្រូវការ ${i.origin} ${t} ${i.minimum.toString()} ${n.unit}`;return`តូចពេក៖ ត្រូវការ ${i.origin} ${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${i.prefix}"`;if("ends_with"===i.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${i.suffix}"`;if("includes"===i.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${i.includes}"`;if("regex"===i.format)return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${i.pattern}`;return`មិនត្រឹមត្រូវ៖ ${t[i.format]??i.format}`;case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${i.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${ew(i.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`;case"invalid_union":default:return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${i.origin}`}})}},"ko",0,function(){let e,t;return{localeError:(e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}},t={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},i=>{switch(i.code){case"invalid_type":return`잘못된 입력: 예상 타입은 ${i.expected}, 받은 타입은 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}입니다`;case"invalid_value":if(1===i.values.length)return`잘못된 입력: 값은 ${eF(i.values[0])} 이어야 합니다`;return`잘못된 옵션: ${ew(i.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let t=i.inclusive?"이하":"미만",n="미만"===t?"이어야 합니다":"여야 합니다",a=e[i.origin]??null,r=a?.unit??"요소";if(a)return`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()}${r} ${t}${n}`;return`${i.origin??"값"}이 너무 큽니다: ${i.maximum.toString()} ${t}${n}`}case"too_small":{let t=i.inclusive?"이상":"초과",n="이상"===t?"이어야 합니다":"여야 합니다",a=e[i.origin]??null,r=a?.unit??"요소";if(a)return`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()}${r} ${t}${n}`;return`${i.origin??"값"}이 너무 작습니다: ${i.minimum.toString()} ${t}${n}`}case"invalid_format":if("starts_with"===i.format)return`잘못된 문자열: "${i.prefix}"(으)로 시작해야 합니다`;if("ends_with"===i.format)return`잘못된 문자열: "${i.suffix}"(으)로 끝나야 합니다`;if("includes"===i.format)return`잘못된 문자열: "${i.includes}"을(를) 포함해야 합니다`;if("regex"===i.format)return`잘못된 문자열: 정규식 ${i.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${t[i.format]??i.format}`;case"not_multiple_of":return`잘못된 숫자: ${i.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${ew(i.keys,", ")}`;case"invalid_key":return`잘못된 키: ${i.origin}`;case"invalid_union":default:return"잘못된 입력";case"invalid_element":return`잘못된 값: ${i.origin}`}})}},"mk",0,function(){let e,t;return{localeError:(e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}},t={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},i=>{switch(i.code){case"invalid_type":return`Грешен внес: се очекува ${i.expected}, примено ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"број";case"object":if(Array.isArray(e))return"низа";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Invalid input: expected ${eF(i.values[0])}`;return`Грешана опција: се очекува една ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Премногу голем: се очекува ${i.origin??"вредноста"} да има ${t}${i.maximum.toString()} ${n.unit??"елементи"}`;return`Премногу голем: се очекува ${i.origin??"вредноста"} да биде ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Премногу мал: се очекува ${i.origin} да има ${t}${i.minimum.toString()} ${n.unit}`;return`Премногу мал: се очекува ${i.origin} да биде ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Неважечка низа: мора да започнува со "${i.prefix}"`;if("ends_with"===i.format)return`Неважечка низа: мора да завршува со "${i.suffix}"`;if("includes"===i.format)return`Неважечка низа: мора да вклучува "${i.includes}"`;if("regex"===i.format)return`Неважечка низа: мора да одгоара на патернот ${i.pattern}`;return`Invalid ${t[i.format]??i.format}`;case"not_multiple_of":return`Грешен број: мора да биде делив со ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${i.origin}`;case"invalid_union":default:return"Грешен внес";case"invalid_element":return`Грешна вредност во ${i.origin}`}})}},"ms",0,function(){let e,t;return{localeError:(e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}},t={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Input tidak sah: dijangka ${i.expected}, diterima ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombor";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Input tidak sah: dijangka ${eF(i.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Terlalu besar: dijangka ${i.origin??"nilai"} ${n.verb} ${t}${i.maximum.toString()} ${n.unit??"elemen"}`;return`Terlalu besar: dijangka ${i.origin??"nilai"} adalah ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Terlalu kecil: dijangka ${i.origin} ${n.verb} ${t}${i.minimum.toString()} ${n.unit}`;return`Terlalu kecil: dijangka ${i.origin} adalah ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if("ends_with"===i.format)return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if("includes"===i.format)return`String tidak sah: mesti mengandungi "${i.includes}"`;if("regex"===i.format)return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${t[i.format]??i.format} tidak sah`;case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${i.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${ew(i.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${i.origin}`;case"invalid_union":default:return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${i.origin}`}})}},"nl",0,function(){let e,t;return{localeError:(e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}},t={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i=>{switch(i.code){case"invalid_type":return`Ongeldige invoer: verwacht ${i.expected}, ontving ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"getal";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Ongeldige invoer: verwacht ${eF(i.values[0])}`;return`Ongeldige optie: verwacht \xe9\xe9n van ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Te lang: verwacht dat ${i.origin??"waarde"} ${t}${i.maximum.toString()} ${n.unit??"elementen"} bevat`;return`Te lang: verwacht dat ${i.origin??"waarde"} ${t}${i.maximum.toString()} is`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Te kort: verwacht dat ${i.origin} ${t}${i.minimum.toString()} ${n.unit} bevat`;return`Te kort: verwacht dat ${i.origin} ${t}${i.minimum.toString()} is`}case"invalid_format":if("starts_with"===i.format)return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if("ends_with"===i.format)return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if("includes"===i.format)return`Ongeldige tekst: moet "${i.includes}" bevatten`;if("regex"===i.format)return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${t[i.format]??i.format}`;case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${i.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${i.origin}`;case"invalid_union":default:return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${i.origin}`}})}},"no",0,function(){let e,t;return{localeError:(e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}},t={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`Ugyldig input: forventet ${i.expected}, fikk ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"tall";case"object":if(Array.isArray(e))return"liste";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Ugyldig verdi: forventet ${eF(i.values[0])}`;return`Ugyldig valg: forventet en av ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`For stor(t): forventet ${i.origin??"value"} til \xe5 ha ${t}${i.maximum.toString()} ${n.unit??"elementer"}`;return`For stor(t): forventet ${i.origin??"value"} til \xe5 ha ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`For lite(n): forventet ${i.origin} til \xe5 ha ${t}${i.minimum.toString()} ${n.unit}`;return`For lite(n): forventet ${i.origin} til \xe5 ha ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ugyldig streng: m\xe5 starte med "${i.prefix}"`;if("ends_with"===i.format)return`Ugyldig streng: m\xe5 ende med "${i.suffix}"`;if("includes"===i.format)return`Ugyldig streng: m\xe5 inneholde "${i.includes}"`;if("regex"===i.format)return`Ugyldig streng: m\xe5 matche m\xf8nsteret ${i.pattern}`;return`Ugyldig ${t[i.format]??i.format}`;case"not_multiple_of":return`Ugyldig tall: m\xe5 v\xe6re et multiplum av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Ugyldig n\xf8kkel i ${i.origin}`;case"invalid_union":default:return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${i.origin}`}})}},"ota",0,function(){let e,t;return{localeError:(e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}},t={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},i=>{switch(i.code){case"invalid_type":return`F\xe2sit giren: umulan ${i.expected}, alınan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"numara";case"object":if(Array.isArray(e))return"saf";if(null===e)return"gayb";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`F\xe2sit giren: umulan ${eF(i.values[0])}`;return`F\xe2sit tercih: m\xfbteberler ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Fazla b\xfcy\xfck: ${i.origin??"value"}, ${t}${i.maximum.toString()} ${n.unit??"elements"} sahip olmalıydı.`;return`Fazla b\xfcy\xfck: ${i.origin??"value"}, ${t}${i.maximum.toString()} olmalıydı.`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Fazla k\xfc\xe7\xfck: ${i.origin}, ${t}${i.minimum.toString()} ${n.unit} sahip olmalıydı.`;return`Fazla k\xfc\xe7\xfck: ${i.origin}, ${t}${i.minimum.toString()} olmalıydı.`}case"invalid_format":if("starts_with"===i.format)return`F\xe2sit metin: "${i.prefix}" ile başlamalı.`;if("ends_with"===i.format)return`F\xe2sit metin: "${i.suffix}" ile bitmeli.`;if("includes"===i.format)return`F\xe2sit metin: "${i.includes}" ihtiv\xe2 etmeli.`;if("regex"===i.format)return`F\xe2sit metin: ${i.pattern} nakşına uymalı.`;return`F\xe2sit ${t[i.format]??i.format}`;case"not_multiple_of":return`F\xe2sit sayı: ${i.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xe7in tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${i.origin} i\xe7in tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}})}},"pl",0,function(){let e,t;return{localeError:(e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}},t={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},i=>{switch(i.code){case"invalid_type":return`Nieprawidłowe dane wejściowe: oczekiwano ${i.expected}, otrzymano ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"liczba";case"object":if(Array.isArray(e))return"tablica";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Nieprawidłowe dane wejściowe: oczekiwano ${eF(i.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Za duża wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${t}${i.maximum.toString()} ${n.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Za mała wartość: oczekiwano, że ${i.origin??"wartość"} będzie mieć ${t}${i.minimum.toString()} ${n.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${i.origin??"wartość"} będzie wynosić ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Nieprawidłowy ciąg znak\xf3w: musi zaczynać się od "${i.prefix}"`;if("ends_with"===i.format)return`Nieprawidłowy ciąg znak\xf3w: musi kończyć się na "${i.suffix}"`;if("includes"===i.format)return`Nieprawidłowy ciąg znak\xf3w: musi zawierać "${i.includes}"`;if("regex"===i.format)return`Nieprawidłowy ciąg znak\xf3w: musi odpowiadać wzorcowi ${i.pattern}`;return`Nieprawidłow(y/a/e) ${t[i.format]??i.format}`;case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${i.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${i.origin}`;case"invalid_union":default:return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${i.origin}`}})}},"ps",0,function(){let e,t;return{localeError:(e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}},t={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},i=>{switch(i.code){case"invalid_type":return`ناسم ورودي: باید ${i.expected} وای, مګر ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"عدد";case"object":if(Array.isArray(e))return"ارې";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)} ترلاسه شو`;case"invalid_value":if(1===i.values.length)return`ناسم ورودي: باید ${eF(i.values[0])} وای`;return`ناسم انتخاب: باید یو له ${ew(i.values,"|")} څخه وای`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`ډیر لوی: ${i.origin??"ارزښت"} باید ${t}${i.maximum.toString()} ${n.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${i.origin??"ارزښت"} باید ${t}${i.maximum.toString()} وي`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`ډیر کوچنی: ${i.origin} باید ${t}${i.minimum.toString()} ${n.unit} ولري`;return`ډیر کوچنی: ${i.origin} باید ${t}${i.minimum.toString()} وي`}case"invalid_format":if("starts_with"===i.format)return`ناسم متن: باید د "${i.prefix}" سره پیل شي`;if("ends_with"===i.format)return`ناسم متن: باید د "${i.suffix}" سره پای ته ورسيږي`;if("includes"===i.format)return`ناسم متن: باید "${i.includes}" ولري`;if("regex"===i.format)return`ناسم متن: باید د ${i.pattern} سره مطابقت ولري`;return`${t[i.format]??i.format} ناسم دی`;case"not_multiple_of":return`ناسم عدد: باید د ${i.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${i.keys.length>1?"کلیډونه":"کلیډ"}: ${ew(i.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${i.origin} کې`;case"invalid_union":default:return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${i.origin} کې`}})}},"pt",0,function(){let e,t;return{localeError:(e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}},t={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},i=>{switch(i.code){case"invalid_type":return`Tipo inv\xe1lido: esperado ${i.expected}, recebido ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"número";case"object":if(Array.isArray(e))return"array";if(null===e)return"nulo";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Entrada inv\xe1lida: esperado ${eF(i.values[0])}`;return`Op\xe7\xe3o inv\xe1lida: esperada uma das ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Muito grande: esperado que ${i.origin??"valor"} tivesse ${t}${i.maximum.toString()} ${n.unit??"elementos"}`;return`Muito grande: esperado que ${i.origin??"valor"} fosse ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Muito pequeno: esperado que ${i.origin} tivesse ${t}${i.minimum.toString()} ${n.unit}`;return`Muito pequeno: esperado que ${i.origin} fosse ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Texto inv\xe1lido: deve come\xe7ar com "${i.prefix}"`;if("ends_with"===i.format)return`Texto inv\xe1lido: deve terminar com "${i.suffix}"`;if("includes"===i.format)return`Texto inv\xe1lido: deve incluir "${i.includes}"`;if("regex"===i.format)return`Texto inv\xe1lido: deve corresponder ao padr\xe3o ${i.pattern}`;return`${t[i.format]??i.format} inv\xe1lido`;case"not_multiple_of":return`N\xfamero inv\xe1lido: deve ser m\xfaltiplo de ${i.divisor}`;case"unrecognized_keys":return`Chave${i.keys.length>1?"s":""} desconhecida${i.keys.length>1?"s":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Chave inv\xe1lida em ${i.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inv\xe1lido em ${i.origin}`;default:return"Campo inválido"}})}},"ru",0,function(){let e,t;return{localeError:(e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}},t={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},i=>{switch(i.code){case"invalid_type":return`Неверный ввод: ожидалось ${i.expected}, получено ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":if(Array.isArray(e))return"массив";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Неверный ввод: ожидалось ${eF(i.values[0])}`;return`Неверный вариант: ожидалось одно из ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n){let e=aY(Number(i.maximum),n.unit.one,n.unit.few,n.unit.many);return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет иметь ${t}${i.maximum.toString()} ${e}`}return`Слишком большое значение: ожидалось, что ${i.origin??"значение"} будет ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n){let e=aY(Number(i.minimum),n.unit.one,n.unit.few,n.unit.many);return`Слишком маленькое значение: ожидалось, что ${i.origin} будет иметь ${t}${i.minimum.toString()} ${e}`}return`Слишком маленькое значение: ожидалось, что ${i.origin} будет ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Неверная строка: должна начинаться с "${i.prefix}"`;if("ends_with"===i.format)return`Неверная строка: должна заканчиваться на "${i.suffix}"`;if("includes"===i.format)return`Неверная строка: должна содержать "${i.includes}"`;if("regex"===i.format)return`Неверная строка: должна соответствовать шаблону ${i.pattern}`;return`Неверный ${t[i.format]??i.format}`;case"not_multiple_of":return`Неверное число: должно быть кратным ${i.divisor}`;case"unrecognized_keys":return`Нераспознанн${i.keys.length>1?"ые":"ый"} ключ${i.keys.length>1?"и":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${i.origin}`;case"invalid_union":default:return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${i.origin}`}})}},"sl",0,function(){let e,t;return{localeError:(e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}},t={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},i=>{switch(i.code){case"invalid_type":return`Neveljaven vnos: pričakovano ${i.expected}, prejeto ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"število";case"object":if(Array.isArray(e))return"tabela";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Neveljaven vnos: pričakovano ${eF(i.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} imelo ${t}${i.maximum.toString()} ${n.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${i.origin??"vrednost"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Premajhno: pričakovano, da bo ${i.origin} imelo ${t}${i.minimum.toString()} ${n.unit}`;return`Premajhno: pričakovano, da bo ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Neveljaven niz: mora se začeti z "${i.prefix}"`;if("ends_with"===i.format)return`Neveljaven niz: mora se končati z "${i.suffix}"`;if("includes"===i.format)return`Neveljaven niz: mora vsebovati "${i.includes}"`;if("regex"===i.format)return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${t[i.format]??i.format}`;case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${i.divisor}`;case"unrecognized_keys":return`Neprepoznan${i.keys.length>1?"i ključi":" ključ"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${i.origin}`;case"invalid_union":default:return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${i.origin}`}})}},"sv",0,function(){let e,t;return{localeError:(e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}},t={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i=>{switch(i.code){case"invalid_type":return`Ogiltig inmatning: f\xf6rv\xe4ntat ${i.expected}, fick ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"antal";case"object":if(Array.isArray(e))return"lista";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Ogiltig inmatning: f\xf6rv\xe4ntat ${eF(i.values[0])}`;return`Ogiltigt val: f\xf6rv\xe4ntade en av ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`F\xf6r stor(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.maximum.toString()} ${n.unit??"element"}`;return`F\xf6r stor(t): f\xf6rv\xe4ntat ${i.origin??"värdet"} att ha ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`F\xf6r lite(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.minimum.toString()} ${n.unit}`;return`F\xf6r lite(t): f\xf6rv\xe4ntade ${i.origin??"värdet"} att ha ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ogiltig str\xe4ng: m\xe5ste b\xf6rja med "${i.prefix}"`;if("ends_with"===i.format)return`Ogiltig str\xe4ng: m\xe5ste sluta med "${i.suffix}"`;if("includes"===i.format)return`Ogiltig str\xe4ng: m\xe5ste inneh\xe5lla "${i.includes}"`;if("regex"===i.format)return`Ogiltig str\xe4ng: m\xe5ste matcha m\xf6nstret "${i.pattern}"`;return`Ogiltig(t) ${t[i.format]??i.format}`;case"not_multiple_of":return`Ogiltigt tal: m\xe5ste vara en multipel av ${i.divisor}`;case"unrecognized_keys":return`${i.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${ew(i.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${i.origin??"värdet"}`;case"invalid_union":default:return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xe4rde i ${i.origin??"värdet"}`}})}},"ta",0,function(){let e,t;return{localeError:(e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}},t={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},i=>{switch(i.code){case"invalid_type":return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${i.expected}, பெறப்பட்டது ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"எண் அல்லாதது":"எண்";case"object":if(Array.isArray(e))return"அணி";if(null===e)return"வெறுமை";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${eF(i.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${ew(i.values,"|")} இல் ஒன்று`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${t}${i.maximum.toString()} ${n.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${i.origin??"மதிப்பு"} ${t}${i.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${t}${i.minimum.toString()} ${n.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${i.origin} ${t}${i.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":if("starts_with"===i.format)return`தவறான சரம்: "${i.prefix}" இல் தொடங்க வேண்டும்`;if("ends_with"===i.format)return`தவறான சரம்: "${i.suffix}" இல் முடிவடைய வேண்டும்`;if("includes"===i.format)return`தவறான சரம்: "${i.includes}" ஐ உள்ளடக்க வேண்டும்`;if("regex"===i.format)return`தவறான சரம்: ${i.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${t[i.format]??i.format}`;case"not_multiple_of":return`தவறான எண்: ${i.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${i.keys.length>1?"கள்":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`${i.origin} இல் தவறான விசை`;case"invalid_union":default:return"தவறான உள்ளீடு";case"invalid_element":return`${i.origin} இல் தவறான மதிப்பு`}})}},"th",0,function(){let e,t;return{localeError:(e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}},t={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},i=>{switch(i.code){case"invalid_type":return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${i.expected} แต่ได้รับ ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"ไม่ใช่ตัวเลข (NaN)":"ตัวเลข";case"object":if(Array.isArray(e))return"อาร์เรย์ (Array)";if(null===e)return"ไม่มีค่า (null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`ค่าไม่ถูกต้อง: ควรเป็น ${eF(i.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"ไม่เกิน":"น้อยกว่า",n=e[i.origin]??null;if(n)return`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${t} ${i.maximum.toString()} ${n.unit??"รายการ"}`;return`เกินกำหนด: ${i.origin??"ค่า"} ควรมี${t} ${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?"อย่างน้อย":"มากกว่า",n=e[i.origin]??null;if(n)return`น้อยกว่ากำหนด: ${i.origin} ควรมี${t} ${i.minimum.toString()} ${n.unit}`;return`น้อยกว่ากำหนด: ${i.origin} ควรมี${t} ${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${i.prefix}"`;if("ends_with"===i.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${i.suffix}"`;if("includes"===i.format)return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${i.includes}" อยู่ในข้อความ`;if("regex"===i.format)return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${i.pattern}`;return`รูปแบบไม่ถูกต้อง: ${t[i.format]??i.format}`;case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${i.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${ew(i.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${i.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${i.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}})}},"tr",0,function(){let e,t;return{localeError:(e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}},t={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},i=>{switch(i.code){case"invalid_type":return`Ge\xe7ersiz değer: beklenen ${i.expected}, alınan ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Ge\xe7ersiz değer: beklenen ${eF(i.values[0])}`;return`Ge\xe7ersiz se\xe7enek: aşağıdakilerden biri olmalı: ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`\xc7ok b\xfcy\xfck: beklenen ${i.origin??"değer"} ${t}${i.maximum.toString()} ${n.unit??"öğe"}`;return`\xc7ok b\xfcy\xfck: beklenen ${i.origin??"değer"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`\xc7ok k\xfc\xe7\xfck: beklenen ${i.origin} ${t}${i.minimum.toString()} ${n.unit}`;return`\xc7ok k\xfc\xe7\xfck: beklenen ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Ge\xe7ersiz metin: "${i.prefix}" ile başlamalı`;if("ends_with"===i.format)return`Ge\xe7ersiz metin: "${i.suffix}" ile bitmeli`;if("includes"===i.format)return`Ge\xe7ersiz metin: "${i.includes}" i\xe7ermeli`;if("regex"===i.format)return`Ge\xe7ersiz metin: ${i.pattern} desenine uymalı`;return`Ge\xe7ersiz ${t[i.format]??i.format}`;case"not_multiple_of":return`Ge\xe7ersiz sayı: ${i.divisor} ile tam b\xf6l\xfcnebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${i.keys.length>1?"lar":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xe7inde ge\xe7ersiz anahtar`;case"invalid_union":default:return"Geçersiz değer";case"invalid_element":return`${i.origin} i\xe7inde ge\xe7ersiz değer`}})}},"ua",0,function(){let e,t;return{localeError:(e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}},t={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},i=>{switch(i.code){case"invalid_type":return`Неправильні вхідні дані: очікується ${i.expected}, отримано ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"число";case"object":if(Array.isArray(e))return"масив";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Неправильні вхідні дані: очікується ${eF(i.values[0])}`;return`Неправильна опція: очікується одне з ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Занадто велике: очікується, що ${i.origin??"значення"} ${n.verb} ${t}${i.maximum.toString()} ${n.unit??"елементів"}`;return`Занадто велике: очікується, що ${i.origin??"значення"} буде ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Занадто мале: очікується, що ${i.origin} ${n.verb} ${t}${i.minimum.toString()} ${n.unit}`;return`Занадто мале: очікується, що ${i.origin} буде ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Неправильний рядок: повинен починатися з "${i.prefix}"`;if("ends_with"===i.format)return`Неправильний рядок: повинен закінчуватися на "${i.suffix}"`;if("includes"===i.format)return`Неправильний рядок: повинен містити "${i.includes}"`;if("regex"===i.format)return`Неправильний рядок: повинен відповідати шаблону ${i.pattern}`;return`Неправильний ${t[i.format]??i.format}`;case"not_multiple_of":return`Неправильне число: повинно бути кратним ${i.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${i.keys.length>1?"і":""}: ${ew(i.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${i.origin}`;case"invalid_union":default:return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${i.origin}`}})}},"ur",0,function(){let e,t;return{localeError:(e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}},t={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},i=>{switch(i.code){case"invalid_type":return`غلط ان پٹ: ${i.expected} متوقع تھا، ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"نمبر";case"object":if(Array.isArray(e))return"آرے";if(null===e)return"نل";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)} موصول ہوا`;case"invalid_value":if(1===i.values.length)return`غلط ان پٹ: ${eF(i.values[0])} متوقع تھا`;return`غلط آپشن: ${ew(i.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`بہت بڑا: ${i.origin??"ویلیو"} کے ${t}${i.maximum.toString()} ${n.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${i.origin??"ویلیو"} کا ${t}${i.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`بہت چھوٹا: ${i.origin} کے ${t}${i.minimum.toString()} ${n.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${i.origin} کا ${t}${i.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":if("starts_with"===i.format)return`غلط سٹرنگ: "${i.prefix}" سے شروع ہونا چاہیے`;if("ends_with"===i.format)return`غلط سٹرنگ: "${i.suffix}" پر ختم ہونا چاہیے`;if("includes"===i.format)return`غلط سٹرنگ: "${i.includes}" شامل ہونا چاہیے`;if("regex"===i.format)return`غلط سٹرنگ: پیٹرن ${i.pattern} سے میچ ہونا چاہیے`;return`غلط ${t[i.format]??i.format}`;case"not_multiple_of":return`غلط نمبر: ${i.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${i.keys.length>1?"ز":""}: ${ew(i.keys,"، ")}`;case"invalid_key":return`${i.origin} میں غلط کی`;case"invalid_union":default:return"غلط ان پٹ";case"invalid_element":return`${i.origin} میں غلط ویلیو`}})}},"vi",0,function(){let e,t;return{localeError:(e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}},t={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},i=>{switch(i.code){case"invalid_type":return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${i.expected}, nhận được ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"số";case"object":if(Array.isArray(e))return"mảng";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`Đầu v\xe0o kh\xf4ng hợp lệ: mong đợi ${eF(i.values[0])}`;return`T\xf9y chọn kh\xf4ng hợp lệ: mong đợi một trong c\xe1c gi\xe1 trị ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`Qu\xe1 lớn: mong đợi ${i.origin??"giá trị"} ${n.verb} ${t}${i.maximum.toString()} ${n.unit??"phần tử"}`;return`Qu\xe1 lớn: mong đợi ${i.origin??"giá trị"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`Qu\xe1 nhỏ: mong đợi ${i.origin} ${n.verb} ${t}${i.minimum.toString()} ${n.unit}`;return`Qu\xe1 nhỏ: mong đợi ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`Chuỗi kh\xf4ng hợp lệ: phải bắt đầu bằng "${i.prefix}"`;if("ends_with"===i.format)return`Chuỗi kh\xf4ng hợp lệ: phải kết th\xfac bằng "${i.suffix}"`;if("includes"===i.format)return`Chuỗi kh\xf4ng hợp lệ: phải bao gồm "${i.includes}"`;if("regex"===i.format)return`Chuỗi kh\xf4ng hợp lệ: phải khớp với mẫu ${i.pattern}`;return`${t[i.format]??i.format} kh\xf4ng hợp lệ`;case"not_multiple_of":return`Số kh\xf4ng hợp lệ: phải l\xe0 bội số của ${i.divisor}`;case"unrecognized_keys":return`Kh\xf3a kh\xf4ng được nhận dạng: ${ew(i.keys,", ")}`;case"invalid_key":return`Kh\xf3a kh\xf4ng hợp lệ trong ${i.origin}`;case"invalid_union":default:return"Đầu vào không hợp lệ";case"invalid_element":return`Gi\xe1 trị kh\xf4ng hợp lệ trong ${i.origin}`}})}},"zhCN",0,function(){let e,t;return{localeError:(e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}},t={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},i=>{switch(i.code){case"invalid_type":return`无效输入:期望 ${i.expected},实际接收 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"非数字(NaN)":"数字";case"object":if(Array.isArray(e))return"数组";if(null===e)return"空值(null)";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`无效输入:期望 ${eF(i.values[0])}`;return`无效选项:期望以下之一 ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`数值过大:期望 ${i.origin??"值"} ${t}${i.maximum.toString()} ${n.unit??"个元素"}`;return`数值过大:期望 ${i.origin??"值"} ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`数值过小:期望 ${i.origin} ${t}${i.minimum.toString()} ${n.unit}`;return`数值过小:期望 ${i.origin} ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`无效字符串:必须以 "${i.prefix}" 开头`;if("ends_with"===i.format)return`无效字符串:必须以 "${i.suffix}" 结尾`;if("includes"===i.format)return`无效字符串:必须包含 "${i.includes}"`;if("regex"===i.format)return`无效字符串:必须满足正则表达式 ${i.pattern}`;return`无效${t[i.format]??i.format}`;case"not_multiple_of":return`无效数字:必须是 ${i.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${ew(i.keys,", ")}`;case"invalid_key":return`${i.origin} 中的键(key)无效`;case"invalid_union":default:return"无效输入";case"invalid_element":return`${i.origin} 中包含无效值(value)`}})}},"zhTW",0,function(){let e,t;return{localeError:(e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}},t={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},i=>{switch(i.code){case"invalid_type":return`無效的輸入值:預期為 ${i.expected},但收到 ${(e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":if(Array.isArray(e))return"array";if(null===e)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}return t})(i.input)}`;case"invalid_value":if(1===i.values.length)return`無效的輸入值:預期為 ${eF(i.values[0])}`;return`無效的選項:預期為以下其中之一 ${ew(i.values,"|")}`;case"too_big":{let t=i.inclusive?"<=":"<",n=e[i.origin]??null;if(n)return`數值過大:預期 ${i.origin??"值"} 應為 ${t}${i.maximum.toString()} ${n.unit??"個元素"}`;return`數值過大:預期 ${i.origin??"值"} 應為 ${t}${i.maximum.toString()}`}case"too_small":{let t=i.inclusive?">=":">",n=e[i.origin]??null;if(n)return`數值過小:預期 ${i.origin} 應為 ${t}${i.minimum.toString()} ${n.unit}`;return`數值過小:預期 ${i.origin} 應為 ${t}${i.minimum.toString()}`}case"invalid_format":if("starts_with"===i.format)return`無效的字串:必須以 "${i.prefix}" 開頭`;if("ends_with"===i.format)return`無效的字串:必須以 "${i.suffix}" 結尾`;if("includes"===i.format)return`無效的字串:必須包含 "${i.includes}"`;if("regex"===i.format)return`無效的字串:必須符合格式 ${i.pattern}`;return`無效的 ${t[i.format]??i.format}`;case"not_multiple_of":return`無效的數字:必須為 ${i.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${i.keys.length>1?"們":""}:${ew(i.keys,"、")}`;case"invalid_key":return`${i.origin} 中有無效的鍵值`;case"invalid_union":default:return"無效的輸入值";case"invalid_element":return`${i.origin} 中有無效的值`}})}}],242625);var aX=e.i(242625);function aQ(e,t){return new e({type:"string",...ez(t)})}function aJ(e,t){return new e({type:"string",coerce:!0,...ez(t)})}function a0(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ez(t)})}function a1(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ez(t)})}function a2(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ez(t)})}function a3(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ez(t)})}function a5(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ez(t)})}function a4(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ez(t)})}function a6(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ez(t)})}function a9(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ez(t)})}function a8(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ez(t)})}function a7(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ez(t)})}function re(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ez(t)})}function rt(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ez(t)})}function ri(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ez(t)})}function rn(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ez(t)})}function ra(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ez(t)})}function rr(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ez(t)})}function ro(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ez(t)})}function rs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ez(t)})}function rl(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ez(t)})}function rd(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ez(t)})}function rc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ez(t)})}function ru(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ez(t)})}e.i(268808),e.i(334861);let rp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function rh(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ez(t)})}function rm(e,t){return new e({type:"string",format:"date",check:"string_format",...ez(t)})}function rg(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ez(t)})}function rf(e,t){return new e({type:"string",format:"duration",check:"string_format",...ez(t)})}function rb(e,t){return new e({type:"number",checks:[],...ez(t)})}function rx(e,t){return new e({type:"number",coerce:!0,checks:[],...ez(t)})}function ry(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ez(t)})}function rv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ez(t)})}function rC(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ez(t)})}function rw(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ez(t)})}function rS(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ez(t)})}function rk(e,t){return new e({type:"boolean",...ez(t)})}function rA(e,t){return new e({type:"boolean",coerce:!0,...ez(t)})}function rE(e,t){return new e({type:"bigint",...ez(t)})}function r_(e,t){return new e({type:"bigint",coerce:!0,...ez(t)})}function rI(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ez(t)})}function rM(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ez(t)})}function rT(e,t){return new e({type:"symbol",...ez(t)})}function rL(e,t){return new e({type:"undefined",...ez(t)})}function rj(e,t){return new e({type:"null",...ez(t)})}function rP(e){return new e({type:"any"})}function rD(e){return new e({type:"unknown"})}function rN(e,t){return new e({type:"never",...ez(t)})}function rR(e,t){return new e({type:"void",...ez(t)})}function rO(e,t){return new e({type:"date",...ez(t)})}function rB(e,t){return new e({type:"date",coerce:!0,...ez(t)})}function rz(e,t){return new e({type:"nan",...ez(t)})}function rF(e,t){return new na({check:"less_than",...ez(t),value:e,inclusive:!1})}function rH(e,t){return new na({check:"less_than",...ez(t),value:e,inclusive:!0})}function rW(e,t){return new nr({check:"greater_than",...ez(t),value:e,inclusive:!1})}function rU(e,t){return new nr({check:"greater_than",...ez(t),value:e,inclusive:!0})}function rV(e){return rW(0,e)}function rG(e){return rF(0,e)}function r$(e){return rH(0,e)}function rZ(e){return rU(0,e)}function rK(e,t){return new no({check:"multiple_of",...ez(t),value:e})}function rq(e,t){return new nd({check:"max_size",...ez(t),maximum:e})}function rY(e,t){return new nc({check:"min_size",...ez(t),minimum:e})}function rX(e,t){return new nu({check:"size_equals",...ez(t),size:e})}function rQ(e,t){return new np({check:"max_length",...ez(t),maximum:e})}function rJ(e,t){return new nh({check:"min_length",...ez(t),minimum:e})}function r0(e,t){return new nm({check:"length_equals",...ez(t),length:e})}function r1(e,t){return new nf({check:"string_format",format:"regex",...ez(t),pattern:e})}function r2(e){return new nb({check:"string_format",format:"lowercase",...ez(e)})}function r3(e){return new nx({check:"string_format",format:"uppercase",...ez(e)})}function r5(e,t){return new ny({check:"string_format",format:"includes",...ez(t),includes:e})}function r4(e,t){return new nv({check:"string_format",format:"starts_with",...ez(t),prefix:e})}function r6(e,t){return new nC({check:"string_format",format:"ends_with",...ez(t),suffix:e})}function r9(e,t,i){return new nS({check:"property",property:e,schema:t,...ez(i)})}function r8(e,t){return new nk({check:"mime_type",mime:e,...ez(t)})}function r7(e){return new nA({check:"overwrite",tx:e})}function oe(e){return r7(t=>t.normalize(e))}function ot(){return r7(e=>e.trim())}function oi(){return r7(e=>e.toLowerCase())}function on(){return r7(e=>e.toUpperCase())}function oa(e,t,i){return new e({type:"array",element:t,...ez(i)})}function or(e,t,i){return new e({type:"union",options:t,...ez(i)})}function oo(e,t,i,n){return new e({type:"union",options:i,discriminator:t,...ez(n)})}function os(e,t,i){return new e({type:"intersection",left:t,right:i})}function ol(e,t,i,n){let a=i instanceof nI,r=a?n:i;return new e({type:"tuple",items:t,rest:a?i:null,...ez(r)})}function od(e,t,i,n){return new e({type:"record",keyType:t,valueType:i,...ez(n)})}function oc(e,t,i,n){return new e({type:"map",keyType:t,valueType:i,...ez(n)})}function ou(e,t,i){return new e({type:"set",valueType:t,...ez(i)})}function op(e,t,i){return new e({type:"enum",entries:Array.isArray(t)?Object.fromEntries(t.map(e=>[e,e])):t,...ez(i)})}function oh(e,t,i){return new e({type:"enum",entries:t,...ez(i)})}function om(e,t,i){return new e({type:"literal",values:Array.isArray(t)?t:[t],...ez(i)})}function og(e,t){return new e({type:"file",...ez(t)})}function of(e,t){return new e({type:"transform",transform:t})}function ob(e,t){return new e({type:"optional",innerType:t})}function ox(e,t){return new e({type:"nullable",innerType:t})}function oy(e,t,i){return new e({type:"default",innerType:t,get defaultValue(){return"function"==typeof i?i():i}})}function ov(e,t,i){return new e({type:"nonoptional",innerType:t,...ez(i)})}function oC(e,t){return new e({type:"success",innerType:t})}function ow(e,t,i){return new e({type:"catch",innerType:t,catchValue:"function"==typeof i?i:()=>i})}function oS(e,t,i){return new e({type:"pipe",in:t,out:i})}function ok(e,t){return new e({type:"readonly",innerType:t})}function oA(e,t,i){return new e({type:"template_literal",parts:t,...ez(i)})}function oE(e,t){return new e({type:"lazy",getter:t})}function o_(e,t){return new e({type:"promise",innerType:t})}function oI(e,t,i){let n=ez(i);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function oM(e,t,i){return new e({type:"custom",check:"custom",fn:t,...ez(i)})}function oT(e,t){let i=ez(t),n=i.truthy??["true","1","yes","on","y","enabled"],a=i.falsy??["false","0","no","off","n","disabled"];"sensitive"!==i.case&&(n=n.map(e=>"string"==typeof e?e.toLowerCase():e),a=a.map(e=>"string"==typeof e?e.toLowerCase():e));let r=new Set(n),o=new Set(a),s=e.Pipe??aB,l=e.Boolean??n6,d=e.String??nM,c=new(e.Transform??a_)({type:"transform",transform:(e,t)=>{let n=e;return"sensitive"!==i.case&&(n=n.toLowerCase()),!!r.has(n)||!o.has(n)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...r,...o],input:t.value,inst:c}),{})},error:i.error}),u=new s({type:"pipe",in:new d({type:"string",error:i.error}),out:c,error:i.error});return new s({type:"pipe",in:u,out:new l({type:"boolean",error:i.error}),error:i.error})}function oL(e,t,i,n={}){let a=ez(n),r={...ez(n),check:"string_format",type:"string",format:t,fn:"function"==typeof i?i:e=>i.test(e),...a};return i instanceof RegExp&&(r.pattern=i),new e(r)}e.s(["TimePrecision",0,rp,"_any",0,rP,"_array",0,oa,"_base64",0,rl,"_base64url",0,rd,"_bigint",0,rE,"_boolean",0,rk,"_catch",0,ow,"_cidrv4",0,ro,"_cidrv6",0,rs,"_coercedBigint",0,r_,"_coercedBoolean",0,rA,"_coercedDate",0,rB,"_coercedNumber",0,rx,"_coercedString",0,aJ,"_cuid",0,a7,"_cuid2",0,re,"_custom",0,oI,"_date",0,rO,"_default",0,oy,"_discriminatedUnion",0,oo,"_e164",0,rc,"_email",0,a0,"_emoji",0,a9,"_endsWith",0,r6,"_enum",0,op,"_file",0,og,"_float32",0,rv,"_float64",0,rC,"_gt",0,rW,"_gte",0,rU,"_guid",0,a1,"_includes",0,r5,"_int",0,ry,"_int32",0,rw,"_int64",0,rI,"_intersection",0,os,"_ipv4",0,ra,"_ipv6",0,rr,"_isoDate",0,rm,"_isoDateTime",0,rh,"_isoDuration",0,rf,"_isoTime",0,rg,"_jwt",0,ru,"_ksuid",0,rn,"_lazy",0,oE,"_length",0,r0,"_literal",0,om,"_lowercase",0,r2,"_lt",0,rF,"_lte",0,rH,"_map",0,oc,"_max",0,rH,"_maxLength",0,rQ,"_maxSize",0,rq,"_mime",0,r8,"_min",0,rU,"_minLength",0,rJ,"_minSize",0,rY,"_multipleOf",0,rK,"_nan",0,rz,"_nanoid",0,a8,"_nativeEnum",0,oh,"_negative",0,rG,"_never",0,rN,"_nonnegative",0,rZ,"_nonoptional",0,ov,"_nonpositive",0,r$,"_normalize",0,oe,"_null",0,rj,"_nullable",0,ox,"_number",0,rb,"_optional",0,ob,"_overwrite",0,r7,"_pipe",0,oS,"_positive",0,rV,"_promise",0,o_,"_property",0,r9,"_readonly",0,ok,"_record",0,od,"_refine",0,oM,"_regex",0,r1,"_set",0,ou,"_size",0,rX,"_startsWith",0,r4,"_string",0,aQ,"_stringFormat",0,oL,"_stringbool",0,oT,"_success",0,oC,"_symbol",0,rT,"_templateLiteral",0,oA,"_toLowerCase",0,oi,"_toUpperCase",0,on,"_transform",0,of,"_trim",0,ot,"_tuple",0,ol,"_uint32",0,rS,"_uint64",0,rM,"_ulid",0,rt,"_undefined",0,rL,"_union",0,or,"_unknown",0,rD,"_uppercase",0,r3,"_url",0,a6,"_uuid",0,a2,"_uuidv4",0,a3,"_uuidv6",0,a5,"_uuidv7",0,a4,"_void",0,rR,"_xid",0,ri],595732);class oj{constructor(e){this._def=e,this.def=e}implement(e){if("function"!=typeof e)throw Error("implement() must be called with a function");let t=(...i)=>{let n=this._def.input?e6(this._def.input,i,void 0,{callee:t}):i;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=e(...n);return this._def.output?e6(this._def.output,a,void 0,{callee:t}):a};return t}implementAsync(e){if("function"!=typeof e)throw Error("implement() must be called with a function");let t=async(...i)=>{let n=this._def.input?await e8(this._def.input,i,void 0,{callee:t}):i;if(!Array.isArray(n))throw Error("Invalid arguments schema: not an array or tuple schema.");let a=await e(...n);return this._def.output?e8(this._def.output,a,void 0,{callee:t}):a};return t}input(...e){let t=this.constructor;return new t(Array.isArray(e[0])?{type:"function",input:new ab({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}:{type:"function",input:e[0],output:this._def.output})}output(e){return new this.constructor({type:"function",input:this._def.input,output:e})}}function oP(e){return new oj({type:"function",input:Array.isArray(e?.input)?ol(ab,e?.input):e?.input??oa(al,rD(an)),output:e?.output??rD(an)})}e.s(["$ZodFunction",0,oj,"function",0,oP],935981),e.i(935981),e.i(595732),e.i(87434),e.s([],594440);var oD=e.i(594440);e.s(["$ZodAny",0,ai,"$ZodArray",0,al,"$ZodAsyncError",0,ex,"$ZodBase64",0,nX,"$ZodBase64URL",0,nJ,"$ZodBigInt",0,n9,"$ZodBigIntFormat",0,n8,"$ZodBoolean",0,n6,"$ZodCIDRv4",0,nK,"$ZodCIDRv6",0,nq,"$ZodCUID",0,nO,"$ZodCUID2",0,nB,"$ZodCatch",0,aR,"$ZodCheck",0,ni,"$ZodCheckBigIntFormat",0,nl,"$ZodCheckEndsWith",0,nC,"$ZodCheckGreaterThan",0,nr,"$ZodCheckIncludes",0,ny,"$ZodCheckLengthEquals",0,nm,"$ZodCheckLessThan",0,na,"$ZodCheckLowerCase",0,nb,"$ZodCheckMaxLength",0,np,"$ZodCheckMaxSize",0,nd,"$ZodCheckMimeType",0,nk,"$ZodCheckMinLength",0,nh,"$ZodCheckMinSize",0,nc,"$ZodCheckMultipleOf",0,no,"$ZodCheckNumberFormat",0,ns,"$ZodCheckOverwrite",0,nA,"$ZodCheckProperty",0,nS,"$ZodCheckRegex",0,nf,"$ZodCheckSizeEquals",0,nu,"$ZodCheckStartsWith",0,nv,"$ZodCheckStringFormat",0,ng,"$ZodCheckUpperCase",0,nx,"$ZodCustom",0,aG,"$ZodCustomStringFormat",0,n3,"$ZodDate",0,ao,"$ZodDefault",0,aT,"$ZodDiscriminatedUnion",0,am,"$ZodE164",0,n0,"$ZodEmail",0,nP,"$ZodEmoji",0,nN,"$ZodEnum",0,ak,"$ZodError",0,eQ,"$ZodFile",0,aE,"$ZodFunction",0,oj,"$ZodGUID",0,nL,"$ZodIPv4",0,n$,"$ZodIPv6",0,nZ,"$ZodISODate",0,nU,"$ZodISODateTime",0,nW,"$ZodISODuration",0,nG,"$ZodISOTime",0,nV,"$ZodIntersection",0,ag,"$ZodJWT",0,n2,"$ZodKSUID",0,nH,"$ZodLazy",0,aV,"$ZodLiteral",0,aA,"$ZodMap",0,av,"$ZodNaN",0,aO,"$ZodNanoID",0,nR,"$ZodNever",0,aa,"$ZodNonOptional",0,aP,"$ZodNull",0,at,"$ZodNullable",0,aM,"$ZodNumber",0,n5,"$ZodNumberFormat",0,n4,"$ZodObject",0,au,"$ZodOptional",0,aI,"$ZodPipe",0,aB,"$ZodPrefault",0,aj,"$ZodPromise",0,aU,"$ZodReadonly",0,aF,"$ZodRealError",0,eJ,"$ZodRecord",0,ay,"$ZodRegistry",0,tp,"$ZodSet",0,aw,"$ZodString",0,nM,"$ZodStringFormat",0,nT,"$ZodSuccess",0,aN,"$ZodSymbol",0,n7,"$ZodTemplateLiteral",0,aW,"$ZodTransform",0,a_,"$ZodTuple",0,ab,"$ZodType",0,nI,"$ZodULID",0,nz,"$ZodURL",0,nD,"$ZodUUID",0,nj,"$ZodUndefined",0,ae,"$ZodUnion",0,ah,"$ZodUnknown",0,an,"$ZodVoid",0,ar,"$ZodXID",0,nF,"$brand",0,eb,"$constructor",0,ef,"$input",0,tu,"$output",0,tc,"Doc",0,nE,"JSONSchema",0,oD,"JSONSchemaGenerator",0,tg,"NEVER",0,eg,"TimePrecision",0,rp,"_any",0,rP,"_array",0,oa,"_base64",0,rl,"_base64url",0,rd,"_bigint",0,rE,"_boolean",0,rk,"_catch",0,ow,"_cidrv4",0,ro,"_cidrv6",0,rs,"_coercedBigint",0,r_,"_coercedBoolean",0,rA,"_coercedDate",0,rB,"_coercedNumber",0,rx,"_coercedString",0,aJ,"_cuid",0,a7,"_cuid2",0,re,"_custom",0,oI,"_date",0,rO,"_default",0,oy,"_discriminatedUnion",0,oo,"_e164",0,rc,"_email",0,a0,"_emoji",0,a9,"_endsWith",0,r6,"_enum",0,op,"_file",0,og,"_float32",0,rv,"_float64",0,rC,"_gt",0,rW,"_gte",0,rU,"_guid",0,a1,"_includes",0,r5,"_int",0,ry,"_int32",0,rw,"_int64",0,rI,"_intersection",0,os,"_ipv4",0,ra,"_ipv6",0,rr,"_isoDate",0,rm,"_isoDateTime",0,rh,"_isoDuration",0,rf,"_isoTime",0,rg,"_jwt",0,ru,"_ksuid",0,rn,"_lazy",0,oE,"_length",0,r0,"_literal",0,om,"_lowercase",0,r2,"_lt",0,rF,"_lte",0,rH,"_map",0,oc,"_max",0,rH,"_maxLength",0,rQ,"_maxSize",0,rq,"_mime",0,r8,"_min",0,rU,"_minLength",0,rJ,"_minSize",0,rY,"_multipleOf",0,rK,"_nan",0,rz,"_nanoid",0,a8,"_nativeEnum",0,oh,"_negative",0,rG,"_never",0,rN,"_nonnegative",0,rZ,"_nonoptional",0,ov,"_nonpositive",0,r$,"_normalize",0,oe,"_null",0,rj,"_nullable",0,ox,"_number",0,rb,"_optional",0,ob,"_overwrite",0,r7,"_parse",0,e4,"_parseAsync",0,e9,"_pipe",0,oS,"_positive",0,rV,"_promise",0,o_,"_property",0,r9,"_readonly",0,ok,"_record",0,od,"_refine",0,oM,"_regex",0,r1,"_safeParse",0,e7,"_safeParseAsync",0,tt,"_set",0,ou,"_size",0,rX,"_startsWith",0,r4,"_string",0,aQ,"_stringFormat",0,oL,"_stringbool",0,oT,"_success",0,oC,"_symbol",0,rT,"_templateLiteral",0,oA,"_toLowerCase",0,oi,"_toUpperCase",0,on,"_transform",0,of,"_trim",0,ot,"_tuple",0,ol,"_uint32",0,rS,"_uint64",0,rM,"_ulid",0,rt,"_undefined",0,rL,"_union",0,or,"_unknown",0,rD,"_uppercase",0,r3,"_url",0,a6,"_uuid",0,a2,"_uuidv4",0,a3,"_uuidv6",0,a5,"_uuidv7",0,a4,"_void",0,rR,"_xid",0,ri,"clone",0,eB,"config",0,ev,"flattenError",0,e0,"formatError",0,e1,"function",0,oP,"globalConfig",0,ey,"globalRegistry",0,tm,"isValidBase64",0,nY,"isValidBase64URL",0,nQ,"isValidJWT",0,n1,"locales",0,aX,"parse",0,e6,"parseAsync",0,e8,"prettifyError",0,e5,"regexes",0,aK,"registry",0,th,"safeParse",0,te,"safeParseAsync",0,ti,"toDotPath",0,e3,"toJSONSchema",0,tf,"treeifyError",0,e2,"util",0,aZ,"version",0,n_],755766);var oN=e.i(755766);e.s(["ZodAny",()=>sq,"ZodArray",()=>s4,"ZodBase64",()=>sx,"ZodBase64URL",()=>sv,"ZodBigInt",()=>sB,"ZodBigIntFormat",()=>sF,"ZodBoolean",()=>sR,"ZodCIDRv4",()=>sm,"ZodCIDRv6",()=>sf,"ZodCUID",()=>se,"ZodCUID2",()=>si,"ZodCatch",()=>lz,"ZodCustom",()=>lJ,"ZodCustomStringFormat",()=>sE,"ZodDate",()=>s3,"ZodDefault",()=>lL,"ZodDiscriminatedUnion",()=>la,"ZodE164",()=>sw,"ZodEmail",()=>oq,"ZodEmoji",()=>o6,"ZodEnum",()=>lb,"ZodFile",()=>lw,"ZodGUID",()=>oX,"ZodIPv4",()=>sc,"ZodIPv6",()=>sp,"ZodIntersection",()=>lo,"ZodJWT",()=>sk,"ZodKSUID",()=>sl,"ZodLazy",()=>lq,"ZodLiteral",()=>lv,"ZodMap",()=>lh,"ZodNaN",()=>lH,"ZodNanoID",()=>o8,"ZodNever",()=>sJ,"ZodNonOptional",()=>lN,"ZodNull",()=>sZ,"ZodNullable",()=>lI,"ZodNumber",()=>sI,"ZodNumberFormat",()=>sT,"ZodObject",()=>s8,"ZodOptional",()=>lE,"ZodPipe",()=>lU,"ZodPrefault",()=>lP,"ZodPromise",()=>lX,"ZodReadonly",()=>lG,"ZodRecord",()=>lc,"ZodSet",()=>lg,"ZodString",()=>o$,"ZodStringFormat",()=>oK,"ZodSuccess",()=>lO,"ZodSymbol",()=>sU,"ZodTemplateLiteral",()=>lZ,"ZodTransform",()=>lk,"ZodTuple",()=>ll,"ZodType",()=>oV,"ZodULID",()=>sa,"ZodURL",()=>o5,"ZodUUID",()=>oJ,"ZodUndefined",()=>sG,"ZodUnion",()=>li,"ZodUnknown",()=>sX,"ZodVoid",()=>s1,"ZodXID",()=>so,"_ZodString",()=>oG,"_default",()=>lj,"any",()=>sY,"array",()=>s6,"base64",()=>sy,"base64url",()=>sC,"bigint",()=>sz,"boolean",()=>sO,"catch",()=>lF,"check",()=>l0,"cidrv4",()=>sg,"cidrv6",()=>sb,"cuid",()=>st,"cuid2",()=>sn,"custom",()=>l1,"date",()=>s5,"discriminatedUnion",()=>lr,"e164",()=>sS,"email",()=>oY,"emoji",()=>o9,"enum",()=>lx,"file",()=>lS,"float32",()=>sj,"float64",()=>sP,"guid",()=>oQ,"instanceof",()=>l5,"int",()=>sL,"int32",()=>sD,"int64",()=>sH,"intersection",()=>ls,"ipv4",()=>su,"ipv6",()=>sh,"json",()=>l6,"jwt",()=>sA,"keyof",()=>s9,"ksuid",()=>sd,"lazy",()=>lY,"literal",()=>lC,"looseObject",()=>lt,"map",()=>lm,"nan",()=>lW,"nanoid",()=>o7,"nativeEnum",()=>ly,"never",()=>s0,"nonoptional",()=>lR,"null",()=>sK,"nullable",()=>lM,"nullish",()=>lT,"number",()=>sM,"object",()=>s7,"optional",()=>l_,"partialRecord",()=>lp,"pipe",()=>lV,"prefault",()=>lD,"preprocess",()=>l9,"promise",()=>lQ,"readonly",()=>l$,"record",()=>lu,"refine",()=>l2,"set",()=>lf,"strictObject",()=>le,"string",()=>oZ,"stringFormat",()=>s_,"stringbool",()=>l4,"success",()=>lB,"superRefine",()=>l3,"symbol",()=>sV,"templateLiteral",()=>lK,"transform",()=>lA,"tuple",()=>ld,"uint32",()=>sN,"uint64",()=>sW,"ulid",()=>sr,"undefined",()=>s$,"union",()=>ln,"unknown",()=>sQ,"url",()=>o4,"uuid",()=>o0,"uuidv4",()=>o1,"uuidv6",()=>o2,"uuidv7",()=>o3,"void",()=>s2,"xid",()=>ss],600498);e.s(["ZodISODate",()=>oB,"ZodISODateTime",()=>oR,"ZodISODuration",()=>oW,"ZodISOTime",()=>oF,"date",()=>oz,"datetime",()=>oO,"duration",()=>oU,"time",()=>oH],427621);let oR=ef("ZodISODateTime",(e,t)=>{nW.init(e,t),oK.init(e,t)});function oO(e){return rh(oR,e)}let oB=ef("ZodISODate",(e,t)=>{nU.init(e,t),oK.init(e,t)});function oz(e){return rm(oB,e)}let oF=ef("ZodISOTime",(e,t)=>{nV.init(e,t),oK.init(e,t)});function oH(e){return rg(oF,e)}let oW=ef("ZodISODuration",(e,t)=>{nG.init(e,t),oK.init(e,t)});function oU(e){return rf(oW,e)}let oV=ef("ZodType",(e,t)=>(nI.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[],...i.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,i)=>eB(e,t,i),e.brand=()=>e,e.register=(t,i)=>(t.add(e,i),e),e.parse=(t,i)=>to(e,t,i,{callee:e.parse}),e.safeParse=(t,i)=>tl(e,t,i),e.parseAsync=async(t,i)=>ts(e,t,i,{callee:e.parseAsync}),e.safeParseAsync=async(t,i)=>td(e,t,i),e.spa=e.safeParseAsync,e.refine=(t,i)=>e.check(l2(t,i)),e.superRefine=t=>e.check(l3(t)),e.overwrite=t=>e.check(r7(t)),e.optional=()=>l_(e),e.nullable=()=>lM(e),e.nullish=()=>l_(lM(e)),e.nonoptional=t=>lR(e,t),e.array=()=>s6(e),e.or=t=>ln([e,t]),e.and=t=>ls(e,t),e.transform=t=>lV(e,lA(t)),e.default=t=>lj(e,t),e.prefault=t=>lD(e,t),e.catch=t=>lF(e,t),e.pipe=t=>lV(e,t),e.readonly=()=>l$(e),e.describe=t=>{let i=e.clone();return tm.add(i,{description:t}),i},Object.defineProperty(e,"description",{get:()=>tm.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return tm.get(e);let i=e.clone();return tm.add(i,t[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),oG=ef("_ZodString",(e,t)=>{nM.init(e,t),oV.init(e,t);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...t)=>e.check(r1(...t)),e.includes=(...t)=>e.check(r5(...t)),e.startsWith=(...t)=>e.check(r4(...t)),e.endsWith=(...t)=>e.check(r6(...t)),e.min=(...t)=>e.check(rJ(...t)),e.max=(...t)=>e.check(rQ(...t)),e.length=(...t)=>e.check(r0(...t)),e.nonempty=(...t)=>e.check(rJ(1,...t)),e.lowercase=t=>e.check(r2(t)),e.uppercase=t=>e.check(r3(t)),e.trim=()=>e.check(ot()),e.normalize=(...t)=>e.check(oe(...t)),e.toLowerCase=()=>e.check(oi()),e.toUpperCase=()=>e.check(on())}),o$=ef("ZodString",(e,t)=>{nM.init(e,t),oG.init(e,t),e.email=t=>e.check(a0(oq,t)),e.url=t=>e.check(a6(o5,t)),e.jwt=t=>e.check(ru(sk,t)),e.emoji=t=>e.check(a9(o6,t)),e.guid=t=>e.check(a1(oX,t)),e.uuid=t=>e.check(a2(oJ,t)),e.uuidv4=t=>e.check(a3(oJ,t)),e.uuidv6=t=>e.check(a5(oJ,t)),e.uuidv7=t=>e.check(a4(oJ,t)),e.nanoid=t=>e.check(a8(o8,t)),e.guid=t=>e.check(a1(oX,t)),e.cuid=t=>e.check(a7(se,t)),e.cuid2=t=>e.check(re(si,t)),e.ulid=t=>e.check(rt(sa,t)),e.base64=t=>e.check(rl(sx,t)),e.base64url=t=>e.check(rd(sv,t)),e.xid=t=>e.check(ri(so,t)),e.ksuid=t=>e.check(rn(sl,t)),e.ipv4=t=>e.check(ra(sc,t)),e.ipv6=t=>e.check(rr(sp,t)),e.cidrv4=t=>e.check(ro(sm,t)),e.cidrv6=t=>e.check(rs(sf,t)),e.e164=t=>e.check(rc(sw,t)),e.datetime=t=>e.check(oO(t)),e.date=t=>e.check(oz(t)),e.time=t=>e.check(oH(t)),e.duration=t=>e.check(oU(t))});function oZ(e){return aQ(o$,e)}let oK=ef("ZodStringFormat",(e,t)=>{nT.init(e,t),oG.init(e,t)}),oq=ef("ZodEmail",(e,t)=>{nP.init(e,t),oK.init(e,t)});function oY(e){return a0(oq,e)}let oX=ef("ZodGUID",(e,t)=>{nL.init(e,t),oK.init(e,t)});function oQ(e){return a1(oX,e)}let oJ=ef("ZodUUID",(e,t)=>{nj.init(e,t),oK.init(e,t)});function o0(e){return a2(oJ,e)}function o1(e){return a3(oJ,e)}function o2(e){return a5(oJ,e)}function o3(e){return a4(oJ,e)}let o5=ef("ZodURL",(e,t)=>{nD.init(e,t),oK.init(e,t)});function o4(e){return a6(o5,e)}let o6=ef("ZodEmoji",(e,t)=>{nN.init(e,t),oK.init(e,t)});function o9(e){return a9(o6,e)}let o8=ef("ZodNanoID",(e,t)=>{nR.init(e,t),oK.init(e,t)});function o7(e){return a8(o8,e)}let se=ef("ZodCUID",(e,t)=>{nO.init(e,t),oK.init(e,t)});function st(e){return a7(se,e)}let si=ef("ZodCUID2",(e,t)=>{nB.init(e,t),oK.init(e,t)});function sn(e){return re(si,e)}let sa=ef("ZodULID",(e,t)=>{nz.init(e,t),oK.init(e,t)});function sr(e){return rt(sa,e)}let so=ef("ZodXID",(e,t)=>{nF.init(e,t),oK.init(e,t)});function ss(e){return ri(so,e)}let sl=ef("ZodKSUID",(e,t)=>{nH.init(e,t),oK.init(e,t)});function sd(e){return rn(sl,e)}let sc=ef("ZodIPv4",(e,t)=>{n$.init(e,t),oK.init(e,t)});function su(e){return ra(sc,e)}let sp=ef("ZodIPv6",(e,t)=>{nZ.init(e,t),oK.init(e,t)});function sh(e){return rr(sp,e)}let sm=ef("ZodCIDRv4",(e,t)=>{nK.init(e,t),oK.init(e,t)});function sg(e){return ro(sm,e)}let sf=ef("ZodCIDRv6",(e,t)=>{nq.init(e,t),oK.init(e,t)});function sb(e){return rs(sf,e)}let sx=ef("ZodBase64",(e,t)=>{nX.init(e,t),oK.init(e,t)});function sy(e){return rl(sx,e)}let sv=ef("ZodBase64URL",(e,t)=>{nJ.init(e,t),oK.init(e,t)});function sC(e){return rd(sv,e)}let sw=ef("ZodE164",(e,t)=>{n0.init(e,t),oK.init(e,t)});function sS(e){return rc(sw,e)}let sk=ef("ZodJWT",(e,t)=>{n2.init(e,t),oK.init(e,t)});function sA(e){return ru(sk,e)}let sE=ef("ZodCustomStringFormat",(e,t)=>{n3.init(e,t),oK.init(e,t)});function s_(e,t,i={}){return oL(sE,e,t,i)}let sI=ef("ZodNumber",(e,t)=>{n5.init(e,t),oV.init(e,t),e.gt=(t,i)=>e.check(rW(t,i)),e.gte=(t,i)=>e.check(rU(t,i)),e.min=(t,i)=>e.check(rU(t,i)),e.lt=(t,i)=>e.check(rF(t,i)),e.lte=(t,i)=>e.check(rH(t,i)),e.max=(t,i)=>e.check(rH(t,i)),e.int=t=>e.check(sL(t)),e.safe=t=>e.check(sL(t)),e.positive=t=>e.check(rW(0,t)),e.nonnegative=t=>e.check(rU(0,t)),e.negative=t=>e.check(rF(0,t)),e.nonpositive=t=>e.check(rH(0,t)),e.multipleOf=(t,i)=>e.check(rK(t,i)),e.step=(t,i)=>e.check(rK(t,i)),e.finite=()=>e;let i=e._zod.bag;e.minValue=Math.max(i.minimum??-1/0,i.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(i.maximum??1/0,i.exclusiveMaximum??1/0)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function sM(e){return rb(sI,e)}let sT=ef("ZodNumberFormat",(e,t)=>{n4.init(e,t),sI.init(e,t)});function sL(e){return ry(sT,e)}function sj(e){return rv(sT,e)}function sP(e){return rC(sT,e)}function sD(e){return rw(sT,e)}function sN(e){return rS(sT,e)}let sR=ef("ZodBoolean",(e,t)=>{n6.init(e,t),oV.init(e,t)});function sO(e){return rk(sR,e)}let sB=ef("ZodBigInt",(e,t)=>{n9.init(e,t),oV.init(e,t),e.gte=(t,i)=>e.check(rU(t,i)),e.min=(t,i)=>e.check(rU(t,i)),e.gt=(t,i)=>e.check(rW(t,i)),e.gte=(t,i)=>e.check(rU(t,i)),e.min=(t,i)=>e.check(rU(t,i)),e.lt=(t,i)=>e.check(rF(t,i)),e.lte=(t,i)=>e.check(rH(t,i)),e.max=(t,i)=>e.check(rH(t,i)),e.positive=t=>e.check(rW(BigInt(0),t)),e.negative=t=>e.check(rF(BigInt(0),t)),e.nonpositive=t=>e.check(rH(BigInt(0),t)),e.nonnegative=t=>e.check(rU(BigInt(0),t)),e.multipleOf=(t,i)=>e.check(rK(t,i));let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null});function sz(e){return rE(sB,e)}let sF=ef("ZodBigIntFormat",(e,t)=>{n8.init(e,t),sB.init(e,t)});function sH(e){return rI(sF,e)}function sW(e){return rM(sF,e)}let sU=ef("ZodSymbol",(e,t)=>{n7.init(e,t),oV.init(e,t)});function sV(e){return rT(sU,e)}let sG=ef("ZodUndefined",(e,t)=>{ae.init(e,t),oV.init(e,t)});function s$(e){return rL(sG,e)}let sZ=ef("ZodNull",(e,t)=>{at.init(e,t),oV.init(e,t)});function sK(e){return rj(sZ,e)}let sq=ef("ZodAny",(e,t)=>{ai.init(e,t),oV.init(e,t)});function sY(){return rP(sq)}let sX=ef("ZodUnknown",(e,t)=>{an.init(e,t),oV.init(e,t)});function sQ(){return rD(sX)}let sJ=ef("ZodNever",(e,t)=>{aa.init(e,t),oV.init(e,t)});function s0(e){return rN(sJ,e)}let s1=ef("ZodVoid",(e,t)=>{ar.init(e,t),oV.init(e,t)});function s2(e){return rR(s1,e)}let s3=ef("ZodDate",(e,t)=>{ao.init(e,t),oV.init(e,t),e.min=(t,i)=>e.check(rU(t,i)),e.max=(t,i)=>e.check(rH(t,i));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function s5(e){return rO(s3,e)}let s4=ef("ZodArray",(e,t)=>{al.init(e,t),oV.init(e,t),e.element=t.element,e.min=(t,i)=>e.check(rJ(t,i)),e.nonempty=t=>e.check(rJ(1,t)),e.max=(t,i)=>e.check(rQ(t,i)),e.length=(t,i)=>e.check(r0(t,i)),e.unwrap=()=>e.element});function s6(e,t){return oa(s4,e,t)}function s9(e){return lC(Object.keys(e._zod.def.shape))}let s8=ef("ZodObject",(e,t)=>{au.init(e,t),oV.init(e,t),aZ.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>lx(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:sQ()}),e.loose=()=>e.clone({...e._zod.def,catchall:sQ()}),e.strict=()=>e.clone({...e._zod.def,catchall:s0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>aZ.extend(e,t),e.merge=t=>aZ.merge(e,t),e.pick=t=>aZ.pick(e,t),e.omit=t=>aZ.omit(e,t),e.partial=(...t)=>aZ.partial(lE,e,t[0]),e.required=(...t)=>aZ.required(lN,e,t[0])});function s7(e,t){return new s8({type:"object",get shape(){return aZ.assignProp(this,"shape",{...e}),this.shape},...aZ.normalizeParams(t)})}function le(e,t){return new s8({type:"object",get shape(){return aZ.assignProp(this,"shape",{...e}),this.shape},catchall:s0(),...aZ.normalizeParams(t)})}function lt(e,t){return new s8({type:"object",get shape(){return aZ.assignProp(this,"shape",{...e}),this.shape},catchall:sQ(),...aZ.normalizeParams(t)})}let li=ef("ZodUnion",(e,t)=>{ah.init(e,t),oV.init(e,t),e.options=t.options});function ln(e,t){return new li({type:"union",options:e,...aZ.normalizeParams(t)})}let la=ef("ZodDiscriminatedUnion",(e,t)=>{li.init(e,t),am.init(e,t)});function lr(e,t,i){return new la({type:"union",options:t,discriminator:e,...aZ.normalizeParams(i)})}let lo=ef("ZodIntersection",(e,t)=>{ag.init(e,t),oV.init(e,t)});function ls(e,t){return new lo({type:"intersection",left:e,right:t})}let ll=ef("ZodTuple",(e,t)=>{ab.init(e,t),oV.init(e,t),e.rest=t=>e.clone({...e._zod.def,rest:t})});function ld(e,t,i){let n=t instanceof nI,a=n?i:t;return new ll({type:"tuple",items:e,rest:n?t:null,...aZ.normalizeParams(a)})}let lc=ef("ZodRecord",(e,t)=>{ay.init(e,t),oV.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function lu(e,t,i){return new lc({type:"record",keyType:e,valueType:t,...aZ.normalizeParams(i)})}function lp(e,t,i){return new lc({type:"record",keyType:ln([e,s0()]),valueType:t,...aZ.normalizeParams(i)})}let lh=ef("ZodMap",(e,t)=>{av.init(e,t),oV.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function lm(e,t,i){return new lh({type:"map",keyType:e,valueType:t,...aZ.normalizeParams(i)})}let lg=ef("ZodSet",(e,t)=>{aw.init(e,t),oV.init(e,t),e.min=(...t)=>e.check(rY(...t)),e.nonempty=t=>e.check(rY(1,t)),e.max=(...t)=>e.check(rq(...t)),e.size=(...t)=>e.check(rX(...t))});function lf(e,t){return new lg({type:"set",valueType:e,...aZ.normalizeParams(t)})}let lb=ef("ZodEnum",(e,t)=>{ak.init(e,t),oV.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let i=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let a={};for(let n of e)if(i.has(n))a[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new lb({...t,checks:[],...aZ.normalizeParams(n),entries:a})},e.exclude=(e,n)=>{let a={...t.entries};for(let t of e)if(i.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new lb({...t,checks:[],...aZ.normalizeParams(n),entries:a})}});function lx(e,t){return new lb({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...aZ.normalizeParams(t)})}function ly(e,t){return new lb({type:"enum",entries:e,...aZ.normalizeParams(t)})}let lv=ef("ZodLiteral",(e,t)=>{aA.init(e,t),oV.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lC(e,t){return new lv({type:"literal",values:Array.isArray(e)?e:[e],...aZ.normalizeParams(t)})}let lw=ef("ZodFile",(e,t)=>{aE.init(e,t),oV.init(e,t),e.min=(t,i)=>e.check(rY(t,i)),e.max=(t,i)=>e.check(rq(t,i)),e.mime=(t,i)=>e.check(r8(Array.isArray(t)?t:[t],i))});function lS(e){return og(lw,e)}let lk=ef("ZodTransform",(e,t)=>{a_.init(e,t),oV.init(e,t),e._zod.parse=(i,n)=>{i.addIssue=n=>{"string"==typeof n?i.issues.push(aZ.issue(n,i.value,t)):(n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=e),n.continue??(n.continue=!0),i.issues.push(aZ.issue(n)))};let a=t.transform(i.value,i);return a instanceof Promise?a.then(e=>(i.value=e,i)):(i.value=a,i)}});function lA(e){return new lk({type:"transform",transform:e})}let lE=ef("ZodOptional",(e,t)=>{aI.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function l_(e){return new lE({type:"optional",innerType:e})}let lI=ef("ZodNullable",(e,t)=>{aM.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lM(e){return new lI({type:"nullable",innerType:e})}function lT(e){return l_(lM(e))}let lL=ef("ZodDefault",(e,t)=>{aT.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function lj(e,t){return new lL({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}let lP=ef("ZodPrefault",(e,t)=>{aj.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lD(e,t){return new lP({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():t}})}let lN=ef("ZodNonOptional",(e,t)=>{aP.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lR(e,t){return new lN({type:"nonoptional",innerType:e,...aZ.normalizeParams(t)})}let lO=ef("ZodSuccess",(e,t)=>{aN.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lB(e){return new lO({type:"success",innerType:e})}let lz=ef("ZodCatch",(e,t)=>{aR.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lF(e,t){return new lz({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let lH=ef("ZodNaN",(e,t)=>{aO.init(e,t),oV.init(e,t)});function lW(e){return rz(lH,e)}let lU=ef("ZodPipe",(e,t)=>{aB.init(e,t),oV.init(e,t),e.in=t.in,e.out=t.out});function lV(e,t){return new lU({type:"pipe",in:e,out:t})}let lG=ef("ZodReadonly",(e,t)=>{aF.init(e,t),oV.init(e,t)});function l$(e){return new lG({type:"readonly",innerType:e})}let lZ=ef("ZodTemplateLiteral",(e,t)=>{aW.init(e,t),oV.init(e,t)});function lK(e,t){return new lZ({type:"template_literal",parts:e,...aZ.normalizeParams(t)})}let lq=ef("ZodLazy",(e,t)=>{aV.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.getter()});function lY(e){return new lq({type:"lazy",getter:e})}let lX=ef("ZodPromise",(e,t)=>{aU.init(e,t),oV.init(e,t),e.unwrap=()=>e._zod.def.innerType});function lQ(e){return new lX({type:"promise",innerType:e})}let lJ=ef("ZodCustom",(e,t)=>{aG.init(e,t),oV.init(e,t)});function l0(e){let t=new ni({check:"custom"});return t._zod.check=e,t}function l1(e,t){return oI(lJ,e??(()=>!0),t)}function l2(e,t={}){return oM(lJ,e,t)}function l3(e){let t=l0(i=>(i.addIssue=e=>{"string"==typeof e?i.issues.push(aZ.issue(e,i.value,t._zod.def)):(e.fatal&&(e.continue=!1),e.code??(e.code="custom"),e.input??(e.input=i.value),e.inst??(e.inst=t),e.continue??(e.continue=!t._zod.def.abort),i.issues.push(aZ.issue(e)))},e(i.value,i)));return t}function l5(e,t={error:`Input not instance of ${e.name}`}){let i=new lJ({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...aZ.normalizeParams(t)});return i._zod.bag.Class=e,i}let l4=(...e)=>oT({Pipe:lU,Boolean:sR,String:o$,Transform:lk},...e);function l6(e){let t=lY(()=>ln([oZ(e),sM(),sO(),sK(),s6(t),lu(oZ(),t)]));return t}function l9(e,t){return lV(lA(e),t)}e.i(600498),e.s([],346118),e.i(346118),e.s(["endsWith",0,r6,"gt",0,rW,"gte",0,rU,"includes",0,r5,"length",0,r0,"lowercase",0,r2,"lt",0,rF,"lte",0,rH,"maxLength",0,rQ,"maxSize",0,rq,"mime",0,r8,"minLength",0,rJ,"minSize",0,rY,"multipleOf",0,rK,"negative",0,rG,"nonnegative",0,rZ,"nonpositive",0,r$,"normalize",0,oe,"overwrite",0,r7,"positive",0,rV,"property",0,r9,"regex",0,r1,"size",0,rX,"startsWith",0,r4,"toLowerCase",0,oi,"toUpperCase",0,on,"trim",0,ot,"uppercase",0,r3],355763),e.i(355763),e.i(854264),e.i(684029);let l8={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function l7(e){ev({customError:e})}function de(){return ev().customError}e.s(["ZodIssueCode",0,l8,"getErrorMap",0,de,"setErrorMap",0,l7],224162),e.i(224162),e.s(["$brand",0,eb,"ZodIssueCode",0,l8,"config",0,ev,"getErrorMap",0,de,"setErrorMap",0,l7],527748),e.i(527748);var dt=e.i(427621);e.s(["bigint",0,function(e){return r_(sB,e)},"boolean",0,function(e){return rA(sR,e)},"date",0,function(e){return rB(s3,e)},"number",0,function(e){return rx(sI,e)},"string",0,function(e){return aJ(o$,e)}],887879);var di=e.i(887879);e.s(["$brand",0,eb,"$input",0,tu,"$output",0,tc,"NEVER",0,eg,"TimePrecision",0,rp,"ZodAny",0,sq,"ZodArray",0,s4,"ZodBase64",0,sx,"ZodBase64URL",0,sv,"ZodBigInt",0,sB,"ZodBigIntFormat",0,sF,"ZodBoolean",0,sR,"ZodCIDRv4",0,sm,"ZodCIDRv6",0,sf,"ZodCUID",0,se,"ZodCUID2",0,si,"ZodCatch",0,lz,"ZodCustom",0,lJ,"ZodCustomStringFormat",0,sE,"ZodDate",0,s3,"ZodDefault",0,lL,"ZodDiscriminatedUnion",0,la,"ZodE164",0,sw,"ZodEmail",0,oq,"ZodEmoji",0,o6,"ZodEnum",0,lb,"ZodError",0,ta,"ZodFile",0,lw,"ZodGUID",0,oX,"ZodIPv4",0,sc,"ZodIPv6",0,sp,"ZodISODate",0,oB,"ZodISODateTime",0,oR,"ZodISODuration",0,oW,"ZodISOTime",0,oF,"ZodIntersection",0,lo,"ZodIssueCode",0,l8,"ZodJWT",0,sk,"ZodKSUID",0,sl,"ZodLazy",0,lq,"ZodLiteral",0,lv,"ZodMap",0,lh,"ZodNaN",0,lH,"ZodNanoID",0,o8,"ZodNever",0,sJ,"ZodNonOptional",0,lN,"ZodNull",0,sZ,"ZodNullable",0,lI,"ZodNumber",0,sI,"ZodNumberFormat",0,sT,"ZodObject",0,s8,"ZodOptional",0,lE,"ZodPipe",0,lU,"ZodPrefault",0,lP,"ZodPromise",0,lX,"ZodReadonly",0,lG,"ZodRealError",0,tr,"ZodRecord",0,lc,"ZodSet",0,lg,"ZodString",0,o$,"ZodStringFormat",0,oK,"ZodSuccess",0,lO,"ZodSymbol",0,sU,"ZodTemplateLiteral",0,lZ,"ZodTransform",0,lk,"ZodTuple",0,ll,"ZodType",0,oV,"ZodULID",0,sa,"ZodURL",0,o5,"ZodUUID",0,oJ,"ZodUndefined",0,sG,"ZodUnion",0,li,"ZodUnknown",0,sX,"ZodVoid",0,s1,"ZodXID",0,so,"_ZodString",0,oG,"_default",0,lj,"any",0,sY,"array",0,s6,"base64",0,sy,"base64url",0,sC,"bigint",0,sz,"boolean",0,sO,"catch",0,lF,"check",0,l0,"cidrv4",0,sg,"cidrv6",0,sb,"clone",0,eB,"coerce",0,di,"config",0,ev,"core",0,oN,"cuid",0,st,"cuid2",0,sn,"custom",0,l1,"date",0,s5,"discriminatedUnion",0,lr,"e164",0,sS,"email",0,oY,"emoji",0,o9,"endsWith",0,r6,"enum",0,lx,"file",0,lS,"flattenError",0,e0,"float32",0,sj,"float64",0,sP,"formatError",0,e1,"function",0,oP,"getErrorMap",0,de,"globalRegistry",0,tm,"gt",0,rW,"gte",0,rU,"guid",0,oQ,"includes",0,r5,"instanceof",0,l5,"int",0,sL,"int32",0,sD,"int64",0,sH,"intersection",0,ls,"ipv4",0,su,"ipv6",0,sh,"iso",0,dt,"json",0,l6,"jwt",0,sA,"keyof",0,s9,"ksuid",0,sd,"lazy",0,lY,"length",0,r0,"literal",0,lC,"locales",0,aX,"looseObject",0,lt,"lowercase",0,r2,"lt",0,rF,"lte",0,rH,"map",0,lm,"maxLength",0,rQ,"maxSize",0,rq,"mime",0,r8,"minLength",0,rJ,"minSize",0,rY,"multipleOf",0,rK,"nan",0,lW,"nanoid",0,o7,"nativeEnum",0,ly,"negative",0,rG,"never",0,s0,"nonnegative",0,rZ,"nonoptional",0,lR,"nonpositive",0,r$,"normalize",0,oe,"null",0,sK,"nullable",0,lM,"nullish",0,lT,"number",0,sM,"object",0,s7,"optional",0,l_,"overwrite",0,r7,"parse",0,to,"parseAsync",0,ts,"partialRecord",0,lp,"pipe",0,lV,"positive",0,rV,"prefault",0,lD,"preprocess",0,l9,"prettifyError",0,e5,"promise",0,lQ,"property",0,r9,"readonly",0,l$,"record",0,lu,"refine",0,l2,"regex",0,r1,"regexes",()=>aK,"registry",0,th,"safeParse",0,tl,"safeParseAsync",0,td,"set",0,lf,"setErrorMap",0,l7,"size",0,rX,"startsWith",0,r4,"strictObject",0,le,"string",0,oZ,"stringFormat",0,s_,"stringbool",0,l4,"success",0,lB,"superRefine",0,l3,"symbol",0,sV,"templateLiteral",0,lK,"toJSONSchema",0,tf,"toLowerCase",0,oi,"toUpperCase",0,on,"transform",0,lA,"treeifyError",0,e2,"trim",0,ot,"tuple",0,ld,"uint32",0,sN,"uint64",0,sW,"ulid",0,sr,"undefined",0,s$,"union",0,ln,"unknown",0,sQ,"uppercase",0,r3,"url",0,o4,"uuid",0,o0,"uuidv4",0,o1,"uuidv6",0,o2,"uuidv7",0,o3,"void",0,s2,"xid",0,ss],345444);var dn=e.i(345444),dn=dn,da=e.i(840733),dr=e.i(52897),ds=Symbol.for("vercel.ai.gateway.error"),dl=class e extends(w=Error,C=ds,w){constructor({message:e,statusCode:t=500,cause:i,generationId:n}){super(n?`${e} [${n}]`:e),this[C]=!0,this.statusCode=t,this.cause=i,this.generationId=n}static isInstance(t){return e.hasMarker(t)}static hasMarker(e){return"object"==typeof e&&null!==e&&ds in e&&!0===e[ds]}},dd="GatewayAuthenticationError",dc=Symbol.for(`vercel.ai.gateway.error.${dd}`),du=class e extends(k=dl,S=dc,k){constructor({message:e="Authentication failed",statusCode:t=401,cause:i,generationId:n}={}){super({message:e,statusCode:t,cause:i,generationId:n}),this[S]=!0,this.name=dd,this.type="authentication_error"}static isInstance(e){return dl.hasMarker(e)&&dc in e}static createContextualError({apiKeyProvided:t,oidcTokenProvided:i,message:n="Authentication failed",statusCode:a=401,cause:r,generationId:o}){return new e({message:t?`AI Gateway authentication failed: Invalid API key. Create a new API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable.`:i?`AI Gateway authentication failed: Invalid OIDC token. Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token. Alternatively, use an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys`:`AI Gateway authentication failed: No authentication provided. Option 1 - API key: Create an API key: https://vercel.com/d?to=%2F%5Bteam%5D%2F%7E%2Fai%2Fapi-keys Provide via 'apiKey' option or 'AI_GATEWAY_API_KEY' environment variable. Option 2 - OIDC token: Run 'npx vercel link' to link your project, then 'vc env pull' to fetch the token.`,statusCode:a,cause:r,generationId:o})}},dp="GatewayInvalidRequestError",dh=Symbol.for(`vercel.ai.gateway.error.${dp}`),dm=class extends(E=dl,A=dh,E){constructor({message:e="Invalid request",statusCode:t=400,cause:i,generationId:n}={}){super({message:e,statusCode:t,cause:i,generationId:n}),this[A]=!0,this.name=dp,this.type="invalid_request_error"}static isInstance(e){return dl.hasMarker(e)&&dh in e}},dg="GatewayRateLimitError",df=Symbol.for(`vercel.ai.gateway.error.${dg}`),db=class extends(I=dl,_=df,I){constructor({message:e="Rate limit exceeded",statusCode:t=429,cause:i,generationId:n}={}){super({message:e,statusCode:t,cause:i,generationId:n}),this[_]=!0,this.name=dg,this.type="rate_limit_exceeded"}static isInstance(e){return dl.hasMarker(e)&&df in e}},dx="GatewayModelNotFoundError",dy=Symbol.for(`vercel.ai.gateway.error.${dx}`),dv=ip(()=>ig(dn.object({modelId:dn.string()}))),dC=class extends(T=dl,M=dy,T){constructor({message:e="Model not found",statusCode:t=404,modelId:i,cause:n,generationId:a}={}){super({message:e,statusCode:t,cause:n,generationId:a}),this[M]=!0,this.name=dx,this.type="model_not_found",this.modelId=i}static isInstance(e){return dl.hasMarker(e)&&dy in e}},dw="GatewayInternalServerError",dS=Symbol.for(`vercel.ai.gateway.error.${dw}`),dk=class extends(j=dl,L=dS,j){constructor({message:e="Internal server error",statusCode:t=500,cause:i,generationId:n}={}){super({message:e,statusCode:t,cause:i,generationId:n}),this[L]=!0,this.name=dw,this.type="internal_server_error"}static isInstance(e){return dl.hasMarker(e)&&dS in e}},dA="GatewayResponseError",dE=Symbol.for(`vercel.ai.gateway.error.${dA}`),d_=class extends(D=dl,P=dE,D){constructor({message:e="Invalid response from Gateway",statusCode:t=502,response:i,validationError:n,cause:a,generationId:r}={}){super({message:e,statusCode:t,cause:a,generationId:r}),this[P]=!0,this.name=dA,this.type="response_error",this.response=i,this.validationError=n}static isInstance(e){return dl.hasMarker(e)&&dE in e}};async function dI({response:e,statusCode:t,defaultMessage:i="Gateway request failed",cause:n,authMethod:a}){var r;let o=await ix({value:e,schema:dM});if(!o.success){let a="object"==typeof e&&null!==e&&"generationId"in e?e.generationId:void 0;return new d_({message:`Invalid error response format: ${i}`,statusCode:t,response:e,validationError:o.error,cause:n,generationId:a})}let s=o.value,l=s.error.type,d=s.error.message,c=null!=(r=s.generationId)?r:void 0;switch(l){case"authentication_error":return du.createContextualError({apiKeyProvided:"api-key"===a,oidcTokenProvided:"oidc"===a,statusCode:t,cause:n,generationId:c});case"invalid_request_error":return new dm({message:d,statusCode:t,cause:n,generationId:c});case"rate_limit_exceeded":return new db({message:d,statusCode:t,cause:n,generationId:c});case"model_not_found":{let e=await ix({value:s.error.param,schema:dv});return new dC({message:d,statusCode:t,modelId:e.success?e.value.modelId:void 0,cause:n,generationId:c})}default:return new dk({message:d,statusCode:t,cause:n,generationId:c})}}var dM=ip(()=>ig(dn.object({error:dn.object({message:dn.string(),type:dn.string().nullish(),param:dn.unknown().nullish(),code:dn.union([dn.string(),dn.number()]).nullish()}),generationId:dn.string().nullish()}))),dT="GatewayTimeoutError",dL=Symbol.for(`vercel.ai.gateway.error.${dT}`),dj=class e extends(R=dl,N=dL,R){constructor({message:e="Request timed out",statusCode:t=408,cause:i,generationId:n}={}){super({message:e,statusCode:t,cause:i,generationId:n}),this[N]=!0,this.name=dT,this.type="timeout_error"}static isInstance(e){return dl.hasMarker(e)&&dL in e}static createTimeoutError({originalMessage:t,statusCode:i=408,cause:n,generationId:a}){return new e({message:`Gateway request timed out: ${t} This is a client-side timeout. To resolve this, increase your timeout configuration: https://vercel.com/docs/ai-gateway/capabilities/video-generation#extending-timeouts-for-node.js`,statusCode:i,cause:n,generationId:a})}};function dP(e){if(!(e instanceof Error))return!1;let t=e.code;return"string"==typeof t&&["UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_CONNECT_TIMEOUT"].includes(t)}async function dD(e,t){var i;return dl.isInstance(e)?e:dP(e)?dj.createTimeoutError({originalMessage:e instanceof Error?e.message:"Unknown error",cause:e}):K.isInstance(e)?e.cause&&dP(e.cause)?dj.createTimeoutError({originalMessage:e.message,cause:e}):await dI({response:function(e){if(void 0!==e.data)return e.data;if(null!=e.responseBody)try{return JSON.parse(e.responseBody)}catch(t){return e.responseBody}return{}}(e),statusCode:null!=(i=e.statusCode)?i:500,defaultMessage:"Gateway request failed",cause:e,authMethod:t}):await dI({response:{},statusCode:500,defaultMessage:e instanceof Error?`Gateway request failed: ${e.message}`:"Unknown Gateway error",cause:e,authMethod:t})}var dN="ai-gateway-auth-method";async function dR(e){let t=await ix({value:e[dN],schema:dO});return t.success?t.value:void 0}var dO=ip(()=>ig(dn.union([dn.literal("api-key"),dn.literal("oidc")]))),dB=class{constructor(e){this.config=e}async getAvailableModels(){try{let{value:e}=await tF({url:`${this.config.baseURL}/config`,headers:await iA(this.config.headers()),successfulResponseHandler:i_(dz),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return e}catch(e){throw await dD(e)}}async getCredits(){try{let e=new URL(this.config.baseURL),{value:t}=await tF({url:`${e.origin}/v1/credits`,headers:await iA(this.config.headers()),successfulResponseHandler:i_(dF),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),fetch:this.config.fetch});return t}catch(e){throw await dD(e)}}},dz=ip(()=>ig(dn.object({models:dn.array(dn.object({id:dn.string(),name:dn.string(),description:dn.string().nullish(),pricing:dn.object({input:dn.string(),output:dn.string(),input_cache_read:dn.string().nullish(),input_cache_write:dn.string().nullish()}).transform(({input:e,output:t,input_cache_read:i,input_cache_write:n})=>({input:e,output:t,...i?{cachedInputTokens:i}:{},...n?{cacheCreationInputTokens:n}:{}})).nullish(),specification:dn.object({specificationVersion:dn.literal("v3"),provider:dn.string(),modelId:dn.string()}),modelType:dn.enum(["embedding","image","language","video"]).nullish()}))}))),dF=ip(()=>ig(dn.object({balance:dn.string(),total_used:dn.string()}).transform(({balance:e,total_used:t})=>({balance:e,totalUsed:t})))),dH=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.supportedUrls={"*/*":[/.*/]}}get provider(){return this.config.provider}async getArgs(e){let{abortSignal:t,...i}=e;return{args:this.maybeEncodeFileParts(i),warnings:[]}}async doGenerate(e){let{args:t,warnings:i}=await this.getArgs(e),{abortSignal:n}=e,a=await iA(this.config.headers());try{let{responseHeaders:r,value:o,rawValue:s}=await iw({url:this.getUrl(),headers:tC(a,e.headers,this.getModelConfigHeaders(this.modelId,!1),await iA(this.config.o11yHeaders)),body:t,successfulResponseHandler:i_(dn.any()),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{...o,request:{body:t},response:{headers:r,body:s},warnings:i}}catch(e){throw await dD(e,await dR(a))}}async doStream(e){let{args:t,warnings:i}=await this.getArgs(e),{abortSignal:n}=e,a=await iA(this.config.headers());try{let r,{value:o,responseHeaders:s}=await iw({url:this.getUrl(),headers:tC(a,e.headers,this.getModelConfigHeaders(this.modelId,!0),await iA(this.config.o11yHeaders)),body:t,successfulResponseHandler:(r=dn.any(),async({response:e})=>{let t=tw(e);if(null==e.body)throw new Q({});return{responseHeaders:t,value:function({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new tv).pipeThrough(new TransformStream({async transform({data:e},i){"[DONE]"!==e&&i.enqueue(await iv({text:e,schema:t}))}}))}({stream:e.body,schema:r})}}),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),...n&&{abortSignal:n},fetch:this.config.fetch});return{stream:o.pipeThrough(new TransformStream({start(e){i.length>0&&e.enqueue({type:"stream-start",warnings:i})},transform(t,i){if(t.success){let n=t.value;("raw"!==n.type||e.includeRawChunks)&&("response-metadata"===n.type&&n.timestamp&&"string"==typeof n.timestamp&&(n.timestamp=new Date(n.timestamp)),i.enqueue(n))}else i.error(t.error)}})),request:{body:t},response:{headers:s}}}catch(e){throw await dD(e,await dR(a))}}isFilePart(e){return e&&"object"==typeof e&&"type"in e&&"file"===e.type}maybeEncodeFileParts(e){for(let t of e.prompt)for(let e of t.content)if(this.isFilePart(e)&&e.data instanceof Uint8Array){let t=Uint8Array.from(e.data),i=H.Buffer.from(t).toString("base64");e.data=new URL(`data:${e.mediaType||"application/octet-stream"};base64,${i}`)}return e}getUrl(){return`${this.config.baseURL}/language-model`}getModelConfigHeaders(e,t){return{"ai-language-model-specification-version":"3","ai-language-model-id":e,"ai-language-model-streaming":String(t)}}},dW=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxEmbeddingsPerCall=2048,this.supportsParallelCalls=!0}get provider(){return this.config.provider}async doEmbed({values:e,headers:t,abortSignal:i,providerOptions:n}){var a;let r=await iA(this.config.headers());try{let{responseHeaders:o,value:s,rawValue:l}=await iw({url:this.getUrl(),headers:tC(r,null!=t?t:{},this.getModelConfigHeaders(),await iA(this.config.o11yHeaders)),body:{values:e,...n?{providerOptions:n}:{}},successfulResponseHandler:i_(dU),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),...i&&{abortSignal:i},fetch:this.config.fetch});return{embeddings:s.embeddings,usage:null!=(a=s.usage)?a:void 0,providerMetadata:s.providerMetadata,response:{headers:o,body:l},warnings:[]}}catch(e){throw await dD(e,await dR(r))}}getUrl(){return`${this.config.baseURL}/embedding-model`}getModelConfigHeaders(){return{"ai-embedding-model-specification-version":"3","ai-model-id":this.modelId}}},dU=ip(()=>ig(dn.object({embeddings:dn.array(dn.array(dn.number())),usage:dn.object({tokens:dn.number()}).nullish(),providerMetadata:dn.record(dn.string(),dn.record(dn.string(),dn.unknown())).optional()}))),dV=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxImagesPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,size:i,aspectRatio:n,seed:a,files:r,mask:o,providerOptions:s,headers:l,abortSignal:d}){var c,u,p,h;let m=await iA(this.config.headers());try{let{responseHeaders:g,value:f,rawValue:b}=await iw({url:this.getUrl(),headers:tC(m,null!=l?l:{},this.getModelConfigHeaders(),await iA(this.config.o11yHeaders)),body:{prompt:e,n:t,...i&&{size:i},...n&&{aspectRatio:n},...a&&{seed:a},...s&&{providerOptions:s},...r&&{files:r.map(e=>dG(e))},...o&&{mask:dG(o)}},successfulResponseHandler:i_(dq),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),...d&&{abortSignal:d},fetch:this.config.fetch});return{images:f.images,warnings:null!=(c=f.warnings)?c:[],providerMetadata:f.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:g},...null!=f.usage&&{usage:{inputTokens:null!=(u=f.usage.inputTokens)?u:void 0,outputTokens:null!=(p=f.usage.outputTokens)?p:void 0,totalTokens:null!=(h=f.usage.totalTokens)?h:void 0}}}}catch(e){throw dD(e,await dR(m))}}getUrl(){return`${this.config.baseURL}/image-model`}getModelConfigHeaders(){return{"ai-image-model-specification-version":"3","ai-model-id":this.modelId}}};function dG(e){return"file"===e.type&&e.data instanceof Uint8Array?{...e,data:tA(e.data)}:e}var d$=dn.object({images:dn.array(dn.unknown()).optional()}).catchall(dn.unknown()),dZ=dn.discriminatedUnion("type",[dn.object({type:dn.literal("unsupported"),feature:dn.string(),details:dn.string().optional()}),dn.object({type:dn.literal("compatibility"),feature:dn.string(),details:dn.string().optional()}),dn.object({type:dn.literal("other"),message:dn.string()})]),dK=dn.object({inputTokens:dn.number().nullish(),outputTokens:dn.number().nullish(),totalTokens:dn.number().nullish()}),dq=dn.object({images:dn.array(dn.string()),warnings:dn.array(dZ).optional(),providerMetadata:dn.record(dn.string(),d$).optional(),usage:dK.optional()}),dY=class{constructor(e,t){this.modelId=e,this.config=t,this.specificationVersion="v3",this.maxVideosPerCall=Number.MAX_SAFE_INTEGER}get provider(){return this.config.provider}async doGenerate({prompt:e,n:t,aspectRatio:i,resolution:n,duration:a,fps:r,seed:o,image:s,providerOptions:l,headers:d,abortSignal:c}){var u,p;let h=await iA(this.config.headers());try{let{responseHeaders:m,value:g,rawValue:f}=await iw({url:this.getUrl(),headers:tC(h,null!=d?d:{},this.getModelConfigHeaders(),await iA(this.config.o11yHeaders)),body:{prompt:e,n:t,...i&&{aspectRatio:i},...n&&{resolution:n},...a&&{duration:a},...r&&{fps:r},...o&&{seed:o},...l&&{providerOptions:l},...s&&{image:(p=s,"file"===p.type&&p.data instanceof Uint8Array?{...p,data:tA(p.data)}:p)}},successfulResponseHandler:i_(d0),failedResponseHandler:iE({errorSchema:dn.any(),errorToMessage:e=>e}),...c&&{abortSignal:c},fetch:this.config.fetch});return{videos:g.videos,warnings:null!=(u=g.warnings)?u:[],providerMetadata:g.providerMetadata,response:{timestamp:new Date,modelId:this.modelId,headers:m}}}catch(e){throw dD(e,await dR(h))}}getUrl(){return`${this.config.baseURL}/video-model`}getModelConfigHeaders(){return{"ai-video-model-specification-version":"3","ai-model-id":this.modelId}}},dX=dn.object({videos:dn.array(dn.unknown()).optional()}).catchall(dn.unknown()),dQ=dn.union([dn.object({type:dn.literal("url"),url:dn.string(),mediaType:dn.string()}),dn.object({type:dn.literal("base64"),data:dn.string(),mediaType:dn.string()})]),dJ=dn.discriminatedUnion("type",[dn.object({type:dn.literal("unsupported"),feature:dn.string(),details:dn.string().optional()}),dn.object({type:dn.literal("compatibility"),feature:dn.string(),details:dn.string().optional()}),dn.object({type:dn.literal("other"),message:dn.string()})]),d0=dn.object({videos:dn.array(dQ),warnings:dn.array(dJ).optional(),providerMetadata:dn.record(dn.string(),dX).optional()}),d1=ik({id:"gateway.parallel_search",inputSchema:ip(()=>ig(da.z.object({objective:da.z.string().describe("Natural-language description of the web research goal, including source or freshness guidance and broader context from the task. Maximum 5000 characters."),search_queries:da.z.array(da.z.string()).optional().describe("Optional search queries to supplement the objective. Maximum 200 characters per query."),mode:da.z.enum(["one-shot","agentic"]).optional().describe('Mode preset: "one-shot" for comprehensive results with longer excerpts (default), "agentic" for concise, token-efficient results for multi-step workflows.'),max_results:da.z.number().optional().describe("Maximum number of results to return (1-20). Defaults to 10 if not specified."),source_policy:da.z.object({include_domains:da.z.array(da.z.string()).optional().describe("List of domains to include in search results."),exclude_domains:da.z.array(da.z.string()).optional().describe("List of domains to exclude from search results."),after_date:da.z.string().optional().describe("Only include results published after this date (ISO 8601 format).")}).optional().describe("Source policy for controlling which domains to include/exclude and freshness."),excerpts:da.z.object({max_chars_per_result:da.z.number().optional().describe("Maximum characters per result."),max_chars_total:da.z.number().optional().describe("Maximum total characters across all results.")}).optional().describe("Excerpt configuration for controlling result length."),fetch_policy:da.z.object({max_age_seconds:da.z.number().optional().describe("Maximum age in seconds for cached content. Set to 0 to always fetch fresh content.")}).optional().describe("Fetch policy for controlling content freshness.")}))),outputSchema:ip(()=>ig(da.z.union([da.z.object({searchId:da.z.string(),results:da.z.array(da.z.object({url:da.z.string(),title:da.z.string(),excerpt:da.z.string(),publishDate:da.z.string().nullable().optional(),relevanceScore:da.z.number().optional()}))}),da.z.object({error:da.z.enum(["api_error","rate_limit","timeout","invalid_input","configuration_error","unknown"]),statusCode:da.z.number().optional(),message:da.z.string()})])))}),d2=ik({id:"gateway.perplexity_search",inputSchema:ip(()=>ig(da.z.object({query:da.z.union([da.z.string(),da.z.array(da.z.string())]).describe("Search query (string) or multiple queries (array of up to 5 strings). Multi-query searches return combined results from all queries."),max_results:da.z.number().optional().describe("Maximum number of search results to return (1-20, default: 10)"),max_tokens_per_page:da.z.number().optional().describe("Maximum number of tokens to extract per search result page (256-2048, default: 2048)"),max_tokens:da.z.number().optional().describe("Maximum total tokens across all search results (default: 25000, max: 1000000)"),country:da.z.string().optional().describe("Two-letter ISO 3166-1 alpha-2 country code for regional search results (e.g., 'US', 'GB', 'FR')"),search_domain_filter:da.z.array(da.z.string()).optional().describe("List of domains to include or exclude from search results (max 20). To include: ['nature.com', 'science.org']. To exclude: ['-example.com', '-spam.net']"),search_language_filter:da.z.array(da.z.string()).optional().describe("List of ISO 639-1 language codes to filter results (max 10, lowercase). Examples: ['en', 'fr', 'de']"),search_after_date:da.z.string().optional().describe("Include only results published after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),search_before_date:da.z.string().optional().describe("Include only results published before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),last_updated_after_filter:da.z.string().optional().describe("Include only results last updated after this date. Format: 'MM/DD/YYYY' (e.g., '3/1/2025'). Cannot be used with search_recency_filter."),last_updated_before_filter:da.z.string().optional().describe("Include only results last updated before this date. Format: 'MM/DD/YYYY' (e.g., '3/15/2025'). Cannot be used with search_recency_filter."),search_recency_filter:da.z.enum(["day","week","month","year"]).optional().describe("Filter results by relative time period. Cannot be used with search_after_date or search_before_date.")}))),outputSchema:ip(()=>ig(da.z.union([da.z.object({results:da.z.array(da.z.object({title:da.z.string(),url:da.z.string(),snippet:da.z.string(),date:da.z.string().optional(),lastUpdated:da.z.string().optional()})),id:da.z.string()}),da.z.object({error:da.z.enum(["api_error","rate_limit","timeout","invalid_input","unknown"]),statusCode:da.z.number().optional(),message:da.z.string()})])))}),d3={parallelSearch:(e={})=>d1(e),perplexitySearch:(e={})=>d2(e)};async function d5(){var e;return null==(e=(0,dr.getContext)().headers)?void 0:e["x-vercel-id"]}async function d4(e){let t=tH({settingValue:e.apiKey,environmentVariableName:"AI_GATEWAY_API_KEY"});return t?{token:t,authMethod:"api-key"}:{token:await (0,dr.getVercelOidcToken)(),authMethod:"oidc"}}!function(e={}){var t,i,n;let a=null,r=null,o=null!=(t=e.metadataCacheRefreshMillis)?t:3e5,s=0,l=null!=(i=null==(n=e.baseURL)?void 0:n.replace(/\/$/,""))?i:"https://ai-gateway.vercel.sh/v3/ai",d=async()=>{try{let t=await d4(e);return tO({Authorization:`Bearer ${t.token}`,"ai-gateway-protocol-version":"0.0.1",[dN]:t.authMethod,...e.headers},"ai-sdk/gateway/3.0.44")}catch(e){throw du.createContextualError({apiKeyProvided:!1,oidcTokenProvided:!1,statusCode:401,cause:e})}},c=()=>{let e=tH({settingValue:void 0,environmentVariableName:"VERCEL_DEPLOYMENT_ID"}),t=tH({settingValue:void 0,environmentVariableName:"VERCEL_ENV"}),i=tH({settingValue:void 0,environmentVariableName:"VERCEL_REGION"});return async()=>{let n=await d5();return{...e&&{"ai-o11y-deployment-id":e},...t&&{"ai-o11y-environment":t},...i&&{"ai-o11y-region":i},...n&&{"ai-o11y-request-id":n}}}},u=t=>new dH(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()}),p=async()=>{var t,i,n;let c=null!=(n=null==(i=null==(t=e._internal)?void 0:t.currentDate)?void 0:i.call(t).getTime())?n:Date.now();return(!a||c-s>o)&&(s=c,a=new dB({baseURL:l,headers:d,fetch:e.fetch}).getAvailableModels().then(e=>(r=e,e)).catch(async e=>{throw await dD(e,await dR(await d()))})),r?Promise.resolve(r):a},h=async()=>new dB({baseURL:l,headers:d,fetch:e.fetch}).getCredits().catch(async e=>{throw await dD(e,await dR(await d()))}),m=function(e){if(new.target)throw Error("The Gateway Provider model function cannot be called with the new keyword.");return u(e)};m.specificationVersion="v3",m.getAvailableModels=p,m.getCredits=h,m.imageModel=t=>new dV(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()}),m.languageModel=u;let g=t=>new dW(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()});m.embeddingModel=g,m.textEmbeddingModel=g,m.videoModel=t=>new dY(t,{provider:"gateway",baseURL:l,headers:d,fetch:e.fetch,o11yHeaders:c()}),m.chat=m.languageModel,m.embedding=m.embeddingModel,m.image=m.imageModel,m.video=m.videoModel,m.tools=d3}();var dn=dn,d6=e.i(163949),d9=e.i(870901),d8=e.i(853583);(r=O||(O={}))[r.NONE=0]="NONE",r[r.SAMPLED=1]="SAMPLED";var d7="0000000000000000",ce="00000000000000000000000000000000",ct={traceId:ce,spanId:d7,traceFlags:O.NONE},ci=function(){function e(e){void 0===e&&(e=ct),this._spanContext=e}return e.prototype.spanContext=function(){return this._spanContext},e.prototype.setAttribute=function(e,t){return this},e.prototype.setAttributes=function(e){return this},e.prototype.addEvent=function(e,t){return this},e.prototype.addLink=function(e){return this},e.prototype.addLinks=function(e){return this},e.prototype.setStatus=function(e){return this},e.prototype.updateName=function(e){return this},e.prototype.end=function(e){},e.prototype.isRecording=function(){return!1},e.prototype.recordException=function(e,t){},e}(),cn=(0,d8.createContextKey)("OpenTelemetry Context Key SPAN");function ca(e){return e.getValue(cn)||void 0}function cr(){return ca(d9.ContextAPI.getInstance().active())}function co(e,t){return e.setValue(cn,t)}function cs(e){return e.deleteValue(cn)}function cl(e,t){return co(e,new ci(t))}function cd(e){var t;return null==(t=ca(e))?void 0:t.spanContext()}var cc=/^([0-9a-f]{32})$/i,cu=/^[0-9a-f]{16}$/i;function cp(e){var t,i;return t=e.traceId,cc.test(t)&&t!==ce&&(i=e.spanId,cu.test(i)&&i!==d7)}function ch(e){return new ci(e)}var cm=d9.ContextAPI.getInstance(),cg=function(){function e(){}return e.prototype.startSpan=function(e,t,i){if(void 0===i&&(i=cm.active()),null==t?void 0:t.root)return new ci;var n,a=i&&cd(i);return"object"==typeof(n=a)&&"string"==typeof n.spanId&&"string"==typeof n.traceId&&"number"==typeof n.traceFlags&&cp(a)?new ci(a):new ci},e.prototype.startActiveSpan=function(e,t,i,n){if(!(arguments.length<2)){2==arguments.length?o=t:3==arguments.length?(a=t,o=i):(a=t,r=i,o=n);var a,r,o,s=null!=r?r:cm.active(),l=this.startSpan(e,a,s),d=co(s,l);return cm.with(d,o,void 0,l)}},e}(),cf=new cg,cb=function(){function e(e,t,i,n){this._provider=e,this.name=t,this.version=i,this.options=n}return e.prototype.startSpan=function(e,t,i){return this._getTracer().startSpan(e,t,i)},e.prototype.startActiveSpan=function(e,t,i,n){var a=this._getTracer();return Reflect.apply(a.startActiveSpan,a,arguments)},e.prototype._getTracer=function(){if(this._delegate)return this._delegate;var e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):cf},e}(),cx=new(function(){function e(){}return e.prototype.getTracer=function(e,t,i){return new cg},e}()),cy=function(){function e(){}return e.prototype.getTracer=function(e,t,i){var n;return null!=(n=this.getDelegateTracer(e,t,i))?n:new cb(this,e,t,i)},e.prototype.getDelegate=function(){var e;return null!=(e=this._delegate)?e:cx},e.prototype.setDelegate=function(e){this._delegate=e},e.prototype.getDelegateTracer=function(e,t,i){var n;return null==(n=this._delegate)?void 0:n.getTracer(e,t,i)},e}(),cv=e.i(121221),cC="trace";(function(){function e(){this._proxyTracerProvider=new cy,this.wrapSpanContext=ch,this.isSpanContextValid=cp,this.deleteSpan=cs,this.getSpan=ca,this.getActiveSpan=cr,this.getSpanContext=cd,this.setSpan=co,this.setSpanContext=cl}return e.getInstance=function(){return this._instance||(this._instance=new e),this._instance},e.prototype.setGlobalTracerProvider=function(e){var t=(0,d6.registerGlobal)(cC,this._proxyTracerProvider,cv.DiagAPI.instance());return t&&this._proxyTracerProvider.setDelegate(e),t},e.prototype.getTracerProvider=function(){return(0,d6.getGlobal)(cC)||this._proxyTracerProvider},e.prototype.getTracer=function(e,t){return this.getTracerProvider().getTracer(e,t)},e.prototype.disable=function(){(0,d6.unregisterGlobal)(cC,cv.DiagAPI.instance()),this._proxyTracerProvider=new cy},e})().getInstance(),(o=B||(B={}))[o.UNSET=0]="UNSET",o[o.OK=1]="OK",o[o.ERROR=2]="ERROR",e.i(251302);var cw=Object.defineProperty,cS=(Symbol.for("vercel.ai.error.AI_InvalidArgumentError"),Symbol.for("vercel.ai.error.AI_InvalidStreamPartError"),Symbol.for("vercel.ai.error.AI_InvalidToolApprovalError"),Symbol.for("vercel.ai.error.AI_InvalidToolInputError"),Symbol.for("vercel.ai.error.AI_ToolCallNotFoundForApprovalError"),Symbol.for("vercel.ai.error.AI_MissingToolResultsError"),Symbol.for("vercel.ai.error.AI_NoImageGeneratedError"),"AI_NoObjectGeneratedError"),ck=`vercel.ai.error.${cS}`,cA=Symbol.for(ck),cE=class extends V{constructor({message:e="No object generated.",cause:t,text:i,response:n,usage:a,finishReason:r}){super({name:cS,message:e,cause:t}),this[z]=!0,this.text=i,this.response=n,this.usage=a,this.finishReason=r}static isInstance(e){return V.hasMarker(e,ck)}};z=cA,Symbol.for("vercel.ai.error.AI_NoOutputGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSpeechGeneratedError"),Symbol.for("vercel.ai.error.AI_NoTranscriptGeneratedError"),Symbol.for("vercel.ai.error.AI_NoVideoGeneratedError"),Symbol.for("vercel.ai.error.AI_NoSuchToolError"),Symbol.for("vercel.ai.error.AI_ToolCallRepairError"),Symbol.for("vercel.ai.error.AI_UIMessageStreamError"),Symbol.for("vercel.ai.error.AI_InvalidDataContentError"),Symbol.for("vercel.ai.error.AI_InvalidMessageRoleError"),Symbol.for("vercel.ai.error.AI_MessageConversionError"),Symbol.for("vercel.ai.error.AI_RetryError");var c_=async({url:e,maxBytes:t,abortSignal:i})=>{var n;let a=e.toString();try{let e=await fetch(a,{headers:tO({},"ai-sdk/6.0.84",tR()),signal:i});if(!e.ok)throw new tM({url:a,statusCode:e.status,statusText:e.statusText});return{data:await tT({response:e,url:a,maxBytes:null!=t?t:0x80000000}),mediaType:null!=(n=e.headers.get("content-type"))?n:void 0}}catch(e){if(tM.isInstance(e))throw e;throw new tM({url:a,cause:e})}},cI=dn.union([dn.string(),dn.instanceof(Uint8Array),dn.instanceof(ArrayBuffer),dn.custom(e=>{var t,i;return null!=(i=null==(t=globalThis.Buffer)?void 0:t.isBuffer(e))&&i},{message:"Must be a Buffer"})]),cM=dn.lazy(()=>dn.union([dn.null(),dn.string(),dn.number(),dn.boolean(),dn.record(dn.string(),cM.optional()),dn.array(cM)])),cT=dn.record(dn.string(),dn.record(dn.string(),cM.optional())),cL=dn.object({type:dn.literal("text"),text:dn.string(),providerOptions:cT.optional()}),cj=dn.object({type:dn.literal("image"),image:dn.union([cI,dn.instanceof(URL)]),mediaType:dn.string().optional(),providerOptions:cT.optional()}),cP=dn.object({type:dn.literal("file"),data:dn.union([cI,dn.instanceof(URL)]),filename:dn.string().optional(),mediaType:dn.string(),providerOptions:cT.optional()}),cD=dn.object({type:dn.literal("reasoning"),text:dn.string(),providerOptions:cT.optional()}),cN=dn.object({type:dn.literal("tool-call"),toolCallId:dn.string(),toolName:dn.string(),input:dn.unknown(),providerOptions:cT.optional(),providerExecuted:dn.boolean().optional()}),cR=dn.discriminatedUnion("type",[dn.object({type:dn.literal("text"),value:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("json"),value:cM,providerOptions:cT.optional()}),dn.object({type:dn.literal("execution-denied"),reason:dn.string().optional(),providerOptions:cT.optional()}),dn.object({type:dn.literal("error-text"),value:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("error-json"),value:cM,providerOptions:cT.optional()}),dn.object({type:dn.literal("content"),value:dn.array(dn.union([dn.object({type:dn.literal("text"),text:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("media"),data:dn.string(),mediaType:dn.string()}),dn.object({type:dn.literal("file-data"),data:dn.string(),mediaType:dn.string(),filename:dn.string().optional(),providerOptions:cT.optional()}),dn.object({type:dn.literal("file-url"),url:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("file-id"),fileId:dn.union([dn.string(),dn.record(dn.string(),dn.string())]),providerOptions:cT.optional()}),dn.object({type:dn.literal("image-data"),data:dn.string(),mediaType:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("image-url"),url:dn.string(),providerOptions:cT.optional()}),dn.object({type:dn.literal("image-file-id"),fileId:dn.union([dn.string(),dn.record(dn.string(),dn.string())]),providerOptions:cT.optional()}),dn.object({type:dn.literal("custom"),providerOptions:cT.optional()})]))})]),cO=dn.object({type:dn.literal("tool-result"),toolCallId:dn.string(),toolName:dn.string(),output:cR,providerOptions:cT.optional()}),cB=dn.object({type:dn.literal("tool-approval-request"),approvalId:dn.string(),toolCallId:dn.string()}),cz=dn.object({type:dn.literal("tool-approval-response"),approvalId:dn.string(),approved:dn.boolean(),reason:dn.string().optional()}),cF=dn.object({role:dn.literal("system"),content:dn.string(),providerOptions:cT.optional()}),cH=dn.object({role:dn.literal("user"),content:dn.union([dn.string(),dn.array(dn.union([cL,cj,cP]))]),providerOptions:cT.optional()}),cW=dn.object({role:dn.literal("assistant"),content:dn.union([dn.string(),dn.array(dn.union([cL,cP,cD,cN,cO,cB]))]),providerOptions:cT.optional()}),cU=dn.object({role:dn.literal("tool"),content:dn.array(dn.union([cO,cz])),providerOptions:cT.optional()});dn.union([cF,cH,cW,cU]);var cV={},cG={array:()=>cY,choice:()=>cX,json:()=>cQ,object:()=>cq,text:()=>cK};for(var c$ in cG)cw(cV,c$,{get:cG[c$],enumerable:!0});async function cZ(e){if(void 0===e)return{value:void 0,state:"undefined-input"};let t=await iv({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await iv({text:function(e){let t=["ROOT"],i=-1,n=null;function a(e,a,r){switch(e){case'"':i=a,t.pop(),t.push(r),t.push("INSIDE_STRING");break;case"f":case"t":case"n":i=a,n=a,t.pop(),t.push(r),t.push("INSIDE_LITERAL");break;case"-":t.pop(),t.push(r),t.push("INSIDE_NUMBER");break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":i=a,t.pop(),t.push(r),t.push("INSIDE_NUMBER");break;case"{":i=a,t.pop(),t.push(r),t.push("INSIDE_OBJECT_START");break;case"[":i=a,t.pop(),t.push(r),t.push("INSIDE_ARRAY_START")}}function r(e,n){switch(e){case",":t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break;case"}":i=n,t.pop()}}function o(e,n){switch(e){case",":t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break;case"]":i=n,t.pop()}}for(let s=0;s=0;i--)switch(t[i]){case"INSIDE_STRING":s+='"';break;case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":s+="}";break;case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":s+="]";break;case"INSIDE_LITERAL":{let t=e.substring(n,e.length);"true".startsWith(t)?s+="true".slice(t.length):"false".startsWith(t)?s+="false".slice(t.length):"null".startsWith(t)&&(s+="null".slice(t.length))}}return s}(e)})).success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"}}var cK=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),parseCompleteOutput:async({text:e})=>e,parsePartialOutput:async({text:e})=>({partial:e}),createElementStreamTransform(){}}),cq=({schema:e,name:t,description:i})=>{let n=im(e);return{name:"object",responseFormat:iA(n.jsonSchema).then(e=>({type:"json",schema:e,...null!=t&&{name:t},...null!=i&&{description:i}})),async parseCompleteOutput({text:e},t){let i=await iv({text:e});if(!i.success)throw new cE({message:"No object generated: could not parse the response.",cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=await ix({value:i.value,schema:n});if(!a.success)throw new cE({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return a.value},async parsePartialOutput({text:e}){let t=await cZ(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:t.value}}},createElementStreamTransform(){}}},cY=({element:e,name:t,description:i})=>{let n=im(e);return{name:"array",responseFormat:iA(n.jsonSchema).then(e=>{let{$schema:n,...a}=e;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...null!=t&&{name:t},...null!=i&&{description:i}}}),async parseCompleteOutput({text:e},t){let i=await iv({text:e});if(!i.success)throw new cE({message:"No object generated: could not parse the response.",cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});let a=i.value;if(null==a||"object"!=typeof a||!("elements"in a)||!Array.isArray(a.elements))throw new cE({message:"No object generated: response did not match schema.",cause:new eh({value:a,cause:"response must be an object with an elements array"}),text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});for(let i of a.elements){let a=await ix({value:i,schema:n});if(!a.success)throw new cE({message:"No object generated: response did not match schema.",cause:a.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason})}return a.elements},async parsePartialOutput({text:e}){let t=await cZ(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let e=t.value;if(null==e||"object"!=typeof e||!("elements"in e)||!Array.isArray(e.elements))return;let i="repaired-parse"===t.state&&e.elements.length>0?e.elements.slice(0,-1):e.elements,a=[];for(let e of i){let t=await ix({value:e,schema:n});t.success&&a.push(t.value)}return{partial:a}}}},createElementStreamTransform(){let e=0;return new TransformStream({transform({partialOutput:t},i){if(null!=t)for(;e({name:"choice",responseFormat:Promise.resolve({type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{result:{type:"string",enum:e}},required:["result"],additionalProperties:!1},...null!=t&&{name:t},...null!=i&&{description:i}}),async parseCompleteOutput({text:t},i){let n=await iv({text:t});if(!n.success)throw new cE({message:"No object generated: could not parse the response.",cause:n.error,text:t,response:i.response,usage:i.usage,finishReason:i.finishReason});let a=n.value;if(null==a||"object"!=typeof a||!("result"in a)||"string"!=typeof a.result||!e.includes(a.result))throw new cE({message:"No object generated: response did not match schema.",cause:new eh({value:a,cause:"response must be an object that contains a choice value."}),text:t,response:i.response,usage:i.usage,finishReason:i.finishReason});return a.result},async parsePartialOutput({text:t}){let i=await cZ(t);switch(i.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{let t=i.value;if(null==t||"object"!=typeof t||!("result"in t)||"string"!=typeof t.result)return;let n=e.filter(e=>e.startsWith(t.result));if("successful-parse"===i.state)return n.includes(t.result)?{partial:t.result}:void 0;return 1===n.length?{partial:n[0]}:void 0}}},createElementStreamTransform(){}}),cQ=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...null!=e&&{name:e},...null!=t&&{description:t}}),async parseCompleteOutput({text:e},t){let i=await iv({text:e});if(!i.success)throw new cE({message:"No object generated: could not parse the response.",cause:i.error,text:e,response:t.response,usage:t.usage,finishReason:t.finishReason});return i.value},async parsePartialOutput({text:e}){let t=await cZ(e);switch(t.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return void 0===t.value?void 0:{partial:t.value}}},createElementStreamTransform(){}});function cJ(e){return e.type.startsWith("tool-")}function c0(e){return"dynamic-tool"===e.type?e.toolName:e.type.split("-").slice(1).join("-")}function c1(e){return({url:t,abortSignal:i})=>c_({url:t,maxBytes:null==e?void 0:e.maxBytes,abortSignal:i})}tL({prefix:"aitxt",size:24}),TransformStream,ip(()=>ig(dn.union([dn.strictObject({type:dn.literal("text-start"),id:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("text-delta"),id:dn.string(),delta:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("text-end"),id:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("error"),errorText:dn.string()}),dn.strictObject({type:dn.literal("tool-input-start"),toolCallId:dn.string(),toolName:dn.string(),providerExecuted:dn.boolean().optional(),providerMetadata:cT.optional(),dynamic:dn.boolean().optional(),title:dn.string().optional()}),dn.strictObject({type:dn.literal("tool-input-delta"),toolCallId:dn.string(),inputTextDelta:dn.string()}),dn.strictObject({type:dn.literal("tool-input-available"),toolCallId:dn.string(),toolName:dn.string(),input:dn.unknown(),providerExecuted:dn.boolean().optional(),providerMetadata:cT.optional(),dynamic:dn.boolean().optional(),title:dn.string().optional()}),dn.strictObject({type:dn.literal("tool-input-error"),toolCallId:dn.string(),toolName:dn.string(),input:dn.unknown(),providerExecuted:dn.boolean().optional(),providerMetadata:cT.optional(),dynamic:dn.boolean().optional(),errorText:dn.string(),title:dn.string().optional()}),dn.strictObject({type:dn.literal("tool-approval-request"),approvalId:dn.string(),toolCallId:dn.string()}),dn.strictObject({type:dn.literal("tool-output-available"),toolCallId:dn.string(),output:dn.unknown(),providerExecuted:dn.boolean().optional(),dynamic:dn.boolean().optional(),preliminary:dn.boolean().optional()}),dn.strictObject({type:dn.literal("tool-output-error"),toolCallId:dn.string(),errorText:dn.string(),providerExecuted:dn.boolean().optional(),dynamic:dn.boolean().optional()}),dn.strictObject({type:dn.literal("tool-output-denied"),toolCallId:dn.string()}),dn.strictObject({type:dn.literal("reasoning-start"),id:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("reasoning-delta"),id:dn.string(),delta:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("reasoning-end"),id:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("source-url"),sourceId:dn.string(),url:dn.string(),title:dn.string().optional(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("source-document"),sourceId:dn.string(),mediaType:dn.string(),title:dn.string(),filename:dn.string().optional(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.literal("file"),url:dn.string(),mediaType:dn.string(),providerMetadata:cT.optional()}),dn.strictObject({type:dn.custom(e=>"string"==typeof e&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:dn.string().optional(),data:dn.unknown(),transient:dn.boolean().optional()}),dn.strictObject({type:dn.literal("start-step")}),dn.strictObject({type:dn.literal("finish-step")}),dn.strictObject({type:dn.literal("start"),messageId:dn.string().optional(),messageMetadata:dn.unknown().optional()}),dn.strictObject({type:dn.literal("finish"),finishReason:dn.enum(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:dn.unknown().optional()}),dn.strictObject({type:dn.literal("abort"),reason:dn.string().optional()}),dn.strictObject({type:dn.literal("message-metadata"),messageMetadata:dn.unknown()})]))),tL({prefix:"aitxt",size:24}),ip(()=>ig(dn.array(dn.object({id:dn.string(),role:dn.enum(["system","user","assistant"]),metadata:dn.unknown().optional(),parts:dn.array(dn.union([dn.object({type:dn.literal("text"),text:dn.string(),state:dn.enum(["streaming","done"]).optional(),providerMetadata:cT.optional()}),dn.object({type:dn.literal("reasoning"),text:dn.string(),state:dn.enum(["streaming","done"]).optional(),providerMetadata:cT.optional()}),dn.object({type:dn.literal("source-url"),sourceId:dn.string(),url:dn.string(),title:dn.string().optional(),providerMetadata:cT.optional()}),dn.object({type:dn.literal("source-document"),sourceId:dn.string(),mediaType:dn.string(),title:dn.string(),filename:dn.string().optional(),providerMetadata:cT.optional()}),dn.object({type:dn.literal("file"),mediaType:dn.string(),filename:dn.string().optional(),url:dn.string(),providerMetadata:cT.optional()}),dn.object({type:dn.literal("step-start")}),dn.object({type:dn.string().startsWith("data-"),id:dn.string().optional(),data:dn.unknown()}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("input-streaming"),input:dn.unknown().optional(),providerExecuted:dn.boolean().optional(),callProviderMetadata:cT.optional(),output:dn.never().optional(),errorText:dn.never().optional(),approval:dn.never().optional()}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("input-available"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.never().optional()}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("approval-requested"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.never().optional(),reason:dn.never().optional()})}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("approval-responded"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.boolean(),reason:dn.string().optional()})}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("output-available"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.unknown(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),preliminary:dn.boolean().optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!0),reason:dn.string().optional()}).optional()}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("output-error"),input:dn.unknown(),rawInput:dn.unknown().optional(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.string(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!0),reason:dn.string().optional()}).optional()}),dn.object({type:dn.literal("dynamic-tool"),toolName:dn.string(),toolCallId:dn.string(),state:dn.literal("output-denied"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!1),reason:dn.string().optional()})}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("input-streaming"),providerExecuted:dn.boolean().optional(),callProviderMetadata:cT.optional(),input:dn.unknown().optional(),output:dn.never().optional(),errorText:dn.never().optional(),approval:dn.never().optional()}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("input-available"),providerExecuted:dn.boolean().optional(),input:dn.unknown(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.never().optional()}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("approval-requested"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.never().optional(),reason:dn.never().optional()})}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("approval-responded"),input:dn.unknown(),providerExecuted:dn.boolean().optional(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.boolean(),reason:dn.string().optional()})}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("output-available"),providerExecuted:dn.boolean().optional(),input:dn.unknown(),output:dn.unknown(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),preliminary:dn.boolean().optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!0),reason:dn.string().optional()}).optional()}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("output-error"),providerExecuted:dn.boolean().optional(),input:dn.unknown(),rawInput:dn.unknown().optional(),output:dn.never().optional(),errorText:dn.string(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!0),reason:dn.string().optional()}).optional()}),dn.object({type:dn.string().startsWith("tool-"),toolCallId:dn.string(),state:dn.literal("output-denied"),providerExecuted:dn.boolean().optional(),input:dn.unknown(),output:dn.never().optional(),errorText:dn.never().optional(),callProviderMetadata:cT.optional(),approval:dn.object({id:dn.string(),approved:dn.literal(!1),reason:dn.string().optional()})})])).nonempty("Message must contain at least one part")})).nonempty("Messages array must not be empty"))),tL({prefix:"aiobj",size:24}),tL({prefix:"aiobj",size:24}),c1(),Symbol.for("vercel.ai.error.AI_NoSuchProviderError"),c1(),e.s(["getToolName",0,c0,"isFileUIPart",0,function(e){return"file"===e.type},"isStaticToolUIPart",0,cJ,"isTextUIPart",0,function(e){return"text"===e.type}],357454),e.s(["useCancelRollback",()=>ux,"useGoBackToTool",()=>uy],789719);var c2=e.i(191788),c3=e.i(418755),c5=e.i(551880),c4=e.i(13556),c6=e.i(462480),c9=e.i(763498);let c8=(0,c6.customAlphabet)("1234567890abcdefghijklmnopqrstuvwxyz",8),c7=(e,t)=>{let i,n=c8(),a=e.state.doc.toJSON(),r=c9.AnnotationPluginKey.getState(e.state);r?.restoreMap&&(i=Object.fromEntries(Array.from(r.restoreMap).map(({key:e,val:t})=>[e,t])));let o={id:n,jsonContent:a,themeId:t,timestamp:new Date().toISOString(),annotationsAbsolute:i};return console.debug("[buddy] creating checkpoint",o),o};e.s(["createCheckpoint",0,c7],802448);var ue=e.i(87959),ut=e.i(365808),ui=e.i(412809);e.i(144786);var un=e.i(275316),ua=e.i(82050),ur=e.i(297391),uo=e.i(414556);e.i(989619);var us=e.i(180939),ul=e.i(391398),ud=e.i(620020),uc=e.i(358280);e.i(185340);var uu=e.i(863750);e.i(734710);var up=e.i(78387),uh=e.i(468738);let um=()=>{let e=(0,ud.useToast)(),[t]=(0,uu.useUpdateFileThemeMutation)(),i=(0,c3.useAppSelector)(ua.selectFile),n=i?.id,a=(0,c3.useAppSelector)(c5.selectTheme),r=(0,uh.useAnalytics)();return(0,c2.useCallback)(o=>{if(n&&o.id!==a.id)return t({variables:{id:n,themeId:o.id},optimisticResponse:{updateFile:{__typename:"File",id:i.id,theme:{...o}}}}).then(()=>{r?.track(up.SegmentEvents.DOC_THEME_UPDATED,{file_id:n,theme_id:o.id})}).catch(t=>{let i=t instanceof Error?t.message:"unknown error";e({title:(0,ul.jsx)(uc.Trans,{message:"Error saving file theme: {errorMessage}",id:"lP9vC8",values:{errorMessage:i}}),position:"top",status:"error"})})},[i,n,a.id,t,r,e])};e.s(["useSetTheme",0,um],212206);var ug=e.i(359227),uf=e.i(372764);let ub=()=>{let e,t,i,n,a,r,o=(0,c3.useAppStore)(),s=(0,ui.selectActiveBuddyAgent)(o.getState()),l=s?.editor??null,d=(0,c3.useAppSelector)(c5.selectTheme),c=(0,uo.useDocGenerateInputImageSettings)(),u=s?.chatId??"",p=(0,c3.useAppSelector)(ua.selectDocId),h=um(),m=(0,c2.useCallback)(e=>{let t=(0,ug.selectAllThemes)(o.getState()).find(t=>t.id===e);if(t)return h(t)},[h,o]),g=l?(0,uf.getDocAttrs)(l)?.aiOptions:{},f=(e=g.imageOptions,t=e?.provider||c.imageProvider,i=e?.model!=null&&e.model in ur.IMAGE_GENERATE_MODELS?e.model:c.imageModel,n=e?.generateStyle,a=e?.artStylePreset,r=e?.artStylePrompt,{imageProvider:t,imageModel:i,imageStyle:n,artStylePreset:a,artStylePrompt:r,styleReferenceImages:e?.styleReferenceImages,styleReferenceKey:un.featureFlags.get("deckStyledImages")?e?.styleReferenceKey??void 0:void 0}),b=ur.IMAGE_GENERATE_MODELS[f.imageModel];b&&(!b.productFeature||(0,us.getCanUseProductFeature)(b.productFeature))||(f.imageModel=(0,ur.getDefaultImageModel)());let x=((e,t)=>{let i=e.imageProvider;if("none"!==i&&"placeholder"!==i)return e;let{imageStyle:n,artStylePreset:a,artStylePrompt:r,styleReferenceImages:o,styleReferenceKey:s}=e;return{imageProvider:"aiGenerated",imageModel:(0,ur.getDefaultImageModel)(),imageStyle:n||t.config.stylePrompt,artStylePreset:a,artStylePrompt:r,styleReferenceImages:o,styleReferenceKey:s}})(f,d);return{agent:s,editor:l,theme:d,chatId:u,imageOptions:f,imageOptionsForEditCard:x,bookmarks:(0,c2.useMemo)(()=>(0,ut.createBookmarkStore)(),[]),applyTheme:m,docId:p,aiOptions:g}};e.s(["useBuddyEditorToolContext",0,ub],605233);let ux=()=>{let e=(0,ue.useBuddyAgent)(),t=ub();return(0,c2.useCallback)(()=>{let i=e.store.getState(),n=i.rollingBack;if(!n)throw Error("No rolling back state");let a=i.checkpoints[n.currentCheckpointId];if(!a)throw Error(`No checkpoint exists with id ${n.currentCheckpointId}`);e.clearRollingBack({resultId:n.resultId,chosenVariationId:n.chosenVariationId}),c4.BuddyEditorInterface.loadCheckpoint(t,a.id,a.id)},[e,t])},uy=e=>{let t=(0,ue.useBuddyAgent)(),i=(0,c3.useAppStore)(),n=ub();return(0,c2.useCallback)(a=>{let{editor:r}=n;if(!r)return;let o=e.findIndex(e=>e.id===a.id);if(-1===o)throw Error(`Cannot find message with id ${a.id}`);let s=c7(r,(0,c5.selectTheme)(i.getState()).id);t.addCheckpoint(s);let l=t.store.getState(),d=l.results[a.id];if(!d)throw Error("Cannot find message result");if("applied-changes"!==d.type)throw Error("Cannot rollback non-applied-changes result");let c=l.chosenResultVariations[d.messageId];if(!c)throw Error("Cannot find applied variation");let u=d.variations.find(e=>e.id===c);if(!u)throw Error("Cannot find applied variation");c4.BuddyEditorInterface.applyResultVariation(n,u),t.setRollingBack({messageIndex:o,resultId:d.messageId,currentCheckpointId:s.id,chosenVariationId:u.id})},[t,n,e,i])};e.s(["useBuddyGenerationProgress",()=>uM],996324);var uv=e.i(44850),uC=e.i(849187);e.i(49202),e.i(256266);var uw=e.i(576897);let uS=new Map;function uk(){let e=Date.now()-3e4;for(let[t,i]of uS)i.timestamp0&&t.applyPending(n),void 0!==i.generationMessage&&(t.upsertGenerationMessage(i.generationMessage),t.flushSave())},_clearForTests(){uS.clear()},_sizeForTests:()=>uS.size}],171084),e.i(584139);var uE=e.i(408122),u_=e.i(103104);let uI={phase:"idle",currentCardIndex:0,isFromAIWizard:!1,completedCards:[]},uM=()=>{let e=(0,ue.useBuddyAgentOrNull)(),t=(0,ue.useBuddyStoreOrDefault)("generationProgress",null),i=(0,c3.useAppSelector)(ua.selectDocId),n=(0,c3.useAppSelector)((0,uv.selectStreamRunningForDoc)(i)),a=t??uI,r=(0,c2.useCallback)(()=>{e?.setGenerationProgress(null)},[e]),o="starting"===a.phase||"generating"===a.phase||"finishing"===a.phase||"done"===a.phase||n&&!t;return{progress:a,resetProgress:r,showGenerationProgress:o,isGenerating:"idle"!==a.phase&&"done"!==a.phase&&"error"!==a.phase,isGenerationComplete:"done"===a.phase}};var uT=e.i(755453),uL=e.i(979021);e.i(254884);var uj=e.i(753801),uP=e.i(103630),uD=e.i(615393),uN=e.i(379457);let uR=(e,t,i,n)=>{let a=n-i;return Math.max(a-Math.max(e-i,0)-Math.max(n-t,0),0)/a};e.s(["useBuddyCardsInView",0,(e,t={})=>{let i=t.bottomInsetPx??0,n=(0,c3.useAppSelector)(c5.selectMode),a=(0,uj.useScrollManager)("editor"),[r,o]=(0,c2.useState)(null),s=(0,c2.useRef)([]),l=(0,c2.useRef)(n);l.current=n;let d=(0,c3.useAppSelector)(ua.selectDocId),c=(0,c2.useRef)(d);c.current=d;let u=(0,c2.useRef)({scrollTop:0,containerHeight:0}),p=(0,c2.useCallback)(e=>{var t;if(t=s.current,t.length===e.length&&t.every((t,i)=>t.cardId===e[i].cardId&&t.pos===e[i].pos&&t.inView===e[i].inView))return;s.current=e;let i=(0,ui.selectActiveBuddyAgent)((0,c3.getStore)().getState());i&&i.docId===c.current&&i.setCardsInView(e)},[]),h=(0,c2.useCallback)(function(){let t=l.current===uD.EditorModeEnum.SLIDE_VIEW;if(document.hidden||!e||t)return;let{scrollTop:n,containerHeight:r}=u.current,o=n+r-i,s=(0,uT.findChildren)(e.state.doc,uP.isCardNode).filter(t=>1===e.state.doc.resolve(t.pos).depth),d=document.querySelector(a.scrollSelector);if(!d)return;let c=(0,uN.getOffsetFromParent)(d,a.scrollSelector),h=[];for(let t of s){let i,r=t.node.attrs.id;try{i=e.view.nodeDOM(t.pos)}catch(e){console.error("computeOverlap error",e);continue}if(i instanceof HTMLElement){i=i.querySelector("[data-card-body]");let e=(0,uN.getOffsetFromParent)(i,a.scrollSelector)-c;if(e>o)break;let{offsetHeight:s}=i,l=s+e;h.push({id:r,pos:t.pos,overlap:uR(n,o,e,l)})}}p((e=>{let t=e.filter(e=>e.overlap>0);if(0===t.length)return[];if(0===t.filter(e=>e.overlap>=.6).length){let e=t.reduce((e,t)=>e.overlap>t.overlap?e:t,t[0]);return[{cardId:e.id,pos:e.pos,inView:"partial"}]}return t.map(e=>({cardId:e.id,pos:e.pos,inView:e.overlap>=.9?"full":"partial"}))})(h.sort((e,t)=>e.pos-t.pos)))},[i,p,e,a.scrollSelector]);(({onStart:e,onEnd:t,onUpdate:i,element:n=null,endDelay:a=250,updateThrottle:r=100}={})=>{let o=(0,c2.useRef)(!1),s=(0,c2.useRef)(null),l=(0,c2.useRef)(null),d=(0,c2.useRef)(0),c=(0,c2.useRef)(!1);(0,c2.useEffect)(()=>{c.current="onscrollend"in window},[]);let u=(0,c2.useCallback)(()=>{let e=Date.now(),t=e-d.current;t>=r?(d.current=e,i?.()):(l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{d.current=Date.now(),i?.()},r-t))},[i,r]),p=(0,c2.useCallback)(()=>{o.current||(o.current=!0,e?.())},[e]),h=(0,c2.useCallback)(()=>{s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{o.current&&(o.current=!1,t?.())},a)},[t,a]),m=(0,c2.useCallback)(()=>{p(),i&&u(),c.current||h()},[p,h,u,i]),g=(0,c2.useCallback)(()=>{o.current&&(o.current=!1,t?.())},[t]);return(0,c2.useEffect)(()=>{if(n)return n.addEventListener("scroll",m,{passive:!0}),c.current&&n.addEventListener("scrollend",g,{passive:!0}),()=>{n.removeEventListener("scroll",m),c.current&&n.removeEventListener("scrollend",g),s.current&&clearTimeout(s.current),l.current&&clearTimeout(l.current)}},[n,m,g]),o.current,c.current})({element:r,onUpdate:()=>{r&&(u.current.scrollTop=r.scrollTop,h())},onEnd:()=>{r&&(u.current.scrollTop=r.scrollTop,h())},endDelay:250,updateThrottle:100}),(0,c2.useEffect)(()=>{let e=(0,uL.default)(()=>{r&&(u.current.containerHeight=r.getBoundingClientRect().height,h())},250,{trailing:!0,maxWait:500});return window.addEventListener("resize",e),()=>{e.cancel(),window.removeEventListener("resize",e)}},[h,r]),(0,c2.useEffect)(()=>{let e=document.querySelector(a.scrollSelector);e&&(o(e),u.current.scrollTop=e.scrollTop,u.current.containerHeight=e.getBoundingClientRect().height,h())},[a.scrollSelector,u,h]),(0,c2.useEffect)(()=>{let e=setInterval(()=>{h()},1e3);return()=>clearInterval(e)},[h])}],986271);let uO=(0,c2.createContext)(null);e.s(["BuddyChatSaveContext",0,uO,"useBuddyChatSave",0,()=>{let e=(0,c2.useContext)(uO);return e?.saveCurrentChat}],237060);var uB=e.i(275885);e.s(["useBuddyClear",0,function(e){let t=(0,ue.useBuddyAgent)(),i=(0,ue.useBuddyResetChat)(),n=(0,ud.useToast)();return(0,c2.useCallback)(async()=>{e?.(),await t.stop();try{await i()}catch(e){uB.captureException(e,{level:"warning",tags:{scope:"buddy.resetChat"}}),n({title:uE.i18n._({id:"qCSLph",message:"Failed to clear chat. Please try again."}),position:"top",status:"error",duration:5e3})}},[t,i,e,n])}],713677);let uz=(e,t)=>t.some(t=>e instanceof t),uF=new WeakMap,uH=new WeakMap,uW=new WeakMap,uU={get(e,t,i){if(e instanceof IDBTransaction){if("done"===t)return uF.get(e);if("store"===t)return i.objectStoreNames[1]?void 0:i.objectStore(i.objectStoreNames[0])}return uV(e[t])},set:(e,t,i)=>(e[t]=i,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function uV(e){if(e instanceof IDBRequest){let t;return t=new Promise((t,i)=>{let n=()=>{e.removeEventListener("success",a),e.removeEventListener("error",r)},a=()=>{t(uV(e.result)),n()},r=()=>{i(e.error),n()};e.addEventListener("success",a),e.addEventListener("error",r)}),uW.set(t,e),t}if(uH.has(e))return uH.get(e);let n=function(e){if("function"==typeof e)return(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(...t){return e.apply(uG(this),t),uV(this.request)}:function(...t){return uV(e.apply(uG(this),t))};return(e instanceof IDBTransaction&&function(e){if(uF.has(e))return;let t=new Promise((t,i)=>{let n=()=>{e.removeEventListener("complete",a),e.removeEventListener("error",r),e.removeEventListener("abort",r)},a=()=>{t(),n()},r=()=>{i(e.error||new DOMException("AbortError","AbortError")),n()};e.addEventListener("complete",a),e.addEventListener("error",r),e.addEventListener("abort",r)});uF.set(e,t)}(e),uz(e,t||(t=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])))?new Proxy(e,uU):e}(e);return n!==e&&(uH.set(e,n),uW.set(n,e)),n}let uG=e=>uW.get(e),u$=["get","getKey","getAll","getAllKeys","count"],uZ=["put","add","delete","clear"],uK=new Map;function uq(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&"string"==typeof t))return;if(uK.get(t))return uK.get(t);let i=t.replace(/FromIndex$/,""),n=t!==i,a=uZ.includes(i);if(!(i in(n?IDBIndex:IDBObjectStore).prototype)||!(a||u$.includes(i)))return;let r=async function(e,...t){let r=this.transaction(e,a?"readwrite":"readonly"),o=r.store;return n&&(o=o.index(t.shift())),(await Promise.all([o[i](...t),a&&r.done]))[0]};return uK.set(t,r),r}uU={...n=uU,get:(e,t,i)=>uq(e,t)||n.get(e,t,i),has:(e,t)=>!!uq(e,t)||n.has(e,t)};let uY=["continue","continuePrimaryKey","advance"],uX={},uQ=new WeakMap,uJ=new WeakMap,u0={get(e,t){if(!uY.includes(t))return e[t];let i=uX[t];return i||(i=uX[t]=function(...e){uQ.set(this,uJ.get(this)[t](...e))}),i}};async function*u1(...e){let t=this;if(t instanceof IDBCursor||(t=await t.openCursor(...e)),!t)return;let i=new Proxy(t,u0);for(uJ.set(i,t),uW.set(i,uG(t));t;)yield i,t=await (uQ.get(i)||t.continue()),uQ.delete(i)}function u2(e,t){return t===Symbol.asyncIterator&&uz(e,[IDBIndex,IDBObjectStore,IDBCursor])||"iterate"===t&&uz(e,[IDBIndex,IDBObjectStore])}uU={...a=uU,get:(e,t,i)=>u2(e,t)?u1:a.get(e,t,i),has:(e,t)=>u2(e,t)||a.has(e,t)};class u3{config;db;initPromise;constructor(e){this.config=e,this.db=null,this.initPromise=null}async getDb(){return this.db?this.db:this.initPromise?this.initPromise:"indexedDB"in window?(this.initPromise=this.initDB(),this.initPromise):(console.warn("[IndexedDBStore] IndexedDB not available"),null)}async initDB(){try{let e=new Promise((e,t)=>{setTimeout(()=>t(Error("Database initialization timeout")),2e3)}),t=function(e,t,{blocked:i,upgrade:n,blocking:a,terminated:r}={}){let o=indexedDB.open(e,t),s=uV(o);return n&&o.addEventListener("upgradeneeded",e=>{n(uV(o.result),e.oldVersion,e.newVersion,uV(o.transaction),e)}),i&&o.addEventListener("blocked",e=>i(e.oldVersion,e.newVersion,e)),s.then(e=>{r&&e.addEventListener("close",()=>r()),a&&e.addEventListener("versionchange",e=>a(e.oldVersion,e.newVersion,e))}).catch(()=>{}),s}(this.config.dbName,this.config.version,{upgrade:this.config.upgrade});return this.db=await Promise.race([t,e]),this.db}catch(e){return console.error("[IndexedDBStore] Failed to initialize database:",e),this.db=null,this.initPromise=null,null}}async save(e,t){let i=await this.getDb();if(!i)return void console.warn("[IndexedDBStore] Database not available, skipping save");try{await i.put(this.config.storeName,t,e)}catch(e){console.error("[IndexedDBStore] Failed to save data:",e)}}async load(e){let t=await this.getDb();if(!t)return console.error("[IndexedDBStore] Database not available"),null;try{return await t.get(this.config.storeName,e)||null}catch(e){return console.error("[IndexedDBStore] Failed to load data:",e),null}}async delete(e){let t=await this.getDb();if(t)try{await t.delete(this.config.storeName,e)}catch(e){console.error("[IndexedDBStore] Failed to delete data:",e)}}async getAll(){let e=await this.getDb();if(!e)return[];try{return await e.getAll(this.config.storeName)}catch(e){return console.error("[IndexedDBStore] Failed to get all data:",e),[]}}getConfig(){return this.config}async getDatabase(){return this.getDb()}async deleteWhere(e){let t=await this.getDb();if(!t)return 0;try{let i=t.transaction(this.config.storeName,"readwrite"),n=i.objectStore(this.config.storeName),a=await n.openCursor(),r=0;for(;a;){let t=a.value;e(t)&&(await a.delete(),r++),a=await a.continue()}return await i.done,r}catch(e){return console.error("[IndexedDBStore] Failed to delete with predicate:",e),0}}async deleteByIndex(e,t){let i=await this.getDb();if(!i)return 0;try{let n=i.transaction(this.config.storeName,"readwrite"),a=n.objectStore(this.config.storeName).index(e),r=await a.openCursor(IDBKeyRange.only(t)),o=0;for(;r;)await r.delete(),o++,r=await r.continue();return await n.done,o}catch(e){return console.error("[IndexedDBStore] Failed to delete by index:",e),0}}async getUniqueIndexValues(e){let t=await this.getDb();if(!t)return new Set;try{let i=t.transaction(this.config.storeName,"readonly"),n=i.objectStore(this.config.storeName).index(e),a=new Set,r=await n.openKeyCursor();for(;r;)r.key&&a.add(r.key),r=await r.continue();return await i.done,a}catch(e){return console.error("[IndexedDBStore] Failed to get unique index values:",e),new Set}}}function u5(e){if("assistant"!==e.role)return e;let t=e.parts,i=[];for(let e=0;e{t<1&&!e.objectStoreNames.contains("chats")&&e.createObjectStore("chats").createIndex("userId","userId",{unique:!1})}};class u6{store;hasInitializedCleanup=!1;constructor(){this.store=new u3(u4)}async ensureCleanupRun(e){this.hasInitializedCleanup||(await this.cleanupStaleChats(),await this.cleanupOtherUserChats(e),this.hasInitializedCleanup=!0)}generateKey(e){let{docId:t,workspaceId:i,userId:n}=e;return`${n}:${i}:${t}`}async saveChat(e){try{await this.ensureCleanupRun(e.userId);let t=this.generateKey(e);await this.store.save(t,e)}catch(t){console.error("[BuddyChatDB] Failed to save chat:",t),uB.captureMessage("buddy saveChat failed",{level:"warning",extra:{docId:e.docId,workspaceId:e.workspaceId,userId:e.userId,error:t instanceof Error?t.message:String(t)}})}}async loadChat(e){try{await this.ensureCleanupRun(e.userId);let t=this.generateKey(e);return await this.store.load(t)}catch(e){return console.error("[BuddyChatDB] Failed to load chat:",e),null}}async deleteChat(e){try{let t=this.generateKey(e);await this.store.delete(t)}catch(e){console.error("[BuddyChatDB] Failed to delete chat:",e)}}async cleanupOtherUserChats(e){try{for(let t of(await this.store.getUniqueIndexValues("userId")))t!==e&&await this.store.deleteByIndex("userId",t)}catch(e){console.error("[BuddyChatDB] Failed to cleanup other user chats:",e)}}async cleanupStaleChats(){try{let e=Date.now()-2592e5;await this.store.deleteWhere(t=>t.timestampe+JSON.stringify(t).length,0),i=e.map(e=>e.timestamp);return{totalChats:e.length,totalSize:t,oldestChat:Math.min(...i),newestChat:Math.max(...i)}}}let u9=new class extends u6{cache={};async loadChat(e){let t=this.generateKey(e),i=this.cache[t];if(i)return i;let n=await super.loadChat(e);if(!n)return null;let a=this.migrateMissingStepStartMessages(n);return this.cache[t]=a,a}async saveChat(e){await super.saveChat(e);let t=this.generateKey(e);this.cache[t]=e}async deleteChat(e){await super.deleteChat(e);let t=this.generateKey(e);delete this.cache[t]}migrateMissingStepStartMessages(e){let t=e.chatData.messages.map(u5);return{...e,chatData:{...e.chatData,messages:t}}}};e.s(["useBuddyDebug",0,(e,t)=>{let i=(0,c3.useAppStore)(),n=(0,ue.useBuddyAgentOrNull)();(0,c2.useEffect)(()=>(window.buddyDebug=async()=>{let a=i.getState(),r=t(),o=a.ThemePicker,s=await u9.getStorageStats(),l={messages:e,agentStore:n?.store.getState(),serialized:r,themes:o,storageStats:s};return console.log(l),l},()=>{delete window.buddyDebug}),[e,t,i,n])}],985050),e.s(["useQueuedMessageDrainer",0,function({agent:e,queuedMessage:t,disabledReason:i,status:n,pendingToolCount:a,doSubmit:r}){(0,c2.useEffect)(()=>{if(t){if("contextWindow"===i){e.setTotalTokensUsed(0),r({input:t.message,uploadedFiles:t.uploadedFiles,context:t.context,keepHistory:!1});return}if(null===i&&"ready"===n&&0===a)return void r({input:t.message,uploadedFiles:t.uploadedFiles,context:t.context,keepHistory:!0});"credits"===i&&e.setQueuedMessage(null)}},[t,i,n,a,e,r])}],166549),e.s(["serializeBuddyState",0,e=>({chatId:e.chatId||"",messagesVersion:"v5",messages:e.messages,checkpoints:e.checkpoints,chosenResultVariations:e.chosenResultVariations,results:e.results,selectiveAccept:e.selectiveAccept,suggestions:Object.values(e.suggestions).map(e=>e.serialize()),totalTokensUsed:e.totalTokensUsed,lastMessageTs:e.lastMessageTs})],31397),e.s(["useBuddyTestCase",0,({reload:e,setMessages:t,isLoading:i})=>{let n=(0,c3.useAppStore)();(0,c3.useAppDispatch)();let a=(0,c2.useRef)(1),[r,o]=(0,c2.useState)(!1),s=(0,c2.useRef)([]),l=(0,c2.useRef)(!1),d=(0,c2.useRef)(i);(0,c2.useEffect)(()=>{d.current=i},[i]);let c=(0,c2.useCallback)(()=>{l.current=!1},[]),u=(0,c2.useCallback)(()=>{if(d.current)return;if(0===s.current.length){console.log("No remaining messages"),o(!1),p.current&&(clearInterval(p.current),p.current=null);return}console.log("send message");let[i,...n]=s.current;s.current=n;let r={id:`user-${a.current++}`,parts:[{type:"text",text:i}],role:"user"};l.current=!0,t(e=>[...e,r]),e()},[e,t]),p=(0,c2.useRef)(null);return{startTestCase:(0,c2.useCallback)((e,i)=>{p.current?console.log("NOT STARTING INTERVAL"):(t(()=>[]),o(!0),i.themeId&&(0,ug.selectGlobalThemes)(n.getState()).find(e=>e.id===i.themeId),s.current=i.userMessages,p.current=setInterval(u,1e3))},[u,t,n]),isRunning:r,markFinish:c}}],816390),e.s(["getLastMessage",0,(e,t)=>{if(!t&&e.length)return e[e.length-1];for(let i=e.length-1;i>=0;i--){let n=e[i];if(n.role===t)return n}}],865208);var u8=e.i(428683),u7=e.i(613616),pe=e.i(555145),pt=e.i(887527),pi=e.i(892194),pn=e.i(654656),pa=e.i(575084),pr=e.i(541075),po=e.i(910656),ps=e.i(707065),pl=e.i(530521);let pd=` @keyframes sparkle-large { 0%, 20%, 80%, 100% { transform: scale(1.1); } 50% { transform: scale(0.9); } } @keyframes sparkle-small { 0%, 20%, 80%, 100% { transform: scale(1.2); } 50% { transform: scale(1); } } @keyframes sparkle-dot-top { 0%, 20%, 80%, 100% { transform: scale(1.1) translateX(0px); } 50% { transform: scale(0.9) translateX(0.5px); } } @keyframes sparkle-dot-bottom { 0%, 20%, 80%, 100% { transform: scale(1.1) translateX(0.5px); } 50% { transform: scale(0.9) translateX(0px); } } `,pc=({variant:e="gradient",color:t,isAnimated:i=!0})=>{let n=(0,c2.useId)(),a=(0,pl.useToken)("colors",t||"blue.900"),r=(()=>{switch(e){case"currentColor":return"currentColor";case"solid":return a;default:return`url(#sparkle-gradient-${n})`}})(),o=(0,pi.useColorModeValue)("var(--chakra-colors-blue-400)","var(--chakra-colors-blue-300)"),s=(0,pi.useColorModeValue)("var(--chakra-colors-blue-700)","var(--chakra-colors-blue-500)");return(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)("style",{children:pd}),(0,ul.jsxs)("svg",{width:24,height:24,viewBox:"-1 -1 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:["gradient"===e&&(0,ul.jsx)("defs",{children:(0,ul.jsxs)("linearGradient",{id:`sparkle-gradient-${n}`,x1:"0%",y1:"0%",x2:"20",y2:"20",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(0,0)",children:[(0,ul.jsx)("stop",{offset:"0%",stopColor:o}),(0,ul.jsx)("stop",{offset:"50%",stopColor:s}),(0,ul.jsx)("stop",{offset:"100%",stopColor:o}),i&&(0,ul.jsx)("animateTransform",{attributeName:"gradientTransform",type:"translate",values:"-36 0; 36 0;",dur:"3s",repeatCount:"indefinite"})]})}),(0,ul.jsx)("path",{d:"M23.7371 14.4666C23.5971 14.6386 23.3914 14.738 23.1691 14.738C19.8643 14.738 17.185 17.4354 17.185 20.7521C17.185 20.9862 17.0862 21.1934 16.9154 21.3343C16.7837 21.442 16.6191 21.5 16.4503 21.5C16.4009 21.5 16.3516 21.4959 16.3001 21.4855C15.9626 21.4171 15.7177 21.1084 15.7177 20.7521C15.7177 17.4354 13.0385 14.738 9.7439 14.738C9.51137 14.738 9.30559 14.6386 9.16566 14.4666C9.02573 14.2947 8.97016 14.0689 9.01544 13.8493C9.08334 13.5095 9.38996 13.263 9.7439 13.263C13.0385 13.263 15.7177 10.5657 15.7177 7.2489C15.7177 7.00444 15.8289 6.78277 16.0161 6.64397C16.2055 6.50309 16.4462 6.46373 16.6767 6.53417C16.9751 6.62739 17.185 6.9195 17.185 7.2489C17.185 10.5657 19.8643 13.263 23.1588 13.263C23.5128 13.263 23.8194 13.5095 23.8873 13.8493C23.9305 14.0689 23.877 14.2947 23.7371 14.4666Z",fill:r,style:{animation:i?"sparkle-large 2s ease-in-out infinite":"none",transformOrigin:"16.5px 14px"}}),(0,ul.jsx)("path",{d:"M8.73882 9.18912C8.77194 9.35249 8.73054 9.52214 8.62706 9.6499V9.6478C8.52357 9.77766 8.36834 9.85096 8.20483 9.85096C6.46004 9.85096 5.04434 11.2836 5.04434 13.0429C5.04434 13.2167 4.96983 13.3717 4.84358 13.4764C4.7463 13.556 4.62418 13.6 4.5 13.6C4.46481 13.6 4.42756 13.5979 4.3903 13.5895C4.1378 13.5372 3.95566 13.3089 3.95566 13.0429C3.95566 11.2836 2.53996 9.85096 0.80138 9.85096C0.629592 9.85096 0.476431 9.77766 0.372945 9.6499C0.269458 9.52004 0.228063 9.35249 0.261179 9.18912C0.312922 8.9336 0.538524 8.74929 0.80138 8.74929C2.53996 8.74929 3.95566 7.3167 3.95566 5.55737C3.95566 5.37515 4.03845 5.20969 4.17712 5.10707C4.31786 5.00235 4.49586 4.97302 4.66558 5.02538C4.88911 5.0945 5.04434 5.31442 5.04434 5.55737C5.04434 7.3167 6.46004 8.74929 8.19862 8.74929C8.46148 8.74929 8.68708 8.9336 8.73882 9.18912Z",fill:r,style:{animation:i?"sparkle-small 2s ease-in-out infinite":"none",transformOrigin:"4.5px 9.2px"}}),(0,ul.jsx)("path",{d:"M13.1 4.10001C13.1 4.92721 12.4299 5.60001 11.6 5.60001C10.7728 5.60001 10.1 4.92721 10.1 4.10001C10.1 3.2728 10.7728 2.60001 11.6 2.60001C12.4272 2.60001 13.1 3.2728 13.1 4.10001Z",fill:r,style:{animation:i?"sparkle-dot-top 2s ease-in-out infinite":"none",transformOrigin:"11.6px 4.1px"}}),(0,ul.jsx)("path",{d:"M5.84998 19.1C5.84998 18.2728 6.52001 17.6 7.34998 17.6C8.17718 17.6 8.84998 18.2728 8.84998 19.1C8.84998 19.9272 8.17718 20.6 7.34998 20.6C6.52277 20.6 5.84998 19.9272 5.84998 19.1Z",fill:r,style:{animation:i?"sparkle-dot-bottom 2s ease-in-out infinite":"none",transformOrigin:"7.35px 19.1px"}})]})]})};e.s(["AISparkleIcon",0,pc],127050);let pu=ps.keyframes` 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } `,pp=({showLoadingIcon:e=!0,children:t,...i})=>{let n=(0,pi.useColorModeValue)("linear(to-r, blue.400 0%, blue.700 50%, blue.400 100%)","linear(to-r, blue.300 0%, blue.500 50%, blue.300 100%)"),a=(0,ul.jsx)(pt.Text,{...i,fontSize:i.fontSize||"sm",fontWeight:"semibold",backgroundClip:"text",bgGradient:n,backgroundSize:"200% 100%",animation:`${pu} 3s linear infinite`,children:t});return e?(0,ul.jsxs)(pe.HStack,{justify:"center",align:"center",children:[(0,ul.jsx)(pc,{}),a]}):a};var ph=e.i(263582),pm=e.i(394305);let pg=(0,c2.memo)(({text:e,iconColor:t,textColor:i})=>(0,ul.jsxs)(pe.HStack,{fontSize:"xs",color:t,alignItems:"flex-start",children:[(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faSparkle,style:{marginInlineStart:"1px",marginTop:"4px"}}),(0,ul.jsx)(pt.Text,{fontSize:"sm",ms:"-1px",color:i,children:e})]}));pg.displayName="CompletedToolCall";let pf=(0,c2.memo)(({text:e})=>(0,ul.jsx)(pp,{children:e}));pf.displayName="InProgressToolCall";let pb=(0,c2.memo)(({progress:e})=>{let{phase:t,currentCardIndex:i,completedCards:n=[]}=e,a=(0,pi.useColorModeValue)("gray.200","gray.600"),r=(0,pi.useColorModeValue)("gray.600","gray.300"),o=(0,pi.useColorModeValue)("gray.500","gray.400"),s="done"===t,l="starting"===t||"generating"===t||"finishing"===t,d=(0,c2.useMemo)(()=>{let e;return e=(0,ph.getCategorizedChatSuggestions)().map(e=>{let t=Math.floor(Math.random()*e.operations.length);return e.operations[t]}),(0,po.default)(e)},[]),c=(0,c2.useRef)(null);return((0,c2.useEffect)(()=>{c.current&&(l||s)&&c.current.scrollIntoView({behavior:"smooth",block:"end"})},[n.length,l,s]),"idle"===t||"error"===t)?null:(0,ul.jsxs)(pn.VStack,{fontSize:"14px",spacing:4,px:0,width:"100%",height:"100%",alignItems:"stretch",justifyContent:"start",flex:1,p:2,pb:0,overflowY:"auto",minHeight:0,children:[(0,ul.jsx)(pn.VStack,{p:0,alignSelf:"flex-start",width:"100%",position:"relative",align:"start",fontSize:"sm",children:(0,ul.jsxs)(pn.VStack,{width:"100%",align:"start",spacing:2,p:2,children:[(0,ul.jsx)(pt.Text,{color:r,fontSize:"sm",children:(0,ul.jsx)(uc.Trans,{message:"Here I go! Let me get to work.",id:"eLGVT1"})}),n.map((e,t)=>{let n;return(0,ul.jsx)(u7.Flex,{position:"relative",_before:t0&&(0,ul.jsxs)(u8.Box,{children:[(0,ul.jsxs)(pt.Text,{fontSize:"sm",pb:3,children:[uE.i18n._({id:"YmlTFV",message:"Done! Your {GAMMA_ARTIFACT_PROPER_NOUN} is ready.",values:{GAMMA_ARTIFACT_PROPER_NOUN:u_.GAMMA_ARTIFACT_PROPER_NOUN}})," ",(0,ul.jsx)(uc.Trans,{message:"Here are some things I can help with:",id:"41XsKc"})]}),(0,ul.jsx)(pm.BuddyQuickActionGroups,{actionGroups:[{key:"post-generation-suggestions",operations:d}],wrapProps:{justify:"flex-start"}})]})]})}),(0,ul.jsx)(u8.Box,{minHeight:"20px"}),(0,ul.jsx)("div",{ref:c})]})});pb.displayName="GenerationProgressMessages",e.s(["GenerationProgressMessages",0,pb],836465);var px=e.i(969641),py=e.i(24790),pv=e.i(918228),pC=e.i(241908);e.s(["BuddyChatHeader",0,({onClose:e,onNewChat:t,hideCloseButton:i=!1})=>{let n=(0,ue.useBuddyStore)("isLoading"),a=(0,ue.useBuddyStore)("generationProgress"),r=!!n||null!=a&&"error"!==a.phase;return(0,ul.jsx)(pv.Stack,{py:2,px:4,spacing:0,children:(0,ul.jsxs)(pe.HStack,{children:[(0,ul.jsx)(u7.Flex,{flex:1,children:(0,ul.jsxs)(pe.HStack,{align:"center",justify:"space-between",w:"100%",flex:1,children:[(0,ul.jsx)(u7.Flex,{display:"flex",alignItems:"center",children:(0,ul.jsx)(pC.PanelHeading,{children:u_.AGENT_PROPER_NOUN})}),(0,ul.jsx)(px.Button,{size:"sm",variant:"ghost",px:4,flexShrink:0,leftIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faRotateRight}),onClick:t,isDisabled:r,children:(0,ul.jsx)(uc.Trans,{message:"Clear",id:"BC/Bbp"})})]})}),!i&&(0,ul.jsx)(py.CloseButton,{onClick:()=>{e?.()}})]})})}],366273),e.s(["ChatFooter",()=>pj],703136);var pw=e.i(865799),pS=e.i(663025),pk=e.i(643292),pA=e.i(139809),pE=e.i(625878),p_=e.i(343094),pI=e.i(948714),pM=e.i(189938);let pT=({cardInView:e})=>{let t=(0,c3.useAppSelector)((0,pM.selectCardTitle)(e.cardId))??e.cardId;return(0,ul.jsx)(pw.Badge,{colorScheme:"blue",variant:"full"===e.inView?"solid":"outline",size:"sm",borderRadius:"md",px:2,py:1,maxW:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flexShrink:0,children:t},e.cardId)};var pL=e.i(192984);let pj=({status:e,manualSubmit:t,handleStop:i,lastTokensUsed:n,editor:a})=>{let{disabledReason:r}=(0,pk.useBuddyNotificationState)(),o=(0,ue.useBuddyStore)("cardsInView"),s=(0,ue.useBuddyStore)("pendingToolCount"),l=(0,uC.useFeatureFlag)("buddyDebug"),[d,c]=(0,c2.useState)(""),u=(0,c2.useRef)(null),p=(0,c2.useCallback)(()=>{u.current?.focus()},[]),{uploadedFiles:h,uploadFiles:m,openFilePicker:g,removeFile:f,resetFiles:b,isUploading:x,hiddenFileInput:y}=(0,pA.useChatFileUploads)({focusInput:p}),v="submitted"===e||"streaming"===e||s>0,C=!v&&!x&&(""!==d.trim()||h.length>0),w=(0,c2.useCallback)(()=>{C&&(t(d,h),c(""),b())},[C,d,t,b,h]),{isInSheet:S}=(0,pI.useSheetOcclusion)();(0,c2.useEffect)(()=>{S||u.current?.focus()},[S]);let k=(0,ue.useBuddyStore)("editorSelection"),A=k?.type==="image"?k.attrs:void 0,{suggestions:E}=(0,pS.useSuggestImageEdits)(A),_=k?.type==="image"&&A?[{key:"suggested",operations:(E||[]).map(e=>({key:e,label:()=>e,onQuickAction:t=>{t({message:uE.i18n._({id:"ZI5Cdm",message:"Edit this image. {s}",values:{s:e}})})}}))}]:[],I=(0,p_.useSendQueuedBuddyMessage)(),M=(0,c2.useCallback)(e=>{e.onQuickAction?.(I,e),c(""),b()},[b,I]),T=k?.type==="image"?uE.i18n._({id:"wm/Yby",message:"How would you like to edit this image?"}):k?.type==="text"&&k?.length>0?uE.i18n._({id:"asPvjX",message:"How would you like to edit this text?"}):uE.i18n._({id:"n64L59",message:"Ask me to edit, create, or style anything"}),L=(({editor:e})=>{let t=(0,ue.useBuddyAgentOrNull)();return(0,c2.useCallback)(()=>{let i=t?.store.getState().editorSelection??null;if(!e||!i)return;if("card"===i.type){let t=c4.BuddyEditorInterface.checkCardById(e,i.cardId);if(!t)return;e.chain().selectInsideCardBody(t.pos).focus().run();return}let n=(0,pE.relativeToAbsolutePos)(e.state,i.from),a=(0,pE.relativeToAbsolutePos)(e.state,i.to);n&&a&&n!==a&&e.chain().setTextSelection({from:n,to:n}).run()},[e,t])})({editor:a}),j=(0,c2.useMemo)(()=>k?{...k,goTo:()=>{c4.BuddyEditorInterface.checkCardById(a,k.cardId)&&a.chain().focus().run()},remove:L}:null,[k,a,L]);return(0,ul.jsxs)(pn.VStack,{direction:"column",align:"stretch",p:2,pt:0,children:[l&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsxs)(pw.Badge,{maxW:"fit-content",children:["Last request: ",Math.trunc(n/1e3),"k/",Math.trunc(200),"k (",Math.trunc(n/2e5*100),"%) tokens used"]}),(0,ul.jsx)(pe.HStack,{spacing:2,overflowX:"auto",py:1,children:o.map(e=>(0,ul.jsx)(pT,{cardInView:e},e.cardId))})]}),y,(0,ul.jsx)(pL.BuddyChatUniInput,{placeholder:T,onSubmit:w,onStop:i,inputRef:u,input:d,setInput:c,onUploadClick:g,isLoading:v,uploadedFiles:h,uploadFiles:m,removeFile:f,canSubmit:C,editor:a,editorSelection:j,actionGroups:_,onQuickAction:M,isDisabled:null!=r,showChatSuggestions:!0})]})};var pP=e.i(676828),pD=e.i(818315),pN=e.i(816350),pR=e.i(25747),pO=e.i(644315);let pB={en:[{imageUrl:"https://static.gamma.app/images/empty-states/roar-fde55d91.png",title:({name:e})=>`Someone stop ${e}! (jk never stop)`,shouldShow:pO.always},{imageUrl:"https://static.gamma.app/images/empty-states/coffee-cat-516d3ee5.png",title:({name:e})=>`${e}! Coffee kicked in yet?`,shouldShow:(0,pO.isHourBetween)(5,12)},{imageUrl:"https://static.gamma.app/images/empty-states/detective-bear-2c0f9922.png",title:({name:e})=>`Oh hey, ${e}! Time to slide`,shouldShow:(0,pO.isHourBetween)(12,18)},{imageUrl:"https://static.gamma.app/images/empty-states/candle-da129327.png",title:({name:e})=>`${e} after dark 🌙`,shouldShow:(0,pO.isHourBetween)(18,24)},{imageUrl:"https://static.gamma.app/images/empty-states/work-on-sand-1ea090dc.png",title:({name:e})=>`Work keeping you up, ${e}? Pass it to me`,shouldShow:(0,pO.isHourBetween)(0,5)},{imageUrl:"https://static.gamma.app/images/empty-states/work-on-grass-84d3575b.png",title:({name:e})=>`${e} on a weekend? Respect`,shouldShow:pO.isWeekend}],global:[{imageUrl:"https://static.gamma.app/images/empty-states/vision-in-hand-196bb0be.png",title:(0,ul.jsx)(uc.Trans,{message:"What's your vision today?",id:"IkgATh"}),shouldShow:pO.always},{imageUrl:"https://static.gamma.app/images/empty-states/train-eb28f3b8.png",title:({name:e})=>(0,ul.jsx)(uc.Trans,{message:"Early start {name}? {AGENT_PROPER_NOUN}'s here! ",id:"rnnwej",values:{name:e,AGENT_PROPER_NOUN:u_.AGENT_PROPER_NOUN}}),shouldShow:(0,pO.isHourBetween)(5,12)},{imageUrl:"https://static.gamma.app/images/empty-states/flying-cat-8dcad3ad.png",title:(0,ul.jsx)(uc.Trans,{message:"Productive afternoon starts now",id:"TSfZA1"}),shouldShow:(0,pO.isHourBetween)(12,17)},{imageUrl:"https://static.gamma.app/images/empty-states/roar-fde55d91.png",title:(0,ul.jsx)(uc.Trans,{message:"Finish strong with {AGENT_PROPER_NOUN}",id:"eBl6Cy",values:{AGENT_PROPER_NOUN:u_.AGENT_PROPER_NOUN}}),shouldShow:(0,pO.isHourBetween)(17,24)},{imageUrl:"https://static.gamma.app/images/empty-states/work-on-sand-1ea090dc.png",title:(0,ul.jsx)(uc.Trans,{message:"Working late? You're not alone",id:"c1s9fb"}),shouldShow:(0,pO.isHourBetween)(0,5)},{imageUrl:"https://static.gamma.app/images/empty-states/work-on-grass-84d3575b.png",title:(0,ul.jsx)(uc.Trans,{message:"{AGENT_PROPER_NOUN} works weekends too",id:"rLQfD1",values:{AGENT_PROPER_NOUN:u_.AGENT_PROPER_NOUN}}),shouldShow:pO.isWeekend}]},pz={src:e.i(437217).default,width:400,height:374,blurWidth:8,blurHeight:7,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAYAAAA1WQxeAAAA8klEQVR42gHnABj/AEdwTABHcEwAR3BMAFh6XR+MfmZmgXddV0xwUBBGcE4FADlxYjE1cmk/PXdzUpmotbfbi436k19t9ENxlLcedZmpAAZ2tuwFdrn0Qo7G+a674v7ol5H/z319/y93s/8Cdr7/AAF2vv8hgcL/nq7a/6a25v/mpZf/+6B//26Pqf8Bdr7/AAp5v/+DoM7/srXk/5y06P/ltKH//rWM/5aiqf8Cdr7/AECLxv+0s93/orfr/6S86v/pwrD/+MKg/2WXtf8Cdr39AJSq1fqvut/vq7zY36S3zM2/s5+5o6OOpTN6i44mc4J32cWIeqpCVDEAAAAASUVORK5CYII="},pF=(0,c2.memo)(()=>{let{user:e}=(0,pR.useUserContext)(),t=(0,pN.useLinguiLocale)(),i=e?.firstName||e?.displayName||"there",n=(0,c2.useMemo)(()=>{let e=((e,t,i=new Date)=>{let n=("en"===e?t.en:t.global).filter(e=>!e.shouldShow||e.shouldShow(i));if(0===n.length)return null;let a=Math.floor(Math.random()*n.length);return n[a]})(t,pB);return e||{imageUrl:pz.src,title:"en"===t?"Edit with AI":(0,ul.jsx)(uc.Trans,{message:"Edit with AI",id:"EVnzPs"})}},[t]),a=(0,c2.useMemo)(()=>"function"==typeof n.title?n.title({name:i}):n.title,[n,i]),r=(0,c2.useMemo)(()=>{let e;return e=(0,ph.getCategorizedChatSuggestions)().map(e=>{let t=Math.floor(Math.random()*e.operations.length);return e.operations[t]}),(0,po.default)(e)},[]),o=r.length>0,s=(0,pi.useColorModeValue)("gray.600","gray.500");return(0,ul.jsx)(u7.Flex,{direction:"column",height:"100%",justifyContent:"center",children:(0,ul.jsxs)(pv.Stack,{spacing:6,alignItems:"center",p:4,borderRadius:"lg",textAlign:"center",children:[(0,ul.jsx)(pD.Image,{src:n.imageUrl,alt:"Empty state",maxW:"200px"}),(0,ul.jsxs)(pv.Stack,{spacing:1,children:[(0,ul.jsx)(pP.Heading,{size:"md",fontWeight:"semibold",css:{textWrap:"balance"},children:a}),!o&&(0,ul.jsx)(pt.Text,{color:s,fontSize:"sm",children:(0,ul.jsx)(uc.Trans,{message:"Start chatting below to modify your {GAMMA_ARTIFACT_PROPER_NOUN}.",id:"iaCYkN",values:{GAMMA_ARTIFACT_PROPER_NOUN:u_.GAMMA_ARTIFACT_PROPER_NOUN}})})]}),o&&(0,ul.jsx)(pm.BuddyQuickActionGroups,{actionGroups:[{key:"random-suggestions",operations:r}],wrapProps:{justify:"center"}})]})})});pF.displayName="BuddyChatEmptyState",e.s(["BuddyChatEmptyState",0,pF],303254),e.s(["useChatMessagesAutoScroll",0,({isReceivingMessages:e,messagesLength:t})=>{let i=(0,c2.useRef)(null),n=(0,c2.useRef)(e),a=(0,c2.useRef)(!1),r=(0,c2.useRef)(null),o=(0,c2.useRef)(!1);return(0,c2.useEffect)(()=>{let s=n.current;n.current=e,!s&&e&&(a.current=!1);let l=()=>{i.current&&i.current.scrollIntoView({behavior:"auto",block:"end"})},d=()=>{e&&!(()=>{let e=r.current;if(!e)return!1;let t=e.scrollTop;return e.scrollHeight-t-e.clientHeight<200})()&&(a.current=!0)};t>0&&l();let c=r.current;if(c&&c.addEventListener("scroll",d),e){l();let e=setInterval(()=>{a.current||l()},100);return()=>{clearInterval(e),c&&c.removeEventListener("scroll",d)}}if(s&&!e){let e=0,t=setInterval(()=>{l(),++e>=10&&clearInterval(t)},100);return()=>{clearInterval(t),c&&c.removeEventListener("scroll",d)}}if(!o.current){o.current=!0;let e=0,t=setInterval(()=>{l(),++e>=10&&clearInterval(t)},100);return()=>{clearInterval(t),c&&c.removeEventListener("scroll",d)}}return()=>{c&&c.removeEventListener("scroll",d)}},[t,e]),{scrollToRef:i,scrollContainerRef:r}}],702692);var pH=e.i(147349),pW=e.i(973886);let pU=()=>({bg:(0,pi.useColorModeValue)("blue.50","elevation.4"),borderColor:(0,pi.useColorModeValue)("blue.200","gray.600"),textColor:(0,pi.useColorModeValue)("blue.950","blue.50")}),pV=({contextWindowStatus:e,clearMessages:t,...i})=>{let{bg:n,borderColor:a,textColor:r}=pU();return(0,ul.jsx)(pn.VStack,{p:3,px:2,bg:n,border:"1px solid",borderColor:a,borderTopRadius:"md",borderBottomColor:"transparent",align:"start",justify:"stretch",spacing:0,...i,children:(0,ul.jsxs)(pe.HStack,{align:"center",justify:"space-between",w:"100%",spacing:3,children:["almost-full"===e&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(pt.Text,{fontSize:"xs",color:r,fontWeight:"semibold",children:(0,ul.jsx)(uc.Trans,{message:"This conversation is nearly at its maximum length. Consider starting a new chat soon.",id:"USlAnI"})}),(0,ul.jsx)(px.Button,{size:"xs",variant:"outline",px:4,flexShrink:0,leftIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faRotateRight}),onClick:t,children:(0,ul.jsx)(uc.Trans,{message:"Clear",id:"BC/Bbp"})})]}),"full"===e&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(pt.Text,{fontSize:"xs",color:r,fontWeight:"semibold",children:(0,ul.jsx)(uc.Trans,{message:"You hit the maximum length for this conversation. Start a new chat to continue.",id:"fxkLLs"})}),(0,ul.jsx)(px.Button,{size:"xs",variant:"solid",px:4,flexShrink:0,leftIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faRotateRight}),onClick:t,children:(0,ul.jsx)(uc.Trans,{message:"Clear",id:"BC/Bbp"})})]})]})})},pG=({...e})=>{let{bg:t,borderColor:i,textColor:n}=pU();return(0,ul.jsx)(pn.VStack,{p:3,px:2,bg:t,border:"1px solid",borderColor:i,borderTopRadius:"md",borderBottomColor:"transparent",align:"start",justify:"stretch",spacing:0,...e,children:(0,ul.jsxs)(pe.HStack,{align:"center",justify:"flex-start",w:"100%",spacing:3,children:[(0,ul.jsx)(pH.Spinner,{size:"sm"}),(0,ul.jsx)(pt.Text,{fontSize:"xs",color:n,fontWeight:"semibold",children:(0,ul.jsx)(uc.Trans,{message:"Please wait for generation to finish before editing",id:"s2IXCR"})})]})})};e.s(["BuddyBottomNotification",0,({clearMessages:e,...t})=>{let{creditWarning:i,contextWindowStatus:n,disabledReason:a}=(0,pk.useBuddyNotificationState)();return"stillStreaming"===a?(0,ul.jsx)(pG,{...t}):i?.isBlocking?(0,ul.jsx)(pW.UpsellWarningBox,{stacked:!0,title:i.title,subtitle:i.subtitle,status:i.status,cta:i.cta.label,ctaTooltip:i.cta.tooltip,onClick:i.cta.onClick}):"full"===n?(0,ul.jsx)(pV,{contextWindowStatus:n,clearMessages:e,...t}):i?(0,ul.jsx)(pW.UpsellWarningBox,{stacked:!0,title:i.title,subtitle:i.subtitle,status:i.status,cta:i.cta.label,ctaTooltip:i.cta.tooltip,onClick:i.cta.onClick,onDismiss:i.onDismiss}):"almost-full"===n?(0,ul.jsx)(pV,{contextWindowStatus:n,clearMessages:e,...t}):null}],943946),e.s(["CHAT_BUBBLE_BASE_STYLE",0,{fontSize:"sm",borderRadius:"md",p:2}],273845),e.s(["compressMessageParts",0,function(e,t){let i=(e,i)=>{i&&(1===i.parts.length?e.push(i.parts[0]):e.push(t(i.key,i.parts)))},n=e=>"tool-invocation-success"===e.type&&"compressKey"in e&&!!e.compressKey,a=[],r=null;for(let t of e){if(!n(t)){i(a,r),r=null,a.push(t);continue}let e=t.compressKey;if(r&&r.key===e){r={key:e,parts:[...r.parts,t]};continue}i(a,r),r={key:e,parts:[t]}}return i(a,r),a}],179658),e.s(["isBuddyToolError",0,e=>"output-available"===e.state&&!!e.output&&"object"==typeof e.output&&"error"===e.output.status,"isBuddyToolSuccess",0,e=>"output-available"===e.state&&!!e.output&&"object"==typeof e.output&&"success"===e.output.status],613110);let p$={removeCard:{present:()=>uE.i18n._({id:"enAttk",message:"Removing card"}),past:()=>uE.i18n._({id:"2EfZS5",message:"Removed card"}),compressKey:"REMOVE_CARD"}},pZ={createCard:{present:()=>uE.i18n._({id:"YFvSg3",message:"Creating card"}),past:()=>uE.i18n._({id:"Z801fH",message:"Created card"})},editCardById:{present:()=>uE.i18n._({id:"y5kNPl",message:"Editing card"}),past:()=>uE.i18n._({id:"nTOyvW",message:"Edited card"}),compressKey:"EDIT_CARD"},editAllCards:{present:()=>uE.i18n._({id:"+mgW41",message:"Editing cards"}),past:()=>uE.i18n._({id:"tor7fY",message:"Edited cards"})},focusCardById:{present:()=>uE.i18n._({id:"dwh4Lg",message:"Focusing card"}),past:()=>uE.i18n._({id:"t0SVyb",message:"Focused card"})},removeCards:{present:()=>uE.i18n._({id:"PPHKL3",message:"Removing cards"}),past:()=>uE.i18n._({id:"EgCNgl",message:"Removed cards"}),compressKey:"REMOVE_CARD"},setCardHtml:{present:()=>uE.i18n._({id:"jubeck",message:"Setting card content"}),past:()=>uE.i18n._({id:"+BZeOo",message:"Set card content"}),compressKey:"EDIT_CARD"},moveCard:{present:()=>uE.i18n._({id:"2VD+0p",message:"Moving card"}),past:()=>uE.i18n._({id:"B8He3D",message:"Moved card"}),compressKey:"MOVE_CARD"},duplicateCard:{present:()=>uE.i18n._({id:"tO+JlV",message:"Duplicating card"}),past:()=>uE.i18n._({id:"PdoIWT",message:"Duplicated card"})},revertToCheckpoint:{present:()=>uE.i18n._({id:"fIJtam",message:"Reverting"}),past:()=>uE.i18n._({id:"i8Of62",message:"Reverted"})},suggestThemes:{present:()=>uE.i18n._({id:"EGiXRh",message:"Suggesting themes"}),past:()=>uE.i18n._({id:"exJFz8",message:"Changed theme"})},readUrl:{present:()=>uE.i18n._({id:"L7svJg",message:"Reading"}),past:()=>uE.i18n._({id:"cQlPDN",message:"Read"})},webSearch:{present:()=>uE.i18n._({id:"f2YVZg",message:"Searching web"}),past:()=>uE.i18n._({id:"AzLUkE",message:"Searched web"})},getCardContentById:{present:()=>uE.i18n._({id:"QfwF96",message:"Retrieving card content"}),past:()=>uE.i18n._({id:"WEt7iO",message:"Content retrieved"})},imageEditContent:{present:()=>uE.i18n._({id:"lst4sw",message:"Editing image"}),past:()=>uE.i18n._({id:"V3CaX7",message:"Edited image"}),compressKey:"EDIT_IMAGE"},convertCardToImageCard:{present:()=>uE.i18n._({id:"HepPHY",message:"Converting to image"}),past:()=>uE.i18n._({id:"WQKeiv",message:"Converted to image"}),compressKey:"EDIT_CARD"},imageRemoveBackground:{present:()=>uE.i18n._({id:"RdqLb7",message:"Removing background"}),past:()=>uE.i18n._({id:"gmS8TU",message:"Removed background"}),compressKey:"EDIT_IMAGE"},imageAnimate:{present:()=>uE.i18n._({id:"ixpQjd",message:"Animating image"}),past:()=>uE.i18n._({id:"gtfeTa",message:"Animated image"}),compressKey:"EDIT_IMAGE"},imageVectorize:{present:()=>uE.i18n._({id:"Q55bBQ",message:"Vectorizing image"}),past:()=>uE.i18n._({id:"c1cnyM",message:"Vectorized image"})},imageUpscale:{present:()=>uE.i18n._({id:"5oQX1R",message:"Upscaling image"}),past:()=>uE.i18n._({id:"nstbgt",message:"Upscaled image"})},generateImage:{compressKey:"GENERATE_IMAGE",present:()=>uE.i18n._({id:"0YTg9V",message:"Generating image"}),past:()=>uE.i18n._({id:"kuh/JT",message:"Generated image"})},replaceImage:{present:()=>uE.i18n._({id:"LM2+EC",message:"Replacing image"}),past:()=>uE.i18n._({id:"f1piDt",message:"Replaced image"})},getAvailableImageStyles:{present:()=>uE.i18n._({id:"aHSLCr",message:"Loading image styles"}),past:()=>uE.i18n._({id:"T8krMU",message:"Loaded image styles"}),hideToolCall:!0},readSource:{present:()=>uE.i18n._({id:"stEmW5",message:"Reading source"}),past:()=>uE.i18n._({id:"RAsD9q",message:"Read source"})},grepSource:{present:()=>uE.i18n._({id:"m706ub",message:"Searching source"}),past:()=>uE.i18n._({id:"TUqAgK",message:"Searched source"})},getImagesInDoc:{present:()=>uE.i18n._({id:"vXBvi6",message:"Loading images"}),past:()=>"Loaded images",hideToolCall:!0},selectImageInDoc:{present:()=>uE.i18n._({id:"mq87Et",message:"Looking for image"}),past:()=>uE.i18n._({id:"9xewoq",message:"Found image"})},webImageSearch:{present:()=>uE.i18n._({id:"syykr0",message:"Searching for images on the web"}),past:()=>uE.i18n._({id:"vpIeaf",message:"Found web images"})},setupPage:{present:()=>uE.i18n._({id:"nR6QZT",message:"Updating page setup"}),past:()=>uE.i18n._({id:"0y/wuK",message:"Updated page setup"})}},pK=e=>e in pZ?pZ[e]:{present:()=>uE.i18n._({id:"Z3FXyt",message:"Loading..."}),past:()=>uE.i18n._({id:"4dQFvz",message:"Finished"})};e.s(["COMPRESSED_TOOL_INVOCATIONS",0,{EDIT_IMAGE:{past:e=>uE.i18n._({id:"u7EVk6",message:"{n, plural, one {Edited image} other {Edited # images}}",values:{n:e}}),present:()=>uE.i18n._({id:"brLdZx",message:"Editing images"})},EDIT_CARD:{past:e=>uE.i18n._({id:"4UmzkI",message:"{n, plural, one {Edited card} other {Edited # cards}}",values:{n:e}}),present:()=>uE.i18n._({id:"+mgW41",message:"Editing cards"})},MOVE_CARD:{past:e=>uE.i18n._({id:"HAuYMv",message:"{n, plural, one {Moved card} other {Moved # cards}}",values:{n:e}}),present:()=>uE.i18n._({id:"Hr7du/",message:"Moving cards"})},REMOVE_CARD:{past:e=>uE.i18n._({id:"JcjR53",message:"{n, plural, one {Removed card} other {Removed # cards}}",values:{n:e}}),present:()=>uE.i18n._({id:"PPHKL3",message:"Removing cards"})},GENERATE_IMAGE:{past:e=>uE.i18n._({id:"t+Df2P",message:"{n, plural, one {Generated image} other {Generated # images}}",values:{n:e}}),present:()=>uE.i18n._({id:"dg6m9K",message:"Generating images"})}},"getBuddySuggestionRowText",0,e=>e in p$?p$[e]:pK(e),"getBuddyToolText",0,pK],891892),e.s(["BuddyToolInvocationAborted",()=>hs,"BuddyToolInvocationError",()=>hu,"BuddyToolInvocationInProgress",()=>hd,"BuddyToolInvocationSuccess",()=>hc,"BuddyToolInvocationText",()=>hl],359603);var pq=e.i(524473);e.i(828525);var pY=e.i(896620);e.s(["BuddyZoomableOverlay",()=>pQ],477245),e.i(297036);var pX=e.i(753128);let pQ=({isZoomed:e,exitZoom:t,src:i,alt:n})=>(0,ul.jsx)(pX.ZoomableOverlay,{isZoomed:e,exitZoom:t,editor:null,children:(0,ul.jsx)(u7.Flex,{justify:"center",align:"center",h:"100%",w:"100%",children:(0,ul.jsx)(pD.Image,{src:i,alt:n,maxW:"90vw",maxH:"90vh",objectFit:"contain"})})});var pJ=e.i(534316),p0=e.i(160396);let p1=({src:e,...t})=>{let[i,n]=(0,c2.useState)(!1),{isZoomed:a,enterZoom:r,exitZoom:o}=(0,pJ.useMediaZoom)(e??"");return i?null:(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(pY.GammaTooltip,{closeOnMouseDown:!0,closeOnClick:!0,label:(0,ul.jsxs)(u8.Box,{as:"span",display:"inline",children:[(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faHand})," ",(0,ul.jsx)(pt.Text,{display:"inline",children:(0,ul.jsx)(uc.Trans,{message:"Drag to insert",id:"Dd9uag"})})]}),"aria-label":uE.i18n._({id:"Dd9uag",message:"Drag to insert"}),placement:"top",shouldWrapChildren:!1,children:(0,ul.jsx)(p0.ImageOrVideo,{src:e,borderRadius:"md",h:"6em",onClick:()=>e&&r(),resizeParams:p0.THUMBNAIL_RESIZE_JPG_PARAMS,transitionProperty:"common",transitionDuration:"normal",transform:"scale(0.95)",_hover:{transform:"scale(1)",shadow:"lg"},onError:()=>{n(!0)},...t})}),e&&(0,ul.jsx)(pQ,{isZoomed:a,exitZoom:o,src:e,alt:""})]})};e.i(601019);var p2=e.i(494075),p3=e.i(406112),p5=e.i(775493),p4=e.i(751827),p6=e.i(588183),p9=e.i(575329),p8=e.i(704077),p7=e.i(112010),he=e.i(883374);let ht=({buttonText:e="🐛",debugTitle:t,debugObject:i})=>{let n=(0,uC.useFeatureFlag)("buddyDebug"),{isOpen:a,onOpen:r,onClose:o}=(0,p3.useDisclosure)(),s=(0,c2.useCallback)(()=>{try{return he.dump(i,{noRefs:!0})}catch(e){return`Error dumping YAML: ${e instanceof Error?e.message:"Unknown error"} Raw object: ${JSON.stringify(i,null,2)}`}},[i]);return n?(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(px.Button,{size:"xs",onClick:r,children:e}),(0,ul.jsxs)(p5.Modal,{isOpen:a,onClose:o,size:"xl",children:[(0,ul.jsx)(p4.ModalOverlay,{}),(0,ul.jsxs)(p6.ModalContent,{children:[t&&(0,ul.jsx)(p9.ModalHeader,{children:t}),(0,ul.jsx)(p7.ModalCloseButton,{}),(0,ul.jsx)(p8.ModalBody,{maxHeight:"80vh",overflow:"auto",children:(0,ul.jsx)(u8.Box,{overflow:"auto",as:"pre",fontSize:"xs",children:s()})})]})]})]}):null};e.s(["DebugModalButton",0,ht],902349);var hi=e.i(277051),hn=e.i(773194);e.i(905506);var ha=e.i(84723);let hr=["gamma.app"],ho=(0,c2.memo)(({content:e,clampToOneLine:t,onContentHeightChange:i,...n})=>{let a=(0,c2.useRef)(null),r=(0,c2.useMemo)(()=>{let t=new hn.marked.Renderer;t.heading=(e,t)=>`

    ${e}

    `;let i=hn.marked.parse(e,{renderer:t,breaks:!0,gfm:!0});var n=hi.default.sanitize(i,{ALLOWED_TAGS:["p","strong","em","code","br","ul","ol","li","strike","a"],ALLOWED_ATTR:["style","href","target","rel"]});if(!n.includes("
    {let t=e.getAttribute("href");t&&!(e=>{try{let t=new URL(e);if("https:"!==t.protocol)return!1;let i=t.hostname.toLowerCase();return hr.some(e=>i===e||i.endsWith(`.${e}`))}catch{return!1}})(t)&&e.removeAttribute("href")}),a.body.innerHTML},[e]),o=(0,c2.useCallback)(()=>{let e=a.current;e&&i&&i((e.firstElementChild??e).scrollHeight)},[i]),s=(0,c2.useMemo)(()=>({leading:!0,trailing:!0,maxWait:100}),[]),l=(0,ha.useThrottled)(o,100,s);return(0,c2.useEffect)(()=>{o()},[o,r]),(0,c2.useEffect)(()=>{let e=a.current;if(!e||!i)return;let t=new ResizeObserver(()=>{l()});return t.observe(e),()=>{t.disconnect()}},[i,l]),(0,ul.jsx)(u8.Box,{ref:a,maxWidth:"100%",sx:{"& p":{margin:0,"&:not(:last-child)":{marginBottom:"1em"}},"& ul, & ol":{margin:0,paddingLeft:"1.5em","&:not(:last-child)":{marginBottom:"1em"}},"& a[href]":{color:"blue.500",textDecoration:"underline"},...t?{"& > :first-child":{display:"-webkit-box",WebkitLineClamp:"1",WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"normal"},"& > :not(:first-child)":{display:"none"}}:{}},...n,dangerouslySetInnerHTML:{__html:r}})}),hs=()=>(0,ul.jsxs)(pe.HStack,{justify:"center",align:"center",children:[(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faTriangleExclamation,fontSize:"13px"}),(0,ul.jsx)(pt.Text,{fontSize:"sm",fontWeight:"semibold",mt:"1px",ms:"-1px",children:(0,ul.jsx)(uc.Trans,{message:"Aborted",id:"7175a1"})})]}),hl=({part:e,isOpen:t,isOnlyPart:i,toggleCollapse:n,onContentHeightChange:a})=>(0,ul.jsxs)(pe.HStack,{w:"100%",pe:4,ps:1,alignItems:"flex-start",pt:2,onClick:n,children:[!i&&(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faCircle,fontSize:"6px"}),(0,ul.jsx)(ho,{mt:-2,content:e.text,clampToOneLine:!t,onContentHeightChange:a})]}),hd=({part:e})=>(0,ul.jsxs)(pp,{children:[e.inProgressText,"…"]}),hc=({part:e,editor:t,toggleCollapse:i})=>{let n=c0(e.toolInvocations[0]);return(0,ul.jsxs)(u7.Flex,{direction:"column",children:[(0,ul.jsxs)(pe.HStack,{justify:"space-between",width:"100%",onClick:i,children:[(0,ul.jsxs)(pe.HStack,{fontSize:"xs",children:[(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faSparkle,style:{marginInlineStart:"1px"}}),(0,ul.jsx)(pt.Text,{fontSize:"sm",ms:"-1px",children:e.successText})]}),(0,ul.jsx)(ht,{debugTitle:`${n}...`,debugObject:{toolCalls:e.toolInvocations.map(e=>({args:e.input,...e.output})),artifact:e.artifact}})]}),e.artifact&&(0,ul.jsx)(pe.HStack,{overflow:"auto",ms:5,overflowY:"hidden",children:e.artifact.images.map((e,i)=>(0,ul.jsx)(p1,{src:e.src??"",alt:e.query??void 0,w:"100%",h:20,mt:2,cursor:"grab",objectFit:"cover",onDragStart:()=>{t&&(0,p2.setDraggingContent)({editor:t,content:{type:"image",attrs:e},operation:"replace"})}},i))})]})},hu=({part:e})=>{let t=c0(e.toolInvocation);return(0,ul.jsxs)(pe.HStack,{justify:"start",align:"center",width:"100%",alignItems:"flex-start",children:[(0,ul.jsxs)(pe.HStack,{justify:"space-between",alignItems:"flex-start",spacing:1,children:[(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faCircleExclamation,fontSize:"13px",style:{marginTop:"4px"}}),(0,ul.jsxs)(pt.Text,{fontSize:"sm",fontWeight:"semibold",children:["Error: ",e.errorText]})]}),(0,ul.jsx)(ht,{buttonText:t,debugTitle:`${t} (ERROR)`,debugObject:{args:e.toolInvocation.input,...e.toolInvocation.output}})]})};var hp=e.i(641099),hh=e.i(921679);let hm=({isApplied:e})=>{let t=(0,pi.useColorModeValue)("blue.100","elevation.5"),i=(0,pi.useColorModeValue)("spacedust.50","elevation.3"),n=(0,pi.useColorModeValue)("blue.200","elevation.6"),a=(0,pi.useColorModeValue)("spacedust.100","elevation.4"),r=(0,pi.useColorModeValue)("blue.600","blue.300"),o=(0,pi.useColorModeValue)("gray.300","gray.600"),s=(0,pi.useColorModeValue)("blue.950","blue.50"),l=(0,pi.useColorModeValue)("gray.800","gray.300");return{getBgColor:()=>e?t:i,getBgColorHover:()=>e?n:a,getBorderColor:()=>e?r:o,getTextColor:()=>e?s:l}};e.s(["useBuddyMessageVariationColors",0,hm],905859);let hg=(0,c2.memo)(({result:e,ratings:t})=>{let i=(0,ue.useBuddyAgent)(),n=(0,ue.useBuddyStore)("editor");return(0,ul.jsxs)(pv.Stack,{pt:2,children:[(0,ul.jsxs)(pe.HStack,{children:[(0,ul.jsx)(u8.Box,{color:"gray.500",children:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faBringForward,fixedWidth:!0,size:"sm"})}),(0,ul.jsx)(pt.Text,{fontSize:"sm",fontWeight:"semibold",children:e.title})]}),(0,ul.jsx)(hp.SimpleGrid,{columns:3,spacing:2,children:e.images.map((t,a)=>(0,ul.jsx)(hf,{attrs:t.attrs,added:t.added,onDragStart:r=>{if(!n||!t.attrs.src)return;let o=document.createElement("div");o.style.width="80px",o.style.height="80px",o.style.backgroundImage=`url(${t.attrs.src})`,o.style.backgroundSize="cover",o.style.borderRadius="4px",document.body.appendChild(o),r.dataTransfer.setDragImage(o,40,40),setTimeout(()=>o.remove(),0),(0,p2.setDraggingContent)({editor:n,content:{type:"image",attrs:t.attrs}});let s=new AbortController;window.addEventListener("drop",()=>{let t=i.store.getState().results[e.messageId];if(t?.type==="image-artifact"){console.debug("[buddy] image artifact handle drop");let e=(0,hh.default)(t);e.images[a].added=!0,i.addResult(e)}s.abort()},{signal:s.signal}),window.addEventListener("dragend",()=>{console.debug("[buddy] image artifact handle dragend"),s.abort()},{signal:s.signal})}},a))}),(0,ul.jsx)(pe.HStack,{justify:"flex-end",w:"100%",children:t})]})});hg.displayName="ImageArtifactMessageResult";let hf=({attrs:e,added:t,key:i,onDragStart:n})=>{let a=hm({isApplied:t});return(0,ul.jsxs)(u7.Flex,{overflow:"hidden",p:1.5,pt:1,role:"group",flexDirection:"column",justifyContent:"start",position:"relative",align:"left",border:"2px solid",borderRadius:"md",transition:"all .25s ease-in-out",borderColor:a.getBorderColor(),cursor:"grab",bg:a.getBgColor(),_hover:{bg:a.getBgColorHover()},_active:{cursor:"grabbing"},draggable:!0,onDragStart:n,children:[(0,ul.jsxs)(pe.HStack,{align:"start",spacing:.25,mb:1,ms:0,h:"18px",alignItems:"center",children:[(0,ul.jsx)(u8.Box,{w:0,overflow:"hidden",opacity:0,transform:"translateX(-8px)",transition:"all 0.2s ease-in-out",_groupHover:{w:"14px",opacity:1,transform:"translateX(0)"},color:a.getTextColor(),children:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faGripDotsVertical})}),(0,ul.jsx)(pt.Text,{fontSize:"xs",fontWeight:"semibold",color:a.getTextColor(),children:t?(0,ul.jsx)(uc.Trans,{message:"Added",id:"hp8OtS"}):(0,ul.jsx)(uc.Trans,{message:"Generated",id:"l7mqG6"})})]}),(0,ul.jsx)(p0.ImageOrVideo,{src:e.src??void 0,borderRadius:4,draggable:!1})]},i)};e.s(["ImageArtifactMessageResult",0,hg],317870);var hb=e.i(860686);let hx=({title:e,children:t})=>{let i=(0,pi.useColorModeValue)("gray.400","gray.300");return(0,ul.jsx)(pv.Stack,{py:2,align:"space-between",w:"100%",borderRadius:"md",children:(0,ul.jsxs)(pe.HStack,{justify:"space-between",w:"100%",children:[(0,ul.jsxs)(pe.HStack,{spacing:1,children:[(0,ul.jsx)(u8.Box,{color:i,children:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faCircleCheck,fixedWidth:!0,size:"sm",style:{marginInlineStart:"-1px"}})}),(0,ul.jsx)(pt.Text,{fontSize:"sm",fontWeight:"semibold",color:i,children:e})]}),t]})})};e.s(["MessageResultHeader",0,hx],364450);var hy=e.i(227909),hv=e.i(66657),hC=e.i(470645),hw=e.i(216912),hS=e.i(244180),hk=e.i(358003);let hA=(0,hw.forwardRef)(function(e,t){let i=(0,hS.useStyleConfig)("Code",e),{className:n,...a}=(0,hv.omitThemingProps)(e);return(0,ul.jsx)(hk.chakra.code,{ref:t,className:(0,hC.cx)("chakra-code",e.className),...a,__css:{display:"inline-block",...i}})});hA.displayName="Code",e.s(["Code",0,hA],370379);var hE=e.i(864860),h_=e.i(847092),hI=e.i(301219),hM=e.i(684034),hT=e.i(662727);let hL=({createdByName:e,createdByProfileImageUrl:t,createdByYou:i,timestampDescription:n})=>{let a=(0,pi.useColorModeValue)("gray.600","gray.200"),r=(0,pi.useColorModeValue)("gray.400","gray.300");return(0,ul.jsxs)(u7.Flex,{align:"center",children:[(0,ul.jsx)(hT.TooltipAvatar,{size:"xs",fontSize:"xs",name:e,src:t,tooltipProps:{placement:"top"}}),(0,ul.jsxs)(u8.Box,{marginInlineStart:2,marginInlineEnd:2,w:"100%",children:[(0,ul.jsx)(pt.Text,{noOfLines:1,fontSize:"xs",w:"100%",wordBreak:"break-all",color:a,children:i?(0,ul.jsx)(uc.Trans,{message:"Created by you",id:"WZTg05"}):(0,ul.jsx)(uc.Trans,{message:"Created by {createdByName}",id:"pS1F3d",values:{createdByName:e}})}),n&&(0,ul.jsx)(pt.Text,{noOfLines:1,fontSize:"11px",color:r,children:n})]})]})};var hj=e.i(516480),hP=e.i(372966);let hD={src:e.i(457387).default,width:600,height:315,blurWidth:0,blurHeight:0};var hN=e.i(344233),hR=e.i(721455),hO=e.i(148318),hB=e.i(826480),hz=e.i(285042),hF=e.i(704273),hH=e.i(935020),hW=e.i(55261),hU=e.i(595408),hV=e.i(283591);let hG=(0,c2.memo)(({theme:e})=>{let t=(0,pi.useColorModeValue)("gray.500","gray.400"),i=(0,hV.useCanManageThemesAndFonts)(),n=(0,hV.useUnarchiveTheme)({theme:e}),a=e.name.replace(hU.ARCHIVED_THEME_NAME_REPLACE_REGEX,""),r=e.createdTime?(0,hW.format)((0,hM.parseISO)(e.createdTime),"PPP"):void 0,o=e.createdBy?.displayName;return(0,ul.jsxs)(hR.Menu,{isLazy:!0,children:[(0,ul.jsx)(hO.MenuButton,{as:hN.IconButton,isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEllipsis}),onClick:e=>e.stopPropagation(),children:(0,ul.jsx)(uc.Trans,{message:"Actions",id:"7L01XJ"})}),(0,ul.jsx)(hH.Portal,{children:(0,ul.jsxs)(hF.MenuList,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,ul.jsxs)(u8.Box,{px:4,py:0,maxWidth:"300px",children:[(0,ul.jsx)(pt.Text,{noOfLines:3,children:a}),r&&(0,ul.jsx)(pt.Text,{fontSize:"sm",color:t,noOfLines:1,children:(0,ul.jsx)(uc.Trans,{message:"Created {createdDate}",id:"/iFtGl",values:{createdDate:r}})}),o&&(0,ul.jsx)(pY.GammaTooltip,{label:e.createdBy?.email,children:(0,ul.jsx)(pt.Text,{display:"inline-block",fontSize:"sm",color:t,noOfLines:1,children:(0,ul.jsx)(uc.Trans,{message:"by {creatorName}",id:"4xMAwk",values:{creatorName:o}})})})]}),(0,ul.jsx)(hB.MenuDivider,{}),(0,ul.jsx)(pY.GammaTooltip,{label:(0,ul.jsx)(uc.Trans,{message:"Only admins can manage themes in this workspace.",id:"xw+aX2"}),isDisabled:i,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pa.faRotateLeft,fixedWidth:!0}),onClick:n,isDisabled:!i,children:(0,ul.jsx)(uc.Trans,{message:"Restore",id:"yKu/3Y"})})})]})})]})});var h$=e.i(382167),hZ=e.i(437994),hK=e.i(335884),hq=e.i(367792);let hY=({files:e})=>(0,ul.jsx)(ul.Fragment,{children:e.map(e=>(0,ul.jsx)("link",{rel:"preload",href:e,as:"font",crossOrigin:""},e))}),hX=(e="")=>`@font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-Bold.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-Bold.woff') format('woff'); font-weight: bold; font-style: normal; font-display: block; } @font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-Regular.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-Regular.woff') format('woff'); font-weight: normal; font-style: normal; font-display: block; } @font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-Light.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-Light.woff') format('woff'); font-weight: 300; font-style: normal; font-display: block; } @font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-ExtraBold.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-ExtraBold.woff') format('woff'); font-weight: 800; font-style: normal; font-display: block; } @font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-ExtraLight.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-ExtraLight.woff') format('woff'); font-weight: 200; font-style: normal; font-display: block; } @font-face { font-family: 'Eudoxus Sans'; src: url('${e}/fonts/EudoxusSans-Medium.woff2') format('woff2'), url('${e}/fonts/EudoxusSans-Medium.woff') format('woff'); font-weight: 500; font-style: normal; font-display: block; } `,hQ=["/fonts/EudoxusSans-Bold.woff","/fonts/EudoxusSans-Bold.woff2","/fonts/EudoxusSans-Regular.woff","/fonts/EudoxusSans-Regular.woff2","/fonts/EudoxusSans-Light.woff","/fonts/EudoxusSans-Light.woff2","/fonts/EudoxusSans-ExtraBold.woff","/fonts/EudoxusSans-ExtraBold.woff2","/fonts/EudoxusSans-ExtraLight.woff","/fonts/EudoxusSans-ExtraLight.woff2","/fonts/EudoxusSans-Medium.woff","/fonts/EudoxusSans-Medium.woff2"],hJ=hQ.map(e=>`${hq.config.FRONTEND_URL}${e}`),h0=({shouldUsePublishedVersion:e})=>{let t=hX(e?hq.config.FRONTEND_URL:"");return(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(ps.Global,{styles:t}),(0,ul.jsx)(hY,{files:e?hJ:hQ})]})};e.s(["default",0,h0,"getEudoxusSansCSSString",0,hX],741783);let h1=({fonts:e})=>{let t=(0,hK.useShouldUsePublishedVersion)(),i=e?.find(e=>"Eudoxus Sans"===e.id),n=(0,c2.useMemo)(()=>(0,hZ.default)(e?.filter(e=>e.url)||[],"url"),[e]);return(0,ul.jsxs)(ul.Fragment,{children:[i?(0,ul.jsx)(h0,{shouldUsePublishedVersion:t}):null,n.map(e=>(0,ul.jsx)(h$.Link,{as:"link",href:e.url,rel:"stylesheet","data-gamma-font":e.id},e.url))]})},h2=({theme:e})=>(0,ul.jsx)(h1,{fonts:e?.fonts});e.s(["ThemeFontLoader",0,h2],271047);var h3=e.i(686296),h5=e.i(85547),h4=e.i(397068);e.i(615835),e.i(188970);var h6=e.i(869557),h9=e.i(97660),h8=e.i(772177),h7=e.i(572383);let me={fontSize:"0.7em",padding:"0.2em 0.4em",borderRadius:"0.3em",insetStart:2,top:2,zIndex:1},mt=(0,c2.memo)(({theme:e,variant:t="outline",children:i,heightEm:n=8,isCrossWorkspaceTheme:a=!1,...r})=>{var o;let s,{contentStyles:l}=e.config,d=(0,h4.getDocOrThemeBackground)(e),c=(0,h3.isThemeDark)(e),u=(0,h7.getThemeCSSVars)(e),p=(0,pi.useColorModeValue)(hP.default.src,hD.src),h=(0,pi.useColorModeValue)("gray.300","gray.800");"string"==typeof u["--card-border-radius"]&&(u["--card-border-radius"]=(s=parseFloat(o=u["--card-border-radius"]),o.endsWith("em")&&s>1?"1em":o));let m=(0,h4.getBackgroundProps)(d,c,p0.THUMBNAIL_RESIZE_JPG_PARAMS),{currentWorkspace:g}=(0,pR.useUserContext)(),f=(0,h6.useWorkspaceData)(g?.id),b=mi(e),x=e.id===f?.defaultThemeId,y=(0,uC.useFeatureFlag)("themeTextPreviewSVGs")&&e.previewUrl,v=y?void 0:(0,h8.getHeadingStylesheet)(e);return(0,ul.jsxs)(u8.Box,{css:u,sx:v,w:"100%",pos:"relative",children:[b&&!x&&null===e.workspaceId&&(0,ul.jsx)(pw.Badge,{position:"absolute",colorScheme:"green",...me,children:(0,ul.jsx)(uc.Trans,{message:"New",id:"isRobC"})}),x&&(0,ul.jsx)(pY.GammaTooltip,{openDelay:300,label:(0,ul.jsx)(uc.Trans,{message:"This is the workspace default theme. Workspace admins can edit the default.",id:"dWkBMI"}),placement:"top",children:(0,ul.jsx)(pw.Badge,{position:"absolute",bg:"blackAlpha.600",color:"white",cursor:"help",...me,children:(0,ul.jsx)(uc.Trans,{message:"Default",id:"ovBPCi"})})}),a&&(0,ul.jsx)(pY.GammaTooltip,{openDelay:300,label:(0,ul.jsx)(uc.Trans,{message:"This theme is from the original {GAMMA_ARTIFACT_PROPER_NOUN}. Duplicate to edit.",id:"7q5Led",values:{GAMMA_ARTIFACT_PROPER_NOUN:u_.GAMMA_ARTIFACT_PROPER_NOUN}}),placement:"top",children:(0,ul.jsx)(pw.Badge,{position:"absolute",bg:"blackAlpha.600",color:"white",cursor:"help",...me,children:(0,ul.jsx)(uc.Trans,{message:"External",id:"bVhrVt"})})}),(0,ul.jsxs)(u7.Flex,{borderTopRadius:"ghost"===t?"none":"md",boxShadow:"sm",_focus:{boxShadow:"outline"},p:`${n/8}em`,transitionProperty:"common",transitionDuration:"normal",...m,backgroundAttachment:"initial",direction:"row",align:"center",overflow:"hidden",minH:`${n}em`,maxH:`${n}em`,...r,children:[!y&&(0,ul.jsx)(h2,{theme:e}),(0,ul.jsx)(u8.Box,{sx:{...h9.CardSx,...l},borderRadius:"base",className:`${h5.CARD_CONTENT_CLASS} ${c?"is-dark":""}`,color:c?"white":"gray.800",flex:1,pointerEvents:"none",dir:"ltr",children:(0,ul.jsx)(u8.Box,{gridArea:'"body"',py:`${n/8}em`,px:`${n/8}em`,position:"relative",minH:`${3*n/4}em`,children:y?(0,ul.jsx)(pD.Image,{src:e.previewUrl,position:"absolute",width:`${7.75/8*n}em`,objectFit:"contain",inset:`${n/8}em`,fallback:(0,ul.jsx)(u8.Box,{pos:"absolute",inset:`-${n/8}em`,bg:h,backgroundImage:p,backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"})}):(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(pt.Text,{className:"block-title",mt:"0 !important",mb:"var(--chakra-space-1) !important",children:(0,ul.jsx)(pt.Text,{as:"span",className:(0,hC.cx)("title",h8.HEADING_CLASS),fontSize:"1.6em !important",paddingBottom:"0 !important",children:(0,ul.jsx)(uc.Trans,{message:"Title",id:"MHrjPM"})})}),(0,ul.jsx)(pt.Text,{fontSize:"0.9em !important",noOfLines:3,className:"block block-paragraph",my:"0 !important",children:(0,ul.jsx)(uc.Trans,{message:"Body & <0>link",id:"U41VTK",components:{0:(0,ul.jsx)(pt.Text,{as:"a",className:"link"})}})})]})})})]}),i]})});mt.displayName="ThemePreviewThumbnail";let mi=e=>{if(!e.createdTime)return!1;let t=new Date(e.createdTime),i=new Date;return i.setDate(i.getDate()-30),t>i};e.s(["ThemePreviewThumbnail",0,mt],276137);var mn=e.i(294988);e.i(195305);class ma{intersectionObserversMap;callbacksMap;static _instance=null;static observeElement(...e){return"function"!=typeof IntersectionObserver?()=>{}:ma.instance.doObserveElement(...e)}static get instance(){return ma._instance||(ma._instance=new ma),ma._instance}constructor(){this.intersectionObserversMap=new Map,this.callbacksMap=new Map}doObserveElement(e,t,{rootMargin:i="0px 0px 0px 0px",root:n=null}){let a=this.getObserverForRoot(n,i);return this.callbacksMap.has(a)||this.callbacksMap.set(a,new Map),this.callbacksMap.get(a).set(e,t),a.observe(e),()=>{this.disconnect(e,i,n)}}disconnect(e,t,i){let n=this.getObserverForRoot(i,t,!0);if(!n)return;n.unobserve(e);let a=this.callbacksMap.get(n);a&&a.delete(e),!a?.size&&(n.disconnect(),this.callbacksMap.delete(n),this.intersectionObserversMap.get(i)?.delete(t),this.intersectionObserversMap.get(i)?.size||this.intersectionObserversMap.delete(i))}getObserverForRoot(e,t,i=!1){if(!this.intersectionObserversMap.has(e)){if(i)return;this.intersectionObserversMap.set(e,new Map)}let n=this.intersectionObserversMap.get(e);if(!n.has(t)){if(i)return;n.set(t,new IntersectionObserver(this.intersectionCallback.bind(this),{root:e,rootMargin:t}))}return n.get(t)}intersectionCallback(e,t){let i=new Map,n=this.callbacksMap.get(t);n&&(e.forEach(e=>{i.has(e.target)||i.set(e.target,[]),i.get(e.target).push(e)}),i.forEach((e,t)=>{try{n.get(t)?.(e)}catch(e){console.error(e)}}))}}class mr{static _instance=void 0;entries=new Map;constructor(){hq.config.DEBUG_ENABLED&&"object"==typeof globalThis&&(globalThis.gammaInViewportStats=this)}get stats(){let e={};return this.entries.forEach(({status:t})=>{e[t]=(e[t]??0)+1}),e}static get instance(){return mr._instance||(mr._instance=new mr),mr._instance}}let mo=({intersectionMargin:e="100% 0px 100% 0px",memoGroup:t,...i}={})=>{let n=(0,uC.useFeatureFlag)("enableVirtualization"),a=(0,c2.useId)(),r=(0,c2.useRef)(void 0),o=(0,c2.useRef)(void 0),s=n?i.dimensions?"HIDDEN":"PENDING":"VISIBLE",[l,d]=(0,c2.useState)(s),c=(0,c2.useRef)(l),[u,p]=(0,c2.useState)(i.dimensions??void 0),h=(0,c2.useMemo)(()=>{let e=null;return(t,i=300)=>{c.current=t,e&&(clearTimeout(e),e=null),e=setTimeout(()=>{if(e=null,"HIDDEN"===c.current&&r.current){let e=r.current.getBoundingClientRect();p({width:e.width,height:e.height})}d(c.current)},i)}},[]),m=i?.loading,g=(0,c2.useCallback)(()=>{if(!r.current)return void o.current?.();if(!i.loading){if(((t,i)=>{if(!n){h("VISIBLE"),o.current?.();return}if(!t||m)return o.current?.();let a=(0,uN.findScrollableParent)(t,i);o.current=ma.observeElement(t,e=>{let t=c.current??"PENDING",i=e.find(e=>e.isIntersecting);"VISIBLE"!==t&&i?h("VISIBLE"):"HIDDEN"===t||i||h("HIDDEN",1500)},{root:a,rootMargin:e})})(r.current,t),!i.dimensions&&!u){let e=r.current.getBoundingClientRect();p({width:e.width,height:e.height})}"PENDING"===c.current&&h("HIDDEN")}},[h,i.loading,i.dimensions?.width,i.dimensions?.height,u?.width,u?.height,t]),f=(0,c2.useCallback)(e=>{r.current!==e&&(r.current=e,g())},[g]);return(0,c2.useEffect)(()=>(mr.instance.entries.set(a,{status:l,el:r.current??null}),()=>{mr.instance.entries.delete(a)}),[l,a]),{inViewport:"PENDING"===l?void 0:"VISIBLE"===l,ref:f,dimensions:u}};e.s(["useIsInViewport",0,mo],700652);var ms=e.i(80192);let ml=(0,c2.memo)(({theme:e})=>{let t=(0,uh.useAnalytics)(),i=(0,hV.useCanManageThemesAndFonts)(),n=(0,c2.useCallback)(()=>{t?.track(up.SegmentEvents.THEME_COPY_TO_WORKSPACE_CLICKED,{theme_id:e.id,name:e.name,source_workspace_id:e.workspaceId}),(0,ms.openThemeEditorWithNewFork)({theme:e,sourceThemeInfo:{themeId:e.id,workspaceId:e.workspaceId,source:"cross_workspace_menu"}})},[t,e]),a=(0,ul.jsx)(uc.Trans,{message:"Only admins can duplicate themes in this workspace.",id:"/D7zq9"});return(0,ul.jsxs)(hR.Menu,{isLazy:!0,children:[(0,ul.jsx)(hO.MenuButton,{as:hN.IconButton,"aria-label":uE.i18n._({id:"7L01XJ",message:"Actions"}),isRound:!0,size:"xs",variant:"ghost",colorScheme:"blackAlpha",icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEllipsis}),onClick:e=>e.stopPropagation(),children:(0,ul.jsx)(uc.Trans,{message:"Actions",id:"7L01XJ"})}),(0,ul.jsx)(hH.Portal,{children:(0,ul.jsxs)(hF.MenuList,{zIndex:"modal",onClick:e=>e.stopPropagation(),maxW:"240px",children:[(0,ul.jsx)(pt.Text,{fontSize:"xs",px:3,py:2,children:(0,ul.jsx)(uc.Trans,{message:"This theme is from another workspace. Copy it to your workspace to edit.",id:"M2qMbj"})}),(0,ul.jsx)(pY.GammaTooltip,{label:a,isDisabled:i,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faCopy,fixedWidth:!0}),onClick:i?n:void 0,isDisabled:!i,children:(0,ul.jsx)(uc.Trans,{message:"Copy theme to workspace",id:"RpUzV/"})})})]})})]})});var md=e.i(856901),mc=e.i(994633);let mu=(0,c2.memo)(({onCustomizeThemeClick:e,onEditThemeClick:t,onSetAsWorkspaceDefaultThemeClick:i,onCopyThemeId:n,theme:a})=>{let{isGammaOrgUser:r,currentWorkspace:o}=(0,pR.useUserContext)(),s=(0,h6.useWorkspaceData)(o?.id),l=r&&"production"!==hq.config.APPLICATION_ENVIRONMENT,d=(0,mc.useCanManageWorkspace)(),c=(0,hV.useCanManageThemesAndFonts)(),u=a.id===s?.defaultThemeId,p=(0,ul.jsx)(uc.Trans,{message:"Only admins can duplicate themes in this workspace.",id:"/D7zq9"}),h=(0,ul.jsx)(uc.Trans,{message:"Only admins can manage themes in this workspace.",id:"xw+aX2"}),m=(0,ul.jsx)(uc.Trans,{message:"Only admins can edit themes in this workspace.",id:"UUeOyF"});return(0,ul.jsxs)(hR.Menu,{isLazy:!0,children:[(0,ul.jsx)(hO.MenuButton,{as:hN.IconButton,isRound:!0,size:"xs",variant:"ghost",colorScheme:"alpha",icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEllipsis}),onClick:e=>e.stopPropagation(),children:(0,ul.jsx)(uc.Trans,{message:"Actions",id:"7L01XJ"})}),(0,ul.jsx)(hH.Portal,{children:(0,ul.jsxs)(hF.MenuList,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[!c&&(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEye,fixedWidth:!0}),onClick:()=>(0,ms.openThemeEditorReadOnly)({theme:a}),children:(0,ul.jsx)(uc.Trans,{message:"View theme",id:"dIM+cw"})}),(0,ul.jsx)(pY.GammaTooltip,{label:p,isDisabled:c,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faSplit,fixedWidth:!0}),onClick:c?e:void 0,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Copy and customize this theme",id:"/b0MjO"})})}),(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faCode,fixedWidth:!0}),onClick:n,children:(0,ul.jsx)(uc.Trans,{message:"Copy <0>{THEME_ID_PROPER_NOUN} for API",id:"8HR5G/",values:{THEME_ID_PROPER_NOUN:u_.THEME_ID_PROPER_NOUN},components:{0:(0,ul.jsx)(hA,{colorScheme:"gray"})}})}),d&&!u&&(0,ul.jsx)(pY.GammaTooltip,{label:h,isDisabled:c,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faPalette,fixedWidth:!0}),onClick:i,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Set as workspace default",id:"rbjUma"})})}),l&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(hB.MenuDivider,{}),(0,ul.jsx)(pY.GammaTooltip,{label:m,isDisabled:c,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{color:"orange.500",icon:(0,ul.jsx)(u8.Box,{boxSize:"4",children:(0,ul.jsx)(md.GammaIconOnSquare,{})}),onClick:t,isDisabled:!c,children:"Edit theme"})})]})]})})]})});var mp=e.i(29215),mh=e.i(335799),mm=e.i(75495),mg=e.i(96095),mf=e.i(203828);let mb=({theme:e,isOpen:t,onClose:i})=>{let{asPath:n}=(0,mf.useRouter)(),[a,r]=(0,c2.useState)(),[o,s]=(0,c2.useState)(),l=(0,c3.useAppSelector)(ua.selectDoc),d=(0,hV.useArchiveTheme)({theme:e,showLinkToDashboard:!!l}),{data:c,loading:u}=(0,uu.useGetThemeWithCountQuery)({variables:{id:e?.id},skip:!e||"new"===e.id});(0,c2.useEffect)(()=>{!u&&c&&(c.theme?.docCount&&r(c.theme.docCount),c.theme?.siteCount&&s(c.theme.siteCount))},[u,c,r,s]);let p=(0,c2.useMemo)(()=>{let e=0;return a&&a>0&&(e+=a),o&&o>0&&(e+=o),e},[a,o]);return(0,ul.jsxs)(p5.Modal,{closeOnOverlayClick:!1,isOpen:t,onClose:i,size:"lg",children:[(0,ul.jsx)(p4.ModalOverlay,{}),(0,ul.jsxs)(p6.ModalContent,{children:[(0,ul.jsx)(p9.ModalHeader,{children:(0,ul.jsx)(uc.Trans,{message:"Archive {0}?",id:"oh7Knm",values:{0:e.name}})}),(0,ul.jsx)(p8.ModalBody,{children:p>0?(0,ul.jsxs)(pt.Text,{mb:2,children:[(0,ul.jsx)(uc.Trans,{message:"{totalCount, plural, one {It's currently in use by # {GAMMA_ARTIFACT_PROPER_NOUN}.} other {It's currently in use by # {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}.}}",id:"uSopl9",values:{totalCount:p,GAMMA_ARTIFACT_PROPER_NOUN:u_.GAMMA_ARTIFACT_PROPER_NOUN,GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:u_.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}})," ",(0,ul.jsx)(uc.Trans,{message:"Existing {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} will not be changed, but new {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} will no longer be able to select it.",id:"c+lbSJ",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:u_.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}})," ","/#themes"!==n&&(0,ul.jsx)(uc.Trans,{message:"You can always access your archived themes through <0>your dashboard <1/>.",id:"kLomb7",components:{0:(0,ul.jsx)(h$.Link,{color:"trueblue.500",colorScheme:"trueblue",href:hU.THEMES_DASHBOARD_LINK,textDecoration:"underline",isExternal:!0}),1:(0,ul.jsx)(mp.ExternalLinkIcon,{mx:"2px"})}})]}):u?(0,ul.jsx)(mg.Skeleton,{h:"1em",mb:2}):(0,ul.jsx)(pt.Text,{mb:2,children:(0,ul.jsx)(uc.Trans,{message:"It's not used by any {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} right now.",id:"KNTN0L",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:u_.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}})})}),(0,ul.jsx)(mm.ModalFooter,{children:(0,ul.jsxs)(mh.ButtonGroup,{children:[(0,ul.jsx)(px.Button,{variant:"ghost",onClick:i,children:(0,ul.jsx)(uc.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,ul.jsx)(px.Button,{variant:"hazardous",onClick:()=>{d(),i()},children:(0,ul.jsx)(uc.Trans,{message:"Archive theme",id:"zck3yw"})})]})}),(0,ul.jsx)(p7.ModalCloseButton,{})]})]})},mx=(0,c2.memo)(({theme:e,openThemeEditorWithThisTheme:t,onDuplicate:i,onShareLink:n,onCopyThemeId:a,onArchiveThemeModalOpen:r,isArchiveThemeModalOpen:o,onArchiveThemeModalClose:s,hasCustomFonts:l})=>{let d=(0,pi.useColorModeValue)("gray.500","gray.400"),c=(0,hV.useCanManageThemesAndFonts)(),{canMakeStandard:u,convertToStandard:p}=(0,hV.useConvertToStandardTheme)(e),{currentWorkspace:h}=(0,pR.useUserContext)(),m=(0,h6.useWorkspaceData)(h?.id),g=(0,mc.useCanManageWorkspace)(),[f]=(0,uu.useUpdateWorkspaceMutation)(),b=(0,ud.useToast)(),x=e.id===m?.defaultThemeId,y=e.createdTime?(0,hW.format)((0,hM.parseISO)(e.createdTime),"PPP"):void 0,v=e.createdBy?.displayName,C=(0,ul.jsx)(uc.Trans,{message:"Only admins can edit themes in this workspace.",id:"UUeOyF"}),w=(0,ul.jsx)(uc.Trans,{message:"Only admins can duplicate themes in this workspace.",id:"/D7zq9"}),S=(0,ul.jsx)(uc.Trans,{message:"Only admins can copy share links in this workspace.",id:"O50tMz"}),k=(0,ul.jsx)(uc.Trans,{message:"Only admins can manage themes in this workspace.",id:"xw+aX2"}),A=(0,c2.useCallback)(()=>{h?.id&&f({variables:{input:{id:h.id,defaultThemeId:e.id}},optimisticResponse:{updateWorkspace:{...h,defaultThemeId:e.id}}}).then(()=>{b({title:(0,ul.jsx)(uc.Trans,{message:"Workspace default theme updated",id:"jpJi4R"}),description:(0,ul.jsx)(uc.Trans,{message:"It will be applied to all new {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} created in this workspace",id:"9TM+t9",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:u_.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}}),status:"success",duration:3e3,position:"top"})}).catch(()=>{console.warn("Error updating theme"),b({title:(0,ul.jsx)(uc.Trans,{message:"Error updating workspace default theme",id:"1sTMTp"}),status:"error",duration:3e3,position:"top"})})},[h,e.id,f,b]);return(0,ul.jsxs)(hR.Menu,{isLazy:!0,children:[(0,ul.jsx)(hO.MenuButton,{as:hN.IconButton,isRound:!0,size:"xs",variant:"ghost",colorScheme:"alpha",icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEllipsis}),onClick:e=>e.stopPropagation(),children:(0,ul.jsx)(uc.Trans,{message:"Actions",id:"7L01XJ"})}),(0,ul.jsx)(hH.Portal,{children:(0,ul.jsxs)(hF.MenuList,{zIndex:"modal",onClick:e=>e.stopPropagation(),children:[(0,ul.jsxs)(u8.Box,{px:4,py:0,maxWidth:"300px",children:[(0,ul.jsx)(pt.Text,{noOfLines:3,children:e.name}),y&&(0,ul.jsx)(pt.Text,{fontSize:"xs",color:d,noOfLines:1,children:(0,ul.jsx)(uc.Trans,{message:"Created {createdDate}",id:"/iFtGl",values:{createdDate:y}})}),v&&(0,ul.jsx)(pY.GammaTooltip,{label:e.createdBy?.email,children:(0,ul.jsx)(pt.Text,{display:"inline-block",fontSize:"xs",color:d,noOfLines:1,children:(0,ul.jsx)(uc.Trans,{message:"by {creatorName}",id:"4xMAwk",values:{creatorName:v}})})})]}),(0,ul.jsx)(hB.MenuDivider,{}),(0,ul.jsx)(pY.GammaTooltip,{label:C,isDisabled:c,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faEdit,fixedWidth:!0}),onClick:t,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Edit",id:"ePK91l"})})}),(0,ul.jsx)(pY.GammaTooltip,{label:w,isDisabled:c,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faClone,fixedWidth:!0}),onClick:i,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Duplicate",id:"euc6Ns"})})}),(0,ul.jsx)(pY.GammaTooltip,{label:c?(0,ul.jsx)(uc.Trans,{message:"Anyone with this link can copy this theme into their workspace.",id:"MXBeyi"}):S,placement:"right",children:(0,ul.jsxs)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faLink,fixedWidth:!0}),onClick:n,isDisabled:!c,children:[(0,ul.jsx)(uc.Trans,{message:"Copy share link",id:"RGCCrg"}),l&&(0,ul.jsx)(pt.Text,{fontSize:"sm",color:d,noOfLines:1,children:(0,ul.jsx)(uc.Trans,{message:"Custom fonts will not be shared",id:"A8cpC7"})})]})}),(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faCode,fixedWidth:!0}),onClick:a,children:(0,ul.jsx)(uc.Trans,{message:"Copy <0>{THEME_ID_PROPER_NOUN} for API",id:"8HR5G/",values:{THEME_ID_PROPER_NOUN:u_.THEME_ID_PROPER_NOUN},components:{0:(0,ul.jsx)(hA,{colorScheme:"gray"})}})}),g&&!x&&(0,ul.jsx)(pY.GammaTooltip,{label:k,isDisabled:c,shouldWrapChildren:!0,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faPalette,fixedWidth:!0}),onClick:A,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Set as workspace default",id:"rbjUma"})})}),u&&(0,ul.jsxs)(ul.Fragment,{children:[(0,ul.jsx)(hB.MenuDivider,{}),(0,ul.jsx)(hz.MenuItem,{color:"orange.500",icon:(0,ul.jsx)(u8.Box,{boxSize:"4",children:(0,ul.jsx)(md.GammaIconOnSquare,{})}),onClick:p,children:(0,ul.jsx)(uc.Trans,{message:"Convert to standard theme",id:"thLYdn"})})]}),(0,ul.jsx)(hB.MenuDivider,{}),(0,ul.jsx)(pY.GammaTooltip,{label:k,isDisabled:c,shouldWrapChildren:!0,placement:"right",children:(0,ul.jsx)(hz.MenuItem,{color:"red.500",icon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faArchive,fixedWidth:!0}),onClick:r,isDisabled:!c,children:(0,ul.jsx)(uc.Trans,{message:"Archive",id:"B495Gs"})})})]})}),o&&(0,ul.jsx)(hH.Portal,{children:(0,ul.jsx)(mb,{theme:e,isOpen:!0,onClose:s})})]})}),my={transitionProperty:"common",shadow:void 0,padding:2,hoverStyles:{bgColor:"blue.50"},themeNamePadding:0},mv={...my,border:"1px solid",borderColor:"gray.200",borderColorSelected:"blue.600",bgColorSelected:"blue.50",hoverStyles:{bgColor:"blue.50",borderColor:"blue.400"}},mC={ghost:my,"ghost-bordered":mv,outline:{transitionProperty:"none",shadow:"sm",padding:0,hoverStyles:{shadow:"md",bgColor:"gray.50"},themeNamePadding:3,border:"1px solid",borderColor:"gray.200"}},mw=({isChecked:e,name:t})=>{let i=(0,pi.useColorModeValue)("trueblue.700","blue.300"),n=(0,pi.useColorModeValue)("gray.900","gray.100");return(0,ul.jsxs)(pe.HStack,{spacing:1,alignItems:"flex-start",children:[e&&(0,ul.jsx)(hy.CheckIcon,{w:3,h:"auto",me:1,mt:1,color:i}),(0,ul.jsx)(pt.Text,{fontSize:"sm",fontWeight:"medium",noOfLines:1,"data-testid":"theme-name",color:e?i:n,overflowWrap:"anywhere",children:t})]})},mS=(0,c2.memo)(({theme:e,isChecked:t=!1,variant:i="outline",onThemeClicked:n,disableEditing:a,hasCustomFonts:r=!1,placeholderPadding:o=2,previewHeightEm:s=8,compact:l=!1,isCrossWorkspaceTheme:d=!1})=>{let c=(0,uh.useAnalytics)(),u=(0,ud.useToast)(),p=mC[i],h=(0,c2.useRef)(null),{borderColor:m,hoverBgColor:g}=(0,hj.useGridCardStyling)(),f=(0,pi.useColorModeValue)("white","transparent"),b=(0,pi.useColorModeValue)("gray.300","gray.600"),x=(0,pi.useColorModeValue)(t?p.bgColorSelected??"blue.100":"white",t?"whiteAlpha.100":"transparent"),y=(0,pi.useColorModeValue)(hP.default.src,hD.src),v=(0,pi.useColorModeValue)(p.borderColor,"transparent"),C=(0,pi.useColorModeValue)(p.borderColorSelected,"trueblue.400"),w=t?C:"outline"===i?m:v,S=(0,pi.useColorModeValue)(p.hoverStyles.borderColor,"whiteAlpha.300"),k=t?C:"outline"===i?m:S,A=(0,pi.useColorModeValue)(p.hoverStyles.bgColor,"whiteAlpha.100"),E=t?x:"outline"===i?g:A,_=t?void 0:{shadow:p.hoverStyles.shadow,bgColor:E,borderColor:k},{currentWorkspace:I,user:M}=(0,pR.useUserContext)(),[T]=(0,uu.useDuplicateThemeMutation)(),[L]=(0,uu.useUpdateWorkspaceMutation)(),j=(0,hV.useCanManageThemesAndFonts)(),P=(0,c2.useCallback)(()=>{(0,ms.openThemeEditorWithCurrentTheme)({theme:e})},[e]),D=(0,c2.useCallback)(()=>{(0,ms.openThemeEditorWithNewFork)({theme:e,sourceThemeInfo:{themeId:e.id,workspaceId:e.workspaceId,source:"theme_preview_customize"}})},[e]),N=(0,c2.useCallback)(()=>{(0,ms.openThemeEditorReadOnly)({theme:e})},[e]),{themeAction:R,themeActionLabel:O}=(0,c2.useMemo)(()=>j?e.workspaceId?{themeAction:P,themeActionLabel:(0,ul.jsx)(uc.Trans,{message:"Edit",id:"ePK91l"})}:{themeAction:D,themeActionLabel:(0,ul.jsx)(uc.Trans,{message:"Customize",id:"srRMnJ"})}:{themeAction:N,themeActionLabel:(0,ul.jsx)(uc.Trans,{message:"View",id:"jpctdh"})},[j,N,D,P,e.workspaceId]),{isOpen:B,onOpen:z,onClose:F}=(0,p3.useDisclosure)({id:"ArchiveThemeModalDisclosure"}),H=e.name.replace(hU.ARCHIVED_THEME_NAME_REPLACE_REGEX,""),W=(0,uw.generateThemeUrl)({themeId:e.id}),{onCopy:U}=(0,h_.useClipboard)(W),{onCopy:V}=(0,h_.useClipboard)(e.id),G=(0,c2.useCallback)(()=>{if(!M||!I)return;let{id:t,...i}=e;T({variables:{id:t},update:(t,{data:i})=>{i?.duplicateTheme&&t.writeQuery({query:uu.GetThemesDocument,variables:{workspaceId:e.workspaceId,archived:!1},data:{themes:[i.duplicateTheme]}})},optimisticResponse:{duplicateTheme:{id:"temp",__typename:"Theme",...i,name:`${H} (copy)`,archived:!1,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}).then(({data:e})=>{if(!e)return;let i=e.duplicateTheme.name;(0,mn.trackThemeDuplicate)(c,{theme_id:e.duplicateTheme.id,source_theme_id:t,source:"menu",source_theme_type:"custom",is_cross_workspace:!1}),(0,mn.trackThemeCreate)(c,{theme_id:e.duplicateTheme.id,type:"duplicate",flow:"menu-direct-duplicate",source:"menu",source_theme_id:t,source_theme_type:"custom",is_cross_workspace:!1}),u({title:uE.i18n._({id:"D64sZs",message:"Theme {themeName} has been saved",values:{themeName:i}}),status:"success",duration:3e3,position:"top",isClosable:!0}),(0,ms.openThemeEditorWithCurrentTheme)({theme:e.duplicateTheme})}).catch(t=>{console.error(`Couldn't duplicate theme ${e.name} error: ${t}`),u({title:"invalid_font_data"===t?.graphQLErrors?.[0]?.extensions?.code?uE.i18n._({id:"eGYLPy",message:"This theme uses custom fonts from another workspace. Swap them for built-in fonts or upload your own to continue."}):uE.i18n._({id:"aOi88n",message:"Couldn't duplicate theme. {err}",values:{err:t}}),status:"error",duration:5e3,position:"top",isClosable:!0})})},[M,I,e,T,H,c,u]),$=(0,c2.useCallback)(()=>{I?.id&&L({variables:{input:{id:I.id,defaultThemeId:e.id}},optimisticResponse:{updateWorkspace:{...I,defaultThemeId:e.id}}}).then(()=>{u({title:(0,ul.jsx)(uc.Trans,{message:"Workspace default theme updated",id:"jpJi4R"}),description:(0,ul.jsx)(uc.Trans,{message:"It will be applied to all new {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} created in this workspace",id:"9TM+t9",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:u_.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}}),status:"success",duration:3e3,position:"top"})}).catch(()=>{console.warn("Error updating theme"),u({title:(0,ul.jsx)(uc.Trans,{message:"Error updating workspace default theme",id:"1sTMTp"}),status:"error",duration:3e3,position:"top"})})},[I,e,L,u]),Z=(0,c2.useCallback)(()=>{if(!M||!I)return;let{name:t}=e;U(),u({title:(0,ul.jsx)(uc.Trans,{message:'Copied share link for "{name}"',id:"EfkecX",values:{name:t}}),description:(0,ul.jsx)(uc.Trans,{message:"Anyone with this link can copy this theme into their workspace.",id:"MXBeyi"}),status:"success",duration:5e3,position:"top",isClosable:!0})},[M,I,e,U,u]),K=(0,c2.useCallback)(()=>{if(!M||!I)return;let{name:t}=e;V(),u({title:(0,ul.jsx)(uc.Trans,{message:'Copied the <0>{THEME_ID_PROPER_NOUN} for "{name}"',id:"h3tz9/",values:{THEME_ID_PROPER_NOUN:u_.THEME_ID_PROPER_NOUN,name:t},components:{0:(0,ul.jsx)(hA,{colorScheme:"gray"})}}),status:"success",duration:3e3,isClosable:!0,position:"top"})},[M,I,V,e,u]),q=e.workspaceId&&!!e.createdBy?.displayName&&!l,Y=!!n,{inViewport:X,dimensions:Q,ref:J}=mo({dimensions:{width:50,height:q?220:172}}),ee=e=>{h.current=e,J(e)};if(!1===X){let i=!l&&Q?`${Q.width}px`:`${13*s/8}em`,n=!l&&Q?`${Q.height}px`:`${s/2}em`;return(0,ul.jsxs)(u7.Flex,{ref:ee,bgColor:f,"data-theme-id":e.id,textAlign:"start",borderRadius:"md",outline:"none",minH:n,minW:i,direction:"column",p:o,sx:{contentVisibility:"auto",containIntrinsicSize:`${i} ${n}`},children:[(0,ul.jsx)(u8.Box,{minH:`${s}em`,maxH:`${s}em`,bg:b,backgroundImage:y,backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}),(0,ul.jsx)(u8.Box,{w:"100%",p:2*(0===o),pt:q?5:1,children:(0,ul.jsx)(mw,{name:H,isChecked:t})})]})}let et=e.updatedTime?(0,hI.formatDistanceToNowStrict)((0,hM.parseISO)(e.updatedTime)):"",ei=a?null:d?(0,ul.jsx)(ml,{theme:e}):e.workspaceId&&!e.archived?(0,ul.jsx)(mx,{theme:e,openThemeEditorWithThisTheme:P,onDuplicate:G,onShareLink:Z,onCopyThemeId:K,onArchiveThemeModalOpen:z,isArchiveThemeModalOpen:B,onArchiveThemeModalClose:F,hasCustomFonts:r}):e.workspaceId&&!0===e.archived?(0,ul.jsx)(hG,{theme:e}):(0,ul.jsx)(mu,{onCustomizeThemeClick:D,onEditThemeClick:P,onSetAsWorkspaceDefaultThemeClick:$,onCopyThemeId:K,theme:e});return(0,ul.jsxs)(u8.Box,{ref:ee,sx:{contentVisibility:"auto",containIntrinsicSize:"13em"},bgColor:x,textAlign:"start",tabIndex:Y?0:void 0,borderRadius:"md",border:p.border,borderColor:w,transitionProperty:p.transitionProperty,transitionDuration:"normal",outline:"none",onClick:()=>Y?n?.(e):void 0,onKeyPress:t=>{Y&&"Enter"===t.key&&n?.(e)},_hover:Y?_:void 0,_focus:{boxShadow:t||!Y?void 0:"outline"},shadow:p.shadow,p:p.padding,"data-theme-id":e.id,"data-testid":t?"current-theme-preview":void 0,cursor:Y?"pointer":void 0,role:"group",position:"relative",children:[(0,ul.jsx)(mt,{theme:e,heightEm:s,isCrossWorkspaceTheme:d,children:t&&!a&&!d&&(0,ul.jsx)(px.Button,{opacity:0,_groupHover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal",position:"absolute",bottom:2,insetEnd:2,size:"sm",variant:"solid",onClick:R,children:O})}),(0,ul.jsxs)(u7.Flex,{align:"baseline",mt:1,direction:"column",p:p.themeNamePadding,children:[(q||d)&&(0,ul.jsx)(u7.Flex,{mb:2,mt:0,children:(0,ul.jsx)(mw,{name:H,isChecked:t})}),(0,ul.jsxs)(pe.HStack,{alignItems:"center",w:"100%",spacing:.5,children:[d?(0,ul.jsx)(pt.Text,{fontSize:"xs",children:(0,ul.jsx)(uc.Trans,{message:"Original theme",id:"5OH9PB"})}):q?(0,ul.jsx)(hL,{createdByYou:e.createdBy?.id===M?.id,createdByName:e.createdBy?.displayName,createdByProfileImageUrl:e.createdBy?.profileImageUrl,timestampDescription:e.updatedTime&&(0,ul.jsx)(uc.Trans,{message:"Updated {formattedThemeUpdateTime} ago",id:"I8D9c7",values:{formattedThemeUpdateTime:et}})}):(0,ul.jsx)(mw,{name:H,isChecked:t}),(0,ul.jsx)(hE.Spacer,{}),ei]})]})]})});mS.displayName="ThemePreview",e.s(["SuggestThemesMessageResult",0,({result:e,state:t,currentThemeId:i,onThemeClick:n,ratings:a})=>{let{isOpen:r,onOpen:o,onClose:s}=(0,p3.useDisclosure)(),l="current"===t||r,d=(0,c3.useAppSelector)(ug.selectAllThemes),c=(0,pi.useColorModeValue)("blue.800","blue.300"),u=(0,c2.useCallback)(e=>{n(e)},[n]);return l?(0,ul.jsxs)(pv.Stack,{align:"space-between",w:"100%",children:[(0,ul.jsxs)(pe.HStack,{justify:"space-between",w:"100%",px:0,py:2,pb:0,border:"1px solid",borderColor:"transparent",children:[(0,ul.jsxs)(pe.HStack,{children:[(0,ul.jsx)(u8.Box,{color:c,children:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faBringForward,fixedWidth:!0,size:"sm"})}),(0,ul.jsx)(pt.Text,{fontSize:"sm",fontWeight:"semibold",children:(0,ul.jsx)(uc.Trans,{message:"Select theme",id:"9KqPc+"})})]}),r&&(0,ul.jsx)(px.Button,{variant:"ghost",size:"xs",onClick:s,"aria-label":uE.i18n._({id:"yz7wBu",message:"Close"}),rightIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faCircleXmark,fixedWidth:!0}),children:(0,ul.jsx)(uc.Trans,{message:"Close",id:"yz7wBu"})})]}),(0,ul.jsx)(pv.Stack,{spacing:4,children:(0,ul.jsx)(hb.Grid,{templateColumns:{base:"repeat(2, 1fr)",md:"repeat(2, 1fr)"},gap:3,children:e.themes.map(({themeId:e,wasOriginal:t})=>{let n=d.find(t=>t.id===e);return n?(0,ul.jsxs)(u8.Box,{position:"relative",children:[(0,ul.jsx)(mS,{theme:n,isChecked:i===e,onThemeClicked:u,variant:"ghost-bordered",disableEditing:!0,previewHeightEm:6,compact:!0},e),t&&(0,ul.jsx)(pw.Badge,{colorScheme:"blue",variant:"subtle",position:"absolute",bottom:1,insetEnd:1,zIndex:1,children:(0,ul.jsx)(uc.Trans,{message:"Original",id:"HxF6Fk"})})]},e):null})})}),a&&(0,ul.jsx)(u8.Box,{display:"flex",justifyContent:"flex-end",children:a})]}):(0,ul.jsx)(hx,{title:e.title,children:(0,ul.jsx)(px.Button,{variant:"ghost",size:"xs",onClick:o,"aria-label":uE.i18n._({id:"1TNIig",message:"Open"}),rightIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:pq.faPalette,fixedWidth:!0}),children:(0,ul.jsx)(uc.Trans,{message:"Open",id:"1TNIig"})})})}],579359),e.s(["MessageResultImageVariation",()=>mA],737504);let mk=(0,c2.memo)(({children:e,position:t="static",...i})=>(0,ul.jsx)(pw.Badge,{bg:"blue.500",color:"white",fontSize:"xs",borderRadius:"md",px:1,py:0,textTransform:"none",..."absolute"===t&&{position:"absolute",bottom:1,insetStart:1,zIndex:1},...i,children:e}));mk.displayName="CardBadge",e.s(["CardBadge",0,mk],472413);let mA=(0,c2.memo)(({variation:e,hideBadge:t})=>{let i,n,a=ub(),r=(0,ue.useBuddyStore)("chosenResultVariations")[e.messageId]===e.id,{getBgColor:o,getBgColorHover:s,getBorderColor:l,getTextColor:d}=hm({isApplied:r}),c=(0,pl.useToken)("colors",l()),u=(0,ue.useBuddyStore)("selectiveAccept"),p=u[e.messageId]?.savedSelections,h=p?{total:Object.keys(p).length,selected:Object.values(p).filter(e=>"modified"===e).length}:null,m=(0,c2.useCallback)(()=>{r||c4.BuddyEditorInterface.applyResultVariation(a,e),c4.BuddyEditorInterface.focusResultVariation(a,e)},[a,r,e]);return(0,ul.jsxs)(u7.Flex,{p:2,pt:1,overflow:"hidden",role:"group",transitionProperty:"height border",transitionDuration:"0.2s",flexDirection:"column",justifyContent:"start",position:"relative",align:"left",borderRadius:"lg",border:"1px solid",borderColor:l(),outline:r?`1px solid ${c}`:"none",outlineOffset:"-2px",_hover:{bg:s()},onClick:m,cursor:"pointer",bg:o(),children:[(0,ul.jsxs)(pe.HStack,{spacing:2,w:"100%",justify:"space-between",mb:1,children:[(0,ul.jsx)(pt.Text,{fontSize:"xs",fontWeight:"semibold",color:d(),children:e.name}),!t&&"modified"===e.id&&h&&(0,ul.jsx)(mk,{children:(i=h.selected,n=h.total,uE.i18n._({id:"xyPRt5",message:"{selected}/{total} edits",values:{selected:i,total:n}}))})]}),e.attrs.src&&(0,ul.jsx)(p0.ImageOrVideo,{src:e.attrs.src,borderRadius:4})]})});mA.displayName="MessageResultImageVariation",e.s(["buildAppliedChangesResultVariations",()=>mM,"getAppliedChangesDisplayVariations",()=>mI],594226),e.i(593613);var mE=e.i(46453),m_=e.i(529232);function mI(e){let{result:t,suggestions:i,savedSelections:n,beforeCheckpoint:a,afterCheckpoint:r}=e;if(!n||!a||!r)return t.variations;let o=i.filter(e=>e.id in n),s=o.filter(e=>"modified"===n[e.id]);return 0===s.length||s.length===o.length?t.variations:mM(s,t.messageId,a,r)}function mM(e,t,i,n){let a=new uT.Editor({extensions:(0,m_.getBaseExtensions)(),content:i.jsonContent}),r=new uT.Editor({extensions:(0,m_.getBaseExtensions)(),content:n.jsonContent}),o=function(e,t,i,n,a,r){var o;let s,l=e.map(e=>e.preview({editor:a},{editor:r})),d=new Map;for(let e of l.filter(e=>e.previewType===mE.BuddySuggestionPreviewType.Image))d.has(e.appliedFirstPos)||d.set(e.appliedFirstPos,e.oldAttrs);let c=l.filter(e=>e.previewType!==mE.BuddySuggestionPreviewType.Theme),u=(o=c.length>0?c:l,s=mE.BuddySuggestionPreviewType.Card,o.map((e,t)=>[e,t]).sort(([e,t],[i,n])=>{if(e.appliedFirstPos===i.appliedFirstPos){let a=e.previewType===s;return a!==(i.previewType===s)?a?-1:1:n-t}return e.appliedFirstPos-i.appliedFirstPos}).map(([e])=>e)),p=u[0],h={id:"original",messageId:t,name:uE.i18n._({id:"HxF6Fk",message:"Original"}),toApplyCheckpointId:i.id},m={id:"modified",messageId:t,name:uE.i18n._({id:"tgWuMB",message:"Modified"}),toApplyCheckpointId:n.id};if(p.previewType===mE.BuddySuggestionPreviewType.Card)if(1==u.length)return[{...h,previewCardId:p.originalPreviewCardId,scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Card},{...m,previewCardId:p.modifiedPreviewCardId,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Card}];else return[{...h,previewCardIds:p.originalContextCardIds,scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:p.modifiedContextCardIds,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}];if(p.previewType===mE.BuddySuggestionPreviewType.Doc)return[{...h,previewCardIds:p.originalPreviewCardIds,scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:p.modifiedPreviewCardIds,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}];if(p.previewType===mE.BuddySuggestionPreviewType.Image)return[{...h,previewType:mE.BuddySuggestionPreviewType.Image,attrs:d.get(p.appliedFirstPos),scrollToCardId:p.originalScrollToCardId},{...m,previewType:mE.BuddySuggestionPreviewType.Image,attrs:p.newAttrs,scrollToCardId:p.modifiedScrollToCardId}];if(p.previewType===mE.BuddySuggestionPreviewType.CardRemoval)return[{...h,previewCardIds:[p.cardId],scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:p.modifiedContextCardIds,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}];if(p.previewType===mE.BuddySuggestionPreviewType.CardCreation)return[{...h,previewCardIds:p.originalContextCardIds,scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:p.modifiedContextCardIds,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}];if(p.previewType===mE.BuddySuggestionPreviewType.CardMove){let e=c4.BuddyEditorInterface.findTopLevelCards(a).map(e=>e.cardId).slice(0,3);return[{...h,previewCardIds:e,scrollToCardId:p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:p.modifiedContextCardIds,scrollToCardId:p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}]}if(p.previewType===mE.BuddySuggestionPreviewType.Theme){let e=c4.BuddyEditorInterface.findTopLevelCards(a).map(e=>e.cardId).slice(0,3),t=c4.BuddyEditorInterface.findTopLevelCards(r).map(e=>e.cardId).slice(0,3);return[{...h,previewCardIds:e,scrollToCardId:e[0]??p.originalScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc},{...m,previewCardIds:t,scrollToCardId:t[0]??p.modifiedScrollToCardId,previewType:mE.BuddySuggestionPreviewType.Doc}]}return[]}(e,t,i,n,a,r);return a.destroy(),r.destroy(),o}e.i(977581),e.i(104056),e.i(417416),e.s(["BuddyCancelButton",0,({variant:e,onClick:t,ariaLabel:i,...n})=>{let a="go-back"===e;return(0,ul.jsx)(px.Button,{variant:a?"ghost":"plain",size:"xs",onClick:t,"aria-label":i||(a?"Go back":"Cancel"),rightIcon:(0,ul.jsx)(pr.FontAwesomeIcon,{icon:a?pq.faUndo:pq.faArrowRotateForward,fixedWidth:!0}),...n,children:a?(0,ul.jsx)(uc.Trans,{message:"Go back",id:"CKyk7Q"}):(0,ul.jsx)(uc.Trans,{message:"Cancel",id:"dEgA5A"})})}],762721);let mT={containerType:"inline-size","--editor-width":"100cqw","--line-thickness":"1px"},mL=(0,c2.memo)(({isSelected:e,selectedColor:t,borderColor:i,bgColor:n,variant:a="solid",height:r="100px",dynamicPreviewWidth:o=!1,children:s,...l})=>(0,ul.jsx)(u7.Flex,{flex:1,borderRadius:"lg",bg:n,border:"2px",borderStyle:e?"solid":a,borderColor:e?t:i,overflow:"hidden",flexDirection:"column",position:"relative",h:r,alignItems:o?"center":void 0,justifyContent:o?"center":void 0,css:o?mT:void 0,...l,children:s}));mL.displayName="PreviewContainer",e.s(["PreviewContainer",0,mL,"previewContainerCssVars",0,mT],927509)},927835,516463,74542,875504,599350,e=>{"use strict";var t=e.i(391398),i=e.i(428683),n=e.i(613616),a=e.i(191788),r=e.i(283591);let o={"[data-thumbnail-hidden]":{display:"none !important"},"[data-selection-ring]":{outline:"none !important",_before:{display:"none !important"}},"[data-selection-background]":{_after:{display:"none !important"}},".is-selecting-text":{backgroundColor:"transparent !important",padding:"0 !important"},".selectedCell:after":{display:"none !important"},".block-table td:not(:first-of-type)":{borderInlineStart:"1px solid transparent !important"},".positioned-box, .smart-diagram-textbox, .smart-diagram-selection-box":{outline:"none !important"},".label":{outline:"none !important"},"[data-placeholder]::before, [data-placeholder]::after, [data-multiline-placeholder]::before, [data-multiline-placeholder]::after, [placeholder]::before, [placeholder]::after":{display:"none !important"},".image-loading-spinner":{display:"none !important"},"*":{backdropFilter:"none !important",webkitBackdropFilter:"none !important",WebkitTransition:"none !important",MozTransition:"none !important",OTransition:"none !important",msTransition:"none !important",transition:"none !important",vectorEffect:"none"},contain:"paint",".editor-core-root, .editor-preview-root":{height:"100% !important",width:"auto !important"},".doc-content-wrapper":{pb:"0 !important",minH:"auto !important"},"[data-doc-background-element], [data-doc-background-element-present-mode]":{display:"none !important"},".card2-background":{mt:0}};var s=e.i(85901);let l=(0,a.createContext)(!1),d=({zoomIn:e,shouldFixHeight:d,hidden:c,children:u,...p})=>{let h=(0,r.useIsThemeDark)(),m=(0,a.useRef)(null);return(0,a.useEffect)(()=>{m.current&&(d?m.current.style.height=`${m.current.offsetHeight}px`:m.current.style.height="")},[d]),(0,t.jsx)(l.Provider,{value:!0,children:(0,t.jsx)(n.Flex,{ref:m,className:"preview-card-wrapper",sx:o,css:{"--editor-font-size":`calc(var(--editor-width) / ${s.CONTENT_WIDTH_EM})`,"--thumbnail-min-height":"calc(var(--editor-width) * 0.4)"},justifyContent:"center",overflow:"hidden",pointerEvents:"none",bg:h?"gray.800":"gray.50",maxH:"calc(var(--editor-width) * 1.777)",w:"var(--editor-width)",...p,children:(0,t.jsx)(i.Box,{w:"100%",transform:e?"scale(2)":void 0,transformOrigin:e?"center left":void 0,opacity:c?.4:1,inert:!0,bg:h?"gray.700":"white",children:u})})})};d.displayName="PreviewCard",e.s(["PreviewCard",0,d,"useIsInsidePreviewCard",0,()=>(0,a.useContext)(l)],927835);var c=e.i(54182),u=e.i(576826),p=e.i(103630);let h=!1;e.s(["monkeyPatchGapCursorForCardLayouts",0,()=>{if(h)return;let e=c.GapCursor.valid;c.GapCursor.valid=t=>{if(!(0,u.getDocFlags)(t.doc).cardLayoutsEnabled)return e(t);let i=e(t);return!(i&&(t.nodeAfter&&(0,p.isCardLayoutItemNode)(t.nodeAfter)||t.nodeBefore&&(0,p.isCardLayoutItemNode)(t.nodeBefore)))&&i},h=!0}],516463);var m=e.i(82050),g=e.i(180939),f=e.i(418755);e.s(["useCanUseCardMarginElementsProductFeature",0,()=>{let e=(0,f.useAppSelector)(m.selectFileWorkspace);return(0,g.useCanUseProductFeature)("card_margin_elements",e)}],74542);var b=e.i(551880),x=e.i(297194);let y=e=>{let{hideFromFirst:t,hideFromLast:i,...n}=e;return Object.values(n).every(e=>!e)},v={top:/^top/,bottom:/^bottom/,left:/Left$/,right:/Right$/,center:/Center$/};e.s(["getAlignmentsForMarginElement",0,e=>{let{flex:t,text:i}={Left:{flex:"flex-start",text:"left"},Center:{flex:"center",text:"center"},Right:{flex:"flex-end",text:"right"}}[e.replace(/^(top|bottom)/,"")];return{flex:t,text:i}},"getCardNumberDisplayString",0,(e,t,i)=>{let n=(t??1)-1;return e{let n=e??1,a=t??1,r="";2===n?r="—,":n>2&&(r="...,");let o=a+1,s=a+2;return i&&1===n?`${a}, ${o}, ${s}, ${s+1}...`:`${r} ${a}, ${o}, ${s}...`},"getImageCardMarginElementSrc",0,e=>e?.type!=="image"?null:e?.imageAttrs?.src??null,"hasNoCardMarginElements",0,y,"hasThemeLogoCardMarginElement",0,e=>{let{hideFromFirst:t,hideFromLast:i,...n}=e;return Object.values(n).some(e=>e?.type==="themeLogo")},"isEmptyMarginElement",0,(e,t)=>!e?.type||"text"===e.type&&!e.content||"image"===e.type&&(!(e?.type==="image"&&e?.imageAttrs?.src)||e?.imageAttrs?.uploadStatus!==x.UploadStatus.Done)||"themeLogo"===e.type&&null===t,"isMarginPosition",0,(e,t)=>v[e].test(t)],875504),e.s(["useCardMarginElementsVisibility",0,e=>{let t=(0,f.useAppSelector)(b.selectTopLevelCardIds),i=e?.id,n=!!(i&&t[0]===i),a=t[t.length-1]===i,{cardMarginSettings:r}=(0,f.useAppSelector)(b.selectDocSettingsWithDefaults),{hideFromFirst:o,hideFromLast:s}=r,l=n&&o,d=a&&s,c=!!e?.cardMarginSettings.isHidden;return{isFirstCardAndHidden:l,isLastCardAndHidden:d,isHiddenByCardSettings:c,areElementsCurrentlyHiddenBySettings:!y(r)&&(l||d||c)}}],599350)},827911,e=>{"use strict";e.i(175863),e.i(319813),e.i(802818);var t=e.i(89081);e.s(["undo",0,e=>{let i=t.yUndoPluginKey.getState(e).undoManager;if(null!=i)return i.undo(),!0}])},48735,392678,305573,e=>{"use strict";var t=e.i(391398),i=e.i(428683),n=e.i(402818),a=e.i(676828),r=e.i(555145),o=e.i(775493),s=e.i(704077),l=e.i(112010),d=e.i(588183),c=e.i(575329),u=e.i(751827),p=e.i(918228),h=e.i(865786),m=e.i(878726),g=e.i(260241),f=e.i(480801),b=e.i(595995),x=e.i(887527),y=e.i(575084),v=e.i(541075);e.i(828525);var C=e.i(876533),w=e.i(358280),S=e.i(191788),k=e.i(849187),A=e.i(418755),E=e.i(551880);e.i(905506);var _=e.i(267158),I=e.i(74542),M=e.i(599350),T=e.i(875504),L=e.i(969641),j=e.i(344233),P=e.i(721455),D=e.i(148318),N=e.i(932786),R=e.i(285042),O=e.i(704273),B=e.i(620020),z=e.i(524473),F=e.i(827911),H=e.i(408122);let W=({onDelete:e,isDeleteDisabled:i,editor:n})=>{let a=(0,B.useToast)(),o=(0,S.useCallback)(()=>{e();let i=a({title:(0,t.jsxs)(r.HStack,{children:[(0,t.jsx)(x.Text,{children:(0,t.jsx)(w.Trans,{message:"Removed all header and footer elements",id:"i+ZZMW"})}),(0,t.jsx)(L.Button,{variant:"link",textDecoration:"underline",as:"span",size:"sm",cursor:"pointer",color:"inherit",onClick:()=>{(0,F.undo)(n.state),a.close(i)},children:(0,t.jsx)(w.Trans,{message:"Undo",id:"IiqYd9"})})]}),status:"info",duration:3e3,position:"top"})},[n,e,a]);return(0,t.jsxs)(P.Menu,{children:[(0,t.jsx)(D.MenuButton,{as:j.IconButton,icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:y.faEllipsis}),"aria-label":H.i18n._({id:"CQDm4Q",message:"Card header & footer options"}),variant:"plain",size:"sm"}),(0,t.jsx)(O.MenuList,{children:(0,t.jsx)(N.MenuGroup,{title:H.i18n._({id:"ZYWBTf",message:"Card headers & footers"}),children:(0,t.jsx)(R.MenuItem,{onClick:o,isDisabled:i,color:"red.500",icon:(0,t.jsx)(v.FontAwesomeIcon,{fixedWidth:!0,icon:z.faTrash}),children:(0,t.jsx)(w.Trans,{message:"Delete all elements",id:"mxPb1C"})})})})]})};var U=e.i(613616);e.i(832019);var V=e.i(736386),G=e.i(364351);e.i(734710);var $=e.i(78387),Z=e.i(468738),K=e.i(103104),q=e.i(325059);let Y=({label:e,children:i,labelProps:n})=>{let a=(0,q.useRtlEnabled)();return(0,t.jsxs)(p.Stack,{position:"absolute",top:"50%",insetStart:"50%",transform:`translate(${a?"50%":"-50%"},-50%)`,alignItems:"center",w:"100%",px:16,children:[(0,t.jsx)(x.Text,{fontSize:"3xl",textAlign:"center",color:"gray.400",...n,children:e}),i]})},X=(0,S.memo)(({onUpsellClick:e})=>(0,t.jsxs)(Y,{label:(0,t.jsx)(w.Trans,{message:"{PRO_PROPER_NOUN} feature",id:"GRyKgN",values:{PRO_PROPER_NOUN:K.PRO_PROPER_NOUN}}),labelProps:{color:"inherit"},children:[(0,t.jsx)(x.Text,{textAlign:"center",mb:"2",children:(0,t.jsx)(w.Trans,{message:"Upgrade to {GAMMA_PRO_PROPER_NOUN} to add your logo, text, or card numbers.",id:"RryZ/g",values:{GAMMA_PRO_PROPER_NOUN:K.GAMMA_PRO_PROPER_NOUN}})}),(0,t.jsx)(L.Button,{variant:"solid",onClick:e,children:(0,t.jsx)(w.Trans,{message:"Upgrade to {PRO_PROPER_NOUN}",id:"cKQRnY",values:{PRO_PROPER_NOUN:K.PRO_PROPER_NOUN}})})]}));X.displayName="CardMarginElementsUpsell";var Q=e.i(865639),J=e.i(826480),ee=e.i(182895),et=e.i(259658),ei=e.i(707065),en=e.i(896620),ea=e.i(534904),er=e.i(84723),eo=e.i(996651),es=e.i(843946),el=e.i(306841),ed=e.i(891494),ec=e.i(882255),eu=e.i(50034),ep=e.i(292750),eh=e.i(189225),em=e.i(654656),eg=e.i(413829);let ef=({value:e,setValue:i,placeholder:n,min:a,max:r,onUpdate:o})=>{let s=(0,S.useCallback)(e=>{if(e){let t=parseInt(e);i((0,eg.default)(isNaN(t)?a:t,a,r).toString())}else i("")},[a,r,i]),l=(0,S.useCallback)(t=>{"Enter"===t.key&&(s(e),o())},[s,o,e]),d=(0,S.useCallback)(()=>{s(e),o()},[s,o,e]);return(0,t.jsx)(Q.Input,{type:"number",value:e,placeholder:n||"",onChange:e=>i(e.target.value),onKeyDown:l,onBlur:d,size:"sm",min:a,max:r,textAlign:"center",maxW:"16"})},eb=({startIndex:e,startNumber:i})=>{let n={height:9,bg:"gray.100",borderRadius:"sm",alignItems:"flex-end",justifyContent:"flex-end",fontSize:"xs"},a=e>2,r=a?[e-1,e,e+1]:[0,1,2,3],o=({cardIndex:a})=>{let r=(0,T.getCardNumberDisplayString)(a,e,i);return(0,t.jsx)(U.Flex,{...n,minH:9,py:.5,px:1.5,flex:"1",children:r},a)};return(0,t.jsxs)(p.Stack,{spacing:2,w:"100%",children:[a&&(0,t.jsx)(({startingIndex:e})=>{let i=(0,eg.default)(e-1,2,7);return(0,t.jsxs)(p.Stack,{spacing:.5,flex:"1",position:"relative",maxH:9,minH:9,children:[[...Array(i)].map((e,i)=>(0,t.jsx)(U.Flex,{...n,h:"100%",flex:"1"},i)),(0,t.jsxs)(x.Text,{position:"absolute",insetStart:"50%",top:"50%",transform:"translate(-50%, -50%)",fontSize:"xs",bg:"white",borderRadius:"sm",px:1,color:"gray.500",children:["(",e-1,")"]})]})},{startingIndex:e}),r.map(e=>(0,t.jsx)(o,{cardIndex:e},e))]})},ex=({element:e,onUpdate:i})=>{let n,[a,o]=(0,S.useState)(1!==(n=e?.type==="cardNumbers"?e.startIndex:void 0)&&n?2===n?"2":"other":"1"),[s,l]=(0,S.useState)(e?.type==="cardNumbers"&&e.startIndex&&e.startIndex>2?e.startIndex.toString():""),[d,c]=(0,S.useState)(e?.type==="cardNumbers"&&void 0!==e.startNumber&&1!==e.startNumber?e.startNumber.toString():""),u="1"===a?1:"2"===a?2:s?(0,eg.default)(parseInt(s),1,1e3):void 0,h=""===d?void 0:(0,eg.default)(parseInt(d),0,1e3),m=(0,S.useCallback)(()=>{i({type:"cardNumbers",startIndex:s?(0,eg.default)(parseInt(s),1,1e3):void 0,startNumber:h})},[s,h,i]),g=(0,S.useCallback)(()=>{let t=d?(0,eg.default)(parseInt(d),0,1e3):void 0;i({type:"cardNumbers",startIndex:e?.type==="cardNumbers"?e.startIndex:void 0,startNumber:t})},[d,e,i]),f=e?.type==="cardNumbers"&&(void 0!==e.startIndex||void 0!==e.startNumber);return(0,t.jsxs)(em.VStack,{spacing:0,children:[(0,t.jsxs)(r.HStack,{w:"100%",alignItems:"flex-start",p:3,children:[(0,t.jsxs)(em.VStack,{alignItems:"flex-start",flex:"2",spacing:4,children:[(0,t.jsxs)(eo.FormControl,{children:[(0,t.jsx)(es.FormLabel,{fontSize:"xs",fontWeight:"bold",children:(0,t.jsx)(w.Trans,{message:"Display starting on:",id:"EgzmRy"})}),(0,t.jsxs)(em.VStack,{spacing:2,alignItems:"flex-start",children:[(0,t.jsx)(eh.RadioGroup,{value:a,defaultValue:a,onChange:e=>{o(e),"other"===e?l(a):l(""),"1"===e?i({type:"cardNumbers",startIndex:1,startNumber:h}):"2"===e&&i({type:"cardNumbers",startIndex:2,startNumber:h})},size:"sm",children:(0,t.jsxs)(p.Stack,{spacing:2,children:[(0,t.jsx)(ep.Radio,{value:"1",children:(0,t.jsx)(x.Text,{children:(0,t.jsx)(w.Trans,{message:"First card",id:"gidUuU"})})}),(0,t.jsx)(ep.Radio,{value:"2",children:(0,t.jsx)(x.Text,{children:(0,t.jsx)(w.Trans,{message:"Second card",id:"CfeM0j"})})}),(0,t.jsx)(ep.Radio,{value:"other",children:(0,t.jsx)(x.Text,{children:(0,t.jsx)(w.Trans,{message:"Other card",id:"m7sNyG"})})})]})}),"other"===a&&(0,t.jsx)(ef,{value:s,setValue:l,min:1,max:1e3,onUpdate:m})]})]}),(0,t.jsxs)(eo.FormControl,{children:[(0,t.jsx)(es.FormLabel,{fontSize:"xs",fontWeight:"bold",children:(0,t.jsx)(w.Trans,{message:"Start counting from:",id:"boZ3aq"})}),(0,t.jsx)(ef,{value:d,setValue:c,placeholder:"1",min:0,max:1e3,onUpdate:g})]})]}),(0,t.jsxs)(em.VStack,{spacing:1,w:"100%",alignItems:"flex-start",maxW:"16",children:[(0,t.jsx)(x.Text,{fontSize:"xs",children:(0,t.jsx)(w.Trans,{message:"Preview:",id:"GswZF3"})}),(0,t.jsx)(eb,{startIndex:u||1,startNumber:h??1})]})]}),f&&(0,t.jsx)(r.HStack,{px:4,py:2,bg:"gray.50",w:"100%",children:(0,t.jsx)(L.Button,{variant:"link",size:"xs",w:"100%",onClick:()=>{o("1"),l(""),c(""),i({type:"cardNumbers",startIndex:void 0,startNumber:void 0})},isDisabled:!f,leftIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:y.faRotateLeft}),children:(0,t.jsx)(w.Trans,{message:"Reset to default",id:"L+rMC9"})})})]})},ey=({element:e,position:i,showUpsell:n,onUpdate:a})=>{let o=(0,q.useRtlEnabled)(),{flex:s}=(0,T.getAlignmentsForMarginElement)(i),l=e?.type==="cardNumbers"?e:null,d=l?.startIndex,c=l?.startNumber,u={px:3,h:8,w:"100%",borderRadius:"md",fontSize:"sm",cursor:n?"not-allowed":"pointer",bg:n?"blackAlpha.50":"white",color:n?"gray.600":"inherit",justifyContent:s,border:"1px solid",borderColor:n?"transparent":"titanium.300"};return n?(0,t.jsx)(r.HStack,{...u,children:(0,t.jsx)(x.Text,{dir:o?"rtl":void 0,children:(0,T.getCardNumbersPreviewString)(d,c)})}):(0,t.jsxs)(el.Popover,{children:[(0,t.jsx)(eu.PopoverTrigger,{children:(0,t.jsx)(r.HStack,{...u,children:(0,t.jsx)(x.Text,{dir:o?"rtl":void 0,children:(0,T.getCardNumbersPreviewString)(d,c)})})}),(0,t.jsx)(ec.PopoverContent,{maxW:"240px",p:0,overflow:"hidden",children:(0,t.jsx)(ed.PopoverBody,{p:0,children:(0,t.jsx)(ex,{element:e,onUpdate:a})})})]})};var ev=e.i(818315),eC=e.i(147349),ew=e.i(315261);let eS=({imageElement:e,isError:i,isLoading:n,isCompact:a=!1})=>{let o=(0,q.useRtlEnabled)();return e&&"image"===e.type?i?(0,t.jsxs)(r.HStack,{dir:o?"rtl":void 0,spacing:1,children:[(0,t.jsx)(x.Text,{color:"red.500",fontSize:"xxs",children:(0,t.jsx)(w.Trans,{message:"Upload error",id:"yabRr8"})}),(0,t.jsx)(ew.InfoTip,{color:"red.500",fontSize:a?"xxs":void 0,display:"block",lineHeight:"0",label:(0,t.jsx)(w.Trans,{message:"There was an error uploading the image. Please remove it and try again.",id:"mjco3+"})})]}):n?(0,t.jsx)(eC.Spinner,{size:"xs"}):null:null};var ek=e.i(312086),eA=e.i(305524),eE=e.i(297194),e_=e.i(25747);let eI={sm:6,md:7,lg:8,xl:10},eM={sm:{name:()=>H.i18n._({id:"4Revpc",message:"Small"}),buttonText:()=>H.i18n._({id:"ZQA8ce",message:"S"}),height:1.55},md:{name:()=>H.i18n._({id:"agPptk",message:"Medium"}),buttonText:()=>H.i18n._({id:"Tmu3kA",message:"M"}),height:2},lg:{name:()=>H.i18n._({id:"k7rCa/",message:"Large"}),buttonText:()=>H.i18n._({id:"SMwD6s",message:"L"}),height:2.65},xl:{name:()=>H.i18n._({id:"vp6Yr4",message:"Extra Large"}),buttonText:()=>H.i18n._({id:"ekdhM0",message:"XL"}),height:3.5}};e.s(["BASE_CARD_MARGIN_PADDING",0,{sm:.6,md:.7,lg:.8,xl:.9},"CARD_MARGIN_IMAGE_SIZES",0,eM,"MIN_ELEMENT_SIZE_EMS",0,2,"TEXT_ELEMENT_SIZE_EMS",0,.7,"THUMBNAIL_IMAGE_HEIGHT",0,eI,"THUMBNAIL_IMAGE_MAX_WIDTH",0,40],392678);var eT=e.i(335799);let eL=({children:e})=>(0,t.jsxs)(r.HStack,{fontSize:"xs",alignItems:"flex-start",children:[(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faCheck,fixedWidth:!0}),(0,t.jsx)(x.Text,{fontSize:"xs",children:e})]}),ej=()=>(0,t.jsxs)(p.Stack,{spacing:1,children:[(0,t.jsx)(x.Text,{fontSize:"xs",children:(0,t.jsx)(w.Trans,{message:"Image and logo tips:",id:"wCgOyU"})}),(0,t.jsxs)(p.Stack,{spacing:.5,children:[(0,t.jsx)(eL,{children:(0,t.jsx)(w.Trans,{message:"Square or rectangular works best",id:"48UYx4"})}),(0,t.jsx)(eL,{children:(0,t.jsx)(w.Trans,{message:"Transparent background (PNG, SVG)",id:"tzmFSd"})}),(0,t.jsx)(eL,{children:(0,t.jsx)(w.Trans,{message:"Cropped to reduce whitespace",id:"krkjlf"})})]})]}),eP=({currentSize:e,onSizeChange:i,onReplaceImage:n,isDisabled:a=!1})=>{let o=void 0!==e;return(0,t.jsxs)(el.Popover,{children:[(0,t.jsx)(eu.PopoverTrigger,{children:(0,t.jsx)(j.IconButton,{"aria-label":H.i18n._({id:"XyAh4B",message:"Change image size"}),icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faSliders,fixedWidth:!0}),size:"sm",variant:"ghost",borderRadius:"full",color:"blackAlpha.700"})}),(0,t.jsx)(ec.PopoverContent,{maxW:"260px",p:0,overflow:"hidden",children:(0,t.jsxs)(ed.PopoverBody,{p:0,children:[(0,t.jsxs)(em.VStack,{p:3,spacing:3,alignItems:"flex-start",children:[(0,t.jsxs)(eo.FormControl,{children:[(0,t.jsx)(es.FormLabel,{fontSize:"xs",fontWeight:"bold",children:(0,t.jsx)(w.Trans,{message:"Image size",id:"8J92vb"})}),(0,t.jsx)(eT.ButtonGroup,{isAttached:!0,size:"sm",display:"flex",w:"100%",children:Object.entries(eM).map(([n,r])=>(0,t.jsx)(en.GammaTooltip,{label:r.name(),placement:"top",children:(0,t.jsx)(L.Button,{"aria-label":r.name(),px:"2.5",boxShadow:"none",variant:n===e?"plainSelected":"plain",bg:"md"!==n||e?void 0:"blue.50",flex:1,onClick:()=>{i(n)},isDisabled:a,children:r.buttonText()})},n))})]}),(0,t.jsx)(ej,{})]}),(o||n)&&!a&&(0,t.jsxs)(r.HStack,{px:4,py:2,bg:"gray.50",w:"100%",justifyContent:o&&n?"space-between":"center",children:[o&&(0,t.jsx)(L.Button,{variant:"link",size:"xs",onClick:()=>{i(void 0)},colorScheme:"gray",leftIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faRotateLeft,fixedWidth:!0}),children:(0,t.jsx)(w.Trans,{message:"Reset size",id:"cl2Y/T"})}),n&&(0,t.jsx)(L.Button,{variant:"link",size:"xs",onClick:n,leftIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faSync,fixedWidth:!0}),colorScheme:"gray",children:(0,t.jsx)(w.Trans,{message:"Replace image",id:"YOzD/a"})})]})]})})]})},eD=({result:e,isError:t})=>{if(t)return{uploadStatus:eE.UploadStatus.Error,src:null,source:"image.custom"};let{name:i,src:n,meta:a}=e;return{uploadStatus:eE.UploadStatus.Done,source:"image.custom",name:i,src:n,meta:a}},eN=({onUpdate:e,element:i,position:n,isReadonly:a,showUpsell:o})=>{let{currentWorkspace:s}=(0,e_.useUserContext)(),[l,d]=(0,S.useState)("idle"),c=(0,S.useRef)(!1),u=(0,S.useMemo)(()=>{if(s?.id)return eA.UppyUploader.createUppyInstance(s?.id,{onUploadStart:()=>{d("loading"),e({type:"image",imageAttrs:{uploadStatus:eE.UploadStatus.Uploading,source:"image.custom",src:null}})},onOriginalFileUpload:t=>{c.current||e({type:"image",imageAttrs:eD({result:t,isError:!1})})},onUploadComplete:t=>{c.current||(d("idle"),e({type:"image",imageAttrs:eD({result:t,isError:!1})}),u?.cancelAll())},onUploadFailed:()=>{d("error"),e({type:"image",imageAttrs:eD({result:void 0,isError:!0})}),u?.cancelAll()}},"cardMargins")},[s?.id,e]),{onClick:p,inputElement:h}=(0,ek.useHiddenFileInput)({accept:"image/*",multiple:!1,handleFilesCallback:e=>{c.current=!1;let t=e[0];t&&u?.addFile({name:t.name,type:t.type,data:t})}}),m=(0,T.getImageCardMarginElementSrc)(i),g=i?.type==="image"?i.imageAttrs:void 0,f=i?.type==="image"?i.imageSize:void 0,b="loading"===l||g?.uploadStatus===eE.UploadStatus.Uploading,x=g?.uploadStatus===eE.UploadStatus.Error||"error"===l,y="idle"===l&&!g,C=(0,q.useRtlEnabled)(),{flex:k}=(0,T.getAlignmentsForMarginElement)(n),A=(0,S.useCallback)(t=>{e({type:"image",imageAttrs:g,imageSize:t})},[e,g]),E=(0,S.useCallback)(()=>{c.current=!0,d("idle"),p()},[p]);return a?(0,t.jsx)(U.Flex,{justifyContent:k,dir:C?"rtl":void 0,gap:2,w:"100%",children:m?(0,t.jsx)(ev.Image,{h:eI[f||"md"]||7,maxW:"100%",objectFit:"contain",src:m,alt:H.i18n._({id:"aiyf05",message:"Custom image upload"})}):(0,t.jsx)(eS,{imageElement:i,isError:g?.uploadStatus===eE.UploadStatus.Error,isLoading:g?.uploadStatus===eE.UploadStatus.Uploading})}):y?(0,t.jsxs)(t.Fragment,{children:[h,(0,t.jsx)(L.Button,{dir:C?"rtl":void 0,leftIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faArrowUpFromBracket,fixedWidth:!0}),variant:"plain",size:"sm",onClick:p,children:(0,t.jsx)(w.Trans,{message:"Choose image...",id:"m3C7sL"})})]}):(0,t.jsxs)(t.Fragment,{children:[h,(0,t.jsx)(r.HStack,{dir:C?"rtl":void 0,gap:2,w:"100%",justifyContent:k,children:b||x?(0,t.jsx)(eS,{imageElement:i,isError:x,isLoading:b}):m?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ev.Image,{h:eI[f||"md"]||7,maxW:40,src:m,objectFit:"contain",bg:"blackAlpha.100"}),(0,t.jsx)(eP,{currentSize:f,onSizeChange:A,onReplaceImage:E,isDisabled:o})]}):null})]})},eR=(0,S.memo)(function({onClick:e,isCompact:i=!1}){let n=(0,q.useRtlEnabled)(),a=(0,t.jsx)(w.Trans,{message:"No theme logo",id:"pQr8gu"}),o=(0,t.jsx)("span",{role:"img","aria-label":"warning",children:"⚠️"});return(0,t.jsxs)(r.HStack,{dir:n?"rtl":void 0,spacing:i?1:2,children:[e?(0,t.jsxs)(r.HStack,{spacing:i?1:2,children:[o,(0,t.jsx)(L.Button,{variant:"link",colorScheme:"gray",fontSize:"xxs",onClick:e,children:a})]}):(0,t.jsxs)(x.Text,{as:"span",display:"inline-flex",gap:2,fontSize:"xxs",children:[!i&&o,a]}),(0,t.jsx)(ew.InfoTip,{fontSize:i?"xxs":void 0,display:"block",lineHeight:"0",label:(0,t.jsx)(w.Trans,{message:"Add a logo to your theme to have it appear here",id:"ek68m3"})})]})});var eO=e.i(80192),eB=e.i(157048);e.i(144786);var ez=e.i(218378);let eF=({preferDark:e=!1})=>{let t=(0,A.useAppSelector)(E.selectTheme),i=(0,k.useFeatureFlag)("lightDarkLogos");return(0,S.useMemo)(()=>(0,ez.getThemeLogoImageAndSrc)(t,{mode:i?e?"dark":"light":void 0,fallbackToDefault:!0}),[t,e,i])};e.s(["useGetThemeLogo",0,eF],305573);let eH=({position:e,element:i,onUpdate:n,showUpsell:a,isReadonly:r})=>{let o=(0,q.useRtlEnabled)(),{logoSrc:s}=eF({preferDark:!1}),l=(0,A.useAppSelector)(E.selectTheme),d=(0,eB.useThemeEditAction)(),{flex:c}=(0,T.getAlignmentsForMarginElement)(e),u=(0,S.useMemo)(()=>i?.type==="themeLogo"&&"imageSize"in i?i.imageSize:void 0,[i]),p=(0,S.useCallback)(e=>{n({type:"themeLogo",imageSize:e})},[n]),h=(0,S.useCallback)(()=>{"edit"===d?(0,eO.openThemeEditorWithCurrentTheme)({theme:l}):"fork"===d&&(0,eO.openThemeEditorWithNewFork)({theme:l,sourceThemeInfo:{themeId:l.id,workspaceId:l.workspaceId,source:"card_margins_logo"}})},[l,d]);return(0,t.jsx)(U.Flex,{justifyContent:c,dir:o?"rtl":void 0,gap:2,w:"100%",children:s?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ev.Image,{h:eI[u||"md"]||7,maxW:"100%",objectFit:"contain",src:s,alt:H.i18n._({id:"iG7KNr",message:"Logo"}),bg:r?void 0:"blackAlpha.100"}),!r&&(0,t.jsx)(eP,{currentSize:u,onSizeChange:p,isDisabled:a})]}):(0,t.jsx)(eR,{onClick:a||r||"disabled"===d?void 0:h})})},eW={text:{key:"text",icon:z.faFontCase,name:(0,t.jsx)(w.Trans,{message:"Text",id:"xeiujy"}),deleteLabel:(0,t.jsx)(w.Trans,{message:"Remove text",id:"JxxCHL"}),deleteToastLabel:(0,t.jsx)(w.Trans,{message:"Removed text",id:"AwHPSN"})},cardNumbers:{key:"cardNumbers",icon:z.faSquare1,name:(0,t.jsx)(w.Trans,{message:"Card numbers",id:"LMa4Y8"}),deleteLabel:(0,t.jsx)(w.Trans,{message:"Remove card numbers",id:"gVFDdv"}),deleteToastLabel:(0,t.jsx)(w.Trans,{message:"Removed card numbers",id:"aTqpEg"})},themeLogo:{key:"themeLogo",name:(0,t.jsx)(w.Trans,{message:"Theme logo",id:"zYGAMY"}),icon:z.faPalette,deleteLabel:(0,t.jsx)(w.Trans,{message:"Remove theme logo",id:"cty1ii"}),deleteToastLabel:(0,t.jsx)(w.Trans,{message:"Removed theme logo",id:"sa/uRd"})},image:{key:"image",name:(0,t.jsx)(w.Trans,{message:"Image upload",id:"yrBphF"}),icon:z.faImage,deleteLabel:(0,t.jsx)(w.Trans,{message:"Remove image upload",id:"lP18tl"}),deleteToastLabel:(0,t.jsx)(w.Trans,{message:"Removed image upload",id:"Aty05U"})}},eU=({selectedType:e,onSelect:n,canAdd:a,showUpsell:r,onUpsellClick:o})=>{if(!e&&a)return(0,t.jsx)(N.MenuGroup,{title:H.i18n._({id:"qmt9HO",message:"Add element"}),textAlign:"start",children:Object.values(eW).map(({key:e,icon:a,name:s})=>r?(0,t.jsx)(R.MenuItem,{value:e,onClick:o,icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:a,fixedWidth:!0}),bg:"trueblue.50",border:"1px solid white",_hover:{bg:"trueblue.50",borderColor:"trueblue.200"},_focus:{bg:"trueblue.50",borderColor:"trueblue.200"},mt:.5,children:(0,t.jsxs)(i.Box,{as:"span",display:"inline-flex",gap:3,w:"100%",children:[(0,t.jsx)(i.Box,{as:"span",flex:1,children:s}),(0,t.jsx)(ea.UpsellProductBadge,{canUseFeature:!1,productFeature:"card_margin_elements",alignSelf:"center"})]})},e):(0,t.jsx)(R.MenuItem,{value:e,onClick:()=>n(e),icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:a,fixedWidth:!0}),children:s},e))});if(!e)return null;let s=(0,t.jsx)(N.MenuGroup,{children:(0,t.jsx)(R.MenuItem,{onClick:()=>{n(e,!0)},color:"red.500",icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faTrash,fixedWidth:!0,fontSize:"sm"}),children:eW[e].deleteLabel})});return a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(et.MenuOptionGroup,{title:H.i18n._({id:"Nb1WK7",message:"Change element"}),textAlign:"start",value:e,type:"radio",children:Object.values(eW).map(({key:e,icon:a,name:r})=>(0,t.jsxs)(ee.MenuItemOption,{value:e,onClick:()=>{n(e)},children:[(0,t.jsx)(v.FontAwesomeIcon,{icon:a,fixedWidth:!0}),(0,t.jsx)(i.Box,{as:"span",ms:2,children:r})]},e))}),(0,t.jsx)(J.MenuDivider,{}),s]}):s},eV=ei.keyframes` 0% { transform: rotate(9deg); background: var(--chakra-colors-trueblue-100); } 10% { transform: rotate(-8deg); } 20% { transform: rotate(7deg); } 30% { transform: rotate(-6deg); } 40% { transform: rotate(5deg); } 50% { transform: rotate(-4deg); background: var(--chakra-colors-trueblue-100); } 60% { transform: rotate(3deg); } 70% { transform: rotate(-2deg); } 80% { transform: rotate(1deg); } 90% { transform: rotate(0deg); } 100% { transform: rotate(0deg); background: var(--chakra-colors-blackAlpha-50); } `,eG=(0,S.memo)(({selectedType:e,onSelect:i,shouldHighlight:n,canAdd:a,showUpsell:r,onUpsellClick:o})=>(0,t.jsxs)(P.Menu,{children:[e?(0,t.jsx)(D.MenuButton,{as:L.Button,variant:"ghost",size:"sm",color:"black",px:"2",rightIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faChevronDown,transform:"shrink-6"}),children:eW[e].name}):(0,t.jsx)(en.GammaTooltip,{label:(0,t.jsx)(w.Trans,{message:"Add element",id:"qmt9HO"}),isDisabled:!a,placement:"top","aria-label":H.i18n._({id:"qmt9HO",message:"Add element"}),children:(0,t.jsx)(D.MenuButton,{as:j.IconButton,isDisabled:!a,size:"lg",variant:"ghost",fontSize:"2xl",transitionProperty:"all",transitionDuration:"normal",color:"gray.800",bg:"blackAlpha.50",animation:n?`${eV} 1.5s ease-in-out`:void 0,_hover:{bg:"trueblue.100",color:"trueblue.500"},icon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faPlus})})}),(0,t.jsx)(O.MenuList,{children:(0,t.jsx)(eU,{selectedType:e,onSelect:i,canAdd:a,showUpsell:r,onUpsellClick:o})})]}));eG.displayName="CardElementMenu";let e$=(0,S.memo)(({position:e,element:n,onUpdate:a,shouldHighlight:r,cardIndex:o,isObscured:s,isReadonly:l,isAddDisabled:d,showUpsell:c,onUpsellClick:u})=>{let h=(0,B.useToast)(),m=(0,q.useRtlEnabled)(),g=n?.type,f="text"===g,b="cardNumbers"===g,y=(0,S.useRef)(null),[v,C]=(0,S.useState)(f&&n?.content||""),w=(0,S.useCallback)(e=>{a({type:"text",content:e})},[a]),k=(0,er.useDebounced)(w,300),A=(0,S.useCallback)((e,t=!1)=>{a({type:e},t),("text"!==e||t)&&C(""),t&&h({title:eW[e].deleteToastLabel,status:"info",duration:2e3,position:"top"})},[a,h]),{flex:E,text:_}=(0,T.getAlignmentsForMarginElement)(e),I=(0,S.useMemo)(()=>b&&void 0!==o?(0,T.getCardNumberDisplayString)(o,n?.startIndex,n?.startNumber):"",[o,n,b]);return(0,t.jsx)(i.Box,{flex:1,children:(0,t.jsxs)(p.Stack,{spacing:1,alignItems:E,filter:s?"grayscale(1) blur(2px)":void 0,opacity:s?.5:1,pointerEvents:s?"none":void 0,userSelect:s?"none":void 0,children:[!l&&(0,t.jsx)(i.Box,{dir:m?"rtl":void 0,children:(0,t.jsx)(eG,{selectedType:g||null,onSelect:A,shouldHighlight:r,canAdd:!d,showUpsell:c,onUpsellClick:u})}),l&&(f||b)&&(0,t.jsx)(x.Text,{dir:m?"rtl":void 0,fontSize:"sm",noOfLines:1,children:f?n?.content||"":I}),!l&&f&&(0,t.jsx)(Q.Input,{dir:m?"rtl":void 0,ref:y,size:"sm",borderRadius:"md",bg:"white",fontSize:"sm",placeholder:H.i18n._({id:"6MDj8K",message:"Start typing..."}),value:v,maxLength:200,isDisabled:c,onKeyUp:e=>{c||"Enter"===e.key&&y.current?.blur()},onChange:e=>{if(c)return;let t=e.target.value;C(t),k(t)},textAlign:_}),!l&&b&&(0,t.jsx)(ey,{element:n,position:e,showUpsell:c,onUpdate:a}),"image"===g&&(0,t.jsx)(eN,{onUpdate:a,element:n,position:e,isReadonly:l,showUpsell:c}),"themeLogo"===g&&(0,t.jsx)(eH,{position:e,element:n,onUpdate:a,showUpsell:c,isReadonly:l})]})})});e$.displayName="EditableCardMarginElement";let eZ=(0,S.memo)(({visibilityLabel:e,isHidden:i,showToggleVisibilityButton:n,onToggleVisibility:a})=>(0,t.jsx)(Y,{label:e,children:n&&(0,t.jsx)(en.GammaTooltip,{label:i?(0,t.jsx)(w.Trans,{message:"Show on this card",id:"G/jP6i"}):(0,t.jsx)(w.Trans,{message:"Hide on this card",id:"Tx4/S/"}),placement:"top",children:(0,t.jsx)(j.IconButton,{variant:"plain",size:"lg",fontSize:"2xl",color:i?"red.600":"gray.600",icon:i?(0,t.jsx)(v.FontAwesomeIcon,{icon:y.faEyeSlash}):(0,t.jsx)(v.FontAwesomeIcon,{icon:y.faEye}),_hover:{color:"default"},"aria-label":i?H.i18n._({id:"WY1TVs",message:"Show card header and footer elements on card"}):H.i18n._({id:"xNpXQs",message:"Hide card header and footer elements on card"}),onClick:a})})}));eZ.displayName="MarginElementsVisibilityControls";let eK=(0,S.memo)(({isSingleCardView:e,isHiddenFirst:i,isHiddenLast:n,hasMarginElements:a,isHiddenOnCard:r})=>e?a?i?(0,t.jsx)(w.Trans,{message:'Hidden on first card. You can change this in "All cards"',id:"9weBGZ"}):n?(0,t.jsx)(w.Trans,{message:'Hidden on last card. You can change this in "All cards"',id:"Qxmjys"}):r?(0,t.jsx)(w.Trans,{message:"Hidden on this card",id:"+gYV7s"}):(0,t.jsx)(w.Trans,{message:"Visible on this card",id:"079GgA"}):(0,t.jsx)(w.Trans,{message:"Nothing to preview",id:"tb4e+E"}):(0,t.jsx)(w.Trans,{message:"All cards",id:"4upC5z"}));eK.displayName="VisibilityLabel";let eq=({editor:e,highlightPosition:i,cardNode:n,getPos:a,showUpsell:r})=>{let o=(0,Z.useAnalytics)(),{cardMarginSettings:s}=(0,A.useAppSelector)(E.selectDocSettingsWithDefaults),l=n?.attrs,d=!!n,c=!(0,T.hasNoCardMarginElements)(s),{isFirstCardAndHidden:u,isLastCardAndHidden:p,isHiddenByCardSettings:h}=(0,M.useCardMarginElementsVisibility)(l),m=d&&(u||p||h),g=(0,A.useAppSelector)(E.selectTopLevelCardIds),f=((e,t)=>{if(!e)return;let i=t.indexOf(e);return -1===i?void 0:i})(l?.id,g),b=(0,S.useCallback)(t=>{e.commands.updateDocumentSettings({cardMarginSettings:{...s,...t}})},[e,s]),x=(0,S.useCallback)(e=>(t,i=!1)=>{let n=s[e],a=!!(n?.type&&t.type&&t.type!==n.type);b({[e]:i?void 0:{...!a&&(n||{}),...t}}),o?.track($.SegmentEvents.CARD_MARGIN_SETTINGS_UPDATED,{elementType:t.type,position:e,action:i?"delete":a?"replace":"add"})},[o,s,b]),y=d&&!u&&!p&&c,v=(0,S.useCallback)(()=>{if(!n||!a)return;let t=a();if("number"==typeof t)try{e.commands.updateNestedAttributesAtPos(t,{cardMarginSettings:{...n.attrs.cardMarginSettings,isHidden:!n.attrs.cardMarginSettings.isHidden}})}catch(e){console.error("(caught) [CardMarginsBuilder](updateVisibility): could not update card",e)}},[n,e,a]),{openUpsellModal:C}=(0,V.useMonetizationContext)(),w=(0,S.useCallback)(()=>{C({segmentEvent:$.SegmentEvents.GAMMA_PRO_UPSELL_CARD_MARGINS,upsellLocation:"cardMargins",targetFeature:"card_margin_elements"})},[C]);return(0,t.jsxs)(U.Flex,{p:4,minH:"320px",bg:"gray.50",flexDirection:"column",justifyContent:"space-between",position:"relative",borderRadius:"md",...r&&!d&&{_before:(0,G.gradientBorderBeforeStyles)()},children:[(0,t.jsx)(U.Flex,{justifyContent:"space-between",gap:6,alignItems:"flex-start",dir:"ltr",children:["topLeft","topCenter","topRight"].map(e=>(0,t.jsx)(e$,{position:e,onUpdate:x(e),element:s[e],shouldHighlight:i===e,isReadonly:d,isObscured:m,cardIndex:f,showUpsell:r,onUpsellClick:w,isAddDisabled:r&&c},e))}),r&&!d?(0,t.jsx)(X,{onUpsellClick:w}):(0,t.jsx)(eZ,{visibilityLabel:(0,t.jsx)(eK,{isSingleCardView:d,isHiddenFirst:u,isHiddenLast:p,hasMarginElements:c,isHiddenOnCard:h}),isHidden:h,showToggleVisibilityButton:y,onToggleVisibility:v}),(0,t.jsx)(U.Flex,{justifyContent:"space-between",gap:6,alignItems:"flex-end",dir:"ltr",children:["bottomLeft","bottomCenter","bottomRight"].map(e=>(0,t.jsx)(e$,{position:e,onUpdate:x(e),element:s[e],shouldHighlight:i===e,isReadonly:d,isObscured:m,cardIndex:f,showUpsell:r,onUpsellClick:w,isAddDisabled:r&&c},e))})]})};var eY=e.i(819197),eX=e.i(78608);let eQ=(0,S.memo)(({hideFromFirst:e,hideFromLast:i,onUpdateSettings:n})=>(0,t.jsxs)(el.Popover,{placement:"bottom-end",children:[(0,t.jsx)(eu.PopoverTrigger,{children:(0,t.jsx)(L.Button,{leftIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:e||i?y.faEyeSlash:y.faEye}),rightIcon:(0,t.jsx)(v.FontAwesomeIcon,{icon:z.faChevronDown,transform:"shrink-6"}),size:"sm",variant:"plain",children:e&&i?(0,t.jsx)(w.Trans,{message:"First and last cards",id:"80NdhM"}):e?(0,t.jsx)(w.Trans,{message:"First card",id:"gidUuU"}):i?(0,t.jsx)(w.Trans,{message:"Last card",id:"vc1V76"}):(0,t.jsx)(w.Trans,{message:"All cards",id:"4upC5z"})})}),(0,t.jsx)(ec.PopoverContent,{w:"fit=content",minW:"200px",children:(0,t.jsx)(ed.PopoverBody,{p:3,children:(0,t.jsxs)(p.Stack,{children:[(0,t.jsx)(eX.SectionTitle,{mb:1,children:(0,t.jsx)(w.Trans,{message:"Display settings",id:"lLeEP7"})}),(0,t.jsx)(eY.Checkbox,{isChecked:e,onChange:e=>{n({hideFromFirst:e.target.checked})},children:(0,t.jsx)(x.Text,{fontSize:"sm",children:(0,t.jsx)(w.Trans,{message:"Hide on first card",id:"1UzO8k"})})}),(0,t.jsx)(eY.Checkbox,{isChecked:i,onChange:e=>{n({hideFromLast:e.target.checked})},children:(0,t.jsx)(x.Text,{fontSize:"sm",children:(0,t.jsx)(w.Trans,{message:"Hide on last card",id:"uGWhnt"})})})]})})})]}));eQ.displayName="DisplaySettingsPopover";let eJ=(0,S.memo)(({editor:e,isOpen:L,onClose:j,cardNode:P,getPos:D,highlightPosition:N})=>{let[R,O]=(0,S.useState)(0),{areElementsCurrentlyHiddenBySettings:B}=(0,M.useCardMarginElementsVisibility)(P?.attrs);(0,_.useEffectWhen)(()=>{L?B&&O(1):O(0)},[B,L],[L]);let z=(0,I.useCanUseCardMarginElementsProductFeature)(),F=(0,k.useFeatureFlag)("cardMarginElements"),{cardMarginSettings:H}=(0,A.useAppSelector)(E.selectDocSettingsWithDefaults),{hideFromFirst:U,hideFromLast:V}=H,G=(0,T.hasNoCardMarginElements)(H),$=!!P,Z=$||z,K=(0,S.useCallback)(t=>{e.commands.updateDocumentSettings({cardMarginSettings:{...H,...t}})},[e,H]),q=(0,S.useCallback)(()=>{let t={...void 0!==U?{hideFromFirst:U}:void 0,...void 0!==V?{hideFromLast:V}:void 0};e.commands.updateDocumentSettings({cardMarginSettings:t})},[U,V,e]);return F?(0,t.jsx)(C.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(o.Modal,{isOpen:!0,onClose:j,size:"3xl",blockScrollOnMount:!1,children:[(0,t.jsx)(u.ModalOverlay,{}),(0,t.jsxs)(d.ModalContent,{children:[(0,t.jsx)(c.ModalHeader,{children:(0,t.jsxs)(p.Stack,{spacing:1,children:[(0,t.jsx)(a.Heading,{size:"lg",children:(0,t.jsx)(w.Trans,{message:"Card headers & footers",id:"JQFgkZ"})}),(0,t.jsx)(x.Text,{fontSize:"md",fontWeight:500,letterSpacing:"normal",color:"gray.600",children:(0,t.jsx)(w.Trans,{message:"Add text, logos, card numbers and more",id:"F1uM5U"})})]})}),(0,t.jsx)(n.Divider,{}),(0,t.jsx)(l.ModalCloseButton,{}),(0,t.jsx)(s.ModalBody,{pb:"6",pt:Z?4:6,children:(0,t.jsxs)(b.Tabs,{variant:"soft-rounded",size:"sm",isLazy:!0,index:R,onChange:O,position:"relative",children:[(0,t.jsxs)(m.TabList,{position:"relative",sx:Z?{minH:8,mb:4}:void 0,children:[$&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(h.Tab,{children:(0,t.jsx)(w.Trans,{message:"All cards",id:"4upC5z"})}),(0,t.jsxs)(h.Tab,{children:[(0,t.jsx)(x.Text,{me:B?2:void 0,as:"span",children:(0,t.jsx)(w.Trans,{message:"This card",id:"xkzndo"})}),B&&(0,t.jsx)(i.Box,{color:"red.600",as:"span",children:(0,t.jsx)(v.FontAwesomeIcon,{icon:y.faEyeSlash})})]})]}),0===R&&z&&(0,t.jsxs)(r.HStack,{position:"absolute",justifyContent:"flex-end",insetEnd:"0",top:"0",children:[(0,t.jsx)(eQ,{hideFromFirst:U,hideFromLast:V,onUpdateSettings:K}),(0,t.jsx)(W,{onDelete:q,isDeleteDisabled:G,editor:e})]})]}),(0,t.jsxs)(f.TabPanels,{children:[(0,t.jsx)(g.TabPanel,{p:0,children:(0,t.jsx)(eq,{editor:e,highlightPosition:N,showUpsell:!z})}),(0,t.jsx)(g.TabPanel,{p:0,children:(0,t.jsx)(eq,{editor:e,highlightPosition:N,cardNode:P,getPos:D,showUpsell:!z})})]})]})})]})]})}):null});eJ.displayName="CardMarginsModal",e.s(["CardMarginsModal",0,eJ],48735)},47735,e=>{"use strict";var t=e.i(406112),i=e.i(191788);e.i(420945);var n=e.i(33823),a=e.i(328573);e.s(["useModalDisclosure",0,({id:e,...r})=>{let{isOpen:o,onOpen:s,onClose:l}=(0,t.useDisclosure)(r),d=(0,n.useDispatch)();return(0,i.useEffect)(()=>{e&&d((0,a.setModalOpen)({id:e,isOpen:o}))},[o,d,e]),(0,i.useEffect)(()=>()=>{e&&d((0,a.setModalOpen)({id:e,isOpen:!1}))},[d,e]),{isOpen:o,onOpen:s,onClose:l}}])},979041,460557,980655,547366,e=>{"use strict";var t=e.i(191788),i=e.i(47735);e.s(["useOpenCardMarginsModal",0,()=>{let{isOpen:e,onClose:n,onOpen:a}=(0,i.useModalDisclosure)({id:"card-margins-elements"}),[r,o]=(0,t.useState)();return{isCardMarginsModalOpen:e,onCloseCardMarginsModal:n,onOpenCardMarginsModal:a,positionToHighlight:r,setPositionToHighlight:o}}],979041);var n=e.i(776204),a=e.i(402261),r=e.i(974994),o=e.i(159080);let s=o.gql` mutation ExtractImageContent($input: ExtractImageContentInput!) { extractImageContent(input: $input) { viewBoxWidth viewBoxHeight backgroundImageUrl backgroundWidth backgroundHeight debugMaskedImageUrl elements { elementId elementType boundingBox { x y width height } imageUrl html fontSize blockCategory } processingTime cost rawProviderResponse } } `;e.s(["useExtractImageContent",0,()=>{let[e,i]=(0,t.useState)(null),[o,l]=(0,t.useState)(null),[d,{loading:c}]=(0,n.useMutation)(s,{onCompleted:e=>{i(e.extractImageContent),l(null)},onError:e=>{l(e),i(null)}});return{extract:(0,t.useCallback)(async({workspaceId:e,imageUrl:t,themeId:i,provider:n})=>{l(null);let o=(0,a.generateAIInteractionId)();return{...await d({variables:{input:{workspaceId:e,interactionId:o,imageUrl:t,themeId:i,provider:n}},context:(0,r.getAiMediaGraphqlContext)()}),interactionId:o}},[d]),isLoading:c,result:e,error:o}}],460557);var l=e.i(45652);let d=(0,t.createContext)(void 0);d.Provider;var c=e.i(476116);class u{renderedMap={main:!1};listeners={};subscribe(e,t){return this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t),()=>{try{if(!this.listeners[e])return;let i=this.listeners[e].indexOf(t);i>-1&&this.listeners[e].splice(i,1)}catch(e){}}}isRendered(e){return this.renderedMap[e]}onRendered(e){this.renderedMap[e]=!0,this.listeners[e]?.forEach(e=>e())}onEditorUnload(e){this.renderedMap[e]=!1,this.listeners[e]=[]}}let p=(0,c.default)(()=>new u),h=e=>{let[i,n]=(0,t.useState)(void 0===e||(p().isRendered(e)??!0));return(0,t.useEffect)(()=>{if(e)return p().subscribe(e,()=>{n(!0)})},[e]),i};e.s(["useOnEditorRendered",0,h],980655),e.s(["OnEditorRendered",0,({editorId:e,children:i})=>{let n=(0,l.useSSRMounted)(),a=(0,t.useContext)(d);return h(e||a)&&n?i:null}],547366)},697463,345100,787360,999792,99341,564665,814958,932970,22569,570203,179588,475641,61185,605737,e=>{"use strict";var t=e.i(391398),i=e.i(428683),n=e.i(613616);e.i(144786);var a=e.i(731378),r=e.i(418755),o=e.i(191788),s=e.i(275316),l=e.i(161385);class d extends l.EventEmitter{viewedCards={};cardViewedThreshold=s.featureFlags.get("cardViewedThreshold");initialize(){this.on("cardViewed",({cardId:e,interval:t})=>{this.viewedCards[e]=this.viewedCards[e]||0,this.viewedCards[e]+=t});let e=()=>{this.cardViewedThreshold=s.featureFlags.get("cardViewedThreshold")??5e3};s.featureFlags.subscribe("cardViewedThreshold",e),e()}flush(){let e={};for(let t in this.viewedCards){let i=this.viewedCards[t];i&&!(i{let[a,r]=(0,o.useState)(0),[s,l]=(0,o.useState)(!1),[d,u]=(0,o.useState)(0);return(0,o.useEffect)(()=>{let t=c.on("cardViewed",({cardId:t,interval:i})=>{e===t&&r(e=>e+i)}),i=c.on("flush",({viewed:t})=>{r(0),t[e]&&(l(!0),u(t[e]),setTimeout(()=>l(!1),2e3))});return()=>{t(),i()}},[e]),(0,t.jsxs)(i.Box,{...n,bg:s?"#c3313a":"#f5ae00",children:[!s&&(0,t.jsxs)(i.Box,{children:["time on card: ",Math.floor(a/1e3),"s"]}),s&&(0,t.jsxs)(i.Box,{children:["Tracked View: ",d,"s"]})]})};e.s(["CardDebugPanel",0,e=>{let o=(0,r.useAppSelector)(a.selectShowDebugCardView),{getPos:s,node:l}=e,{id:d}=l.attrs;if(!o)return null;let c=s(),p="number"==typeof c?c+l.nodeSize:void 0;return(0,t.jsxs)(n.Flex,{left:8,top:2,zIndex:"overlay",position:"absolute",pointerEvents:"none",opacity:.5,contentEditable:!1,children:[(0,t.jsx)(i.Box,{bg:"yellow",px:2,mr:2,borderRadius:"md",children:d}),(0,t.jsxs)(i.Box,{bg:"trueblue.200",px:2,mr:2,borderRadius:"md",children:["f:",c,"t:",p]}),(0,t.jsx)(u,{cardId:d,px:2,borderRadius:"md"})]})}],697463);var p=e.i(344233),h=e.i(887527),m=e.i(654656),g=e.i(524473),f=e.i(541075);e.i(828525);var b=e.i(896620),x=e.i(358280),y=e.i(408122),v=e.i(498817),C=e.i(198311),w=e.i(357126),S=e.i(39016),k=e.i(256077),A=e.i(26049),E=e.i(548079);function _(e,t){[...t].reverse().forEach(i=>{let n=e.getVariant(i);n&&(0,A.setTarget)(e,n),e.variantChildren&&e.variantChildren.forEach(e=>{_(e,t)})})}function I(){let e=!1,t=new Set,i={subscribe:e=>(t.add(e),()=>void t.delete(e)),start(i,n){(0,E.invariant)(e,"controls.start() should only be called after a component has mounted. Consider calling within a useEffect hook.");let a=[];return t.forEach(e=>{a.push((0,k.animateVisualElement)(e,i,{transitionOverride:n}))}),Promise.all(a)},set:i=>((0,E.invariant)(e,"controls.set() should only be called after a component has mounted. Consider calling within a useEffect hook."),t.forEach(e=>{var t,n;t=e,Array.isArray(n=i)?_(t,n):"string"==typeof n?_(t,[n]):(0,A.setTarget)(t,n)})),stop(){t.forEach(e=>{e.values.forEach(e=>e.stop())})},mount:()=>(e=!0,()=>{e=!1,i.stop()})};return i}e.i(350461);var M=e.i(677866),T=e.i(367631),L=e.i(274560),j=e.i(98155);let P=(0,C.motion)(p.IconButton),D=(0,C.motion)(i.Box),N={scale:[1,.92,1.06,1],rotate:[0,-5,3,0]},R={duration:.38,ease:[.34,1.56,.64,1],times:[0,.3,.65,1]},O={type:"spring",stiffness:400,damping:15},B={type:"spring",stiffness:500,damping:20,mass:.4},z={perspective:"400px",transformStyle:"preserve-3d"},F={position:"absolute",inset:0,display:"inline-flex",alignItems:"center",justifyContent:"center",backfaceVisibility:"hidden"},H=(0,o.memo)(function({mode:e,onChange:n}){let a,r="canvas"===e,s=(0,L.useGetStylesForHandleButtons)(),l=function(){M.hasReducedMotionListener.current||(0,T.initPrefersReducedMotion)();let[e]=(0,o.useState)(M.prefersReducedMotion.current);return e}(),d=(a=(0,w.useConstant)(I),(0,S.useIsomorphicLayoutEffect)(a.mount,[]),a),c=(0,o.useCallback)(()=>{l||d.start({...N,transition:R})},[d,l]),u=r?{...s,bg:"var(--chakra-colors-purple-500)",color:"var(--chakra-colors-white)",borderColor:"var(--chakra-colors-purple-600)",_hover:{background:"var(--chakra-colors-purple-600)"}}:s,p=(0,o.useCallback)(()=>{n(r?"fluid":"canvas"),c()},[r,n,c]),C=(0,t.jsxs)(m.VStack,{spacing:0,align:"start",children:[(0,t.jsx)(h.Text,{children:r?(0,t.jsx)(x.Trans,{message:"Canvas mode",id:"RApsVU"}):(0,t.jsx)(x.Trans,{message:"Fluid mode",id:"cbZcWj"})}),(0,t.jsx)(h.Text,{color:"gray.400",children:r?(0,t.jsx)(x.Trans,{message:"Switch to fluid",id:"0Gpaey"}):(0,t.jsx)(x.Trans,{message:"Switch to canvas",id:"wWtxZo"})})]});return(0,t.jsx)(b.GammaTooltip,{placement:"top",label:C,shouldWrapChildren:!0,children:(0,t.jsx)(P,{"aria-label":r?y.i18n._({id:"v2ZKGr",message:"Switch to fluid mode"}):y.i18n._({id:"YY5z6u",message:"Switch to canvas mode"}),onClick:p,alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",pointerEvents:"auto",...u,width:j.CARD_DRAG_HANDLE_HEIGHT,minWidth:j.CARD_DRAG_HANDLE_HEIGHT,height:j.CARD_DRAG_HANDLE_HEIGHT,borderRadius:"lg",paddingInline:0,transitionProperty:"background, color, border-color",transitionDuration:"250ms",animate:d,whileHover:l?void 0:{scale:1.04},whileTap:l?void 0:{scale:.97},transition:O,icon:(0,t.jsx)(i.Box,{position:"relative",width:"1em",height:"1em",display:"inline-flex",alignItems:"center",justifyContent:"center",style:z,children:(0,t.jsx)(v.AnimatePresence,{initial:!1,mode:"wait",children:r?(0,t.jsx)(D,{initial:!l&&{opacity:0,rotateY:90,scale:.6,y:-3},animate:{opacity:1,rotateY:0,scale:1,y:0},exit:l?{opacity:0}:{opacity:0,rotateY:-90,scale:.6,y:3},transition:l?{duration:.1}:B,style:F,children:(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faGrid2,fixedWidth:!0})},"canvas"):(0,t.jsx)(D,{initial:!l&&{opacity:0,rotateY:-90,scale:.6,y:3},animate:{opacity:1,rotateY:0,scale:1,y:0},exit:l?{opacity:0}:{opacity:0,rotateY:90,scale:.6,y:-3},transition:l?{duration:.1}:B,style:F,children:(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faAlignLeft,fixedWidth:!0})},"fluid")})})})})});e.s(["CardModeToggle",0,H],345100),e.s(["convertCardToCanvas",()=>Z],787360);var W=e.i(658729),U=e.i(85547);let V=new Set(["cardLayoutItem","gridLayout","gridCell"]),G=new Set(["image","mediaPlaceholder"]),$=new Set(["video","embed","graphic","gallery","smartLayout","smartDiagram","chart","graphyChart","drawing","diagram"]);function Z({editor:e,getPos:t}){var i,n,a;let r,o=t();if("number"!=typeof o)return{ok:!1,boxCount:0};let s=e.state.doc.nodeAt(o);if(!s||"card"!==s.type.name)return{ok:!1,boxCount:0};let l=s.firstChild;if(l&&("cardCanvasItem"===l.type.name||"cardImageItem"===l.type.name||"cardCodeItem"===l.type.name))return{ok:!1,boxCount:0};let d=e.view.nodeDOM(o),c=d instanceof HTMLElement?d:null,u=c?.querySelector("."+U.CARD_CONTENT_CLASS);if(!u)return{ok:!1,boxCount:0};let p=u.getBoundingClientRect();if(!p.width||!p.height)return{ok:!1,boxCount:0};let h=W.DEFAULT_VIEWBOX_WIDTH/p.width,m=p.width/p.height,g=function e(t,i){let n=[],a=null,r=()=>{a&&(n.push({kind:"text",children:a.children,childPositions:a.childPositions}),a=null)},o=i;return t.forEach(t=>{let i=o;o+=t.nodeSize;let s=t.type.name;if("cardNotes"===s)return void r();if(V.has(s)){r(),n.push(...e(t,i+1));return}if("cardAccentLayoutItem"===s)return"image"!==(t.attrs.background??{}).type?void r():(r(),void n.push({kind:"image",node:t,pos:i}));if(G.has(s)){r(),n.push({kind:"image",node:t,pos:i});return}if($.has(s)){r(),n.push({kind:"text",children:[t],childPositions:[i]});return}a||(a={children:[],childPositions:[]}),a.children.push(t),a.childPositions.push(i)}),r(),n}(s,o+1);if(0===g.length)return{ok:!1,boxCount:0};let f=[];for(let t of g){let i=function(e,t,i,n){let a=1/0,r=1/0,o=-1/0,s=-1/0;for(let i of"text"===t.kind?t.childPositions:[t.pos]){let t=e.view.nodeDOM(i),n=t instanceof Element?t:t?.parentElement??null;if(!n)continue;let l=n.getBoundingClientRect();(l.width||l.height)&&(l.lefto&&(o=l.right),l.bottom>s&&(s=l.bottom))}return isFinite(a)?{x:Math.round((a-i.left)*n),y:Math.round((r-i.top)*n),w:Math.round((o-a)*n),h:Math.round((s-r)*n)}:null}(e,t,p,h);i&&("text"===t.kind?f.push({type:"positionedContentBox",attrs:{x:i.x,y:i.y,w:i.w,h:i.h},content:t.children.map(e=>e.toJSON())}):f.push({type:"positionedImageBox",attrs:{x:i.x,y:i.y,w:i.w,h:i.h,image:function(e){if("cardAccentLayoutItem"===e.type.name){let t=e.attrs.background??{};return"image"===t.type&&t.image?{...t.image}:{}}return{...e.attrs}}(t.node)}}))}if(0===f.length)return{ok:!1,boxCount:0};let b=o+1,x=o+1+s.content.size,y=s.lastChild;return y&&"cardNotes"===y.type.name&&(x-=y.nodeSize),e.chain().insertContentAt({from:b,to:x},{type:"cardCanvasItem",attrs:{aspectRatio:m},content:f}).run(),i=e,n=o,a=m,r=W.DEFAULT_VIEWBOX_WIDTH/a,requestAnimationFrame(()=>{if(i.isDestroyed)return;let e=i.view.nodeDOM(n),t=e instanceof HTMLElement?e:null;if(!t)return;let a=t.querySelector(".positioned-boxes-wrapper");if(!a)return;let o=i.state.doc.nodeAt(n+1);if(o){let e=a.querySelectorAll(".positioned-box"),t=0;o.forEach(i=>{let n=e[t++];if(!n)return;let a=Math.max(0,Math.min(1,("number"==typeof i.attrs.y?i.attrs.y:0)/Math.max(r,1)));n.style.setProperty("--canvas-intro-delay",`${Math.round(700*a)}ms`)})}a.setAttribute("data-canvas-intro","true"),window.setTimeout(()=>{a.removeAttribute("data-canvas-intro"),a.querySelectorAll(".positioned-box").forEach(e=>e.style.removeProperty("--canvas-intro-delay"))},1700)}),{ok:!0,boxCount:f.length}}var K=e.i(335799),q=e.i(451910);let Y=[{key:"start",name:()=>y.i18n._({id:"Xl2IZ9",message:"Top align content"}),icon:g.faArrowUpToLine,description:()=>y.i18n._({id:"N0rIpR",message:"Good for documents"})},{key:"center",name:()=>y.i18n._({id:"7FOGnf",message:"Center align content"}),icon:g.faArrowsToLine,description:()=>y.i18n._({id:"3JV7Yt",message:"Best for most use cases"})},{key:"end",name:()=>y.i18n._({id:"H0UcZG",message:"Bottom align content"}),icon:g.faArrowDownToLine,description:()=>y.i18n._({id:"LcSMtc",message:"We're not gonna stop you"})}];e.s(["CardAlignment",0,({defaultAlignment:e,alignment:i,setAlignment:n})=>(0,t.jsx)(K.ButtonGroup,{isAttached:!0,size:"xs",display:"flex",children:Y.map(a=>{let r=i||a.key!==e?a.key===i?"trueblue.100":void 0:"trueblue.50";return(0,t.jsx)(b.GammaTooltip,{label:(0,t.jsx)(q.StackedTooltipText,{label:a.name(),description:a.description()}),placement:"top",children:(0,t.jsx)(p.IconButton,{"aria-label":a.name(),px:"2.5",boxShadow:"none",icon:(0,t.jsx)(f.FontAwesomeIcon,{icon:a.icon}),variant:"plain",bg:r,onClick:()=>{n(a.key)}})},a.key)})})],999792);var X=e.i(338538),Q=e.i(548402);let J={effect:"faded"},ee=e=>e&&(0,Q.isColorDark)(e)?.8:.85,et=e=>e.type===X.BackgroundType.IMAGE||!e.type;e.s(["BackgroundMask",0,({background:e,cardColor:n})=>{let a,{mask:r=J}=e;if(!et(e)||!((a=r)&&"none"!==a.effect))return null;let o=ee(n),s=n&&(0,Q.colorWithOpacity)(n,r.intensity??o),l=void 0!==r.intensity?Math.round(10*r.intensity):10,d=void 0!==r.intensity?Math.round(100+50*r.intensity):150,c={frosted:{backdropFilter:`blur(${l}px) saturate(${d}%)`,backgroundColor:"var(--card-color-mask)"},faded:{backgroundColor:"var(--card-color-mask)"}}[r.effect||"none"];return(0,t.jsx)(i.Box,{position:"absolute",inset:"0",borderRadius:"inherit",transitionProperty:"backdrop-filter, background",transitionDuration:"normal",style:s?{"--card-color-mask":s}:void 0,...c})},"DEFAULT_MASK",0,J,"backgroundSupportsMask",0,et,"getDefaultIntensity",0,ee],99341);var ei=e.i(969641),en=e.i(555145),ea=e.i(459014),er=e.i(864860),eo=e.i(918228);let es=({icon:e,customIcon:i,label:n,children:a,useSpacer:r=!0,...o})=>(0,t.jsxs)(eo.Stack,{direction:"row",spacing:4,alignItems:"center",...o,children:[e&&(0,t.jsx)(f.FontAwesomeIcon,{fixedWidth:!0,icon:e}),i&&i,(0,t.jsx)(h.Text,{children:n}),r&&(0,t.jsx)(er.Spacer,{}),a]});e.s(["CardStyleRow",0,es],564665),e.s(["CardAccentImageSelector",0,({editor:e,accentPos:i,cardId:n,hasAccentImage:a,displayLayout:r,setLayoutToBehind:s})=>{let l="blank"===r,d="behind"!==r&&!l,c=a&&!l,u=(0,o.useCallback)(()=>{i&&e.commands.updateAttributesAtPos(i,{background:{type:X.BackgroundType.NONE}})},[e,i]),h=(0,o.useCallback)(()=>{l&&s(),ea.eventEmitter.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:n})},[n,l,s]);return(0,t.jsx)(es,{label:d?(0,t.jsx)(x.Trans,{message:"Accent image",id:"e5Sy/T"}):(0,t.jsx)(x.Trans,{message:"Background image",id:"23c2Uw"}),icon:g.faImage,children:(0,t.jsxs)(en.HStack,{spacing:1,children:[(0,t.jsx)(ei.Button,{size:"sm",variant:"link",onClick:h,children:c?(0,t.jsx)(x.Trans,{message:"Edit",id:"ePK91l"}):(0,t.jsx)(x.Trans,{message:"+ Add",id:"PNapeY"})}),c&&(0,t.jsx)(b.GammaTooltip,{label:(0,t.jsx)(x.Trans,{message:"Remove accent image",id:"sGYCGx"}),placement:"top",children:(0,t.jsx)(p.IconButton,{"aria-label":y.i18n._({id:"sGYCGx",message:"Remove accent image"}),size:"sm",variant:"link",onClick:u,colorScheme:"red",icon:(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faImageSlash})})})]})})}],814958);var el=e.i(575084);e.s(["CardBackdropSelector",0,({editor:e,getPos:n,onAddOrEditClick:a,isDisabled:r,hasBackdrop:s})=>{let l=(0,o.useCallback)(()=>{let t=n();"number"==typeof t&&e.commands.updateAttributesAtPos(t,{background:{type:X.BackgroundType.NONE}})},[e,n]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(es,{icon:g.faPanorama,label:(0,t.jsx)(x.Trans,{message:"Backdrop",id:"ANn8Qe"}),color:r?"gray.500":void 0,children:[r&&(0,t.jsx)(b.GammaTooltip,{placement:"top",label:(0,t.jsx)(x.Trans,{message:"Full width hides the backdrop",id:"ZnOCf5"}),isDisabled:!r,children:(0,t.jsx)(i.Box,{fontSize:"sm",cursor:"help",children:(0,t.jsx)(f.FontAwesomeIcon,{fixedWidth:!0,icon:el.faEyeSlash})})}),(0,t.jsx)(en.HStack,{spacing:1,children:!r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ei.Button,{size:"sm",variant:"link",onClick:a,children:s?(0,t.jsx)(x.Trans,{message:"Edit",id:"ePK91l"}):(0,t.jsx)(x.Trans,{message:"+ Add",id:"PNapeY"})}),s&&(0,t.jsx)(b.GammaTooltip,{label:(0,t.jsx)(x.Trans,{message:"Remove backdrop",id:"IfZ6hd"}),placement:"top",children:(0,t.jsx)(p.IconButton,{"aria-label":y.i18n._({id:"IfZ6hd",message:"Remove backdrop"}),size:"sm",variant:"link",onClick:l,colorScheme:"red",icon:(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faImageSlash})})})]})})]})})}],932970);var ed=e.i(721455),ec=e.i(148318),eu=e.i(182895),ep=e.i(704273),eh=e.i(259658);e.i(676828),e.i(641099),e.i(572383);var em=e.i(686296),eg=e.i(551880);e.i(914911);var ef=e.i(812405);let eb=({value:e,onChange:i,cardColor:n})=>{let a=ee(n),[r,s]=(0,o.useState)(!1),l=Math.round(100*(e||a));return(0,t.jsx)(es,{label:(0,t.jsx)(x.Trans,{message:"Overlay intensity",id:"CMsMJp"}),icon:g.faEyeDropper,useSpacer:!1,children:(0,t.jsxs)(en.HStack,{spacing:.5,w:"140px",children:[(0,t.jsx)(h.Text,{fontSize:"xs",color:"gray.500",minW:"25px",children:"5%"}),(0,t.jsxs)(ef.Slider,{value:e||a,min:.1,max:.9,step:.1,onChange:i,onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),colorScheme:"trueblue",size:"sm",flex:1,children:[(0,t.jsx)(ef.SliderTrack,{children:(0,t.jsx)(ef.SliderFilledTrack,{})}),(0,t.jsx)(b.GammaTooltip,{placement:"top",isOpen:r,label:`${l}%`,children:(0,t.jsx)(ef.SliderThumb,{})})]}),(0,t.jsx)(h.Text,{fontSize:"xs",color:"gray.500",minW:"30px",children:"95%"})]})})};e.i(227909);var ex=e.i(397068);e.i(160396);let ey=[{label:()=>y.i18n._({id:"37VL/A",message:"Frosted"}),value:"frosted"},{label:()=>y.i18n._({id:"W4wYdx",message:"Faded"}),value:"faded"},{label:()=>y.i18n._({id:"siC4v8",message:"Clear"}),value:"none"}];e.s(["CardAccentBackgroundOverlaySelector",0,({editor:e,accentPos:i,accentBackground:n,effect:a,intensity:r,cardColor:s})=>{let l=(0,o.useCallback)(t=>{if(!i||!n)return;let a={background:{mask:{...n.mask,effect:t}}};e.commands.updateNestedAttributesAtPos(i,a)},[e,n,i]),d=(0,o.useCallback)(t=>{if(!i)return;let a={background:{mask:{...n?.mask??{effect:J.effect},intensity:t}}};e.commands.updateNestedAttributesAtPos(i,a)},[e,n,i]),c=a??J.effect,u=ey.find(e=>e.value===a)?.label()??(0,t.jsx)(x.Trans,{message:"Faded",id:"xg0y9o"});return(0,t.jsxs)(m.VStack,{spacing:3,align:"stretch",children:[(0,t.jsx)(es,{label:(0,t.jsx)(x.Trans,{message:"Overlay effect",id:"u4YODQ"}),icon:g.faCircleHalfStroke,children:(0,t.jsxs)(ed.Menu,{isLazy:!0,children:[(0,t.jsx)(ec.MenuButton,{as:ei.Button,variant:"plain",size:"sm",minW:"128px",boxShadow:"none",textAlign:"start",rightIcon:(0,t.jsx)(f.FontAwesomeIcon,{icon:el.faChevronDown,size:"xs",fixedWidth:!0}),children:u}),(0,t.jsx)(ep.MenuList,{children:(0,t.jsx)(eh.MenuOptionGroup,{value:c,type:"radio",onChange:l,children:ey.map(({value:e,label:i})=>(0,t.jsx)(eu.MenuItemOption,{value:e,children:i()},e))})})]})}),"none"!==a&&(0,t.jsx)(eb,{value:r,onChange:d,cardColor:s})]})}],22569);var ev=e.i(892194),eC=e.i(304521),ew=e.i(549022),eS=e.i(770127);let ek=({editor:e,attrs:t,getPos:i})=>{let n=(0,r.useAppSelector)(eg.selectTheme),a=(0,ex.getBackgroundColor)(t?.container?.background),o=(0,em.getThemeCardColorSolid)(n),s=(0,ex.getBackgroundCardColor)(t?.container?.background);return{currentColor:a,currentGradient:s?.type==="linear-gradient"?s:void 0,currentCardColor:s,themeCardColor:o,setCardColor:n=>{let a=i();if("number"!=typeof a||!t)return;let{container:r}=t,o=n?{background:{type:X.BackgroundType.COLOR,color:{hex:n}}}:{background:void 0};void 0!==r.isDark&&(o.isDark=void 0),e.commands.updateNestedAttributesAtPos(a,{container:{...r,...o}})},setCardGradient:n=>{let a=i();if("number"!=typeof a||!t)return;let{container:r}=t,o=n?{background:{type:X.BackgroundType.GRADIENT,gradient:n}}:{background:void 0};void 0!==r.isDark&&(o.isDark=void 0),e.commands.updateNestedAttributesAtPos(a,{container:{...r,...o}})}}};e.s(["useCardColorSelector",0,ek],570203),e.s(["CardColorSelector",0,({editor:e,attrs:n,getPos:a})=>{let{setCardColor:r,setCardGradient:s,currentColor:l,currentCardColor:d,themeCardColor:c}=ek({editor:e,attrs:n,getPos:a}),u=(0,ev.useColorModeValue)("gray.300","gray.600"),p=d?.type==="linear-gradient",m=!d,g=(0,o.useMemo)(()=>d?p?(0,eS.getGradientCss)(d):(0,em.getThemeColorSolid)(d):c,[d,p,c]),b=(0,o.useMemo)(()=>p?(0,t.jsx)(x.Trans,{message:"Gradient",id:"/S8bMP"}):m?(0,t.jsx)(x.Trans,{message:"Default",id:"ovBPCi"}):(0,eC.default)((0,em.getThemeColorSolid)(d)).toHexString(),[p,m,d]);return(0,t.jsx)(es,{icon:el.faFillDrip,label:n?.layout==="behind"?(0,t.jsx)(x.Trans,{message:"Overlay color",id:"cA3hQ0"}):(0,t.jsx)(x.Trans,{message:"Card color",id:"9d2iLQ"}),children:(0,t.jsxs)(ed.Menu,{isLazy:!0,children:[(0,t.jsx)(ec.MenuButton,{as:ei.Button,variant:"plain",size:"sm",boxShadow:"none",minW:"fit-content",textAlign:"start",rightIcon:(0,t.jsx)(f.FontAwesomeIcon,{fixedWidth:!0,icon:el.faChevronDown,size:"xs"}),children:(0,t.jsxs)(eo.Stack,{direction:"row",spacing:2,align:"center",children:[(0,t.jsx)(i.Box,{as:"span",alignSelf:"center",boxSize:5,borderRadius:"md",border:"2px solid",borderColor:u,bgColor:p?void 0:g,backgroundImage:p?g:void 0}),(0,t.jsx)(h.Text,{fontFamily:m||p?void 0:"mono",textTransform:m||p?void 0:"uppercase",fontSize:"sm",children:b})]})}),(0,t.jsx)(ep.MenuList,{overflow:"hidden",children:(0,t.jsx)(ew.ColorPickerMenuInner,{currentColor:p?null:l??null,setColor:r,source:"CardColor",includeGradients:!0,onSelectGradient:s,currentThemeColor:d})})]})})}],179588);let eA=[{key:"sm",name:()=>y.i18n._({id:"58+81B",message:"Narrow"}),buttonText:()=>y.i18n._({id:"ZQA8ce",message:"S"}),description:()=>y.i18n._({id:"LX+k3Q",message:"Good for social media"})},{key:"md",name:()=>y.i18n._({id:"ovBPCi",message:"Default"}),buttonText:()=>y.i18n._({id:"Tmu3kA",message:"M"}),description:()=>y.i18n._({id:"Of2q2s",message:"Good for documents and articles"})},{key:"lg",name:()=>y.i18n._({id:"I5S9ZE",message:"Wide"}),buttonText:()=>y.i18n._({id:"SMwD6s",message:"L"}),description:()=>y.i18n._({id:"nRirkB",message:"Good for presentations and websites"})}],eE=({contentWidth:e,defaultContentWidth:i,setWidth:n,allowedWidths:a=["sm","md","lg"]})=>(0,t.jsx)(K.ButtonGroup,{isAttached:!0,size:"xs",display:"flex",children:eA.filter(e=>a.includes(e.key)).map(a=>{let r=e||a.key!==i?a.key===e?"trueblue.100":void 0:"trueblue.50";return(0,t.jsx)(b.GammaTooltip,{label:(0,t.jsx)(q.StackedTooltipText,{label:a.name(),description:a.description()}),placement:"top",children:(0,t.jsx)(ei.Button,{"aria-label":a.name(),px:"2.5",boxShadow:"none",variant:"plain",bg:r,onClick:()=>{n(a.key)},children:a.buttonText()})},a.key)})});e.s(["CardContentWidthSelector",0,({editor:e,getPos:i,contentWidth:n})=>{let{defaultContentWidth:a}=(0,r.useAppSelector)(eg.selectDocSettingsWithDefaults),s=(0,o.useCallback)(t=>{let n=i();"number"==typeof n&&e.commands.updateNestedAttributesAtPos(n,{container:{width:t}})},[e,i]);return(0,t.jsx)(es,{icon:g.faArrowsLeftRightToLine,label:(0,t.jsx)(x.Trans,{message:"Card width",id:"cPp+Ef"}),children:(0,t.jsx)(eE,{setWidth:s,contentWidth:n,defaultContentWidth:a,allowedWidths:["md","lg"]})})}],475641);var e_=e.i(7820);e.s(["CardFullBleedSelector",0,({editor:e,getPos:i,isFullWidth:n})=>{let a=(0,o.useCallback)(()=>{let t=i();"number"==typeof t&&e.commands.updateAttributesAtPos(t,{cardSize:n?"contained":"full"})},[e,i,n]);return(0,t.jsx)(es,{icon:g.faRectangleWide,label:(0,t.jsx)(x.Trans,{message:"Full-bleed card",id:"BquNv8"}),children:(0,t.jsx)(e_.Switch,{isChecked:n,onChange:a})})}],61185);let eI=()=>(0,t.jsxs)("span",{className:"fa-layers fa-fw fa-sm",children:[(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faHorizontalRule,style:{top:"-1rem"}}),(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faHorizontalRule,style:{bottom:"-1rem"}}),(0,t.jsx)(f.FontAwesomeIcon,{icon:g.faRectangleWide})]});e.s(["CardMarginElementsSelector",0,({hasCardMarginElements:e,onAddOrEditClick:n,isHiddenByVisibilitySettings:a,isHiddenByCardSettings:r,onToggleVisibility:o})=>(0,t.jsx)(es,{customIcon:(0,t.jsx)(eI,{}),label:(0,t.jsx)(x.Trans,{message:"Card headers & footers",id:"JQFgkZ"}),children:(0,t.jsxs)(en.HStack,{spacing:1,children:[(0,t.jsx)(ei.Button,{size:"sm",variant:"link",onClick:n,colorScheme:"trueblue",children:(0,t.jsx)(x.Trans,{message:"Edit",id:"ePK91l"})}),a&&(0,t.jsx)(b.GammaTooltip,{label:(0,t.jsx)(x.Trans,{message:"Card header and footer elements are currently hidden on the first or last card",id:"gB9UFo"}),children:(0,t.jsx)(i.Box,{as:"span",color:"red.600",cursor:"help",children:(0,t.jsx)(f.FontAwesomeIcon,{fixedWidth:!0,icon:el.faEyeSlash})})}),!a&&e&&o&&(0,t.jsx)(b.GammaTooltip,{label:r?(0,t.jsx)(x.Trans,{message:"Hidden on this card",id:"+gYV7s"}):(0,t.jsx)(x.Trans,{message:"Visible on this card",id:"079GgA"}),placement:"top",children:(0,t.jsx)(p.IconButton,{size:"sm",variant:"ghost","aria-label":r?"Show card margins":"Hide card margins",color:r?"red.600":"gray.600",icon:(0,t.jsx)(f.FontAwesomeIcon,{icon:r?el.faEyeSlash:el.faEye}),onClick:o,_hover:{bg:r?"red.50":"gray.50"}})})]})})],605737)},279920,e=>{"use strict";var t=e.i(575329);e.s(["DrawerHeader",()=>t.ModalHeader])},405860,295595,383156,974952,429992,375101,913060,972133,509402,962272,136458,362129,e=>{"use strict";e.s(["CardStylingMenu",()=>eW],405860);var t=e.i(391398),i=e.i(969641),n=e.i(402818),a=e.i(555145),r=e.i(344233),o=e.i(382167),s=e.i(306841),l=e.i(882255),d=e.i(50034),c=e.i(935020),u=e.i(918228),p=e.i(887527),h=e.i(865080),m=e.i(620020),g=e.i(550530),f=e.i(524473),b=e.i(575084),x=e.i(541075);e.i(828525);var y=e.i(876533),v=e.i(896620),C=e.i(827911),w=e.i(358280),S=e.i(408122),k=e.i(191788),A=e.i(599350),E=e.i(875504),_=e.i(849187),I=e.i(469305),M=e.i(418755),T=e.i(873082),L=e.i(49202),j=e.i(551880),P=e.i(338538),D=e.i(261442),N=e.i(274560),R=e.i(267971),O=e.i(999792),B=e.i(854861),z=e.i(892684),F=e.i(99341),H=e.i(814958),W=e.i(932970),U=e.i(22569),V=e.i(179588),G=e.i(475641),$=e.i(61185),Z=e.i(372030),K=e.i(605737),q=e.i(564665),Y=e.i(913807),X=e.i(979504);e.s(["EditBackgroundDrawer",()=>eF,"useEditBackgroundDrawerDisclosure",()=>ez],429992);var Q=e.i(40317),J=e.i(531768),ee=e.i(52307),et=e.i(387451),ei=e.i(96953),en=e.i(281107),ea=e.i(279920),er=e.i(285256),eo=e.i(864860),es=e.i(406112);e.s(["ImageChatNarniaButton",()=>eu],295595);var el=e.i(584139),ed=e.i(103104),ec=e.i(558247);let eu=({onClick:e,image:n})=>{let{toggleBuddyChatPanel:a,isBuddyChatPanelOpen:r}=(0,el.useToggleBuddyChatPanel)();return(0,ec.useCanEditImageWithAI)(n)?(0,t.jsx)(i.Button,{size:"sm",variant:"special",leftIcon:(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faSparkles}),onClick:()=>{r||a(),e()},children:(0,t.jsx)(w.Trans,{message:"Edit with {AGENT_PROPER_NOUN}",id:"0aK6vE",values:{AGENT_PROPER_NOUN:ed.AGENT_PROPER_NOUN}})}):null};var ep=e.i(188407);let eh={base:"md","2xl":"lg"},em=()=>(0,ep.useGammaBreakpointValue)(eh);e.s(["useDrawerSize",0,em],383156);var eg=e.i(120604),ef=e.i(878917);e.i(185340);var eb=e.i(863750),ex=e.i(606004),ey=e.i(307591),ev=e.i(865799),eC=e.i(428683),ew=e.i(613616),eS=e.i(818315),ek=e.i(721455),eA=e.i(148318),eE=e.i(182895),e_=e.i(704273),eI=e.i(259658);e.i(144786);var eM=e.i(534904),eT=e.i(180939);let eL=k.default.memo(({currentSource:e,onChange:n,isValidSource:a})=>{let r=e?.image?.src,o=(0,_.useAllFeatureFlags)();return(0,t.jsxs)(ek.Menu,{children:[(0,t.jsx)(eA.MenuButton,{as:i.Button,w:"100%",textAlign:"start",rightIcon:(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faChevronDown}),leftIcon:r?(0,t.jsx)(eS.Image,{h:"1em",w:"1em",objectFit:"cover",src:r}):e?.icon?(0,t.jsx)(x.FontAwesomeIcon,{icon:e?.icon,color:"var(--chakra-colors-trueblue-600)",fixedWidth:!0}):void 0,mb:4,"data-testid":"media-drawer-menu-button",flexShrink:"0",children:(0,t.jsxs)(ew.Flex,{align:"center",overflow:"hidden",children:[(0,t.jsx)(eC.Box,{noOfLines:1,wordBreak:"break-all",overflowX:"hidden",textOverflow:"ellipsis",children:e?.label()||"Source"}),e&&(0,t.jsx)(ej,{source:e})]})}),(0,t.jsx)(c.Portal,{children:(0,t.jsx)(e_.MenuList,{zIndex:"modalPopover",maxH:"60vh",overflowY:"auto",pos:"relative","data-media-drawer-menu":!0,children:Object.entries(ef.MediaSources).map(([i,r])=>{let s=r.filter(e=>!(e.checkDisabled&&e.checkDisabled())&&!e.disabled&&(!e.featureFlag||!!o[e.featureFlag])&&a(e));return 0===s.length?null:(0,t.jsx)(eI.MenuOptionGroup,{title:ef.getMediaSourceGroupDisplayName[i]()??i,type:"radio",onChange:n,value:e?.key,children:s.map(e=>(0,t.jsx)(eE.MenuItemOption,{value:e.key,children:(0,t.jsx)(eP,{source:e})},e.key))},i)})})})]})});eL.displayName="MediaDrawerMenu";let ej=({source:e})=>{let{productFeature:i}=e,n=(0,eT.useCanUseProductFeature)(i??"ai_premium_models");return i?(0,t.jsx)(eM.UpsellProductBadge,{canUseFeature:n,productFeature:i,marginInlineStart:2,flexShrink:0}):null},eP=({source:e})=>{let{label:i,icon:n,image:a,badge:r,productFeature:o}=e,s=(0,eT.useCanUseProductFeature)(o??"ai_premium_models"),l=o&&!s;return(0,t.jsxs)(ew.Flex,{direction:"row",align:"center",children:[a?(0,t.jsx)(eS.Image,{display:"inline",marginInlineEnd:2,h:"1em",w:"1em",objectFit:"contain",src:a.src}):n?(0,t.jsx)(eC.Box,{display:"inline",marginInlineEnd:2,color:"trueblue.600",children:(0,t.jsx)(x.FontAwesomeIcon,{icon:n})}):(0,t.jsx)(t.Fragment,{}),i(),o&&(0,t.jsx)(eM.UpsellProductBadge,{canUseFeature:s,productFeature:o,marginInlineStart:2}),r&&!l&&(0,t.jsx)(ev.Badge,{marginInlineStart:2,colorScheme:"blue",children:r()})]})};e.s(["MediaDrawerMenu",0,eL],974952);let eD=(0,k.memo)(({editor:e,defaultMessage:i,isDark:n,setCurrentSourceKey:a,currentSourceKey:r,currentSource:o,updateCurrentBackground:s,currentBackground:l,isValidSource:d,editType:c="background",contextualTheme:u,defaultToNoBackgroundSource:p=!1,closeDrawer:h})=>{let{isInOfflineMode:m}=(0,ex.useHealthCheck)(),g=(0,k.useCallback)(e=>{let t=ef.MediaSourcesMap[e];t.backgroundType&&s({type:t.backgroundType,source:e,[t.backgroundType]:void 0})},[s]),f=(0,k.useCallback)(()=>g(r),[r,g]),b=(0,k.useCallback)(e=>{e===ef.NO_BACKGROUND_SOURCE_KEY&&g(ef.NO_BACKGROUND_SOURCE_KEY),a(e)},[a,g]),x=l.source||l.type!==P.BackgroundType.IMAGE?!l.source&&p?ef.NO_BACKGROUND_SOURCE_KEY:l.source:l.image?.source??void 0;(0,k.useEffect)(()=>{x&&ef.MediaSourcesMap[x]&&a(x)},[x,a]);let y=!!(m&&!o?.availableOffline),v=ef.MediaPanelsMap[r],C="themeBackground"===c?eb.SavedMediaContext.Theme:eb.SavedMediaContext.Doc;return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ey.OfflineInfoBox,{isInOfflineMode:y,description:(0,t.jsx)(w.Trans,{message:"Some background options will not be available until you reconnect.",id:"nfjtFu"}),mb:3,my:6}),(0,t.jsx)(eL,{isValidSource:d,onChange:b,currentSource:o}),o&&(0,t.jsx)(v,{closeDrawer:h,editor:e,updateAttributes:e=>{o.backgroundType&&(o.key===eg.ACCENT_IMAGE_SOURCE_KEY?s(e):s({type:o.backgroundType,[o.backgroundType]:{...e},source:r}))},currentAttributes:o.backgroundType?o.key===eg.ACCENT_IMAGE_SOURCE_KEY?l:l[o.backgroundType]||{}:{},resetToPlaceholder:f,editType:c,isDark:n,contextualTheme:u,savedMediaContext:C}),r===ef.NO_BACKGROUND_SOURCE_KEY&&i]})});eD.displayName="BackgroundPanel";let eN=({closeDrawer:e,editor:i,updateNestedAttributes:n,background:a,defaultMessage:r,isDark:o,isValidSource:s,defaultToNoBackgroundSource:l})=>{let{currentEditBackgroundDrawerSourceKey:d,setBackgroundDrawerSourceKeyAction:c}=(0,R.useDrawerSourceKey)(),u=ef.MediaSourcesMap[d],p=(0,k.useCallback)(e=>{u.key===eg.ACCENT_IMAGE_SOURCE_KEY?n({background:e}):n({background:{...e,accentId:void 0}})},[u?.key,n]),h=(0,k.useCallback)(e=>s?s(e)&&!!e.backgroundType:!!e.backgroundType,[s]);return(0,t.jsx)(eD,{closeDrawer:e,editor:i,isDark:o,isValidSource:h,defaultMessage:r,currentBackground:a,updateCurrentBackground:p,currentSourceKey:d,setCurrentSourceKey:c,currentSource:u,defaultToNoBackgroundSource:l})};var eR=e.i(485527),eO=e.i(98155),eB=e.i(267904);let ez=()=>{let{isOpen:e,onOpen:t,onClose:i}=(0,es.useDisclosure)(),[n,a]=(0,k.useState)(0),r=(0,k.useCallback)(e=>{t(),a(e)},[t]),o=(0,M.useAppDispatch)();return{openBackgroundTab:(0,k.useCallback)((e=!0)=>{e&&o((0,eB.resetBackgroundDrawerSourceKey)()),r(0)},[o,r]),openStylesTab:(0,k.useCallback)(()=>{r(1)},[r]),isOpen:e,onClose:i,tabIndex:n,setTabIndex:a}},eF=(0,k.memo)(function({editor:e,isOpen:i,onClose:n,background:r,updateNestedAttributes:o,tabIndex:s,setTabIndex:l,isAccentImageDrawer:d=!1}){let c=(0,eR.useForwardUndo)(e),u=(0,k.useCallback)(()=>{0!==s&&l(0),n()},[n,s,l]),p=em(),h=d?eO.getDefaultBackgroundDisplayText.accentImage():eO.getDefaultBackgroundDisplayText.cardBackground(),m=(0,k.useCallback)(e=>!d||e.backgroundType!==P.BackgroundType.NONE,[d]);return(0,t.jsx)(y.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(ee.Drawer,{trapFocus:!1,isOpen:i,placement:"right",onClose:u,size:p,blockScrollOnMount:!1,children:[(0,t.jsx)(er.DrawerOverlay,{background:"none"}),(0,t.jsxs)(en.DrawerContent,{onKeyDown:c,"data-in-editor-focus":!0,"data-edit-background-drawer":!0,"data-testid":"card-style-drawer",children:[(0,t.jsx)(ei.DrawerCloseButton,{}),(0,t.jsx)(ea.DrawerHeader,{fontSize:"x-large",children:(0,t.jsxs)(a.HStack,{me:7,children:[(0,t.jsx)(w.Trans,{message:"Media",id:"xYilR2"}),(0,t.jsx)(eo.Spacer,{}),r.type===P.BackgroundType.IMAGE&&r.image&&d&&(0,t.jsx)(eu,{onClick:u,image:r.image})]})}),(0,t.jsx)(et.DrawerBody,{overflowX:"hidden",sx:{scrollbarGutter:"stable"},display:"flex",flexDirection:"column",pt:0,children:(0,t.jsx)(eN,{closeDrawer:u,editor:e,updateNestedAttributes:o,background:r,defaultMessage:(0,t.jsxs)(Q.Alert,{children:[(0,t.jsx)(J.AlertIcon,{}),h]}),isDark:!1,isValidSource:m})})]})]})})}),eH=(0,k.memo)(({editor:e,getPos:r,attrs:s,accentBackgroundMaskEffect:l,accentBackgroundMaskIntensity:d,displayLayout:c,hasAccentImage:h,insideSideLayout:b,isNested:y,isFullBleed:v,contentWidth:T,cardDimensionsKey:D,editBackdrop:N,onOpenCardMarginsModal:z,cardColor:Q})=>{let J=(0,M.useAppDispatch)(),ee=(0,k.useCallback)(()=>{J((0,Y.closeCardMenu)())},[J]),{verticalAlign:et,presentBackdrop:ei}=(0,M.useAppSelector)(j.selectDocSettingsWithDefaults),{setBackgroundDrawerSourceKeyAction:en}=(0,R.useDrawerSourceKey)(),ea=(0,X.useSetLayout)({editor:e,getPos:r}),er=(0,k.useCallback)(()=>{ea("behind")},[ea]),eo={};try{let t=r();"number"==typeof t&&(eo=(0,B.getCardLayoutItemsFromResolvedPos)(e.state.doc.resolve(t)))}catch(e){console.error(`[CardStylingMenuInner] could not get layout items for card ${s.id}: ${e}`)}let es=(0,m.useToast)(),el=eo.accent?.pos||null,ed=eo.accent?.node.attrs.background,ec="none"!==s.background.type,eu="default"!==s.cardSize||ec||h||s.container.width||s.container.background||"blank"!==c||s.verticalAlign,ep="behind"===c&&h&&ed&&(0,F.backgroundSupportsMask)(ed),eh=(0,M.useAppSelector)(j.selectDocFormatKey),em=(0,_.useFeatureFlag)("cardMarginElements")&&"webpage"!==eh,{cardMarginSettings:eg}=(0,M.useAppSelector)(j.selectDocSettingsWithDefaults),ef=!(0,E.hasNoCardMarginElements)(eg),{isFirstCardAndHidden:eb,isLastCardAndHidden:ex,isHiddenByCardSettings:ey}=(0,A.useCardMarginElementsVisibility)(s),ev="fluid"===D||T,eC="fluid"===D||ec||ei,ew=(0,k.useCallback)(()=>{let i=r();if("number"!=typeof i)return;let n={};ec&&(n.background={type:P.BackgroundType.NONE,source:void 0}),n.cardSize=void 0,n.verticalAlign=void 0,n.container={...s.container,width:void 0},s.container.background&&(n.container={...s.container,background:void 0}),"blank"!==c&&(n.layout="blank"),el?e.chain().updateAttributesAtPos(i,n).updateNestedAttributesAtPos(el,{background:{type:P.BackgroundType.NONE}}).run():e.commands.updateAttributesAtPos(i,n);let l=S.i18n._({id:"rQHMjX",message:"Removed all card styling"}),d=S.i18n._({id:"9uI/rE",message:"Undo"}),u=es({title:(0,t.jsxs)(a.HStack,{children:[(0,t.jsx)(p.Text,{children:l}),(0,t.jsx)(o.Link,{textDecoration:"underline",onClick:()=>{(0,C.undo)(e.state),es.close(u)},children:d})]}),status:"info",duration:3e3,position:"top"})},[ec,s.container,c,el,e,r,es]),eS=(0,k.useCallback)(()=>{let t=r();if("number"==typeof t)try{e.commands.updateNestedAttributesAtPos(t,{cardMarginSettings:{...s.cardMarginSettings,isHidden:!s.cardMarginSettings.isHidden}})}catch(e){console.error("(caught) [CardMarginsBuilder](updateVisibility): could not update card",e)}},[e,r,s.cardMarginSettings]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(u.Stack,{spacing:4,p:4,children:[(0,t.jsx)(Z.CardLayoutSelector,{editor:e,layout:c,getPos:r,edgeLayoutsEnabled:!b}),(0,t.jsx)(H.CardAccentImageSelector,{editor:e,accentPos:el,cardId:s.id,hasAccentImage:h,displayLayout:c,setLayoutToBehind:er}),ep&&(0,t.jsx)(U.CardAccentBackgroundOverlaySelector,{editor:e,accentBackground:ed,accentPos:el,effect:l,intensity:d,cardColor:Q}),(0,t.jsx)(V.CardColorSelector,{editor:e,attrs:s,getPos:r}),!y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.Divider,{my:"1"}),(0,t.jsx)($.CardFullBleedSelector,{editor:e,getPos:r,isFullWidth:v}),(0,t.jsx)(q.CardStyleRow,{icon:f.faAlignLeft,label:(0,t.jsx)(w.Trans,{message:"Content alignment",id:"vUBA/H"}),children:(0,t.jsx)(O.CardAlignment,{defaultAlignment:et,alignment:s.verticalAlign,setAlignment:t=>{let i=r();"number"==typeof i&&e.commands.updateAttributesAtPos(i,{verticalAlign:t})}})}),ev&&(0,t.jsx)(G.CardContentWidthSelector,{editor:e,getPos:r,contentWidth:T}),eC&&(0,t.jsx)(W.CardBackdropSelector,{editor:e,getPos:r,onAddOrEditClick:()=>{en(I.AI_IMAGE_SOURCE_KEY),N(!1)},hasBackdrop:ec,isDisabled:v}),em&&(0,t.jsx)(K.CardMarginElementsSelector,{hasCardMarginElements:ef,isHiddenByVisibilitySettings:!!(eb||ex),isHiddenByCardSettings:ey,onAddOrEditClick:()=>{z(),ee()},onToggleVisibility:eS})]})]}),(0,t.jsxs)(g.Wrap,{px:5,py:3,bg:"gray.50",mx:-1,mb:-1,justify:eu?"space-between":"center",alignItems:"center",borderBottomRadius:"xl",children:[eu&&(0,t.jsx)(g.WrapItem,{children:(0,t.jsx)(i.Button,{onClick:ew,variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faRotateLeft}),children:(0,t.jsx)(w.Trans,{message:"Reset styling",id:"6hU6uw"})})}),(0,t.jsx)(g.WrapItem,{children:(0,t.jsx)(i.Button,{onClick:()=>{ee(),L.TiptapEventBus.emit(L.EventBusEvent.OPEN_PAGE_SETUP,"cards")},variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faGear}),children:(0,t.jsx)(w.Trans,{message:"Page setup",id:"fvaOtb"})})})]})]})}),eW=(0,k.memo)(e=>{let{attrs:n,editor:o,getPos:u,onOpenCardMarginsModal:p,decorations:m}=e,{cardColor:g}=(0,z.useCardColorMode)(m),C=(0,N.useGetStylesForHandleButtons)(),A=(0,k.useRef)(null),E=(0,M.useAppSelector)((0,Y.selectCardMenuOpen)(n.id,"styling")),_=(0,M.useAppDispatch)(),I=(0,k.useCallback)(()=>{_((0,Y.closeCardMenu)())},[_]),L=(0,k.useCallback)(()=>{_((0,Y.toggleCardMenu)({cardId:n.id,menuType:"styling"}))},[_,n?.id]),{openBackgroundTab:j,...P}=ez(),R=(0,k.useCallback)(e=>{let t=u();"number"==typeof t&&(0,T.handleBackgroundResetOrUpdate)(o,t,e)},[o,u]);return(0,h.useOutsideClick)({ref:A,handler:e=>{if(!E)return;let t=e.target;if(t&&t instanceof Element){let e=t.closest(`[data-card-styles-menu-trigger="${n.id}"]`),i=!!t.closest(".chakra-modal__content-container")?.querySelector("[data-edit-background-drawer]"),a=!!t.closest("[data-media-drawer-menu]");if(e||i||a)return}I()}}),(0,t.jsxs)(y.DarkModeProvider,{isDark:!1,children:[(0,t.jsx)(a.HStack,{spacing:1,onClick:D.stopPropagation,contentEditable:!1,pointerEvents:"auto",children:(0,t.jsxs)(s.Popover,{isLazy:!0,returnFocusOnClose:!1,isOpen:E,onClose:I,closeOnBlur:!1,children:[(0,t.jsx)(v.GammaTooltip,{label:(0,t.jsx)(w.Trans,{message:"Card styling",id:"F153E+"}),placement:"top",shouldWrapChildren:!0,children:(0,t.jsx)(d.PopoverTrigger,{children:(0,t.jsx)(i.Button,{"data-card-styles-menu-trigger":n.id,as:r.IconButton,icon:(0,t.jsxs)(a.HStack,{spacing:1,children:[(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faPalette,fixedWidth:!0}),(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faChevronDown,size:"xs",fixedWidth:!0})]}),"aria-label":S.i18n._({id:"F153E+",message:"Card styling"}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...C,px:.5,onClick:L})})}),(0,t.jsx)(c.Portal,{children:(0,t.jsx)(l.PopoverContent,{"data-card-styles-menu":!0,ref:A,width:"360px",fontFamily:"body",fontSize:"sm",border:"none",children:(0,t.jsx)(eH,{...e,cardColor:g,editBackdrop:j,onOpenCardMarginsModal:p})})})]})}),(0,t.jsx)(eF,{editor:o,updateNestedAttributes:R,background:n.background,container:n.container,...P})]})});e.s(["EditCardStatus",()=>e3],972133);var eU=e.i(335799),eV=e.i(892194),eG=e.i(104855);e.i(734710);var e$=e.i(78387),eZ=e.i(468738),eK=e.i(186003),eq=e.i(929508);let eY=({interactionId:e,operation:i,instructions:n,RatingButtons:a=eK.CardRatingButtons})=>{let[r,o]=(0,k.useState)(null),s=(0,k.useCallback)((t,a,r)=>{(0,eq.trackEditCardFeedback)({feedback:a,tags:r,rating:t,interactionId:e,instructions:n,operation:i})},[e,n,i]),l=(0,k.useCallback)(t=>{o(t),(0,eq.trackEditCardRating)({rating:t,interactionId:e,operation:i,instructions:n})},[e,i,n]);return(0,t.jsx)(eK.ThumbsRating,{rating:r||void 0,setRating:l,RatingButtons:a,feedbackTags:eX,trackFeedback:s})},eX=[{key:"wrong-language",label:(0,t.jsx)(w.Trans,{message:"Wrong language",id:"R2Ly6h"})},{key:"wrong-layout",label:(0,t.jsx)(w.Trans,{message:"Wrong layout",id:"moXJSM"})},{key:"wrong-content",label:(0,t.jsx)(w.Trans,{message:"Wrong content",id:"AgLuGi"})},{key:"wrong-images",label:(0,t.jsx)(w.Trans,{message:"Wrong images",id:"IAt1qK"})},{key:"too-similar",label:(0,t.jsx)(w.Trans,{message:"Too similar",id:"Np7sCV"})},{key:"too-different",label:(0,t.jsx)(w.Trans,{message:"Too different",id:"/wLn3u"})},{key:"instructions",label:(0,t.jsx)(w.Trans,{message:"Didn't follow prompt",id:"Tq32Jp"})},{key:"other",label:(0,t.jsx)(w.Trans,{message:"Other",id:"/IX/7x"})}];e.s(["EditCardRating",0,eY],375101),e.s(["getNewCardAttrs",()=>e1,"replaceCardWithVariant",()=>e2],913060);var eQ=e.i(755453),eJ=e.i(240178),e0=e.i(103630);let e1=(e,t)=>({...e,...t,id:e.id}),e2=(e,t,i,n)=>{let a=(0,eQ.findChildren)(e.state.doc,e=>(0,e0.isCardNode)(e)&&e.attrs.id===t)[0];if(!a)return void console.warn("[useGenerateCard] Card not found. It may have been deleted while generating.");e.chain().setMeta("isEditCardVariant",!0).setMeta("cardNotesHandled",!0).insertContentAt({from:a.pos,to:a.pos+a.node.nodeSize},i).selectInsideCardBody(a.pos).run();let r=(0,j.selectTheme)((0,M.getStore)().getState());(0,eJ.lazyLoadAsyncJSONContent)({editor:e,content:i,theme:r,interactionId:n})},e3=({suggestions:e,cardId:n,isDark:o,editor:s})=>{let{color:l,bg:d}=(0,N.useGetColorsForDragHandle)(),c=(0,N.useGetStylesForHandleButtons)(),{status:u,variants:h,selected:m,loadingMessage:g,interactionId:y,instructions:C,operation:A}=e,E=(0,M.useAppDispatch)(),_=(0,k.useCallback)((e,t)=>{E((0,eG.selectCardVariant)({cardId:n,variantId:e})),e2(s,n,t,y)},[E,n,s,y]),I=(0,eZ.useAnalytics)(),T=(0,k.useCallback)(()=>{I?.track(e$.SegmentEvents.AI_CARD_VARIATION_KEPT,{cardId:n,variantId:m,isOriginal:h.find(e=>e.id===m)?.isOriginal,interactionId:y,source:"button"}),E((0,eG.removeCardSuggestions)({cardId:n}))},[E,n,m,I,h,y]),L=(0,eV.useColorModeValue)("trueblue.500","trueblue.100"),j=(0,eV.useColorModeValue)("trueblue.50","gray.600"),P=(0,eV.useColorModeValue)("red.100","red.700"),D=(0,eV.useColorModeValue)("red.500","red.100");return(0,t.jsx)(a.HStack,{contentEditable:!1,userSelect:"none",align:"center",position:"absolute",left:"50%",transform:"translateX(-50%)",marginLeft:-3,pointerEvents:"auto",spacing:2,children:"loading"===u?(0,t.jsxs)(a.HStack,{borderWidth:"1px",...c,pointerEvents:"none",children:[(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faSparkles}),(0,t.jsxs)(p.Text,{children:[g||(0,t.jsx)(w.Trans,{message:"Working on it",id:"RQqcwV"}),"..."]})]}):"error"===u?(0,t.jsxs)(a.HStack,{borderWidth:"1px",...c,_hover:{},bg:P,color:D,children:[(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faWarning}),(0,t.jsx)(p.Text,{children:(0,t.jsx)(w.Trans,{message:"Something went wrong",id:"nwtY4N"})}),(0,t.jsx)(r.IconButton,{"aria-label":S.i18n._({id:"yz7wBu",message:"Close"}),size:"xs",minW:4,minH:4,h:4,isRound:!0,variant:"ghost",onClick:T,icon:(0,t.jsx)(x.FontAwesomeIcon,{icon:f.faTimes}),colorScheme:o?"white":"blackAlpha"})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(eU.ButtonGroup,{spacing:"-1px",children:[h.map(e=>(0,t.jsx)(i.Button,{...c,color:m===e.id?L:l,bg:m===e.id?j:d,variant:m===e.id?"plainSelected":"plain",onClick:()=>_(e.id,e.card),position:"relative",children:e.label},e.id)),(0,t.jsx)(v.GammaTooltip,{label:(0,t.jsx)(w.Trans,{message:"Done editing",id:"MuX+Gc"}),placement:"top",children:(0,t.jsx)(r.IconButton,{...c,icon:(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faCheck}),"aria-label":S.i18n._({id:"MuX+Gc",message:"Done editing"}),onClick:T})})]}),y&&(0,t.jsx)(eY,{interactionId:y,operation:A?.key,instructions:C})]})})};e.s(["BuddyCardImageEditDropdownMenu",()=>ts],962272);var e5=e.i(663025),e4=e.i(792276),e6=e.i(324886),e9=e.i(395993),e8=e.i(178428),e7=e.i(311996),te=e.i(82050),tt=e.i(35585),ti=e.i(257549),tn=e.i(372764),ta=e.i(391736);e.i(988162);var tr=e.i(71259);let to=({editor:e,getImageItemPos:t,imageItemNode:i})=>{let n=(0,M.useAppStore)(),a=(0,e6.useAIInteraction)("card-image-item-retry"),[r,o]=(0,k.useState)(!1);return{regenerate:(0,k.useCallback)(async()=>{if(r)return;o(!0);let s=a.current.start();try{let a=i;if(!a){let i=t();void 0!==i&&(a=e.state.doc.nodeAt(i))}if(!a)throw Error("Card image item node not found");let r=(0,ti.nullthrows)((0,tr.getNodeImageAttrs)(a),"Image attrs not found"),o=n.getState(),l=(0,ti.nullthrows)((0,te.selectDocId)(o),"docId is undefined"),d=(0,ti.nullthrows)((0,tt.selectCurrentWorkspaceId)(o),"current workspaceId is undefined"),{prompt:c="",model:u="",stylePreset:p="",aspectRatio:h="",artStylePreset:m,artStylePrompt:g}=r.aiParams??{};s.setAttributes({input:{prompt:c,model:u,stylePreset:p,aspectRatio:h,artStylePreset:m,artStylePrompt:g}});let f=(0,ta.generateMediaId)();e.commands.updateNestedAttributesAtPos((0,ti.nullthrows)(t(),"getImageItemPos returned undefined"),(0,tr.mergeImageAttrs)(a,{uploadStatus:null,loadImageStatus:"queued",loadImageId:f}));let b=await (0,e7.loadImageCardFromAttrsAndContext)({context:{docId:l,workspaceId:d,interactionId:s.id,traceparent:s.traceparent,imageStore:new e9.StreamImageSearchStore,theme:(0,j.selectTheme)(o),cardDimensions:(0,tn.getDocSettingFromDocument)(e.state.doc,"cardDimensions")},imageAttrs:r,loadImageId:f}),x=(0,ti.nullthrows)(t(),"getImageItemPos returned undefined"),y=(0,ti.nullthrows)(e.state.doc.nodeAt(x),`editor found no node at position ${x}`),v=e.chain().updateAttributesAtPos(x,(0,tr.mergeImageAttrs)(y,b));b.extraction&&(v=(0,e8.addPositionedTextboxesToChain)(v,e,x,b.extraction,{clearExisting:!0})),v.run(),s.complete({result:{savedMediaId:b.savedMediaId}})}catch(n){let i=t();if(void 0!==i){let t=e.state.doc.nodeAt(i);t&&e.commands.updateNestedAttributesAtPos(i,(0,tr.mergeImageAttrs)(t,{loadImageStatus:"error"}))}console.error("(caught) [useRegenerateCardImage] Error: ",n),s.error(n)}o(!1)},[e,t,i,r,a,n])}};e.s(["useRegenerateCardImage",0,to],509402);let ts=({attrs:e,editor:i,selectImage:n,getPos:o,node:s})=>{let l=(0,N.useGetStylesForHandleButtons)(),{isOpen:d,onOpen:c,onClose:u}=(0,es.useDisclosure)(),{regenerate:p}=to({editor:i,getImageItemPos:(0,k.useCallback)(()=>{let e=o(),t=(0,eQ.findChildren)(s,e0.isCardImageItemNode)[0];if("number"==typeof e&&t)return e+1+t.pos},[o,s])}),h=(({attrs:e,onRegenerateCard:t})=>{let{suggestions:i}=(0,e5.useSuggestImageEdits)(e),n=!!e.loadImageParams?.query;return(0,k.useMemo)(()=>{let e=[];return n&&e.push({key:"regenerate-actions",operations:[{key:"regenerate.imageCard",label:()=>S.i18n._({id:"zcgtoH",message:"Regenerate card"}),icon:b.faSparkles,onQuickAction:()=>{t()}}]}),e.push({key:"suggested",label:()=>S.i18n._({id:"nyQWMb",message:"Suggested"}),operations:i.map(e=>({key:e,label:()=>e,onQuickAction:t=>{t({message:S.i18n._({id:"ZI5Cdm",message:"Edit this image. {s}",values:{s:e}})})}}))}),e},[i,t,n])})({attrs:e,onRegenerateCard:(0,k.useCallback)(async()=>{await p()},[p])});return(0,t.jsx)(e4.BuddyChatPopover,{title:S.i18n._({id:"b0eJco",message:"Edit this image"}),placeholder:S.i18n._({id:"wm/Yby",message:"How would you like to edit this image?"}),isOpen:d,onOpen:c,onClose:u,editor:i,selectImage:n,trigger:(0,t.jsx)(v.GammaTooltip,{label:(0,t.jsx)(w.Trans,{message:"Edit with {AGENT_PROPER_NOUN}",id:"0aK6vE",values:{AGENT_PROPER_NOUN:ed.AGENT_PROPER_NOUN}}),placement:"top",children:(0,t.jsx)(r.IconButton,{"aria-label":S.i18n._({id:"0aK6vE",message:"Edit with {AGENT_PROPER_NOUN}",values:{AGENT_PROPER_NOUN:ed.AGENT_PROPER_NOUN}}),icon:(0,t.jsxs)(a.HStack,{spacing:1,children:[(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faSparkles,fixedWidth:!0}),(0,t.jsx)(x.FontAwesomeIcon,{icon:b.faChevronDown,size:"xs",fixedWidth:!0})]}),pointerEvents:"auto",...l,px:.5})}),placement:"bottom-start",actionGroups:h})};var tl=e.i(996651),td=e.i(843946),tc=e.i(775493),tu=e.i(704077),tp=e.i(112010),th=e.i(588183),tm=e.i(75495),tg=e.i(575329),tf=e.i(751827),tb=e.i(689130),tx=e.i(792565),ty=e.i(907839);let tv=()=>{let e=(0,k.useMemo)(()=>{let e=navigator.language.toLowerCase(),t=e.split("-")[0],i=tb.AI_LOCALE_OPTIONS.find(t=>t.key===e)??tb.AI_LOCALE_OPTIONS.find(e=>e.key===t);return i?.key},[]),[t,i]=(0,tx.useLocalStorage)(ty.USER_SETTINGS_CONSTANTS.generateLanguage,e??"en");return[(0,k.useMemo)(()=>tb.AI_LOCALE_OPTIONS.find(e=>e.key===t)??tb.AI_LOCALE_OPTIONS[0],[t]),i]},tC=(0,k.memo)(({locale:e,setLocale:n,buttonProps:a})=>{let[r,o]=(0,k.useState)([]);(0,k.useEffect)(()=>{o(t=>{if(tb.AI_LOCALE_OPTIONS.find(t=>t.key===e.key))return t;let i=[...t];return i.find(t=>t.key===e.key)||i.push(e),i})},[e.key]);let s=(0,k.useMemo)(()=>[...r,...(0,tb.getAiLocaleOptionsSorted)()],[r]);return(0,t.jsxs)(ek.Menu,{children:[(0,t.jsx)(eA.MenuButton,{as:i.Button,size:"sm",boxShadow:"sm",variant:"ghost",rightIcon:(0,t.jsx)(x.FontAwesomeIcon,{size:"xs",icon:f.faChevronDown}),leftIcon:(0,t.jsx)(x.FontAwesomeIcon,{size:"xs",icon:b.faLanguage}),minW:"150px",...a,children:e.displayName}),(0,t.jsx)(c.Portal,{children:(0,t.jsx)(e_.MenuList,{minWidth:"240px",maxH:"290px",overflowY:"auto",overflowX:"hidden",zIndex:"tooltip",children:(0,t.jsx)(eI.MenuOptionGroup,{value:e.key,title:S.i18n._({id:"vXIe7J",message:"Language"}),type:"radio",onChange:e=>{n(e)},children:s.map(e=>(0,t.jsx)(eE.MenuItemOption,{value:e.key,children:(0,t.jsxs)(u.Stack,{spacing:0,children:[(0,t.jsx)(p.Text,{children:e.displayName}),(0,t.jsx)(p.Text,{as:"span",color:"gray.500",fontSize:"sm",children:e.displayNameLocalized()})]})},e.key))})})})]})});tC.displayName="AILocalePicker",e.s(["AILocalePicker",0,tC,"useRememberAILocale",0,tv],136458),e.s(["TranslateModal",0,({isAdminView:e=!1,isFullDoc:n,isSite:a,onClose:r,startTranslation:o})=>{let[s]=tv(),[l,d]=(0,k.useState)(s);return(0,t.jsx)(y.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(tc.Modal,{isOpen:!0,onClose:r,children:[(0,t.jsx)(tf.ModalOverlay,{}),(0,t.jsxs)(th.ModalContent,{children:[(0,t.jsx)(tg.ModalHeader,{children:(0,t.jsx)(ew.Flex,{alignItems:"center",mr:8,children:a?(0,t.jsx)(w.Trans,{message:"Translate page",id:"56Urwv"}):n?(0,t.jsx)(w.Trans,{message:"Translate {GAMMA_ARTIFACT_PROPER_NOUN}",id:"e2vVXR",values:{GAMMA_ARTIFACT_PROPER_NOUN:ed.GAMMA_ARTIFACT_PROPER_NOUN}}):(0,t.jsx)(w.Trans,{message:"Translate card",id:"DLQ7Yc"})})}),(0,t.jsx)(tp.ModalCloseButton,{}),(0,t.jsxs)(tu.ModalBody,{children:[(0,t.jsx)(p.Text,{mb:4,children:a?(0,t.jsx)(w.Trans,{message:"Translate this entire page to another language using advanced AI models.",id:"dZwNdR"}):n?(0,t.jsx)(w.Trans,{message:"Translate this {GAMMA_ARTIFACT_PROPER_NOUN} to another language using advanced AI models.",id:"6YnROT",values:{GAMMA_ARTIFACT_PROPER_NOUN:ed.GAMMA_ARTIFACT_PROPER_NOUN}}):(0,t.jsx)(w.Trans,{message:"Translate this card to another language using advanced AI models.",id:"WQFlqR"})}),(0,t.jsxs)(tl.FormControl,{children:[(0,t.jsx)(td.FormLabel,{children:(0,t.jsx)(p.Text,{fontSize:"14px",children:(0,t.jsx)(w.Trans,{message:"Translate to...",id:"3LIgcv"})})}),(0,t.jsx)(tC,{buttonProps:{variant:"plain",justifyContent:"flex-start",textAlign:"left",width:"100%"},locale:l,setLocale:e=>{d((0,tb.getAILocale)(e))}})]}),e&&(0,t.jsx)(ew.Flex,{mt:4,children:(0,t.jsxs)(Q.Alert,{status:"warning",children:[(0,t.jsx)(J.AlertIcon,{}),"You're using the translation feature as an admin in the PUBLIC_STATIC editor. Translations made here will not be persisted to the database and are intended for admin review process only."]})})]}),(0,t.jsx)(tm.ModalFooter,{children:(0,t.jsxs)(eU.ButtonGroup,{children:[(0,t.jsx)(i.Button,{variant:"ghost",colorScheme:"gray",onClick:r,color:e?{color:"orange.500"}:void 0,_hover:e?{bg:"orange.100"}:void 0,children:(0,t.jsx)(w.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(i.Button,{variant:"solid",bg:e?"orange.500":void 0,_hover:{bg:e?"orange.700":void 0},onClick:()=>o(l),children:(0,t.jsx)(w.Trans,{message:"Translate",id:"pi8x/S"})})]})})]})]})})}],362129)},15464,e=>{"use strict";var t=e.i(191788);e.i(420945);var i=e.i(33823),n=e.i(418755),a=e.i(267158);e.i(24316);var r=e.i(853361);e.s(["useTogglePanel",0,(e,o=!0)=>{let s=(0,n.useAppStore)(),l=e.panelPosition,d=(0,i.useDispatch)(),c=(0,n.useAppSelector)((0,r.selectIsPanelComponentOpen)(e)),u=(0,t.useCallback)(()=>{d((0,r.initializePanel)({component:e}))},[e,d]);return(0,a.useEffectWhen)(()=>{!o&&c&&d((0,r.closePanel)({position:l}))},[c,d,o,l],[o]),{togglePanel:(0,t.useCallback)(t=>{if(!o)return;let i=!0;e.canClose&&(i=e.canClose(s));let n=!c;t?.override==="open"?n=!0:t?.override==="closed"&&(n=!1),n?d((0,r.openPanel)({component:e,disableTransition:t?.disableTransition,isResizable:t?.isResizable,props:t?.props})):i&&d((0,r.closePanel)({position:l}))},[e,d,o,c,l,s]),initPanel:u,isPanelOpen:c}}])},455784,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.sanitize=i.isValidEmailDomain=i.VALID_EMAIL_REGEX=i.URL_REGEX=i.HTML_REGEX=void 0,i.HTML_REGEX=/<[^>]*(>|$)/gi,i.URL_REGEX=/\b((?:https?:(?:\/{1,3}|[a-z0-9%])|[a-z0-9.-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|Ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)\/)(?:[^\s()<>{}[\]]+|\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\))+(?:\([^\s()]*?\([^\s()]+\)[^\s()]*?\)|\([^\s]+?\)|[^\s`!()[\]{};:'".,<>?«»“”‘’])|(?:(?()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/,i.isValidEmailDomain=e=>!!e&&/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/.test(e),i.sanitize=e=>{let t=[i.HTML_REGEX,i.URL_REGEX,i.VALID_EMAIL_REGEX];if(!e)return e;let n=e;for(let e of t)n=n.replace(e,"");return n}},447487,681442,828260,86010,495084,873463,672887,247879,976188,647477,168578,173953,995505,909875,516456,940818,432523,15185,144052,689525,206474,855795,149452,119831,501098,908613,367369,447143,382818,309623,e=>{"use strict";e.s(["SwitchingCardAIMenu",()=>tE],447487);var t=e.i(391398),i=e.i(755453),n=e.i(191788),a=e.i(745914),r=e.i(849187),o=e.i(962272),s=e.i(103630),l=e.i(969641),d=e.i(555145),c=e.i(344233),u=e.i(406112),p=e.i(575084),h=e.i(541075);e.i(828525);var m=e.i(896620),g=e.i(358280),f=e.i(408122),b=e.i(362129),x=e.i(606004),y=e.i(584139),v=e.i(792276),C=e.i(343094),w=e.i(192094),S=e.i(413399),k=e.i(690310),A=e.i(103104),E=e.i(418755);e.i(734710);var _=e.i(78387),I=e.i(274560),M=e.i(15464),T=e.i(335799),L=e.i(24790),j=e.i(613616),P=e.i(887527),D=e.i(892194),N=e.i(524473);e.i(314572);var R=e.i(133350),O=e.i(636339),B=e.i(723641),z=e.i(955312),F=e.i(835128),H=e.i(127050),W=e.i(23917),U=e.i(389928),V=e.i(783197),G=e.i(440721),$=e.i(241908),Z=e.i(430378),K=e.i(529232);e.s(["Contributors",()=>em],86010);var q=e.i(175863),Y=e.i(82050);e.i(838054);var X=e.i(408767),Q=e.i(767730),J=e.i(577281);e.s(["ContributorsThumbnailView",()=>eh,"ContributorsView",()=>ep],828260);var ee=e.i(314305),et=e.i(618067),ei=e.i(662727),en=e.i(367792),ea=e.i(601583),er=e.i(959022),eo=e.i(428683);let es=e=>(0,t.jsx)(eo.Box,{bg:"var(--body-color)",opacity:"0.4",borderRadius:"sm",...e});e.s(["ThumbnailSkeleton",0,es],681442);var el=e.i(188407);e.i(905506);var ed=e.i(45652),ec=e.i(194552),eu=e.i(864935);let ep=e=>{let i=(0,el.useGammaBreakpointValue)({base:4,md:8})||8,{node:a,decorations:r}=e,{showTime:o,hiddenContributorIds:s}=a.attrs,l=(0,E.useAppSelector)(Y.selectDocEditors),d=(0,n.useMemo)(()=>(l||[]).filter(e=>!s.includes(e.user.id)),[l,s]),c=(0,ed.useSSRMounted)(),u=(0,E.useAppSelector)(Y.selectDoc),p=u?.editedTime,h=(e=>{let[t,i]=(0,n.useState)(new Date),a=(0,n.useRef)(!1);return(0,n.useEffect)(()=>{a.current&&i(new Date),a.current=!0;let e=setInterval(()=>{i(new Date)},6e4);return()=>{clearInterval(e)}},[e]),t})(p).toISOString(),m=d.length-i,b=(0,eu.getAlignDirection)(r),x=e.node.attrs.horizontalAlign??("rtl"===b?"right":"left"),y=(0,n.useMemo)(()=>({left:"rtl"===b?"row-reverse":"row",center:"column",right:"rtl"===b?"row":"row-reverse"})[x],[b,x]);return(0,t.jsx)(t.Fragment,{children:d.length>0&&(0,t.jsx)(ec.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,t.jsxs)(j.Flex,{dir:b,userSelect:"none",contentEditable:!1,justify:"flex-start",align:"center",direction:y,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,children:[(0,t.jsxs)(ee.AvatarGroup,{sx:{".avatar-overflow-activator":{height:"1.6em",width:"1.6em",minH:"1.6em",minW:"1.6em",fontSize:"inherit",span:{fontSize:"0.68em"}}},children:[d.slice(0,i).map(e=>(0,t.jsx)(ei.TooltipAvatar,{width:"1.6em",height:"1.6em",fontSize:"inherit",size:"sm",shadow:"base",sx:{"@media print":{shadow:"none"}},borderWidth:"1px",name:e.user.displayName,label:c&&e.user.displayName?f.i18n._({id:"bxVoEp",message:"{0} edited {1} ago",values:{0:e.user.displayName,1:(0,ea.formatDateRelative)(e.lastEdited,h)}}):" ",src:e.user.profileImageUrl},e.user.id)),m>0&&(0,t.jsx)(et.AvatarOverflowList,{tooltipLabel:f.i18n._({id:"25VyZX",message:"See everyone"}),count:m,avatars:d.map(e=>({name:e.user.displayName||"",id:e.user.id,profileImageUrl:e.user.profileImageUrl||"",color:"white"})),disabled:!0})]}),(0,t.jsxs)(j.Flex,{direction:"column",marginInline:"0.5em",lineHeight:"1.4",textAlign:x,children:[(0,t.jsx)(P.Text,{className:"contributors-list",children:1===d.length?(0,t.jsx)(g.Trans,{message:"by {0}",id:"t490IT",values:{0:d[0].user.displayName}}):(0,t.jsx)(g.Trans,{message:"{0} Contributors",id:"KNjuGh",values:{0:d.length}})}),!en.config.GAMMA_PUPPETEER_SERVICE&&p&&o&&(0,t.jsx)(P.Text,{fontSize:"0.75em",children:c?(0,t.jsx)(g.Trans,{message:"Last edited {0} ago",id:"gUWkFH",values:{0:(0,ea.formatDateRelative)(p,h)}}):" "})]})]})})})},eh=e=>{let i=e.node.attrs.horizontalAlign??"left",a=(0,n.useMemo)(()=>({left:"row",center:"column",right:"row-reverse"})[i],[i]);return(0,t.jsx)(er.NodeViewWrapper,{children:(0,t.jsxs)(j.Flex,{direction:a,alignItems:"center",gap:"1em",children:[(0,t.jsx)(es,{borderRadius:"full",boxSize:"4em"}),(0,t.jsx)(es,{h:"2em",w:"14em"})]})})},em=(0,Q.createTiptapNode)("contributors",{selectable:!0,dynamic:!0,addCommands:()=>({toggleShowTime:()=>({commands:e,state:t})=>{let{selection:i}=t;if(!(i instanceof q.NodeSelection))return!1;let{node:n}=i;return"contributors"===n.type.name&&(e.updateAttributes("contributors",{showTime:!n.attrs.showTime}),!0)},toggleOneContributorVisibility:e=>({commands:t,state:i})=>{let n=(0,E.getStore)().getState(),a=(0,Y.selectDocEditors)(n);if(!a||1===a.length)return!1;let{selection:r}=i;if(!(r instanceof q.NodeSelection))return!1;let{hiddenContributorIds:o}=r.node.attrs,s=[];if(o.includes(e))s=o.filter(t=>t!==e);else{if(o.length+1===a.length)return!1;s=[...o,e]}return t.updateAttributes("contributors",{hiddenContributorIds:s}),!0},toggleAllContributorsVisibility:()=>({commands:e,state:t})=>{let i=(0,E.getStore)().getState(),n=(0,Y.selectDocEditors)(i);if(!n||1===n.length)return!1;let{selection:a}=t;if(!(a instanceof q.NodeSelection))return!1;let{hiddenContributorIds:r}=a.node.attrs,o=[];if(r.length>0)o=[];else{let e=(0,Y.selectDocCreator)(i);o=n.filter(t=>t.user.id!==e?.id).map(e=>e.user.id)}return e.updateAttributes("contributors",{hiddenContributorIds:o}),!0}}),parseHTML:()=>[{tag:"div[class=contributors]",getAttrs:e=>({hiddenContributorIds:(0,Q.parseJSONAttr)(e,"hiddenContributorIds"),...(0,Q.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"contributors",...(0,Q.renderJSONAttrs)(e.attrs,"hiddenContributorIds"),...(0,Q.renderHorizontalAlign)(e.attrs)})],addNodeView(){return this.editor.isThumbnail?(0,X.ReactNodeViewRenderer)(eh,{update:J.attrsOrDecorationsChanged}):(0,X.ReactNodeViewRenderer)(ep,{update:J.attrsOrDecorationsChanged})}});var eg=e.i(136484),ef=e.i(913060),eb=e.i(471259),ex=e.i(271910),ey=e.i(105970),ev=e.i(818315),eC=e.i(186003),ew=e.i(927835),eS=e.i(292632),ek=e.i(375101),eA=e.i(198889);let eE=n.default.memo(({isGenerating:e,id:i,isSelected:n,onClick:a,label:r,interactionId:o,children:s,isNestedCard:l})=>{let{ref:d,width:c}=(0,eS.useElementSize)();return(0,t.jsxs)(j.Flex,{ref:d,direction:"column",onClick:a,cursor:"pointer",position:"relative",w:"100%",my:2,css:{"--editor-width":`${c&&1!==c?c:365}px`,"--line-thickness":"1px"},minHeight:l?"auto":"150px",children:[e&&(0,t.jsx)(e_,{}),(0,t.jsxs)(j.Flex,{borderRadius:"md",border:"1px solid",borderColor:n?"trueblue.500":"gray.200",outline:n?"1px solid var(--chakra-colors-trueblue-500)":"none",_hover:{borderColor:n?"trueblue.600":"trueblue.300"},boxShadow:"md",overflow:"hidden",role:"group",visibility:e?"hidden":"visible",height:e?"0px":"auto",transitionProperty:"height border",transitionDuration:"0.2s",children:[!l&&(0,t.jsx)(j.Flex,{position:"absolute",top:4,insetEnd:4,bgColor:"trueblue.50",color:"trueblue.600",borderRadius:"md",px:2,py:1,zIndex:eA.BADGE_Z_INDEX,fontSize:"xs",border:"1px solid",borderColor:"trueblue.200",children:r}),"original"!==i&&!l&&(0,t.jsx)(j.Flex,{position:"absolute",insetEnd:4,bottom:4,zIndex:eA.BADGE_Z_INDEX,opacity:0,transitionProperty:"opacity",transitionDuration:"0.2s",_groupHover:{opacity:1},children:(0,t.jsx)(ek.EditCardRating,{interactionId:o||"",operation:"layout.different",RatingButtons:eC.ImageRatingButtons})}),(0,t.jsx)(ew.PreviewCard,{children:s})]})]})});eE.displayName="VariantCard";let e_=()=>(0,t.jsx)(j.Flex,{position:"absolute",inset:0,zIndex:1,w:"100%",h:"150px",minHeight:"150px",borderRadius:"md",align:"center",justify:"center",mb:4,children:(0,t.jsxs)(j.Flex,{bg:"gradient.secondary-light",h:"100%",borderRadius:"md",mx:4,align:"center",justify:"center",children:[(0,t.jsx)(ev.Image,{src:"/images/ai_sparkle_small.gif",alt:"AI sparkles",objectFit:"cover",width:282,height:280,boxSize:"45px",zIndex:1}),(0,t.jsx)(eo.Box,{bg:"gradient.secondary-light",bgSize:"cover",bgPosition:"center center",borderRadius:"inherit",pos:"absolute",inset:0,pointerEvents:"none",w:"100%",zIndex:0})]})}),eI=(0,n.createContext)({selectedCardId:"",selectedCardPos:void 0,interactionId:"",handleSelectVariant:()=>{}});function eM({value:e,children:i}){return(0,t.jsx)(eI.Provider,{value:e,children:i})}function eT(){return(0,n.useContext)(eI)}function eL({children:e,nodeProps:i,...a}){let r=(0,n.useMemo)(()=>(0,B.tiptapNodeView)({component:ey.CardNodeView,extension:ex.Card}),[]),{node:o}=i,{selectedCardId:s,interactionId:l,handleSelectVariant:d}=eT(),c=(0,E.useAppSelector)((0,eb.selectSelectedVariantId)(s)),u=(0,E.useAppSelector)((0,eb.selectVariants)(s)),p=!u.map(e=>e.id).includes(o.attrs.id);return(0,t.jsx)(eE,{...a,interactionId:l,isNestedCard:p,label:"original"===o.attrs.id?(0,t.jsx)(j.Flex,{children:(0,t.jsx)(P.Text,{children:(0,t.jsx)(g.Trans,{message:"Original",id:"HxF6Fk"})})}):p?null:(0,t.jsxs)(j.Flex,{align:"center",gap:1,children:[(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faSparkles,size:"xs"}),(0,t.jsx)(P.Text,{children:(0,t.jsx)(g.Trans,{message:"New",id:"isRobC"})})]}),isGenerating:u.find(e=>e.id===o.attrs.id)?.isGenerating??!1,id:o.attrs.id,isSelected:c===o.attrs.id,onClick:()=>{d(o.attrs.id,u)},children:(0,t.jsx)(r,{nodeProps:i,children:e})},o.attrs.id)}var ej=e.i(470645),eP=e.i(772177),eD=e.i(131526),eN=e.i(686296),eR=e.i(85547),eO=e.i(650292);let eB={src:e.i(24373).default,width:1,height:1,blurWidth:0,blurHeight:0},ez={src:e.i(115290).default,width:1,height:1,blurWidth:0,blurHeight:0},eF={src:e.i(47147).default,width:1,height:1,blurWidth:0,blurHeight:0},eH={src:e.i(770575).default,width:1,height:1,blurWidth:0,blurHeight:0},eW={src:e.i(826283).default,width:1,height:1,blurWidth:0,blurHeight:0},eU={src:e.i(888618).default,width:1,height:1,blurWidth:0,blurHeight:0},eV={src:e.i(897234).default,width:1,height:1,blurWidth:0,blurHeight:0},eG={src:e.i(618975).default,width:1,height:1,blurWidth:0,blurHeight:0},e$={src:e.i(684533).default,width:1,height:1,blurWidth:0,blurHeight:0},eZ={src:e.i(597096).default,width:1,height:1,blurWidth:0,blurHeight:0},eK={src:e.i(175197).default,width:1,height:1,blurWidth:0,blurHeight:0},eq={src:e.i(777616).default,width:1,height:1,blurWidth:0,blurHeight:0},eY={src:e.i(170819).default,width:1,height:1,blurWidth:0,blurHeight:0},eX={src:e.i(124856).default,width:1,height:1,blurWidth:0,blurHeight:0},eQ={src:e.i(190114).default,width:1,height:1,blurWidth:0,blurHeight:0},eJ={default:{name:()=>"Default",maskStyles:{left:void 0,right:void 0,top:void 0},fgStyles:{left:void 0,right:void 0,top:void 0}},fade:{name:()=>"Fade",maskStyles:{left:{maskImage:`url("${eZ.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"110%",marginRight:"-10%"},right:{maskImage:`url("${eK.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"110%",marginLeft:"-10%"},top:{maskImage:`url("${eq.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"110%"}},fgStyles:{left:{maxWidth:"90%",marginRight:"10%"},right:{maxWidth:"90%",marginLeft:"10%"},top:void 0}},diagonal:{name:()=>"Diagonal",maskStyles:{left:{maskImage:`url("${eV.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:`url("${eG.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:`url("${e$.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"80%",marginRight:"20%"},right:{maxWidth:"80%",marginLeft:"20%"},top:{maxHeight:"85%",marginBottom:"auto"}}},round:{name:()=>"Round",maskStyles:{left:{maskImage:`url("${eH.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:`url("${eW.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:`url("${eU.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"80%",marginRight:"20%"},right:{maxWidth:"80%",marginLeft:"20%"},top:void 0}},roundInverse:{name:()=>"Round Inverse",maskStyles:{left:{maskImage:`url("${eB.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"110%",marginRight:"-10%"},right:{maskImage:`url("${ez.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"110%",marginLeft:"-10%"},top:{maskImage:`url("${eF.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"112%"}},fgStyles:{left:{maxWidth:"90%",marginRight:"10%"},right:{maxWidth:"90%",marginLeft:"10%"},top:{maxHeight:"90%",marginBottom:"auto"}}},wiggle:{name:()=>"Wiggle",maskStyles:{left:{maskImage:`url("${eY.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:`url("${eX.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:`url("${eQ.src}")`,maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"94%",marginRight:"6%"},right:{maxWidth:"94%",marginLeft:"6%"},top:{maxHeight:"95%",marginBottom:"auto"}}}},e0="themed-clickable-box",e1={transitionProperty:"transform",transitionDuration:"normal"},e2={transform:"scale(1.03)",_before:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",boxShadow:"inset 0 0 0 500px var(--expandable-hover-background)",pointerEvents:"none"}},e3={border:"var(--shape-border-width) solid var(--neutral-border-color)",borderRadius:"var(--box-border-radius)",backgroundColor:"var(--clickable-background-color)",boxShadow:"var(--clickable-shadow)",backdropFilter:"var(--card-backdrop-filter)","@media print":{boxShadow:"none"}},e5=(e,t)=>({[`.${e0}`]:{...e1,...e3,_hover:t?void 0:e2,"@media print":{boxShadow:"none"}}});e.s(["CLICKABLE_BOX_CLASS",0,e0,"ClickableButtonSx",0,{_hover:{transform:"scale(1.1)"},color:"var(--link-color)",height:"auto",padding:"0.7em",paddingY:"0.2em",minW:"2.5em",position:"relative"},"ClickableHoverSx",0,e2,"ClickableTransitionSx",0,e1,"getBoxStylesheet",0,e5],495084);var e4=e.i(754851);let e6="themed-table",e9=()=>({[`.${e6}`]:e8,[`.is-first-row-comment-highlighted .${e6}`]:{"tbody tr:first-child td":{backgroundColor:"var(--comment-highlight-bg)"}}}),e8={border:"0.0625em solid var(--neutral-border-color)",borderRadius:"var(--box-border-radius)",'&[data-table-style="striped"] tbody tr':{_even:{backgroundColor:"blackAlpha.50"},_odd:{backgroundColor:"whiteAlpha.50"}},'&[data-table-style="bordered"] tbody tr':{borderBottom:"0.0625em solid var(--neutral-border-color)",_last:{borderBottom:"none"}},'&[data-table-style="bordered"] td':{borderInlineStart:"0.0625em solid var(--neutral-border-color)",_first:{borderInlineStartWidth:"0"}},'&[data-table-style="horizontal"] tbody tr':{borderBottom:"0.0625em solid var(--neutral-border-color)",_last:{borderBottom:"none"}},'&[data-table-style="horizontal"] td':{borderInlineStart:"none"},'&[data-table-style="vertical"] td':{borderInlineStart:"0.0625em solid var(--neutral-border-color)",_first:{borderInlineStartWidth:"0"}},'&[data-table-style="none"]':{border:"none"},'&[data-table-style="none"] td':{borderInlineStart:"none"},'&[data-table-style="outer"] td':{borderInlineStart:"none"},"tbody tr":{_first:{td:{_first:{borderTopLeftRadius:"var(--box-border-radius)"},_last:{borderTopRightRadius:"var(--box-border-radius)"}}}},"tbody tr:last-child":{td:{_first:{borderBottomLeftRadius:"var(--box-border-radius)"},_last:{borderBottomRightRadius:"var(--box-border-radius)"}}},td:{borderInlineStart:"0.0625em solid var(--shape-border-color)",_first:{borderInlineStartWidth:"0"}},"tr.is-comment-highlighted td":{backgroundColor:"var(--comment-highlight-bg)"},".is-first-table-row .controls-wrapper":{opacity:0,pointerEvents:"none"},'.is-first-table-row .comments-wrapper[data-is-popup-open="true"] .controls-wrapper':{opacity:1,pointerEvents:"auto"}};e.s(["TABLE_CLASS",0,e6,"getTableStylesheet",0,e9],873463);let e7=(e,t)=>{let i;return{...(0,eP.getHeadingStylesheet)(e),...e5(e,t),...(0,eD.getFontSizeStylesheet)(e),...(e=>{if(eO.isPdfExport)return{};let{accentCut:t}=e.config;if(!t)return{};let{maskStyles:i,fgStyles:n}=eJ[t]||{};return{"[data-layout-cut=left]":i.left,"[data-layout-cut=right]":i.right,"video[data-layout-cut=right]":{width:"100%",marginLeft:0,marginRight:0},"[data-layout-cut=top]":i.top,"[data-layout-cut-fg=left]":n.left,"[data-layout-cut-fg=right]":n.right,"[data-layout-cut-fg=top]":n.top}})(e),...(0,e4.getShapesStylesheet)(),...(0,e4.getRtlShapesStylesheet)(),...e9(),...(i="linear-gradient"===(0,eN.getThemeHeadingColor)(e).type?eP.GradientHeadingStyles:eP.HeadingStyles,{".card-code-item":{h1:(0,eD.getFontSizeStyles)("h1",e),h2:(0,eD.getFontSizeStyles)("h2",e),h3:(0,eD.getFontSizeStyles)("h3",e),h4:(0,eD.getFontSizeStyles)("h4",e),"h1, h2, h3, h4, h5, h6":{...i,width:"100%"},"img:not([src])":{width:"100%",backgroundColor:"gray.200",borderRadius:"var(--box-border-radius)",aspectRatio:"16/9"},"> *":{borderRadius:"var(--card-border-radius)"}}}),[`.${eR.CARD_WRAPPER_CLASS} .${eR.CARD_CONTENT_CLASS}`]:e.config.contentStyles}};e.s(["getThemeStylesheet",0,e7],672887);var te=e.i(551880);function tt({children:e,nodeProps:i,...n}){let a=e7((0,E.useAppSelector)(te.selectTheme),!1);return(0,t.jsx)(eo.Box,{h:"100%",overflowY:"auto",...n,sx:a,className:(0,ej.cx)("doc-content-wrapper",n.className),children:(0,t.jsx)(j.Flex,{direction:"column",w:"100%",px:4,children:e})})}var ti=e.i(365808),tn=e.i(844290),ta=e.i(164149),tr=e.i(853081);e.i(929508);var to=e.i(402261),ts=e.i(643940),tl=e.i(240178),td=e.i(360137),tc=e.i(414556),tu=e.i(372764);e.i(615835);var tp=e.i(195305),th=e.i(854861);let tm=(e,t)=>{let i=e.node.attrs,n=t.content.find(e=>"cardAccentLayoutItem"===e.type);return n&&"none"!==i.background.type&&(n.attrs={...n.attrs,...i}),t},tg=Object.assign(({selectedCardRange:e,closePanel:i,cardId:a,editor:r})=>((0,eg.useEditorUpdateDuringSelectionTiptap)(r,!0),(0,n.useEffect)(()=>{let t=r?.state.selection?.from,{from:n,to:a}=e||{};n&&a&&t&&(t===n||t>n&&t{let o=(0,E.useAppDispatch)(),s=(0,E.useAppSelector)((0,eb.selectVariants)(r)),d=(0,E.useAppSelector)((0,eb.selectSelectedVariantId)(r)),c=(0,E.useAppSelector)((0,eb.selectEditorContent)(r)),u=(0,U.useAllowOrUpsell)(void 0,"editCard",_.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),p=i.view.state.doc.nodeAt(a??0),{generateCardLayoutVariants:m,revertToOriginalCard:f,interactionId:b}=(({editor:e,start:t,cardId:i,card:a})=>{let r=(0,E.useAppSelector)(Y.selectDoc),o=(0,E.useAppSelector)(te.selectTheme),s=(0,tu.getDocAttrs)(e),l=(0,tu.getDocFormatKey)(s),d=e.state.doc.resolve(t),[c]=(0,n.useState)(a),u=(0,E.useAppStore)(),p=(0,E.useAppSelector)((0,eb.selectVariants)(i)),h=(0,E.useAppSelector)((0,eb.selectSelectedVariantId)(i)),m=(0,E.useAppSelector)((0,eb.selectEditorContent)(i)),g=(0,E.useAppDispatch)(),[f,b]=(0,n.useState)(null),x=(0,E.useAppSelector)(te.selectDocSettingsWithDefaults),y=(0,E.useAppSelector)(Y.selectFileWorkspace),v=y?(0,tp.getDocOrPaidWorkspace)(y.id):void 0,C=v?.id||y?.id,{imageProvider:w,imageModel:S,imageStyle:k}=(0,tc.useDocGenerateInputImageSettings)(),A=(0,n.useMemo)(()=>(0,ti.createBookmarkStore)(),[]),_=(0,n.useCallback)(async({variantsWithHtml:t,docId:i,interactionId:n})=>{let r=[...t];for(let s=0;s{if(!r)return void console.error("[GenerateCardLayoutVariants] Cannot generate variants. Card or workspace unknown");let a=(0,tn.splitDocIntoSections)(t),[o,...s]=(0,eb.selectVariants)(i)(u.getState()),l=[],d=s.map((e,t)=>{let i=a[t]||null,n={...e,html:e.html?e.html:i};return i&&!e.html&&l.push(n),n});g((0,eb.setVariants)({cardId:i,variants:[o,...d]})),_({variantsWithHtml:l,docId:r.id,interactionId:n}).then(t=>{let r=(0,eb.selectVariants)(i)(u.getState()).map(e=>{let i=t.find(t=>t.id===e.id);return i?{...e,...i}:e});if(g((0,eb.setVariants)({cardId:i,variants:r})),1===a.length&&!r[1]?.parseFailed){g((0,eb.setSelectedVariantId)({cardId:i,selectedVariantId:r[1].id}));try{(0,ef.replaceCardWithVariant)(e,i,{...r[1].card,attrs:{...r[1].card.attrs,id:i}},n)}catch(e){console.error("[GenerateCardLayoutVariants] Error replacing card with variant",e)}}})},[i,g,r,e,_,u]),M=(0,n.useCallback)(async()=>{if(!c||!C)return void console.error("[GenerateCardLayoutVariants] Cannot generate variants. Card or workspace unknown");g((0,eb.initializeVariants)({card:c,docSettings:x}));try{let t=(0,ta.contentToAiHtml)(e,c,{bookmarks:A}),i=(0,to.generateAIInteractionId)();b(i);let n=(({onContent:e,inputHtml:t,format:i,imageProvider:n,imageOptions:a,workspaceId:r,aiInteractionId:o})=>{let{promise:s}=(0,tr.streamJsxGeneration)({promptKey:"GenerateCardLayoutVariants",opts:{onContent:e},variables:{inputHtml:t,request:"I dont like this template. Try a different layout or visualization. You can rephrase the text to fit a new template, but don't alter the original voice or make up new details.",format:i,numberOfVariants:eA.NUM_VARIANTS,imageProvider:n,imageOptions:a,blockFlags:(0,tn.getBlockFlags)()},workspaceId:r,interactionId:o});return s})({onContent:e=>{I({content:e,interactionId:i})},inputHtml:t,format:l,imageProvider:w||"none",imageOptions:{model:S,stylePrompt:k},workspaceId:C,aiInteractionId:i});(0,td.deductCredits)("editCard",v,i),await n}catch(e){console.error("[GenerateCardLayoutVariants] Error generating card variants",e)}},[c,C,g,x,e,I,l,w,S,k,v]),T=(0,n.useCallback)(()=>{let t=p.find(e=>"original"===e.id);if(t){g((0,eb.setSelectedVariantId)({cardId:i,selectedVariantId:t.id}));try{(0,ef.replaceCardWithVariant)(e,i,t.card,f)}catch(e){console.error("[GenerateCardLayoutVariants] Error reverting card to original",e)}}},[e,i,p,g,f]);return{generateCardLayoutVariants:M,variants:p,selectedVariantId:h,setSelectedVariantId:eb.setSelectedVariantId,revertToOriginalCard:T,interactionId:f,editorContent:m}})({editor:i,start:a??0,cardId:r,card:p}),x=(0,n.useMemo)(()=>s.some(e=>e?.isGenerating??!1),[s]),y=(0,n.useCallback)(async()=>{u()?await m():e()},[u,m,e]);(0,n.useEffect)(()=>{y()},[]),(0,n.useEffect)(()=>()=>{d&&Z.analytics?.track(_.SegmentEvents.AI_CARD_VARIATION_KEPT,{cardId:r,variantId:d,isOriginal:"original"===d,interactionId:b,source:"layout-panel"})},[r,d,b,s]);let v={bgColor:(0,D.useColorModeValue)("white","gray.800"),textColor:(0,D.useColorModeValue)("gray.800","white")},C={dropdownBgColor:(0,D.useColorModeValue)("blackAlpha.100","whiteAlpha.100"),dropdownBgHoverColor:(0,D.useColorModeValue)("blackAlpha.300","whiteAlpha.300"),dropdownTextColor:(0,D.useColorModeValue)("gray.800","white")},w=(0,n.useCallback)(e=>{let t=s.find(t=>t.id===e);if(t){o((0,eb.setSelectedVariantId)({cardId:r,selectedVariantId:t.id}));try{(0,ef.replaceCardWithVariant)(i,r,t.card,b)}catch(e){console.error("[GenerateCardLayoutVariants] Error replacing card with variant",e)}}},[r,s,i,o,b]);return(0,t.jsx)(G.Panel,{bgColor:v.bgColor,w:"100%",pt:4,children:(0,t.jsxs)(j.Flex,{direction:"column",overflowX:"hidden",w:"100%",h:"100%",children:[(0,t.jsxs)(j.Flex,{position:"relative",pb:1,px:4,children:[(0,t.jsx)(j.Flex,{flex:1,children:(0,t.jsx)($.PanelHeading,{children:(0,t.jsx)(g.Trans,{message:"AI layouts",id:"jVFRe1"})})}),(0,t.jsxs)(T.ButtonGroup,{spacing:0,children:["original"!==d&&(0,t.jsx)(l.Button,{size:"sm",onClick:f,variant:"ghost",leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faArrowRotateBack,size:"sm"}),children:(0,t.jsx)(g.Trans,{message:"Undo",id:"9uI/rE"})}),(0,t.jsx)(L.CloseButton,{onClick:e})]})]}),!x&&(0,t.jsxs)(j.Flex,{px:4,gap:2,pb:2,align:"center",children:[(0,t.jsx)(P.Text,{fontSize:"xs",color:"gray.500",children:(0,t.jsx)(g.Trans,{message:"Don't like these?",id:"GhS4Yn"})}),(0,t.jsxs)(l.Button,{size:"xs",leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faArrowsRepeat}),textAlign:"start",bgColor:C.dropdownBgColor,color:C.dropdownTextColor,borderRadius:"md",px:2,_hover:{bgColor:C.dropdownBgHoverColor},onClick:()=>{y()},children:[(0,t.jsx)(g.Trans,{message:"Show more",id:"fMPkxb"}),(0,t.jsx)(W.CreditCostIcon,{type:"editCard",colorScheme:"blackAlpha",color:"blackAlpha.600",fontSize:"xs",ms:2,px:0})]})]}),c&&(0,t.jsx)(tb,{editorContent:c,anyVariantsGenerating:x,selectedCardId:r,selectedCardPos:a,interactionId:b,handleSelectVariant:w})]})})});tf.displayName="CardLayoutVariantsPanelInner";let tb=n.default.memo(({editorContent:e,anyVariantsGenerating:i,selectedCardId:a,selectedCardPos:r,interactionId:o,handleSelectVariant:s})=>{let l=(0,n.useMemo)(()=>(0,K.getBaseExtensions)(),[]),d=(0,z.useTiptapEditor)({extensions:l,content:e,immediatelyRender:!0,editable:!1}),c=(0,n.useMemo)(()=>({...(0,K.getBaseNodeViews)(),document:tt,card:eL,contributors:(0,B.tiptapNodeView)({component:eh,extension:em})}),[]),u=(0,n.useMemo)(()=>(0,K.getBaseMarkViews)(),[]);return(0,t.jsx)(eM,{value:{selectedCardId:a,selectedCardPos:r,interactionId:o,handleSelectVariant:s},children:(0,t.jsx)(V.IsThumbnailViewProvider,{value:!0,children:(0,t.jsxs)(j.Flex,{overflowY:"auto",direction:"column",h:"100%",flex:1,children:[i&&(0,t.jsxs)(j.Flex,{px:4,py:2,borderRadius:"md",align:"center",gap:1,color:"blue.900",fontWeight:"bold",alignItems:"center",children:[(0,t.jsx)(H.AISparkleIcon,{}),(0,t.jsx)(P.Text,{fontSize:"sm",children:(0,t.jsx)(g.Trans,{message:"Visualizing...",id:"yARg1X"})})]}),(0,t.jsx)(O.TiptapEditorView,{editor:d,nodeViewComponents:c,markViewComponents:u,children:(0,t.jsx)(tx,{editor:d})})]})})})});tb.displayName="CardLayoutVariantsList";let tx=({editor:e})=>{let{selectedCardId:i,interactionId:n}=eT(),a=(0,E.useAppSelector)((0,eb.selectVariants)(i));return(0,F.useTiptapEditorEffect)(e=>{a.forEach(t=>{if(!n||t.isGenerating)return;let i={...t.card,attrs:{...t.card.attrs,id:t.id}};(0,ef.replaceCardWithVariant)(e,t.id,i,n)})},[a,n]),(0,t.jsx)(R.TiptapEditorContent,{editor:e})},ty=()=>{let{togglePanel:e,isPanelOpen:t}=(0,M.useTogglePanel)(tg);return{toggleCardLayoutVariantsPanel:e,isCardLayoutVariantsPanelOpen:t}};var tv=e.i(913807),tC=e.i(320037),tw=e.i(15647);let tS=[{key:"rephrase.better",label:()=>f.i18n._({id:"WLqWVj",message:"Improve writing"}),instructions:"Improve the writing",instructionsTrans:()=>f.i18n._({id:"KaTt0J",message:"Improve the writing"}),icon:N.faFeather,group:"writing",loadingMessage:()=>f.i18n._({id:"OxbbYn",message:"Rewriting"}),variationName:()=>f.i18n._({id:"5j51A1",message:"Improved"}),completionMessage:()=>f.i18n._({id:"EF1nyz",message:"Improved writing"})},{key:"edit.spelling",label:()=>f.i18n._({id:"kIRRvo",message:"Fix spelling & grammar"}),instructions:"Fix spelling & grammar",instructionsTrans:()=>f.i18n._({id:"7Mcbfl",message:"Fix spelling & grammar"}),icon:N.faCheck,group:"writing",loadingMessage:()=>f.i18n._({id:"vLjsO9",message:"Looking for typos"}),variationName:()=>f.i18n._({id:"MRZxAn",message:"Edited"}),completionMessage:()=>f.i18n._({id:"3G04Qf",message:"Fixed spelling & grammar"})},{key:"edit.translate",label:()=>f.i18n._({id:"pi8x/S",message:"Translate"}),instructions:"",instructionsTrans:()=>f.i18n._({id:"E6k5Np",message:"Translate"}),icon:N.faLanguage,group:"writing",loadingMessage:()=>f.i18n._({id:"aKSJTV",message:"Translating"}),variationName:()=>f.i18n._({id:"a/ppJp",message:"Translated"}),completionMessage:()=>f.i18n._({id:"a/ppJp",message:"Translated"})},{key:"rephrase.expand",label:()=>f.i18n._({id:"rRLXT4",message:"Make longer"}),instructions:"Make this longer - about 2x the current length",instructionsTrans:()=>f.i18n._({id:"hbj+SR",message:"Make this longer - about 2x the current length"}),icon:N.faBars,group:"writing",loadingMessage:()=>f.i18n._({id:"Q+x/E4",message:"Expanding"}),variationName:()=>f.i18n._({id:"pvJgUJ",message:"Expanded"}),completionMessage:()=>f.i18n._({id:"jgdqxQ",message:"Expanded writing"})},{key:"rephrase.condense",label:()=>f.i18n._({id:"xTY2A5",message:"Make shorter"}),instructions:"Make this more concise - about half the current length",instructionsTrans:()=>f.i18n._({id:"zeiJlg",message:"Make this more concise - about half the current length"}),icon:N.faGripLines,group:"writing",loadingMessage:()=>f.i18n._({id:"BjuYlr",message:"Condensing"}),variationName:()=>f.i18n._({id:"Q7U9iz",message:"Condensed"}),completionMessage:()=>f.i18n._({id:"l7sxzR",message:"Condensed writing"})},{key:"rephrase.simplify",label:()=>f.i18n._({id:"Lx/Sd1",message:"Simplify language"}),instructions:"Simplify the language",instructionsTrans:()=>f.i18n._({id:"BS3Eqe",message:"Simplify the language"}),icon:N.faThoughtBubble,group:"writing",loadingMessage:()=>f.i18n._({id:"AAhoH1",message:"Simplifying"}),variationName:()=>f.i18n._({id:"nvmoB1",message:"Simplified"}),completionMessage:()=>f.i18n._({id:"5xpG46",message:"Simplified language"})},{key:"rephrase.specifics",label:()=>f.i18n._({id:"u6rs0A",message:"Be more specific"}),instructions:"Rewrite this to be more specific. Use the previous text and the outline for context. If you don't have enough details, make them up.",instructionsTrans:()=>f.i18n._({id:"pbZESM",message:"Rewrite this to be more specific. Use the previous text and the outline for context. If you don't have enough details, make them up."}),icon:N.faReflectBoth,group:"writing",loadingMessage:()=>f.i18n._({id:"HW6L/y",message:"Adding specifics"}),variationName:()=>f.i18n._({id:"PRHEO1",message:"More specific"}),completionMessage:()=>f.i18n._({id:"dib9YI",message:"Added specifics"})},{key:"layout.visual",label:()=>f.i18n._({id:"gcHjj/",message:"Make this more visual"}),instructions:"I want to make this content more visual. Make up new images to illustrate the concepts. You can rephrase the text to fit the new template, but don't alter the original voice or make up new details.",instructionsTrans:()=>f.i18n._({id:"7AVs0v",message:"I want to make this content more visual. Make up new images to illustrate the concepts. You can rephrase the text to fit the new template, but don't alter the original voice or make up new details."}),icon:N.faMessageImage,group:"layout",loadingMessage:()=>f.i18n._({id:"hMtOFm",message:"Visualizing"}),variationName:()=>f.i18n._({id:"p0QPRq",message:"More visual"})},{key:"layout.addImage",label:()=>f.i18n._({id:"LfOSf5",message:"Add an image"}),instructions:"Add a new image. Keep the rest of my content and formatting the same. Don't change layout blocks or make up new details. Do not remove any of the text!",instructionsTrans:()=>f.i18n._({id:"ohc2fy",message:"Add a new image. Keep the rest of my content and formatting the same. Don't change layout blocks or make up new details. Do not remove any of the text!"}),icon:N.faImage,group:"layout",loadingMessage:()=>f.i18n._({id:"hMtOFm",message:"Visualizing"}),variationName:()=>f.i18n._({id:"2ap0Xm",message:"Added image"})},{key:"layout.addChart",label:()=>f.i18n._({id:"5gs+hl",message:"Add a chart"}),instructions:"Add a new chart. Keep the rest of my content and formatting the same. Don't change layout blocks or make up new details. Do not remove any of the text!",instructionsTrans:()=>f.i18n._({id:"Ac64aO",message:"Add a new chart. Keep the rest of my content and formatting the same. Don't change layout blocks or make up new details. Do not remove any of the text!"}),icon:N.faChartLine,group:"layout",loadingMessage:()=>f.i18n._({id:"jrmkrk",message:"Adding chart"}),variationName:()=>f.i18n._({id:"/ncPTi",message:"Added chart"})},{key:"layout.beautify",label:()=>f.i18n._({id:"/tecMj",message:"Convert to image card"}),instructions:"Convert this card into a beautiful image card. Preserve the text content while making it visually stunning.",instructionsTrans:()=>f.i18n._({id:"48L/2U",message:"Convert this card into a beautiful image card. Preserve the text content while making it visually stunning."}),icon:N.faImageLandscape,group:"layout",loadingMessage:()=>f.i18n._({id:"+cj1qu",message:"Converting"}),variationName:()=>f.i18n._({id:"sUu7Wg",message:"Converted"}),completionMessage:()=>f.i18n._({id:"RBPdbP",message:"Card converted"}),checkEnabled:tw.isBeautifyCardAvailable}],tk=(0,tC.default)(tS,"group"),tA=(0,n.memo)(function({attrs:e,editor:i,getPos:a}){let r=(0,E.useAppDispatch)(),o=(0,E.useAppSelector)((0,tv.selectCardMenuOpen)(e.id,"editWithAI")),s=(0,n.useCallback)(()=>{r((0,tv.closeCardMenu)())},[r]),M=(0,n.useCallback)(()=>{r((0,tv.toggleCardMenu)({cardId:e.id,menuType:"editWithAI"}))},[r,e.id]),{isOpen:T,onOpen:L,onClose:j}=(0,u.useDisclosure)(),P=(0,I.useGetStylesForHandleButtons)(),{isInOfflineMode:D}=(0,x.useHealthCheck)(),{toggleBuddyChatPanel:N}=(0,y.useToggleBuddyChatPanel)(),R=e.id,{toggleCardLayoutVariantsPanel:O,isCardLayoutVariantsPanelOpen:B}=ty(),z=(0,C.useSendQueuedBuddyMessage)(),F=(({cardId:e,onTranslateOpen:t,onOpenLayoutVariants:i})=>(0,n.useMemo)(()=>[{key:"layout-actions",operations:[{key:"layout.tryNew",label:()=>f.i18n._({id:"3MMiDG",message:"Try new layout"}),icon:p.faSparkles,onQuickAction:()=>{i()}}]},{key:"writing",label:()=>f.i18n._({id:"4kJRen",message:"Writing"}),operations:tk.writing.map(i=>({key:i.key,label:i.label,icon:i.icon,checkEnabled:i.checkEnabled,onQuickAction:n=>{if("edit.translate"===i.key)return void t();let a=i.instructionsTrans();n({message:f.i18n._({id:"1Boz2S",message:"Edit this card. {instruction}",values:{instruction:a}}),context:{initiatingCardId:e}})}}))},{key:"image",label:()=>f.i18n._({id:"hG89Ed",message:"Image"}),operations:tk.layout.map(t=>({key:t.key,label:t.label,icon:t.icon,checkEnabled:t.checkEnabled,onQuickAction:i=>{let n=t.instructionsTrans();i({message:f.i18n._({id:"1Boz2S",message:"Edit this card. {instruction}",values:{instruction:n}}),context:{initiatingCardId:e}})}}))}],[i,e,t]))({cardId:R,onTranslateOpen:L,onOpenLayoutVariants:(0,n.useCallback)(()=>{B&&O({override:"closed"});let e=a();if(void 0===e)return;let t=i.state.doc.nodeAt(e);t&&(i.commands.selectNodeAtPos(e),N({override:"closed",disableTransition:!0}),O({override:"open",isResizable:!1,props:{cardId:t.attrs.id,selectedCardRange:{from:e,to:e+t.nodeSize},editor:i}}))},[i,a,B,N,O])}),H=(0,k.useCreditWarning)({cost:w.DEFAULT_CREDIT_COSTS.editCard,surface:"edit-card",source:{segmentEvent:_.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_BUDDY_EDIT_CHAT,upsellLocation:"credits.buddyEditChat"}});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(v.BuddyChatPopover,{creditWarning:H,title:f.i18n._({id:"IkOuqb",message:"Edit this card"}),placeholder:f.i18n._({id:"0IhjJa",message:"How would you like to edit this card?"}),editor:i,initiatingCardId:e.id,isOpen:o,onOpen:M,onClose:s,trigger:(0,t.jsx)(S.CreditWarningTooltip,{creditWarning:H,children:(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Edit with {AGENT_PROPER_NOUN}",id:"0aK6vE",values:{AGENT_PROPER_NOUN:A.AGENT_PROPER_NOUN}}),placement:"top",children:(0,t.jsx)(l.Button,{as:c.IconButton,"aria-label":f.i18n._({id:"0aK6vE",message:"Edit with {AGENT_PROPER_NOUN}",values:{AGENT_PROPER_NOUN:A.AGENT_PROPER_NOUN}}),icon:(0,t.jsxs)(d.HStack,{spacing:1,children:[(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faSparkles,fixedWidth:!0}),(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faChevronDown,size:"xs",fixedWidth:!0})]}),"data-guider-highlight":"edit-with-ai-button","data-card-ai-edit-menu-trigger":e.id,fontWeight:"900",alignItems:"center",fontFamily:"body",display:"flex",pointerEvents:"auto",cursor:"pointer",...P,px:.5,isDisabled:D,zIndex:1e3,onMouseDown:e=>{e.stopPropagation()}})})}),placement:"bottom-start",actionGroups:F}),T&&(0,t.jsx)(b.TranslateModal,{isSite:!1,isFullDoc:!1,onClose:j,startTranslation:e=>{let t=e.displayName;z({message:f.i18n._({id:"l0kId+",message:"Translate this card to {lang}",values:{lang:t}}),context:{initiatingCardId:R}}),N({override:"open",disableTransition:!0}),j()}})]})}),tE=({cardContentType:e,attrs:l,editor:d,getPos:c,node:u})=>{let p=(0,r.useFeatureFlag)("aiImageEditing"),h=(0,n.useCallback)(()=>{let e=c();if("number"!=typeof e)return;let t=(0,i.findChildren)(u,s.isCardImageItemNode);if(t.length>0){let i=e+1+t[0].pos;d.commands.selectNodeAtPos(i)}},[d,c,u]);if("image"===e&&u.firstChild){let e=u.firstChild.attrs.image;return p&&(0,a.isImageEditableWithAI)(e)?(0,t.jsx)(o.BuddyCardImageEditDropdownMenu,{attrs:e,editor:d,selectImage:h,getPos:c,node:u}):null}return(0,t.jsx)(tA,{editor:d,getPos:c,attrs:l})};e.s(["GenerateCardStatus",()=>tT],247879);var t_=e.i(325059),tI=e.i(180939),tM=e.i(37169);let tT=({editor:e,getPos:i,updateAttributes:a,input:r})=>{let o=(0,I.useGetStylesForHandleButtons)(),s=(0,tI.useCanUseProductFeature)("unlimited_credits"),{toggleCardLayoutVariantsPanel:u,isCardLayoutVariantsPanelOpen:b}=ty(),x=(0,n.useCallback)(()=>{b&&u({override:"closed"});let t=i();if("number"!=typeof t)return;let n=e.state.doc.nodeAt(t);n&&(e.commands.selectNodeAtPos(t),u({override:"open",isResizable:!1,props:{cardId:n.attrs.id,selectedCardRange:{from:e.state.selection.from,to:e.state.selection.from+n.nodeSize},editor:e}}))},[e,i,u,b]),y=(0,n.useCallback)(()=>{a({generatorInput:null})},[a]),v=(0,el.useGammaBreakpointValue)({base:!0,lg:!1}),C=(0,t_.useRtlEnabled)(),w=C?p.faArrowRight:p.faArrowLeft,S="imageCard"===r.template;return(0,t.jsx)(d.HStack,{contentEditable:!1,userSelect:"none",align:"center",position:"absolute",insetInlineStart:"50%",transform:C?"translateX(50%)":"translateX(-50%)",pointerEvents:"auto",children:(0,t.jsxs)(d.HStack,{spacing:2,children:[(0,t.jsx)(l.Button,{...o,leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:w}),"aria-label":f.i18n._({id:"K1Ro+T",message:"Go back to prompt"}),onClick:()=>a({layoutTemplateColumns:null,generatorInput:{...tM.DEFAULT_CARD_GENERATOR_INPUT,prompt:r.prompt,...S?{template:r.template}:{}}}),children:(0,t.jsx)(g.Trans,{message:"Back to prompt",id:"550oRP"})}),!S&&(0,t.jsx)(l.Button,{...o,leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faSparkles}),onClick:()=>{x(),y()},children:(0,t.jsxs)(d.HStack,{spacing:.5,alignItems:"center",justifyContent:"center",children:[(0,t.jsx)(P.Text,{children:(0,t.jsx)(g.Trans,{message:"Try more layouts",id:"SiSG+p"})}),!s&&(0,t.jsx)(W.CreditCostIcon,{type:"generateCard",ms:0,color:"gray.500"})]})}),r.interactionId&&!v&&(0,t.jsx)(ek.EditCardRating,{interactionId:r.interactionId,operation:"generate-card",instructions:r.prompt}),!S||v?(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Dismiss",id:"1QfxQT"}),placement:"top",children:(0,t.jsx)(c.IconButton,{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faXmark}),"aria-label":f.i18n._({id:"1QfxQT",message:"Dismiss"}),...o,px:1.5,minW:"auto",onClick:y})}):(0,t.jsx)(l.Button,{leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faXmark}),...o,onClick:y,children:(0,t.jsx)(g.Trans,{message:"Dismiss",id:"1QfxQT"})})]})})};var tL=e.i(707065),tj=e.i(876533),tP=e.i(97660),tD=e.i(572383),tN=e.i(914911),tR=e.i(428624);let tO=tL.keyframes` 0% { margin-inline: 0; } 100% { margin-inline: var(--nested-card-margin); } `;e.s(["CardBody",0,({attrs:e,isFullBleed:i,displayFullBleed:n,isNested:a,isPresentMode:r,isEditable:o,isFocused:s,isDark:l,isLetterboxed:d,showPresentBackdrop:c,isCommentOpenOnCard:u,theme:p,children:h})=>{let{id:m,container:g}=e,f=(0,tN.getContainerBackgroundColor)(p,g),b=n?tP.CardFullBleedSx:tP.CardSx,x=r&&!a,y=(0,V.useIsThumbnailView)(),v=(0,tD.getThemeCSSVars)(p,g.background?f:void 0),C=i?{width:a||d?"var(--card-width)":"100%"}:{zIndex:a?u?tR.DOC_Z_INDEXES.nestedCardBodyWithComment:tR.DOC_Z_INDEXES.nestedCardBody:void 0,width:"var(--card-width)"},w=x?{minW:c||d?"auto":"100%",minH:"var(--card-min-height)",my:"auto"}:{minW:"0%",minH:"var(--card-min-height)"},S=eO.isPuppeteer?0:eR.EXPAND_CARD_TRANSITION_TIME;return(0,t.jsxs)(j.Flex,{className:(0,ej.cx)(eR.CARD_BODY_CLASS),"data-card-body":m,"data-selection-ring":!0,"data-guider-highlight":"card-body","data-letterboxed":d?"true":void 0,"data-content-reference":!0,"data-testid":"card-body","data-hide-comments":r,fontSize:"var(--font-size)",animation:a&&!y?`${tO} ${S}ms ease-out forwards`:void 0,position:"relative",...C,...w,maxW:"var(--card-max-width)",css:{"--grid-outline-color":l?"var(--chakra-colors-gray-600)":"var(--chakra-colors-gray-200)",...v,"--card-border-radius":n?0:v["--card-border-radius"]},justify:"center",borderRadius:"var(--card-border-radius)",ps:i&&!a?"var(--doc-padding-left)":void 0,pe:i&&!a?"var(--doc-padding-right)":void 0,_hover:o&&n&&!s?{"> .card-body-background":{outline:"2px solid var(--grid-outline-color)"}}:void 0,outline:d?"max(50vw, 50vh) solid black":void 0,children:[(0,t.jsx)(eo.Box,{position:"absolute",inset:"0",sx:b,className:"card-body-background",borderRadius:"inherit",contentEditable:!1,zIndex:r?-1:void 0,outline:s&&!y?"2px solid var(--chakra-ring-color)":void 0,outlineOffset:i&&!r?"-2px":void 0,border:a&&!y&&"0em"===v["--card-border-width"]?"1px solid var(--neutral-border-color)":void 0,"data-export-master":!!n||void 0}),(0,t.jsx)(tj.DarkModeProvider,{isDark:l,children:h})]})}],976188),e.s(["CardDivider",()=>at],432523);var tB=e.i(47735);e.i(601019);var tz=e.i(494075);e.i(275885),e.i(979021),e.i(524617);var tF=e.i(131339);e.i(729088),e.i(250332);let tH="FLUSH_SYNCED_EDITOR";e.s(["FLUSH_SYNCED_EDITOR",0,tH],647477);var tW=e.i(261442);e.s(["CardTemplateModal",()=>n4],909875);var tU=e.i(402818),tV=e.i(676828),tG=e.i(775493),t$=e.i(704077),tZ=e.i(112010),tK=e.i(588183),tq=e.i(575329),tY=e.i(751827),tX=e.i(918228),tQ=e.i(865786),tJ=e.i(878726),t0=e.i(595995),t1=e.i(620020),t2=e.i(315261);e.i(144786);var t3=e.i(534904);let t5=N.faLayerGroup;N.faGrid2;let t4=(0,e.i(275561).createIcon)({d:"M23.384,21.619,16.855,15.09a9.284,9.284,0,1,0-1.768,1.768l6.529,6.529a1.266,1.266,0,0,0,1.768,0A1.251,1.251,0,0,0,23.384,21.619ZM2.75,9.5a6.75,6.75,0,1,1,6.75,6.75A6.758,6.758,0,0,1,2.75,9.5Z",displayName:"SearchIcon"});e.s(["SearchIcon",0,t4],168578);var t6=e.i(865639),t9=e.i(965837),t8=e.i(774314);e.i(185340);var t7=e.i(863750),ie=e.i(40317),it=e.i(865799),ii=e.i(857051),ia=e.i(222625),ir=e.i(382167),io=e.i(641099);let is=[{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faSidebar,fixedWidth:!0}),title:(0,t.jsx)(g.Trans,{message:"Add from dashboard",id:"Z9qr0V"}),description:(0,t.jsx)(g.Trans,{message:"To turn any {GAMMA_ARTIFACT_PROPER_NOUN} into a template, you can also click on its <0><1/> overflow menu from the dashboard.",id:"v97pUA",values:{GAMMA_ARTIFACT_PROPER_NOUN:A.GAMMA_ARTIFACT_PROPER_NOUN},components:{0:(0,t.jsx)(ia.Kbd,{}),1:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faEllipsis})}})},{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faCode,fixedWidth:!0}),title:(0,t.jsx)(g.Trans,{message:"Templates API",id:"XKFqJ1"}),isNew:!0,description:(0,t.jsx)(g.Trans,{message:"Our create from template API is now live. Build custom automation workflows that save you hours of work, generating consistent, on-brand content at scale.",id:"7fUBT4"}),learnMoreLink:(0,t.jsx)(ir.Link,{isExternal:!0,href:"https://developers.gamma.app/",target:"_blank",textDecoration:"underline",children:(0,t.jsx)(g.Trans,{message:"Learn more",id:"fxfeMA"})})},{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faGlobe,fixedWidth:!0}),title:(0,t.jsx)(g.Trans,{message:"Site templates",id:"hMn6kD"}),isPlanned:!0,description:(0,t.jsx)(g.Trans,{message:"Site templates are not currently supported but we're working on supporting them.",id:"hItpb6"})}],il=()=>(0,t.jsx)(tX.Stack,{spacing:4,pt:"3",children:(0,t.jsx)(io.SimpleGrid,{columns:{base:1,lg:3},gap:4,children:is.map(({icon:e,title:i,description:n,isPlanned:a,isNew:r,learnMoreLink:o},s)=>(0,t.jsxs)(ii.GridItem,{as:ie.Alert,flexDirection:"column",alignItems:"flex-start",py:3,px:4,borderRadius:"md",colorScheme:"gray",variant:"subtle",gap:2,children:[(0,t.jsx)(eo.Box,{fontSize:"md",children:e}),(0,t.jsxs)(tV.Heading,{alignSelf:"flex-start",size:"xs",children:[i,r&&(0,t.jsx)(it.Badge,{display:"inline",colorScheme:"green",ms:1,fontSize:"xs",children:(0,t.jsx)(g.Trans,{message:"New",id:"isRobC"})}),a&&(0,t.jsx)(it.Badge,{display:"inline",colorScheme:"yellow",ms:1,fontSize:"xs",children:(0,t.jsx)(g.Trans,{message:"Planned",id:"iAXogw"})})]}),(0,t.jsx)(P.Text,{fontSize:"sm",children:n}),o]},s))})}),id="recently_used";var ic=e.i(76810),iu=e.i(98926),ip=e.i(407055),ih=e.i(25747),im=e.i(792565);let ig=(e={})=>{let{currentWorkspace:t}=(0,ih.useUserContext)(),i=t?.id,[a,r]=(0,n.useState)(!1),o=e.sortBy===id,s=(0,iu.useApolloClient)(),{recentlyUsedTemplateFileIds:l,sortTemplatesByRecentUsage:d}=(()=>{let{currentWorkspace:e}=(0,ih.useUserContext)(),t=e?.id,i=t?`recentlyUsedWorkspaceTemplateFileIds:${t}`:null,[a,r]=(0,im.useLocalStorage)(i??"recentlyUsedWorkspaceTemplateFileIds:default",[]),o=(0,n.useCallback)(e=>{r((0,ip.default)([e,...a]).slice(0,10))},[a,r]),s=(0,n.useCallback)(e=>{if(0===a.length)return e;let t=new Map(a.map((e,t)=>[e,t]));return[...e].sort((e,i)=>{let n=t.get(e.id),a=t.get(i.id);return void 0!==n&&void 0!==a?n-a:void 0!==n?-1:1*(void 0!==a)})},[a]);return{recentlyUsedTemplateFileIds:a,markTemplateAsUsed:o,sortTemplatesByRecentUsage:s}})(),{data:c,called:u,error:p,loading:h,networkStatus:m,fetchMore:g,refetch:f}=(0,t7.useGetTemplateFilesForWorkspaceQuery)({variables:{workspaceId:i,...(e=>{let{first:t=50,sortBy:i,sortDirection:n=t7.SortDirection.Desc,archived:a=!1}=e,r=i===id?t7.FileSortField.EditedTime:i,o=i===id?t7.SortDirection.Desc:n;return{first:t,archived:a,...r&&{sortBy:{field:r,direction:o}}}})(e)},skip:!i,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",notifyOnNetworkStatusChange:!0}),b=(0,n.useMemo)(()=>c?.files?.edges?.map(e=>e.node)||[],[c?.files?.edges]),x=c?.files?.pageInfo,y=x?.hasNextPage||!1,v=x?.endCursor,[C,w]=(0,n.useState)([]),[S,k]=(0,n.useState)(!1);(0,n.useEffect)(()=>{w([])},[i]);let A=!u||m===ic.NetworkStatus.loading,E=(0,n.useMemo)(()=>{if(!o||A||0===b.length||0===l.length)return[];let e=new Set(b.map(e=>e.id)),t=new Set(C.map(e=>e.id));return l.filter(i=>!e.has(i)&&!t.has(i))},[o,A,b,l,C]),I=E.join(",");(0,n.useEffect)(()=>{if(!o){w([]),k(!1);return}if(0===E.length)return;let t=!1;return(async()=>{Z.analytics.track(_.SegmentEvents.TEMPLATES_RECENTLY_USED_FETCH_MISSING,{count:E.length}),k(!0);try{let n=await Promise.all(E.map(e=>s.query({query:t7.GetTemplateFileDocument,variables:{id:e},fetchPolicy:"cache-first",returnPartialData:!1}).catch(()=>null)));if(t)return;let a=n.flatMap(t=>{let n=t?.data?.file;if(!n||n.workspace?.id!==i)return[];let a=e.archived??!1;return n.archived!==a?[]:[{id:n.id,mainPageId:n.mainPageId,title:n.title,previewUrl:n.previewUrl,createdBy:n.createdBy,createdTime:n.createdTime,archived:n.archived}]});if(t)return;w(e=>{let t=new Set(e.map(e=>e.id)),i=a.filter(e=>!t.has(e.id));return[...e,...i]})}finally{t||k(!1)}})(),()=>{t=!0}},[s,o,I,e?.archived]);let M=(0,n.useMemo)(()=>{if(!o)return b;let e=new Map;for(let t of C)e.set(t.id,t);for(let t of b)e.set(t.id,t);return d(Array.from(e.values()))},[o,b,C,d]),T=(0,n.useCallback)(async()=>{if(y&&!a&&v){r(!0);try{await g({variables:{after:v},updateQuery:(e,{fetchMoreResult:t})=>t?{...t,files:{...t.files,edges:[...e.files.edges,...t.files.edges]}}:e})}finally{r(!1)}}},[g,y,v,a]),L=m===ic.NetworkStatus.setVariables,j=m===ic.NetworkStatus.fetchMore,P=m===ic.NetworkStatus.refetch,D=h&&m!==ic.NetworkStatus.fetchMore||S,N=!A&&!P&&!D&&0===M.length;return{templates:M,loading:D,error:p,hasNextPage:y,endCursor:v,loadMore:T,isLoadingMore:a,isInitialLoading:A,isFetchingMore:j,isRefetching:P,isSettingVariables:L,isEmpty:N,refetch:f}};var ib=e.i(907839),ix=e.i(84723),iy=e.i(227909),iv=e.i(721455),iC=e.i(148318),iw=e.i(285042),iS=e.i(704273),ik=e.i(259658),iA=e.i(935020);let iE=[{key:id,label:(0,t.jsx)(g.Trans,{message:"Recently used",id:"uabU9X"})},{key:t7.FileSortField.EditedTime,label:(0,t.jsx)(g.Trans,{message:"Last edited",id:"acZeX2"})},{key:t7.FileSortField.CreatedTime,label:(0,t.jsx)(g.Trans,{message:"Date created",id:"u46WEi"})},{key:t7.FileSortField.Title,label:(0,t.jsx)(g.Trans,{message:"Title",id:"MHrjPM"})}],i_=({sortBy:e,setSortBy:i,sortDirection:n,setSortDirection:a,buttonVariant:r="ghost"})=>(0,t.jsxs)(T.ButtonGroup,{variant:r,size:"sm",children:[(0,t.jsxs)(iv.Menu,{closeOnSelect:!0,children:[(0,t.jsx)(iC.MenuButton,{as:l.Button,variant:"ghost",colorScheme:"alpha",rightIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faChevronDown,fixedWidth:!0}),fontWeight:"600",children:iE.find(t=>t.key===e)?.label??(0,t.jsx)(g.Trans,{message:"Recently used",id:"uabU9X"})}),(0,t.jsx)(iA.Portal,{children:(0,t.jsx)(iS.MenuList,{minWidth:"240px",zIndex:"modalPopover",children:(0,t.jsx)(ik.MenuOptionGroup,{defaultValue:"alpha",title:f.i18n._({id:"/HgF9q",message:"Sort by"}),type:"radio",children:iE.map(n=>{let r=e===n.key;return(0,t.jsx)(iw.MenuItem,{icon:r?(0,t.jsx)(iy.CheckIcon,{}):(0,t.jsx)(eo.Box,{w:3}),value:n.key,onClick:()=>{n.key===t7.FileSortField.Title?a(t7.SortDirection.Asc):a(t7.SortDirection.Desc),i(n.key)},children:n.label},n.key)})})})})]}),e!==id&&(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Reverse sort order",id:"TZml21"}),children:(0,t.jsx)(c.IconButton,{"aria-label":"sort",variant:"ghost",colorScheme:"alpha",isDisabled:!1,onClick:()=>a(n===t7.SortDirection.Asc?t7.SortDirection.Desc:t7.SortDirection.Asc),icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faArrowUpArrowDown})})})]});var iI=e.i(96095),iM=e.i(370379),iT=e.i(641295),iL=e.i(72382),ij=e.i(607663);e.i(832019);var iP=e.i(736386),iD=e.i(147349),iN=e.i(455784),iR=e.i(372966),iO=e.i(743241),iB=e.i(644315),iz=e.i(404529),iF=e.i(531768),iH=e.i(131669),iW=e.i(996651),iU=e.i(843946),iV=e.i(75495),iG=e.i(203828),i$=e.i(576897);let iZ=({isOpen:e,onClose:i,docPreview:a,showViewTemplates:r=!0})=>{let o=(0,t1.useToast)(),{currentWorkspace:s}=(0,ih.useUserContext)(),d=s?.id,c=f.i18n._({id:"Xm+eHu",message:"Untitled template"}),{push:u}=(0,iG.useRouter)(),[p,h]=(0,n.useState)(a?.title||c),m=(0,n.useRef)(null),[b,{data:x,loading:y}]=(0,t7.useCreateTemplateFromFileMutation)();(0,n.useEffect)(()=>{e&&setTimeout(()=>{m?.current?.select()},100)},[e]);let v=(0,n.useCallback)(async()=>{if(a)try{await b({variables:{input:{fileId:a.fileId,pageId:a.docId,workspaceId:d,title:p}},refetchQueries:["GetTemplateFilesForWorkspace"]})}catch(e){o({title:f.i18n._({id:"vnVWDE",message:"Error creating template"}),description:e.message||f.i18n._({id:"fuwKpE",message:"Please try again."}),status:"error",position:"top",duration:3e3}),console.error(e)}},[b,d,a,p,o]),C=x?.createTemplateFromFile.mainPageId,w=!!C,S=(0,n.useCallback)(()=>{C&&u((0,i$.generateDocUrl)({docId:C}))},[C,u]),k=(0,n.useCallback)(()=>{u("/#templates"),i()},[u,i]);return(0,t.jsxs)(tG.Modal,{isOpen:e,onClose:i,size:"lg",initialFocusRef:m,children:[(0,t.jsx)(tY.ModalOverlay,{}),(0,t.jsxs)(tK.ModalContent,{children:[(0,t.jsx)(tq.ModalHeader,{children:(0,t.jsx)(g.Trans,{message:"Create workspace template",id:"70RJbN"})}),(0,t.jsx)(tZ.ModalCloseButton,{}),(0,t.jsx)(tU.Divider,{}),(0,t.jsx)(t$.ModalBody,{py:"4",pb:"4",children:(0,t.jsxs)(tX.Stack,{spacing:6,children:[(0,t.jsx)(P.Text,{fontSize:"sm",children:(0,t.jsx)(g.Trans,{message:"Turn frequently-used {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL} into templates for your entire workspace to use.",id:"PfuRo+",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:A.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}})}),(0,t.jsx)(eo.Box,{borderRadius:"md",p:+!w,position:"relative",bg:w?"transparent":"gray.50",transitionProperty:"all",transitionDuration:"normal",maxW:"xs",mx:"auto",children:(0,t.jsxs)(tX.Stack,{spacing:3,transform:w?"scale(1) ":"scale(0.9) ",transitionProperty:"all",transitionDuration:"normal",children:[(0,t.jsx)(ev.Image,{src:a?.previewUrl||iR.default.src,fallbackSrc:iR.default.src,fit:"cover",borderRadius:"md",boxShadow:"xl",border:"1px solid",borderColor:"blackAlpha.50"}),(0,t.jsx)(P.Text,{fontSize:"md",children:p})]})}),w?(0,t.jsxs)(ie.Alert,{status:"success",children:[(0,t.jsx)(iF.AlertIcon,{}),(0,t.jsxs)(tX.Stack,{spacing:0,children:[(0,t.jsx)(iH.AlertTitle,{children:(0,t.jsx)(g.Trans,{message:"Template created.",id:"iLt90Y"})}),(0,t.jsx)(iz.AlertDescription,{children:(0,t.jsx)(g.Trans,{message:'"{templateName}" is now ready for your workspace to edit and use.',id:"Dp2AEq",values:{templateName:p}})})]})]}):(0,t.jsxs)(iW.FormControl,{isRequired:!0,isInvalid:!p,isDisabled:y,children:[(0,t.jsx)(iU.FormLabel,{children:(0,t.jsx)(g.Trans,{message:"Template name",id:"5OwALL"})}),(0,t.jsx)(t6.Input,{ref:m,placeholder:c,value:p,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),v())}})]})]})}),(0,t.jsx)(iV.ModalFooter,{children:w?(0,t.jsxs)(j.Flex,{gap:2,flexWrap:"wrap",children:[r&&(0,t.jsx)(l.Button,{variant:"plain",onClick:k,children:(0,t.jsx)(g.Trans,{message:"View all templates",id:"lLxUlk"})}),C&&(0,t.jsx)(l.Button,{variant:"solid",onClick:S,children:(0,t.jsx)(g.Trans,{message:"Open template in editor",id:"jnz/ol"})})]}):(0,t.jsx)(l.Button,{variant:"solid",onClick:v,isDisabled:!p||y,isLoading:y,children:(0,t.jsx)(g.Trans,{message:"Save copy as template",id:"FZQC0K"})})})]})]})},iK=({result:e})=>{let{fileId:i,docId:n,title:a,previewUrl:r,editors:o,editedTime:s,createdBy:p}=e,m="SearchResult"===e.__typename?e.text:void 0,f=p?.displayName,b=(0,iB.normalizeDate)(s),x=(0,iT.useBreakpointValue)({base:!0,md:!1}),{isOpen:y,onOpen:v,onClose:C}=(0,u.useDisclosure)({id:"save-copy-as-template-modal"}),w=e=>{e.stopPropagation(),v()},S={docId:n??i,title:(0,iN.sanitize)(a||""),previewUrl:r,fileId:i};return(0,t.jsxs)(d.HStack,{className:"add-to-workspace-templates-modal-row",wordBreak:"break-word",p:3,spacing:{base:3,md:6},alignItems:"center",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",borderColor:"transparent",_hover:{bg:"gray.50",borderColor:"gray.200",cursor:"pointer"},color:"gray.700",borderWidth:"1px",onClick:v,sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,t.jsxs)(d.HStack,{spacing:"3",flex:"1",alignItems:"flex-start",children:[(0,t.jsx)(ev.Image,{h:"100%",src:r,w:{base:32,sm:40},border:"1px solid",borderColor:"gray.200",borderRadius:"md",shadow:"lg",fallbackSrc:iR.default.src}),(0,t.jsxs)(tX.Stack,{spacing:1,flex:"1",children:[a&&(0,t.jsx)(P.Text,{fontSize:"md",fontWeight:"600",noOfLines:2,children:(0,t.jsx)(iO.HighlightedText,{text:a})}),f&&(0,t.jsx)(P.Text,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,t.jsx)(g.Trans,{message:"Created by {createdByDisplayName}",id:"a/5Qb5",values:{createdByDisplayName:f}})}),m&&(0,t.jsx)(P.Text,{fontSize:"sm",noOfLines:2,whiteSpace:"normal",wordBreak:"break-word",children:(0,t.jsx)(iO.HighlightedText,{text:m})}),(0,t.jsxs)(d.HStack,{children:[o&&o.length>0&&(0,t.jsx)(ee.AvatarGroup,{size:"xs",fontSize:"xs",max:5,children:o?.map(({user:e})=>{let{id:i,displayName:n,profileImageUrl:a}=e;return(0,t.jsx)(ei.TooltipAvatar,{label:n,src:a,shadow:"base"},i)})}),s&&(0,t.jsx)(P.Text,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,t.jsx)(g.Trans,{message:"Edited {lastEditedTime}",id:"OwE+Ks",values:{lastEditedTime:b}})})]})]})]}),x?(0,t.jsx)(c.IconButton,{"aria-label":"Create template",icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faChevronRight}),onClick:w,size:"sm",variant:"plain"}):(0,t.jsx)(l.Button,{onClick:w,variant:"solid",size:"sm",children:(0,t.jsx)(g.Trans,{message:"Create template...",id:"50j3hV"})}),y&&(0,t.jsx)(iZ,{isOpen:y,onClose:C,docPreview:S,showViewTemplates:!1})]},i)},iq=({isOpen:e,onClose:i})=>{let a=(0,n.useRef)(null),[r,o]=(0,n.useState)(""),[s,{data:l,loading:d}]=(0,t7.useSearchDocsToMakeTemplatesLazyQuery)(),[c,u]=(0,n.useState)([]),{currentWorkspace:p}=(0,ih.useUserContext)(),h=p?.id,{recentItems:m,loading:b}=(()=>{let{currentWorkspace:e}=(0,ih.useUserContext)(),t=e?.id,{data:i,loading:n}=(0,t7.useGetFilesForWorkspaceTemplatesQuery)({variables:{first:50,workspaceId:t,archived:!1,sortBy:{field:t7.FileSortField.LastViewed,direction:t7.SortDirection.Desc}},fetchPolicy:"cache-first"});return{recentItems:(i?.files.edges.map(e=>e.node)||[]).slice(0,8).map(e=>({fileId:e.id,docId:e.mainPageId,title:e.title,previewUrl:e.previewUrl,editors:e.editors,editedTime:e.editedTime,createdBy:e.createdBy,__typename:"RecentFileResult"})),loading:n}})(),x=l?.search;(0,n.useEffect)(()=>{x&&u(x.filter(e=>"DocResult"===e.__typename).map(e=>({fileId:e.file?.id||e.id,docId:e.id,title:e.title,previewUrl:e.previewUrl,editors:e.editors,editedTime:e.editedTime,createdBy:e.createdBy,text:e.text??void 0,__typename:"SearchResult"})))},[x]),(0,n.useLayoutEffect)(()=>{e&&a?.current?.select()},[e]);let y=(0,ix.useDebounced)(s,600),v=!!r,C=!!c?.length,w=(0,n.useMemo)(()=>v&&C?c:m||[],[v,C,c,m]),S=(0,n.useCallback)(e=>{let{value:t}=e.target;t?(o(t),y({variables:{workspaceId:h,query:t}})):(y.cancel(),o(""),u([]))},[h,y]);return(0,t.jsxs)(tG.Modal,{isOpen:e,onClose:i,size:"4xl",initialFocusRef:a,children:[(0,t.jsx)(tY.ModalOverlay,{}),(0,t.jsxs)(tK.ModalContent,{maxH:"90vh",children:[(0,t.jsx)(tq.ModalHeader,{children:(0,t.jsxs)(tX.Stack,{spacing:4,children:[(0,t.jsx)(g.Trans,{message:"Add to workspace templates",id:"qJ1Iy1"}),(0,t.jsxs)(t9.InputGroup,{size:"lg",children:[(0,t.jsx)(t8.InputLeftElement,{p:4,pointerEvents:"none",color:"gray.300",children:(0,t.jsx)(t4,{"aria-label":f.i18n._({id:"A1taO8",message:"Search"})})}),(0,t.jsx)(t6.Input,{ref:a,placeholder:f.i18n._({id:"D7FUvT",message:"Search for a {GAMMA_ARTIFACT_PROPER_NOUN}",values:{GAMMA_ARTIFACT_PROPER_NOUN:A.GAMMA_ARTIFACT_PROPER_NOUN}}),value:r,onChange:S,_placeholder:{opacity:1,color:"gray.300"}}),(0,t.jsx)(t8.InputRightElement,{p:4,pointerEvents:"none",color:"gray.500",opacity:+!!d,transitionProperty:"common",transitionDuration:"normal",children:(0,t.jsx)(iD.Spinner,{size:"sm"})})]})]})}),(0,t.jsx)(tZ.ModalCloseButton,{}),(0,t.jsx)(t$.ModalBody,{overflowY:"auto",minH:"540px",px:"3",children:b?(0,t.jsxs)(tX.Stack,{spacing:2,w:"100%",pb:12,children:[(0,t.jsx)(iI.Skeleton,{h:24,w:"100%"}),(0,t.jsx)(iI.Skeleton,{h:24,w:"100%"}),(0,t.jsx)(iI.Skeleton,{h:24,w:"100%"}),(0,t.jsx)(iI.Skeleton,{h:24,w:"100%"})]}):(0,t.jsx)(tX.Stack,{spacing:0,h:"100%",children:w?.map(e=>(0,t.jsx)(iK,{result:e},e.fileId))})})]})]})},iY=({buttonProps:e})=>{let i=(0,tI.useCanUseProductFeature)("workspace_templates"),{openUpsellModal:a}=(0,iP.useMonetizationContext)(),r=(0,tI.useWorkspaceAllowsWorkspaceSharing)(),{isOpen:o,onOpen:s,onClose:d}=(0,u.useDisclosure)({id:"add-to-workspace-templates-modal"}),c=(0,n.useCallback)(()=>{i?s():a({segmentEvent:_.SegmentEvents.GAMMA_PRO_UPSELL_WORKSPACE_TEMPLATES,upsellLocation:"workspaceTemplates",targetFeature:"workspace_templates"})},[s,a,i]);return!1===r?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Button,{variant:"solid",onClick:c,leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faPlus}),...e,rightIcon:(0,t.jsx)(t3.UpsellProductBadge,{canUseFeature:i,productFeature:"workspace_templates"}),children:(0,t.jsx)(g.Trans,{message:"Add a {GAMMA_ARTIFACT_PROPER_NOUN}",id:"E/qjf9",values:{GAMMA_ARTIFACT_PROPER_NOUN:A.GAMMA_ARTIFACT_PROPER_NOUN}})}),o&&(0,t.jsx)(iq,{isOpen:o,onClose:d})]})},iX=({size:e})=>!1===(0,tI.useWorkspaceAllowsWorkspaceSharing)()?(0,t.jsx)(iL.EmptyState,{title:(0,t.jsx)(g.Trans,{message:"No workspace templates",id:"KOscyb"}),description:(0,t.jsx)(g.Trans,{message:"No workspace templates have been added yet.",id:"QLwnOe"}),size:e}):(0,t.jsx)(iL.EmptyState,{title:(0,t.jsx)(g.Trans,{message:"Add your first template",id:"x/5lom"}),description:(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(g.Trans,{message:"Create once, reuse forever. Turn any {GAMMA_ARTIFACT_PROPER_NOUN} into a reusable workspace template for fast, consistent outputs.",id:"tsR+jE",values:{GAMMA_ARTIFACT_PROPER_NOUN:A.GAMMA_ARTIFACT_PROPER_NOUN}})}),alternateVisual:(0,t.jsx)(iJ,{}),size:e,children:(0,t.jsx)(iY,{})}),iQ=()=>[f.i18n._({id:"/AfnO+",message:"Customize this sales pitch for the following client:"}),f.i18n._({id:"g0A23W",message:"Use this lesson plan template to create a new one about:"}),f.i18n._({id:"BVUhZc",message:"Using the layouts in this template, create a presentation about:"}),f.i18n._({id:"lvWoAF",message:"Fill in this proposal with the following content:"}),f.i18n._({id:"QBtg9U",message:"Update this report using the following information:"})],iJ=(0,n.memo)(()=>{let e=(0,ij.useLocalizedFunction)(iQ,[]),[i,a]=(0,n.useState)(0),r=(0,n.useRef)(void 0);(0,n.useEffect)(()=>{a(0)},[e]),(0,n.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);let o=e[i],s=(0,iT.useBreakpointValue)({base:!0,md:!1}),l=((e,t={})=>{let{typingSpeed:i=40,deletingSpeed:a=5,pauseBeforeDelete:r=2e3,shouldDelete:o=!0,onComplete:s}=t,[l,d]=(0,n.useState)(""),[c,u]=(0,n.useState)(!0),[p,h]=(0,n.useState)(0),[m,g]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let t;if(!m)return c?p{d(e.slice(0,p+1)),h(p+1)},i):o?t=setTimeout(()=>{u(!1)},r):(g(!0),s?.()):p>0?t=setTimeout(()=>{d(e.slice(0,p-1)),h(p-1)},a):(g(!0),s?.()),()=>clearTimeout(t)},[e,p,c,m,i,a,r,o,s]),(0,n.useEffect)(()=>{d(""),u(!0),h(0),g(!1)},[e]),l})(o,{onComplete:()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{a(t=>(t+1)%e.length)},300)}});return(0,t.jsxs)(d.HStack,{display:"flex",alignItems:"stretch",justifyContent:"flex-start",w:"100%",minW:"200px",maxW:"400px",spacing:"3",my:"3",children:[(0,t.jsx)(j.Flex,{flex:"1",alignItems:"stretch",sx:s?{minH:"6em",h:"6em"}:{},children:(0,t.jsxs)(iM.Code,{flex:"1",h:"100%",lineHeight:"1.5",fontSize:s?"xs":"sm",p:"4",borderRadius:"md",color:"purple.800",bg:"purple.100",border:"1px solid",borderColor:"purple.300",pointerEvents:"none",userSelect:"none",children:[l,(0,t.jsx)(iM.Code,{fontSize:s?"xs":"sm",as:"span",lineHeight:"1.5",sx:{"@keyframes blink":{"0%, 50%":{opacity:1},"51%, 100%":{opacity:0}},animation:"blink 1s infinite"},fontWeight:"bold",bg:"pink.100",color:"pink.400",children:"|"})]})}),!s&&(0,t.jsx)(j.Flex,{flex:"1",height:"100%",w:"100%",overflow:"hidden",borderRadius:"md",children:(0,t.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,children:[(0,t.jsx)("source",{src:"https://static.gamma.app/videos/empty-states/cauldron_32c393d8.mp4"}),(0,t.jsx)("source",{src:"https://static.gamma.app/videos/empty-states/cauldron_109b0f79.webm"})]})})]})});iJ.displayName="TypingPromptsPlaceholder";let i0={base:2,md:2,lg:3,xl:3,"2xl":4},i1={base:3,md:4,lg:6},i2=({isLoading:e,isEmpty:i,templates:n,onLoadMoreClick:a,hasNextPage:r,isFetchingMore:o,renderEmptyState:s,renderLoadingState:d,renderCard:c,gridProps:u})=>{let p={columns:i0,gap:i1,...u};return e?d?d():(0,t.jsxs)(io.SimpleGrid,{...p,children:[(0,t.jsx)(iI.Skeleton,{width:"100%",height:48,borderRadius:"md"}),(0,t.jsx)(iI.Skeleton,{width:"100%",height:48,borderRadius:"md"}),(0,t.jsx)(iI.Skeleton,{width:"100%",height:48,borderRadius:"md"})]}):i?s?s():(0,t.jsx)(iX,{size:"lg"}):(0,t.jsxs)(tX.Stack,{spacing:6,children:[(0,t.jsx)(io.SimpleGrid,{...p,children:n.map(e=>c(e))}),r&&(0,t.jsx)(l.Button,{alignSelf:"center",variant:"plain",size:"sm",w:"fit-content",onClick:a,isLoading:o,children:(0,t.jsx)(g.Trans,{message:"Load more",id:"yQ2kGp"})})]})},i3=({isArchived:e,showFooter:i,renderEmptyState:a,renderLoadingState:r,renderCard:o,gridProps:s,sortOptionsButtonVariant:l})=>{let[d,c]=(0,im.useLocalStorage)(ib.USER_SETTINGS_CONSTANTS.workspaceTemplatesSortBy,id),[u,p]=(0,n.useState)(""),h=(0,n.useRef)(null),[m,g]=(0,im.useLocalStorage)(ib.USER_SETTINGS_CONSTANTS.workspaceTemplatesSortDirection,t7.SortDirection.Desc),{templates:b,loadMore:x,hasNextPage:y,isInitialLoading:v,isFetchingMore:C,isEmpty:w,loading:S}=ig({archived:e,sortBy:d,sortDirection:m}),k=(0,n.useCallback)(()=>{x()},[x]),{results:A,loading:E}=(({query:e})=>{let{currentWorkspace:t}=(0,ih.useUserContext)(),i=t?.id,[a,r]=(0,n.useState)(!1),[o,{data:s,loading:l,networkStatus:d}]=(0,t7.useSearchTemplatesLazyQuery)({notifyOnNetworkStatusChange:!0}),c=(0,ix.useDebounced)((0,n.useCallback)(async e=>{await o({variables:{workspaceId:i,query:e,isTemplate:!0}}),r(!1)},[o,i]),600),u=s?.search,p=(0,n.useMemo)(()=>{if(u)return u.filter(e=>e.file?.id).map(e=>({id:e.file.id,mainPageId:e.id,title:e.title,rawTitle:e.rawTitle??void 0,previewUrl:e.previewUrl,createdBy:e.createdBy,createdTime:e.createdTime,archived:e.archived,text:e.text??void 0}))},[u]),h=l||a||d===ic.NetworkStatus.setVariables;return(0,n.useEffect)(()=>{i&&e&&0!==e.length?(r(!0),c(e)):r(!1)},[e,c,i]),{results:p,loading:h}})({query:u}),_=u.length>0,I=(0,n.useMemo)(()=>_?A||[]:b,[_,A,b]),M=_&&!E&&!A?.length,T=M?()=>(0,t.jsx)(P.Text,{children:"No results found"}):a;return(0,t.jsxs)(tX.Stack,{spacing:6,children:[!w&&!v&&(0,t.jsxs)(tX.Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[(0,t.jsxs)(t9.InputGroup,{maxW:"md",size:{base:"md",md:"sm"},children:[(0,t.jsx)(t8.InputLeftElement,{pointerEvents:"none",color:"gray.300",children:(0,t.jsx)(t4,{})}),(0,t.jsx)(t6.Input,{placeholder:f.i18n._({id:"UQAp48",message:"Search templates"}),value:u,onChange:e=>p(e.target.value),ref:h,borderRadius:"md",onKeyDown:e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),""===u&&h.current?.blur(),p(""))}}),u?.length&&(0,t.jsx)(t8.InputRightElement,{children:(0,t.jsx)(L.CloseButton,{zIndex:1,size:"sm",color:"gray.300",onClick:()=>p("")})})]}),!u?.length&&(0,t.jsx)(i_,{sortBy:d,setSortBy:c,sortDirection:m,setSortDirection:g,buttonVariant:l})]}),(0,t.jsx)(eo.Box,{minH:"600px",children:(0,t.jsx)(i2,{templates:I,isLoading:v||E||S,isEmpty:w||M,onLoadMoreClick:k,hasNextPage:y,isFetchingMore:C,renderEmptyState:T,renderLoadingState:r,renderCard:o,gridProps:s})}),i&&!u?.length&&(0,t.jsx)(tX.Stack,{spacing:4,pb:"12",children:(0,t.jsx)(il,{})})]})};var i5=e.i(607400);let i4="gamma:cardTemplateModalState",i6="workspace",i9={activeTabName:"all",selectedTemplate:null};var i8=e.i(860686);let i7=(e,i,a=null,r=0,o=0)=>{if(!i||!i.type)return(0,t.jsx)(n.default.Fragment,{},o);if("text"===i.type)return(0,t.jsx)(n.default.Fragment,{},`text-${o}`);let s=e.nodes[i.type];if(!s)return(0,t.jsx)(n.default.Fragment,{});let l=i.content?.map((t,n)=>i7(e,t,i,r+1,n));return n.default.createElement(s.component,{key:`${s.type}-${o}`,node:i,depth:r,parent:a,index:o},l)};var ne=e.i(53158);let nt=({children:e,orientation:i="vertical",...n})=>{let a="vertical"===i?tX.Stack:d.HStack;return(0,t.jsx)(a,{spacing:"var(--block-spacing)",...n,children:e})},ni=e=>(0,t.jsx)(eo.Box,{bg:"var(--main-color)",h:"var(--paragraph-height)",w:"100%",borderRadius:"var(--text-border-radius)",...e}),nn=({style:e="solid",children:i,...n})=>(0,t.jsx)(nt,{w:"100%",bg:"solid"===e?"var(--main-color)":"transparent",minH:"2em",borderRadius:"var(--box-border-radius)",border:"outline"===e?"var(--border-width) solid var(--main-color)":"none",...n,children:i&&i});var na=e.i(349904);let nr=({iconSize:e="2x",icon:i,...n})=>(0,t.jsx)(na.Center,{minH:"4em",bg:"var(--box-background-color)",color:"var(--accent-color)",borderRadius:"var(--box-border-radius)",...n,children:i||(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faImage,size:e})}),no={top:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"auto 1fr",gridTemplateAreas:'"accent" "body"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!1},behind:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"auto"},items:{accent:{type:"accent",style:{gridArea:"1 / 1"}},body:{type:"body",style:{gridArea:"1 / 1",zIndex:1}}},allowFit:!1},blank:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"1fr",gridTemplateAreas:'"body"'},items:{body:{type:"body"}},allowFit:!1},left:{grid:{gridTemplateColumns:`37.5% ${62.5}%`,gridTemplateRows:"auto ",gridTemplateAreas:'"accent body"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!0},right:{grid:{gridTemplateColumns:`${62.5}% 37.5%`,gridTemplateRows:"auto",gridTemplateAreas:'"body accent"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!0}},ns=e=>no[e??"blank"]||no.blank,nl=e=>{let{node:i}=e;return i.attrs?.itemId==="accent"?(0,t.jsx)(nc,{...e}):(0,t.jsx)(nd,{...e})},nd=({node:e,children:i})=>(0,t.jsx)(nt,{className:`thumbnail-node-${e.type}`,spacing:"1em",p:"1em",alignSelf:"center","data-testid":"card-layout-thumbnail",children:i}),nc=({node:e,parent:i})=>{let n=e.attrs,a=i?.attrs,r=ns(a?.layout??"blank");if(!(n?.itemId&&r.items[n.itemId]))return null;let o=r.allowFit&&n?.fitType==="fit";return(0,t.jsx)(j.Flex,{className:`thumbnail-node-${e.type}`,children:o?(0,t.jsx)(j.Flex,{flexDirection:"column",justifyContent:"center",alignItems:"center",bg:"var(--box-background-color)",flex:1,h:"100%",children:(0,t.jsx)(nr,{w:"70%",minH:"55%",bg:"var(--main-color)"})}):(0,t.jsx)(nr,{w:"100%",h:"auto",borderRadius:"none"})})},nu=({node:e,isCollapsed:i=!1,children:n})=>{let a=e.attrs,r=ns(a?.layout??"blank"),o=r.items,s=e.content?.[0]?.type==="cardImageItem";return(0,t.jsx)(j.Flex,{className:(0,ej.cx)(`thumbnail-node-${e.type}`,i&&"collapsed"),"data-testid":"card-thumbnail",minH:i?"2.5em":"var(--card-template-min-height)",w:i?"100%":"var(--card-template-width)",h:"auto",border:"2px solid",borderColor:"var(--main-color)",borderRadius:"base",flexDirection:"column",overflow:"hidden",children:(0,t.jsxs)(j.Flex,{flexDirection:"column",fontSize:"0.375em",flex:1,justifyContent:"center",children:[!i&&(0,t.jsx)(eo.Box,{display:s?"flex":"grid",flex:1,sx:s?void 0:{...r.grid,...o.body&&{"> .thumbnail-node-cardLayoutItem":o.body?.style??{gridArea:"body"}},...o.accent&&{"> .thumbnail-node-cardAccentLayoutItem":o.accent?.style??{gridArea:"accent"}}},children:n}),i&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(ni,{w:"50%",mx:"1em",h:"2em",borderRadius:"calc(var(--text-border-radius) * 2)"})})]})})},np={bar:N.faChartSimple,pie:N.faChartPie,line:N.faChartLine,donut:N.faDonut,"horizontal-bar":N.faChartSimpleHorizontal},nh={column:N.faChartSimple,bar:N.faChartSimpleHorizontal,line:N.faChartLine,pie:N.faChartPie,donut:N.faDonut};var nm=e.i(714521),ng=e.i(879891);let nf=e=>({"--flex-align":(0,eu.getFlexAlign)(e)});var nb=e.i(408553);let nx=({children:e,...i})=>(0,t.jsx)(eo.Box,{boxSize:"var(--bullet-size)",borderRadius:"0.25em",bg:"var(--main-color)",...i,children:e}),ny="0.5em";var nv=e.i(517103);let nC={xs:"sm",sm:"sm",md:"lg",lg:"xl",xl:"2x",full:"2x"},nw=({node:e,parent:i,children:n})=>{let a=nf(i?.attrs?.options?.horizontalAlign??"center"),r=i?.attrs?.options?.imageShape??"square",o=nv.ImageShapeStyles[r],s=i?.attrs?.variantKey==="iconsText",l=i?.attrs?.options?.shapeSize||"lg",d={"& .thumbnail-node-paragraph > div:nth-of-type(1n+3)":{display:"none"}};return(0,t.jsxs)(j.Flex,{className:`thumbnail-node-${e.type}`,gap:"var(--block-spacing)",flexDirection:"column",children:[s?(0,t.jsx)(nr,{minH:"0",icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faStar,size:nC[l]||"lg"}),bg:s?"none":void 0}):(0,t.jsx)(nr,{minH:"2em",minW:"2em",sx:o}),(0,t.jsx)(nt,{css:a,sx:s?void 0:d,children:n})]})},nS=({node:e,children:i})=>{let n=e.attrs?.variantKey==="iconsText";return(0,t.jsx)(io.SimpleGrid,{rowGap:"1.5em",columnGap:"1.5em",columns:n?4:3,children:i})},nk="0.25em",nA=({node:e})=>(0,t.jsx)(j.Flex,{className:`thumbnail-node-${e.type}`,bg:"var(--main-color)",h:"1.25em"}),nE=({isFunnel:e=!1,children:i})=>(0,t.jsx)(io.SimpleGrid,{columns:1,autoRows:"1fr",gap:nk,pos:"relative",mx:"auto",w:"min(100%, calc((var(--card-template-width) * 0.5) / 0.375))",clipPath:e?"polygon(50% 100%, 0 0, 100% 0)":"polygon(50% 0%, 0% 100%, 100% 100%)",children:i}),n_={bullets:{Cell:({node:e,children:i})=>(0,t.jsxs)(j.Flex,{className:`thumbnail-node-${e.type}`,pos:"relative",align:"flex-start",gap:"1em",flex:"1 1 auto",w:"calc(50% - 1em)",children:[(0,t.jsx)(nx,{}),(0,t.jsx)(nt,{flex:"1",children:i})]}),Wrapper:({children:e})=>(0,t.jsx)(j.Flex,{gap:"1em",wrap:"wrap",children:e})},timeline:{Cell:({node:e,parent:i,children:n})=>{let a=i?.attrs?.options?.orientation==="horizontal",r="2em";return(0,t.jsxs)(j.Flex,{className:`thumbnail-node-${e.type}`,pos:"relative",...a?{gridColumn:"span 2",gridRow:3,align:"flex-start",justify:"center",pt:r}:{gridRow:"span 2",gridColumn:3,align:"flex-start",pl:r},orientation:"horizontal",align:"start",children:[(0,t.jsx)(nx,{pos:"absolute",...a?{top:0,transform:"translateY(-50%)"}:{left:0,transform:"translateX(-50%)"},children:(0,t.jsx)(eo.Box,{position:"absolute",zIndex:"-1",bg:"var(--main-color)",...a?{height:"1em",width:"var(--border-width)",left:"50%",top:"100%",transform:"translateX(-50%)"}:{width:"1em",height:"var(--border-width)",top:"50%",transform:"translateY(-50%)",left:"100%"}})}),(0,t.jsx)(nt,{flex:"1",children:n})]})},Wrapper:({children:e,node:i})=>{let n=i.attrs?.options?.orientation==="horizontal",a=n?(0,t.jsx)(eo.Box,{gridRow:2,gridColumn:1,children:(0,t.jsx)(eo.Box,{position:"absolute",height:"var(--border-width)",width:"100%",left:"0",right:"0",bg:"var(--main-color)"})}):(0,t.jsx)(na.Center,{gridColumn:2,gridRow:1,children:(0,t.jsx)(eo.Box,{position:"absolute",width:"var(--border-width)",top:"0",bottom:"0",bg:"var(--main-color)"})});return(0,t.jsxs)(i8.Grid,{...n?{templateRows:"auto 0px auto",autoColumns:"1fr",justifyContent:"center",columnGap:"1em",mt:"var(--bullet-size)"}:{templateColumns:"0px 0px 1fr",autoRows:"auto",justifyContent:"center",rowGap:"1em",ml:"var(--bullet-size)"},pos:"relative","data-testid":"timeline-thumbnail",children:[a,e]})}},imagesText:{Cell:nw,Wrapper:nS},textBoxes:{Cell:({node:e,parent:i,children:n})=>{let a=nf(i?.attrs?.options?.horizontalAlign||"center");return(0,t.jsx)(nn,{className:`thumbnail-node-${e.type}`,bg:"var(--box-background-color)",p:"var(--box-padding)",css:a,children:n})},Wrapper:({children:e})=>(0,t.jsx)(j.Flex,{gap:"var(--block-spacing)",children:e})},stats:{Cell:({children:e,node:i,parent:n})=>{let a=nf(n?.attrs?.options?.horizontalAlign||"center");return(0,t.jsxs)(nt,{className:`thumbnail-node-${i.type}`,align:"center",justify:"start",children:[(0,t.jsx)(P.Text,{color:"var(--accent-color)",fontSize:"1.5em",children:i.attrs?.label||"X%"}),(0,t.jsx)(nt,{w:"100%",css:a,children:e})]})},Wrapper:({children:e,parent:i})=>{let n=i?.type==="gridCell"?1:3;return(0,t.jsx)(io.SimpleGrid,{columns:n,columnGap:"1.5em",rowGap:"1.5em",children:e})}},barStats:{Cell:({node:e,parent:i,children:n})=>{let a=(0,nb.getStatsPercent)({label:e.attrs?.label||null}),r=nf(i?.attrs?.options?.horizontalAlign||"center");return(0,t.jsxs)(nt,{className:`thumbnail-node-${e.type}`,align:"center",justify:"start",children:[(0,t.jsxs)(nt,{borderRadius:"calc(var(--box-border-radius) / 2)",overflow:"hidden",orientation:"horizontal",flex:1,w:"100%",bg:"var(--main-color)",children:[(0,t.jsx)(eo.Box,{w:"100%",bg:"var(--accent-color)",pos:"relative",h:"1.25em",children:(0,t.jsx)(eo.Box,{pos:"absolute",inset:0})}),(0,t.jsx)(eo.Box,{w:`${100*a}%`,pos:"relative"})]}),(0,t.jsx)(nt,{w:"100%",css:r,children:n})]})},Wrapper:({children:e,parent:i})=>{let n=i?.type==="gridCell"?1:2;return(0,t.jsx)(io.SimpleGrid,{columns:n,columnGap:"1.5em",rowGap:"1em",children:e})}},staircase:{Cell:({node:e,parent:i,index:n})=>{let a=Math.floor(33+n*(67/((i?.content?.length??1)-1)));return(0,t.jsx)(j.Flex,{className:`thumbnail-node-${e.type}`,borderRadius:"2px",bg:"var(--main-color)",h:"1.25em",w:`${a}%`})},Wrapper:({node:e,children:i})=>{let n=e?.attrs?.options?.horizontalAlign??"center",a=(0,eu.getFlexAlign)(n);return(0,t.jsx)(nt,{align:a,gap:nk,mx:"auto",w:"min(100%, calc((var(--card-template-width) * 0.5) / 0.375))",children:i})}},pyramid:{Cell:nA,Wrapper:nE},funnel:{Cell:e=>(0,t.jsx)(nA,{...e}),Wrapper:({children:e,...i})=>(0,t.jsx)(nE,{isFunnel:!0,...i,children:e})},circleStats:{Cell:({node:e,parent:i,children:n})=>{let a=(0,eu.getFlexAlign)(i?.attrs?.options?.horizontalAlign||"center"),r=(0,nb.getStatsPercent)({label:e.attrs?.label??"50"});return(0,t.jsxs)(j.Flex,{className:`thumbnail-node-${e.type}`,gap:"var(--block-spacing)",flexDirection:"column",children:[(0,t.jsx)(eo.Box,{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",w:"80%",alignSelf:"center",aspectRatio:"1 / 1",_before:{content:'""',position:"absolute",top:"0",left:"0",right:"0",bottom:"0",borderRadius:"50%",background:`conic-gradient(var(--accent-color) ${100*r}%, var(--main-color) 0 ${(100-r)*100}%)`,zIndex:1},_after:{content:'""',position:"absolute",top:ny,left:ny,right:ny,bottom:ny,background:"var(--card-background)",borderRadius:"50%",zIndex:2},children:(0,t.jsx)(eo.Box,{zIndex:"100",bg:"var(--main-color)",h:"0.5em",pos:"absolute",borderRadius:"var(--text-border-radius)",w:"40%"})}),(0,t.jsx)(nt,{css:a,children:n})]})},Wrapper:({children:e})=>(0,t.jsx)(io.SimpleGrid,{gap:"1.5em",columns:3,children:e})},arrows:{Cell:({node:e,parent:i,children:n})=>{let a=nf(i?.attrs?.options?.horizontalAlign||"left"),r=i?.attrs?.options?.orientation==="vertical";return(0,t.jsxs)(j.Flex,{className:`thumbnail-node-${e.type}`,gap:"var(--block-spacing)",flexDirection:r?"row":"column",children:[(0,t.jsx)(eo.Box,{width:r?"1.5em":"100%",height:r?"100%":"1.25em",bg:"var(--accent-color)",clipPath:r?"polygon(50% 10%, 100% 0, 100% 90%, 50% 100%, 0 90%, 0% 0%)":"polygon(90% 0, 100% 50%, 90% 100%, 0% 100%, 10% 50%, 0% 0%)"}),(0,t.jsx)(nt,{flex:1,css:a,p:"0.5em",px:r?0:"0.5em",pt:r?void 0:0,children:n})]})},Wrapper:({node:e,children:i})=>{let n=e.attrs?.options?.orientation==="vertical";return(0,t.jsx)(io.SimpleGrid,{columns:n?1:3,rowGap:n?void 0:"1.5em",children:i})}},iconsText:{Cell:nw,Wrapper:nS}},nI=({children:e})=>(0,t.jsx)(nn,{p:"var(--box-padding)",bg:"var(--box-background-color)",w:"100%",children:e}),nM=({children:e})=>(0,t.jsx)(nn,{p:"var(--box-padding)",bg:"var(--box-background-color)",w:"100%",children:e}),nT={nodes:{card:{type:"card",component:({depth:e,...i})=>e>2?(0,t.jsx)(t.Fragment,{}):e>1?(0,t.jsx)(nu,{...i,isCollapsed:!0}):(0,t.jsx)(nu,{...i})},cardLayoutItem:{type:"cardLayoutItem",component:nl},cardAccentLayoutItem:{type:"cardAccentLayoutItem",component:nl},cardImageItem:{type:"cardImageItem",component:({node:e})=>(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`,icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faImage,size:"2x"}),w:"100%"})},title:{type:"title",component:({node:e})=>(0,t.jsx)(eo.Box,{className:`thumbnail-node-${e.type}`,w:"50%",bg:"var(--main-color)",h:`${(0,nm.getFontSizeOption)("title").size/2}em`,borderRadius:"var(--text-border-radius)"})},paragraph:{type:"paragraph",component:({node:e})=>(0,t.jsxs)(tX.Stack,{className:`thumbnail-node-${e.type}`,"data-testid":"paragraph-thumbnail",spacing:"var(--line-spacing)",align:"var(--flex-align)",children:[(0,t.jsx)(ni,{}),(0,t.jsx)(ni,{}),(0,t.jsx)(ni,{w:"85%"})]})},heading:{type:"heading",component:({node:e})=>(0,t.jsx)(eo.Box,{className:`thumbnail-node-${e.type}`,"data-testid":"heading-thumbnail",bg:"var(--main-color)",h:`${(0,nm.getFontSizeOption)((0,nm.fontSizeFromHeading)(e.attrs?.level)).size/2}em`,borderRadius:"var(--text-border-radius)"})},bullet:{type:"bullet",component:({node:e})=>(0,t.jsxs)(nt,{className:`thumbnail-node-${e.type}`,orientation:"horizontal",align:"start",pl:"0.5em",color:"var(--main-color)",children:[(0,t.jsx)(ne.Circle,{size:"var(--block-spacing)",bg:"var(--main-color)"}),(0,t.jsx)(nt,{orientation:"horizontal",flex:"1",children:(0,t.jsx)(ni,{w:"75%"})})]})},gridLayout:{type:"gridLayout",component:({node:e,children:i})=>(0,t.jsx)(i8.Grid,{className:`thumbnail-node-${e.type}`,templateColumns:`repeat(${e.attrs?.colWidths?.length||2}, 1fr)`,gap:"var(--block-spacing)",children:i})},gridCell:{type:"gridCell",component:({node:e,children:i})=>{let n=e.attrs?.verticalAlign;return(0,t.jsx)(nt,{className:`thumbnail-node-${e.type}`,justifyContent:n,flex:1,children:i})}},image:{type:"image",component:({node:e})=>(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`})},mediaPlaceholder:{type:"mediaPlaceholder",component:({node:e})=>{let i=e.attrs,n=i?.source,a=n&&ng.MediaProvidersMap[n]?.icon||null;return(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`,icon:a?(0,t.jsx)(h.FontAwesomeIcon,{icon:a,size:"2x"}):void 0})}},buttonGroup:{type:"buttonGroup",component:({node:e,children:i})=>(0,t.jsx)(nt,{className:`thumbnail-node-${e.type}`,orientation:"horizontal",children:i})},button:{type:"button",component:({node:e})=>{let i=e.attrs?.variant||"solid";return(0,t.jsx)(nn,{className:`thumbnail-node-${e.type}`,minH:"1.5em",w:"25%",style:i})}},gallery:{type:"gallery",component:({node:e})=>(0,t.jsxs)(nn,{className:`thumbnail-node-${e.type}`,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",bg:"var(--box-background-color)",p:"0.5em",children:[(0,t.jsx)(nr,{flex:2,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"}),(0,t.jsx)(nr,{flex:1,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"}),(0,t.jsx)(nr,{flex:2,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"})]})},toggle:{type:"toggle",component:({node:e,children:i})=>(0,t.jsx)(eo.Box,{className:`thumbnail-node-${e.type}`,pl:"0.5em","data-open":"false",sx:{'&[data-open="false"]':{"> :not(:first-of-type)":{display:"none"}}},children:i})},toggleSummary:{type:"toggleSummary",component:({node:e})=>(0,t.jsxs)(nt,{className:`thumbnail-node-${e.type}`,orientation:"horizontal",color:"var(--main-color)",maxH:"1em",children:[(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faCaretRight,size:"xl"}),(0,t.jsx)(ni,{w:"75%"})]})},smartLayout:{type:"smartLayout",component:({node:e,children:i,...n})=>{let a=nM;if(e.attrs?.variantKey){let t=n_[e.attrs.variantKey]?.Wrapper;t&&(a=t)}return(0,t.jsx)(i8.Grid,{className:`thumbnail-node-${e.type}`,gridTemplateColumns:"100%",children:(0,t.jsx)(a,{node:e,...n,children:i})})}},smartLayoutCell:{type:"smartLayoutCell",component:({children:e,parent:i,...n})=>{let a=nI;if(i&&i.attrs?.variantKey){let e=n_[i.attrs.variantKey]?.Cell;e&&(a=e)}return(0,t.jsx)(a,{parent:i,...n,children:e})}},diagram:{type:"diagram",component:({node:e})=>(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`,icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faShapes,size:"2x"})})},chart:{type:"chart",component:({node:e})=>(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`,icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:np[e.attrs?.chartType||"bar"],size:"2x"})})},graphyChart:{type:"graphyChart",component:({node:e})=>(0,t.jsx)(nr,{className:`thumbnail-node-${e.type}`,icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:nh[e.attrs?.chartType]||N.faChartSimple,size:"2x"})})},table:{type:"table",component:({node:e,children:i})=>(0,t.jsx)(eo.Box,{flex:1,className:`thumbnail-node-${e.type}`,bg:"var(--box-background-color)",borderRadius:"var(--text-border-radius)",p:"0.25em",children:(0,t.jsx)(eo.Box,{border:"1px solid var(--main-color)",borderRadius:"var(--text-border-radius)",children:i})})},tableRow:{type:"tableRow",component:({node:e,children:i})=>(0,t.jsx)(j.Flex,{className:`thumbnail-node-${e.type}`,borderBottom:"1px solid var(--main-color)",sx:{"&:last-of-type ":{borderBottom:"none"}},children:i})},tableCell:{type:"tableCell",component:({node:e})=>(0,t.jsx)(eo.Box,{flex:1,className:`thumbnail-node-${e.type}`,height:"1em",borderRight:"1px solid var(--main-color)",sx:{"&:last-of-type":{borderRight:"none"}}})}}},nL={md:"6em",lg:"8em",full:"100%"},nj={md:"4em",lg:"5em",full:"5em"},nP=({templateContent:e,isDark:i,size:n="md",...a})=>(0,t.jsx)(eo.Box,{css:{"--box-background-color":i?"var(--chakra-colors-gray-600)":"var(--chakra-colors-gray-50)","--main-color":i?"var(--chakra-colors-gray-500)":"var(--chakra-colors-gray-200)","--accent-color":i?"var(--chakra-colors-gray-300)":"var(--chakra-colors-gray-400)","--box-border-radius":"0.5em","--box-padding":"0.75em","--text-border-radius":"0.25em","--block-spacing":"0.75em","--bullet-size":"1em","--line-spacing":"calc(1 / 3 * 1em)","--paragraph-height":"0.5em","--border-width":"0.25em","--card-template-width":nL[n],"--card-template-min-height":nj[n],"--card-background":i?"var(--chakra-colors-gray-600)":"white"},bg:"var(--card-background)",h:"auto",...a,children:i7(nT,e)});e.s(["CARD_TEMPLATE_WIDTH",0,nL,"CardTemplateThumbnail",0,nP],173953);var nD=e.i(268496);let nN=(0,n.memo)(function({thumbnail:e,label:i,tooltip:n,onClick:a,badge:r,outlined:o=!1}){let s=(0,t.jsx)(l.Button,{variant:"ghost",onClick:a,"aria-label":n||("string"==typeof i?i:void 0),borderRadius:"md",justifyContent:"start",alignItems:"start",h:"auto",p:3,children:(0,t.jsxs)(tX.Stack,{spacing:2,alignItems:"stretch",w:"100%",children:[(0,t.jsxs)(eo.Box,{overflow:"hidden",maxW:"100%",position:"relative",h:"auto",maxH:"130px",...o&&{borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.100",boxShadow:"sm",overflow:"hidden"},children:[e,r&&(0,t.jsx)(it.Badge,{position:"absolute",top:"1.5",insetStart:"1.5",colorScheme:"green",children:r()})]}),(0,t.jsx)(P.Text,{fontSize:"sm",noOfLines:2,fontWeight:"medium",color:"gray.700",textAlign:"start",w:"100%",children:i})]})});return n?(0,t.jsx)(m.GammaTooltip,{label:n,placement:"top",children:s}):s}),nR=(0,n.memo)(function(){return(0,t.jsxs)(tX.Stack,{spacing:2,p:3,children:[(0,t.jsx)(iI.Skeleton,{w:"100%",h:"5em",borderRadius:"md"}),(0,t.jsx)(iI.Skeleton,{height:"12px",width:"80%"})]})}),nO=(0,n.memo)(function({count:e=5}){return(0,t.jsx)(i8.Grid,{templateColumns:`repeat(auto-fill, minmax(calc(${nL.lg} + 0.4em), 1fr))`,gap:1,children:Array.from({length:e}).map((e,i)=>(0,t.jsx)(nR,{},i))})}),nB=({title:e,message:i,cta:n})=>(0,t.jsx)(eo.Box,{border:"1px dashed",borderColor:"gray.300",borderRadius:"md",p:3,children:(0,t.jsxs)(j.Flex,{direction:"row",align:"center",gap:6,children:[(0,t.jsx)(eo.Box,{border:"1px solid",borderColor:"blackAlpha.100",borderRadius:"md",boxShadow:"sm",p:2,flexShrink:0,children:(0,t.jsxs)(tX.Stack,{maxW:"100%",alignItems:"center",children:[(0,t.jsx)(eo.Box,{borderRadius:"md",overflow:"hidden",w:nL.lg,children:(0,t.jsx)(ev.Image,{src:nD.default.src,alt:"",h:"5em",objectFit:"cover",w:"100%"})}),(0,t.jsx)(P.Text,{fontSize:"xs",textAlign:"center",color:"gray.700",fontWeight:"semibold",lineHeight:"1.2",children:e})]})}),(0,t.jsxs)(tX.Stack,{align:"flex-start",spacing:2,flex:1,children:[(0,t.jsx)(P.Text,{children:i}),n]})]})}),nz=({children:e})=>(0,t.jsx)(tV.Heading,{size:"md",as:"h2",mb:"1",children:e}),nF=(0,n.memo)(function({items:e,onTemplateClick:i,insertionMode:n}){let a="add"===n?f.i18n._({id:"g+7nXG",message:"Insert card"}):f.i18n._({id:"4TwsNi",message:"Apply template"});return(0,t.jsx)(i8.Grid,{templateColumns:`repeat(auto-fill, minmax(calc(${nL.md} + 1.5em), 1fr))`,gap:1,children:e.map(({id:e,name:n,jsonContent:r,badge:o})=>(0,t.jsx)(nN,{tooltip:a,label:n(),onClick:()=>i(e),badge:o,thumbnail:(0,t.jsx)(nP,{templateContent:r,isDark:!1,borderRadius:"base",size:"full"})},e))})}),nH=(0,n.memo)(function({template:e,onSelectTemplate:i}){let n=e.previewUrl,a=e.title||f.i18n._({id:"/K2CvV",message:"Template"});return(0,t.jsx)(nN,{onClick:()=>i({fileId:e.id,title:a||"",docId:e.mainPageId}),tooltip:f.i18n._({id:"xHeMqh",message:"View template"}),outlined:!0,label:(0,t.jsx)(iO.HighlightedText,{text:a}),thumbnail:(0,t.jsx)(ev.Image,{src:n||iR.default.src,fallbackSrc:iR.default.src,alt:a,objectFit:"cover",w:"100%",h:"5em"})},e.id)});e.s(["WorkspaceTemplateCardGrid",()=>nQ,"WorkspaceTemplateCardNodeView",()=>nq,"WorkspaceTemplateDocumentNodeView",()=>nK],995505);var nW=e.i(550927),nU=e.i(179115),nV=e.i(444577);let nG=(0,n.createContext)({onSelectCard:()=>{},insertionMode:"",cards:[]});function n$({value:e,children:i}){return(0,t.jsx)(nG.Provider,{value:e,children:i})}var nZ=e.i(182535);let nK=({children:e,nodeProps:i,...n})=>{let a=e7((0,E.useAppSelector)(te.selectTheme),!1);return(0,t.jsx)(i8.Grid,{templateColumns:`repeat(auto-fill, minmax(calc(${nL.lg} + 2.5em), 1fr))`,gap:1,sx:a,...n,children:e})},nq=({children:e,nodeProps:i,...a})=>{let{ref:r,width:o}=(0,eS.useElementSize)(),{node:s}=i,l=(0,n.useMemo)(()=>(0,B.tiptapNodeView)({component:nU.SwitchingCardView,extension:ex.Card}),[]),{onSelectCard:d,insertionMode:c,cards:u}=(0,n.useContext)(nG);if((0,ew.useIsInsidePreviewCard)())return(0,t.jsx)(l,{nodeProps:i,children:e});let p="add"===c?f.i18n._({id:"g+7nXG",message:"Insert card"}):f.i18n._({id:"4TwsNi",message:"Apply template"}),h=u.find(e=>e.cardId===s.attrs.id);return(0,t.jsx)(nN,{onClick:()=>h?d((0,nV.assignCardIds)(h.nodeJson),h.cardId):void 0,tooltip:p,outlined:!0,label:h?.title||"",thumbnail:(0,t.jsx)(j.Flex,{direction:"column",w:"100%",css:{"--editor-width":`${o&&1!==o?o:320}px`,"--line-thickness":"1px"},...a,ref:r,children:(0,t.jsx)(ew.PreviewCard,{children:h?(0,t.jsx)(l,{nodeProps:i,children:e}):null})})})},nY=()=>(0,t.jsx)(i8.Grid,{templateColumns:`repeat(auto-fill, minmax(calc(${nL.lg} + 1.5em), 1fr))`,gap:1,children:[1,2,3,4,5,6,7,8,9,10].map(e=>(0,t.jsx)(nR,{},e))}),nX=()=>(0,t.jsxs)(ie.Alert,{status:"info",children:[(0,t.jsx)(iF.AlertIcon,{}),(0,t.jsx)(g.Trans,{message:"This template doesn't have any cards yet.",id:"q8XE16"})]}),nQ=({docId:e,theme:i,onSelectCard:a,insertionMode:r})=>{let{cards:o,isLoading:s,error:l}=(e=>{let{data:t,loading:i,error:a}=(0,t7.useGetDocCurrentSnapshotQuery)({variables:{id:e},skip:!e}),r=(0,n.useMemo)(()=>{if(!e||i||a)return[];let n=t?.doc?.currentSnapshot?.content?.default;if(!n)return[];let r=n.content?.[0];return(r?.content||[]).filter(e=>e.type===eR.CARD_NODE_NAME).map((e,t)=>{let i=e.attrs?.id||`workspace-card-${t}`,n=(0,nZ.getCardTitle)(e)||`Card ${t+1}`;return{cardId:i,nodeJson:e,title:n}})},[e,i,a,t]);return e?{cards:r,isLoading:i,error:a}:{cards:[],isLoading:!1,error:void 0}})(e),d=i.name,c=(0,n.useMemo)(()=>0===o.length?null:{type:"doc",content:[{type:"document",content:o.map(e=>({...e.nodeJson,attrs:{...e.nodeJson.attrs,id:e.cardId}}))}]},[o]);return s?(0,t.jsx)(nY,{}):l?(0,t.jsxs)(ie.Alert,{status:"error",children:[(0,t.jsx)(iF.AlertIcon,{}),(0,t.jsx)(g.Trans,{message:"Failed to load template cards. Please try again.",id:"/eP1jF"})]}):0!==o.length&&c?(0,t.jsxs)(tX.Stack,{spacing:4,children:[(0,t.jsx)(P.Text,{fontSize:"sm",children:(0,t.jsx)(g.Trans,{message:"Cards will be inserted using your current theme: <0>{themeName}",id:"4CIeRD",values:{themeName:d},components:{0:(0,t.jsx)("strong",{})}})}),(0,t.jsx)(n$,{value:{onSelectCard:a,insertionMode:r,cards:o},children:(0,t.jsx)(nW.EditorPreview,{content:c,theme:i,type:"workspaceTemplate",isThumbnail:!0})})]}):(0,t.jsx)(nX,{})},nJ={templateColumns:`repeat(auto-fill, minmax(calc(${nL.lg} + 1.5em), 1fr))`,gap:1},n0=(0,n.memo)(function({onSelectTemplate:e,onViewMoreClick:i}){let a=(0,tI.useCanUseProductFeature)("workspace_templates"),{templates:r,isInitialLoading:o}=ig({first:6}),s=(0,n.useMemo)(()=>r.slice(0,5),[r]),c=r.length>5;return(0,t.jsxs)(tX.Stack,{children:[(0,t.jsxs)(d.HStack,{justifyContent:"space-between",alignItems:"center",children:[(0,t.jsx)(nz,{children:(0,t.jsxs)(d.HStack,{spacing:2,children:[(0,t.jsx)(P.Text,{children:(0,t.jsx)(g.Trans,{message:"Workspace templates",id:"rK+c0Q"})}),!a&&(0,t.jsx)(t3.PaidProductBadge,{product:"pro"})]})}),c&&!o&&a&&(0,t.jsx)(l.Button,{onClick:i,size:"sm",variant:"plain",rightIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faArrowRight,size:"sm"}),"aria-label":f.i18n._({id:"pGr2tz",message:"View all workspace templates"}),children:(0,t.jsx)(g.Trans,{message:"View all",id:"N6Pxr9"})})]}),o||0!==r.length?a?(0,t.jsx)(i2,{templates:s,isLoading:o,isEmpty:!o&&0===s.length,renderCard:i=>(0,t.jsx)(nH,{template:i,onSelectTemplate:e},i.id),onLoadMoreClick:()=>{},hasNextPage:!1,isFetchingMore:!1,renderEmptyState:()=>(0,t.jsx)(n2,{}),renderLoadingState:()=>(0,t.jsx)(nO,{}),gridProps:nJ}):(0,t.jsx)(n1,{}):(0,t.jsx)(n2,{})]})}),n1=(0,n.memo)(function(){let{openUpsellModal:e}=(0,iP.useMonetizationContext)();return(0,t.jsx)(nB,{title:(0,t.jsx)(g.Trans,{message:"Upgrade required",id:"RxhyrO"}),message:(0,t.jsx)(g.Trans,{message:"Upgrade to {GAMMA_PRO_PROPER_NOUN} to add cards from your workspace templates",id:"Vh2MKN",values:{GAMMA_PRO_PROPER_NOUN:A.GAMMA_PRO_PROPER_NOUN}}),cta:(0,t.jsx)(l.Button,{size:"sm",variant:"solid",onClick:()=>e({targetFeature:"workspace_templates",segmentEvent:_.SegmentEvents.GAMMA_PRO_UPSELL_WORKSPACE_TEMPLATES,upsellLocation:"workspaceTemplates"}),rightIcon:(0,t.jsx)(t3.PaidProductBadge,{product:"pro"}),children:(0,t.jsx)(g.Trans,{message:"Upgrade",id:"kwkhPe"})})})}),n2=(0,n.memo)(function(){let e=!1===(0,tI.useWorkspaceAllowsWorkspaceSharing)();return(0,t.jsx)(nB,{title:e?(0,t.jsx)(g.Trans,{message:"No workspace templates",id:"KOscyb"}):(0,t.jsx)(g.Trans,{message:"Nothing here!",id:"nUBsbk"}),message:e?(0,t.jsx)(g.Trans,{message:"No workspace templates have been added yet.",id:"QLwnOe"}):(0,t.jsx)(g.Trans,{message:"Quickly add cards from your templates into your {GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}.",id:"3nxXxN",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:A.GAMMA_ARTIFACT_PROPER_NOUN_PLURAL}}),cta:e?void 0:(0,t.jsx)(l.Button,{as:"a",href:"/#templates",target:"_blank",rel:"noopener noreferrer",size:"sm",variant:"plain",rightIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faArrowUpRightFromSquare,size:"sm",fixedWidth:!0}),children:(0,t.jsx)(g.Trans,{message:"Go to templates",id:"csFbe+"})})})}),n3=["all","workspace","gamma"],n5={all:{icon:N.faGrid2,label:(0,t.jsx)(g.Trans,{message:"All templates",id:"DA2Nma"})},workspace:{icon:t5,label:(0,t.jsx)(g.Trans,{message:"Workspace templates",id:"rK+c0Q"})},gamma:{icon:N.faRectangleHistory,label:(0,t.jsx)(g.Trans,{message:"{GAMMA_PROPER_NOUN} templates",id:"OloJuX",values:{GAMMA_PROPER_NOUN:A.GAMMA_PROPER_NOUN}})}},n4=(0,n.memo)(({editor:e,onClose:i,onTemplateSelect:a,recentlyUsedTemplates:o,insertionMode:s,dataAttribute:l})=>{let u=(0,t1.useToast)(),p=(0,i5.getGroupedCardTemplates)("modal"),m=(0,E.useAppSelector)(te.selectTheme),b=(0,r.useFeatureFlag)("workspaceCardTemplates"),x=(0,tI.useCanUseProductFeature)("workspace_templates"),{activeTabName:y,selectedTemplate:v,setActiveTabName:C,setSelectedTemplate:w,clearSelection:S}=(()=>{let{currentWorkspace:e}=(0,ih.useUserContext)(),t=e?.id,i=t?`${i4}:${t}`:null,[a,r]=(0,im.useLocalStorage)(i??i4,i9),o=(0,n.useMemo)(()=>{let e={...i9,...a&&"object"==typeof a?a:{}};return e.selectedTemplate&&!e.selectedTemplate.fileId&&(e.selectedTemplate=null),e},[a]),s=(0,n.useCallback)(e=>{r({...o,activeTabName:e,selectedTemplate:null})},[r,o]),l=(0,n.useCallback)(e=>{r({...o,selectedTemplate:e})},[r,o]),d=(0,n.useCallback)(()=>{r({...o,selectedTemplate:null})},[r,o]);return{activeTabName:o.activeTabName,selectedTemplate:o.selectedTemplate,setActiveTabName:s,setSelectedTemplate:l,clearSelection:d}})(),k=(0,n.useCallback)(e=>{u({status:"success",title:"add"===s?(0,t.jsx)(g.Trans,{message:"Card template added",id:"XcEMwf"}):(0,t.jsx)(g.Trans,{message:"Card template applied",id:"WJGAWS"}),duration:1300,isClosable:!1,position:"top"}),a(e),i()},[i,a,u,s]),_=(0,n.useCallback)(e=>{k({source:"gammaLayout",templateId:e})},[k]),I=(0,n.useCallback)((e,t)=>{v&&k({source:"workspaceTemplate",cardNode:e,cardId:t,templateId:v.fileId})},[k,v]),M=(0,n.useCallback)(e=>{w({fileId:e.fileId,title:e.title?.replace(//g,"").replace(/<\/em>/g,""),docId:e.docId})},[w]),T=(0,n.useCallback)(()=>{S()},[S]),L=(0,n.useCallback)(()=>{C(i6)},[C]),D=o.filter(t=>!(0,i5.checkTemplateDisabled)(e,t)).slice(0,10),R=(0,n.useCallback)(e=>{let t=n3[e];t&&C(t)},[C]),O=()=>0===D.length?null:(0,t.jsxs)(tX.Stack,{display:{base:"none",sm:"flex"},children:[(0,t.jsx)(nz,{children:(0,t.jsx)(g.Trans,{message:"Recently used",id:"uabU9X"})}),(0,t.jsx)(nF,{items:D,onTemplateClick:_,insertionMode:s})]}),B=(0,n.useMemo)(()=>p.map(({subcategory:i,items:n,description:a})=>{let r=n.filter(t=>!(0,i5.checkTemplateDisabled)(e,t)).map(({id:e,name:t,jsonContent:i,badge:n})=>({id:e,name:t,jsonContent:i,badge:n,hasBeenUsed:!!o.find(({id:t})=>t===e)}));return(0,t.jsxs)(tX.Stack,{children:[(0,t.jsxs)(d.HStack,{alignItems:"center",children:[(0,t.jsx)(tV.Heading,{size:"sm",as:"h3",children:i}),a&&(0,t.jsx)(t2.InfoTip,{label:a})]}),(0,t.jsx)(nF,{items:r,onTemplateClick:_,insertionMode:s})]},i)}),[p,e,o,_,s]),z=(0,n.useCallback)(e=>(0,t.jsx)(nH,{template:e,onSelectTemplate:M},e.id),[M]),F=()=>(0,t.jsxs)(tX.Stack,{spacing:6,children:[O(),b&&(0,t.jsx)(n0,{onSelectTemplate:M,onViewMoreClick:L}),(0,t.jsx)(nz,{children:(0,t.jsx)(g.Trans,{message:"{GAMMA_PROPER_NOUN} templates",id:"OloJuX",values:{GAMMA_PROPER_NOUN:A.GAMMA_PROPER_NOUN}})}),B]});return(0,t.jsx)(tj.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(tG.Modal,{isOpen:!0,onClose:i,size:{base:"5xl","2xl":"6xl"},children:[(0,t.jsx)(tY.ModalOverlay,{}),(0,t.jsxs)(tK.ModalContent,{...l||{},children:[(0,t.jsx)(tZ.ModalCloseButton,{}),(0,t.jsx)(tq.ModalHeader,{children:(0,t.jsxs)(d.HStack,{spacing:3,children:[v&&(0,t.jsx)(c.IconButton,{variant:"plain",size:"sm",icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faChevronLeft}),onClick:T,"aria-label":f.i18n._({id:"UNaXdI",message:"Back to templates"})}),(0,t.jsx)(P.Text,{children:v?v.title:"add"===s?f.i18n._({id:"jM1JI6",message:"Add card from template"}):f.i18n._({id:"HNcS3K",message:"Apply card template"})})]})}),(0,t.jsx)(tU.Divider,{}),(0,t.jsx)(t$.ModalBody,{p:0,children:(()=>{if(x&&v)return(0,t.jsx)(eo.Box,{p:4,children:(0,t.jsx)(nQ,{docId:v.docId??null,theme:m,onSelectCard:I,insertionMode:s})});return b?(0,t.jsx)(t0.Tabs,{orientation:"vertical",variant:"soft-rounded",index:n3.findIndex(e=>e===y),onChange:R,isLazy:!0,w:"100%",minH:"400px",children:(0,t.jsxs)(j.Flex,{w:"100%",children:[(0,t.jsx)(tJ.TabList,{borderInlineEndWidth:"1px",borderColor:"titanium.100",w:"260px",flexShrink:0,p:4,display:"flex",flexDirection:"column",gap:.5,children:n3.map(e=>(0,t.jsxs)(tQ.Tab,{justifyContent:"flex-start",textAlign:"start",fontSize:"sm",children:[(0,t.jsx)(eo.Box,{as:"span",fontWeight:"semibold",me:2,children:(0,t.jsx)(h.FontAwesomeIcon,{icon:n5[e].icon,fixedWidth:!0})}),(0,t.jsx)(P.Text,{noOfLines:1,children:n5[e].label})]},e))}),(0,t.jsx)(eo.Box,{flex:1,minW:0,p:4,children:(()=>{switch(y){case"all":return F();case i6:return(0,t.jsxs)(tX.Stack,{spacing:4,children:[(0,t.jsx)(nz,{children:(0,t.jsxs)(d.HStack,{spacing:2,children:[(0,t.jsx)(P.Text,{children:(0,t.jsx)(g.Trans,{message:"All workspace templates",id:"kyJSgj"})}),!x&&(0,t.jsx)(t3.PaidProductBadge,{product:"pro"})]})}),x?(0,t.jsx)(i3,{renderCard:z,renderEmptyState:()=>(0,t.jsx)(n2,{}),renderLoadingState:()=>(0,t.jsx)(nO,{}),sortOptionsButtonVariant:"plain",gridProps:nJ}):(0,t.jsx)(n1,{})]});case"gamma":return(0,t.jsx)(tX.Stack,{spacing:6,children:B});default:return F()}})()})]})}):(0,t.jsx)(eo.Box,{p:4,children:(0,t.jsxs)(tX.Stack,{spacing:6,children:[O(),B]})})})()})]})]})})});e.i(89699);let n6=()=>{let[e,t]=(0,im.useLocalStorage)(ib.USER_SETTINGS_CONSTANTS.recentlyUsedCardTemplateIds,[]),i=(0,n.useCallback)(i=>{let n;"workspaceTemplate"!==i.source&&t((n=i.templateId,(0,ip.default)([n,...e]).slice(0,10)))},[e,t]);return{recentlyUsedTemplates:(0,n.useMemo)(()=>e.map(e=>(0,i5.getCardTemplatesMap)()[e]).filter(e=>!!e),[e]),updateRecentlyUsedTemplateIds:i}};e.s(["useRecentlyUsedTemplates",0,n6],516456);var n9=e.i(144294),n8=e.i(500425);e.i(368740);let n7={blankCard:"/new"},ae=e=>{if("workspaceTemplate"===e.source)return{cardToAdd:e.cardNode,trackingInfo:{key:"workspaceTemplateCard",nodeName:"card"}};let{templateId:t}=e,i=(0,i5.getCardTemplates)().reduce((e,{id:t,name:i,jsonContent:n,featureFlag:a,badge:r})=>(e[t]={type:"cardTemplate",key:t,nodeName:"card",name:i,...n7[t]&&{shortcut:n7[t]},...a&&{featureFlag:a},...r&&{badge:r},icon:n8.faGrid2,execute:e=>{e.commands.insertContentAndSelect(n)}},e),{}),n=(0,n9.EMPTY_NODES)()[t]||(0,n9.EMPTY_NODES)().blankCard,a="aiCardAfter"===t?{key:"aiCardAfter",nodeName:"card"}:i[t]||i.blankCard;return{cardToAdd:n,trackingInfo:{key:a.key,nodeName:a.nodeName}}};e.s(["getCardToAddAndTrack",0,ae],940818);let at=(0,n.memo)(function({editor:e,getPos:i,display:a,isNested:r}){let o=(0,t_.useRtlEnabled)(),{isInOfflineMode:s}=(0,x.useHealthCheck)(),l=(0,eg.useShouldRenderMobileVersion)(),{isOpen:u,onClose:b,onOpen:y}=(0,tB.useModalDisclosure)({id:"cardTemplatesModal"}),{recentlyUsedTemplates:v,updateRecentlyUsedTemplateIds:C}=n6(),w=(0,n.useCallback)(t=>{let n=i();if("number"!=typeof n)return;let a=e.view.state.doc.nodeAt(n);if(!a)return void console.error("[CardDivider] Cannot append card. Node unknown");let r=n+a.nodeSize,{cardToAdd:o,trackingInfo:s}=ae(t),l="aiCardAfter"===s.key?_.NodeInsertMethods.CARD_DIVIDER_AI:"blankCard"!==s.key?_.NodeInsertMethods.CARD_DIVIDER_DROPDOWN:_.NodeInsertMethods.CARD_DIVIDER;(0,tz.trackItemInserted)(s,l),"aiCardAfter"!==s.key&&"blankCard"!==s.key&&C(t),e.chain().insertContentAt(r,(0,nV.assignCardIdsToChildren)(o)).command(({tr:e})=>(e.setMeta(tH,!0),!0)).focus().selectInsertedNode().run()},[e,i,C]),S=(0,n.useCallback)(()=>{w({source:"gammaLayout",templateId:"blankCard"})},[w]),k=(0,n.useCallback)(()=>{s||w({source:"gammaLayout",templateId:"aiCardAfter"})},[w,s]),A=(0,D.useColorModeValue)("gray.50","gray.600"),E=!l;return(0,t.jsxs)(j.Flex,{contentEditable:!1,suppressContentEditableWarning:!0,className:"card-divider","data-is-nested-card":String(r),position:"absolute",zIndex:tR.DOC_Z_INDEXES.cardDivider,bottom:-4,w:"100%",justify:"center",align:"center",display:a,opacity:+!!u,transitionProperty:"opacity",transitionDuration:"normal","data-print-hidden":!0,"data-id":"card-divider",children:[(0,t.jsxs)(T.ButtonGroup,{size:"sm",isAttached:!0,"data-guider-highlight":"add-card-button",className:"card-divider-button-group",variant:"plain",shadow:"md",borderRadius:"md",opacity:"1",transitionProperty:"opacity",transitionDuration:"normal",dir:o?"rtl":"ltr",children:[(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Add blank card",id:"7iE+3N"}),children:(0,t.jsx)(c.IconButton,{className:"insert-card-button",variant:"plain","aria-label":f.i18n._({id:"g+7nXG",message:"Insert card"}),icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faPlus,fixedWidth:!0}),size:"sm",shadow:"none",borderRadius:"md",minW:12,transitionProperty:"none",borderColor:A,borderInlineEndRadius:E?void 0:"none",onMouseDown:tW.preventDefaultAndStopPropagation,onClick:S})}),E&&(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Add card with AI",id:"kLZLXX"}),children:(0,t.jsx)(c.IconButton,{className:"insert-ai-card-button",variant:"plain","aria-label":f.i18n._({id:"g+7nXG",message:"Insert card"}),icon:(0,t.jsx)(d.HStack,{spacing:0,opacity:s?.3:1,children:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faSparkles,fixedWidth:!0})}),size:"sm",shadow:"none",minW:12,transitionProperty:"none",borderColor:A,borderRadius:"md",borderInlineStart:"none",borderInlineEndRadius:"none",tabIndex:s?-1:void 0,pointerEvents:s?"none":"auto",onMouseDown:tW.preventDefaultAndStopPropagation,onClick:k})}),(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Add from template",id:"UgOs5x"}),children:(0,t.jsx)(c.IconButton,{variant:"plain","aria-label":f.i18n._({id:"UgOs5x",message:"Add from template"}),icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faTableLayout,fixedWidth:!0}),shadow:"none",size:"sm",minW:12,transitionProperty:"none",borderRadius:"md",borderColor:A,borderInlineStart:"none",borderInlineStartRadius:"none","data-guider-highlight":"add-card-template-button",onMouseDown:tW.preventDefaultAndStopPropagation,onClick:y})})]}),u&&(0,t.jsx)(n4,{editor:e,onClose:b,onTemplateSelect:w,recentlyUsedTemplates:v,insertionMode:"add"})]})});var ai=e.i(277051);let an=(e,t)=>{let i=t();if("number"!=typeof i)return null;let n=e.state.doc.nodeAt(i);if(!n)return null;let a=n.firstChild;return a&&(0,s.isCardImageItemNode)(a)?a.attrs:null},aa=({editor:e,getPos:i})=>{let[a,o]=(0,n.useState)(null),s=(0,r.useFeatureFlag)("imageCardsDebug"),l=(0,n.useCallback)((t,n,a)=>{let r=an(e,i);if(!r)return;let{image:o}=r;Z.analytics.track(_.SegmentEvents.AI_IMAGE_CARD_FEEDBACK,{rating:t,feedback:ai.default.sanitize(n),tags:a,aiParams:o?.aiParams,imageUrl:o?.src,interactionId:o?.aiParams?.interactionId,savedMediaId:o?.savedMediaId,extraction:o?.extraction})},[e,i]),d=(0,n.useCallback)(t=>{o(t);let n=an(e,i);if(!n)return;let{image:a}=n;Z.analytics.track(_.SegmentEvents.AI_IMAGE_CARD_RATED,{rating:t,aiParams:a?.aiParams,imageUrl:a?.src,interactionId:a?.aiParams?.interactionId,savedMediaId:a?.savedMediaId,extraction:a?.extraction})},[e,i]);return s?(0,t.jsx)(eC.ThumbsRating,{trackFeedback:l,rating:a||void 0,setRating:d,RatingButtons:eC.CardRatingButtons,feedbackTags:ar,size:"xs"}):null},ar=[{key:"garbled-text",label:(0,t.jsx)(g.Trans,{message:"Garbled text",id:"ANtc5/"})},{key:"distorted",label:(0,t.jsx)(g.Trans,{message:"Distorted image",id:"evxU4x"})},{key:"low-quality",label:(0,t.jsx)(g.Trans,{message:"Low quality",id:"9cm/hp"})},{key:"prompt-leaked",label:(0,t.jsx)(g.Trans,{message:"Prompt leaked",id:"fNGCvy"})},{key:"inconsistent-fonts",label:(0,t.jsx)(g.Trans,{message:"Inconsistent fonts",id:"uAo2gI"})},{key:"inappropriate",label:(0,t.jsx)(g.Trans,{message:"Inappropriate",id:"i/9pR4"})}],ao=({traceId:e,extraction:i})=>{let a=(0,I.useGetStylesForHandleButtons)(),o=(0,r.useFeatureFlag)("imageCardsDebug"),s=i?.originalImageUrl,l=(0,n.useCallback)(t=>{if(t.stopPropagation(),!e)return void console.warn("No trace ID found for this media");let i=Date.now(),n=new URLSearchParams({query:`@savedMediaId:${e} resource_name:ai.*`,spanType:"all",view:"spans",start:(i-2592e6).toString(),end:i.toString()}),a=`https://app.datadoghq.com/apm/traces?${n.toString()}`;window.open(a,"_blank","noopener,noreferrer")},[e]),u=(0,n.useCallback)(e=>{(e.stopPropagation(),s)?window.open(s,"_blank","noopener,noreferrer"):console.warn("No original image URL found for this media")},[s]);if(!o)return null;let g={...a,bg:"purple.100",color:"purple.600",_hover:{bg:"purple.200"}};return(0,t.jsx)(tj.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(d.HStack,{spacing:1,contentEditable:!1,pointerEvents:"auto",onMouseDown:tW.preventDefaultToAvoidBlur,children:[e&&(0,t.jsx)(m.GammaTooltip,{label:"View trace in Datadog (admin only)",placement:"top",shouldWrapChildren:!0,children:(0,t.jsx)(c.IconButton,{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faBug}),"aria-label":"View trace in Datadog (admin only)",alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...g,onClick:l})}),s&&(0,t.jsx)(m.GammaTooltip,{label:"Open original image URL (admin only)",placement:"top",shouldWrapChildren:!0,children:(0,t.jsx)(c.IconButton,{icon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faExternalLink}),"aria-label":"Open original image URL (admin only)",alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...g,onClick:u})})]})})};e.s(["DebugExtractionButtons",0,ao],15185);let as=({editor:e,getPos:i})=>{let{traceId:a,extraction:r}=(0,n.useMemo)(()=>{let t=i();if("number"!=typeof t)return{traceId:null,extraction:null};let n=e.state.doc.nodeAt(t);if(!n)return{traceId:null,extraction:null};let a=n.firstChild;if(!a||!(0,s.isCardImageItemNode)(a))return{traceId:null,extraction:null};let r=a.attrs;return{traceId:r.image?.savedMediaId,extraction:r.image?.extraction}},[e,i]);return(0,t.jsx)(ao,{traceId:a,extraction:r})};var al=e.i(268236),ad=e.i(178428),ac=e.i(35585);let au=({editor:e,getPos:i,extract:a,isLoading:o})=>{let c=(0,I.useGetStylesForHandleButtons)(),u=(0,E.useAppSelector)(ac.selectCurrentWorkspaceId),p=(0,r.useFeatureFlag)("useIdeogramExtraction"),f=(0,n.useCallback)(async()=>{let t=i();if("number"!=typeof t||!u)return;let n=e.state.doc.nodeAt(t);if(!n)return;let r=n.firstChild;if(!r||!(0,s.isCardImageItemNode)(r))return;let{image:o}=r.attrs,l=o?.src;if(!l)return;let d=p?"ideogram":"datalab";try{let i=await a({workspaceId:u,imageUrl:l,provider:d}),n=i.data?.extractImageContent,{interactionId:r}=i;if(!n)return;Z.analytics.track(_.SegmentEvents.AI_EXTRACT_TEXT_CLICKED,{interactionId:r,imageUrl:l,source:"image_card",provider:d,cost:n.cost,processingTime:n.processingTime,elementCount:n.elements?.length??0});let s=t+1,c=e.chain();if(n.backgroundImageUrl){let e={...o,src:n.backgroundImageUrl,meta:{...o.meta,width:n.backgroundWidth,height:n.backgroundHeight},extraction:{...n,originalImageUrl:l,originalMeta:o.meta?{width:o.meta.width,height:o.meta.height}:void 0,interactionId:r}};c=c.updateNestedAttributesAtPos(s,{image:e})}(c=(c=(0,ad.addPositionedTextboxesToChain)(c,e,s,n)).updateAttributesAtPos(t,{generatorInput:null})).run()}catch(e){console.error("[ExtractTextButton] Error extracting text:",e)}},[e,i,u,p,a]);return(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Edit text",id:"T7vd8+"}),placement:"top",shouldWrapChildren:!0,children:(0,t.jsx)(l.Button,{leftIcon:o?(0,t.jsx)(iD.Spinner,{size:"xs"}):(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faPenToSquare}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...c,px:2,onClick:f,isDisabled:o,children:(0,t.jsxs)(d.HStack,{spacing:1,children:[(0,t.jsx)(g.Trans,{message:"Edit text",id:"T7vd8+"}),(0,t.jsx)(al.ReleaseStatusBadge,{badge:"beta",fontSize:"2xs"})]})})})},ap=({editor:e,getPos:i})=>{let a=(0,I.useGetStylesForHandleButtons)(),r=(0,n.useCallback)(()=>{let t=i();if("number"!=typeof t)return;let n=e.state.doc.nodeAt(t);if(!n)return;let a=n.firstChild;if(!a||!(0,s.isCardImageItemNode)(a))return;let{image:r}=a.attrs,o=r?.extraction?.originalImageUrl;if(!o)return;Z.analytics.track(_.SegmentEvents.AI_EXTRACT_TEXT_REVERTED,{interactionId:r?.extraction?.interactionId,imageUrl:o,source:"image_card"});let l=t+1,d=r?.extraction?.originalMeta,c={...r,src:o,...d&&{meta:{...r.meta,...d}},extraction:null},u=e.chain().updateNestedAttributesAtPos(l,{image:c});(u=(0,ad.clearPositionedTextboxesFromChain)(u,e,l)).run()},[e,i]);return(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Original image",id:"0Rfeda"}),placement:"top",shouldWrapChildren:!0,children:(0,t.jsx)(l.Button,{leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faRotateLeft}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...a,px:2,onClick:r,children:(0,t.jsx)(g.Trans,{message:"Original image",id:"0Rfeda"})})})};e.s(["CardImageItemButtons",0,({editor:e,getPos:i,hasPositionedBoxes:n,extract:a,isExtracting:o})=>(0,r.useFeatureFlag)("editImageText")?(0,t.jsx)(tj.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(d.HStack,{spacing:1,contentEditable:!1,pointerEvents:"auto",children:[n?(0,t.jsx)(ap,{editor:e,getPos:i}):(0,t.jsx)(au,{editor:e,getPos:i,extract:a,isLoading:o}),(0,t.jsx)(aa,{editor:e,getPos:i}),(0,t.jsx)(as,{editor:e,getPos:i})]})}):null],144052);let ah=(0,n.memo)(({label:e,tooltipLabel:i,icon:n,onClick:a})=>{let r=(0,t.jsxs)(d.HStack,{spacing:1.5,px:2,py:.5,borderTopRadius:"md",borderBottomRadius:0,contentEditable:!1,userSelect:"none",fontFamily:"body",bg:"blue.600",color:"gray.50",fontWeight:"semibold",alignItems:"center",justifyContent:"center",cursor:a?"pointer":"default",_hover:a?{bg:"blue.700"}:void 0,pointerEvents:"auto",onMouseDown:tW.preventDefaultToAvoidBlur,onClick:a,children:[(0,t.jsx)(P.Text,{fontSize:"xs",children:e}),n&&(0,t.jsx)(h.FontAwesomeIcon,{icon:n,fixedWidth:!0,size:"2xs"})]});return i?(0,t.jsx)(m.GammaTooltip,{placement:"top",label:i,children:r}):r});ah.displayName="CardLabel",e.s(["CardLabel",0,ah],689525),e.s(["CardLayout",()=>rI],119831);var am=e.i(929362);let ag=({isFocused:e})=>(0,t.jsx)(eo.Box,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden",display:{base:"none",lg:"block"},opacity:+!!e,className:"card-height-guide",children:(0,t.jsxs)(eo.Box,{position:"absolute",top:"var(--card-min-height)",insetStart:"0",w:"100%",h:"1px",borderBottom:"2px dashed",borderBottomColor:"var(--body-color)",opacity:"0.25",children:[(0,t.jsx)(af,{insetStart:0}),(0,t.jsx)(af,{insetEnd:0})]})}),af=e=>{let{cardDimensions:i}=(0,E.useAppSelector)(te.selectDocSettingsWithDefaults),{label:n}=(0,am.getCardDimensions)(i);return(0,t.jsx)(m.GammaTooltip,{placement:"top",w:"250px",label:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(P.Text,{children:["Your content is too tall to fit the ",n()," size, so it may shrink or overflow when presenting or exporting."]}),(0,t.jsx)(P.Text,{color:"gray.500",children:(0,t.jsx)(g.Trans,{message:"Manage card and font sizes in page setup",id:"yrOr7z"})})]}),children:(0,t.jsx)(eo.Box,{position:"absolute",w:"var(--card-inner-padding-x)",h:"20px",top:"-10px",pointerEvents:"auto",cursor:"help",...e})})};var ab=e.i(98155),ax=e.i(970346),ay=e.i(358003),av=e.i(216912);let aC={left:{marginEnd:"-1px",borderEndRadius:0,borderEndColor:"transparent"},right:{marginStart:"-1px",borderStartRadius:0,borderStartColor:"transparent"}},aw=(0,ay.chakra)("div",{baseStyle:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap"}}),aS=(0,av.forwardRef)(function(e,i){let{placement:n="left",...a}=e,r=aC[n]??{},o=(0,t9.useInputGroupStyles)();return(0,t.jsx)(aw,{ref:i,...a,__css:{...o.addon,...r}})});aS.displayName="InputAddon";let ak=(0,av.forwardRef)(function(e,i){return(0,t.jsx)(aS,{ref:i,placement:"left",...e,className:(0,ej.cx)("chakra-input__left-addon",e.className)})});ak.displayName="InputLeftAddon",ak.id="InputLeftAddon";let aA=(0,av.forwardRef)(function(e,i){return(0,t.jsx)(aS,{ref:i,placement:"right",...e,className:(0,ej.cx)("chakra-input__right-addon",e.className)})});aA.displayName="InputRightAddon",aA.id="InputRightAddon";var aE=e.i(864860),a_=e.i(156518),aI=e.i(615505),aM=e.i(7301),aT=e.i(853361),aL=e.i(256266);let aj=(0,n.memo)(({children:e,...i})=>{let n=(0,ed.useSSRMounted)(),a=(0,E.useAppSelector)((0,aT.selectPanelWidth)("right"));return!n||(0,aL.isMobileDevice)()?null:(0,t.jsx)(eo.Box,{position:"fixed",bottom:4,insetInlineEnd:a+4,zIndex:"overlay","data-print-hidden":!0,...i,children:e})});aj.displayName="HelpWidgetWrapper";var aP=e.i(826480),aD=e.i(932786);e.i(420945);var aN=e.i(33823),aR=e.i(161385);let aO=new aR.EventEmitter;var aB=e.i(971681),az=e.i(982725),aF=e.i(182895),aH=e.i(175440),aW=e.i(661619),aU=e.i(200456);let aV=({selectedLocale:e,onLocaleSelect:i,buttonProps:n,menuListProps:a,matchWidth:o=!0,hideLabel:s=!1})=>{let d=(0,r.useFeatureFlag)("i18nEnabled");return(0,g.useLingui)(),(0,t.jsx)(j.Flex,{direction:"column",children:(0,t.jsxs)(iv.Menu,{matchWidth:o,children:[(0,t.jsx)(iC.MenuButton,{as:l.Button,rightIcon:s?null:(0,t.jsx)(h.FontAwesomeIcon,{size:"xs",icon:N.faChevronDown}),textAlign:"start",w:"100%",...n,children:s?null:e?.displayName||"Unknown"}),(0,t.jsx)(iS.MenuList,{minWidth:"240px",maxH:"500px",overflowY:"auto",overflowX:"hidden",...a,children:(0,t.jsx)(ik.MenuOptionGroup,{value:e?.key||"unknown",type:"radio",onChange:e=>{i(e)},children:(0,aW.getSupportedLocaleOptionsSorted)().map(e=>{let i=new Date(aU.SUPPORTED_LOCALE_OPTIONS[e.key].launchDate),n=!d&&"private_beta"===aH.LOCALE_ROLLOUT_MAP[e.key],a=d&&"private_beta"===aH.LOCALE_ROLLOUT_MAP[e.key],r="public_beta"===aH.LOCALE_ROLLOUT_MAP[e.key]&&Date.now()-i.getTime()<2592e6;return(0,t.jsx)(aF.MenuItemOption,{value:e.key,isDisabled:n,children:(0,t.jsxs)(j.Flex,{flex:1,alignItems:"center",children:[(0,t.jsxs)(tX.Stack,{spacing:0,children:[(0,t.jsx)(P.Text,{fontWeight:"600",children:e.displayName}),(0,t.jsx)(P.Text,{fontSize:"xs",color:"gray.500",children:e.displayNameLocalized()})]})," ",(0,t.jsx)(aE.Spacer,{}),n?(0,t.jsx)(it.Badge,{ms:2,fontSize:"0.75em",colorScheme:"teal",children:(0,t.jsx)(g.Trans,{message:"Coming Soon",id:"VZeG/A"})}):a?(0,t.jsx)(it.Badge,{ms:2,fontSize:"0.75em",colorScheme:"purple",children:(0,t.jsx)(g.Trans,{message:"Beta",id:"YBt9YP"})}):r?(0,t.jsx)(it.Badge,{ms:2,fontSize:"0.75em",colorScheme:"green",children:(0,t.jsx)(g.Trans,{message:"New",id:"isRobC"})}):null]})},e.key)})})})]})})};var aG=e.i(816350),a$=e.i(130833);let aZ=({onClose:e})=>{let i=(0,t1.useToast)(),{user:a}=(0,ih.useUserContext)(),[r,o]=(0,n.useState)(!1),{setSettings:s}=(0,ih.useUserContext)(),d=(0,aG.useLinguiLocale)(),c=(0,n.useMemo)(()=>d,[]),[u,p]=(0,n.useState)(c);(0,a$.useLocalePreview)(u);let h=(0,n.useCallback)(async()=>{o(!0);try{await s?.({set:{locale:u}}),i({title:(0,t.jsx)(g.Trans,{message:"Language updated.",id:"RRo9kN"}),position:"top",status:"success",isClosable:!0,duration:3e3}),e()}catch(e){console.error(`[StandaloneLocaleModal.onSave] Error updating language for user with id "${a?.id}"`,e.message)}o(!1)},[u,e,s,i,a?.id]),m=u!==a?.settings?.locale;return(0,t.jsx)(tj.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(tG.Modal,{isOpen:!0,onClose:e,children:[(0,t.jsx)(tY.ModalOverlay,{}),(0,t.jsxs)(tK.ModalContent,{children:[(0,t.jsx)(tq.ModalHeader,{children:(0,t.jsx)(g.Trans,{message:"Change language",id:"+DEogc"})}),(0,t.jsx)(tZ.ModalCloseButton,{}),(0,t.jsx)(t$.ModalBody,{children:(0,t.jsxs)(iW.FormControl,{children:[(0,t.jsx)(iU.FormLabel,{children:(0,t.jsx)(g.Trans,{message:"Account language",id:"M3JKNC"})}),(0,t.jsx)(aV,{selectedLocale:aU.SUPPORTED_LOCALE_OPTIONS[u],onLocaleSelect:p})]})}),(0,t.jsx)(iV.ModalFooter,{children:m?(0,t.jsxs)(T.ButtonGroup,{children:[(0,t.jsx)(l.Button,{variant:"ghost",onClick:e,children:(0,t.jsx)(g.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(l.Button,{variant:"solid",onClick:h,isLoading:r,children:(0,t.jsx)(g.Trans,{message:"Save",id:"tfDRzk"})})]}):(0,t.jsx)(l.Button,{variant:"plain",onClick:e,children:(0,t.jsx)(g.Trans,{message:"Close",id:"yz7wBu"})})})]})]})})};var aK=e.i(267617),aq=e.i(700183),aY=e.i(180078),aX=e.i(283591),aQ=e.i(306841),aJ=e.i(470020),a0=e.i(891494),a1=e.i(45646),a2=e.i(882255),a3=e.i(760853);let a5=(0,av.forwardRef)(function(e,i){let{getHeaderProps:n}=(0,a3.usePopoverContext)(),a=(0,a3.usePopoverStyles)();return(0,t.jsx)(ay.chakra.header,{...n(e,i),className:(0,ej.cx)("chakra-popover__header",e.className),__css:a.header})});a5.displayName="PopoverHeader";var a4=e.i(280318),a6=e.i(991154),a9=e.i(260241),a8=e.i(480801),a7=e.i(4751),re=e.i(400506),rt=e.i(576750),ri=e.i(98398),rn=e.i(78608);let ra=({prefix:e="",support:i="",suffix:n=""})=>(0,t.jsxs)(P.Text,{children:[e,(0,t.jsx)(P.Text,{color:"gray.400",as:"span",children:i}),n]}),rr=()=>[{description:(0,t.jsx)(g.Trans,{message:"Open slash menu",id:"8aebws"}),shortcut:"/"},{description:(0,t.jsx)(g.Trans,{message:"Open/close cards",id:"JZEY8K"}),shortcut:"Mod+Shift+O"},{description:(0,t.jsx)(g.Trans,{message:"Split card",id:"3Lpas4"}),shortcut:"***"},{description:(0,t.jsx)(g.Trans,{message:"Print/export PDF",id:"e+t/xM"}),shortcut:"Mod+P"},{description:(0,t.jsx)(g.Trans,{message:"Enter present mode",id:"MF+p5R"}),shortcut:"Mod+Enter"},{description:(0,t.jsx)(g.Trans,{message:"Jump to",id:"NiZZRh"}),shortcut:"Mod+K"},{description:(0,t.jsx)(g.Trans,{message:"Mention a person",id:"4J90L0"}),shortcut:(0,t.jsx)(ra,{prefix:"@",support:"name"})},{description:(0,t.jsx)(g.Trans,{message:"Link to a card",id:"1fOM5v"}),shortcut:(0,t.jsx)(ra,{prefix:"@",support:"cardTitle"})}],ro=()=>[{description:(0,t.jsx)(g.Trans,{message:"Monster",id:"bSLwU6"}),shortcut:"!!!"},{description:(0,t.jsx)(g.Trans,{message:"Display",id:"Xm/s+u"}),shortcut:"!!"},{description:(0,t.jsx)(g.Trans,{message:"Title",id:"MHrjPM"}),shortcut:"!"},{description:(0,t.jsx)(g.Trans,{message:"Heading 1",id:"lXKZGw"}),shortcut:["#","Mod+Alt+1"]},{description:(0,t.jsx)(g.Trans,{message:"Heading 2",id:"El7NbA"}),shortcut:["##","Mod+Alt+2"]},{description:(0,t.jsx)(g.Trans,{message:"Heading 3",id:"SFN6dN"}),shortcut:["###","Mod+Alt+3"]},{description:(0,t.jsx)(g.Trans,{message:"Heading 4",id:"nJeKmw"}),shortcut:["####","Mod+Alt+4"]},{description:(0,t.jsx)(g.Trans,{message:"Link",id:"yzF66j"}),shortcut:"Mod+K"},{description:(0,t.jsx)(g.Trans,{message:"Emoji <0>😍",id:"QpoxX6",components:{0:(0,t.jsx)("span",{role:"img","aria-label":f.i18n._({id:"ssT83y",message:"heart-eyes"})})}}),shortcut:(0,t.jsx)(ra,{prefix:":",support:"heart_eyes",suffix:":"})},{description:(0,t.jsx)(g.Trans,{message:"Bold",id:"KmydK6"}),shortcut:[(0,t.jsx)(ra,{prefix:"*",support:"bold",suffix:"*"},"0"),"Mod+B"]},{description:(0,t.jsx)(g.Trans,{message:"Italic",id:"pzutoc"}),shortcut:[(0,t.jsx)(ra,{prefix:"_",support:"italic",suffix:"_"},"0"),"Mod+I"]},{description:(0,t.jsx)(g.Trans,{message:"Underline",id:"YyXtnN"}),shortcut:"Mod+U"},{description:(0,t.jsx)(g.Trans,{message:"Strikethrough",id:"WhOsNE"}),shortcut:"Mod+Shift+X"},{description:(0,t.jsx)(g.Trans,{message:"Left align",id:"VjjKVj"}),shortcut:"Mod+Shift+L"},{description:(0,t.jsx)(g.Trans,{message:"Center align",id:"95ckMP"}),shortcut:"Mod+Shift+E"},{description:(0,t.jsx)(g.Trans,{message:"Right align",id:"vTKw81"}),shortcut:"Mod+Shift+R"},{description:(0,t.jsx)(g.Trans,{message:"Code snippet",id:"Gc5apx"}),shortcut:[(0,t.jsx)(ra,{prefix:"`",support:"code",suffix:"`"},"0"),"Mod+Shift+C"]},{description:(0,t.jsx)(g.Trans,{message:"Math equation",id:"sFkOYO"}),shortcut:[(0,t.jsx)(ra,{prefix:"$",support:"x^2",suffix:"$ "},"0"),"$$ "]},{description:(0,t.jsx)(g.Trans,{message:"Highlight text",id:"eKJQi9"}),shortcut:"Mod+Shift+H"},{description:(0,t.jsx)(g.Trans,{message:"Numbered list",id:"M3G9ZD"}),shortcut:["1. ","Mod+/","Mod+Shift+7"]},{description:(0,t.jsx)(g.Trans,{message:"Bulleted list",id:"ynb7Kh"}),shortcut:["- ","Mod+.","Mod+Shift+8"]},{description:(0,t.jsx)(g.Trans,{message:"Todo list",id:"rCIbrq"}),shortcut:["[] ","Mod+,","Mod+Shift+9"]},{description:(0,t.jsx)(g.Trans,{message:"Footnote",id:"dOxPd4"}),shortcut:[(0,t.jsx)(ra,{prefix:"^",support:"note",suffix:"^"},"0"),"Mod+Alt+F"]}],rs=()=>[{description:(0,t.jsx)(g.Trans,{message:"Navigate between images",id:"5MUPYy"}),shortcut:["←","→"]},{description:(0,t.jsx)(g.Trans,{message:"Multi-select images",id:"UtNOh5"}),shortcut:["Shift+←","Shift+→"]},{description:(0,t.jsx)(g.Trans,{message:"Select all images",id:"tCoWm+"}),shortcut:"Mod+A"},{description:(0,t.jsx)(g.Trans,{message:"Fullscreen preview",id:"HayZue"}),shortcut:"Space"},{description:(0,t.jsx)(g.Trans,{message:"Copy image",id:"GWCG6Y"}),shortcut:"Mod+C"},{description:(0,t.jsx)(g.Trans,{message:"Duplicate image",id:"cCFXVg"}),shortcut:"Mod+D"},{description:(0,t.jsx)(g.Trans,{message:"Delete selected images",id:"QSQNSK"}),shortcut:["⌫","Delete"]},{description:(0,t.jsx)(g.Trans,{message:"Undo",id:"9uI/rE"}),shortcut:"Mod+Z"}],rl=()=>[{description:(0,t.jsx)(g.Trans,{message:"Previous/next card",id:"9xCxY6"}),shortcut:["←","→"]},{description:(0,t.jsx)(g.Trans,{message:"Scroll up/down card",id:"6r2KAP"}),shortcut:["↑","↓"]},{description:(0,t.jsx)(g.Trans,{message:"Open/close card",id:"rEj/lx"}),shortcut:"Enter"},{description:(0,t.jsx)(g.Trans,{message:"Exit present mode",id:"IkakN2"}),shortcut:"Esc"},{description:(0,t.jsx)(g.Trans,{message:"Open/close all cards",id:"dQU33K"}),shortcut:"Mod+Shift+O"},{description:(0,t.jsx)(g.Trans,{message:"Spotlight on/off",id:"CgmvBu"}),shortcut:"S"},{description:(0,t.jsx)(g.Trans,{message:"Restart presentation",id:"K0Oq/D"}),shortcut:"R"},{description:(0,t.jsx)(g.Trans,{message:"Right click to edit <0/> and spotlight blocks",id:"q8Gtmt",components:{0:(0,t.jsx)("br",{})}}),shortcut:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faComputerMouse})}],rd={borderColor:"gray.50",py:2,px:2},rc={borderColor:"gray.600",py:2,px:2},ru=({list:e})=>{let i=(0,D.useColorModeValue)(rd,rc),n={bg:(0,D.useColorModeValue)("gray.50","gray.700"),borderColor:(0,D.useColorModeValue)("gray.200","gray.600"),color:(0,D.useColorModeValue)("gray.700","white")};return(0,t.jsx)(a6.TableContainer,{w:"100%",children:(0,t.jsx)(a4.Table,{variant:"simple",children:(0,t.jsx)(a7.Tbody,{children:e.map(({shortcut:e,description:a},r)=>(0,t.jsxs)(rt.Tr,{children:[(0,t.jsx)(re.Td,{w:"60%",...i,children:a}),(0,t.jsx)(re.Td,{w:"40%",...i,children:Array.isArray(e)?e.map((e,i)=>(0,t.jsx)(ia.Kbd,{display:"inline-block",px:2,py:1,me:1,children:"string"==typeof e?(0,ri.getShortcutTextForOS)(e):e},i)):"string"==typeof e?(0,t.jsx)(ia.Kbd,{...n,display:"inline-block",px:2,py:1,children:(0,ri.getShortcutTextForOS)(e)}):(0,t.jsx)(ia.Kbd,{...n,display:"inline-block",px:2,py:1,children:e})})]},r))})})})},rp=({isOpen:e,onClose:i,variant:n="doc"})=>{let a=(0,ij.useLocalizedFunction)(ro),r=(0,ij.useLocalizedFunction)(rl),o=(0,ij.useLocalizedFunction)(rr),s=(0,ij.useLocalizedFunction)(rs),l=(0,D.useColorModeValue)("gray.700","white"),c=(0,D.useColorModeValue)("gray.50","gray.600");return(0,t.jsxs)(aQ.Popover,{returnFocusOnClose:!1,closeOnBlur:!1,placement:"top",isOpen:e,onClose:i,modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}}],children:[(0,t.jsx)(aJ.PopoverAnchor,{children:(0,t.jsx)(eo.Box,{position:"fixed",bottom:0,insetEnd:0})}),(0,t.jsxs)(a2.PopoverContent,{zIndex:"menu",h:"80vh",w:"400px",flex:1,position:"relative",color:l,borderColor:c,children:[(0,t.jsxs)(a5,{border:"0 none",mb:2,position:"sticky",children:[(0,t.jsxs)(d.HStack,{spacing:2,children:[(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faKeyboard}),(0,t.jsx)(tV.Heading,{size:"sm",children:(0,t.jsx)(g.Trans,{message:"Shortcuts",id:"CTqTgr"})})]}),(0,t.jsx)(a1.PopoverCloseButton,{})]}),(0,t.jsx)(a0.PopoverBody,{overflowY:"auto",children:"design"===n?(0,t.jsx)(eo.Box,{p:0,pb:1,fontSize:"sm",children:(0,t.jsx)(ru,{list:s})}):(0,t.jsxs)(t0.Tabs,{variant:"soft-rounded",size:"sm",isFitted:!0,children:[(0,t.jsxs)(tJ.TabList,{mb:6,children:[(0,t.jsxs)(tQ.Tab,{children:[(0,t.jsx)(eo.Box,{me:2,children:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faPencil})}),(0,t.jsx)(g.Trans,{message:"Doc mode",id:"vVRhxh"})]}),(0,t.jsxs)(tQ.Tab,{children:[(0,t.jsx)(eo.Box,{me:2,children:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faPresentationScreen})}),(0,t.jsx)(g.Trans,{message:"Present mode",id:"UodEcE"})]})]}),(0,t.jsxs)(a8.TabPanels,{children:[(0,t.jsxs)(a9.TabPanel,{p:0,pb:1,mt:4,fontSize:"sm",children:[(0,t.jsx)(ru,{list:o}),(0,t.jsx)(rn.SectionTitle,{pt:4,pb:4,children:(0,t.jsx)(g.Trans,{message:"Text & formatting",id:"Bb47jg"})}),(0,t.jsx)(ru,{list:a})]}),(0,t.jsx)(a9.TabPanel,{p:0,pb:1,mt:4,fontSize:"sm",children:(0,t.jsx)(ru,{list:r})})]})]})})]})]})};e.s(["KeyboardShortcutsPopover",0,rp,"ShortcutsTable",0,ru],206474),e.s([],855795);let rh=e=>(0,ed.useSSRMounted)()?(0,t.jsx)(rg,{...e}):null,rm=(0,n.memo)(({showShortcuts:e=!0,showOnboardingChecklist:i=!1,shortcutsVariant:a="doc"})=>{let o=(0,aN.useDispatch)(),s=(0,r.useFeatureFlag)("intercom"),l=(0,r.useFeatureFlag)("shareFeedback"),d=(0,aK.useLaunchIntercom)(),p=(0,aG.useLinguiLocale)(),{isOpen:m,onOpen:b,onClose:x}=(0,u.useDisclosure)(),{isOpen:y,onOpen:v,onClose:C}=(0,u.useDisclosure)({id:"locale-modal"}),{onOpen:w}=(0,u.useDisclosure)({id:"help-menu"}),[S,k]=(0,im.useLocalStorage)("hasUnreadIntercom",!1),I=window.Intercom,M=(0,n.useCallback)(()=>{k(!1),d()},[d,k]),T=(0,aX.useIsThemeDark)();return(0,n.useEffect)(()=>{if(!I)return;I("onHide",()=>{o((0,aq.setIsIntercomOpen)({isOpen:!1}))});let e=setInterval(()=>{document.querySelector("iframe.intercom-borderless-frame")&&k(!0)},1e3);return()=>{I("hide"),clearInterval(e)}},[o,I,k]),(0,t.jsxs)(tj.DarkModeProvider,{isDark:T,children:[(0,t.jsxs)(iv.Menu,{children:[(0,t.jsx)(iC.MenuButton,{"data-guider-highlight":"default-help-widget-activator",as:c.IconButton,onClick:()=>{w(),az.default.set("gamma_help_intent","true",{domain:en.config.VISITOR_ID_COOKIE_DOMAIN,expires:3,secure:!0,sameSite:"lax"}),aO.emit("toggleOpen",{behavior:"close",skipTracking:!0})},isRound:!0,position:"relative",size:"md","aria-label":f.i18n._({id:"c3XJ18",message:"Help"}),icon:S?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ne.Circle,{position:"absolute",size:2.5,bg:"red.400",top:0,insetEnd:0}),(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faBell,className:"fa-beat-fade"})]}):(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faQuestion})}),(0,t.jsxs)(iS.MenuList,{children:[(0,t.jsxs)(aD.MenuGroup,{children:[e&&(0,t.jsx)(iw.MenuItem,{onClick:b,icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faKeyboard}),children:(0,t.jsx)(g.Trans,{message:"Keyboard shortcuts",id:"77Emn0"})}),i&&(0,t.jsx)(iw.MenuItem,{as:ir.Link,_hover:{textDecoration:"none",shadow:"none"},onClick:()=>{var e,t;let i,n;e=_.SegmentEvents.ONBOARDING_CHECKLIST_WIDGET_CHECKLIST_MANUAL_OPENED,i=(0,E.getStore)().getState(),n=(0,Y.selectDocId)(i),Z.analytics?.track(e,{docId:n,...t}),aO.emit("toggleOpen",{behavior:"open"})},icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faClipboardListCheck}),"data-guider-highlight":"onboarding-checklist",children:(0,t.jsx)(g.Trans,{message:"Get started checklist",id:"BOFovM"})}),(0,t.jsx)(iw.MenuItem,{as:ir.Link,_hover:{textDecoration:"none",shadow:"none"},href:"https://ideas.gamma.app/changelog",target:"_blank",icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faMeteor}),children:(0,t.jsx)(g.Trans,{message:"What's new in {GAMMA_PROPER_NOUN}",id:"PbLEFQ",values:{GAMMA_PROPER_NOUN:A.GAMMA_PROPER_NOUN}})})]}),(0,t.jsx)(aP.MenuDivider,{}),(0,t.jsxs)(aD.MenuGroup,{children:[(0,t.jsx)(iw.MenuItem,{as:ir.Link,_hover:{textDecoration:"none",shadow:"none"},href:"https://help.gamma.app",target:"_blank",icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faMagnifyingGlass}),children:(0,t.jsx)(g.Trans,{message:"Help center",id:"CRzGla"})}),s?(0,t.jsx)(iw.MenuItem,{icon:S?(0,t.jsxs)(eo.Box,{position:"relative",children:[(0,t.jsx)(ne.Circle,{position:"absolute",size:1.5,bg:"red.400",top:0,insetEnd:-1}),(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faBell,className:"fa-beat-fade"})]}):(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faMessageLines}),onClick:M,children:(0,t.jsx)(g.Trans,{message:"Contact support",id:"mpby9d"})}):(0,t.jsx)(iw.MenuItem,{icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faEnvelope}),as:ir.Link,_hover:{textDecoration:"none",shadow:"none"},href:`mailto:${aB.GAMMA_SUPPORT_EMAIL}`,children:(0,t.jsx)(g.Trans,{message:"Email us",id:"A0C9La"})}),l&&(0,t.jsx)(iw.MenuItem,{as:ir.Link,_hover:{textDecoration:"none",shadow:"none"},href:"https://ideas.gamma.app/ideas",target:"_blank",icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faSend}),children:(0,t.jsx)(g.Trans,{message:"Share feedback",id:"u5hSeG"})})]}),(0,t.jsx)(aP.MenuDivider,{}),(0,t.jsx)(aD.MenuGroup,{children:(0,t.jsx)(iw.MenuItem,{icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faGlobe}),onClick:v,children:aU.SUPPORTED_LOCALE_OPTIONS[p]?.displayName||"Unknown"})})]}),(0,t.jsx)(rp,{isOpen:m,onClose:x,variant:a})]}),y&&(0,t.jsx)(aZ,{onClose:C})]})});rm.displayName="DefaultHelpWidgetComponent";let rg=(0,aY.default)(rm);rh.displayName="DefaultHelpWidget";let rf=(0,tL.keyframes)({"0%":{maskPosition:"0% 50%"},"50%":{maskPosition:"100% 50%"},"100%":{maskPosition:"0% 50%"}});(0,n.memo)(({children:e,...i})=>{let a=(0,ed.useSSRMounted)(),r=(0,D.useColorModeValue)("gradient.sky","linear-gradient(180deg,rgb(13, 17, 24) 0%, rgb(9, 14, 20) 100%)"),o=(0,n.useMemo)(()=>(0,I.getGlobalHandleCSSVars)(!1),[]);return a?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tL.Global,{styles:tL.css` html { scrollbar-gutter: stable; } `}),(0,t.jsxs)(j.Flex,{pt:4,w:"100%",minH:"100%",bgSize:"cover",bgPosition:"center center",position:"relative",bg:r,className:"ai-page-wrapper",flex:"1",sx:o,...i,children:[(0,t.jsx)(eo.Box,{zIndex:1,w:"100%",flex:"1",children:e}),(0,t.jsx)(aj,{children:(0,t.jsx)(rh,{showShortcuts:!1})})]})]}):null}).displayName="AIPageWrapper";var rb=e.i(973886),rx=e.i(136458),ry=e.i(400722),rv=e.i(432247);let rC={src:e.i(623056).default,width:2144,height:1534,blurWidth:0,blurHeight:0};var rw=e.i(275316);let rS=({isDark:e,templateIcon:i,tooltip:n,label:a,isSelected:r,onClick:o,badge:s,...l})=>(0,t.jsx)(m.GammaTooltip,{label:n,placement:"top",children:(0,t.jsx)(c.IconButton,{onClick:o,icon:(0,t.jsxs)(tX.Stack,{maxW:"100%",alignItems:"center",position:"relative",children:[i,s&&(0,t.jsx)(it.Badge,{position:"absolute",top:"1.5",insetStart:"1.5",colorScheme:"green",children:s()}),a&&(0,t.jsx)(P.Text,{maxW:"100%",w:"100%",fontSize:"xs",overflow:"hidden",textOverflow:"ellipsis",overflowX:"hidden",whiteSpace:"nowrap",textAlign:"start",children:a})]}),h:"auto",textShadow:"none",variant:"plain",p:2,flex:"1",w:"100%",cursor:"pointer",textAlign:"center",transition:"all 300ms ease",border:"1px solid",bg:e?r?"trueblue.900":"whiteAlpha.50":r?"trueblue.50":"blackAlpha.50",borderRadius:"md",boxShadow:"sm",borderColor:e?r?"trueblue.300":"whiteAlpha.100":r?"trueblue.500":"blackAlpha.100",color:e?r?"trueblue.200":"gray.300":r?"trueblue.500":"gray.600",_hover:{bg:e?r?"whiteAlpha.100":"whiteAlpha.200":r?"trueblue.100":"trueblue.50",borderColor:e?"trueblue.200":r?"trueblue.500":"trueblue.200"},position:"relative","aria-label":n,...l})});e.s(["CardTemplateButton",0,rS],149452);var rk=e.i(296753);let rA=({isDark:e,selectedTemplate:i,setSelectedTemplate:n,isDisabled:a})=>{let r=(0,rk.AI_CARD_TEMPLATES)(),o=e?"invert(.8) brightness(1.2)":"invert(0)",s=e?"invert(.8) brightness(2)":"invert(0)";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(P.Text,{color:e?"titanium.50":"titanium.900",fontSize:"sm",fontWeight:"normal",children:(0,t.jsx)(g.Trans,{message:"Choose a template",id:"hQDrYd"})}),(0,t.jsxs)(io.SimpleGrid,{spacing:2,columns:[2,3,5,r.length+1],children:[(0,t.jsx)(rS,{isDark:e,templateIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:n8.faTableLayout,fixedWidth:!0,size:"lg"}),label:(0,t.jsx)(g.Trans,{message:"Magic",id:"wtGmzA"}),tooltip:f.i18n._({id:"zopynZ",message:"Magic - Let {GAMMA_PROPER_NOUN} decide",values:{GAMMA_PROPER_NOUN:A.GAMMA_PROPER_NOUN}}),isSelected:null===i,onClick:()=>n(null),isDisabled:a}),r.map(({key:r,image:l,name:d,featureFlag:c,minProductFeature:u})=>{if(c&&!rw.featureFlags.get(c)||u&&!(0,tI.getCanUseProductFeature)(u))return null;let p=r===i;return(0,t.jsx)(rS,{isDark:e,templateIcon:(0,t.jsx)(ev.Image,{src:l.src,filter:p?s:o,bg:"white",borderRadius:"0.25rem"}),tooltip:d,isSelected:p,onClick:()=>n(r),isDisabled:a},r)})]})]})};var rE=e.i(210104);let r_=({theme:e,handle:i,editor:a,getPos:r,input:o,displayFullBleed:s,isFocused:u})=>{let{isInOfflineMode:m}=(0,x.useHealthCheck)(),b="image"===(0,tu.getDocAttrs)(a).aiOptions.cardContentType,y=o.template??(b?"imageCard":null),v=(0,V.useIsThumbnailView)(),{isGenerating:C,getContextAndGenerate:A,updateInput:E,locale:I}=(0,rE.useGenerateCard)({theme:e,editor:a,getPos:r,input:{...o,template:y}}),M=(0,ix.useDebounced)(E,500),{prompt:T}=o,[L,P]=(0,n.useState)(T),R=(0,k.useCreditWarning)({cost:w.DEFAULT_CREDIT_COSTS.generateCard,surface:"generate-card",source:{segmentEvent:_.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD,upsellLocation:"credits.generateCard"}}),O=(0,U.useAllowOrUpsell)(()=>{E({prompt:L}),A(L)},"generateCard",_.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),B=()=>{R?.isBlocking?R.cta.onClick?.():O()},z=(0,D.useColorModeValue)(!1,!0),F=(0,n.useRef)(null),{suggestions:H,generateSuggestionsStatus:G}=(0,rE.useSuggestCardTopics)(a,u);return((0,n.useEffect)(()=>{u&&F.current&&setTimeout(()=>{F.current?.focus()})},[u]),C)?(0,t.jsxs)(j.Flex,{position:"relative",maxW:"100%",w:"var(--card-width)",minH:32,contentEditable:"false",justify:"center",direction:"column",p:"var(--card-inner-padding)",children:[i,(0,t.jsxs)(tX.Stack,{zIndex:1,w:"100%",children:[(0,t.jsx)(iI.Skeleton,{height:"3em",w:"33%",mb:4}),(0,t.jsx)(iI.Skeleton,{height:"1.5em"}),(0,t.jsx)(iI.Skeleton,{height:"1.5em"}),(0,t.jsx)(iI.Skeleton,{height:"1.5em"}),(0,t.jsx)(iI.Skeleton,{height:"1.5em",w:"75%"})]})]}):v?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rv.NodeViewContent,{style:{position:"absolute",opacity:0}}),(0,t.jsxs)(j.Flex,{contentEditable:"false",suppressContentEditableWarning:!0,w:"var(--card-width)",maxW:"100%",minH:32,position:"relative",borderRadius:s?"none":"var(--card-border-radius)",p:"var(--card-inner-padding)",direction:"column",justify:"center",m:"-1px",fontFamily:"body",onMouseDown:e=>{!(e.target instanceof HTMLElement&&e.target.closest(".drag-handle"))&&(e.preventDefault(),F.current&&F.current===document.activeElement?F.current.blur():a.view instanceof aI.EditorView&&a.view.hasFocus()&&a.commands.blur())},children:[(0,t.jsx)(eo.Box,{bg:z?"gradient.secondary-dark":"gradient.secondary-light",bgSize:"cover",bgPosition:"center center",borderRadius:"inherit",pos:"absolute",inset:0,pointerEvents:"none",w:s?"var(--editor-width)":void 0,insetStart:s?"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)":void 0,transform:s?"translateX(-50%)":void 0}),i,(0,t.jsx)(eo.Box,{position:"absolute",zIndex:0,pointerEvents:"none",inset:0,bgImage:`url(${rC.src})`,bgRepeat:"repeat",bgPosition:"center center",sx:{animation:`${rf} 180s linear infinite`,maskImage:"linear-gradient(to left, rgba(0,0,0,.75), transparent, rgba(0,0,0,.75))",maskRepeat:"repeat",maskSize:"140px"},opacity:z?.2:1}),(0,t.jsx)(c.IconButton,{position:"absolute",top:2,insetEnd:2,variant:"ghost",colorScheme:z?"whiteAlpha":"blackAlpha",isRound:!0,size:"sm","aria-label":f.i18n._({id:"DIQZR1",message:"Close AI card generator"}),icon:(0,t.jsx)(h.FontAwesomeIcon,{fixedWidth:!0,icon:N.faTimes}),onClick:()=>{M.cancel();let e=r();"number"==typeof e&&a.commands.deleteCard(e)}}),(0,t.jsxs)(tX.Stack,{spacing:4,pos:"relative",zIndex:1,maxWidth:"100%",children:[(0,t.jsxs)(d.HStack,{justify:"end",flexWrap:"wrap",children:[(0,t.jsx)(tV.Heading,{fontWeight:700,size:"md",color:z?"white":"blue.950",children:"imageCard"===y?(0,t.jsx)(g.Trans,{message:"Generate image card",id:"UR4RPR"}):(0,t.jsx)(g.Trans,{message:"Generate card",id:"8e1wQN"})}),(0,t.jsx)(aE.Spacer,{}),(0,t.jsx)(ry.AICreditsBadgeAndModalWithOfflineCheck,{modalId:"ai-credits-modal-generate-card",variant:"ghost",isDark:z,justify:"flex-end",segmentEvent:_.SegmentEvents.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD,upsellLocation:"credits.generateCard"}),(0,t.jsx)(rx.AILocalePicker,{locale:I,setLocale:e=>E({settings:{locale:e}}),buttonProps:{variant:"plain",size:"sm",textAlign:"left",w:["100%","100%","auto"],isDisabled:m}})]}),(0,t.jsxs)(t9.InputGroup,{color:z?"white":"gray.700",bg:z?"blackAlpha.900":"white",boxShadow:"sm",border:"none",borderRadius:"md",display:"flex",alignItems:"start",gap:"0",onMouseDown:tW.stopPropagation,_focusWithin:{boxShadow:"var(--chakra-shadows-sm), var(--chakra-shadows-outline)"},transitionProperty:"box-shadow",transitionDuration:"normal",children:[(0,t.jsx)(aM.ResizingTextarea,{ref:F,"data-in-editor-focus":!0,fontWeight:"500",border:"none",fontSize:"lg",initialHeight:"4rem",placeholder:f.i18n._({id:"BiLwIi",message:"Describe what you'd like to make"}),value:L,isDisabled:m,onChange:e=>{P(e.target.value),M({prompt:e.target.value})},onKeyDown:e=>{if(!e.shiftKey)if("Enter"===e.key)B();else if("ArrowDown"!==e.key||L){if("ArrowUp"===e.key&&!L){let e=r();if("number"!=typeof e)return;a.chain().focus(e).selectInsideNextCard(!1).run()}}else{let e=r();if("number"!=typeof e)return;a.chain().focus(e).selectInsideNextCard(!0).run()}},_focus:{boxShadow:"none"},_focusVisible:{boxShadow:"none"},p:5}),(0,t.jsx)(aA,{h:"100%",border:"none",color:z?"white":"gray.700",bg:z?"blackAlpha.900":"white",p:3,ps:0,alignItems:"end",display:["none","none","flex"],children:(0,t.jsx)(S.CreditWarningTooltip,{creditWarning:R,children:(0,t.jsxs)(l.Button,{px:3,"aria-label":"Generate card",isDisabled:!L||m,onClick:B,onMouseDown:tW.preventDefaultToAvoidBlur,children:[(0,t.jsx)(W.CreditCostIcon,{type:"generateCard",ms:0,me:2,color:"currentcolor"}),(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faPaperPlaneTop})]})})})]}),(0,t.jsx)(S.CreditWarningTooltip,{creditWarning:R,children:(0,t.jsxs)(l.Button,{variant:"solid","aria-label":"Generate card",isDisabled:!L,onClick:B,onMouseDown:tW.preventDefaultToAvoidBlur,display:["flex","flex","none"],leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faPaperPlaneTop}),children:[(0,t.jsx)(g.Trans,{message:"Generate",id:"ziAjHi"}),(0,t.jsx)(W.CreditCostIcon,{type:"generateCard",ms:0,me:2})]})}),(0,t.jsx)(ax.Collapse,{in:!L&&!m&&(H.length>0||"generating"===G),children:(0,t.jsxs)(d.HStack,{direction:["column","row"],spacing:2,wrap:"wrap",children:[H?.map((e,i)=>(0,t.jsx)(l.Button,{leftIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:p.faSparkle}),onClick:()=>{P(e),E({prompt:e})},borderRadius:"full",variant:"ghost",bg:z?"whiteAlpha.100":"blackAlpha.100",color:z?"whiteAlpha.800":"blackAlpha.800",_hover:{bg:z?"whiteAlpha.300":"blackAlpha.300"},colorScheme:z?"whiteAlpha":"blackAlpha",size:"xs",isTruncated:!0,flexShrink:0,children:e},i)),"generating"===G&&(0,t.jsxs)(a_.Tag,{variant:"subtle",colorScheme:z?"whiteAlpha":"blackAlpha",color:z?"whiteAlpha.500":"blackAlpha.500",children:[(0,t.jsx)(a_.TagLeftIcon,{boxSize:"12px",as:iD.Spinner}),(0,t.jsx)(a_.TagLabel,{children:(0,t.jsx)(g.Trans,{message:"Thinking",id:"AUV+TY"})})]})]})}),R&&(0,t.jsx)(rb.UpsellWarningBox,{status:R.status,title:R.title,subtitle:R.subtitle,cta:R.cta.label,ctaTooltip:R.cta.tooltip,onClick:R.cta.onClick,onDismiss:R.onDismiss}),(0,t.jsx)(rA,{isDark:z,selectedTemplate:y,setSelectedTemplate:e=>{E({template:e})},isDisabled:m})]})]})]})},rI=({displayLayout:e,children:i,isExpandableSelected:n,isFocused:a,displayFullBleed:r,isEditable:o,isNested:s,attrs:l,hasLayoutItem:d,cardContentType:c,onDoubleClick:u,cardDimensions:p,theme:h,handle:m,editor:g,getPos:f,updateAttributes:b})=>{if(l.generatorInput&&"done"!==l.generatorInput.status&&o)return(0,t.jsx)(r_,{theme:h,handle:m,editor:g,getPos:f,input:l.generatorInput,updateAttributes:b,displayFullBleed:r,isFocused:a});let x=(0,th.findLayoutPreset)(e),y=(0,th.getCardLayoutChildrenSx)(e),v=l.layoutTemplateColumns,C=l.layoutTemplateRows,w=o&&p.aspectRatio&&!s&&(!l.fontScale||l.fontScale===eR.MIN_FONT_SCALE);return(0,t.jsxs)(eo.Box,{className:(0,ej.cx)(ab.CARD_LAYOUT_CLASS,n&&"expandable-selected"),onDoubleClick:u,w:"var(--card-width)",maxW:"100%",position:"relative",spellCheck:a,cursor:"auto",color:"var(--body-color)",sx:{[`> .${eR.CARD_CONTENT_CLASS}`]:{padding:d||"responsive"!==c?void 0:"var(--card-inner-padding)",counterReset:"footnote",'> [data-node-view-content-inner="card"]':{..."responsive"!==c?{}:d?{display:"grid",alignItems:"stretch",justifyContent:"stretch",minH:"100%",transitionDuration:`${eR.EXPAND_CARD_TRANSITION_TIME}ms`,transitionProperty:"grid-template-rows, grid-template-columns, min-height",...x.grid,...v&&"top"!==e&&x.allowResizing&&{gridTemplateColumns:v},...C&&"top"===e&&x.allowResizing&&{gridTemplateRows:C},...y}:{display:"block",mx:"auto",maxW:"var(--max-content-width)",width:"100%",boxSizing:"border-box",minW:0},"> .node-cardLayoutItem":{"> [data-node-view-wrapper]":{"> .card-layout-cell-bg":{"> [data-node-view-content]":{"> [data-node-view-content-inner]":{maxWidth:"var(--max-content-width)",margin:"auto"},padding:"var(--card-inner-padding)"}}}}}},_hover:{"> .card-height-guide":{opacity:1}}},children:[m,i,w&&(0,t.jsx)(ag,{isFocused:a})]})};e.i(197071);var rM=e.i(564246);let rT=new aR.EventEmitter;e.s(["eventEmitter",0,rT],501098);var rL=e.i(59614),rj=e.i(144621),rP=e.i(398358);let rD=({hasNotes:e,isReadonly:i})=>e?i?(0,t.jsx)(g.Trans,{message:"View notes",id:"nqt+Fj"}):(0,t.jsx)(g.Trans,{message:"Edit notes",id:"+kQy/G"}):i?null:(0,t.jsx)(g.Trans,{message:"Add notes",id:"GquPwe"});e.s(["CardNotesButton",0,({cardId:e,decorations:i,editor:a,getPos:r,hasNonEmptyCardNotes:o,isReadonly:s,...d})=>{let u=(0,rM.useEditorState)(),g=(0,n.useCallback)(()=>{let t=r();if("number"!=typeof t)return;if(!s){let{hasCardNotesNode:e}=(0,rj.findCardPluginDecoration)(i);e||(0,rP.addCardNotes)(a,t)}let n=(0,E.getStore)(),o=(0,rL.selectActiveNoteCardId)(n.getState());rT.emit("toggle",{clickedCardId:e,activeNotesCardId:o}),(0,rP.isSelectionWithinTopCardAtPos)(u,t)||a.commands.selectInsideNodeAtPos(t)},[e,i,s,a,r,u]),b=(0,I.useGetStylesForHandleButtons)();return(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(rD,{hasNotes:o,isReadonly:s}),placement:"top",children:(0,t.jsx)(l.Button,{as:c.IconButton,icon:(0,t.jsx)(eo.Box,{as:"span",display:"inline-flex",children:(0,t.jsx)(h.FontAwesomeIcon,{icon:o?p.faMemoPad:N.faMemoPad,fixedWidth:!0})}),"aria-label":o||s?f.i18n._({id:"nqt+Fj",message:"View notes"}):f.i18n._({id:"GquPwe",message:"Add notes"}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",pointerEvents:"auto",minW:"auto",...b,px:1.5,onMouseDown:tW.preventDefaultToAvoidBlur,onClick:g,...d})})}],908613);var rN=e.i(397068),rR=e.i(85901),rO=e.i(157888);let rB=({isMobileDevice:e,numericFontSize:t})=>(e?1.5:3.5)/t,rz=e=>"sm"===e?.875:"lg"===e?1.25:1,rF=(0,rO.default)(e=>e?{"--top-accent-height-sm":"4.125em","--top-accent-height-md":"8em","--top-accent-height-lg":"12.375em","--top-accent-height":"var(--top-accent-height-md)","--behind-accent-height":"12em"}:{"--top-accent-height-sm":"6.25em","--top-accent-height-md":"12.5em","--top-accent-height-lg":"18.75em","--top-accent-height":"var(--top-accent-height-md)","--behind-accent-height":"24em"}),rH=(0,rO.default)(({isPresentMode:e,isNested:t,isFullBleed:i,displayFullBleed:n,isThumbnail:a,isMobileDevice:r,attrs:o})=>{let s="none"!==o.background.type&&!t,l=a?"em":e?"rem":"em",d=n||t?"0px":r?`0.5${l}`:`2${l}`,c=`calc(var(--card-outer-padding-x) + ${i||t?"0px":"var(--doc-padding-left, 0px)"} + ${e?"var(--present-padding-left, 0px)":"0px"})`,u=`calc(var(--card-outer-padding-x) + ${i||t?"0px":"var(--doc-padding-right, 0px)"} + ${e?"var(--present-padding-right, 0px)":"0px"})`;return{outerPaddingX:d,outerPaddingY:n||t?"0px":r?`0.5${l}`:!s||e||a?`2${l}`:`8${l}`,outerPaddingLeft:c,outerPaddingRight:u}}),rW=({theme:e,fontSize:t,isMobileDevice:i,contentWidth:n,nestedDepth:a=0})=>{let r=rz(t||"md"),o="lg"===n?rR.WIDE_CONTENT_WIDTH_CHARS:"sm"===n?rR.NARROW_CONTENT_WIDTH_CHARS:rR.NORMAL_CONTENT_WIDTH_CHARS,s=e.config.fontSize??1,l=s*r,d=o*(rR.CHAR_WIDTH/s)/r,c=((e=0)=>e*eR.NESTED_CARD_OUTDENT)(a);return{baseFontSize:l,contentWidthEms:d,themeFontSize:s,cardWidthEms:d+2*rB({isMobileDevice:i,numericFontSize:r})+2*c}},rU=(0,rO.default)(({isPresentMode:e,isNested:t,nestedDepth:i,isFullBleed:n,isThumbnail:a,theme:r,cardDimensions:o,defaultContentWidth:s,contentWidth:l,showPresentBackdrop:d,isMobileDevice:c,docZoomLevel:u,fontSize:p,cardFontScale:h=1})=>{let{baseFontSize:m,contentWidthEms:g,cardWidthEms:f}=rW({theme:r,fontSize:p,isMobileDevice:c,contentWidth:l??s,nestedDepth:i});return{...(e||a?o.aspectRatio&&!eO.isScreenshot?rZ:r$:c?rG:rV)({baseFontSize:m,contentWidthEms:g,cardWidthEms:f,cardAspectRatio:o.aspectRatio,showPresentBackdrop:d,isNested:t,isFullBleed:n,isThumbnail:a,docZoomLevel:u,nestedDepth:i,cardFontScale:h})}}),rV=({cardWidthEms:e,cardAspectRatio:t,isNested:i,baseFontSize:n,docZoomLevel:a,cardFontScale:r,contentWidthEms:o})=>({"--font-size":`calc(${n} * var(--card-font-scale, 1) * var(--editor-font-size, 1rem) * ${a} * var(--viewport-scale-factor, 1.125))`,"--card-font-scale":`${r||1}`,"--card-width":`calc(${e}em / var(--card-font-scale, 1))`,"--card-min-height":t&&!i?`calc(min(var(--card-width), var(--editor-width)) / ${t})`:"0px","--max-content-width":`calc(${o}em / var(--card-font-scale, 1))`,"--card-max-width":"var(--editor-width)","--media-scale":"min(1, var(--card-font-scale, 1))"}),rG=({cardWidthEms:e,baseFontSize:t,isNested:i,cardAspectRatio:n})=>({"--font-size":`${t}rem`,"--card-width":`${e}em`,"--card-min-height":n&&!i?`calc(min(var(--card-width), var(--editor-width)) / ${n})`:"0px","--card-max-width":"var(--editor-width)","--media-scale":"1"}),r$=({contentWidthEms:e,cardWidthEms:t,showPresentBackdrop:i,isFullBleed:n,baseFontSize:a,isNested:r,isThumbnail:o})=>{let s=eO.isPdfExport||eO.isImageExport?`calc(${a}rem * var(--viewport-scale-factor, 1.125))`:`calc(var(--zoom-level) * clamp(${o?"0rem":"1rem"}, var(--card-max-width) / ${t}, 3vh))`,l=!i||n;return{"--font-size":s,"--card-width":l?"var(--editor-width)":`${t}em`,"--card-max-width":"calc(var(--editor-width) - 2 * var(--card-outer-padding-x))","--card-min-height":o&&!r?"var(--thumbnail-min-height, 0px)":l&&!r?"100vh":"0vh","--max-content-width":`${1.2*e}em`,"--media-scale":"1"}},rZ=({cardAspectRatio:e,cardWidthEms:t,isNested:i,cardFontScale:n})=>{let a=eO.isPdfExport||eO.isImageExport?`calc(var(--card-max-width) / ${e})`:"calc(100vh - 2 * var(--card-outer-padding-y))",r=`min(var(--card-max-width), calc(var(--card-max-height) * ${e}))`,o=i?"0px":`calc(${r} / ${e})`,s=`calc(var(--zoom-level) * var(--card-font-scale, 1) * ${r} / ${t})`;return{"--card-width":r,"--card-font-scale":`${n||1}`,"--font-size":s,"--card-max-width":"calc(var(--editor-width) - 2 * var(--card-outer-padding-x))","--card-max-height":a,"--card-min-height":o,"--media-scale":"min(1, var(--card-font-scale, 1))"}};e.s(["getCardSizeCSSVars",0,rU,"getCardWidthAndFontSize",0,rW],367369);var rK=e.i(413829),rq=e.i(473226),rY=e.i(875504),rX=e.i(392678);let rQ=e=>{let t;return t=(e?.type==="image"||e?.type==="themeLogo")&&e.imageSize||"md",rX.CARD_MARGIN_IMAGE_SIZES[t].height},rJ=(e,t)=>{var i;return e?rQ(e)*(i=t??1,1-((0,rK.default)(i,1,4.5)-1)/3.5*.4):rX.CARD_MARGIN_IMAGE_SIZES.md.height},r0=(e,t)=>{let i=rX.BASE_CARD_MARGIN_PADDING[e||"md"],n=(t-rX.MIN_ELEMENT_SIZE_EMS)*.2;return(0,rq.default)(i+Math.max(0,n),2)},r1=e=>{let{hideFromFirst:t,hideFromLast:i,...n}=e,a=rX.MIN_ELEMENT_SIZE_EMS;return Object.values(n).forEach(e=>{if(e&&("image"===e.type||"themeLogo"===e.type)&&!(0,rY.isEmptyMarginElement)(e)){let t=rQ(e);t>a&&(a=t)}}),a},r2=(e,t)=>{let i=r1(e),n=r0(t,i);return i+2*n};e.s(["getBalancedImageHeightEms",0,rJ,"getCardMarginPaddingEms",0,r0,"getElementOpticalPaddingEms",0,(e,t,i,n,a)=>{if(!t)return{start:0,end:0};let r=t?.type==="image"||t?.type==="themeLogo",o=t?.type==="text"||t?.type==="cardNumbers",s=r0(i,e),l=r?rJ(t,n):rX.TEXT_ELEMENT_SIZE_EMS,d=r?rQ(t):rX.TEXT_ELEMENT_SIZE_EMS,c=(e-l)*s/2,u=Math.max(0,(1-l/d)*s)+Math.max(0,c);return{start:(0,rq.default)(u+("flex-start"===a&&o?.3:0),2),end:(0,rq.default)(u+("flex-end"===a&&o?.3:0),2)}},"getHeightOfLargestElementEms",0,r1,"getTotalCardMarginHeightEms",0,r2],447143);let r3=({attrs:e,children:i,presentVariant:a,isPresentMode:r,isDark:o,isNested:s,isThumbnail:l,isFullBleed:d,displayFullBleed:c,isMobileDevice:u,fontSize:p,nestedDepth:h,theme:m,cardDimensions:g,showPresentBackdrop:f,userZoomLevel:b,verticalAlign:x,defaultContentWidth:y,contentWidth:v,docZoomLevel:C,cardContentType:w})=>{let S=(({isPresentMode:e,isNested:t,isFullBleed:i,displayFullBleed:a,isThumbnail:r,isMobileDevice:o,attrs:s,fontSize:l,nestedDepth:d,cardContentType:c})=>{let u,{outerPaddingX:p,outerPaddingY:h,outerPaddingLeft:m,outerPaddingRight:g}=rH({isPresentMode:e,isNested:t,isFullBleed:i,displayFullBleed:a,isThumbnail:r,isMobileDevice:o,attrs:s}),f=rB({isMobileDevice:o,numericFontSize:rz(l||"md")}),b=((e=0)=>e*eR.NESTED_CARD_OUTDENT)(d),x="image"===c?0:f+b,{cardMarginSettings:y}=(0,E.useAppSelector)(te.selectDocSettingsWithDefaults),v=(0,E.useAppSelector)(te.selectTheme),C=(0,rY.hasNoCardMarginElements)(y)?2.75:r2(y,v?.config.roundness);return u=e||r?C:o?t?2.25:1.5+ +!!i:i?Math.max(4.75,C):C,(0,n.useMemo)(()=>({"--card-inner-padding-x":`calc(${f}em / var(--card-font-scale, 1))`,"--card-inner-padding-y":`calc(${u}em / var(--card-font-scale, 1))`,"--card-inner-padding":"var(--card-inner-padding-y) var(--card-inner-padding-x)","--card-outer-padding-left":m,"--card-outer-padding-right":g,"--card-outer-padding-x":p,"--card-outer-padding-y":h,"--comment-padding":`${x}em`,"--nested-card-margin":"calc(-1 * var(--comment-padding))"}),[x,f,u,m,g,p,h])})({isPresentMode:r,isNested:s,isFullBleed:d,displayFullBleed:c,isThumbnail:l,isMobileDevice:u,attrs:e,fontSize:p,nestedDepth:h,cardContentType:w}),k=rF(u),A=rU({isPresentMode:r,isNested:s,nestedDepth:h,isFullBleed:d,isThumbnail:l,theme:m,cardDimensions:g,defaultContentWidth:y,contentWidth:v,showPresentBackdrop:f,isMobileDevice:u,fontSize:p,docZoomLevel:C,cardFontScale:e.fontScale}),{background:_,id:I}=e,M=(0,E.useAppSelector)(te.selectAnimationsEnabled),T=s||l?void 0:(0,rN.getBackgroundProps)(_,o);return(0,t.jsx)(j.Flex,{onDragOver:tW.preventDefaultToAllowDrop,top:0,left:0,position:"relative",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",cursor:"default","data-animate-value":a,fontSize:"var(--editor-font-size, 1rem)",py:"var(--card-outer-padding-y)",pl:"var(--card-outer-padding-left)",pr:"var(--card-outer-padding-right)","data-card-id":I,"data-card-scroll-element":!0,overflow:r&&!s?"hidden auto":void 0,sx:{scrollbarGutter:!r||s||l||eO.isPuppeteer?void 0:"stable"},margin:"0 auto",className:(0,ej.cx)(eR.CARD_WRAPPER_CLASS,"card-expanded",r&&!l&&eR.CARD_PRESENTING_CLASS,r&&!l&&`card-present-mode card-present-mode--${a}`),transitionProperty:"transform, padding",transitionDuration:`${M?eR.BETWEEN_CARD_TRANSITION_TIME:0}ms`,...T,css:{...S,...k,...A,"--zoom-level":b,"--card-vertical-align":x},children:i})};r3.displayName="CardContainer",e.s(["CardWrapper",0,r3],382818);var r5=e.i(468738),r4=e.i(763896);let r6=(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faCompressAlt}),r9=(0,n.memo)(function({cardId:e,getPos:a,editor:r,isNested:o,isCollapsed:u,isPresentMode:p,isEditable:b,isDark:x,top:y}){let v=(0,r5.useAnalytics)(),C=(0,n.useCallback)(()=>{let t=a();if("number"==typeof t){if(p&&!b)r.commands.spotlightCollapseCard(t);else{(0,tF.setCardCollapsed)(e,!0);let{selection:n}=r.state,a=(0,i.findParentNode)(s.isCardNode)(n);a&&a.node.attrs.id===e&&r.commands.selectNodeAtPos(t)}v?.track(_.SegmentEvents.CARD_COLLAPSED,{method:"collapse_button",is_present_mode:!1})}},[r,a,v,e,b,p]),w=(0,r4.useTooltipPortalRef)(),S=(0,n.useMemo)(()=>(0,t.jsx)(m.GammaTooltip,{label:(0,t.jsx)(g.Trans,{message:"Collapse card",id:"kBUgVh"}),placement:"top",portalProps:{containerRef:w},children:(0,t.jsx)(c.IconButton,{variant:"ghost",size:"sm",paddingInlineStart:6*!!(0,aL.isMobileDevice)(),paddingInlineEnd:2*!!(0,aL.isMobileDevice)(),onClick:C,onMouseDown:tW.preventDefaultToAvoidBlur,isRound:!0,"aria-label":f.i18n._({id:"H86f9p",message:"Collapse"}),"data-collapse-card-button":!0,icon:r6,color:x?"gray.300":"gray.600"})}),[C,w,x]),k=(0,n.useMemo)(()=>(0,t.jsx)(l.Button,{size:"sm",variant:"ghost",position:"absolute",zIndex:2,bottom:[1,3],right:[2,4],rightIcon:(0,t.jsx)(h.FontAwesomeIcon,{icon:N.faChevronUp}),"data-collapse-card-button":!0,onMouseDown:tW.preventDefaultToAvoidBlur,onClick:C,fontWeight:"normal",color:x?"gray.300":"gray.600",children:(0,t.jsx)(g.Trans,{message:"Collapse",id:"H86f9p"})}),[C,x]);return(0,t.jsxs)(j.Flex,{contentEditable:!1,onClick:tW.stopPropagation,className:"manage-card-controls","data-print-hidden":!0,transitionProperty:"common",transitionDuration:"normal",display:"inherit",fontFamily:"body",sx:{"[data-collapse-card-button]":{visibility:o&&!u?"visible":"hidden"}},children:[(0,t.jsx)(d.HStack,{spacing:1,position:"absolute",top:y||[1,3],insetInlineEnd:[2,4],zIndex:2,children:S}),o&&!u&&k]})});e.s(["CollapsedCardControls",0,r9],309623)},376742,906857,657729,710317,e=>{"use strict";e.i(197071);var t=e.i(896416),i=e.i(783197),n=e.i(418755),a=e.i(335884),r=e.i(136484),o=e.i(551880),s=e.i(615393),l=e.i(372764),d=e.i(470645),c=e.i(755453),u=e.i(175863),p=e.i(615505);e.i(254884);var h=e.i(753801);e.i(734710);var m=e.i(430378),g=e.i(78387),f=e.i(977581),b=e.i(308822),x=u,y=e.i(509510),v=e.i(285598);class C extends x.Selection{constructor(e,t=0){const i=e.nodeAfter,n=e.node(0).resolve(e.pos+i.nodeSize);super(e,n),this.node=i,this.side=t}side;node;map(e,t){let{deleted:i,pos:n}=t.mapResult(this.anchor),a=e.resolve(n);return i?(0,v.findSelectionNearOrGapCursor)(a)||x.Selection.near(a):new C(a,this.side)}content(){return new b.Slice(b.Fragment.from(this.node),0,0)}eq(e){return e instanceof C&&e.anchor===this.anchor&&e.side===this.side}toJSON(){return{type:"presentation",anchor:this.anchor,side:this.side}}createSelectionNear(){let e=this.side<1?1:-1;return(0,y.findSelectionInsideNode)(this.$from,e)||x.Selection.near(this.$from)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for PresentationSelection.fromJSON");return new C(e.resolve(t.anchor))}static create(e,t,i){return new C(e.resolve(t),i)}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}}if(C.prototype.visible=!1,!C.prototype.jsonID)try{x.Selection.jsonID("presentation",C)}catch(e){}var w=e.i(131339),S=e.i(103630);e.s(["findNextNode",()=>U,"isNodeContentSpotlightable",()=>F,"isNodeSpotlightable",()=>z,"spotlightingBlock",()=>D],906857),e.i(24439);var k=e.i(830269),A=e.i(379457),E=e.i(647031),_=e.i(85547),I=e.i(536913),M=e.i(49202),T=e.i(555999),L=e.i(829814);let j=new u.PluginKey("spotlight"),P=(e,t,i)=>{if(null===t.pos)return p.DecorationSet.create(e.doc,[]);let n=[],a=e.doc.nodeAt(t.pos);a&&(0,S.isCardNode)(a)&&!i(a,t.cardId)?n.push(p.Decoration.node(t.pos,t.pos+a.nodeSize,{class:"presenting-card"})):a&&i(a,t.cardId)&&n.push(p.Decoration.node(t.pos,t.pos+a.nodeSize,{class:"spotlight-block"}));let r=t.pos;return e.doc.descendants((e,a)=>(i(e,t.cardId)&&n.push(p.Decoration.node(a,a+e.nodeSize,{class:(0,d.cx)("spotlightable",a>r&&"after-spotlight")})),F(e)||(0,S.isCardNode)(e))),p.DecorationSet.create(e.doc,n)},D=(e,t)=>{let i=t.pos?e.state.doc.nodeAt(t.pos):null;return i&&z(i,t.cardId)},N=({tr:e,editor:t,spotlight:i,bias:n=0,method:a="replace"})=>{e.setMeta(j,i);let r=j.getState(t.state);if(i.cardId||(0,k.updateCardHash)({cardId:null,method:a,emitChange:!1}),r.cardId!==i.cardId&&i.cardId){(0,k.updateCardHash)({cardId:i.cardId,method:a,emitChange:!1});let r=(0,S.findCardById)(t,i.cardId);r&&e.setSelection(C.create(e.doc,r.pos,n))}t.commands.user({spotlight:i})},R=(e,t)=>{if(!t)return;let i=document.querySelector(`${e} ${(0,_.getCardScrollerSelector)(t)}`);i&&(i?.classList.add("cardWiggle"),setTimeout(()=>{i?.classList.remove("cardWiggle")},750))},O=(e,t)=>{let i=D(e,t),n=i&&t.cardId&&t.pos&&U(e,t.cardId,t.pos,e=>z(e,t.cardId),!0).cardId!==t.cardId;return{isSpotlightingBlock:i,isSpotlightingFirstBlock:n}},B=e=>{switch(e.type.name){case"card":return!(0,w.isCardCollapsed)(e);case"toggle":return(0,I.isToggleOpen)(e.attrs.id);default:return!1}},z=(e,t)=>{switch(e.type.name){case"paragraph":case"heading":case"title":case"math_display":case"codeBlock":return e.textContent.trim().length>0||e.content.content.some(e=>"text"!==e.type.name);case"calloutBox":case"blockquote":case"bullet":case"numbered":case"todo":case"embed":case"video":case"image":case"graphic":case"mediaPlaceholder":case"gallery":case"drawing":case"diagram":case"smartDiagram":case"chart":case"graphyChart":case"contributors":case"tableOfContents":case"toggleSummary":case"table":case"buttonGroup":case"labelGroup":case"gridCell":case"smartLayoutCell":case"gridItem":return!0;case"toggle":return!(0,I.isToggleOpen)(e.attrs.id);case"card":{let t=(0,o.selectCardIdMap)((0,n.getStore)().getState()).parents[e.attrs.id].slice(-1)[0];return!0===(0,w.isCardCollapsed)(e)&&!1===(0,w.isCardCollapsed)(t)}default:return!1}},F=e=>{switch(e.type.name){case"toggle":return(0,I.isToggleOpen)(e.attrs.id);case"card":return!(0,w.isCardCollapsed)(e);case"footnote":case"gallery":case"gridCell":case"smartLayoutCell":case"table":case"cardNotes":case"blockquote":case"calloutBox":case"gridItem":return!1;default:return!0}};c.Extension.create({name:"spotlight",addOptions:()=>({scrollerSelector:"body"}),addCommands(){return{syncSpotlightAndScroll:({spotlight:e,scroll:t,scrollOffset:i})=>({editor:n,view:a,tr:r})=>{let{pos:o,cardId:s}=e,l=j.getState(n.state).cardId!==s;if(o){let e=a.state.doc.nodeAt(o),t=a.nodeDOM(o);if(e&&t instanceof HTMLElement){console.debug(`[Spotlight.syncSpotlight] Scrolling to specific card at pos: ${o}`,t);let i=(0,S.isCardNode)(e)&&e.attrs.id===s;setTimeout(()=>requestAnimationFrame(()=>{i?$({}):G({element:t})}),l?_.BETWEEN_CARD_TRANSITION_TIME:0)}}else if(t?.pos){let{pos:e,pct:a}=t;setTimeout(()=>requestAnimationFrame(()=>{n.commands.scrollToPositionInCard(e,a||void 0,i)}),l?_.BETWEEN_CARD_TRANSITION_TIME:0)}return N({editor:n,tr:r,spotlight:{pos:o,cardId:s}}),!0},spotlightCardById:(e,t=!1)=>({editor:i,view:n})=>{let a=j.getState(i.state),r=(0,S.findCardById)(i,e);if(!r)return!0;let o=i.state.doc.resolve(r.pos),s=o.depth>1,l=s?(0,E.findTopCardNodeParent)(i.state.doc,r.pos):r;if(l){let d=a.cardId!==e;if(s){(0,w.setCardCollapsed)(e,!1),(0,E.openParentCards)({pos:o.pos,editor:i});let t=n.nodeDOM(r.pos);t instanceof HTMLElement&&setTimeout(()=>requestAnimationFrame(()=>{G({element:t,behavior:"smooth"})}),d?_.BETWEEN_CARD_TRANSITION_TIME:0)}return t?i.commands.spotlightNextBlock(!1,{pos:r.pos,cardId:e}):i.commands.syncSpotlightAndScroll({spotlight:{pos:null,cardId:l.node.attrs.id}})}return!0},spotlightCurrentCard:()=>({editor:e,tr:t})=>{let i,n=()=>{console.warn("[Spotlight.spotlightCurrentCard] Couldnt find a card to spotlight, so using first card.");let i=e.view.state.doc.nodeAt(1);return i&&(0,S.isCardNode)(i)?N({editor:e,tr:t,spotlight:{pos:null,cardId:i.attrs.id}}):console.error("[Spotlight.spotlightCurrentCard] nodeAt(1) is unexpectedly not a card. Cannot spotlight"),!0};if(!document.querySelector(this.options.scrollerSelector))return n();let a=e.state.selection.from,r=a&&e.view.coordsAtPos(a);if(r&&r.top0)console.debug("%c [Spotlight.spotlightCurrentCard] Using cursor pos","background-color: deeppink",{posToUse:i=a});else{let t=(0,f.getTopCenterIshNode)(e,this.options.scrollerSelector,135).pos;console.debug("%c [Spotlight.spotlightCurrentCard] Using top center pos","background-color: deeppink",{posToUse:i=t?.pos})}(!i||i<2)&&console.warn("%c [Spotlight.spotlightCurrentCard] Using fallback pos","background-color: deeppink",{posToUse:i=2});let o=(0,E.findTopCardNodeParent)(e.state.doc,i);if(o?.node?.attrs?.hidden){let t=o;for(;o&&o?.node?.attrs?.hidden;)o=H(e,o.pos);if(!o)for(o=t;o&&o?.node?.attrs?.hidden;)o=H(e,o.pos,!0)}return o&&o.pos?((0,E.openParentCards)({editor:e,pos:i}),N({editor:e,tr:t,spotlight:{pos:null,cardId:o.node.attrs.id}}),!0):n()},ascendUpToParentCard:(e=!0)=>({editor:t})=>{let i=j.getState(t.state),n=i.pos;if(!n){let e=(0,f.getTopCenterIshNode)(t,this.options.scrollerSelector,window.innerHeight/2).pos;n=e?.pos}return!!n&&!!(0,E.findCollapsedCardNodeClosestToPos)(t,n,!1)&&!!e&&(R(this.options.scrollerSelector,i.cardId),!0)},descendIntoCurrentCard:(e,t="replace")=>({editor:t})=>{let i=j.getState(t.state),n=e||i.pos;return t.commands.spotlightExpandCard(n)},spotlightCollapseCard:e=>({editor:t,tr:i})=>{let n=t.view.state.doc.nodeAt(e);if(!n||!(0,S.isCardNode)(n))return console.warn("[Spotlight.spotlightCollapseCard] pos does not resolve to a card node. This is a noop",e),!0;let a=j.getState(t.state),r=n.attrs.id;return(0,w.setCardCollapsed)(r,!0),N({editor:t,tr:i,spotlight:a}),(0,h.getScrollManager)("editor").scrollElementIntoView({element:t.view.nodeDOM(e),attempts:0,offsetFromTop:null}),!0},spotlightCollapseNearestExpandableNode:e=>({editor:t,tr:i})=>{let n=j.getState(t.state),a=e||t.state.selection.from,r={pos:a,node:t.view.state.doc.nodeAt(a)};if(!r.node||!B(r.node)){let e=(0,c.findParentNodeClosestToPos)(t.state.doc.resolve(a),B);r.node=e?.node||null,r.pos=e?.pos||0}let o=r.pos&&(0,E.findTopCardNodeParent)(t.state.doc,r.pos);if(!r.node||!r.pos||!o||o.node.attrs.id===r.node.attrs.id)return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] pos does not resolve to a valid collapsible node. This is a noop",r.pos),!1;if(!(o.pos<=r.pos&&o.pos+o.node.nodeSize>=r.pos))return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] posToUse is outside of the presenting card. This is a noop",r.pos),!1;console.debug("[Spotlight.spotlightCollapseNearestExpandableNode]",{result:r});let s=(e=>{switch(e.type.name){case"card":return(0,w.setCardCollapsed)(e.attrs.id,!0),!0;case"toggle":return(0,I.setToggleOpen)(e.attrs.id,!1),!0;default:return!1}})(r.node);return s&&((0,h.getScrollManager)("editor").scrollElementIntoView({element:t.view.nodeDOM(r.pos),attempts:0,offsetFromTop:null}),r.pos===t.state.selection.from?t.commands.reHighlightExpandableNode():i.setSelection(C.create(t.state.doc,r.pos)),D(t,n)&&N({editor:t,tr:i,spotlight:{pos:r.pos,cardId:o.node.attrs.id}})),s},spotlightExpandCard:e=>({editor:t})=>{let i=j.getState(t.state),n=e&&t.view.state.doc.nodeAt(e);if(!n||!(0,S.isCardNode)(n))return console.warn("[Spotlight.spotlightExpandCard] pos does not resolve to a card node. This is a noop",e),!0;let a=n.attrs.id,{isSpotlightingBlock:r}=O(t,i);return(0,w.setCardCollapsed)(a,!1),console.debug("[Spotlight.spotlightExpandCard]",{node:n,isSpotlightingBlock:r}),setTimeout(()=>{r?t.commands.spotlightNextBlock(!1,{pos:e,cardId:a},"smooth"):t.commands.scrollToPositionInCard(e,0,50)},_.EXPAND_CARD_TRANSITION_TIME),!0},spotlightNextExpandedCard:e=>({editor:t,commands:i})=>{let n=j.getState(t.state);if(!n.pos||!n.cardId)return!0;let a=(0,E.findTopCardNodeParent)(t.state.doc,n.pos),r=(0,S.findCardNodeClosestToPos)(t,n.pos);if(!a||!r)return!0;let o={node:null,pos:null,cardId:null},s=n.pos;return(t.state.doc.descendants((i,n,a)=>{if(!e&&o.pos)return!1;let l=!(0,w.isCardCollapsed)(i);if(!((0,S.isCardNode)(i)&&l&&(e?ns)))return l;let d=i!==r.node||!e;if(!d){let{isSpotlightingFirstBlock:e}=O(t,{pos:s,cardId:i.attrs.id});d=!e}return d&&(o.node=i,o.pos=n,o.cardId=i.attrs.id),l}),o.pos&&o.cardId)?i.spotlightNextBlock(!1,{pos:o.pos,cardId:o.cardId}):(R(this.options.scrollerSelector,a.node.attrs.id),!0)},spotlightNextCard:(e,t="top")=>({editor:i,commands:n,tr:a})=>{let r=j.getState(i.state),o=r.pos,{isSpotlightingBlock:s,isSpotlightingFirstBlock:l}=O(i,r);if(s)return n.spotlightNextExpandedCard(e);if(!o){let e=(0,S.findCardById)(i,r.cardId);o=e?.pos}if(!o)return console.warn("[Spotlight.spotlightNextCard] Could not find posToUse",{lastSpotlight:r}),!1;let d=i.view.state.doc.nodeAt(o),u=!!(d&&e&&s&&!l&&d.attrs.id!==r.cardId),p=d&&r.cardId&&d.attrs.id===r.cardId?{node:d,pos:o}:(0,c.findParentNodeClosestToPos)(i.state.doc.resolve(o),S.isCardNode),h=u?p:p?.pos?H(i,p.pos,e):null;if(h&&null!==h.pos){console.debug("[Spotlight.spotlightNextCard] Found next card:",{next:h,posToUse:o,isSpotlightingBlock:s});let n=h.node.attrs.id,l=h.pos;if(s)return i.commands.spotlightNextBlock(!1,{pos:l,cardId:n});N({editor:i,tr:a,bias:e?1:-1,spotlight:{pos:null,cardId:n}});let d=r.cardId!==n,c="top"==t?$:Z;null!==t&&setTimeout(()=>{c({sync:!0,behavior:"auto"})},d?_.BETWEEN_CARD_TRANSITION_TIME:0)}else console.debug("[Spotlight.spotlightNextCard] No next node. Will attempt to ascendUp",{lastSpotlight:r,posToUse:o,node:d}),i.commands.ascendUpToParentCard();return!0},spotlightNextBlock:(e,t,i)=>({editor:n,tr:a})=>{let r=j.getState(n.state);if(!r.cardId)return!0;let o=n.state.selection,s=o instanceof C,l=s&&(-1===o.side&&e||1===o.side&&!e)?-1:0,d=s?e?o.to+l:o.from+l:void 0,c=t?.cardId||r.cardId,u=t?.pos||r.pos||d,p=s&&null===r.pos&&(0,S.isCardNode)(o.node)&&1===o.$from.depth,{pos:h,cardId:m,domNode:g}=u&&!p?U(n,c,u,z,e):W(n,r.cardId,this.options.scrollerSelector,e);if(null!==h&&g instanceof HTMLElement){let t=(0,E.findTopCardNodeParent)(n.state.doc,h)?.node.attrs.id;if(!t)return!0;console.debug("%c [Spotlight.spotlightNextBlock]","background-color: deeppink",{prevCardId:r.cardId,cardId:t,pos:h}),setTimeout(()=>{G({element:g,behavior:i})},r.cardId===t?0:_.BETWEEN_CARD_TRANSITION_TIME),N({editor:n,tr:a,bias:e?1:-1,spotlight:{pos:h,cardId:t}})}else n.commands.ascendUpToParentCard();return!0},spotlightNodeAtPos:e=>({editor:t,tr:i})=>{let n=j.getState(t.state);if(!n.cardId)return!1;let a=n.cardId,r=(0,f.findParentNodes)(t.state.doc.resolve(e),e=>z(e)),o=r.reverse().find((e,t)=>!(t!==r.length-1&&F(e.node)));return!!o&&(o.pos!==n.pos?(N({editor:t,tr:i,spotlight:{pos:o.pos,cardId:a}}),!0):t.commands.turnOffSpotlight())},turnOffSpotlight:(e=!1)=>({editor:t,tr:i})=>{let n=j.getState(t.state);return N({editor:t,tr:i,spotlight:{pos:null,cardId:e?null:n.cardId}}),!0},scrollToPositionInCard:(e,t=0,i=0)=>({editor:n})=>{let a=(0,A.getFirstParentWithHeight)((0,f.getNodeDOMNonText)(n,e)),r=a?.getBoundingClientRect();if(!a||!r)return!0;let o=(t||0)*r.height;return console.debug("%c [Spotlight.scrollToPositionInCard]","background-color: deeppink",JSON.stringify({pos:e,offset:i-o}),a),(0,A.__DEBUGGING_addDebuggingOutline)({element:a,color:"deeppink",requiredCookie:"spotlightScrollDebug=true"}),G({element:a,offset:i-o}),!0},scrollToNodeWithPin:(e,t)=>()=>(console.debug("%c [Spotlight.scrollToNodeWithPin] WITH NODE","background-color: deeppink",{scrollToNode:e}),V(G,_.EXPAND_CARD_TRANSITION_TIME,0)({element:e,offset:t}),!0)}},addProseMirrorPlugins(){let e,t;return[(e=(e,t)=>z(e,t),t=this.editor,new u.Plugin({key:j,state:{init:(t,i)=>{let n={pos:null,cardId:""};return{...n,decorations:P(i,n,e)}},apply(t,i,n,a){let r=t.getMeta(j),o=(0,T.isRemoteTransaction)(t);if(r||o){let t=r||i;return{...t,decorations:P(a,t,e)}}let s=i.decorations.map(t.mapping,t.doc);return{...i,decorations:s}}},props:{attributes:t=>{let i=j.getState(t);if(!i||null===i.pos)return{class:""};let n=t.doc.nodeAt(i.pos);return n&&e(n,i.cardId)?{class:"spotlight-active"}:{class:""}},decorations:e=>{let t=j.getState(e);return t?t.decorations:null},handleDOMEvents:{click(e,i){if(i.detail>1||(0,L.isNonEmptyTextSelection)(e))return;let a=(0,n.getStore)(),r=a.getState(),s=(0,o.selectLocalCollaboratorSpotlight)(r);if(!(s&&D(t,s))||(0,o.selectIsEditingInSlideView)(r))return;if((0,o.selectIsPresentModeMenuOpen)(r))return void a.dispatch((0,o.closePresentModeContextMenu)());let l=j.getState(e.state);if(!l?.cardId)return;let d=e.posAtDOM(i.target,0);if(null===d||d<1)return;if(!e.state.doc.nodeAt(d))return void t.commands.turnOffSpotlight();let[c]=(0,f.findParentNodes)(e.state.doc.resolve(d),e=>z(e));c?t.commands.spotlightNodeAtPos(d):t.commands.turnOffSpotlight()},contextmenu(e,i){let a=j.getState(e.state);if(!a?.cardId)return;let r=(0,n.getStore)().getState();if((0,o.selectIsEditingInSlideView)(r))return;let s=e.posAtDOM(i.target,0),l=t.state.doc.resolve(s),d=e.state.doc.nodeAt(s),[c]=d&&z(d)?[{pos:s,start:l.start(l.depth+1)}]:(0,f.findParentNodes)(t.state.doc.resolve(s),e=>z(e));M.TiptapEventBus.emit(M.EventBusEvent.OPEN_PRESENT_MODE_CONTEXT_MENU,{e:i,cardId:a.cardId,pos:c?c.start:null})}}}}))]}});let H=(e,t,i=!1)=>{let n=e.view.state.doc.nodeAt(t),a=n&&(0,S.isCardNode)(n)?{node:n,pos:t}:(0,c.findParentNodeClosestToPos)(e.state.doc.resolve(t),S.isCardNode);if(!a)return;let r=e.state.doc.resolve(i?a.pos:a.pos+a.node?.nodeSize),o=i?r.nodeBefore:r.nodeAfter;if(!o)return;let s=i?r.pos-o.nodeSize:r.pos;if((0,S.isCardNode)(o))return(console.debug("[Spotlight.findNextDirectSiblingCard]",{nextNode:o,nextPos:s}),o.attrs.hidden)?H(e,s,i):{node:o,pos:s}},W=(e,t,i,n=!1)=>{let a={node:null,pos:null,cardId:null,domNode:null},r=(0,f.getTopCenterIshNode)(e,i,135),o=r.pos?.inside||null,s=o?e.state.doc.nodeAt(o):null;if(!o||!s)return a;if(s.attrs.id===t)return U(e,t,o,e=>z(e,t),n);let l=e.state.doc.resolve(o),d=(0,S.findCardNodeClosestToPos)(e,l.before());if(!d)return a;let c=l.before(d.depth+2),u=e.state.doc.nodeAt(c);return u&&z(u,t)?(a.pos=e.state.doc.resolve(c).pos,a.node=u,a.cardId=d?.node.attrs.id,a.domNode=e.view.nodeDOM(a.pos),a):U(e,t,c,e=>z(e,t),n)},U=(e,t,i,n,a=!1)=>{let r={node:null,pos:null,cardId:null,domNode:null},o=e.state.doc.resolve(i),s=e.view.state.doc.nodeAt(i),l=(0,c.findParentNodeClosestToPos)(o,e=>(0,S.isCardNode)(e)&&e.attrs.id===t),d=s&&(0,S.isCardNode)(s)&&s?.attrs.id===t?{node:s,pos:i}:l;if(!d)return console.debug("[Spotlight.findNextNode] - No card found:",{cardId:t,from:i,node:s}),r;let u=(e,t)=>{let o=e.attrs.id;e.descendants((s,l)=>{let d=t+l+1,c=n(s,o)&&(a?di);return(!!a||!r.node)&&(c&&(r.node=s,r.pos=d,r.cardId=e.attrs.id),F(s))})};u(d.node,d.pos);let p=d.pos;for(;null===r.pos;){let t=H(e,p,a);if(t)u(t.node,t.pos),p=t.pos;else break}return null!==r.pos&&(r.domNode=e.view.nodeDOM(r.pos)),console.debug("[Spotlight.findNextNode]",{result:r}),r},V=(e,t=0,i=0)=>n=>{let a,r={...n,sync:!0,behavior:"auto"};e(r);let o=!1;Promise.race([new Promise(e=>setTimeout(()=>e(!1),i+t+300)),new Promise(e=>{a=()=>e(!0),n.element.addEventListener("transitionend",a)})]).then(e=>{console.debug("[scrollTo withDurationPin] transitionend race result",e),o=!0}).finally(()=>{n.element.removeEventListener("transitionend",a)});let s=+new Date,l=()=>requestAnimationFrame(()=>{e(r),(new Date-s{if(!(0,A.isElementDisplayed)(e)){let t=e.querySelector("[data-content-reference]");if(!t||!(0,A.isElementDisplayed)(t))return;e=t}let a=(0,h.getScrollManager)("editor");if(!a.scroller?.clientHeight)return;let r=(0,A.getOffsetFromParent)(e,a.scrollSelector),o=e.clientHeight/2,s=.45*a.scroller.clientHeight-o,l=r-Math.max(void 0!==n?n:s,125);a.scrollTo({top:l,sync:t,behavior:i})},$=({sync:e=!1,behavior:t="smooth"})=>{(0,h.getScrollManager)("editor").scrollTo({top:0,behavior:t,sync:e})},Z=({sync:e=!1,behavior:t="smooth"})=>{let i=(0,h.getScrollManager)("editor"),n=i.scroller;n&&i.scrollTo({top:n.scrollHeight,behavior:t,sync:e})},K=new u.PluginKey("expandableNodes"),q=e=>e.some(e=>e.spec.isExpandableNode),Y=e=>e instanceof C&&0===e.side&&X(e.node),X=e=>!0===e.type.spec.expandable,Q=(e,t)=>{if(!t?.from)return!1;let i=(0,f.getDomNodeFromPos)(e,t.from),n=(0,h.isInViewport)(i);return n?.inView===!0},J=(e,t,i)=>{let n=(0,S.getFullHeightCardNode)(e.view.nodeDOM(t)),a=(0,h.isInViewport)(n);if(!a)return!1;let{bottomInView:r,topInView:o}=a;return"top"===i?o:r};c.Extension.create({name:"expandableNodes",extendNodeSchema:e=>({expandable:(0,c.callOrReturn)((0,c.getExtensionField)(e,"expandable",e))??!1}),addCommands:()=>({expandOrCollapseExpandableNode:e=>({state:t,chain:i})=>{let a=e??t.selection.from,r=t.doc.nodeAt(a);if(!r||!X(r))return!1;let s=(0,n.getStore)();switch(r.type.name){case"card":if(s.dispatch((0,o.setFollowingAttached)({attached:!1})),m.analytics?.track(g.SegmentEvents.CARD_EXPANDED,{is_present_mode:!0,method:"enter_key"}),(0,w.isCardCollapsed)(r.attrs.id))return i().descendIntoCurrentCard(a).reHighlightExpandableNode().run();return i().spotlightCollapseCard(a).reHighlightExpandableNode().run();case"toggle":{(0,I.setToggleOpen)(r.attrs.id,!(0,I.isToggleOpen)(r.attrs.id));let t=i();return e&&t.spotlightNextBlock(),t.reHighlightExpandableNode().run(),!0}case"image":case"video":case"embed":return s.dispatch((0,o.setMediaNodeExpanded)({nodeId:r.attrs.id})),!0;case"gallery":{let e=r.firstChild;if(e)return s.dispatch((0,o.setMediaNodeExpanded)({nodeId:e.attrs.id})),!0;return!1}default:return!1}},goToNextExpandableNode:e=>({editor:t,tr:i,state:n})=>{let a=j.getState(t.state),r=(0,S.findCardById)(t,a.cardId);if(!r)return!1;let o=r.node.attrs.id,s=r.pos,l=r.pos+r.node.nodeSize,d=t.state.selection,c=Y(d),p=d instanceof C,m=((e,t,i,n=!1)=>{let a=e.state.selection,r=a instanceof C&&1===a.side?a.to:a.from;if(r<=t){if(J(e,t,"top"))return null}else if(r>=i){if(J(e,t,"bottom"))return null}else{if(Q(e,a))return null;let t=e.state.doc.resolve(r);if(Q(e,u.Selection.findFrom(t,-1,!1))||Q(e,u.Selection.findFrom(t,1,!1)))return null}let o=(0,f.getTopOrBottomCenterNode)({editor:e,side:n?"bottom":"top",margin:200});if(o.pos){let t=u.Selection.findFrom(e.state.doc.resolve(o.pos),n?1:-1,!1);return t?.from||null}return null})(t,s,l,e),g=K.getState(n)?.lastApplied||+new Date;if(c&&!m&&new Date-g>3e3)return t.commands.reHighlightExpandableNode();i.setMeta(K,{});let b=p&&(-1===d.side&&e||1===d.side&&!e)?-1:0,x=Math.min(Math.max(m||(c||!p?d.from:1===d.side?d.to+b:d.from+b),s),l-1),y=U(t,o,x,X,e);if(console.debug("[ExpandableNodes] goToNextExpandableNode",{posToUse:x,overridePos:m},y),!y.pos||!y.domNode||y.cardId!==o)return i.setSelection(C.create(t.state.doc,s,e?-1:1)),!1;let v=(0,h.isInViewport)(y.domNode,50);return v?.inView?(i.setSelection(C.create(t.state.doc,y.pos)),(0,h.getScrollManager)("editor").scrollElementIntoView({element:y.domNode,attempts:0,offsetFromTop:null}),!0):(c&&i.setSelection(C.create(t.state.doc,d.from,e?-1:1)),!1)},reHighlightExpandableNode:()=>({tr:e,editor:t})=>(e.setMeta(K,{shouldAddResetClass:!0}),requestAnimationFrame(()=>{t.commands.command(({tr:e})=>(e.setMeta(K,{shouldAddResetClass:!1}),!0))}),!0)}),addProseMirrorPlugins:()=>[new u.Plugin({key:K,state:{init:()=>({lastApplied:0,shouldAddResetClass:!1}),apply(e,t){let i=e.getMeta(K);return i?{...t,lastApplied:+new Date,...i}:t}},props:{decorations(e){let t=j.getState(e);if(t?.pos)return p.DecorationSet.empty;let i=K.getState(e);if((0,o.selectMode)((0,n.getStore)().getState())!==s.EditorModeEnum.SLIDE_VIEW)return p.DecorationSet.empty;let a=e.selection;if(!Y(a)||!(a instanceof C))return p.DecorationSet.empty;let r=a.node;return p.DecorationSet.create(e.doc,[p.Decoration.node(a.from,a.from+r.nodeSize,{class:(0,d.cx)("expandable-node-selected",i?.shouldAddResetClass&&"expandable-node-reset")},{isExpandableNode:!0})])}}})]}),e.s(["isExpandableSelectedNode",0,q],657729);var ee=e.i(929362),et=e.i(144621),ei=e.i(892684),en=e.i(191788),ea=e.i(189938);let er=e=>{let t=(0,en.useRef)("doc"),i=(0,n.useAppStore)(),a=(0,n.useAppSelector)(ea.selectHiddenMap),r=(0,n.useAppSelector)(i=>{let n=(0,o.selectPresentingCardId)(i)||"",r=(0,o.selectCardIdMap)(i),l=(0,o.selectCardIds)(i),d=(0,o.selectMode)(i),c=r.parents[n]||[],u=c.reduce((e,t)=>e[t],r.tree),p=l.includes(n),h=d===s.EditorModeEnum.SLIDE_VIEW;if(h&&!p||!h&&p)return t.current;if(!h&&!p)return"doc";let m=l.filter(e=>u[e]&&!a?.[e]),g=e=>u[e]?m.indexOf(e)-m.indexOf(n):1/0,f=g(e),b=c.indexOf(e)>-1,x=m.some(t=>u[t][e]&&1>=Math.abs(g(t))),y=n===e,v=r.parents[e];if(!v)return t.current;let C=v.includes(n);return x||C?"presentCollapsed":b?"presentParent":y?"presentCurrent":-1===f?"presentPrev":1===f?"presentNext":"doc"});return(0,en.useEffect)(()=>{t.current=r;let n=i.getState();!(0,o.selectFollowingAttached)(n)&&["presentParent","presentCurrent","presentPrev","presentNext"].includes(r)&&(0,w.setCardCollapsed)(e,!1)},[i,r,e]),[r,t.current]};e.s(["usePresentVariant",0,er],710317);e.s(["useCardState",0,({editor:e,node:d,decorations:c})=>{let u=d.attrs,{id:p,previewContent:h}=u,m=(0,r.useShouldRenderMobileVersion)(),g=(0,a.useShouldUsePublishedVersion)(),f=(0,i.useIsThumbnailView)(),b=(0,t.useIsEditorStatic)(),[x,y]=er(p),v=(0,n.useAppSelector)(o.selectIsDocPreviewMode)?s.EditorModeEnum.DOC_PREVIEW:"doc"===x?s.EditorModeEnum.DOC_VIEW:s.EditorModeEnum.SLIDE_VIEW,C=(0,n.useAppSelector)(e=>(0,o.selectEditable)(e,v)),w=v===s.EditorModeEnum.SLIDE_VIEW,S=(0,n.useAppSelector)(o.selectZoomLevel),k=(0,n.useAppSelector)(o.selectDocZoomLevel),A=(0,n.useAppSelector)(o.selectDocZoomToFit),E=(0,n.useAppSelector)((0,o.selectIsCommentOpenOnCard)(p)),_=(0,L.isFocusedInside)(c),I=(0,n.useAppSelector)((0,o.selectCardCollapsed)(p)),M=q(c),{isNested:T,nestedDepth:j,isFirstCard:P,isLastCard:D,inheritContainerWidth:N,displayLayout:R,insideSideLayout:O,cardAccentBackgroundMaskEffect:B,cardAccentBackgroundMaskIntensity:z,hasLayoutItem:F,hasAccentImage:H,cardContentType:W,hasImageCardSrc:U,hasNonEmptyCardNotes:V,hasPositionedBoxes:G}=(0,et.findCardPluginDecoration)(c),{theme:$,isDark:Z}=(0,ei.useCardColorMode)(c),{cardDimensions:K,defaultFullBleed:Y,defaultContentWidth:X,presentBackdrop:Q=!1,verticalAlign:J,fontSize:en,scaleContentToFit:ea}=(e=>{let t=(0,n.useAppSelector)(o.selectDocSettingsWithDefaults);if(e.isStatic)try{return(0,l.getDocAttrs)(e).settings}catch(e){console.error(`[caught] useDocSettings: ${e}`)}return t})(e),eo=(0,ee.getCardDimensions)(K),es="default"===u.cardSize?"full"===Y:"full"===u.cardSize,el=u.verticalAlign||J||eo.defaultVerticalAlign,ed=w&&!T&&!!eo.aspectRatio&&!Q,ec=u.container.width??N;return{hasNonEmptyCardNotes:V,hasAccentImage:H,hasPositionedBoxes:G,isCollapsed:I,isEditable:C,isFirstCard:P,isFocused:_,isExpandableSelected:M,isLastCard:D,isLetterboxed:ed,isMobileDevice:m,isNested:T,isPresenting:"doc"!==x&&"presentCollapsed"!==x,isPresentingCurrent:"presentCurrent"===x,isPresentingParent:"presentParent"===x,isPresentMode:w,isPublished:g,isStatic:b,isDark:Z,isThumbnail:f,mode:v,nestedDepth:j,presentVariant:x,prevPresentVariant:y,previewContent:h,theme:$,attrs:u,cardId:p,isFullBleed:es,displayFullBleed:f||!T&&(es||w&&!Q),defaultContentWidth:X,contentWidth:ec,verticalAlign:el,isWideContent:(ec??X)==="lg",displayLayout:R,insideSideLayout:O,cardAccentBackgroundMaskEffect:B,cardAccentBackgroundMaskIntensity:z,cardDimensions:eo,cardDimensionsKey:K,showPresentBackdrop:Q,hasLayoutItem:F,cardContentType:W,hasImageCardSrc:U,userZoomLevel:S,docZoomLevel:k,fontSize:en,docZoomToFit:A,scaleContentToFit:ea,isCommentOpenOnCard:E}}],376742)},162030,105970,47621,179115,271910,429465,e=>{"use strict";let t;e.s(["BatchQACardNodeView",()=>tD],162030);var i,n=e.i(391398),a=e.i(428683),r=e.i(613616);e.i(314572);var o=e.i(723641),s=e.i(191788),l=e.i(927835);e.s(["Card",()=>tj,"cardIgnoreMutation",()=>tL,"isCardEmpty",()=>tM],271910);var d=e.i(755453),c=e.i(175863),u=e.i(103630),p=e.i(767730);e.i(838054);var h=e.i(408767),m=e.i(977581),g=e.i(438106),f=e.i(329860),b=e.i(577281),x=e.i(131339),y=e.i(516463),v=e.i(144621),C=e.i(85547);e.s(["SwitchingCardView",()=>t_],179115);var w=e.i(418755),S=e.i(136484),k=e.i(551880),A=e.i(650292);e.s(["CardNodeView",()=>ey,"useClosestCardNode",()=>eS],105970);var E=e.i(555145),_=e.i(864860),I=e.i(887527),M=e.i(654656),T=e.i(470645),L=e.i(524473);e.i(828525);var j=e.i(876533);e.i(197071);var P=e.i(896416),D=e.i(717834),N=e.i(358280),R=e.i(104855),O=e.i(48735),B=e.i(979041);e.i(144786);var z=e.i(849187),F=e.i(783197),H=e.i(460557),W=e.i(686296),U=e.i(786928),V=e.i(49202),G=e.i(547366),$=e.i(432247),Z=e.i(194552),K=e.i(616820),q=e.i(428624),Y=e.i(343902),X=e.i(196444),Q=e.i(697463),J=e.i(345100),ee=e.i(787360),et=e.i(405860),ei=e.i(913807),en=e.i(98155),ea=e.i(972133),er=e.i(447487),eo=e.i(247879),es=e.i(976188),el=e.i(432523),ed=e.i(144052),ec=e.i(689525),eu=e.i(119831),ep=e.i(908613),eh=e.i(382818),em=e.i(309623),eg=e.i(376742),ef=e.i(620020),eb=e.i(792565),ex=e.i(907839);let ey=e=>{let{getPos:t,editor:i,node:r,decorations:o,updateAttributes:l}=e,d=(0,X.isSelectingNode)(o),c=(0,eg.useCardState)(e),{isThumbnail:p,isPresentMode:h,isNested:m,isFocused:g,isEditable:f,isFullBleed:b,cardContentType:x,hasImageCardSrc:y}=c,{onDoubleClick:v}=(()=>{let e=(0,ef.useToast)(),[t,i]=(0,eb.useLocalStorage)(ex.USER_SETTINGS_CONSTANTS.hasSeenPresentModeDblClickNotification,!1),a=(0,w.useAppSelector)(k.selectIsPresentModeAndNotEditing);return{onDoubleClick:(0,s.useCallback)(()=>{if(!a||t)return;let r=new Date,o=new Date("2024-08-15");r.getTime()>o.getTime()||(i(!0),e({title:(0,n.jsx)(N.Trans,{message:"Right-click to edit in present mode.",id:"xtaPrg"}),status:"info",position:"bottom",duration:3e3,isClosable:!0}))},[a,t,i,e])}})(),{isCardMarginsModalOpen:S,onCloseCardMarginsModal:A,onOpenCardMarginsModal:E}=(0,B.useOpenCardMarginsModal)(),_=f&&(d||g)&&!m&&!p&&!h,P=null!=c.attrs.fontScale&&1!==c.attrs.fontScale,R=_&&"image"===x?"image":_&&P?"scaled":null,F=(0,U.useToggleMediaDrawer)(),H=(0,z.useFeatureFlag)("fluidToCanvas"),K=(0,D.useTiptapEditorEventCallback)(e=>{let i=t();if("number"!=typeof i)return;let n=e.state.doc.nodeAt(i);if(!n)return;let a=n.firstChild;a&&(0,u.isCardImageItemNode)(a)&&(e.chain().focus().selectNodeAtPos(i+1,!1).run(),F({isOpen:!0}))}),J=(0,s.useCallback)(()=>{V.TiptapEventBus.emit(V.EventBusEvent.OPEN_PAGE_SETUP,"cards")},[]);return(0,n.jsx)(Z.AnnotatableNodeViewWrapper,{as:"div",style:{minHeight:h&&!m?"100vh":0},hideComments:!0,...e,children:(0,n.jsxs)(eh.CardWrapper,{...c,children:[(0,n.jsx)(es.CardBody,{...c,children:(0,n.jsxs)(eu.CardLayout,{...c,...e,onDoubleClick:v,handle:(0,n.jsx)(Y.ContainerDragHandle,{...e,handlePlacement:"custom","data-testid":"card-drag-handle",zIndex:q.DOC_Z_INDEXES.cardButtons,insetInlineStart:2,top:3,width:"18px",height:en.CARD_DRAG_HANDLE_HEIGHT,label:(0,n.jsxs)(M.VStack,{spacing:0,children:[(0,n.jsx)(I.Text,{color:"gray.400",children:(0,n.jsx)(N.Trans,{message:"<0>Drag to move",id:"63lY3K",components:{0:(0,n.jsx)(I.Text,{color:"white",as:"span"})}})}),(0,n.jsx)(I.Text,{color:"gray.400",children:(0,n.jsx)(N.Trans,{message:"<0>Click to open menu",id:"COhrZ5",components:{0:(0,n.jsx)(I.Text,{color:"white",as:"span"})}})})]})}),children:[(0,n.jsx)(Q.CardDebugPanel,{...e}),(0,n.jsx)(eC,{dragHandleTopMargin:3,editor:i,getPos:t,node:r,cardState:c,decorations:o,isImageCardLoading:"image"===x&&!y,onOpenCardMarginsModal:E,updateAttributes:l}),H&&"responsive"===x&&f&&!p&&!h&&!m&&(0,n.jsx)(a.Box,{position:"absolute",top:3,insetInlineStart:"100%",ps:2,zIndex:q.DOC_Z_INDEXES.cardButtons,contentEditable:!1,pointerEvents:"auto",children:(0,n.jsx)(ev,{editor:i,getPos:t})}),R&&(0,n.jsxs)(a.Box,{pos:"absolute",insetInlineEnd:8,bottom:"100%",contentEditable:!1,pointerEvents:"none",zIndex:q.DOC_Z_INDEXES.cardDivider,children:["image"===R&&(0,n.jsx)(ec.CardLabel,{label:(0,n.jsx)(N.Trans,{message:"Image card",id:"leAzzX"}),tooltipLabel:(0,n.jsx)(N.Trans,{message:"Image cards can only be edited with AI",id:"+C+BtG"}),icon:L.faEdit,onClick:K}),"scaled"===R&&(0,n.jsx)(ec.CardLabel,{label:(0,n.jsx)(N.Trans,{message:"Content scaled to fit",id:"mhvtC6"}),tooltipLabel:(0,n.jsx)(N.Trans,{message:"Turn off scale to fit in Page setup",id:"HjS3Mm"}),icon:L.faGear,onClick:J})]}),(0,n.jsx)(ew,{value:r,children:(0,n.jsx)($.NodeViewContent,{dir:"ltr",className:(0,T.cx)(C.CARD_CONTENT_CLASS,g&&"is-focused",m&&"is-nested",(h||b)&&"is-full-width",b&&!m&&!h&&"is-borderless",c.isDark&&"is-dark")})}),S&&(0,n.jsx)(O.CardMarginsModal,{editor:i,cardNode:e.node,getPos:t,isOpen:S,onClose:A}),m&&!p&&(0,n.jsx)(em.CollapsedCardControls,{top:[1,3],...c,...e})]})}),(0,n.jsx)(G.OnEditorRendered,{children:(0,n.jsx)(j.DarkModeProvider,{isDark:(0,W.isThemeDark)(c.theme),children:(0,n.jsx)(el.CardDivider,{display:!f||m||h?"none":"flex",editor:i,getPos:t,isNested:m})})})]})})},ev=({editor:e,getPos:t})=>{let i=(0,s.useCallback)(i=>{"canvas"===i&&(0,ee.convertCardToCanvas)({editor:e,getPos:t})},[e,t]);return(0,n.jsx)(J.CardModeToggle,{mode:"fluid",onChange:i})},eC=(0,s.memo)(function({dragHandleTopMargin:e,editor:t,getPos:i,cardState:a,decorations:r,isImageCardLoading:o,onOpenCardMarginsModal:s,node:l,updateAttributes:d}){let{isPresentMode:c,isNested:u,isEditable:p,isFocused:h,isMobileDevice:m,cardAccentBackgroundMaskEffect:g,cardAccentBackgroundMaskIntensity:f,cardId:b,hasNonEmptyCardNotes:x,cardContentType:y,hasImageCardSrc:v}=a,C=(0,K.hasBlockHoverDeco)(r),S=(0,X.isSelectingNode)(r),k=C||S||h,A=(0,F.useIsThumbnailView)(),I=(0,w.useAppSelector)((0,ei.selectCardMenuOpen)(b,"styling")),M=(0,w.useAppSelector)((0,ei.selectCardMenuOpen)(b,"editWithAI")),T=p&&!A&&(k||M||I),L=(0,w.useAppSelector)((0,R.selectCardSuggestions)(b)),j=(0,P.useIsEditorStatic)(),{extract:D,isLoading:N}=(0,H.useExtractImageContent)(),O=!u&&!A&&!j&&!m&&!t.shouldUsePublishedVersion&&!c&&(x||p&&k);return(0,n.jsxs)(E.HStack,{pos:"absolute","data-card-overlay-ui":!0,insetInlineStart:8,insetInlineEnd:2.5,zIndex:q.DOC_Z_INDEXES.cardButtons,top:e,align:"start",contentEditable:!1,pointerEvents:"none",spacing:1.5,children:[T&&"responsive"===y&&(0,n.jsx)(et.CardStylingMenu,{editor:t,getPos:i,...a,decorations:r,accentBackgroundMaskEffect:g,accentBackgroundMaskIntensity:f,onOpenCardMarginsModal:s}),T&&(0,n.jsx)(er.SwitchingCardAIMenu,{cardContentType:y,attrs:a.attrs,editor:t,getPos:i,node:l}),(T||N)&&"image"===y&&v&&(0,n.jsx)(ed.CardImageItemButtons,{editor:t,getPos:i,hasPositionedBoxes:a.hasPositionedBoxes,extract:D,isExtracting:N}),(0,n.jsx)(_.Spacer,{}),!p||A?null:L?(0,n.jsx)(ea.EditCardStatus,{...a,updateAttributes:d,editor:t,getPos:i,isDark:a.isDark,isInteracting:k,suggestions:L}):a.attrs.generatorInput&&!o?(0,n.jsx)(eo.GenerateCardStatus,{...a,updateAttributes:d,editor:t,getPos:i,isDark:a.isDark,input:a.attrs.generatorInput,isInteracting:k}):null,(0,n.jsx)(_.Spacer,{}),O&&(0,n.jsx)(ep.CardNotesButton,{editor:t,cardId:b,decorations:r,getPos:i,hasNonEmptyCardNotes:x,isReadonly:!p})]})}),ew=(0,s.createContext)(null);function eS(){return(0,s.useContext)(ew)}var ek=e.i(969641),eA=e.i(335799),eE=e.i(541075),e_=e.i(408122),eI=e.i(703971),eM=e.i(468738),eT=e.i(78387),eL=e.i(495084),ej=e.i(772177),eP=e.i(221809);e.i(350461);let{entries:eD,setPrototypeOf:eN,isFrozen:eR,getPrototypeOf:eO,getOwnPropertyDescriptor:eB}=Object,{freeze:ez,seal:eF,create:eH}=Object,{apply:eW,construct:eU}="u">typeof Reflect&&Reflect;ez||(ez=function(e){return e}),eF||(eF=function(e){return e}),eW||(eW=function(e,t,i){return e.apply(t,i)}),eU||(eU=function(e,t){return new e(...t)});let eV=e5(Array.prototype.forEach),eG=e5(Array.prototype.lastIndexOf),e$=e5(Array.prototype.pop),eZ=e5(Array.prototype.push),eK=e5(Array.prototype.splice),eq=e5(String.prototype.toLowerCase),eY=e5(String.prototype.toString),eX=e5(String.prototype.match),eQ=e5(String.prototype.replace),eJ=e5(String.prototype.indexOf),e0=e5(String.prototype.trim),e1=e5(Object.prototype.hasOwnProperty),e2=e5(RegExp.prototype.test),e3=(i=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n1?i-1:0),a=1;a2&&void 0!==arguments[2]?arguments[2]:eq;eN&&eN(e,null);let n=t.length;for(;n--;){let a=t[n];if("string"==typeof a){let e=i(a);e!==a&&(eR(t)||(t[n]=e),a=e)}e[a]=!0}return e}function e6(e){let t=eH(null);for(let[i,n]of eD(e))e1(e,i)&&(Array.isArray(n)?t[i]=function(e){for(let t=0;t/gm),tu=eF(/\$\{[\w\W]*/gm),tp=eF(/^data-[\-\w.\u00B7-\uFFFF]+$/),th=eF(/^aria-[\-\w]+$/),tm=eF(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),tg=eF(/^(?:\w+script|data):/i),tf=eF(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),tb=eF(/^html$/i);var tx=Object.freeze({__proto__:null,ARIA_ATTR:th,ATTR_WHITESPACE:tf,CUSTOM_ELEMENT:eF(/^[a-z][.\w]*(-[.\w]+)+$/i),DATA_ATTR:tp,DOCTYPE_NAME:tb,ERB_EXPR:tc,IS_ALLOWED_URI:tm,IS_SCRIPT_OR_DATA:tg,MUSTACHE_EXPR:td,TMPLIT_EXPR:tu});let ty=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null,n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));let a="dompurify"+(i?"#"+i:"");try{return e.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}},tv=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},tC=(function e(){let t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"u"e(t);if(n.version="3.2.6",n.removed=[],!i||!i.document||9!==i.document.nodeType||!i.Element)return n.isSupported=!1,n;let{document:a}=i,r=a,o=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:l,Node:d,Element:c,NodeFilter:u,NamedNodeMap:p=i.NamedNodeMap||i.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=i,f=c.prototype,b=e9(f,"cloneNode"),x=e9(f,"remove"),y=e9(f,"nextSibling"),v=e9(f,"childNodes"),C=e9(f,"parentNode");if("function"==typeof l){let e=a.createElement("template");e.content&&e.content.ownerDocument&&(a=e.content.ownerDocument)}let w="",{implementation:S,createNodeIterator:k,createDocumentFragment:A,getElementsByTagName:E}=a,{importNode:_}=r,I=tv();n.isSupported="function"==typeof eD&&"function"==typeof C&&S&&void 0!==S.createHTMLDocument;let{MUSTACHE_EXPR:M,ERB_EXPR:T,TMPLIT_EXPR:L,DATA_ATTR:j,ARIA_ATTR:P,IS_SCRIPT_OR_DATA:D,ATTR_WHITESPACE:N,CUSTOM_ELEMENT:R}=tx,{IS_ALLOWED_URI:O}=tx,B=null,z=e4({},[...e8,...e7,...te,...ti,...ta]),F=null,H=e4({},[...tr,...to,...ts,...tl]),W=Object.seal(eH(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),U=null,V=null,G=!0,$=!0,Z=!1,K=!0,q=!1,Y=!0,X=!1,Q=!1,J=!1,ee=!1,et=!1,ei=!1,en=!0,ea=!1,er=!0,eo=!1,es={},el=null,ed=e4({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ec=null,eu=e4({},["audio","video","img","source","image","track"]),ep=null,eh=e4({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),em="http://www.w3.org/1998/Math/MathML",eg="http://www.w3.org/2000/svg",ef="http://www.w3.org/1999/xhtml",eb=ef,ex=!1,ey=null,ev=e4({},[em,eg,ef],eY),eC=e4({},["mi","mo","mn","ms","mtext"]),ew=e4({},["annotation-xml"]),eS=e4({},["title","style","font","a","script"]),ek=null,eA=["application/xhtml+xml","text/html"],eE=null,e_=null,eI=a.createElement("form"),eM=function(e){return e instanceof RegExp||e instanceof Function},eT=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e_||e_!==e){if(e&&"object"==typeof e||(e={}),e=e6(e),eE="application/xhtml+xml"===(ek=-1===eA.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE)?eY:eq,B=e1(e,"ALLOWED_TAGS")?e4({},e.ALLOWED_TAGS,eE):z,F=e1(e,"ALLOWED_ATTR")?e4({},e.ALLOWED_ATTR,eE):H,ey=e1(e,"ALLOWED_NAMESPACES")?e4({},e.ALLOWED_NAMESPACES,eY):ev,ep=e1(e,"ADD_URI_SAFE_ATTR")?e4(e6(eh),e.ADD_URI_SAFE_ATTR,eE):eh,ec=e1(e,"ADD_DATA_URI_TAGS")?e4(e6(eu),e.ADD_DATA_URI_TAGS,eE):eu,el=e1(e,"FORBID_CONTENTS")?e4({},e.FORBID_CONTENTS,eE):ed,U=e1(e,"FORBID_TAGS")?e4({},e.FORBID_TAGS,eE):e6({}),V=e1(e,"FORBID_ATTR")?e4({},e.FORBID_ATTR,eE):e6({}),es=!!e1(e,"USE_PROFILES")&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,$=!1!==e.ALLOW_DATA_ATTR,Z=e.ALLOW_UNKNOWN_PROTOCOLS||!1,K=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,q=e.SAFE_FOR_TEMPLATES||!1,Y=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,et=e.RETURN_DOM_FRAGMENT||!1,ei=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,en=!1!==e.SANITIZE_DOM,ea=e.SANITIZE_NAMED_PROPS||!1,er=!1!==e.KEEP_CONTENT,eo=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||tm,eb=e.NAMESPACE||ef,eC=e.MATHML_TEXT_INTEGRATION_POINTS||eC,ew=e.HTML_INTEGRATION_POINTS||ew,W=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&eM(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(W.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&eM(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(W.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(W.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&($=!1),et&&(ee=!0),es&&(B=e4({},ta),F=[],!0===es.html&&(e4(B,e8),e4(F,tr)),!0===es.svg&&(e4(B,e7),e4(F,to),e4(F,tl)),!0===es.svgFilters&&(e4(B,te),e4(F,to),e4(F,tl)),!0===es.mathMl&&(e4(B,ti),e4(F,ts),e4(F,tl))),e.ADD_TAGS&&(B===z&&(B=e6(B)),e4(B,e.ADD_TAGS,eE)),e.ADD_ATTR&&(F===H&&(F=e6(F)),e4(F,e.ADD_ATTR,eE)),e.ADD_URI_SAFE_ATTR&&e4(ep,e.ADD_URI_SAFE_ATTR,eE),e.FORBID_CONTENTS&&(el===ed&&(el=e6(el)),e4(el,e.FORBID_CONTENTS,eE)),er&&(B["#text"]=!0),X&&e4(B,["html","head","body"]),B.table&&(e4(B,["tbody"]),delete U.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw e3('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw e3('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');w=(t=e.TRUSTED_TYPES_POLICY).createHTML("")}else void 0===t&&(t=ty(g,o)),null!==t&&"string"==typeof w&&(w=t.createHTML(""));ez&&ez(e),e_=e}},eL=e4({},[...e7,...te,...tt]),ej=e4({},[...ti,...tn]),eP=function(e){let t=C(e);t&&t.tagName||(t={namespaceURI:eb,tagName:"template"});let i=eq(e.tagName),n=eq(t.tagName);return!!ey[e.namespaceURI]&&(e.namespaceURI===eg?t.namespaceURI===ef?"svg"===i:t.namespaceURI===em?"svg"===i&&("annotation-xml"===n||eC[n]):!!eL[i]:e.namespaceURI===em?t.namespaceURI===ef?"math"===i:t.namespaceURI===eg?"math"===i&&ew[n]:!!ej[i]:e.namespaceURI===ef?(t.namespaceURI!==eg||!!ew[n])&&(t.namespaceURI!==em||!!eC[n])&&!ej[i]&&(eS[i]||!eL[i]):"application/xhtml+xml"===ek&&!!ey[e.namespaceURI])},eN=function(e){eZ(n.removed,{element:e});try{C(e).removeChild(e)}catch(t){x(e)}},eR=function(e,t){try{eZ(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){eZ(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(ee||et)try{eN(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},eO=function(e){let i=null,n=null;if(J)e=""+e;else{let t=eX(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ek&&eb===ef&&(e=''+e+"");let r=t?t.createHTML(e):e;if(eb===ef)try{i=new m().parseFromString(r,ek)}catch(e){}if(!i||!i.documentElement){i=S.createDocument(eb,"template",null);try{i.documentElement.innerHTML=ex?w:r}catch(e){}}let o=i.body||i.documentElement;return(e&&n&&o.insertBefore(a.createTextNode(n),o.childNodes[0]||null),eb===ef)?E.call(i,X?"html":"body")[0]:X?i.documentElement:o},eB=function(e){return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},eF=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},eW=function(e){return"function"==typeof d&&e instanceof d};function eU(e,t,i){eV(e,e=>{e.call(n,t,i,e_)})}let e5=function(e){let t=null;if(eU(I.beforeSanitizeElements,e,null),eF(e))return eN(e),!0;let i=eE(e.nodeName);if(eU(I.uponSanitizeElement,e,{tagName:i,allowedTags:B}),Y&&e.hasChildNodes()&&!eW(e.firstElementChild)&&e2(/<[/\w!]/g,e.innerHTML)&&e2(/<[/\w!]/g,e.textContent)||7===e.nodeType||Y&&8===e.nodeType&&e2(/<[/\w]/g,e.data))return eN(e),!0;if(!B[i]||U[i]){if(!U[i]&&tc(i)&&(W.tagNameCheck instanceof RegExp&&e2(W.tagNameCheck,i)||W.tagNameCheck instanceof Function&&W.tagNameCheck(i)))return!1;if(er&&!el[i]){let t=C(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&t){let n=i.length;for(let a=n-1;a>=0;--a){let n=b(i[a],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,y(e))}}}return eN(e),!0}return e instanceof c&&!eP(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&e2(/<\/no(script|embed|frames)/i,e.innerHTML)?(eN(e),!0):(q&&3===e.nodeType&&(t=e.textContent,eV([M,T,L],e=>{t=eQ(t,e," ")}),e.textContent!==t&&(eZ(n.removed,{element:e.cloneNode()}),e.textContent=t)),eU(I.afterSanitizeElements,e,null),!1)},td=function(e,t,i){if(en&&("id"===t||"name"===t)&&(i in a||i in eI))return!1;if($&&!V[t]&&e2(j,t));else if(G&&e2(P,t));else if(!F[t]||V[t]){if(!(tc(e)&&(W.tagNameCheck instanceof RegExp&&e2(W.tagNameCheck,e)||W.tagNameCheck instanceof Function&&W.tagNameCheck(e))&&(W.attributeNameCheck instanceof RegExp&&e2(W.attributeNameCheck,t)||W.attributeNameCheck instanceof Function&&W.attributeNameCheck(t))||"is"===t&&W.allowCustomizedBuiltInElements&&(W.tagNameCheck instanceof RegExp&&e2(W.tagNameCheck,i)||W.tagNameCheck instanceof Function&&W.tagNameCheck(i))))return!1}else if(ep[t]);else if(e2(O,eQ(i,N,"")));else if(("src"===t||"xlink:href"===t||"href"===t)&&"script"!==e&&0===eJ(i,"data:")&&ec[e]);else if(Z&&!e2(D,eQ(i,N,"")));else if(i)return!1;return!0},tc=function(e){return"annotation-xml"!==e&&eX(e,R)},tu=function(e){eU(I.beforeSanitizeAttributes,e,null);let{attributes:i}=e;if(!i||eF(e))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},r=i.length;for(;r--;){let{name:o,namespaceURI:s,value:l}=i[r],d=eE(o),c="value"===o?l:e0(l);if(a.attrName=d,a.attrValue=c,a.keepAttr=!0,a.forceKeepAttr=void 0,eU(I.uponSanitizeAttribute,e,a),c=a.attrValue,ea&&("id"===d||"name"===d)&&(eR(o,e),c="user-content-"+c),Y&&e2(/((--!?|])>)|<\/(style|title)/i,c)){eR(o,e);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr||!K&&e2(/\/>/i,c)){eR(o,e);continue}q&&eV([M,T,L],e=>{c=eQ(c,e," ")});let u=eE(e.nodeName);if(!td(u,d,c)){eR(o,e);continue}if(t&&"object"==typeof g&&"function"==typeof g.getAttributeType)if(s);else switch(g.getAttributeType(u,d)){case"TrustedHTML":c=t.createHTML(c);break;case"TrustedScriptURL":c=t.createScriptURL(c)}if(c!==l)try{s?e.setAttributeNS(s,o,c):e.setAttribute(o,c),eF(e)?eN(e):e$(n.removed)}catch(t){eR(o,e)}}eU(I.afterSanitizeAttributes,e,null)},tp=function e(t){let i=null,n=eB(t);for(eU(I.beforeSanitizeShadowDOM,t,null);i=n.nextNode();)eU(I.uponSanitizeShadowNode,i,null),e5(i),tu(i),i.content instanceof s&&e(i.content);eU(I.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=null,o=null,l=null,c=null;if((ex=!e)&&(e=""),"string"!=typeof e&&!eW(e))if("function"==typeof e.toString){if("string"!=typeof(e=e.toString()))throw e3("dirty is not a string, aborting")}else throw e3("toString is not a function");if(!n.isSupported)return e;if(Q||eT(i),n.removed=[],"string"==typeof e&&(eo=!1),eo){if(e.nodeName){let t=eE(e.nodeName);if(!B[t]||U[t])throw e3("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof d)1===(o=(a=eO("")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===o.nodeName||"HTML"===o.nodeName?a=o:a.appendChild(o);else{if(!ee&&!q&&!X&&-1===e.indexOf("<"))return t&&ei?t.createHTML(e):e;if(!(a=eO(e)))return ee?null:ei?w:""}a&&J&&eN(a.firstChild);let u=eB(eo?e:a);for(;l=u.nextNode();)e5(l),tu(l),l.content instanceof s&&tp(l.content);if(eo)return e;if(ee){if(et)for(c=A.call(a.ownerDocument);a.firstChild;)c.appendChild(a.firstChild);else c=a;return(F.shadowroot||F.shadowrootmode)&&(c=_.call(r,c,!0)),c}let p=X?a.outerHTML:a.innerHTML;return X&&B["!doctype"]&&a.ownerDocument&&a.ownerDocument.doctype&&a.ownerDocument.doctype.name&&e2(tb,a.ownerDocument.doctype.name)&&(p="\n"+p),q&&eV([M,T,L],e=>{p=eQ(p,e," ")}),t&&ei?t.createHTML(p):p},n.setConfig=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};eT(e),Q=!0},n.clearConfig=function(){e_=null,Q=!1},n.isValidAttribute=function(e,t,i){return e_||eT({}),td(eE(e),eE(t),i)},n.addHook=function(e,t){"function"==typeof t&&eZ(I[e],t)},n.removeHook=function(e,t){if(void 0!==t){let i=eG(I[e],t);return -1===i?void 0:eK(I[e],i,1)[0]}return e$(I[e])},n.removeHooks=function(e){I[e]=[]},n.removeAllHooks=function(){I=tv()},n})()(t);e.s(["domPurify",0,tC],47621);var tw=e.i(657729),tS=e.i(131526);let tk=(0,s.memo)(e=>{let{decorations:t,editor:i,getPos:r,node:o}=e,l=(0,eM.useAnalytics)(),d=(0,w.useAppDispatch)(),{cardId:c,isPresentMode:u,isEditable:p,isMobileDevice:h}=(0,eg.useCardState)(e),{title:m,text:g}=(0,eI.useGetCardText)({node:o,cardId:c}),f=(0,F.useIsThumbnailView)(),{previewContent:b}=e.node.attrs,y=""===b,v=m?.replaceAll(eP.EMOJI_REGEX,e=>`${e}`),S=(0,s.useMemo)(()=>({__html:tC.sanitize(v)}),[v]),A=(0,w.useAppSelector)(k.selectTheme),_=(0,tS.getFontSizeStyles)("h4",A),M=(0,tw.isExpandableSelectedNode)(t),j=(0,s.useCallback)(e=>{e.stopPropagation(),u&&!p?(d((0,k.setFollowingAttached)({attached:!1})),i.commands.descendIntoCurrentCard(r(),"push"),l?.track(eT.SegmentEvents.CARD_EXPANDED,{is_present_mode:!0,method:"click"})):((0,x.setCardCollapsed)(c,!1),setTimeout(()=>{if(!p||i.isDestroyed)return;let e=r();"number"==typeof e&&i.commands.selectInsideNodeAtPos(e)},50),l?.track(eT.SegmentEvents.CARD_EXPANDED,{is_present_mode:!1,method:"click"}))},[c,u,p,d,i,r,l]),P=y||!g?.trim();return(0,n.jsxs)(Z.AnnotatableNodeViewWrapper,{...e,children:[(0,n.jsx)(Y.ContainerDragHandle,{...e,"data-testid":"card-drag-handle",handlePlacement:"outside"}),(0,n.jsxs)(a.Box,{mb:"0.25em",position:"relative",contentEditable:!1,userSelect:"none",role:"group","data-card-id":c,"data-export-as-image":!0,children:[(0,n.jsxs)(eA.ButtonGroup,{position:"absolute",insetInlineEnd:"0.75em",top:"0.75em","data-print-hidden":!0,variant:"unstyled",colorScheme:"gray",fontFamily:"body","data-thumbnail-hidden":!0,children:[p&&(0,n.jsx)(tA,{hidePreview:y,...e}),(0,n.jsx)(tE,{onClick:j})]}),(0,n.jsxs)(a.Box,{cursor:"pointer",className:(0,T.cx)(C.CARD_WRAPPER_CLASS,"card-collapsed",M&&"expandable-selected"),_groupHover:eL.ClickableHoverSx,...eL.ClickableTransitionSx,paddingX:h?"1em":"1.5em",paddingY:"1em",onClick:j,"data-collapsed-card":!0,"data-selection-ring":!0,"data-selection-background":!0,"data-content-reference":!0,sx:{backgroundColor:"var(--clickable-background-color)",boxShadow:"var(--card-border-shadow, 0px 0px 0px 1px var(--neutral-border-color)), var(--card-box-shadow, var(--clickable-shadow))",borderRadius:"calc(var(--card-border-radius) / 2)","@media print":{boxShadow:"none",border:"var(--card-border, 1px solid var(--neutral-border-color))"}},children:[(0,n.jsx)(I.Text,{sx:_,noOfLines:1,marginInlineEnd:"1.75em",mb:"0.375em",className:(0,T.cx)(ej.HEADING_CLASS),children:v?(0,n.jsx)(I.Text,{as:"span",dangerouslySetInnerHTML:S}):m||(f?null:(0,n.jsx)(I.Text,{as:"span",color:"gray.400",children:(0,n.jsx)(N.Trans,{message:"Untitled card",id:"gLDJuJ"})}))}),(0,n.jsxs)(E.HStack,{color:"var(--body-color-muted)",children:[(0,n.jsx)(I.Text,{noOfLines:1,fontFamily:P?"body":void 0,fontSize:"0.9em",children:P?(0,n.jsx)(N.Trans,{message:"View more",id:"4m3nxQ"}):g}),y&&(0,n.jsx)(eE.FontAwesomeIcon,{icon:L.faChevronDown,size:"sm"})]})]})]})]})});tk.displayName="CollapsedCard";let tA=({hidePreview:e,updateAttributes:t})=>{let i=(0,w.useAppSelector)(k.selectIsAnyCommentOpen),a=(0,s.useCallback)(i=>{t&&(t({previewContent:e?null:""}),i.stopPropagation())},[t,e]);return(0,n.jsx)(ek.Button,{opacity:0,zIndex:+!i,transitionProperty:"opacity",transitionDuration:"normal",_groupHover:{opacity:1},sx:eL.ClickableButtonSx,fontSize:"0.7em",onClick:a,className:eL.CLICKABLE_BOX_CLASS,children:e?(0,n.jsx)(N.Trans,{message:"Show preview",id:"fsyAH8"}):(0,n.jsx)(N.Trans,{message:"Hide preview",id:"Po0vX/"})})},tE=({onClick:e})=>{let t=(0,w.useAppSelector)(k.selectIsAnyCommentOpen);return(0,n.jsxs)(ek.Button,{"aria-label":e_.i18n._({id:"JjrOSL",message:"Expand card"}),className:eL.CLICKABLE_BOX_CLASS,onClick:e,sx:eL.ClickableButtonSx,zIndex:+!t,fontSize:"0.7em","data-testid":"expand-card-button",children:[(0,n.jsx)(eE.FontAwesomeIcon,{icon:L.faExpandAlt,fontSize:"0.9em"}),(0,n.jsx)(I.Text,{as:"span",_groupHover:{opacity:1,display:"inline"},opacity:"0",display:"none",marginInlineStart:2,children:(0,n.jsx)(N.Trans,{message:"Expand",id:"1A3EXy"})})]})},t_=e=>{let{editor:t,node:i}=e,{id:a}=i.attrs,r=(0,w.useAppSelector)((0,k.selectCardCollapsed)(a)),o=(0,w.useAppSelector)(k.selectEditable),s=(0,S.useCanWithSelectFile)("edit"),l=t?.isThumbnail,{isStatic:d}=t;return!i.attrs.hidden||A.isPuppeteer||l||d||o&&s?r?(0,n.jsx)(tk,{...e}):(0,n.jsx)(ey,{...e}):null};var tI=e.i(444577);(0,y.monkeyPatchGapCursorForCardLayouts)();let tM=e=>{if((0,m.isNodeEmpty)(e)||1===e.childCount&&(0,m.isNodeEmpty)(e.firstChild))return!0;if("blank"!==e.attrs.layout)return!1;let t=(0,u.getCardLayoutItemChildren)(e);if(0===t.length)return!1;let i=t.find(e=>"body"===e.attrs.itemId);return!!i&&1===i.childCount&&(0,m.isNodeEmpty)(i.firstChild)},tT=({oldNode:e,oldDecorations:t,newNode:i,newDecorations:n,updateProps:a})=>{let r=JSON.stringify(i.attrs)!==JSON.stringify(e.attrs),o=(0,b.didDecorationsSpecChange)(t,n),s=tM(i)!==tM(e);return(r||o||s)&&(console.debug(`[cardUpdateFn] Card ${i.attrs.id} updateProps will be called:`,{oldDecorations:t,newDecorations:n,decorationsChanged:o}),a()),!0};function tL({mutation:e}){let t=this.editor.state.selection,i=e.target instanceof HTMLElement?e.target:e.target.parentElement,n="selection"!==e.type&&tP(i),a="selection"===e.type&&t instanceof c.NodeSelection&&(0,f.isMediaNode)(t.node);return!!n||!!a}let tj=(0,p.createTiptapNode)("card",{defining:!1,isolating:!0,selectable:!1,draggable:!0,priority:g.ExtensionPriorityMap.Card,containerHandle:!0,imageKeyPath:"background.image",allowGapCursor:!1,expandable:!0,addNodeView(){return(0,h.ReactNodeViewRenderer)(t_,{update:tT,ignoreMutation:tL.bind(this)})},addProseMirrorPlugins(){return[(0,v.CardPlugin)(this.editor)]},addOptions:()=>({isStatic:!1}),addExtensions(){return[tI.UniqueCardId.configure({callback:(e,t,i)=>{0!==t.length&&t.forEach(({val:e})=>{console.debug(`[Card.UniqueCardId] New card id(${e}) created. Will be created in postgres through content service.`),(0,x.initializeCardExpanded)(e)})},types:[this.name]})]},addCommands:()=>({}),parseHTML:()=>[{tag:"div[class=gamma-card]",getAttrs:e=>({cardSize:e.getAttribute("card-size")||"default",layout:e.getAttribute("image-layout")||e.getAttribute("layout")||"blank",layoutTemplateColumns:e.getAttribute("layout-template-columns")||null,layoutTemplateRows:e.getAttribute("layout-template-rows")||null,verticalAlign:e.getAttribute("vertical-align")||null,fontScale:e.getAttribute("data-font-scale")?Number(e.getAttribute("data-font-scale")):null,hidden:"true"===e.getAttribute("data-hidden"),...(0,p.parseJSONAttr)(e,"background")?{background:(0,p.parseJSONAttr)(e,"background")}:{},...(0,p.parseJSONAttr)(e,"container")?{container:(0,p.parseJSONAttr)(e,"container")}:{},...(0,p.parseJSONAttr)(e,"generatorInput")?{generatorInput:(0,p.parseJSONAttr)(e,"generatorInput")}:{},...(0,p.parseJSONAttr)(e,"cardMarginSettings")?{cardMarginSettings:(0,p.parseJSONAttr)(e,"cardMarginSettings")}:{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,d.mergeAttributes)(t,{class:"gamma-card","card-size":e.attrs.cardSize,"image-layout":e.attrs.layout,"layout-template-columns":e.attrs.layoutTemplateColumns,"layout-template-rows":e.attrs.layoutTemplateRows,"vertical-align":e.attrs.verticalAlign,"data-font-scale":e.attrs.fontScale??void 0,"data-hidden":e.attrs.hidden?"true":void 0,...(0,p.renderJSONAttrs)(e.attrs,"background","container","generatorInput","cardMarginSettings")}),0]}),tP=e=>e?.parentElement&&(e.classList.contains(C.CARD_WRAPPER_CLASS)||e.parentElement.closest(`.${C.CARD_CONTENT_CLASS}, .${C.CARD_WRAPPER_CLASS}`)?.classList.contains(C.CARD_WRAPPER_CLASS));function tD({children:e,nodeProps:t,...i}){let d=(0,s.useMemo)(()=>(0,o.tiptapNodeView)({component:t_,extension:tj}),[]);if((0,l.useIsInsidePreviewCard)())return(0,n.jsx)(d,{nodeProps:t,children:e});let c=Math.round(50.0625);return(0,n.jsx)(a.Box,{w:"89px",h:`${c}px`,overflow:"hidden",borderRadius:"sm",flexShrink:0,...i,children:(0,n.jsx)(r.Flex,{direction:"column",w:"100%",css:{"--editor-width":"89px","--line-thickness":"1px"},children:(0,n.jsx)(l.PreviewCard,{children:(0,n.jsx)(d,{nodeProps:t,children:e})})})})}var tN=e.i(672887);e.s(["BatchQADocumentNodeView",0,function({children:e,nodeProps:t,...i}){let a=(0,w.useAppSelector)(k.selectTheme),o=(0,tN.getThemeStylesheet)(a,!1);return(0,n.jsx)(r.Flex,{sx:o,gap:"2px",pointerEvents:"none",...i,children:e})}],429465)},888055,e=>{"use strict";var t=e.i(391398),i=e.i(191788),n=e.i(395478);let a=(0,i.createContext)({variationName:"",isApplied:!1,cardIds:[],headerExtra:null,theme:n.DefaultLightTheme});e.s(["BuddyEditorPreviewStateProvider",0,function({value:e,children:i}){return(0,t.jsx)(a.Provider,{value:e,children:i})},"useBuddyEditorPreviewState",0,function(){return(0,i.useContext)(a)}])},550927,579367,932138,852400,e=>{"use strict";e.s(["EditorPreview",()=>eg],550927);var t=e.i(391398),i=e.i(428683);e.i(314572);var n=e.i(133350),a=e.i(636339),r=e.i(723641),o=e.i(955312),s=e.i(835128),l=e.i(191788);e.i(420945);var d=e.i(209239),c=e.i(162030),u=e.i(429465),p=e.i(888055),h=e.i(927835),m=e.i(271910),g=e.i(179115);function f({children:e,nodeProps:n,...a}){let o=(0,l.useMemo)(()=>(0,r.tiptapNodeView)({component:g.SwitchingCardView,extension:m.Card}),[]),{cardIds:s}=(0,p.useBuddyEditorPreviewState)();return(0,h.useIsInsidePreviewCard)()?(0,t.jsx)(o,{nodeProps:n,children:e}):s.includes(n.node.attrs.id)?(0,t.jsx)(i.Box,{borderRadius:"md",overflow:"hidden",maxH:"200px",...a,children:(0,t.jsx)(h.PreviewCard,{children:(0,t.jsx)(o,{nodeProps:n,children:e})})}):null}var b=e.i(555145),x=e.i(918228),y=e.i(887527),v=e.i(905859),C=e.i(672887);function w({children:e,nodeProps:i,...n}){let{variationName:a,isApplied:r,headerExtra:o,theme:s}=(0,p.useBuddyEditorPreviewState)(),l=(0,C.getThemeStylesheet)(s,!1),{getTextColor:d}=(0,v.useBuddyMessageVariationColors)({isApplied:r});return(0,t.jsxs)(x.Stack,{sx:l,justify:"start",align:"start",spacing:1,pos:"relative",...n,children:[(a||o)&&(0,t.jsxs)(b.HStack,{spacing:2,w:"100%",justify:"space-between",children:[(0,t.jsx)(y.Text,{fontSize:"xs",fontWeight:"semibold",color:d(),children:a}),o]}),e]})}var S=e.i(135594),k=e.i(783197),A=e.i(418755),E=e.i(131339),_=e.i(729088),I=e.i(86010),M=e.i(828260),T=e.i(250332),L=e.i(551880);let j={color:"titanium.50",bg:"titanium.800","--popper-arrow-bg":"var(--chakra-colors-titanium-800)",borderRadius:"sm",px:1.5,py:.5,fontSize:"xs",fontWeight:600};var P=e.i(256266);let D='/**/url(\'data:image/svg+xml;charset=utf-8,\')',N={backgroundRepeat:"no-repeat",backgroundSize:"11px",backgroundPosition:"8px center",fontSize:"13px",fontWeight:"bold",color:"var(--chakra-colors-trueblue-400)",position:"absolute",zIndex:1,top:"0px",left:"0px",backgroundColor:"var(--chakra-colors-trueblue-100)",padding:"4px 12px",paddingLeft:"24px",borderRadius:"0 0 4px 4px",pointerEvents:"none"},R={".ai-generate-streaming-card":{"&.node-card":{pointerEvents:(0,P.isMobileDevice)()?void 0:"none !important"},"&.node-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}},".streaming-cursor__label":{_after:{...N,backgroundImage:D,content:"var(--ai-generating-label)"}}},".ai-generate-streaming-card--node-selection":{".streaming-cursor--node-selection":{position:"absolute",top:"0px",left:"0px",zIndex:2,pointerEvents:"none",".streaming-cursor__label":{_after:{...N,backgroundImage:D,content:"var(--ai-generating-label)",position:"relative",top:"auto",left:"auto"}}}},"&.buddy-active":{".buddy-active-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 1px #2208CC",borderRadius:"inherit",pointerEvents:"none"}}}};var O=e.i(707065),B=e.i(503752);let z="transparent",F=(0,O.keyframes)({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),H=(0,O.keyframes)({"0%":{opacity:.5,color:"var(--chakra-colors-trueblue-500)"},"100%":{opacity:1,color:"inherit"}}),W={".autocomplete-loading":{display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:"2px",borderBottomColor:z,borderLeftColor:z,animation:`${F} 0.45s linear infinite`,width:"var(--spinner-size)",height:"var(--spinner-size)","--spinner-size":"1em",marginLeft:"0.25em",color:"var(--chakra-colors-trueblue-500)"},".autocomplete-inserted":{animation:`${H} ${B.INSERT_FADE_TIME}ms ease-out`},".autocomplete-highlight":{backgroundColor:"#84c1fa45"}},U=".25em",V={transitionDuration:"slow",transitionTimingFunction:"ease-out"},G=".comments-wrapper, .block-comments-circle",$=`> :is(${G})`,Z=`> :not(${G}), [data-spotlight-parent] > *`,K=e=>{let t=e?.2:.65;return{"&.react-renderer > [data-node-view-wrapper]":{[Z]:{transitionProperty:"filter, transform",...V,filter:`opacity(${t}) blur(${e?U:"0"})`},[$]:{transitionProperty:"opacity",...V,filter:`opacity(${t}) blur(${e?U:"0"})`,"&[data-is-popup-open=true]":{filter:"none"},_hover:{filter:"none"}}},"&:not(.react-renderer)":{transitionProperty:"filter, transform",...V,filter:`opacity(${t}) blur(${e?U:"0"})`}}},q={"[data-spotlight-dim]":{opacity:.2},".spotlightable":{...K(!1),transitionProperty:"filter, transform",...V,cursor:"pointer"},".spotlightable:hover":{transform:"scale(1.05)"},".spotlightable.after-spotlight":K(!0),".spotlightable.spotlight-block, .spotlight-block .spotlightable":{"&.react-renderer > [data-node-view-wrapper]":{[Z]:{opacity:"1",filter:"none"},[$]:{filter:"none"}},"&:not(.react-renderer)":{filter:"none"}}},Y={...W,".ProseMirror":{"&.spotlight-active":q,...R,".block-card":{transitionProperty:"opacity",transitionDuration:"normal"},"&.card-notes-active":{".block-card:not(.card-notes-active-parent-card)":{opacity:.5},".card-notes-active-parent-card .block-card":{opacity:"revert"},".card-notes-active-parent-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}}},'&[contenteditable="true"]':{"&:focus-within":{".ProseMirror-gapcursor":{display:"block",height:"1.5em",position:"relative","&:after":{width:"0px",height:"100%",borderTop:"0px",borderLeft:"1px solid black"}},".grid-cell":{".ProseMirror-gapcursor:first-child":{marginTop:"1em"},".ProseMirror-gapcursor:last-child":{marginBottom:"1em"}},".block-table td":{".ProseMirror-gapcursor:first-child":{marginTop:".75em"},".ProseMirror-gapcursor:last-child":{marginBottom:".75em"}},".is-dark":{".ProseMirror-gapcursor:after":{borderLeftColor:"white"}}}},".collaboration-cursor__caret":{position:"relative",marginLeft:"-1px",marginRight:"-1px",borderLeft:"1px solid #0d0d0d",borderRight:"1px solid #0d0d0d",wordBreak:"normal",pointerEvents:"none",textIndent:0},".collaboration-cursor__label":{position:"absolute",top:"-1.4em",left:"-1px",fontSize:"12px",fontStyle:"normal",fontFamily:"'Inter', sans-serif",fontWeight:"600",lineHeight:"normal",letterSpacing:"normal",textTransform:"none",userSelect:"none",color:"#0d0d0d",padding:"0.1rem 0.3rem",borderRadius:"3px 3px 3px 0",whiteSpace:"nowrap",zIndex:1,pointerEvents:"auto",spellCheck:"false",_hover:{opacity:.1}},'&[contenteditable="false"]':{".ProseMirror-gapcursor":{display:"none"},".collaboration-cursor__caret:not(.streaming-cursor)":{display:"none"}},".is-selecting-node, .sal-selection-node, .sal-selection-card":{"[data-selection-ring]":{_before:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",outline:"2px solid",outlineColor:"blue.600",pointerEvents:"none",zIndex:1}},'[data-selection-ring="inside"]':{_before:{zIndex:10,outlineOffset:"-2px"}},'[data-selection-ring="padded"]':{_before:{outlineOffset:"0.25em"}},".react-renderer [data-selection-ring]":{_before:{content:"none"}}},".is-selecting-around":{"[data-selection-background]":{_after:{content:'""',position:"absolute",inset:0,backgroundColor:"var(--chakra-ring-color)",borderRadius:"inherit",opacity:.75}},".react-renderer:not(.is-selecting-around) [data-selection-ring]":{_after:{content:"none"}}},".is-selecting-text":{backgroundColor:"highlight",padding:0,margin:0,display:"inline",lineHeight:"inherit",textDecoration:"none",boxDecorationBreak:"clone",WebkitBoxDecorationBreak:"clone"},".card-present-mode":{"&--doc":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentCollapsed":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentPrev":{transform:"translateY(-100%)",position:"fixed",zIndex:2},"&--presentCurrent":{transform:"translateY(0)","@media print":{transform:"none"},position:"fixed",zIndex:3},"&--presentNext":{transform:"translateY(100%)",position:"fixed",zIndex:2},"&--presentParent":{transform:"translateY(0)",position:"fixed",zIndex:2}},".document-content.is-doc-mode":{".card-wrapper":{"&:hover":{".card-divider":{opacity:1},".manage-card-controls":{opacity:1}}}},".document-content":{".card-wrapper":{"&:hover":{".card-footer-reactions":{opacity:1},".card-collapsed":{".card-footer-reactions":{display:"none"}}}}}},".ProseMirror-dropcursor":{transitionProperty:"inset",transitionDuration:"fast",borderRadius:"md",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",'&[data-type="tableColumn"]':{backgroundColor:"var(--chakra-ring-color)",borderRadius:"1px",display:"block",fontSize:"sm",fontWeight:"medium","&:before":{content:"attr(data-message)",position:"absolute",bottom:"100%",left:"50%",transform:"translateX(-50%)",...j,whiteSpace:"nowrap",marginBottom:"4px",opacity:1,pointerEvents:"none"}},outline:"1px solid",outlineColor:"whiteAlpha.800",pointerEvents:"none",backdropFilter:"blur(4px)","&::after":{...j,w:"max-content",pointerEvents:"none",display:"none"},'&[data-type="column"]::after':{content:'"Drop to add column"',position:"absolute",top:"-2em",display:"block"}}};e.s(["EditorStyles",0,Y],579367);var X=e.i(995505);let Q=(0,l.createContext)({variantGroup:{family:{key:"",name:()=>"",icon:""},variants:[],visible:!1},savedVariantHash:null,handleSelectVariant:()=>{}});function J(){return(0,l.useContext)(Q)}e.s(["SmartLayoutVariantPanelStateProvider",0,function({value:e,children:i}){return(0,t.jsx)(Q.Provider,{value:e,children:i})},"useSmartLayoutVariantPanelState",0,J],932138);var ee=e.i(613616),et=e.i(292632);let ei=e.i(11507).PANEL_TRANSITION_DURATION;e.s(["EDITOR_WIDTH",0,173,"LOADING_DELAY_MS",0,ei+100,"RENDER_DELAY_MS",0,ei],852400);let en=l.default.memo(({zoomIn:e,isSelected:i,onClick:n,children:a})=>{let{ref:r,width:o}=(0,et.useElementSize)();return(0,t.jsx)(ee.Flex,{ref:r,direction:"column",onClick:n,cursor:"pointer",overflow:"hidden",transition:"all 0.2s",color:i?"trueblue.600":"gray.800",bgColor:i?"trueblue.200":"transparent",_hover:{backgroundColor:i?"trueblue.150":"trueblue.100"},position:"relative",w:"100%",px:2,pt:2,pb:1,borderRadius:"md",css:{"--editor-width":`${o&&1!==o?o:173}px`,"--line-thickness":"1px"},h:"100%",children:(0,t.jsx)(h.PreviewCard,{zoomIn:e,shadow:"md",border:"1px solid",borderColor:"gray.200",borderRadius:"md",minH:"80px",maxH:"100px",children:a})})});en.displayName="VariantCard";var ea=e.i(641099),er=e.i(541075);let eo=e=>({visibility:e?"visible":"hidden",height:e?"auto":"0",overflow:"hidden",position:e?"relative":"absolute",pointerEvents:e?"auto":"none","aria-hidden":!e,tabIndex:e?void 0:-1});function es({children:e,nodeProps:n,...a}){let r=(0,A.useAppSelector)(L.selectTheme),o=(0,C.getThemeStylesheet)(r,!1),{variantGroup:s}=J(),l=s.visible,d=eo(l);return(0,t.jsxs)(ee.Flex,{direction:"column",w:"100%",...d,...a,sx:o,children:[l&&(0,t.jsx)(ee.Flex,{alignItems:"center",justifyContent:"space-between",children:(0,t.jsxs)(ee.Flex,{px:4,py:1,alignItems:"center",flex:1,children:[(0,t.jsx)(i.Box,{as:"span",fontSize:"lg",me:2,children:s.family.icon&&(0,t.jsx)(er.FontAwesomeIcon,{icon:s.family.icon,fixedWidth:!0,size:"sm"})}),(0,t.jsx)(y.Text,{children:s.family.name()})]})}),(0,t.jsx)(ea.SimpleGrid,{columns:2,gap:1,px:2,pb:2*!!l,...d,children:e})]})}function el({children:e,nodeProps:n,...a}){let{node:o}=n,s=(0,l.useMemo)(()=>(0,r.tiptapNodeView)({component:g.SwitchingCardView,extension:m.Card}),[]),d=(0,h.useIsInsidePreviewCard)(),{variantGroup:c,savedVariantHash:u,handleSelectVariant:p}=J();if(d)return(0,t.jsx)(s,{nodeProps:n,children:e});let f=c.variants.flatMap(e=>e.options).find(e=>e.key===o.attrs.id),b=eo(c.visible&&!!f?.visible);return f?(0,t.jsx)(i.Box,{...b,...a,children:(0,t.jsx)(en,{zoomIn:f.zoomIn??!1,isSelected:u===o.attrs.id,onClick:()=>{p(o.attrs.id)},children:(0,t.jsx)(s,{nodeProps:n,children:e})},o.attrs.id)}):null}var ed=e.i(529232),ec=e.i(388302),eu=e.i(82050);function ep({children:e,nodeProps:n,...a}){let o=(0,l.useMemo)(()=>(0,r.tiptapNodeView)({component:g.SwitchingCardView,extension:m.Card}),[]);return(0,h.useIsInsidePreviewCard)()?(0,t.jsx)(o,{nodeProps:n,children:e}):(0,t.jsx)(i.Box,{...a,children:(0,t.jsx)(h.PreviewCard,{children:(0,t.jsx)(o,{nodeProps:n,children:e})})})}var eh=e.i(470645);function em({children:e,nodeProps:n,...a}){let r=(0,A.useAppSelector)(L.selectTheme),o=(0,C.getThemeStylesheet)(r,!1);return(0,t.jsx)(i.Box,{sx:o,h:"100%",overflowY:"auto",className:(0,eh.cx)("doc-content-wrapper",a.className),...a,children:e})}let eg=e=>{let{reduxData:i,...n}=e,a=(e=>{let[t]=(0,l.useState)(()=>(0,ec.configureStore)({reducer:A.moduleReducers,middleware:e=>e({serializableCheck:!1})}));return(0,l.useEffect)(()=>{e?.doc&&t.dispatch((0,eu.setCurrentPage)({currentPage:e.doc}))},[e,t]),t})(i);return(0,t.jsx)(d.Provider,{store:a,children:(0,t.jsx)(eb,{...n})})},ef=({editor:e,content:i})=>{let a=(0,A.useAppDispatch)();return(0,s.useTiptapEditorEffect)(e=>{i&&(e.commands.setContent(i,{emitUpdate:!1}),e.commands.command(()=>((0,E.setDefaultCardCollapse)(e.state.doc,a),!0)),T.DocumentAttrsPluginKey.getState(e.state)?.compute(e.state.doc).processChanges(a))},[i,a]),(0,t.jsx)(n.TiptapEditorContent,{editor:e,style:{width:"100%",height:"100%"},className:"highlight-mask"})},eb=({type:e,onCreate:n=()=>{},initialContent:s,content:d,theme:p,isThumbnail:h})=>{let m,g,b=(0,l.useMemo)(()=>(0,ed.getBaseExtensions)(),[]),x=(0,A.useAppDispatch)();(0,l.useEffect)(()=>{x((0,L.setTheme)({theme:p||null})),x((0,L.setIsAllowedToEdit)({isAllowedToEdit:!1})),x((0,L.setAnimationsEnabled)({animationsEnabled:!1}))},[p,x]);let y=(0,o.useTiptapEditor)({async onCreate({editor:e}){console.debug("[EditorPreview][onCreate] TipTap editor is now ready"),_.CardIdsPluginKey.getState(e.state)?.compute(e.state).processChanges(x),e.commands.command(()=>((0,E.setDefaultCardCollapse)(e.state.doc,x),!0)),n?.({editor:e})},extensions:b,content:s,editable:!1,immediatelyRender:!0});switch((0,S.useComputeCardTextMap)(y),e){case"buddyEditor":m=w,g=f;break;case"smartLayoutVariantPanel":m=es,g=el;break;case"workspaceTemplate":m=X.WorkspaceTemplateDocumentNodeView,g=X.WorkspaceTemplateCardNodeView;break;case"deckFilmstrip":m=u.BatchQADocumentNodeView,g=c.BatchQACardNodeView;break;case"suggestionRow":m=em,g=ep;break;default:m=null,g=null}let v=(0,l.useMemo)(()=>({...(0,ed.getBaseNodeViews)(),contributors:(0,r.tiptapNodeView)({component:M.ContributorsThumbnailView,extension:I.Contributors}),...m&&{document:m},...g&&{card:g}}),[m,g]),C=(0,l.useMemo)(()=>(0,ed.getBaseMarkViews)(),[]);return(0,t.jsx)(k.IsThumbnailViewProvider,{value:!!h,children:(0,t.jsx)(i.Box,{className:"editor-preview-root","data-variation-preview":!0,"data-testid":"editor-preview-root",width:"100%",position:"relative",sx:Y,children:(0,t.jsx)(a.TiptapEditorView,{editor:y,nodeViewComponents:v,markViewComponents:C,children:(0,t.jsx)(ef,{editor:y,content:d})})})})}},584139,593613,e=>{"use strict";e.s(["useToggleBuddyChatPanel",()=>tA],584139);var t=e.i(391398),i=e.i(620020),n=e.i(408122);e.i(755453);var a=e.i(191788),r=e.i(613616),o=e.i(654656);e.i(828525);var s=e.i(876533),l=e.i(357454),d=e.i(929508),c=e.i(87959),u=e.i(948714),p=e.i(82050),h=e.i(418755);e.i(734710);var m=e.i(78387),g=e.i(468738),f=e.i(957631),b=e.i(789719),x=e.i(996324),y=e.i(986271),v=e.i(237060),C=e.i(713677),w=e.i(985050),S=e.i(643292),k=e.i(166549),A=e.i(31397),E=e.i(816390),_=e.i(865208),I=e.i(836465),M=e.i(366273),T=e.i(703136),L=e.i(428683),j=e.i(303254),P=e.i(702692),D=e.i(943946);e.s(["AssistantMessage",()=>e5,"extractArtifact",()=>e8],593613);var N=e.i(840733),R=e.i(273845),O=e.i(179658),B=e.i(613110),z=e.i(891892),F=e.i(359603),H=e.i(358280),W=e.i(186003),U=e.i(707188),V=e.i(317870),G=e.i(579359),$=e.i(212206),Z=e.i(551880),K=e.i(641099),q=e.i(918228),Y=e.i(809701),X=e.i(737504),Q=e.i(594226),J=e.i(46453),ee=e.i(103104),et=e.i(762721),ei=e.i(865799),en=e.i(530521),ea=e.i(13556),er=e.i(472413),eo=e.i(927509),es=e.i(605233),el=e.i(240178),ed=e.i(359227),ec=e.i(550927),eu=e.i(195305),ep=e.i(888055);let eh=a.default.memo(({initialContent:e,variationName:i,headerExtra:n,isSelected:a,cardIds:r,themeId:o,interactionId:s,children:l})=>{let d=(0,h.useAppSelector)((0,ed.selectThemeById)(o)),c=(0,es.useBuddyEditorToolContext)();return(0,t.jsxs)(ep.BuddyEditorPreviewStateProvider,{value:{variationName:i||"",isApplied:a,cardIds:r,headerExtra:n,theme:d},children:[(0,t.jsx)(ec.EditorPreview,{content:e,isThumbnail:!0,type:"buddyEditor",theme:d,onCreate:({editor:t})=>{t.gammaOrgId=(0,eu.getCurrentWorkspaceId)(),t.gammaDocId=c.editor?.gammaDocId,requestAnimationFrame(()=>{(0,el.lazyLoadAsyncJSONContent)({editor:t,content:e,theme:d,interactionId:s,interactionName:"buddy-chat"})})}}),l]})});eh.displayName="DocEditorPreview";var em=e.i(905859);let eg=(0,a.memo)(({variation:e,hideBadge:i})=>{let o,s,l=(0,es.useBuddyEditorToolContext)(),d=(0,c.useBuddyStore)("chosenResultVariations")[e.messageId]===e.id,{themeId:u,jsonContent:p}=(0,c.useBuddyStore)("checkpoints")[e.toApplyCheckpointId],h=[e.previewCardId],{getBgColor:m,getBgColorHover:g,getBorderColor:f}=(0,em.useBuddyMessageVariationColors)({isApplied:d}),b=(0,en.useToken)("colors",f()),x=(0,c.useBuddyStore)("selectiveAccept"),y=x[e.messageId]?.savedSelections,v=y?{total:Object.keys(y).length,selected:Object.values(y).filter(e=>"modified"===e).length}:null,C=(0,a.useCallback)(()=>{d||ea.BuddyEditorInterface.applyResultVariation(l,e),ea.BuddyEditorInterface.focusResultVariation(l,e)},[l,d,e]);return(0,t.jsx)(r.Flex,{p:2,pt:1,borderRadius:"lg",bg:m(),border:"1px solid",borderColor:f(),outline:d?`1px solid ${b}`:"none",outlineOffset:"-2px",_hover:{bg:g()},overflow:"hidden",role:"group",transitionProperty:"height border",transitionDuration:"0.2s",flexDirection:"column",justifyContent:"start",onClick:C,cursor:"pointer",position:"relative",align:"center",maxH:"300px",css:eo.previewContainerCssVars,children:(0,t.jsx)(eh,{initialContent:p,themeId:u,cardIds:h,isSelected:d,interactionId:e.messageId,variationName:e.name,headerExtra:!i&&"modified"===e.id&&v&&(0,t.jsx)(er.CardBadge,{children:(o=v.selected,s=v.total,n.i18n._({id:"xyPRt5",message:"{selected}/{total} edits",values:{selected:o,total:s}}))}),children:d&&(0,t.jsx)(ei.Badge,{colorScheme:"blue",bg:"blue.500",variant:"solid",position:"absolute",top:"45%",insetStart:"50%",color:"white",transform:"translateX(-50%)",zIndex:2,fontSize:"xs",opacity:0,cursor:"pointer",_groupHover:{opacity:1},transition:"opacity 0.2s",children:(0,t.jsx)(H.Trans,{message:"Back to card",id:"9krCfL"})})})})});eg.displayName="MessageResultCardVariation";var ef=e.i(887527);let eb=e=>(0,t.jsx)(r.Flex,{direction:"column",align:"center",justify:"center",...e}),ex=(0,a.memo)(({variation:e,hideBadge:i})=>{let o,s,l=(0,es.useBuddyEditorToolContext)(),d=(0,c.useBuddyStore)("chosenResultVariations")[e.messageId]===e.id,{getBgColor:u,getBorderColor:p,getBgColorHover:h,getTextColor:m}=(0,em.useBuddyMessageVariationColors)({isApplied:d}),g=(0,en.useToken)("colors",p()),{themeId:f,jsonContent:b}=(0,c.useBuddyStore)("checkpoints")[e.toApplyCheckpointId],x=e.previewCardIds,y=(0,c.useBuddyStore)("selectiveAccept"),v=y[e.messageId]?.savedSelections,C=v?{total:Object.keys(v).length,selected:Object.values(v).filter(e=>"modified"===e).length}:null,w="modified"===e.id&&0===x.length,S=(0,a.useCallback)(()=>{d?ea.BuddyEditorInterface.focusResultVariation(l,e):ea.BuddyEditorInterface.applyResultVariation(l,e)},[l,d,e]);return w?(0,t.jsx)(r.Flex,{p:2,pt:1,borderRadius:"lg",bg:u(),border:"1px solid",borderColor:p(),outline:d?`1px solid ${g}`:"none",outlineOffset:"-2px",_hover:{bg:h()},overflow:"hidden",role:"group",transitionProperty:"height border",transitionDuration:"0.2s",flexDirection:"column",justifyContent:"start",onClick:S,cursor:"pointer",position:"relative",minH:"100px",children:(0,t.jsxs)(q.Stack,{spacing:1,align:"start",justify:"start",h:"100%",children:[(0,t.jsx)(ef.Text,{fontSize:"xs",fontWeight:"semibold",color:m(),children:e.name}),(0,t.jsx)(eb,{flex:1,w:"100%"})]})}):(0,t.jsxs)(r.Flex,{p:2,pt:1,borderRadius:"lg",bg:u(),border:"1px solid",borderColor:p(),outline:d?`1px solid ${g}`:"none",outlineOffset:"-2px",_hover:{bg:h()},overflow:"hidden",role:"group",transitionProperty:"height border",transitionDuration:"0.2s",flexDirection:"column",justifyContent:"start",onClick:S,cursor:"pointer",position:"relative",align:"center",maxH:"300px",css:eo.previewContainerCssVars,children:[(0,t.jsx)(eh,{initialContent:b,themeId:f,cardIds:x,isSelected:d,interactionId:e.messageId,variationName:e.name,headerExtra:!i&&"modified"===e.id&&C&&(0,t.jsx)(er.CardBadge,{children:(o=C.selected,s=C.total,n.i18n._({id:"xyPRt5",message:"{selected}/{total} edits",values:{selected:o,total:s}}))})}),d&&(0,t.jsx)(ei.Badge,{colorScheme:"blue",bg:"blue.500",variant:"solid",position:"absolute",top:"50%",color:"white",insetStart:"50%",transform:"translateX(-50%)",zIndex:2,fontSize:"xs",opacity:0,_groupHover:{opacity:1},transition:"opacity 0.2s",children:(0,t.jsx)(H.Trans,{message:"Back to top",id:"0MgdN+"})})]})});ex.displayName="MessageResultDeckVariation";var ey=e.i(364450),ev=e.i(555145),eC=e.i(892194),ew=e.i(524473),eS=e.i(575084),ek=e.i(541075);e.i(144786);var eA=e.i(849187),eE=e.i(320037),e_=e.i(802448),eI=e.i(921679);let eM=(0,a.memo)(({isSelected:e,selectedColor:i,unselectedColor:n})=>(0,t.jsx)(r.Flex,{w:"20px",h:"20px",borderRadius:"full",border:"2px solid",borderColor:e?i:n,alignItems:"center",justifyContent:"center",bg:e?i:"transparent",flexShrink:0,alignSelf:"flex-start","aria-hidden":"true",children:e&&(0,t.jsx)(ek.FontAwesomeIcon,{icon:ew.faCheck,color:"white",size:"xs"})}));eM.displayName="SelectionIndicator";let eT=(0,a.memo)((0,a.forwardRef)(({isSelected:e,onSelect:i,onFocus:n,onArrowKey:r,colors:o,children:s},l)=>{let d=(0,a.useCallback)(()=>{n?.(),e||i()},[n,e,i]),c=(0,a.useCallback)(e=>{"Enter"===e.key||" "===e.key?(e.preventDefault(),d()):("ArrowLeft"===e.key||"ArrowRight"===e.key)&&(e.preventDefault(),r?.())},[d,r]),u=(0,a.useCallback)(()=>{n?.()},[n]);return(0,t.jsxs)(ev.HStack,{ref:l,flex:1,spacing:1,align:"flex-start",cursor:"pointer",onClick:d,onKeyDown:c,onFocus:u,role:"radio","aria-checked":e,tabIndex:0,children:[(0,t.jsx)(eM,{isSelected:e,selectedColor:o.selectedColor,unselectedColor:o.unselectedColor}),s]})}));eT.displayName="SelectionOption";let eL=()=>{let e=(0,eC.useColorModeValue)("blue.600","blue.300"),t=(0,eC.useColorModeValue)("gray.300","gray.600"),i=(0,eC.useColorModeValue)("gray.200","gray.600");return{selectedColor:e,unselectedColor:t,cardBorderColor:i,cardBgColor:(0,eC.useColorModeValue)("white","elevation.3"),placeholderBgColor:(0,eC.useColorModeValue)("gray.50","elevation.2")}},ej=(0,a.memo)(({selectedState:e,onToggle:i,onFocusOriginal:r,onFocusModified:o,originalContent:s,modifiedContent:l})=>{let d=eL(),c=(0,a.useRef)(null),u=(0,a.useRef)(null),p=(0,a.useCallback)(()=>{u.current?.focus()},[]),h=(0,a.useCallback)(()=>{c.current?.focus()},[]);return(0,t.jsxs)(ev.HStack,{spacing:2,w:"100%",align:"flex-start",role:"radiogroup","aria-label":n.i18n._({id:"2DZxOK",message:"Select original or modified"}),children:[(0,t.jsx)(eT,{ref:c,isSelected:"original"===e,onSelect:i,onFocus:r,onArrowKey:p,colors:d,children:s}),(0,t.jsx)(eT,{ref:u,isSelected:"modified"===e,onSelect:i,onFocus:o,onArrowKey:h,colors:d,children:l})]})});ej.displayName="SelectionRow";let eP=(0,a.memo)(({originalSlot:e,modifiedSlot:i,selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o})=>{let s=eL(),l=(e,i)=>"placeholder"===e.type?(0,t.jsx)(eo.PreviewContainer,{isSelected:i,selectedColor:s.selectedColor,borderColor:s.cardBorderColor,bgColor:s.placeholderBgColor,variant:"dashed",alignItems:"center",justifyContent:"center",children:e.content}):(0,t.jsx)(eo.PreviewContainer,{isSelected:i,selectedColor:s.selectedColor,borderColor:s.cardBorderColor,bgColor:s.placeholderBgColor,dynamicPreviewWidth:!0,children:e.content});return(0,t.jsx)(ej,{selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o,originalContent:l(e,"original"===n),modifiedContent:l(i,"modified"===n)})});eP.displayName="CardComparisonRow";let eD=(0,a.memo)(()=>(0,t.jsx)(er.CardBadge,{position:"absolute",children:(0,t.jsx)(H.Trans,{message:"New card",id:"pnrmSP"})}));eD.displayName="NewCardBadge";let eN=(0,a.memo)(({position:e,showArrow:i})=>(0,t.jsx)(er.CardBadge,{position:"absolute",minW:5,textAlign:"center","aria-label":i?n.i18n._({id:"u1xjYW",message:"Moved to position {position}",values:{position:e}}):n.i18n._({id:"lJcnnh",message:"Position {position}",values:{position:e}}),children:i?`→ ${e}`:e}));eN.displayName="PositionBadge";let eR=(0,a.memo)(()=>(0,t.jsx)(er.CardBadge,{position:"absolute",children:(0,t.jsx)(H.Trans,{message:"Removed",id:"eps54V"})}));eR.displayName="RemovedCardBadge";var eO=e.i(276137),eB=e.i(338538),ez=e.i(160396);let eF=({content:e,cardId:i})=>{let n=(0,a.useMemo)(()=>{let t=(0,eI.default)(e);if(t.content){let e=t.content[0].content?.filter(e=>e.attrs?.id===i);t.content[0].content=e}return t},[e,i]);return(0,t.jsx)(ec.EditorPreview,{content:n,type:"suggestionRow",isThumbnail:!0})},eH=(0,a.memo)(({originalThemeId:e,newThemeId:i,selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o})=>{let s=(0,h.useAppSelector)((0,ed.selectThemeById)(e)),l=(0,h.useAppSelector)((0,ed.selectThemeById)(i)),d=eL();return(0,t.jsx)(ej,{selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o,originalContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"original"===n,selectedColor:d.selectedColor,borderColor:d.cardBorderColor,height:"auto",children:(0,t.jsx)(eO.ThemePreviewThumbnail,{theme:s,heightEm:6})}),modifiedContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"modified"===n,selectedColor:d.selectedColor,borderColor:d.cardBorderColor,height:"auto",children:(0,t.jsx)(eO.ThemePreviewThumbnail,{theme:l,heightEm:6})})})});eH.displayName="ThemeSuggestionRow";let eW=(0,a.memo)(({oldAttrs:e,newAttrs:i,selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o})=>{let s=eL();return(0,t.jsx)(ej,{selectedState:n,onToggle:a,onFocusOriginal:r,onFocusModified:o,originalContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"original"===n,selectedColor:s.selectedColor,borderColor:s.cardBorderColor,bgColor:s.placeholderBgColor,height:"100px",alignItems:"center",justifyContent:"center",children:(0,t.jsx)(ez.ImageOrVideo,{src:e.src??void 0,maxH:"100%",maxW:"100%",objectFit:"contain"})}),modifiedContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"modified"===n,selectedColor:s.selectedColor,borderColor:s.cardBorderColor,bgColor:s.placeholderBgColor,height:"100px",alignItems:"center",justifyContent:"center",children:(0,t.jsx)(ez.ImageOrVideo,{src:i.src??void 0,maxH:"100%",maxW:"100%",objectFit:"contain"})})})});eW.displayName="ImageSuggestionRow";let eU=(0,a.memo)(({cardId:e,cardJson:i,content:n,positionBadge:a,positionBadgeShowArrow:r,showNewCardBadge:o})=>{let s=n??{type:"doc",content:[{type:"document",attrs:{background:{type:eB.BackgroundType.NONE},docFlags:{}},content:[i]}]};return(0,t.jsxs)(t.Fragment,{children:[void 0!==a&&(0,t.jsx)(eN,{position:a,showArrow:r}),o&&(0,t.jsx)(eD,{}),(0,t.jsx)(eF,{content:s,cardId:e})]})});eU.displayName="CardPreviewContent";let eV=(0,a.memo)(({suggestion:e,beforeCheckpointId:i,afterCheckpointId:n,selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s})=>{let l=(0,es.useBuddyEditorToolContext)(),d=(0,c.useBuddyStore)("checkpoints"),u=d[i],p=d[n],h=eL(),m=e.preview({editor:l.editor},{editor:l.editor});if(m.previewType===J.BuddySuggestionPreviewType.Theme)return(0,t.jsx)(eH,{originalThemeId:m.originalThemeId,newThemeId:m.newThemeId,selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s});if(m.previewType===J.BuddySuggestionPreviewType.Image)return(0,t.jsx)(eW,{oldAttrs:m.oldAttrs,newAttrs:m.newAttrs,selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s});if(m.previewType===J.BuddySuggestionPreviewType.CardRemoval)return(0,t.jsx)(eP,{selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s,originalSlot:{type:"card",content:(0,t.jsx)(eU,{cardId:m.cardId,cardJson:m.cardJson})},modifiedSlot:{type:"placeholder",content:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eR,{}),(0,t.jsx)(eb,{})]})}});if(m.previewType===J.BuddySuggestionPreviewType.CardCreation){let e=p&&ea.BuddyEditorInterface.getTopLevelCardIdsFromJson(p.jsonContent).includes(m.cardId);return(0,t.jsx)(eP,{selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s,originalSlot:{type:"placeholder",content:(0,t.jsx)(eb,{})},modifiedSlot:{type:"card",content:e?(0,t.jsx)(eU,{cardId:m.cardId,content:p.jsonContent,showNewCardBadge:!0}):(0,t.jsx)(eU,{cardId:m.cardId,cardJson:m.cardJson,showNewCardBadge:!0})}})}if(m.previewType===J.BuddySuggestionPreviewType.CardMove){let e=u?ea.BuddyEditorInterface.getTopLevelCardIdsFromJson(u.jsonContent):[],i=p?ea.BuddyEditorInterface.getTopLevelCardIdsFromJson(p.jsonContent):[],n=e.indexOf(m.cardId),l=i.indexOf(m.cardId);return(0,t.jsx)(eP,{selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s,originalSlot:{type:"card",content:(0,t.jsx)(eU,{cardId:m.cardId,cardJson:m.cardJson,positionBadge:n>=0?n+1:void 0})},modifiedSlot:{type:"card",content:(0,t.jsx)(eU,{cardId:m.cardId,cardJson:m.cardJson,positionBadge:l>=0?l+1:void 0,positionBadgeShowArrow:!0})}})}if(m.previewType!==J.BuddySuggestionPreviewType.Card)return null;let g=m.originalPreviewCardId,f=m.modifiedPreviewCardId;return(0,t.jsx)(ej,{selectedState:a,onToggle:r,onFocusOriginal:o,onFocusModified:s,originalContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"original"===a,selectedColor:h.selectedColor,borderColor:h.cardBorderColor,bgColor:h.placeholderBgColor,dynamicPreviewWidth:!0,children:u&&(0,t.jsx)(eF,{content:u.jsonContent,cardId:g})}),modifiedContent:(0,t.jsx)(eo.PreviewContainer,{isSelected:"modified"===a,selectedColor:h.selectedColor,borderColor:h.cardBorderColor,bgColor:h.placeholderBgColor,dynamicPreviewWidth:!0,children:p&&(0,t.jsx)(eF,{content:p.jsonContent,cardId:f})})})});eV.displayName="SuggestionRow";let eG={},e$=(0,a.memo)(({result:e,suggestions:i,ratings:n})=>{var r;let o,s,l,d,u=(0,c.useBuddyAgent)(),p=(0,es.useBuddyEditorToolContext)(),m=(0,h.useAppSelector)(Z.selectTheme),g=(0,v.useBuddyChatSave)(),f=(0,c.useBuddyStore)("selectiveAcceptExpandedId"),b=(0,c.useBuddyStore)("selectiveAccept"),x=(()=>{if(!f)return eG;let e=b[f];return e?.expanded?e.expanded.selections:eG})(),y=(0,eC.useColorModeValue)("gray.700","gray.300"),C=(0,eC.useColorModeValue)("blue.700","blue.300"),w=e.variations.find(e=>"original"===e.id),S=e.variations.find(e=>"modified"===e.id),k=w?.toApplyCheckpointId||"",A=S?.toApplyCheckpointId||"",E=(0,c.useBuddyStore)("checkpoints")[k],_=(0,a.useCallback)(async(t,n)=>{let a;if(!E||!p.editor)return;let r=i.find(e=>"suggestThemes"===e.type);if(r){let e=r.preview(p,p);e.previewType===J.BuddySuggestionPreviewType.Theme&&(a="modified"===t[r.id]?e.newThemeId:e.originalThemeId)}let o=p.theme?.id;for(let n of(await ea.BuddyEditorInterface.loadCheckpoint(p,k,e.messageId,{skipTheme:!0}),[...i].filter(e=>"suggestThemes"!==e.type).sort((e,t)=>{let i={editCardById:0,imageEditContent:1};return(i[e.type]??0)-(i[t.type]??0)})))"modified"===t[n.id]?n.apply(p):n.applyOriginal(p);if(a&&a!==o&&await p.applyTheme?.(a),n){let e=i.find(e=>e.id===n);e&&("modified"===t[n]?e.focus(p):e.focusOriginal(p))}},[E,k,p,e.messageId,i]),I=(0,a.useRef)(!1);(0,a.useEffect)(()=>{I.current||(I.current=!0,Object.values(x).some(e=>"original"===e)&&_(x))},[]);let M=(0,a.useMemo)(()=>Object.entries((0,eE.default)(i,e=>(0,z.getBuddySuggestionRowText)(e.type).compressKey||e.type)).map(([e,t])=>({label:e in z.COMPRESSED_TOOL_INVOCATIONS?z.COMPRESSED_TOOL_INVOCATIONS[e].past(t.length):(0,z.getBuddySuggestionRowText)(t[0].type).past(),suggestions:t})),[i]),T=M.length>1,j=(0,a.useRef)(void 0),P=(r=(0,a.useCallback)(async t=>{let n;if(u.isDestroyed||(await _(t,j.current),j.current=void 0,u.isDestroyed||!p.editor))return;let a=Object.values(t).every(e=>"original"===e),r=Object.values(t).every(e=>"modified"===e),o="";if(!a&&!r){let a=(0,Z.selectThemeId)((0,h.getStore)().getState())??m.id,r=(0,e_.createCheckpoint)(p.editor,a);u.addCheckpoint(r),o=r.id;let s=i.filter(e=>"modified"===t[e.id]);s.length>0&&E&&(n=(0,Q.buildAppliedChangesResultVariations)(s,e.messageId,E,r).find(e=>"modified"===e.id))}u.syncSelectiveAcceptState({messageId:e.messageId,selections:t,newCheckpointId:o,updatedModifiedVariation:n}),await g?.()},[_,p.editor,p.theme,m.id,u,i,E,e.messageId,g]),o=(0,a.useRef)(!1),s=(0,a.useRef)(null),l=(0,a.useRef)(null),(d=(0,a.useRef)(r)).current=r,(0,a.useEffect)(()=>()=>{if(l.current&&(clearTimeout(l.current),l.current=null),s.current&&!o.current){let e=s.current;s.current=null,d.current(...e).catch(console.error)}},[]),(0,a.useCallback)((...e)=>{s.current=e,l.current&&clearTimeout(l.current),l.current=setTimeout(async()=>{if(!o.current)for(;s.current;){o.current=!0;let e=s.current;s.current=null;try{await d.current(...e)}finally{o.current=!1}}},150)},[150])),D=(0,a.useCallback)(()=>{let e=u.store.getState(),t=e.selectiveAcceptExpandedId;if(!t)return eG;let i=e.selectiveAccept[t];return i?.expanded?i.expanded.selections:eG},[u]),N=(0,a.useCallback)(e=>{u.toggleSuggestionSelection({suggestionId:e}),j.current=e,P(D())},[u,D,P]),R=(0,a.useCallback)(()=>{u.setAllSelections({selection:"original"}),j.current=void 0,P(D())},[u,D,P]),O=(0,a.useCallback)(()=>{u.setAllSelections({selection:"modified"}),j.current=void 0,P(D())},[u,D,P]),B=(0,a.useCallback)(e=>{let t=i.find(t=>t.id===e);t?.focusOriginal(p)},[i,p]),F=(0,a.useCallback)(e=>{let t=i.find(t=>t.id===e);t?.focus(p)},[i,p]);return(0,t.jsxs)(q.Stack,{spacing:4,w:"100%",children:[(0,t.jsxs)(ev.HStack,{spacing:2,children:[(0,t.jsx)(ef.Text,{flex:1,as:"button",fontSize:"xs",fontWeight:"medium",color:"blue.500",cursor:"pointer",textAlign:"start",ps:"24px",onClick:R,_hover:{color:C},children:(0,t.jsx)(H.Trans,{message:"Select all originals",id:"aJW4c+"})}),(0,t.jsx)(ef.Text,{flex:1,as:"button",fontSize:"xs",fontWeight:"medium",color:"blue.500",cursor:"pointer",textAlign:"start",ps:"24px",onClick:O,_hover:{color:C},children:(0,t.jsx)(H.Trans,{message:"Select all edits",id:"8k8gXc"})})]}),(0,t.jsx)(q.Stack,{spacing:4,children:M.map(e=>(0,t.jsxs)(L.Box,{children:[T&&(0,t.jsx)(ef.Text,{fontSize:"xs",fontWeight:"medium",color:y,mb:2,children:e.label}),(0,t.jsx)(q.Stack,{spacing:2,children:e.suggestions.map(e=>(0,t.jsx)(eV,{suggestion:e,beforeCheckpointId:k,afterCheckpointId:A,selectedState:x[e.id]||"modified",onToggle:()=>N(e.id),onFocusOriginal:()=>B(e.id),onFocusModified:()=>F(e.id)},e.id))})]},e.label))}),(0,t.jsx)(ev.HStack,{justify:"flex-end",w:"100%",children:n})]})});e$.displayName="SelectiveAcceptGrid";let eZ=new Set,eK={},eq=({result:e,suggestions:i,ratings:n,collapsedContent:r,showCancelButton:o,cancelRollback:s})=>{let l=(0,c.useBuddyAgent)(),u=(0,eC.useColorModeValue)("blue.800","blue.300"),m=(0,eC.useColorModeValue)("white","elevation.3"),g=(0,eC.useColorModeValue)("blackAlpha.50","whiteAlpha.100"),f=(0,c.useBuddyStore)("chatId"),b=(0,h.useAppSelector)(p.selectDocId),x=(0,c.useBuddyStore)("selectiveAcceptExpandedId"),y=x===e.messageId,v=(0,c.useBuddyStore)("chosenResultVariations")[e.messageId],C=(0,c.useBuddyStore)("selectiveAccept"),w=(()=>{if(!x)return eK;let e=C[x];return e?.expanded?e.expanded.selections:eK})(),S=(0,a.useMemo)(()=>Object.values(w).filter(e=>"modified"===e).length,[w]),k=i.length,A=(0,eA.useFeatureFlag)("buddySelectiveAccept"),E=e.messageId in C,_=A&&i.length>=2&&E;(0,a.useEffect)(()=>{if(!_||eZ.has(e.messageId))return;eZ.add(e.messageId);let t={};for(let e of i)t[e.type]=(t[e.type]??0)+1;(0,d.trackSelectiveAcceptShown)({chatId:f??"",docId:b??void 0,messageId:e.messageId,suggestionCount:i.length,suggestionTypes:t})},[_,e.messageId,f,b,i]);let I=(0,a.useRef)(null),M=(0,a.useRef)(null),T=(0,a.useRef)(y);(0,a.useEffect)(()=>{y&&!T.current?M.current?.focus():!y&&T.current&&I.current?.focus(),T.current=y},[y]);let j=(0,a.useCallback)(()=>{if(y){let t=Object.values(w).filter(e=>"original"===e).length;(0,d.trackSelectiveAcceptCollapsed)({chatId:f??"",docId:b??void 0,messageId:e.messageId,originalCount:t,modifiedCount:S,totalCount:k}),l.saveSelectiveAccept()}else{let t={};for(let e of i)t[e.type]=(t[e.type]??0)+1;(0,d.trackSelectiveAcceptExpanded)({chatId:f??"",docId:b??void 0,messageId:e.messageId,suggestionCount:i.length,suggestionTypes:t}),l.expandSelectiveAccept({messageId:e.messageId,suggestionIds:i.map(e=>e.id),currentVariationId:v||"modified"})}},[y,l,e.messageId,i,v,f,b,w,S,k]),P=(0,t.jsxs)(ev.HStack,{justify:"space-between",w:"100%",pt:4,pb:4,mb:0,position:"sticky",top:-4,bg:m,zIndex:2,_after:{content:'""',position:"absolute",bottom:0,left:0,right:0,height:"16px",bgGradient:`linear(to-b, ${m}, transparent)`,transform:"translateY(100%)",pointerEvents:"none"},children:[(0,t.jsxs)(ev.HStack,{spacing:1,children:[(0,t.jsx)(L.Box,{color:u,children:(0,t.jsx)(ek.FontAwesomeIcon,{icon:ew.faBringForward,fixedWidth:!0,size:"sm"})}),(0,t.jsx)(ef.Text,{fontSize:"sm",fontWeight:"semibold",children:(0,t.jsx)(H.Trans,{message:"Select edits",id:"fzjk3Y"})})]}),(0,t.jsx)(ev.HStack,{spacing:2,children:o?(0,t.jsx)(et.BuddyCancelButton,{variant:"cancel",onClick:s}):_?(0,t.jsxs)(ev.HStack,{ref:I,as:"button",role:"button",tabIndex:0,"aria-expanded":y,onClick:j,spacing:1,fontSize:"xs",color:"blue.500",cursor:"pointer",borderRadius:"md",px:1.5,py:.5,_hover:{bg:g},children:[(0,t.jsx)(ef.Text,{fontWeight:"medium",children:y?(0,t.jsx)(H.Trans,{message:"{selectedCount}/{totalCount} changes",id:"hkNzlV",values:{selectedCount:S,totalCount:k}}):(0,t.jsx)(H.Trans,{message:"{totalCount} changes",id:"8fANS4",values:{totalCount:k}})}),(0,t.jsx)(L.Box,{as:"span",transform:y?"rotate(-180deg)":void 0,transition:"transform 0.2s",display:"flex",alignItems:"center",children:(0,t.jsx)(ek.FontAwesomeIcon,{icon:eS.faChevronDown,size:"xs"})})]}):null})]});return y?(0,t.jsxs)(t.Fragment,{children:[P,(0,t.jsx)(L.Box,{ref:M,tabIndex:-1,children:(0,t.jsx)(e$,{result:e,suggestions:i,ratings:n})})]}):(0,t.jsxs)(q.Stack,{spacing:4,children:[P,r,(0,t.jsx)(ev.HStack,{justify:"flex-end",w:"100%",children:n})]})},eY=({result:e,showCancelButton:i,cancelRollback:n,onGoBack:r,state:o,ratings:s,suggestions:l})=>{let d,u,p,h,m,g,f,b=(0,c.useBuddyStore)("isLoading"),x=(d=(0,c.useBuddyStore)("selectiveAccept"),u=d[e.messageId]?.savedSelections??void 0,p=e.variations.find(e=>"original"===e.id)?.toApplyCheckpointId,h=e.variations.find(e=>"modified"===e.id)?.toApplyCheckpointId,m=(0,c.useBuddyStore)("checkpoints"),g=p?m[p]:void 0,f=h?m[h]:void 0,(0,a.useMemo)(()=>(0,Q.getAppliedChangesDisplayVariations)({result:e,suggestions:l,savedSelections:u,beforeCheckpoint:g,afterCheckpoint:f}),[f,g,e,u,l]));return"done"===o?(0,t.jsx)(ey.MessageResultHeader,{title:e.title,children:(0,t.jsx)(Y.Tooltip,{label:(0,t.jsx)(H.Trans,{message:"Wait for {GAMMA_AGENT_PROPER_NOUN} to finish",id:"b29QuD",values:{GAMMA_AGENT_PROPER_NOUN:ee.GAMMA_AGENT_PROPER_NOUN}}),isDisabled:!b,placement:"top",children:(0,t.jsx)(et.BuddyCancelButton,{variant:"go-back",onClick:r,disabled:b})})}):(0,t.jsx)(q.Stack,{align:"space-between",w:"100%",children:(0,t.jsx)(eq,{result:e,suggestions:l,ratings:s,showCancelButton:i,cancelRollback:n,collapsedContent:(0,t.jsx)(K.SimpleGrid,{columns:2,spacing:1,children:x.map((e,i)=>{switch(e.previewType){case J.BuddySuggestionPreviewType.Doc:return(0,t.jsx)(ex,{variation:e},i);case J.BuddySuggestionPreviewType.Card:return(0,t.jsx)(eg,{variation:e},i);case J.BuddySuggestionPreviewType.Image:return(0,t.jsx)(X.MessageResultImageVariation,{variation:e},i);default:return null}})})})})},eX=({message:e,lastUserMessage:i,result:n,state:r,cancelRollback:o,onGoBack:s,chatId:l,docId:d})=>{let u="rolling-back"===r,p=(0,c.useBuddyStore)("suggestions"),m=(0,a.useMemo)(()=>"applied-changes"!==n.type?[]:(n.suggestionIds??[]).map(e=>p[e]).filter(Boolean),[n,p]),g=(0,t.jsx)(e0,{chatId:l,result:n,message:e,lastUserMessage:i,docId:d}),f=(0,h.useAppSelector)(Z.selectTheme),b=(0,$.useSetTheme)();return"suggest-themes"===n.type?(0,t.jsx)(G.SuggestThemesMessageResult,{result:n,state:r,currentThemeId:f?.id,onThemeClick:b,ratings:g}):"applied-changes"===n.type?(0,t.jsx)(eY,{result:n,showCancelButton:u,cancelRollback:o,state:r,onGoBack:s,ratings:g,suggestions:m}):"image-artifact"===n.type?(0,t.jsx)(V.ImageArtifactMessageResult,{result:n,ratings:g}):null},eQ=[{key:"instructions",label:(0,t.jsx)(H.Trans,{message:"Didn't follow prompt",id:"Tq32Jp"})},{key:"incorrect-information",label:(0,t.jsx)(H.Trans,{message:"Incorrect information",id:"UZQ7Jv"})},{key:"too-many-changes",label:(0,t.jsx)(H.Trans,{message:"Too many changes",id:"YI0lXP"})},{key:"formatting",label:(0,t.jsx)(H.Trans,{message:"Bad formatting",id:"TO8fPE"})}],eJ=(e,t,i)=>{let n=e.parts.filter(l.isStaticToolUIPart),a=n.map(e=>(0,l.getToolName)(e)).reduce((e,t)=>(e[t]=(e[t]??0)+1,e.all+=1,e),{all:0}),r=i?.parts.find(l.isTextUIPart)?.text??"";return{toolInvocations:n,toolCount:a,interactionId:t.interactionId??t.messageId,messageId:t.messageId,userMessage:r}},e0=a.default.memo(({result:e,message:i,lastUserMessage:n,chatId:r,docId:o})=>{let[s,l]=(0,a.useState)(null),u=(0,c.useBuddyStore)("editor"),{toolInvocations:p,toolCount:h,userMessage:m,messageId:g,interactionId:f}=eJ(i,e,n),b=(0,a.useCallback)(e=>{l(e),(0,d.trackBuddyResultRating)({toolInvocations:p,toolCount:h,interactionId:f,messageId:g,userMessage:m,chatId:r,rating:e,agentType:"Buddy"})},[r,p,h,m,g,f]),x=(0,a.useCallback)((e,t,i)=>{let n=(0,U.uploadDeckToDatadog)(u);(0,d.trackBuddyResultFeedback)({chatId:r,toolInvocations:p,toolCount:h,rating:e,feedback:t,userMessage:m,messageId:g,interactionId:f,tags:i,agentType:"Buddy",ddLogUrl:(0,U.getDeckContentLogUrl)(n),ddTraceUrl:(0,U.getBuddyTraceUrl)(o)})},[r,p,h,m,g,f,o,u]);return(0,t.jsx)(W.ThumbsRating,{setRating:b,RatingButtons:W.ImageRatingButtons,size:"xs",rating:s??void 0,trackFeedback:x,feedbackTags:eQ})});e0.displayName="MessageResultRatings";var e1=e.i(198311);let e2=(0,e1.motion)(ev.HStack),e3=({children:e,isLast:i,isOnlyPart:n,showToggle:o=!0,startOpen:s=!1,showVerticalLine:l=!0})=>{let[d,c]=(0,a.useState)(s),[u,p]=(0,a.useState)(s),[h,m]=(0,a.useState)(-1),[g,f]=(0,a.useState)(-1),b=(0,a.useRef)(null),x=(0,eC.useColorModeValue)("gray.700","gray.300"),y=(0,eC.useColorModeValue)("gray.400","gray.500"),v=(0,eC.useColorModeValue)("gray.200","gray.600");(0,a.useEffect)(()=>{b.current&&f(1.5*parseFloat(window.getComputedStyle(b.current).fontSize))},[1.5]);let C=-1===g||-1===h||h>g,w=!!(o&&!n&&!i&&C);(0,a.useEffect)(()=>{n||s?(p(!0),c(!0)):c(!1)},[n,s]);let S=(0,a.useCallback)(()=>{w&&c(e=>{let t=!e;return t&&p(!0),t})},[w]),k="function"==typeof e?e({isOpen:u,toggleCollapse:S,onContentHeightChange:m}):e;return(0,t.jsx)(r.Flex,{position:"relative",_before:i||!l?{}:{content:"''",position:"absolute",w:"1px",top:8,bottom:-3,insetStart:"6px",bg:v,borderRadius:"none",overflow:"visible"},py:2,w:"100%",children:(0,t.jsxs)(e2,{ref:b,cursor:w?"pointer":"inherit",color:d||!C?x:y,_hover:w?{color:x}:{},transitionProperty:"common",transitionDuration:"normal",w:"100%",alignItems:"flex-start",overflow:"hidden",minH:"1.5em",initial:{height:s?"auto":"1.5em"},animate:{height:d||i?"auto":"1.5em"},onAnimationComplete:()=>{p(d)},children:[k,w&&(0,t.jsx)(L.Box,{as:"span",position:"absolute",insetEnd:0,fontSize:"sm",transform:d?"rotate(-180deg)":void 0,transition:"transform 0.2s",onClick:S,children:(0,t.jsx)(ek.FontAwesomeIcon,{size:"sm",icon:ew.faChevronDown})})]})})},e5=({message:e,chatId:i,messageIndex:n,goBackToMessage:r,isLast:s,lastUserMessage:l,editor:d,...u})=>{let p=(0,c.useBuddyStore)("rollingBack"),h=p?.messageIndex,m=(0,c.useBuddyStore)("results")[e.id],g="done";h===n?g="rolling-back":s&&(g="current");let f=(0,b.useCancelRollback)(),x=(0,a.useCallback)(()=>{r(e)},[r,e]),y=(0,O.compressMessageParts)(e.parts.map(e4).filter(e=>"unknown"!==e.type&&"ignored"!==e.type),(e,t)=>({type:"tool-invocation-success",successText:z.COMPRESSED_TOOL_INVOCATIONS[e].past(t.length),compressKey:e,artifact:{type:"image",images:t.flatMap(e=>e.artifact?.images??[])},toolInvocations:t.flatMap(e=>e.toolInvocations)}));return(0,t.jsx)(o.VStack,{...R.CHAT_BUBBLE_BASE_STYLE,p:0,alignSelf:"flex-start",width:"100%",position:"relative",align:"start",fontSize:"sm",...u,children:(0,t.jsxs)(o.VStack,{width:"100%",align:"start",spacing:2,p:2,children:[y.map((e,i)=>{let n=m?i===y.length:i===y.length-1,a=1===y.length&&!m;if("aborted"===e.type)return(0,t.jsx)(e3,{isLast:n,isOnlyPart:a,children:(0,t.jsx)(F.BuddyToolInvocationAborted,{})},i);if("text"===e.type)return(0,t.jsx)(e3,{isLast:n,isOnlyPart:a,startOpen:n,children:({isOpen:i,toggleCollapse:n,onContentHeightChange:r})=>(0,t.jsx)(F.BuddyToolInvocationText,{part:e,isOpen:i,isOnlyPart:a,toggleCollapse:n,onContentHeightChange:r})},i);if("tool-invocation-in-progress"===e.type)return(0,t.jsx)(e3,{isLast:n,isOnlyPart:a,showToggle:!1,children:(0,t.jsx)(F.BuddyToolInvocationInProgress,{part:e})},`${e.toolInvocation.toolCallId}-result`);if("tool-invocation-success"===e.type){let r=!!e.artifact?.images?.length;return(0,t.jsx)(e3,{isLast:n,isOnlyPart:a,showToggle:r,startOpen:r,children:({toggleCollapse:i})=>(0,t.jsx)(F.BuddyToolInvocationSuccess,{part:e,editor:d,toggleCollapse:i})},`${i}-success`)}if("tool-invocation-error"===e.type)return(0,t.jsx)(e3,{isLast:n,showToggle:!1,isOnlyPart:a,startOpen:!0,children:(0,t.jsx)(F.BuddyToolInvocationError,{part:e})},`${i}-error`);return null}),m&&(0,t.jsx)(eX,{chatId:i,message:e,lastUserMessage:l,result:m,state:g,onGoBack:x,cancelRollback:f,docId:d?.gammaDocId??""})]})})};function e4(e){if("text"===e.type)return"USER_ABORTED"===e.text?{type:"aborted"}:{type:"text",text:e.text};if((0,l.isStaticToolUIPart)(e)){let t=(0,z.getBuddyToolText)((0,l.getToolName)(e));return"input-streaming"===e.state||"input-available"===e.state?{type:"tool-invocation-in-progress",inProgressText:t.present(),toolInvocation:e}:(0,B.isBuddyToolError)(e)?{type:"tool-invocation-error",errorText:e.output.error,toolInvocation:e}:"output-error"===e.state?{type:"tool-invocation-error",errorText:e.errorText,toolInvocation:e}:(0,B.isBuddyToolSuccess)(e)?{type:"tool-invocation-success",successText:t.past(),artifact:e8(e)??void 0,toolInvocations:[e],compressKey:t.compressKey}:(console.error("Unknown tool invocation state",e),{type:"unknown"})}return"step-start"===e.type?{type:"ignored"}:(console.error("Unknown part type",e),{type:"unknown"})}let e6=N.z.object({attrs:N.z.object({source:N.z.string(),src:N.z.string(),tempUrl:N.z.string().optional(),query:N.z.string().optional(),meta:N.z.object({}).passthrough(),aiParams:N.z.object({}).passthrough().optional()})}),e9=N.z.object({status:N.z.literal("success"),images:N.z.array(e6).optional(),image:e6.optional()});function e8(e){let t=e9.safeParse(e.output);if(!t.success)return null;let i=[];return t.data.images&&i.push(...t.data.images.map(e=>e.attrs)),t.data.image&&i.push(t.data.image.attrs),{type:"image",images:i}}var e7=e.i(864860),te=e.i(896620),tt=e.i(477245),ti=e.i(346312);e.i(297036);var tn=e.i(534316),ta=e.i(902349),tr=e.i(321791);let to=(0,e1.motion)(q.Stack),ts=({message:e})=>{let i,n=e.parts.find(l.isTextUIPart),a=n?.text?.replace("the current deck is ","")??"";try{i=JSON.parse(a)}catch(e){i=null}return(0,t.jsxs)(q.Stack,{children:[(0,t.jsx)(ta.DebugModalButton,{buttonText:"Current Deck",debugTitle:"Current Deck",debugObject:i||{error:"Failed to parse current deck JSON",rawContent:a}}),i&&(0,t.jsxs)(ef.Text,{fontSize:"xs",fontWeight:"bold",children:["docHtml.type: ",i.docHtml.type]}),i&&"selection"in i&&(0,t.jsxs)(q.Stack,{fontSize:"xs",wordBreak:"break-all",overflowY:"auto",width:"250px",children:[(0,t.jsx)(ef.Text,{fontSize:"xs",fontWeight:"bold",children:"Selection"}),Object.entries(i.selection||{}).map(([e,i],n)=>(0,t.jsxs)(L.Box,{children:[(0,t.jsx)("b",{children:e}),(0,t.jsx)("br",{}),JSON.stringify(i,null,2)]},n))]})]})},tl=({url:e,name:i})=>{let{isZoomed:n,enterZoom:r,exitZoom:o}=(0,tn.useMediaZoom)(e),s=(0,a.useCallback)(()=>{r()},[r]);return(0,t.jsxs)(L.Box,{position:"relative",flexShrink:0,children:[(0,t.jsx)(ez.ImageOrVideo,{src:e,alt:i,boxSize:"64px",objectFit:"cover",borderRadius:"md",border:"1px solid",borderColor:"gray.200",cursor:"zoom-in",onClick:s,resizeParams:ez.THUMBNAIL_RESIZE_PARAMS}),(0,t.jsx)(tt.BuddyZoomableOverlay,{isZoomed:n,exitZoom:o,src:e,alt:i??""})]})},td=({name:e,defaultName:i,badgeLabel:n})=>{let a=e||i;return(0,t.jsxs)(r.Flex,{boxSize:"64px",borderRadius:"md",border:"1px solid",borderColor:"gray.200",bg:"gray.50",display:"flex",flexDir:"column",p:2,flexShrink:0,children:[(0,t.jsx)(te.GammaTooltip,{label:a,placement:"top",openDelay:500,children:(0,t.jsx)(ef.Text,{fontSize:"xxs",fontWeight:"semibold",noOfLines:1,children:a})}),(0,t.jsx)(e7.Spacer,{}),(0,t.jsx)(ev.HStack,{children:(0,t.jsx)(ei.Badge,{fontSize:"xxs",colorScheme:"gray",children:n})})]})},tc=({message:e,shouldAnimate:i=!0,...n})=>{let a=(0,eA.useFeatureFlag)("buddyDebug"),s=(0,eC.useColorModeValue)("spacedust.50","elevation.4"),d=(0,eC.useColorModeValue)("gray.600","gray.300");if(e.id.startsWith("generation-brief-")){if(!a)return null;let i=e.parts.find(l.isTextUIPart)?.text??"No brief content";return(0,t.jsx)(o.VStack,{...R.CHAT_BUBBLE_BASE_STYLE,...n,bg:s,color:d,maxW:"90%",alignSelf:"flex-end",borderBottomEndRadius:"0",align:"start",children:(0,t.jsx)(ta.DebugModalButton,{buttonText:"Generation Brief",debugTitle:"Generation Brief",debugObject:{brief:i}})})}if(e.id.startsWith("current-deck"))return a?(0,t.jsx)(o.VStack,{...R.CHAT_BUBBLE_BASE_STYLE,...n,bg:s,color:d,maxW:"90%",alignSelf:"flex-end",borderBottomEndRadius:"0",align:"start",children:(0,t.jsx)(ts,{message:e})}):null;let c=e.parts.filter(l.isFileUIPart).filter(e=>(0,ti.isImageMimeType)(e.mediaType)||(0,ti.isPdfMimeType)(e.mediaType)||(0,ti.isCsvMimeType)(e.mediaType)),u=c.find(e=>"selected-image"===e.filename&&(0,ti.isImageMimeType)(e.mediaType)),p=c.filter(e=>"selected-image"!==e.filename),h=p?.length>0,m=e.parts.find(l.isTextUIPart)?.text??"";return(0,t.jsxs)(to,{initial:i?{opacity:0,y:10,scale:.9}:{},animate:i?{opacity:1,y:0,scale:1}:{},exit:i?{opacity:0}:{},transition:{duration:.3,ease:"easeOut"},transitionOrigin:"right",alignSelf:"flex-end",w:"100%",children:[u&&(0,t.jsx)(r.Flex,{justifyContent:"flex-end",w:"100%",children:(0,t.jsx)(tl,{url:u.url,name:u.filename})}),(0,t.jsxs)(q.Stack,{...R.CHAT_BUBBLE_BASE_STYLE,...n,bg:s,color:d,w:h?"100%":"auto",maxW:"95%",alignSelf:"flex-end",borderBottomEndRadius:"0",align:"start",children:[(0,t.jsx)(ef.Text,{children:m}),h&&(0,t.jsx)(tr.CollapsibleMediaRowWrapper,{label:(0,t.jsx)(H.Trans,{message:"{0, plural, one {# file uploaded} other {# files uploaded}}",id:"j5jwnX",values:{0:p.length}}),icon:ew.faPaperclip,isCollapsedByDefault:!0,w:"100%",children:p.map(e=>(0,ti.isPdfMimeType)(e.mediaType)?(0,t.jsx)(td,{name:e.filename,defaultName:"document.pdf",badgeLabel:"PDF"},e.url):(0,ti.isCsvMimeType)(e.mediaType)?(0,t.jsx)(td,{name:e.filename,defaultName:"data.csv",badgeLabel:"CSV"},e.url):(0,t.jsx)(tl,{url:e.url,name:e.filename},e.url))})]})]})},tu=(0,a.memo)(e=>(0,t.jsx)(L.Box,{flex:1,width:"100%",...e}));tu.displayName="Spacer";let tp=({chatId:e,messages:i,goBackToMessage:n,isReceivingMessages:r,clearMessages:s,editor:l})=>{let d=(0,c.useBuddyStore)("rollingBack"),u=d?.messageIndex,{scrollToRef:p,scrollContainerRef:h}=(0,P.useChatMessagesAutoScroll)({isReceivingMessages:r,messagesLength:i.length}),m=(0,a.useRef)(null);return null==m.current&&(m.current=new Set((i||[]).filter(e=>"user"===e.role).map(e=>e.id))),(0,t.jsxs)(o.VStack,{ref:h,fontSize:"14px",spacing:4,px:0,width:"100%",height:"100%",alignItems:"stretch",justifyContent:"start",flex:1,p:2,pb:0,overflowY:"auto",position:"relative",children:[i.map((a,r)=>{if(null!=u&&u0&&"user"===i[r-1].role&&(o=i[r-1]),(0,t.jsx)(e5,{chatId:e,message:a,messageIndex:r,goBackToMessage:n,isLast:r===i.length-1,lastUserMessage:o,editor:l},a.id)}if("user"===a.role){let e=!m.current.has(a.id);return(0,t.jsx)(tc,{message:a,shouldAnimate:e},a.id)}return null}),0===i.length&&(0,t.jsx)(j.BuddyChatEmptyState,{}),(0,t.jsx)(tu,{minHeight:"20px"}),(0,t.jsx)(D.BuddyBottomNotification,{clearMessages:s,position:"sticky",bottom:0,insetEnd:2,insetStart:2,mb:-4,w:"calc(100% - var(--chakra-space-4))"}),(0,t.jsx)("div",{ref:p})]})},th=(0,a.memo)(({closePanel:e,isDark:i,hideHeaderCloseButton:n=!1,hideFooter:l=!1,...d})=>{let _=(0,c.useBuddyAgent)(),L=(0,c.useBuddyStore)("messages"),j=(0,c.useBuddyStore)("status"),P=(0,c.useBuddyStore)("pendingToolCount"),D=(0,c.useBuddyStore)("totalTokensUsed"),N=(0,c.useBuddyStore)("editor"),R=(0,h.useAppSelector)(p.selectDocId),{disabledReason:O}=(0,S.useBuddyNotificationState)(),{progress:B,showGenerationProgress:z,resetProgress:F}=(0,x.useBuddyGenerationProgress)();(0,f.useFetchAndStoreThemePickerData)();let H=(0,g.useAnalytics)(),W=_.chatId,U=(0,c.useBuddyStore)("queuedMessage"),V="submitted"===j||"streaming"===j,{bottomInsetPx:G}=(0,u.useSheetOcclusion)();(0,y.useBuddyCardsInView)(N,{bottomInsetPx:G});let{markFinish:$}=(0,E.useBuddyTestCase)({reload:_.chat.regenerate,setMessages:_.chat.setMessages.bind(_.chat),isLoading:V});(0,a.useEffect)(()=>_.chat.on("finish",$),[_,$]),(0,w.useBuddyDebug)(L,()=>(0,A.serializeBuddyState)(_.store.getState()));let Z=(0,a.useCallback)(async()=>{_.flushSave()},[_]),K=(0,a.useMemo)(()=>({saveCurrentChat:Z}),[Z]),q=(0,a.useCallback)(()=>{H?.track(m.SegmentEvents.BUDDY_CHAT_CLEARED,{chatId:W,docId:R})},[H,W,R]),Y=(0,C.useBuddyClear)(q),X=(0,a.useCallback)(()=>{Y()},[Y]),Q=(0,b.useGoBackToTool)(L),J=tm(L),ee=(0,a.useCallback)(({input:e,uploadedFiles:t,keepHistory:i,context:n})=>{if(!N)return;F(),J(e),_.chat.interaction.start({docId:R});let{attachments:a}=_.sendMessage({input:e,uploadedFiles:t,keepHistory:i,context:n});_.chat.interaction.setAttributes({input:{content:e,attachments:a}})},[N,F,J,_,R]);(0,k.useQueuedMessageDrainer)({agent:_,queuedMessage:U,disabledReason:O,status:j,pendingToolCount:P,doSubmit:ee});let et=(0,a.useCallback)(async()=>{await _.stop()},[_]);return N?(0,t.jsx)(v.BuddyChatSaveContext.Provider,{value:K,children:(0,t.jsx)(s.DarkModeProvider,{isDark:i,children:(0,t.jsxs)(r.Flex,{direction:"column",w:"100%",h:"100%","data-testid":"buddy-chat-right-panel",children:[(0,t.jsx)(M.BuddyChatHeader,{onClose:e,onNewChat:X,hideCloseButton:n}),(0,t.jsx)(r.Flex,{direction:"column",h:"100%",overflowY:"auto",overflowX:"hidden",className:"buddy-scroll",w:"100%",children:(0,t.jsxs)(o.VStack,{...d,justifyContent:"space-between",align:"stretch",position:"relative",height:"100%",spacing:0,overflowY:"hidden",children:[z?(0,t.jsx)(I.GenerationProgressMessages,{progress:B}):(0,t.jsx)(tp,{chatId:W,messages:L,goBackToMessage:Q,isReceivingMessages:V,clearMessages:X,editor:N??void 0}),!l&&(0,t.jsx)(T.ChatFooter,{status:j,messages:L,handleNewChat:X,manualSubmit:(e,t)=>ee({input:e,uploadedFiles:t,keepHistory:!0}),handleStop:et,editor:N,lastTokensUsed:D})]})})]})})}):null}),tm=e=>{let t=(0,c.useBuddyAgent)(),i=(0,h.useAppSelector)(p.selectDocId);return(0,a.useCallback)(n=>{let a=t.store.getState(),r=a.chatId,o=(0,_.getLastMessage)(e,"assistant");if(!o)return;let s=a.results[o.id];if(!s)return;let c=a.chosenResultVariations[s.messageId],u=s?.type==="applied-changes"?s.variations.find(e=>e.id===(c??"modified")):void 0,p=u?.id==="modified",h=a.rollingBack,m=(0,_.getLastMessage)(e,"user")?.parts.find(l.isTextUIPart)?.text||"";if(s.messageId===o.id&&"applied-changes"===s.type&&!h){let e=function(e,t){let i=e.selectiveAccept[t];if(i){if(e.selectiveAcceptExpandedId===t&&i.expanded){let e=Object.values(i.expanded.selections);return{selectiveAcceptOriginalCount:e.filter(e=>"original"===e).length,selectiveAcceptModifiedCount:e.filter(e=>"modified"===e).length,selectiveAcceptTotalCount:e.length}}if(i.savedSelections){let e=Object.values(i.savedSelections);return{selectiveAcceptOriginalCount:e.filter(e=>"original"===e).length,selectiveAcceptModifiedCount:e.filter(e=>"modified"===e).length,selectiveAcceptTotalCount:e.length}}if(i.originalModifiedVariation){let i=e.results[t];if(i?.type==="applied-changes"&&i.suggestionIds){let n=i.suggestionIds.length,a="original"===e.chosenResultVariations[t];return{selectiveAcceptOriginalCount:a?n:0,selectiveAcceptModifiedCount:a?0:n,selectiveAcceptTotalCount:n}}}}}(a,s.messageId);(0,d.trackBuddyResultRatedImplicit)({isImplicit:!0,selectedVariant:p?"modified":"original",agentType:"Buddy",chatId:r,docId:i,...eJ(o,s),triggeringUserMessage:n,lastUserMessage:m,selectiveAccept:e})}},[t,i,e])};th.displayName="Toolbar",e.i(312434),e.i(487914);var tg=e.i(15464),tf=e.i(440721),tb=e.i(283591),tx=e.i(49202),ty=e.i(615393),tv=e.i(171084),tC=e.i(412809);let tw="buddy-blocked-send-busy",tS="buddy-blocked-send-credits",tk=({closePanel:e})=>{let i=(0,tb.useIsThemeDark)(),n=(0,c.useBuddyIsReady)();return(0,g.useAnalyticsEffect)(e=>{e.track(m.SegmentEvents.BUDDY_CHAT_PANEL_OPENED)},[]),(0,t.jsx)(tf.Panel,{bgColor:i?"elevation.3":"white",w:"100%",color:i?"white":"titanium.900",children:n?(0,t.jsx)(th,{closePanel:e,isDark:i}):null})};tk.panelPosition="right",tk.panelName="buddy-chat",tk.canCollapse=!1,tk.minWidth=400,tk.alwaysDocked=!0,tk.dontCloseOnEscape=!0,tk.canClose=()=>!0;let tA=()=>{let e=(0,h.useAppSelector)(Z.selectMode),t=(0,h.useAppSelector)(Z.selectIsAllowedToEdit),r=(0,h.useAppSelector)(p.selectDocId),o=(0,i.useToast)(),{creditWarning:s}=(0,S.useBuddyNotificationState)(),l=e!==ty.EditorModeEnum.SLIDE_VIEW&&t,{togglePanel:d,isPanelOpen:c}=(0,tg.useTogglePanel)(tk,l),u=(0,a.useRef)(r);u.current=r;let m=(0,a.useRef)(s);return m.current=s,(0,a.useEffect)(()=>tx.TiptapEventBus.on("queueBuddyEditMessage",e=>{let t={message:e.message,uploadedFiles:e.uploadedFiles||[],context:e.context},i=(0,tC.selectActiveBuddyAgent)((0,h.getStore)().getState());if(i&&i.docId===u.current){let e=m.current?.isBlocking?m.current:null;if(e)o.isActive(tS)||o({id:tS,title:e.title,description:e.subtitle,position:"top",status:e.status,duration:5e3});else{let{status:e,pendingToolCount:t}=i.store.getState();("ready"!==e||t>0)&&"error"!==e&&!o.isActive(tw)&&o({id:tw,title:n.i18n._({id:"cii4bX",message:"AI request in progress"}),description:n.i18n._({id:"wqxsb/",message:"Please wait for the current AI request to finish."}),position:"top",status:"warning",duration:5e3})}i.setQueuedMessage(t)}else u.current&&tv.BuddyPendingOperations.queueMessage(u.current,t);d({disableTransition:!0,override:"open"})}),[o,d]),{toggleBuddyChatPanel:d,isBuddyChatPanelOpen:c}}},435674,e=>{"use strict";e.s(["useImageStateForMenu",()=>s]);var t=e.i(191788),i=e.i(558247),n=e.i(144621),a=e.i(255664),r=e.i(15272),o=e.i(160396);let s=({editor:e,node:s,decorations:l})=>{let d=s.attrs,{src:c,tempUrl:u}=d,p=(0,i.useCanEditImageWithAI)(d);return(0,t.useMemo)(()=>{let t=(0,a.isFootnoteEditor)(e),i=(0,r.isNodeViewInGallery)({decorations:l}),s=(0,o.isSVGUrl)(c||u||void 0),d=(0,o.isMp4Url)(c||u||void 0),{isNested:h}=(0,n.findCardPluginDecoration)(l);return{inFootnote:t,inGallery:i,isImageSVG:s,isImageMp4:d,isInNestedCard:h,cropResizeAndAlignmentEnabled:!i&&!t&&!d,canEditImageWithAI:p}},[e,c,u,l,p])}},154217,e=>{"use strict";e.s(["ImageView",()=>ee],154217);var t=e.i(391398),i=e.i(428683),n=e.i(357790);e.i(314572);var a=e.i(835128),r=e.i(717834),o=e.i(191788);e.i(144786);var s=e.i(731378),l=e.i(783197),d=e.i(297194),c=e.i(418755),u=e.i(750526),p=e.i(19654),h=e.i(551880);e.i(905506);var m=e.i(274970),g=e.i(160396),f=e.i(550963),b=e.i(194552),x=e.i(255664),y=e.i(196444),v=e.i(932132),C=e.i(820773),w=e.i(15272),S=e.i(604956),k=e.i(485992),A=e.i(529545),E=e.i(329860);e.i(297036);var _=e.i(534316),I=e.i(456389),M=e.i(263726),T=e.i(159911),L=e.i(495433),j=e.i(543315),P=e.i(59936),D=e.i(210956),N=e.i(316353),R=e.i(571790),O=e.i(502585),B=e.i(524473),z=e.i(575084),F=e.i(358280),H=e.i(755453),W=e.i(584139),U=e.i(103104),V=e.i(786928);e.i(419217);var G=e.i(202545),$=e.i(922712),Z=e.i(103630),K=e.i(864935),q=e.i(204319),Y=e.i(555027),X=e.i(435674),Q=e.i(313399),J=e.i(753748);let ee=({...e})=>{let{node:ee,editor:et,selected:ei,decorations:en,getPos:ea,updateAttributes:er}=e,eo=ei||(0,y.isSelectingNode)(en),{src:es,tempUrl:el,uploadStatus:ed,meta:ec,showPlaceholder:eu,horizontalAlign:ep,resize:eh,id:em,href:eg,clickBehavior:ef,source:eb}=ee.attrs,ex=eh?.width||ec?.width,ey=(0,g.isSVGUrl)(es||el),ev=(0,g.isGifUrl)(es||el)||(ec?.frame_count??0)>1,eC=ec?.has_transparency,ew=ed===d.UploadStatus.Uploading,eS=(0,f.isIconSource)(eb),{isFullBleed:ek}=(0,v.findFullBleedDecoration)(en),eA=(0,w.isNodeViewInGallery)(e),eE=eA||ek,e_=(0,w.isNodeViewInGridGallery)(e),eI=(0,w.isNodeViewInLogoGallery)(e),eM=(0,y.isFocusedAndEditable)(en),eT=(0,c.useAppSelector)(h.selectEditable),eL=(0,x.isFootnoteEditor)(et),{colors:ej,isDark:eP,cardColor:eD}=(0,Q.useRecoloredImage)({src:es,tempUrl:el,decorations:en}),{imageWrapperRef:eN,isResizing:eR,setIsResizing:eO,resizeableSx:eB,alignStyles:ez}=(({editor:e,horizontalAlign:t})=>{let i=(0,K.getAlignStyles)(t),{ref:n,isResizing:a,setIsResizing:r,resizeableSx:o}=(0,A.useResizeable)(e);return{imageWrapperRef:n,isResizing:a,setIsResizing:r,resizeableSx:o,alignStyles:i}})({editor:et,horizontalAlign:ep}),eF=eT?"expand":(0,E.getImageClickBehavior)(ef),eH="newTab"===eF&&!!eg,eW=(0,c.useAppSelector)(s.selectShowDebugCardView),{enterZoom:eU}=(0,_.useMediaZoom)(em),{width:eV,height:eG,aspectRatio:e$,containerWrapperRef:eZ,imageRef:eK,setSize:eq}=(0,R.useSetSize)();(0,a.useTiptapEditorEffect)(e=>N.eventEmitter.on("startCrop",({id:t})=>{em===t&&(eq(),requestAnimationFrame(()=>{e.commands.refreshBubbleMenu?.()}))}),[em,eq]);let eY=eN.current&&eM&&!eE&&!eL,eX=eN.current&&!eE&&!eL,eQ=(0,r.useTiptapEditorEventCallback)((e,t)=>{er({...ee.attrs,resize:{...ee.attrs.resize,...t}})}),eJ=(0,m.useWindowResizing)(),e0=(0,c.useAppSelector)((0,J.selectIsIdCropping)(em)),{confirmCrop:e1}=(0,D.useCroppingControls)(et);(0,a.useTiptapEditorEffect)(e=>{e0&&!eo&&em&&e1({id:em}),eo||(eO(!1),e.commands.forceHideBubbleMenu?.(!1))},[eo,e0,em,e1,eO]),(0,a.useTiptapEditorEffect)(()=>{if("image.custom"===eb&&!eh?.width&&ec?.width&&ec?.height){let e=(0,n.calculateResizeToFitViewport)({width:ec.width,height:ec.height,viewportHeight:window.innerHeight});e&&er({resize:e})}},[eb,eh,ec,er]);let e2=(0,o.useCallback)(()=>{eo&&et.commands.refreshBubbleMenu?.()},[eo,et]),e3=ee.attrs,{contextMenuItems:e5}=(({editor:e,node:i,getPos:n,decorations:a})=>{let r=i.attrs,{resize:s,id:d,clickBehavior:c}=r,u=(0,E.getImageClickBehavior)(c),{startCrop:p}=(0,D.useCroppingControls)(e),h=(0,o.useCallback)(()=>{let t=n();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.chain().deleteSelectionAndSelectNear().run())},[e,n]),m=(0,V.useToggleMediaDrawer)(),g=(0,o.useCallback)(t=>{e.commands.updateAttributes(G.Image.name,{clickBehavior:t})},[e]),{inFootnote:f,inGallery:b,isInNestedCard:x,cropResizeAndAlignmentEnabled:y,canEditImageWithAI:v}=(0,X.useImageStateForMenu)({editor:e,node:i,decorations:a}),{toggleBuddyChatPanel:C,isBuddyChatPanelOpen:S}=(0,W.useToggleBuddyChatPanel)(),k=(0,o.useCallback)(()=>{let t=n();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.commands.convertImageToImageCard())},[e,n]),A=(0,o.useCallback)(t=>{let i=n();if("number"!=typeof i)return;let a=e.state.doc.resolve(i),o=(0,H.findParentNodeClosestToPos)(a,Z.isCardNode);o&&"number"==typeof o.pos&&(e.commands.selectNodeAtPos(i),(0,q.setCardLayoutWithImageFromPos)({editor:e,cardPos:o.pos,attrs:r,layout:t}))},[e,r,n]),_=(0,$.useEditorContextMenuItems)({editor:e,node:i,getPos:n,imageSrc:i.attrs.src}),{imageCardActionsMenuItems:I}=(0,Y.useImageCardActionsMenuItems)({disabled:f,canSetAsAccent:!x,onTurnIntoCard:k,onSetCardLayout:A}),M=(0,l.useIsThumbnailView)();return{contextMenuItems:(0,o.useMemo)(()=>M?[]:[..._,{divider:!0},{key:"edit-image",label:(0,t.jsx)(F.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:B.faEdit,onClick:t=>{e.view.focus(),m({isOpen:!0}),t.stopPropagation()}},...v&&!f?[{key:"ask-ai",label:(0,t.jsx)(F.Trans,{message:"Edit with {AGENT_PROPER_NOUN}...",id:"IzVrMk",values:{AGENT_PROPER_NOUN:U.AGENT_PROPER_NOUN}}),icon:z.faSparkles,onClick:()=>{S||C()}}]:[],...y?[{key:"crop",label:(0,t.jsx)(F.Trans,{message:"Crop",id:"qKx+US"}),icon:B.faCrop,onClick:()=>{if(!d)return;let t=n();"number"==typeof t&&(e.commands.selectNodeAtPos(t),p({id:d,clipType:s?.clipType}))}}]:[],...(0,q.hasFormattingApplied)(i)?[{key:"reset-formatting",label:(0,t.jsx)(F.Trans,{message:"Reset formatting",id:"5eaf8Z"}),icon:B.faUndo,onClick:()=>(0,q.resetFormatting)(e)}]:[],...I,...f?[]:[{divider:!0},{key:"add-comment",label:(0,t.jsx)(F.Trans,{message:"Add comment",id:"oFsfkI"}),icon:B.faComment,onClick:()=>{let t=n();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,w.addImageComment)(e.state.selection))}}],{divider:!0},...y?[{key:"align",label:(0,t.jsx)(F.Trans,{message:"Align",id:"9ms+e0"}),icon:B.faAlignLeft,items:K.AlignmentCommands.map(({name:t,key:i,icon:n,checkActive:a,apply:r})=>({key:i,icon:a&&a(e)?B.faCheck:n,label:t(),onClick:()=>{r&&r(e)}}))}]:[],{key:"click-action",label:(0,t.jsx)(F.Trans,{message:"Click action",id:"PWv7TI"}),icon:B.faMousePointer,items:[{key:"do-nothing",icon:"none"===u?B.faCheck:void 0,label:(0,t.jsx)(F.Trans,{message:"Do nothing",id:"gIjBW2"}),onClick:()=>g("none")},{key:"expand",icon:"expand"===u?B.faCheck:void 0,label:(0,t.jsx)(F.Trans,{message:"Expand",id:"1A3EXy"}),onClick:()=>g("expand")},{key:"new-tab",icon:"newTab"===u?B.faCheck:void 0,label:(0,t.jsx)(F.Trans,{message:"Open in new tab",id:"Alx2/L"}),onClick:()=>{let t=n();"number"==typeof t&&(e.commands.selectNodeAtPos(t),g("newTab"))}}]},...b?[{divider:!0},{key:"edit-gallery",icon:B.faGrid2,label:(0,t.jsx)(F.Trans,{message:"Edit gallery...",id:"+v0hYZ"}),onClick:()=>{let t=n();if("number"==typeof t)try{let i=(0,w.findParentGallery)(e.state.doc.resolve(t));if(!i)return;e.commands.selectNodeAtPos(i.pos)}catch(e){console.error(`[caught] useImageContextMenuItems edit gallery error: ${e}`)}}}]:[],{divider:!0},{key:"delete",label:(0,t.jsx)(F.Trans,{message:"Delete",id:"cnGeoo"}),icon:B.faTrash,onClick:h,color:"red.500"}],[v,y,u,h,e,_,n,g,d,f,b,S,i,s,p,C,m,I])}})({editor:et,node:ee,getPos:ea,decorations:en}),{onOpenContextMenu:e4}=(0,p.useEditorContextMenu)({editor:et,getPos:ea,contextMenuItems:e5}),{sizingAttrs:e6,shouldUseImgProxyCrop:e9}=(0,O.useGallerySizing)({nodeViewProps:e,inGallery:eA,inGridGallery:e_,inLogoGallery:eI,isSvg:ey,isAnimatedGif:ev}),e8=(0,l.useIsThumbnailView)();return(0,t.jsxs)(b.AnnotatableNodeViewWrapper,{...e,as:"div",className:eT||"none"!==eF?void 0:j.NON_CLICKABLE_CLASSNAME,style:{height:eE?"100%":void 0},children:[(eu||!es&&!el)&&(0,t.jsx)(k.MediaPlaceholderBlock,{...e}),!eu&&(es||el)&&(0,t.jsxs)(S.MediaViewWrapper,{ref:eZ,resizeableSx:eB,alignStyles:ez,horizontalAlign:ep,editor:et,decorations:en,node:ee,isDark:eP,isResizing:eR,getPos:ea,onContextMenu:e4,children:[eX&&e0&&!e8&&(0,t.jsx)(I.ClippableControls,{imageWrapperRef:eN,updateResizeAttrs:eQ,refreshDeps:[eJ],currentWidth:eV,currentHeight:eG,clipPath:eh?.clipPath,clipAspectRatio:eh?.clipAspectRatio,onFinishCrop:()=>{requestAnimationFrame(()=>{et.commands.refreshBubbleMenu?.()})}}),eY&&!e0&&eo&&!e8&&(0,t.jsx)(A.ResizableControls,{imageWrapperRef:eN,setIsResizing:eO,updateResizeAttrs:eQ,refreshDeps:[ee.attrs,eJ]}),(0,t.jsxs)(i.Box,{ref:eN,css:{mask:e0?"":"none !important","--media-maxH":!ew||eR||eh?.width||eE?void 0:`${100*n.MAX_IMAGE_HEIGHT_VIEWPORT}vh`},sx:eC?void 0:u.ImageSx,"data-drag-handle":!0,"data-image-node-element":!0,"data-selection-ring":"inside","data-selection-background":!0,"data-node-image-testid":em,w:eE?"100%":ex?`calc(${ex} * var(--font-size) / 16)`:ey?"300px":"fit-content",maxW:eE?"100%":"calc(100% * var(--media-scale))",position:"relative",overflow:"hidden",...eE?{h:e_||ek?"100%":void 0,display:"flex",justifyContent:"center",alignContent:"center"}:{},children:[(0,t.jsx)(M.ImageClickHandler,{isEditable:eT,clickBehavior:ef,shouldContainImage:eE,isCropping:e0,isResizing:eR,onEnterZoom:eU}),eW&&(0,t.jsx)(T.ImageUrlDebugger,{imageAttrs:e3}),(0,t.jsx)(P.CroppedImage,{containerWidth:eV,intrinsicAspectRatio:e$||void 0,isCroppingThisImage:e0,imageAttrs:e3,onLoad:e2,linkHref:eH?eg||"":void 0,filter:eS?"url(#theme-body-color-fill)":void 0,ref:eK,width:eA&&!ek?"auto":ex||eR||ey?"100%":ec?.width,minW:eE?"100%":void 0,objectFit:eE?"cover":"contain",isThumbnail:eE||e8,flex:e_?1:void 0,containerProps:{display:e_?"flex":"block"},shouldUseImgProxyCrop:e9,colors:ej,...e6}),(0,t.jsx)(L.ImageZoomOverlay,{id:em||"",node:ee,editor:et,decorations:en,enabled:!e0&&!eR&&!eE&&!e8}),(0,t.jsx)(C.MediaUploadIndicators,{uploadStatus:ed??void 0,isEditable:eT})]})]})]})}},419217,202545,e=>{"use strict";e.s([],419217),e.s(["Image",()=>b],202545);var t=e.i(755453),i=e.i(698380),n=e.i(175863),a=e.i(418755);e.i(838054);var r=e.i(408767),o=e.i(767730),s=e.i(438106),l=e.i(577281),d=e.i(342047),c=e.i(391736),u=e.i(329860),p=e.i(543315),h=e.i(316353),m=e.i(723740),g=e.i(154217),f=e.i(753748);let b=(0,o.extendTiptapNode)(i.default,"image",{selectable:!0,draggable:!0,priority:s.ExtensionPriorityMap.Image,expandable:!0,addOptions(){return{...this.parent?.(),placeholders:{}}},addNodeView:()=>(0,r.ReactNodeViewRenderer)(g.ImageView,{update:l.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"img[src], img[tempUrl]",getAttrs:e=>({id:(0,o.parseIdAttr)(e,c.generateMediaId),src:e.getAttribute("src")||null,tempUrl:e.getAttribute("tempUrl")||null,savedMediaId:e.getAttribute("data-saved-media-id")||null,source:e.getAttribute("data-source")||null,name:e.getAttribute("data-name")||null,query:e.getAttribute("data-query")||null,showPlaceholder:"true"===e.getAttribute("data-show-placeholder")||"false"!==e.getAttribute("data-show-placeholder")&&null,meta:(0,o.parseJSONAttr)(e,"meta")??null,aiParams:(0,o.parseJSONAttr)(e,"aiParams")??null,resize:(0,o.parseJSONAttr)(e,"resize")??p.DEFAULT_RESIZE_STATE,providerMeta:(0,o.parseJSONAttr)(e,"providerMeta")??null,loadImageParams:(0,o.parseJSONAttr)(e,"loadImageParams")??null,uploadStatus:null!=e.getAttribute("data-upload-status")?Number(e.getAttribute("data-upload-status")):null,loadImageStatus:e.getAttribute("data-load-image-status")||null,clickBehavior:e.getAttribute("data-click-behavior")||null,href:e.getAttribute("data-href")||null,...(0,o.parseHorizontalAlign)(e)})},{tag:"div[class=card-accent-layout-item]",context:"cardLayoutItem//",getAttrs:e=>{try{let t=JSON.parse(e.getAttribute("data-background")||"{}");if("image"!==t.type||!t.image)return!1;let i={...t.image,source:t.source};return(0,u.resizeImageToFitViewport)(i)}catch(t){return console.error("[Image] Error parsing accent image background",e,t),!1}}}],renderHTML:({node:e,HTMLAttributes:i})=>["img",(0,t.mergeAttributes)(i,{loading:"lazy",src:e.attrs.src,"data-id":e.attrs.id,...e.attrs.tempUrl&&{tempUrl:e.attrs.tempUrl},...e.attrs.savedMediaId&&{"data-saved-media-id":e.attrs.savedMediaId},...e.attrs.source&&{"data-source":e.attrs.source},...e.attrs.name&&{"data-name":e.attrs.name},...e.attrs.query&&{"data-query":e.attrs.query},...null!=e.attrs.showPlaceholder&&{"data-show-placeholder":String(e.attrs.showPlaceholder)},...(0,o.renderJSONAttrs)(e.attrs,"meta","aiParams","resize","providerMeta","loadImageParams"),...null!=e.attrs.uploadStatus&&{"data-upload-status":String(e.attrs.uploadStatus)},...e.attrs.loadImageStatus&&{"data-load-image-status":e.attrs.loadImageStatus},...e.attrs.clickBehavior&&{"data-click-behavior":e.attrs.clickBehavior},...e.attrs.href&&{"data-href":e.attrs.href},...(0,o.renderHorizontalAlign)(e.attrs)})],addKeyboardShortcuts:()=>({Enter:({editor:e})=>{let t=e.state.selection;if(t instanceof n.NodeSelection&&t.node.type.name===i.default.name){let e=(0,f.selectIsCropping)((0,a.getStore)().getState()),{id:i}=t.node.attrs;if(e)return h.eventEmitter.emit("endClip",{id:i,confirm:!0}),!0}return!1}}),addProseMirrorPlugins(){return[new n.Plugin({key:new n.PluginKey("imageDrag"),props:{handleDOMEvents:{dragstart:(e,i)=>{let{selection:n}=e.state,r=(0,t.isNodeSelection)(n)&&n.node?.type.name==="image"?n.node.attrs.id:null;if(r){let e=(0,a.getStore)().getState();if((0,f.selectIsIdCropping)(r)(e))return i.preventDefault(),!0}return!1}}}}),(0,d.ConvertMediaToGridLayoutPlugin)(),(0,m.ImageDropPlugin)(this.editor)]},addCommands(){let e=this.name,t=t=>{let{selection:i}=t;return i instanceof n.NodeSelection&&i.node.type.name===e?i.node:void 0};return{resetImageClip:()=>({chain:i,state:n})=>{let a=t(n);if(!a)return console.warn("[resetImageClip] Selected node is not an image: ",n.selection),!0;let{clipPath:r,clipType:o,clipAspectRatio:s}=p.DEFAULT_RESIZE_STATE;return i().updateAttributes(e,{resize:{...a.attrs.resize,clipPath:r,clipType:o,clipAspectRatio:s}}).run()},resetImageScale:()=>({chain:i,state:n})=>{let a=t(n);return a?i().updateAttributes(e,{resize:{...a.attrs.resize,width:null,isAuto:null}}).run():(console.warn("[resetImageClip] Selected node is not an image: ",n.selection),!0)}}}});e.i(43887),e.i(218025),e.i(59936)},664075,376556,956053,e=>{"use strict";e.s(["CardAccentLayoutItemFormattingMenu",()=>Z],664075);var t=e.i(391398),i=e.i(335799),n=e.i(344233),a=e.i(524473),r=e.i(541075);e.i(828525);var o=e.i(876533),s=e.i(896620),l=e.i(358280),d=e.i(408122),c=e.i(755453),u=e.i(191788),p=e.i(979504),h=e.i(459014),m=e.i(24066),g=e.i(892493),f=e.i(555027);e.i(24439);var b=e.i(103630),x=e.i(425605),y=e.i(348258);e.s(["ChangeFocusPoint",()=>z],376556);var v=e.i(514791),C=e.i(428683),w=e.i(969641),S=e.i(818315),k=e.i(306841),A=e.i(470020),E=e.i(891494),_=e.i(882255),I=e.i(865080),M=e.i(413829),T=e.i(473226);e.i(420945);var L=e.i(949488),j=e.i(418755);e.i(419217);var P=e.i(753748),D=e.i(625878),N=e.i(160396),R=e.i(71259);let O=(e,t,i)=>{let n=e.view.domAtPos(t);if(!n)return;let{node:a,offset:r}=n,o=a.childNodes[r].querySelector("[data-change-focus-point-el]");o&&(o.style.backgroundPosition=i?`${i.x}% ${i.y}%`:"")},B=(e,t,i)=>{if(!t||!i)return;let n=(0,D.relativeToAbsolutePos)(e.state,i);if(!n)return void console.error("ChangeFocusPoint - relative pos is null");O(e,n,null);let a=e.state.doc.nodeAt(n);if(!a)return;let r=(0,R.getNodeImageAttrs)(a),o=(0,R.mergeImageAttrs)(a,{...r,backgroundPos:t});e.commands.updateAttributesAtPos(n,o)},z=({node:e,editor:i,pos:o,isDisabled:c=!1})=>{let p=(0,R.getNodeImageAttrs)(e),h=p?.src||p?.tempUrl,m=(e=>{let[t,i]=(0,u.useState)(null);return(0,u.useEffect)(()=>{let t;return(t=new Image).src=e,t.onload=()=>{let{naturalWidth:e,naturalHeight:n}=t;i(e/n)},()=>{i(null)}},[e]),t})(h),g=(0,R.getUniqueIdForImage)(i,e,o,p),f=(0,L.useSelector)((0,P.selectIsChangeFocalPoint)(g)),{dotRef:b,dotContainerRef:x,canReset:y,resetDotPosition:z}=(({editor:e,pos:t,node:i,isOpen:n})=>{let a=(0,u.useRef)(null),r=(0,u.useRef)(null),o=(0,u.useRef)(null),[s,l]=(0,u.useState)(!1),d=(0,u.useRef)(void 0),c=(0,u.useCallback)(i=>{let n=a.current;if(n){if(d.current=i,!i){n.style.left="calc(50% - 10px)",n.style.top="calc(50% - 10px)",l(!1);return}n.style.left=`calc(${i.x}% - 10px)`,n.style.top=`calc(${i.y}% - 10px)`,O(e,t,i),l(50!==i.x||50!==i.y)}},[e,t]);(0,u.useEffect)(()=>{n&&c((0,R.getNodeImageAttrs)(i)?.backgroundPos)},[n,i,c]);let p=(0,u.useCallback)(()=>{let i={x:50,y:50};c(i);let n=(0,D.absoluteToRelativePos)(e.state,t);B(e,i,n)},[c,e,t]),h=(0,u.useCallback)(e=>{let t=r.current;if(!t)return;let i=t.getBoundingClientRect(),n=i.width,a=i.height,o=(e.clientX-i.left)/n,s=(e.clientY-i.top)/a;c({x:(0,T.default)(100*(0,M.default)(o,0,1),2),y:(0,T.default)(100*(0,M.default)(s,0,1),2)})},[c]);return(0,u.useEffect)(()=>{let i=a.current,n=r.current;if(!i||!n)return;o.current=(0,D.absoluteToRelativePos)(e.state,t);let s=()=>{n.addEventListener("mousemove",h),window.addEventListener("mouseup",l)},l=()=>{n.removeEventListener("mousemove",h),window.removeEventListener("mouseup",l),B(e,d.current,o.current)};return i.addEventListener("mousedown",s),()=>{i.removeEventListener("mousedown",s)}},[e,h,t]),(0,u.useEffect)(()=>{let i=r.current;if(!i)return;o.current=(0,D.absoluteToRelativePos)(e.state,t);let n=e=>{i.addEventListener("mousemove",h),window.addEventListener("mouseup",a),h(e)},a=()=>{i.removeEventListener("mousemove",h),window.removeEventListener("mouseup",a),B(e,d.current,o.current)};return i.addEventListener("mousedown",n),()=>{i.removeEventListener("mousedown",n)}},[e,h,t]),{dotRef:a,dotContainerRef:r,canReset:s,resetDotPosition:p}})({editor:i,pos:o,node:e,isOpen:f}),F=(0,j.useAppDispatch)();return(0,u.useEffect)(()=>()=>{F((0,P.endChangeFocalPoint)())},[F]),(0,I.useOutsideClick)({ref:{current:x.current},handler(){F((0,P.endChangeFocalPoint)())}}),(0,t.jsxs)(k.Popover,{strategy:"absolute",placement:"top",isOpen:f,onClose:()=>F((0,P.endChangeFocalPoint)()),children:[(0,t.jsx)(s.GammaTooltip,{label:(0,t.jsx)(l.Trans,{message:"Change focus point",id:"BmxaoW"}),placement:"top",children:(0,t.jsx)(C.Box,{my:1,children:(0,t.jsx)(A.PopoverAnchor,{children:(0,t.jsx)(n.IconButton,{variant:"toolbar",size:"sm",icon:(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faCrosshairsSimple}),boxSize:7,p:0,my:0,isDisabled:c,"aria-label":d.i18n._({id:"BmxaoW",message:"Change focus point"}),onClick:()=>{F((0,P.startChangeFocalPoint)({id:g}))}})})})}),(0,t.jsx)(_.PopoverContent,{children:(0,t.jsx)(E.PopoverBody,{p:1,children:(0,t.jsxs)(C.Box,{ref:x,userSelect:"none",position:"relative",children:[(0,t.jsx)(C.Box,{ref:b,borderRadius:"full",boxSize:5,pos:"absolute",zIndex:"overlay",border:"2px solid",borderColor:"gray.50",pointerEvents:"none",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white"}),h&&(0,t.jsx)(v.AspectRatio,{maxW:"300px",ratio:m||1,position:"relative",children:(0,t.jsx)(S.Image,{pointerEvents:"none",src:(0,N.resizeAndProxyImageUrl)(h,N.THUMBNAIL_RESIZE_JPG_PARAMS,p.meta),fallbackSrc:h,objectFit:"cover",position:"absolute",top:0,insetStart:0,width:"100%",height:"100%"})}),(0,t.jsx)(w.Button,{opacity:+!!y,pos:"absolute",bottom:3,insetEnd:3,variant:"plain",size:"xs",onClick:z,children:(0,t.jsx)(l.Trans,{message:"Reset",id:"OfhWJH"})})]})})})]})};var F=e.i(400551),H=e.i(555145),W=e.i(575084);e.i(58124);var U=e.i(865594),V=e.i(232278),G=e.i(261442);let $=({onEditImage:e,imageCardMenuItems:i,...o})=>{let c=(0,u.useRef)(null),{onContextMenu:p,menuProps:h}=(0,V.useContextMenuDropdown)(c),m=(0,u.useMemo)(()=>[{key:"edit-image",label:(0,t.jsx)(l.Trans,{message:"Edit image...",id:"3oFHeo"}),icon:a.faPencil,onClick:e},...i],[e,i]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(s.GammaTooltip,{label:(0,t.jsx)(l.Trans,{message:"Edit image",id:"XQFMOm"}),placement:"top",children:(0,t.jsx)(n.IconButton,{px:2,"aria-label":d.i18n._({id:"XQFMOm",message:"Edit image"}),icon:(0,t.jsxs)(H.HStack,{children:[(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faEdit,fixedWidth:!0}),(0,t.jsx)(r.FontAwesomeIcon,{icon:W.faChevronDown,size:"xs",fixedWidth:!0})]}),flex:1,onMouseDown:e=>{p(e),(0,G.preventDefaultToAvoidBlur)(e)},ref:c,...o})}),(0,t.jsx)(U.ContextMenu,{...h,menuItems:m,size:"small",inEditorContext:!0})]})};e.s(["ImageEditMenuDropdown",0,$],956053);let Z=({editor:e,selection:v,decorations:C})=>{let{node:w,from:S}=v,k=w.attrs,{background:A,cardLayoutDeco:E,hasImage:_,hasAccentImage:I,canChangeFit:M,canEditImageWithAI:T,fitType:L,showChangeFocusPoint:j,displayLayout:P}=(0,g.useCardAccentBackground)(k,C),D=E?.isNested,N=(0,u.useCallback)(()=>{e.commands.convertImageToImageCard()},[e]),R=(0,p.useSetLayout)({editor:e,source:"card-accent-formatting-menu",getPos:()=>S,findParentCard:!0}),O=(0,u.useCallback)(()=>{try{let t=(0,c.findParentNodeClosestToPos)(e.state.doc.resolve(S),b.isCardNode),i=t?.node.attrs.id;if(!i)return;h.eventEmitter.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:i})}catch(e){console.error("(caught) [CardLayoutItemFormattingMenu] error",e)}},[e,S]),{showImageCardOptions:B,imageCardActionsMenuItems:H}=(0,f.useImageCardActionsMenuItems)({disabled:!I,canSetAsAccent:!D,onTurnIntoCard:N,onSetCardLayout:R,isAccentImage:!0,canTurnIntoCard:_,selectedLayout:P});return(0,t.jsx)(i.ButtonGroup,{spacing:1,size:"sm",alignItems:"center",children:"accent"===k.itemId&&(0,t.jsxs)(t.Fragment,{children:[M&&(0,t.jsx)(y.CardAccentImageFitButton,{editor:e,selection:v,decorations:C}),j&&(0,t.jsx)(z,{editor:e,pos:S,node:w,isDisabled:"fit"===L}),(M||j)&&(0,t.jsx)(F.FormattingMenuDivider,{}),_&&A?.image&&T&&(0,t.jsx)(o.DarkModeProvider,{isDark:!1,children:(0,t.jsx)(x.BuddyImageEditDropdownMenu,{attrs:A.image,editor:e})}),B?(0,t.jsx)($,{onEditImage:O,imageCardMenuItems:H,variant:"toolbar"}):(0,t.jsx)(s.GammaTooltip,{label:I?(0,t.jsx)(l.Trans,{message:"Edit image",id:"XQFMOm"}):(0,t.jsx)(l.Trans,{message:"Add image",id:"P5MuiB"}),placement:"top",children:(0,t.jsx)(n.IconButton,{onClick:O,variant:"toolbar",size:"sm",icon:(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faEdit}),boxSize:7,p:0,"aria-label":I?d.i18n._({id:"Ov693i",message:"Edit accent image"}):d.i18n._({id:"B6vyEa",message:"Add accent image"})})}),(0,t.jsx)(F.FormattingMenuDivider,{}),I&&(0,t.jsx)(s.GammaTooltip,{label:(0,t.jsx)(l.Trans,{message:"Remove accent image",id:"sGYCGx"}),placement:"top",children:(0,t.jsx)(n.IconButton,{onClick:()=>(0,m.removeAccentImage)(e,S,!0),variant:"toolbar",size:"sm",icon:(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faImageSlash}),color:"red.500",boxSize:7,p:0,"aria-label":d.i18n._({id:"sGYCGx",message:"Remove accent image"})})}),(0,t.jsx)(s.GammaTooltip,{label:(0,t.jsx)(l.Trans,{message:"Remove layout",id:"6vLq+T"}),placement:"top",children:(0,t.jsx)(n.IconButton,{onClick:()=>(0,m.removeAccentImage)(e,S,!1),variant:"toolbar",size:"sm",icon:(0,t.jsx)(r.FontAwesomeIcon,{icon:a.faTrash}),color:"red.500",boxSize:7,p:0,"aria-label":d.i18n._({id:"6vLq+T",message:"Remove layout"})})})]})})}},166740,662892,e=>{"use strict";let t;var i=e.i(191788);e.i(420945);var n=e.i(33823),a=e.i(418755);e.i(734710);var r=e.i(78387),o=e.i(688293),s=e.i(430378);let l=(e,t={})=>{let i=(0,a.getStore)().getState(),n=(0,o.selectSearchSessionId)(i);s.analytics?.track(e,{...t,search_session_id:n})};e.s(["useGlobalSearchModal",0,()=>{let e=(0,n.useDispatch)();return{openGlobalSearch:(0,i.useCallback)(({onSelectDoc:t,source:i,initialQuery:n})=>{e((0,o.setIsGlobalSearchOpen)({isOpen:!0,onSelectDoc:t,initialQuery:n})),l(r.SegmentEvents.SEARCH_OPENED,{source:i,initial_query:n})},[e]),closeGlobalSearch:(0,i.useCallback)(()=>{let t=(0,o.selectSearchQuery)((0,a.getStore)().getState());l(r.SegmentEvents.SEARCH_CLOSED,{final_query:t}),e((0,o.setIsGlobalSearchOpen)({isOpen:!1,initialQuery:""}))},[e])}}],166740);var d=e.i(221168);let c="function"==typeof atob,u="function"==typeof btoa,p="function"==typeof d.Buffer,h=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder&&new TextEncoder,[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="]),m=(t={},h.forEach((e,i)=>t[e]=i),t),g=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,f=String.fromCharCode.bind(String),b="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=e=>e)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),x=u?e=>btoa(e):p?e=>d.Buffer.from(e,"binary").toString("base64"):e=>{let t,i,n,a,r="",o=e.length%3;for(let o=0;o255||(n=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)throw TypeError("invalid character found");r+=h[(t=i<<16|n<<8|a)>>18&63]+h[t>>12&63]+h[t>>6&63]+h[63&t]}return o?r.slice(0,o-3)+"===".substring(o):r},y=p?e=>d.Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,n=e.length;iatob(e.replace(/[^A-Za-z0-9\+\/]/g,"")):p?e=>d.Buffer.from(e,"base64").toString("binary"):e=>{if(e=e.replace(/\s+/g,""),!g.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,i="",n,a;for(let r=0;r>16&255):64===a?f(t>>16&255,t>>8&255):f(t>>16&255,t>>8&255,255&t);return i};e.s(["fromUint8Array",0,(e,t=!1)=>t?y(e).replace(/[+\/]/g,e=>"+"==e?"-":"_").replace(/=+$/m,""):y(e)],662892)},874309,(e,t,i)=>{var n=e.r(481954),a=e.r(461994);t.exports=function(e,t,i){return i="function"==typeof i?i:void 0,n(e,t,a(t),i)}},59554,e=>{"use strict";e.s(["useOpenSearchWithCardsToCopy",()=>s],59554),e.i(391398),e.i(620020),e.i(358280);var t=e.i(921679),i=e.i(191788);e.i(144786);var n=e.i(849187);e.i(710776),e.i(418755);var a=e.i(166740),r=e.i(444577);e.i(103630),e.i(816256),e.i(755453),e.i(662892),e.i(874309),e.i(257140),e.i(802818),e.i(479886),e.i(529232);let o=e=>{"card"===e.type&&e.attrs&&delete e.attrs.id},s=()=>{let e=(0,n.useFeatureFlag)("copyCardsToDeck"),{openGlobalSearch:s}=(0,a.useGlobalSearchModal)();return(0,i.useCallback)(i=>{if(!e)return;let n=i.map(e=>{var i;let n,a=(i=(0,t.default)(e.toJSON()),n=e=>e.content?.map(e=>{if(!e.content)return e;let t={...e,attrs:{...e.attrs}};return o(t),t.content=n(t),t}),o(i),Object.assign({},i,{content:n(i)}));return a.attrs&&(a.attrs.fontScale=null),a}).map(e=>(0,r.assignCardIdsToChildren)(e));s({source:"copy_card",onSelectDoc:()=>{sessionStorage.setItem("cardsToCopy",JSON.stringify(n))}})},[e,s])}},643079,762368,417781,124059,207556,136008,765996,229895,316969,976996,515785,747420,556504,224852,536420,198149,804508,147573,901267,494556,588319,e=>{"use strict";e.s(["CardFormattingMenu",()=>eL],643079);var t=e.i(391398),i=e.i(335799),n=e.i(555145),a=e.i(382167),r=e.i(887527),o=e.i(620020),s=e.i(524473),l=e.i(827911),d=e.i(182535),c=e.i(358280),u=e.i(408122),p=e.i(191788),h=e.i(606004),m=e.i(59554);e.i(144786);var g=e.i(849187),f=e.i(47735),b=e.i(376742),x=e.i(241894),y=e.i(296690),v=e.i(865799),C=e.i(969641),w=e.i(402818),S=e.i(775493),k=e.i(704077),A=e.i(112010),E=e.i(588183),_=e.i(75495),I=e.i(575329),M=e.i(751827),T=e.i(918228),L=e.i(654656);let j=(0,p.createContext)(null);function P({clientId:e,onScriptLoadSuccess:t,onScriptLoadError:i,children:n}){let a=function(e={}){let{onScriptLoadSuccess:t,onScriptLoadError:i}=e,[n,a]=(0,p.useState)(!1),r=(0,p.useRef)(t);r.current=t;let o=(0,p.useRef)(i);return o.current=i,(0,p.useEffect)(()=>{let e=document.createElement("script");return e.src="https://accounts.google.com/gsi/client",e.async=!0,e.defer=!0,e.onload=()=>{var e;a(!0),null==(e=r.current)||e.call(r)},e.onerror=()=>{var e;a(!1),null==(e=o.current)||e.call(o)},document.body.appendChild(e),()=>{document.body.removeChild(e)}},[]),n}({onScriptLoadSuccess:t,onScriptLoadError:i}),r=(0,p.useMemo)(()=>({clientId:e,scriptLoadedSuccessfully:a}),[e,a]);return p.default.createElement(j.Provider,{value:r},n)}function D({flow:e="implicit",scope:t="",onSuccess:i,onError:n,...a}){let{clientId:r,scriptLoadedSuccessfully:o}=function(){let e=(0,p.useContext)(j);if(!e)throw Error("Google OAuth components must be used within GoogleOAuthProvider");return e}(),s=(0,p.useRef)(),l=(0,p.useRef)(i);l.current=i;let d=(0,p.useRef)(n);d.current=n,(0,p.useEffect)(()=>{var i;if(!o)return;let n="implicit"===e?"initTokenClient":"initCodeClient";s.current=null==(i=window.google)?void 0:i.accounts.oauth2[n]({client_id:r,scope:`openid profile email ${t}`,callback:e=>{var t,i;if(e.error)return null==(t=d.current)?void 0:t.call(d,e);null==(i=l.current)||i.call(l,e)},...a})},[r,o,e,t]);let c=(0,p.useCallback)(e=>s.current.requestAccessToken(e),[]),u=(0,p.useCallback)(()=>s.current.requestCode(),[]);return"implicit"===e?c:u}function N(e,t,...i){return!!window.google&&window.google.accounts.oauth2.hasGrantedAllScopes(e,t,...i)}e.s(["GoogleOAuthProvider",0,P,"hasGrantedAllScopesGoogle",0,N,"useGoogleLogin",0,D],762368);var R=e.i(367792),O=e.i(82050),B=e.i(180078),z=e.i(418755),F=e.i(78387),H=e.i(613616),W=e.i(864860),U=e.i(892194),V=s,G=e.i(541075);let $=({formatLabel:e,icon:i,rightIcon:n=V.faArrowDownToBracket,accentColor:a,onClick:o,exportInProgress:s,exportInProgressNote:l,badge:d,customLabel:u,customInProgressMessage:p})=>{let h=(0,U.useColorModeValue)("gray.50","whiteAlpha.100"),m=(0,U.useColorModeValue)("gray.200","gray.600"),g=(0,U.useColorModeValue)(`${a}.100`,`${a}.200`),f=a.endsWith("00")?a:g,b=(0,U.useColorModeValue)("gray.300","gray.600");return(0,t.jsxs)(H.Flex,{alignItems:"stretch",overflow:"hidden",onClick:o,borderRadius:"md",border:"1px",borderColor:(0,U.useColorModeValue)("gray.200","gray.600"),bgColor:s?m:h,cursor:s?"progress":void 0,disabled:s,as:"button",transitionProperty:"common",transitionDuration:"normal",_hover:s?{}:{boxShadow:"var(--chakra-shadows-md)",borderColor:"inherit",color:"inherit"},children:[(0,t.jsx)(H.Flex,{bgColor:s?b:f,filter:s?"grayscale(1)":void 0,width:14,minWidth:14,minH:14,alignItems:"center",justifyContent:"center",fontSize:"2xl",children:i}),(0,t.jsxs)(T.Stack,{alignItems:"flex-start",spacing:0,p:4,justifyContent:"center",children:[!s&&(0,t.jsxs)(r.Text,{fontWeight:"medium",children:[u||(0,t.jsx)(c.Trans,{message:"Export to {formatLabel}",id:"i3Tbgc",values:{formatLabel:e}})," ",d]}),s&&(0,t.jsxs)(r.Text,{fontWeight:"medium",textAlign:"start",children:[p||(0,t.jsx)(c.Trans,{message:"Your {formatLabel} is being generated.",id:"wRvCQ6",values:{formatLabel:e}})," ",l]})]}),(0,t.jsx)(W.Spacer,{}),!s&&(0,t.jsx)(H.Flex,{alignItems:"center",ps:4,pe:6,children:(0,t.jsx)(G.FontAwesomeIcon,{icon:n,size:"1x"})})]})};var Z=e.i(85583),K=e.i(275885),q=e.i(918331);e.i(734710);var Y=e.i(468738),X=e.i(540791);e.i(407055);var Q=e.i(103104);e.i(615835);var J=e.i(25747),ee=e.i(256266);class et extends Error{code;constructor(e,t){super(e),this.code=t,this.name="AccountStateError"}}let ei=async(e,t,i,n,a,r,o,s,l=!1,d,c,u,p)=>{let h=l?`${R.config.API_HOST||""}/share/docs/${e}/${c}`:`${R.config.API_HOST||""}/export/docs/${e}/${i}${p?"/url":""}`,m=new AbortController;return setTimeout(()=>m.abort(),6e4),fetch(h,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":R.config.SHARE_TOKEN||""},body:JSON.stringify({docContent:t,fileName:a,cardIds:r,cardRanges:o,isCardExport:n,shareMessage:d,googleOauthToken:"google_slides"===i?s:void 0,quality:u}),signal:m.signal})},en=({doc:e,source:i,editor:n,format:s="pdf",formatLabel:l,fileName:d,cardIds:h,cardRanges:m,socialPost:f=!1,socialPlatform:b,shareMessage:x,interceptFileExport:y,quality:v,onExportSuccess:C})=>{let w=(0,o.useToast)(),S=(0,p.useRef)(null),k=(0,Y.useAnalytics)(),{user:A}=(0,J.useUserContext)(),[E,_]=(0,p.useState)(!1),I=(0,g.useFeatureFlag)("exportUrlDownload");if(f&&!b)throw console.error("Unable to export since no social platform provided for the post"),Error("Unable to share post");let M=(0,p.useCallback)(()=>{S.current=null},[]),T=(0,p.useCallback)(()=>{S.current=w({id:`export-toast-${e.id}-${s}`,isClosable:!1,position:"top",duration:null,status:"loading",colorScheme:"gray",onCloseComplete:M,title:f?(0,t.jsx)(c.Trans,{message:"Posting to {formatLabel}...",id:"jQGAZQ",values:{formatLabel:l}}):(0,t.jsx)(c.Trans,{message:"Exporting {formatLabel}...",id:"eWt/TT",values:{formatLabel:l}})})},[e.id,w,s,l,M,f]),L=(0,p.useCallback)(()=>{S.current&&w.update(S.current,{status:"loading",colorScheme:"gray",title:f?(0,t.jsx)(c.Trans,{message:"Posting...",id:"iPHeYN"}):(0,t.jsx)(c.Trans,{message:"Exporting...",id:"eJOEBy"}),description:(0,t.jsx)(c.Trans,{message:"This is taking a while. You can keep waiting, or close this and we'll email you a link.",id:"3xBuWT"}),duration:1e4,isClosable:!0})},[w,f]),j=(0,p.useCallback)(()=>{S.current&&w.update(S.current,{status:"info",colorScheme:"gray",title:(0,t.jsx)(c.Trans,{message:"Exporting...",id:"eJOEBy"}),description:f?(0,t.jsx)(c.Trans,{message:"This is taking a while. You can keep waiting, or close this and we'll email you a link to your post.",id:"c5plBG"}):"google_slides"===s?(0,t.jsx)(c.Trans,{message:"This is taking a while. You can keep waiting, or close this and we'll email you a link to your file.",id:"/CtF0l"}):(0,t.jsx)(c.Trans,{message:"We're still working on it. We'll email you a link to download your file.",id:"W4zgCP"}),duration:1e4,isClosable:!0})},[w,f,s]),P=(0,p.useCallback)(i=>{let n,a;if(f)n="REVOKED_ACCESS_TOKEN"===i?(0,t.jsx)(c.Trans,{message:"Access to your {formatLabel} was revoked. Please try again.",id:"zK8Tsy",values:{formatLabel:l}}):(0,t.jsx)(c.Trans,{message:"Error posting to {formatLabel}",id:"sBE71M",values:{formatLabel:l}});else switch(i){case"INSUFFICIENT_SPACE":n=(0,t.jsx)(c.Trans,{message:"Error exporting to {formatLabel}: Insufficient space available",id:"+ope9f",values:{formatLabel:l}});break;case"UPLOAD_TOO_LARGE":n=(0,t.jsx)(c.Trans,{message:"Can't export to {formatLabel}",id:"HcLZqO",values:{formatLabel:l}}),a=(0,t.jsx)(c.Trans,{message:"This {GAMMA_ARTIFACT_PROPER_NOUN} is too large for {formatLabel}. {formatLabel} has a 100 MB size limit, and your {GAMMA_ARTIFACT_PROPER_NOUN} is over that limit. You can still export it as a PowerPoint or PDF instead.",id:"vslK0D",values:{GAMMA_ARTIFACT_PROPER_NOUN:Q.GAMMA_ARTIFACT_PROPER_NOUN,formatLabel:l}});break;default:n=(0,t.jsx)(c.Trans,{message:"Error exporting file.",id:"walT1X"})}S.current&&w.isActive(S.current)?w.update(S.current,{title:n,description:a,status:"error",duration:null,isClosable:!0}):S.current=w({id:`export-toast-${e.id}-${s}`,title:n,description:a,status:"error",duration:null,isClosable:!0,position:"top",onCloseComplete:M})},[w,l,f,M,e.id,s]),D=(0,p.useCallback)((i,n="download")=>{let o=e.title;if(S.current){let e,s;switch(n){case"download":e=u.i18n._({id:"aVmJex",message:"Your {formatLabel} export is ready",values:{formatLabel:l}}),s=(0,t.jsx)(c.Trans,{message:"A download should start automatically. If not, <0>click here to download it.",id:"VkeGn4",components:{0:(0,t.jsx)(a.Link,{textDecoration:"underline",target:"_blank",href:i||void 0,onClick:()=>S.current&&w.close(S.current)})}});break;case"social":e=u.i18n._({id:"lZgste",message:'"{docTitle}" has been posted to {formatLabel}',values:{docTitle:o,formatLabel:l}}),s=(0,t.jsx)(c.Trans,{message:"<0>Click here to view your post.",id:"nManvG",components:{0:(0,t.jsx)(a.Link,{textDecoration:"underline",target:"_blank",href:i||void 0,onClick:()=>S.current&&w.close(S.current)})}});break;case"web":e=u.i18n._({id:"eLTtkg",message:"Your export is complete"}),s=(0,t.jsx)(c.Trans,{message:"<0>Click here to view your {formatLabel} export.",id:"8hY871",values:{formatLabel:l},components:{0:(0,t.jsx)(a.Link,{textDecoration:"underline",target:"_blank",href:i||void 0})}})}w.update(S.current,{status:"success",title:e,description:(0,t.jsx)(r.Text,{children:s}),duration:5e3,isClosable:!0})}},[e,l,w]);return{handleExport:(0,p.useCallback)(()=>{let t=n?.getJSON();_(!0),T();let a=setTimeout(L,3e4);y?.({format:s,formatLabel:l,exportWaitWarnTimeout:a,showErrorToast:P,showEmailToast:j,showSuccessToast:D,setExportInProgress:_,onExportSuccess:C})||ei(e.id,t,s,"card_export_menu"===i,d,h,m,void 0,f,x,b,v,!f&&"google_slides"!==s?I:void 0).then(async a=>{if(!a.ok){let e=await a.json();if(console.error("Export failed:",{status:a.status,statusText:a.statusText}),"REVOKED_ACCESS_TOKEN"===e.error)throw new et("Posting to LinkedIn failed due to revoked access token",e.error);throw Error(`Fetching export failed: ${a.status} ${a.statusText}`)}let r="linkedin"===b?F.SegmentEvents.LINKEDIN_POST:"pdf"===s?F.SegmentEvents.PDF_EXPORTED:"pptx"===s?F.SegmentEvents.PPTX_EXPORTED:"image"===s?F.SegmentEvents.PNG_EXPORTED:void 0,o=decodeURIComponent(a.headers.get("x-gamma-download-url")||"")||void 0,d=a.headers.get("x-gamma-export-id")||void 0;if(f){let e=await a.json();o=e.url,d=d||e.exportId||void 0}else if(I&&"google_slides"!==s){let e=await a.json();if(o=e.url,d=d||e.exportId||void 0,!o)throw Error("Export URL endpoint returned no download URL")}if(r){let a=n&&"card_export_menu"!==i&&!A?.trainingOptOutTime?await (0,q.compressHtmlForAnalytics)(n):void 0,s=t?(0,X.getCardDimensions)(t)??"fluid":void 0;k?.track(r,{doc_id:e.id,source:i,device:(0,ee.getDeviceType)(),cardDimensions:s,documentHtmlZlib:a,...f&&{postUrl:o}})}if(D(o,f?"social":"download"),f)return void C?.(s,l,o,d);if(I&&"google_slides"!==s&&o){let t=await fetch(o);if(!t.ok)throw Error(`Failed to download export file: ${t.status} ${t.statusText}`);let i=await t.blob(),n=window.URL.createObjectURL(i),a=document.createElement("a");a.href=n,a.download=decodeURIComponent(o.split("/").pop()||`${e.id}.${s}`),a.style.display="none",document.body.appendChild(a),a.click(),a.remove(),window.URL.revokeObjectURL(n),C?.(s,l,o,d);return}let c=await a.blob(),u=window.URL.createObjectURL(c),p=document.createElement("a");p.download=decodeURIComponent((a.headers.get("Content-Disposition")||"").split(";").find(e=>e.includes("filename="))?.replace("filename=","").trim()||`${e.id}.${s}`),p.href=u,p.style.display="none",document.body.appendChild(p),p.click(),p.remove(),C?.(s,l,o,d)}).catch(t=>{"AbortError"===t.name?j():(K.captureException(t,{extra:{docId:e.id,format:s,source:i}}),Z.datadogLogs.logger.error("[useHandleExport] Error exporting doc",{docId:e.id,format:s,source:i},t),P(t?.code))}).finally(()=>{_(!1),clearTimeout(a)})},[k,e?.id,n,i,s,d,y,h,m,A?.trainingOptOutTime,v,x,P,T,L,j,D,b,f,I,C,l]),exportInProgress:E}};var ea=e.i(818315);let er={src:e.i(713200).default,width:48,height:66,blurWidth:0,blurHeight:0},eo={src:e.i(265680).default,width:24,height:27,blurWidth:0,blurHeight:0},es={src:e.i(789045).default,width:256,height:256,blurWidth:0,blurHeight:0},el={src:e.i(978284).default,width:512,height:512,blurWidth:0,blurHeight:0},ed={src:e.i(725516).default,width:1920,height:1786,blurWidth:0,blurHeight:0},ec={pdf:{icon:(0,t.jsx)(ea.Image,{src:es.src,h:"1.35rem",w:"auto"}),accentColor:"red"},pptx:{icon:(0,t.jsx)(ea.Image,{src:ed.src,h:"1.5rem",w:"auto"}),accentColor:"orange"},png:{icon:(0,t.jsx)(ea.Image,{src:el.src,h:"1.45rem",w:"auto"}),accentColor:"purple"},google_slides:{icon:(0,t.jsx)(ea.Image,{src:er.src,h:"1.6rem",w:"auto"}),accentColor:"yellow"},linkedin:{icon:(0,t.jsx)(ea.Image,{src:eo.src,h:"1.6rem",w:"auto"}),accentColor:"blue.900"}};var eu=e.i(7820);e.i(989619);var ep=e.i(180939),eh=e.i(534904);e.i(832019);var em=e.i(736386);e.i(195305);let eg=({onClose:e,onOpen:i,segmentEvent:a,targetWorkspace:o,label:s,upsellLocation:l,includeTopDivider:d=!1})=>{let u=(0,ep.useCanHideMadeWithGammaBadge)(o),{openUpsellModal:p}=(0,em.useMonetizationContext)(),h=(0,U.useColorModeValue)("gray.200","gray.600"),{currentWorkspace:m}=(0,J.useUserContext)();if(!1!==u||o?.id!==m?.id)return null;let g=(0,t.jsxs)(n.HStack,{w:"100%",children:[(0,t.jsxs)(n.HStack,{children:[(0,t.jsx)(r.Text,{children:s||(0,t.jsx)(c.Trans,{message:'Hide "Made with {GAMMA_PROPER_NOUN}" badge',id:"nkzjqi",values:{GAMMA_PROPER_NOUN:Q.GAMMA_PROPER_NOUN}})}),(0,t.jsx)(eh.PaidProductBadge,{product:"plus"})]}),(0,t.jsx)(W.Spacer,{}),(0,t.jsx)(eu.Switch,{onClickCapture:t=>{t.preventDefault(),p({onOpenCallback:e,onCloseCallback:i,segmentEvent:a,upsellLocation:l,targetFeature:"hide_gamma_badge"})},isChecked:!1})]});return d?(0,t.jsxs)(H.Flex,{direction:"column",w:"100%",children:[(0,t.jsx)(w.Divider,{borderColor:h,mb:4}),g]}):g};var ef=e.i(49202);let eb=({cardId:e,format:i,doc:n,editor:a,icon:r,badge:o,accentColor:s,label:l})=>{let{handleExport:d,exportInProgress:u}=en({doc:n,source:"card_export_menu",editor:a,format:i,formatLabel:l,cardIds:[e],interceptFileExport:void 0});return(0,t.jsx)($,{onClick:d,icon:r,formatLabel:l,accentColor:s,badge:o,exportInProgress:u,exportInProgressNote:(0,t.jsx)(c.Trans,{message:"It's safe to close this panel.",id:"SJjTti"})})},ex=({cardId:e,doc:i,editor:n,icon:a,badge:r,accentColor:o,label:s})=>{let{interceptFileExport:l}=(({doc:e,source:t,editor:i,fileName:n,cardIds:a,cardRanges:r})=>{let o="https://www.googleapis.com/auth/drive.file",s=(0,p.useRef)(null),l=(0,Y.useAnalytics)(),{user:d}=(0,J.useUserContext)(),c=D({scope:o,prompt:"",onSuccess:async c=>{let{showErrorToast:u,showEmailToast:p,showSuccessToast:h,setExportInProgress:m,exportWaitWarnTimeout:g,formatLabel:f,onExportSuccess:b}=s.current,x="";if(!N(c,o))return void u();x=c.access_token;let y=i?.getJSON(),v="google_slides";ei(e.id,y,"google_slides","card_export_menu"===t,n,a,r,x).then(async n=>{let a=await n.json();if(!n.ok){if(console.error("Export failed:",{status:n.status,statusText:n.statusText}),400===n.status)throw new et("Google drive upload failed",a.error);throw Error(`Fetching export failed: ${n.status} ${n.statusText}`)}let r=F.SegmentEvents.GSLIDES_EXPORTED;if(r){let n=i&&"card_export_menu"!==t&&!d?.trainingOptOutTime?await (0,q.compressHtmlForAnalytics)(i):void 0;l?.track(r,{doc_id:e.id,source:t,documentHtmlZlib:n})}h(a.url,"web"),b?.(v,f,a.url,a.exportId),window.open(a.url,"_blank")}).catch(i=>{"AbortError"===i.name?p():(K.captureException(i,{extra:{docId:e.id,format:v,source:t}}),Z.datadogLogs.logger.error("[useHandleExport] Error exporting doc",{docId:e.id,format:v,source:t},i),i instanceof et?u(i.code):u())}).finally(()=>{m(!1),clearTimeout(g)})}});return{interceptFileExport:e=>"google_slides"===e.format&&(s.current=e,c(),!0)}})({doc:i,source:"card_export_menu",editor:n,fileName:i.title,cardIds:[e]}),{handleExport:d,exportInProgress:u}=en({doc:i,source:"card_export_menu",editor:n,format:"google_slides",formatLabel:s,cardIds:[e],interceptFileExport:l});return(0,t.jsx)($,{onClick:d,icon:a,formatLabel:s,accentColor:o,badge:r,exportInProgress:u,exportInProgressNote:(0,t.jsx)(c.Trans,{message:"It's safe to close this panel.",id:"SJjTti"})})},ey=e=>"google_slides"===e.format?(0,t.jsx)(P,{clientId:R.config.GOOGLE_DRIVE_IMPORT_CLIENT_ID,children:(0,t.jsx)(ex,{...e})}):(0,t.jsx)(eb,{...e}),ev=(0,B.default)(({isOpen:e,onClose:n,onOpen:a,cardId:o,editor:s})=>{let l=(0,z.useAppSelector)(O.selectDoc),d=(0,z.useAppSelector)(O.selectFileWorkspace),u=(0,g.useFeatureFlag)("googleSlidesExport");return(0,t.jsxs)(S.Modal,{isOpen:e,onClose:n,size:"lg",children:[(0,t.jsx)(M.ModalOverlay,{}),(0,t.jsxs)(E.ModalContent,{children:[(0,t.jsx)(I.ModalHeader,{children:(0,t.jsx)(c.Trans,{message:"Export card",id:"xRJ+bN"})}),(0,t.jsx)(A.ModalCloseButton,{}),(0,t.jsx)(w.Divider,{}),(0,t.jsx)(k.ModalBody,{pt:"6",children:(0,t.jsxs)(L.VStack,{spacing:4,align:"start",children:[(0,t.jsxs)(T.Stack,{spacing:2,w:"100%",children:[(0,t.jsx)(ey,{cardId:o,format:"image",label:"PNG",icon:ec.png.icon,accentColor:ec.png.accentColor,doc:l,editor:s}),(0,t.jsx)(ey,{cardId:o,format:"pdf",label:"PDF",icon:ec.pdf.icon,accentColor:ec.pdf.accentColor,doc:l,editor:s}),(0,t.jsx)(ey,{cardId:o,format:"pptx",label:"PPTX",icon:ec.pptx.icon,accentColor:ec.pptx.accentColor,doc:l,editor:s}),u&&(0,t.jsx)(ey,{cardId:o,format:"google_slides",label:"Google Slides",icon:ec.google_slides.icon,accentColor:ec.google_slides.accentColor,badge:(0,t.jsx)(v.Badge,{colorScheme:"green",children:(0,t.jsx)(c.Trans,{message:"New",id:"isRobC"})}),doc:l,editor:s})]}),(0,t.jsx)(r.Text,{fontSize:"sm",color:"gray.600",children:(0,t.jsx)(c.Trans,{message:"Tip: you can control card sizing and backdrops in <0>page setup.",id:"8LhjM/",components:{0:(0,t.jsx)(C.Button,{variant:"link",as:"span",size:"sm",cursor:"pointer",onClick:()=>{n(),ef.TiptapEventBus.emit(ef.EventBusEvent.OPEN_PAGE_SETUP,"cards")}})}})}),(0,t.jsx)(eg,{includeTopDivider:!0,onClose:n,onOpen:a,segmentEvent:F.SegmentEvents.GAMMA_PRO_UPSELL_EXPORT_SETTINGS_REMOVE_WATERMARK,targetWorkspace:d,upsellLocation:"exportSettingsRemoveWatermark"})]})}),(0,t.jsx)(_.ModalFooter,{children:(0,t.jsx)(i.ButtonGroup,{children:(0,t.jsx)(C.Button,{onClick:()=>{n()},children:(0,t.jsx)(c.Trans,{message:"Done",id:"DPfwMq"})})})})]})]})});e.s(["ExportCardModalWithOfflineCheck",0,ev],417781);var eC=e.i(847092),ew=e.i(428683),eS=e.i(575084);let ek=(0,p.memo)(({isLocked:e,isDark:i=!1})=>(0,t.jsxs)(ew.Box,{as:"span",className:"fa-layers fa-fw",children:[(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faLink}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(G.FontAwesomeIcon,{icon:eS.faCircle,color:i?"var(--chakra-colors-gray-800)":"var(--chakra-colors-gray-50)",transform:"shrink-3 right-6 down-6"}),(0,t.jsx)(G.FontAwesomeIcon,{icon:eS.faLock,transform:"shrink-8 right-6 down-6"})]})]}));ek.displayName="LinkWithLockIcon";let eA=()=>{let e=(0,z.useAppSelector)(O.selectFile);if(!e)return!1;let t=R.config.SHARE_TOKEN,i=e.accessLinks?.some(e=>""===e.token),n=e.accessLinks?.some(e=>null===e.permission);return!!t||!!i&&!n};e.s(["useIsCardLinkSharingOpen",0,eA],124059);var eE=e.i(551880),e_=e.i(615393),eI=e.i(576897);let eM=({cardId:e})=>{let i=(0,z.useAppSelector)(eE.selectMode),n=(0,z.useAppSelector)(O.selectDoc),a=n?.id,r=a?(0,eI.getCardUrl)({cardId:e,docId:a,isPresentMode:i===e_.EditorModeEnum.SLIDE_VIEW}):"",s=(0,o.useToast)(),{onCopy:l}=(0,eC.useClipboard)(r);return{onCopyLinkClick:(0,p.useCallback)(()=>{a?(l(),s({title:u.i18n._({id:"BVYvMa",message:"URL copied"}),status:"success",duration:3e3,position:"top"})):s({title:(0,t.jsx)(c.Trans,{message:"Error copying link to card",id:"+ge1lq"}),status:"error",duration:3e3,position:"top"})},[l,s,a])}},eT=({attrs:e})=>{let i=eA(),{onCopyLinkClick:n}=eM({cardId:e.id});return(0,t.jsx)(y.ToolbarButton,{onClick:e=>{e.target&&e.target?.closest('[data-testid="open-share"]')?e.preventDefault():n()},label:i?(0,t.jsx)(c.Trans,{message:"Copy card link",id:"F0YmUY"}):(0,t.jsxs)(T.Stack,{spacing:"0",children:[(0,t.jsx)(r.Text,{children:(0,t.jsx)(c.Trans,{message:"Copy link to private card",id:"afMspw"})}),(0,t.jsx)(r.Text,{fontSize:"xxs",color:"gray.400",children:(0,t.jsx)(c.Trans,{message:"Only those with access will be able to view",id:"OpeWZK"})})]}),children:(0,t.jsx)(ek,{isLocked:!i})})};e.s(["CopyLinkButton",0,eT,"useCopyLink",0,eM],207556);let eL=({editor:e,selection:v,decorations:C})=>{let{isInOfflineMode:w}=(0,h.useHealthCheck)(),{node:S,from:k}=v,{attrs:A,isNested:E,isFirstCard:_}=(0,b.useCardState)({node:S,decorations:C,editor:e}),{isOpen:I,onOpen:M,onClose:T}=(0,f.useModalDisclosure)({id:"downloadCardAsImageDisclosure"}),L=(0,p.useCallback)(()=>{e?.commands.duplicateCard(k)},[e,k]),j=(0,p.useCallback)(()=>{e?.commands.unnestCard(k)},[e,k]),P=(0,p.useCallback)(()=>{e?.chain().mergeCardsAtPos(k).focus().run()},[e,k]),D=(0,o.useToast)(),N=(0,p.useCallback)(()=>{let i=e.state.doc.nodeAt(k),o=i&&(0,d.getCardTitle)(i.toJSON()),s=o?`"${o}"`:"card";e.chain().deleteCard(k).focus().run();let c=u.i18n._({id:"0MWv65",message:"Deleted {displayTitle}.",values:{displayTitle:s}}),p=u.i18n._({id:"9uI/rE",message:"Undo"}),h=D({title:(0,t.jsxs)(n.HStack,{children:[(0,t.jsx)(r.Text,{noOfLines:1,children:c}),(0,t.jsx)(a.Link,{textDecoration:"underline",onClick:()=>{(0,l.undo)(e.state),D.close(h)},children:p})]}),status:"info",duration:3e3,position:"top"})},[e,k,D]),R=(0,g.useFeatureFlag)("copyCardsToDeck"),O=(0,m.useOpenSearchWithCardsToCopy)();return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(i.ButtonGroup,{spacing:1,size:"sm",alignItems:"center",children:[(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Duplicate card",id:"BTDPLo"}),testId:"duplicate-card",onClick:L,icon:s.faClone}),E&&(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Merge into parent card",id:"b+J8Wt"}),testId:"merge-into-parent-card",onClick:j,icon:s.faArrowUpLeft}),!E&&!_&&(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Merge into card above",id:"kV34zB"}),testId:"merge-into-card-above",onClick:P,icon:s.faArrowUp}),(0,t.jsx)(eT,{attrs:A}),R&&(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Copy to...",id:"IAsTWw"}),onClick:()=>O([S]),icon:s.faObjectUngroup,flipIcon:"horizontal",isDisabled:w}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Export card",id:"xRJ+bN"}),testId:"download-card",onClick:M,icon:s.faArrowDownToBracket,isDisabled:w}),(0,t.jsx)(ev,{onOpen:M,isOpen:I,onClose:T,cardId:A.id,editor:e})]}),(0,t.jsx)(x.DeleteNodeButton,{editor:e,handleDelete:N})]})})};e.s(["CardTOCFormattingMenu",0,({editor:e,selection:n})=>{let{nested:a}=n.node.attrs;return(0,t.jsxs)(i.ButtonGroup,{spacing:0,size:"sm",children:[(0,t.jsx)(y.ToolbarButton,{testId:"toc-top-level-cards",label:(0,t.jsx)(c.Trans,{message:"Show top-level cards",id:"RiLgqi"}),icon:s.faList,onClick:()=>{e.commands.updateAttributes("tableOfContents",{nested:!1})},isActive:!a}),(0,t.jsx)(y.ToolbarButton,{testId:"toc-nested-cards",label:(0,t.jsx)(c.Trans,{message:"Show all nested cards",id:"nTkST4"}),icon:s.faListTree,onClick:()=>{e.commands.updateAttributes("tableOfContents",{nested:!0})},isActive:a})]})}],136008);var ej=e.i(686296),eP=e.i(344233);e.i(828525);var eD=e.i(896620),eN=e.i(194279),eR=e.i(864935);let eO=({label:e,control:i,icon:a})=>(0,t.jsxs)(n.HStack,{spacing:4,children:[a,(0,t.jsx)(r.Text,{children:e}),(0,t.jsx)(W.Spacer,{}),(0,t.jsx)(ew.Box,{children:i})]});function eB(e,t){return function(i,n,a){return t({chartAttributes:{...a,[e]:{...a[e]??{},[i]:n}}})}}let ez=({chartType:e,attributes:i,updateAttributes:n})=>{let a=i.chartAttributes||{},r=a[e],o=eB(e,n);return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(eO,{label:u.i18n._({id:"Y7a6MU",message:"Axis always includes zero"}),control:(0,t.jsx)(eu.Switch,{isChecked:r?.axisPullToZero??!0,onChange:e=>o("axisPullToZero",e.target.checked,a)})})})},eF=({chartType:e="bar",...i})=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(ez,{chartType:e,...i})});var eH=e.i(363278),eW=e.i(721455),eU=e.i(148318),eV=e.i(182895),eG=e.i(704273),e$=e.i(259658);let eZ=({attributes:e,updateAttributes:i})=>{let a=e.chartAttributes||{},o=a.pie||{},s=eB("pie",i),l=o.legendPosition??"bottom",d={top:u.i18n._({id:"WWy8TN",message:"Top"}),right:u.i18n._({id:"nOPbWJ",message:"Right"}),bottom:u.i18n._({id:"zsiX7I",message:"Bottom"}),left:u.i18n._({id:"UlKSMd",message:"Left"})};return(0,t.jsx)(eO,{label:u.i18n._({id:"G4H8LE",message:"Legend position"}),control:(0,t.jsxs)(eW.Menu,{isLazy:!0,children:[(0,t.jsx)(eU.MenuButton,{as:C.Button,variant:"plain",size:"sm",w:40,boxShadow:"none",textAlign:"left",rightIcon:(0,t.jsx)(eH.ChevronDownIcon,{}),sx:{"span:first-of-type":{overflow:"clip",textOverflow:"ellipsis"}},children:d[l]}),(0,t.jsx)(eG.MenuList,{zIndex:"modalPopover",children:(0,t.jsx)(e$.MenuOptionGroup,{value:l,type:"radio",onChange:e=>{var t;s("legendPosition",void 0===d[t=Array.isArray(e)?e[0]:e]?"bottom":t,a)},children:Object.entries(d).map(([e,i])=>(0,t.jsx)(eV.MenuItemOption,{value:e,children:(0,t.jsx)(n.HStack,{children:(0,t.jsx)(r.Text,{children:i})})},e))})})]})})},eK={pie:eZ,donut:eZ,line:({...e})=>(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(ez,{chartType:"line",...e})}),bar:eF,"horizontal-bar":e=>(0,t.jsx)(eF,{...e,chartType:"horizontal-bar"})};var eq=e.i(466511);let eY=({accentColor:e,selected:i,onChange:n,steps:a=5})=>(0,t.jsx)(eO,{icon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faFillDrip}),label:u.i18n._({id:"tvmuQ0",message:"Color scheme"}),control:(0,t.jsx)(eq.ColorSchemeDropdown,{accentColor:e,selected:i,onChange:n,steps:a})}),eX=e=>{let{attributes:n,updateAttributes:a,accentColor:r,setEditing:o,editor:l}=e,d=eK[n.chartType],{data:p}=n,h=(0,g.useFeatureFlag)("chartInlineLabels");return(0,t.jsxs)(T.Stack,{spacing:0,children:[(0,t.jsxs)(T.Stack,{spacing:4,p:4,children:[(0,t.jsx)(i.ButtonGroup,{mb:2,children:Object.entries(eN.CHART_TYPES).map(([e,{icon:i,selectedIcon:r,label:o}])=>{let s=n.chartType===e;return(0,t.jsx)(eD.GammaTooltip,{placement:"top",label:o(),children:(0,t.jsx)(eP.IconButton,{"aria-label":o(),flex:1,variant:"plain",size:"md",icon:s?r:i,boxShadow:"none",background:s?"trueblue.50":"white",color:s?"trueblue.400":"gray.600",onClick:()=>a({chartType:e})})},`${o()}`)})}),(0,t.jsx)(eY,{accentColor:r,selected:n.colorScheme,steps:5,onChange:e=>{a({colorScheme:e})}}),(0,t.jsx)(eO,{icon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faInputText}),label:u.i18n._({id:"sgzcYD",message:"Show labels"}),control:(0,t.jsx)(eu.Switch,{isChecked:!n.hideLabels,onChange:e=>a({hideLabels:!e.target.checked})})}),h&&(0,t.jsx)(eO,{icon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faInputNumeric}),label:u.i18n._({id:"hw0byi",message:"Show values"}),control:(0,t.jsx)(eu.Switch,{isChecked:n.showInlineLabels,onChange:e=>a({showInlineLabels:e.target.checked})})}),l&&(0,t.jsx)(eO,{icon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faAlignLeft}),label:u.i18n._({id:"0j+RGO",message:"Horizontal alignment"}),control:(0,t.jsx)(i.ButtonGroup,{dir:"ltr",spacing:1,size:"sm",children:eR.AlignmentCommands.map(({name:e,icon:i,checkActive:n,apply:a})=>{if(n&&a)return(0,t.jsx)(y.ToolbarButton,{label:e(),icon:i,onClick:()=>{a(l)},isActive:n(l),my:0},e())})})}),d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(w.Divider,{my:3}),(0,t.jsx)(d,{...e})]})]}),o&&(0,t.jsx)(H.Flex,{px:5,py:3,bg:"gray.50",alignItems:"center",justify:"center",children:(0,t.jsx)(C.Button,{variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faEdit}),onClick:()=>o(!0),children:p?(0,t.jsx)(c.Trans,{message:"Edit chart data",id:"BhcOHV"}):(0,t.jsx)(c.Trans,{message:"Add chart data",id:"UHoZ5e"})})})]})};e.s(["ChartOptions",0,eX],765996),e.s(["ChartFormattingMenu",0,({editor:e,selection:i})=>{let n=(0,z.useAppSelector)(eE.selectTheme),a=i.node,r=(0,ej.getThemeColorSolid)((0,ej.getThemePrimaryAccentColor)(n));return a?(0,t.jsx)(eX,{attributes:a.attrs,updateAttributes:t=>{e.chain().updateAttributes("chart",t).focus().run()},accentColor:r,setEditing:()=>{e.commands.editSelectedChart()},editor:e,inline:!0}):null}],229895);var eQ=e.i(315261),eJ=e.i(261442);let e0=({icon:e,label:i,children:n,iconProps:a,isHidden:o,...s})=>o?null:(0,t.jsxs)(T.Stack,{direction:"row",spacing:8,alignItems:"center",justifyContent:"space-between",...s,children:[(e||i)&&(0,t.jsxs)(H.Flex,{gap:4,alignItems:"center",children:[e&&(0,t.jsx)(G.FontAwesomeIcon,{icon:e,fixedWidth:!0,...a}),i&&(0,t.jsx)(r.Text,{fontSize:"sm",children:i})]}),n]}),e1=({icon:e,label:i,onClick:n,colorScheme:a="gray",secondaryIcon:r,secondaryLabel:o,secondaryAction:s,secondaryColorScheme:l="gray"})=>(0,t.jsxs)(H.Flex,{px:5,py:3,bg:"gray.50",mx:-4,mb:-4,justifyContent:o?"space-between":"center",alignItems:"center",children:[o&&s&&(0,t.jsx)(C.Button,{variant:"link",size:"sm",colorScheme:l,leftIcon:r?(0,t.jsx)(G.FontAwesomeIcon,{icon:r,fixedWidth:!0}):void 0,onClick:s,onMouseDown:eJ.preventDefaultToAvoidBlur,children:o}),(0,t.jsx)(C.Button,{variant:"link",size:"sm",colorScheme:a,leftIcon:e?(0,t.jsx)(G.FontAwesomeIcon,{icon:e,fixedWidth:!0}):void 0,onClick:n,onMouseDown:eJ.preventDefaultToAvoidBlur,children:i})]}),e2=({...e})=>(0,t.jsx)(w.Divider,{my:1,...e});e.s(["FormattingPopoverMenuDivider",0,e2,"FormattingPopoverMenuFooter",0,e1,"FormattingPopoverMenuRow",0,e0],316969);let e3=({children:e,...i})=>(0,t.jsx)(T.Stack,{spacing:4,p:4,...i,children:e});e.s(["FormattingPopoverMenuSection",0,e3],976996);let e5="14px",e4="28px",e6=({label:e,withSidePadding:i=!1,children:n,...a})=>(0,t.jsxs)(T.Stack,{direction:"row",spacing:3,...a,children:[e&&(0,t.jsx)(T.Stack,{alignSelf:"center",justifyContent:"start",minWidth:n?"max-content":"100%",h:e4,pl:i?e5:void 0,children:(0,t.jsx)(H.Flex,{justifyContent:"flex-start",alignItems:"center",width:"100%",height:"100%",children:e})}),n&&(0,t.jsx)(T.Stack,{alignSelf:"center",width:"100%",pr:i?e5:void 0,h:e4,children:(0,t.jsx)(H.Flex,{justifyContent:"flex-end",alignItems:"center",width:"100%",height:"100%",children:n})})]}),e9=({editor:e})=>(0,t.jsx)(i.ButtonGroup,{dir:"ltr",spacing:1,size:"sm",children:eR.AlignmentCommands.map(({name:i,icon:n,checkActive:a,apply:r})=>{if(a&&r)return(0,t.jsx)(y.ToolbarButton,{label:i(),icon:n,onClick:()=>{r(e)},isActive:a(e),my:0},i())})});var e8=e.i(78608),e7=e.i(662727);let te=({contributors:e,hiddenContributorIds:i,toggleOneVisibleContributor:n,toggleAllVisibleContributors:a,isDisabled:o=!1})=>{let s=i?.length===0;return(0,t.jsxs)(eW.Menu,{isLazy:!0,children:[(0,t.jsx)(eU.MenuButton,{as:C.Button,variant:"plain",size:"sm",boxShadow:"none",minW:"max-content",textAlign:"left",rightIcon:(0,t.jsx)(G.FontAwesomeIcon,{icon:eS.faChevronDown,size:"xs",fixedWidth:!0}),isDisabled:o,children:s?(0,t.jsx)(c.Trans,{message:"Show all",id:"lZw9AX"}):(0,t.jsx)(c.Trans,{message:"Custom",id:"8Tg/JR"})}),(0,t.jsx)(eG.MenuList,{minWidth:"max-content",padding:0,children:(0,t.jsxs)(T.Stack,{spacing:1,py:3,children:[(0,t.jsx)(e6,{label:(0,t.jsx)(c.Trans,{message:"Show all",id:"lZw9AX"}),withSidePadding:!0,children:(0,t.jsx)(eu.Switch,{isChecked:s,onChange:a})}),(0,t.jsx)(w.Divider,{py:2}),(0,t.jsx)(e6,{label:(0,t.jsx)(e8.SectionTitle,{children:(0,t.jsx)(r.Text,{children:(0,t.jsx)(c.Trans,{message:"Custom",id:"8Tg/JR"})})}),withSidePadding:!0}),e.map(a=>(0,t.jsx)(tt,{contributor:a,contributors:e,toggleOneVisibleContributor:n,hiddenContributorIds:i,allVisible:s},a.user.id))]})})]})},tt=({contributor:e,contributors:i,toggleOneVisibleContributor:n,hiddenContributorIds:a,allVisible:o})=>{let s=i.length-a.length==1&&!a.includes(e.user.id);return(0,t.jsxs)(e6,{label:(0,t.jsxs)(H.Flex,{alignItems:"center",gap:2,children:[(0,t.jsx)(e7.TooltipAvatar,{size:"xs",src:e.user.profileImageUrl,opacity:o?.5:1}),(0,t.jsx)(r.Text,{fontSize:"md",fontFamily:"body",opacity:o?.5:1,sx:{cursor:o?"default":"text"},children:e.user.displayName})]}),paddingY:1.25,withSidePadding:!0,children:[(0,t.jsx)(W.Spacer,{w:4}),(0,t.jsx)(eu.Switch,{isChecked:!a.includes(e.user.id),onChange:()=>n(e.user.id),disabled:s})]})},ti=({contributors:e,hiddenContributorIds:i,hasMultipleContributors:n,toggleOneVisibleContributor:a,toggleAllVisibleContributors:r})=>(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Contributors",id:"YqsXfH"}),icon:s.faUserCircle,children:(0,t.jsx)(te,{contributors:e,hiddenContributorIds:i,toggleOneVisibleContributor:a,toggleAllVisibleContributors:r,isDisabled:!n})});e.s(["ContributorsFormattingMenu",0,({editor:e})=>{let i,{showTime:n=!0,hiddenContributorIds:a=[]}=e.getAttributes("contributors"),o=(0,z.useAppSelector)(O.selectDocEditors)||[],{toggleShowTime:l,toggleOneVisibleContributor:d,toggleAllVisibleContributors:u}=(i=(0,p.useCallback)(()=>{e.commands.toggleShowTime()},[e]),{toggleShowTime:i,toggleOneVisibleContributor:(0,p.useCallback)(t=>{e.commands.toggleOneContributorVisibility(t)},[e]),toggleAllVisibleContributors:(0,p.useCallback)(()=>{e.commands.toggleAllContributorsVisibility()},[e])}),h=o.length>1,m=(0,p.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]);return(0,t.jsxs)(e3,{children:[(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:s.faAlignLeft,children:(0,t.jsx)(e9,{editor:e})}),(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Show last edited time",id:"4ep6pq"}),icon:s.faClock,children:(0,t.jsx)(eu.Switch,{isChecked:n,onChange:l})}),h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e2,{}),(0,t.jsx)(ti,{contributors:o,hasMultipleContributors:h,hiddenContributorIds:a,toggleOneVisibleContributor:d,toggleAllVisibleContributors:u})]}),(0,t.jsxs)(r.Text,{fontSize:"xs",color:"gray.600",textAlign:"center",children:[(0,t.jsx)(c.Trans,{message:"Tip: edit your display name in account settings",id:"Xqn2KO"})," ",(0,t.jsx)(eQ.InfoTip,{label:(0,t.jsx)(c.Trans,{message:"On the dashboard, click on the workspace dropdown, then your name and profile photo.",id:"CYpThg"})})]}),(0,t.jsx)(e1,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,colorScheme:"red",onClick:m})]})}],515785);var tn=e.i(400551);e.s(["DrawingFormattingMenu",0,({editor:e,selection:n})=>{let a=(0,p.useCallback)(t=>{t.stopPropagation(),e.commands.editSelectedDrawingBlock?.()},[e]);return(0,t.jsxs)(i.ButtonGroup,{spacing:0,size:"sm",alignItems:"center",dir:"ltr",children:[eR.AlignmentCommands.map(({name:i,icon:n,checkActive:a,apply:r})=>{if(a&&r)return(0,t.jsx)(y.ToolbarButton,{label:i(),icon:n,onClick:()=>{r(e)},isActive:a(e)},i())}),(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Edit",id:"ePK91l"}),icon:s.faEdit,onClick:a}),(0,t.jsx)(tn.FormattingMenuDivider,{}),(0,t.jsx)(x.DeleteNodeButton,{editor:e})]})}],747420);var ta=e.i(358003),tr=e.i(244180);e.s(["FormatMenuPopover",0,({children:e,...i})=>{let{content:n}=(0,tr.useMultiStyleConfig)("Popover");return(0,t.jsx)(ta.chakra.div,{__css:n,p:0,overflow:"hidden",borderWidth:0,minW:"auto",width:"auto",...i,children:e})}],556504);let to=({selection:e,editor:n})=>{let a={square:{icon:s.faSquare,label:(0,t.jsx)(c.Trans,{message:"Square",id:"du/PIl"})},landscape:{icon:s.faRectangle,label:(0,t.jsx)(c.Trans,{message:"Landscape",id:"BZXXSi"})},portrait:{icon:s.faRectangleVertical,label:(0,t.jsx)(c.Trans,{message:"Portrait",id:"79gnko"})}},r=e.node.attrs;return(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Dimensions",id:"7bRShe"}),icon:s.faRectanglesMixed,children:(0,t.jsx)(i.ButtonGroup,{children:Object.entries(a).map(([i,{icon:a,label:o}])=>(0,t.jsx)(y.ToolbarButton,{icon:a,label:o,onClick:()=>{n.chain().updateAttributes("gallery",{dimensions:i}).setNodeSelection(e.from).run()},isActive:r.dimensions===i},i))})})};var ts=e.i(812405);e.s(["DEFAULT_THUMB_HEIGHT_EM",0,12,"DEFAULT_THUMB_SPACING_EM",0,1,"GALLERY_PADDING_EM",0,.8,"MAX_THUMB_HEIGHT_EM",0,15,"MAX_THUMB_SPACING_EM",0,2,"MIN_THUMB_HEIGHT_EM",0,5,"MIN_THUMB_SPACING_EM",0,.1,"MOBILE_THUMB_HEIGHT_EM",0,8],224852);let tl=({selection:e,editor:i})=>{let n=e.node.attrs.thumbHeight||12,a=(0,p.useCallback)(t=>{i.chain().updateAttributes("gallery",{thumbHeight:t}).setNodeSelection(e.from).focus().run()},[i,e.from]);return(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Size",id:"Cj2Gtd"}),icon:s.faSlider,children:(0,t.jsxs)(ts.Slider,{"aria-label":"gallery-slider",min:5,max:15,step:.25,value:n,onChange:a,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,t.jsx)(ts.SliderTrack,{children:(0,t.jsx)(ts.SliderFilledTrack,{})}),(0,t.jsx)(ts.SliderThumb,{background:"trueblue.500"})]})})},td=()=>({flex:{title:(0,t.jsx)(c.Trans,{message:"Flex",id:"oNVcTP"}),description:(0,t.jsx)(c.Trans,{message:"Lays out images and media horizontally",id:"HfsL0F"})},grid:{title:(0,t.jsx)(c.Trans,{message:"Grid",id:"fY+Mvd"}),description:(0,t.jsx)(c.Trans,{message:"Crops images to a uniform size and shape",id:"Ur6uwh"})},logo:{title:(0,t.jsx)(c.Trans,{message:"Logo",id:"iG7KNr"}),description:(0,t.jsx)(c.Trans,{message:"Adds spacing and prevents clipping",id:"hcTCev"})}}),tc=(e,t,i,n)=>{let a="flex"===e&&t.thumbHeight<5?5:"grid"===e||"logo"===e?Math.round(t.thumbHeight):void 0;i.chain().updateAttributes("gallery",{layout:e,dimensions:"grid"===e?"square":void 0,stretchToFill:"flex"!==e&&void 0,...a&&{thumbHeight:a}}).setNodeSelection(n.from).focus().run()},tu=({selection:e,editor:i})=>{let n=e.node.attrs,a=td(),o=Object.keys(a).includes(n.layout)?n.layout:"flex",l=a[o].title;return(0,t.jsxs)(eW.Menu,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,strategy:"fixed",children:[(0,t.jsx)(eU.MenuButton,{as:C.Button,"data-testid":"display-style-dropdown",size:"sm",rightIcon:(0,t.jsx)(G.FontAwesomeIcon,{fixedWidth:!0,icon:s.faChevronDown,transform:"shrink-6"}),boxShadow:"none",onMouseDown:eJ.preventDefaultToAvoidBlur,children:l}),(0,t.jsx)(eG.MenuList,{zIndex:2,maxW:"400px",children:(0,t.jsx)(e$.MenuOptionGroup,{type:"radio",onChange:t=>tc(t,n,i,e),value:n.layout,children:Object.entries(a).map(([e,{title:i,description:n}])=>(0,t.jsxs)(eV.MenuItemOption,{value:e,onMouseDown:eJ.preventDefaultToAvoidBlur,"data-testid":`display-style-option-${e}`,children:[(0,t.jsx)(r.Text,{children:i}),(0,t.jsx)(r.Text,{fontSize:"xs",color:"gray.500",children:n})]},e))})})]})};e.s(["GalleryLayoutPicker",0,tu,"getGalleryLayoutOptions",0,td,"onLayoutChange",0,tc],536420);let tp=({selection:e,editor:i})=>{let n=e.node.attrs.thumbSpacing||1,a=(0,p.useCallback)(t=>{i.chain().updateAttributes("gallery",{thumbSpacing:t}).setNodeSelection(e.from).focus().run()},[i,e.from]);return(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Spacing",id:"EL5s3L"}),icon:s.faSlider,children:(0,t.jsxs)(ts.Slider,{"aria-label":"gallery-slider",min:.1,max:2,step:.1,value:n,onChange:a,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,t.jsx)(ts.SliderTrack,{children:(0,t.jsx)(ts.SliderFilledTrack,{})}),(0,t.jsx)(ts.SliderThumb,{background:"trueblue.500"})]})})},th=({selection:e,editor:i})=>{let n=e.node.attrs,a=!0===n.stretchFill||null===n.stretchFill;return(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Stretch to fill",id:"57WAKT"}),icon:s.faArrowsLeftRight,children:(0,t.jsx)(eu.Switch,{isChecked:a,onChange:()=>{i.chain().updateAttributes("gallery",{stretchFill:!n.stretchFill}).setNodeSelection(e.from).run()}})})};e.s(["GalleryFormattingMenuV2",0,({selection:e,editor:n})=>{let a=0===e.node.childCount,{layout:r,stretchFill:o}=e.node.attrs,l=(0,p.useCallback)(()=>{n.chain().deleteSelectionAndSelectNear().run()},[n]);return a?null:(0,t.jsx)(ew.Box,{minW:"300px",children:(0,t.jsxs)(e3,{children:[!a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(T.Stack,{w:"100%",direction:"row",justify:"space-between",alignItems:"flex-start",children:(0,t.jsx)(e8.SectionTitle,{children:(0,t.jsx)(c.Trans,{message:"Gallery",id:"U+kFad"})})}),(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Layout",id:"rdU729"}),icon:s.faGrid,children:(0,t.jsx)(tu,{editor:n,selection:e})}),"grid"===r&&(0,t.jsx)(to,{editor:n,selection:e}),"flex"===r&&(0,t.jsx)(th,{editor:n,selection:e}),(0,t.jsx)(tl,{editor:n,selection:e}),"logo"===r&&(0,t.jsx)(tp,{editor:n,selection:e}),"flex"===r&&!0!==o&&null!==o&&(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:s.faAlignLeft,children:(0,t.jsx)(i.ButtonGroup,{dir:"ltr",spacing:0,size:"sm",onMouseDown:eJ.preventDefaultToAvoidBlur,_empty:{display:"none"},children:eR.AlignmentCommands.map(i=>{let{key:a,name:r,shortcut:o,icon:s,apply:l,checkActive:d}=i;if(!n||!l||!d)return null;let c=d(n);return(0,t.jsx)(y.ToolbarButton,{shortcut:o,icon:s,label:r(),onClick:()=>{l(n),n.chain().setNodeSelection(e.from).run()},isActive:c,testId:a},a)})})})]}),(0,t.jsx)(e1,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,colorScheme:"red",onClick:l})]})})}],198149),e.s(["GraphicPopoverFormattingMenu",()=>tE],494556);var tm=e.i(876533),tg=e.i(558247),tf=e.i(949833);let tb=e=>!e||0===e.top&&0===e.right&&0===e.bottom&&0===e.left;e.s(["clipStylesToCropRect",0,e=>({top:parseFloat(e[0])/100,right:parseFloat(e[1])/100,bottom:parseFloat(e[2])/100,left:parseFloat(e[3])/100}),"cropRectToClipStyles",0,e=>e?[`${100*e.top}%`,`${100*e.right}%`,`${100*e.bottom}%`,`${100*e.left}%`]:["0%","0%","0%","0%"],"cropRectToMask",0,e=>{let t=100*e.top,i=100*e.right,n=100*e.bottom,a=100*e.left,r=a+i===0?50:a/(i+a)*100,o=t+n===0?50:t/(t+n)*100;return` linear-gradient(#000 0 0) ${isNaN(r)?50:r}% ${isNaN(o)?50:o}% / ${100-a-i}% ${100-t-n}%, linear-gradient(rgba(0,0,0,0.4) 0 0)`},"cropRectToTransform",0,(e,t)=>{let i=1-e.left-e.right,n=1-e.top-e.bottom;if(i<=0||n<=0)return null;let a=1/i,r=100*e.left,o=100*e.top;return{scale:a,translateX:r,translateY:o,croppedAspectRatio:i/n*t,transform:`scale(${a}) translate(-${r}%, -${o}%)`}},"enforceCropMinimum",0,(e,t,i,n=tf.MIN_WIDTH_OR_HEIGHT_PIXELS)=>{let a={...e},r=n/t,o=n/i;if(1-a.left-a.right=0?a.right=e:(a.right=0,a.left=1-r)}if(1-a.top-a.bottom=0?a.bottom=e:(a.bottom=0,a.top=1-o)}return a},"isCropEmpty",0,tb],804508);var tx=e.i(316353),ty=e.i(753748);let tv=e=>{let t=(0,z.useAppDispatch)(),i=(0,p.useCallback)(({id:i})=>{tx.eventEmitter.emit("endClip",{id:i,confirm:!1}),t((0,ty.endCropping)()),e.commands.command(({tr:e})=>(e.doc.descendants((t,n)=>"graphic"!==t.type.name||t.attrs.id!==i||(e.setNodeMarkup(n,void 0,{...t.attrs,crop:null}),!1)),!0))},[t,e]),n=(0,p.useCallback)(({id:e})=>{tx.eventEmitter.emit("endClip",{id:e,confirm:!1}),t((0,ty.endCropping)())},[t]),a=(0,p.useCallback)(({id:e})=>{tx.eventEmitter.emit("endClip",{id:e,confirm:!0}),t((0,ty.endCropping)())},[t]);return{cancelCrop:n,startCrop:(0,p.useCallback)(({id:e})=>{t((0,ty.startCropping)({id:e,clipType:"inset"})),tx.eventEmitter.emit("startCrop",{id:e})},[t]),confirmCrop:a,resetCrop:i}};e.s(["useGraphicCroppingControls",0,tv],147573);var tC=e.i(15272),tw=e.i(786928),tS=e.i(425605),tk=e.i(285042);let tA=({buttonList:e})=>{let n=e.filter(e=>!e.isHidden),a=1===n.length,r=n.filter(e=>!e.customButton),o=Math.max(0,5-n.filter(e=>e.customButton).length),l=0===o?0:r.length<=o?o:o-1,d=r.slice(0,l),p=r.slice(l,r.length),h=new Set(d.map(e=>e.key)),m=new Set(p.map(e=>e.key));return(0,t.jsxs)(i.ButtonGroup,{size:"sm",width:"100%",children:[n.map(e=>{let{key:i,customButton:n}=e;if(n)return(0,t.jsx)(ew.Box,{display:"flex",flex:a?void 0:1,width:a?"33%":void 0,children:n},i);if(m.has(i))return null;if(h.has(i)){let{label:n,ariaLabel:r,action:o,icon:s,customIcon:l,isDisabled:d=!1,isLoading:c=!1}=e;return s||l?(0,t.jsx)(eD.GammaTooltip,{label:n,placement:"top",children:(0,t.jsx)(ew.Box,{flex:a?void 0:1,width:a?"33%":void 0,tabIndex:d?-1:void 0,children:(0,t.jsx)(eP.IconButton,{"aria-label":r,icon:l||(0,t.jsx)(G.FontAwesomeIcon,{icon:s,fixedWidth:!0}),onClick:o,w:"100%",isDisabled:d,isLoading:c,onMouseDown:eJ.preventDefaultToAvoidBlur})})},i):null}return null}),!!p.length&&(0,t.jsxs)(eW.Menu,{children:[(0,t.jsx)(eD.GammaTooltip,{placement:"top",label:(0,t.jsx)(c.Trans,{message:"More options",id:"3Siwmw"}),children:(0,t.jsx)(eU.MenuButton,{as:eP.IconButton,"aria-label":u.i18n._({id:"3Siwmw",message:"More options"}),icon:(0,t.jsx)(G.FontAwesomeIcon,{icon:s.faEllipsis,fixedWidth:!0}),flex:1,shadow:"none"})}),(0,t.jsx)(eG.MenuList,{children:p.map(({key:e,label:i,action:n,icon:a,customIcon:r})=>(0,t.jsx)(tk.MenuItem,{icon:r||a&&(0,t.jsx)(G.FontAwesomeIcon,{icon:a,fixedWidth:!0}),onClick:n,children:i},e))})]})]})};e.s(["PopoverMenuButtonRow",0,tA],901267);let tE=({editor:e,selection:a})=>{let r=a.node.attrs,o={src:r.src,tempUrl:r.tempUrl,meta:r.meta??void 0,uploadStatus:r.uploadStatus},{horizontalAlign:l,crop:d,src:m,id:g}=r,{isInOfflineMode:f}=(0,h.useHealthCheck)(),b=(0,tg.useCanEditImageWithAI)(o),x=(0,tw.useToggleMediaDrawer)(),v=(0,z.useAppSelector)((0,ty.selectIsIdCropping)(g)),{startCrop:C,confirmCrop:w,cancelCrop:S,resetCrop:k}=tv(e),A=!tb(d),E=(0,p.useCallback)(t=>{e.view.focus(),x({isOpen:!0}),t.stopPropagation()},[e,x]),_=(0,p.useCallback)(()=>{(0,tC.addImageComment)(a)},[a]),I=(0,p.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]),M=(0,p.useCallback)(t=>{let i=a.from;e.chain().updateAttributesAtPos(i,{horizontalAlign:l===t?null:t}).selectNodeAtPos(i).run()},[e,a.from,l]),T=(0,p.useMemo)(()=>[{key:"addComment",ariaLabel:u.i18n._({id:"oFsfkI",message:"Add comment"}),label:(0,t.jsx)(c.Trans,{message:"Add comment",id:"oFsfkI"}),action:_,icon:s.faComment,isDisabled:f},{key:"ai",customButton:(0,t.jsx)(tm.DarkModeProvider,{isDark:!1,children:(0,t.jsx)(tS.BuddyImageEditDropdownMenu,{editor:e,attrs:o,buttonProps:{variant:"plain",flex:1}},"ai")},"ai"),isHidden:!b,ariaLabel:u.i18n._({id:"EVnzPs",message:"Edit with AI"}),label:(0,t.jsx)(c.Trans,{message:"Edit with AI",id:"EVnzPs"}),action:()=>{}},{key:"crop",ariaLabel:A?u.i18n._({id:"kRTGKt",message:"Edit crop"}):u.i18n._({id:"qKx+US",message:"Crop"}),label:A?(0,t.jsx)(c.Trans,{message:"Edit crop",id:"kRTGKt"}):(0,t.jsx)(c.Trans,{message:"Crop",id:"qKx+US"}),action:()=>{g&&C({id:g})},icon:s.faCrop,isHidden:!m},{key:"edit",ariaLabel:u.i18n._({id:"ePK91l",message:"Edit"}),label:(0,t.jsx)(c.Trans,{message:"Edit",id:"ePK91l"}),action:E,icon:s.faEdit}],[_,o,b,E,e,f,A,g,C,m]);return(0,t.jsxs)(e3,{children:[!v&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(tA,{buttonList:T}),(0,t.jsx)(e0,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:s.faAlignLeft,children:(0,t.jsx)(i.ButtonGroup,{dir:"ltr",spacing:0,size:"sm",onMouseDown:eJ.preventDefaultToAvoidBlur,children:eR.AlignmentCommands.map(({name:e,key:i,icon:n,shortcut:a,alignment:r})=>(0,t.jsx)(y.ToolbarButton,{label:e(),shortcut:a,isActive:l===r,onClick:()=>M(r),icon:n,testId:i,my:0},i))})}),(0,t.jsx)(e1,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,onClick:I,colorScheme:"red"})]}),v&&(0,t.jsx)(n.HStack,{alignSelf:"stretch",my:-3,mx:-2,zIndex:"menu",children:(0,t.jsxs)(i.ButtonGroup,{spacing:0,size:"sm",alignItems:"center",children:[(0,t.jsx)(y.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Reset crop",id:"6Z0nnS"}),icon:s.faRotateLeft,isDisabled:!A,onClick:()=>{g&&k({id:g})},my:0}),(0,t.jsx)(y.ToolbarButton,{color:"red.500",label:(0,t.jsx)(c.Trans,{message:"Cancel crop",id:"7Bn152"}),icon:s.faXmark,onClick:()=>{g&&S({id:g})},my:0}),(0,t.jsx)(y.ToolbarButton,{color:"green.500",label:(0,t.jsx)(c.Trans,{message:"Save crop",id:"ryQtQS"}),icon:s.faCheck,onClick:()=>{g&&w({id:g})},my:0})]})})]})};var t_=e.i(157965);e.s(["useColorSchemeOptions",0,({accentColor:e,steps:t=5})=>{let i=(0,z.useAppSelector)(eE.selectTheme),n=(0,ej.getThemeAccentColors)(i),a=(0,g.useFeatureFlag)("useNewChartingColorSet"),r=(0,eN.getChartColorSchemes)(a);return{schemaOptions:(0,p.useMemo)(()=>(0,t_.getFullColorSchemesList)({chartColorSchemes:r,useNewChartingColorSet:a,themeAccentColors:n,steps:t,theme:i,accentColor:e}),[e,n,i,a,r,t]),theme:i,useNewChartingColorSet:a}}],588319)},161592,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=e.r(731640)._(e.r(191788)).default.createContext(null)},852414,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"default",{enumerable:!0,get:function(){return p}});let n=e.r(731640)._(e.r(191788)),a=e.r(161592),r=[],o=[],s=!1;function l(e){let t=e(),i={loading:!0,loaded:null,error:null};return i.promise=t.then(e=>(i.loading=!1,i.loaded=e,e)).catch(e=>{throw i.loading=!1,i.error=e,e}),i}class d{constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}}function c(t){return function(t,i){let l=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},i),c=null;function u(){if(!c){let e=new d(t,l);c={getCurrentValue:e.getCurrentValue.bind(e),subscribe:e.subscribe.bind(e),retry:e.retry.bind(e),promise:e.promise.bind(e)}}return c.promise()}if("u"typeof window){let t=l.webpack&&"function"==typeof e.t.resolveWeak?l.webpack():l.modules;t&&o.push(e=>{for(let i of t)if(e.includes(i))return u()})}function p(e,t){let i;u(),(i=n.default.useContext(a.LoadableContext))&&Array.isArray(l.modules)&&l.modules.forEach(e=>{i(e)});let r=n.default.useSyncExternalStore(c.subscribe,c.getCurrentValue,c.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:c.retry}),[]),n.default.useMemo(()=>{var t;return r.loading||r.error?n.default.createElement(l.loading,{isLoading:r.loading,pastDelay:r.pastDelay,timedOut:r.timedOut,error:r.error,retry:c.retry}):r.loaded?n.default.createElement((t=r.loaded)&&t.default?t.default:t,e):null},[e,r])}return p.preload=()=>u(),p.displayName="LoadableComponent",n.default.forwardRef(p)}(l,t)}function u(e,t){let i=[];for(;e.length;){let n=e.pop();i.push(n(t))}return Promise.all(i).then(()=>{if(e.length)return u(e,t)})}c.preloadAll=()=>new Promise((e,t)=>{u(r).then(e,t)}),c.preloadReady=(e=[])=>new Promise(t=>{let i=()=>(s=!0,t());u(o,e).then(i,i)}),"u">typeof window&&(window.__NEXT_PRELOADREADY=c.preloadReady);let p=c},425167,(e,t,i)=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n={default:function(){return u},noSSR:function(){return c}};for(var a in n)Object.defineProperty(i,a,{enumerable:!0,get:n[a]});let r=e.r(731640),o=e.r(391398);e.r(191788);let s=r._(e.r(852414)),l="u"(0,o.jsx)(i,{error:null,isLoading:!0,pastDelay:!1,timedOut:!1})}function u(e,t){let i=s.default,n={loading:({error:e,isLoading:t,pastDelay:i})=>null};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let a=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?i({...n,loader:()=>null!=a?a().then(d):Promise.resolve(d(()=>null))}):(delete n.webpack,delete n.modules,c(i,n))}("function"==typeof i.default||"object"==typeof i.default&&null!==i.default)&&void 0===i.default.__esModule&&(Object.defineProperty(i.default,"__esModule",{value:!0}),Object.assign(i.default,i),t.exports=i.default)},168489,(e,t,i)=>{t.exports=e.r(425167)},613497,287816,42303,502400,e=>{"use strict";var t=e.i(408122);e.s(["getGraphyI18nStrings",0,function(){return{"common.save":t.i18n._({id:"aZTKpp",message:"Save"}),"common.cancel":t.i18n._({id:"tUKMxP",message:"Cancel"}),"common.confirm":t.i18n._({id:"mAPHIc",message:"Confirm"}),"common.delete":t.i18n._({id:"F+n1rj",message:"Delete"}),"common.confirmDelete":e=>{let{item:i}=e;return t.i18n._({id:"GS3saf",message:"Are you sure you want to delete {item}?",values:{item:i}})},"common.abbreviations.thousands":t.i18n._({id:"aO/26j",message:"k"}),"common.abbreviations.millions":t.i18n._({id:"7BUaGj",message:"m"}),"common.abbreviations.billions":t.i18n._({id:"2Hj55r",message:"b"}),"editor.title":t.i18n._({id:"WduDD8",message:"Graphy Editor"}),"editor.description":t.i18n._({id:"6tN0Zu",message:"Edit your content here"}),"editor.graphTypes.column":t.i18n._({id:"TWxjwq",message:"Column"}),"editor.graphTypes.columnStacked":t.i18n._({id:"0IgO9U",message:"Stacked"}),"editor.graphTypes.columnStackedFill":t.i18n._({id:"i8B6tV",message:"100% Stacked"}),"editor.graphTypes.bar":t.i18n._({id:"5aLZeZ",message:"Bar"}),"editor.graphTypes.barStacked":t.i18n._({id:"0IgO9U",message:"Stacked"}),"editor.graphTypes.barStackedFill":t.i18n._({id:"i8B6tV",message:"100% Stacked"}),"editor.graphTypes.line":t.i18n._({id:"ZbJ1ZN",message:"Line"}),"editor.graphTypes.areaStacked":t.i18n._({id:"6r47uw",message:"Stacked Area"}),"editor.graphTypes.pie":t.i18n._({id:"VGQq42",message:"Pie"}),"editor.graphTypes.donut":t.i18n._({id:"E7J60r",message:"Donut"}),"editor.graphTypes.scatter":t.i18n._({id:"KA0ARo",message:"Scatter"}),"editor.graphTypes.bubble":t.i18n._({id:"yBH6A6",message:"Bubble"}),"editor.graphTypes.funnel":t.i18n._({id:"Dtaqu3",message:"Funnel"}),"editor.graphTypes.combo":t.i18n._({id:"1+X09x",message:"Combo"}),"editor.graphTypes.heatmap":t.i18n._({id:"XBKmSM",message:"Heatmap"}),"editor.graphTypes.waterfall":t.i18n._({id:"J1LIkL",message:"Waterfall"}),"editor.graphTypes.mekko":t.i18n._({id:"a7INuw",message:"Mekko"}),"editor.graphTypes.table":t.i18n._({id:"v40Yh4",message:"Table"}),"editor.sizePanel.toolbarButton":t.i18n._({id:"x9Xn9f",message:"Size"}),"editor.sizePanel.presetsSection.title":t.i18n._({id:"EhKmJm",message:"Presets"}),"editor.sizePanel.customSizeSection.title":t.i18n._({id:"x3ETxH",message:"Custom size"}),"editor.sizePanel.presets.googleSlides":t.i18n._({id:"s2s0XQ",message:"Google Slides / PowerPoint"}),"editor.sizePanel.presets.webEmail":t.i18n._({id:"GWydgv",message:"Web / email"}),"editor.sizePanel.presets.linkedIn":t.i18n._({id:"zRyaQQ",message:"LinkedIn post"}),"editor.sizePanel.presets.instagram":t.i18n._({id:"Vzyx0R",message:"Instagram post"}),"editor.sizePanel.presets.tiktok":t.i18n._({id:"o5KDEA",message:"TikTok / Instagram story"}),"editor.sizePanel.presets.twitter":t.i18n._({id:"J+x/eS",message:"X (Twitter)"}),"editor.sizePanel.presets.mobile":t.i18n._({id:"14UdwS",message:"Mobile"}),"editor.sizePanel.inputs.unitLabel":t.i18n._({id:"sjY2PR",message:"px"}),"editor.sizePanel.validation.maxSizeError":e=>{let{max:i}=e;return t.i18n._({id:"O+wrYN",message:"≤ {max}px",values:{max:i}})},"editor.sizePanel.validation.minSizeError":e=>{let{min:i}=e;return t.i18n._({id:"DJ1nBw",message:"≥ {min}px",values:{min:i}})},"editor.graphPanel.toolbarButton":t.i18n._({id:"Xi9QUq",message:"Graph"}),"editor.graphPanel.graphTypeSection.title":t.i18n._({id:"lTnsMc",message:"Graph type"}),"editor.graphPanel.graphOptionsSection.title":t.i18n._({id:"Onpt49",message:"Graph options"}),"editor.graphPanel.graphOptions.sortBars":t.i18n._({id:"K5Irfx",message:"Sort high → low"}),"editor.graphPanel.graphOptions.gridLines":t.i18n._({id:"fJTm1w",message:"Grid lines"}),"editor.graphPanel.graphOptions.showPoints":t.i18n._({id:"6DeL+X",message:"Show points"}),"editor.graphPanel.graphOptions.smoothLines":t.i18n._({id:"+WGUMO",message:"Smooth lines"}),"editor.graphPanel.graphOptions.stackTotals":t.i18n._({id:"+pPY0m",message:"Stack totals"}),"editor.graphPanel.graphOptions.dataLabels":t.i18n._({id:"if44z8",message:"Data labels"}),"editor.graphPanel.graphOptions.showPercentages":t.i18n._({id:"WHvO6P",message:"Show percentages"}),"editor.graphPanel.graphOptions.categoryLabels":t.i18n._({id:"pe9NKM",message:"Category labels"}),"editor.graphPanel.legendSection.title":t.i18n._({id:"tfQmiT",message:"Legend"}),"editor.graphPanel.legendSection.right":t.i18n._({id:"/rM++D",message:"Right"}),"editor.graphPanel.legendSection.top":t.i18n._({id:"ZTtFh4",message:"Top"}),"editor.graphPanel.legendSection.none":t.i18n._({id:"mZX8ao",message:"None"}),"editor.graphPanel.numberFormatSection.title":t.i18n._({id:"yoZpzB",message:"Number format"}),"editor.graphPanel.numberFormat.abbreviationLabel":t.i18n._({id:"zineG/",message:"Abbreviation"}),"editor.graphPanel.numberFormat.valueLabel":t.i18n._({id:"WC9lFu",message:"Value"}),"editor.graphPanel.numberFormat.decimalPlacesLabel":t.i18n._({id:"vlakz4",message:"Decimal places"}),"editor.graphPanel.numberFormat.options.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.graphPanel.numberFormat.options.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.graphPanel.numberFormat.options.none":t.i18n._({id:"mZX8ao",message:"None"}),"editor.graphPanel.headlineNumberSize.sizeLabel":t.i18n._({id:"x9Xn9f",message:"Size"}),"editor.graphPanel.headlineNumberSize.valueLabel":t.i18n._({id:"WC9lFu",message:"Value"}),"editor.graphPanel.headlineNumberSize.sizes.small":t.i18n._({id:"c3baYK",message:"S"}),"editor.graphPanel.headlineNumberSize.sizes.medium":t.i18n._({id:"NTd7zd",message:"M"}),"editor.graphPanel.headlineNumberSize.sizes.large":t.i18n._({id:"nIX+7K",message:"L"}),"editor.graphPanel.lineThickness.label":t.i18n._({id:"48A2h+",message:"Line thickness"}),"editor.graphPanel.pointSize.label":t.i18n._({id:"yTfwIE",message:"Point size"}),"editor.graphPanel.pointSize.options.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.graphPanel.pointSize.options.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.graphPanel.headlineNumberSection.title":t.i18n._({id:"yIbdwY",message:"Headline number"}),"editor.graphPanel.headlineNumberSection.toggle":t.i18n._({id:"L0jBtP",message:"Visible"}),"editor.graphPanel.headlineNumberSection.metricLabel":t.i18n._({id:"Sqt2/g",message:"Metric"}),"editor.graphPanel.headlineNumberSection.compareWithLabel":t.i18n._({id:"CoDIBd",message:"Compare with"}),"editor.graphPanel.headlineNumberSection.metrics.total":t.i18n._({id:"2LRf8j",message:"Total"}),"editor.graphPanel.headlineNumberSection.metrics.average":t.i18n._({id:"gJ8HxQ",message:"Avg."}),"editor.graphPanel.headlineNumberSection.metrics.current":t.i18n._({id:"DKVcHj",message:"Last"}),"editor.graphPanel.headlineNumberSection.metrics.conversion":t.i18n._({id:"otR4zL",message:"Conversion"}),"editor.graphPanel.headlineNumberSection.metrics.left":t.i18n._({id:"WXkVj/",message:"Left"}),"editor.graphPanel.headlineNumberSection.comparison.first":t.i18n._({id:"9d7gSZ",message:"First"}),"editor.graphPanel.headlineNumberSection.comparison.previous":t.i18n._({id:"Qux/z5",message:"Previous"}),"editor.graphPanel.headlineNumberSection.pieTotalPosition.left":t.i18n._({id:"WXkVj/",message:"Left"}),"editor.graphPanel.headlineNumberSection.pieTotalPosition.center":t.i18n._({id:"d4kpNz",message:"Center"}),"editor.graphPanel.treatEmptyValues.leaveGap.label":t.i18n._({id:"+nx4zC",message:"Leave gap in chart"}),"editor.graphPanel.treatEmptyValues.leaveGap.description":t.i18n._({id:"j2ZyT8",message:"Leaves a visible break in the line where data is missing"}),"editor.graphPanel.treatEmptyValues.fillZero.label":t.i18n._({id:"Jt7k+T",message:"Fill with zero"}),"editor.graphPanel.treatEmptyValues.fillZero.description":t.i18n._({id:"FHmevG",message:"Displays missing data points as zero"}),"editor.graphPanel.treatEmptyValues.connectGaps.label":t.i18n._({id:"eLVIZ4",message:"Connect across gaps"}),"editor.graphPanel.treatEmptyValues.connectGaps.description":t.i18n._({id:"XLvD8S",message:"Joins the line between available points, skipping the gap"}),"editor.graphPanel.comboChartAppearance.title":t.i18n._({id:"wquhZ8",message:"Combo chart appearance"}),"editor.graphPanel.comboChartAppearance.groupedBars":t.i18n._({id:"mdBTf9",message:"Grouped bars"}),"editor.graphPanel.comboChartAppearance.stackedBars":t.i18n._({id:"LaMvxq",message:"Stacked bars"}),"editor.graphPanel.comboChartAppearance.linesOnly":t.i18n._({id:"xNkYC2",message:"Lines only"}),"editor.propertyMapping.title":t.i18n._({id:"BT7XMK",message:"Data"}),"editor.propertyMapping.xAxis":t.i18n._({id:"8gbuL8",message:"X-Axis"}),"editor.propertyMapping.yAxis":t.i18n._({id:"9MiFOW",message:"Y-Axis"}),"editor.propertyMapping.leftYAxis":t.i18n._({id:"z+a/D0",message:"Y-Axis (left)"}),"editor.propertyMapping.rightYAxis":t.i18n._({id:"PG0Awn",message:"Y-Axis (right)"}),"editor.propertyMapping.slices":t.i18n._({id:"fnEp+o",message:"Values (slices)"}),"editor.propertyMapping.labels":t.i18n._({id:"S47Uoq",message:"Labels"}),"editor.propertyMapping.size":t.i18n._({id:"x9Xn9f",message:"Size"}),"editor.propertyMapping.shape":t.i18n._({id:"yr4rNT",message:"Shape"}),"editor.propertyMapping.reset":t.i18n._({id:"IGS8Nk",message:"Reset all changes"}),"editor.propertyMapping.addSeries":t.i18n._({id:"lLl+sd",message:"Add another"}),"editor.propertyMapping.removeSeries":t.i18n._({id:"av4P1h",message:"Remove series"}),"editor.axesPanel.toolbarButton":t.i18n._({id:"KgedTg",message:"Axes"}),"editor.axesPanel.mainAxisSection.yAxis":t.i18n._({id:"9MiFOW",message:"Y-Axis"}),"editor.axesPanel.mainAxisSection.xAxis":t.i18n._({id:"8gbuL8",message:"X-Axis"}),"editor.axesPanel.crossAxisSection.xAxis":t.i18n._({id:"8gbuL8",message:"X-Axis"}),"editor.axesPanel.crossAxisSection.yAxis":t.i18n._({id:"9MiFOW",message:"Y-Axis"}),"editor.axesPanel.controls.visible":t.i18n._({id:"L0jBtP",message:"Visible"}),"editor.axesPanel.controls.labels":t.i18n._({id:"S47Uoq",message:"Labels"}),"editor.axesPanel.controls.position":t.i18n._({id:"sJ4McG",message:"Position"}),"editor.axesPanel.controls.scale":t.i18n._({id:"Tx+1th",message:"Scale"}),"editor.axesPanel.controls.startFrom":t.i18n._({id:"9hIsAL",message:"Start from"}),"editor.axesPanel.controls.endAt":t.i18n._({id:"HhYBsZ",message:"End at"}),"editor.axesPanel.controls.value":t.i18n._({id:"WC9lFu",message:"Value"}),"editor.axesPanel.controls.numberOfAxes":t.i18n._({id:"Caw7Ub",message:"Number of axes"}),"editor.axesPanel.controls.reverse":t.i18n._({id:"eyugAc",message:"Reverse"}),"editor.axesPanel.labelMode.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.axesPanel.labelMode.edges":t.i18n._({id:"ZihsKe",message:"Edges"}),"editor.axesPanel.scale.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.axesPanel.scale.log":t.i18n._({id:"Sowd0X",message:"Log"}),"editor.axesPanel.startFrom.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.axesPanel.startFrom.zero":t.i18n._({id:"0S1EGR",message:"Zero"}),"editor.axesPanel.startFrom.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.axesPanel.endAt.auto":t.i18n._({id:"529Eyu",message:"Auto"}),"editor.axesPanel.endAt.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.axesPanel.axisCount.single":t.i18n._({id:"e/fHZy",message:"Single"}),"editor.axesPanel.axisCount.double":t.i18n._({id:"1HZrr7",message:"Double"}),"editor.axesPanel.position.left":t.i18n._({id:"WXkVj/",message:"Left"}),"editor.axesPanel.position.right":t.i18n._({id:"/rM++D",message:"Right"}),"editor.axesPanel.position.top":t.i18n._({id:"ZTtFh4",message:"Top"}),"editor.axesPanel.position.bottom":t.i18n._({id:"UohuUZ",message:"Bottom"}),"editor.axesPanel.yesNo.yes":t.i18n._({id:"/RZFOx",message:"Yes"}),"editor.axesPanel.yesNo.no":t.i18n._({id:"9iwLsT",message:"No"}),"editor.colorPanel.toolbarButton":t.i18n._({id:"Dvhxbb",message:"Color"}),"editor.colorPanel.themeSection.title":t.i18n._({id:"lDOxYU",message:"Theme"}),"editor.colorPanel.paletteSection.title":t.i18n._({id:"MPZQhr",message:"Palette"}),"editor.colorPanel.paletteSection.colorScheme":t.i18n._({id:"c7KC1f",message:"Color scheme"}),"editor.colorPanel.paletteSection.colors":t.i18n._({id:"5FXxD5",message:"Colors"}),"editor.colorPanel.paletteSection.colorPalettes":t.i18n._({id:"YkBdRR",message:"Color palettes"}),"editor.colorPanel.paletteMode.preset":t.i18n._({id:"Z0+N9b",message:"Preset"}),"editor.colorPanel.paletteMode.brand":t.i18n._({id:"VHuYJP",message:"Brand"}),"editor.colorPanel.paletteMode.freestyle":t.i18n._({id:"3Byvge",message:"Freestyle"}),"editor.colorPanel.paletteThemes.colorful":t.i18n._({id:"wj65vC",message:"Colorful"}),"editor.colorPanel.paletteThemes.pastel":t.i18n._({id:"bQiyMx",message:"Pastel"}),"editor.colorPanel.paletteThemes.neon":t.i18n._({id:"obxkOW",message:"Neon"}),"editor.colorPanel.backgroundSection.title":t.i18n._({id:"9gDj0J",message:"Background"}),"editor.colorPanel.backgroundSection.black":t.i18n._({id:"oaudsN",message:"Black"}),"editor.colorPanel.backgroundSection.white":t.i18n._({id:"pX2nJH",message:"White"}),"editor.colorPanel.backgroundSection.grey":t.i18n._({id:"mk84XG",message:"Grey"}),"editor.colorPanel.backgroundSection.tint":t.i18n._({id:"xFacoB",message:"Tint"}),"editor.colorPanel.backgroundSection.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.colorPanel.backgroundSection.none":t.i18n._({id:"mZX8ao",message:"None"}),"editor.colorPanel.borderSection.title":t.i18n._({id:"krrD0G",message:"Border"}),"editor.colorPanel.borderSection.borderColor":t.i18n._({id:"SPuXc4",message:"Border color"}),"editor.colorPanel.borderSection.thickness":t.i18n._({id:"llaYq3",message:"Thickness"}),"editor.colorPanel.borderSection.cornerRadius":t.i18n._({id:"R/10la",message:"Corner radius"}),"editor.colorPanel.borderType.solid":t.i18n._({id:"ImTHfZ",message:"Solid"}),"editor.colorPanel.borderType.gradient":t.i18n._({id:"xnDshS",message:"Gradient"}),"editor.colorPanel.borderType.grey":t.i18n._({id:"mk84XG",message:"Grey"}),"editor.colorPanel.borderType.preset":t.i18n._({id:"Z0+N9b",message:"Preset"}),"editor.colorPanel.borderType.custom":t.i18n._({id:"vCktod",message:"Custom"}),"editor.colorPanel.borderType.none":t.i18n._({id:"mZX8ao",message:"None"}),"editor.colorPanel.presetGradients.lilac":t.i18n._({id:"Pz425S",message:"Lilac"}),"editor.colorPanel.presetGradients.neonPink":t.i18n._({id:"drN/kY",message:"Neon Pink"}),"editor.colorPanel.presetGradients.blackberry":t.i18n._({id:"FerDxj",message:"Blackberry"}),"editor.colorPanel.presetGradients.sun":t.i18n._({id:"FvjWgn",message:"Sun"}),"editor.colorPanel.presetGradients.iceland":t.i18n._({id:"G/aYnJ",message:"Iceland"}),"editor.colorPanel.presetGradients.sunset":t.i18n._({id:"VGMcmi",message:"Sunset"}),"editor.colorPanel.presetGradients.ultraviolet":t.i18n._({id:"sdb/Ji",message:"Ultraviolet"}),"editor.colorPanel.presetGradients.purple":t.i18n._({id:"P4cdPE",message:"Purple"}),"editor.colorPanel.presetGradients.iceCream":t.i18n._({id:"PN2b7K",message:"Ice Cream"}),"editor.colorPanel.presetGradients.mint":t.i18n._({id:"hmYpsO",message:"Mint"}),"editor.colorPanel.presetGradients.cool":t.i18n._({id:"+tz3Lu",message:"Cool"}),"editor.colorPanel.presetGradients.fresh":t.i18n._({id:"2sJJnc",message:"Fresh"}),"editor.designPanel.toolbarButton":t.i18n._({id:"UE2sex",message:"Design"}),"editor.designPanel.defaultExpanded":t.i18n._({id:"MPZQhr",message:"Palette"}),"editor.annotatePanel.toolbarButton":t.i18n._({id:"n/LDsQ",message:"Annotate"}),"editor.annotatePanel.callOutSection.title":t.i18n._({id:"UbulY2",message:"Call-out"}),"editor.annotatePanel.callOutSection.text":t.i18n._({id:"3KRbUA",message:"Text"}),"editor.annotatePanel.callOutSection.arrow":t.i18n._({id:"3qO7zY",message:"Arrow"}),"editor.annotatePanel.callOutSection.box":t.i18n._({id:"4ymnOI",message:"Box"}),"editor.annotatePanel.callOutSection.differenceArrows":t.i18n._({id:"ptLweW",message:"Difference arrows"}),"editor.annotatePanel.highlightSection.title":t.i18n._({id:"CvDpSx",message:"Highlight"}),"editor.annotatePanel.highlightSection.button":t.i18n._({id:"CvDpSx",message:"Highlight"}),"editor.annotatePanel.highlightSection.colorLabel":t.i18n._({id:"d/I4oG",message:"Highlight color"}),"editor.annotationsPanel.toolbarButton":t.i18n._({id:"n/LDsQ",message:"Annotate"}),"editor.annotationsPanel.freeformSection.title":t.i18n._({id:"Jn35kD",message:"Freeform"}),"editor.annotationsPanel.freeformSection.text":t.i18n._({id:"3KRbUA",message:"Text"}),"editor.annotationsPanel.freeformSection.arrow":t.i18n._({id:"3qO7zY",message:"Arrow"}),"editor.annotationsPanel.freeformSection.box":t.i18n._({id:"4ymnOI",message:"Box"}),"editor.annotationsPanel.freeformSection.difference":t.i18n._({id:"Rx4jhb",message:"Difference"}),"editor.annotationsPanel.goalSection.title":t.i18n._({id:"HiRrjH",message:"Goal"}),"editor.annotationsPanel.goalSection.labelControl":t.i18n._({id:"n2rqnS",message:"Label"}),"editor.annotationsPanel.goalSection.labelPlaceholder":t.i18n._({id:"HiRrjH",message:"Goal"}),"editor.annotationsPanel.goalSection.labelAriaLabel":t.i18n._({id:"XwoGn0",message:"Custom goal label"}),"editor.annotationsPanel.goalSection.valueControl":t.i18n._({id:"kwz2uO",message:"Goal value"}),"editor.annotationsPanel.goalSection.valueAriaLabel":t.i18n._({id:"kwz2uO",message:"Goal value"}),"editor.annotationsPanel.goalSection.byDate":t.i18n._({id:"hGmQqS",message:"By date"}),"editor.annotationsPanel.goalSection.xAxisValue":t.i18n._({id:"LBDali",message:"X-axis value"}),"editor.annotationsPanel.goalSection.optional":t.i18n._({id:"u0yDUH",message:"(optional)"}),"editor.annotationsPanel.trendsAndAveragesSection.title":t.i18n._({id:"lZ5beY",message:"Trends and Averages"}),"editor.annotationsPanel.trendsAndAveragesSection.trend":t.i18n._({id:"k7bc+6",message:"Trend"}),"editor.annotationsPanel.trendsAndAveragesSection.average":t.i18n._({id:"uFJllz",message:"Average"}),"editor.annotationsPanel.trendType.label":t.i18n._({id:"9CIV5k",message:"Trend type"}),"editor.annotationsPanel.trendType.placeholder":t.i18n._({id:"9CIV5k",message:"Trend type"}),"editor.annotationsPanel.trendType.options.linear":t.i18n._({id:"fOHyG1",message:"Linear"}),"editor.annotationsPanel.trendType.options.exponential":t.i18n._({id:"sNDX60",message:"Exponential"}),"editor.annotationsPanel.trendType.options.quadratic":t.i18n._({id:"Hy/Wau",message:"Quadratic"}),"editor.annotationsPanel.trendType.options.polynomial":t.i18n._({id:"vnfF2I",message:"Polynomial"}),"editor.annotationsPanel.trendType.options.logarithmic":t.i18n._({id:"mMZg/U",message:"Logarithmic"}),"editor.annotationsPanel.trendType.options.power":t.i18n._({id:"4sADgb",message:"Power"}),"editor.annotationsPanel.trendType.options.loess":t.i18n._({id:"0NFLsC",message:"Loess"}),"editor.annotationsPanel.averageLineSeries.label":t.i18n._({id:"+01e9/",message:"Average line series"}),"editor.annotationsPanel.averageLineSeries.placeholder":t.i18n._({id:"wKFsoU",message:"Select series"}),"editor.annotationsPanel.averageLineSeries.ariaLabel":t.i18n._({id:"sY0phw",message:"Series dropdown for average line"}),"editor.annotationsPanel.highlightSection.title":t.i18n._({id:"CvDpSx",message:"Highlight"}),"editor.annotationsPanel.highlightSection.button":t.i18n._({id:"CvDpSx",message:"Highlight"}),"editor.annotationsPanel.highlightSection.fadeColorLabel":t.i18n._({id:"ns9yMU",message:"Fade color"}),"editor.annotationsPanel.titleAndSubtitleSection.title":t.i18n._({id:"TYZr+a",message:"Title & Subtitle"}),"editor.annotationsPanel.titleAndSubtitleSection.toggleTitle":t.i18n._({id:"fF8HDC",message:"Title"}),"editor.annotationsPanel.titleAndSubtitleSection.subtitle":t.i18n._({id:"9DgcdQ",message:"Subtitle"}),"editor.annotationsPanel.captionAndSourceSection.title":t.i18n._({id:"xlkAu8",message:"Caption & Source"}),"editor.annotationsPanel.captionAndSourceSection.caption":t.i18n._({id:"Zfc+Tk",message:"Caption"}),"editor.annotationsPanel.captionAndSourceSection.source":t.i18n._({id:"4i4q8S",message:"Source"}),"editor.annotationsPanel.captionAndSourceSection.url":t.i18n._({id:"ZjzO4D",message:"URL"}),"editor.annotationsPanel.captionAndSourceSection.name":t.i18n._({id:"/svG+T",message:"Name"}),"editor.elementsPanel.toolbarButton":t.i18n._({id:"/NYQIb",message:"Elements"}),"editor.elementsPanel.headerSection.title":t.i18n._({id:"Hk9WO6",message:"Header"}),"editor.elementsPanel.headerSection.toggleTitle":t.i18n._({id:"fF8HDC",message:"Title"}),"editor.elementsPanel.headerSection.subtitle":t.i18n._({id:"9DgcdQ",message:"Subtitle"}),"editor.elementsPanel.footerSection.title":t.i18n._({id:"+17YC2",message:"Footer"}),"editor.elementsPanel.footerSection.caption":t.i18n._({id:"Zfc+Tk",message:"Caption"}),"editor.elementsPanel.footerSection.source":t.i18n._({id:"4i4q8S",message:"Source"}),"editor.elementsPanel.footerSection.url":t.i18n._({id:"ZjzO4D",message:"URL"}),"editor.elementsPanel.footerSection.name":t.i18n._({id:"/svG+T",message:"Name"}),"editor.elementsPanel.textSizeSection.title":t.i18n._({id:"bnCeBa",message:"Text size"}),"editor.elementsPanel.textSizeSection.scaleFormat":e=>{let{value:i}=e;return t.i18n._({id:"KgDwK3",message:"{value}x",values:{value:i}})},"editor.elementsPanel.fontSection.title":t.i18n._({id:"uST8kS",message:"Font"}),"editor.elementsPanel.sourceSection.title":t.i18n._({id:"4i4q8S",message:"Source"}),"editor.elementsPanel.sourceSection.url":t.i18n._({id:"ZjzO4D",message:"URL"}),"editor.elementsPanel.sourceSection.name":t.i18n._({id:"/svG+T",message:"Name"}),"editor.powerUpPanel.toolbarButton":t.i18n._({id:"hSuoCI",message:"Power-ups"}),"editor.powerUpPanel.goalSection.title":t.i18n._({id:"HiRrjH",message:"Goal"}),"editor.powerUpPanel.goalSection.toggle":t.i18n._({id:"HiRrjH",message:"Goal"}),"editor.powerUpPanel.goalSection.labelControl":t.i18n._({id:"n2rqnS",message:"Label"}),"editor.powerUpPanel.goalSection.labelPlaceholder":t.i18n._({id:"HiRrjH",message:"Goal"}),"editor.powerUpPanel.goalSection.labelAriaLabel":t.i18n._({id:"XwoGn0",message:"Custom goal label"}),"editor.powerUpPanel.goalSection.valueControl":t.i18n._({id:"kwz2uO",message:"Goal value"}),"editor.powerUpPanel.goalSection.byDate":t.i18n._({id:"hGmQqS",message:"By date"}),"editor.powerUpPanel.goalSection.xAxisValue":t.i18n._({id:"LBDali",message:"X-axis value"}),"editor.powerUpPanel.goalSection.optional":t.i18n._({id:"hlPs9I",message:" (optional)"}),"editor.powerUpPanel.goalSection.xAxisReferenceAriaLabel":t.i18n._({id:"yHenPO",message:"X-axis reference value"}),"editor.powerUpPanel.goalSection.anyXAxisValue":t.i18n._({id:"clwpfk",message:"Any x-axis value"}),"editor.powerUpPanel.goalSection.selectValuePlaceholder":t.i18n._({id:"0PXozu",message:"Select value"}),"editor.powerUpPanel.trendSection.title":t.i18n._({id:"k7bc+6",message:"Trend"}),"editor.powerUpPanel.trendSection.toggle":t.i18n._({id:"k7bc+6",message:"Trend"}),"editor.powerUpPanel.averageSection.title":t.i18n._({id:"uFJllz",message:"Average"}),"editor.powerUpPanel.averageSection.toggle":t.i18n._({id:"uFJllz",message:"Average"}),"editor.powerUpPanel.averageSection.seriesLabel":t.i18n._({id:"+01e9/",message:"Average line series"}),"editor.powerUpPanel.averageSection.seriesPlaceholder":t.i18n._({id:"wKFsoU",message:"Select series"}),"editor.powerUpPanel.averageSection.seriesAriaLabel":t.i18n._({id:"sY0phw",message:"Series dropdown for average line"}),"editor.powerUpPanel.trendType.label":t.i18n._({id:"9CIV5k",message:"Trend type"}),"editor.powerUpPanel.trendType.placeholder":t.i18n._({id:"9CIV5k",message:"Trend type"}),"editor.powerUpPanel.trendType.options.linear":t.i18n._({id:"fOHyG1",message:"Linear"}),"editor.powerUpPanel.trendType.options.exponential":t.i18n._({id:"sNDX60",message:"Exponential"}),"editor.powerUpPanel.trendType.options.quadratic":t.i18n._({id:"Hy/Wau",message:"Quadratic"}),"editor.powerUpPanel.trendType.options.polynomial":t.i18n._({id:"vnfF2I",message:"Polynomial"}),"editor.powerUpPanel.trendType.options.logarithmic":t.i18n._({id:"mMZg/U",message:"Logarithmic"}),"editor.powerUpPanel.trendType.options.power":t.i18n._({id:"4sADgb",message:"Power"}),"editor.powerUpPanel.trendType.options.loess":t.i18n._({id:"0NFLsC",message:"Loess"}),"editor.powerUpPanel.valueInput.percentagePlaceholder":t.i18n._({id:"2ZEpgF",message:"Percentage"}),"editor.powerUpPanel.valueInput.numberPlaceholder":t.i18n._({id:"cUh1+L",message:"Number"}),"editor.powerUpPanel.valueInput.percentageSymbol":t.i18n._({id:"RK0QER",message:"%"}),"editor.highlighting.modeHelper.title":t.i18n._({id:"Vyv4sH",message:"Highlight mode"}),"editor.highlighting.modeHelper.hover":t.i18n._({id:"ItXoQQ",message:"Hover"}),"editor.highlighting.modeHelper.toHighlight":t.i18n._({id:"zK4BJr",message:"to highlight"}),"editor.highlighting.modeHelper.anyElement":t.i18n._({id:"St44pU",message:"any element"}),"editor.highlighting.modeHelper.escToExit":t.i18n._({id:"9c9kUy",message:"to exit"}),"editor.highlighting.modeHelper.esc":t.i18n._({id:"kWRXAX",message:"ESC"}),"editor.highlighting.emptyState":t.i18n._({id:"SooC8u",message:"No highlight options available"}),"editor.highlighting.deleteAriaLabel":t.i18n._({id:"uHdMxQ",message:"Delete highlight"}),"editor.highlighting.highlightStyle.tint":t.i18n._({id:"xFacoB",message:"Tint"}),"editor.highlighting.highlightStyle.grey":t.i18n._({id:"mk84XG",message:"Grey"}),"editor.fineTunePanel.toolbarButton":t.i18n._({id:"7su8FP",message:"Fine tune"}),"editor.fineTunePanel.detailSection.title":t.i18n._({id:"WGQ6RY",message:"Detail"}),"editor.fineTunePanel.detailSection.missingValues":t.i18n._({id:"T4suLg",message:"Missing values"}),"editor.fineTunePanel.lineStyleSection.title":t.i18n._({id:"WKjqjp",message:"Line style"}),"editor.fineTunePanel.lineStyleSection.lineCurve":t.i18n._({id:"ZE2H+w",message:"Line curve"}),"editor.fineTunePanel.lineStyleSection.sharp":t.i18n._({id:"YlRobC",message:"Sharp"}),"editor.fineTunePanel.lineStyleSection.smooth":t.i18n._({id:"aq+nHb",message:"Smooth"}),"editor.customThemeEditor.patternDropdownAriaLabel":t.i18n._({id:"H7cgxy",message:"Pattern dropdown for series"}),"editor.customThemeEditor.patterns.solid":t.i18n._({id:"ImTHfZ",message:"Solid"}),"editor.customThemeEditor.patterns.pattern":t.i18n._({id:"T7kQgf",message:"Pattern"}),"editor.customThemeEditor.patterns.dotted":t.i18n._({id:"NeI+tM",message:"Dotted"}),"editor.customThemeEditor.patterns.dashed":t.i18n._({id:"nrCGhm",message:"Dashed"}),"editor.customThemeEditor.patterns.hatched":t.i18n._({id:"0IZtFY",message:"Hatched"}),"editor.customThemeEditor.heatmapColorLabel":t.i18n._({id:"Dvhxbb",message:"Color"}),"editor.accessibility.toggleSection":e=>{let{title:i}=e;return t.i18n._({id:"UDn8V7",message:"Toggle {title} section",values:{title:i}})},"editor.graphyDefaults.themeOptions.light":t.i18n._({id:"77350Z",message:"Light"}),"editor.graphyDefaults.themeOptions.dark":t.i18n._({id:"OIy1fE",message:"Dark"}),"graph.loading":t.i18n._({id:"8Lc8Yh",message:"Loading"}),"graph.error":t.i18n._({id:"+CVzfq",message:"Something went wrong"}),"graph.axisLabels.placeholder":t.i18n._({id:"qEC1l8",message:"Add label"}),"graph.defaultPropertyLabels.date":t.i18n._({id:"sS4zyA",message:"Date"}),"graph.defaultPropertyLabels.year":t.i18n._({id:"IZqXMA",message:"Year"}),"graph.defaultPropertyLabels.quarter":t.i18n._({id:"dMwlPa",message:"Quarter"}),"graph.defaultPropertyLabels.month":t.i18n._({id:"w7b65S",message:"Month"}),"graph.defaultPropertyLabels.week":t.i18n._({id:"Gv62M4",message:"Week"}),"graph.defaultPropertyLabels.series":t.i18n._({id:"RsQTNs",message:"Series"}),"graph.defaultPropertyLabels.category":t.i18n._({id:"rzrAfo",message:"Category"}),"graph.defaultPropertyLabels.columnNumber":e=>{let{number:i}=e;return t.i18n._({id:"48VdSN",message:"Column {number}",values:{number:i}})},"graph.defaultPropertyLabels.rowNumber":e=>{let{number:i}=e;return t.i18n._({id:"W3qlGb",message:"Row {number}",values:{number:i}})},"graph.defaultPropertyLabels.seriesNumber":e=>{let{number:i}=e;return t.i18n._({id:"UA+XWS",message:"Series {number}",values:{number:i}})},"graph.trendComparison.fromPrevious.long":e=>{let{value:i}=e;return t.i18n._({id:"RkyByD",message:"{value} vs previous",values:{value:i}})},"graph.trendComparison.fromPrevious.short":e=>{let{value:i}=e;return t.i18n._({id:"hUYkik",message:"{value} vs prev",values:{value:i}})},"graph.trendComparison.fromPreviousYear.long":e=>{let{value:i}=e;return t.i18n._({id:"JiSCnQ",message:"{value} vs previous year",values:{value:i}})},"graph.trendComparison.fromPreviousYear.short":e=>{let{value:i}=e;return t.i18n._({id:"7weUdn",message:"{value} vs prev year",values:{value:i}})},"graph.trendComparison.fromPreviousMonth.long":e=>{let{value:i}=e;return t.i18n._({id:"UYlCx4",message:"{value} vs previous month",values:{value:i}})},"graph.trendComparison.fromPreviousMonth.short":e=>{let{value:i}=e;return t.i18n._({id:"LF1sR+",message:"{value} vs prev month",values:{value:i}})},"graph.trendComparison.fromPreviousWeek.long":e=>{let{value:i}=e;return t.i18n._({id:"+Rqlvl",message:"{value} vs previous week",values:{value:i}})},"graph.trendComparison.fromPreviousWeek.short":e=>{let{value:i}=e;return t.i18n._({id:"Ea9uEB",message:"{value} vs prev week",values:{value:i}})},"graph.trendComparison.fromPreviousDay.long":e=>{let{value:i}=e;return t.i18n._({id:"MDKFec",message:"{value} vs previous day",values:{value:i}})},"graph.trendComparison.fromPreviousDay.short":e=>{let{value:i}=e;return t.i18n._({id:"gCmedD",message:"{value} vs prev day",values:{value:i}})},"graph.trendComparison.fromPreviousHour.long":e=>{let{value:i}=e;return t.i18n._({id:"WSMGc6",message:"{value} vs previous hour",values:{value:i}})},"graph.trendComparison.fromPreviousHour.short":e=>{let{value:i}=e;return t.i18n._({id:"x1hSig",message:"{value} vs prev hour",values:{value:i}})},"graph.headlineMetrics.averageLong":e=>{let{value:i}=e;return t.i18n._({id:"7MXZuB",message:"Average {value}",values:{value:i}})},"graph.headlineMetrics.averageShort":e=>{let{value:i}=e;return t.i18n._({id:"9IOVkt",message:"Avg. {value}",values:{value:i}})},"graph.headlineMetrics.total":e=>{let{value:i}=e;return t.i18n._({id:"8mOKWs",message:"Total {value}",values:{value:i}})},"graph.headlineMetrics.totalConversionRate":e=>{let{value:i}=e;return t.i18n._({id:"/qDcQu",message:"Total conversion rate {value}",values:{value:i}})},"graph.headlineMetrics.current":e=>{let{value:t}=e;return String(t)},"graph.titleEditor.titlePlaceholder":t.i18n._({id:"sKKwiE",message:"Untitled"}),"graph.titleEditor.subtitlePlaceholder":t.i18n._({id:"Avxphh",message:"Add a subtitle"}),"graph.toolbar.formatting.bold":t.i18n._({id:"wlRV83",message:"Bold"}),"graph.toolbar.formatting.italic":t.i18n._({id:"DK0K+8",message:"Italic"}),"graph.toolbar.formatting.underline":t.i18n._({id:"JZI1o9",message:"Underline"}),"graph.toolbar.formatting.link":t.i18n._({id:"AD0Ub6",message:"Link"}),"graph.toolbar.link.ariaLabel":t.i18n._({id:"wS6ZSK",message:"Create link"}),"graph.toolbar.link.placeholder":t.i18n._({id:"bXDvez",message:"Type or paste a link..."}),"graph.toolbar.link.submit":t.i18n._({id:"ACJ9uj",message:"Submit"}),"graph.toolbar.font.label":t.i18n._({id:"uST8kS",message:"Font"}),"graph.toolbar.heading.label":t.i18n._({id:"pNouOe",message:"Heading level"}),"graph.toolbar.heading.text":t.i18n._({id:"3KRbUA",message:"Text"}),"graph.toolbar.heading.caption":t.i18n._({id:"Zfc+Tk",message:"Caption"}),"graph.toolbar.heading.heading1":t.i18n._({id:"MnBpHw",message:"Heading 1"}),"graph.toolbar.heading.heading2":t.i18n._({id:"qgTcTE",message:"Heading 2"}),"graph.toolbar.heading.heading3":t.i18n._({id:"KLCRN5",message:"Heading 3"}),"graph.toolbar.textAlign.left":t.i18n._({id:"6TU+oO",message:"Align left"}),"graph.toolbar.textAlign.center":t.i18n._({id:"ZwSXgV",message:"Align center"}),"graph.toolbar.textAlign.right":t.i18n._({id:"8yrDuG",message:"Align right"}),"graph.toolbar.color.label":t.i18n._({id:"nAn+20",message:"Text color"}),"graph.colorDropdown.colors":t.i18n._({id:"5FXxD5",message:"Colors"}),"graph.colorDropdown.chartColors":t.i18n._({id:"AiTRVT",message:"Chart colors"}),"graph.colorDropdown.custom":t.i18n._({id:"vCktod",message:"Custom"}),"graph.colorDropdown.opacity":t.i18n._({id:"y12zam",message:"Opacity"}),"graph.colorDropdown.transparent":t.i18n._({id:"AimOfG",message:"Transparent"}),"graph.annotations.baseMenu.pinNumber":t.i18n._({id:"oQZ3Vs",message:"Pin number"}),"graph.annotations.baseMenu.unpinNumber":t.i18n._({id:"QO+JK6",message:"Unpin number"}),"graph.annotations.baseMenu.annotate":t.i18n._({id:"n/LDsQ",message:"Annotate"}),"graph.annotations.baseMenu.removeAnnotation":t.i18n._({id:"olNUjg",message:"Remove annotation"}),"graph.annotations.baseMenu.highlight":t.i18n._({id:"CvDpSx",message:"Highlight"}),"graph.annotations.baseMenu.highlightWithLabel":e=>{let{label:i}=e;return t.i18n._({id:"lVE+8B",message:"Highlight {label}",values:{label:i}})},"graph.annotations.baseMenu.removeHighlight":t.i18n._({id:"vnQ0NF",message:"Remove highlight"}),"graph.annotations.baseMenu.differenceArrow":t.i18n._({id:"dltMKr",message:"Difference arrow"}),"graph.annotations.baseMenu.addSticker":t.i18n._({id:"G2vETq",message:"Add sticker"}),"graph.annotations.baseMenu.removeSticker":t.i18n._({id:"dFp7E8",message:"Remove sticker"}),"graph.annotations.textMenu.title":t.i18n._({id:"n/LDsQ",message:"Annotate"}),"graph.annotations.textMenu.placeholder":t.i18n._({id:"d2FBNF",message:"Add a comment"}),"graph.annotations.textMenu.addButton":t.i18n._({id:"iinmUE",message:"Add"}),"graph.annotations.highlights.menuTitle":t.i18n._({id:"CvDpSx",message:"Highlight"}),"graph.annotations.highlights.labels.bar":t.i18n._({id:"5aLZeZ",message:"Bar"}),"graph.annotations.highlights.labels.barGroup":t.i18n._({id:"COyPV+",message:"Group"}),"graph.annotations.highlights.labels.barStack":t.i18n._({id:"oydjGz",message:"Stack"}),"graph.annotations.highlights.labels.barSeries":t.i18n._({id:"RsQTNs",message:"Series"}),"graph.annotations.highlights.labels.line":t.i18n._({id:"ZbJ1ZN",message:"Line"}),"graph.annotations.highlights.labels.linePoint":t.i18n._({id:"CuYPQE",message:"Point"}),"graph.annotations.highlights.labels.lineSeries":t.i18n._({id:"RsQTNs",message:"Series"}),"graph.annotations.highlights.labels.scatterPoint":t.i18n._({id:"CuYPQE",message:"Point"}),"graph.annotations.highlights.labels.scatterSeries":t.i18n._({id:"RsQTNs",message:"Series"}),"graph.annotations.highlights.labels.pieSlice":t.i18n._({id:"awOjCc",message:"Slice"}),"graph.annotations.highlights.labels.pointOrBar":t.i18n._({id:"vnFvLU",message:"Point / bar"}),"graph.annotations.highlights.labels.lineOrSeries":t.i18n._({id:"fYdqc+",message:"Line / series"}),"graph.annotations.stickerMenu.title":t.i18n._({id:"G2vETq",message:"Add sticker"}),"graph.annotations.delete":t.i18n._({id:"F+n1rj",message:"Delete"}),"graph.annotations.arrow.thickness.label":t.i18n._({id:"llaYq3",message:"Thickness"}),"graph.annotations.arrow.thickness.thin":t.i18n._({id:"67zAzp",message:"Thin"}),"graph.annotations.arrow.thickness.medium":t.i18n._({id:"AOO1pf",message:"Medium"}),"graph.annotations.arrow.thickness.thick":t.i18n._({id:"NGxso9",message:"Thick"}),"graph.annotations.arrow.arrowhead.startPoint":t.i18n._({id:"Q01D+Y",message:"Start point"}),"graph.annotations.arrow.arrowhead.endPoint":t.i18n._({id:"Y1N6k9",message:"End point"}),"graph.annotations.arrow.arrowhead.lineArrow":t.i18n._({id:"eIf9hx",message:"Line arrow"}),"graph.annotations.arrow.arrowhead.none":t.i18n._({id:"mZX8ao",message:"None"}),"graph.annotations.arrow.lineStyle.label":t.i18n._({id:"WKjqjp",message:"Line style"}),"graph.annotations.arrow.lineStyle.solid":t.i18n._({id:"ImTHfZ",message:"Solid"}),"graph.annotations.arrow.lineStyle.dotted":t.i18n._({id:"NeI+tM",message:"Dotted"}),"graph.annotations.arrow.stickerEffect":t.i18n._({id:"kujNHB",message:"Sticker effect"}),"graph.annotations.arrow.toolbarAriaLabel":t.i18n._({id:"A3fvsy",message:"Free-form arrow toolbar"}),"graph.annotations.arrow.editorAriaLabel":t.i18n._({id:"EvA1ip",message:"Arrow editor"}),"graph.annotations.differenceArrow.type.proportion":t.i18n._({id:"fAboWp",message:"Proportion"}),"graph.annotations.differenceArrow.type.difference":e=>{let{absoluteDifference:i}=e;return t.i18n._({id:"r5QDtL",message:"Difference ({absoluteDifference})",values:{absoluteDifference:i}})},"graph.annotations.differenceArrow.type.increase":e=>{let{absoluteDifference:i}=e;return t.i18n._({id:"LFZelw",message:"Increase ({absoluteDifference})",values:{absoluteDifference:i}})},"graph.annotations.differenceArrow.type.decrease":e=>{let{absoluteDifference:i}=e;return t.i18n._({id:"fvOQap",message:"Decrease ({absoluteDifference})",values:{absoluteDifference:i}})},"graph.annotations.differenceArrow.type.percentageChange":e=>{let{percentageChange:i}=e;return t.i18n._({id:"rHbt1t",message:"Percentage change ({percentageChange})",values:{percentageChange:i}})},"graph.annotations.differenceArrow.type.percentIncrease":e=>{let{percentageChange:i}=e;return t.i18n._({id:"tpEKAK",message:"Percent increase ({percentageChange})",values:{percentageChange:i}})},"graph.annotations.differenceArrow.type.percentDecrease":e=>{let{percentageChange:i}=e;return t.i18n._({id:"W+2BpT",message:"Percent decrease ({percentageChange})",values:{percentageChange:i}})},"graph.annotations.differenceArrow.size.label":t.i18n._({id:"x9Xn9f",message:"Size"}),"graph.annotations.differenceArrow.size.small":t.i18n._({id:"R+oib6",message:"Small"}),"graph.annotations.differenceArrow.size.medium":t.i18n._({id:"AOO1pf",message:"Medium"}),"graph.annotations.differenceArrow.size.large":t.i18n._({id:"xT6TJi",message:"Large"}),"graph.annotations.differenceArrow.flipArrow":t.i18n._({id:"/GUID3",message:"Flip arrow"}),"graph.annotations.differenceArrow.color":t.i18n._({id:"Dvhxbb",message:"Color"}),"graph.annotations.differenceArrow.toolbarAriaLabel":t.i18n._({id:"HgRGPJ",message:"Difference arrow toolbar"}),"graph.annotations.differenceArrow.editorAriaLabel":t.i18n._({id:"/NUerC",message:"Difference arrow editor"}),"graph.annotations.shape.color":t.i18n._({id:"Dvhxbb",message:"Color"}),"graph.annotations.shape.border.label":t.i18n._({id:"krrD0G",message:"Border"}),"graph.annotations.shape.border.none":t.i18n._({id:"mZX8ao",message:"None"}),"graph.annotations.shape.border.thin":e=>{let{value:i}=e;return t.i18n._({id:"7OiTNP",message:"Thin ({value})",values:{value:i}})},"graph.annotations.shape.border.medium":e=>{let{value:i}=e;return t.i18n._({id:"ET5PNG",message:"Medium ({value})",values:{value:i}})},"graph.annotations.shape.border.thick":e=>{let{value:i}=e;return t.i18n._({id:"DJlH29",message:"Thick ({value})",values:{value:i}})},dir:t.i18n._({id:"rqtfYq",message:"ltr"})}}],613497);var i=e.i(391398),n=e.i(613616),a=e.i(147349);let r=(0,e.i(168489).default)(async()=>(await e.A(582435)).DataEditor,{loadableGenerated:{modules:[499262]},ssr:!1,loading:()=>(0,i.jsx)(n.Flex,{m:5,h:"100%",justifyContent:"center",children:(0,i.jsx)(a.Spinner,{size:"lg"})})});e.s(["DataEditorWrapper",0,e=>(0,i.jsx)(r,{...e})],287816);var o=e.i(7820);e.s(["GraphySwitch",0,({ref:e,isChecked:t,isDisabled:n,isInvalid:a,onCheckedChange:r})=>(0,i.jsx)(o.Switch,{ref:e,isChecked:t,isDisabled:n,isInvalid:a,colorScheme:a?"red":"blue",onChange:e=>r?.(e.target.checked)})],42303);var s=e.i(428683),l=e.i(641099),d=e.i(654656),c=e.i(887527),u=e.i(555145),p=e.i(721455),h=e.i(704273),m=e.i(402818),g=e.i(358280),f=e.i(191788),b=e.i(157965),x=e.i(194279),y=e.i(588319),v=e.i(418755),C=e.i(957897),w=e.i(549022),S=e.i(686296),k=e.i(551880);let A=({label:e,scale:t,sampleArr:n,onClick:a,isSelected:r=!1})=>(0,i.jsx)(s.Box,{as:"button",p:2,borderRadius:"md",borderWidth:"2px",borderColor:r?"blue.500":"gray.200",bg:r?"blue.50":"transparent",cursor:"pointer",transition:"all 0.2s",_hover:{borderColor:r?"blue.600":"gray.300",bg:r?"blue.50":"gray.50",boxShadow:"sm"},onClick:a,children:(0,i.jsx)(d.VStack,{spacing:2,align:"stretch",children:(0,i.jsx)(u.HStack,{spacing:0,borderRadius:"sm",overflow:"hidden",height:4,children:n.map(e=>(0,i.jsx)(s.Box,{bg:t.get(e)??"black",width:"100%",height:"100%"},e))})})});e.s(["GraphColorPresetsPanel",0,({graphConfig:e,onChange:n})=>{let a=(0,v.useAppSelector)(k.selectTheme),r=(0,S.getThemeAccentColors)(a),o=r[0]?(0,S.getThemeColorSolid)(r[0]):"#000000",{schemaOptions:E}=(0,y.useColorSchemeOptions)({accentColor:o,steps:5}),_=e?.type,I="pie"===_||"donut"===_,M="waterfall"===_,T=(0,f.useMemo)(()=>I?(e.data?.rows||[]).map((i,n)=>{let a=e.data?.columns?.[0]?.key,r=a?i[a]:void 0,o=n+1;return{key:`series${o}`,label:"string"==typeof r||"number"==typeof r?String(r):t.i18n._({id:"x+nSsF",message:"Slice {sliceNumber}",values:{sliceNumber:o}})}}):(e.data?.columns||[]).slice(1).map((e,t)=>({key:`series${t+1}`,label:e.label||e.key})),[e.data,I]),L=(0,f.useMemo)(()=>[{key:"waterfallPositive",label:t.i18n._({id:"wfm1n7",message:"Positive (+)"})},{key:"waterfallNegative",label:t.i18n._({id:"9LthJf",message:"Negative (-)"})},{key:"waterfallStart",label:t.i18n._({id:"1cKipw",message:"Start & Total"})}],[]),j=T.length>1||M,P=e.appearance,D=P?.colorScheme||x.DEFAULT_COLOR_SCHEME,N="solid"===D,R=P?.customSolidColor||o,O=[,,,,,].fill(0).map((e,t)=>t),B=t.i18n._({id:"ovBPCi",message:"Default"}),z=(0,f.useMemo)(()=>(0,b.prepareColorSchemeOptions)(E,B),[E,B]),F=(0,f.useMemo)(()=>{let e=(0,b.filterColorSchemesByContrast)(z,o).filter(([e])=>!["alternating","spin","complement","complement2"].includes(e)),t=new Set,i=[];for(let[n,a]of e){let e=O.map(e=>a.scale.get(e)??"black").join(",");t.has(e)||(t.add(e),i.push([n,a]))}return i},[z,o,O]),H="scatter"!==_&&"bubble"!==_&&"heatmap"!==_&&j;return(0,i.jsxs)(d.VStack,{align:"stretch",children:[!I&&(N||!H)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.Box,{className:"custom-section-container",children:[(0,i.jsx)(c.Text,{className:"custom-section-labels",mb:0,children:(0,i.jsx)(g.Trans,{message:"Solid Color",id:"iFeLoB"})}),(0,i.jsx)(c.Text,{fontSize:"xs",color:"gray.600",mb:"0.8em",children:(0,i.jsx)(g.Trans,{message:"Apply one color to all items",id:"RRGwBo"})}),(0,i.jsx)(u.HStack,{spacing:2,align:"center",children:(0,i.jsxs)(p.Menu,{isLazy:!0,children:[(0,i.jsx)(C.ColorMenuButton,{color:N?R:void 0,isDefaultColor:!N}),(0,i.jsx)(h.MenuList,{children:(0,i.jsx)(w.ColorPickerMenuInner,{currentColor:N?R:null,setColor:t=>{e.appearance&&(null===t?n({appearance:{...e.appearance,colorScheme:x.DEFAULT_COLOR_SCHEME,customSeriesColors:void 0,customSolidColor:void 0,seriesStyles:{}}}):n({appearance:{...e.appearance,colorScheme:"solid",customSeriesColors:void 0,customSolidColor:t,seriesStyles:{}}}))},source:"GraphColorPanel-Solid",showAddColorButton:!1})})]})})]}),(0,i.jsx)(m.Divider,{borderColor:"gray.300"})]}),H&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(s.Box,{className:"custom-section-container",children:[(0,i.jsx)(c.Text,{className:"custom-section-labels",mb:0,children:M?(0,i.jsx)(g.Trans,{message:"Waterfall Colors",id:"NgdjLV"}):(0,i.jsx)(g.Trans,{message:"Series Colors",id:"FXRmPZ"})}),(0,i.jsx)(c.Text,{fontSize:"xs",color:"gray.600",mb:"0.8em",children:M?(0,i.jsx)(g.Trans,{message:"Customize colors for waterfall chart segments",id:"YnALJX"}):(0,i.jsx)(g.Trans,{message:"Override colors for individual series",id:"eSlJRy"})}),(0,i.jsx)(d.VStack,{align:"stretch",spacing:2,children:(M?L:T).map(({key:t,label:a})=>{let r=P?.customSeriesColors?.[t]?.color;return(0,i.jsxs)(u.HStack,{spacing:2,justify:"space-between",children:[(0,i.jsx)(c.Text,{fontSize:"sm",noOfLines:1,flex:1,children:a}),(0,i.jsxs)(p.Menu,{isLazy:!0,children:[(0,i.jsx)(C.ColorMenuButton,{color:r,isDefaultColor:!r}),(0,i.jsx)(h.MenuList,{children:(0,i.jsx)(w.ColorPickerMenuInner,{currentColor:r||null,setColor:i=>((t,i)=>{if(!e.appearance)return;let a=P?.customSeriesColors||{},r="waterfallStart"===t||"waterfallTotal"===t?["waterfallStart","waterfallTotal"]:[t];if(null===i){let t={...a};for(let e of r)delete t[e];let i=Object.keys(t).length>0;n({appearance:{...e.appearance,customSeriesColors:i?t:void 0,colorScheme:i?P?.colorScheme:x.DEFAULT_COLOR_SCHEME,customSolidColor:i?P?.customSolidColor:void 0,seriesStyles:{}}})}else{let t=P?.colorScheme==="solid"?x.DEFAULT_COLOR_SCHEME:P?.colorScheme,o={...a};for(let e of r)o[e]={color:i};n({appearance:{...e.appearance,customSeriesColors:o,colorScheme:t,customSolidColor:void 0,seriesStyles:{}}})}})(t,i),source:`GraphColorPanel-Series-${t}`,showAddColorButton:!1})})]})]},t)})})]}),(0,i.jsx)(m.Divider,{borderColor:"gray.300"})]}),(0,i.jsxs)(s.Box,{className:"custom-section-container",children:[(0,i.jsx)(c.Text,{className:"custom-section-labels",children:(0,i.jsx)(g.Trans,{message:"Color Presets",id:"qdY9Tp"})}),(0,i.jsx)(l.SimpleGrid,{columns:2,spacing:2,children:F.map(([t,{label:a,scale:r}])=>{let o="default"===t?x.DEFAULT_COLOR_SCHEME:t;return(0,i.jsx)(A,{label:a(),scale:r,sampleArr:O,onClick:()=>{let i;return i="default"===t?x.DEFAULT_COLOR_SCHEME:t,void(e.appearance&&n({appearance:{...e.appearance,colorScheme:i,customSeriesColors:void 0,customSolidColor:void 0,seriesStyles:{}}}))},isSelected:o===D&&!N},t)})})]})]})}],502400)},799613,465691,e=>{"use strict";var t=e.i(391398),i=e.i(227909),n=e.i(428683),a=e.i(969641),r=e.i(555145),o=e.i(721455),s=e.i(148318),l=e.i(704273),d=e.i(285042),c=e.i(524473),u=e.i(541075);e.i(828525);var p=e.i(896620),h=e.i(358280),m=e.i(408122),g=e.i(762368),f=e.i(191788),b=e.i(367792),x=e.i(157965),y=e.i(588319);e.i(144786);var v=e.i(849187),C=e.i(418755),w=e.i(686296),S=e.i(428856),k=e.i(52307),A=e.i(285256),E=e.i(281107),_=e.i(279920),I=e.i(387451),M=e.i(96953),T=e.i(865786),L=e.i(878726),j=e.i(595995),P=e.i(260241),D=e.i(480801),N=e.i(613616),R=e.i(402818),O=e.i(887527),B=e.i(654656),z=e.i(427001),F=e.i(40317),H=e.i(531768),W=e.i(404529),U=e.i(243521),V=e.i(809701),G=e.i(382167),$=e.i(826480),Z=e.i(277395),K=e.i(876533),q=e.i(168489),Y=e.i(174119),X=e.i(613497),Q=e.i(864619),J=e.i(536075),ee=e.i(325059),et=e.i(572383),ei=e.i(551880),en=e.i(287816),ea=e.i(42303),er=e.i(502400),eo=e.i(254140),es=e.i(775493),el=e.i(751827),ed=e.i(588183),ec=e.i(575329),eu=e.i(704077),ep=e.i(75495),eh=e.i(112010),em=e.i(292750),eg=e.i(189225),ef=e.i(147349);let eb=({isOpen:e,onClose:i,spreadsheetName:n,sheets:o,onSelectSheet:s,isLoading:l})=>{let[d,p]=(0,f.useState)("0");return(0,f.useEffect)(()=>{p("0")},[o]),(0,t.jsxs)(es.Modal,{isOpen:e,onClose:i,isCentered:!0,children:[(0,t.jsx)(el.ModalOverlay,{}),(0,t.jsxs)(ed.ModalContent,{children:[(0,t.jsx)(ec.ModalHeader,{children:(0,t.jsx)(h.Trans,{message:"Select a sheet to import",id:"sgY5OJ"})}),(0,t.jsx)(eh.ModalCloseButton,{}),(0,t.jsxs)(eu.ModalBody,{children:[(0,t.jsx)(O.Text,{fontSize:"sm",color:"gray.600",mb:4,children:(0,t.jsx)(h.Trans,{message:'"{spreadsheetName}" has multiple sheets. Choose which one to import:',id:"OY/HK2",values:{spreadsheetName:n}})}),(0,t.jsx)(eg.RadioGroup,{value:d,onChange:p,children:(0,t.jsx)(B.VStack,{align:"stretch",spacing:2,children:o.map((e,i)=>(0,t.jsx)(em.Radio,{value:String(i),colorScheme:"blue",children:(0,t.jsxs)(r.HStack,{spacing:2,children:[(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faTable}),(0,t.jsx)(O.Text,{children:e.title})]})},e.sheetId))})})]}),(0,t.jsxs)(ep.ModalFooter,{children:[(0,t.jsx)(a.Button,{variant:"ghost",me:3,onClick:i,isDisabled:l,children:(0,t.jsx)(h.Trans,{message:"Cancel",id:"dEgA5A"})}),(0,t.jsx)(a.Button,{colorScheme:"blue",onClick:()=>{let e=o[parseInt(d,10)];e&&s(e)},isLoading:l,leftIcon:l?(0,t.jsx)(ef.Spinner,{size:"sm"}):void 0,children:(0,t.jsx)(h.Trans,{message:"Import",id:"l3s5ri"})})]})]})]})};var ex=e.i(620020);e.i(615835);var ey=e.i(25747);e.i(905506);var ev=e.i(497980);async function eC(e,t){if(!e?.trim())throw Error("Access token is required");if(!t?.trim())throw Error("Spreadsheet ID is required");let i=`https://sheets.googleapis.com/v4/spreadsheets/${t}?fields=properties.title,sheets.properties`,n=await fetch(i,{headers:{Authorization:`Bearer ${e}`}});if(!n.ok){let e=await n.text();throw Error(`Failed to fetch spreadsheet metadata: ${e}`)}let a=await n.json();if(!a||"object"!=typeof a)throw Error("Invalid API response: expected object");let r=[];if(Array.isArray(a.sheets))for(let e of a.sheets){if(!e?.properties){console.warn("Skipping sheet with missing properties:",e);continue}let{sheetId:t,title:i,index:n}=e.properties;if("number"!=typeof t||"string"!=typeof i){console.warn("Skipping sheet with invalid properties:",e.properties);continue}r.push({sheetId:t,title:i,index:"number"==typeof n?n:0})}return{title:a.properties?.title||"Untitled Spreadsheet",sheets:r}}async function ew(e,t,i){if(!e?.trim())throw Error("Access token is required");if(!t?.trim())throw Error("Spreadsheet ID is required");if(!i?.trim())throw Error("Sheet name is required");let n=encodeURIComponent(`'${i.replace(/'/g,"''")}'`),a=`${n}!A1:ZZ1002`,r=`https://sheets.googleapis.com/v4/spreadsheets/${t}/values/${a}`,o=await fetch(r,{headers:{Authorization:`Bearer ${e}`}});if(!o.ok){let e=await o.text();throw Error(`Failed to fetch sheet data: ${e}`)}let s=(await o.json()).values||[],l=s.length>1001,d=Math.min(s.length-1,1e3);return{values:l?s.slice(0,1001):s,truncated:l,rowCount:d}}let eS=["Name","Title","Category","Label","Description","Email Address","Email","Timestamp","Date","Time","ID","Username","User","Response","Comment","Comments","Notes","Note"];function ek(e){if(!e||0===e.length)return{columns:[]};let t=e[0],i=e.slice(1);if(!t||0===t.length)return{columns:[]};let n=eS.map(e=>e.toLowerCase()),a=t.map((e,t)=>{let a=e.trim(),r=!n.includes(a.toLowerCase())&&function(e,t){if(0===e.length)return!1;let i=0,n=0;for(let a of e){let e=a[t];null!=e&&""!==e&&(n++,!isNaN(Number(String(e).replace(/[$,]/g,"").trim()))&&i++)}return 0!==n&&i/n>.5}(i,t);return{name:a||`Column ${t+1}`,type:r?"data":"label",index:t}});return!a.some(e=>"label"===e.type)&&a.length>0&&(a[0].type="label"),{columns:a}}function eA(e,t,i,n){return{values:e,spreadsheetId:t,sheetName:i,detectedStructure:n}}function eE(e,t){let{values:i,detectedStructure:n}=e;if(!i||0===i.length)throw Error("Sheet data is empty");let a=i.slice(1);if(0===a.length)throw Error("Sheet has no data rows (only headers)");let r=n.columns.filter(e=>"label"===e.type),o=n.columns.filter(e=>"data"===e.type),s=r[0],l=[];s&&l.push({key:"label",label:s.name,isHidden:!1,columnType:"label",sourceIndex:s.index}),o.forEach((e,t)=>{l.push({key:`data_${t+1}`,label:e.name,isHidden:!1,columnType:"data",sourceIndex:e.index})});let d=a.map(e=>{let t={};return l.forEach(i=>{let n=e[i.sourceIndex];"label"===i.columnType?t[i.key]=e_(n,"label"):t[i.key]=e_(n,"data")}),t}),c=l.map(({sourceIndex:e,columnType:t,...i})=>({key:i.key,label:i.label,_metadata:{isHidden:i.isHidden}}));return{...t||{type:"line",data:{columns:[],rows:[]},options:{},axes:{y:{min:0},showGridLines:!0},dataLabels:{showDataLabels:!1,dataLabelFormat:"absolute"},appearance:{seriesStyles:{},colorScheme:"monochrome"}},data:{columns:c,rows:d}}}function e_(e,t){if(null==e||""===e)return"data"===t?0:"";if("data"===t){let t=Number(String(e).replace(/[$,]/g,"").trim());return isNaN(t)?0:t}return String(e)}function eI(e){return e.values&&0!==e.values.length?1===e.values.length?{valid:!1,error:"Sheet has only headers, no data rows"}:e.detectedStructure.columns.some(e=>"label"===e.type)?e.detectedStructure.columns.some(e=>"data"===e.type)?{valid:!0}:{valid:!1,error:"Sheet must have at least one data column"}:{valid:!1,error:"Sheet must have at least one label column"}:{valid:!1,error:"Sheet is empty"}}let eM="https://www.googleapis.com/auth/drive.file",eT=({onImportComplete:e,existingConfig:i,onError:n})=>{let{user:a}=(0,ey.useUserContext)(),r=(0,ex.useToast)(),[o,s]=(0,f.useState)(null),[l,d]=(0,f.useState)(!1),[c,u]=(0,f.useState)(!1),p=(0,f.useCallback)(()=>!!o&&Date.now(){u(!1),x(null),v([]),w(!1)},[]),E=(0,f.useCallback)(e=>{console.error("Google auth failed:",e),u(!1),r({title:(0,t.jsx)(h.Trans,{message:"Couldn't authenticate with Google. Please try again.",id:"EdMVeP"}),status:"error",duration:5e3,position:"top",isClosable:!0}),n?.(Error(String(e)))},[r,n]),_=(0,f.useCallback)(async(a,o,s)=>{u(!0);try{let n=await ew(a,o.id,s.title);if(!n.values||0===n.values.length)throw Error("Sheet is empty");let l=ek(n.values),d=eA(n.values,o.id,s.title,l),c=eI(d);if(!c.valid)throw Error(c.error);let u=eE(d,i),p={spreadsheetId:o.id,spreadsheetName:o.name,sheetName:s.title};e({config:u,source:p});let m=s.title;if(n.truncated)r({title:(0,t.jsx)(h.Trans,{message:"Data imported with limit",id:"yUe7sV"}),description:(0,t.jsx)(h.Trans,{message:'Imported {MAX_IMPORT_ROWS, plural, one {# row} other {# rows}} from "{sheetNameDisplay}". Your sheet has more data that was not imported.',id:"3dVaie",values:{MAX_IMPORT_ROWS:1e3,sheetNameDisplay:m}}),status:"warning",duration:5e3,position:"top",isClosable:!0});else{let e=n.rowCount;r({title:(0,t.jsx)(h.Trans,{message:"Data imported successfully",id:"n7AANI"}),description:(0,t.jsx)(h.Trans,{message:'Imported {rowCount} rows from "{sheetNameDisplay}"',id:"FHI4Sx",values:{rowCount:e,sheetNameDisplay:m}}),status:"success",duration:3e3,position:"top",isClosable:!0})}}catch(e){console.error("Error importing sheet data:",e),r({title:(0,t.jsx)(h.Trans,{message:"Failed to import sheet data",id:"GLUA+9"}),description:String(e),status:"error",duration:5e3,position:"top",isClosable:!0}),n?.(e)}finally{u(!1),x(null),v([])}},[i,e,n,r]),I=(0,f.useCallback)(async(e,i)=>{w(!0);try{let t=await eC(e,i.id);if(0===t.sheets.length)throw Error("Spreadsheet has no sheets");1===t.sheets.length?await _(e,i,t.sheets[0]):(x(i),v(t.sheets))}catch(e){console.error("Error fetching spreadsheet metadata:",e),A(),r({title:(0,t.jsx)(h.Trans,{message:"Failed to load spreadsheet",id:"nMtWfE"}),description:String(e),status:"error",duration:5e3,position:"top",isClosable:!0}),n?.(e)}finally{w(!1)}},[_,n,A,r]),M=(0,f.useCallback)((e,t)=>{s({accessToken:e,expiresAt:Date.now()+1e3*t});let i=window.google,n=new i.picker.DocsView(i.picker.ViewId.SPREADSHEETS).setMimeTypes("application/vnd.google-apps.spreadsheet");new i.picker.PickerBuilder().addView(n).addView(i.picker.ViewId.FOLDERS).setOAuthToken(e).setAppId(b.config.GOOGLE_PROJECT_ID).setDeveloperKey(b.config.GOOGLE_API_KEY).setCallback(t=>{if("picked"!==t.action)return;let i=t.docs[0];I(e,{id:i.id,name:i.name})}).build().setVisible(!0)},[I]),T=(0,f.useCallback)(async(a,o)=>{u(!0);try{let n=await ew(a,o.spreadsheetId,o.sheetName);if(!n.values||0===n.values.length)throw Error("Sheet is empty");let s=ek(n.values),l=eA(n.values,o.spreadsheetId,o.sheetName,s),d=eI(l);if(!d.valid)throw Error(d.error);let c=eE(l,i);e({config:c,source:o});let u=o.sheetName;if(n.truncated)r({title:(0,t.jsx)(h.Trans,{message:"Data refreshed with limit",id:"oGFaV2"}),description:(0,t.jsx)(h.Trans,{message:'Refreshed {MAX_IMPORT_ROWS} rows from "{sheetNameDisplay}". Your sheet has more data that was not imported.',id:"+0ela9",values:{MAX_IMPORT_ROWS:1e3,sheetNameDisplay:u}}),status:"warning",duration:5e3,position:"top",isClosable:!0});else{let e=n.rowCount;r({title:(0,t.jsx)(h.Trans,{message:"Data refreshed successfully",id:"3Di2iS"}),description:(0,t.jsx)(h.Trans,{message:'Refreshed {rowCount} rows from "{sheetNameDisplay}"',id:"MZ2lVJ",values:{rowCount:e,sheetNameDisplay:u}}),status:"success",duration:3e3,position:"top",isClosable:!0})}}catch(e){console.error("Error refreshing sheet data:",e),A(),r({title:(0,t.jsx)(h.Trans,{message:"Failed to refresh sheet data",id:"Ch6uZG"}),description:String(e),status:"error",duration:5e3,position:"top",isClosable:!0}),n?.(e)}finally{u(!1),k.current=null}},[i,e,n,A,r]),L=(0,g.useGoogleLogin)({scope:eM,hint:a?.email,prompt:"",onSuccess:e=>{if((0,g.hasGrantedAllScopesGoogle)(e,eM)){let t=e.expires_in||3600;s({accessToken:e.access_token,expiresAt:Date.now()+1e3*t}),"picker"===S.current?M(e.access_token,t):"refresh"===S.current&&k.current&&(T(e.access_token,k.current),k.current=null),S.current=null}else S.current=null,E("Could not get requested scopes")},onError:e=>{S.current=null,E(e)}}),j=(0,f.useCallback)(()=>{!l||c||C||(p()?M(o.accessToken,(o.expiresAt-Date.now())/1e3):(S.current="picker",L()))},[L,c,C,p,l,M,o]),P=(0,f.useCallback)(e=>{m&&o?.accessToken&&_(o.accessToken,m,e)},[o,_,m]),D=(0,f.useCallback)(()=>{x(null),v([]),u(!1)},[]),N=(0,f.useCallback)(e=>{c||C||(u(!0),p()?T(o.accessToken,e):(k.current=e,S.current="refresh",L()))},[T,L,c,C,p,o]),R=(0,f.useCallback)(()=>{window.gapi.load("picker",()=>{d(!0)})},[]);return(0,ev.useScript)("https://apis.google.com/js/api.js",{onload:R}),{initiateImport:j,refreshFromSource:N,isImporting:c,pickerReady:l,pendingSpreadsheet:m,availableTabs:y,isLoadingTabs:C,selectSheetTab:P,cancelTabSelection:D}},eL=(0,q.default)(()=>e.A(493189).then(e=>e.GraphProvider),{loadableGenerated:{modules:[793532]},ssr:!1}),ej=(0,q.default)(()=>e.A(493189).then(e=>e.Graph),{loadableGenerated:{modules:[793532]},ssr:!1}),eP=(0,q.default)(()=>e.A(826807).then(e=>e.EditorProvider),{loadableGenerated:{modules:[478466]},ssr:!1}),eD=(0,q.default)(()=>e.A(826807).then(e=>e.GraphPanel),{loadableGenerated:{modules:[478466]},ssr:!1}),eN=(0,q.default)(()=>e.A(826807).then(e=>e.AxesPanel),{loadableGenerated:{modules:[478466]},ssr:!1}),eR=(0,q.default)(()=>e.A(826807).then(e=>e.ElementsPanel),{loadableGenerated:{modules:[478466]},ssr:!1}),eO=(0,q.default)(()=>e.A(826807).then(e=>e.TextSizeSection),{loadableGenerated:{modules:[478466]},ssr:!1}),eB=(0,q.default)(()=>e.A(826807).then(e=>e.SourceSection),{loadableGenerated:{modules:[478466]},ssr:!1}),ez=(0,q.default)(()=>e.A(826807).then(e=>e.PowerUpPanel),{loadableGenerated:{modules:[478466]},ssr:!1}),eF=(0,q.default)(()=>e.A(826807).then(e=>e.AnnotatePanel),{loadableGenerated:{modules:[478466]},ssr:!1}),eH=(0,q.default)(()=>e.A(826807).then(e=>e.GraphTypePicker),{loadableGenerated:{modules:[478466]},ssr:!1}),eW=(0,q.default)(()=>e.A(826807).then(e=>e.GraphOptionsSection),{loadableGenerated:{modules:[478466]},ssr:!1}),eU=(0,q.default)(()=>e.A(826807).then(e=>e.LegendPositionSection),{loadableGenerated:{modules:[478466]},ssr:!1}),eV=(0,q.default)(()=>e.A(826807).then(e=>e.HeadlineNumberSection),{loadableGenerated:{modules:[478466]},ssr:!1}),eG=(0,q.default)(()=>e.A(826807).then(e=>e.NumberFormatSection),{loadableGenerated:{modules:[478466]},ssr:!1}),e$=(0,q.default)(()=>e.A(493189).then(e=>e.PortalProvider),{loadableGenerated:{modules:[793532]},ssr:!1}),eZ=(0,q.default)(()=>e.A(493189).then(e=>e.ThemeProvider),{loadableGenerated:{modules:[793532]},ssr:!1}),eK=(0,Y.withChartContext)(({isOpen:i,onClose:a,onChange:r,initialConfig:o,googleSheetsSource:s,onGoogleSheetsSourceChange:l})=>{let[d,c]=(0,f.useState)(()=>o||(0,eo.createGraphConfigFromSampleData)("line")),[u,p]=(0,f.useState)(!1),m=(0,v.useFeatureFlag)("googleSheetSync"),[x]=(0,U.useMediaQuery)("(min-width: 62em)"),y=(0,C.useAppSelector)(ei.selectTheme),S=(0,w.getThemeAccentColors)(y).map(e=>(0,w.getThemeColorSolid)(e)),T=(0,w.getThemeCardColorSolid)(y),L=(0,et.getThemeCSSVars)(y,T),j=(0,ee.useRtlEnabled)(),P=(0,eo.getChartColorMode)(y),[D,O]=(0,f.useState)(void 0),[B,z]=(0,f.useState)(void 0);(0,f.useEffect)(()=>{e.A(553364).then(e=>{let t=e=>({...e,values:{...e.values,fontXs:"var(--chakra-fontSizes-xs)",fontSm:"var(--chakra-fontSizes-sm)",fontMd:"var(--chakra-fontSizes-md)",fontLg:"var(--chakra-fontSizes-lg)",fontXl:"var(--chakra-fontSizes-xl)"}});O(t(e.graphyLightTheme)),z(t("dark"===P?e.graphyDarkTheme:e.graphyLightTheme))})},[P]);let{i18n:F}=(0,h.useLingui)(),H=(0,f.useMemo)(()=>(0,X.getGraphyI18nStrings)(),[F?.locale]),W=(0,f.useMemo)(()=>({...H,dir:j?"rtl":"ltr"}),[H,j]),V=(0,f.useCallback)(e=>{let t=e.appearance,i=t?.customSeriesColors,n=t?.colorScheme||"monochrome",a=(0,eo.calculateColorsNeeded)(e.data),r=e.type||"line",o=Object.fromEntries(Object.entries((0,eo.generateSeriesStyles)(n,a,S,y,r,t?.customSolidColor)).map(([e,t])=>{let n=i?.[e]?.color;return[e,{customColor:n||t.customColor}]}));return{...e,appearance:e.appearance?{...e.appearance,seriesStyles:o}:void 0}},[S,y]);(0,f.useEffect)(()=>{o&&c(o)},[o]),(0,f.useEffect)(()=>{let e;return i?(e=setTimeout(()=>{p(!0)},350),()=>clearTimeout(e)):(p(!1),()=>{clearTimeout(e)})},[i]);let G=(0,f.useCallback)(e=>{let t=e.appearance,i=d.appearance,n=e=>void 0!==t&&Object.prototype.hasOwnProperty.call(t,e),a=e.appearance?{...d.appearance,...e.appearance,colorScheme:n("colorScheme")?t?.colorScheme:i?.colorScheme,customSeriesColors:n("customSeriesColors")?t?.customSeriesColors:i?.customSeriesColors,customSolidColor:n("customSolidColor")?t?.customSolidColor:i?.customSolidColor}:d.appearance,o={...d,...e,appearance:a};c(o),r?.(o)},[d,r]);return(0,t.jsx)(K.DarkModeProvider,{isDark:!1,children:(0,t.jsxs)(k.Drawer,{placement:"bottom",onClose:a,isOpen:i,trapFocus:!1,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,t.jsx)(A.DrawerOverlay,{}),(0,t.jsxs)(E.DrawerContent,{dir:j?"rtl":"ltr",borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",transitionDuration:{enter:"0.2s"},zIndex:1e3,children:[(0,t.jsx)(M.DrawerCloseButton,{}),(0,t.jsxs)(I.DrawerBody,{p:0,h:"100%",overflow:"auto",display:"flex",flexDir:"column",children:[(0,t.jsx)(_.DrawerHeader,{fontSize:"xl",children:(0,t.jsx)(h.Trans,{message:"Edit chart",id:"44wbJb"})}),u&&(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(eL,{config:V(d),onChange:G,i18nOverrides:W,theme:D,children:(0,t.jsxs)(N.Flex,{direction:"column",overflow:"auto",h:"100%",gap:5,px:5,children:[(0,t.jsxs)(N.Flex,{direction:{base:"column",lg:"row"},gap:5,flexShrink:0,children:[(0,t.jsx)(n.Box,{className:"graphy-graph-type-section",width:{base:"100%",lg:"250px"},flexShrink:0,children:(0,t.jsx)(eP,{components:{Switch:ea.GraphySwitch},children:(0,t.jsx)(eD,{children:(0,t.jsxs)(n.Box,{as:x?"div":"details",...!x&&{open:!0},children:[(0,t.jsx)(n.Box,{as:x?"div":"summary",cursor:"pointer",fontWeight:"600",fontSize:14,mb:2,children:(0,t.jsx)(h.Trans,{message:"Chart type",id:"kSRPkz"})}),(0,t.jsx)(eH,{hiddenTypes:["table"]})]})})})}),(0,t.jsxs)(N.Flex,{direction:{base:"column",lg:"row"},gap:5,flexGrow:1,children:[(0,t.jsx)(n.Box,{zIndex:3,children:(0,t.jsx)(n.Box,{borderRadius:"md",children:(0,t.jsx)(e$,{children:(0,t.jsx)(eY,{graphConfig:d,onChange:G,graphyI18nStrings:H})})})}),(0,t.jsxs)(n.Box,{className:`is-${P}`,width:{base:"auto"},flexGrow:1,children:[(0,t.jsx)(n.Box,{className:"chart graphy-chart-editor-preview",background:T,css:L,borderRadius:"md",border:"1px solid",p:3,borderColor:"dark"===P?"gray.600":"gray.100",maxWidth:"100%",h:"500px",children:B&&(0,t.jsx)(eZ,{theme:B,children:(0,t.jsx)(e$,{children:(0,t.jsx)(ej,{isEditable:!0,sizing:{mode:"responsive"},renderTitle:()=>null})})})}),(0,t.jsx)(eq,{graphConfig:d})]})]})]}),(0,t.jsx)(R.Divider,{}),(0,t.jsx)(n.Box,{flexGrow:1,pb:8,children:d&&(b.config.GOOGLE_DRIVE_IMPORT_CLIENT_ID&&m?(0,t.jsx)(g.GoogleOAuthProvider,{clientId:b.config.GOOGLE_DRIVE_IMPORT_CLIENT_ID,children:(0,t.jsx)(eX,{graphConfig:d,onGraphConfigChange:G,googleSheetsSource:s,onGoogleSheetsSourceChange:l})}):(0,t.jsx)(eQ,{graphConfig:d,onGraphConfigChange:G}))})]})})})]})]})]})})}),eq=({graphConfig:e})=>{let i=e?.type,n=(0,f.useMemo)(()=>"bubble"===i||"scatter"===i,[i]),a=(0,f.useMemo)(()=>{let t=e?.data?.columns;return t&&0!==t.length?Math.max(t.length-1,0):0},[e?.data?.columns]);return!n||a>=2?null:(0,t.jsxs)(F.Alert,{status:"info",borderRadius:"md",mt:3,alignItems:"flex-start",children:[(0,t.jsx)(H.AlertIcon,{}),(0,t.jsx)(W.AlertDescription,{fontSize:"sm",whiteSpace:"normal",wordBreak:"break-word",flex:"1",minWidth:"0",children:"bubble"===i?(0,t.jsx)(h.Trans,{message:"Bubble charts work best with at least two data columns. Add more columns to your data table below to see multiple bubbles.",id:"JQkclj"}):(0,t.jsx)(h.Trans,{message:"Scatter charts work best with at least two data columns. Add more columns to your data table below to see multiple data series.",id:"Zu0T08"})})]})},eY=({graphConfig:e,onChange:i})=>{let a=e?.type,r=(0,f.useMemo)(()=>"pie"!==a&&"donut"!==a,[a]),o=(0,f.useRef)(null),[s,l]=(0,f.useState)(!1),[d,p]=(0,f.useState)(!1),m=(0,f.useCallback)(()=>{let e=o.current;if(!e)return;let{scrollTop:t,scrollHeight:i,clientHeight:n}=e;l(t>0),p(t+n{g.current&&clearTimeout(g.current),g.current=setTimeout(m,12)},[m]);(0,f.useEffect)(()=>{m()},[m,e]),(0,f.useEffect)(()=>()=>{g.current&&clearTimeout(g.current)},[]);let x=(0,f.useMemo)(()=>{let e=[];return s&&e.push("inset 0 8px 8px -8px rgba(0, 0, 0, 0.15)"),d&&e.push("inset 0 -8px 8px -8px rgba(0, 0, 0, 0.15)"),e.join(", ")},[s,d]);return(0,t.jsx)(eP,{components:{Switch:ea.GraphySwitch},children:(0,t.jsxs)(j.Tabs,{defaultValue:"axes",position:"relative",size:"sm",children:[(0,t.jsxs)(L.TabList,{onMouseUp:()=>b(),borderWidth:1,borderStyle:"solid",borderBottomWidth:2,borderColor:"gray.100",borderTopRadius:"md",children:[(0,t.jsx)(T.Tab,{value:"graph",children:(0,t.jsx)(h.Trans,{message:"Graph",id:"x2fr/j"})}),(0,t.jsx)(T.Tab,{value:"axes",children:(0,t.jsx)(h.Trans,{message:"Axes",id:"oiz1a2"})}),(0,t.jsx)(T.Tab,{value:"visuals",children:(0,t.jsx)(h.Trans,{message:"Visuals",id:"1dt6zm"})}),(0,t.jsx)(T.Tab,{value:"annotate",children:(0,t.jsx)(h.Trans,{message:"Annotate",id:"TJ5Fgy"})})]}),(0,t.jsxs)(D.TabPanels,{ref:o,bg:"white",borderBottomRadius:"md",className:"graphy-editor-tab-panels",p:0,border:"1px solid",borderTop:"none",borderColor:"gray.100",maxH:470,overflowY:"auto",onScroll:b,boxShadow:x,transition:"box-shadow 0.2s ease",children:[(0,t.jsx)(P.TabPanel,{id:"graph",children:(0,t.jsxs)(eD,{children:[(0,t.jsx)(eW,{layout:"fixed",preview:!0}),(0,t.jsx)(eU,{layout:"fixed",preview:!0}),(0,t.jsx)(eV,{layout:"fixed",preview:!0}),(0,t.jsx)(eG,{layout:"collapsible",preview:!0})]})}),(0,t.jsx)(P.TabPanel,{id:"axes",children:r?(0,t.jsx)(eN,{}):(0,t.jsxs)(B.VStack,{spacing:3,py:8,color:"gray.500",children:[(0,t.jsx)(z.Icon,{as:u.FontAwesomeIcon,icon:c.faChartPie,boxSize:10}),(0,t.jsx)(O.Text,{fontSize:"sm",fontWeight:"medium",children:"pie"===a?(0,t.jsx)(h.Trans,{message:"Pie charts don't use axes",id:"84hz3+"}):(0,t.jsx)(h.Trans,{message:"Donut charts don't use axes",id:"m5NlZj"})}),(0,t.jsx)(O.Text,{fontSize:"xs",textAlign:"center",maxW:"250px",children:(0,t.jsx)(h.Trans,{message:"Try a different chart type from the Graph tab if you need to configure axes",id:"x6JN0r"})})]})}),(0,t.jsx)(P.TabPanel,{id:"visuals",children:(0,t.jsxs)(n.Box,{children:[(0,t.jsx)(er.GraphColorPresetsPanel,{graphConfig:e,onChange:i}),(0,t.jsxs)(eR,{children:[(0,t.jsx)(eB,{layout:"collapsible"}),(0,t.jsx)(eO,{layout:"collapsible"})]})]})}),(0,t.jsxs)(P.TabPanel,{id:"annotate",children:[(0,t.jsx)(eF,{callOutProps:{hiddenButtons:["text"]}}),(0,t.jsx)(R.Divider,{borderColor:"gray.300",mb:-1.5}),(0,t.jsx)(ez,{})]})]})]})})},eX=({graphConfig:e,onGraphConfigChange:i,googleSheetsSource:n,onGoogleSheetsSourceChange:r})=>{let p,m,g,{initiateImport:b,refreshFromSource:x,isImporting:y,pickerReady:v,pendingSpreadsheet:C,availableTabs:w,isLoadingTabs:S,selectSheetTab:k,cancelTabSelection:A}=eT({existingConfig:e,onImportComplete:({config:e,source:t})=>{i(e),r?.(t)},onError:e=>{console.error("Google Sheets import error:",e)}}),E=(0,f.useCallback)(()=>{n&&x(n)},[n,x]),_=(0,f.useCallback)(()=>{r?.(null)},[r]);return(0,t.jsx)(eQ,{graphConfig:e,onGraphConfigChange:i,googleSheetsUI:(0,t.jsx)(t.Fragment,{children:n&&(0,t.jsx)(O.Text,{fontSize:"xs",color:"gray.500",children:(p=n.sheetName,m=n.spreadsheetName,g=`https://docs.google.com/spreadsheets/d/${n.spreadsheetId}/edit`,(0,t.jsx)(h.Trans,{message:'From "{sheetName}" in "<0>{spreadsheetName}"',id:"VdthIy",values:{sheetName:p,spreadsheetName:m},components:{0:(0,t.jsx)(G.Link,{href:g,isExternal:!0,color:"blue.500",textDecoration:"underline"})}}))})}),googleSheetsMenu:(0,t.jsxs)(o.Menu,{children:[(0,t.jsx)(V.Tooltip,{label:v?void 0:(0,t.jsx)(h.Trans,{message:"Loading Google integration...",id:"Kgm8gN"}),isDisabled:v,children:(0,t.jsx)(s.MenuButton,{as:a.Button,size:"sm",variant:"outline",leftIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:Z.faGoogle}),rightIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faChevronDown}),isDisabled:!v,isLoading:y||S,children:(0,t.jsx)(h.Trans,{message:"Google Sheets",id:"Ta1XBT"})})}),(0,t.jsxs)(l.MenuList,{children:[(0,t.jsx)(d.MenuItem,{icon:(0,t.jsx)(u.FontAwesomeIcon,{icon:Z.faGoogle}),onClick:b,children:n?(0,t.jsx)(h.Trans,{message:"Import new sheet",id:"FREy5c"}):(0,t.jsx)(h.Trans,{message:"Import from Google Sheets",id:"7Sk+Yx"})}),n&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(d.MenuItem,{icon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faRefresh}),onClick:E,children:(0,t.jsx)(h.Trans,{message:"Sync data",id:"416CxM"})}),(0,t.jsx)(d.MenuItem,{as:G.Link,href:`https://docs.google.com/spreadsheets/d/${n.spreadsheetId}/edit`,isExternal:!0,icon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faArrowUpRightFromSquare}),_hover:{textDecoration:"none"},children:(0,t.jsx)(h.Trans,{message:"Open sheet",id:"Xwknwd"})}),(0,t.jsx)($.MenuDivider,{}),(0,t.jsx)(d.MenuItem,{icon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faLinkSlash}),onClick:_,color:"red.500",children:(0,t.jsx)(h.Trans,{message:"Unlink",id:"6dvIbw"})})]})]})]}),sheetTabModal:(0,t.jsx)(eb,{isOpen:!!C,onClose:A,spreadsheetName:C?.name||"",sheets:w,onSelectSheet:k,isLoading:y})})},eQ=({graphConfig:e,onGraphConfigChange:i,googleSheetsUI:a,googleSheetsMenu:o,sheetTabModal:s})=>{let l=(0,f.useRef)(!1),d=(0,f.useCallback)(e=>{let t=e.data?.columns||[];return{data:e.data?.rows||[],config:{properties:t.map(e=>({key:e.key,label:e.label??"",isHidden:e._metadata?.isHidden||!1})),isDataHorizontal:!1}}},[]),[c,u]=(0,f.useState)(()=>{let t=d(e),i=(0,J.parseGraphyData)(t);return Q.chartObjectSerializer.parse(i)});return(0,f.useEffect)(()=>{if(l.current){l.current=!1;return}let t=d(e),i=(0,J.parseGraphyData)(t);u(Q.chartObjectSerializer.parse(i))},[e,d]),(0,t.jsxs)(n.Box,{position:"relative",width:"100%",maxWidth:{md:"100%",xl:"100%"},sx:{".rg-celleditor":{marginTop:-6}},children:[(0,t.jsxs)(r.HStack,{justify:"space-between",mb:4,wrap:"wrap",gap:2,children:[(0,t.jsxs)(B.VStack,{align:"start",spacing:0,children:[(0,t.jsx)(O.Text,{fontWeight:"medium",fontSize:"md",children:(0,t.jsx)(h.Trans,{message:"Data",id:"HKH+W+"})}),a]}),o]}),(0,t.jsx)(en.DataEditorWrapper,{onChange:e=>{let t=Q.chartObjectSerializer.serialize(e);u(Q.chartObjectSerializer.parse(t));let n=(0,J.serializeToGraphyData)(t);l.current=!0,i({data:{columns:n.config.properties.map(e=>({key:e.key,label:e.label,_metadata:{isHidden:e.isHidden}})),rows:n.data}})},data:c}),s]})};e.s(["GraphyChartEditorModal",0,eK],465691);var eJ=e.i(864935),e0=e.i(241894),e1=e.i(400551);let e2=({currentColorScheme:e,updateColorScheme:p})=>{let h=(0,C.useAppSelector)(ei.selectTheme),g=(0,w.getThemeAccentColors)(h),b=g[0]?(0,w.getThemeColorSolid)(g[0]):"#000000",{schemaOptions:v}=(0,y.useColorSchemeOptions)({accentColor:b,steps:5}),S=m.i18n._({id:"ovBPCi",message:"Default"}),k=(0,f.useMemo)(()=>(0,x.prepareColorSchemeOptions)(v,S),[v,S]),A=(0,f.useMemo)(()=>{let e=(0,x.filterColorSchemesByContrast)(k,b).filter(([e])=>!["alternating","spin","complement","complement2"].includes(e)),t=new Set,i=[];for(let[n,a]of e){let e=[0,1,2,3,4].map(e=>a.scale.get(e)??"black").join(",");t.has(e)||(t.add(e),i.push([n,a]))}return i},[k,b]),E="default"===e?"monochrome":e;return(0,t.jsxs)(o.Menu,{children:[(0,t.jsx)(s.MenuButton,{as:a.Button,variant:"toolbar",rightIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faChevronDown,transform:"shrink-6"}),size:"sm","data-testid":"graphy-chart-color-scheme-dropdown",children:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faPalette})}),(0,t.jsx)(l.MenuList,{children:A.map(([e,a])=>{let o=E===e;return(0,t.jsx)(d.MenuItem,{onClick:()=>p(e),bg:o?"trueblue.50":void 0,children:(0,t.jsxs)(r.HStack,{spacing:1,width:"100%",children:[(0,t.jsx)(n.Box,{marginInlineEnd:1,children:o?(0,t.jsx)(i.CheckIcon,{}):(0,t.jsx)(n.Box,{width:"1em"})}),(0,t.jsx)(r.HStack,{spacing:0,borderRadius:"sm",overflow:"hidden",height:4,children:[0,1,2,3,4].map(e=>(0,t.jsx)(n.Box,{bg:a.scale.get(e)??"black",width:"1em",height:"100%"},e))}),(0,t.jsx)(n.Box,{flex:"1",textAlign:"start",ms:2,children:a.label()})]})},e)})})]})},e3=({currentAlignment:e,updateAlignment:i})=>{let d=eJ.AlignmentCommands.find(t=>t.alignment===e);return(0,t.jsxs)(o.Menu,{children:[(0,t.jsx)(s.MenuButton,{as:a.Button,variant:"toolbar",rightIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faChevronDown,transform:"shrink-6"}),size:"sm","data-testid":"graphy-chart-alignment-dropdown",children:(0,t.jsx)(u.FontAwesomeIcon,{icon:d?d.icon:c.faAlignLeft})}),(0,t.jsx)(l.MenuList,{minWidth:"auto",children:(0,t.jsx)(n.Box,{children:(0,t.jsx)(r.HStack,{spacing:1,children:eJ.AlignmentCommands.map(n=>{let r=e===n.alignment;return(0,t.jsx)(a.Button,{variant:"toolbar",size:"sm",onClick:()=>i(n.alignment),bg:r?"trueblue.50":void 0,"aria-label":n.name(),"data-testid":`graphy-chart-align-${n.alignment}`,children:(0,t.jsx)(u.FontAwesomeIcon,{icon:n.icon})},n.key)})})})})]})},e5=({currentChartType:e,updateChartType:p})=>{let m=S.CHART_TYPE_CONFIGS.find(t=>t.key===e);return(0,t.jsxs)(o.Menu,{children:[(0,t.jsx)(s.MenuButton,{as:a.Button,variant:"toolbar",leftIcon:m?(0,t.jsx)(u.FontAwesomeIcon,{icon:m.icon}):void 0,rightIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faChevronDown,transform:"shrink-6"}),size:"sm","data-testid":"graphy-chart-type-dropdown",children:m?m.label():(0,t.jsx)(h.Trans,{message:"Select Chart Type",id:"T7KxYG"})}),(0,t.jsx)(l.MenuList,{children:S.CHART_TYPE_CONFIGS.filter(e=>!e.hidden).map(a=>{let o=e===a.key;return(0,t.jsx)(d.MenuItem,{onClick:()=>p(a.key),bg:o?"trueblue.50":void 0,children:(0,t.jsxs)(r.HStack,{spacing:1,width:"100%",children:[(0,t.jsx)(n.Box,{marginInlineEnd:1,children:o?(0,t.jsx)(i.CheckIcon,{}):(0,t.jsx)(n.Box,{width:"1em"})}),(0,t.jsx)(n.Box,{width:"1em",children:(0,t.jsx)(u.FontAwesomeIcon,{icon:a.icon})}),(0,t.jsx)(n.Box,{flex:"1",textAlign:"start",ms:2,children:a.label()})]})},a.key)})})]})},e4=({googleSheetsSource:e,existingConfig:i,onSyncComplete:n})=>{let{refreshFromSource:r,isImporting:o,pickerReady:s}=eT({existingConfig:i,onImportComplete:({config:e,source:t})=>{n(e,t)},onError:e=>{console.error("Google Sheets sync error:",e)}}),l=(0,f.useCallback)(()=>{r(e)},[e,r]);return(0,t.jsx)(p.GammaTooltip,{label:s?(0,t.jsx)(h.Trans,{message:"Sync data from Google Sheets",id:"7aHW2Y"}):(0,t.jsx)(h.Trans,{message:"Loading Google integration...",id:"Kgm8gN"}),children:(0,t.jsx)(a.Button,{variant:"toolbar",leftIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faRefresh}),size:"sm",onClick:l,isLoading:o,isDisabled:!s,"data-testid":"graphy-chart-sync-data",children:(0,t.jsx)(h.Trans,{message:"Sync",id:"Nu4DdT"})})})},e6=({googleSheetsSource:e,existingConfig:i,onSyncComplete:n})=>b.config.GOOGLE_DRIVE_IMPORT_CLIENT_ID?(0,t.jsx)(g.GoogleOAuthProvider,{clientId:b.config.GOOGLE_DRIVE_IMPORT_CLIENT_ID,children:(0,t.jsx)(e4,{googleSheetsSource:e,existingConfig:i,onSyncComplete:n})}):null;e.s(["GraphyChartFormattingMenu",0,({editor:e,selection:i})=>{let{node:n}=i,{chartType:o,chartData:s,horizontalAlign:l,googleSheetsSource:d}=n.attrs,[p,m]=(0,f.useState)(!1),[g,b]=(0,f.useState)(s),x=(0,v.useFeatureFlag)("googleSheetSync"),y=(0,f.useMemo)(()=>(0,S.inferChartTypeFromGraphConfig)(s)||o||"line",[s,o]);(0,f.useEffect)(()=>{b(s)},[s]);let C=(0,f.useCallback)(t=>{e.commands.updateNestedAttributesAtPos(i.from,t)},[e,i.from]),w=(0,f.useCallback)(e=>{let t=S.CHART_TYPE_CONFIGS.find(t=>t.key===e);if(!t)return;let i=s||(0,eo.createGraphConfigFromSampleData)(y);C({chartType:e,chartData:(0,eo.updateChartTypeInConfig)(i,t.graphyConfig.type)})},[C,s,y]),k=(0,f.useCallback)(e=>{let t=s||(0,eo.createGraphConfigFromSampleData)(y);C({chartData:(0,eo.updateColorSchemeInConfig)(t,e)})},[C,s,y]),A=(0,f.useCallback)(()=>{let{state:t}=e,n=t.doc.nodeAt(i.from);b(n?.attrs.chartData||s),m(!0)},[e,i.from,s]),E=(0,f.useCallback)(()=>{m(!1)},[]),_=(0,f.useCallback)(e=>{let t=(0,S.inferChartTypeFromGraphConfig)(e);t?C({chartData:e,chartType:t}):C({chartData:e})},[C]),I=(0,f.useCallback)(e=>{C({googleSheetsSource:e})},[C]),M=(0,f.useCallback)((e,t)=>{let i=(0,S.inferChartTypeFromGraphConfig)(e);C({chartData:e,googleSheetsSource:t,...i&&{chartType:i}})},[C]),T=(0,f.useCallback)(e=>{C({horizontalAlign:e})},[C]),L=(0,eo.getColorScheme)(s);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(r.HStack,{spacing:2,children:[(0,t.jsx)(e5,{currentChartType:y,updateChartType:w}),(0,t.jsx)(e1.FormattingMenuDivider,{}),(0,t.jsx)(e2,{currentColorScheme:L,updateColorScheme:k}),(0,t.jsx)(e3,{currentAlignment:l,updateAlignment:T}),(0,t.jsx)(e1.FormattingMenuDivider,{}),x&&d&&s&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(e6,{googleSheetsSource:d,existingConfig:s,onSyncComplete:M}),(0,t.jsx)(e1.FormattingMenuDivider,{})]}),(0,t.jsx)(a.Button,{variant:"toolbar",leftIcon:(0,t.jsx)(u.FontAwesomeIcon,{icon:c.faPencil}),size:"sm","data-testid":"graphy-chart-open-editor",onClick:A,children:(0,t.jsx)(h.Trans,{message:"Edit Chart",id:"fpDojI"})}),(0,t.jsx)(e1.FormattingMenuDivider,{}),(0,t.jsx)(e0.DeleteNodeButton,{editor:e})]}),(0,t.jsx)(eK,{isOpen:p,onClose:E,onChange:_,initialConfig:g,googleSheetsSource:d,onGoogleSheetsSourceChange:I},p?"open":"closed")]})}],799613)},164042,133075,734043,808707,957448,973506,293330,991097,704416,577467,32113,224960,821094,206479,364991,952697,e=>{"use strict";e.s(["ImagePopoverFormattingMenu",()=>eI],164042);var t=e.i(391398),i=e.i(428683),n=e.i(335799),a=e.i(555145),r=e.i(887527),o=e.i(524473),s=e.i(541075);e.i(828525);var l=e.i(876533);e.i(314572);var d=e.i(717834),c=e.i(358280),u=e.i(408122),p=e.i(755453),h=e.i(175863),m=e.i(191788),g=e.i(606004),f=e.i(418755),b=e.i(103630),x=e.i(864935);e.i(419217);var y=e.i(202545),v=e.i(753748),C=e.i(210956),w=e.i(555027),S=e.i(435674),k=e.i(204319),A=e.i(329860);e.i(297036);var E=e.i(534316),_=e.i(261442),I=e.i(15272),M=e.i(786928),T=e.i(296690),L=e.i(802150),j=e.i(425605),P=e.i(969641),D=e.i(721455),N=e.i(148318),R=e.i(182895),O=e.i(704273),B=e.i(259658),z=e.i(575084);let F=({handleClickBehaviorChange:e,currentClickBehavior:i,enableNoClickBehavior:n=!1,canAddLink:a=!1})=>{let o=((e=!1)=>({none:{label:(0,t.jsx)(c.Trans,{message:"Do nothing",id:"gIjBW2"})},expand:{label:(0,t.jsx)(c.Trans,{message:"Expand",id:"1A3EXy"})},newTab:{label:e?(0,t.jsx)(c.Trans,{message:"Open link in a new tab",id:"YdDilE"}):(0,t.jsx)(c.Trans,{message:"Open in a new tab",id:"XGRJzS"})}}))(a);return(0,t.jsxs)(D.Menu,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,t.jsx)(N.MenuButton,{as:P.Button,"data-testid":"click-behavior-dropdown",size:"sm",rightIcon:(0,t.jsx)(s.FontAwesomeIcon,{fixedWidth:!0,icon:z.faChevronDown,size:"xs"}),boxShadow:"none",onMouseDown:_.preventDefaultToAvoidBlur,children:o[i].label}),(0,t.jsx)(O.MenuList,{zIndex:2,children:(0,t.jsx)(B.MenuOptionGroup,{type:"radio",onChange:t=>{e(t)},value:i,children:Object.entries(o).map(([e,{label:i}])=>"none"!==e||n?(0,t.jsx)(R.MenuItemOption,{value:e,onMouseOver:_.preventDefaultToAvoidBlur,onMouseDown:_.preventDefaultToAvoidBlur,"data-testid":`click-behavior-option-${e}`,children:(0,t.jsx)(r.Text,{children:i})},e):null)})})]})};var H=e.i(613616),W=e.i(344233),U=e.i(865639),V=e.i(965837),G=e.i(774314),$=e.i(620020),Z=e.i(896620),K=e.i(235704),q=e.i(210792),Y=e.i(303236),X=e.i(551880),Q=e.i(977581),J=e.i(242349),ee=e.i(156518),et=e.i(703971),ei=e.i(189938),en=e.i(82050),ea=e.i(576897),er=e.i(346037),eo=e.i(306841),es=e.i(470020),el=e.i(882255),ed=e.i(406112),ec=e.i(78608);let eu=(0,m.memo)(({label:e,icon:i,isFocused:n,focusedItemEl:o,onClick:l,onMouseMove:d})=>(0,t.jsx)(er.ListItem,{px:2,py:2,mx:2,borderRadius:"md",ref:n?o:null,bg:n?"trueblue.50":"none",onClick:l,onMouseMove:d,onMouseDown:_.preventDefaultToAvoidBlur,role:"option",cursor:"pointer",tabIndex:-1,children:(0,t.jsxs)(a.HStack,{pointerEvents:"none",children:[(0,t.jsx)(s.FontAwesomeIcon,{icon:i,fixedWidth:!0,size:"sm"}),(0,t.jsx)(r.Text,{noOfLines:1,fontSize:"sm",w:"100%",children:e})]})}));eu.displayName="Option";let ep=(0,m.memo)(({items:e,inputValue:n,focusedIndex:a,interactionRef:r,isScrollingRef:s,isFiltered:l,onMouseMove:d,onSelectItem:u})=>{let p=e.reduce((e,t,i)=>("page"===t.type?e.pages.push({item:t,index:i}):"card"===t.type?e.cards.push({item:t,index:i}):"url"===t.type&&e.url.push({item:t,index:i}),e),{pages:[],cards:[],url:[]}),h=(0,m.useRef)(null),g=(0,m.useRef)(null);return(0,m.useEffect)(()=>{if("keyboard"!==r.current)return;let e=g.current,t=h.current;if(!e||!t)return;let i=t.clientHeight,n=e.offsetTop,a=e.offsetHeight;s.current=!0,t.scrollTo({top:n-i/2+a/2,behavior:"smooth"});let o=setTimeout(()=>{s.current=!1},50);return()=>{clearTimeout(o)}},[a,g,h,r,s]),(0,t.jsx)(i.Box,{children:(0,t.jsxs)(er.List,{ref:h,pos:"relative",overflowY:"auto",maxH:"min(300px, 50vh)",children:[p.pages.map(({item:e,index:r},s)=>(0,t.jsxs)(i.Box,{children:[0===s&&(0,t.jsx)(ec.SectionTitle,{ml:4,my:1,children:l?(0,t.jsx)(c.Trans,{message:'Pages matching "{inputValue}"',id:"rXYeDA",values:{inputValue:n}}):(0,t.jsx)(c.Trans,{message:"Recent pages",id:"QIUdjp"})}),(0,t.jsx)(eu,{label:eh(e),icon:o.faFile,isFocused:r===a,focusedItemEl:g,onClick:()=>u(e),onMouseMove:()=>d(r)})]},e.docId)),p.cards.map(({item:e,index:r},s)=>(0,t.jsxs)(i.Box,{children:[0===s&&(0,t.jsx)(ec.SectionTitle,{ml:4,my:1,children:l?(0,t.jsx)(c.Trans,{message:'Cards matching "{inputValue}"',id:"m+j0l8",values:{inputValue:n}}):(0,t.jsx)(c.Trans,{message:"Cards",id:"Ccpbzh"})}),(0,t.jsx)(eu,{label:eh(e),icon:o.faRectangle,isFocused:r===a,focusedItemEl:g,onClick:()=>u(e),onMouseMove:()=>d(r)})]},e.cardId)),p.url.map(({item:e,index:n},r)=>(0,t.jsxs)(i.Box,{children:[0===r&&(0,t.jsx)(ec.SectionTitle,{ml:4,my:1,children:(0,t.jsx)(c.Trans,{message:"Link to URL",id:"wuJqqq"})}),(0,t.jsx)(eu,{label:e.value,icon:o.faLink,isFocused:n===a,focusedItemEl:g,onClick:()=>u(e),onMouseMove:()=>d(n)})]},`custom${n}`))]})})});ep.displayName="ListBox";let eh=e=>e.title||("card"===e.type?u.i18n._({id:"gLDJuJ",message:"Untitled card"}):u.i18n._({id:"kveQAJ",message:"Untitled page"})),em=(0,m.memo)(({items:e,onSelect:i,onRevert:n,inputValue:a,setInputValue:r,inputRef:o})=>{let s=(0,m.useRef)(null),{filteredItems:l,isFiltered:d}=(({items:e,inputValue:t})=>(0,m.useMemo)(()=>{let i,n=(i=(0,J.startsWithHttp)(t)||(0,Y.isOtherSupportedProtocol)(t)?t:"https://"+t,(0,J.isValidUrl)(i)?i:""),a=[...e.filter(e=>eh(e).trim().toLowerCase().includes(t.trim().toLowerCase())),""!==n?{type:"url",value:n}:null].filter(e=>!!e),r=a.length!==e.length;return{filteredItems:a,isFiltered:r}},[e,t]))({items:e,inputValue:a}),{onKeyDown:c,onMouseMove:p,focusedIndex:h,setFocusedIndex:g,interactionRef:f,isOpen:b,onClose:x,onOpen:y,onBlur:v,onFocus:C,handleSelectItem:w,isScrollingRef:S}=(({items:e,inputValue:t,onSelect:i,onRevert:n,popoverRef:a})=>{let{isOpen:r,onClose:o,onOpen:s}=(0,ed.useDisclosure)(),[l,d]=(0,m.useState)(null),c=(0,m.useRef)(null),u=(0,m.useRef)(!1),p=(0,m.useCallback)(()=>{o(),d(null)},[o]),h=(0,m.useCallback)(()=>{t&&(s(),d(0))},[t,s]),g=(0,m.useCallback)(e=>{a.current?.contains(e.relatedTarget)||p()},[p,a]),f=(0,m.useCallback)(e=>{i(e),p()},[p,i]),b=(0,m.useCallback)(t=>{switch(c.current="keyboard",t.key){case"Enter":case"Tab":{if(null===l)return;t.preventDefault();let i=e[l];i?f(i):p();return}case"Escape":t.preventDefault(),p(),n();return;case"ArrowDown":t.preventDefault(),r?d(t=>((t??0)+1)%e.length):(s(),d(0));return;case"ArrowUp":t.preventDefault(),r?d(t=>{let i=(t??0)-1;return i<0?e.length-1:i}):(s(),d(e.length-1));return}},[n,p,r,l,e,f,s]),x=(0,m.useCallback)(e=>{u.current||(c.current="mouse",d(e))},[]);return{isOpen:r,onClose:o,onOpen:s,focusedIndex:l,setFocusedIndex:d,handleSelectItem:f,onMouseMove:x,onKeyDown:b,onBlur:g,onFocus:h,interactionRef:c,isScrollingRef:u}})({items:l,onSelect:i,onRevert:n,popoverRef:s,inputValue:a}),k=(0,m.useCallback)(e=>{r(e.target.value),b||y(),g(0)},[b,y,g,r]),A=(0,m.useCallback)(()=>{b||(y(),g(0))},[b,y,g]);return(0,t.jsxs)(eo.Popover,{isLazy:!0,isOpen:b,onClose:x,autoFocus:!1,returnFocusOnClose:!1,matchWidth:!0,placement:"bottom",children:[(0,t.jsx)(es.PopoverAnchor,{children:(0,t.jsx)(U.Input,{ref:o,size:"sm",placeholder:u.i18n._({id:"BHFH/3",message:"Paste a link or search for a page"}),value:a,onKeyDown:c,onFocus:C,onBlur:v,onChange:k,onClick:A})}),(0,t.jsx)(el.PopoverContent,{ref:s,w:"100%",h:"100%",display:0===l.length?"none":void 0,tabIndex:-1,_focusVisible:{outline:"none"},children:(0,t.jsx)(ep,{items:l,isFiltered:d,onSelectItem:w,onMouseMove:p,inputValue:a,focusedIndex:h,interactionRef:f,isScrollingRef:S})})]})});em.displayName="PageAwareLinkComboBox";var eg=e.i(349324),ef=e.i(940709);let eb=({href:e})=>{let t=(0,f.useAppSelector)(eg.selectSite),i=(0,f.useAppSelector)(en.selectPages);return(0,m.useMemo)(()=>{let n=i.filter(e=>!e.offline).map(e=>({docId:e.id,title:e.title})),a=(({href:e,linkablePages:t})=>{if(!e)return null;let i=(0,ef.parseGammaDocUrl)(e);if(!i)return{href:e};let{docId:n,cardId:a}=i;return{...n&&t?.find(e=>e.docId===n)||null,href:e,cardId:a}})({href:e,linkablePages:n}),r=a?.docId&&t?.id&&(0,ea.getEditorUrl)({docId:a?.docId})||e,o=n?.some(e=>e.docId===a?.docId);return{linkablePages:n,existingLink:a,newTabUrl:r,isPageLink:o}},[e,t,i])},ex=({href:e,inputValue:n,setInputValue:r,setHref:l,clearHref:d,inputRef:p,onCloseFocusRef:h})=>{let g=(0,f.useAppSelector)(en.selectDocId),b=(0,f.useAppSelector)(ei.selectComputedCards),{existingLink:x,linkablePages:y}=eb({href:e}),v=(0,m.useMemo)(()=>[...(y||[]).map(e=>({type:"page",docId:e.docId,title:e.title})),...b.map(e=>({type:"card",cardId:e.id,title:e.title}))],[y,b]),C=x?.title,w=x?.cardId??void 0,{title:S}=(0,et.useGetCardText)({cardId:w}),k=(0,m.useCallback)(e=>{e&&(l("url"===e.type?e.value:"page"===e.type?(0,ea.generateDocUrl)({docId:e.docId,docTitle:e.title,absolute:!0}):(0,ea.getCardUrl)({cardId:e.cardId,docId:g})),h?.current?.focus({preventScroll:!0}))},[g,l,h]),A=x?.href&&!x.docId;if(!x||A)return(0,t.jsx)(em,{items:v,inputValue:n,setInputValue:r,inputRef:p,onSelect:k,onRevert:()=>{r(e),h?.current?.focus()}});{let e=w?S||(0,t.jsx)(c.Trans,{message:"Untitled card",id:"gLDJuJ"}):C||(0,t.jsx)(c.Trans,{message:"Untitled page",id:"kveQAJ"});return(0,t.jsx)(a.HStack,{spacing:1,children:(0,t.jsx)(ee.Tag,{pr:1,children:(0,t.jsxs)(a.HStack,{spacing:1,children:[(0,t.jsx)(s.FontAwesomeIcon,{icon:w?o.faRectangle:o.faFile}),(0,t.jsx)(Z.GammaTooltip,{label:e,placement:"top",children:(0,t.jsx)(i.Box,{noOfLines:1,children:e})}),d&&(0,t.jsx)(Z.GammaTooltip,{label:(0,t.jsx)(c.Trans,{message:"Remove link",id:"484LKL"}),placement:"top",children:(0,t.jsx)(W.IconButton,{size:"xs",minHeight:4,height:4,variant:"ghost","aria-label":u.i18n._({id:"484LKL",message:"Remove link"}),icon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faClose}),onMouseDown:_.preventDefaultToAvoidBlur,onClick:()=>{d(),r("")}})})]})})})}},ey="link-input-invalid-url",ev=({editor:e,href:a,updateHref:r,clearHref:l,removeLink:d,isEmbedLink:p=!1})=>{let[h,g]=(0,m.useState)(a),b=(0,m.useRef)(null),x=(0,m.useRef)(null),y=(0,$.useToast)(),v=h!==a,C=!!(e.multipageEnabled||e.isSiteNavbarEditor),w=(0,f.useAppSelector)(X.selectCardIds),S=(0,Q.doesMemoContainGivenCardFromUrl)(a,w),{newTabUrl:k}=eb({href:a});(0,m.useEffect)(()=>{g(a)},[a]),(0,m.useEffect)(()=>{!a&&b.current&&setTimeout(()=>{b?.current?.focus()})},[a]);let A=(0,m.useCallback)(e=>{if(!e)return;let i=e;if(p){let t=(0,K.parseEmbedCodeSrc)(e);t&&(i=t)}if(i=(0,J.startsWithHttp)(i)||(0,Y.isOtherSupportedProtocol)(i)?i:"https://"+i,!(0,J.isValidUrl)(i)){r(""),y.isActive(ey)||y({id:ey,title:(0,t.jsx)(c.Trans,{message:"Invalid URL",id:"sBZMWb"}),description:(0,t.jsx)(c.Trans,{message:"Please enter a valid URL",id:"jEw0Mr"}),status:"error",position:"top",duration:3e3,isClosable:!0});return}r(i),g(i)},[p,y,r]),E=(0,m.useCallback)(t=>{if(S){let i=(0,Q.getCardIdFromHash)(a);(0,q.navigateToCardLink)(e,t,i)}else try{window.open(k,"_blank")}catch(e){console.error("(caught) LinkInput error going to URL",e)}},[S,e,a,k]),I=(0,m.useCallback)(()=>{navigator.clipboard.writeText(h).then(()=>{y({title:(0,t.jsx)(c.Trans,{message:"Link copied",id:"edWbV6"}),status:"success",position:"top",duration:2e3,isClosable:!0})},e=>{console.error("Failed to copy URL:",e),y({title:(0,t.jsx)(c.Trans,{message:"Failed to copy link",id:"LtRSbo"}),status:"error",position:"top",duration:3e3,isClosable:!0})})},[h,y]);return(0,t.jsxs)(H.Flex,{gap:2,justify:"space-between",alignItems:"center",children:[C&&!p?(0,t.jsxs)(H.Flex,{flex:1,children:[(0,t.jsx)(ex,{href:a,inputValue:h,setInputValue:g,setHref:A,clearHref:l,inputRef:b,onCloseFocusRef:x}),(0,t.jsx)(i.Box,{w:"0",h:"0",ref:x,tabIndex:-1})]}):(0,t.jsxs)(V.InputGroup,{children:[(0,t.jsx)(U.Input,{"data-testid":"link-input",ref:b,value:h,placeholder:u.i18n._({id:"Ilf1mg",message:"Paste a link, then hit enter"}),onChange:e=>{g(e.target.value)},onKeyDown:t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),g(a),e.commands.focus())},onKeyUp:t=>{"Enter"===t.key&&(t.preventDefault(),A(h),e.commands.focus())},size:"sm"}),h.length>0&&v&&(0,t.jsx)(G.InputRightElement,{top:"50%",transform:"translateY(-50%)",children:(0,t.jsx)(Z.GammaTooltip,{placement:"top",label:(0,t.jsx)(c.Trans,{message:"Save",id:"tfDRzk"}),children:(0,t.jsx)(W.IconButton,{"aria-label":u.i18n._({id:"tfDRzk",message:"Save"}),variant:"ghost",size:"xs",onClick:()=>{A(h)},icon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faCheck})})})}),h.length>0&&!v&&(0,t.jsx)(G.InputRightElement,{top:"50%",transform:"translateY(-50%)",children:(0,t.jsx)(Z.GammaTooltip,{placement:"top",label:(0,t.jsx)(c.Trans,{message:"Copy URL",id:"E6nRW7"}),children:(0,t.jsx)(W.IconButton,{"aria-label":u.i18n._({id:"E6nRW7",message:"Copy URL"}),variant:"ghost",size:"xs",onClick:I,icon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faCopy})})})})]}),(0,t.jsxs)(n.ButtonGroup,{spacing:1,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:[d&&(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Remove link",id:"484LKL"}),icon:o.faUnlink,onClick:d,my:0}),a&&(0,t.jsx)(T.ToolbarButton,{label:S?(0,t.jsx)(c.Trans,{message:"Jump to card link",id:"088Oxr"}):(0,t.jsx)(c.Trans,{message:"Visit link",id:"fOj0+R"}),icon:S?o.faArrowRight:o.faExternalLink,onClick:E,my:0})]})]})};var eC=e.i(316969),ew=e.i(976996),eS=e.i(956053),ek=e.i(901267);let eA=()=>({inset:{title:u.i18n._({id:"Jn5DbR",message:"Freeform"})},circle:{title:u.i18n._({id:"7xMmki",message:"Circle"})}}),eE=({clipType:e,onChange:n})=>e?(0,t.jsxs)(L.Dropdown,{children:[(0,t.jsx)(L.DropdownButton,{size:"sm",borderRadius:"full",minWidth:"105px",rightIcon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faChevronDown,transform:"shrink-6"}),variant:"toolbar",ps:2,onMouseDown:_.preventDefaultToAvoidBlur,children:eA()[e].title}),(0,t.jsx)(L.DropdownList,{children:Object.entries(eA()).map(([a,{title:l}])=>(0,t.jsx)(L.DropdownItem,{value:a,fontSize:"sm",fontWeight:600,icon:(0,t.jsx)(i.Box,{visibility:a===e?"visible":"hidden",children:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faCheck})}),onMouseDown:_.preventDefaultToAvoidBlur,onClick:()=>{n(a)},children:(0,t.jsx)(r.Text,{children:l})},a))})]}):null,e_={expand:o.faMagnifyingGlassPlus,newTab:o.faArrowUpRightFromSquare,none:o.faSquareXmark},eI=({editor:e,selection:i,decorations:r})=>{let s=i.node.attrs,{resize:L,id:P,href:D,clickBehavior:N}=s,{isInOfflineMode:R}=(0,g.useHealthCheck)(),{enterZoom:O}=(0,E.useMediaZoom)(P),B=(0,M.useToggleMediaDrawer)(),z=(0,m.useCallback)(t=>{e.view.focus(),B({isOpen:!0}),t.stopPropagation()},[e,B]),H=(0,m.useCallback)(()=>{e.commands.convertImageToImageCard()},[e]),W=(0,m.useCallback)(t=>{if(!(i instanceof h.NodeSelection))return;let n=(0,p.findParentNode)(b.isCardNode)(i);n&&"number"==typeof n?.pos&&n.pos>=0&&(0,k.setCardLayoutWithImageFromPos)({editor:e,cardPos:n.pos,attrs:s,layout:t})},[e,i,s]),U=(0,A.getImageClickBehavior)(N),V=(0,d.useTiptapEditorEventCallback)((e,t)=>{e.commands.updateAttributes(y.Image.name,{clickBehavior:t})}),G=(0,d.useTiptapEditorEventCallback)((e,t)=>{e.commands.updateAttributes(y.Image.name,{href:t})}),{setCropClipType:$,confirmCrop:Z,cancelCrop:K,startCrop:q,resetCrop:Y}=(0,C.useCroppingControls)(e),X=(0,f.useAppSelector)(v.selectClipType),Q=(0,m.useCallback)(()=>{(0,I.addImageComment)(i)},[i]),J=(0,f.useAppSelector)((0,v.selectIsIdCropping)(P)),ee=!!(L?.clipPath&&L?.clipType),{inFootnote:et,inGallery:ei,canEditImageWithAI:en,isInNestedCard:ea,cropResizeAndAlignmentEnabled:er}=(0,S.useImageStateForMenu)({editor:e,node:i.node,decorations:r}),{imageCardActionsMenuItems:eo,showImageCardOptions:es}=(0,w.useImageCardActionsMenuItems)({disabled:et,canSetAsAccent:!ea,onTurnIntoCard:H,onSetCardLayout:W}),el=(0,m.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]),ed=(0,m.useMemo)(()=>[{key:"zoom",ariaLabel:u.i18n._({id:"ACjxWW",message:"Zoom"}),label:(0,t.jsx)(c.Trans,{message:"Zoom",id:"ACjxWW"}),action:O,icon:o.faMagnifyingGlassPlus},{key:"addComment",ariaLabel:u.i18n._({id:"oFsfkI",message:"Add comment"}),label:(0,t.jsx)(c.Trans,{message:"Add comment",id:"oFsfkI"}),action:Q,icon:o.faComment,isHidden:et,isDisabled:R},{key:"crop",ariaLabel:u.i18n._({id:"qKx+US",message:"Crop"}),label:(0,t.jsx)(c.Trans,{message:"Crop",id:"qKx+US"}),action:()=>{P&&q({id:P,clipType:L?.clipType})},icon:o.faCrop,isHidden:!er},{key:"editGallery",ariaLabel:u.i18n._({id:"ATVjaW",message:"Edit gallery"}),label:(0,t.jsx)(c.Trans,{message:"Edit gallery...",id:"+v0hYZ"}),action:()=>{e.chain().selectParentNode().run()},icon:o.faGrid2,isHidden:!ei},{key:"ai",customButton:(0,t.jsx)(l.DarkModeProvider,{isDark:!1,children:(0,t.jsx)(j.BuddyImageEditDropdownMenu,{editor:e,attrs:s,buttonProps:{variant:"plain",flex:1}},"ai")},"ai"),isHidden:!en||et,ariaLabel:u.i18n._({id:"EVnzPs",message:"Edit with AI"}),label:(0,t.jsx)(c.Trans,{message:"Edit with AI",id:"EVnzPs"}),action:()=>{}},{key:"edit",ariaLabel:u.i18n._({id:"ePK91l",message:"Edit"}),label:(0,t.jsx)(c.Trans,{message:"Edit",id:"ePK91l"}),action:z,icon:o.faEdit,isHidden:es},{key:"imageMenu",customButton:(0,t.jsx)(eS.ImageEditMenuDropdown,{onEditImage:z,imageCardMenuItems:eo},"imageMenu"),isHidden:!es,ariaLabel:u.i18n._({id:"STGpNQ",message:"Image options"}),label:(0,t.jsx)(c.Trans,{message:"More options",id:"3Siwmw"}),action:()=>{}}],[Q,er,z,e,O,P,et,ei,R,L?.clipType,q,en,es,s,eo]);return(0,t.jsxs)(ew.FormattingPopoverMenuSection,{children:[!J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(ek.PopoverMenuButtonRow,{buttonList:ed}),(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:o.faAlignLeft,isHidden:!er,children:(0,t.jsx)(n.ButtonGroup,{dir:"ltr",spacing:0,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:x.AlignmentCommands.map(({name:i,key:n,icon:a,shortcut:r,checkActive:o,apply:s})=>{if(o&&s)return(0,t.jsx)(T.ToolbarButton,{label:i(),shortcut:r,isActive:o(e),onClick:()=>{s(e)},icon:a,testId:n,my:0},n)})})}),(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Click action",id:"S58tkK"}),icon:e_[U],children:(0,t.jsx)(F,{currentClickBehavior:U,handleClickBehaviorChange:V,enableNoClickBehavior:!0,canAddLink:!0})}),"newTab"===U&&(0,t.jsx)(ev,{editor:e,href:D||"",updateHref:G,clearHref:()=>{G("")}}),(0,t.jsx)(eC.FormattingPopoverMenuFooter,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:o.faTrash,onClick:el,colorScheme:"red",secondaryLabel:(0,k.hasFormattingApplied)(i.node)?(0,t.jsx)(c.Trans,{message:"Reset formatting",id:"5eaf8Z"}):void 0,secondaryAction:(0,k.hasFormattingApplied)(i.node)?()=>(0,k.resetFormatting)(e):void 0,secondaryIcon:(0,k.hasFormattingApplied)(i.node)?o.faRotateLeft:void 0})]}),er&&J&&(0,t.jsxs)(a.HStack,{alignSelf:"stretch",my:-3,mx:-2,zIndex:"menu",children:[(0,t.jsx)(eE,{clipType:X,onChange:e=>{$({clipType:e})}}),(0,t.jsxs)(n.ButtonGroup,{spacing:0,size:"sm",alignItems:"center",children:[(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Reset crop",id:"6Z0nnS"}),icon:o.faRotateLeft,isDisabled:!ee,onClick:()=>{P&&Y({id:P})},my:0}),(0,t.jsx)(T.ToolbarButton,{color:"red.500",label:(0,t.jsx)(c.Trans,{message:"Cancel crop",id:"7Bn152"}),icon:o.faXmark,onClick:()=>{P&&K({id:P})},my:0}),(0,t.jsx)(T.ToolbarButton,{color:"green.500",label:(0,t.jsx)(c.Trans,{message:"Save crop",id:"ryQtQS"}),icon:o.faCheck,onClick:()=>{P&&Z({id:P})},my:0})]})]})]})};e.i(144786);var eM=e.i(275316),eT=e.i(612099),eL=e.i(917067);let ej=()=>[{name:u.i18n._({id:"dngcvq",message:"Solid"}),key:"solid",icon:z.faRectangleWide},{name:u.i18n._({id:"NWQb/x",message:"Outline"}),key:"outline",icon:o.faRectangleWide},{name:u.i18n._({id:"utdov0",message:"Plain"}),key:"plain",icon:o.faT}];e.s(["MAX_LABELS",0,5,"getLabelVariants",0,ej],133075);var eP=e.i(267971),eD=e.i(144294),eN=e.i(442136),eR=e.i(241894),eO=e.i(400551);e.s(["LabelFormattingMenu",0,({editor:e,selection:i})=>{let{color:a,variant:r,icon:s,uppercase:l}=e.getAttributes("label"),d=l??!0,u=ej(),g=s?.src||s?.tempUrl,f=i instanceof h.NodeSelection?{pos:i.from,node:i.node}:(0,p.findParentNode)(e=>"label"===e.type.name)(i),b=(0,p.findParentNode)(e=>"labelGroup"===e.type.name)(i);b?.node.attrs.horizontalAlign;let y=null!=b&&b.node.childCount<5,v=(0,m.useCallback)(()=>{f&&e.chain().insertContentAt(f.pos,(0,eD.EMPTY_NODES)().label).selectInsertedNode().run()},[e,f]),C=(0,m.useCallback)(()=>{f&&e.chain().insertContentAt(f.pos+f.node.nodeSize,(0,eD.EMPTY_NODES)().label).selectInsertedNode().run()},[e,f]),w=(0,m.useCallback)(t=>{e.chain().updateAttributes("label",t).selectNodeAtPos(f.pos).run()},[e,f]),{currentMediaDrawerSourceKey:S,setMediaDrawerSourceKeyAction:k}=(0,eP.useDrawerSourceKey)(),A=(0,m.useCallback)(()=>{let t=eM.featureFlags.get("pictographicIconsSearch")?eL.PictographicIconProvider.key:eT.FontawesomeIconProvider.key,n=(0,p.findParentNode)(e=>"label"===e.type.name)(i);n&&(e.commands.selectNodeAtPos(n.pos),k(s?.source||t,!0),setTimeout(()=>{(0,M.openMediaDrawer)(!1)},30))},[s?.source,k,f?.pos]),E=(0,m.useCallback)(()=>{w({icon:null})},[w]);return(0,t.jsxs)(n.ButtonGroup,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,t.jsx)(n.ButtonGroup,{spacing:1,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:u.map(({name:e,icon:i,key:n})=>(0,t.jsx)(T.ToolbarButton,{label:e,icon:i,onClick:()=>{w({variant:n})},isActive:r===n,my:0},e))}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eN.ColorButton,{color:a||void 0,setColor:e=>{w({color:e})},editor:e,analyticsSource:"Label"}),(0,t.jsx)(eO.FormattingMenuDivider,{}),x.AlignmentCommands.map(i=>(0,t.jsx)(T.ToolbarButton,{label:i.name(),icon:i.icon,onClick:()=>i.apply?.(e),isActive:i.checkActive?.(e)},i.key)),(0,t.jsx)(eO.FormattingMenuDivider,{}),g?(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Edit icon...",id:"JE/4q/"}),icon:o.faIcons,onClick:A}):(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Add icon...",id:"1SYZRR"}),icon:o.faIcons,onClick:A}),g&&(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Remove icon",id:"+4mjS6"}),icon:o.faImageSlash,color:"red.500",onClick:E}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(T.ToolbarButton,{label:l?(0,t.jsx)(c.Trans,{message:"Lowercase",id:"thnUhW"}):(0,t.jsx)(c.Trans,{message:"Uppercase",id:"c54EGO"}),icon:o.faFontCase,onClick:()=>{w({uppercase:!d})},isActive:d}),y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Add label before",id:"95CA8S"}),icon:o.faDiagramCells,iconRotation:270,onClick:v}),(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Add label after",id:"qitlT3"}),icon:o.faDiagramCells,iconRotation:90,onClick:C})]}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eR.DeleteNodeButton,{editor:e,handleDelete:()=>e.commands.handleLabelDelete(!1)})]})}],734043);let eB={type:"gridCell",content:[{type:"paragraph"}]};e.s(["EMPTY_GRID_CELL",0,eB,"MAX_COLUMNS",0,4,"NODE_NAME",0,"gridLayout"],808707);let ez=({editor:e,selection:i,handleDuplicate:n})=>{let a=(0,m.useCallback)(()=>{e.chain().insertContentAt(i.from+i.node.nodeSize,i.node.toJSON()).selectInsertedNode().run()},[e,i]);return(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Duplicate",id:"euc6Ns"}),icon:o.faClone,onClick:n||a,testId:"duplicate-node-button"})};e.s(["DuplicateNodeButton",0,ez],957448);let eF=({editor:e,label:i})=>(0,t.jsx)(T.ToolbarButton,{onClick:()=>{e.chain().selectParentNode().run()},label:i,children:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faArrowTurnUp,flip:"horizontal"})});e.s(["SelectParentButton",0,eF],973506),e.s(["LayoutCellFormattingMenu",0,({editor:e,selection:i})=>{let a=i.$from.parent.childCount<4,{verticalAlign:r,backgroundColor:s}=i.node.attrs,l=(0,m.useCallback)(t=>{e.chain().updateAttributes("gridCell",{verticalAlign:t===r?null:t}).selectNodeAtPos(i.from).focus().run()},[e,r,i]),d=(0,m.useCallback)(t=>{e.chain().updateAttributes("gridCell",{backgroundColor:t}).selectNodeAtPos(i.from).focus().run()},[e,i]);return(0,t.jsxs)(n.ButtonGroup,{spacing:1,size:"sm",alignItems:"center",children:[(0,t.jsx)(eF,{editor:e,label:u.i18n._({id:"NFoeBH",message:"Edit layout..."}),icon:o.faColumns}),a&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(T.ToolbarButton,{label:u.i18n._({id:"bZ9ges",message:"Add column before"}),icon:o.faDiagramCells,iconRotation:270,onClick:()=>{e.chain().insertContentAt(i.from,eB).run()},testId:"add-col-before-button"}),(0,t.jsx)(T.ToolbarButton,{label:u.i18n._({id:"7ibPpM",message:"Add column after"}),icon:o.faDiagramCells,iconRotation:90,onClick:()=>{e.chain().insertContentAt(i.from+i.node.nodeSize,eB).run()},testId:"add-col-after-button"}),(0,t.jsx)(ez,{editor:e,selection:i})]}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>l("start"),isActive:"start"===r,label:u.i18n._({id:"/Q0jUh",message:"Align top"}),icon:z.faArrowUpToLine}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>l("center"),isActive:"center"===r,label:u.i18n._({id:"QhuQN2",message:"Align middle"}),icon:z.faArrowsToLine}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>l("end"),isActive:"end"===r,label:u.i18n._({id:"EPnxoe",message:"Align bottom"}),icon:z.faArrowDownToLine}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eN.ColorButton,{editor:e,color:s,setColor:d,analyticsSource:"LayoutCell"}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eR.DeleteNodeButton,{editor:e,handleDelete:()=>{e.chain().selectInsideNodeAtPos(i.from).handleLayoutDelete(!0,!1).run()}})]})}],293330),e.s(["LayoutFormattingMenu",()=>eY],991097);var eH=e.i(227909),eW=e.i(818315),eU=e.i(622758),eV=e.i(777226);let eG={src:e.i(995631).default,width:20,height:25,blurWidth:0,blurHeight:0},e$={src:e.i(900077).default,width:20,height:25,blurWidth:0,blurHeight:0},eZ={src:e.i(442329).default,width:20,height:25,blurWidth:0,blurHeight:0},eK={src:e.i(966953).default,width:20,height:25,blurWidth:0,blurHeight:0},eq={src:e.i(253320).default,width:20,height:25,blurWidth:0,blurHeight:0},eY=({editor:e,selection:i})=>{let{node:a,from:r}=i,{verticalAlign:l}=e.getAttributes("gridCell"),d=(0,m.useCallback)(t=>{e.chain().updateAttributes("gridCell",{verticalAlign:t===l?null:t}).selectNodeAtPos(i.from).focus().run()},[e,i,l]),p=(0,m.useCallback)(()=>{if(!r||!a)return;let t=(0,eV.equalizeColumnWidths)(a.childCount);e.commands.useLayoutPreset(r,t)},[e,r,a]),h=(0,m.useCallback)(t=>{let n=e.chain();if(n.updateAttributes("gridLayout",{backgroundColor:t}),null!==t)try{let t=e.state.doc.resolve(i.from);(0,eU.getLayoutChildren)(t).forEach(e=>{n.updateAttributesAtPos(e.pos,{backgroundColor:null})})}catch(e){console.warn("Could not clear child cell colors:",e)}n.selectNodeAtPos(i.from).focus().run()},[e,i]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(n.ButtonGroup,{spacing:1,size:"sm",alignItems:"center",children:[(0,t.jsxs)(L.Dropdown,{isLazy:!0,children:[(0,t.jsx)(L.DropdownButton,{as:P.Button,variant:"toolbar",rightIcon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faChevronDown}),size:"sm","data-testid":"layout-preset-dropdown",children:(0,t.jsx)(c.Trans,{message:"{0} columns",id:"6v+N4U",values:{0:a.childCount}})}),(0,t.jsx)(L.DropdownList,{"data-in-editor-focus":!0,fontSize:"md",children:[{name:u.i18n._({id:"oCWIE5",message:"2 columns - equal"}),testId:"layout-preset-5050",image:eK,value:[50,50]},{name:u.i18n._({id:"eWUI4Z",message:"2 columns - left"}),testId:"layout-preset-7030",image:eq,value:[70,30]},{name:u.i18n._({id:"hOcihM",message:"2 columns - right"}),testId:"layout-preset-3070",image:e$,value:[30,70]},{name:u.i18n._({id:"OnuuaA",message:"3 columns"}),testId:"layout-preset-3col",image:eG,value:[33.33,33.33,33.34]},{name:u.i18n._({id:"hexbw8",message:"4 columns"}),testId:"layout-preset-4col",image:eZ,value:[25,25,25,25]}].map(({testId:i,name:n,image:o,value:s})=>(0,t.jsx)(L.DropdownItem,{"data-testid":i,icon:a&&JSON.stringify(s)===JSON.stringify(a.attrs.colWidths)?(0,t.jsx)(eH.CheckIcon,{w:"2rem"}):(0,t.jsx)(eW.Image,{h:"1rem",w:"2rem",objectFit:"cover",src:o.src}),onClick:()=>{r&&e.commands.useLayoutPreset(r,s)},children:n},n))})]}),(0,t.jsx)(T.ToolbarButton,{onClick:p,label:u.i18n._({id:"SOkhdm",message:"Equalize columns"}),icon:o.faDistributeSpacingHorizontal,testId:"layout-equalize-columns-button"}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>d("start"),isActive:"start"===l,label:u.i18n._({id:"/Q0jUh",message:"Align top"}),icon:z.faArrowUpToLine}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>d("center"),isActive:"center"===l,label:u.i18n._({id:"QhuQN2",message:"Align middle"}),icon:z.faArrowsToLine}),(0,t.jsx)(T.ToolbarButton,{onClick:()=>d("end"),isActive:"end"===l,label:u.i18n._({id:"EPnxoe",message:"Align bottom"}),icon:z.faArrowDownToLine}),(0,t.jsx)(eN.ColorButton,{color:a.attrs.backgroundColor,setColor:h,editor:e,analyticsSource:"Layout"}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eR.DeleteNodeButton,{editor:e})]})})};var eX=e.i(957897),eQ=e.i(549022),eJ=e.i(686296),e0=e.i(770127);let e1=()=>[{name:u.i18n._({id:"bjuYAW",message:"Solid button"}),key:"solid",icon:z.faRectangleWide},{name:u.i18n._({id:"bCuf07",message:"Outlined button"}),key:"outline",icon:o.faRectangleWide},{name:u.i18n._({id:"1lWK8g",message:"Link button"}),key:"link",icon:o.faLink}],e2={buttonGroup:{alignEnabled:!0,colorEnabled:!0,linkDropdownEnabled:!0,variants:["solid","outline"],defaultVariant:"solid"},navbarButtons:{alignEnabled:!1,colorEnabled:!0,linkDropdownEnabled:!1,variants:["solid","outline"],defaultVariant:"solid"},navbarLinks:{alignEnabled:!0,colorEnabled:!1,linkDropdownEnabled:!1,variants:["link"],defaultVariant:"link"}};e.s(["BUTTON_GROUP_RULES",0,e2,"MAX_BUTTONS",0,3,"getButtonVariants",0,e1],704416);let e3=({editor:e,selection:i,isDisabled:n})=>{let a=(0,p.findParentNode)(e=>"button"===e.type.name)(i),l=i instanceof h.TextSelection?a?"button":"link":i.node.type.name,d="link"===l,u="button"===l,g=e.getAttributes(l),f=u?"button":d?"link":"displayStyle"in g&&g.displayStyle||"inline",b=(0,m.useCallback)(t=>{if(l===t)return;let i="inline"===t||"preview"===t;switch(l){case"link":i?e.commands.convertLinkToMedia(t):"button"===t&&e.commands.convertLinkToButton();break;case"button":"link"===t?e.commands.convertButtonToLink():i&&e.commands.convertButtonToMedia(t);break;default:"link"===t?e.commands.convertMediaToLink():"button"===t?e.commands.convertMediaToButton():e.commands.updateAttributes(l,{displayStyle:t})}},[e,l]),x={link:{title:(0,t.jsx)(c.Trans,{message:"Link",id:"yzF66j"})},button:{title:(0,t.jsx)(c.Trans,{message:"Button",id:"hxBFty"})},preview:{title:(0,t.jsx)(c.Trans,{message:"Preview",id:"rdUucN"})},inline:{title:(0,t.jsx)(c.Trans,{message:"Embed",id:"KKBlUU"})}};return(0,t.jsxs)(D.Menu,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,t.jsx)(N.MenuButton,{as:P.Button,"data-testid":"display-style-dropdown",isDisabled:n,size:"sm",rightIcon:(0,t.jsx)(s.FontAwesomeIcon,{fixedWidth:!0,icon:o.faChevronDown,transform:"shrink-6"}),boxShadow:"none",onMouseDown:_.preventDefaultToAvoidBlur,children:x[f].title}),(0,t.jsx)(O.MenuList,{zIndex:2,children:(0,t.jsx)(B.MenuOptionGroup,{type:"radio",onChange:b,value:f,children:Object.entries(x).map(([e,{title:i}])=>(0,t.jsx)(R.MenuItemOption,{value:e,onMouseDown:_.preventDefaultToAvoidBlur,"data-testid":`display-style-option-${e}`,children:(0,t.jsx)(r.Text,{children:i})},e))})})]})};e.s(["ButtonFormattingPopoverMenu",0,({editor:e,selection:i})=>{let{href:a}=e.getAttributes("button"),{isPageLink:r}=eb({href:a}),s=(0,f.useAppSelector)(X.selectTheme),l=(0,eJ.getThemeButtonColor)(s),d=(0,eJ.getThemeColorSolid)(l),u=(0,e0.getGradientCss)(l),p=e.getAttributes("button").color,g=e2[i.$from.node(-1).type.name],b=e1().filter(e=>g.variants.includes(e.key)),y=(0,m.useCallback)(()=>e.commands.handleButtonDelete(!1),[e]),v=(0,m.useCallback)(t=>{e.commands.updateAttributes("button",{color:t})},[e]);return(0,t.jsxs)(ew.FormattingPopoverMenuSection,{overflow:"hidden",children:[g.linkDropdownEnabled&&a&&(i instanceof h.TextSelection||i instanceof h.NodeSelection)&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Link display",id:"/SVg/B"}),icon:o.faInputText,children:(0,t.jsx)(e3,{editor:e,selection:i,isDisabled:r})}),(0,t.jsx)(ev,{href:a||"",updateHref:t=>{e.commands.updateAttributes("button",{href:t})},clearHref:()=>{e.commands.updateAttributes("button",{href:""})},editor:e}),b.length>=2&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Style",id:"q6YAHa"}),icon:o.faRectangleWide,children:(0,t.jsx)(n.ButtonGroup,{spacing:1,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:b.map(({name:i,icon:n,key:a})=>(0,t.jsx)(T.ToolbarButton,{label:i,icon:n,onClick:()=>{e.commands.updateAttributes("button",{variant:a})},isActive:e.isActive("button",{variant:a}),my:0},i))})}),g.alignEnabled&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:o.faAlignLeft,children:(0,t.jsx)(n.ButtonGroup,{dir:"ltr",spacing:0,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:x.AlignmentCommands.map(({name:i,icon:n,checkActive:a,apply:r})=>{if(a&&r)return(0,t.jsx)(T.ToolbarButton,{label:i(),icon:n,onClick:()=>{r(e)},isActive:a(e),my:0},i())})})}),g.colorEnabled&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Color",id:"jZlrte"}),icon:o.faFillDrip,children:(0,t.jsx)(n.ButtonGroup,{spacing:0,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:(0,t.jsxs)(D.Menu,{isLazy:!0,children:[(0,t.jsx)(eX.ColorMenuButton,{color:p||d,isDefaultColor:null===p||p===d}),(0,t.jsx)(O.MenuList,{overflow:"hidden",children:(0,t.jsx)(eQ.ColorPickerMenuInner,{currentColor:p||(u?null:d),setColor:v,source:"ButtonColor"})})]})})}),(0,t.jsx)(eC.FormattingPopoverMenuFooter,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:o.faTrash,onClick:y,colorScheme:"red"})]})}],577467),e.s(["EmbedVideoFormattingPopoverMenu",()=>tl],821094);var e5=e.i(308822),e4=e.i(929508),e6=e.i(178428),e9=e.i(837438),e8=e.i(322830),e7=e.i(706923),te=e.i(878917);let tt=(e,t,i)=>{let n=(0,e8.getSelectedMedia)({editor:e,selection:t,freshNode:i});if(n){if("smartLayoutCell"===n.node.type.name){let e=(0,e7.getSmartLayoutVariant)(n.node.attrs.variantKey);if(!n.attrs.source)if(e.defaultAttrs?.image?.source)n.attrs.source=e.defaultAttrs.image.source;else{let e=(0,Q.fragmentToArray)(t.$from.parent.content).find(e=>e.attrs.image?.source);n.attrs.source=e?.attrs.image?.source}}let e="imgKeyPath"in n?n.imgKeyPath:void 0;return{...n,type:n.node.type,accesoryKeyPath:e,editType:"accessory"===n.area||"background"===n.area?n.area:"node"}}if(t instanceof h.NodeSelection){let e=t.node;return{editType:"node",id:e.attrs.id,...e}}if(t instanceof h.TextSelection){if(t.to-t.from==1&&t.$from.nodeAfter&&!e.isActive("link")){let e=i??t.$from.nodeAfter;return{editType:"node",id:e.attrs.id,...e}}if(e.isActive("link")){let t=e.getAttributes("link");return{attrs:t,type:e.schema.marks.link,mediaType:"embed",id:t.id}}}return null},ti=({editor:e,selection:t,sourceKey:i,attrs:n,nodeName:a,resetAttrs:r,resizeToFit:o})=>{let s,l=t.from,d=tt(e,t);if(!d)return void console.error("[updateSelectedMedia] No selectedMedia to update");if(r)s={};else if(d.type instanceof e5.MarkType)s=d.attrs;else{let i=e.state.doc.nodeAt(l);if(!i||i.type!==d.type&&i.attrs.id!==d.attrs.id){let t=d.attrs.id;if(t){let n=(0,p.findChildren)(e.state.doc,e=>e.attrs.id===t)[0];n&&(l=n.pos,i=n.node)}if(!i||i.type!==d.type&&i.attrs.id!==d.attrs.id)return void console.error("[updateSelectedMedia] Node has moved, cant update")}s=tt(e,t,i)?.attrs||{}}let c={...s,source:i,...n};if(o&&"node"===d.editType&&(c=(0,A.resizeImageToFitViewport)(c)),n.src&&"error"===c.loadImageStatus&&(delete c.loadImageStatus,delete c.loadImageParams,delete c.loadImageId),d&&(0,e4.trackImageReplaced)({previous_attrs:d.attrs,new_attrs:c,replacement_method:"media_drawer",doc_id:e.gammaDocId||"",node_id:d.attrs.id,image_type:d.type.name}),d?.type.name==="link"){c.href=c.href||c.sourceUrl;let{from:i,to:n}=t;e.chain().extendMarkRange("link").updateAttributes("link",c).setTextSelection({from:i,to:n}).run();return}if("smartDiagram"===d.type.name&&d.accesoryKeyPath)return void e.chain().updateSmartDiagramData(l,d.accesoryKeyPath,c).run();if(d.accesoryKeyPath){let t=c.extraction,i=e.chain().updateAttributeKeyPathAtPos(l,d.accesoryKeyPath,c);t?.elements?.length&&(i=(0,e6.addPositionedTextboxesToChain)(i,e,l,t,{clearExisting:!0})),i.run();return}let u=te.MediaSourcesMap[c.source],m=a||u.nodeName;if(!m)return;let g=c.extraction;if(e.commands.command(({tr:e,state:t})=>{let i=t.schema.nodes[m];if(!i)return!1;let n={type:"update-node-attrs",pos:l};return e.setNodeMarkup(l,i,c).setSelection(h.NodeSelection.create(e.doc,l)).setMeta("annotationEvent",n),!0}),g?.elements?.length){let t=e.chain();(t=(0,e6.addPositionedTextboxesToChain)(t,e,l,g,{clearExisting:!0})).run()}};e.s(["canEditInMediaDrawer",0,(e,t)=>!!t.spec.accessoryImageKey||"smartDiagram"===t.name&&e.state.selection instanceof e9.DiagramItemSelection||(t instanceof e5.NodeType?(0,A.isMediaNodeType)(t):t instanceof e5.MarkType&&"link"===t.name),"getSelectedMedia",0,tt,"updateSelectedMedia",0,ti],32113);var tn=e.i(367792);e.i(261991);var ta=e.i(879891),tr=e.i(547119);let to=e=>e&&ta.MediaProvidersMap[e]?ta.MediaProvidersMap[e]:tr.WebpageProvider;e.s(["getEmbedProvider",0,to,"getProxiedUrl",0,e=>`${tn.config.EMBED_PROXY_URL}?alt_url=${e}`],224960);let ts="embed-formatting-invalid-error",tl=({editor:e,selection:i})=>{let n=(0,$.useToast)(),a=(0,M.useToggleMediaDrawer)(),r=(0,m.useCallback)(t=>{e.view.focus(),a({isOpen:!0}),t.stopPropagation()},[e,a]),s=(0,m.useCallback)(()=>{e.chain().deleteSelectionAndSelectNear().run()},[e]),l=(0,m.useCallback)(t=>{"none"!==t&&e.commands.updateAttributes(i.node.type.name,{clickBehavior:t})},[e,i]),d=(0,m.useCallback)(a=>{let r="embed.custom";(0,K.fetchAndUpdateEmbedAttrsForUrlAndUploadThumbnail)(a,t=>{r=t.source||r,ti({editor:e,selection:i,attrs:t,sourceKey:r})}).catch(e=>{n.isActive(ts)||n({id:ts,title:(0,t.jsx)(c.Trans,{message:"Sorry, we couldn't reach this URL.",id:"MWOB3g"}),description:(0,t.jsx)(c.Trans,{message:"If this is a private URL that requires a login, try using the app's share function to generate an embed code.",id:"iEFpL0"}),status:"error",position:"top",duration:3e3,isClosable:!0}),console.error("[caught] EmbedVideoFormattingMenu error fetching URL",e)})},[e,n,i]),u=e.getAttributes(i.node.type.name),p="displayStyle"in u&&u.displayStyle||"inline",h=(0,A.getMediaEmbedUrl)(u),g=(0,I.isNodeInGallery)(i.$from),f="video"===i.node.type.name,b=(0,A.getEmbedOrVideoClickBehavior)(u,"preview"===p&&!g),x=u.source?to(u.source):null,y="inline"===p&&(f||x?.inlineInteractive)&&!g;return(0,t.jsxs)(ew.FormattingPopoverMenuSection,{children:[!g&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Link display",id:"/SVg/B"}),icon:"inline"===p?o.faBrowser:o.faSidebarFlip,children:(0,t.jsx)(e3,{editor:e,selection:i})}),(0,t.jsx)(ev,{href:h||"",updateHref:d,editor:e,isEmbedLink:!0}),!y&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Click action",id:"S58tkK"}),icon:"newTab"===b?o.faArrowUpRightFromSquare:o.faMagnifyingGlassPlus,children:(0,t.jsx)(F,{currentClickBehavior:b,handleClickBehaviorChange:l})}),(0,t.jsx)(eC.FormattingPopoverMenuFooter,{label:(0,t.jsx)(c.Trans,{message:"Delete",id:"cnGeoo"}),icon:o.faTrash,onClick:s,colorScheme:"red",secondaryAction:r,secondaryIcon:o.faGear,secondaryLabel:(0,t.jsx)(c.Trans,{message:"Advanced",id:"sxkWRg"})})]})};var td=e.i(849187),tc=e.i(833431),tu=e.i(623184),tp=e.i(863750);let th=(0,m.memo)(({editor:e,href:n})=>{let{docId:l,isValidDocUrl:d}=((e,t)=>{try{let i=[...e.matchAll(ea.GAMMA_DOC_REGEX)],n=i.length&&i[0]?(0,ea.getDocIdFromUrl)(i[0][0]):null,{cardId:a}=(0,ea.parseUrlHash)(e);return{docId:n,isValidDocUrl:!!n&&(n!==t||!a)}}catch(t){return console.debug("[validateDocMentionUrl] Error parsing URL:",e,t),{docId:null,isValidDocUrl:!1}}})(n,e.gammaDocId),{data:u,error:p}=(0,tp.useGetDocMentionQuery)({variables:{id:l||""},skip:!d});return(0,t.jsx)(tu.Fade,{in:!!u?.doc&&!p&&d,unmountOnExit:!0,children:(0,t.jsx)(eC.FormattingPopoverMenuRow,{minH:8,children:(0,t.jsxs)(H.Flex,{gap:2,alignItems:"center",w:"100%",children:[(0,t.jsx)(P.Button,{variant:"link",size:"sm",leftIcon:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faArrowsRepeat}),onClick:()=>{e.commands.convertLinkToDocMention(l)},children:(0,t.jsx)(c.Trans,{message:"Convert URL to",id:"OB1CKc"})}),(0,t.jsx)(i.Box,{color:"blue.950",bgColor:"blue.100",ms:"auto",borderRadius:"md",padding:"0.05em 0.1em",maxWidth:"2xs",children:(0,t.jsxs)(a.HStack,{display:"inline-flex",spacing:0,children:[(0,t.jsx)(i.Box,{display:"inline-block",textAlign:"center",minWidth:4,children:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faRectangleHistory,fixedWidth:!0,size:"sm",style:{marginInlineStart:"0.1em",marginInlineEnd:"0.3em"}})}),(0,t.jsx)(r.Text,{noOfLines:1,whiteSpace:"normal",wordBreak:"break-all",flex:1,lineHeight:"normal",children:u?.doc?.title||""})]})})]})})})});th.displayName="LinkConvertToDocMention",e.s(["LinkFormattingPopoverMenu",0,({editor:e,selection:i})=>{let a=(0,f.useAppSelector)(X.selectTheme),r=e.getAttributes("link").href||"",s=!e.shouldUseLiteMenus,{isPageLink:l}=eb({href:r}),d=(0,eJ.getThemeColorSolid)((0,eJ.getThemeLinkColor)(a)),u=(0,td.useFeatureFlag)("disableDocMentionPasteRule"),p=(0,m.useCallback)(t=>{e.commands.updateSurroundingLink(t)},[e]),h=(0,M.useToggleMediaDrawer)(),g=(0,m.useCallback)(t=>{e.view.focus(),h({isOpen:!0}),t.stopPropagation()},[e,h]);return(0,t.jsxs)(ew.FormattingPopoverMenuSection,{children:[s&&r&&!(0,Y.isOtherSupportedProtocol)(r)&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Link display",id:"/SVg/B"}),icon:o.faLink,children:(0,t.jsx)(e3,{editor:e,selection:i,isDisabled:l})}),(0,t.jsx)(ev,{href:r,updateHref:p,clearHref:()=>{e.commands.updateSurroundingLink("")},removeLink:()=>e.commands.removeSurroundingLink(),editor:e}),s&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Horizontal alignment",id:"0j+RGO"}),icon:o.faAlignLeft,children:(0,t.jsx)(n.ButtonGroup,{dir:"ltr",spacing:0,size:"sm",onMouseDown:_.preventDefaultToAvoidBlur,children:x.AlignmentCommands.map(({name:i,key:n,icon:a,shortcut:r,checkActive:o,apply:s})=>{if(o&&s)return(0,t.jsx)(T.ToolbarButton,{label:i(),shortcut:r,isActive:o(e),onClick:()=>{s(e)},icon:a,testId:n,my:0},n)})})}),s&&(0,t.jsx)(eC.FormattingPopoverMenuRow,{label:(0,t.jsx)(c.Trans,{message:"Color",id:"jZlrte"}),icon:o.faFillDrip,children:(0,t.jsx)(tc.TextColorMenu,{editor:e,useMenuButton:!0,isLinkText:!0,defaultTextColor:d})}),s&&u&&(0,t.jsx)(th,{editor:e,href:r}),s&&!(0,Y.isOtherSupportedProtocol)(r)&&(0,t.jsx)(eC.FormattingPopoverMenuFooter,{label:(0,t.jsx)(c.Trans,{message:"Advanced",id:"sxkWRg"}),onClick:g,icon:o.faGear})]})}],206479),e.s(["MediaPlaceholderFormattingMenu",()=>tg],364991);var tm=e.i(255664);let tg=({editor:e,selection:i})=>{let r=(0,M.useToggleMediaDrawer)(),s=(0,m.useCallback)(t=>{e.view.focus(),r({isOpen:!0}),t.stopPropagation()},[e,r]),l=(0,tm.isFootnoteEditor)(e),d=(0,I.isNodeInGallery)(i.$from);return(0,t.jsxs)(a.HStack,{spacing:0,children:[!d&&!l&&(0,t.jsxs)(H.Flex,{dir:"ltr",children:[x.AlignmentCommands.map(({name:i,icon:n,checkActive:a,apply:r})=>{if(a&&r)return(0,t.jsx)(T.ToolbarButton,{label:i(),icon:n,onClick:()=>{r(e)},isActive:a(e)},i())}),(0,t.jsx)(eO.FormattingMenuDivider,{})]}),(0,t.jsxs)(n.ButtonGroup,{spacing:0,size:"sm",alignItems:"center",children:[(0,t.jsxs)(t.Fragment,{children:[d&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eF,{editor:e,label:u.i18n._({id:"+v0hYZ",message:"Edit gallery..."}),icon:o.faGrid2}),(0,t.jsx)(eO.FormattingMenuDivider,{})]}),(0,t.jsx)(T.ToolbarButton,{label:(0,t.jsx)(c.Trans,{message:"Edit",id:"ePK91l"}),icon:o.faEdit,onClick:s,testId:"edit-button"})]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(eR.DeleteNodeButton,{editor:e})]})]})]})};e.s(["SmartDiagramFormattingMenu",()=>tk],952697);var tf=e.i(990272);let tb=({selected:e,availableTemplateKeys:n,onChange:l,isLoading:d=!1})=>{let c=(0,m.useMemo)(()=>n.map(e=>{try{let t=(0,tf.getSmartDiagramTemplate)(e);return{key:e,template:t,label:t.label()}}catch(e){return null}}).filter(e=>null!==e).sort((e,t)=>e.label.localeCompare(t.label)),[n]),p=(0,m.useMemo)(()=>{try{return(0,tf.getSmartDiagramTemplate)(e)}catch(e){return null}},[e]),h=p?.label()||e;return(0,t.jsxs)(L.Dropdown,{isLazy:!0,children:[(0,t.jsx)(L.DropdownButton,{as:P.Button,variant:"toolbar",size:"sm",boxShadow:"none",rightIcon:(0,t.jsx)(s.FontAwesomeIcon,{icon:z.faChevronDown,size:"xs",fixedWidth:!0}),isLoading:d,loadingText:u.i18n._({id:"DBJmXQ",message:"Transforming..."}),disabled:d,children:(0,t.jsxs)(a.HStack,{children:[p?.previewImage&&(0,t.jsx)(eW.Image,{src:p.previewImage.src,w:"2em",h:"2em",alt:p.label(),pointerEvents:"none",transform:"scale(1.75)"}),(0,t.jsx)(i.Box,{children:h})]})}),(0,t.jsx)(L.DropdownList,{zIndex:"modalPopover",children:c.map(({key:n,template:c,label:u})=>{let p=n===e,h=p||d;return(0,t.jsx)(L.DropdownItem,{onClick:()=>{h||l(n)},isDisabled:h,opacity:p?.6:1,pt:1,pb:1,children:(0,t.jsxs)(a.HStack,{children:[p&&(0,t.jsx)(i.Box,{w:"2em",h:"2em",display:"flex",alignItems:"center",justifyContent:"center",children:(0,t.jsx)(s.FontAwesomeIcon,{icon:o.faCheck})}),!p&&c.previewImage&&(0,t.jsx)(eW.Image,{src:c.previewImage.src,w:"2em",h:"2em",alt:c.label(),pointerEvents:"none",transform:"scale(1.75)"}),(0,t.jsx)(r.Text,{children:u})]})},n)})})]})};var tx=e.i(853081);e.i(734710);var ty=e.i(430378),tv=e.i(78387),tC=e.i(140753);e.i(615835);var tw=e.i(25747);async function tS({sourceTemplateKey:e,targetTemplateKey:t,sourceData:i,language:n,docId:a,workspaceId:r}){let o=JSON.parse(await (0,tx.renderJsxPrompt)({promptKey:"TransformDiagram",variables:{sourceTemplateKey:e,targetTemplateKey:t,sourceData:i,language:n},workspaceId:r}));if(!o.variant||!o.data)throw Error("Invalid response format from TransformDiagram prompt");return o}let tk=({editor:e,selection:i,decorations:n})=>{let o=i.node,l=i.node.type.name,{templateKey:d,data:c}=o.attrs,p=(0,tf.getSmartDiagramTemplate)(d),h=(0,tf.getSmartDiagramFormattingMenu)(d),{currentWorkspace:g}=(0,tw.useUserContext)(),f=(0,m.useMemo)(()=>Object.entries(tf.SmartDiagramTemplates).filter(([e,t])=>t.featureFlag?eM.featureFlags.get(t.featureFlag):!t.disabled).map(([e])=>e).sort(),[]),b=(0,m.useMemo)(()=>Object.entries(tf.SmartDiagramImageTemplates).filter(([e,t])=>t.featureFlag?eM.featureFlags.get(t.featureFlag):!t.disabled).map(([e])=>e).sort(),[]),x=f.includes(d),y=b.includes(d),v=x||y,{transformDiagramType:C,isTransforming:w}=function({editor:e,docId:t,workspaceId:i,sectionContext:n}){let[a,r]=(0,m.useState)(!1),o=(0,$.useToast)(),{user:s}=(0,tw.useUserContext)();return{transformDiagramType:(0,m.useCallback)(async({sourceTemplateKey:n,targetTemplateKey:l,sourceData:d,onSuccess:c,onError:p})=>{if(!a){r(!0);try{ty.analytics.track(tv.SegmentEvents.SMART_DIAGRAM_TRANSFORM_STARTED,{sourceTemplateKey:n,targetTemplateKey:l,userId:s?.id,workspaceId:i});let a=(0,tC.getLanguageForDiagrams)(e),r=await tS({sourceTemplateKey:n,targetTemplateKey:l,sourceData:d,language:a,docId:t,workspaceId:i});ty.analytics.track(tv.SegmentEvents.SMART_DIAGRAM_TYPE_CHANGED,{fromTemplateKey:n,toTemplateKey:l,userId:s?.id,workspaceId:i}),c(r)}catch(t){let e=t instanceof Error?t.message:"Unknown error";ty.analytics.track(tv.SegmentEvents.SMART_DIAGRAM_TRANSFORM_ERROR,{sourceTemplateKey:n,targetTemplateKey:l,errorMessage:e,userId:s?.id,workspaceId:i}),o({title:u.i18n._({id:"+FgFGk",message:"Failed to transform diagram"}),description:u.i18n._({id:"7LAiVo",message:"Unable to transform diagram type. Please try again or select a different diagram type."}),status:"error",duration:3e3,isClosable:!0}),p?.(t instanceof Error?t:Error(e))}finally{r(!1)}}},[a,t,i,n,o,s?.id]),isTransforming:a}}({editor:e,docId:e.gammaDocId||"",workspaceId:g?.id||""});return h&&p?(0,t.jsxs)(a.HStack,{spacing:2,children:[!v&&(0,t.jsxs)(a.HStack,{spacing:1,px:2,py:1,borderRadius:"md",children:[p.icon&&(0,t.jsx)(s.FontAwesomeIcon,{icon:p.icon,fixedWidth:!0}),(0,t.jsx)(r.Text,{fontSize:"sm",fontWeight:"medium",color:"gray.700",children:p.label()})]}),v&&(0,t.jsx)(tb,{selected:d,availableTemplateKeys:y?b:f,isLoading:w,onChange:t=>{C({sourceTemplateKey:d,targetTemplateKey:t,sourceData:c,onSuccess:t=>{let i=(0,tf.getSmartDiagramTemplate)(t.variant).defaultColorScheme,n=(0,tC.preserveExistingIconsAndImages)(c,t.data);e.commands.updateAttributes(l,{templateKey:t.variant,data:{...n,colorScheme:i}})}})}}),(0,t.jsx)(eO.FormattingMenuDivider,{}),(0,t.jsx)(h,{editor:e,selection:i,decorations:n})]}):null}},94596,e=>{"use strict";var t=e.i(391398),i=e.i(168578),n=e.i(344233),a=e.i(865639),r=e.i(965837),o=e.i(774314),s=e.i(892194),l=e.i(524473),d=e.i(541075),c=e.i(408122);e.s(["SearchInput",0,({searchQuery:e,onChange:u,placeholder:p})=>{let h={searchInputBorderColor:(0,s.useColorModeValue)("gray.200","whiteAlpha.200"),searchInputBackgroundColor:(0,s.useColorModeValue)("whiteAlpha.900","blackAlpha.900"),searchInputTextColor:(0,s.useColorModeValue)("gray.800","gray.50"),searchInputCloseColorScheme:(0,s.useColorModeValue)("blackAlpha","gray"),searchInputIconColor:(0,s.useColorModeValue)("gray.400","gray.500")};return(0,t.jsxs)(r.InputGroup,{size:"md",children:[(0,t.jsx)(o.InputLeftElement,{pointerEvents:"none",color:h.searchInputIconColor,children:(0,t.jsx)(i.SearchIcon,{})}),(0,t.jsx)(a.Input,{placeholder:p,value:e,onChange:u,backgroundColor:h.searchInputBackgroundColor,color:h.searchInputTextColor}),e&&(0,t.jsx)(o.InputRightElement,{p:4,children:(0,t.jsx)(n.IconButton,{variant:"ghost",colorScheme:h.searchInputCloseColorScheme,size:"xs","aria-label":c.i18n._({id:"V8yTm6",message:"Clear search"}),icon:(0,t.jsx)(d.FontAwesomeIcon,{icon:l.faXmark}),onClick:()=>u({target:{value:""}})})})]})}])},462269,(e,t,i)=>{var n=e.r(259093);t.exports=function(e){return n(e,4)}},598401,98707,332409,295884,230279,202599,864713,589193,803479,53237,127455,775952,235512,36025,948982,180190,379363,478401,577298,e=>{"use strict";e.s(["FormattingMenu",()=>iV],598401);var t,i=e.i(391398),n=e.i(428683),a=e.i(555145);e.i(828525);var r=e.i(876533),o=e.i(418588);e.i(197071);var s=e.i(564246),l=e.i(755453),d=e.i(175863),c=e.i(191788),u=e.i(324314),p=e.i(853361),h=e.i(418755),m=e.i(854861),g=e.i(254140),f=e.i(622758),b=e.i(15272),x=e.i(161268),y=e.i(45954),v=e.i(528403),C=e.i(951190),w=e.i(24439),S=e.i(103630),k=e.i(492812),A=e.i(384392),E=e.i(694801),_=e.i(329860),I=e.i(419087),M=e.i(147313),T=e.i(664075),L=e.i(643079),j=e.i(136008),P=e.i(229895),D=e.i(515785),N=e.i(747420),R=e.i(556504),O=e.i(198149),B=e.i(494556),z=e.i(799613),F=e.i(164042),H=e.i(734043),W=e.i(293330),U=e.i(991097),V=e.i(577467),G=e.i(821094),$=e.i(206479),Z=e.i(364991),K=e.i(952697);e.s(["SmartLayoutCellFormattingMenu",()=>e0],332409);var q=e.i(969641),Y=e.i(335799),X=e.i(524473),Q=e.i(541075),J=e.i(358280),ee=e.i(408122),et=e.i(275316),ei=e.i(612099),en=e.i(917067);e.i(734710);var ea=e.i(430378),er=e.i(78387),eo=e.i(267971),es=e.i(15464),el=e.i(24790),ed=e.i(613616),ec=e.i(641099),eu=e.i(892194),ep=e.i(440721),eh=e.i(241908),em=e.i(550927),eg=e.i(136484),ef=e.i(551880),eb=e.i(932138),ex=e.i(852400),ey=e.i(721455),ev=e.i(148318),eC=e.i(182895),ew=e.i(704273),eS=e.i(259658),ek=e.i(887527),eA=e.i(94596),eE=e.i(536788),e_=e.i(932132),eI=e.i(591378),eM=e.i(113669),eT=e.i(747355);let eL=c.memo(({selectedFamilyKey:e,setSelectedFamilyKey:t,searchQuery:a,handleSearchChange:r,suggestedFamilyKey:o})=>{let s={dropdownBgColor:(0,eu.useColorModeValue)("blackAlpha.100","whiteAlpha.100"),dropdownBgHoverColor:(0,eu.useColorModeValue)("blackAlpha.300","whiteAlpha.300"),dropdownTextColor:(0,eu.useColorModeValue)("gray.800","white")},l=(0,c.useMemo)(()=>{let e=[];return(0,eT.getAvailableVariants)().forEach(t=>{t.family.key===o?e.unshift({value:t.family.key,icon:X.faLightbulbOn,label:ee.i18n._({id:"+0acwA",message:"Suggested layouts"})}):e.push({value:t.family.key,icon:t.family.icon,label:t.family.name()})}),[{value:"",icon:X.faGrid2,label:ee.i18n._({id:"XbthhE",message:"All layouts"})},...e]},[o]);return(0,i.jsxs)(ed.Flex,{px:4,pb:2,direction:"column",gap:2,children:[(0,i.jsx)(n.Box,{mb:1,children:(0,i.jsx)(eA.SearchInput,{searchQuery:a,onChange:r,placeholder:ee.i18n._({id:"CYJHZl",message:"Search smart layouts"})})}),(0,i.jsxs)(ed.Flex,{alignItems:"center",gap:2,children:[(0,i.jsx)(ek.Text,{fontSize:"xs",mb:1,children:(0,i.jsx)(J.Trans,{message:"Filter by type:",id:"2BreKV"})}),(0,i.jsxs)(ey.Menu,{children:[(0,i.jsx)(ev.MenuButton,{as:q.Button,display:"flex",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown}),variant:"unstyled",size:"xs",textAlign:"start",bgColor:s.dropdownBgColor,color:s.dropdownTextColor,borderRadius:"md",px:2,_hover:{bgColor:s.dropdownBgHoverColor},children:o===e?(0,i.jsx)(J.Trans,{message:"Suggested layouts",id:"+0acwA"}):e?(0,eT.getAvailableVariantsByFamily)()[e]?.family.name():(0,i.jsx)(J.Trans,{message:"All layouts",id:"XbthhE"})}),(0,i.jsx)(ew.MenuList,{children:(0,i.jsx)(eS.MenuOptionGroup,{type:"radio",value:e||"",onChange:e=>t(""===e?null:String(e)),children:l.map(e=>(0,i.jsx)(eC.MenuItemOption,{value:e.value,children:(0,i.jsxs)(ed.Flex,{alignItems:"center",gap:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e.icon,fixedWidth:!0}),e.label]})},e.value))})})]})]})]})});eL.displayName="FilterControls";var ej=e.i(182535);let eP=(e,t)=>({...e,...Object.fromEntries(Object.entries(t).filter(([i])=>null===e[i]||void 0===e[i]||null===t[i]))}),eD=()=>(0,i.jsx)(ed.Flex,{direction:"column",w:"100%",gap:1,opacity:.7,px:4,children:Array.from({length:3}).map((e,t)=>(0,i.jsxs)(ed.Flex,{direction:"column",w:"100%",mb:4,children:[(0,i.jsx)(ed.Flex,{alignItems:"center",justifyContent:"space-between",mb:2,children:(0,i.jsxs)(ed.Flex,{px:2,py:1,alignItems:"center",flex:1,children:[(0,i.jsx)(n.Box,{as:"span",fontSize:"lg",me:2,children:(0,i.jsx)(n.Box,{w:"16px",h:"16px",bg:"gray.200",borderRadius:"sm"})}),(0,i.jsx)(n.Box,{w:"120px",h:"20px",bg:"gray.200",borderRadius:"md"})]})}),(0,i.jsx)(ec.SimpleGrid,{columns:2,spacing:4,children:Array.from({length:4}).map((e,t)=>(0,i.jsxs)(ed.Flex,{direction:"column",overflow:"hidden",h:"100px",position:"relative",children:[(0,i.jsx)(n.Box,{flex:1,borderWidth:"1px",borderColor:"gray.200",borderRadius:"md",w:"100%",position:"relative",bg:"gray.50"}),(0,i.jsx)(ed.Flex,{direction:"row",alignItems:"center",mt:2,children:(0,i.jsx)(n.Box,{w:"80px",h:"16px",bg:"gray.200",borderRadius:"md"})})]},t))})]},t))}),eN=Object.assign(({selectedSmartLayoutRange:e,closePanel:t,editor:n,node:a})=>((0,eg.useEditorUpdateDuringSelectionTiptap)(n,!0),(0,c.useEffect)(()=>{let i=n?.state.selection?.from,{from:a,to:r}=e||{};if(!a||!r||!i)return void t();let o=n?.state.doc.nodeAt(a),s=o?.type.name==="smartLayout";(i===a||i>a&&i{let[r,o]=(0,c.useState)(null);(0,c.useEffect)(()=>{if(!t||!t.from)return;let e=a&&a?.attrs?.variantKey||"",i=a&&a?.attrs?.options||{};o((0,eM.hashKeyAndOptions)(e,i))},[]);let s={bgColor:(0,eu.useColorModeValue)("white","gray.800"),textColor:(0,eu.useColorModeValue)("gray.800","white")},d=(0,c.useCallback)(e=>{n&&t&&t.from&&(o(e),requestAnimationFrame(()=>{t.from&&((e,t,i)=>{try{let n=e.chain(),{key:a,options:r}=(0,eM.parseKeyAndOptions)(t);n.updateAttributesAtPos(i,{variantKey:a,options:r});let o=(0,eT.getAllVariantsByKeyAndOptionHash)()[t];if(!o)return;let{cellAttrs:s}=o;if(s){let t=e.view.state.doc.nodeAt(i);if(!t)return;(0,l.findChildren)(t,y.isSmartLayoutCellNode).forEach(e=>{let t=i+e.pos+1,a=eP(e.node.attrs,s);n.updateNestedAttributesAtPos(t,a)})}let d=e.view.state.doc.nodeAt(i)?.attrs?.variantKey;d!==a&&ea.analytics.track(er.SegmentEvents.SMART_LAYOUT_VARIANT_CHANGED,{previousVariant:d,newVariant:a,method:"variant-panel"}),n.run()}catch(e){console.error("[Smart Layout Variant Panel] Error updating variant",e)}})(n,e,t.from)}))},[n,t]);return r?(0,i.jsx)(ep.Panel,{bgColor:s.bgColor,w:"100%",pt:4,children:(0,i.jsxs)(ed.Flex,{direction:"column",overflowX:"hidden",w:"100%",h:"100%",children:[(0,i.jsxs)(ed.Flex,{position:"relative",px:4,children:[(0,i.jsx)(ed.Flex,{flex:1,children:(0,i.jsx)(eh.PanelHeading,{children:(0,i.jsx)(J.Trans,{message:"Smart layouts",id:"uNnHCK"})})}),(0,i.jsx)(el.CloseButton,{onClick:e})]}),(0,i.jsx)(eO,{savedVariantHash:r,handleSelectVariant:d,editor:n,selectedSmartLayoutPos:t?.from,node:a})]})}):null},eO=c.default.memo(({savedVariantHash:e,handleSelectVariant:t,editor:n,selectedSmartLayoutPos:a,node:r})=>{let{selectedFamilyKey:o,setSelectedFamilyKey:s,searchQuery:l,handleSearchChange:d,filteredVariants:u,suggestedFamilyKey:p}=(({initialFamily:e=null,selectedVariantHash:t=null,editor:i,selectedSmartLayoutPos:n})=>{let[a,r]=(0,c.useState)(e),[o,s]=(0,c.useState)(""),[l,d]=(0,c.useState)(null),u=null,p=null,h=null;try{let e=void 0!==n?i?.state.doc.nodeAt(n):null;h=(p=(u=void 0!==n&&i?(0,w.getDecorationsForNode)(i,n):null)?(0,e_.findSmartLayoutDecoration)(u):null)?(0,eI.getSmartLayoutOptions)(e?.attrs,p.direction):null}catch(e){console.error(`[SmartLayout] unable to find decorations at ${n}`,e.message)}let{isHorizontal:m}=(0,eE.useLayoutIsHorizontal)({cellSize:h?.cellSize||0,horizontalAlign:h?.horizontalAlign||"center",orientation:h?.orientation||"horizontal",numCells:p?.numCells||0,containerSize:p?.containerSize||0});(0,c.useEffect)(()=>{if(t){let{key:e}=(0,eM.parseKeyAndOptions)(t),i=(0,eT.getAvailableVariants)().find(t=>t.variants.some(t=>t.variant.key===e));d(i?.family.key||null)}},[]);let g=(0,c.useCallback)(e=>{s(e.target.value),e.target.value.trim()&&a&&r(null)},[a]),f=(0,c.useCallback)(e=>e.map(e=>({...e,visible:!a||e.family.key===a})),[a]),b=(0,c.useCallback)(e=>{if(!o.trim())return e.map(e=>({...e,variants:e.variants.map(e=>({...e,options:e.options.map(e=>({...e,visible:!0}))}))}));let t=o.toLowerCase().trim();return e.map(e=>{let i=e.variants.map(i=>({...i,options:i.options.map(n=>({...n,visible:n.name().toLowerCase().includes(t)||i.variant.name().toLowerCase().includes(t)||e.family.name().toLowerCase().includes(t)}))})),n=i.some(e=>e.options.some(e=>e.visible));return{...e,variants:i,visible:n}})},[o]),x=(0,c.useCallback)(e=>e.map(e=>({...e,variants:e.variants.map(e=>({...e,options:e.options.map(e=>({...e,visible:e.visible&&(!e.hideIfVertical||m)}))}))})),[m]),y=(0,c.useCallback)(e=>{if(!l)return e;let t=e.findIndex(e=>e.family.key===l);if(-1===t)return e;let i=e[t],n=[...e];return n.splice(t,1),n.unshift({...i,family:{...i.family,name:()=>ee.i18n._({id:"+0acwA",message:"Suggested layouts"}),icon:X.faLightbulbOn}}),n},[l]);return{selectedFamilyKey:a,setSelectedFamilyKey:r,searchQuery:o,handleSearchChange:g,filteredVariants:(0,c.useMemo)(()=>{let e=[...(0,eT.getAvailableVariants)()];return y(e=x(e=b(e=f(e))))},[f,b,x,y]),suggestedFamilyKey:l}})({selectedVariantHash:e,editor:n,selectedSmartLayoutPos:a}),[h,m]=(0,c.useState)(!1),[g,f]=(0,c.useState)(!0);return(0,c.useEffect)(()=>{f(!0);let e=setTimeout(()=>{m(!0)},ex.RENDER_DELAY_MS),t=setTimeout(()=>{f(!1)},ex.LOADING_DELAY_MS);return()=>{clearTimeout(e),clearTimeout(t)}},[]),(0,i.jsxs)(ed.Flex,{direction:"column",h:"100%",overflowY:"auto",flex:1,pt:4,children:[(0,i.jsx)(eL,{selectedFamilyKey:o,setSelectedFamilyKey:s,searchQuery:l,handleSearchChange:d,suggestedFamilyKey:p}),g&&(0,i.jsx)(eD,{}),h&&(0,i.jsx)(ed.Flex,{direction:"column",w:"100%",gap:1,children:u.map((n,a)=>(0,i.jsx)(eB,{node:r,variantGroup:n,savedVariantHash:e,handleSelectVariant:t},a))})]})});eO.displayName="SmartLayoutVariantList";let eB=({node:e,variantGroup:t,savedVariantHash:n,handleSelectVariant:a})=>{let r=(0,c.useRef)(t.variants.flatMap(e=>e.options)),o=(0,h.useAppSelector)(ef.selectTheme),s=(0,c.useMemo)(()=>(({baseContent:e,variants:t})=>(0,ej.createDocWithCards)({settings:{cardDimensions:"16x9"}},t.map(t=>({type:"card",attrs:{id:t.key},content:[{type:"cardLayoutItem",content:[{...e,attrs:{...e.attrs,options:{...e.attrs?.options,...t.options},variantKey:t.variantKey},content:t.cellAttrs?.label&&e.content?e.content.map(e=>"smartLayoutCell"===e.type?{...e,attrs:eP(e.attrs||{},t.cellAttrs||{})}:e):e.content}]}]}))))({baseContent:e?.toJSON(),variants:r.current}),[e]);return(0,i.jsx)(eb.SmartLayoutVariantPanelStateProvider,{value:{variantGroup:t,savedVariantHash:n,handleSelectVariant:a},children:(0,i.jsx)(em.EditorPreview,{isThumbnail:!0,content:s,type:"smartLayoutVariantPanel",theme:o})})},ez=()=>{let{togglePanel:e,isPanelOpen:t}=(0,es.useTogglePanel)(eN);return{toggleSmartLayoutVariantPanel:e,isSmartLayoutVariantPanelOpen:t}};var eF=e.i(241894),eH=e.i(957448),eW=e.i(973506),eU=e.i(296690),eV=e.i(425605),eG=e.i(376556),e$=e.i(400551);e.s(["useImageFormattingMenuActions",()=>eQ,"useSmartLayoutCellFormattingMenuActions",()=>eJ],98707);var eZ=e.i(558247);e.i(419217);var eK=e.i(753748),eq=e.i(706923),eY=e.i(160396),eX=e.i(786928);let eQ=({editor:e,getPos:t})=>{let i=(0,h.useAppDispatch)(),n=(0,eX.useToggleMediaDrawer)(),a=(0,c.useCallback)((t,i=!0)=>{e.view.focus(),n({isOpen:!0,shouldResetSourceKey:i}),t.stopPropagation()},[e,n]);return{changeFocalPoint:(0,c.useCallback)(n=>{let a=t();"number"==typeof a&&(e.commands.selectNodeAtPos(a),i((0,eK.startChangeFocalPoint)({id:n})))},[e,t,i]),editImage:a}},eJ=({editor:e,node:t,parentNode:i})=>{let n=(0,c.useCallback)(t=>{e.chain().insertSmartLayoutCell(t).run()},[e]),a=(0,c.useCallback)(t=>{e.chain().insertSmartLayoutCell(t).run()},[e]),r=(0,c.useCallback)(i=>{e.chain().insertContentAt(i,t.toJSON()).selectInsertedNode().run()},[e,t]),o=(0,c.useCallback)(()=>{e.chain().handleSmartLayoutDelete().run()},[e]),s=(0,c.useCallback)((t,i)=>{e.commands.updateNestedAttributesAtPos(t,i)},[e]),l=(0,c.useCallback)(t=>{e.chain().updateNestedAttributesAtPos(t,{image:null}).run()},[e]),d=t.attrs.options,u=t.attrs.image,p=i&&(0,eI.getSmartLayoutDirection)(i.attrs),h=i?(0,eq.getSmartLayoutVariant)(i.attrs.variantKey):null,{imageSlot:m,imageType:g}=h??{},f=m&&!!u?.src,b=(0,eY.isSVGUrl)(u?.src||u?.tempUrl),x=(0,eY.isMp4Url)(u?.src);return{addColumnBefore:n,addColumnAfter:a,canChangeFocusPoint:"image"===g&&!b&&u?.src&&!x,canEditImageWithAI:(0,eZ.useCanEditImageWithAI)(u)&&f&&"image"===g,hasImage:f,imageSlot:m,imageType:g,addDirection:p,parentVariant:h,cellOptions:d,handleDelete:o,selectParent:t=>{e.commands.selectNodeAtPos(t),e.chain().selectParentNode().run()},duplicateNode:r,updateAttributes:s,resetImage:l}},e0=({editor:e,selection:t})=>{let{node:n,from:a}=t,o=(0,y.isSmartLayoutNode)(t?.$from.parent)?t?.$from.parent:null,{editImage:s}=eQ({editor:e,getPos:()=>a}),{currentMediaDrawerSourceKey:d,setMediaDrawerSourceKeyAction:u}=(0,eo.useDrawerSourceKey)(),p=(0,c.useCallback)(e=>{let t=n.attrs.image,i=et.featureFlags.get("pictographicIconsSearch")?en.PictographicIconProvider.key:ei.FontawesomeIconProvider.key;u(t?.source||i,!0),s(e,!1)},[n.attrs.image,s,u]),h=eJ({editor:e,node:n,parentNode:o}),{toggleSmartLayoutVariantPanel:m}=ez(),g=(0,c.useCallback)(t=>{let i=(0,l.findParentNodeClosestToPos)(t,y.isSmartLayoutNode);if(!i)return;let n=i.pos,a=n+i.node.nodeSize;e.commands.selectParentNode(),m({override:"open",isResizable:!1,props:{selectedSmartLayoutRange:{from:n,to:a},editor:e,node:i.node}})},[m,e]);if(!h)return null;let{addColumnBefore:f,addColumnAfter:b,canChangeFocusPoint:x,canEditImageWithAI:v,hasImage:C,imageSlot:w,imageType:S,addDirection:k,parentVariant:A,cellOptions:E,handleDelete:_,updateAttributes:I,resetImage:M}=h;return(0,i.jsxs)(Y.ButtonGroup,{spacing:1,size:"sm",alignItems:"center",children:[(0,i.jsx)(eW.SelectParentButton,{editor:e,label:ee.i18n._({id:"NFoeBH",message:"Edit layout..."}),icon:A?.icon}),(0,i.jsx)(e$.FormattingMenuDivider,{}),x&&(0,i.jsx)(eG.ChangeFocusPoint,{editor:e,pos:a,node:n}),v&&(0,i.jsx)(r.DarkModeProvider,{isDark:!1,children:(0,i.jsx)(eV.BuddyImageEditDropdownMenu,{editor:e,attrs:n.attrs.image,buttonProps:{variant:"toolbar"}})}),"always"===w||C?(0,i.jsx)(eU.ToolbarButton,{label:"icon"===S?(0,i.jsx)(J.Trans,{message:"Edit icon...",id:"JE/4q/"}):(0,i.jsx)(J.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:"icon"===S?X.faIcons:X.faEdit,onClick:p}):"optional"===w?(0,i.jsx)(eU.ToolbarButton,{label:"icon"===S?(0,i.jsx)(J.Trans,{message:"Add icon...",id:"1SYZRR"}):(0,i.jsx)(J.Trans,{message:"Add image...",id:"pVb3uA"}),icon:"icon"===S?X.faIcons:X.faImage,onClick:p}):null,C&&(0,i.jsx)(eU.ToolbarButton,{label:"icon"===S?(0,i.jsx)(J.Trans,{message:"Remove icon",id:"+4mjS6"}):(0,i.jsx)(J.Trans,{message:"Reset image",id:"EyVcag"}),icon:X.faImageSlash,color:"red.500",onClick:()=>M(a)}),("always"===w||C)&&(0,i.jsx)(e$.FormattingMenuDivider,{}),(0,i.jsx)(eU.ToolbarButton,{label:ee.i18n._({id:"w7mkyz",message:"Add item before"}),iconRotation:"bottom"===k?void 0:270,icon:X.faDiagramCells,onClick:()=>f(a),testId:"add-col-before-button"}),(0,i.jsx)(eU.ToolbarButton,{label:ee.i18n._({id:"1e37Dl",message:"Add item after"}),icon:X.faDiagramCells,iconRotation:"bottom"===k?180:90,onClick:()=>b(a+n.nodeSize),testId:"add-col-after-button"}),(0,i.jsx)(eH.DuplicateNodeButton,{editor:e,selection:t}),A?.cellOptions.length&&A?.cellOptions.length>0?(0,i.jsx)(e$.FormattingMenuDivider,{}):null,(0,i.jsx)(Y.ButtonGroup,{size:"sm",children:A?.cellOptions.map(r=>{let o=n.attrs;if(r.checkEnabled&&!r.checkEnabled({options:o.options,attrs:o}))return null;let s=E[r.key]??r.defaultValue?.({ctx:"menu"});return r.Control?(0,i.jsx)(r.Control,{value:s,updateValue:e=>{I(t.from,{options:{...E,[r.key]:e}}),ea.analytics.track(er.SegmentEvents.SMART_LAYOUT_CELL_OPTION_UPDATED,{variantKey:A?.key,optionKey:r.key,previousValue:s,newValue:e})},editor:e,option:r,pos:a},r.key):null})}),(0,i.jsx)(e$.FormattingMenuDivider,{}),(0,i.jsx)(q.Button,{variant:"toolbar",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faPenToSquare}),size:"sm",onClick:()=>g(t.$from),children:(0,i.jsx)(J.Trans,{message:"Change layout",id:"vR68Ol"})}),(0,i.jsx)(e$.FormattingMenuDivider,{}),(0,i.jsx)(eF.DeleteNodeButton,{editor:e,handleDelete:_})]})};e.s(["SmartLayoutFormattingMenu",()=>e4],295884);var e1=e.i(227909);e.i(58124);var e2=e.i(865594),e3=e.i(232278);let e5=({variant:e,variantKey:t,updateVariant:n})=>{let a=(0,c.useMemo)(()=>{let e=(0,eT.getAvailableVariants)(),a=e.find(e=>e.variants.some(e=>e.variant.key===t))?.family.key;return e.map(e=>{let r=a===e.family.key;return{key:`family-${e.family.key}`,label:e.family.name(),icon:e.family.icon,background:r?"trueblue.50":void 0,items:e.variants.map(e=>{let a=e.variant,r=t===a.key;return{key:`variant-${a.key}`,label:a.name(),icon:r?(0,i.jsx)(e1.CheckIcon,{}):(0,i.jsx)(Q.FontAwesomeIcon,{fixedWidth:!0,icon:a.icon}),background:r?"trueblue.50":void 0,onClick:()=>n(a.key)}})}})},[t,n]),r=(0,c.useRef)(null),{onContextMenu:o,menuProps:s}=(0,e3.useContextMenuDropdown)(r);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.Button,{variant:"toolbar",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),leftIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:e.icon,fixedWidth:!0}),size:"sm","data-testid":"smart-layout-variant-dropdown",onMouseDown:e=>o(e),ref:r,children:e.name()}),(0,i.jsx)(e2.ContextMenu,{...s,menuItems:a,size:"small",inEditorContext:!0})]})},e4=({editor:e,selection:t,decorations:n})=>{let{node:r}=t,{options:o,variantKey:s}=r.attrs,l=(0,eq.getSmartLayoutVariant)(s),d=(0,eT.getAvailableVariants)().find(e=>e.variants.some(e=>e.variant.key===s)),{toggleSmartLayoutVariantPanel:u}=ez(),p=(0,c.useCallback)(i=>{e.commands.updateNestedAttributesAtPos(t.from,i)},[e,t.from]),h=(0,c.useCallback)(()=>{u({override:"open",isResizable:!1,props:{selectedSmartLayoutRange:{from:t.from,to:t.to},editor:e,node:r}})},[u,t.from,t.to,e,r]),m=(0,c.useCallback)(e=>{p({variantKey:e}),ea.analytics.track(er.SegmentEvents.SMART_LAYOUT_VARIANT_CHANGED,{previousVariant:s,newVariant:e,method:"formatting-menu-dropdown"})},[p,s]);return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(a.HStack,{spacing:2,children:[d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e5,{variant:l,variantKey:s,updateVariant:m}),(0,i.jsx)(e$.FormattingMenuDivider,{})]}),(0,i.jsx)(Y.ButtonGroup,{size:"sm",children:l.options.map(a=>{let l=(0,e_.findSmartLayoutDecoration)(n),d=r.attrs,c=(0,eI.getSmartLayoutOptions)(d);if(a.checkEnabled&&!a.checkEnabled({options:c,attrs:d,deco:l,node:r}))return null;let u=o[a.key]??a.defaultValue?.({ctx:"menu"});return a.Control?(0,i.jsx)(a.Control,{value:u,updateValue:(i,n)=>{p({options:{...o,[a.key]:i}}),n&&r.forEach((n,r)=>{e.commands.updateNestedAttributesAtPos(t.from+r+1,{options:{...n.attrs.options,[a.key]:i}})}),ea.analytics.track(er.SegmentEvents.SMART_LAYOUT_OPTION_UPDATED,{variantKey:s,optionKey:a.key,previousValue:u,newValue:i,updateChildren:n,method:"formatting-menu"})},editor:e,option:a},a.key):null})}),(0,i.jsx)(e$.FormattingMenuDivider,{}),d&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(q.Button,{variant:"toolbar",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faPenToSquare}),size:"sm",onClick:h,children:(0,i.jsx)(J.Trans,{message:"Change layout",id:"vR68Ol"})}),(0,i.jsx)(e$.FormattingMenuDivider,{})]}),(0,i.jsx)(eF.DeleteNodeButton,{editor:e})]})})};e.s(["TableFormattingMenu",()=>iF],775952);var e6=e.i(500425),e9=e.i(575084),e8=e.i(896620);e.i(693774),e.i(144786);var e7=e.i(849187),te=e.i(190946),tt=e.i(832300),ti=e.i(777226);e.s(["Table",()=>tL],202599),e.i(838054);var tn=e.i(408767),ta=e.i(767730),tr=e.i(438106),to=e.i(577281),ts=e.i(456801),tl=e.i(214898),td=e.i(958859);e.s(["TableView",()=>tI],230279);var tc=e.i(470645);e.i(314572);var tu=e.i(835128),tp=e.i(473226),th=e.i(783197),tm=e.i(495084),tg=e.i(873463),tf=e.i(959022),tb=e.i(432247),tx=e.i(509510),ty=e.i(261442);e.i(905506);var tv=e.i(45652),tC=e.i(763498),tw=e.i(194552),tS=e.i(616820),tk=e.i(343902),tA=e.i(265304),tE=e.i(339891);let t_=({colWidths:e})=>(0,i.jsxs)("colgroup",{children:[(0,i.jsx)("col",{style:{width:"0%"}}),e.map((e,t)=>(0,i.jsx)("col",{className:"col-width-control",style:{width:`${e}%`}},t))]});t_.displayName="ColGroup";let tI=e=>{let t=(0,eg.useShouldRenderMobileVersion)(),{node:a,editor:r,getPos:o,decorations:s,updateAttributes:l}=e,d=(e=>{let{decorations:t,editor:i,node:n}=e,a=(0,tE.getTableDecoPos)(t);if(void 0===a)return t;let r=n.firstChild;if(!r)return t;let o=tC.AnnotationPluginKey.getState(i.state);if(!o)return t;let s=o.getAnnotationsBetween(i.state,a,a+1),l=a+1,d=l+r.nodeSize,c=new Set([...s,...o.getAnnotationsBetween(i.state,l,d)].map(e=>e.id));return t.filter(e=>!e.spec.isAnnotation||c.has(e.spec.id))})(e),{colMinPercent:u,newColSize:p}=r.schema.nodes.table.spec,h=(0,ti.canAddCol)((0,ti.parseColWidths)(a.attrs.colWidths),p,u),m=tt.TableMap.get(a),g=s.some(e=>e.spec.isFocusedInside),f=s.find(e=>e.spec.isColumnSelected)?.spec.colNumber,b=(0,c.useMemo)(()=>(0,ti.parseColWidths)(a.attrs.colWidths),[a.attrs.colWidths]),x=(0,tv.useSSRMounted)(),y=m.height*m.width,v=(0,th.useIsThumbnailView)();(0,tu.useTiptapEditorEffect)(()=>{m.width!==b.length&&l({colWidths:(0,ti.createColumnWidths)(m.width)})},[m.width,b,l]);let C=(0,c.useCallback)(e=>{let t=o();if("number"==typeof t)return t+1+m.positionAt(0,e,a)},[o,a,m]),w=(0,c.useCallback)(e=>{let t=C(e+1);if("number"!=typeof t)return;let i=t+1;r.chain().addColumnAfter(e).command(({tr:e})=>{let t=(0,tx.findSelectionInsideNode)(e.doc.resolve(i));return t&&e.setSelection(t),!0}).run()},[r,C]),S=(0,c.useCallback)(()=>{w(m.width-1)},[w,m.width]),k=(0,c.useCallback)(()=>{let e=o();"number"==typeof e&&r.chain().command(({tr:t,state:i})=>{let n=i.doc.nodeAt(e);if(!n)return!1;let a=i.schema,r=0,o=[];for(let e=0;er&&i<=20&&(r=i)}if(0===r||r>20){let e=new Map;o.forEach(t=>{t<=20&&e.set(t,(e.get(t)||0)+1)});let t=0;e.forEach((e,i)=>{e>t&&(t=e,r=i)})}(0===r||r>20)&&(r=3);let s=[];for(let e=0;e0||i.length0){let i=a.nodes.table.create({...n.attrs,colWidths:(0,ti.createColumnWidths)(r)},s);return t.replaceWith(e,e+n.nodeSize,i),!0}return!1}).run()},[r,o]),A=(0,tp.default)(b.reduce((e,t)=>e+t,0),20),E=m.width<=0||m.height<=0,_=0===a.childCount,I=y>=tA.MAX_TABLE_CELLS_TO_RENDER,M=(0,c.useMemo)(()=>{let e=!1;for(let t=0;tm.width){e=!0;break}return e},[a,m.width]);if(!x)return null;let T=(0,i.jsx)(J.Trans,{message:"Error: table has an invalid structure. Please roll back to an earlier version using Version History.",id:"4t5Za1"}),L=!1;return(M?(T=(0,i.jsx)(J.Trans,{message:"Error: table has a row with more cells than the table width.",id:"KvWsPt"}),L=!0):_?T=(0,i.jsx)(J.Trans,{message:"Error: table has no rows. Please roll back to an earlier version using Version History.",id:"2POCf1"}):I&&(T=(0,i.jsx)(J.Trans,{message:"Error: table is too large to display. Please roll back to an earlier version using Version History.",id:"/ZI3Eo"}),L=!0),I||E||_||!_&&0===y||M)?(0,i.jsx)(tf.NodeViewWrapper,{children:(0,i.jsxs)(n.Box,{contentEditable:!1,border:"1px solid red",p:"0.5em",display:"flex",alignItems:"center",gap:2,children:[(0,i.jsx)(ek.Text,{color:"red",flex:"1",children:T}),L&&(0,i.jsx)(q.Button,{size:"sm",sx:{fontSize:"0.7em",width:"7em",height:"2em"},colorScheme:"red",onClick:k,"data-testid":"repair-table-button",children:(0,i.jsx)(J.Trans,{message:"Try to Fix",id:"n6vGIp"})})]})}):(0,i.jsx)(tw.AnnotatableNodeViewWrapper,{as:"div",...e,...a.attrs,decorations:d,children:(0,i.jsxs)(n.Box,{w:"fit-content",overflowX:t?"auto":void 0,position:"relative",width:"100%",className:(0,tc.cx)("table-wrapper",tg.TABLE_CLASS),"data-selection-ring":!0,"data-table-style":a.attrs.tableStyle||"striped",children:[(0,i.jsxs)("table",{style:{width:t?"max-content":`${A}%`,minWidth:t?"100%":void 0,maxWidth:t?"200vw":void 0,tableLayout:t?"auto":"fixed",position:"relative"},children:[(0,i.jsx)(t_,{cols:m.width,colWidths:b}),(0,i.jsx)("thead",{children:(0,i.jsx)(tM,{numColumns:m.width,selectedColumn:f,getColumnPosition:C,...e})}),(0,i.jsx)(tb.NodeViewContent,{as:"tbody",className:"table-content",style:{display:"contents"}})]}),(0,i.jsx)(tk.ContainerDragHandle,{...e,handlePlacement:"outside","data-testid":"select-table-button",onClick:()=>{let e=C(0);"number"==typeof e&&r.chain().focus().selectTable(e).run()},label:ee.i18n._({id:"3xRGMR",message:"Select table"})}),g&&!v&&(0,i.jsxs)(n.Box,{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,i.jsx)(e8.GammaTooltip,{placement:"right",label:ee.i18n._({id:"AgvHni",message:"Add column"}),children:(0,i.jsx)(q.Button,{position:"absolute",insetInlineStart:"100%",top:"0",height:"100%",onClick:S,onMouseDown:ty.preventDefaultToAvoidBlur,minWidth:"0",width:"auto",isDisabled:!h,zIndex:1,"data-testid":"add-col-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:tm.CLICKABLE_BOX_CLASS,backgroundColor:"var(--clickable-background-color)",marginInlineStart:1,w:5,children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faPlus})})}),(0,i.jsx)(e8.GammaTooltip,{placement:"bottom",label:ee.i18n._({id:"qZd/ph",message:"Add row"}),children:(0,i.jsx)(q.Button,{position:"absolute",insetInlineStart:"0",top:"100%",width:"100%",onClick:()=>{let e=o();if("number"!=typeof e)return;let t=m.height-1,i=m.width-1,n=e+1+m.positionAt(t,i,a);r.chain().focus(n).addRowAfter().run(),requestAnimationFrame(()=>r.chain().focus(n).goToNextCell().run())},onMouseDown:ty.preventDefaultToAvoidBlur,minHeight:"0",height:6,zIndex:4,"data-testid":"add-row-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:tm.CLICKABLE_BOX_CLASS,mt:1,children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faPlus})})})]})]})})},tM=({numColumns:e,selectedColumn:t,getColumnPosition:n,...a})=>{let{editor:r}=a,o=(0,c.useCallback)(e=>{let t=n(e);"number"==typeof t&&r.chain().focus().selectColumn(t).run()},[r,n]),[s,l]=(0,c.useState)(!1);if(!e)return null;let d=Array.from(Array(e).keys());return(0,i.jsxs)("tr",{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,i.jsx)("th",{style:{padding:0}}),d.map(e=>(0,i.jsx)(tT,{colNumber:e,selectColumn:o,isSelected:e===t,getColumnPosition:n,isDragging:s,setIsDragging:l,...a},e))]})},tT=(0,c.memo)(({colNumber:e,selectColumn:t,getColumnPosition:a,isDragging:r,setIsDragging:o,...s})=>{let{decorations:l,editor:d}=s,{colHover:u}=(0,tS.findTableHoverDeco)(l),{colFocus:p}=(0,tS.findTableFocusDeco)(l),h=(0,c.useCallback)(()=>t(e),[e,t]),m=(0,c.useCallback)(t=>{t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/x-column-index",e.toString()),t.stopPropagation(),o(!0)},[e,o]),g=(0,c.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move",o(!0)},[o]),f=(0,c.useCallback)((e,t)=>{if(e===t)return;let i=a(e);"number"==typeof i&&d.chain().focus(i).command(({tr:i,state:n})=>(0,te.reorderColumnTr)(e,t,n.selection,i)).run()},[d,a]),b=(0,c.useCallback)(t=>{t.preventDefault(),o(!1);let i=parseInt(t.dataTransfer.getData("text/x-column-index"),10);if(isNaN(i))return void console.warn("Invalid fromCol in drop operation:",t.dataTransfer.getData("text/x-column-index"));let n=t.currentTarget.getBoundingClientRect(),a=t.clientX>n.left+n.width/2,r=e;a&&(r=e+1),i!==r&&!isNaN(r)&&i>=0&&r>=0?f(i,r):console.warn("Invalid column reorder parameters:",{fromCol:i,toCol:r,colNumber:e,isRightSide:a}),t.stopPropagation()},[e,f,o]),x=(0,c.useCallback)(e=>{e.preventDefault(),o(!1)},[o]);return(0,i.jsxs)("th",{style:{position:"relative",padding:0,border:0},className:"table-col-control",onDrop:b,onDragOver:g,onDragEnd:x,children:[(0,i.jsx)(tk.ContainerDragHandle,{...s,handlePlacement:"top",label:ee.i18n._({id:"pzbGX8",message:"Drag to rearrange column"}),zIndex:"3",isVisible:u===e||p===e,onClick:h,onDragStart:m,"data-test-column-control":e}),(0,i.jsx)(n.Box,{position:"absolute",top:"-2em",insetStart:"0.25em",insetEnd:"0.25em",bottom:"-2em",zIndex:"2",pointerEvents:r?"auto":"none",onDrop:b,onDragOver:g,onDragEnd:x,"data-testid":`column-drop-zone-${e}`})]},e)});tT.displayName="SelectColumnHeader";let tL=(0,ta.createTiptapNode)("table",{priority:tr.ExtensionPriorityMap.Table,containerHandle:!0,tableRole:"table",isolating:!0,allowGapCursor:!1,addNodeView:()=>(0,tn.ReactNodeViewRenderer)(tI,{update:to.attrsOrDecorationsChanged}),addOptions:()=>({resizable:!0,handleWidth:10,colMinPercent:10,newColSize:20,lastColumnResizable:!1,allowTableNodeSelection:!0}),parseHTML:()=>[{tag:"table",getAttrs:e=>(function(e){let t,i=e.getAttribute("data-col-widths")||e.getAttribute("colWidths");if(i)try{let e=JSON.parse(i);Array.isArray(e)&&((0,ti.fixWidths)(e),t=e)}catch{}if(!t){let i=e.querySelector("tr");if(i){let e=0;i.childNodes.forEach(t=>{("TD"===t.nodeName||"TH"===t.nodeName)&&e++}),t=(0,ti.createColumnWidths)(e)}else t=[]}return{colWidths:t,tableStyle:e.getAttribute("data-table-style")||"striped"}})(e)}],renderHTML({node:e,HTMLAttributes:t}){let i=(0,ti.parseColWidths)(e.attrs.colWidths);return["table",(0,l.mergeAttributes)(t,{...i.length&&{"data-col-widths":JSON.stringify(i)},"data-table-style":e.attrs.tableStyle||"striped"}),["tbody",0]]},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:i=!0}={})=>({dispatch:n,editor:a,commands:r})=>{if(!n)return!1;let o=function(e,t,i,n){let a=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(i=>{let n=e.nodes[i];n.spec.tableRole&&(t[n.spec.tableRole]=n)}),e.cached.tableNodeTypes=t,t}(e),r=[],o=[];for(let e=0;e({state:t,dispatch:i,tr:n})=>{if(!(0,td.isInTable)(t.selection)||!i)return!1;let a=(0,te.selectedRect)(t.selection);if(!a)return!1;let{table:r,tableStart:o}=a;return(0,te.addColumn)(n,{table:r,col:e,tableStart:o,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},addColumnAfter:e=>({state:t,dispatch:i,tr:n})=>{if(!(0,td.isInTable)(t.selection)||!i)return!1;let a=(0,te.selectedRect)(t.selection);if(!a)return!1;let{table:r,tableStart:o}=a;return(0,te.addColumn)(n,{table:r,col:e+1,tableStart:o,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},moveColumn:(e,t)=>({state:i,dispatch:n,tr:a})=>!!n&&(0,te.reorderColumnTr)(e,t,i.selection,a,n),equalizeColumns:()=>({state:e,dispatch:t,tr:i})=>{if(!(0,td.isInTable)(e.selection)||!t)return!1;let n=(0,te.selectedRect)(e.selection);if(!n)return!1;let{map:a,tableStart:r}=n,o=e.doc.nodeAt(r-1);return i.setNodeMarkup(r-1,void 0,{...o?.attrs,colWidths:(0,ti.createColumnWidths)(a.width)}),!0},visualizeTable:()=>({state:e,dispatch:t,tr:i})=>{if(!(0,td.isInTable)(e.selection)||!t)return!1;let n=(0,te.selectedRect)(e.selection);if(!n)return!1;let{map:a,tableStart:r}=n,o=e.doc.nodeAt(r-1);return i.setNodeMarkup(r-1,void 0,{...o?.attrs,colWidths:(0,ti.createColumnWidths)(a.width)}),!0},deleteColumn:()=>({state:e,dispatch:t,tr:i})=>!!t&&(0,te.deleteColumnTr)(e.selection,i,t),addRowBefore:()=>({state:e,dispatch:t})=>(0,te.addRowBefore)(e,t),addRowAfter:()=>({state:e,dispatch:t})=>(0,te.addRowAfter)(e,t),deleteRow:()=>({state:e,dispatch:t,tr:i})=>(0,te.deleteRowTr)(e.selection,i,t),deleteTable:()=>({state:e,tr:t,dispatch:i})=>!!i&&(0,te.deleteTableTr)(e.selection,t,i),deleteTableWhenEmpty:()=>({state:e,tr:t,dispatch:i})=>!!i&&(0,te.deleteTableWhenEmpty)(e.selection,t,i),deleteColWhenEmpty:()=>({state:e,tr:t,dispatch:i})=>!!i&&(0,te.deleteColWhenEmpty)(e.selection,t,i),deleteRowWhenEmpty:()=>({state:e,tr:t,dispatch:i})=>!!i&&(0,te.deleteRowWhenEmpty)(e.selection,t,i),mergeCells:()=>({state:e,dispatch:t})=>(0,te.mergeCells)(e,t),splitCell:()=>({state:e,dispatch:t})=>(0,te.splitCell)(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>(0,te.toggleHeaderColumn)(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>(0,te.toggleHeaderRow)(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>(0,te.toggleHeaderCell)(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>!!(0,te.mergeCells)(e,t)||(0,te.splitCell)(e,t),setCellAttribute:(e,t)=>({state:i,dispatch:n})=>(0,te.setCellAttr)(e,t)(i,n),goToNextCell:()=>({state:e,dispatch:t})=>(0,te.goToNextCell)(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>(0,te.goToNextCell)(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&(0,tl.fixTables)(e),!0),setCellSelection:e=>({tr:t,dispatch:i})=>{if(i){let i=C.CellSelection.create(t.doc,e.anchorCell,e.headCell);t.setSelection(i)}return!0},setTableStyle:e=>({state:t,dispatch:i,tr:n})=>{if(!(0,td.isInTable)(t.selection))return!1;if(!i)return!0;let a=(0,te.selectedRect)(t.selection);if(!a)return!1;let{tableStart:r}=a,o=t.doc.nodeAt(r-1);return!!o&&(n.setNodeMarkup(r-1,void 0,{...o.attrs,tableStyle:e}),i(n),!0)}}},addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.deleteTableWhenEmpty(),()=>e.deleteRowWhenEmpty(),()=>e.deleteColWhenEmpty()]);return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e}},addProseMirrorPlugins(){return this.options.resizable,[(0,ts.columnResizing)({handleWidth:this.options.handleWidth,colMinPercent:this.options.colMinPercent,lastColumnResizable:this.options.lastColumnResizable}),(0,v.tableEditing)({allowTableNodeSelection:this.options.allowTableNodeSelection}),(0,tE.TableDecorationPlugin)()]},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{colMinPercent:e.options?.colMinPercent,newColSize:e.options?.newColSize,tableRole:(0,l.callOrReturn)((0,l.getExtensionField)(e,"tableRole",t))}}}),tj={prefix:"fad",iconName:"table",icon:[640,640,[],"f0ce",["M144 224L296 224L296 328L144 328L144 224zM144 376L296 376L296 496L160 496C151.2 496 144 488.8 144 480L144 376zM344 224L496 224L496 328L344 328L344 224zM344 376L496 376L496 480C496 488.8 488.8 496 480 496L344 496L344 376z","M480 96C515.3 96 544 124.7 544 160L544 480C544 515.3 515.3 544 480 544L160 544L153.5 543.7C121.2 540.4 96 513.1 96 480L96 160C96 124.7 124.7 96 160 96L480 96zM144 376L144 480C144 488.8 151.2 496 160 496L296 496L296 376L144 376zM344 376L344 496L480 496C488.8 496 496 488.8 496 480L496 376L344 376zM144 328L296 328L296 224L144 224L144 328zM344 328L496 328L496 224L344 224L344 328z"]]};var tP=e.i(918228),tD=e.i(549022),tN=e.i(873082);let tR=({editor:e,selection:t})=>{let n=tO(e,t),a=(0,c.useCallback)(t=>{e.chain().focus().setTableCellBackgroundColor(t).run()},[e]),r=(0,c.useCallback)(()=>{e.chain().focus().unsetTableCellBackgroundColor().run()},[e]);return(0,i.jsxs)(ey.Menu,{isLazy:!0,onClose:()=>(0,tN.focusEditorOnMenuClose)(e),children:[(0,i.jsx)(e8.GammaTooltip,{placement:"top",label:(0,i.jsx)(J.Trans,{message:"Cell background color",id:"a08Aie"}),children:(0,i.jsx)(ev.MenuButton,{as:q.Button,variant:"toolbar",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),onMouseDown:ty.preventDefaultToAvoidBlur,size:"sm",children:(0,i.jsx)(tB,{color:n})})}),(0,i.jsx)(ew.MenuList,{overflow:"hidden",children:(0,i.jsx)(tD.ColorPickerMenuInner,{currentColor:n||null,setColor:a,unsetColor:r,source:"TableCellBackground"})})]})},tO=(e,t)=>{let i=null,n=!0;return t.forEachCell(e=>{if("tableCell"===e.type.name){let t=e.attrs.backgroundColor||null;if(n)i=t,n=!1;else if(i!==t)return i=null,!1}return!0}),i},tB=({color:e})=>(0,i.jsxs)(tP.Stack,{spacing:"2px",alignItems:"center",children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faPalette,size:"sm",transform:{y:+!!e}}),e&&(0,i.jsx)("div",{style:{position:"relative",top:"2px",width:"20px",height:"6px",backgroundColor:e,borderRadius:"2px",border:"1px solid rgba(0, 0, 0, 0.4)"}})]});e.s(["TextFormattingMenu",()=>iB],127455);var tz=e.i(606004),tF=e.i(406112),tH=e.i(792276),tW=e.i(49202);let tU=[{key:"rephrase.better",type:"rephrase",name:()=>ee.i18n._({id:"24nR0A",message:"More engaging"}),icon:X.faTypewriter,description:()=>ee.i18n._({id:"8KfRLQ",message:"Suggest a more compelling framing"}),apply:e=>{let{from:t,to:i}=e.state.selection,n=e.state.doc.textBetween(t,i);tW.TiptapEventBus.emit("queueBuddyEditMessage",{message:ee.i18n._({id:"Us1RzN",message:"Edit this card to make this text more engaging:\n\n{plainText}",values:{plainText:n}})})}},{key:"rephrase.expand",type:"rephrase",name:()=>ee.i18n._({id:"XhF4Jp",message:"Expand text"}),icon:X.faUpDown,description:()=>ee.i18n._({id:"fB02Qr",message:"Take a short summary or bullets and make it longer automatically"}),apply:e=>{let{from:t,to:i}=e.state.selection,n=e.state.doc.textBetween(t,i);tW.TiptapEventBus.emit("queueBuddyEditMessage",{message:ee.i18n._({id:"SnevVr",message:"Edit this card to expand and elaborate on this text:\n\n{plainText}",values:{plainText:n}})})}},{key:"rephrase.condense",type:"rephrase",name:()=>ee.i18n._({id:"g/NDyG",message:"Condense text"}),icon:X.faArrowsToLine,description:()=>ee.i18n._({id:"Yrd0bz",message:"Take long text and make it more concise"}),apply:e=>{let{from:t,to:i}=e.state.selection,n=e.state.doc.textBetween(t,i);tW.TiptapEventBus.emit("queueBuddyEditMessage",{message:ee.i18n._({id:"4oqnEl",message:"Edit this card to make this text short and concise:\n\n{plainText}",values:{plainText:n}})})}}],tV=({editor:e,testId:t,disabled:n,icon:a,label:o})=>{let{isOpen:s,onOpen:l,onClose:d}=(0,tF.useDisclosure)(),u=(({editor:e})=>(0,c.useMemo)(()=>[{key:"writing",label:()=>ee.i18n._({id:"4kJRen",message:"Writing"}),operations:tU.map(t=>({key:t.key,label:()=>t.name(),icon:t.icon,onQuickAction:()=>{t.apply?.(e)}}))}],[e]))({editor:e});return(0,i.jsx)(r.DarkModeProvider,{isDark:!1,children:(0,i.jsx)(tH.BuddyChatPopover,{title:ee.i18n._({id:"QdkMII",message:"Edit this text"}),placeholder:ee.i18n._({id:"asPvjX",message:"How would you like to edit this text?"}),editor:e,isOpen:s,onOpen:l,onClose:d,trigger:(0,i.jsx)(e8.GammaTooltip,{placement:"top",label:o,children:(0,i.jsx)(q.Button,{isDisabled:n,variant:"toolbar","data-testid":t,onMouseDown:ty.preventDefaultToAvoidBlur,color:"blue.500",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),children:a&&(0,i.jsx)(Q.FontAwesomeIcon,{icon:a})})}),placement:"bottom-end",actionGroups:u})})};var tG=e.i(864935),t$=e.i(833431),tZ=e.i(935020);let tK=({editor:e,testId:t,disabled:n,icon:a,label:r})=>{let o=tG.AlignmentCommands.map(t=>{let{key:n,name:a,shortcut:r,icon:o,checkActive:s,apply:l}=t;return(0,i.jsx)(eU.ToolbarButton,{icon:o,label:a(),onClick:()=>l?.(e),isActive:s?.(e),testId:n,shortcut:r},n)});return e.shouldUseLiteMenus?(0,i.jsx)(Y.ButtonGroup,{spacing:0,children:o}):(0,i.jsxs)(ey.Menu,{isLazy:!0,onClose:()=>(0,tN.focusEditorOnMenuClose)(e),children:[(0,i.jsx)(e8.GammaTooltip,{placement:"top",label:r,children:(0,i.jsx)(ev.MenuButton,{isDisabled:n,as:q.Button,variant:"toolbar","data-testid":t,onMouseDown:ty.preventDefaultToAvoidBlur,rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),children:a&&(0,i.jsx)(Q.FontAwesomeIcon,{icon:a})})}),(0,i.jsx)(tZ.Portal,{children:(0,i.jsx)(ew.MenuList,{minW:"auto",zIndex:"modalPopover",dir:"ltr",children:o})})]})};var tq=e.i(932786),tY=e.i(285042),tX=e.i(462269),tQ=e.i(127969),tJ=e.i(977581);e.s(["Heading",()=>t9,"MaxHeadingLevel",()=>t6],589193);var t0=e.i(399685),t1=e.i(596523);e.s(["HeadingView",()=>t5],864713);var t2=e.i(772177),t3=e.i(13948);let t5=e=>{let{node:t,decorations:n}=e,{level:a,horizontalAlign:r,placeholder:o}=t.attrs,s=(0,t3.findFirstBlockInCardDeco)(n),l=o||(s?ee.i18n._({id:"gLDJuJ",message:"Untitled card"}):ee.i18n._({id:"1nLERW",message:"Heading {level}",values:{level:a}}));return(0,i.jsx)(tw.AnnotatableNodeViewWrapper,{...e,style:{display:"flex",flexDirection:"column",...(0,tG.getAlignStyles)(r)},children:(0,i.jsx)(tb.NodeViewContent,{dir:(0,tG.getAlignDirection)(n),level:a,"data-placeholder":l,className:(0,tc.cx)("heading",t2.HEADING_CLASS),style:{minWidth:"min(100%, 10em)",...(0,tG.getAlignSelfStyles)(r)}})})},t4=[1,2,3,4],t6=Math.max(...t4),t9=(0,ta.extendTiptapNode)(t0.Heading,"heading",{selectable:!1,addNodeView:()=>(0,tn.ReactNodeViewRenderer)(t5,{update:to.attrsOrDecorationsChanged}),parseHTML:()=>t4.map(e=>({tag:`h${e}`,getAttrs:t=>({level:e,...(0,ta.parseHorizontalAlign)(t)})})),renderHTML:({node:e,HTMLAttributes:t})=>[`h${e.attrs.level}`,(0,l.mergeAttributes)(t,(0,ta.renderHorizontalAlign)(e.attrs)),0],addInputRules(){return this.options.levels.map(e=>(0,t1.disallowParentsFromInputRule)({find:RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}},[this.editor.state.schema.nodes.bullet,this.editor.state.schema.nodes.numbered,this.editor.state.schema.nodes.todo]))}}).configure({levels:t4}),t8=e=>{let t=[];for(let i=0;ie.node.attrs.indent>a),o=t8(r);t.push({node:n.node,pos:n.pos,children:o}),i+=r.length}return t},t7=(e,t,i)=>{let n=[];for(let a=t+1;ae.map(e=>{let t=ie(e.children);return{type:"card",content:[{type:"heading",attrs:{level:Math.min(e.node.attrs.indent+1,t6)},content:[{type:"text",text:e.node.textContent}]},...t]}}),it=e=>(0,tJ.selectionHasMatchingNodes)(e,tQ.isListNode);e.s(["ListToSmartLayoutCommands",()=>id,"SmartLayoutCommands",()=>il],803479),e.i(320037);var ii=e.i(521689);e.i(601019);var ia=e.i(494075),ir=e.i(957883);let io=()=>(0,eq.getSmartLayoutVariants)().filter(e=>!e.disabled),is=e=>{let{key:t,name:i,description:n,icon:a,keywords:r=[],defaultAttrs:o,defaultOptions:s,featureFlag:l,family:d,getEmptyNode:c}=e,u=`smartLayout-${t}`,p=c?c():{type:"smartLayout",attrs:{variantKey:t,options:s},content:(0,ii.default)(3).map(()=>({type:"smartLayoutCell",content:(0,ir.DefaultCellContent)(),attrs:o}))};return{key:u,name:i,keywords:[...r,"layout","smart"],description:n,nodeName:"smartLayout",icon:a,execute:e=>{e.chain().focus().insertContentAndSelect(p).run()},dragStartFn:e=>(0,ia.setDraggingContent)({editor:e,content:p}),dragEndFn:e=>{(0,eI.selectParentLayout)(e,e.state.selection.$from)},featureFlag:l,family:d}},il=()=>io().map(is),id=()=>io().map(e=>{let{key:t,name:i,description:n,icon:a,featureFlag:r}=e;return{key:`listToSmartLayout-${t}`,name:i,icon:a,description:n,group:"list",apply:e=>e.commands.listToSmartLayout(t),checkDisabled:e=>!it(e),featureFlag:r}});var ic=e.i(985894),iu=e.i(164149),ip=e.i(103104),ih=e.i(6419),im=e.i(398358),ig=e.i(255664);e.s(["List",()=>iC,"MAX_INDENT",()=>iv,"checkListActive",()=>iw,"listFilteredInputRule",()=>iS],53237);var ib=e.i(615505);let ix=(0,ii.default)(10),iy=["blockquote","card","sectionBreak","calloutBox"],iv=8,iC=l.Extension.create({name:"list",priority:tr.ExtensionPriorityMap.List,addProseMirrorPlugins(){return[(this.editor,new d.Plugin({key:new d.PluginKey("ListPlugin"),props:{decorations:({doc:e})=>{let t=[],i=new Map,n=(e,t=0)=>{let n=i.get(e)||{};ix.filter(e=>e>=t).forEach(e=>{n[e]=1}),i.set(e,n)},a=0;return e.descendants((e,r,o)=>{let s;if((0,tQ.isListNode)(e)&&e.firstChild){let i=e.firstChild.marks.find(e=>"textColor"===e.type.name);i?.attrs.variant&&t.push(ib.Decoration.node(r,r+e.nodeSize,{"data-text-color":i.attrs.variant})),i?.attrs.hex&&t.push(ib.Decoration.node(r,r+e.nodeSize,{style:`--list-marker-text-color: ${i.attrs.hex}`}))}if(!o||(s=a,"numbered"===e.type.name||(0,tQ.isListNode)(e)&&e.attrs.indent>s||e.isAtom||iy.includes(e.type.name)||n(o),"numbered"!==e.type.name))return;i.get(o)||n(o);let l=e.attrs.indent;a=l;let d=i.get(o)?.[l]||1;var c=d+1;let u=i.get(o);try{u[l]=c}catch(e){console.error("(caught) [ListPlugin] setCounter error",e)}n(o,l+1),t.push(ib.Decoration.node(r,r+e.nodeSize,{},{listNumber:d}))}),0==t.length?ib.DecorationSet.empty:ib.DecorationSet.create(e,t)}}}))]},addCommands:()=>({listToCards:()=>({chain:e,state:t})=>{let{selection:i,doc:n}=t,{from:a,to:r}=i,o=(0,l.findChildrenInRange)(n,{from:a,to:r},tQ.isListNode),s=(0,l.findParentNode)(S.isCardNode)(i);if(!o.length||!s)return!1;let d=s.pos+s.node.nodeSize,c=ie(t8(o));return e().insertContentAt(d,c).scrollIntoView().run(),!0},listToSmartLayout:e=>({chain:t,state:i})=>{let{selection:n,doc:a}=i,{from:r,to:o,$from:s,$to:d}=n,c=s.blockRange(d),u=(0,l.findChildrenInRange)(a,{from:r,to:o},tQ.isListNode);if(!u.length||!c)return!1;let p={type:"smartLayout",attrs:{variantKey:e},content:t8(u).map(e=>{let t=[{type:"heading",attrs:{level:4},content:(0,tX.default)(e.node.content.toJSON())}];return t.push(...e.children.map(e=>{let t=(0,tX.default)(e.node.toJSON());return t.attrs.indent-=1,t})),{type:"smartLayoutCell",content:t}})};return t().insertContentAt({from:c.start,to:c.end},p).selectInsertedNode().scrollIntoView().run(),!0},indent:e=>({tr:t,dispatch:i,state:n})=>{if(!i)return!0;let a=!1;return t.selection.ranges.forEach(i=>{let r=i.$from.pos,o=i.$to.pos;n.doc.nodesBetween(r,o,(i,n)=>{let{indent:r}=i.attrs;Object.values(tQ.ListVariant).includes(i.type.name)&&r+e>=0&&r+e<=iv&&(t.setNodeMarkup(n,void 0,{...i.attrs,indent:r+e}),a=!0)})}),a},setListItems:({variant:e})=>({tr:t,dispatch:i,state:n})=>!i||(t.selection.ranges.forEach(i=>{let a=i.$from.pos,r=i.$to.pos;n.doc.nodesBetween(a,r,(i,a)=>{Object.values(tQ.ListVariant).includes(i.type.name)?t.setNodeMarkup(a,n.schema.nodes[e],i.attrs):i.isTextblock&&t.setNodeMarkup(a,n.schema.nodes[e],{...i.attrs,indent:0})})}),!0),toggleListItems:({variant:e})=>({commands:t,editor:i})=>iw(i,e)?t.setNode("paragraph"):t.setListItems({variant:e})}),addKeyboardShortcuts:()=>({Enter:({editor:e})=>{let t,i;for(let n of Object.values(tQ.ListVariant))if(e.isActive(n)){i=e.getAttributes(n),t=n;break}if(void 0===t)return!1;let{from:n,$from:a,empty:r}=e.state.selection;if(!r)return!1;if(0==a.parent.content.size)if(i.indent>0)return e.commands.indent(-1);else return e.commands.setNode("paragraph",i);return 0===a.parentOffset?(i.checked&&(i.checked=!1),e.chain().insertContentAt(n-1,{type:t,attrs:i}).selectInsertedNode().run()):a.parentOffset===a.parent.content.size&&(i.checked&&(i.checked=!1),e.chain().insertContentAt(n+1,{type:t,attrs:i}).selectInsertedNode().run())},Backspace:({editor:e})=>{let t,i;for(let n of Object.values(tQ.ListVariant))if(e.isActive(n)){i=e.getAttributes(n),t=n;break}if(void 0===t)return!1;let{$from:n,empty:a}=e.state.selection;return!!a&&0==n.parentOffset&&e.commands.setNode("paragraph",i)},Tab:({editor:e})=>e.commands.indent(1),"Shift-Tab":({editor:e})=>e.commands.indent(-1),"Mod-]":({editor:e})=>e.commands.indent(1),"Mod-[":({editor:e})=>e.commands.indent(-1)})}),iw=(e,t)=>{let i=Object.values(tQ.ListVariant).filter(e=>e!==t);return e.isActive(t)&&!i.some(t=>e.isActive(t))},iS=(e,t)=>(0,t1.disallowParentsFromInputRule)(e,[t.nodes.heading,t.nodes.title]),ik=[[{key:"textColor",name:()=>ee.i18n._({id:"MapzEo",message:"Text color"}),icon:X.faFont,shortcut:"Mod+Shift+H",enabledForTables:!0,checkDisabled:im.isCardNotesEditor}],[{key:"bold",name:()=>ee.i18n._({id:"KmydK6",message:"Bold"}),mark:"bold",icon:e9.faBold,shortcut:"Mod+B",enabledForTables:!0},{key:"italic",name:()=>ee.i18n._({id:"pzutoc",message:"Italic"}),mark:"italic",icon:X.faItalic,shortcut:"Mod+I",enabledForTables:!0},{key:"underline",name:()=>ee.i18n._({id:"YyXtnN",message:"Underline"}),mark:"underline",icon:X.faUnderline,shortcut:"Mod+U",enabledForTables:!0},{key:"strike",name:()=>ee.i18n._({id:"WhOsNE",message:"Strikethrough"}),mark:"strike",icon:X.faStrikethrough,shortcut:"Mod+Shift+X",enabledForTables:!0},{key:"code",name:()=>ee.i18n._({id:"EWPtMO",message:"Code"}),mark:"code",icon:X.faCode,shortcut:"Mod+Shift+C"},{key:"math",name:()=>ee.i18n._({id:"l8rp1O",message:"Math"}),apply:e=>e.commands.convertToMathInline(),icon:X.faSigma,featureFlag:"math",shortcut:"$$",checkDisabled:()=>!0},{key:"removeFormatting",name:()=>ee.i18n._({id:"bj5jMy",message:"Remove formatting"}),icon:X.faRemoveFormat,apply:e=>e.chain().unsetAllMarks().focus().run(),enabledForTables:!0}],[{key:"link",name:()=>ee.i18n._({id:"yzF66j",message:"Link"}),mark:"link",icon:X.faLink,shortcut:"Mod+K"},{key:"footnote",name:()=>ee.i18n._({id:"ONAJuB",message:"Create footnote"}),icon:X.faSuperscript,apply:e=>{(0,ia.trackItemInserted)((0,ic.getCommandsMap)().footnote,er.NodeInsertMethods.FORMATTING_MENU),e.chain().toggleFootnote().run()},checkActive:e=>e.isActive("footnoteLabel"),shortcut:"Mod+Alt+F",checkDisabled:e=>(0,ig.isFootnoteEditor)(e)||!(0,tJ.canWrapSelection)(e,"footnote")||(0,im.isCardNotesEditor)(e)}],[{key:"numbered",name:()=>ee.i18n._({id:"M3G9ZD",message:"Numbered list"}),icon:X.faListOl,node:"numbered",checkActive:e=>iw(e,tQ.ListVariant.Numbered),shortcut:"Mod+/ or Mod+Shift+7",apply:e=>e.chain().toggleListItems({variant:tQ.ListVariant.Numbered}).focus().run()},{key:"bullet",name:()=>ee.i18n._({id:"ynb7Kh",message:"Bulleted list"}),icon:X.faListUl,node:"bullet",checkActive:e=>iw(e,tQ.ListVariant.Bullet),apply:e=>e.chain().toggleListItems({variant:tQ.ListVariant.Bullet}).focus().run(),shortcut:"Mod+. or Mod+Shift+8"},{key:"todo",name:()=>ee.i18n._({id:"rCIbrq",message:"Todo list"}),icon:X.faTasks,node:"todo",checkActive:e=>iw(e,tQ.ListVariant.Todo),shortcut:"Mod+, or Mod+Shift+9",apply:e=>{let{from:t,to:i}=e.state.selection;e.chain().toggleListItems({variant:tQ.ListVariant.Todo}).run(),requestAnimationFrame(()=>e.chain().focus().setTextSelection({from:t,to:i}).run())}}],[{key:"alignText",name:()=>ee.i18n._({id:"6Hkcin",message:"Align text"}),icon:X.faAlignLeft,enabledForTables:!0}],[{key:"convertText",name:()=>ee.i18n._({id:"cXIM1U",message:"Convert to..."}),checkDisabled:e=>!!e.shouldUseLiteMenus,icon:X.faRepeat},{key:"rewriteText",name:()=>ee.i18n._({id:"0aK6vE",message:"Edit with {AGENT_PROPER_NOUN}",values:{AGENT_PROPER_NOUN:ip.AGENT_PROPER_NOUN}}),icon:e9.faSparkles,checkDisabled:e=>!!e.shouldUseLiteMenus,needsConnection:!0},{key:"visualizeText",name:()=>ee.i18n._({id:"vzQMNK",message:"Visualize this text"}),icon:X.faDiagramVenn,apply:e=>{let{from:t,to:i}=e.state.selection,n=e.state.doc.slice(t,i),a=(0,iu.contentToAiHtml)(e,n.content,{disableBookmarks:!0}).trim();a&&e.chain().setTextSelection(i).insertSmartDiagram({attrs:{},selectedText:a}).run()},checkDisabled:e=>{if(e.shouldUseLiteMenus)return!0;let{from:t,to:i}=e.state.selection;return 0===e.state.doc.textBetween(t,i).trim().length},needsConnection:!0}],[{key:"comment",name:()=>ee.i18n._({id:"oFsfkI",message:"Add comment"}),icon:X.faComment,enabledForTables:!0,checkDisabled:e=>(0,ig.isFootnoteEditor)(e)||(0,im.isCardNotesEditor)(e)||!!e.shouldUseLiteMenus,needsConnection:!0,apply:e=>{let{selection:t}=e.state,{from:i,to:n}=t,a=(0,tJ.findParentNodes)(e.state.doc.resolve(i),(e,t)=>(0,ih.isAnnotatableParent)(t));if(!a[0])return void console.warn("[TEXT_FORMATTING_COMMANDS] Add comment - Unable to find annotatable parent for this selection");let r=t instanceof C.CellSelection&&t.isRowSelection()&&t.isColSelection(),o="tableRow"===a[0].node.type.name,s=r&&o&&a[1]?a[1]:a[0],l=(0,tJ.textBetweenFiltered)(e.state.doc,i,n,e=>"footnote"!==e.type.name&&"cardNotes"!==e.type.name,"__BLOCK_SEPARATOR_PLACEHOLDER").split("__BLOCK_SEPARATOR_PLACEHOLDER").join("

    ");tW.TiptapEventBus.emit(tW.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,{selectionPos:s.pos,parentPos:s.pos,text:l})}}]],iA=(e,t,i=!1)=>!!(t.needsConnection&&i||t.featureFlag&&!et.featureFlags.get(t.featureFlag)||t.checkDisabled?.(e))||(t.node?!(0,tJ.canChangeSelectedNodeType)(e,t.node):!!t.mark&&!(0,tJ.selectionAllowsMark)(e,t.mark)),iE=({editor:e,testId:t,disabled:n,icon:a,label:r})=>{let o,{isInOfflineMode:s}=(0,tz.useHealthCheck)(),l=(o=(0,ic.getCommandsMap)(),[{key:"toggle",name:()=>ee.i18n._({id:"JFciKP",message:"Toggle"}),icon:X.faPlay,node:"toggle",description:()=>ee.i18n._({id:"rhfAX6",message:"Turn this into a collapsible section. Highlight key points and hide details"}),apply:e=>{(0,ia.trackItemInserted)(o.toggle,er.NodeInsertMethods.FORMATTING_MENU),e.chain().wrapWithToggle().run()},group:"wrap"},{key:"convertToNestedCard",name:()=>ee.i18n._({id:"lOmsEK",message:"Nested card"}),node:"card",description:()=>ee.i18n._({id:"gRMoQV",message:"Put this content into its own card. Good for bigger, self-contained ideas"}),icon:X.faDiagramSubtask,apply:e=>{(0,ia.trackItemInserted)(o.insertCardInside,er.NodeInsertMethods.FORMATTING_MENU),e.chain().convertToNestedCard().run()},checkDisabled:e=>!e.schema.nodes.card||!(0,tJ.canWrapSelection)(e,"card"),group:"wrap"},{key:"blockquote",name:()=>ee.i18n._({id:"OLMhPm",message:"Blockquote"}),node:"blockquote",description:()=>ee.i18n._({id:"2yuhT7",message:"Pull out quotes or text for emphasis"}),icon:X.faBlockQuote,shortcut:"> Quote",apply:e=>e.chain().wrapWithAnnotations("blockquote").run(),checkDisabled:e=>!(0,tJ.canWrapSelection)(e,"blockquote"),group:"wrap"},{key:"calloutBox",name:()=>ee.i18n._({id:"1E4ojF",message:"Info box"}),node:"calloutBox",description:()=>ee.i18n._({id:"4Wf98Z",message:"Call out important info with a box and icon"}),icon:X.faInfoCircle,apply:e=>e.chain().wrapWithAnnotations("calloutBox",{variant:"info"}).run(),checkDisabled:e=>!(0,tJ.canWrapSelection)(e,"calloutBox"),group:"wrap"},{key:"listToCards",name:()=>ee.i18n._({id:"FJ18tL",message:"Cards from outline"}),icon:X.faRectangleHistory,description:()=>ee.i18n._({id:"hWesxP",message:"Turn bullet points into cards"}),group:"list",apply:e=>e.commands.listToCards(),checkDisabled:e=>!it(e)},...id()]).filter(t=>t.apply&&!iA(e,t,s));return 0===l.length?null:(0,i.jsxs)(ey.Menu,{isLazy:!0,onClose:()=>(0,tN.focusEditorOnMenuClose)(e),children:[(0,i.jsx)(e8.GammaTooltip,{placement:"top",label:r,children:(0,i.jsx)(ev.MenuButton,{isDisabled:n,as:q.Button,variant:"toolbar","data-testid":t,onMouseDown:ty.preventDefaultToAvoidBlur,rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),children:a&&(0,i.jsx)(Q.FontAwesomeIcon,{icon:a})})}),(0,i.jsx)(tZ.Portal,{children:(0,i.jsx)(ew.MenuList,{maxH:"min(25em, 45vh)",overflowY:"auto",maxW:"400px",children:Object.entries({list:{label:ee.i18n._({id:"Ci8I/9",message:"Transform list"})},wrap:{label:ee.i18n._({id:"T4+jD7",message:"Wrap inside"})}}).map(([t,{label:n}])=>{let a=l.filter(e=>e.group===t);return 0===a.length?null:(0,i.jsx)(tq.MenuGroup,{title:n,children:a.map(({key:t,icon:n,name:a,description:r,apply:o})=>(0,i.jsxs)(tY.MenuItem,{value:t,icon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:n,fixedWidth:!0}),onClick:()=>o(e),"data-testid":`text-convert-menu-${t}`,children:[(0,i.jsx)(ek.Text,{children:a()}),r&&(0,i.jsx)(ek.Text,{color:"gray.400",fontSize:"sm",children:r()})]},t))},t)})})})]})};var i_=e.i(826480),iI=e.i(864860);let iM=({badge:e,label:t,leftIcon:a,isSticky:r,onClick:o,isDisabled:s})=>{let l=(0,eu.useColorModeValue)("gray.50","gray.700");return(0,i.jsx)(ed.Flex,{bg:l,position:r?"sticky":"static",bottom:r?-2:"auto",children:(0,i.jsxs)(q.Button,{colorScheme:"gray",variant:"link",size:"sm",mx:"auto",leftIcon:a,onClick:o,isDisabled:s,w:"100%",py:3,children:[t,e&&(0,i.jsx)(n.Box,{ms:2,children:e})]})})};var iT=e.i(80192),iL=e.i(157048),ij=e.i(108634),iP=e.i(761657),iD=e.i(676876),iN=e.i(714521);let iR=(e,t)=>!!t&&(e||!t.startsWith("/")),iO=({editor:e})=>{let{isInOfflineMode:t}=(0,tz.useHealthCheck)(),r=(0,iL.useThemeEditAction)(),o=(0,h.useAppSelector)(ef.selectTheme),{bodyFont:s,headingFont:l,fonts:d}=o,u=`"${(0,ij.getFontName)(d,s)}"`,p=`"${(0,ij.getFontName)(d,l)}"`,m=t=>{e.chain().focus().setFontSize(t).run()},g=(0,tJ.isAllowedFontSize)(e,"heading"),f=(0,tJ.isAllowedFontSize)(e,"title"),b=(0,tJ.isAllowedFontSize)(e,"body"),x=(0,c.useCallback)(()=>{"edit"===r?(0,iT.openThemeEditorWithCurrentTheme)({theme:o}):"fork"===r&&(0,iT.openThemeEditorWithNewFork)({theme:o,sourceThemeInfo:{themeId:o.id,workspaceId:o.workspaceId,source:"text_size_menu"}})},[o,r]);if(!b&&!g&&!f)return null;let y=(0,iD.getSelectedFontSizes)(e),v="default",C=(0,iN.getFontSizeOption)("default");v=e.isActive("title")?(0,iN.fontSizeFromTitle)(e.getAttributes("title").level)||"default":e.isActive("heading")?(0,iN.fontSizeFromHeading)(e.getAttributes("heading").level)||"default":1===y.length&&y[0]||"default",C=(0,iN.getFontSizeOption)(v)||C;let w=e=>`${Math.sqrt(e)}em`,S=(0,im.isCardNotesEditor)(e),k=!!e.extensionManager.extensions.find(e=>"slashMenu"===e.name);return(0,i.jsxs)(ey.Menu,{closeOnSelect:!0,isLazy:!0,children:[(0,i.jsx)(ev.MenuButton,{size:"sm",as:q.Button,rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),variant:"toolbar",ps:2,children:C.label}),(0,i.jsxs)(ew.MenuList,{maxH:"min(60em, 45vh)",overflowY:"auto",minW:"260px",children:[b&&(0,i.jsx)(eS.MenuOptionGroup,{type:"radio",value:v,children:(0,iP.getBodySizeOptions)().filter(([e])=>!(S&&"default"!==e)).map(([e,{label:t,size:n,flagged:r,shortcut:o}])=>{let s=iR(k,o);return(0,i.jsx)(eC.MenuItemOption,{value:e,onClick:()=>m(e),children:(0,i.jsxs)(a.HStack,{children:[(0,i.jsx)(ek.Text,{fontFamily:u,fontSize:w(n),children:t}),s&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iI.Spacer,{}),(0,i.jsx)(ek.Text,{color:"gray.400",children:o})]})]})},e)})}),g&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(i_.MenuDivider,{}),(0,i.jsx)(eS.MenuOptionGroup,{type:"radio",value:v,children:(0,iP.getHeadingSizeOptions)().reverse().map(([e,{label:t,size:n,shortcut:r}])=>{let o=iR(k,r);return(0,i.jsx)(eC.MenuItemOption,{value:e,onClick:()=>m(e),children:(0,i.jsxs)(a.HStack,{children:[(0,i.jsx)(ek.Text,{fontSize:w(n),fontWeight:"bold",fontFamily:p,children:t}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iI.Spacer,{}),(0,i.jsx)(ek.Text,{color:"gray.400",children:r})]})]})},e)})})]}),f&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(i_.MenuDivider,{}),(0,i.jsx)(eS.MenuOptionGroup,{type:"radio",value:v,children:(0,iP.getTitleSizeOptions)().map(([e,{label:t,size:n,shortcut:r}])=>{let o=iR(k,r);return(0,i.jsx)(eC.MenuItemOption,{value:e,onClick:()=>m(e),children:(0,i.jsxs)(a.HStack,{children:[(0,i.jsx)(ek.Text,{fontSize:w(n),fontWeight:"bold",fontFamily:p,children:t}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(iI.Spacer,{}),(0,i.jsx)(ek.Text,{color:"gray.400",children:r})]})]})},e)})})]}),"disabled"!==r&&(0,i.jsx)(n.Box,{mt:2,mb:-2,mx:-2,children:(0,i.jsx)(iM,{label:(0,i.jsx)(J.Trans,{message:"Edit theme fonts",id:"gJpKw8"}),leftIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faFontCase,fixedWidth:!0}),onClick:x,isDisabled:t})})]})]})},iB=({editor:e,filterBy:t})=>{let{isInOfflineMode:n}=(0,tz.useHealthCheck)(),r="rtl"===(0,tG.getCurrentTextDirection)(e)?"alignRight":"alignLeft";return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(Y.ButtonGroup,{isAttached:!0,onMouseDown:ty.preventDefaultToAvoidBlur,children:(0,i.jsx)(iO,{editor:e})},"text"),ik.map((o,s)=>(0,i.jsx)(Y.ButtonGroup,{spacing:0,size:"sm",onMouseDown:ty.preventDefaultToAvoidBlur,_empty:{display:"none"},children:o.filter(i=>{let a=!iA(e,i,n);return t?a&&i[t]:a}).map(t=>{let{key:n,name:o,shortcut:s,icon:l,mark:d,node:c,checkActive:u,apply:p}=t,h=p||(d?e=>e.chain().toggleMark(d).focus().run():()=>{}),m=u?u(e):d?e.isActive(d):c?e.isActive(c):void 0;if("textColor"===n)return(0,i.jsx)(t$.TextColorMenu,{shortcut:s,icon:l,editor:e},n);if("rewriteText"===n)return(0,i.jsx)(tV,{editor:e,shortcut:s,icon:l,testId:n,label:o()},n);if("convertText"===n)return(0,i.jsx)(iE,{editor:e,shortcut:s,icon:l,testId:n,label:o()},n);if("alignText"===n)return(0,i.jsx)(tK,{editor:e,shortcut:s,icon:(()=>{let t=tG.AlignmentCommands.find(t=>t.alignment===(0,tG.getCurrentAlignment)(e));if(t)return t.icon;let i=tG.AlignmentCommands.find(e=>e.key===r);return i?.icon||X.faAlignLeft})(),testId:n,label:o()},n);if("visualizeText"===n)return(0,i.jsx)(q.Button,{variant:"toolbar",isActive:m,onClick:()=>h(e),children:(0,i.jsxs)(a.HStack,{spacing:1,alignItems:"center",justifyContent:"center",children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:l}),(0,i.jsx)(ek.Text,{children:o()})]})},n);else return(0,i.jsx)(eU.ToolbarButton,{label:o(),shortcut:s,isActive:m,onClick:()=>h(e),icon:l,testId:n},n)})},s))]})};var iz=((t={}).enabledForTables="enabledForTables",t);let iF=({editor:e,selection:t})=>{(0,e7.useFeatureFlag)("chartConversion");let n=t.isRowSelection(),r=t.isColSelection(),o=n&&r,s=(0,l.findParentNode)(tA.isTableNode)(t),d=Math.min(t.$anchorCell.pos,t.$headCell.pos),c=Math.max(t.$anchorCell.pos,t.$headCell.pos),u=s?.node.attrs.tableStyle||"striped",{colMinPercent:p,newColSize:h}=e.schema.nodes[tL.name].spec,m=t.getTableNode()??s,g=(0,ti.canAddCol)((0,ti.parseColWidths)(m.attrs.colWidths),h,p);return(0,i.jsxs)(a.HStack,{spacing:1,children:[(0,i.jsx)(iB,{editor:e,filterBy:iz.enabledForTables}),(0,i.jsx)(tR,{editor:e,selection:t}),n||r||o&&(0,i.jsx)(e$.FormattingMenuDivider,{}),n&&!o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Insert row before",id:"1ct6G/"}),onClick:()=>{e.commands.addRowBefore(),requestAnimationFrame(()=>{e.commands.focus(d)})},testId:"add-row-before-button",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faDiagramCells})}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Insert row after",id:"JUmxSq"}),onClick:()=>{e.commands.addRowAfter(),requestAnimationFrame(()=>{e.chain().focus(c).goToNextCell().run()})},testId:"add-row-after-button",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faDiagramCells,rotation:180})}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Delete row",id:"0cspe/"}),icon:X.faTrash,onClick:()=>e.chain().focus().deleteRow().run(),color:"red.500",testId:"delete-row-button"})]}),r&&!o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Insert column before",id:"mwcRkO"}),onClick:()=>{let{left:t}=(0,te.selectedRect)(e.state.selection)||{};e.commands.addColumnBefore(t??0),requestAnimationFrame(()=>{e.commands.focus(d)})},isDisabled:!g,testId:"add-col-before-button",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faDiagramCells,rotation:270})}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Insert column after",id:"/93cy4"}),onClick:()=>{let{left:t}=(0,te.selectedRect)(e.state.selection)||{};e.commands.addColumnAfter(t??0),requestAnimationFrame(()=>{e.chain().focus(d).goToNextCell().run()})},isDisabled:!g,testId:"add-col-after-button",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faDiagramCells,rotation:90})}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Delete column",id:"GAohqx"}),icon:X.faTrash,onClick:()=>{e.commands.deleteColumn(),requestAnimationFrame(()=>{e.commands.focus(d)})},color:"red.500",testId:"delete-col-button"})]}),o&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(ey.Menu,{isLazy:!0,onClose:()=>(0,tN.focusEditorOnMenuClose)(e),children:[(0,i.jsx)(e8.GammaTooltip,{placement:"top",label:(0,i.jsx)(J.Trans,{message:"Table style",id:"p81m8h"}),children:(0,i.jsx)(ev.MenuButton,{as:q.Button,variant:"toolbar",rightIcon:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faChevronDown,transform:"shrink-6"}),onMouseDown:ty.preventDefaultToAvoidBlur,size:"sm","data-testid":"table-style-button",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:(e=>{switch(e){case"striped":return tj;case"bordered":return e9.faTableCellsLarge;case"horizontal":return e6.faRows;case"vertical":return e6.faColumns;case"none":return e9.faBorderNone;case"outer":return X.faBorderOuter}})(u),transform:"striped"===u?"grow-7":void 0})})}),(0,i.jsx)(ew.MenuList,{children:(0,i.jsxs)(eS.MenuOptionGroup,{type:"radio",value:u,onChange:t=>e.commands.setTableStyle(t),children:[(0,i.jsx)(eC.MenuItemOption,{value:"striped",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:tj,transform:"grow-7",fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"Striped",id:"0lzbCy"})]})}),(0,i.jsx)(eC.MenuItemOption,{value:"bordered",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e9.faTableCellsLarge,fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"Bordered",id:"i+1Ogj"})]})}),(0,i.jsx)(eC.MenuItemOption,{value:"horizontal",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e6.faRows,fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"Row",id:"Ngg5LS"})]})}),(0,i.jsx)(eC.MenuItemOption,{value:"vertical",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e6.faColumns,fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"Column",id:"EMfuF8"})]})}),(0,i.jsx)(eC.MenuItemOption,{value:"outer",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faBorderOuter,fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"Outer",id:"Hbid8p"})]})}),(0,i.jsx)(eC.MenuItemOption,{value:"none",children:(0,i.jsxs)(a.HStack,{spacing:2,children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e9.faBorderNone,fixedWidth:!0}),(0,i.jsx)(J.Trans,{message:"None",id:"Ris9h8"})]})})]})})]}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Equalize columns",id:"SOkhdm"}),icon:X.faDistributeSpacingHorizontal,onClick:()=>e.commands.equalizeColumns(),testId:"equalize-columns-button"}),!1,(0,i.jsx)(e$.FormattingMenuDivider,{}),(0,i.jsx)(eU.ToolbarButton,{label:(0,i.jsx)(J.Trans,{message:"Delete table",id:"HSI88F"}),icon:X.faTrash,onClick:()=>e.chain().focus().deleteTable().run(),color:"red.500",testId:"delete-table-button"})]})]})},iH=[{component:iF,predicate:e=>e instanceof C.CellSelection&&e.isColSelection(),offsetPx:16},{component:iF,predicate:e=>e instanceof C.CellSelection&&e.isRowSelection(),offsetPx:12},{component:iF,predicate:e=>e instanceof C.CellSelection,offsetPx:12},{component:P.ChartFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&e.node?.type?.name==="chart",isPopover:!0},{component:z.GraphyChartFormattingMenu,predicate:e=>{if(!(e instanceof d.NodeSelection)||e.node?.type?.name!=="graphyChart")return!1;let t=e.node.attrs?.chartData;return!(0,g.isLegacyGraphConfig)(t)}},{component:$.LinkFormattingPopoverMenu,predicate:(e,t)=>e instanceof d.TextSelection&&t.isActive("link"),isPopover:!0},{component:V.ButtonFormattingPopoverMenu,predicate:(e,t)=>t.isActive("button")&&!t.isSiteNavbarEditor,isPopover:!0},{component:H.LabelFormattingMenu,predicate:(e,t)=>t.isActive("label")},{component:U.LayoutFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&(0,f.isLayoutNode)(e.node)},{component:L.CardFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&(0,S.isCardNode)(e.node),offsetPx:0},{component:T.CardAccentLayoutItemFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&(0,m.isAccentCardLayoutItem)(e.node),offsetPx:6},{component:W.LayoutCellFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&(0,f.isLayoutCellNode)(e.node)},{component:e4,predicate:(e,t,i)=>e instanceof d.NodeSelection&&(0,y.isSmartLayoutNode)(e.node)&&"smart-layout-variant"!==i.right},{component:e0,predicate:e=>e instanceof d.NodeSelection&&(0,y.isSmartLayoutCellNode)(e.node)},{component:O.GalleryFormattingMenuV2,predicate:e=>e instanceof d.NodeSelection&&(0,b.isGalleryNode)(e.node),isPopover:!0},{component:M.CalloutBoxFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"calloutBox"===e.node.type.name},{component:N.DrawingFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&("drawing"===e.node.type.name||"diagram"===e.node.type.name)},{component:K.SmartDiagramFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"smartDiagram"===e.node.type.name&&e.node.attrs.templateKey},{component:Z.MediaPlaceholderFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"mediaPlaceholder"===e.node.type.name},{component:F.ImagePopoverFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"image"===e.node.type.name,isPopover:!0},{component:B.GraphicPopoverFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"graphic"===e.node.type.name,isPopover:!0},{component:G.EmbedVideoFormattingPopoverMenu,predicate:e=>e instanceof d.NodeSelection&&(0,_.isMediaEmbedNode)(e.node),isPopover:!0},{component:j.CardTOCFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"tableOfContents"===e.node.type.name},{component:D.ContributorsFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"contributors"===e.node.type.name,isPopover:!0},{component:A.GridFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"grid"===e.node.type.name},{component:E.GridItemFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&"gridItem"===e.node.type.name},{component:I.PositionedBoxFormattingMenu,predicate:e=>e instanceof d.NodeSelection&&("positionedTextbox"===e.node.type.name||"positionedContentBox"===e.node.type.name)},{component:iB,predicate:e=>!e.empty&&e instanceof d.TextSelection}],iW=[{component:V.ButtonFormattingPopoverMenu,predicate:(e,t,i,n)=>n&&t.isActive("button")&&!!t.isSiteNavbarEditor&&!t.multipageEnabled&&!document?.querySelector(`[${x.NAVBAR_TOGGLE_CLOSED_ATTR}]`),isPopover:!0}],iU={backgroundColor:"white",shadow:"lg"},iV=({editor:e,scrollingParentSelector:t,menuContext:d,appendToSelector:m})=>{let{hideTooltips:g,GammaTooltipHiderContext:f}=(0,o.useGammaTooltipHider)(),b=(0,h.useAppSelector)(u.selectContextMenuOpen),x=(0,h.useAppSelector)(p.selectNameOfOpenPanel),y=((e,t)=>{let[i,n]=(0,c.useState)(!1);return(0,c.useEffect)(()=>{if("navigation"!==t)return;let i=t=>{let i=t.target;i instanceof Element&&(i.closest("[data-navbar-editor]")||i.closest('[data-active-menu="navigation"]')?n(!0):(n(!1),e.isSiteNavbarEditor&&e.isFocused&&e.commands.blur()))};return document.addEventListener("mousedown",i),()=>{document.removeEventListener("mousedown",i)}},[t,e]),"navigation"!==t||i})(e,d),v=(0,s.useEditorState)(),C="navigation"===d?iW:iH,S=v.selection,A=!b&&C.find(t=>t.predicate(S,e,x,y)),E=[];try{(0,l.isNodeSelection)(v.selection)&&(E=(0,w.getDecorationsForNode)(e,v.selection.from))}catch(e){console.error(`[FormattingMenu] unable to find decorations at ${v.selection.from}`,e.message)}let _=(0,c.useMemo)(()=>({maxWidth:"none",zIndex:"var(--chakra-zIndices-popover)",placement:"top",appendTo:m?()=>document.querySelector(m):void 0,popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["top","top-start","top-end","bottom","bottom-start","bottom-end"]}},{name:"preventOverflow",options:{boundary:t?document.querySelector(t):void 0,altAxis:!0}}]}}),[t,m]),I="navigation"===d?"navigation":"editor";return(0,i.jsx)(f,{children:(0,i.jsx)(r.DarkModeProvider,{isDark:!1,children:(0,i.jsxs)(k.FormattingBubbleMenu,{editor:e,onHide:g,tippyOptions:_,children:[A&&A.isPopover&&(0,i.jsx)(R.FormatMenuPopover,{"data-in-editor-focus":I,"data-active-menu":I,"data-testid":"formatting-menu",fontFamily:"body",children:(0,i.jsx)(A.component,{editor:e,selection:S,decorations:E})}),A&&!A.isPopover&&(0,i.jsx)(n.Box,{"data-active-menu":I,borderRadius:"xl",...iU,w:"auto",minW:"0px",h:"fit-content",position:"relative",bottom:A.offsetPx?`${A.offsetPx}px`:"0","data-in-editor-focus":I,"data-testid":"formatting-menu",fontFamily:"body",children:(0,i.jsx)(a.HStack,{spacing:3,px:2,minH:10,children:(0,i.jsx)(A.component,{editor:e,selection:S,decorations:E})})})]})})})};e.s(["Paragraph",()=>nl],379363);var iG=e.i(936265);e.s(["ParagraphView",()=>ns],180190),e.s([],36025),e.s(["SlashMenuDropdown",()=>iQ],235512);var i$=e.i(865799),iZ=e.i(818315),iK=e.i(525053),iq=e.i(23917),iY=e.i(607663);e.i(503117);var iX=e.i(493731);let iQ=(0,c.forwardRef)(({query:e,editor:t},a)=>{let{isInOfflineMode:r}=(0,tz.useHealthCheck)(),o=(0,iY.useLocalizedFunction)(ic.getSortedCommands).filter(i=>{if((0,ic.checkCommandDisabled)(t,i,void 0,r))return!1;let{name:n,keywords:a=[]}=i;return n().toLowerCase().includes(e.toLowerCase())||a.find(t=>t.startsWith(e.toLowerCase()))}),s=(0,c.useCallback)(i=>{if(!o[i])return;let{execute:n}=o[i],a=t.state.selection;t.chain().deleteRange({from:a.from-e.length-1,to:a.to}).run(),(0,ia.trackItemInserted)(o[i],er.NodeInsertMethods.SLASH_MENU),n(t)},[t,o,e.length]),{selectedIndex:l,selectedItemEl:d}=(0,iX.useSuggestionKeyboardHandler)({ref:a,selectItem:s,options:o});return o.length>0?(0,i.jsx)(n.Box,{"data-slash-menu-dropdown":!0,children:(0,i.jsx)(iK.ListBox,{children:(0,i.jsx)(iK.ListBoxList,{width:"375px",children:o.map(({name:e,icon:t,iconStyle:n,image:a,shortcut:r,creditType:o,badge:c,nodeName:u},p)=>(0,i.jsxs)(iK.ListBoxItem,{ref:p===l?d:null,icon:a?(0,i.jsx)(iZ.Image,{h:"1.5em",w:"1.25em",objectFit:"contain",src:a.src}):t?(0,i.jsx)(Q.FontAwesomeIcon,{icon:t,rotation:n?.rotation,size:"1x",fixedWidth:!0,color:"var(--chakra-colors-trueblue-600)"}):(0,i.jsx)(i.Fragment,{}),tabIndex:p===l?0:-1,onClick:()=>s(p),command:r,children:[e(),u&&(0,i.jsx)(i0,{nodeName:u}),o&&(0,i.jsx)(iq.CreditCostIcon,{type:o,colorScheme:"blackAlpha",bg:"whiteAlpha.800"}),c&&(0,i.jsx)(i$.Badge,{ms:2,colorScheme:"green",children:c()})]},p))})})}):(0,i.jsx)(i.Fragment,{})}),iJ={smartLayout:()=>ee.i18n._({id:"Biyg+u",message:"Smart layout"}),smartDiagram:()=>ee.i18n._({id:"PgKDOY",message:"Smart diagram"}),diagram:()=>ee.i18n._({id:"i+ShMB",message:"Diagram"})},i0=({nodeName:e})=>{let t=iJ[e];return t?(0,i.jsx)(ek.Text,{mt:-1,color:"gray.500",fontSize:"xs",children:t()}):null};var i1=e.i(222625),i2=e.i(306841),i3=e.i(882255),i5=e.i(50034),i4=e.i(414556),i6=e.i(469305),i9=e.i(892684),i8=e.i(865639),i7=e.i(965837),ne=e.i(774314);let nt=({editor:e,isCardDark:t})=>{let[a,r]=(0,c.useState)(""),{isInOfflineMode:o}=(0,tz.useHealthCheck)(),s=(0,iY.useLocalizedFunction)(ic.getSortedCommands).filter(t=>{if((0,ic.checkCommandDisabled)(e,t,void 0,o))return!1;let{name:i,keywords:n=[]}=t;return!a||i().toLowerCase().includes(a.toLowerCase())||n.find(e=>e.toLowerCase().includes(a.toLowerCase()))}),l=(0,c.useCallback)(t=>{if(!s[t])return;let{execute:i}=s[t],n=e.state.selection;e.chain().deleteRange({from:n.from,to:n.to}).run(),(0,ia.trackItemInserted)(s[t],er.NodeInsertMethods.SLASH_MENU_BLOCK_PROMPT),i(e)},[e,s]),{focusedIndex:d,focusedItemEl:u,searchInputRef:p,handleSearchKeyDown:h,handleSearchFocus:m,handleSearchChange:g,handleItemKeyDown:f,handleMouseMove:b,listBoxRef:x}=((e,t)=>{let[i,n]=(0,c.useState)(null),[a,r]=(0,c.useState)(!0),o=(0,c.useRef)(null),s=(0,c.useRef)(null),l=(0,c.useRef)("keyboard"),d=(0,c.useRef)(!1),u=(0,c.useRef)(null);(0,c.useEffect)(()=>{"keyboard"===l.current&&null!==i&&s.current&&!a&&(d.current=!0,setTimeout(()=>{if(s.current&&u.current){let e=u.current.getBoundingClientRect(),t=s.current.getBoundingClientRect();(t.bottom>e.bottom||t.top{d.current=!1},100)},0))},[i,a]);let p=(0,c.useCallback)(e=>{d.current||(l.current="mouse",n(e),r(!1))},[]),h=(0,c.useCallback)(()=>{n(0)},[]),m=(0,c.useCallback)(i=>{if(l.current="keyboard","Escape"===i.key)return i.currentTarget.value?(i.preventDefault(),i.stopPropagation(),{action:"clearSearch"}):void 0;if("ArrowDown"===i.key){i.preventDefault(),i.stopPropagation(),e.length>0&&(r(!1),n(0));return}if("Enter"===i.key){i.preventDefault(),i.stopPropagation(),e.length>0&&t(0);return}if("Tab"===i.key){e.length>0&&(i.preventDefault(),i.stopPropagation(),r(!1),n(0));return}i.stopPropagation()},[e.length,t]),g=(0,c.useCallback)((i,a)=>{switch(l.current="keyboard",i.key){case"ArrowUp":i.preventDefault(),i.stopPropagation(),0===a?(r(!0),n(null),o.current&&o.current.focus()):n(a-1);break;case"ArrowDown":i.preventDefault(),i.stopPropagation(),a{r(!0)},[]),handleSearchChange:h,handleItemKeyDown:g,handleMouseMove:p,listBoxRef:u}})(s,l);(0,c.useEffect)(()=>{p.current&&setTimeout(()=>{p.current?.focus()},50)},[]);let y=0===s.length;return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.Box,{p:2,borderBottom:"1px solid",borderColor:t?"titanium.700":"titanium.100",children:(0,i.jsxs)(i7.InputGroup,{size:"sm",children:[(0,i.jsx)(ne.InputLeftElement,{pointerEvents:"none",children:(0,i.jsx)(Q.FontAwesomeIcon,{icon:X.faSearch})}),(0,i.jsx)(i8.Input,{ref:p,placeholder:ee.i18n._({id:"Mm1grj",message:"Search blocks..."}),value:a,onChange:e=>{r(e.target.value),g()},onClick:ty.stopPropagation,onMouseDown:ty.stopPropagation,onKeyDown:e=>{let t=h(e);t?.action==="clearSearch"&&r("")},onFocus:m,borderRadius:"md","data-slash-menu-search-input":!0})]})}),y?(0,i.jsx)(n.Box,{p:3,color:t?"titanium.300":"blue.950",children:(0,i.jsx)(J.Trans,{message:'No blocks found for "{searchTerm}"',id:"rj6/sx",values:{searchTerm:a}})}):(0,i.jsx)(n.Box,{maxH:"50vh",overflowY:"auto",ref:x,children:(0,i.jsx)(iK.ListBox,{children:(0,i.jsx)(iK.ListBoxList,{border:"none",borderRadius:"none",children:s.map(({name:e,icon:t,iconStyle:n,image:a,shortcut:r,creditType:o,badge:s},c)=>(0,i.jsxs)(iK.ListBoxItem,{ref:c===d?e=>{u.current=e}:null,icon:a?(0,i.jsx)(iZ.Image,{h:"1.5em",w:"1.25em",objectFit:"contain",src:a.src}):t?(0,i.jsx)(Q.FontAwesomeIcon,{icon:t,rotation:n?.rotation,size:"1x",fixedWidth:!0,color:"var(--chakra-colors-trueblue-600)"}):(0,i.jsx)(i.Fragment,{}),tabIndex:c===d?0:-1,onClick:()=>l(c),onMouseMove:()=>b(c),onMouseDown:ty.stopPropagation,onKeyDown:e=>f(e,c),command:r,children:[e(),o&&(0,i.jsx)(iq.CreditCostIcon,{type:o,colorScheme:"blackAlpha",bg:"whiteAlpha.800"}),s&&(0,i.jsx)(i$.Badge,{ms:2,colorScheme:"green",children:s()})]},c))})})})]})},ni=e=>(0,ic.getCommandsMap)()[e],nn=({editor:e,dir:t,slashMenuOpen:n,setSlashMenuOpen:o})=>{let s=(0,i4.useDocGenerateInputImageSettings)(),d=(0,h.useAppSelector)(ef.selectTheme),{selection:c}=e.state;if(!c.empty)return null;let u=(0,l.findParentNodeClosestToPos)(e.state.doc.resolve(c.from),e=>"table"===e.type.name),p=((e,t)=>{let i,n,{state:a}=e;if(!a)return;let r=[];try{(i=(0,l.findParentNodeClosestToPos)(e?.state.doc.resolve(a.selection.from),S.isCardNode))&&(r=(0,w.getDecorationsForNode)(e,i.pos),n=(0,i9.getCardColorMode)(r,t).isCardDark)}catch(e){console.error(e)}return n})(e,d)??!1;return(0,i.jsx)(r.DarkModeProvider,{isDark:p,children:(0,i.jsx)(a.HStack,{spacing:2,dir:t,color:"gray.400","data-print-hidden":!0,position:"absolute",inset:"0",contentEditable:!1,overflow:"hidden",fontFamily:"body",fontSize:"0.8em",onMouseDown:ty.preventDefaultToAvoidBlur,pointerEvents:"none",userSelect:"none","data-guider-highlight":"slash-menu-prompt",className:"slash-menu-prompt",children:(0,i.jsxs)(a.HStack,{spacing:2,width:"100%",children:[(0,i.jsx)(ek.Text,{whiteSpace:"nowrap",className:"slash-menu-placeholder-long",children:(0,i.jsx)(J.Trans,{message:"Type <0>/ to add blocks or... ",id:"ll36Dw",components:{0:(0,i.jsx)(i1.Kbd,{})}})}),(0,i.jsx)(ek.Text,{whiteSpace:"nowrap",className:"slash-menu-placeholder-short",children:(0,i.jsx)(J.Trans,{message:"Type <0>/ or... ",id:"RcqUBT",components:{0:(0,i.jsx)(i1.Kbd,{})}})}),(0,i.jsxs)(Y.ButtonGroup,{variant:"plain",size:"xs",spacing:"0.5em",pointerEvents:"auto",verticalAlign:"middle",children:[(0,i.jsx)(e8.GammaTooltip,{label:(0,i.jsx)(J.Trans,{message:"Insert image here",id:"7PxiS5"}),placement:"top",shouldWrapChildren:!0,shortcut:"/image",children:(0,i.jsx)(q.Button,{color:p?"gray.400":"gray.700",borderColor:p?"gray.600":"gray.300",backgroundColor:"transparent",fontSize:"0.8em",paddingInlineStart:"1em",paddingInlineEnd:"1em",minWidth:"2em",height:"2em",onClick:()=>{let t=ni((e=>{switch(e){case"aiGenerated":default:return i6.AI_IMAGE_SOURCE_KEY;case"web":return"image.web";case"pictographic":return"image.pictographic";case"giphy":return"image.giphy";case"unsplash":return"image.unsplash"}})(s.imageProvider));t&&((0,ia.trackItemInserted)(t,er.NodeInsertMethods.BLOCK_PROMPT),t.execute(e))},children:(0,i.jsxs)(a.HStack,{spacing:"0.5em",children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e6.faImage}),(0,i.jsx)("span",{className:"slash-menu-button-text",children:(0,i.jsx)(J.Trans,{message:"Add image",id:"P5MuiB"})})]})})}),!u&&(0,i.jsx)(e8.GammaTooltip,{label:(0,i.jsx)(J.Trans,{message:"Insert table here",id:"hLgX3L"}),placement:"top",shouldWrapChildren:!0,shortcut:"/table",children:(0,i.jsx)(q.Button,{color:p?"gray.400":"gray.700",borderColor:p?"gray.600":"gray.300",backgroundColor:"transparent",fontSize:"0.8em",paddingInlineStart:"1em",paddingInlineEnd:"1em",minWidth:"2em",height:"2em",onClick:()=>{let t=ni("table2");t&&((0,ia.trackItemInserted)(t,er.NodeInsertMethods.BLOCK_PROMPT),t.execute(e))},children:(0,i.jsxs)(a.HStack,{spacing:"0.5em",children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e6.faTable}),(0,i.jsx)("span",{className:"slash-menu-button-text",children:(0,i.jsx)(J.Trans,{message:"Add table",id:"ttzhtD"})})]})})}),(0,i.jsxs)(i2.Popover,{isOpen:n,onClose:()=>{o(!1),e.chain().focus().run()},onOpen:()=>o(!0),isLazy:!0,children:[(0,i.jsx)(e8.GammaTooltip,{label:(0,i.jsx)(J.Trans,{message:"Search to insert a block",id:"NZGeUO"}),shortcut:"Type '/'",placement:"top",shouldWrapChildren:!0,children:(0,i.jsx)(i5.PopoverTrigger,{children:(0,i.jsx)(q.Button,{color:p?"gray.400":"gray.700",borderColor:p?"gray.600":"gray.300",backgroundColor:"transparent",fontSize:"0.8em",paddingInlineStart:"1em",paddingInlineEnd:"1em",minWidth:"2em",height:"2em",children:(0,i.jsxs)(a.HStack,{spacing:"0.5em",children:[(0,i.jsx)(Q.FontAwesomeIcon,{icon:e6.faGrid2Plus}),(0,i.jsx)("span",{className:"slash-menu-button-text",children:(0,i.jsx)(J.Trans,{message:"Add more blocks",id:"PtsfKC"})})]})})})}),(0,i.jsx)(tZ.Portal,{children:(0,i.jsx)(i3.PopoverContent,{borderRadius:"lg",boxShadow:"0px 8px 16px rgba(0, 0, 0, 0.15)",children:(0,i.jsx)(nt,{isCardDark:p,editor:e})})})]})]})]})})})},na=l.Extension.create({name:"emptyNodes",addOptions:()=>({emptyNodeClass:"is-empty",showOnlyWhenEditable:!0,showOnlyCurrent:!1}),addProseMirrorPlugins(){return[new d.Plugin({key:new d.PluginKey("emptyNodes"),props:{decorations:({doc:e,selection:t})=>{let i=[],n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:a}=t;if(!n)return;let r=(e,t)=>{if("table"===e.type.name&&(0,tA.isTableTooLargeToHandle)(e))return!1;if(!(e.isTextblock||["gallery","cardLayoutItem","buttonGroup","labelGroup","navbarLinks","navbarButtons","toggleSummary"].includes(e.type.name)))return;let n=a>=t&&a<=t+e.nodeSize,r=(0,tJ.isTreeEmpty)(e);(n||!this.options.showOnlyCurrent)&&r&&i.push(ib.Decoration.node(t,t+e.nodeSize,{class:this.options.emptyNodeClass},{isEmpty:!0}))};return e.descendants(r),ib.DecorationSet.create(e,i)}}})]}}),nr=e=>e.some(e=>e.spec.isEmpty);e.s(["EmptyNodes",0,na,"isNodeViewEmpty",0,nr],948982);var no=e.i(829814);let ns=e=>{let{node:t,decorations:n,editor:a}=e,r=(0,th.useIsThumbnailView)(),o=nr(n),s=(0,no.isFocusedInside)(n),l=(0,tG.getAlignDirection)(n),{horizontalAlign:d,fontSize:u,placeholder:p}=t.attrs,h=(0,tG.getAlignStyles)(d),m="left"===d&&"ltr"===l||"right"===d&&"rtl"===l,[g,f]=(0,c.useState)(!1),b=!r&&s&&o&&(!d||m)&&!(0,im.isCardNotesEditor)(a)&&!p||g;return(0,i.jsxs)(tw.AnnotatableNodeViewWrapper,{...e,style:{position:"relative"},children:[(0,i.jsx)(tb.NodeViewContent,{dir:l,"data-font-size":u,"data-multiline-placeholder":p,style:{textAlign:h.textAlign}}),b&&(0,i.jsx)(nn,{...e,dir:l,slashMenuOpen:g,setSlashMenuOpen:f})]})},nl=(0,ta.extendTiptapNode)(iG.default,"paragraph",{selectable:!1,addNodeView:()=>(0,tn.ReactNodeViewRenderer)(ns,{update:to.attrsOrDecorationsChanged}),allowFontSizes:"body",parseHTML:()=>[{tag:"p",getAttrs:e=>({fontSize:(0,ta.parseFontSize)(e),...(0,ta.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["p",(0,l.mergeAttributes)(t,{class:"paragraph",...(0,ta.renderFontSize)(e.attrs),...(0,ta.renderHorizontalAlign)(e.attrs)}),0]});e.s([],478401);var nd=e.i(295189);let nc=(0,ta.extendTiptapNode)(nd.HardBreak,"hardBreak",{addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});e.s(["HardBreak",0,nc],577298)},562190,e=>{"use strict";var t=e.i(691567),i=e.i(191788),n=e.i(272043),a=["top","left","transform","className","children","innerRef"];function r(){return(r=Object.assign.bind()).apply(this,arguments)}function o(e){var t=e.top,o=e.left,s=e.transform,l=e.className,d=e.children,c=e.innerRef,u=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,a);return i.default.createElement("g",r({ref:c,className:(0,n.default)("visx-group",l),transform:s||"translate("+(void 0===o?0:o)+", "+(void 0===t?0:t)+")"},u),d)}o.propTypes={top:t.default.number,left:t.default.number,transform:t.default.string,className:t.default.string,children:t.default.node,innerRef:t.default.oneOfType([t.default.string,t.default.func,t.default.object])},e.s(["default",0,o])},263618,(e,t,i)=>{function n(e,t,i){e instanceof RegExp&&(e=a(e,i)),t instanceof RegExp&&(t=a(t,i));var n=r(e,t,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+e.length,n[1]),post:i.slice(n[1]+t.length)}}function a(e,t){var i=t.match(e);return i?i[0]:null}function r(e,t,i){var n,a,r,o,s,l=i.indexOf(e),d=i.indexOf(t,l+1),c=l;if(l>=0&&d>0){for(n=[],r=i.length;c>=0&&!s;)c==l?(n.push(c),l=i.indexOf(e,c+1)):1==n.length?s=[n.pop(),d]:((a=n.pop())=0?l:d;n.length&&(s=[r,o])}return s}t.exports=n,n.range=r},517501,(e,t,i)=>{"use strict";function n(e,t,i){e instanceof RegExp&&(e=a(e,i)),t instanceof RegExp&&(t=a(t,i));var n=r(e,t,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+e.length,n[1]),post:i.slice(n[1]+t.length)}}function a(e,t){var i=t.match(e);return i?i[0]:null}function r(e,t,i){var n,a,r,o,s,l=i.indexOf(e),d=i.indexOf(t,l+1),c=l;if(l>=0&&d>0){for(n=[],r=i.length;c>=0&&!s;)c==l?(n.push(c),l=i.indexOf(e,c+1)):1==n.length?s=[n.pop(),d]:((a=n.pop())=0?l:d;n.length&&(s=[r,o])}return s}t.exports=n,n.range=r},719153,(e,t,i)=>{var n=e.r(517501);t.exports=function e(t,i,a){return(function(e,t){var i=[],a="string"==typeof t?RegExp("\\b("+t+")\\("):t;do{var r=a.exec(e);if(!r)break;if(void 0===r[1])throw Error("Missing the first couple of parenthesis to get the function identifier in "+t);var o=r[1],s=r.index,l=n("(",")",e.substring(s));if(!l||l.start!==r[0].length-1)throw SyntaxError(o+"(): missing closing ')' in the value '"+e+"'");i.push({matches:l,functionIdentifier:o}),e=l.post}while(a.test(e))return i})(t,i).reduce(function(n,r){var o,s,l,d;return n.replace(r.functionIdentifier+"("+r.matches.body+")",(o=r.matches.body,s=r.functionIdentifier,l=a,d=t,l(e(o,i,l),s,d)))},t)}},392875,(e,t,i)=>{"use strict";var n=function(e){this.value=e};n.math={isDegree:!0,acos:function(e){return n.math.isDegree?180/Math.PI*Math.acos(e):Math.acos(e)},add:function(e,t){return e+t},asin:function(e){return n.math.isDegree?180/Math.PI*Math.asin(e):Math.asin(e)},atan:function(e){return n.math.isDegree?180/Math.PI*Math.atan(e):Math.atan(e)},acosh:function(e){return Math.log(e+Math.sqrt(e*e-1))},asinh:function(e){return Math.log(e+Math.sqrt(e*e+1))},atanh:function(e){return Math.log((1+e)/(1-e))},C:function(e,t){var i=1,a=e-t,r=t;r{"use strict";var n=e.r(392875);function a(e,t){for(var i=0;im.length-2?m.length-1:e.length-l;i>0;i--)if(void 0!==m[i])for(a=0;a0&&k{var n=e.r(664888);n.prototype.toPostfix=function(){"use strict";for(var e,t,i,a,r,o=[],s=[{value:"(",type:4,pre:0}],l=this.value,d=1;di)s.push(e);else{for(;i>=a&&!c||c&&a{var n=e.r(90002);n.prototype.postfixEval=function(e){"use strict";(e=e||{}).PI=Math.PI,e.E=Math.E;for(var t,i,a,r=[],o=this.value,s=void 0!==e.n,l=0;l1)throw new n.Exception("Uncaught Syntax error");return r[0].value>1e15?"Infinity":parseFloat(r[0].value.toFixed(15))},n.eval=function(e,t,i){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0!==i?this.lex(e,t).toPostfix().postfixEval(i):void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t)},t.exports=n},639087,(e,t,i)=>{var n=e.r(947141);n.prototype.formulaEval=function(){"use strict";for(var e,t,i,n=[],a=this.value,r=0;r"+t.value+""+a[r].show+""+e.value+"",type:10}):n.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+""+e.value+"",type:1})):2===a[r].type||9===a[r].type?(e=n.pop(),t=n.pop(),n.push({value:(1!=t.type?"(":"")+t.value+(1!=t.type?")":"")+a[r].show+(1!=e.type?"(":"")+e.value+(1!=e.type?")":""),type:a[r].type})):12===a[r].type&&(e=n.pop(),t=n.pop(),i=n.pop(),n.push({value:a[r].show+"("+i.value+","+t.value+","+e.value+")",type:12}));return n[0].value},t.exports=n},765695,(e,t,i)=>{var n,a=e.r(263618),r=e.r(719153),o=e.r(639087),s=/(\+|\-|\*|\\|[^a-z]|)(\s*)(\()/g;t.exports=function(e,t){return n=0,t=Math.pow(10,void 0===t?5:t),r(e=e.replace(/\n+/g," "),/((?:\-[a-z]+\-)?calc)\(/,function e(i,r,l){if(n++>100)throw n=0,Error("Call stack overflow for "+l);if(""===i)throw Error(r+"(): '"+l+"' must contain a non-whitespace string");var d,c=function(e){for(var t=[],i=[],n=/[\.0-9]([%a-z]+)/gi,a=n.exec(e);a;)a&&a[1]&&(-1===i.indexOf(a[1].toLowerCase())&&(t.push(a[1]),i.push(a[1].toLowerCase())),a=n.exec(e));return t}(i=function(t,i){t=t.replace(/((?:\-[a-z]+\-)?calc)/g,"");for(var n,r="",o=t;n=s.exec(o);){n[0].index>0&&(r+=o.substring(0,n[0].index));var l=a("(",")",o.substring(void 0));if(""===l.body)throw Error("'"+t+"' must contain a non-whitespace string");var d=e(l.body,"",i);r+=l.pre+d,o=l.post}return r+o}(i,l));if(c.length>1||i.indexOf("var(")>-1)return r+"("+i+")";var u=c[0]||"";"%"===u&&(i=i.replace(/\b[0-9\.]+%/g,function(e){return .01*parseFloat(e.slice(0,-1))}));var p=i.replace(RegExp(u,"gi"),"");try{d=o.eval(p)}catch(e){return r+"("+i+")"}return"%"===u&&(d*=100),(r.length||"%"===u)&&(d=Math.round(d*t)/t),d+=u})}},322655,e=>{"use strict";e.s([],507530),e.i(507530);var t=e.i(562190);e.s(["Group",()=>t.default],322655)},911592,e=>{"use strict";e.s([],119857),e.i(119857);var t=e.i(704938),i=e.i(564183),n=e.i(612386),a=e.i(77971),r=e.i(73422),o=l(r.default);function s(e){this._curve=e}function l(e){function t(t){return new s(e(t))}return t._curve=e,t}function d(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(e){return arguments.length?t(l(e)):t()._curve},e}function c(){return d((0,n.default)().curve(o))}function u(){var e=(0,i.default)().curve(o),t=e.curve,n=e.lineX0,a=e.lineX1,r=e.lineY0,s=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return d(n())},delete e.lineX0,e.lineEndAngle=function(){return d(a())},delete e.lineX1,e.lineInnerRadius=function(){return d(r())},delete e.lineY0,e.lineOuterRadius=function(){return d(s())},delete e.lineY1,e.curve=function(e){return arguments.length?t(l(e)):t()._curve},e}function p(e,t){return[(t*=1)*Math.cos(e-=Math.PI/2),t*Math.sin(e)]}s.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),-(t*Math.cos(e)))}};var h=e.i(758866),m=e.i(321776),g=e.i(872301),f=e.i(821587);function b(e){return e.source}function x(e){return e.target}function y(e){var t=b,i=x,n=f.x,a=f.y,r=null;function o(){var o,s=m.slice.call(arguments),l=t.apply(this,s),d=i.apply(this,s);if(r||(r=o=(0,h.path)()),e(r,+n.apply(this,(s[0]=l,s)),+a.apply(this,s),+n.apply(this,(s[0]=d,s)),+a.apply(this,s)),o)return r=null,o+""||null}return o.source=function(e){return arguments.length?(t=e,o):t},o.target=function(e){return arguments.length?(i=e,o):i},o.x=function(e){return arguments.length?(n="function"==typeof e?e:(0,g.default)(+e),o):n},o.y=function(e){return arguments.length?(a="function"==typeof e?e:(0,g.default)(+e),o):a},o.context=function(e){return arguments.length?(r=null==e?null:e,o):r},o}function v(e,t,i,n,a){e.moveTo(t,i),e.bezierCurveTo(t=(t+n)/2,i,t,a,n,a)}function C(e,t,i,n,a){e.moveTo(t,i),e.bezierCurveTo(t,i=(i+a)/2,n,i,n,a)}function w(e,t,i,n,a){var r=p(t,i),o=p(t,i=(i+a)/2),s=p(n,i),l=p(n,a);e.moveTo(r[0],r[1]),e.bezierCurveTo(o[0],o[1],s[0],s[1],l[0],l[1])}var S=e.i(151711);let k={draw:function(e,t){var i=Math.sqrt(t/S.pi);e.moveTo(i,0),e.arc(0,0,i,0,S.tau)}},A={draw:function(e,t){var i=Math.sqrt(t/5)/2;e.moveTo(-3*i,-i),e.lineTo(-i,-i),e.lineTo(-i,-3*i),e.lineTo(i,-3*i),e.lineTo(i,-i),e.lineTo(3*i,-i),e.lineTo(3*i,i),e.lineTo(i,i),e.lineTo(i,3*i),e.lineTo(-i,3*i),e.lineTo(-i,i),e.lineTo(-3*i,i),e.closePath()}};var E=Math.sqrt(1/3),_=2*E;let I={draw:function(e,t){var i=Math.sqrt(t/_),n=i*E;e.moveTo(0,-i),e.lineTo(n,0),e.lineTo(0,i),e.lineTo(-n,0),e.closePath()}};var M=Math.sin(S.pi/10)/Math.sin(7*S.pi/10),T=Math.sin(S.tau/10)*M,L=-Math.cos(S.tau/10)*M;let j={draw:function(e,t){var i=Math.sqrt(.8908130915292852*t),n=T*i,a=L*i;e.moveTo(0,-i),e.lineTo(n,a);for(var r=1;r<5;++r){var o=S.tau*r/5,s=Math.cos(o),l=Math.sin(o);e.lineTo(l*i,-s*i),e.lineTo(s*n-l*a,l*n+s*a)}e.closePath()}},P={draw:function(e,t){var i=Math.sqrt(t),n=-i/2;e.rect(n,n,i,i)}};var D=Math.sqrt(3);let N={draw:function(e,t){var i=-Math.sqrt(t/(3*D));e.moveTo(0,2*i),e.lineTo(-D*i,-i),e.lineTo(D*i,-i),e.closePath()}};var R=Math.sqrt(3)/2,O=1/Math.sqrt(12),B=(O/2+1)*3;let z={draw:function(e,t){var i=Math.sqrt(t/B),n=i/2,a=i*O,r=i*O+i,o=-n;e.moveTo(n,a),e.lineTo(n,r),e.lineTo(o,r),e.lineTo(-.5*n-R*a,R*n+-.5*a),e.lineTo(-.5*n-R*r,R*n+-.5*r),e.lineTo(-.5*o-R*r,R*o+-.5*r),e.lineTo(-.5*n+R*a,-.5*a-R*n),e.lineTo(-.5*n+R*r,-.5*r-R*n),e.lineTo(-.5*o+R*r,-.5*r-R*o),e.closePath()}};var F=[k,A,I,P,j,N,z];function H(){}function W(e,t,i){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+i)/6)}function U(e){this._context=e}function V(e){this._context=e}function G(e){this._context=e}function $(e,t){this._basis=new U(e),this._beta=t}U.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:W(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:W(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},V.prototype={areaStart:H,areaEnd:H,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:W(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},G.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var i=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(i,n):this._context.moveTo(i,n);break;case 3:this._point=4;default:W(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},$.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var e=this._x,t=this._y,i=e.length-1;if(i>0)for(var n,a=e[0],r=t[0],o=e[i]-a,s=t[i]-r,l=-1;++l<=i;)n=l/i,this._basis.point(this._beta*e[l]+(1-this._beta)*(a+n*o),this._beta*t[l]+(1-this._beta)*(r+n*s));this._x=this._y=null,this._basis.lineEnd()},point:function(e,t){this._x.push(+e),this._y.push(+t)}};let Z=function e(t){function i(e){return 1===t?new U(e):new $(e,t)}return i.beta=function(t){return e(+t)},i}(.85);var K=e.i(753998);function q(e,t){this._context=e,this._k=(1-t)/6}q.prototype={areaStart:H,areaEnd:H,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:(0,K.point)(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let Y=function e(t){function i(e){return new q(e,t)}return i.tension=function(t){return e(+t)},i}(0);function X(e,t){this._context=e,this._k=(1-t)/6}X.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:(0,K.point)(this,e,t)}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let Q=function e(t){function i(e){return new X(e,t)}return i.tension=function(t){return e(+t)},i}(0);var J=e.i(304565);function ee(e,t){this._context=e,this._alpha=t}ee.prototype={areaStart:H,areaEnd:H,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){if(e*=1,t*=1,this._point){var i=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:(0,J.point)(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let et=function e(t){function i(e){return t?new ee(e,t):new q(e,0)}return i.alpha=function(t){return e(+t)},i}(.5);function ei(e,t){this._context=e,this._alpha=t}ei.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){if(e*=1,t*=1,this._point){var i=this._x2-e,n=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(i*i+n*n,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:(0,J.point)(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};let en=function e(t){function i(e){return t?new ei(e,t):new X(e,0)}return i.alpha=function(t){return e(+t)},i}(.5);function ea(e){this._context=e}ea.prototype={areaStart:H,areaEnd:H,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e*=1,t*=1,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function er(e,t,i){var n=e._x1-e._x0,a=t-e._x1,r=(e._y1-e._y0)/(n||a<0&&-0),o=(i-e._y1)/(a||n<0&&-0);return((r<0?-1:1)+(o<0?-1:1))*Math.min(Math.abs(r),Math.abs(o),.5*Math.abs((r*a+o*n)/(n+a)))||0}function eo(e,t){var i=e._x1-e._x0;return i?(3*(e._y1-e._y0)/i-t)/2:t}function es(e,t,i){var n=e._x0,a=e._y0,r=e._x1,o=e._y1,s=(r-n)/3;e._context.bezierCurveTo(n+s,a+s*t,r-s,o-s*i,r,o)}function el(e){this._context=e}function ed(e){this._context=new ec(e)}function ec(e){this._context=e}function eu(e){this._context=e}function ep(e){var t,i,n=e.length-1,a=Array(n),r=Array(n),o=Array(n);for(a[0]=0,r[0]=2,o[0]=e[0]+2*e[1],t=1;t=0;--t)a[t]=(o[t]-a[t+1])/r[t];for(t=0,r[n-1]=(e[n]+a[n-1])/2;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e*=1,t*=1,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var i=this._x*(1-this._t)+e*this._t;this._context.lineTo(i,this._y),this._context.lineTo(i,t)}}this._x=e,this._y=t}};var em=e.i(169898),eg=e.i(435751),ef=e.i(869651),eb=e.i(721935),ex=e.i(882039);function ey(e){var t=e.map(ev);return(0,ex.default)(e).sort(function(e,i){return t[e]-t[i]})}function ev(e){for(var t,i=-1,n=0,a=e.length,r=-1/0;++ir&&(r=t,n=i);return n}function eC(e){var t=e.map(ew);return(0,ex.default)(e).sort(function(e,i){return t[e]-t[i]})}function ew(e){for(var t,i=0,n=-1,a=e.length;++nt.default,"area",()=>i.default,"areaRadial",0,u,"curveBasis",0,function(e){return new U(e)},"curveBasisClosed",0,function(e){return new V(e)},"curveBasisOpen",0,function(e){return new G(e)},"curveBundle",0,Z,"curveCardinal",()=>K.default,"curveCardinalClosed",0,Y,"curveCardinalOpen",0,Q,"curveCatmullRom",()=>J.default,"curveCatmullRomClosed",0,et,"curveCatmullRomOpen",0,en,"curveLinear",()=>r.default,"curveLinearClosed",0,function(e){return new ea(e)},"curveMonotoneX",0,function(e){return new el(e)},"curveMonotoneY",0,function(e){return new ed(e)},"curveNatural",0,function(e){return new eu(e)},"curveStep",0,function(e){return new eh(e,.5)},"curveStepAfter",0,function(e){return new eh(e,1)},"curveStepBefore",0,function(e){return new eh(e,0)},"line",()=>n.default,"lineRadial",0,c,"linkHorizontal",0,function(){return y(v)},"linkRadial",0,function(){var e=y(w);return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e},"linkVertical",0,function(){return y(C)},"pie",()=>a.default,"pointRadial",0,p,"radialArea",0,u,"radialLine",0,c,"stack",()=>em.default,"stackOffsetDiverging",()=>ef.default,"stackOffsetExpand",()=>eg.default,"stackOffsetNone",()=>eb.default,"stackOffsetSilhouette",0,function(e,t){if((i=e.length)>0){for(var i,n=0,a=e[t[0]],r=a.length;n0&&(n=(i=e[t[0]]).length)>0){for(var i,n,a,r=0,o=1;oex.default,"stackOrderReverse",0,function(e){return(0,ex.default)(e).reverse()},"symbol",0,function(){var e=(0,g.default)(k),t=(0,g.default)(64),i=null;function n(){var n;if(i||(i=n=(0,h.path)()),e.apply(this,arguments).draw(i,+t.apply(this,arguments)),n)return i=null,n+""||null}return n.type=function(t){return arguments.length?(e="function"==typeof t?t:(0,g.default)(t),n):e},n.size=function(e){return arguments.length?(t="function"==typeof e?e:(0,g.default)(+e),n):t},n.context=function(e){return arguments.length?(i=null==e?null:e,n):i},n},"symbolCircle",0,k,"symbolCross",0,A,"symbolDiamond",0,I,"symbolSquare",0,P,"symbolStar",0,j,"symbolTriangle",0,N,"symbolWye",0,z,"symbols",0,F],911592)},629598,(e,t,i)=>{"use strict";i.__esModule=!0,i.default=function(e,t){e(t)}},533035,(e,t,i)=>{"use strict";i.__esModule=!0,i.STACK_ORDER_NAMES=i.STACK_ORDERS=void 0,i.default=function(e){return e&&a[e]||a.none};var n=e.r(911592),a={ascending:n.stackOrderAscending,descending:n.stackOrderDescending,insideout:n.stackOrderInsideOut,none:n.stackOrderNone,reverse:n.stackOrderReverse};i.STACK_ORDERS=a,i.STACK_ORDER_NAMES=Object.keys(a)},922841,(e,t,i)=>{"use strict";i.__esModule=!0,i.STACK_OFFSET_NAMES=i.STACK_OFFSETS=void 0,i.default=function(e){return e&&a[e]||a.none};var n=e.r(911592),a={expand:n.stackOffsetExpand,diverging:n.stackOffsetDiverging,none:n.stackOffsetNone,silhouette:n.stackOffsetSilhouette,wiggle:n.stackOffsetWiggle};i.STACK_OFFSETS=a,i.STACK_OFFSET_NAMES=Object.keys(a)},993307,(e,t,i)=>{"use strict";i.__esModule=!0,i.arc=function(e){var t=void 0===e?{}:e,i=t.innerRadius,r=t.outerRadius,o=t.cornerRadius,s=t.startAngle,l=t.endAngle,d=t.padAngle,c=t.padRadius,u=(0,n.arc)();return null!=i&&(0,a.default)(u.innerRadius,i),null!=r&&(0,a.default)(u.outerRadius,r),null!=o&&(0,a.default)(u.cornerRadius,o),null!=s&&(0,a.default)(u.startAngle,s),null!=l&&(0,a.default)(u.endAngle,l),null!=d&&(0,a.default)(u.padAngle,d),null!=c&&(0,a.default)(u.padRadius,c),u},i.area=function(e){var t=void 0===e?{}:e,i=t.x,r=t.x0,o=t.x1,s=t.y,l=t.y0,d=t.y1,c=t.defined,u=t.curve,p=(0,n.area)();return i&&(0,a.default)(p.x,i),r&&(0,a.default)(p.x0,r),o&&(0,a.default)(p.x1,o),s&&(0,a.default)(p.y,s),l&&(0,a.default)(p.y0,l),d&&(0,a.default)(p.y1,d),c&&p.defined(c),u&&p.curve(u),p},i.line=function(e){var t=void 0===e?{}:e,i=t.x,r=t.y,o=t.defined,s=t.curve,l=(0,n.line)();return i&&(0,a.default)(l.x,i),r&&(0,a.default)(l.y,r),o&&l.defined(o),s&&l.curve(s),l},i.pie=function(e){var t=void 0===e?{}:e,i=t.startAngle,r=t.endAngle,o=t.padAngle,s=t.value,l=t.sort,d=t.sortValues,c=(0,n.pie)();return null===l?c.sort(l):null!=l&&c.sort(l),null===d?c.sortValues(d):null!=d&&c.sortValues(d),null!=s&&c.value(s),null!=o&&(0,a.default)(c.padAngle,o),null!=i&&(0,a.default)(c.startAngle,i),null!=r&&(0,a.default)(c.endAngle,r),c},i.radialLine=function(e){var t=void 0===e?{}:e,i=t.angle,r=t.radius,o=t.defined,s=t.curve,l=(0,n.radialLine)();return i&&(0,a.default)(l.angle,i),r&&(0,a.default)(l.radius,r),o&&l.defined(o),s&&l.curve(s),l},i.stack=function(e){var t=e.keys,i=e.value,s=e.order,l=e.offset,d=(0,n.stack)();return t&&d.keys(t),i&&(0,a.default)(d.value,i),s&&d.order((0,r.default)(s)),l&&d.offset((0,o.default)(l)),d};var n=e.r(911592),a=s(e.r(629598)),r=s(e.r(533035)),o=s(e.r(922841));function s(e){return e&&e.__esModule?e:{default:e}}},844224,(e,t,i)=>{"use strict";i.__esModule=!0,i.default=function(e){var t=e.className,i=e.top,l=e.left,c=e.data,u=e.centroid,p=e.innerRadius,h=e.outerRadius,m=e.cornerRadius,g=e.startAngle,f=e.endAngle,b=e.padAngle,x=e.padRadius,y=e.pieSort,v=e.pieSortValues,C=e.pieValue,w=e.children,S=e.fill,k=void 0===S?"":S,A=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,s),E=(0,o.arc)({innerRadius:void 0===p?0:p,outerRadius:h,cornerRadius:m,padRadius:x}),_=(0,o.pie)({startAngle:g,endAngle:f,padAngle:b,value:C,sort:y,sortValues:v}),I=_(void 0===c?[]:c);return w?n.default.createElement(n.default.Fragment,null,w({arcs:I,path:E,pie:_})):n.default.createElement(r.Group,{className:"visx-pie-arcs-group",top:i,left:l},I.map(function(e,i){return n.default.createElement("g",{key:"pie-arc-"+i},n.default.createElement("path",d({className:(0,a.default)("visx-pie-arc",t),d:E(e)||"",fill:null==k||"string"==typeof k?k:k(e)},A)),null==u?void 0:u(E.centroid(e),e))}))};var n=l(e.r(191788)),a=l(e.r(272043)),r=e.r(322655),o=e.r(993307),s=["className","top","left","data","centroid","innerRadius","outerRadius","cornerRadius","startAngle","endAngle","padAngle","padRadius","pieSort","pieSortValues","pieValue","children","fill"];function l(e){return e&&e.__esModule?e:{default:e}}function d(){return(d=Object.assign.bind()).apply(this,arguments)}},601019,641078,525277,889628,415756,742014,475463,539262,200155,990272,78383,985894,225335,383576,908229,826646,385589,364247,672279,757451,838777,928530,953433,177890,53092,969987,918327,588748,82206,135317,842252,979353,198905,708235,613037,888919,701652,823299,254311,423686,967856,274526,461679,165020,431604,208815,313307,592799,622456,432605,282845,553901,810983,122488,389278,59539,138588,427387,602563,967233,266663,211917,640901,e=>{"use strict";e.s([],601019),e.s(["checkCommandDisabled",()=>rI,"getCommandsMap",()=>r_,"getSortedCommands",()=>rE],985894);var t,i,n,a,r,o=e.i(500425),s=e.i(524473),l=e.i(408122),d=e.i(55261),c=e.i(3297),u=e.i(148908),p=e.i(130074);e.i(144786);var h=e.i(275316),m=e.i(144294),g=e.i(522542),f=e.i(860766),b=e.i(429577),x=e.i(683164),y=e.i(517344),v=e.i(255664),C=e.i(296691),w=e.i(809755),S=e.i(127969),k=e.i(152561),A=e.i(357790),E=e.i(436910);e.s(["SmartDiagramImageTemplates",()=>rd,"SmartDiagramTemplates",()=>rl,"getSmartDiagramFormattingMenu",()=>rp,"getSmartDiagramTemplate",()=>ru],990272);var _=e.i(391398),I=e.i(413829),M=e.i(957734),T=e.i(774193),L=e.i(613616),j=e.i(191788),P=e.i(849187),D=e.i(661619),N=e.i(325059),R=e.i(418755),O=e.i(136484),B=e.i(551880),z=e.i(509504),F=e.i(271015),H=e.i(498201),W=e.i(928286),U=e.i(166292),V=e.i(955300),G=e.i(470645),$=e.i(858895),Z=e.i(864935),K=e.i(446924),q=e.i(74056);e.i(828525);var Y=e.i(876533);e.i(197071);var X=e.i(564246);e.i(314572);var Q=e.i(636339),J=e.i(133350),ee=e.i(955312),et=e.i(835128),ei=e.i(755453),en=e.i(54182),ea=e.i(175863),er=e.i(783197),eo=e.i(335884),es=e.i(598401),el=e.i(529232),ed=e.i(807727),ec=e.i(589193),eu=e.i(864713),ep=e.i(379363),eh=e.i(180190);e.i(905506);var em=e.i(84723);e.s(["TextboxEditor",()=>tx,"getTextboxExtensions",()=>tb],200155);var eg=e.i(428683),ef=e.i(8518),eb=e.i(569962),ex=e.i(154258),ey=e.i(676095),ev=e.i(383865),eC=e.i(520100),ew=e.i(388773),eS=e.i(772177),ek=e.i(539106);e.i(478401);var eA=e.i(13948),eE=e.i(639014),e_=e.i(676876),eI=e.i(577298),eM=e.i(919352),eT=e.i(264333),eL=e.i(935020),ej=e.i(887527),eP=e.i(296446),eD=e.i(358280),eN=e.i(361183),eR=e.i(498817),eO=e.i(198311),eB=e.i(367792),ez=e.i(695192),eF=e.i(309847),eH=e.i(959022);e.i(838054);var eW=e.i(432247),eU=e.i(256266),eV=e.i(437769),eG=e.i(555145),e$=e.i(382167),eZ=e.i(650292),eK=e.i(160396),eq=e.i(242349),eY=e.i(344233),eX=e.i(818315),eQ=e.i(654656),eJ=e.i(541075),e0=e.i(896620);let e1=e=>{let{interceptLinkClick:t,linkUrlSafe:i,linkInterceptEnabled:n}=(0,ez.useLinkInterstitial)(e),a=(0,j.useCallback)((i=!1)=>a=>{if(e){if(!n){i||window.open(e,"_blank","noopener");return}t(a)||i||window.open(e,"_blank","noopener")}},[e,t,n]);return(0,j.useMemo)(()=>({handleOpenNativeLinkWithInterstitial:a(!0),handleOpenLinkWithInterstitial:a(),linkUrlSafe:i}),[a,i])};e.s(["useOpenLinkWithInterstitial",0,e1],641078);var e2=e.i(495084),e3=e.i(261442),e5=e.i(329860),e4=e.i(224960);let e6=({node:e,disableOpenButton:t=!1})=>{let{meta:i,source:n}=e.attrs,a=(0,e5.getMediaSourceUrl)(e.attrs),r=(0,e4.getEmbedProvider)(n),{handleOpenLinkWithInterstitial:o}=e1(a),d="embed.custom"===n||"video.custom"===n,c=i?.icon||r.image?.src,u=i?.site||(d?(0,eq.getLinkDomain)(a):r.label());return(0,_.jsxs)(eQ.VStack,{spacing:"0.25em",align:"flex-start",color:"black",w:"100%",fontSize:"0.9em",children:[(0,_.jsxs)(eG.HStack,{align:"center",spacing:"0.25em",w:"100%",color:"var(--body-color-muted)",children:[(0,_.jsx)(e9,{icon:c}),(0,_.jsx)(ej.Text,{noOfLines:1,flex:1,"data-testid":"site-name",fontSize:"0.9em",children:u}),r.downloadable&&a&&(0,_.jsx)(e0.GammaTooltip,{label:(0,_.jsx)(eD.Trans,{message:"Download",id:"mzI/c+"}),placement:"top",children:(0,_.jsx)(eY.IconButton,{"aria-label":l.i18n._({id:"mzI/c+",message:"Download"}),icon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faDownload}),onClick:()=>{let e=document.createElement("a");e.href=a,e.target="_blank",e.download=i?.title||"file.pdf",e.dispatchEvent(new MouseEvent("click"))},variant:"unstyled",sx:e2.ClickableButtonSx,fontSize:"0.7em",zIndex:2,onMouseDown:e3.preventDefaultToAvoidBlur})}),!t&&a&&(0,_.jsx)(e0.GammaTooltip,{label:(0,_.jsx)(eD.Trans,{message:"Open in new tab",id:"Alx2/L"}),placement:"top",children:(0,_.jsx)(eY.IconButton,{"aria-label":l.i18n._({id:"Alx2/L",message:"Open in new tab"}),icon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faExternalLink}),onClick:o,variant:"unstyled",zIndex:2,fontSize:"0.7em",onMouseDown:e3.preventDefaultToAvoidBlur,sx:e2.ClickableButtonSx})})]}),(0,_.jsx)(ej.Text,{fontWeight:"bold",noOfLines:1,maxW:"90%","data-testid":"title",color:"var(--body-color)",wordBreak:"break-all",children:i?.title}),i?.description&&(0,_.jsx)(ej.Text,{noOfLines:[2,3],whiteSpace:"normal",maxW:"100%",color:"var(--body-color-muted)",children:i.description})]})},e9=({icon:e,...t})=>e?(0,_.jsx)(eX.Image,{src:e,h:"1.5em",borderRadius:"sm",...t}):(0,_.jsx)(ej.Text,{as:"span",...t,children:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faBrowser})});var e8=e.i(575084),e7=e.i(297194),te=e.i(697240);let tt=({node:e})=>{let t,i,n,a,r,o,{thumbnail:l,meta:d,source:c}=e.attrs,u=l?.src||l?.tempUrl;return l?.showPlaceholder?(0,_.jsx)(te.MediaPlaceholderImage,{hasUploadError:l.uploadStatus===e7.UploadStatus.Error,isUploading:l.uploadStatus===e7.UploadStatus.Uploading,width:"100%",borderRadius:"none",icon:"embed.pdf"===c?s.faFilePdf:s.faBrowser}):u?(0,_.jsxs)(L.Flex,{flex:1,color:"white",position:"relative",children:[(0,_.jsx)(eg.Box,{flex:1,overflow:"hidden",bgColor:"white",children:(0,_.jsx)(eX.Image,{src:u,position:"absolute",objectFit:"cover",width:"100%",height:"100%"})}),l?.uploadStatus===e7.UploadStatus.Uploading&&(0,_.jsx)(te.MediaPlaceholderSpinner,{}),d?.duration&&(0,_.jsxs)(eG.HStack,{fontSize:"0.75em",backgroundColor:"blackAlpha.700",color:"white",position:"absolute",insetEnd:0,bottom:0,py:1,px:2,"data-thumbnail-hidden":!0,children:[(0,_.jsx)(eJ.FontAwesomeIcon,{icon:e8.faPlay}),(0,_.jsx)(ej.Text,{children:(i=Math.floor((t=Math.floor(Math.max(0,d.duration)))/3600),n=Math.floor(t%3600/60),a=i.toString().padStart(2,"0"),r=n.toString().padStart(2,"0"),o=(t%60).toString().padStart(2,"0"),i>=1?a+":"+r+":"+o:r+":"+o)})]})]}):null},ti=e=>e&&(!e.height||e.height>=50)&&(!e.width||e.width>=50),tn=({node:e})=>{let{thumbnail:t,sourceUrl:i}=e.attrs;return(0,_.jsxs)(L.Flex,{overflow:"hidden",direction:"row",align:"stretch",wrap:"wrap",contentEditable:!1,transitionProperty:"common",transitionDuration:"normal",position:"relative",borderRadius:"inherit","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,fontFamily:"body","data-drag-handle":!0,h:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",children:[t&&ti(t)&&(0,_.jsx)(L.Flex,{flex:1,minH:"10em",minW:"min(10em, 100%)",maxW:"100%",maxH:"var(--media-maxH)",children:(0,_.jsx)(tt,{node:e})}),(0,_.jsx)(L.Flex,{flex:1.618,minW:"min(16em, 100%)",maxW:"100%",p:"1em",position:"relative",children:(0,_.jsx)(e6,{node:e})}),eZ.isPuppeteer&&i&&(0,_.jsx)(e$.Link,{href:i,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0})]})};e.s(["EmbedPreview",0,tn,"MiniEmbedPreview",0,({node:e})=>{let{thumbnail:t,meta:i,sourceUrl:n,source:a}=e.attrs,r=(0,e4.getEmbedProvider)(a);return(0,_.jsxs)(L.Flex,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},maxW:"100%",maxH:"var(--media-maxH)",h:"100%",align:"stretch",boxSizing:"content-box",overflow:"hidden","data-content-reference":!0,"data-selection-ring":"inside",position:"relative",bg:"gray.50",children:[t&&ti(t)?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(tt,{node:e}),(0,_.jsxs)(eG.HStack,{backgroundColor:"whiteAlpha.700",backdropFilter:"blur(8px)",py:1,px:2,position:"absolute",bottom:"0",fontSize:"0.75em","data-thumbnail-hidden":!0,children:[(0,_.jsx)(e9,{icon:i?.icon||r.image?.src}),n&&(0,_.jsx)(ej.Text,{color:"black",noOfLines:1,children:i?.title||i?.site||(0,eq.getLinkDomain)(n)})]})]}):(0,_.jsx)(L.Flex,{align:"flex-start",flex:"1",p:4,children:(0,_.jsx)(e6,{node:e,disableOpenButton:!0})}),eB.config.GAMMA_PUPPETEER_SERVICE&&n&&(0,_.jsx)(e$.Link,{href:n,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0})]})},"ThumbnailEmbedPreview",0,({node:e})=>{let{meta:t,source:i,thumbnail:n}=e.attrs,a=(0,e4.getEmbedProvider)(i),r=n?.src||n?.tempUrl,o=r&&(0,eK.resizeAndProxyImageUrl)(r,eK.THUMBNAIL_RESIZE_JPG_PARAMS);return(0,_.jsx)(L.Flex,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},bg:"var(--body-color-muted)",align:"center",justify:"center",bgImage:(0,eK.backgroundImageFromUrls)(o),backgroundSize:"cover",children:(0,_.jsx)(e9,{icon:t?.icon||a.image?.src,fontSize:"7.5em"})})}],525277);let ta=(0,eO.motion)(eg.Box),tr=({node:e,children:t,contentDOMRef:i})=>{let{href:n,meta:a}=e.attrs,r=(0,eo.useShouldUsePublishedVersion)(),o=(0,eP.useIsInReactProseMirror)(),{linkUrl:s,handleClick:l}=(0,eF.useSiteEnabledLink)({url:n||""}),{interceptLinkClick:d,linkUrlSafe:c,isUntrusted:u,linkInterceptEnabled:p}=(0,ez.useLinkInterstitial)(s),h=(0,j.useCallback)(e=>{if(l?.(e),p)return d(e)},[l,d,p]),{popperRef:m,referenceRef:g,isHovering:f,onMouseOver:b,onMouseOut:x,getPopperProps:y}=(0,eV.useLightPopover)({disabled:(0,eU.isMobileOrTabletDevice)()}),v=!r&&!eB.config.GAMMA_CYPRESS_TEST&&(0,eU.isChrome)();return(0,_.jsxs)(eH.NodeViewWrapper,{as:"span",children:[u?(0,_.jsx)(ej.Text,{as:"span",textDecoration:"underline",color:"gray.500",children:(0,_.jsx)(eD.Trans,{message:"unknown link",id:"b7jHrl"})}):(0,_.jsxs)(ej.Text,{as:"a",className:"link",rel:"noopener nofollow",href:p?c||"":s,onClick:h,onMouseOver:b,onMouseOut:x,ref:g,children:[v&&(0,_.jsx)("span",{contentEditable:!1,children:"​"}),r||o?(0,_.jsx)("span",{ref:i,children:t}):(0,_.jsx)(eW.NodeViewContent,{as:"span"}),v&&(0,_.jsx)("span",{contentEditable:!1,children:"​"})]}),!1===r&&f&&s&&a?(0,_.jsx)(eL.Portal,{children:(0,_.jsx)(eR.AnimatePresence,{children:(0,_.jsx)(ta,{position:"relative",zIndex:"popover",ref:m,onMouseOver:b,onMouseOut:x,className:"link-preview-hover",...y(),...eV.LightPopoverMotionProps,w:"min(500px, 80vw)",minW:"auto !important",children:(0,_.jsxs)(eT.LinkBox,{backgroundColor:"white",border:"1px solid",borderColor:"gray.200",shadow:"lg",borderRadius:"lg",_hover:{backgroundColor:"trueblue.50"},children:[(0,_.jsx)(tn,{node:e}),(0,_.jsx)(eT.LinkOverlay,{href:s,target:"_blank",rel:"noopener nofollow",onClick:h})]})})})}):null]})};function to({markProps:e,children:t,ref:i}){let{editor:n}=(0,eN.useCurrentEditor)(),{contentDOMRef:a}=e;return n?(0,_.jsx)("span",{ref:i,children:(0,_.jsx)(tr,{editor:n,node:e.mark,contentDOMRef:a,children:t})}):null}e.s(["LinkView",0,to],889628);var ts=e.i(562931),tl=e.i(767730);let td=(0,tl.extendTiptapMark)(ts.default,"strike",{parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration=line-through",consuming:!1},{style:"text-decoration-line=line-through",consuming:!1}],addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}}});e.s(["Strike",0,td],415756);var tc=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/,tu=/(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g,tp=ei.Mark.create({name:"highlight",addOptions:()=>({multicolor:!1,HTMLAttributes:{}}),addAttributes(){return this.options.multicolor?{color:{default:null,parseHTML:e=>e.getAttribute("data-color")||e.style.backgroundColor,renderHTML:e=>e.color?{"data-color":e.color,style:`background-color: ${e.color}; color: inherit`}:{}}}:{}},parseHTML:()=>[{tag:"mark"}],renderHTML({HTMLAttributes:e}){return["mark",(0,ei.mergeAttributes)(this.options.HTMLAttributes,e),0]},renderMarkdown:(e,t)=>`==${t.renderChildren(e)}==`,parseMarkdown:(e,t)=>t.applyMark("highlight",t.parseInline(e.tokens||[])),markdownTokenizer:{name:"highlight",level:"inline",start:e=>e.indexOf("=="),tokenize(e,t,i){let n=/^(==)([^=]+)(==)/.exec(e);if(n){let e=n[2].trim(),t=i.inlineTokens(e);return{type:"highlight",raw:n[0],text:e,tokens:t}}}},addCommands(){return{setHighlight:e=>({commands:t})=>t.setMark(this.name,e),toggleHighlight:e=>({commands:t})=>t.toggleMark(this.name,e),unsetHighlight:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-h":()=>this.editor.commands.toggleHighlight()}},addInputRules(){return[(0,ei.markInputRule)({find:tc,type:this.type})]},addPasteRules(){return[(0,ei.markPasteRule)({find:tu,type:this.type})]}}),th=e.i(548402),tm=e.i(438106);let tg=(0,tl.extendTiptapMark)(tp,"highlight",{priority:tm.ExtensionPriorityMap.Highlight,excludes:"textColor highlight",addCommands(){return{...this.parent?.(),setHighlightColor:e=>({commands:t})=>t.setMark(this.name,{hex:e,variant:null})}},parseHTML:()=>[{tag:"mark[class=highlight]",getAttrs:e=>({variant:e.getAttribute("data-variant")||null,hex:e.getAttribute("data-hex")||null})},{tag:"mark[highlight-color]",getAttrs(e){let t=e.getAttribute("highlight-color");return!!t&&{hex:t}}}],renderHTML({HTMLAttributes:e,mark:t}){let i=t.attrs.hex&&(0,th.isColorDark)(t.attrs.hex),n=`var(${i?"--highlight-color-dark":"--highlight-color-light"})`,a=`var(${i?"--highlight-link-color-hover-dark":"--highlight-link-color-hover-light"})`,r=`--highlight-color: ${t.attrs.hex}; color: ${n}; --link-color: ${n}; --link-color-hover:${a}`;return["mark",(0,ei.mergeAttributes)(this.options.HTMLAttributes,e,{class:"highlight",style:r,"data-variant":t.attrs.variant||void 0,"data-hex":t.attrs.hex||void 0})]}}).configure({multicolor:!0});e.s(["Highlight",0,tg],742014);let tf=(0,tl.createTiptapMark)("textColor",{excludes:"highlight textColor",priority:tm.ExtensionPriorityMap.TextColor,addCommands(){return{setTextColor:e=>({commands:t})=>t.setMark(this.name,{hex:e,variant:null})}},parseHTML:()=>[{tag:"span[class=textColor]",getAttrs:e=>({variant:e.getAttribute("data-variant")||null,hex:e.getAttribute("data-hex")||null})},{tag:"span[text-color]",getAttrs(e){let t=e.getAttribute("text-color");return!!t&&{hex:t}}}],renderHTML:({HTMLAttributes:e,mark:t})=>["span",(0,ei.mergeAttributes)(e,{class:"textColor",style:t.attrs.hex?`--text-color: ${t.attrs.hex}`:void 0,"data-variant":t.attrs.variant||void 0,"data-hex":t.attrs.hex||void 0})]});e.s(["TextColor",0,tf],475463),e.s([],539262);let tb=()=>[ei.Extension.create({addCommands:()=>({selectAllText:ek.selectAllText})}),ex.Document.extend({content:"block+"}),ew.UndoRedo,eA.BlockClass,ep.Paragraph,ev.Text,eE.EmojiNode,ec.Heading.configure({HTMLAttributes:{class:eS.HEADING_CLASS}}),eI.HardBreak,e_.FontSize,ef.Bold,eC.Underline,ey.Italic,tf,tg,Z.HorizontalAlign,td,eM.Link.extend({excludes:"underline link",addProseMirrorPlugins(){return this.parent?.()??[]},renderHTML({HTMLAttributes:e}){let{href:t}=e;return["a",{...this.options.HTMLAttributes,href:t,class:"link"},0]}}).configure({openOnClick:!1}),eb.Code,ed.FormattingBubbleMenu,eE.EmojiShortcuts],tx=({isEditing:e,disableGradients:t,...i})=>{let n=(0,j.useMemo)(()=>tb(),[]),a=(0,j.useMemo)(()=>({paragraph:(0,el.gammaTiptapNodeView)({component:eh.ParagraphView,extension:ep.Paragraph}),heading:(0,el.gammaTiptapNodeView)({component:eu.HeadingView,extension:ec.Heading})}),[]),r=(0,j.useMemo)(()=>({link:to}),[]),o=(0,ee.useTiptapEditor)({extensions:n,parseOptions:{preserveWhitespace:"full"},...i,editable:!0,immediatelyRender:!0});return o.shouldUseLiteMenus=!0,(0,_.jsx)(Q.TiptapEditorView,{editor:o,nodeViewComponents:a,markViewComponents:r,static:!1,children:(0,_.jsxs)(eg.Box,{sx:{width:"100%"},className:t?eS.HEADING_NO_GRADIENT_CLASS:void 0,children:[(0,_.jsx)(ty,{editor:o,isEditing:e}),(0,_.jsx)(es.FormattingMenu,{editor:o,appendToSelector:"[data-tldraw-menu-root]"})]})})},ty=({editor:e,isEditing:t})=>((0,et.useTiptapEditorEffect)(e=>{t?e.commands.focus():e.commands.blur()},[t]),(0,_.jsx)(J.TiptapEditorContent,{style:{width:"100%"},className:"text",editor:e})),tv=ei.Extension.create({name:"smartDiagramKeyboard",addOptions:()=>({parentEditor:null}),addKeyboardShortcuts(){let{parentEditor:e}=this.options;return{"Mod-z":()=>e?.commands.undo(),"Mod-y":()=>e?.commands.redo()}}});function tC(e){let t=ed.FormattingBubbleMenuPluginKey.getState(e.state);if(t?.forceHide===!0)return!1;let i=e.state.selection;return i instanceof ea.TextSelection?!i.empty:t?.tippyInstance?.state.isVisible===!0||document.body.classList.contains("formatting-menu-open")}let tw=({className:e,selectItem:t,onChange:i,editable:n,parentEditor:a,direction:r="ltr",setIsTextMenuVisible:o,isTextMenuVisible:s,...l})=>{let[d,c]=(0,j.useState)(!1),u=(0,j.useMemo)(()=>[...tb(),...a?[tv.configure({parentEditor:a})]:[]],[a]),p=(0,j.useMemo)(()=>({paragraph:(0,el.gammaTiptapNodeView)({component:eh.ParagraphView,extension:ep.Paragraph}),heading:(0,el.gammaTiptapNodeView)({component:eu.HeadingView,extension:ec.Heading})}),[]),h=(0,em.useDebouncedWithRef)(i,500),m=(0,ee.useTiptapEditor)({extensions:u,...l,onUpdate({editor:e,transaction:t}){!t.docChanged||t.getMeta("history$")||h({editor:e})},onSelectionUpdate({editor:e}){let t=tC(e);o?.(t)},onBlur:({event:e})=>{c(!1),e.relatedTarget instanceof HTMLElement&&e.relatedTarget.closest("[data-active-menu]")||(m.commands.forceHideBubbleMenu(!0),setTimeout(()=>{o?.(!1)},0))},onFocus:()=>{m.commands.forceHideBubbleMenu(!1),c(!0),setTimeout(()=>{a&&a.state.selection instanceof en.GapCursor&&a.view.focus()},100)},immediatelyRender:!0});m.shouldUseLiteMenus=!0;let g=(0,eo.useShouldUsePublishedVersion)(),f=(0,er.useIsThumbnailView)();return(0,_.jsx)(Q.TiptapEditorView,{editor:m,static:g||f,nodeViewComponents:p,children:(0,_.jsx)(tS,{editor:m,isPublished:!!g,editable:n,hasFocus:d,isTextMenuVisible:s,setIsTextMenuVisible:o,content:l.content,selectItem:t,className:e,direction:r})})},tS=({className:e,direction:t="ltr",editor:i,isPublished:n,hasFocus:a,editable:r,selectItem:o,isTextMenuVisible:s,setIsTextMenuVisible:l,content:d})=>{(0,et.useTiptapEditorEffect)(e=>{void 0!==d&&e.getHTML()!==d&&e.commands.setContent(d,{emitUpdate:!1})},[d]),(0,et.useTiptapEditorEffect)(e=>{e.setEditable(!!r)},[r]);let c=ed.FormattingBubbleMenuPluginKey.getState((0,X.useEditorState)());(0,et.useTiptapEditorEffect)(e=>{let t=tC(e);l?.(t)},[c,l]),(0,et.useTiptapEditorEffect)(e=>{let t=tC(e);!1===s&&t&&e.commands.forceHideBubbleMenu&&e.commands.forceHideBubbleMenu(!0)},[s]);let u=(0,j.useRef)(null);return(0,j.useEffect)(()=>{let e=u.current?.closest(".smart-diagram-wrapper");if(!e)return;let t=e=>{e.target instanceof Element&&e.target.closest("[data-active-menu]")&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)},[]),n?(0,_.jsx)(J.TiptapEditorContent,{editor:i}):(0,_.jsxs)(L.Flex,{ref:u,dir:t,direction:"column",w:"100%",h:"100%",className:(0,G.cx)("smart-diagram-textbox",e),borderRadius:"var(--box-border-radius)",justifyContent:"center",alignItems:"center",onMouseDown:e=>{o(),e.stopPropagation()},style:{outlineColor:a?"var(--chakra-ring-color)":void 0,outlineWidth:a?"2px":void 0},children:[(0,_.jsx)(J.TiptapEditorContent,{editor:i}),(0,_.jsx)(Y.DarkModeProvider,{isDark:!1,children:(0,_.jsx)(es.FormattingMenu,{editor:i,appendToSelector:".smart-diagram-wrapper:focus-within"})})]})},tk=({x:e,y:t,width:i,height:n,style:a,...r})=>(0,_.jsx)("g",{style:a,children:(0,_.jsx)("foreignObject",{x:e,y:t,width:i,height:n,style:{overflow:"visible"},children:(0,_.jsx)(tA,{...r})})}),tA=({text:e,isEditable:t,onUpdate:i,horizontalAlignClass:n="center",verticalAlignClass:a="middle",textDirection:r="ltr",selectItem:o,parentEditor:s,isItemSelected:l,fontSize:d=`${q.BASE_FONT_SIZE}px`,setIsTextMenuVisible:c,isTextMenuVisible:u,...p})=>{let h=(0,K.getFlexAlign)(a),m=((e,t)=>{if("rtl"===t){if("left"===e)return"right";if("right"===e)return"left"}return e})(n,r),g={...(0,Z.getAlignStyles)(m,r),...(0,Z.getAlignStylesParent)(m,r),"--vertical-align":h},f=(0,j.useCallback)(({editor:e})=>{let t=e.state.doc.content;i((0,$.serializeFragmentToHtml)(t,e.schema))},[i]);return(0,_.jsx)(L.Flex,{direction:"column",w:"100%",h:"100%",css:g,justifyContent:"stretch",...p,className:(0,G.cx)(t?"is-editable":""),fontSize:d,style:{transform:"rtl"===r?"scaleX(-1)":void 0},children:(0,_.jsx)(tw,{content:e,onChange:f,className:p.className,editable:t,selectItem:o,isItemSelected:l,parentEditor:s,direction:r,setIsTextMenuVisible:c,isTextMenuVisible:u})})};var tE=e.i(304521),t_=e.i(962666),tI=e.i(194279),tM=e.i(233365),tT=e.i(686296);let tL=e=>{if(!e)return{x:void 0,y:void 0,width:void 0,height:void 0};let[t,i,n,a]=e.split(" ").map(parseFloat);return{x:t,y:i,width:n,height:a}},tj=e=>e instanceof SVGElement&&e.className&&"object"==typeof e.className?e.className.baseVal||"":e.className||"",tP=(e,t)=>[...new Set(Array.from(e.querySelectorAll(`[class*="${t}-"]`)).map(e=>{let i=tj(e).match(RegExp(`${t}-(\\d+)`));return i?parseInt(i[1]):0}).filter(e=>e>0))].sort((e,t)=>e-t),tD=(e,t,i,n,a,r,o,s,l)=>{let d;t.length&&(r&&!l&&(d=(0,t_.makeColorScale)(i,t,r,{lightnessRange:o,theme:s})),t.forEach(t=>{let r=`.${a}-${t}`,o=e.querySelector(r);if(o){let e=o.querySelectorAll(n),a=l?i:d?d.get(t):void 0;a?e.forEach(e=>{let t=tj(e),i=a;t.includes("light")?i=(0,th.lightenColor)(a,5):t.includes("dim")&&(i=(0,th.lightenColor)(a,-5)),e.style.setProperty("--shape-bg-color-override",i)}):e.forEach(e=>{e.style.getPropertyValue("--shape-bg-color-override")&&(e.style.removeProperty("--shape-bg-color-override"),0===e.style.length&&e.removeAttribute("style"))})}}))},tN=(e,t,i,n,a,r,o,s)=>{tD(e,t,i,n,"step",a,r,o,s)},tR=(e,t,i,n,a,r,o,s)=>{tD(e,t,i,n,"general",a,r,o,s)},tO=(e,t)=>{let i=100*(0,th.getColorLightness)(e);return(0,tT.isThemeDark)(t)?{min:Math.max(35,i-20),max:Math.min(85,i+25)}:{min:Math.max(25,i-20),max:Math.min(70,i+20)}},tB=({nodes:e,data:t,isEditable:i,updateData:n,defaultFontSize:a,viewBoxWidth:r,viewBoxHeight:o,selectItem:s,editor:l,isNodeSelected:d,selectedKeyPath:c,modifyingFns:u,direction:p="ltr",globalSelectionElements:h,globalInteractiveElements:m,globalImageElements:g,colors:f,globalClipPathDefs:b,isTextMenuVisible:x,setIsTextMenuVisible:y,theme:v})=>{let C=[],w=h||[],S=m||[],k=b||[],A=g||[];return(Array.from(e).forEach((e,h)=>{let m;if(e.nodeType!==Node.ELEMENT_NODE)return;let g=e.tagName.toLowerCase(),b=e.id,{stepNumber:E,generalNumber:I}=(0,M.parseClassNames)(e.classList);if("rect"===g&&e.classList.contains("selection"))return void w.push((0,V.createSelectionBox)({element:e,id:b,data:t,isEditable:i,updateData:n,selectItem:s,_isNodeSelected:d,selectedKeyPath:c,dataLookupInfo:{stepNumber:E,generalNumber:I,type:"selection"},modifyingFns:u,editor:l,isTextMenuVisible:x}));if("rect"===g&&e.classList.contains("textbox"))return void S.push((({element:e,id:t,data:i,isEditable:n,updateData:a,selectItem:r,dataLookupInfo:o,parentEditor:s,isNodeSelected:l,selectedKeyPath:d,direction:c="ltr",setIsTextMenuVisible:u,isTextMenuVisible:p})=>{let h,m,g=parseFloat(e.getAttribute("x")||"0"),f=parseFloat(e.getAttribute("y")||"0"),b=parseFloat(e.getAttribute("width")||"0"),x=parseFloat(e.getAttribute("height")||"0"),y=(0,H.getBaseClassnameForElement)(e),v=(h=e.classList).contains("right")?"right":h.contains("left")?"left":"center",C=(m=e.classList).contains("top")?"start":m.contains("bottom")?"end":"middle";if("text"!==o.type)return null;let w=(0,M.getDataForElement)(o,i),S=(0,M.getKeyPathForElement)(o),k=(0,M.hasEmphasizedSteps)(i),A=1;return k&&((0,M.isStepEmphasized)(o,i)||(A=.5)),(0,_.jsx)(tk,{id:t,x:g,y:f,width:b,height:x,text:w||"",isEditable:n,onUpdate:e=>{a(t=>(0,M.getUpdatedDataForElement)(o,t,e))},className:y,selectItem:()=>{r((0,M.getKeyPathForElement)({...o,type:"selection"}))},parentEditor:s,isItemSelected:l&&d===S,horizontalAlignClass:v,verticalAlignClass:C,textDirection:c,style:1!==A?{opacity:A}:void 0,setIsTextMenuVisible:u,isTextMenuVisible:p},S)})({element:e,id:b,data:t,isEditable:i,updateData:n,dataLookupInfo:{stepNumber:E,generalNumber:I,type:"text"},selectItem:s,isNodeSelected:d,selectedKeyPath:c,parentEditor:l,direction:p,setIsTextMenuVisible:y,isTextMenuVisible:x}));if("rect"===g&&(e=>{if("rect"!==e.tagName.toLowerCase())return!1;if(e.classList.contains("icon"))return!0;let t=e.getAttribute("width");return!(!t||isNaN(Number(t))||0>=Number(t))&&e.classList.contains("image")&&80>Number(t)})(e))return void S.push((0,W.createIconLabel)({element:e,id:b,data:t,isEditable:i,selectItem:s,dataLookupInfo:{stepNumber:E,generalNumber:I,type:"icon"},isNodeSelected:d,selectedKeyPath:c}).component);if(e.classList.contains("image")){let{component:n,clipPathDef:a}=(0,U.createImageElement)({element:e,id:b,data:t,isEditable:i,selectItem:s,dataLookupInfo:{stepNumber:E,generalNumber:I,type:"image"},isNodeSelected:d,selectedKeyPath:c,colors:f,direction:p});A.push(n),a&&k.push(a);return}let T=tB({nodes:e.childNodes,data:t,isEditable:i,updateData:n,defaultFontSize:a,viewBoxWidth:r,viewBoxHeight:o,selectItem:s,isNodeSelected:d,selectedKeyPath:c,editor:l,modifyingFns:u,direction:p,globalSelectionElements:w,globalInteractiveElements:S,globalClipPathDefs:k,globalImageElements:A,colors:f,isTextMenuVisible:x,setIsTextMenuVisible:y,theme:v}),L=(m={},Array.from(e.attributes).forEach(e=>{if("fill"===e.name)return;let t="class"===e.name?"className":e.name;["x","y","width","height","cx","cy","r","x1","y1","x2","y2","opacity","fill-opacity","stroke-width"].includes(e.name)?m[t]=parseFloat(e.value):("style"===e.name||"class"===e.name||e.name,m[t]=e.value)}),m);L.style=(e=>{if(!e)return{};let t={};return e.split(";").forEach(e=>{let[i,n]=e.split(":");t[i]=n}),t})(L.style),L=((e,t,i,n)=>{let a,r={...e};if((0,M.hasEmphasizedSteps)(t)&&(null!==i||null!==n)&&!(0,M.isStepEmphasized)({stepNumber:i,generalNumber:n,type:"selection"},t)){let t=1;r.style?.opacity&&(t=parseFloat(r.style.opacity.toString())),void 0!==e.opacity&&(t=parseFloat(e.opacity.toString())),void 0!==e.fillOpacity&&(t=parseFloat(e.fillOpacity.toString())),a=.5*t}return void 0!==a&&(r.style={...r.style,opacity:a},void 0===r.fillOpacity&&(r.fillOpacity=a),void 0===r.strokeOpacity&&(r.strokeOpacity=a)),r})(L=((e,t,i,n,a)=>{let r,o={...e},s=e.className||"",l=s.includes("accent")&&!s.includes("textbox")&&!s.includes("image")&&!s.includes("selection"),d=s.includes("subtle")&&!s.includes("textbox")&&!s.includes("image")&&!s.includes("selection");if((l||d)&&(null!==i&&t.step?.[i]?.color?r=(0,tM.getShapeColorCss)(t.step[i].color):null!==n&&t.general?.[n]?.color&&(r=(0,tM.getShapeColorCss)(t.general[n].color))),r){if(d){let e=(0,tT.isThemeDark)(a);r["--shape-bg-color-override"]=(0,th.lightenColor)(r["--shape-bg-color-override"],e?-20:30)}s.includes("light")?r["--shape-bg-color-override"]=(0,th.lightenColor)(r["--shape-bg-color-override"],5):s.includes("dim")&&(r["--shape-bg-color-override"]=(0,th.lightenColor)(r["--shape-bg-color-override"],-5)),o.style={...o.style,...r}}return o})(L,t,E,I,v),t,E,I);let P=(0,H.getBaseClassnameForElement)(e,p);P&&(L.className=P),i&&("circle"===g||"ellipse"===g||"rect"===g||"path"===g)&&("object"==typeof L.style?L.style={...L.style,pointerEvents:"none"}:L.style={pointerEvents:"none"}),C.push(j.default.createElement(g,{...L,key:`${g}-${b||h}`},T.length>0?T:void 0))}),h||m||g)?C:[...k.length>0?[(0,_.jsx)("defs",{children:k},"clipPathDefs")]:[],...C,...A,...w,...S]},tz=e=>{let{svgData:t,isEditable:i=!1,data:n={},updateData:a=()=>{},selectItem:r,editor:o,isNodeSelected:s,selectedKeyPath:l,templateKey:d,svgDirection:c,colors:u,isTextMenuVisible:p=!1,setIsTextMenuVisible:h,nonSteppedColors:m=!1}=e,g=(0,j.useMemo)(()=>{let e=(e=>{if(!e||"object"!=typeof e)return"";let t="",i=e=>{if(!e||"string"!=typeof e)return"";try{let t=new DOMParser().parseFromString(e,"text/html");return t.body.textContent||t.body.innerText||""}catch(e){return""}};return e.step&&Array.isArray(e.step)&&e.step.forEach(e=>{if(e?.text){let n=i(e.text);t+=" "+n}}),e.general&&Array.isArray(e.general)&&e.general.forEach(e=>{if(e?.text){let n=i(e.text);t+=" "+n}}),t.trim()})(n);if(e){let t=(0,D.getDirectionFromContent)(e);if(t)return t}return c||(0,N.getPreferredTextDirection)()},[n,c]),f=(0,j.useMemo)(()=>({addStep:e=>{a(()=>(0,M.addStepToData)(n,e))},removeStep:e=>{a(()=>(0,M.removeStepFromData)(n,e))},canAddStep:(0,M.canAddStepToData)(d,n),canRemoveStep:(0,M.canRemoveStepFromData)(d,n)}),[n,a,d]),b=(0,R.useAppSelector)(B.selectTheme),x=(0,P.useFeatureFlag)("useNewChartingColorSet"),y=(0,j.useMemo)(()=>t?(e=>{if(!e)return null;let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,i=t.getAttribute("viewBox")||void 0,{width:n,height:a}=tL(i);return{element:t,props:{viewBox:i,width:n,height:a,preserveAspectRatio:"xMidYMid meet",overflow:"visible"}}})(t):null,[t]),v=(0,j.useMemo)(()=>{if(!y)return null;let e=tB({nodes:(({svgElement:e,theme:t,colorScheme:i,useNewChartingColorSet:n=!1,nonSteppedColors:a=!1})=>{var r,o;let s,l=i&&(i in tI.CHART_COLORS_SCHEMES||i?.startsWith("monochrome-"))?i:void 0,d=(0,tT.getThemeColorSolid)((0,tT.getThemePrimaryAccentColor)(t)),c=(0,t_.resolveAccentColorForScheme)(d,i,t,n);l?.startsWith("monochrome")&&(r=c,o=t,s=(0,tE.default)(r).toHsl(),(0,tT.isThemeDark)(o)?s.l<.45?s.l=.55:s.l>.7&&(s.l=.6):s.l>.6?s.l=.48:s.l<.35&&(s.l=.42),c=(0,tE.default)(s).toHex8String());let u=(0,tT.getThemeShapeBlendedBackgroundColor)(t),p=tP(e,"step"),h=tP(e,"general"),m=".accent:not(.textbox):not(.image):not(.selection)",g=".subtle:not(.textbox):not(.image):not(.selection)",f=".background:not(.textbox):not(.image):not(.selection)",b=!a&&l?.startsWith("monochrome")?tO(c,t):void 0,x=!a&&l?.startsWith("monochrome")?tO(u,t):void 0;tN(e,p,c,m,l,b,t,a);let y=(0,tT.isThemeDark)(t),v=y?-20:30,C=b?{min:Math.max(15,b.min+(y?-10:15)),max:Math.min(85,b.max+(y?-10:15))}:void 0;return tN(e,p,(0,th.lightenColor)(c,v),g,l,C,t,a),tR(e,h,c,m,l,b,t,a),tR(e,h,(0,th.lightenColor)(c,v),g,l,C,t,a),tN(e,p,u,f,l,x,t,a),tR(e,h,u,f,l,x,t,a),e})({svgElement:y.element.cloneNode(!0),theme:b,colorScheme:n.colorScheme,useNewChartingColorSet:x,nonSteppedColors:m}).childNodes,data:n,isEditable:i,defaultFontSize:18,viewBoxWidth:y.props.width,viewBoxHeight:y.props.height,selectItem:r,updateData:a,editor:o,isNodeSelected:s,selectedKeyPath:l,modifyingFns:f,direction:g,colors:u,globalClipPathDefs:[],isTextMenuVisible:p,setIsTextMenuVisible:h,theme:b});return(0,_.jsxs)("svg",{...y.props,width:"100%",height:"auto",style:{maxWidth:"100%",display:"block",...y.props.style,transform:"rtl"===g?"scaleX(-1)":void 0},children:[i&&(0,_.jsx)(z.FocusAbsorber,{}),e,i&&(0,_.jsx)(z.FocusAbsorber,{})]})},[y,b,n,i,r,a,o,s,l,f,g,u,p,h,x,m]),C=(0,O.useShouldRenderMobileVersion)(),w=(0,j.useMemo)(()=>y?.props.viewBox?((e,t=1,i)=>{let n=tL(e);return n?.height&&n.width&&!i?Math.min(n.width/1e3*t*100,100):100})(y.props.viewBox,e.svgScalingFactor||1,C):100,[y?.props.viewBox,e.svgScalingFactor,C]);return(0,_.jsx)(F.ResizeableWrapper,{svgWidthPercent:w,...e,children:(0,_.jsx)(L.Flex,{w:"100%",position:"relative",children:t&&(0,_.jsx)(L.Flex,{w:"100%",h:"100%",children:v})})})},tF={src:e.i(364122).default,width:253,height:96,blurWidth:0,blurHeight:0},tH=new Map(Object.entries({arrow_bars_1:` `,arrow_bars_2:` `,arrow_bars_3:` `,arrow_bars_4:` `}).map(([e,t])=>[Number(e.replace("arrow_bars_","")),t])),tW="arrow_bars",tU={key:tW,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,4),n=tH.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:tW,svgScalingFactor:tU.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"Yxcx0I",message:"Arrow bars"}),icon:s.faArrowRight,defaultColorScheme:"monochrome",stepSvgData:tH,previewImage:tF,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(tH),svgScalingFactor:1},tV={src:e.i(61278).default,width:253,height:96,blurWidth:0,blurHeight:0},tG=new Map(Object.entries({bubbles_1:` `,bubbles_2:` `,bubbles_3:` `,bubbles_4:` `,bubbles_5:` `}).map(([e,t])=>[Number(e.replace("bubbles_","")),t])),t$="bubble_steps",tZ={key:t$,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,1,5),n=tG.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:t$,svgScalingFactor:tZ.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"9v8/rg",message:"Bubbles"}),previewImage:tV,allowedColorSchemes:[],stepSvgData:tG,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(tG),svgScalingFactor:1},tK={src:e.i(875862).default,width:253,height:96,blurWidth:0,blurHeight:0},tq=new Map(Object.entries({bullseye_4:` `,bullseye_1:` `,bullseye_2:` `,bullseye_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),tY="bullseye",tX={key:tY,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,4),n=tq.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:tY,svgScalingFactor:tX.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"EV9YnT",message:"Bullseye"}),icon:o.faBullseye,previewImage:tK,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],stepSvgData:tq,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(tq),svgScalingFactor:1},tQ={src:e.i(550736).default,width:253,height:96,blurWidth:0,blurHeight:0},tJ=new Map(Object.entries({concentric_circles_2:` `,concentric_circles_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),t0="concentric_circles",t1={key:t0,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??2,2,3),n=tJ.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:t0,svgScalingFactor:t1.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"FafLHV",message:"Concentric circles"}),previewImage:tQ,icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:tJ,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(tJ),svgScalingFactor:1},t2={src:e.i(80683).default,width:253,height:96,blurWidth:0,blurHeight:0},t3=new Map(Object.entries({connected_circles_2:` `,connected_circles_3:` `,connected_circles_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),t5="connected_circles",t4={key:t5,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=t3.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:t5,svgScalingFactor:t4.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"f1/9Zk",message:"Connected circles"}),icon:s.faCircle,previewImage:t2,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:t3,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(t3),svgScalingFactor:1},t6={src:e.i(827367).default,width:253,height:96,blurWidth:0,blurHeight:0},t9=new Map(Object.entries({diamonds_2:` `,diamonds_3:` `,diamonds_4:` `,diamonds_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),t8="diamonds",t7={key:t8,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,5),n=t9.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:t8,svgScalingFactor:t7.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"kCK0aH",message:"Diamonds"}),icon:s.faDiamond,previewImage:t6,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:t9,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(t9),svgScalingFactor:1},ie={src:e.i(604697).default,width:253,height:96,blurWidth:0,blurHeight:0},it=new Map(Object.entries({funnel_3d_1:` `,funnel_3d_2:` `,funnel_3d_3:` `,funnel_3d_4:` `,funnel_3d_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),ii="funnel_3d",ia={key:ii,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,1,5),n=it.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:ii,svgScalingFactor:ia.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"D+va93",message:"Funnel 3d"}),previewImage:ie,icon:s.faTriangle,defaultColorScheme:null,stepSvgData:it,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(it),svgScalingFactor:1},ir={src:e.i(617604).default,width:253,height:96,blurWidth:0,blurHeight:0},io=new Map(Object.entries({gears_2:` `,gears_3:` `,gears_4:` `,gears_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),is="gears",il={key:is,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,2,5),n=io.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:is,svgScalingFactor:il.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"LSGGaF",message:"Gears"}),previewImage:ir,icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:io,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(io),svgScalingFactor:1},id={src:e.i(748971).default,width:253,height:96,blurWidth:0,blurHeight:0},ic=new Map(Object.entries({hot_air_balloons_1:` `,hot_air_balloons_2:` `,hot_air_balloons_3:` `,hot_air_balloons_4:` `}).map(([e,t])=>[Number(e.replace("hot_air_balloons_","")),t])),iu="hot_air_balloons",ip={key:iu,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,4),n=ic.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iu,svgScalingFactor:ip.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"5Ds1yY",message:"Hot air balloons"}),icon:s.faBalloons,previewImage:id,defaultColorScheme:"monochrome",stepSvgData:ic,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ic),svgScalingFactor:1},ih={src:e.i(56078).default,width:253,height:96,blurWidth:0,blurHeight:0},im=new Map(Object.entries({iceberg_icons_1:` `,iceberg_icons_2:` `,iceberg_icons_3:` `,iceberg_icons_4:` `,iceberg_icons_5:` `}).map(([e,t])=>[Number(e.replace("iceberg_icons_","")),t])),ig=new Map(Object.entries({iceberg_1:` `,iceberg_2:` `,iceberg_3:` `,iceberg_4:` `,iceberg_5:` `}).map(([e,t])=>[Number(e.replace("iceberg_","")),t])),ib="iceberg",ix={key:ib,Component:e=>{let{data:t,showIcons:i}=e,n=(0,I.default)(t.step?.length??5,1,5),a=(i?im:ig).get(n);return a?(0,_.jsx)(tz,{svgData:a,templateKey:ib,svgScalingFactor:ix.svgScalingFactor,...e}):(console.error("No SVG data found for key",n),null)},label:()=>l.i18n._({id:"bxoNRj",message:"Iceberg"}),icon:s.faIcicles,previewImage:ih,defaultColorScheme:"monochrome",stepSvgData:im,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(im),svgScalingFactor:1,canToggleIcons:!0},iy={src:e.i(973417).default,width:253,height:96,blurWidth:0,blurHeight:0},iv=new Map(Object.entries({ideas_1:` `,ideas_2:` `,ideas_3:` `,ideas_4:` `}).map(([e,t])=>[Number(e.replace("ideas_","")),t])),iC="ideas",iw={key:iC,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,1,4),n=iv.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iC,svgScalingFactor:iw.svgScalingFactor,nonSteppedColors:iw.nonSteppedColors,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"zaDZll",message:"Ideas"}),icon:o.faLightbulb,previewImage:iy,stepSvgData:iv,defaultData:()=>(0,M.getDefaultDataForTemplate)(iv),formattingMenu:T.ComposableSVGDiagramFormattingMenu,svgScalingFactor:1,nonSteppedColors:!0},iS={src:e.i(157628).default,width:253,height:96,blurWidth:0,blurHeight:0},ik=new Map(Object.entries({infinity_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iA="infinity",iE={key:iA,Component:e=>{let t=(0,I.default)(e.data.step?.length??4,4,4),i=ik.get(t);return i?(0,_.jsx)(tz,{svgData:i,templateKey:iA,svgScalingFactor:iE.svgScalingFactor,...e}):(console.error("No SVG data found for key",t),null)},label:()=>l.i18n._({id:"5o9DHo",message:"Infinity"}),icon:o.faInfinity,previewImage:iS,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],formattingMenu:T.ComposableSVGDiagramFormattingMenu,stepSvgData:ik,defaultData:()=>(0,M.getDefaultDataForTemplate)(ik),svgScalingFactor:1},i_={src:e.i(319304).default,width:253,height:96,blurWidth:0,blurHeight:0},iI=new Map(Object.entries({inputs_1:` `,inputs_2:` `,inputs_3:` `,inputs_4:` `,inputs_5:` `,inputs_6:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iM="inputs",iT={key:iM,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,6),n=iI.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iM,svgScalingFactor:iT.svgScalingFactor,nonSteppedColors:iT.nonSteppedColors,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"h8Oe96",message:"Inputs"}),previewImage:i_,allowedColorSchemes:[],stepSvgData:iI,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iI),nonSteppedColors:!0},iL={src:e.i(889400).default,width:253,height:96,blurWidth:0,blurHeight:0},ij=new Map(Object.entries({isometric_building_2:` `,isometric_building_3:` `,isometric_building_4:` `,isometric_building_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iP="isometric_building",iD={key:iP,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,2,5),n=ij.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iP,svgScalingFactor:iD.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"uYVHtp",message:"Isometric building"}),previewImage:iL,icon:s.faSquare,defaultColorScheme:"monochrome",stepSvgData:ij,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ij),svgScalingFactor:1},iN={src:e.i(982803).default,width:253,height:96,blurWidth:0,blurHeight:0},iR=new Map(Object.entries({isometric_dashed_squares_2:` `,isometric_dashed_squares_3:` `,isometric_dashed_squares_4:` `,isometric_dashed_squares_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iO="isometric_dashed_squares",iB={key:iO,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,2,5),n=iR.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iO,svgScalingFactor:iB.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"dzV3Pu",message:"Isometric dashed squares"}),previewImage:iN,icon:s.faSquare,defaultColorScheme:"monochrome",stepSvgData:iR,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iR),svgScalingFactor:1},iz={src:e.i(874166).default,width:253,height:96,blurWidth:0,blurHeight:0},iF=new Map(Object.entries({isometric_globe_2:` `,isometric_globe_3:` `,isometric_globe_4:` `,isometric_globe_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iH="isometric_globe",iW={key:iH,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,2,5),n=iF.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iH,svgScalingFactor:iW.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"emdrzk",message:"Isometric globe"}),previewImage:iz,icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:iF,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iF),svgScalingFactor:1},iU={src:e.i(252299).default,width:253,height:96,blurWidth:0,blurHeight:0},iV=new Map(Object.entries({linear_venn_2:` `,linear_venn_3:` `,linear_venn_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iG="linear_venn",i$={key:iG,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=iV.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iG,svgScalingFactor:i$.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"Fmu+gx",message:"Linear venn"}),icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:iV,featureFlag:"diagramsOct25",previewImage:iU,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iV),svgScalingFactor:1},iZ={src:e.i(992471).default,width:253,height:96,blurWidth:0,blurHeight:0},iK=new Map(Object.entries({linear_venn_filled_2:` `,linear_venn_filled_3:` `,linear_venn_filled_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iq="linear_venn_filled",iY={key:iq,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=iK.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iq,svgScalingFactor:iY.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"1J3mCd",message:"Linear venn filled"}),icon:s.faCircle,previewImage:iZ,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:iK,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iK),svgScalingFactor:1},iX={src:e.i(499601).default,width:253,height:96,blurWidth:0,blurHeight:0},iQ=new Map(Object.entries({go_funnel_2:` `,go_funnel_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),iJ="minimal_funnel",i0={key:iJ,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??2,2,3),n=iQ.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:iJ,svgScalingFactor:i0.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"rT9CpO",message:"Minimal funnel"}),icon:s.faArrowRight,previewImage:iX,featureFlag:"diagramsOct25",defaultColorScheme:void 0,stepSvgData:iQ,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(iQ),svgScalingFactor:1},i1={src:e.i(568884).default,width:253,height:96,blurWidth:0,blurHeight:0},i2=new Map(Object.entries({minimal_road_2:` `,minimal_road_3:` `,minimal_road_4:` `,minimal_road_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),i3="minimal_road",i5={key:i3,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,5),n=i2.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:i3,svgScalingFactor:i5.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"5iD6IZ",message:"Minimal road"}),icon:s.faArrowRight,previewImage:i1,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:i2,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(i2),svgScalingFactor:1},i4={src:e.i(437196).default,width:253,height:96,blurWidth:0,blurHeight:0},i6=new Map(Object.entries({nested_diamond_4:` `,nested_diamond_2:` `,nested_diamond_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),i9="nested_diamond",i8={key:i9,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=i6.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:i9,svgScalingFactor:i8.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"C5zvEL",message:"Nested diamond"}),icon:s.faDiamond,previewImage:i4,allowedColorSchemes:[],stepSvgData:i6,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(i6),defaultColorScheme:"monochrome",svgScalingFactor:1},i7={src:e.i(620312).default,width:253,height:96,blurWidth:0,blurHeight:0},ne=new Map(Object.entries({orbit_2:` `,orbit_3:` `,orbit_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nt="orbit",ni={key:nt,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=ne.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nt,svgScalingFactor:ni.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"MUIdbW",message:"Orbit"}),previewImage:i7,icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:ne,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ne),svgScalingFactor:1},nn={src:e.i(673407).default,width:253,height:96,blurWidth:0,blurHeight:0},na=new Map(Object.entries({orbit_fill_2:` `,orbit_fill_3:` `,orbit_fill_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nr="orbit_fill",no={key:nr,Component:e=>{let{data:t}=e,i=t.step?.length??3,n=na.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nr,svgScalingFactor:no.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"smgT7J",message:"Orbit fill"}),icon:s.faCircle,previewImage:nn,featureFlag:"orbitFill",defaultColorScheme:"monochrome",stepSvgData:na,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(na),svgScalingFactor:1},ns={src:e.i(808727).default,width:253,height:96,blurWidth:0,blurHeight:0},nl=new Map(Object.entries({packed_circles_1:` `,packed_circles_2:` `,packed_circles_3:` `,packed_circles_4:` `,packed_circles_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nd="packed_circles",nc={key:nd,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,1,5),n=nl.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nd,svgScalingFactor:nc.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"QhL7JY",message:"Packed circles"}),icon:s.faCircle,defaultColorScheme:"monochrome",stepSvgData:nl,previewImage:ns,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nl),svgScalingFactor:1},nu={src:e.i(167557).default,width:253,height:96,blurWidth:0,blurHeight:0},np=new Map(Object.entries({pillar_3:` `,pillar_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nh="pillar",nm={key:nh,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,3,4),n=np.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nh,svgScalingFactor:nm.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"Vs8/ai",message:"Pillar"}),previewImage:nu,icon:s.faSquare,defaultColorScheme:"monochrome",stepSvgData:np,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(np),svgScalingFactor:1},ng={src:e.i(460022).default,width:253,height:96,blurWidth:0,blurHeight:0},nf=new Map(Object.entries({pinwheel_4:` `}).map(([e,t])=>[Number(e.replace("pinwheel_","")),t])),nb="pinwheel",nx={key:nb,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,4,4),n=nf.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nb,svgScalingFactor:nx.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"MVp6kM",message:"Pinwheel"}),icon:s.faFerrisWheel,previewImage:ng,defaultColorScheme:"monochrome",stepSvgData:nf,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nf),svgScalingFactor:1},ny={src:e.i(647187).default,width:253,height:96,blurWidth:0,blurHeight:0},nv=new Map([[4,` `]]),nC="puzzle",nw={key:nC,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,4,4),n=nv.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nC,svgScalingFactor:nw.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"nT0180",message:"Puzzle"}),icon:o.faPuzzle,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],previewImage:ny,formattingMenu:T.ComposableSVGDiagramFormattingMenu,stepSvgData:nv,defaultData:()=>(0,M.getDefaultDataForTemplate)(nv),svgScalingFactor:1},nS={src:e.i(288711).default,width:253,height:96,blurWidth:0,blurHeight:0},nk=new Map([[1,` `]]),nA="quadrants",nE={key:nA,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,1,1),n=nk.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nA,svgScalingFactor:nE.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"o/Eq9R",message:"Quadrant"}),icon:o.faSquare,previewImage:nS,stepSvgData:nk,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nk),svgScalingFactor:1},n_={src:e.i(494280).default,width:253,height:96,blurWidth:0,blurHeight:0},nI=new Map(Object.entries({ribbon_arrows_2:` `,ribbon_arrows_3:` `,ribbon_arrows_4:` `,ribbon_arrows_5:` `}).map(([e,t])=>[Number(e.replace("ribbon_arrows_","")),t])),nM="ribbon_arrows",nT={key:nM,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,5),n=nI.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nM,svgScalingFactor:nT.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"aBHvyl",message:"Ribbon arrows"}),previewImage:n_,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],formattingMenu:T.ComposableSVGDiagramFormattingMenu,stepSvgData:nI,defaultData:()=>(0,M.getDefaultDataForTemplate)(nI),svgScalingFactor:1},nL={src:e.i(798352).default,width:253,height:96,blurWidth:0,blurHeight:0},nj=new Map(Object.entries({rings_1:` `,rings_2:` `,rings_3:` `,rings_4:` `,rings_5:` `,rings_6:` `}).map(([e,t])=>[Number(e.replace("rings_","")),t])),nP="rings",nD={key:nP,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,1,6),n=nj.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nP,svgScalingFactor:nD.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"ZoIl0W",message:"Chain"}),icon:o.faLink,previewImage:nL,defaultColorScheme:"alternating",allowedColorSchemes:["alternating"],stepSvgData:nj,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nj),svgScalingFactor:1},nN={src:e.i(940613).default,width:253,height:96,blurWidth:0,blurHeight:0},nR=new Map(Object.entries({road_2:` `,road_3:` `,road_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nO="road",nB={key:nO,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=nR.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nO,svgScalingFactor:nB.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"LL9rkd",message:"Road"}),previewImage:nN,icon:s.faArrowRight,defaultColorScheme:null,stepSvgData:nR,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nR),svgScalingFactor:1},nz={src:e.i(692139).default,width:253,height:96,blurWidth:0,blurHeight:0},nF=new Map(Object.entries({semi_circle_road_2:` `,semi_circle_road_3:` `,semi_circle_road_4:` `,semi_circle_road_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nH="semi_circle_road",nW={key:nH,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,5),n=nF.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nH,svgScalingFactor:nW.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"2iU2Gr",message:"Semi circle road"}),icon:s.faArrowRight,previewImage:nz,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:nF,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nF),svgScalingFactor:1},nU={src:e.i(708159).default,width:253,height:96,blurWidth:0,blurHeight:0},nV=new Map(Object.entries({signs_1:` `,signs_2:` `,signs_3:` `,signs_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nG="signs",n$={key:nG,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,4),n=nV.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nG,svgScalingFactor:n$.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"SOssfV",message:"Signs"}),icon:s.faArrowRight,defaultColorScheme:"monochrome",stepSvgData:nV,previewImage:nU,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nV),svgScalingFactor:1},nZ={src:e.i(723328).default,width:253,height:96,blurWidth:0,blurHeight:0},nK=new Map(Object.entries({slope_2:` `,slope_3:` `,slope_4:` `,slope_5:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nq="slope",nY={key:nq,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??5,2,5),n=nK.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nq,svgScalingFactor:nY.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"ppRU+y",message:"Slope"}),icon:s.faUpRight,defaultColorScheme:"monochrome",stepSvgData:nK,previewImage:nZ,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nK),svgScalingFactor:1},nX={src:e.i(304078).default,width:253,height:96,blurWidth:0,blurHeight:0},nQ=new Map(Object.entries({solar_system_2:` `,solar_system_3:` `,solar_system_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),nJ="solar_system",n0={key:nJ,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=nQ.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:nJ,svgScalingFactor:n0.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"y1okDF",message:"Solar system"}),previewImage:nX,icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:nQ,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(nQ),svgScalingFactor:1},n1={src:e.i(547760).default,width:253,height:96,blurWidth:0,blurHeight:0},n2=new Map(Object.entries({square_cycle_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),n3="square_arrows",n5={key:n3,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,4,4),n=n2.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:n3,svgScalingFactor:n5.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"Rnzk97",message:"Square arrows"}),previewImage:n1,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],formattingMenu:T.ComposableSVGDiagramFormattingMenu,stepSvgData:n2,defaultData:()=>(0,M.getDefaultDataForTemplate)(n2),svgScalingFactor:1},n4={src:e.i(740406).default,width:253,height:96,blurWidth:0,blurHeight:0},n6=new Map(Object.entries({swoosh_1:` `,swoosh_2:` `,swoosh_3:` `,swoosh_4:` `}).map(([e,t])=>[Number(e.replace("swoosh_","")),t])),n9="swoosh",n8={key:n9,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,1,4),n=n6.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:n9,svgScalingFactor:n8.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"ba37aB",message:"Swoosh"}),previewImage:n4,defaultColorScheme:"monochrome",allowedColorSchemes:["monochrome"],stepSvgData:n6,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(n6),svgScalingFactor:1},n7={src:e.i(692695).default,width:253,height:96,blurWidth:0,blurHeight:0},ae=new Map(Object.entries({target_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),at="target",ai={key:at,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,4,4),n=ae.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:at,svgScalingFactor:ai.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"3vVgzt",message:"Target"}),icon:s.faCircle,previewImage:n7,featureFlag:"diagramsOct25",defaultColorScheme:"monochrome",stepSvgData:ae,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ae),svgScalingFactor:1},an={src:e.i(797092).default,width:253,height:96,blurWidth:0,blurHeight:0},aa=new Map(Object.entries({text_box_collage_1:` `,text_box_collage_2:` `,text_box_collage_3:` `,text_box_collage_4:` `,text_box_collage_5:` `,text_box_collage_6:` `,text_box_collage_7:` `,text_box_collage_8:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),ar="text_box_collage",ao={key:ar,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??8,1,8),n=aa.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:ar,svgScalingFactor:ao.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"xGS01X",message:"Text box collage"}),previewImage:an,icon:s.faSquare,defaultColorScheme:null,stepSvgData:aa,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aa),svgScalingFactor:1,disabled:!0},as={src:e.i(826876).default,width:253,height:96,blurWidth:0,blurHeight:0},al=new Map(Object.entries({versus_2:` `,versus_3:` `,versus_4:` `,versus_5:` `,versus_6:` `}).map(([e,t])=>[Number(e.replace("versus_","")),t])),ad="versus",ac={key:ad,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??6,2,6),n=al.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:ad,svgScalingFactor:ac.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"HHQOYx",message:"Versus"}),icon:o.faArrowsLeftRight,previewImage:as,formattingMenu:T.ComposableSVGDiagramFormattingMenu,stepSvgData:al,defaultData:()=>(0,M.getDefaultDataForTemplate)(al),svgScalingFactor:1},au={src:e.i(575932).default,width:253,height:96,blurWidth:0,blurHeight:0},ap=new Map(Object.entries({accent_circle_1:` `,accent_circle_2:` `,accent_circle_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),ah="accent_circle",am={key:ah,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,1,3),n=ap.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:ah,svgScalingFactor:am.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"8TjL5n",message:"Accent circle"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:ap,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ap),svgScalingFactor:1,previewImage:au,featureFlag:"imagesInDiagrams"},ag={src:e.i(785808).default,width:253,height:96,blurWidth:0,blurHeight:0},af=new Map(Object.entries({circle_hero_pic_4:` `,circle_hero_pic_2:` `,circle_hero_pic_3:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),ab="circle_hero_pic",ax={key:ab,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,1,4),n=af.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:ab,svgScalingFactor:ax.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"VqSfhV",message:"Circle hero"}),icon:s.faQuestion,defaultColorScheme:null,stepSvgData:af,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(af),svgScalingFactor:1,previewImage:ag},ay={src:e.i(969361).default,width:253,height:96,blurWidth:0,blurHeight:0},av=new Map(Object.entries({circle_post_it_2:` `,circle_post_it_3:` `,circle_post_it_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aC="circle_post_it",aw={key:aC,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??3,2,4),n=av.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aC,svgScalingFactor:aw.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"cnAxpj",message:"Note collage"}),icon:s.faQuestion,defaultColorScheme:null,stepSvgData:av,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(av),svgScalingFactor:1,previewImage:ay},aS={src:e.i(321346).default,width:253,height:96,blurWidth:0,blurHeight:0},ak=new Map(Object.entries({image_arc_1:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aA="image_arc",aE={key:aA,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,1,1),n=ak.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aA,svgScalingFactor:aE.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"vH25CK",message:"Image arc"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:ak,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(ak),svgScalingFactor:1,previewImage:aS},a_={src:e.i(778774).default,width:253,height:96,blurWidth:0,blurHeight:0},aI=new Map(Object.entries({leaf_image_2:` `,leaf_image_3:` `,leaf_image_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aM="leaf_image",aT={key:aM,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,2,4),n=aI.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aM,svgScalingFactor:aT.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"oLKWsK",message:"Leaf"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aI,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aI),svgScalingFactor:1,previewImage:a_},aL={src:e.i(615715).default,width:253,height:96,blurWidth:0,blurHeight:0},aj=new Map(Object.entries({left_rounded_edge_rect_image_2:` `,left_rounded_edge_rect_image_3:` `,left_rounded_edge_rect_image_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aP="left_rounded_edge_rect_image",aD={key:aP,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,2,4),n=aj.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aP,svgScalingFactor:aD.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"4EqxuM",message:"Arch"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aj,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aj),svgScalingFactor:1,previewImage:aL},aN={src:e.i(561714).default,width:253,height:96,blurWidth:0,blurHeight:0},aR=new Map(Object.entries({oval_stroke_image_2:` `,oval_stroke_image_3:` `,oval_stroke_image_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aO="oval_stroke_image",aB={key:aO,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,2,4),n=aR.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aO,svgScalingFactor:aB.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"zq+ouO",message:"Oval"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aR,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aR),svgScalingFactor:1,previewImage:aN},az={src:e.i(277132).default,width:253,height:96,blurWidth:0,blurHeight:0},aF=new Map(Object.entries({round_rect_and_square_image_2:` `,round_rect_and_square_image_3:` `,round_rect_and_square_image_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aH="round_rect_and_square_image",aW={key:aH,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??1,2,4),n=aF.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aH,svgScalingFactor:aW.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"oeHMAR",message:"Impact"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aF,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aF),svgScalingFactor:1,previewImage:az},aU={src:e.i(590865).default,width:253,height:96,blurWidth:0,blurHeight:0},aV=new Map(Object.entries({semi_circle_1:` `,semi_circle_2:` `,semi_circle_3:` `,semi_circle_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aG="semi_circle",a$={key:aG,Component:e=>{let{data:t}=e,i=(0,I.default)(t.step?.length??4,1,4),n=aV.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aG,svgScalingFactor:a$.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"dwGAFh",message:"Semi circle"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aV,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aV),svgScalingFactor:1,previewImage:aU},aZ=new Map(Object.entries({pillar_layout_4:` `}).map(([e,t])=>{let i=e.match(/_([0-9]+)$/);return[i?Number(i[1]):1,t]})),aK="pillar_layout",aq={key:aK,Component:e=>{let{data:t}=e,i=t.step?.length??4,n=aZ.get(i);return n?(0,_.jsx)(tz,{svgData:n,templateKey:aK,svgScalingFactor:aq.svgScalingFactor,...e}):(console.error("No SVG data found for key",i),null)},label:()=>l.i18n._({id:"h1icb8",message:"Pillar layout"}),icon:s.faQuestion,defaultColorScheme:"monochrome",stepSvgData:aZ,formattingMenu:T.ComposableSVGDiagramFormattingMenu,defaultData:()=>(0,M.getDefaultDataForTemplate)(aZ),svgScalingFactor:1,featureFlag:"heroSmartLayouts"};var aY=e.i(754851),aX=e.i(131363),aQ=e.i(666916);let aJ=.9*q.BASE_FONT_SIZE,a0=({index:e,totalSegments:t,label:i,icon:n,color:a,updateLabel:r,selectItem:o,isEditable:s,isNodeSelected:l,selectedKeyPath:d,editor:c,x:u,segmentLength:p})=>{var h;let m,g,f,b,x=100/t,y=40+x*(e+1),{path:v,iconCenterX:C}=(h=40+x*e,m=p/2,g=.35*h,f=-m,b=-h,{path:`M ${f},${b} L ${m},${-y} A ${.35*y},${y} 0 0,0 ${m},${y} L ${f},${h} A ${g},${h} 0 0,1 ${f},${b} Z`,iconCenterX:-g}),w=(0,tM.getShapeColorCss)(a);return(0,_.jsxs)("g",{style:w,children:[(0,_.jsx)("ellipse",{cx:u+p/2,cy:140,rx:.35*y,ry:y,className:(0,G.cx)(aY.SVG_SHAPE_FILL_CLASS,aY.SVG_SHAPE_BACKGROUND_CLASS),style:{opacity:.5}}),(0,_.jsx)("g",{transform:`translate(${u}, 140)`,children:(0,_.jsx)("path",{d:v,className:aY.SVG_SHAPE_BACKGROUND_CLASS})}),(0,_.jsx)(aX.SvgIconLabel,{x:u+C-22.5,y:117.5,width:45,height:45,image:n,isEditable:s,selectItem:()=>o(`segments[${e}].icon`),isItemSelected:l&&d===`segments[${e}].icon`}),(0,_.jsx)(tk,{x:u,transform:"translateX(-50%)",y:140+y+20,width:p+40,height:550-(140+y+20),fontSize:aJ,text:i,isEditable:s,onUpdate:r,selectItem:()=>o(`segments[${e}].label`),parentEditor:c,isItemSelected:l&&d===`segments[${e}].label`,verticalAlign:"start"})]})},a1={key:"funnelDiagram",Component:({data:e,updateData:t,selectItem:i,isEditable:n,editor:a,isNodeSelected:r,selectedKeyPath:o,...s})=>{let l,{segments:d}=e,c=(0,R.useAppSelector)(B.selectTheme),u=(0,P.useFeatureFlag)("useNewChartingColorSet"),p=(0,tT.getThemeColorSolid)((0,tT.getThemePrimaryAccentColor)(c)),h=(0,t_.resolveAccentColorForScheme)(p,e.colorScheme,c,u),m=Array.from({length:d.length},(e,t)=>t);e.colorScheme&&(l=(0,t_.makeColorScale)(h,m,e.colorScheme,{theme:c}));let g=(937-40*(d.length-1))/d.length,f=g/2+14;return(0,_.jsx)(F.ResizeableWrapper,{...s,data:e,updateData:t,selectItem:i,isEditable:n,editor:a,isNodeSelected:r,selectedKeyPath:o,children:(0,_.jsx)("svg",{viewBox:"0 0 1000 550",preserveAspectRatio:"xMidYMid meet",overflow:"visible",children:d.map((e,s)=>(0,_.jsx)(a0,{index:s,totalSegments:d.length,label:e.label,icon:e.icon,color:e.color||l?.get(s),isEditable:n,selectItem:i,isNodeSelected:r,selectedKeyPath:o,editor:a,x:f+s*(g+40),segmentLength:g,updateLabel:e=>t(t=>(t.segments[s].label=e,t))},s))})})},label:()=>l.i18n._({id:"MWYJBI",message:"Funnel"}),icon:s.faFilterList,formattingMenu:aQ.SmartDiagramFormattingMenu,disabled:!0},a2=425,a3=535,a5=555,a4=q.BASE_FONT_SIZE,a6=500-a2/2,a9=({x:e,color:t,icon:i,label:n,updateLabel:a,selectItem:r,isEditable:o,isNodeSelected:s,selectedKeyPath:l,editor:d,index:c})=>{let u=(0,tM.getShapeColorCss)(t);return(0,_.jsxs)("g",{transform:`translate(${e}, 0)`,style:u,children:[(0,_.jsx)("rect",{x:12.5,y:205,width:140,height:330,className:aY.SVG_SHAPE_BACKGROUND_CLASS}),(0,_.jsx)("rect",{x:0,y:205,width:165,height:20,rx:5,ry:5,className:aY.SVG_SHAPE_BACKGROUND_CLASS}),(0,_.jsx)("rect",{x:0,y:a3-20,width:165,height:20,rx:5,ry:5,className:aY.SVG_SHAPE_BACKGROUND_CLASS}),(0,_.jsx)(aX.SvgIconLabel,{x:57.5,y:345,width:50,height:50,image:i,isEditable:o,selectItem:()=>r(`pillars[${c}].icon`),isItemSelected:s&&l===`pillars[${c}].icon`}),(0,_.jsx)(tk,{x:82.5,y:a5,width:214.5,transform:"translateX(-50%)",height:80,fontSize:a4,text:n,isEditable:o,onUpdate:a,selectItem:()=>r(`pillars[${c}].label`),parentEditor:d,isItemSelected:s&&l===`pillars[${c}].label`,verticalAlign:"start"})]})},a8={key:"pillars",Component:({data:e,updateData:t,isEditable:i,selectItem:n,editor:a,isNodeSelected:r,selectedKeyPath:o,...s})=>{let{title:l,pillars:d}=e,c=(()=>{let e=d.length;if(e<=1)return[417.5];let t=e>1?(850-165*e)/(e-1):0;return d.map((e,i)=>75+i*(165+t))})(),u=`75,205 ${925},205 ${500+a2/2},5 ${500-a2/2},5`;return(0,_.jsx)(F.ResizeableWrapper,{...s,data:e,updateData:t,selectItem:n,isEditable:i,editor:a,isNodeSelected:r,selectedKeyPath:o,children:(0,_.jsxs)("svg",{viewBox:"0 0 1000 650",preserveAspectRatio:"xMidYMid meet",overflow:"visible",children:[(0,_.jsx)("polygon",{points:u,className:aY.SVG_SHAPE_BACKGROUND_CLASS}),(0,_.jsx)(tk,{x:a6,y:5,width:a2,height:200,fontSize:a4,text:l,isEditable:i,onUpdate:e=>{t(t=>(t.title=e,t))},selectItem:()=>n("title"),parentEditor:a,isItemSelected:r&&"title"===o,verticalAlign:"middle",className:aY.SHAPE_TEXT_OVER_BACKGROUND_CLASS}),(0,_.jsx)("rect",{x:75,y:a3,width:850,height:20,className:aY.SVG_SHAPE_BACKGROUND_CLASS,rx:5,ry:5}),d.map((e,s)=>(0,_.jsx)(a9,{x:c[s],color:e.color,icon:e.icon,label:e.label,updateLabel:e=>{t(t=>(t.pillars[s].label=e,t))},isEditable:i,selectItem:n,isNodeSelected:r,selectedKeyPath:o,editor:a,index:s},s))]})})},label:()=>l.i18n._({id:"xGL+6k",message:"Pillar diagram"}),icon:o.faBuildingColumns,disabled:!0,formattingMenu:aQ.SmartDiagramFormattingMenu};var a7=e.i(969641),re=e.i(296690),rt=e.i(400551),ri=e.i(935150);let rn={src:e.i(828188).default,width:253,height:96,blurWidth:0,blurHeight:0},ra=q.BASE_FONT_SIZE/.75,rr=q.BASE_FONT_SIZE/.75,ro=(e,t)=>t?e?.isEmphasized?.5:.25:.5,rs=(e,t)=>t?e?.isEmphasized?1:.5:1,rl={[nH]:nW,[at]:ai,[i3]:i5,[iG]:i$,[iq]:iY,[t8]:t7,[iJ]:i0,[t5]:t4,[nr]:no,[t0]:t1,[ii]:ia,[nO]:nB,[iP]:iD,[iH]:iW,[iO]:iB,[is]:il,[nh]:nm,[nt]:ni,[aK]:aq,pillars:a8,venn:{key:"venn",Component:e=>{let t,{data:i,updateData:n,isEditable:a,selectItem:r,editor:o,isNodeSelected:l,selectedKeyPath:d,isTextMenuVisible:c,setIsTextMenuVisible:u}=e,{topCircle:p,leftCircle:h,rightCircle:m,topLeftIntersection:g,leftRightIntersection:f,topRightIntersection:b,allIntersection:x}=i,y=!!p,v=[i.leftCircle,i.rightCircle,i.topCircle,i.leftRightIntersection,i.topLeftIntersection,i.topRightIntersection,i.allIntersection].some(e=>e?.isEmphasized),C=(0,j.useCallback)(()=>{y&&n(e=>({leftCircle:{...e.leftCircle},rightCircle:{...e.rightCircle},leftRightIntersection:{...e.leftRightIntersection},topCircle:void 0,topLeftIntersection:void 0,topRightIntersection:void 0,allIntersection:void 0}))},[y,n]),w=(0,j.useCallback)(()=>{y&&n(e=>({leftCircle:{...e.rightCircle},rightCircle:{...e.topCircle},leftRightIntersection:{...e.topRightIntersection},topCircle:void 0,topLeftIntersection:void 0,topRightIntersection:void 0,allIntersection:void 0}))},[y,n]),S=(0,j.useCallback)(()=>{y&&n(e=>({leftCircle:{...e.leftCircle},rightCircle:{...e.topCircle},leftRightIntersection:{...e.topLeftIntersection},topCircle:void 0,topLeftIntersection:void 0,topRightIntersection:void 0,allIntersection:void 0}))},[y,n]),k=y?3:2,A=(0,R.useAppSelector)(B.selectTheme),E=(0,P.useFeatureFlag)("useNewChartingColorSet"),I=(0,tT.getThemeColorSolid)((0,tT.getThemePrimaryAccentColor)(A)),M=(0,t_.resolveAccentColorForScheme)(I,i.colorScheme,A,E);if(i.colorScheme){let e=Array.from({length:k},(e,t)=>t);t=(0,t_.makeColorScale)(M,e,i.colorScheme,{theme:A})}let T=(0,tM.getShapeColorCss)(p?.color||t?.get(0)||M),L=(0,tM.getShapeColorCss)(h?.color||t?.get(1)||M),D=(0,tM.getShapeColorCss)(m?.color||t?.get(2)||M);return(0,_.jsx)(F.ResizeableWrapper,{...e,svgWidthPercent:75,children:(0,_.jsxs)("svg",{viewBox:y?"0 0 1000 938":"0 0 1000 625",preserveAspectRatio:"xMidYMid meet",overflow:"visible",style:{"--shape-border-width":"1.25px"},children:[(0,_.jsx)(z.FocusAbsorber,{}),(0,_.jsx)("g",{style:L,children:(0,_.jsx)("circle",{cx:312.5,cy:y?625:312.5,r:312.5,className:aY.SVG_SHAPE_FILL_CLASS,fillOpacity:ro(h,v),strokeOpacity:ro(h,v),style:a?{pointerEvents:"none"}:void 0})}),(0,_.jsx)("g",{style:D,children:(0,_.jsx)("circle",{cx:687.5,cy:y?625:312.5,r:312.5,className:aY.SVG_SHAPE_FILL_CLASS,fillOpacity:ro(m,v),strokeOpacity:ro(m,v),style:a?{pointerEvents:"none"}:void 0})}),y&&(0,_.jsx)("g",{style:T,children:(0,_.jsx)("circle",{cx:500,cy:312.5,r:312.5,className:aY.SVG_SHAPE_FILL_CLASS,fillOpacity:ro(p,v),strokeOpacity:ro(p,v),style:a?{pointerEvents:"none"}:void 0})}),(0,_.jsx)(ri.SvgSelectionBox,{x:0,y:312.5*!!y,width:625,height:625,isEditable:a,selectItem:()=>{r("leftCircle")},updateStep:e=>{n(t=>(t.leftCircle={...t.leftCircle,...e},t))},isItemSelected:!l&&"leftCircle"===d,isStepSelected:!l&&"leftCircle"===d,formattingMenuItems:(0,_.jsx)(_.Fragment,{children:y&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rt.FormattingMenuDivider,{}),(0,_.jsx)(re.ToolbarButton,{size:"sm",variant:"toolbar",onClick:w,icon:s.faTrash,color:"red.500"})]})}),stepAttributes:h,editor:o}),(0,_.jsx)(ri.SvgSelectionBox,{x:375,y:312.5*!!y,width:625,height:625,isEditable:a,selectItem:()=>{r("rightCircle")},updateStep:e=>{n(t=>(t.rightCircle={...t.rightCircle,...e},t))},isItemSelected:!l&&"rightCircle"===d,isStepSelected:!l&&"rightCircle"===d,formattingMenuItems:(0,_.jsx)(_.Fragment,{children:y&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rt.FormattingMenuDivider,{}),(0,_.jsx)(re.ToolbarButton,{size:"sm",variant:"toolbar",onClick:S,icon:s.faTrash,color:"red.500"})]})}),stepAttributes:m,editor:o}),y&&(0,_.jsx)(ri.SvgSelectionBox,{x:187.5,y:0,width:625,height:625,isEditable:a,selectItem:()=>{r("topCircle")},updateStep:e=>{n(t=>(t.topCircle&&(t.topCircle={...t.topCircle,...e}),t))},isItemSelected:!l&&"topCircle"===d,isStepSelected:!l&&"topCircle"===d,formattingMenuItems:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(rt.FormattingMenuDivider,{}),(0,_.jsx)(re.ToolbarButton,{size:"sm",variant:"toolbar",onClick:C,icon:s.faTrash,color:"red.500"})]}),stepAttributes:p,editor:o}),y&&p&&(0,_.jsx)(tk,{x:250,y:50,width:500,height:250,fontSize:ra,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:p.text,isEditable:a,onUpdate:e=>{n(t=>(t.topCircle&&(t.topCircle.text=e),t))},selectItem:()=>r("topCircle.text"),parentEditor:o,isItemSelected:l&&"topCircle.text"===d,style:v?{opacity:rs(p,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),(0,_.jsx)(tk,{x:y?25:50,y:y?550:50,width:y?350:300,height:y?300:525,fontSize:ra,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:h?.text??"",isEditable:a,onUpdate:e=>{n(t=>(t.leftCircle||(t.leftCircle={text:""}),t.leftCircle.text=e,t))},selectItem:()=>r("leftCircle.text"),parentEditor:o,isItemSelected:l&&"leftCircle.text"===d,textAlign:"center",style:v?{opacity:rs(h,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),(0,_.jsx)(tk,{x:y?625:675,y:y?550:50,width:y?350:300,height:y?300:525,fontSize:ra,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:m.text,isEditable:a,onUpdate:e=>{n(t=>(t.rightCircle.text=e,t))},selectItem:()=>r("rightCircle.text"),parentEditor:o,isItemSelected:l&&"rightCircle.text"===d,textAlign:"center",style:v?{opacity:rs(m,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),y&&g&&(0,_.jsx)(tk,{x:212.5,y:300,width:212.5,height:225,fontSize:rr,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:g.text,isEditable:a,onUpdate:e=>{n(t=>(t.topLeftIntersection&&(t.topLeftIntersection.text=e),t))},selectItem:()=>r("topLeftIntersection.text"),parentEditor:o,isItemSelected:l&&"topLeftIntersection.text"===d,style:v?{opacity:rs(g,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),y&&b&&(0,_.jsx)(tk,{x:575,y:300,width:212.5,height:225,fontSize:rr,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:b.text,isEditable:a,onUpdate:e=>{n(t=>(t.topRightIntersection&&(t.topRightIntersection.text=e),t))},selectItem:()=>r("topRightIntersection.text"),parentEditor:o,isItemSelected:l&&"topRightIntersection.text"===d,style:v?{opacity:rs(b,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),(0,_.jsx)(tk,{x:y?437.5:400,y:y?650:150,width:y?125:200,height:y?100:325,fontSize:rr,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:f.text,isEditable:a,onUpdate:e=>{n(t=>(t.leftRightIntersection.text=e,t))},selectItem:()=>r("leftRightIntersection.text"),parentEditor:o,isItemSelected:l&&"leftRightIntersection.text"===d,textAlign:"center",style:v?{opacity:rs(f,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),y&&x&&(0,_.jsx)(tk,{x:425,y:400,width:150,height:225,fontSize:rr,className:aY.SHAPE_TEXT_OVER_FILL_CLASS,text:x.text,isEditable:a,onUpdate:e=>{n(t=>(t.allIntersection&&(t.allIntersection.text=e),t))},selectItem:()=>r("allIntersection.text"),parentEditor:o,isItemSelected:l&&"allIntersection.text"===d,style:v?{opacity:rs(x,v)}:void 0,isTextMenuVisible:c,setIsTextMenuVisible:u}),(0,_.jsx)(z.FocusAbsorber,{})]})})},label:()=>l.i18n._({id:"z5TX2d",message:"Venn diagram"}),icon:o.faCirclesOverlap,previewImage:rn,defaultData:()=>({leftCircle:{text:"

    A

    ",color:void 0,isEmphasized:!1},rightCircle:{text:"

    B

    ",color:void 0,isEmphasized:!1},leftRightIntersection:{text:"A & B",color:void 0,isEmphasized:!1}}),formattingMenu:({editor:e,selection:t,decorations:i})=>{let{data:n}=t.node.attrs,a=(0,j.useCallback)(i=>{try{let a=i({...n});e.commands.updateAttributesAtPos(t.from,{data:a})}catch(e){console.error("Error updating Venn diagram data",e)}},[n,e.commands,t.from]),r=(0,j.useCallback)(()=>{a(e=>({...e,topCircle:{text:"

    C

    ",color:void 0,isEmphasized:!1},topLeftIntersection:{text:"A & C",color:void 0,isEmphasized:!1},topRightIntersection:{text:"B & C",color:void 0,isEmphasized:!1},allIntersection:{text:"A & B & C",color:void 0,isEmphasized:!1}}))},[a]),o=(0,j.useCallback)(()=>{a(e=>({leftCircle:e.leftCircle,rightCircle:e.rightCircle,leftRightIntersection:e.leftRightIntersection,topCircle:void 0,topLeftIntersection:void 0,topRightIntersection:void 0,allIntersection:void 0}))},[a]),l=!!n.topCircle;return(0,_.jsx)(aQ.SmartDiagramFormattingMenu,{editor:e,selection:t,decorations:i,children:(0,_.jsxs)(eG.HStack,{children:[!l&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(a7.Button,{size:"sm",variant:"toolbar",onClick:r,leftIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faCirclePlus}),ms:2,children:(0,_.jsx)(eD.Trans,{message:"Add circle",id:"Fgzljt"})}),(0,_.jsx)(rt.FormattingMenuDivider,{})]}),l&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(a7.Button,{size:"sm",variant:"toolbar",onClick:o,leftIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faCircleMinus}),ms:2,children:(0,_.jsx)(eD.Trans,{message:"Remove circle",id:"DUcdY9"})}),(0,_.jsx)(rt.FormattingMenuDivider,{})]})]})})}},funnel:a1,[nP]:nD,[tY]:tX,[nM]:nT,[iC]:iw,[iM]:iT,[nA]:nE,[n9]:n8,[ad]:ac,[iA]:iE,[n3]:n5,[nC]:nw,[t$]:tZ,[i9]:i8,[nd]:nc,[tW]:tU,[nb]:nx,[ib]:ix,[nq]:nY,[iu]:ip,[nJ]:n0,[nG]:n$,[ar]:ao},rd={[ab]:ax,[aC]:aw,[aH]:aW,[aO]:aB,[aP]:aD,[aM]:aT,[aA]:aE,[ah]:am,[aG]:a$},rc={bullseye_composable:tY,quadrant:nA,"square-arrows":n3,bubbles:t$},ru=e=>(rc[e]&&(e=rc[e]),rd[e])?rd[e]:rl[e],rp=e=>{let t=ru(e);return t?.formattingMenu};var rh=e.i(494075),rm=e.i(391736),rg=e.i(417692);let rf=(e,t)=>{let{label:i,icon:n,defaultColorScheme:a,previewImage:r,defaultData:s,defaultWidth:l}=t,d=()=>({templateKey:e,id:(0,rm.generateMediaId)(),data:{...s?s():{},colorScheme:a},horizontalAlign:"center",width:l?l*A.CONTENT_WIDTH_PX:void 0});return{key:`smart-diagram-${e}`,name:i,nodeName:"smartDiagram",icon:n??o.faShapes,previewImage:r,keywords:["diagram","smart"],execute:t=>{t.chain().focus().insertSmartDiagram({attrs:d(),allowGeneration:E.DiagramKeys.includes(e)}).run()},dragStartFn:t=>(0,rh.setDraggingContent)({editor:t,content:(t=>{let i=E.DiagramKeys.includes(e),n=d();if(i&&t){let e=(0,rg.createSmartDiagramGenerateData)(t);return{type:"smartDiagram",attrs:{...n,...e}}}return{type:"smartDiagram",attrs:n}})(t)}),dragEndFn:t=>{if(E.DiagramKeys.includes(e)){let{state:e}=t,{selection:i}=e,n=i.from;requestAnimationFrame(()=>{(0,rg.triggerSmartDiagramGeneration)(t,e,n)})}}}};var rb=e.i(803479),rx=e.i(462480),ry=e.i(555999);e.i(566358);var rv=e.i(907648);let rC=()=>(0,rx.nanoid)(5),rw=rv.UniqueAttribute.extend({name:"UniqueToggleId"}).configure({attributeName:"id",types:["toggle"],initialValue:rC,filterTransaction:ry.isLocalTransaction,pluginKey:new ea.PluginKey("UniqueToggleId")});e.s(["UniqueToggleId",0,rw,"generateToggleId",0,rC],78383);var rS=e.i(536913),rk=e.i(977581);let rA=()=>[{key:"insertCardAfter",name:()=>l.i18n._({id:"coNSGP",message:"New card below"}),nodeName:"card",icon:o.faDiagramCells,execute:e=>e.commands.insertCardAfter(),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"]},{key:"insertCardInside",name:()=>l.i18n._({id:"lOmsEK",message:"Nested card"}),nodeName:"card",icon:o.faDiagramSubtask,execute:e=>e.commands.insertNestedCard(),checkDisabled:e=>!e.schema.nodes.card,keywords:["nested","card","sub"]},{key:"splitCard",name:()=>l.i18n._({id:"ONXbeB",message:"Split card here"}),nodeName:"card",icon:o.faPageBreak,shortcut:"***",execute:e=>e.commands.splitCardAtSelection(),checkDisabled:e=>!e.schema.nodes.card,dragStartFn:e=>{(0,rh.setDraggingContent)({editor:e,content:(0,m.EMPTY_NODES)().normalText})},dragEndFn:e=>{e.chain().splitCardAtSelection().focusDelayed().run()},keywords:["split"]},{key:"title",name:()=>l.i18n._({id:"XxGz2W",message:"Title"}),nodeName:"title",icon:s.faText,shortcut:"! Title",execute:e=>{e.chain().focus().setFontSize("title").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"title"),keywords:["title","large"]},{key:"display",name:()=>l.i18n._({id:"ySF22d",message:"Display"}),nodeName:"title",icon:s.faText,shortcut:"!! Title",execute:e=>{e.chain().focus().setFontSize("titleLg").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"title"),keywords:["display","large"]},{key:"monster",name:()=>l.i18n._({id:"+nhv+2",message:"Monster"}),nodeName:"title",icon:s.faText,shortcut:"!!! Ahhhh",execute:e=>{e.chain().focus().setFontSize("titleXl").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"title"),keywords:["monster","huge"]},{key:"h1",name:()=>l.i18n._({id:"lXKZGw",message:"Heading 1"}),nodeName:"heading",icon:o.faH1,shortcut:"# Heading 1",execute:e=>{e.chain().focus().setFontSize("h1").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"heading"),keywords:["heading","h1"]},{key:"smallText",name:()=>l.i18n._({id:"LBkaLa",message:"Small text"}),nodeName:"paragraph",icon:s.faText,shortcut:"/sm",execute:e=>{e.chain().focus().setFontSize("sm").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"body"),keywords:["sm","small","paragraph"]},{key:"normalText",name:()=>l.i18n._({id:"5NwZ8t",message:"Normal text"}),nodeName:"paragraph",icon:o.faText,shortcut:"/md",execute:e=>{e.chain().focus().setFontSize("md").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"body"),keywords:["md","normal","paragraph","default","body"]},{key:"largeText",name:()=>l.i18n._({id:"0Sz17G",message:"Large text"}),nodeName:"paragraph",icon:o.faText,shortcut:"/lg",execute:e=>{e.chain().focus().setFontSize("lg").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"body"),keywords:["lg","large","paragraph"]},{key:"h2",name:()=>l.i18n._({id:"El7NbA",message:"Heading 2"}),nodeName:"heading",icon:o.faH2,shortcut:"## Heading 2",execute:e=>{e.chain().focus().setFontSize("h2").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"heading"),keywords:["heading","h2"]},{key:"h3",name:()=>l.i18n._({id:"SFN6dN",message:"Heading 3"}),nodeName:"heading",icon:o.faH3,shortcut:"### Heading 3",execute:e=>{e.chain().focus().setFontSize("h3").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"heading"),keywords:["heading","h3"]},{key:"h4",name:()=>l.i18n._({id:"nJeKmw",message:"Heading 4"}),nodeName:"heading",icon:o.faH4,shortcut:"#### Heading 4",execute:e=>{e.chain().focus().setFontSize("h4").run()},checkDisabled:(e,t)=>!!t&&!(0,rk.isAllowedFontSize)(e,"heading"),keywords:["heading","h4"]},{key:"openEmojiPicker",name:()=>l.i18n._({id:"tKlWWY",message:"Emoji"}),nodeName:"emoji",icon:s.faFaceSmile,execute:e=>e.commands.openEmojiPicker(),keywords:["symbol","emoji"]},{key:"bulletedList",name:()=>l.i18n._({id:"ynb7Kh",message:"Bulleted list"}),nodeName:S.ListVariant.Bullet,icon:o.faListUl,shortcut:"- Item",execute:e=>{e.chain().setListItems({variant:S.ListVariant.Bullet}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,rk.canChangeSelectedNodeType)(e,S.ListVariant.Bullet),keywords:["bullets","unordered","ul","list"]},{key:"numberedList",name:()=>l.i18n._({id:"M3G9ZD",message:"Numbered list"}),nodeName:S.ListVariant.Numbered,icon:o.faListOl,shortcut:"1. Item",execute:e=>{e.chain().setListItems({variant:S.ListVariant.Numbered}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,rk.canChangeSelectedNodeType)(e,S.ListVariant.Numbered),keywords:["numbers","numbered","ordered","ol","list"]},{key:"todoList",name:()=>l.i18n._({id:"rCIbrq",message:"Todo list"}),nodeName:S.ListVariant.Todo,icon:o.faTasks,shortcut:"[] Item",execute:e=>{e.chain().setListItems({variant:S.ListVariant.Todo}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,rk.canChangeSelectedNodeType)(e,S.ListVariant.Todo),keywords:["todo","task","checkbox","list","checklist"]},{key:"blockquote",name:()=>l.i18n._({id:"OLMhPm",message:"Blockquote"}),nodeName:"blockquote",icon:o.faBlockQuote,shortcut:"> Quote",execute:e=>e.chain().focus().toggleBlockquote().run(),keywords:["quote","blockquote"]},...(0,f.getCalloutBoxCommands)(),{key:"buttonGroup",name:()=>l.i18n._({id:"hxBFty",message:"Button"}),nodeName:"buttonGroup",icon:o.faHandPointer,execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().buttonGroup),description:()=>l.i18n._({id:"IvDo5O",message:"A clickable button that can link to other pages, or an email"}),keywords:["button","link","click","call to action"]},{key:"labelGroup",name:()=>l.i18n._({id:"kAid74",message:"Label"}),nodeName:"labelGroup",icon:o.faTag,execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().labelGroup),description:()=>l.i18n._({id:"vATimd",message:"Tag-style labels for categories or chapter indicators"}),keywords:["label","tag","category","badge","chip"],featureFlag:"labelBlock"},{key:"codeBlock",name:()=>l.i18n._({id:"4A3Yzu",message:"Code block"}),nodeName:"codeBlock",icon:o.faCode,shortcut:"```",execute:e=>{e.chain().focus().setCodeBlock().run()},keywords:["code","block","codeblock"]},{key:"mathBlock",name:()=>l.i18n._({id:"TI6GY9",message:"Math block"}),nodeName:"math_display",featureFlag:"math",icon:o.faFunction,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertContent((0,m.EMPTY_NODES)().mathBlock).run(),dragEndFn:()=>{},description:()=>l.i18n._({id:"mBJFYh",message:"Write equations using Katex syntax"})},{key:"mathInline",name:()=>l.i18n._({id:"qc9cD+",message:"Inline math"}),featureFlag:"math",nodeName:"math_inline",icon:o.faSigma,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertMathInline().run(),shortcut:"$x^2$ "},{key:"table2",name:()=>l.i18n._({id:"3gSgpL",message:"2x2 table"}),keywords:["table","grid","data"],nodeName:"table",shortcut:"/table",icon:o.faTable,execute:e=>e.commands.insertTable({rows:2,cols:2,withHeaderRow:!1})},{key:"table3",name:()=>l.i18n._({id:"ZjN50+",message:"3x3 table"}),keywords:["table","grid","data"],nodeName:"table",icon:o.faTable,execute:e=>e.commands.insertTable({rows:3,cols:3,withHeaderRow:!1})},{key:"table4",name:()=>l.i18n._({id:"64S2d0",message:"4x4 table"}),keywords:["table","grid","data"],nodeName:"table",icon:o.faTable,execute:e=>e.commands.insertTable({rows:4,cols:4,withHeaderRow:!1})},{key:"columns2",name:()=>l.i18n._({id:"vVJ2/D",message:"2 columns"}),keywords:["columns","layout","grid","two"],nodeName:"gridLayout",shortcut:"/columns",icon:o.faColumns3,execute:e=>e.commands.insertLayout(2)},{key:"columns3",name:()=>l.i18n._({id:"OnuuaA",message:"3 columns"}),keywords:["columns","layout","grid","three"],nodeName:"gridLayout",icon:o.faColumns3,execute:e=>e.commands.insertLayout(3)},{key:"columns4",name:()=>l.i18n._({id:"hexbw8",message:"4 columns"}),keywords:["columns","layout","grid","four"],nodeName:"gridLayout",icon:o.faColumns3,execute:e=>e.commands.insertLayout(4)},{key:"contributors",name:()=>l.i18n._({id:"YqsXfH",message:"Contributors"}),nodeName:"contributors",icon:o.faCircleUser,execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().contributors),keywords:["contributors","authors","credits"]},{key:"divider",name:()=>l.i18n._({id:"R8AthW",message:"Divider"}),nodeName:"divider",icon:o.faHorizontalRule,keywords:["hr","rule","line","divider"],shortcut:"---",execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().divider)},{key:"tableOfContents",name:()=>l.i18n._({id:"9FTolD",message:"Table of contents"}),nodeName:"tableOfContents",icon:o.faBarsStaggered,execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().tableOfContents,-1),keywords:["toc","contents"]},{key:"gallery",name:()=>l.i18n._({id:"U+kFad",message:"Gallery"}),description:()=>l.i18n._({id:"GqdREM",message:"Combine images, videos, and embeds in a zoomable carousel"}),nodeName:"gallery",shortcut:"/gallery",icon:o.faGrid2,keywords:["gallery","image","layout","filmstrip","carousel"],execute:e=>e.commands.insertContentAndSelect((0,m.EMPTY_NODES)().gallery)},{key:"logo",name:()=>l.i18n._({id:"YkFus/",message:"Logo gallery"}),description:()=>l.i18n._({id:"YRtGxa",message:"Display logos in a gallery. Useful for companies, partners, and sponsors"}),nodeName:"gallery",shortcut:"/logos",icon:o.faGripDots,keywords:["logo","logos","gallery"],execute:e=>e.chain().insertContentAndSelect((0,m.EMPTY_NODES)().logoGallery).run()},{key:"footnote",name:()=>l.i18n._({id:"dOxPd4",message:"Footnote"}),nodeName:"footnote",shortcut:"^note^",icon:o.faSuperscript,execute:e=>{let t=(0,y.generateFootnoteId)(),i={...(0,m.EMPTY_NODES)().footnote,attrs:{noteId:t}};(0,y.setFootnoteExpanded)(t,!0),e.commands.insertContent(i)},dragStartFn:e=>{let t=(0,y.generateFootnoteId)(),i={...(0,m.EMPTY_NODES)().footnote,attrs:{noteId:t}};(0,y.setFootnoteExpanded)(t,!0),(0,rh.setDraggingContent)({editor:e,content:i})},checkDisabled:v.isFootnoteEditor,keywords:["footnote","note","reference"]},{key:"insertDate",name:()=>l.i18n._({id:"mYGY3B",message:"Date"}),nodeName:"paragraph",icon:o.faCalendar,execute:e=>{let t=(0,d.format)(new Date,"PPP",{locale:c.enUS});e.chain().focus().insertContent(t).run()},shortcut:"/date",featureFlag:"insertDate",keywords:["date","today","current"]},...(0,C.GraphyChartCommands)(),...(0,b.ChartCommands)(),{key:"toggle",name:()=>l.i18n._({id:"JFciKP",message:"Toggle"}),description:()=>l.i18n._({id:"Woijyj",message:"A collapsible section. Highlight key points and hide details"}),keywords:["toggle","expand","collapse","disclosure","details"],nodeName:"toggle",icon:o.faPlay,execute:e=>{let t=rC();(0,rS.setToggleOpen)(t,!0),e.chain().insertContent({...(0,m.EMPTY_NODES)().toggle,attrs:{id:t}}).selectInsertedNode().run()},dragStartFn:e=>{let t=rC();(0,rS.setToggleOpen)(t,!0),(0,rh.setDraggingContent)({editor:e,content:{...(0,m.EMPTY_NODES)().toggle,attrs:{id:t}}})}},...(0,k.MediaCommands)(),...(0,rb.SmartLayoutCommands)(),...(0,w.GridTemplateCommands)(),...(0,x.DiagramCommands)(),...Object.entries(rl).filter(([e,t])=>!t.disabled&&(void 0===t.featureFlag||h.featureFlags.get(t.featureFlag))).map(([e,t])=>rf(e,t)),...Object.entries(rd).filter(([e,t])=>!t.disabled&&(void 0===t.featureFlag||h.featureFlags.get(t.featureFlag))).map(([e,t])=>rf(e,t)),...(0,g.AICommands)()],rE=()=>(0,u.default)(rA(),e=>e.priority),r_=()=>(0,p.default)(rA(),"key"),rI=(e,t,i=!0,n=!1)=>!!(t.needsConnection&&n||t.featureFlag&&!h.featureFlags.get(t.featureFlag)||t.checkDisabled?.(e,i))||!!i&&!(0,rk.canInsertNodeAtSelection)(e,t.nodeName);e.s(["Blockquote",()=>rN],383576);var rM=e.i(482279),rT=e.i(524617),rL=e.i(408767),rj=e.i(577281);e.s(["BlockquoteView",()=>rD],225335);var rP=e.i(194552);let rD=e=>(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsxs)(eg.Box,{position:"relative","data-selection-ring":"padded",dir:(0,Z.getAlignDirection)(e.decorations),children:[(0,_.jsx)(eW.NodeViewContent,{as:"blockquote"}),(0,_.jsx)(eg.Box,{position:"absolute",css:{insetInlineStart:"0"},top:"0",height:"100%",w:"var(--line-thickness)",backgroundColor:"var(--accent-color)",backgroundImage:"var(--accent-gradient)"})]})}),rN=(0,tl.extendTiptapNode)(rM.default,"blockquote",{addNodeView:()=>(0,rL.ReactNodeViewRenderer)(rD,{update:rj.attrsOrDecorationsChanged}),addCommands(){return{...this.parent?.(),unwrapQuoteOnDelete:()=>({state:e,tr:t})=>{let{selection:i}=e;if(!i.empty)return!1;let n=(0,ei.findParentNode)(e=>e.type.name===rN.name)(i);if(!n||!(i.from<=n.pos+2))return!1;let a=i.$from.blockRange(i.$to);if(!a)return!1;let r=(0,rT.liftTarget)(a);return!!r&&(t.lift(a,r),!0)}}}}),rR=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,rO=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,rB=(0,tl.extendTiptapMark)(ef.default,"bold",{addInputRules(){return[(0,ei.markInputRule)({find:rR,type:this.type}),(0,ei.markInputRule)({find:rO,type:this.type})]},renderHTML:({HTMLAttributes:e})=>["b",(0,ei.mergeAttributes)(e),0]});e.s(["Bold",0,rB],908229);var rz=e.i(285598),rF=e.i(948982),rH=e.i(829814);let rW=({variant:e})=>({variant:"unstyled",display:"inline-flex",position:"relative",_hover:{textDecoration:"none"},minW:"min(100%, 12em)",maxW:"100%",fontSize:"1em",py:"0.5em",minH:"2.75em",w:"var(--button-width)",h:"auto",px:"link"===e?"0.5em":"1em",transitionProperty:"none","data-variant":e});e.s(["getDefaultButtonPropsForVariant",0,rW],826646);let rU=e=>{let{editor:t,node:i,decorations:n}=e,{href:a,variant:r,color:o}=i.attrs,s=(0,R.useAppSelector)(B.selectContentEditable),l=(0,er.useIsThumbnailView)(),d=(0,rH.isFocusedInside)(n),c=s&&d,u=(0,rF.isNodeViewEmpty)(n),{linkUrl:p,handleClick:h,isCurrentPage:m}=(0,eF.useSiteEnabledLink)({url:a}),{interceptLinkClick:g,linkUrlSafe:f,isUntrusted:b,linkInterceptEnabled:x}=(0,ez.useLinkInterstitial)(p),y=x&&!0!==t.isSiteNavbarEditor,{textColor:v}=(0,tM.getTextColorVarsForBackground)(o),C="solid"===r?{backgroundColor:o||"var(--button-color)",backgroundImage:o?void 0:"var(--button-gradient)",borderRadius:"var(--button-border-radius, var(--box-border-radius))",fontFamily:"var(--body-font)"}:"outline"===r?{border:"0px",boxShadow:`inset 0 0 0 max(1px, var(--shape-border-width)) ${o||"var(--button-color)"}`,backgroundColor:"var(--shape-bg-color-override, var(--card-color))",borderRadius:"var(--button-border-radius, var(--box-border-radius))",fontFamily:"var(--body-font)"}:{borderRadius:"var(--button-border-radius, var(--box-border-radius))",fontFamily:"var(--body-font)"},w=(0,j.useMemo)(()=>({...rW({variant:r})}),[r]);return(0,_.jsx)(eH.NodeViewWrapper,{children:(0,_.jsx)(a7.Button,{as:c?eg.Box:e$.Link,isDisabled:!!y&&b,cursor:s?"text":"pointer",userSelect:s?"auto":"none",href:y?f||void 0:p,rel:"noopener nofollow",onClick:y?g:h,...w,style:C,className:(0,G.cx)("button","solid"===r&&eS.HEADING_NO_GRADIENT_CLASS),"data-export-as-image":!0,"data-export-link":a,sx:{"@media print":{width:"auto"},outline:d&&!l?"2px solid var(--chakra-ring-color) !important":void 0,lineHeight:"var(--line-height-body)"},"data-is-current-page":m,children:(0,_.jsxs)(ej.Text,{as:"div",noOfLines:c||u?void 0:1,wordBreak:"break-all",style:{color:"solid"===r?v||"var(--button-color-inverted)":"outline"===r?o||"var(--button-color)":void 0},textAlign:"center",children:[u&&(0,_.jsx)(ej.Text,{opacity:"0.3",pointerEvents:"none",contentEditable:!1,pos:"absolute",w:"100%",left:"0",textAlign:"center",children:"…"}),(0,_.jsx)(eW.NodeViewContent,{})]})})})};e.s(["ButtonView",0,rU],385589);var rV=e.i(704416);let rG=(0,tl.createTiptapNode)("button",{defining:!0,isolating:!0,selectable:!1,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(rU,{update:rj.attrsOrDecorationsChanged}),addCommands:()=>({addButtonToGroup:e=>({state:t,chain:i})=>{let n=t.doc.nodeAt(e);if(!n)return!1;let a=e+n.nodeSize-1;return i().insertContentAt(a,{...(0,m.EMPTY_NODES)().button,attrs:{variant:rV.BUTTON_GROUP_RULES[n.type.name].defaultVariant,href:""}}).selectInsertedNode().run(),!0},handleButtonDelete:e=>({dispatch:t,state:i,chain:n})=>{if(!t)return!0;let a=(0,ei.findParentNode)(e=>"button"===e.type.name)(i.selection);if(!a||e&&!(0,rk.isNodeEmpty)(a.node))return!1;let r=(0,ei.findParentNode)(e=>"buttonGroup"===e.type.name)(i.selection),o=(0,ei.findParentNode)(e=>"navbarButtons"===e.type.name)(i.selection),s=(0,ei.findParentNode)(e=>"navbarLinks"===e.type.name)(i.selection);return o||s||!r||1!==r.node.childCount?o&&1===o.node.childCount||s&&1===s.node.childCount?n().deleteNode("button").blur().run():n().deleteNode("button").command(({tr:e})=>{let t=(0,rz.findSelectionNearOrGapCursor)(e.doc.resolve(a.pos-1),-1);return t&&e.setSelection(t),!0}).focus().run():n().deleteNode("buttonGroup").command(({tr:e})=>{let t=(0,rz.findSelectionNearOrGapCursor)(e.doc.resolve(r.pos));return t&&e.setSelection(t),!0}).focus().run(),!0},exitButtonGroup:()=>({state:e,chain:t})=>{if(!(0,ei.findParentNode)(e=>"button"===e.type.name)(e.selection))return!1;let i=(0,ei.findParentNode)(e=>"buttonGroup"===e.type.name)(e.selection),n=(0,ei.findParentNode)(e=>"navbarButtons"===e.type.name)(e.selection),a=(0,ei.findParentNode)(e=>"navbarLinks"===e.type.name)(e.selection);if(n||a||!i)return!1;let r=i.pos+i.node.nodeSize;return t().insertContentAt(r,{type:"paragraph"}).selectInsertedNode().run(),!0}}),parseHTML:()=>[{tag:"button"}],renderHTML:({node:e,HTMLAttributes:t})=>["button",(0,ei.mergeAttributes)(t,{href:e.attrs.href,variant:e.attrs.variant,color:e.attrs.color}),0]});e.s(["Button",0,rG],364247),e.s(["ButtonGroup",()=>rq],838777),e.s(["ButtonGroupView",()=>rZ,"getButtonGroupSx",()=>rK],757451);let r$=({editor:e,getPos:t,node:i,direction:n,maxButtons:a,tooltip:r})=>{let o=(0,R.useAppSelector)(B.selectContentEditable),d=!a||i.childCount{let i=t();"number"==typeof i&&e.commands.addButtonToGroup(i)},[e,t]);return d&&o?(0,_.jsx)(L.Flex,{position:"relative",align:"center",children:(0,_.jsx)(e0.GammaTooltip,{label:r||(0,_.jsx)(eD.Trans,{message:"Add a button",id:"xe7fzh"}),placement:"top",children:(0,_.jsx)(eY.IconButton,{icon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faPlus}),"aria-label":l.i18n._({id:"6oU9VZ",message:"Add button"}),size:"xs",variant:"plain",isRound:!0,onClick:c,opacity:0,className:"add-button",transitionProperty:"opacity",transitionDuration:"normal",position:"absolute",left:"column"===n?"50%":0,top:"50%",transform:"column"===n?"translateX(-50%)":"translateY(-50%)",zIndex:"sticky"})})}):null};e.s(["AddButtonButton",0,r$],672279);let rZ=e=>{let{decorations:t,node:i}=e,{horizontalAlign:n}=i.attrs,a=(0,O.useShouldRenderMobileVersion)(),r=a?"column":"row";return(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsxs)(L.Flex,{dir:(0,Z.getAlignDirection)(t,n),w:"100%","data-selection-ring":"padded",borderRadius:"var(--box-border-radius)",direction:r,justify:(0,Z.getFlexAlign)(n)||"var(--flex-align)",sx:rK(a),gap:"0.5em",alignItems:"center",children:[(0,_.jsx)(eW.NodeViewContent,{}),(0,_.jsx)(r$,{...e,direction:r,maxButtons:rV.MAX_BUTTONS})]})})},rK=e=>({"> [data-node-view-content]":{display:"contents","> [data-node-view-content-inner]":{display:"contents"}},"--button-width":e?"100%":"auto",".node-button":{width:"var(--button-width)",".button":{width:"100%"}},_hover:{".add-button":{opacity:1}}}),rq=(0,tl.createTiptapNode)("buttonGroup",{allowGapCursor:!1,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(rZ,{update:rj.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=button-group]",getAttrs:e=>(0,tl.parseHorizontalAlign)(e)},{tag:"buttons",getAttrs:e=>(0,tl.parseHorizontalAlign)(e)}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"button-group",...(0,tl.renderHorizontalAlign)(e.attrs)}),0]});e.s(["CalloutBox",()=>r3],953433),e.s(["CalloutBoxView",()=>r0],928530);var rY=e.i(892684),rX=e.i(343902),rQ=e.i(549678),rJ=e.i(131526);let r0=e=>{let{node:t,editor:i,getPos:n,decorations:a}=e,{variant:r,icon:o,color:s}=t.attrs,{firstChildSize:l}=(0,rQ.findFirstChildFontSizeDeco)(a),{theme:d,isDark:c}=(0,rY.useCardColorMode)(a),u=(0,rJ.getFontSizeStyles)(l,d),p=(0,tT.getThemeColorSolid)((0,tT.getThemePrimaryAccentColor)(d)),{colors:h,icon:m}=(0,f.getCalloutBoxOption)(r),{backgroundColor:g,iconColor:b,bodyColor:x}=s?r1(s):r2(c,h,p),y=(0,j.useCallback)(()=>{if(!i.isEditable)return;let e=n();"number"==typeof e&&i.commands.selectNodeAtPos(e)},[i,n]);return(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsxs)(eg.Box,{backgroundColor:`${g} !important`,pt:"0.25em",pb:"0.5em",px:"1em",className:"calloutBox",borderRadius:"var(--box-border-radius)",css:{"--body-color":x,"--heading-color":x},"data-selection-ring":!0,pos:"relative",children:[(0,_.jsxs)(eG.HStack,{direction:"row",align:l?"baseline":"flex-start",spacing:"1em",children:[o&&(0,_.jsx)(ej.Text,{sx:u,onClick:y,color:b,mt:l?void 0:"1em",contentEditable:!1,children:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:m,fixedWidth:!0})}),(0,_.jsx)(eW.NodeViewContent,{style:{flex:"1 1 auto",minWidth:0},className:(0,G.cx)(eS.HEADING_NO_GRADIENT_CLASS)})]}),(0,_.jsx)(rX.ContainerDragHandle,{handlePlacement:"outside",...e})]})})},r1=e=>{let t=(0,th.isColorDark)(e),i=t?(0,th.colorWithLightness)(e,.7):(0,th.colorWithLightness)(e,.3);return{backgroundColor:e,bodyColor:t?"white":"black",iconColor:i}},r2=(e,t,i)=>{if("accent"===t)return{backgroundColor:e?(0,th.colorWithLightness)(i,.15):(0,th.colorWithLightness)(i,.85),bodyColor:e?"white":"black",iconColor:e?(0,th.colorWithLightness)(i,.7):(0,th.colorWithLightness)(i,.3)};let n=e?t.dark:t.light;return{backgroundColor:n.backgroundColor,bodyColor:e?"white":"black",iconColor:n.iconColor}},r3=(0,tl.createTiptapNode)("calloutBox",{selectable:!0,isolating:!0,containerHandle:!0,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(r0,{update:rj.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"aside",getAttrs:e=>{let t=e.getAttribute("icon");return{variant:e.getAttribute("variant")||"note",color:e.getAttribute("color")||null,...null!=t?{icon:"false"!==t}:{}}}}],renderHTML:({node:e,HTMLAttributes:t})=>["aside",(0,ei.mergeAttributes)(t,{class:"calloutBox",variant:e.attrs.variant,color:e.attrs.color,icon:e.attrs.icon?void 0:"false"}),0]});function r5(e){return new ea.Plugin({props:{handleTextInput:t=>!!(0,ei.isNodeSelection)(t.state.selection)&&e(t.state.selection.node)}})}e.s(["CardCanvasItem",()=>oP],135317),e.s(["CardCanvasItemView",()=>oL],82206);var r4=e.i(349904),r6=e.i(615393);function r9(e){if(!e)return;let t={};for(let i of function(e){let t=[],i=0,n=null,a=0;for(let r=0;r0?i--:";"===o&&0===i&&(t.push(e.slice(a,r)),a=r+1)}return t.push(e.slice(a)),t}(e)){let e=i.indexOf(":");if(e<0)continue;let n=i.slice(0,e).trim(),a=i.slice(e+1).trim();n&&a&&(t[n.startsWith("--")?n:n.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())]=a)}return Object.keys(t).length>0?t:void 0}function r8(e){return 25*Math.round(e/25)}e.s(["parseCssStyleString",0,r9],177890),e.s(["PositionedBoxesWrapper",()=>o_,"useCropBounds",()=>oE],588748),e.s(["getBoxPositions",()=>oC,"useCanvasInteractions",()=>ok],918327);var r7=e.i(658729);class oe{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}emit(e){this.listeners.forEach(t=>t(e))}clear(){this.emit([])}}let ot=new oe,oi="#FF1493";function on({viewBoxHeight:e,isEditable:t}){let[i,n]=(0,j.useState)([]);return((0,j.useEffect)(()=>ot.subscribe(n),[]),t&&0!==i.length)?(0,_.jsx)("g",{className:"snap-guide-lines",pointerEvents:"none",style:{userSelect:"none"},children:i.map((t,i)=>"vertical"===t.direction?(0,_.jsx)("line",{x1:t.position,y1:0,x2:t.position,y2:e,stroke:oi,strokeWidth:1,strokeDasharray:"4 2"},`${t.direction}-${t.position}-${i}`):(0,_.jsx)("line",{x1:0,y1:t.position,x2:r7.DEFAULT_VIEWBOX_WIDTH,y2:t.position,stroke:oi,strokeWidth:1,strokeDasharray:"4 2"},`${t.direction}-${t.position}-${i}`))}):null}function oa(e,t){let i=[],n=e.state.doc.resolve(t),a=n.before(n.depth),r=e.state.doc.nodeAt(a);if(!r)return i;let o=a+1;return r.forEach(e=>{let n=o;if(o+=e.nodeSize,n!==t&&e.type.spec.group?.includes("positionedBox")){let t=e.attrs;i.push({x:t.x,y:t.y,w:t.w,h:t.h})}}),i}function or(e,t,i,n){let a=[],r=i?i.left*r7.DEFAULT_VIEWBOX_WIDTH:0,o=i?(1-i.right)*r7.DEFAULT_VIEWBOX_WIDTH:r7.DEFAULT_VIEWBOX_WIDTH,s=i?i.top*t:0,l=i?(1-i.bottom)*t:t;for(let t of(a.push({position:(r+o)/2,direction:"vertical",source:"container-center"}),a.push({position:(s+l)/2,direction:"horizontal",source:"container-center"}),e)){let e=t.x,i=t.x+t.w,n=t.y,r=t.y+t.h,o=t.x+t.w/2,s=t.y+t.h/2;a.push({position:e,direction:"vertical",source:"sibling-edge"}),a.push({position:i,direction:"vertical",source:"sibling-edge"}),a.push({position:o,direction:"vertical",source:"sibling-center"}),a.push({position:n,direction:"horizontal",source:"sibling-edge"}),a.push({position:r,direction:"horizontal",source:"sibling-edge"}),a.push({position:s,direction:"horizontal",source:"sibling-center"})}return n&&a.push(...function(e){let t=[];for(let e=0;e<=r7.DEFAULT_VIEWBOX_WIDTH;e+=25)t.push({position:e,direction:"vertical",source:"grid"});for(let i=0;i<=e;i+=25)t.push({position:i,direction:"horizontal",source:"grid"});return t}(t)),a}function oo(e,t,i){let n=t.filter(e=>e.direction===i),a=null;for(let t of e)for(let e of n){let i=Math.abs(t-e.position);i<=8&&(!a||ie.direction===i),a=null,r=1/0;for(let t of n){let i=Math.abs(e-t.position);i<=8&&iod,"useBoxInteractions",()=>om],53092);let od=6,oc={"top-left":"nwse-resize",top:"ns-resize","top-right":"nesw-resize",right:"ew-resize","bottom-right":"nwse-resize",bottom:"ns-resize","bottom-left":"nesw-resize",left:"ew-resize"},ou=(e,t)=>e/t*r7.DEFAULT_VIEWBOX_WIDTH,op=e=>e.height/e.width*r7.DEFAULT_VIEWBOX_WIDTH,oh=(e,t)=>e?{minX:e.left*r7.DEFAULT_VIEWBOX_WIDTH,maxX:(1-e.right)*r7.DEFAULT_VIEWBOX_WIDTH,minY:e.top*t,maxY:(1-e.bottom)*t}:{minX:0,maxX:r7.DEFAULT_VIEWBOX_WIDTH,minY:0,maxY:t},om=({x:e,y:t,w:i,h:n,isImageBox:a,editor:r,getPos:o,getContainerElement:s,elementRef:l,crop:d,enabled:c=!0})=>{let u=(0,j.useRef)(!1),p=(0,j.useRef)(!1),h=(0,j.useRef)({x:e,y:t}),m=(0,j.useRef)({w:i,h:n}),[g,f]=(0,j.useState)(!1),[b,x]=(0,j.useState)({x:e,y:t}),[y,v]=(0,j.useState)({w:i,h:n});(0,j.useEffect)(()=>{c&&(u.current||p.current||(x({x:e,y:t}),h.current={x:e,y:t}))},[c,e,t]),(0,j.useEffect)(()=>{c&&(p.current||(v({w:i,h:n}),m.current={w:i,h:n}))},[c,i,n]);let C=(0,j.useCallback)((e,t)=>{if(!l.current)return!1;let i=l.current.getBoundingClientRect(),n=e-i.left,a=i.right-e,r=t-i.top,o=i.bottom-t,s=6>=Math.abs(n),d=6>=Math.abs(a),c=6>=Math.abs(r),u=6>=Math.abs(o),p=r>=-6&&o>=-6,h=n>=-6&&a>=-6;return s&&p||d&&p||c&&h||u&&h},[l]),w=(0,j.useCallback)((e,t)=>{let{minX:i,maxX:n,minY:a,maxY:r}=oh(d,op(t));return{x:Math.min(n-y.w,Math.max(i,e.x)),y:Math.min(r-y.h,Math.max(a,e.y))}},[y.w,y.h,d]),S=(0,j.useCallback)(e=>{!a&&r.isEditable&&f(C(e.clientX,e.clientY))},[a,C,r]),k=(0,j.useCallback)(()=>{f(!1)},[]),A=(0,j.useCallback)(e=>{if(!r.isEditable)return;let t=C(e.clientX,e.clientY);if(!a&&!t)return;let i=o();if(void 0!==i&&r.chain().focus().setNodeSelection(i).run(),u.current=!1,!l.current)return;e.preventDefault(),e.stopPropagation();let n=e.clientX,c=e.clientY,p=l.current.getBoundingClientRect(),m={x:n-p.left,y:c-p.top},g=s();if(!g)return;let f=e=>{if(!g)return;let t=g.getBoundingClientRect(),i=Math.abs(e.clientX-n),a=Math.abs(e.clientY-c);if(!u.current){if(i<=5&&a<=5)return;u.current=!0}let s=e.clientX-m.x,l=e.clientY-m.y,p=ou(s-t.left,t.width),f=ou(l-t.top,t.width),b=o();if(r.isEditable&&!e.altKey&&void 0!==b){let e=op(t),i=or(oa(r,b),e,d),n=os({x:p,y:f,w:y.w,h:y.h},i);p=n.position.x,f=n.position.y,ot.emit(n.activeGuides)}else ot.clear();let v=w({x:p,y:f},t);h.current=v,x(v)},b=()=>{if(document.removeEventListener("mousemove",f),document.removeEventListener("mouseup",b),ot.clear(),u.current){u.current=!1;let e=o();void 0!==e&&r.chain().updateAttributesAtPos(e,{x:h.current.x,y:h.current.y}).setNodeSelection(e).run()}};document.addEventListener("mousemove",f),document.addEventListener("mouseup",b)},[a,C,s,w,r,o,l,y,d]),E=(0,j.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),p.current=!0;let i=e.clientX,n=e.clientY,a=y.w,l=y.h,c=b.x,u=b.y,g=s();if(!g)return;let f={left:t.includes("left"),right:t.includes("right"),top:t.includes("top"),bottom:t.includes("bottom")},C=e=>{if(!g)return;let t=g.getBoundingClientRect(),s=op(t),p=ou(e.clientX-i,t.width),b=ou(e.clientY-n,t.width),y=c,C=u,w=a,S=l,k=oh(d,s);f.right?w=Math.max(50,a+p):f.left&&(w=Math.max(50,a-p),(y=c+p){document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",w),ot.clear(),p.current=!1;let e=o();void 0!==e&&r.chain().updateAttributesAtPos(e,{x:h.current.x,y:h.current.y,w:m.current.w,h:m.current.h}).setNodeSelection(e).run()};document.addEventListener("mousemove",C),document.addEventListener("mouseup",w)},[y,b,s,r,o,d]),I=(0,j.useMemo)(()=>r.isEditable?a||g?"move":"text":"auto",[r,a,g]);return{tempPosition:b,tempDimensions:y,isInBorderZone:g,cursor:I,handleMouseDown:A,handleMouseMove:S,handleMouseLeave:k,ResizeHandles:({selected:e})=>e&&r.isEditable?(0,_.jsx)(_.Fragment,{children:["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"].map(e=>(0,_.jsx)(og,{position:e,onMouseDown:E},e))}):null}},og=({position:e,onMouseDown:t})=>{let i;return(0,_.jsx)("div",{style:(i={position:"absolute",width:8,height:8,backgroundColor:"white",border:"2px solid var(--chakra-colors-blue-600)",borderRadius:2,cursor:oc[e],zIndex:10},e.includes("left")?i.left=od-4:e.includes("right")?i.right=od-4:(i.left="50%",i.marginLeft=-4),e.includes("top")?i.top=od-4:e.includes("bottom")?i.bottom=od-4:(i.top="50%",i.marginTop=-4),i),onMouseDown:i=>t(i,e),contentEditable:!1,"data-resize-handle":e})};var of=e.i(846443);function ob(e,t,i=6){let n=e.y+e.h,a=e.x,r=e.x+e.w;return t.filter(t=>{if(t.id===e.id)return!1;let o=Math.abs(t.y-n)<=i,s=t.x+t.w,l=t.xa;return o&&l})}function ox(e,t,i,n=new Set){let a=new Map,r=e.h-t;if(0===r)return a;let o=ob({...e,h:t},i),s=i.filter(t=>n.has(t.id)&&t.id!==e.id&&!o.some(e=>e.id===t.id)),l=[...o,...s],d=new Set;for(;l.length>0;){let t=l.shift();if(!d.has(t.id))for(let o of(d.add(t.id),n.add(t.id),a.set(t.id,{dy:r}),ob(t,i)))d.has(o.id)||o.id===e.id||l.push(o)}return a}e.s(["computeStickyPushes",0,ox],969987);let oy=e=>"positionedTextbox"===e||"positionedContentBox"===e,ov=(e,t)=>e/t*r7.DEFAULT_VIEWBOX_WIDTH;function oC(e,t){let i=[],n=e.state.doc.nodeAt(t);if(!n)return i;let a=t+1;return n.forEach(e=>{let t=a;a+=e.nodeSize,e.type.spec.group?.includes("positionedBox")&&i.push({pos:t,attrs:{id:e.attrs.id??String(t),x:e.attrs.x,y:e.attrs.y,w:e.attrs.w,h:e.attrs.h}})}),i}function ow(e,t){return e.x>=t.x&&e.y>=t.y&&e.x+e.w<=t.x+t.w&&e.y+e.h<=t.y+t.h}function oS(e,t,i){let n,a=e.view.dom.ownerDocument,r=null,o=0;if("caretPositionFromPoint"in a){let e=a.caretPositionFromPoint(t,i);e&&(r=e.offsetNode,o=e.offset)}else if("caretRangeFromPoint"in a){let e=a.caretRangeFromPoint(t,i);e&&(r=e.startContainer,o=e.startOffset)}if(!r)return!1;let s=e.view;try{n=s.docView.posFromDOM(r,o,1)}catch{return!1}if(n<0||!e.state.doc.resolve(n).parent.isTextblock)return!1;e.view.hasFocus()||e.view.focus();let l=ea.TextSelection.create(e.state.doc,n);return e.view.dispatch(e.state.tr.setSelection(l)),!0}function ok({editor:e,containerRef:t,isEditable:i}){let[n,a]=(0,j.useState)({marquee:null,isDragging:!1,showDotGrid:!1,isResizing:!1}),r=(0,j.useRef)(new Set),o=(0,j.useRef)(null),s=(0,j.useCallback)(()=>{let i=t.current;if(!i)return null;let n=i.closest(".positioned-boxes-wrapper");if(!n)return null;let a=n.closest("[data-node-view-wrapper]");if(!a)return null;let r=e.view.posAtDOM(a,0);return r>0?r-1:null},[e,t]),l=(0,j.useCallback)((t,i)=>{let n=ov(t.clientX-i.left,i.width),r=ov(t.clientY-i.top,i.width),o=s();if(null===o)return;let l=t.clientX,d=t.clientY,c=!1,u=e=>{if(!c){let t=e.clientX-l,i=e.clientY-d;if(3>=Math.abs(t)&&3>=Math.abs(i))return;c=!0}let t=ov(e.clientX-i.left,i.width),o=ov(e.clientY-i.top,i.width),s={x:Math.min(n,t),y:Math.min(r,o),w:Math.abs(t-n),h:Math.abs(o-r)};a(e=>({...e,marquee:s}))},p=t=>{if(document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",p),!c){if(null!==o){let{tr:t}=e.state;t.setSelection(ea.TextSelection.create(e.state.doc,o+1)),e.view.dispatch(t)}a(e=>({...e,marquee:null}));return}let s=ov(t.clientX-i.left,i.width),l=ov(t.clientY-i.top,i.width),d={x:Math.min(n,s),y:Math.min(r,l),w:Math.abs(s-n),h:Math.abs(l-r)};if(null!==o){let t=oC(e,o).filter(e=>{var t;return t=e.attrs,t.xd.x&&t.yd.y}).map(e=>e.pos);if(t.length>0){let i=of.CanvasSelection.create(e.state.doc,t);e.view.dispatch(e.state.tr.setSelection(i).scrollIntoView())}else{let{tr:t}=e.state;t.setSelection(ea.TextSelection.create(e.state.doc,o+1)),e.view.dispatch(t)}}a(e=>({...e,marquee:null}))};document.addEventListener("mousemove",u),document.addEventListener("mouseup",p)},[e,s]),d=(0,j.useCallback)((t,i,n)=>{t.preventDefault(),t.stopPropagation();let r=t.clientX,s=e.state.doc.nodeAt(i);if(!s)return;let l=s.attrs.w,d=!1,c=l,u=document.createElement("div");u.style.cssText="position:fixed;pointer-events:none;z-index:99999;background:rgba(99,102,241,0.9);color:#fff;font-size:11px;font-family:system-ui,sans-serif;font-weight:600;padding:2px 6px;border-radius:4px;white-space:nowrap;display:none;",document.body.appendChild(u),document.body.style.cursor="ew-resize",a(e=>({...e,isResizing:!0,showDotGrid:!0}));let p=e.view.nodeDOM(i),h=p?.querySelector(".positioned-textbox")??null,m=h?.parentElement??null,g=e=>{let t=e.clientX-r;if(!d&&3>=Math.abs(t))return;d=!0;let i=Math.max(50,r8(l+ov(t,n.getBoundingClientRect().width)));c=i;let a=Math.round(i/r7.DEFAULT_VIEWBOX_WIDTH*100);if(u.textContent=`${a}%`,u.style.display="block",m&&(m.style.width=`${i+2*od}px`),h){let e=h.getBoundingClientRect();u.style.left=`${e.right+8}px`,u.style.top=`${e.top+e.height/2-10}px`}},f=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",b),u.remove(),document.body.style.cursor="",m&&(m.style.width=""),o.current===f&&(o.current=null)},b=()=>{if(f(),d&&c!==l){let t=e.state.doc.nodeAt(i);if(t){let{tr:n}=e.state;n.setNodeMarkup(i,void 0,{...t.attrs,w:c});try{n.setSelection(of.CanvasSelection.single(n.doc,i))}catch{}e.view.dispatch(n)}}a(e=>({...e,isResizing:!1,showDotGrid:!1}))};o.current=f,document.addEventListener("mousemove",g),document.addEventListener("mouseup",b)},[e]),c=(0,j.useCallback)(n=>{if(!i)return;let c=t.current;if(!c)return;let u=c.getBoundingClientRect(),p=s();if(null===p)return;let h=oC(e,p),m=n.target,g=null,f=null;for(let t of h){let i=e.view.nodeDOM(t.pos);if(i&&(i===m||i.contains(m))){g=t,f=i.querySelector(".positioned-box");break}}let{selection:b}=e.state;if(m.hasAttribute("data-canvas-resize-handle")||null!==m.closest("[data-canvas-resize-handle]")){let t=null;if(b instanceof of.CanvasSelection&&!b.isMulti)t=b.positions[0];else if(b instanceof ea.TextSelection){let e=b.$from;for(let i=e.depth;i>0;i--)if(oy(e.node(i).type.name)){t=e.before(i);break}}else g&&(t=g.pos);if(null!==t){if(!(b instanceof of.CanvasSelection)||!b.hasPosition(t)){let i=of.CanvasSelection.single(e.state.doc,t);e.view.hasFocus()||e.view.focus(),e.view.dispatch(e.state.tr.setSelection(i))}d(n,t,c);return}}if(!g||!f){n.preventDefault(),n.stopPropagation(),l(n,u);return}if(n.shiftKey&&b instanceof of.CanvasSelection){let t=b.togglePosition(e.state.doc,g.pos);e.view.hasFocus()||e.view.focus(),e.view.dispatch(e.state.tr.setSelection(t)),n.preventDefault(),n.stopPropagation();return}let x=f.getBoundingClientRect(),y=n.clientX>=x.left&&n.clientX<=x.right&&n.clientY>=x.top&&n.clientY<=x.bottom,v=e.state.doc.nodeAt(g.pos),C=null!=v&&oy(v.type.name)||v?.type.name==="positionedHtmlBox"&&v.childCount>0,w=e=>oy(e)||"positionedHtmlBox"===e,S=!1;if(C&&b instanceof ea.TextSelection){let e=b.$from;for(let t=e.depth;t>0;t--)if(w(e.node(t).type.name)){S=e.before(t)===g.pos;break}}let k=b instanceof of.CanvasSelection&&b.hasPosition(g.pos),A=k&&b.isMulti;if(C&&y&&S)return;if(C&&y&&!k){oS(e,n.clientX,n.clientY),n.preventDefault(),n.stopPropagation();return}if(!k){let t=of.CanvasSelection.single(e.state.doc,g.pos);e.view.hasFocus()||e.view.focus(),e.view.dispatch(e.state.tr.setSelection(t))}n.preventDefault(),n.stopPropagation();let E=n.clientX,_=n.clientY,I=!1,M=k?b.positions:[g.pos],T=M.map(e=>h.find(t=>t.pos===e)).filter(Boolean),L=h.filter(e=>!M.includes(e.pos)&&T.some(t=>ow(e.attrs,t.attrs))).map(e=>e.pos),j=[...M,...L],P=t=>e.view.nodeDOM(t),D=[];for(let e of j){let t=P(e);t&&D.push({pos:e,dom:t})}let N=new Map,R=0,O=0,B=null,z=null,F=e=>{let t=e.clientX-E,i=e.clientY-_;if(!I){if(3>=Math.abs(t)&&3>=Math.abs(i))return;I=!0,document.body.style.cursor="grabbing",a(e=>({...e,isDragging:!0,showDotGrid:!0}))}let n=c.getBoundingClientRect(),o=ov(t,n.width),s=ov(i,n.width),l=1/0,d=1/0,u=-1/0,p=-1/0;for(let e of T)l=Math.min(l,e.attrs.x),d=Math.min(d,e.attrs.y),u=Math.max(u,e.attrs.x+e.attrs.w),p=Math.max(p,e.attrs.y+e.attrs.h);let m=u-l,g=p-d,f=r8(l+o),b=r8(d+s);if(e.altKey)ot.clear();else{let e=n.height/n.width*r7.DEFAULT_VIEWBOX_WIDTH,t=new Set(j),i=os({x:f,y:b,w:m,h:g},or(h.filter(e=>!t.has(e.pos)).map(e=>e.attrs),e));f=i.position.x,b=i.position.y,ot.emit(i.activeGuides)}let x=f-l,y=b-d;R=x,O=y;let v=`translate(${x}px, ${y}px)`;for(let{dom:e}of D)e.style.transform=v;let C=new Map;if(0!==y){let e=new Set(j);for(let t of T){let i={...t.attrs,x:t.attrs.x+x,y:t.attrs.y+y},n=h.map(e=>e.attrs);for(let[a,o]of ox(i,t.attrs.h-y,n,r.current)){let t=h.find(e=>e.attrs.id===a);t&&(e.has(t.pos)||C.set(t.pos,o.dy))}}}for(let e of N.keys())if(!C.has(e)){let t=P(e);t&&(t.style.transform="")}for(let[e,t]of C){let i=P(e);i&&(i.style.transform=`translate(0, ${t}px)`)}for(let[e,t]of(N.clear(),C))N.set(e,t)},H=e=>{z=e,null===B&&(B=requestAnimationFrame(()=>{B=null,z&&F(z)}))},W=()=>{for(let{dom:e}of(document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",U),null!==B&&(cancelAnimationFrame(B),B=null),D))e.style.transform="";for(let e of N.keys()){let t=P(e);t&&(t.style.transform="")}ot.clear(),document.body.style.cursor="",r.current.clear(),a(e=>({...e,isDragging:!1,showDotGrid:!1})),o.current===W&&(o.current=null)},U=()=>{if(null!==B&&z&&F(z),W(),I&&(0!==R||0!==O)){let{tr:t}=e.state;for(let{pos:e,box:i}of j.map(e=>{let t=h.find(t=>t.pos===e);return t?{pos:e,box:t}:null}).filter(e=>!!e).sort((e,t)=>t.pos-e.pos)){let n=t.doc.nodeAt(e);n&&t.setNodeMarkup(e,void 0,{...n.attrs,x:i.attrs.x+R,y:i.attrs.y+O})}for(let[e,i]of[...N.entries()].sort((e,t)=>t[0]-e[0])){let n=t.doc.nodeAt(e);if(!n)continue;let a=h.find(t=>t.pos===e);a&&t.setNodeMarkup(e,void 0,{...n.attrs,y:a.attrs.y+i})}let i=M.map(e=>t.mapping.map(e));try{t.setSelection(of.CanvasSelection.create(t.doc,i))}catch{}e.view.dispatch(t)}if(!I&&k&&!A&&y){let t=e.state.doc.nodeAt(g.pos);(null!=t&&oy(t.type.name)||t?.type.name==="positionedHtmlBox"&&t.childCount>0)&&oS(e,E,_)}};o.current=W,document.addEventListener("mousemove",H),document.addEventListener("mouseup",U)},[i,e,t,s,l,d]);return(0,j.useEffect)(()=>{if(!i)return;let t=t=>{let{selection:i}=e.state;if("Escape"===t.key){if(i instanceof ea.TextSelection){let n=i.$from;for(let i=n.depth;i>0;i--)if(oy(n.node(i).type.name)){let a=n.before(i),r=of.CanvasSelection.single(e.state.doc,a);e.view.hasFocus()||e.view.focus(),e.view.dispatch(e.state.tr.setSelection(r)),t.preventDefault();return}}if(i instanceof of.CanvasSelection){let i=s();if(null!==i){let{tr:t}=e.state;t.setSelection(ea.TextSelection.create(e.state.doc,i+1)),e.view.dispatch(t)}t.preventDefault();return}}if(!(i instanceof of.CanvasSelection))return;let n={ArrowUp:{dx:0,dy:-1},ArrowDown:{dx:0,dy:1},ArrowLeft:{dx:-1,dy:0},ArrowRight:{dx:1,dy:0}}[t.key];if(n){let a;t.preventDefault(),a=t.altKey?1:t.shiftKey?50:25;let o=n.dx*a,l=n.dy*a,d=s();if(null===d)return;let c=oC(e,d),{tr:u}=e.state,p=c.filter(e=>i.hasPosition(e.pos)),h=c.filter(e=>!i.hasPosition(e.pos)&&p.some(t=>ow(e.attrs,t.attrs))),m=[...p,...h].sort((e,t)=>t.pos-e.pos);for(let e of m){let t=u.doc.nodeAt(e.pos);t&&u.setNodeMarkup(e.pos,void 0,{...t.attrs,x:e.attrs.x+o,y:e.attrs.y+l})}if(0!==l)for(let e of p){let t={...e.attrs,y:e.attrs.y+l},i=c.map(e=>e.attrs);for(let[n,a]of ox(t,e.attrs.h-l,i,r.current)){let e=c.find(e=>e.attrs.id===n);if(e&&!m.some(t=>t.pos===e.pos)){let t=u.doc.nodeAt(e.pos);t&&u.setNodeMarkup(e.pos,void 0,{...t.attrs,y:e.attrs.y+a.dy})}}}let g=i.positions.map(e=>u.mapping.map(e));try{u.setSelection(of.CanvasSelection.create(u.doc,g))}catch{}e.view.dispatch(u);return}if((t.metaKey||t.ctrlKey)&&"d"===t.key){t.preventDefault();let n=s();if(null===n)return;let{tr:a}=e.state,r=[];for(let t of i.positions){let i=e.state.doc.nodeAt(t);if(!i)continue;let o=e.state.doc.nodeAt(n);if(!o)continue;let s=n+1+o.content.size,l=i.type.create({...i.attrs,x:i.attrs.x+25,y:i.attrs.y+25,id:null},i.content,i.marks),d=a.mapping.map(s);a.insert(d,l),r.push(d)}if(r.length>0)try{a.setSelection(of.CanvasSelection.create(a.doc,r))}catch{}e.view.dispatch(a)}};return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[i,e,s]),(0,j.useEffect)(()=>{if(!i)return;let e=t.current;if(e)return e.addEventListener("mousedown",c),()=>{e.removeEventListener("mousedown",c),o.current?.()}},[i,t,c]),{state:n}}let oA=(0,j.createContext)(null),oE=()=>(0,j.useContext)(oA),o_=({aspectRatio:e,children:t,handleSelect:i,crop:n,editor:a})=>{let r={width:r7.DEFAULT_VIEWBOX_WIDTH,height:r7.DEFAULT_VIEWBOX_WIDTH/e},o=(0,R.useAppSelector)(B.selectEditable),s=(0,r7.getPositionedBoxStyles)({isEditable:o}),l=(0,P.useFeatureFlag)("canvasInteractions"),d=(0,j.useRef)(null),c=ok({editor:a,containerRef:d,isEditable:o&&l&&!!a}),u=(0,j.useCallback)(e=>{e.target.matches(".positioned-boxes-wrapper")&&o&&(i?.(),e.preventDefault())},[o,i]);return(0,eU.isSafari)()?(0,_.jsx)(oA.Provider,{value:n??null,children:(0,_.jsx)(oM,{viewBox:r,positionedBoxStyles:s,onMouseDown:u,isEditable:o,canvasInteractionsEnabled:l,canvasInteractions:c,canvasContainerRef:d,children:t})}):(0,_.jsx)(oA.Provider,{value:n??null,children:(0,_.jsxs)(eg.Box,{ref:d,pos:"absolute",inset:"0",width:"100%",height:"100%",borderRadius:"inherit",overflow:"hidden",sx:s,cursor:"default",onMouseDown:l?void 0:u,className:"positioned-boxes-wrapper",children:[(0,_.jsx)(oI,{enabled:l,canvasInteractions:c,viewBox:r}),(0,_.jsxs)("svg",{viewBox:`0 0 ${r.width} ${r.height}`,preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%",style:{overflow:"visible",display:"block"},pointerEvents:"none",children:[(0,_.jsx)("foreignObject",{x:"0",y:"0",width:r.width,height:r.height,style:{overflow:"visible"},children:(0,_.jsx)(eg.Box,{position:"relative",width:"100%",height:"100%",css:{"& > *":{pointerEvents:"auto"}},children:t})}),(0,_.jsx)(on,{viewBoxHeight:r.height,isEditable:o})]})]})})};function oI({enabled:e,canvasInteractions:t,viewBox:i}){let n=(0,j.useId)();if(!e)return null;let{state:a}=t;return(0,_.jsxs)(_.Fragment,{children:[a.showDotGrid&&(0,_.jsx)(eg.Box,{pos:"absolute",inset:"0",pointerEvents:"none",zIndex:0,children:(0,_.jsxs)("svg",{width:"100%",height:"100%",viewBox:`0 0 ${i.width} ${i.height}`,preserveAspectRatio:"xMidYMid meet",style:{display:"block"},children:[(0,_.jsx)("defs",{children:(0,_.jsx)("pattern",{id:n,x:-12.5,y:-12.5,width:25,height:25,patternUnits:"userSpaceOnUse",children:(0,_.jsx)("circle",{cx:12.5,cy:12.5,r:1.5,fill:"var(--chakra-colors-gray-300)"})})}),(0,_.jsx)("rect",{width:i.width,height:i.height,fill:`url(#${n})`})]})}),a.marquee&&(0,_.jsx)(eg.Box,{pos:"absolute",pointerEvents:"none",zIndex:10,border:"1px solid",borderColor:"blue.400",bg:"blue.50",opacity:.5,style:{insetInlineStart:`${a.marquee.x/i.width*100}%`,top:`${a.marquee.y/i.height*100}%`,width:`${a.marquee.w/i.width*100}%`,height:`${a.marquee.h/i.height*100}%`}})]})}function oM({viewBox:e,positionedBoxStyles:t,onMouseDown:i,isEditable:n,canvasInteractionsEnabled:a,canvasInteractions:r,canvasContainerRef:o,children:s}){let l=(0,j.useRef)(null),[d,c]=(0,j.useState)(null);return(0,j.useLayoutEffect)(()=>{let t=l.current;if(!t)return;let i=()=>{let i=t.clientWidth;i>0&&c(i/e.width)};i();let n=new ResizeObserver(()=>i());return n.observe(t),()=>n.disconnect()},[e.width]),(0,_.jsxs)(eg.Box,{ref:e=>{l.current=e,o.current=e},pos:"absolute",inset:"0",width:"100%",height:"100%",borderRadius:"inherit",overflow:"hidden",sx:t,cursor:"default",onMouseDown:a?void 0:i,className:"positioned-boxes-wrapper",children:[(0,_.jsx)(oI,{enabled:a,canvasInteractions:r,viewBox:e}),(0,_.jsx)(eg.Box,{position:"relative",width:`${e.width}px`,height:`${e.height}px`,transform:null!=d?`scale(${d})`:void 0,transformOrigin:"top left",visibility:null!=d?"visible":"hidden",css:{"& > *":{pointerEvents:"auto"}},children:s}),(0,_.jsx)(eg.Box,{pos:"absolute",inset:"0",pointerEvents:"none",width:"100%",height:"100%",children:(0,_.jsx)("svg",{viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMidYMid meet",width:"100%",height:"100%",style:{display:"block"},children:(0,_.jsx)(on,{viewBoxHeight:e.height,isEditable:n})})})]})}var oT=e.i(196444);let oL=e=>{let{node:t,editor:i,getPos:n,decorations:a}=e,{style:r,aspectRatio:o}=t.attrs,s=(0,P.useFeatureFlag)("canvasInteractions"),l=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW,d=(0,oT.isSelectingNode)(a),c=(0,j.useCallback)(()=>{if(s)return;let e=n();void 0!==e&&i.commands.setNodeSelection(e)},[i,n,s]),u=(0,j.useMemo)(()=>r9(r),[r]);return(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsx)(r4.Center,{className:"canvas-card",position:"relative",w:"100%",h:l?"100vh":"100%",overflow:"visible",cursor:"default",borderRadius:"var(--card-border-radius)",contentEditable:!d&&void 0,suppressContentEditableWarning:!0,children:(0,_.jsx)(eg.Box,{position:"relative",w:"100%",aspectRatio:l?void 0:`${o||16/9}`,h:l?"100%":void 0,style:u,borderRadius:"inherit",onClick:c,"data-selection-ring":!0,"data-selection-background":!0,children:(0,_.jsx)(o_,{aspectRatio:o||16/9,handleSelect:c,editor:i,children:(0,_.jsx)(eW.NodeViewContent,{})})})})})},oj=e=>"cardCanvasItem"===e.type.name,oP=(0,tl.createTiptapNode)("cardCanvasItem",{draggable:!1,isolating:!0,selectable:!0,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(oL,{update:rj.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=canvas-card]",getAttrs:e=>{let t={id:(0,tl.parseIdAttr)(e,rm.generateMediaId)},i=e.getAttribute("data-background");i&&(t.background=i);let n=e.getAttribute("data-style");n&&(t.style=n);let a=e.getAttribute("data-aspect-ratio");return a&&(t.aspectRatio=Number(a)),t}}],renderHTML({node:e,HTMLAttributes:t}){let i={class:"canvas-card","data-id":e.attrs.id};return e.attrs.background&&(i["data-background"]=e.attrs.background),e.attrs.style&&(i["data-style"]=e.attrs.style),e.attrs.aspectRatio!==16/9&&(i["data-aspect-ratio"]=String(e.attrs.aspectRatio)),["div",(0,ei.mergeAttributes)(t,i),0]},addProseMirrorPlugins:()=>[r5(oj)]});e.s(["CardCodeItem",()=>oZ],708235),e.s(["CardCodeItemView",()=>oG],198905);var oD=e.i(277051),oN=e.i(741783),oR=e.i(147349),oO=e.i(283591);let oB=(0,j.forwardRef)(({dimensions:e,enforceMinDimensions:t,isThumbnail:i,isLoading:n,disableSpinner:a,children:r,...o},s)=>{let l=(0,P.useFeatureFlag)("enableVirtualization"),d=(0,oO.useIsThemeDark)();if(!l)return(0,_.jsx)(_.Fragment,{children:r});let c=e?{width:`${e.width}px`,height:`${e.height}px`}:{};return(!0===n||t)&&(c.minHeight=c.height),void 0!==n&&(c.height=void 0,c.width=void 0),(0,_.jsxs)(L.Flex,{backgroundColor:!1===n?"transparent":d?"whiteAlpha.200":"blackAlpha.200",ref:s,position:!1!==n?"relative":"static",transition:"background-color .2s",...c,...o,children:[r,!a&&!1!==n&&(0,_.jsx)(oR.Spinner,{position:"absolute",top:"50%",insetStart:"50%",colorScheme:"gray",size:i?"xs":"md"})]})});oB.displayName="VirtualizedPlaceholder",e.s(["VirtualizedPlaceholder",0,oB],842252);var oz=e.i(700652);let oF=(e={})=>{let t=(0,R.useAppSelector)(B.selectIsFullyInPresentMode),i=(0,R.useAppSelector)(B.selectPresentingCardId),n=!1!==e.memoGroup&&(t?`${e.memoGroup?`${e.memoGroup}:`:""}presenting:${i}`:void 0);return(0,oz.useIsInViewport)({...e,memoGroup:n})};e.s(["useNodeIsInViewport",0,oF],979353);let oH=["--body-color","--body-font","--body-font-weight","--heading-color","--heading-font","--heading-font-weight","--card-color","--primary-color","--shape-bg-color","--shape-border-color","--card-inner-padding","--card-border-radius","--box-border-radius"],oW="gamma-code-card-content",oU=` @keyframes gammaCodeCardShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } } .${oW} img:not([src]), .${oW} img[src=""] { background: linear-gradient( 90deg, color-mix(in srgb, var(--body-color, #888) 6%, transparent) 0%, color-mix(in srgb, var(--body-color, #888) 18%, transparent) 50%, color-mix(in srgb, var(--body-color, #888) 6%, transparent) 100% ); background-size: 200% 100%; animation: gammaCodeCardShimmer 1.6s ease-in-out infinite; border-radius: var(--box-border-radius, 0.4em); min-height: 1em; min-width: 1em; }`,oV=``,oG=e=>{let{node:t,editor:i}=e,n=t.attrs.code,a=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW;(0,P.useFeatureFlag)("virtualizeEmbeds");let[r,o]=(0,j.useState)(),s=(0,j.useRef)(null),l=(0,j.useRef)(null),[d,c]=(0,j.useState)(null),{inViewport:u,ref:p,dimensions:h}=oF(),m=(0,j.useCallback)(e=>{p(e),c(e)},[p]),g=(0,j.useMemo)(()=>{let e;return d?(e=getComputedStyle(d),oH.map(t=>{let i=e.getPropertyValue(t)?.trim();return i?`${t}: ${i}`:""}).filter(Boolean).join("; ")):""},[d]);return(0,j.useMemo)(()=>{let e,t,i=(e=Array.from(document.querySelectorAll("link[data-gamma-font]")).map(e=>e.href).filter(Boolean).map(e=>``).join("\n"),t=g.includes("Eudoxus Sans")?``:"",`${e} ${t}`);return` ${i} ${n}${oV}`},[n,g]),(0,j.useEffect)(()=>{let e=e=>{e.source===s.current?.contentWindow&&e.data?.type==="codeCardResize"&&o(e.data.height)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]),(0,j.useEffect)(()=>{if(!l.current)return;let e=oD.default.sanitize(n,{ADD_TAGS:["script"],FORCE_BODY:!0}),t=l.current;t.innerHTML=e,t.querySelectorAll("script").forEach(e=>{let t=document.createElement("script");Array.from(e.attributes).forEach(e=>{t.setAttribute(e.name,e.value)}),t.textContent=e.textContent,e.parentNode?.replaceChild(t,e)})},[n]),(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsx)(eg.Box,{ref:m,contentEditable:!1,onMouseDown:e3.preventDefaultToAvoidBlur,overflow:"hidden",borderRadius:"var(--card-border-radius)",sx:a?o$:void 0,children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("style",{dangerouslySetInnerHTML:{__html:oU}}),(0,_.jsx)("div",{ref:l,className:oW})]})})})},o$={h:"100vh",overflowY:"auto"},oZ=(0,tl.createTiptapNode)("cardCodeItem",{selectable:!1,draggable:!1,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(oG,{update:rj.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=custom-code]",getAttrs:e=>({id:(0,tl.parseIdAttr)(e,rm.generateMediaId),code:e.getAttribute("data-code")||"",aiGenerateStatus:e.getAttribute("data-aigeneratestatus")||null})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"custom-code","data-id":e.attrs.id,...e.attrs.code&&{"data-code":e.attrs.code},...e.attrs.aiGenerateStatus&&{"data-aigeneratestatus":e.attrs.aiGenerateStatus}})],addExtensions:()=>[oK]}),oK=rv.UniqueAttribute.extend({name:"UniqueCodeCardId"}).configure({attributeName:"id",types:["codeCard"],initialValue:rm.generateMediaId,filterTransaction:ry.isLocalTransaction,pluginKey:new ea.PluginKey("UniqueCodeCardId")});e.s(["CardCommands",()=>sl],613037);var oq=e.i(921679),oY=e.i(949125),oX=e.i(150215);e.i(734710);var oQ=e.i(430378),oJ=e.i(78387),o0=e.i(120604),o1=e.i(647477),o2=e.i(338538),o3=e.i(509510),o5=m;e.i(24439);var o4=e.i(103630),o6=e.i(6419),o9=e.i(372764),o8=e.i(204319),o7=e.i(854861),se=e.i(398358),st=e.i(85547);let si=(e,t)=>{let i=t.doc.resolve(e);if(!i.nodeBefore)return!1;let n=e-i.nodeBefore.nodeSize,a=t.doc.nodeAt(n);if(!a||!(0,o4.isCardNode)(a))return!1;let r=(0,se.hasCardNotes)(a),o=i.nodeAfter&&(0,se.hasCardNotes)(i.nodeAfter),s=null;o&&(s=r?sr(t.doc,n,!0):n+a.nodeSize-1);let l=sn(t,e);if(!l)return!1;t.delete(e,e+i.nodeAfter.nodeSize);let d=sa(t,n,!0);if(s&&o){let e=(0,se.findCardNotes)(i);if(e){let i=r?e.node.content:e.node;t.insert(s,i),t.setMeta("cardNotesHandled",!0)}}t.insert(d,l.node.content);let c=(0,rz.findSelectionNearOrGapCursor)(t.doc.resolve(d));c&&t.setSelection(c);let u={type:"merge-cards",contentPos:l.pos,insertPos:d};return t.setMeta("annotationEvent",u),!0},sn=(e,t)=>{let i=(0,o7.getCardLayoutItems)(e,t);return 0===Object.entries(i).length?{node:e.doc.nodeAt(t),pos:t}:i.body||null},sa=(e,t,i=!1)=>{let n=(0,o7.getCardLayoutItems)(e,t),a=e.doc.resolve(t);if(0===Object.entries(n).length)return i?a.doc.resolve(a.start(a.depth+1)).end():t+1;if(!n.body)throw Error(`Could not find card body at cardPos=${t}`);let r=e.doc.resolve(n.body.pos);return i?r.doc.resolve(r.start(r.depth+1)).end():r.pos+1},sr=(e,t,i=!1)=>{let n=e.resolve(t),a=(0,se.findCardNotes)(n);if(!a)return null;let r=e.resolve(a.pos);return i?r.doc.resolve(r.start(r.depth+1)).end():r.pos+1};var so=e.i(271910);let ss=/^(\*\*\*)/,sl=ei.Extension.create({name:"cardCommands",addCommands:()=>({resetCardSettings:e=>({state:t,dispatch:i,chain:n})=>{if(!i)return!0;let a=n();return t.doc.descendants((t,i)=>{(0,o4.isCardNode)(t)&&a.updateNestedAttributesAtPos(i,e)}),!0},splitCardAtSelection:()=>e=>(sd(e),!0),insertNestedCard:()=>({state:e,chain:t,dispatch:i,editor:n})=>{if(!i)return!0;let{from:a,$from:r}=e.selection;return t().insertContentAndSelect((0,o5.EMPTY_NODES)().insertCardInside).command(({tr:e})=>{let t=(0,o6.computeInsertNestedCardMoves)({editor:n,pos:a-r.parentOffset-1,tr:e});return t.length&&requestAnimationFrame(()=>{n.commands.moveAnnotations?.(t)}),!0}).run(),!0},convertToNestedCard:()=>({state:e,dispatch:t,commands:i})=>{if(!t)return!0;let n=(0,oX.wrapIn)(e.schema.nodes[so.Card.name])(e,t);return i.selectInsertedNode(),n},unnestCard:e=>({state:t,dispatch:i,chain:n,tr:a})=>{let r=t.doc.nodeAt(e);if(!r||!(0,o4.isCardNode)(r))return!1;if(!i)return!0;let o=sn(a,e);if(!o)return!1;let s=a.doc.resolve(e),l=(0,ei.findParentNodeClosestToPos)(s,o4.isCardNode),d=(0,se.findCardNotes)(s),c=null;d&&(c=l?sr(t.doc,l.pos,!0):null);let u=e+r.nodeSize,p=n();if(c&&d&&l){let e=(0,se.hasCardNotes)(l.node)?d.node.content:d.node;p.insertContentAt(c,e.toJSON()).setMeta("cardNotesHandled",!0)}return p.insertContentAt({from:e,to:u},o.node.toJSON().content).selectInsertedNode().command(({tr:t})=>(t.setMeta("annotationEvent",{type:"merge-cards",contentPos:o.pos,insertPos:e}),!0)).run(),!0},mergeCardsAtPos:e=>({tr:t})=>{let i=t.doc.nodeAt(e);return!!i&&!!(0,o4.isCardNode)(i)&&si(e,t)},mergeCardsOnDelete:e=>({tr:t,state:i,dispatch:n})=>{if(!n)return!0;let{selection:a}=i,r=(0,ei.findParentNode)(o4.isCardNode)(a);if(!r||!a.empty)return!1;try{if(!((e,t)=>{let i;if(!e.empty)return!1;let n=e instanceof en.GapCursor;if(!(0,ei.isTextSelection)(e)&&!n)return!1;let{from:a,$from:r}=e;if(!t&&0!==r.parentOffset||t&&r.parentOffset!==r.parent.content.size)return!1;let o=(i=(0,rk.findNodeAndParents)(r,e=>"cardLayoutItem"===e.type.name&&"body"===e.attrs.itemId||"card"===e.type.name),0===i.length?null:i[0]);if(!o)return!1;if(n)return t?a===o.pos+o.node.nodeSize-1:a===o.pos+1;let s=["paragraph","heading","title"],l=!0;for(let e=r.depth;e>0;e--){let t=r.node(e);if("card"===t.type.name||(0,o4.isCardLayoutItemNode)(t))break;if(!s.includes(t.type.name)){l=!1;break}}return!!l&&(t?a===o.pos+o.node.nodeSize-2:a===o.pos+2)})(a,e))return!1;return e?((e,t,i)=>{let n=t.doc.resolve(e),a=t.doc.nodeAt(e),r=e+n.nodeAfter.nodeSize,o=t.doc.resolve(r),s=t.doc.nodeAt(r);if(!s||!(0,o4.isCardNode)(s))return!1;let l=a&&(0,se.hasCardNotes)(a),d=(0,se.hasCardNotes)(s),c=null;d&&(c=l?sr(t.doc,n.pos,!0):a?n.pos+a.nodeSize-1:null);let u=sn(t,r);if(!u)return!1;t.delete(r,r+s.nodeSize);let p=sa(t,e,!0);if(c&&d){let e=(0,se.findCardNotes)(o);if(e){let i=l?e.node.content:e.node;t.insert(c,i),t.setMeta("cardNotesHandled",!0)}}t.insert(p,u.node.content);let h={type:"merge-cards",contentPos:u.pos,insertPos:p};if(t.setMeta("annotationEvent",h),i.selection instanceof en.GapCursor){let e=(0,rz.findSelectionNearOrGapCursor)(t.doc.resolve(p));e&&t.setSelection(e)}return!0})(r.pos,t,i):si(r.pos,t)}catch(e){return console.debug("[CardCommands] mergeCardsOnDelete failed",e),!1}},insertCardAfter:(e=(0,o5.EMPTY_NODES)().insertCardInside)=>({state:t,chain:i,dispatch:n})=>{if(!n)return!0;let{selection:a}=t,r=(0,ei.findParentNode)(o4.isCardNode)(a);if(!r)return!0;let{pos:o,node:s}=r,l=o+s.nodeSize;return i().insertContentAt(l,e).selectInsertedNode().scrollIntoView().run(),!0},convertImageToImageCard:()=>({state:e,chain:t,dispatch:i})=>{if(!i)return!0;let{selection:n}=e;if(!(n instanceof ea.NodeSelection))return!1;let a=n.node,r="image"===a.type.name,o="graphic"===a.type.name,s=(0,o7.isAccentCardLayoutItem)(a);if(!r&&!o&&!s)return!1;try{let i;if(s){let e=a.attrs.background.image;if(!e)return!1;i=(0,o8.extractImageAttrsFromBackground)(e)}else if(o){let{src:e,tempUrl:t,meta:n,uploadStatus:r,savedMediaId:o,aiParams:s,source:l,extraction:d}=a.attrs;i={src:e,tempUrl:t,meta:n??void 0,uploadStatus:r,savedMediaId:o,aiParams:s,source:l,extraction:d}}else i=(0,o8.extractImageAttrs)(a.attrs);let l=e.doc.resolve(n.from),{node:d,pos:c}=(0,ei.findParentNodeClosestToPos)(l,o4.isCardNode)??{};if(!d||"number"!=typeof c)return!1;let u=e.doc.resolve(c),p=(0,o7.getCardLayoutItemsFromResolvedPos)(u),h=!!p.body?.node&&(s?(0,rk.isTreeEmptyAllChildren)(p.body.node):(0,rk.isTreeEmptyExceptNode)(p.body.node,a))&&(!r&&!o||"blank"===d.attrs.layout),m=[];o&&a.forEach(e=>{m.push(e.toJSON())});let g={type:"card",content:[{type:"cardImageItem",attrs:{image:i},...m.length>0?{content:m}:{}}]};if(h){let{layoutTemplateColumns:e,...i}=d.attrs;g.attrs={...i},t().insertContentAt({from:c,to:c+d.nodeSize},g,{updateSelection:!1}).selectInsertedNode().scrollIntoView().run()}else{let e=n.from,i=n.from+a.nodeSize,l=t();l.insertCardAfter(g),s?l.setCardLayout(c,"blank"):(r||o)&&l.command(({tr:t})=>(t.delete(t.mapping.map(e),t.mapping.map(i)),!0)),l.run()}return!0}catch(e){return console.error("(caught) [CardCommands] convertImageToImageCard error:",e),!1}},deleteCardIfEmpty:e=>({tr:t,dispatch:i,state:n})=>{if(!i)return!0;let a=!1,{from:r,to:o}=n.selection;return n.doc.nodesBetween(r,o,(i,n)=>{if((0,o4.isCardNode)(i)&&(0,so.isCardEmpty)(i)&&n>st.CARD_DEPTH){let r=t.doc.resolve(n).depth>1;t.deleteRange(n,n+i.nodeSize);let o=(0,rz.findSelectionNearOrGapCursor)(t.doc.resolve(n+(r?0:e?1:-1)),e?1:-1);o&&t.setSelection(o),a=!0}}),a},deleteCard:e=>({state:t,dispatch:i,tr:n})=>{if(!i)return!0;let a=t.doc.resolve(e),r=a.depth>1,o=a.nodeAfter;if(!o||!(0,o4.isCardNode)(o))return console.error("[CardExtension.deleteCard] Cannot delete card. Node unknown"),!1;n.delete(e,e+o.nodeSize);let s=(0,rz.findSelectionNearOrGapCursor)(n.doc.resolve(e-!r),-1);return s&&n.setSelection(s),!0},handleDeleteOnCardImageItem:()=>({dispatch:e,state:t,commands:i})=>{if(!e)return!0;if(!(0,ei.isNodeSelection)(t.selection))return!1;let{node:n}=t.selection;if(!(0,o4.isCardImageItemNode)(n))return!1;let a=(0,ei.findParentNode)(o4.isCardNode)(t.selection);return!!a&&i.deleteCard(a.pos)},duplicateCard:e=>({state:t,chain:i,editor:n})=>{let a=t.doc.nodeAt(e);if(!a||!(0,o4.isCardNode)(a))return console.error("[CardExtension.duplicateCard] Cannot duplicate card. Node unknown"),!1;let r=e+a.nodeSize,o=(0,rv.pruneUniqueIds)(n,(0,oq.default)(a.toJSON()));return i().insertContentAt(r,o,{updateSelection:!1}).command(({tr:e})=>(e.setMeta(rv.UniqueAttributePluginKey,!0),!0)).run(),setTimeout(()=>{n.chain().selectInsideNodeAtPos(r).focus().run()},200),!0},rearrangeCards:({from:e,to:t,position:i})=>({view:n,state:a,tr:r})=>{let o,s=a.doc.resolve(t),l=a.doc.resolve(e),d=l.pos+l.nodeAfter.nodeSize,c=new ea.NodeSelection(l),u=c.content();if((o="below"===i?s.pos+s.nodeAfter.nodeSize:"above"===i?s.pos:s.pos+s.nodeAfter.nodeSize-1)===l.pos)return r.setMeta("preventDispatch",!0),!0;r.delete(c.from,c.to);let p=r.mapping.map(o);r.replaceRangeWith(p,p,u.content.firstChild);let h=r.doc.resolve(p+1);r.setSelection(new ea.NodeSelection(h));let m={type:"move",insertPos:p,insertPosRaw:o,pos:l.pos,end:d};return r.setMeta("annotationEvent",m).setMeta("rearrangeCards",!0),n.focus(),!0},rearrangeCardsById:(e,t,i)=>({editor:n,tr:a,chain:r})=>{let o=a.doc.firstChild?.children??[],s=e.map(e=>o.findIndex(t=>t.attrs.id===e)),l=(0,o4.findTopLevelCardsWithPos)(n.state.doc);return!!l&&r().reorderSiblings(1,s).command(({tr:e})=>{e.setMeta("rearrangeCards",!0);let n=(0,o4.findTopLevelCardsWithPos)(e.doc);if(!n)return!1;let a=t.map(e=>{let t=l.findIndex(t=>t.node.attrs.id===e),i=s[t];return{id:e,oldPos:l[t].pos,newPos:n[i].pos}}),r=t[0];if(!r)return!0;let o=n.find(e=>e.node.attrs.id===r)?.pos;return void 0===o||(e.setMeta("annotationEvent",{type:"rearrange-cards",rearrangedCardPositions:a,insertPos:o}).setMeta("rearrangeCards",!0).setMeta(o1.FLUSH_SYNCED_EDITOR,!0),(0,oY.default)(Array.from(Object.keys(s)),s)||oQ.analytics.trackDocEvent(oJ.SegmentEvents.CARDS_REORDERED,{card_count:t.length,method:i?.viewPreference==="film"?"filmstrip":"list-view"}),!0)}).run()},updateThemeAccentImages:(e,t=!1)=>({editor:i,commands:n})=>{let a=(0,o9.getDocAttrs)(i);if(a.aiOptions.imageOptions?.provider==="placeholder")return!0;let r=!e||0===e.length,o=0;return i.state.doc.descendants((i,a)=>{let s=(0,o7.isAccentCardLayoutItem)(i);if(s||(0,o4.isCardNode)(i)){let l=s&&i.attrs.background.type===o2.BackgroundType.NONE;(i.attrs.background.source===o0.ACCENT_IMAGE_SOURCE_KEY||t&&s||l)&&(r?n.updateAttributesAtPos(a,{background:{type:s?o2.BackgroundType.NONE:void 0}}):(n.updateNestedAttributesAtPos(a,{background:e[o%e.length]}),o++))}}),!0},deleteCardsById:(e,t=!1)=>({editor:i,dispatch:n,tr:a})=>{if(!n)return!0;let r=(0,ei.findChildren)(i.state.doc,t=>(0,o4.isCardNode)(t)&&e.includes(t.attrs.id));if(!r.length)return!1;let o=r.map((e,t)=>({pos:e.pos,cardIndex:t}));r.forEach(({node:e,pos:t})=>{a=a.delete(a.mapping.map(t),a.mapping.map(t+e.nodeSize))});let s=r[0].pos,l=(0,o3.findSelectionInsideNode)(a.doc.resolve(s));return l&&(a=a.setSelection(l)),t&&a.setMeta("annotationEvent",{type:"filmstrip-cut",deleted:o}),a.setMeta(o1.FLUSH_SYNCED_EDITOR,!0),!0},deleteCardsAfter:e=>({editor:t,dispatch:i,commands:n})=>{if(!i)return!0;let a=(0,rk.findDirectChildren)(t.state.doc.firstChild,e=>(0,o4.isCardNode)(e)).map(e=>e.node.attrs.id);if(null===e)return n.deleteCardsById(a);let r=a.indexOf(e),o=r>-1?a.slice(r+1):[];return 0===o.length||n.deleteCardsById(o)},selectInsideNextCard:e=>({state:t,dispatch:i,commands:n})=>{if(!i)return!0;let{selection:a}=t,r=(0,rk.findNodeAndParents)(a.$from,o4.isCardNode)[0];if(!r||!a.empty)return!1;let o=t.doc.resolve(r.pos),s=o.index();if(e){if(s===o.parent.childCount-1)return!1;n.selectInsideNodeAtPos(r.pos+r.node.nodeSize)}else{if(0===s)return!1;let e=o.posAtIndex(s-1);n.selectInsideNodeAtPos(e,-1)}return!0}}),addInputRules:()=>[new ei.InputRule({find:ss,handler:({state:e,range:t})=>{let{tr:i}=e;sd({tr:i.deleteRange(t.from,t.to),dispatch:!0})}})]}),sd=({tr:e,dispatch:t})=>{if(!t)return;let i=(0,ei.findParentNode)(o4.isCardNode)(e.selection);if(!i)return void console.error("Couldn't find parent card while splitting",e.selection);let{accent:n,body:a}=(0,o7.getCardLayoutItems)(e,i.pos);n&&a&&n.pos>a.pos&&(e.delete(n.pos,n.pos+n.node.nodeSize),e.insert(a.pos,n.node));let{selection:r}=e,{$from:o}=r,s=r.$from.parentOffset,l=r.from-s-1,d=r.$from.node().content.size-r.$from.parentOffset;e.setMeta(rv.UniqueAttributePluginKey,!0),e.setMeta("annotationEvent",{type:"split-card",splitPos:o.before()});let{node:c,depth:u}=i,{type:p,attrs:h}=c,m=o.depth-u+1,g=(0,se.findCardNotes)(e.doc.resolve(i.pos));e.split(o.pos,m,[{type:p,attrs:{...h,layout:"blank"}}]);let f=(0,o3.getInsertedNodePos)(e,st.CARD_NODE_NAME).pos,b=e.doc.nodeAt(f).childCount;if(0===s&&(e.delete(l,l+e.doc.nodeAt(l).nodeSize),f=e.steps[e.steps.length-1].getMap().map(f)),0===d&&b>1){let t=f+1,i=e.doc.nodeAt(t);i&&"cardNotes"!==i.type.name&&"cardLayoutItem"!==i.type.name&&e.delete(t,t+i.nodeSize)}let x=(0,se.findCardNotes)(e.doc.resolve(f));x&&e.delete(x.pos,x.pos+x.node.nodeSize);let y=(0,rz.findSelectionNearOrGapCursor)(e.doc.resolve(f+1)),v=e.doc.nodeAt(i.pos),C=v&&i.pos+v.nodeSize-1;if(C&&g){let t=g.node;e.insert(C,t),e.setMeta("cardNotesHandled",!0)}y&&e.setSelection(y).scrollIntoView()};e.s(["CardImageItem",()=>sJ],823299),e.s(["Clipboard",()=>sy,"copyFragment",()=>sv],888919);var sc=e.i(308328),su=e.i(308822),sp=e.i(572943),sh=e.i(763498),sm=e.i(576826),sg=e.i(423444),sf=e.i(457776),sb=e.i(305463),sx=e.i(120203);let sy=ei.Extension.create({name:"clipboard",addProseMirrorPlugins(){let e=this.editor,t=e.state.schema,i=null;return[new ea.Plugin({key:new ea.PluginKey("clipboard"),appendTransaction(e,t,i){let n=e.find(e=>"cut"===e.getMeta("uiEvent"));if(!n)return null;let a=(0,rz.createSelectionNearLastTo)(n);return a?i.tr.setSelection(a):null},props:{handleDOMEvents:{drop(e){i=e.dragging,requestAnimationFrame(()=>{i=null})}},clipboardSerializer:{serializeFragment:e=>(0,$.serializeFragment)(e,this.editor.schema)},transformPastedHTML:sp.transformPastedHTML,transformPasted:n=>{let a=i?.slice?n:(0,sx.transformOutsideContent)(n,t);return sC(e,a)},handlePaste:(t,i,n)=>(0,sf.handleLinkPaste)(e,i,n)||(0,sb.handleMarkdownPaste)(e,i)||(0,sg.defaultHandlePaste)(t,i,n)}})]},addCommands(){return{insertMarkdownAt:(e,t)=>({state:i,tr:n})=>{try{let a=(0,sb.parseMarkdownToSlice)(t,i.schema);return n.replaceRange(e.from,e.to,a),!0}catch(e){return console.warn("(caught) [Clipboard] insertMarkdownAt error",e),!1}},basicCut:({from:e,to:t})=>({state:i,tr:n})=>(sv(i.doc.slice(e,t).content,this.editor,!0),n.deleteRange(e,t),!0),copy:({from:e,to:t})=>({state:i})=>(sv(i.doc.slice(e,t).content,this.editor,!1),!0)}}}),sv=(e,t,i)=>{let n=(0,$.serializeFragmentToClipboardHtml)(e,t.schema),a=e.firstChild;if(1===e.childCount&&!i){let e,t=a?.type.name==="image",i=a?.type.name==="cardAccentLayoutItem"&&a?.attrs?.background?.image,n=a?.type.name==="smartLayoutCell"&&a?.attrs?.image;t?e=a.attrs.src:i?e=a?.attrs.background.image.src:n&&(e=a?.attrs.image.src),e&&(0,o8.copyImageToClipboard)(e).catch(e=>{console.warn("Image clipboard copy failed, falling back to HTML:",e)})}document.getSelection()?.removeAllRanges(),(0,sc.default)(n,{format:"text/html"});let r=sh.AnnotationPluginKey.getState(t.state);return r&&!i&&r.clearCutData(),n},sC=(e,t)=>{let i=(0,sm.getDocFlags)(e.state.doc),n=t.toJSON()?.content;if(!n||"document"!==n[0].type)return t;let a=(0,sm.getDocFlags)(t.content.firstChild);return i.cardLayoutsEnabled&&!a.cardLayoutsEnabled?((0,rk.traverseJSONContent)(n,e=>{"card"===e.type&&(e.content=[{type:"cardLayoutItem",content:e.content}])}),su.Slice.fromJSON(e.schema,{openStart:t.openStart+1,openEnd:t.openEnd+1,content:n})):t};e.s(["CardImageItemView",()=>sX],701652);var sw=e.i(606004),sS=e.i(389928),sk=e.i(297391),sA=e.i(47735),sE=e.i(786928),s_=e.i(417781),sI=e.i(267971),sM=e.i(19654),sT=e.i(635273),sL=e.i(144621),sj=e.i(335799),sP=e.i(334784);e.i(261991);var sD=e.i(383540);e.i(989619);var sN=e.i(180939),sR=e.i(337130),sO=e.i(37169);let sB=({editor:e,getPos:t})=>{let i=(0,oO.useIsThemeDark)(),n=(0,R.useAppSelector)(B.selectEditable),a=(0,er.useIsThumbnailView)(),r=(0,sE.useToggleMediaDrawer)(),l=(0,sI.useSelectAndFocus)(e,t),{setMediaDrawerSourceKeyAction:d}=(0,sI.useDrawerSourceKey)(),c=(0,j.useCallback)(()=>{n&&(l(),d(sD.CustomImageProvider.key,!0),setTimeout(()=>r({isOpen:!0,shouldResetSourceKey:!1}),0))},[n,l,d,r]),u=(0,j.useCallback)(()=>{if(!n)return;let i=t();if("number"!=typeof i)return;let a=(0,ei.findParentNodeClosestToPos)(e.state.doc.resolve(i),o4.isCardNode);a&&"number"==typeof a.pos&&e.commands.updateNestedAttributesAtPos(a.pos,{generatorInput:{...sO.DEFAULT_CARD_GENERATOR_INPUT,template:"imageCard"}})},[e,t,n]),p=(0,sN.useCanUseProductFeature)(sP.STUDIO_MODE_REQUIRED_FEATURE);return(0,_.jsx)(L.Flex,{minH:"max(var(--card-min-height), 20em)",w:"100%",borderRadius:"var(--card-border-radius)",overflow:"hidden",contentEditable:!1,children:(0,_.jsx)(L.Flex,{minH:"max(var(--card-min-height), 20em)",w:"100%","data-testid":"media-placeholder",color:i?sR.PH_COLOR.DARK_COLOR:sR.PH_COLOR.LIGHT_COLOR,align:"center",justify:"center",p:3,bg:i?sR.PH_COLOR.DARK_BG:sR.PH_COLOR.LIGHT_BG,className:"placeholder","data-drag-handle":!0,"data-export-as-image":!0,position:"relative",cursor:"default",transition:"background-color 0.2s",children:(0,_.jsxs)(eQ.VStack,{children:[(0,_.jsx)(eJ.FontAwesomeIcon,{icon:o.faImage,size:"3x"}),n&&!a&&(0,_.jsxs)(sj.ButtonGroup,{children:[(0,_.jsx)(a7.Button,{size:"sm",onClick:c,leftIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faPlus}),children:(0,_.jsx)(eD.Trans,{message:"Add image",id:"P5MuiB"})}),p&&(0,_.jsx)(a7.Button,{size:"sm",onClick:u,leftIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:e8.faSparkles}),children:(0,_.jsx)(eD.Trans,{message:"Generate image",id:"UQ4o1/"})})]})]})})})},sz="max(var(--card-min-height), 20em)";var sF=e.i(620020),sH=e.i(827911),sW=e.i(182535),sU=e.i(717834),sV=e.i(501098),sG=e.i(59554),s$=e.i(207556),sZ=e.i(49202),sK=e.i(215531);let sq=(e,t)=>{let i=t();if("number"!=typeof i)return null;try{return(0,ei.findParentNodeClosestToPos)(e.state.doc.resolve(i),o4.isCardNode)}catch{return null}};var sY=e.i(509402);let sX=e=>{let{node:t,editor:i,getPos:n,decorations:a}=e,{cardId:r,hasCardNotesNode:o,isNested:d}=(0,sL.findCardPluginDecoration)(a),{image:c}=t.attrs,{src:u,tempUrl:p,uploadStatus:h,showPlaceholder:m}=c,g=(0,R.useAppSelector)(B.selectEditable),{hasEnoughCreditsToGenerateImage:f}=(0,sS.useCreditStatus)(),b=(0,er.useIsThumbnailView)(),x=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW&&!b,y=(0,sE.useToggleMediaDrawer)(),v=(0,sI.useSelectAndFocus)(i,n),C=(0,j.useCallback)(()=>{g&&(v(),y({isOpen:!0}))},[g,y,v]),{regenerate:w}=(0,sY.useRegenerateCardImage)({editor:i,getImageItemPos:n,imageItemNode:t}),S=(0,j.useCallback)(async()=>{g&&await w()},[g,w]),k=h===e7.UploadStatus.Uploading,A=m||!u&&!p,E=void 0!==c.loadImageStatus&&null!==c.loadImageStatus&&"done"!==c.loadImageStatus,[I,M]=(0,j.useState)(!1),T=c.loadImageParams?.options?.model,L=T?(0,sk.getImageModelInfo)(T).estimatedTimeSeconds:void 0,D=(0,P.useFeatureFlag)("imageCardsDebug"),N=(0,P.useFeatureFlag)("imageCardText"),O=t.childCount>0,{width:z,height:F}=c.meta??{width:0,height:0},H=(0,oT.isSelectingNode)(a),{isInOfflineMode:W}=(0,sw.useHealthCheck)(),{isOpen:U,onOpen:V,onClose:G}=(0,sA.useModalDisclosure)({id:"downloadCardAsImageDisclosure"}),$=(({cardId:e,hasCardNotesNode:t,isNested:i,getImageCardPos:n,onExportCardOpen:a,isInOfflineMode:r})=>{let o=(0,sF.useToast)(),d=(0,sE.useToggleMediaDrawer)(),c=(0,sG.useOpenSearchWithCardsToCopy)(),u=(0,P.useFeatureFlag)("copyCardsToDeck"),p=(0,R.useAppSelector)(B.selectEditable),{onCopyLinkClick:h}=(0,s$.useCopyLink)({cardId:e}),m=(0,sU.useTiptapEditorEventCallback)(e=>{let t=sq(e,n);t&&sv(su.Fragment.from([t.node]),e,!1)}),g=(0,sU.useTiptapEditorEventCallback)(e=>{let t=sq(e,n);t&&c([t.node])}),f=(0,sU.useTiptapEditorEventCallback)(i=>{let a=sq(i,n);a&&e&&(p&&!t&&(0,se.addCardNotes)(i,a.pos),sV.eventEmitter.emit("toggle",{config:{override:"open"}}))}),b=(0,sU.useTiptapEditorEventCallback)(()=>{e&&h()}),x=(0,sU.useTiptapEditorEventCallback)(e=>{let t=n();if("number"!=typeof t)return;e.commands.selectNodeAtPos(t);let i=e.state.selection;i.node&&sZ.TiptapEventBus.emit(sZ.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,{selectionPos:i.from,parentPos:i.from,text:(0,sK.generateHtmlFromNode)(i.node)})}),y=(0,sU.useTiptapEditorEventCallback)(e=>{let t=sq(e,n);if(!t)return;let i=e.state.doc.nodeAt(t.pos),a=i&&(0,sW.getCardTitle)(i.toJSON()),r=a?`"${a}"`:"card";e.chain().deleteCard(t.pos).focus().run();let s=l.i18n._({id:"0MWv65",message:"Deleted {displayTitle}.",values:{displayTitle:r}}),d=l.i18n._({id:"9uI/rE",message:"Undo"}),c=o({title:(0,_.jsxs)(eG.HStack,{children:[(0,_.jsx)(ej.Text,{noOfLines:1,children:s}),(0,_.jsx)(e$.Link,{textDecoration:"underline",onClick:()=>{(0,sH.undo)(e.state),o.close(c)},children:d})]}),status:"info",duration:3e3,position:"top"})}),v=(0,sU.useTiptapEditorEventCallback)((e,t)=>{e.view.focus(),d({isOpen:!0}),t.stopPropagation()}),C=(0,er.useIsThumbnailView)();return(0,j.useMemo)(()=>!e||C?[]:[{key:"image-card-title",title:(0,_.jsx)(eD.Trans,{message:"Image card",id:"leAzzX"})},{divider:!0},{key:"copy-card",label:(0,_.jsx)(eD.Trans,{message:"Copy card",id:"Bq0HJ4"}),icon:s.faCopy,onClick:m},...u?[{key:"copy-card-to-deck",label:(0,_.jsx)(eD.Trans,{message:"Copy to...",id:"IAsTWw"}),icon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faObjectUngroup,flip:"horizontal"}),onClick:g}]:[],{divider:!0},{key:"edit-image",label:(0,_.jsx)(eD.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:s.faEdit,onClick:v},{divider:!0},...i?[]:[{key:"card-notes",label:(0,_.jsx)(eD.Trans,{message:"Card notes",id:"PFP9+0"}),icon:s.faFileLines,onClick:f}],{key:"copy-card-link",label:(0,_.jsx)(eD.Trans,{message:"Copy card link",id:"F0YmUY"}),icon:s.faLink,onClick:b},{key:"export-card",label:(0,_.jsx)(eD.Trans,{message:"Export card",id:"xRJ+bN"}),icon:s.faArrowDownToBracket,onClick:a,disabled:r},{divider:!0},{key:"add-comment",label:(0,_.jsx)(eD.Trans,{message:"Add comment",id:"oFsfkI"}),icon:s.faComment,onClick:x},{divider:!0},{key:"delete",label:(0,_.jsx)(eD.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,color:"red.500",onClick:y}],[e,C,m,u,g,i,f,b,a,r,x,y,v])})({cardId:r,hasCardNotesNode:o,isNested:d,getImageCardPos:n,onExportCardOpen:V,isInOfflineMode:W}),{onOpenContextMenu:Z}=(0,sM.useEditorContextMenu)({contextMenuItems:$,editor:i,getPos:n});return E?(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsxs)(r4.Center,{className:"image-card",position:"relative",w:"100%",h:"100%",onClick:v,onDoubleClick:C,"data-selection-ring":!0,"data-selection-background":!0,"data-drag-handle":!0,onMouseDown:e3.preventDefaultToAvoidBlur,borderRadius:"var(--card-border-radius)",bg:"black",overflow:"hidden",zIndex:0,children:["error"===c.loadImageStatus?(0,_.jsx)(sT.ImageGenerationErrorPlaceholder,{onRetry:g?S:void 0,isRetryDisabled:!f,retryDisabledReason:(0,_.jsx)(eD.Trans,{message:"Can't retry - no credits available",id:"Ey8PF3"}),minH:sz}):(0,_.jsx)(te.MediaPlaceholderImage,{w:"100%",minH:sz,isLoading:"queued"===c.loadImageStatus,loadingProvider:c.loadImageParams?.provider,promptPreview:D?c.loadImageParams?.query:void 0,estimatedTimeSeconds:b?void 0:L}),k&&g&&(0,_.jsx)(te.MediaPlaceholderSpinner,{}),h===e7.UploadStatus.Error&&(0,_.jsx)(te.MediaPlaceholderErrorUploadingTag,{})]})}):A?(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,children:(0,_.jsx)(sB,{editor:i,getPos:n})}):(0,_.jsxs)(rP.AnnotatableNodeViewWrapper,{...e,children:[(0,_.jsx)(r4.Center,{className:"image-card",position:"relative",w:"100%",h:x?"100vh":"100%",minH:I?void 0:sz,bg:x?"black":void 0,overflow:"visible",cursor:"default",onContextMenu:Z,borderRadius:"var(--card-border-radius)",contentEditable:!H&&void 0,suppressContentEditableWarning:!0,children:(0,_.jsxs)(r4.Center,{position:"relative",w:"100%",h:x?"100%":void 0,maxW:"100%",maxH:x?"100%":void 0,aspectRatio:!x&&z&&F?`${z} / ${F}`:void 0,onDoubleClick:C,"data-selection-ring":!0,"data-selection-background":!0,borderRadius:"inherit",children:[(0,_.jsx)(eK.ImageOrVideo,{src:u||void 0,fallbackSrc:p||void 0,alt:"",w:"100%",h:x?"100%":void 0,maxW:"100%",maxH:x?"100%":void 0,objectFit:"contain",resizeParams:b?eK.THUMBNAIL_RESIZE_PARAMS:{width:2e3},onLoad:()=>{M(!0)},borderRadius:"inherit",onClick:v,userSelect:"none"}),k&&g&&(0,_.jsx)(te.MediaPlaceholderSpinner,{}),h===e7.UploadStatus.Error&&(0,_.jsx)(te.MediaPlaceholderErrorUploadingTag,{}),(O||N)&&(0,_.jsx)(o_,{aspectRatio:(z||1e3)/(F||1e3),handleSelect:v,editor:i,children:(0,_.jsx)(eW.NodeViewContent,{})})]})}),r&&(0,_.jsx)(s_.ExportCardModalWithOfflineCheck,{onOpen:V,isOpen:U,onClose:G,cardId:r,editor:i})]})},sQ=(e,t,i,n)=>{let{selection:a}=e.state;if(!(0,ei.isNodeSelection)(a)||!(0,o4.isCardImageItemNode)(a.node))return!1;let r=(0,ei.findParentNode)(o4.isCardNode)(a);if(!r)return!1;let o=r.pos,s=r.pos+r.node.nodeSize;return sv(e.state.doc.slice(o,s).content,i,n),n&&e.dispatch(e.state.tr.deleteRange(o,s).setMeta("uiEvent","cut")),t.preventDefault(),!0},sJ=(0,tl.createTiptapNode)("cardImageItem",{draggable:!1,isolating:!0,selectable:!0,imageKeyPath:"image",accessoryImageKey:"image",addNodeView:()=>(0,rL.ReactNodeViewRenderer)(sX,{update:rj.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"img[class=image-card]",getAttrs:e=>({id:(0,tl.parseIdAttr)(e,rm.generateMediaId),...(0,tl.parseJSONAttr)(e,"image")?{image:(0,tl.parseJSONAttr)(e,"image")}:{}})},{tag:"div[class=image-card]",getAttrs:e=>({id:(0,tl.parseIdAttr)(e,rm.generateMediaId),...(0,tl.parseJSONAttr)(e,"image")?{image:(0,tl.parseJSONAttr)(e,"image")}:{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"image-card","data-id":e.attrs.id,...(0,tl.renderJSONAttrs)(e.attrs,"image")}),0],addProseMirrorPlugins(){return[r5(o4.isCardImageItemNode),new ea.Plugin({props:{handleDOMEvents:{copy:(e,t)=>sQ(e,t,this.editor,!1),cut:(e,t)=>sQ(e,t,this.editor,!0)}}})]}});e.s(["CardAccentLayoutItem",()=>lZ],423686),e.s(["CardLayoutItemView",()=>l$],254311);var s0=e.i(929508),s1=e.i(469305),s2=e.i(429992),s3=e.i(820773),s5=e.i(313399),s4=e.i(99341),s6=e.i(970346),s9=e.i(860686),s8=e.i(918228),s7=e.i(437994),le=e.i(149452),lt=e.i(909875),li=e.i(607400),ln=e.i(173953),la=e.i(516456);let lr=(0,j.memo)(({setCardContent:e,editor:t,isFocused:i,edgeLayoutsDisabled:n,isNested:a,cardColorOverrideIsDark:r})=>{let{isInOfflineMode:o}=(0,sw.useHealthCheck)(),{isOpen:s,onClose:d,onOpen:c}=(0,sA.useModalDisclosure)({id:"cardTemplatesModal"}),{recentlyUsedTemplates:u,updateRecentlyUsedTemplateIds:p}=(0,la.useRecentlyUsedTemplates)(),h=(0,j.useCallback)((t,i)=>{e(t),"aiCardAfter"!==t.templateId&&p(t);let n="placeholder"===i?oJ.NodeInsertMethods.CARD_TEMPLATE_PLACEHOLDER:oJ.NodeInsertMethods.CARD_TEMPLATE_MODAL;(0,rh.trackItemInserted)({nodeName:"card",key:t.templateId},n)},[e,p]),m=(0,j.useCallback)(e=>{h({source:"gammaLayout",templateId:e},"placeholder")},[h]),g=(0,j.useCallback)(e=>{h(e,"modal")},[h]),f=(0,j.useMemo)(()=>{let e=(0,li.getGroupedCardTemplates)("placeholder").flatMap(({items:e})=>e),i="image"===(0,o9.getDocAttrs)(t).aiOptions.cardContentType?[(0,li.getCardTemplatesMap)().blankImageCard]:[],a=u.filter(e=>"blankCard"!==e.id);return(0,s7.default)([...i,...a,...e],"id").filter(e=>!!e).filter(e=>!(0,li.checkTemplateDisabled)(t,e,({jsonContent:e})=>n&&(0,o7.isSideLayout)(e.attrs?.layout)))},[n,t,u]),b=(0,oO.useIsThemeDark)(),x=void 0===r?b:r;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(Y.DarkModeProvider,{isDark:x,children:(0,_.jsx)(s6.Collapse,{in:i||s,onAnimationComplete:()=>{t.commands.refreshBubbleMenu?.()},children:(0,_.jsxs)(s8.Stack,{overflow:"hidden",mx:16,mb:12,contentEditable:!1,onMouseDown:e3.preventDefaultToAvoidBlur,cursor:"default",fontFamily:"body",color:"var(--body-color-muted)",children:[(0,_.jsx)(ej.Text,{fontSize:"sm",fontWeight:"normal",children:(0,_.jsx)(eD.Trans,{message:"Or start with a template",id:"3h21H3"})}),(0,_.jsxs)(s9.Grid,{templateColumns:`repeat(auto-fill, minmax(calc(${ln.CARD_TEMPLATE_WIDTH.md} + var(--chakra-space-1-5)), 1fr))`,fontSize:"1rem",gap:2,children:[f.slice(0,a?2:4).map(({id:e,jsonContent:t,name:i})=>(0,_.jsx)(le.CardTemplateButton,{tooltip:i(),isDark:x,templateIcon:(0,_.jsx)(ln.CardTemplateThumbnail,{templateContent:t,isDark:x,borderRadius:"base",maxH:"5em",overflow:"hidden"}),isSelected:!1,onClick:()=>m(e),w:"auto",minW:"auto",fontSize:"1em"},e)),(0,_.jsx)(le.CardTemplateButton,{tooltip:l.i18n._({id:"bHT6mZ",message:"Browse card templates"}),label:(0,_.jsx)(eD.Trans,{message:"Templates",id:"iTylMl"}),isDark:x,templateIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:e8.faGrid2,fixedWidth:!0}),isSelected:!1,onClick:c,fontSize:"1em"}),!o&&(0,_.jsx)(le.CardTemplateButton,{isDark:x,templateIcon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:e8.faSparkles,fixedWidth:!0}),label:(0,_.jsx)(eD.Trans,{message:"Generate",id:"ziAjHi"}),tooltip:l.i18n._({id:"tkZYgO",message:"Generate card with AI"}),isSelected:!1,onClick:()=>m("aiCardAfter"),fontSize:"1em"})]})]})})}),s&&(0,_.jsx)(lt.CardTemplateModal,{editor:t,onClose:d,onTemplateSelect:g,recentlyUsedTemplates:u,insertionMode:"replace"})]})});lr.displayName="ChooseCardTemplatePlaceholder";var lo=e.i(392678),ls=e.i(447143),ll=e.i(875504),ld=e.i(599350),lc=e.i(305573);let lu=(e,t)=>{let i=(0,ll.isMarginPosition)("top",e)?"top":"bottom",n=t[`${i}Center`],a=t[`${i}Left`],r=t[`${i}Right`],o=(0,ll.isMarginPosition)("center",e);return!!n&&(!n||!!a||!!r||o)},lp=({element:e,position:t,cardId:i,shouldStretch:n,isWidthConstrained:a,containerHeight:r,isCardDark:o})=>{let s=(0,R.useAppSelector)(B.selectTopLevelCardIds),{flex:l,text:d}=(0,ll.getAlignmentsForMarginElement)(t),c=e?.type==="image"||e?.type==="themeLogo",u=e?.type==="text"||e?.type==="cardNumbers",{logoSrc:p,logoImage:h}=(0,lc.useGetThemeLogo)({preferDark:o}),m=e?.type==="image"?e.imageAttrs?.meta:h?.meta,g=e?.type==="image"?(0,ll.getImageCardMarginElementSrc)(e):p,f=g&&(0,eK.resizeAndProxyImageUrl)(g,eK.THUMBNAIL_RESIZE_PARAMS,m)||g,b=(0,j.useMemo)(()=>i&&e?.type==="cardNumbers"?(0,ll.getCardNumberDisplayString)(s.indexOf(i),e.startIndex,e.startNumber):"",[e,i,s]),x=m?.aspect_ratio,y=(0,j.useMemo)(()=>(0,ls.getBalancedImageHeightEms)(e,x),[e,x]),v=(0,R.useAppSelector)(B.selectTheme),C=v?.config.roundness,w=(0,j.useMemo)(()=>(0,ls.getElementOpticalPaddingEms)(r,e,C,x,l),[e,C,r,x,l]);return!e&&(0,ll.isMarginPosition)("center",t)?null:(0,_.jsxs)(L.Flex,{alignItems:"center",justifyContent:l,flex:n?1:void 0,flexShrink:c?0:void 0,flexBasis:c&&a?"calc(50% - 0.25em)":void 0,children:[u&&(0,_.jsxs)(ej.Text,{fontSize:`calc(${lo.TEXT_ELEMENT_SIZE_EMS}em / var(--media-scale))`,ps:`calc(${w.start}em / var(--media-scale))`,pe:`calc(${w.end}em / var(--media-scale))`,opacity:.65,noOfLines:1,fontFamily:"var(--body-font)",color:"var(--body-color)",fontWeight:"var(--body-font-weight)",textAlign:d,children:["cardNumbers"===e.type&&b,"text"===e.type&&e.content]}),c&&f&&(0,_.jsx)(eX.Image,{src:f,h:`calc(${y}em / var(--media-scale))`,ps:`calc(${w.start}em / var(--media-scale))`,pe:`calc(${w.end}em / var(--media-scale))`,objectFit:"contain"})]})},lh=(e,t,i,n)=>{if("left"!==i&&"right"!==i)return!1;let a=t[`${e}Left`],r=t[`${e}Center`],o=t[`${e}Right`],s=!(0,ll.isEmptyMarginElement)(a,n)&&(a?.type==="image"||a?.type==="themeLogo"),l=!(0,ll.isEmptyMarginElement)(o,n)&&(o?.type==="image"||o?.type==="themeLogo");return s&&!r&&l},lm=({cardNode:e,isNested:t,isMobileDevice:i,displayLayout:n,isCardDark:a})=>{let r=e?.attrs,{cardMarginSettings:o}=(0,R.useAppSelector)(B.selectDocSettingsWithDefaults),{hideFromFirst:s,hideFromLast:l,...d}=o,c=(({isNested:e,isMobileDevice:t,cardMarginSettings:i,cardAttrs:n})=>{let a=(0,R.useAppSelector)(B.selectDocFormatKey),{areElementsCurrentlyHiddenBySettings:r}=(0,ld.useCardMarginElementsVisibility)(n);return t||e||(0,ll.hasNoCardMarginElements)(i)||"webpage"===a||r})({isNested:t,cardMarginSettings:o,isMobileDevice:i,cardAttrs:r}),u=(0,oO.useIsThemeDark)(),p=void 0===a?u:a,{logoSrc:h}=(0,lc.useGetThemeLogo)({preferDark:p}),m=Object.entries(d).reduce((e,[t,i])=>{if((0,ll.isEmptyMarginElement)(i,h))return e;let a=((e,t,i,n)=>{let a=(0,ll.isMarginPosition)("top",e);if("top"===t&&a)return null;if(!(0,ll.isMarginPosition)("center",e)||"left"!==t&&"right"!==t)return e;let r=a?"top":"bottom",o="left"===t?`${r}Left`:`${r}Right`,s="left"===t?`${r}Right`:`${r}Left`;return(0,ll.isEmptyMarginElement)(i[o],n)||(0,ll.isEmptyMarginElement)(i[s],n)?(0,ll.isEmptyMarginElement)(i[o],n)?o:(0,ll.isEmptyMarginElement)(i[s],n)?s:e:null})(t,n,d,h);return a?{...e,[a]:i}:e},{}),g=lh("top",m,n,h),f=lh("bottom",m,n,h),b=(0,R.useAppSelector)(B.selectTheme),x=b?.config.roundness,y=(0,ls.getTotalCardMarginHeightEms)(o,x),v=(0,j.useMemo)(()=>(0,ls.getHeightOfLargestElementEms)(o),[o]),C=(0,j.useMemo)(()=>(0,ls.getCardMarginPaddingEms)(x,v),[x,v]);return c?null:(0,_.jsxs)(eg.Box,{dir:"ltr",css:{"--margin-padding":`calc(${C}em / var(--media-scale))`},children:[(0,_.jsx)(eG.HStack,{"data-card-margin-elements":"top",position:"absolute",pointerEvents:"none",justifyContent:"space-between",alignItems:"center",h:`calc(${y}em / var(--media-scale))`,p:"var(--margin-padding)",top:0,insetStart:0,insetEnd:0,spacing:"0.5em",overflow:"hidden",children:["topLeft","topCenter","topRight"].map(t=>(0,_.jsx)(lp,{element:m[t],position:t,cardId:e?.attrs.id,shouldStretch:lu(t,m),isWidthConstrained:g,containerHeight:v,isCardDark:p},t))}),(0,_.jsx)(eG.HStack,{"data-card-margin-elements":"bottom",position:"absolute",pointerEvents:"none",justifyContent:"space-between",alignItems:"center",h:`calc(${y}em / var(--media-scale))`,p:"var(--margin-padding)",bottom:0,insetStart:0,insetEnd:0,spacing:"0.5em",overflow:"hidden",children:["bottomLeft","bottomCenter","bottomRight"].map(t=>(0,_.jsx)(lp,{element:m[t],position:t,cardId:e?.attrs.id,shouldStretch:lu(t,m),isWidthConstrained:f,containerHeight:v,isCardDark:p},t))})]})};var lg=e.i(105970),lf=e.i(710317),lb=e.i(940818),lx=e.i(444577),ly=e.i(549022),lv=e.i(873082),lC=e.i(372030),lw=e.i(570203),lS=e.i(979504),lk=e.i(24066),lA=e.i(124059),lE=e.i(562409);let l_=(e,t,i)=>{if(i)return{};if("behind"===e||"blank"===e)return{borderRadius:"var(--card-border-radius)"};if("left"===e)return"accent"===t?{borderLeftRadius:"var(--card-border-radius)"}:"body"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("right"===e)return"body"===t?{borderLeftRadius:"var(--card-border-radius)"}:"accent"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("top"===e||"mobileLeft"===e)return"body"===t?{borderBottomRadius:"var(--card-border-radius)"}:"accent"===t?{borderTopRadius:"var(--card-border-radius)"}:{};if("mobileRight"===e){if("accent"===t)return{borderBottomRadius:"var(--card-border-radius)"};if("body"===t)return{borderTopRadius:"var(--card-border-radius)"}}return{}},lI=e=>{let{node:t,getPos:i,decorations:n,editor:a}=e,r=t.attrs,o=(0,N.useRtlEnabled)(),d=(0,lE.findCardLayoutDecorationSpec)(n),c=(0,lg.useClosestCardNode)(),{isNested:u,insideSideLayout:p,displayLayout:h,hasCardNotesNode:m,isCardDark:g}=(0,sL.findCardPluginDecoration)(n),f=d?.layout==="blank",b=(0,er.useIsThumbnailView)(),x=l_(d.layout,r.itemId,"full"===d.cardSize),y={flexDirection:"column",justifyContent:r.verticalAlign||"var(--card-vertical-align)"},v=(0,o7.findLayoutPreset)(d?.layout),C=v&&!v.items[r.itemId],[w]=(0,lf.usePresentVariant)(d.cardId),S=(0,rF.isNodeViewEmpty)(n),k=(0,R.useAppSelector)(B.selectEditable),A=(0,oT.isFocusedAndEditable)(n),E=c?.attrs.generatorInput&&"done"!==c.attrs.generatorInput.status,I=(0,sU.useTiptapEditorEventCallback)((e,t)=>{let n=i();if(void 0===n)return;let{cardToAdd:a}=(0,lb.getCardToAddAndTrack)(t),r=(0,lx.assignCardIdsToChildren)(a),o=(0,ei.findParentNodeClosestToPos)(e.state.doc.resolve(n),o4.isCardNode);if(!o)return;let{layoutTemplateColumns:s,...l}=o.node.attrs;r.attrs={...l,...r.attrs};let d=o.pos,c=o.pos+o.node.nodeSize;e.chain().insertContentAt({from:d,to:c},r,{updateSelection:!1}).selectInsertedNode().run()}),{contextMenuItems:M,exportCardModal:T}=(({editor:e,cardNode:t,getCardPos:i,cardId:n,displayLayout:a,hasCardNotesNode:r})=>{let o=(0,sF.useToast)(),{isInOfflineMode:d}=(0,sw.useHealthCheck)(),c=(0,sG.useOpenSearchWithCardsToCopy)(),u=(0,P.useFeatureFlag)("copyCardsToDeck"),p=(0,R.useAppSelector)(B.selectEditable),h=(0,lA.useIsCardLinkSharingOpen)(),{isOpen:m,onOpen:g,onClose:f}=(0,sA.useModalDisclosure)({id:"downloadCardAsImageDisclosure"}),b=n===(0,R.useAppSelector)(B.selectTopLevelCardIds)[0],x=(0,lS.useSetLayout)({editor:e,source:"card-context-menu",getPos:i}),y=(0,sU.useTiptapEditorEventCallback)(e=>{if(!e||!t)return;let n=e.state.doc.nodeAt(i()),a=n&&(0,sW.getCardTitle)(n.toJSON()),r=a?`"${a}"`:"card";e.chain().deleteCard(i()).focus().run();let s=l.i18n._({id:"0MWv65",message:"Deleted {displayTitle}.",values:{displayTitle:r}}),d=l.i18n._({id:"9uI/rE",message:"Undo"}),c=o({title:(0,_.jsxs)(eG.HStack,{children:[(0,_.jsx)(ej.Text,{noOfLines:1,children:s}),(0,_.jsx)(e$.Link,{textDecoration:"underline",onClick:()=>{(0,sH.undo)(e.state),o.close(c)},children:d})]}),status:"info",duration:3e3,position:"top"})}),v=(0,j.useCallback)(()=>{e&&t&&sv(su.Fragment.from([t]),e,!1)},[e,t]),C=(0,sU.useTiptapEditorEventCallback)(e=>{e.chain().mergeCardsAtPos(i()).focus().run()}),w=(0,sU.useTiptapEditorEventCallback)(e=>{let n=t.attrs,a={background:{type:o2.BackgroundType.NONE,source:void 0},cardSize:void 0,verticalAlign:void 0,container:{...n.container,width:void 0,background:void 0},layout:"blank"};(0,lv.handleBackgroundResetOrUpdate)(e,i(),a)}),{setCardColor:S,currentColor:k,themeCardColor:A}=(0,lw.useCardColorSelector)({editor:e,attrs:t?.attrs,getPos:i}),E=(0,sU.useTiptapEditorEventCallback)(e=>{p&&!r&&(0,se.addCardNotes)(e,i()),sV.eventEmitter.emit("toggle",{config:{override:"open"}})}),{onCopyLinkClick:I}=(0,s$.useCopyLink)({cardId:t?.attrs.id}),M=(0,j.useCallback)(()=>{e&&n&&I()},[e,n,I]),T=(0,er.useIsThumbnailView)();return(0,j.useMemo)(()=>!e||T?{contextMenuItems:[],exportCardModal:null}:{contextMenuItems:[{key:"card-options",title:(0,_.jsx)(eD.Trans,{message:"Card",id:"kryGs+"})},{divider:!0},{key:"copy-card",label:(0,_.jsx)(eD.Trans,{message:"Copy card",id:"Bq0HJ4"}),icon:s.faCopy,onClick:v},...u?[{key:"copy-card-to-deck",label:(0,_.jsx)(eD.Trans,{message:"Copy to...",id:"IAsTWw"}),icon:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:s.faObjectUngroup,flip:"horizontal"}),onClick:()=>t&&c([t])}]:[],...b?[]:[{key:"merge-card-with-above",label:(0,_.jsx)(eD.Trans,{message:"Merge card with above",id:"lxx9kE"}),icon:s.faArrowUp,onClick:C}],{divider:!0},{key:"change-card-color",label:(0,_.jsx)(eD.Trans,{message:"Change card color",id:"D/jD8b"}),icon:s.faPalette,items:[{key:"color-picker",element:e=>(0,_.jsx)(ly.ColorPickerMenuInner,{currentColor:k??A,setColor:t=>{S(t),e?.()},source:"CardColor"})}]},{key:"reset-styling",label:(0,_.jsx)(eD.Trans,{message:"Reset styling",id:"6hU6uw"}),icon:s.faRotateLeft,onClick:w},{divider:!0},{key:"card-notes",label:(0,_.jsx)(eD.Trans,{message:"Card notes",id:"PFP9+0"}),icon:s.faFileLines,onClick:E},{key:"copy-private-link",label:h?(0,_.jsx)(eD.Trans,{message:"Copy card link",id:"F0YmUY"}):(0,_.jsx)(eD.Trans,{message:"Copy private link",id:"j7DOt7"}),icon:s.faLink,onClick:M},{key:"export-card",label:(0,_.jsx)(eD.Trans,{message:"Export card",id:"xRJ+bN"}),icon:s.faArrowDownToBracket,onClick:g,disabled:d},{divider:!0},{key:"layout",label:l.i18n._({id:"vR68Ol",message:"Change layout"}),icon:s.faSidebarFlip,items:lC.CARD_LAYOUTS.map(e=>({key:e,label:(0,lk.getLayoutLabel)(e),checked:a===e,icon:(0,_.jsx)(lC.CardLayoutIcon,{layout:e,isSelected:a===e}),onClick:()=>x(e)}))},{divider:!0},{key:"delete",label:(0,_.jsx)(eD.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,onClick:y,color:"red.500"}],exportCardModal:n?(0,_.jsx)(s_.ExportCardModalWithOfflineCheck,{onOpen:g,isOpen:m,onClose:f,cardId:n,editor:e}):null},[e,T,v,u,b,C,w,E,h,M,g,d,y,n,m,f,t,c,k,A,S,a,x])})({editor:a,cardNode:c,getCardPos:()=>{let e=i();if(!e)return 0;let t=a.state.doc.resolve(e);return(0,ei.findParentNodeClosestToPos)(t,o4.isCardNode)?.pos??0},cardId:c?.attrs.id,displayLayout:h,hasCardNotesNode:m}),{onOpenContextMenu:D}=(0,sM.useEditorContextMenu)({editor:a,contextMenuItems:M,getPos:i}),z=(0,O.useShouldRenderMobileVersion)();return(0,_.jsxs)(eH.NodeViewWrapper,{dir:o?"rtl":"ltr",as:"div",style:{...C?{display:"none"}:{}},children:[(0,_.jsxs)(L.Flex,{"data-content-reference":!0,className:"card-layout-cell-bg",w:"100%",h:"100%",position:"relative","data-selection-ring":!0,"data-selection-background":!0,..."presentCurrent"!==w&&x,...y,children:[(0,_.jsx)(eW.NodeViewContent,{as:"div",style:{width:"100%"},onContextMenu:e=>{e.target===e.currentTarget&&D(e)}}),!b&&k&&S&&f&&!E&&(0,_.jsx)(lr,{isFocused:A,editor:a,setCardContent:I,edgeLayoutsDisabled:p,isNested:u,cardColorOverrideIsDark:g}),(0,_.jsx)(lm,{cardNode:c,displayLayout:h,isNested:u,isMobileDevice:z,isCardDark:g})]}),T]})};var lM=e.i(459014),lT=e.i(878917);let lL=({hasImage:e,onEditImage:t,image:i,isLoading:n,openEditBackgroundDrawer:a,borderProps:r,accentLayout:o,...s})=>{let l=!!t,d=(0,er.useIsThumbnailView)();return e?null:(0,_.jsx)(L.Flex,{align:"center",justify:"center",pos:"absolute",inset:0,role:"group",cursor:"default","data-layout-cut":"mobileLeft"===o?"top":o,...e?{}:{bgColor:"gray.200"},...s,children:!d&&(0,_.jsx)(L.Flex,{pos:"absolute",inset:0,justify:"center",align:"center",cursor:l?"default":void 0,onClick:t,children:(0,_.jsx)(eg.Box,{color:"gray.400",h:"100%",w:"100%",children:(0,_.jsx)(te.MediaPlaceholderImage,{icon:lT.MediaSourcesMap[o0.ACCENT_IMAGE_SOURCE_KEY].icon,isUploading:!1,isLoading:n,loadingProvider:i?.loadImageParams?.provider,onSelectAndFocus:t,hasUploadError:!1,isAccentImageDrawer:!0,openEditBackgroundDrawer:a,h:"100%",w:"100%",hasQuickActions:"behind"!==o,...r})})})})};var lj=e.i(50044),lP=e.i(397068);let lD=({background:e,rounded:t,resizeParams:i,cutLayout:n,isEditable:a,isDark:r,colors:o})=>{let s=(0,lP.getBackgroundProps)(e,r,i,o);return(0,_.jsx)(eg.Box,{position:"absolute",inset:"0",overflow:"hidden",borderRadius:t?"var(--box-border-radius)":"inherit","data-layout-cut":n,draggable:a,...s})},lN=({background:e,rounded:t,cutLayout:i})=>{let n=e.image?.meta?.has_transparency,a=e.image&&!(0,eK.isSVGUrl)(e.image.src)&&!n,r=a?(0,lP.getBackgroundProps)(e,!1,{width:400,blur:50,format:"jpg"}):n?{bg:"var(--shape-bg-color-alpha)"}:void 0;return(0,_.jsx)(eg.Box,{position:"absolute",inset:"0","data-image-fit-bg":!0,overflow:"hidden",...r,borderRadius:t?"var(--box-border-radius)":"inherit",marginY:t?"1em":void 0,bgPosition:"center","data-layout-cut":i,children:a&&!A.isGammaCDNUrl(e.image?.src||void 0)&&(0,_.jsx)(eg.Box,{backdropFilter:"blur(6em)",inset:0,position:"absolute",borderRadius:"inherit","data-selection-ring":"inside"})})},lR=({image:e,resizeParams:t,cutLayout:i,colors:n})=>{let{tempUrl:a,meta:r}=e,o=e.src?(0,eK.recolorImageUrl)(e.src,n):void 0,s=o&&(0,lj.isRasterImage)(e)&&t?(0,eK.resizeAndProxyImageUrl)(o,t,r):o;return(0,_.jsx)(eK.ImageOrVideo,{src:s||void 0,fallbackSrc:a||void 0,borderRadius:"var(--box-border-radius)",pos:"relative",flex:"0 1 auto",minH:0,minW:0,width:"auto",maxW:"100%","data-layout-cut-fg":i,className:"reset-max-width-with-margins"})};var lO=e.i(584139),lB=e.i(103104),lz=e.i(98707),lF=e.i(555027);e.i(988162);var lH=e.i(71259),lW=e.i(922712),lU=e.i(892493);let lV={width:1200},lG=e=>{let t,i,{node:n,decorations:a,editor:r,getPos:o}=e,d=n.attrs,{background:c}=d;(({editor:e,node:t,getPos:i})=>{(0,j.useEffect)(()=>{"cardLayoutItem"===t.type.name&&"accent"===t.attrs.itemId&&setTimeout(()=>{e.commands.command(({tr:n})=>{let a=i();return"number"==typeof a&&((0,o7.replaceCardLayoutWithCardAccentLayoutItem)(n,a,t,e.schema),!0)})})},[e,i,t])})(e);let{openBackgroundTab:u,...p}=(0,s2.useEditBackgroundDrawerDisclosure)(),h=(t=(0,R.useAppSelector)(B.selectTheme),i=t.config?.accentBackgrounds&&t.config?.accentBackgrounds.length>0,c?.source||c?.image?.source||i?o0.ACCENT_IMAGE_SOURCE_KEY:s1.AI_IMAGE_SOURCE_KEY),m=(0,j.useCallback)(e=>{let t=o();if("number"!=typeof t)return;r.commands.updateNestedAttributesAtPos(t,e);let i=a.find(e=>e.spec&&"cardId"in e.spec)?.spec;(0,s0.trackImageReplaced)({previous_attrs:c?.image||{},new_attrs:e.background?.image||{},image_type:"accent_background",replacement_method:"card_accent_drawer",doc_id:r.gammaDocId||"",node_id:i?.cardId})},[r,o,c,a]),{contextMenuItems:g}=(({editor:e,node:t,decorations:i,getPos:n})=>{let a=t.attrs,{background:r,hasImage:o,hasAccentImage:d,canChangeFit:c,canEditImageWithAI:u,cardLayoutDeco:p,displayLayout:h,fitType:m,showChangeFocusPoint:g}=(0,lU.useCardAccentBackground)(a,i),f=p?.cardId,b=p?.isNested,{changeFocalPoint:x}=(0,lz.useImageFormattingMenuActions)({editor:e,getPos:n}),y=(0,lS.useSetLayout)({editor:e,source:"card-accent-context-menu",getPos:n,findParentCard:!0}),{toggleBuddyChatPanel:v,isBuddyChatPanelOpen:C}=(0,lO.useToggleBuddyChatPanel)(),w=(0,j.useCallback)(()=>{f&&lM.eventEmitter.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:f})},[f]),S=(0,j.useCallback)(()=>{e.commands.convertImageToImageCard()},[e]),{imageCardActionsMenuItems:k,showImageCardOptions:A}=(0,lF.useImageCardActionsMenuItems)({canSetAsAccent:!b,onTurnIntoCard:S,onSetCardLayout:y,selectedLayout:h,isAccentImage:!0,canTurnIntoCard:o,canSetAsBackground:d}),E=(0,lW.useEditorContextMenuItems)({editor:e,getPos:n,node:t,includeCut:!1,imageSrc:r?.image?.src}),I=(0,er.useIsThumbnailView)();return{contextMenuItems:(0,j.useMemo)(()=>{if(I)return[];let i=[];return o?(i.push(...E),i.push({divider:!0}),i.push({key:"edit-image",label:l.i18n._({id:"9IrgTy",message:"Edit image..."}),icon:s.faEdit,onClick:w}),u&&i.push({key:"ask-ai",label:(0,_.jsx)(eD.Trans,{message:"Edit with {AGENT_PROPER_NOUN}...",id:"IzVrMk",values:{AGENT_PROPER_NOUN:lB.AGENT_PROPER_NOUN}}),icon:e8.faSparkles,onClick:()=>{C||v()}}),c&&i.push({key:"fit-image",label:"fit"===m?l.i18n._({id:"2Ivw1n",message:"Fill image"}):l.i18n._({id:"VPxUGR",message:"Fit image"}),icon:s.faArrowsMinimize,onClick:()=>{let t=n();"number"==typeof t&&e.commands.updateAttributesAtPos(t,{fitType:"fit"===m?"fill":"fit"})}}),g&&i.push({key:"change-focus-point",label:l.i18n._({id:"BmxaoW",message:"Change focus point"}),icon:s.faCrosshairsSimple,onClick:()=>{let i=n();if("number"!=typeof i)return;let a=(0,lH.getNodeImageAttrs)(t);x((0,lH.getUniqueIdForImage)(e,t,i,a))},disabled:"fit"===m})):i.push({key:"edit-image",label:d?l.i18n._({id:"9IrgTy",message:"Edit image..."}):l.i18n._({id:"pVb3uA",message:"Add image..."}),icon:s.faEdit,onClick:w}),A?i.push(...k):(i.push({divider:!0}),i.push({key:"layout",label:l.i18n._({id:"vR68Ol",message:"Change layout"}),icon:s.faSidebarFlip,items:lC.CARD_LAYOUTS.map(e=>({key:e,label:(0,lk.getLayoutLabel)(e),icon:(0,_.jsx)(lC.CardLayoutIcon,{layout:e,isSelected:h===e}),onClick:()=>y(e)}))})),i.length>0&&i.push({divider:!0}),d&&i.push({key:"remove-accent-image",label:l.i18n._({id:"sGYCGx",message:"Remove accent image"}),icon:s.faImageSlash,onClick:()=>{let t=n();"number"==typeof t&&(0,lk.removeAccentImage)(e,t,!0)}}),i.push({key:"remove-layout",label:l.i18n._({id:"6vLq+T",message:"Remove layout"}),icon:s.faTrash,onClick:()=>{let t=n();"number"==typeof t&&(0,lk.removeAccentImage)(e,t,!1)},color:"red.500"}),i},[E,c,u,x,h,e,m,n,d,o,k,C,I,t,w,y,g,A,v])}})({editor:r,node:n,decorations:a,getPos:o}),{onOpenContextMenu:f}=(0,sM.useEditorContextMenu)({editor:r,contextMenuItems:g,getPos:o}),{defaultFullBleed:b}=(0,R.useAppSelector)(B.selectDocSettingsWithDefaults),x=(0,lE.findCardLayoutDecorationSpec)(a),{colors:y,isDark:v,cardColor:C}=(0,s5.useRecoloredImage)({src:c.image?.src,tempUrl:c.image?.tempUrl,decorations:a}),w=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW,S=(0,er.useIsThumbnailView)(),k=!(w||x?.isNested)&&(x?.cardSize==="default"?"full"===b:x?.cardSize==="full"),A=x?.cardId,E=x?.layout,I="behind"===E,M=S?eK.THUMBNAIL_RESIZE_PARAMS:"right"===E||"left"===E||"top"===E||"mobileLeft"===E||"mobileRight"===E?lV:void 0,T=(0,lk.getAccentImageFitType)(d,E),P=!!(0,o7.findLayoutPreset)(E).items[d.itemId],D=l_(x.layout,d.itemId,"full"===x.cardSize),N="none"===c.type||c.type===o2.BackgroundType.IMAGE&&!c.image||c.type===o2.BackgroundType.IMAGE&&!c.image?.src&&!c.image?.tempUrl,z="fit"===T&&c.image&&!N,F=(0,sI.useSelectAndFocus)(r,o),{setBackgroundDrawerSourceKeyAction:H}=(0,sI.useDrawerSourceKey)(),W=c.image?.loadImageStatus==="queued",U=(0,R.useAppSelector)(B.selectEditable);(0,j.useEffect)(()=>lM.eventEmitter.on("toggleEditBackgroundDrawer",({openDrawer:e,cardId:t})=>{e&&t===A&&(H(h),u(!1))}),[h,A,u,H]);let V=c.image?.uploadStatus,G=(0,O.useShouldRenderMobileVersion)(),$=!k||"fit"===T||G?void 0:"left"===E||"right"===E?{borderRadius:"var(--box-border-radius)",marginY:"1em",height:"auto"}:"top"===E||"behind"===E?{width:"var(--editor-width)",position:"absolute",transform:"translateX(-50%)",left:"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)"}:void 0,Z=(0,j.useCallback)(e=>{(!(e.target instanceof Element)||e.target.closest("[data-card-layout]"))&&(F(),H(h),u(!1))},[h,F,u,H]);if(!P)return null;let K="mobileLeft"===E?"top":E;return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(eH.NodeViewWrapper,{as:"div",style:{display:k?"flex":void 0},children:(0,_.jsxs)(L.Flex,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",w:"100%",h:"100%",onContextMenu:p.isOpen?void 0:f,"data-selection-ring":"inside","data-selection-background":!0,"data-card-layout":x?.layout,"data-testid":"card-accent-layout-item","data-fit-type":T,position:"relative","data-drag-handle":!0,...D,...{flexDirection:"column",justifyContent:"center"},onClick:F,onDoubleClick:Z,...$,bgSize:"fill"===T||I?"cover":"contain",p:"fill"===T||I?0:k?"0.75em":"0.5em",objectFit:"contain",css:{containerType:"size"},align:"center",justify:"center",children:[!z&&(0,_.jsx)(lD,{background:c,isEditable:U,rounded:k&&!G,resizeParams:M,cutLayout:K,isDark:v,colors:y}),z&&(0,_.jsx)(lN,{background:c,rounded:k&&!G,cutLayout:K}),z&&(0,_.jsx)(lR,{image:c.image,resizeParams:M,cutLayout:K,colors:y}),I&&(0,_.jsx)(s4.BackgroundMask,{background:c,cardColor:C}),U&&(0,_.jsx)(s2.EditBackgroundDrawer,{editor:r,updateNestedAttributes:m,background:d?.background,enableMask:I,isAccentImageDrawer:!0,...p}),(0,_.jsx)(lL,{isLoading:W,hasImage:!N,image:c.image,onEditImage:U?F:void 0,openEditBackgroundDrawer:u,borderProps:D,accentLayout:x?.layout,...D}),(0,_.jsx)(s3.MediaUploadIndicators,{uploadStatus:V??void 0,isEditable:U})]})})})},l$=e=>{let{node:t}=e;return"accent"===t.attrs.itemId?(0,_.jsx)(lG,{...e}):(0,_.jsx)(lI,{...e})},lZ=(0,tl.createTiptapNode)("cardAccentLayoutItem",{priority:tm.ExtensionPriorityMap.CardAccentLayoutItem,selectable:!1,draggable:!0,imageKeyPath:"background.image",addNodeView:()=>(0,rL.ReactNodeViewRenderer)(l$,{update:rj.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=card-accent-layout-item]",context:"card/",getAttrs:e=>({id:(0,tl.parseIdAttr)(e,rm.generateMediaId),fitType:e.getAttribute("data-fittype")||null,itemId:e.getAttribute("data-itemid")||"accent",...(0,tl.parseJSONAttr)(e,"background")?{background:(0,tl.parseJSONAttr)(e,"background")}:{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"card-accent-layout-item","data-id":e.attrs.id,"data-fittype":e.attrs.fitType,"data-itemid":e.attrs.itemId,...(0,tl.renderJSONAttrs)(e.attrs,"background")})]});e.s(["CardLayoutItem",()=>l9],967856);var lK=e.i(503108),lq=e.i(615505),lY=e.i(625878);let lX=new ea.PluginKey("cardLayoutResizing");class lQ{activeHandle=null;side;dragging=null;getActiveHandleAbs(e){return this.activeHandle?(0,lY.relativeToAbsolutePos)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.side=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?(this.activeHandle=null,this.side=null):(this.activeHandle=(0,lY.absoluteToRelativePos)(e,t.setHandle.pos),this.side=t.setHandle.side),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let i=e.getMeta(lX);return i&&"setHandle"in i?this.setHandle(t,i):i&&"setDragging"in i?this.setDragging(i):i&&"reset"in i?this.reset():this}}var lJ=e.i(473226),l0=e.i(777226),l1=e.i(599294);let l2=(e,t)=>{e.dispatch(e.state.tr.setMeta(lX,{setHandle:t}))},l3=(e,t)=>{e.dispatch(e.state.tr.setMeta(lX,{setDragging:t}))},l5=(e,t)=>{let{node:i,offset:n}=e.domAtPos(t.start()),a=i.childNodes[n];do if(a&&a.classList&&a.classList.contains("node-card"))break;while(a=a.parentNode)return a},l4={sm:100,md:200,lg:300},l6=(e,t,i)=>{let n=(0,o7.findLayoutPreset)(i),a=e.attrs,r=t?.style.gridTemplateRows||a.layoutTemplateRows||n.grid.gridTemplateRows;if(!r)return null;let o=r.split(" ");if(!o.length)return null;let s=o[0],l=s.includes("var"),d=[];if(l){let e=s.split("-").at(-1)?.slice(0,-1);e&&e in l4||(e="md"),d=[l4[e],0]}else d=o.map(e=>"auto"===e?0:Number.parseInt(e));return d},l9=(0,tl.createTiptapNode)("cardLayoutItem",{selectable:!1,draggable:!1,isolating:!0,containerHandle:!0,priority:tm.ExtensionPriorityMap.CardLayoutItem,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(l$,{update:rj.attrsOrDecorationsChanged}),addCommands:()=>({handleCardAccentDelete:()=>({state:e,commands:t})=>{if(!(0,ei.isNodeSelection)(e.selection))return!1;let{node:i}=e.selection;if(!(0,o7.isAccentCardLayoutItem)(i))return!1;let n=(0,ei.findParentNode)(o4.isCardNode)(e.selection);return!!n&&t.setCardLayout(n.pos,"blank")},selectInsideCardBody:(e,t)=>({state:i,tr:n,commands:a})=>{let r=i.doc.nodeAt(e);if(!r||!(0,o4.isCardNode)(r))return!1;let o=(0,o7.getCardLayoutItems)(n,e);if(0===Object.entries(o).length)return a.selectInsideNodeAtPos(e,t);let s=o.body;return!!s&&a.selectInsideNodeAtPos(s.pos,t)},setCardLayout:(e,t,i)=>({tr:n,editor:a})=>(0,lK.setCardLayoutCommand)(a,n,e,t,i),setCardLayoutWithImage:(e,t,i)=>({tr:n,editor:a})=>{try{if(!(0,lK.setCardLayoutCommand)(a,n,e,t))return!1;let{accent:r}=(0,o7.getCardLayoutItems)(n,e);if(!r||!r.node)return!1;let o=r.node.attrs,s={...o?.background,type:o2.BackgroundType.IMAGE,source:i.source||"image.custom",image:{...(0,o8.extractImageAttrs)(i)}};return n.setNodeAttribute(r.pos,"background",s),!0}catch(e){return console.error("Error in setCardLayoutWithImage:",e),!1}},removeCardLayout:e=>({tr:t,editor:i})=>{let n=(0,o4.findCardById)(i,e);return!!n&&(0,lK.setCardLayoutCommand)(i,t,n.pos,"blank")}}),parseHTML:()=>[{tag:"div[class=card-layout-item]"},{tag:"div[class=body]",context:"card/"}],addProseMirrorPlugins(){return[(0,lE.CardLayoutPlugin)(this.editor),new ea.Plugin({key:lX,state:{init:()=>new lQ,apply:(e,t,i,n)=>t.apply(e,n)},props:{attributes:e=>null!==lX.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(e,t)=>(((e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let i=lX.getState(e.state);if(i.dragging)return;let n=function(e,t){let i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i||-1===i.inside)return null;let n=e.domAtPos(i.inside);if(!n)return null;let a=n.node.childNodes[n.offset];if(!a)return null;let r=e.state.doc.resolve(i.inside);if(!r.nodeAfter||!(0,o4.isCardLayoutItemNode)(r.nodeAfter))return null;let o=(0,rk.findParentNodes)(r,o4.isCardNode)[0];if(!o)return null;let s=o.node.attrs.layout;if(!(0,o7.findLayoutPreset)(s).allowResizing)return null;let l="top"===s,{left:d,right:c,bottom:u,top:p}=a.getBoundingClientRect();if(t.clientX-d<=5&&!l){let i=e.posAtCoords({left:t.clientX-10,top:t.clientY});if(!i)return null;let n=e.state.doc.nodeAt(i.inside);return n&&(0,o4.isCardLayoutItemNode)(n)?"cardLayoutItem"===n.type.name?{pos:i.inside,side:"right"}:{pos:r.pos,side:"left"}:null}if(c-t.clientX<=5&&!l){let i=e.posAtCoords({left:t.clientX+10,top:t.clientY});if(!i)return null;let n=e.state.doc.nodeAt(i.inside);return n&&(0,o4.isCardLayoutItemNode)(n)?"cardLayoutItem"===n.type.name?{pos:i.inside,side:"left"}:{pos:r.pos,side:"right"}:null}if(u-t.clientY<=5&&l){let i=e.posAtCoords({left:t.clientX,top:t.clientY+10});if(!i)return null;let n=e.state.doc.nodeAt(i.inside);return n&&(0,o4.isCardLayoutItemNode)(n)&&"cardLayoutItem"===n.type.name?{pos:i.inside,side:"top"}:null}if(t.clientY-p<=5&&l){let i=e.posAtCoords({left:t.clientX,top:t.clientY+10});if(!i)return null;let n=e.state.doc.nodeAt(i.inside);if(!n||!(0,o4.isCardLayoutItemNode)(n)||"cardLayoutItem"!==n.type.name)return null;let a=e.state.doc.resolve(i.inside).parent;return a&&"card"===a.type.name&&"top"===a.attrs.layout?{pos:i.inside,side:"top"}:null}return null}(e,t),a=i.getActiveHandleAbs(e.state),r=i.side;null===a&&null===n||n&&n.side===r&&n.pos===a||l2(e,n)})(e,t),!1),mouseleave(e){let t;return null===(t=lX.getState(e.state)).getActiveHandleAbs(e.state)||t.dragging||l2(e,null),!1},mousedown:(e,t)=>(!function(e,t){if(!e.editable)return;let i=lX.getState(e.state),n=i.getActiveHandleAbs(e.state);if(null===n||i.dragging)return;let a=e.state.doc.resolve(n),r=a.node(),o=l5(e,a),s=o.querySelector('[data-node-view-content-inner="card"]');if(!s)return;let l=i.side,d=l&&["top","bottom"].includes(l)?"y":"x",c="x"===d?s.offsetWidth:s.offsetHeight,u=((e,t,i="x")=>{let n=e.domAtPos(t),a=n.node.childNodes[n.offset];return"x"===i?a.offsetWidth:a.offsetHeight})(e,n),p=((e,t,i)=>{let n=(0,o7.findLayoutPreset)(i),a=t.querySelector('[data-node-view-content-inner="card"]');if("top"===i)return l6(e,a,i);let r=e.attrs,o=a?.style.gridTemplateColumns||r.layoutTemplateColumns||n.grid.gridTemplateColumns;if(!o)return null;let s=o.split(" ");if(!s.length)return null;let l=s[0].includes("fr"),d=[];if(l){let e=s.map(e=>+e.replace("fr","")),t=e.reduce((e,t)=>e+t,0);d=e.map(e=>e/t*100)}else d=s.map(e=>+e.replace("%",""));return d})(r,o,r.attrs.layout);if(!p)return;l3(e,{startX:t.clientX,startY:t.clientY,dragDirection:l&&["top","bottom"].includes(l)?"y":"x",startSize:u,colWidths:p,totalSize:c,colIndex:0});let h=null;function m(){window.removeEventListener("mouseup",m),window.removeEventListener("mousemove",g);let t=lX.getState(e.state);if(t.dragging){if(null===h)return void l3(e,null);if(t.dragging)try{(function(e,t,i,n="x"){var a,r;let o,s,l=e.state.doc.resolve(t).before(),d=i.join(" "),c=e.state.tr.setNodeAttribute(l,"x"===n?"layoutTemplateColumns":"layoutTemplateRows",d);e.dispatch(c),a=e,r=t,o=a.state.doc.resolve(r),(s=l5(a,o).querySelector('[data-node-view-content-inner="card"]'))&&(s.style.gridTemplateColumns="",s.style.gridTemplateRows="")})(e,t.getActiveHandleAbs(e.state),h,t.dragging.dragDirection),l3(e,null)}catch(t){e.dispatch(e.state.tr.setMeta(lX,{reset:!0}))}h=null}}function g(t){if(!t.which)return m();let i=lX.getState(e.state),n=i.getActiveHandleAbs(e.state);if(!i.dragging||null===n)return;let{colWidths:a}=i.dragging,r=a[0],s={left:[10,25,37.5,50,62.5],right:[37.5,50,62.5,75,90],top:Object.values(l4)}[l??"left"];if("top"===l){let e=r+(t.clientY-i.dragging.startY),n=s.findIndex((t,i,n)=>i===n.length-1||e<=(n[i+1]+t)/2),a=Object.keys(l4)[n];h=[`var(--top-accent-height-${a})`,"auto"]}else{let e=function(e,t,i=1){let{totalSize:n}=e,a="x"===e.dragDirection?t.clientX-e.startX:t.clientY-e.startY;return(0,lJ.default)(100*a/n/i,0)*i}(i.dragging,t,.1),n=r+es[s.length-1]?s[s.length-1]:s.find(t=>6.25>=Math.abs(t-r-e));h=(0,l0.rebalanceColWidths)(a,0,n-r,10).map(e=>`${e}%`)}(function(e,t,i="x"){let n=e.querySelector('[data-node-view-content-inner="card"]');n&&(n.style["y"===i?"gridTemplateRows":"gridTemplateColumns"]=t.join(" "))})(o,h,d),(0,l1.dispatchContainerResizeEvent)(o)}window.addEventListener("mouseup",m),window.addEventListener("mousemove",g),t.preventDefault()}(e,t),!1)},decorations(e){let t=lX.getState(e),i=t.getActiveHandleAbs(e);if(null!==i){let n=[];try{let a=document.createElement("div");a.className=`column-resize-handle ${t.side}`,n.push(lq.Decoration.widget(i+1,a));let r=e.doc.nodeAt(i);return n.push(lq.Decoration.node(i,i+r.nodeSize,{class:"has-column-resize-handle"})),lq.DecorationSet.create(e.doc,n)}catch(e){return console.error(`(caught) cardLayoutResizing error: ${e.message}`),lq.DecorationSet.empty}}},nodeViews:{}}})]},renderHTML:({HTMLAttributes:e})=>["div",(0,ei.mergeAttributes)(e,{class:"card-layout-item"}),0]});var l8=e.i(59614),l7=e.i(647031);let de=new ea.PluginKey("cardNotesPlugin"),dt=(0,tl.createTiptapNode)("cardNotes",{selectable:!1,parseHTML:()=>[{tag:"div[class=card-notes]"},{tag:"notes"}],renderHTML:({HTMLAttributes:e})=>["div",(0,ei.mergeAttributes)(e,{class:"card-notes"}),0],renderText:()=>"",addProseMirrorPlugins(){let e,t=(0,R.getStore)();return[(e=this.editor,new ea.Plugin({key:de,props:{attributes:()=>{let i=t.getState();return(0,l8.selectIsCardNotesPanelOpen)(i)&&!(0,se.isCardNotesEditor)(e)&&(0,B.selectEditable)(i)&&!e.isStatic?{class:"card-notes-active"}:{class:""}},decorations:({doc:i,selection:n})=>{let a=t.getState();if(!(0,l8.selectIsCardNotesPanelOpen)(a)||(0,se.isCardNotesEditor)(e)||!(0,B.selectEditable)(a)||e.isStatic)return;let r=(0,l7.findTopCardNodeParent)(e.state.doc,n.from);if(r)return lq.DecorationSet.create(i,[lq.Decoration.node(r.pos,r.pos+r.node.nodeSize,{class:"card-notes-active-parent-card"})])}},appendTransaction:(t,i,n)=>{var a,r,o,s;if((0,se.isCardNotesEditor)(e)||e.isThumbnail||e.isStatic)return;let l=n.tr;return((0,v.preventLeakyMarks)(t,i,n,l,"cardNotes"),a=t,r=i,o=n,s=l,a.forEach(e=>{let t,i=e.steps.map((e,t)=>[e,t]).filter(e=>e[0]instanceof rT.ReplaceStep||e[0]instanceof rT.ReplaceAroundStep);if(1!==i.length)return;let[n,a]=i[0];if((0,ry.isRemoteTransaction)(e)||e.getMeta("cardNotesHandled")||(t=0===n.slice.content.size,(n.from===n.to||!t)&&(n.from===n.to&&!t||(n.from===n.to||t)&&1)))return;let l=e.docs[a],{from:d,to:c}=n,u=new Set;l.nodesBetween(d,c,(e,t)=>{if(tc)return!0;if("card"===e.type.name)return u.add(e.attrs.id),!0;if("cardNotes"===e.type.name){let i=r.doc.resolve(t),n=(0,ei.findParentNodeClosestToPos)(i,o4.isCardNode);if(u.has(n?.node.attrs.id))return!1;let a=(0,ei.findChildren)(o.doc,e=>(0,o4.isCardNode)(e)&&e.attrs.id===n?.node.attrs.id);if(!a[0])return!1;let l=(0,ei.findChildren)(a[0].node,e=>"cardNotes"===e.type.name);if(l.length>0&&l[0]?.node.content.eq(e.content)&&a[0].pos===n?.pos)return!1;let c=(0,l7.findTopCardNodeParent)(o.doc,d);if(!c)return console.warn("[preventNotesDelete] parentCard not found"),!1;let p=o.doc.resolve(c.pos);if((0,se.findCardNotes)(p)){let t=sr(o.doc,c.pos,!1);if(null===t)return console.warn("[preventNotesDelete] insertPos not found"),!1;s.insert(t,e.content)}else{let t=c.pos+c.node.nodeSize-1;s.insert(t,e)}}return!0})}),l.docChanged)?l:null}}))]}});e.s(["CardNotes",0,dt],274526),e.s(["CardNotesNodeView",0,e=>{let{decorations:t,editor:i,getPos:n,node:a}=e,r=(0,R.useAppDispatch)(),o=n(),s=(e=>{let{doc:t}=(0,X.useEditorState)();try{if("number"!=typeof e)return;let i=(0,ei.findParentNodeClosestToPos)(t.resolve(e),o4.isCardNode),n=i?.node;return n?.attrs.id}catch{return}})(o),{isNested:l}=(0,sL.findCardPluginDecoration)(t),d=(0,X.useEditorState)(),c=!l&&"number"==typeof o&&(0,se.isSelectionWithinTopCardAtPos)(d,o),u=i.shouldUsePublishedVersion,p=!!a&&!u&&c&&!l;return(0,j.useEffect)(()=>{p&&r((0,l8.setCardNoteProps)({activeNoteCardId:s,getPos:n,node:a}))},[p,r,s,n,a]),null}],461679),e.s(["CardTableOfContents",()=>dE],208815),e.s(["CardTableOfContentsThumbnailView",()=>dA,"CardTableOfContentsView",()=>dk],431604);var di=e.i(40317),dn=e.i(404529),da=e.i(531768),dr=e.i(131669),ds=e.i(189938),dl=e.i(82050),dd=e.i(681442),dc=e.i(346037),du=e.i(703971),dp=e.i(210792);e.s(["createUnorderedListStyle",()=>dy,"listStyles",()=>dv],165020);var dh=e.i(53237),dm=e.i(51913),dg=e.i(878410);let df=[...Array(dh.MAX_INDENT+1).keys()],db="1.6em",dx=["disc","circle","square"],dy=e=>({listStyle:dx[e%dx.length],paddingStart:"0.4em",_after:{ps:"0.4em"},marginStart:`calc(${e+1} * ${db} - 0.4em)`}),dv={[dm.LIST_BLOCK_CLASSES]:{margin:"0",marginBottom:(0,dg.scaleWithFontScale)(dm.LIST_VERTICAL_MARGIN),textAlign:"start","&.first-block":{marginTop:(0,dg.scaleWithFontScale)(dm.LIST_FIRST_ITEM_MARGIN)}},"ol.block-numbered":{listStyle:"none"},".block-todo":{listStyle:"none","label.chakra-checkbox":{pointerEvents:"none",".chakra-checkbox__control":{pointerEvents:"auto",width:"1em",height:"1em",top:"calc(0.5lh - 0.5em)",position:"relative",borderRadius:"var(--box-border-radius)",borderColor:"var(--link-color)",borderWidth:"0.125em","&[data-checked]":{backgroundColor:"var(--link-color)",color:"var(--body-color-inverted)"},svg:{fontSize:"0.5em"}}}},".block-bullet, .block-todo":{li:{position:"relative"}}};df.forEach(e=>{dv[`ol.block-numbered[indent="${e}"]`]={"li[data-node-view-content]":{ms:`calc(${e+1} * ${db})`,position:"relative",_before:{position:"absolute","inset-inline-start":`-${db}`,content:'attr(data-list-counter) "."'}}}}),df.forEach(e=>{dv[`ul.block-bullet[indent="${e}"]`]={"li[data-node-view-content]":dy(e)},dv[`ul.block-todo[indent="${e}"]`]={"li.todo":{ms:`calc(${e+1} * ${db})`,listStyle:"none"},".chakra-checkbox__control":{"inset-inline-start":`-${db}`}}});var dC=e.i(940709),dw=e.i(576897);let dS=(0,j.memo)(({cardId:e,docId:t,editor:i,cards:n,level:a,showNested:r,isPresentMode:o,hiddenCardMap:s})=>{let l=(0,du.useGetCardText)({cardId:e}),d=(0,R.useAppSelector)(dl.selectDoc),c=(0,R.useAppSelector)(dl.selectFile),u=(0,j.useCallback)(t=>{(0,dp.navigateToCardLink)(i,t,e)},[i,e]),p=(0,eo.useShouldUsePublishedVersion)(),h=(0,j.useMemo)(()=>{let i=(0,dw.getCardUrl)({cardId:e,docId:t,isPresentMode:o});return p?(0,dC.getRelativeOrAbsoluteUrl)({url:i,doc:d,file:c}):i},[e,t,d,c,o,p]),{listStyle:m,paddingStart:g,marginStart:f}=dy(a);return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(dc.List,{mb:"0.5em",children:(0,_.jsx)(dc.ListItem,{listStyleType:m,ps:g,ms:f,children:(0,_.jsx)(eg.Box,{display:"inline",children:(0,_.jsx)(e$.Link,{href:h,className:"link",role:"link",isExternal:!p,noOfLines:1,wordBreak:"break-word",onClick:u,display:"-webkit-inline-box",verticalAlign:"top",children:l?.title||(0,_.jsx)(eD.Trans,{message:"Untitled",id:"wja8aL"})})})})}),r&&n.filter(({id:e})=>!s?.[e]).map(e=>(0,_.jsx)(dS,{cardId:e.id,cards:e.children,editor:i,level:a+1,showNested:r,docId:t,isPresentMode:o,hiddenCardMap:s},e.id))]})});dS.displayName="CardTOCItem";let dk=e=>{let{node:t,editor:i,decorations:n}=e,{nested:a}=t.attrs,{cardId:r}=(0,sL.findCardPluginDecoration)(n),o=(0,R.useAppSelector)(ds.selectHiddenMap),s=(0,R.useAppSelector)((0,B.selectTOCData)({cardId:r,showAll:eZ.isScreenshot})).filter(({id:e})=>!o?.[e]),l=(0,R.useAppSelector)(dl.selectDoc),d=(0,R.useAppSelector)(B.selectMode),c=(0,R.useAppSelector)(B.selectIsStatic),u=d===r6.EditorModeEnum.SLIDE_VIEW;return(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,_.jsxs)(eg.Box,{cursor:"default",pointerEvents:c?"none":void 0,borderRadius:"var(--box-border-radius)","data-selection-ring":!0,className:"card-toc",children:[0===s.length&&(0,_.jsxs)(di.Alert,{colorScheme:"gray",color:"gray.700",fontFamily:"body",fontSize:"1em",py:"0.75em",px:"1em",children:[(0,_.jsx)(da.AlertIcon,{w:"1em",h:"1em",alignSelf:"center",me:"0.75em"}),(0,_.jsxs)(eg.Box,{children:[(0,_.jsx)(dr.AlertTitle,{fontSize:"1em",lineHeight:"1.5em",children:(0,_.jsx)(eD.Trans,{message:"This is the last card.",id:"519v/x"})}),(0,_.jsx)(dn.AlertDescription,{fontSize:"0.75em",lineHeight:"1.5em",children:(0,_.jsx)(eD.Trans,{message:"Add more cards to generate table of content links automatically.",id:"HmhQ3B"})})]})]}),s.map(e=>(0,_.jsx)(dS,{cardId:e.id,cards:e.children,editor:i,level:0,showNested:a,docId:l?.id||"",isPresentMode:u,hiddenCardMap:o},e.id))]})})},dA=e=>(0,_.jsx)(eH.NodeViewWrapper,{children:(0,_.jsxs)(eQ.VStack,{spacing:"0.5em",align:"start",children:[(0,_.jsx)(dd.ThumbnailSkeleton,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,_.jsx)(dd.ThumbnailSkeleton,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,_.jsx)(dd.ThumbnailSkeleton,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,_.jsx)(dd.ThumbnailSkeleton,{h:"1em",w:"14em",bg:"var(--link-color)"})]})}),dE=(0,tl.createTiptapNode)("tableOfContents",{selectable:!0,dynamic:!0,parseHTML:()=>[{tag:"div[class=toc]",getAttrs:e=>({nested:"true"===e.getAttribute("data-nested")})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"toc",...e.attrs.nested&&{"data-nested":"true"}})],addNodeView(){return this.editor.isThumbnail?(0,rL.ReactNodeViewRenderer)(dA,{update:rj.attrsOrDecorationsChanged}):(0,rL.ReactNodeViewRenderer)(dk,{update:rj.attrsOrDecorationsChanged})}});e.s(["Chart",()=>mR],282845),e.s(["ChartView",()=>m_],432605);var d_=e.i(562190),d_=d_;function dI(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}class dM extends Map{constructor(e,t=dL){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,i]of e)this.set(t,i)}get(e){return super.get(dT(this,e))}has(e){return super.has(dT(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},i){let n=t(i);return e.has(n)?e.get(n):(e.set(n,i),i)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},i){let n=t(i);return e.has(n)&&(i=e.get(n),e.delete(n)),i}(this,e))}}function dT({_intern:e,_key:t},i){let n=t(i);return e.has(n)?e.get(n):i}function dL(e){return null!==e&&"object"==typeof e?e.valueOf():e}let dj=Symbol("implicit");function dP(e,t,i){e.prototype=t.prototype=i,i.constructor=e}function dD(e,t){var i=Object.create(e.prototype);for(var n in t)i[n]=t[n];return i}function dN(){}var dR="\\s*([+-]?\\d+)\\s*",dO="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dB="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",dz=/^#([0-9a-f]{3,8})$/,dF=RegExp(`^rgb\\(${dR},${dR},${dR}\\)$`),dH=RegExp(`^rgb\\(${dB},${dB},${dB}\\)$`),dW=RegExp(`^rgba\\(${dR},${dR},${dR},${dO}\\)$`),dU=RegExp(`^rgba\\(${dB},${dB},${dB},${dO}\\)$`),dV=RegExp(`^hsl\\(${dO},${dB},${dB}\\)$`),dG=RegExp(`^hsla\\(${dO},${dB},${dB},${dO}\\)$`),d$={aliceblue:0xf0f8ff,antiquewhite:0xfaebd7,aqua:65535,aquamarine:8388564,azure:0xf0ffff,beige:0xf5f5dc,bisque:0xffe4c4,black:0,blanchedalmond:0xffebcd,blue:255,blueviolet:9055202,brown:0xa52a2a,burlywood:0xdeb887,cadetblue:6266528,chartreuse:8388352,chocolate:0xd2691e,coral:0xff7f50,cornflowerblue:6591981,cornsilk:0xfff8dc,crimson:0xdc143c,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:0xb8860b,darkgray:0xa9a9a9,darkgreen:25600,darkgrey:0xa9a9a9,darkkhaki:0xbdb76b,darkmagenta:9109643,darkolivegreen:5597999,darkorange:0xff8c00,darkorchid:0x9932cc,darkred:9109504,darksalmon:0xe9967a,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:0xff1493,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:0xb22222,floralwhite:0xfffaf0,forestgreen:2263842,fuchsia:0xff00ff,gainsboro:0xdcdcdc,ghostwhite:0xf8f8ff,gold:0xffd700,goldenrod:0xdaa520,gray:8421504,green:32768,greenyellow:0xadff2f,grey:8421504,honeydew:0xf0fff0,hotpink:0xff69b4,indianred:0xcd5c5c,indigo:4915330,ivory:0xfffff0,khaki:0xf0e68c,lavender:0xe6e6fa,lavenderblush:0xfff0f5,lawngreen:8190976,lemonchiffon:0xfffacd,lightblue:0xadd8e6,lightcoral:0xf08080,lightcyan:0xe0ffff,lightgoldenrodyellow:0xfafad2,lightgray:0xd3d3d3,lightgreen:9498256,lightgrey:0xd3d3d3,lightpink:0xffb6c1,lightsalmon:0xffa07a,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:0xb0c4de,lightyellow:0xffffe0,lime:65280,limegreen:3329330,linen:0xfaf0e6,magenta:0xff00ff,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:0xba55d3,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:0xc71585,midnightblue:1644912,mintcream:0xf5fffa,mistyrose:0xffe4e1,moccasin:0xffe4b5,navajowhite:0xffdead,navy:128,oldlace:0xfdf5e6,olive:8421376,olivedrab:7048739,orange:0xffa500,orangered:0xff4500,orchid:0xda70d6,palegoldenrod:0xeee8aa,palegreen:0x98fb98,paleturquoise:0xafeeee,palevioletred:0xdb7093,papayawhip:0xffefd5,peachpuff:0xffdab9,peru:0xcd853f,pink:0xffc0cb,plum:0xdda0dd,powderblue:0xb0e0e6,purple:8388736,rebeccapurple:6697881,red:0xff0000,rosybrown:0xbc8f8f,royalblue:4286945,saddlebrown:9127187,salmon:0xfa8072,sandybrown:0xf4a460,seagreen:3050327,seashell:0xfff5ee,sienna:0xa0522d,silver:0xc0c0c0,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:0xfffafa,springgreen:65407,steelblue:4620980,tan:0xd2b48c,teal:32896,thistle:0xd8bfd8,tomato:0xff6347,turquoise:4251856,violet:0xee82ee,wheat:0xf5deb3,white:0xffffff,whitesmoke:0xf5f5f5,yellow:0xffff00,yellowgreen:0x9acd32};function dZ(){return this.rgb().formatHex()}function dK(){return this.rgb().formatRgb()}function dq(e){var t,i;return e=(e+"").trim().toLowerCase(),(t=dz.exec(e))?(i=t[1].length,t=parseInt(t[1],16),6===i?dY(t):3===i?new d0(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===i?dX(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===i?dX(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=dF.exec(e))?new d0(t[1],t[2],t[3],1):(t=dH.exec(e))?new d0(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=dW.exec(e))?dX(t[1],t[2],t[3],t[4]):(t=dU.exec(e))?dX(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=dV.exec(e))?d6(t[1],t[2]/100,t[3]/100,1):(t=dG.exec(e))?d6(t[1],t[2]/100,t[3]/100,t[4]):d$.hasOwnProperty(e)?dY(d$[e]):"transparent"===e?new d0(NaN,NaN,NaN,0):null}function dY(e){return new d0(e>>16&255,e>>8&255,255&e,1)}function dX(e,t,i,n){return n<=0&&(e=t=i=NaN),new d0(e,t,i,n)}function dQ(e){return(e instanceof dN||(e=dq(e)),e)?new d0((e=e.rgb()).r,e.g,e.b,e.opacity):new d0}function dJ(e,t,i,n){return 1==arguments.length?dQ(e):new d0(e,t,i,null==n?1:n)}function d0(e,t,i,n){this.r=+e,this.g=+t,this.b=+i,this.opacity=+n}function d1(){return`#${d4(this.r)}${d4(this.g)}${d4(this.b)}`}function d2(){let e=d3(this.opacity);return`${1===e?"rgb(":"rgba("}${d5(this.r)}, ${d5(this.g)}, ${d5(this.b)}${1===e?")":`, ${e})`}`}function d3(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function d5(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function d4(e){return((e=d5(e))<16?"0":"")+e.toString(16)}function d6(e,t,i,n){return n<=0?e=t=i=NaN:i<=0||i>=1?e=t=NaN:t<=0&&(e=NaN),new d7(e,t,i,n)}function d9(e){if(e instanceof d7)return new d7(e.h,e.s,e.l,e.opacity);if(e instanceof dN||(e=dq(e)),!e)return new d7;if(e instanceof d7)return e;var t=(e=e.rgb()).r/255,i=e.g/255,n=e.b/255,a=Math.min(t,i,n),r=Math.max(t,i,n),o=NaN,s=r-a,l=(r+a)/2;return s?(o=t===r?(i-n)/s+(i0&&l<1?0:o,new d7(o,s,l,e.opacity)}function d8(e,t,i,n){return 1==arguments.length?d9(e):new d7(e,t,i,null==n?1:n)}function d7(e,t,i,n){this.h=+e,this.s=+t,this.l=+i,this.opacity=+n}function ce(e){return(e=(e||0)%360)<0?e+360:e}function ct(e){return Math.max(0,Math.min(1,e||0))}function ci(e,t,i){return(e<60?t+(i-t)*e/60:e<180?i:e<240?t+(i-t)*(240-e)/60:t)*255}function cn(e,t,i,n,a){var r=e*e,o=r*e;return((1-3*e+3*r-o)*t+(4-6*r+3*o)*i+(1+3*e+3*r-3*o)*n+o*a)/6}dP(dN,dq,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:dZ,formatHex:dZ,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return d9(this).formatHsl()},formatRgb:dK,toString:dK}),dP(d0,dJ,dD(dN,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new d0(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new d0(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new d0(d5(this.r),d5(this.g),d5(this.b),d3(this.opacity))},displayable(){return -.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:d1,formatHex:d1,formatHex8:function(){return`#${d4(this.r)}${d4(this.g)}${d4(this.b)}${d4((isNaN(this.opacity)?1:this.opacity)*255)}`},formatRgb:d2,toString:d2})),dP(d7,d8,dD(dN,{brighter(e){return e=null==e?1.4285714285714286:Math.pow(1.4285714285714286,e),new d7(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?.7:Math.pow(.7,e),new d7(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,i=this.l,n=i+(i<.5?i:1-i)*t,a=2*i-n;return new d0(ci(e>=240?e-240:e+120,a,n),ci(e,a,n),ci(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new d7(ce(this.h),ct(this.s),ct(this.l),d3(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=d3(this.opacity);return`${1===e?"hsl(":"hsla("}${ce(this.h)}, ${100*ct(this.s)}%, ${100*ct(this.l)}%${1===e?")":`, ${e})`}`}}));let ca=e=>()=>e;function cr(e,t){return function(i){return e+i*t}}function co(e,t){var i=t-e;return i?cr(e,i>180||i<-180?i-360*Math.round(i/360):i):ca(isNaN(e)?t:e)}function cs(e,t){var i=t-e;return i?cr(e,i):ca(isNaN(e)?t:e)}let cl=function e(t){var i,n=1==(i=+t)?cs:function(e,t){var n,a,r;return t-e?(n=e,a=t,n=Math.pow(n,r=i),a=Math.pow(a,r)-n,r=1/r,function(e){return Math.pow(n+e*a,r)}):ca(isNaN(e)?t:e)};function a(e,t){var i=n((e=dJ(e)).r,(t=dJ(t)).r),a=n(e.g,t.g),r=n(e.b,t.b),o=cs(e.opacity,t.opacity);return function(t){return e.r=i(t),e.g=a(t),e.b=r(t),e.opacity=o(t),e+""}}return a.gamma=e,a}(1);function cd(e){return function(t){var i,n,a=t.length,r=Array(a),o=Array(a),s=Array(a);for(i=0;i=1?(i=1,t-1):Math.floor(i*t),a=e[n],r=e[n+1],o=n>0?e[n-1]:2*a-r,s=ncg?Math.pow(e,1/3):e/cm+cp}function cv(e){return e>ch?e*e*e:cm*(e-cp)}function cC(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function cw(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function cS(e,t,i,n){return 1==arguments.length?function(e){if(e instanceof ck)return new ck(e.h,e.c,e.l,e.opacity);if(e instanceof cx||(e=cf(e)),0===e.a&&0===e.b)return new ck(NaN,0(e(t=new Date(+t)),t),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=e=>{let t=a(e),i=a.ceil(e);return e-t(t(e=new Date(+e),null==i?1:Math.floor(i)),e),a.range=(i,n,r)=>{let o,s=[];if(i=a.ceil(i),r=null==r?1:Math.floor(r),!(i0))return s;do s.push(o=new Date(+i)),t(i,r),e(i);while(ocz(t=>{if(t>=t)for(;e(t),!i(t);)t.setTime(t-1)},(e,n)=>{if(e>=e)if(n<0)for(;++n<=0;)for(;t(e,-1),!i(e););else for(;--n>=0;)for(;t(e,1),!i(e););}),i&&(a.count=(t,n)=>(cO.setTime(+t),cB.setTime(+n),e(cO),e(cB),Math.floor(i(cO,cB))),a.every=e=>isFinite(e=Math.floor(e))&&e>0?e>1?a.filter(n?t=>n(t)%e==0:t=>a.count(0,t)%e==0):a:null),a}let cF=cz(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+1e3*t)},(e,t)=>(t-e)/1e3,e=>e.getUTCSeconds());cF.range;let cH=cz(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds())},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getMinutes());cH.range;let cW=cz(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+6e4*t)},(e,t)=>(t-e)/6e4,e=>e.getUTCMinutes());cW.range;let cU=cz(e=>{e.setTime(e-e.getMilliseconds()-1e3*e.getSeconds()-6e4*e.getMinutes())},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getHours());cU.range;let cV=cz(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+36e5*t)},(e,t)=>(t-e)/36e5,e=>e.getUTCHours());cV.range;let cG=cz(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/864e5,e=>e.getDate()-1);cG.range;let c$=cz(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>e.getUTCDate()-1);c$.range,cz(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/864e5,e=>Math.floor(e/864e5)).range;let cZ=cz(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());cZ.every=e=>isFinite(e=Math.floor(e))&&e>0?cz(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,i)=>{t.setFullYear(t.getFullYear()+i*e)}):null,cZ.range;let cK=cz(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());cK.every=e=>isFinite(e=Math.floor(e))&&e>0?cz(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,i)=>{t.setUTCFullYear(t.getUTCFullYear()+i*e)}):null,cK.range;let cq=cz(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());cq.range;let cY=cz(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());function cX(e){return cz(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4)/6048e5)}cY.range;let cQ=cX(0),cJ=cX(1),c0=cX(2),c1=cX(3),c2=cX(4),c3=cX(5),c5=cX(6);function c4(e){return cz(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/6048e5)}cQ.range,cJ.range,c0.range,c1.range,c2.range,c3.range,c5.range;let c6=c4(0),c9=c4(1),c8=c4(2),c7=c4(3),ue=c4(4),ut=c4(5),ui=c4(6);c6.range,c9.range,c8.range,c7.range,ue.range,ut.range,ui.range;var un=new Date(Date.UTC(2020,1,2,3,4,5)),ua={day:cG,hour:cU,minute:cH,month:cq,second:cF,week:cQ,year:cZ},ur={day:c$,hour:cV,minute:cW,month:cY,second:cF,week:c6,year:cK};function uo(e,t){return e*=1,t*=1,function(i){return Math.round(e*(1-i)+t*i)}}var us=["domain","nice","zero","interpolate","round","range","reverse","align","base","clamp","constant","exponent","padding","unknown"],ul={domain:function(e,t){t.domain&&e.domain(t.domain)},nice:function(e,t){if("nice"in t&&void 0!==t.nice&&"nice"in e){var i=t.nice;if("boolean"==typeof i)i&&e.nice();else if("number"==typeof i)e.nice(i);else{var n="2020-02-02 03:04"===e.tickFormat(1,"%Y-%m-%d %H:%M")(un);if("string"==typeof i)e.nice(n?ur[i]:ua[i]);else{var a=i.interval,r=i.step,o=(n?ur[a]:ua[a]).every(r);null!=o&&e.nice(o)}}}},zero:function(e,t){if("zero"in t&&!0===t.zero){var i=e.domain(),n=i[0],a=i[1],r=a=0||(a[i]=e[i]);return a}(e,uh);return j.default.createElement("rect",um({ref:i,className:(0,up.default)("visx-bar",t)},n))}var uf=["children","className","innerRef","x","y","width","height","radius","all","top","bottom","left","right","topLeft","topRight","bottomLeft","bottomRight"];function ub(){return(ub=Object.assign.bind()).apply(this,arguments)}function ux(e){var t,i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b=e.children,x=e.className,y=e.innerRef,v=e.x,C=e.y,w=e.width,S=e.height,k=e.radius,A=e.all,E=e.top,_=e.bottom,I=e.left,M=e.right,T=e.topLeft,L=e.topRight,P=e.bottomLeft,D=e.bottomRight,N=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,uf),R=(i=(t={x:v,y:C,width:w,height:S,radius:k,all:void 0!==A&&A,top:void 0!==E&&E,bottom:void 0!==_&&_,left:void 0!==I&&I,right:void 0!==M&&M,topLeft:void 0!==T&&T,topRight:void 0!==L&&L,bottomLeft:void 0!==P&&P,bottomRight:void 0!==D&&D}).all,n=t.bottom,a=t.bottomLeft,r=t.bottomRight,o=t.height,s=t.left,l=t.radius,d=t.right,c=t.top,u=t.topLeft,p=t.topRight,h=t.width,m=t.x,g=t.y,p=i||c||d||p,r=i||n||d||r,a=i||n||s||a,u=i||c||s||u,f=2*(l=Math.max(1,Math.min(l,Math.min(h,o)/2))),("M"+(m+l)+","+g+" h"+(h-f)+"\n "+(p?"a"+l+","+l+" 0 0 1 "+l+","+l:"h"+l+"v"+l)+"\n v"+(o-f)+"\n "+(r?"a"+l+","+l+" 0 0 1 "+-l+","+l:"v"+l+"h"+-l)+"\n h"+(f-h)+"\n "+(a?"a"+l+","+l+" 0 0 1 "+-l+","+-l:"h"+-l+"v"+-l)+"\n v"+(f-o)+"\n "+(u?"a"+l+","+l+" 0 0 1 "+l+","+-l:"v"+-l+"h"+l)+"\nz").split("\n").join(""));return b?j.default.createElement(j.default.Fragment,null,b({path:R})):j.default.createElement("path",ub({ref:y,className:(0,up.default)("visx-bar-rounded",x),d:R},N))}class uy{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;it.attachTimeline(e));return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return uv(this.animations,"duration")}get iterationDuration(){return uv(this.animations,"iterationDuration")}runAll(e){this.animations.forEach(t=>t[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function uv(e,t){let i=0;for(let n=0;ni&&(i=a)}return i}class uC extends uy{then(e,t){return this.finished.finally(e).then(()=>{})}}var uw=e.i(850710),uS=e.i(244735),uk=e.i(385465),uA=e.i(20086),uE=e.i(453595),u_=e.i(443976),uI=e.i(822276),uM=e.i(982787),uT=e.i(122551),uL=e.i(955189),uj=e.i(548079),uP=e.i(802793);function uD(e,t){var i;let n;return(0,uP.isEasingArray)(e)?e[i=e.length,((t-0)%(n=i-0)+n)%n+0]:e}var uN=e.i(768821);function uR(e){return"object"==typeof e&&!Array.isArray(e)}function uO(e,t,i,n){return null==e?[]:"string"==typeof e&&uR(t)?(0,uN.resolveElements)(e,i,n):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(e=>null!=e):[e]}function uB(e,t,i,n){return"number"==typeof t?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):"<"===t?i:t.startsWith("<")?Math.max(0,i+parseFloat(t.slice(1))):n.get(t)??e}var uz=e.i(714517);function uF(e,t){return e.at!==t.at?e.at-t.at:null===e.value?1:null===t.value?-1:0}function uH(e,t){return t.has(e)||t.set(e,{}),t.get(e)}function uW(e,t){return t[e]||(t[e]=[]),t[e]}let uU=e=>"number"==typeof e,uV=e=>e.every(uU);var uG=e.i(907771),u$=e.i(999971),uZ=e.i(635419),uK=e.i(837577),uq=e.i(47422),uY=e.i(308392),uX=e.i(176537),uQ=e.i(380789),uJ=e.i(752611);class u0 extends uJ.VisualElement{constructor(){super(...arguments),this.type="object"}readValueFromInstance(e,t){if(t in e){let i=e[t];if("string"==typeof i||"number"==typeof i)return i}}getBaseTargetFromProps(){}removeValueFromRenderState(e,t){delete t.output[e]}measureInstanceViewportBox(){return(0,uQ.createBox)()}build(e,t){Object.assign(e.output,t)}renderInstance(e,{output:t}){Object.assign(e,t)}sortInstanceNodePosition(){return 0}}function u1(e){let t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},i=(0,uK.isSVGElement)(e)&&!(0,uq.isSVGSVGElement)(e)?new uY.SVGVisualElement(t):new uX.HTMLVisualElement(t);i.mount(e),u$.visualElementStore.set(e,i)}function u2(e){let t=new u0({presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}});t.mount(e),u$.visualElementStore.set(e,t)}function u3(e,t,i,n){let a=[];if((0,uA.isMotionValue)(e)||"number"==typeof e||"string"==typeof e&&!uR(t))a.push((0,uG.animateSingleValue)(e,uR(t)&&t.default||t,i&&i.default||i));else{if(null==e)return a;let r=uO(e,t,n),o=r.length;(0,uj.invariant)(!!o,"No valid elements provided.","no-valid-elements");for(let e=0;e{var l;let d=Array.isArray(l=e)?l:[l],{delay:c=0,times:h=(0,uE.defaultOffset)(d),type:m=t.type||"keyframes",repeat:g,repeatType:f,repeatDelay:b=0,...y}=i,{ease:v=t.ease||"easeOut",duration:C}=i,w="function"==typeof c?c(o,s):c,S=d.length,k=(0,u_.isGenerator)(m)?m:a?.[m||"keyframes"];if(S<=2&&k){let e=100;2===S&&uV(d)&&(e=Math.abs(d[1]-d[0]));let i={...t,...y};void 0!==C&&(i.duration=(0,uL.secondsToMilliseconds)(C));let n=(0,uI.createGeneratorEasing)(i,e,k);v=n.ease,C=n.duration}C??(C=r);let A=u+w;1===h.length&&0===h[0]&&(h[1]=1);let E=h.length-d.length;if(E>0&&(0,uM.fillOffset)(h,E),1===d.length&&d.unshift(null),g){(0,uj.invariant)(g<20,"Repeat count too high, must be less than 20","repeat-count-high"),C*=g+1;let e=[...d],t=[...h],i=[...v=Array.isArray(v)?[...v]:[v]];for(let n=0;na&&i.at{for(let a in e){let r=e[a];r.sort(uF);let s=[],l=[],d=[];for(let e=0;e{if(Array.isArray(e)&&"function"==typeof e[0]){let t=e[0],i=(0,uS.motionValue)(0);return(i.on("change",t),1===e.length)?[i,[0,1]]:2===e.length?[i,[0,1],e[1]]:[i,e[1],e[2]]}return e}),r,t,{spring:uk.spring}).forEach(({keyframes:e,transition:t},i)=>{a.push(...u3(i,e,t))}),s=a}else{let{onComplete:r,...l}=a||{};"function"==typeof r&&(o=r),s=u3(e,n,void 0!==i?{reduceMotion:i,...l}:l,t)}let l=new uC(s);return o&&l.finished.then(o),t&&(t.animations.push(l),l.finished.then(()=>{(0,uw.removeItem)(t.animations,l)})),l}}();function u4(e){for(let t of e.columns)if(!t.isEmpty(e)&&"data"===t.type)return t;return null}function u6(e){for(let t of e.columns)if(!t.isEmpty(e)&&"label"===t.type)return t;return null}var u9=tI,u8=e.i(854624),u7=e.i(765695),pe=e.i(476116),pt="__react_svg_text_measurement_id";let pi=(0,pe.default)(function(e,t){try{var i=document.getElementById(pt);if(!i){var n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.position="absolute",n.style.top="-100%",n.style.left="-100%",(i=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("id",pt),n.appendChild(i),document.body.appendChild(n)}return Object.assign(i.style,t),i.textContent=e,i.getComputedTextLength()}catch(e){return null}},function(e,t){return e+"_"+JSON.stringify(t)});var pn=["verticalAnchor","scaleToFit","angle","width","lineHeight","capHeight","children","style"];function pa(e){return"number"==typeof e}function pr(e){return"number"==typeof e&&Number.isFinite(e)||"string"==typeof e}var po=["dx","dy","textAnchor","innerRef","innerTextRef","verticalAnchor","angle","lineHeight","scaleToFit","capHeight","width"];function ps(){return(ps=Object.assign.bind()).apply(this,arguments)}var pl={overflow:"visible"};function pd(e){var t,i,n,a,r,o,s,l,d,c,u,p,h,m,g,f,b,x,y,v,C,w,S,k,A=e.dx,E=e.dy,_=e.textAnchor,I=e.innerRef,M=e.innerTextRef,T=(e.verticalAnchor,e.angle,e.lineHeight),L=void 0===T?"1em":T,P=(e.scaleToFit,e.capHeight,e.width,function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,po)),D=P.x,N=void 0===D?0:D,R=P.fontSize,O=(i=void 0===(t=e.verticalAnchor)?"end":t,a=void 0!==(n=e.scaleToFit)&&n,r=e.angle,o=e.width,l=void 0===(s=e.lineHeight)?"1em":s,c=void 0===(d=e.capHeight)?"0.71em":d,u=e.children,p=e.style,g=void 0===(m=(h=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,pn)).x)?0:m,b=void 0===(f=h.y)?0:f,x=!pr(g)||!pr(b),v=(y=(0,j.useMemo)(function(){return{wordsWithWidth:(null==u?[]:u.toString().split(/(?:(?!\u00A0+)\s+)/)).map(function(e){return{word:e,wordWidth:pi(e,p)||0}}),spaceWidth:pi(" ",p)||0}},[u,p])).wordsWithWidth,C=y.spaceWidth,w=(0,j.useMemo)(function(){return x?[]:o||a?v.reduce(function(e,t){var i=t.word,n=t.wordWidth,r=e[e.length-1];return r&&(null==o||a||(r.width||0)+n+C0){var t=w[0].width||1,i="shrink-only"===a?Math.min(o/t,1):o/t,n=g-i*g,s=b-i*b;e.push("matrix("+i+", 0, 0, "+i+", "+n+", "+s+")")}return r&&e.push("rotate("+r+", "+g+", "+b+")"),e.length>0?e.join(" "):""},[x,g,b,o,a,w,r]),{wordsByLines:w,startDy:S,transform:k}),B=O.wordsByLines,z=O.startDy,F=O.transform;return j.default.createElement("svg",{ref:I,x:void 0===A?0:A,y:void 0===E?0:E,fontSize:R,style:pl},B.length>0?j.default.createElement("text",ps({ref:M,transform:F},P,{textAnchor:void 0===_?"start":_}),B.map(function(e,t){return j.default.createElement("tspan",{key:t,x:N,dy:0===t?z:L},e.words.join(" "))})):null)}let pc=({direction:e="vertical",definition:t,textValue:i,x:n,y:a,width:r,height:o,bounds:s,offset:l={x:0,y:0},onPositionChange:d,invertColorOfInsideText:c})=>{let u=(()=>{if(!t)return!1;let d=t.getDimensions(i),c=d.width+l.x,u=d.height+l.y;return"vertical"===e?t.inside?(t.rotate?c:u)+t.margin=s.width})(),p=(0,j.useMemo)(()=>({x:"vertical"===e?n+r/2+l.x:n+r+(t.margin+l.x)*(u?-1:1),y:"vertical"===e?a+(l.y+t.margin)*(u?1:-1):a+o/2+l.y}),[n,r,l.x,a,o,l.y,u,e,t.margin]);return((0,j.useEffect)(()=>{d?.(p)},[p]),t.hide)?null:(0,_.jsx)(pd,{pointerEvents:"none",...p,textAnchor:t.rotate?u?"end":"start":"vertical"===e?"middle":u?"end":"start",verticalAnchor:"vertical"===e?t.rotate?"middle":u?"start":"end":"middle",style:{...t.textStyles,userSelect:"none",filter:u&&c?"invert(1)":void 0},angle:270*!!t.rotate,children:i})};var d_=d_,pu=["from","to","fill","className","innerRef"];function pp(){return(pp=Object.assign.bind()).apply(this,arguments)}function ph(e){var t=e.from,i=void 0===t?{x:0,y:0}:t,n=e.to,a=void 0===n?{x:1,y:1}:n,r=e.fill,o=e.className,s=e.innerRef,l=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,pu),d=i.x===a.x||i.y===a.y;return j.default.createElement("line",pp({ref:s,className:(0,up.default)("visx-line",o),x1:i.x,y1:i.y,x2:a.x,y2:a.y,fill:void 0===r?"transparent":r,shapeRendering:d?"crispEdges":"auto"},l))}let pm="left",pg="bottom";var d_=d_;function pf(){return(pf=Object.assign.bind()).apply(this,arguments)}function pb(){return(pb=Object.assign.bind()).apply(this,arguments)}var px={textAnchor:"middle",fontFamily:"Arial",fontSize:10,fill:"#222"};function py(e){return null==e?void 0:e.toString()}var pv=function(){function e(e){var t=e.x,i=e.y;this.x=0,this.y=0,this.x=void 0===t?0:t,this.y=void 0===i?0:i}var t=e.prototype;return t.value=function(){return{x:this.x,y:this.y}},t.toArray=function(){return[this.x,this.y]},e}();function pC(e,t){var i=e.x,n=e.y;return new pv(t?{x:i,y:n}:{x:n,y:i})}function pw(){return(pw=Object.assign.bind()).apply(this,arguments)}var pS=["children","axisClassName","hideAxisLine","hideTicks","hideZero","innerRef","left","numTicks","orientation","rangePadding","scale","tickFormat","tickLength","tickValues","top"];function pk(){return(pk=Object.assign.bind()).apply(this,arguments)}function pA(e){var t,i=e.children,n=e.axisClassName,a=e.hideAxisLine,r=e.hideTicks,o=e.hideZero,s=void 0!==o&&o,l=e.innerRef,d=e.left,c=e.numTicks,u=void 0===c?10:c,p=e.orientation,h=void 0===p?pg:p,m=e.rangePadding,g=void 0===m?0:m,f=e.scale,b=e.tickFormat,x=e.tickLength,y=void 0===x?8:x,v=e.tickValues,C=e.top,w=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,pS),S=null!=b?b:"tickFormat"in f?f.tickFormat():py,k="top"===h,A=k||h===pg,E=function(e,t){if(void 0===t&&(t="center"),"start"!==t&&"bandwidth"in e){var i=e.bandwidth();return"center"===t&&(i/=2),e.round()&&(i=Math.round(i)),function(t){var n=e(t);return"number"==typeof n?n+i:n}}return e}(f),_=h===pm||k?-1:1,I=f.range(),M=(void 0===(t=g)&&(t=0),"number"==typeof t?{start:t,end:t}:pw({start:0,end:0},t)),T=pC({x:Number(I[0])+.5-M.start,y:0},A),L=pC({x:Number(I[I.length-1])+.5+M.end,y:0},A),P=(null!=v?v:"ticks"in f?f.ticks(u):f.domain().filter(function(e,t,i){return null==u||i.length<=u||t%Math.round((i.length-1)/u)==0})).filter(function(e){return!s||0!==e&&"0"!==e}).map(function(e,t){return{value:e,index:t}}),D=P.map(function(e){var t=e.value,i=e.index,n=function(e){if(("function"==typeof e||"object"==typeof e&&e)&&"valueOf"in e){var t=e.valueOf();if("number"==typeof t)return t}return e}(E(t));return{value:t,index:i,from:pC({x:n,y:0},A),to:pC({x:n,y:y*_},A),formattedValue:S(t,i,P)}});return j.default.createElement(d_.default,{className:(0,up.default)("visx-axis",n),innerRef:l,top:void 0===C?0:C,left:void 0===d?0:d},(void 0===i?function(e){var t=e.axisFromPoint,i=e.axisLineClassName,n=e.axisToPoint,a=e.hideAxisLine,r=e.hideTicks,o=e.horizontal,s=e.label,l=void 0===s?"":s,d=e.labelClassName,c=e.labelOffset,u=e.labelProps,p=e.orientation,h=void 0===p?pg:p,m=e.scale,g=e.stroke,f=e.strokeDasharray,b=e.strokeWidth,x=void 0===b?1:b,y=e.tickClassName,v=e.tickComponent,C=e.tickLineProps,w=e.tickLabelProps,S=e.tickLength,k=e.tickStroke,A=e.tickTransform,E=e.ticks,_=e.ticksComponent,I=pb({},px,u),M=pb({},px,"object"==typeof w?w:null),T=E.map(function(e){var t=e.value,i=e.index;return"function"==typeof w?w(t,i,E):M}),L=Math.max.apply(Math,[10].concat(T.map(function(e){return"number"==typeof e.fontSize?e.fontSize:0})));return j.default.createElement(j.default.Fragment,null,(void 0===_?function(e){var t=e.hideTicks,i=e.horizontal,n=e.orientation,a=e.tickClassName,r=e.tickComponent,o=e.tickLabelProps,s=e.tickStroke,l=void 0===s?"#222":s,d=e.tickTransform,c=e.ticks,u=e.strokeWidth,p=e.tickLineProps;return c.map(function(e){var s,c=e.value,h=e.index,m=e.from,g=e.to,f=e.formattedValue,b=null!=(s=o[h])?s:{},x=Math.max(10,"number"==typeof b.fontSize&&b.fontSize||0),y=g.y+(i&&"top"!==n?x:0);return j.default.createElement(d_.default,{key:"visx-tick-"+c+"-"+h,className:(0,up.default)("visx-axis-tick",a),transform:d},!t&&j.default.createElement(ph,pf({from:m,to:g,stroke:l,strokeWidth:u,strokeLinecap:"square"},p)),r?r(pf({},b,{x:g.x,y:y,formattedValue:f})):j.default.createElement(pd,pf({x:g.x,y:y},b),f))})}:_)({hideTicks:r,horizontal:o,orientation:h,scale:m,tickClassName:y,tickComponent:v,tickLabelProps:T,tickStroke:void 0===k?"#222":k,tickTransform:A,ticks:E,strokeWidth:x,tickLineProps:C}),!a&&j.default.createElement(ph,{className:(0,up.default)("visx-axis-line",i),from:t,to:n,stroke:void 0===g?"#222":g,strokeWidth:x,strokeDasharray:f}),l&&j.default.createElement(pd,pb({className:(0,up.default)("visx-axis-label",d)},function(e){var t,i,n,a=e.labelOffset,r=e.labelProps,o=e.orientation,s=e.range,l=e.tickLabelFontSize,d=e.tickLength,c=o===pm||"top"===o?-1:1;if("top"===o||o===pg){var u=o===pg&&"number"==typeof r.fontSize?r.fontSize:0;t=(Number(s[0])+Number(s[s.length-1]))/2,i=c*(d+a+l+u)}else t=c*((Number(s[0])+Number(s[s.length-1]))/2),i=-(d+a),n="rotate("+90*c+")";return{x:t,y:i,transform:n}}({labelOffset:void 0===c?14:c,labelProps:I,orientation:h,range:m.range(),tickLabelFontSize:L,tickLength:void 0===S?8:S}),I),l))}:i)(pk({},w,{axisFromPoint:T,axisToPoint:L,hideAxisLine:void 0!==a&&a,hideTicks:void 0!==r&&r,hideZero:s,horizontal:A,numTicks:u,orientation:h,rangePadding:g,scale:f,tickFormat:S,tickLength:y,tickPosition:E,tickSign:_,ticks:D})))}var pE=["axisClassName","labelOffset","tickLength","tickLabelProps"];function p_(){return(p_=Object.assign.bind()).apply(this,arguments)}var pI={dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"middle"};function pM(e){var t=e.axisClassName,i=e.labelOffset,n=e.tickLength,a=e.tickLabelProps,r=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,pE),o="function"==typeof a?a:p_({},pI,a);return j.default.createElement(pA,p_({axisClassName:(0,up.default)("visx-axis-bottom",t),labelOffset:void 0===i?8:i,orientation:pg,tickLabelProps:o,tickLength:void 0===n?8:n},r))}var pT=["axisClassName","labelOffset","tickLength","tickLabelProps"];function pL(){return(pL=Object.assign.bind()).apply(this,arguments)}var pj={dx:"-0.25em",dy:"0.25em",fill:"#222",fontFamily:"Arial",fontSize:10,textAnchor:"end"};function pP(e){var t=e.axisClassName,i=e.labelOffset,n=e.tickLength,a=e.tickLabelProps,r=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,pT),o="function"==typeof a?a:pL({},pj,a);return j.default.createElement(pA,pL({axisClassName:(0,up.default)("visx-axis-left",t),labelOffset:void 0===i?36:i,orientation:pm,tickLabelProps:o,tickLength:void 0===n?8:n},r))}function pD(){return(pD=Object.assign.bind()).apply(this,arguments)}var pN={x:0,y:0},d_=d_;let pR=Math.sqrt(50),pO=Math.sqrt(10),pB=Math.sqrt(2);function pz(e,t,i){let n,a,r,o=(t-e)/Math.max(0,i),s=Math.floor(Math.log10(o)),l=o/Math.pow(10,s),d=l>=pR?10:l>=pO?5:l>=pB?2:1;return(s<0?(n=Math.round(e*(r=Math.pow(10,-s)/d)),a=Math.round(t*r),n/rt&&--a,r=-r):(n=Math.round(e/(r=Math.pow(10,s)*d)),a=Math.round(t/r),n*rt&&--a),at?1:e>=t?0:NaN}function pW(e,t){return null==e||null==t?NaN:te?1:t>=e?0:NaN}function pU(e){let t,i,n;function a(e,n,r=0,o=e.length){if(r>>1;0>i(e[t],n)?r=t+1:o=t}while(rpH(e(t),i),n=(t,i)=>e(t)-i):(t=e===pH||e===pW?e:pV,i=e,n=e),{left:a,center:function(e,t,i=0,r=e.length){let o=a(e,t,i,r-1);return o>i&&n(e[o-1],t)>-n(e[o],t)?o-1:o},right:function(e,n,a=0,r=e.length){if(a>>1;0>=i(e[t],n)?a=t+1:r=t}while(a1?n[0]+n.slice(2):n,+e.slice(i+1)]}function p3(e){return(e=p2(Math.abs(e)))?e[1]:NaN}var p5=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function p4(e){var t;if(!(t=p5.exec(e)))throw Error("invalid format: "+e);return new p6({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function p6(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function p9(e,t){var i=p2(e,t);if(!i)return e+"";var n=i[0],a=i[1];return a<0?"0."+Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+Array(a-n.length+2).join("0")}p4.prototype=p6.prototype,p6.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};let p8={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>p9(100*e,t),r:p9,s:function(e,t){var n=p2(e,t);if(!n)return e+"";var a=n[0],r=n[1],o=r-(i=3*Math.max(-8,Math.min(8,Math.floor(r/3))))+1,s=a.length;return o===s?a:o>s?a+Array(o-s+1).join("0"):o>0?a.slice(0,o)+"."+a.slice(o):"0."+Array(1-o).join("0")+p2(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function p7(e){return e}var he=Array.prototype.map,ht=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];a=(n=function(e){var t,n,a,r=void 0===e.grouping||void 0===e.thousands?p7:(t=he.call(e.grouping,Number),n=e.thousands+"",function(e,i){for(var a=e.length,r=[],o=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>i&&(s=Math.max(1,i-l)),r.push(e.substring(a-=s,a+s)),!((l+=s+1)>i));)s=t[o=(o+1)%t.length];return r.reverse().join(n)}),o=void 0===e.currency?"":e.currency[0]+"",s=void 0===e.currency?"":e.currency[1]+"",l=void 0===e.decimal?".":e.decimal+"",d=void 0===e.numerals?p7:(a=he.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return a[+e]})}),c=void 0===e.percent?"%":e.percent+"",u=void 0===e.minus?"−":e.minus+"",p=void 0===e.nan?"NaN":e.nan+"";function h(e){var t=(e=p4(e)).fill,n=e.align,a=e.sign,h=e.symbol,m=e.zero,g=e.width,f=e.comma,b=e.precision,x=e.trim,y=e.type;"n"===y?(f=!0,y="g"):p8[y]||(void 0===b&&(b=12),x=!0,y="g"),(m||"0"===t&&"="===n)&&(m=!0,t="0",n="=");var v="$"===h?o:"#"===h&&/[boxX]/.test(y)?"0"+y.toLowerCase():"",C="$"===h?s:/[%p]/.test(y)?c:"",w=p8[y],S=/[defgprs%]/.test(y);function k(e){var o,s,c,h=v,k=C;if("c"===y)k=w(e)+k,e="";else{var A=(e*=1)<0||1/e<0;if(e=isNaN(e)?p:w(Math.abs(e),b),x&&(e=function(e){i:for(var t,i=e.length,n=1,a=-1;n0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),A&&0==+e&&"+"!==a&&(A=!1),h=(A?"("===a?a:u:"-"===a||"("===a?"":a)+h,k=("s"===y?ht[8+i/3]:"")+k+(A&&"("===a?")":""),S){for(o=-1,s=e.length;++o(c=e.charCodeAt(o))||c>57){k=(46===c?l+e.slice(o+1):e.slice(o))+k,e=e.slice(0,o);break}}}f&&!m&&(e=r(e,1/0));var E=h.length+e.length+k.length,_=E>1)+h+e+k+_.slice(E);break;default:e=_+h+e+k}return d(e)}return b=void 0===b?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b)),k.toString=function(){return e+""},k}return{format:h,formatPrefix:function(e,t){var i=h(((e=p4(e)).type="f",e)),n=3*Math.max(-8,Math.min(8,Math.floor(p3(t)/3))),a=Math.pow(10,-n),r=ht[8+n/3];return function(e){return i(a*e)+r}}}}({thousands:",",grouping:[3],currency:["$",""]})).format,r=n.formatPrefix;var hi=ud("domain","range","reverse","clamp","interpolate","nice","round","zero");function hn(e){return hi(function e(){var t,i=(function(){var e,t,i,n,a,r,o=pX,s=pX,l=function e(t,i){var n,a,r=typeof i;return null==i||"boolean"===r?ca(i):("number"===r?pZ:"string"===r?(a=dq(i))?(i=a,cl):function(e,t){var i,n,a,r,o,s=pK.lastIndex=pq.lastIndex=0,l=-1,d=[],c=[];for(e+="",t+="";(a=pK.exec(e))&&(r=pq.exec(t));)(o=r.index)>s&&(o=t.slice(s,o),d[l]?d[l]+=o:d[++l]=o),(a=a[0])===(r=r[0])?d[l]?d[l]+=r:d[++l]=r:(d[++l]=null,c.push({i:l,x:pZ(a,r)})),s=pq.lastIndex;return st&&(i=e,e=t,t=i),d=function(i){return Math.max(e,Math.min(t,i))}),n=l>2?p1:p0,a=r=null,u}function u(t){return null==t||isNaN(t*=1)?i:(a||(a=n(o.map(e),s,l)))(e(d(t)))}return u.invert=function(i){return d(t((r||(r=n(s,o.map(e),pZ)))(i)))},u.domain=function(e){return arguments.length?(o=Array.from(e,pY),c()):o.slice()},u.range=function(e){return arguments.length?(s=Array.from(e),c()):s.slice()},u.rangeRound=function(e){return s=Array.from(e),l=uo,c()},u.clamp=function(e){return arguments.length?(d=!!e||pQ,c()):d!==pQ},u.interpolate=function(e){return arguments.length?(l=e,c()):l},u.unknown=function(e){return arguments.length?(i=e,u):i},function(i,n){return e=i,t=n,c()}})()(pQ,pQ);return i.copy=function(){return e().domain(i.domain()).range(i.range()).interpolate(i.interpolate()).clamp(i.clamp()).unknown(i.unknown())},dI.apply(i,arguments),t=i.domain,i.ticks=function(e){var i=t();return function(e,t,i){if(t*=1,e*=1,!((i*=1)>0))return[];if(e===t)return[e];let n=t=a))return[];let s=r-a+1,l=Array(s);if(n)if(o<0)for(let e=0;e0;){if((a=pF(l,d,e))===n)return r[o]=l,r[s]=d,t(r);if(a>0)l=Math.floor(l/a)*a,d=Math.ceil(d/a)*a;else if(a<0)l=Math.ceil(l*a)/a,d=Math.floor(d*a)/a;else break;n=a}return i},i}(),e)}var ha=e.i(541307),hr=tI,ho=e.i(560834);let hs={top:8,bottom:2,right:1,left:4},hl=({color:e,labelCells:t,dataCells:i,height:n,children:a,textColor:r,tickColor:o,tiny:s=!1,width:l,fontFamily:d="var(--body-font)",fontSize:c="var(--chakra-fontSizes-sm)",fontWeight:u="var(--body-font-weight)",margin:p=hr.DEFAULT_MARGIN,direction:h="vertical",hideLabels:m=!1,padding:g=0,labelPadding:f=.3,pullToZero:b=!0,onMouseMove:x,onMouseLeave:y,onMouseMoveInside:v,onMouseLeaveInside:C})=>{let w=s?2:14,S=s?{top:1,right:0,bottom:2,left:0}:hs,k=s?{top:0,right:0,bottom:0,left:0}:p,A=!!s||m;s&&(c="2px",g=0);let E=s?.5:2,I=s?1:6,M=i.map(e=>e.data),T=i.reduce((e,t)=>{if("mixed"===e)return e;let i=t.getFormatter().type;return""===e||e===i?i:"mixed"},""),L=Math.max(...M),P=Math.min(...M),D=t.length?t:i.map(e=>({position:{row:e.position.row},textValue:""})),N=(0,j.useMemo)(()=>{let e="percentage"===T&&L<=100?100:null;return function(e,t,i,n=null){if(null!==n&&t>n&&(console.error("`capAt` MUST be larger than `max`",{capAt:n,max:t}),n=null),!i){let n=hn({range:[0,1],domain:[e,Math.max(t,0)]}).ticks();i=n.length<2?1:Math.abs(n[1]-n[0])}let a=(0,ho.roundToStep)(Math.max(t,0),i,1),r=(0,ho.roundToStep)(e,i,-1),o=(0,ho.roundToStep)((a-r)/3,i,1);o&&o!==i&&(r=(0,ho.roundToStep)(r,o,-1));let s=[r];for(;s[s.length-1]8)););return null!==n&&s[s.length-1]>=n?Array.from({length:5}).map((e,t)=>(r+(a-r)/4)*t):s}(b?Math.min(P,0):P,L,void 0,e)},[P,L,b,T]),R=i[0].format.bind(i[0]),O="vertical"===h?N.map(e=>i[0].format(e)):D.map(e=>(0,ha.default)(e.textValue,{length:25,separator:" "})),B=(0,ho.indexStringDimensions)(O,{fontFamily:d,fontSize:c,fontWeight:u}),z=A?0:B.maxWidth,F={top:k.top+S.top,right:k.right+S.right,bottom:k.bottom+E+(A?0:I+S.bottom),left:k.left+z+E+(A?0:I+S.left)},H=("vertical"===h?D:i).map(({textValue:e})=>(0,ha.default)(e,{length:25,separator:" "})),{bottomTickValues:W,bottomLabels:U,rotateLabels:V,labelsHeight:G,splitIx:$}=hd({em:w,textStyles:{fontFamily:d,fontSize:c,fontWeight:u},hideLabels:A,padding:g,height:n,width:l,margin:F,labelCells:D,labelStrings:H}),Z=n-F.top-F.bottom-G,K="horizontal"===h&&Z/O.lengthe),q=l-F.left-F.right,Y=D.map(e=>`${e.position.row}:${e.textValue}`).join(","),{labelScale:X,labelIndex:Q}=(0,j.useMemo)(()=>({labelScale:uu({range:"vertical"===h?[0,q]:[0,Z],domain:D.map(e=>e.position.row),paddingInner:f,paddingOuter:.3}),labelIndex:Object.fromEntries(D.map(e=>[e.position.row,e]))}),[q,h,Z,Y,f]),J=(0,j.useMemo)(()=>{let e=N[0],t=N[N.length-1];return hn({range:"horizontal"===h?[P<0?g:0,q]:[Z-(P<0?g:0),E+g],round:!0,domain:[e,t]})},[N,Z,P,q,h,g,E]),ee=(()=>{if(!v&&!C)return null;let e=e=>t=>{var i,n;let a;e(t,(i=t,n=F,{svgCoords:a=function(e){if(e&&Element,e&&(e instanceof Event||"nativeEvent"in e&&e.nativeEvent instanceof Event)){var t=e.target;if(t)return function(e,t){if(!e||!t)return null;var i=function(e){if(!e)return pD({},pN);if(e&&"changedTouches"in e)return e.changedTouches.length>0?{x:e.changedTouches[0].clientX,y:e.changedTouches[0].clientY}:pD({},pN);if(e&&"clientX"in e)return{x:e.clientX,y:e.clientY};var t=null==e?void 0:e.target,i=t&&"getBoundingClientRect"in t?t.getBoundingClientRect():null;return i?{x:i.x+i.width/2,y:i.y+i.height/2}:pD({},pN)}(t),n=e&&(e instanceof SVGElement||"ownerSVGElement"in e)?e.ownerSVGElement:e,a=n&&"getScreenCTM"in n?n.getScreenCTM():null;if(n&&"createSVGPoint"in n&&a){var r=n.createSVGPoint();return r.x=i.x,r.y=i.y,new pv({x:(r=r.matrixTransform(a.inverse())).x,y:r.y})}var o=e.getBoundingClientRect();return new pv({x:i.x-o.left-e.clientLeft,y:i.y-o.top-e.clientTop})}(t,e)}return null}(i)??{x:i.clientX,y:i.clientY},axisCoords:{x:a.x-n.left,y:a.y-n.top}}))};return{move:v&&e(v),leave:C&&e(C)}})();return(0,_.jsxs)("svg",{width:"100%",viewBox:`0 0 ${l} ${n}`,height:"100%",preserveAspectRatio:"none",overflow:"visible",onMouseMove:x,onMouseLeave:y,children:[N.map((t,i)=>"vertical"===h?(0,_.jsx)(ph,{from:{x:F.left,y:J(t)+F.top},to:{x:l,y:J(t)+F.top},stroke:e,opacity:0===t?.5:.2},i):(0,_.jsx)(ph,{from:{x:F.left+J(t),y:F.top},to:{x:F.left+J(t),y:Z},stroke:e,opacity:0===t?.5:.2},i)),ee&&(0,_.jsx)(ug,{fill:"transparent",opacity:.2,x:F.left,y:F.top,height:Z,width:q,onMouseMove:ee.move,onMouseLeave:ee.leave}),a({labelScale:X,dataScale:J,yMax:Z,xMax:q,margin:{...F}}),(0,_.jsx)(d_.default,{children:"vertical"===h?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(pP,{top:F.top,left:F.left,scale:J,stroke:e,rangePadding:P<0?-1*g:0,strokeWidth:E,tickValues:A?[]:N,tickFormat:R,tickLength:I,tickStroke:o||e,tickLabelProps:()=>({fill:r||e,textAnchor:"end",fontFamily:d,fontSize:c,fontWeight:u,dy:"0.33em",dx:s?0:-4,userSelect:"none"})}),(0,_.jsx)(pM,{top:Z+F.top,left:F.left,scale:X,stroke:e,tickValues:W,tickFormat:(e,t)=>U[t],tickStroke:o||e,tickLabelProps:(t,i)=>({fill:r||e,fontFamily:d,fontSize:c,fontWeight:u,userSelect:"none",dy:4*!s,i}),strokeWidth:E,tickLength:I,tickComponent:({x:e,y:t,i,dy:n,formattedValue:a,...r})=>(0,_.jsx)("g",{alignmentBaseline:"middle",...r,children:V||!$[i]?(0,_.jsx)("text",{x:e,y:t,dy:n,transform:V?`rotate(-45, ${e}, 0)`:"",textAnchor:V?"end":"middle",children:a}):(a||"").split(" ").map((a,r)=>(0,_.jsx)("text",{x:e,y:t+w*r,dy:n,textAnchor:"middle",children:a},`${i}:${r}`))})})]}):(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(pP,{top:F.top,left:F.left,scale:X,stroke:e,strokeWidth:E,tickLength:I,tickValues:A?[]:K,tickFormat:e=>(0,ha.default)(Q[e].textValue,{length:25,separator:" "}),tickStroke:o||e,tickLabelProps:()=>({fill:r||e,textAnchor:"end",fontFamily:d,fontSize:c,fontWeight:u,dy:"0.33em",dx:s?0:-4,userSelect:"none"})}),(0,_.jsx)(pM,{top:Z+F.top,left:F.left,scale:J,stroke:e,rangePadding:P<0?g:0,tickValues:A?[]:N,tickFormat:R,tickLength:I,tickStroke:o||e,tickLabelProps:(t,i)=>({fill:r||e,textAnchor:0===i?"end":"middle",fontFamily:d,fontSize:c,fontWeight:u,userSelect:"none",dy:4*!s}),strokeWidth:E})]})})]})},hd=({em:e,textStyles:t,hideLabels:i,padding:n,height:a,width:r,margin:o,labelStrings:s,labelCells:l})=>{let d=s.join(","),c=(r-o.left-o.right)/s.length,{fontFamily:u,fontSize:p,fontWeight:h}=t;return(0,j.useMemo)(()=>{let r=[...s],d={bottomTickValues:[],rotateLabels:!1,labelsHeight:0,splitIx:[],sliceWidth:c,bottomLabels:[]};if(i||c<=e+3)return d;let{widths:u,maxWidth:p}=(0,ho.indexStringDimensions)(s,t),h=!1,m=e,g=l.map(({position:{row:e}})=>e),f=s.map((i,a)=>{if(h||u[a]c-n)return h=!0,!0;let s=r.length*e;return s>m&&(m=s),!0});if(!h)return{bottomTickValues:g,rotateLabels:h,labelsHeight:m,splitIx:f,sliceWidth:c,bottomLabels:r};let b=t=>Math.cos(Math.PI/4)*t-(e+7);m=Math.sin(Math.PI/4)*p;let x=b(p);if(x>.3*a)return d;let y=e=>o.left+c*e+c/2;for(let e=0;ex)break;if(b(u[e])>i){let n=(0,ho.truncateToFit)(s[e],e=>{let n=pi(e,t);if(null===n)return -1;let a=b(n);return ai?-1:0});if(!n)return console.log("could not truncate"),d;r[e]=n}}return{bottomTickValues:g,bottomLabels:r,rotateLabels:h,labelsHeight:m,splitIx:f,sliceWidth:c}},[e,a,d,u,p,h,i,n,c])},hc=({data:e,render:t,getColor:i,getOpacity:n,onMouseOver:a,onMouseLeave:r,onClick:o,onDoubleClick:s,textColor:l,position:d="bottom",width:c})=>{let u=(0,j.useRef)(null),[p,h]=(0,j.useState)(0),[m,g]=(0,j.useState)(!1),f=["top","bottom"].includes(d),b=e.some(e=>t(e).length>20),x=(0,O.useShouldRenderMobileVersion)(),y=b&&f&&x,v=f?{width:"100%",display:"grid",gridTemplateColumns:y?"1fr":`repeat(auto-fit, minmax(${p}em, 1fr))`,justifyItems:m||y?"flex-start":"center",alignSelf:"stretch","& > div:first-child":{justifySelf:m||y?void 0:"flex-end"},"& > div:last-child":{justifySelf:m||y?void 0:"flex-start"}}:{height:"100%",flexDir:"column"},C=e.map(e=>t(e)).join("|");return(0,j.useEffect)(()=>{let e=0;if(!u.current)return;let t=(0,ho.getEmSize)(u.current);for(let t of u.current.querySelectorAll(":scope > div")){t.style.width="min-content";let i=t.getClientRects()[0]?.width||0;t.style.width="",i>e&&(e=i)}h(parseFloat((e/t).toFixed(2)))},[C]),(0,j.useEffect)(()=>{g(!!u.current&&function(e){let t=e.children;if(!t.length)return!1;let i=t.item(0)?.offsetTop;for(let e of t)if(e.offsetTop!==i)return!0;return!1}(u.current))},[c,p]),(0,_.jsx)(L.Flex,{ref:u,sx:v,flexGrow:0,flexShrink:1,flexWrap:"wrap",alignContent:["left","top"].includes(d)?"flex-end":"flex-start",justifyContent:"center",gap:5,children:e.map((e,d)=>(0,_.jsxs)(eG.HStack,{flexGrow:0,flexShrink:1,opacity:n?n(e,d):1,cursor:"pointer",onMouseOver:a?.(e,d),onMouseLeave:r?.(e,d),onClick:o?.(e,d),onDoubleClick:s?.(e,d),transition:`opacity ${tI.ANIMATION_DURATION}s`,minW:"min-content",gap:2,alignItems:"flex-start",children:[(0,_.jsx)(eg.Box,{flex:"0 0 auto",as:eO.motion.div,width:"1em",height:"1em",flexShrink:0,bg:i(e,d),borderRadius:"sm",animate:{backgroundColor:i(e,d)},children:" "}),(0,_.jsx)(ej.Text,{flex:"0 1 auto",fontSize:"1em",lineHeight:"1em",color:l,textAlign:"left",children:(0,ha.default)(t(e),{length:y?60:30})})]},d))})};function hu(){let e=(0,j.useRef)(null);return(0,j.useEffect)(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{clickHandler:t=>i=>{e.current||(e.current=setTimeout(()=>{e.current=null,t(i)},200))},doubleClickHandler:t=>i=>{e.current&&(clearTimeout(e.current),e.current=null),t(i)}}}let hp=({showInlineLabels:e,dataCells:t,scale:i,textStyles:n,direction:a,labelMargin:r=5})=>{let o=t.flatMap(e=>e.map(e=>e.textValue)),s=o.join("|"),l=i.bandwidth();return(0,j.useMemo)(()=>{if(!e)return;let s=t[0].length>1?uu({range:[0,l],domain:t[0].map(e=>e.textValue),paddingInner:.2}):i,d=(0,ho.indexStringDimensions)(o,n),c="vertical"===a&&d.maxWidth+r>=s.bandwidth(),u="vertical"===a?c&&d.maxHeight+r>=s.bandwidth():d.maxHeight+r>=s.bandwidth(),p=Object.fromEntries(o.map((e,t)=>[e,t]));return{margin:r,rotate:c,hide:u,textStyles:n,getDimensions:e=>{let t=p[e];return{width:void 0===t?0:d.widths[t],height:void 0===t?0:d.heights[t]}},inside:!1}},[e,n,s,a,l,r])};var hh=e.i(358003),hm=e.i(244180),hg=e.i(691567),hf=e.i(730943);function hb(){return(hb=Object.assign.bind()).apply(this,arguments)}function hx(e,t){return(hx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}var hy={top:0,right:0,bottom:0,left:0,width:0,height:0},hv=["className","top","left","offsetLeft","offsetTop","style","children","unstyled","applyPositionStyle"];function hC(){return(hC=Object.assign.bind()).apply(this,arguments)}var hw={position:"absolute",backgroundColor:"white",color:"#666666",padding:".3rem .5rem",borderRadius:"3px",fontSize:"14px",boxShadow:"0 1px 2px rgba(33,33,33,0.2)",lineHeight:"1em",pointerEvents:"none"},hS=j.default.forwardRef(function(e,t){var i=e.className,n=e.top,a=e.left,r=e.offsetLeft,o=void 0===r?10:r,s=e.offsetTop,l=void 0===s?10:s,d=e.style,c=e.children,u=e.unstyled,p=e.applyPositionStyle,h=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,hv);return j.default.createElement("div",hC({ref:t,className:(0,up.default)("visx-tooltip",i),style:hC({top:null==n||null==l?n:n+l,left:null==a||null==o?a:a+o},void 0!==p&&p&&{position:"absolute"},!(void 0!==u&&u)&&(void 0===d?hw:d))},h),c)});hS.propTypes={children:hg.default.node,className:hg.default.string,left:hg.default.number,offsetLeft:hg.default.number,offsetTop:hg.default.number,top:hg.default.number,applyPositionStyle:hg.default.bool,unstyled:hg.default.bool},hS.displayName="Tooltip";var hk=(0,j.createContext)({isFlippedVertically:!1,isFlippedHorizontally:!1}),hA=hk.Provider;hk.Consumer;var hE=["children","getRects","left","offsetLeft","offsetTop","parentRect","rect","style","top","unstyled","nodeRef"];function h_(){return(h_=Object.assign.bind()).apply(this,arguments)}function hI(e){var t,i=e.children,n=(e.getRects,e.left),a=e.offsetLeft,r=void 0===a?10:a,o=e.offsetTop,s=void 0===o?10:o,l=e.parentRect,d=e.rect,c=e.style,u=e.top,p=e.unstyled,h=e.nodeRef,m=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,hE),g=!1,f=!1;if(d&&l){var b=void 0===n?0:n,x=void 0===u?0:u;if(l.width){var y=b+r+d.width-l.width,v=d.width-b-r;g=y>0&&y>v}else{var C=b+r+d.width-window.innerWidth,w=d.width-b-r;g=C>0&&C>w}if(l.height){var S=x+s+d.height-l.height,k=d.height-x-s;f=S>0&&S>k}else f=x+s+d.height>window.innerHeight;b=g?b-d.width-r:b+r,x=f?x-d.height-s:x+s,t="translate("+(b=Math.round(b))+"px, "+(x=Math.round(x))+"px)"}return j.default.createElement(hS,h_({ref:h,style:h_({left:0,top:0,transform:t},!(void 0!==p&&p)&&(void 0===c?hw:c))},m),j.default.createElement(hA,{value:{isFlippedVertically:!f,isFlippedHorizontally:!g}},i))}hI.propTypes={nodeRef:hg.default.oneOfType([hg.default.string,hg.default.func,hg.default.object])};let hM=((t=function(e){function t(t){var i;return(i=e.call(this,t)||this).state={rect:void 0,parentRect:void 0},i.nodeRef=j.default.createRef(),i.getRects=i.getRects.bind(function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(i)),i}t.prototype=Object.create(e.prototype),t.prototype.constructor=t,hx(t,e);var i=t.prototype;return i.componentDidMount=function(){var e,t=this;this.node=null!=(e=this.nodeRef)&&e.current?this.nodeRef.current:hf.default.findDOMNode(this),this.setState(function(){return t.getRects()})},i.getRects=function(){if(!this.node)return this.state;var e=this.node,t=e.parentNode;return{rect:e.getBoundingClientRect?e.getBoundingClientRect():hy,parentRect:null!=t&&t.getBoundingClientRect?t.getBoundingClientRect():hy}},i.render=function(){return j.default.createElement(hI,hb({nodeRef:this.nodeRef,getRects:this.getRects},this.state,this.props))},t}(j.default.PureComponent)).displayName="withBoundingRects("+(hI.displayName||"")+")",t);var hT=["tooltipOpen"];function hL(){return(hL=Object.assign.bind()).apply(this,arguments)}let hj=({TooltipInner:e})=>{var t,i,n,a,r;let{showTooltip:o,tooltipOpen:s,tooltipLeft:l,tooltipTop:d,tooltipData:c,hideTooltip:u}=(i=(t=(0,j.useState)(hL({tooltipOpen:!1},void 0)))[0],n=t[1],a=(0,j.useCallback)(function(e){return n("function"==typeof e?function(t){t.tooltipOpen;var i=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(t,hT);return hL({},e(i),{tooltipOpen:!0})}:{tooltipOpen:!0,tooltipLeft:e.tooltipLeft,tooltipTop:e.tooltipTop,tooltipData:e.tooltipData})},[n]),r=(0,j.useCallback)(function(){return n({tooltipOpen:!1,tooltipLeft:void 0,tooltipTop:void 0,tooltipData:void 0})},[n]),{tooltipOpen:i.tooltipOpen,tooltipLeft:i.tooltipLeft,tooltipTop:i.tooltipTop,tooltipData:i.tooltipData,updateTooltip:n,showTooltip:a,hideTooltip:r}),p={minW:"5rem",textAlign:"left",pointerEvents:"none",...(0,hm.useStyleConfig)("Tooltip")},h=(0,j.useRef)(void 0);return(0,j.useEffect)(()=>()=>{h.current&&clearTimeout(h.current)},[]),{mouseMoveHandler:(e,t)=>i=>{h.current&&clearTimeout(h.current);let n=t?t(e,i):(0,ho.relativizeEventCoords)(i);o({tooltipData:{...e,position:e.position},tooltipTop:n?.y,tooltipLeft:n?.x})},mouseLeaveHandler:e=>e=>{h.current=window.setTimeout(()=>{u()},300)},renderTooltip:function(){return s&&c?(0,_.jsx)(hP,{style:{},top:d,left:l,sx:{...p,top:void 0,left:void 0,userSelect:"none",pointerEvents:"none"},position:"absolute",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,_.jsx)(e,{...c})},Math.random()):null}}},hP=(0,hh.chakra)(hM,{shouldForwardProp:e=>["top","left","style","children"].includes(e)});var hD=e.i(174119),hN=e.i(334142);let hR=e=>{let{dispatch:t}=(0,j.useContext)(hD.ChartContext),i=e.filter(e=>e instanceof hN.ChartColumn).map(e=>e.id),n=i.join(",");(0,j.useEffect)(()=>(t({type:"reportActiveColumnIds",payload:i}),()=>{t({type:"reportActiveColumnIds",payload:void 0})}),[n,t])},hO=({textColor:e="var(--body-color)",fontFamily:t="var(--body-font)",fontSize:i="var(--chakra-fontSizes-sm)",fontWeight:n="var(--body-font-weight)"}={})=>(0,j.useMemo)(()=>({fontFamily:t,fontSize:i,fontWeight:n,fill:e}),[e,t,i,n]),hB=({showZero:e,data:t,dataColumns:i,animationDuration:n,barColors:a,textColor:r,direction:o,selectCell:s,tooltipEnter:l,tooltipLeave:d,dataScale:c,labelScale:u,yMax:p,xMax:h,margin:m,minValueGreaterThanZero:g,onDataClick:f,onDataDoubleClick:b,isThumbnail:x,focusedPosition:y,setFocusedPosition:v,showInlineLabels:C})=>{let w=(0,u8.indexBy)(i,"id"),S=hO({textColor:r}),k=t.rows.map(e=>e.getCells(t).filter(e=>!!w.get(e.position.column))),A=hp({dataCells:k,textStyles:S,scale:u,direction:o,showInlineLabels:C});return(0,_.jsx)(_.Fragment,{children:(0,_.jsx)(d_.default,{top:m.top,left:m.left,children:t.rows.map((t,i)=>{let r=`group-${t.id}`;return(0,_.jsx)(hF,{animationDuration:n,barColors:a,data:k[i],showZero:e,yMax:p,xMax:h,dataScale:c,inlineLabels:A,labelScale:u,selectCell:s,direction:o,globalMinValueGreaterThanZero:g,tooltipEnter:l,tooltipLeave:d,onDataClick:f,onDataDoubleClick:b,borderRadius:x?1:5,focusedPosition:y,setFocusedPosition:v},r)})})})},hz=({TooltipInner:e,showZero:t=!0,data:i,textColor:n,accentColor:a,animationDuration:r=u9.ANIMATION_DURATION,isThumbnail:o=!1,width:s,height:l,chartType:d,colorScheme:c=u9.DEFAULT_COLOR_SCHEME,hideLabels:u,showInlineLabels:p,onDataClick:h,onDataDoubleClick:m,backgroundColor:g,chartOptions:f,onContextMenu:b})=>{let x="horizontal-bar"===d?"horizontal":"vertical",{renderTooltip:y,mouseMoveHandler:v,mouseLeaveHandler:C}=hj({TooltipInner:e}),[w,S]=(0,j.useState)(null),k=u6(i),A=k?.getCells(i)||[],E=i.columns.filter(({type:e})=>"data"===e),I=E.map(e=>e.getCells(i)).flat(),M=E.length>1&&!u,T=Math.min(...I.map(e=>e.data).filter(e=>e>0)),L=(0,R.useAppSelector)(B.selectTheme),D=(0,P.useFeatureFlag)("useNewChartingColorSet"),N=E.map(({id:e})=>e),O=N.length>1?N:[...new Set(I.map(e=>e.position.row))],z=(0,t_.resolveAccentColorForScheme)(a,c,L,D),F=(0,t_.makeColorScale)(z,O,c,{contrastColor:g,theme:L}),H=(0,ho.guessEmValue)(o),W=f["vertical"===x?"bar":"horizontal-bar"]??{};return hR([k,...E]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(eg.Box,{"data-test":"bar-chart-container",height:M?"calc(100% - 3em)":"100%",cursor:"default",userSelect:"none",contentEditable:!1,onContextMenu:b,children:[(0,_.jsx)(hl,{width:s,height:M?l-3*H:l,labelCells:A,dataCells:I,color:n,textColor:n,tiny:o,direction:x,hideLabels:u,pullToZero:W.axisPullToZero??!0,children:e=>(0,_.jsx)(hB,{showZero:t,barColors:F,data:i,textColor:n,dataColumns:E,animationDuration:r,direction:x,tooltipEnter:v,tooltipLeave:C,minValueGreaterThanZero:T,onDataClick:h,onDataDoubleClick:m,isThumbnail:o,focusedPosition:w,setFocusedPosition:S,showInlineLabels:p,...e})}),M&&(0,_.jsx)(hc,{width:s,data:E,render:e=>e.label,getColor:e=>F.get(e.id),textColor:n,onMouseOver:e=>()=>S({row:"_",column:e.id}),onMouseLeave:()=>()=>S(null)})]}),y()]})},hF=({animationDuration:e,barColors:t,data:i,showZero:n,yMax:a,xMax:r,dataScale:o,inlineLabels:s,labelScale:l,direction:d,globalMinValueGreaterThanZero:c,tooltipEnter:u,tooltipLeave:p,onDataClick:h,onDataDoubleClick:m,borderRadius:g,focusedPosition:f,setFocusedPosition:b})=>{let{clickHandler:x,doubleClickHandler:y}=hu(),v=l.bandwidth(),C=l(i[0]?.position.row)||0,w=(0,j.useMemo)(()=>{let e=i.map(e=>e.position.column);return uu({range:[C,C+v],domain:e,paddingInner:.2*(e.length>1)})},[v,i,C]),S=n?o(c):0;return(0,_.jsx)(d_.default,{children:i.map(l=>{let c,v,C={dataScale:o,value:l,innerScale:w,yMax:a,xMax:r,scaledMinValueGreaterThanZero:S,showZero:n},{x:k,y:A,width:E,height:I,roundedCorners:M}="vertical"===d?function({dataScale:e,value:t,innerScale:i,showZero:n,scaledMinValueGreaterThanZero:a}){let r=Math.min(e.range()[0],e(0)),o=r-(e(t.data)??0),s=o,l=i(t.position.column)??0,d=r-s,c=i.bandwidth(),u={topLeft:!0,topRight:!0,bottomLeft:!1,bottomRight:!1};return n&&Math.abs(r-a)>12&&6>Math.abs(o)&&(s=6,e.domain()[0]<0?(d-=3,u.bottomLeft=!0,u.bottomRight=!0):d-=6),s<0&&(d+=s,u.topLeft=!1,u.topRight=!1,u.bottomLeft=!0,u.bottomRight=!0),{x:l,y:d,height:Math.abs(s),width:c,roundedCorners:u}}(C):function({dataScale:e,value:t,innerScale:i,showZero:n,scaledMinValueGreaterThanZero:a}){let r=Math.max(e.range()[0],e(0)),o=r,s=i(t.position.column),l=e(t.data)-r,d=i.bandwidth(),c=l,u={topLeft:!1,topRight:!0,bottomLeft:!1,bottomRight:!0};return n&&a>12&&6>Math.abs(l)&&(c=6,e.domain()[0]<0&&(o-=3,u.bottomLeft=!0,u.topLeft=!0)),c<0&&(o+=c,u.bottomLeft=!0,u.bottomRight=!1,u.topLeft=!0,u.topRight=!1),{x:o,y:s,height:d,width:Math.abs(c),roundedCorners:u}}(C);return(0,_.jsx)(hH,{yMax:a,xMax:r,x:k,y:A,direction:d,width:E,height:I,radius:g,topLeft:M.topLeft,topRight:M.topRight,bottomRight:M.bottomRight,bottomLeft:M.bottomLeft,fill:t.get(i.length>1?l.position.column:l.position.row),label:s?{...s,label:l.textValue}:void 0,opacity:null!==f&&(i.length>1?f.column!==l.position.column:f.row!==l.position.row)?.5:1,duration:e,onMouseLeave:(c=p(l),e=>{c(e),b(null)}),onMouseMove:(v=u(l),e=>{v(e),b(l.position)}),onClick:h?x(h.bind(void 0,l)):void 0,onDoubleClick:m?y(m.bind(void 0,l)):void 0,style:{cursor:"pointer",transition:"opacity .25s"}},l.key)})})},hH=({duration:e=0,y:t,x:i,height:n,width:a,yMax:r,xMax:o,innerRef:s,direction:l,label:d,opacity:c,style:u,...p})=>{let[h,m]=(0,j.useState)(0),[g,f]=(0,j.useState)(a),[b,x]=(0,j.useState)(t+n),[y,v]=(0,j.useState)(i);return(0,j.useEffect)(()=>{u5(h,n,{duration:e,onUpdate:e=>m(e)})},[n]),(0,j.useEffect)(()=>{u5(g,a,{duration:e,onUpdate:e=>f(e)})},[a]),(0,j.useEffect)(()=>{u5(y,i,{duration:e,onUpdate:e=>v(e)})},[i]),(0,j.useEffect)(()=>{u5(b,t,{duration:e,onUpdate:e=>x(e)})},[t]),(0,_.jsxs)(d_.default,{children:[(0,_.jsx)(ug,{height:"vertical"===l?Math.max(0,r):h,width:"horizontal"===l?Math.max(0,o):g,x:"vertical"===l?y:0,y:"vertical"===l?0:b,...p,onClick:void 0,onDoubleClick:void 0,style:void 0,opacity:0}),(0,_.jsxs)("g",{opacity:c,style:u,children:[(0,_.jsx)(ux,{height:h,width:g,x:y,y:b,innerRef:s,...p}),d&&(0,_.jsx)(pc,{direction:l,textValue:d.label,definition:d,width:g,height:h,x:y,y:b,invertColorOfInsideText:!0,bounds:{x:0,y:0,width:o,height:r}})]})]})};var hW=e.i(997936),hU=e.i(864619),d_=d_,hV=e.i(269662),hG=["children","data","x","y","fill","className","curve","innerRef","defined"];function h$(){return(h$=Object.assign.bind()).apply(this,arguments)}function hZ(e){var t=e.children,i=e.data,n=e.x,a=e.y,r=e.fill,o=e.className,s=e.curve,l=e.innerRef,d=e.defined,c=function(e,t){if(null==e)return{};var i,n,a={},r=Object.keys(e);for(n=0;n=0||(a[i]=e[i]);return a}(e,hG),u=(0,hV.line)({x:n,y:a,defined:void 0===d?function(){return!0}:d,curve:s});return t?j.default.createElement(j.default.Fragment,null,t({path:u})):j.default.createElement("path",h$({ref:l,className:(0,up.default)("visx-linepath",o),d:u(void 0===i?[]:i)||"",fill:void 0===r?"transparent":r,strokeLinecap:"round"},c))}var hK=tI;let hq=({data:e,TooltipInner:t,isThumbnail:i=!1,width:n,height:a,accentColor:r,textColor:o,colorScheme:s=hK.DEFAULT_COLOR_SCHEME,hideLabels:l,backgroundColor:d,chartOptions:c,onContextMenu:u,...p})=>{let{renderTooltip:h,mouseMoveHandler:m,mouseLeaveHandler:g}=hj({TooltipInner:t}),[f,b]=(0,j.useState)(null),[x,y]=(0,j.useState)(null),v=u6(e),C=v?.getCells(e)||[],w=e.columns.filter(({type:e})=>"data"===e),S=w.map(t=>t.getCells(e)).flat(),k=(0,R.useAppSelector)(B.selectTheme),A=(0,P.useFeatureFlag)("useNewChartingColorSet"),E=w.map(({id:e})=>e),I=(0,t_.resolveAccentColorForScheme)(r,s,k,A),M=(0,t_.makeColorScale)(I,E,s,{contrastColor:d,theme:k}),T=(0,ho.guessEmValue)(i),L=w.length>1&&!l,D=L?a-3*T:a;return hR([v,...w]),(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(eg.Box,{"data-test":"line-chart-container",height:L?"calc(100% - 3em)":"100%",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",onContextMenu:u,children:[(0,_.jsx)(hl,{width:n,height:D,color:o,textColor:o,tiny:i,labelCells:C,dataCells:S,hideLabels:l,labelPadding:0,pullToZero:c.line?.axisPullToZero??!0,onMouseMoveInside:i?void 0:(e,t)=>b(t.axisCoords),onMouseLeaveInside:i?void 0:()=>b(null),children:t=>(0,_.jsx)(hY,{data:e,dataColumns:w,width:n,height:D,isThumbnail:i,getColor:M.get.bind(M),textColor:o,tooltipEnter:m,tooltipLeave:g,hoverPosition:f,highlightedColumn:x,chartOptions:c,...p,...t})}),L&&(0,_.jsx)(hc,{width:n,data:w,getColor:e=>M.get(e.id),textColor:o,render:e=>e.label,onMouseOver:e=>()=>y(e.id),onMouseLeave:()=>()=>y(null)})]}),h()]})},hY=({labelScale:e,dataScale:t,data:i,dataColumns:n,isThumbnail:a,getColor:r,margin:o,tooltipEnter:s,tooltipLeave:l,chartOptions:{line:d={}},onDataClick:c,onDataDoubleClick:u,animationDuration:p=hK.ANIMATION_DURATION,textColor:h,hoverPosition:m,highlightedColumn:g,showInlineLabels:f})=>{let[b,x]=t.range(),[y,v]=(0,j.useState)(null),[C,w]=(0,j.useState)(null),S=hO({textColor:h}),k=(0,u8.indexBy)(n,"id"),A=hp({dataCells:i.rows.map(e=>e.getCells(i).filter(e=>!!k.get(e.position.column))),textStyles:S,scale:e,direction:"vertical",showInlineLabels:1===n.length&&f,labelMargin:-2}),E=i=>{let n=s(i),a=(({data:i,position:{row:n}})=>({x:e(n)+e.bandwidth()/2,y:t(i)}))(i);return e=>{n(e),v(a),w(i.position.row)}},I=e=>{let t=l(e);return e=>{t(e),v(null),w(null)}};return(0,_.jsxs)(d_.default,{left:o.left,top:o.top,children:[(0,_.jsx)("line",{y1:x,y2:b,x1:0,x2:0,strokeWidth:1,stroke:h,transform:`translate(${y?.x??m?.x??0}, 0)`,style:{opacity:`${m||y?.8:0}`,pointerEvents:"none",transition:`opacity ${p}s, transform ${.15*!!y}s`}}),n[0].getCells(i).map(t=>(0,_.jsx)(ug,{opacity:0,height:b,width:e.bandwidth(),x:e(t.position.row),y:x,onMouseMove:E(t),onMouseLeave:I(t)},`p-${t.key}`)),n.map(n=>{let o=n.getCells(i);return(0,_.jsx)(hX,{cells:o,isThumbnail:a,color:r(n.id),xScale:e,yScale:t,onDataClick:c,onDataDoubleClick:u,lineOptions:d,animationDuration:p,onMouseMove:E,onMouseLeave:I,highlightedRow:C,highlightedColumn:g,inlineLabels:A,height:b},n.id)})]})},hX=({cells:e,color:t,xScale:i,yScale:n,onDataClick:a,onDataDoubleClick:r,onMouseMove:o,onMouseLeave:s,lineOptions:l={},animationDuration:d,isThumbnail:c,highlightedRow:u,highlightedColumn:p,inlineLabels:h,height:m})=>{var g;let{clickHandler:f,doubleClickHandler:b}=hu(),x=i.bandwidth(),[y,v]=(0,j.useState)({}),C=hQ(e,n,d),w=e=>i(e.position.row)||0;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(hZ,{data:e,x:e=>w(e)+x/2,y:C,stroke:t,strokeWidth:2,style:{pointerEvents:"none",transition:`opacity ${d}s`},opacity:(g=e[0],(u||p)&&(p?p!==g.position.column:!!u))?.3:1}),!c&&e.map(e=>{let n=y[e.key],c=w(e)+i.bandwidth()/2,g=C(e);return(0,_.jsxs)("g",{style:{transition:`opacity ${d}s`},opacity:l.hideMarkers?0:(u||p)&&(p?p!==e.position.column:u!==e.position.row)?.3:1,children:[h&&!h.hide&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(pc,{textValue:e.textValue,definition:h,width:x,height:m,x:w(e),y:C(e),offset:{y:Math.min(.1*m,50),x:0},onPositionChange:t=>{v(i=>({...i,[e.key]:t}))}}),n&&(0,_.jsx)("line",{x1:c,y1:g,x2:n.x,y2:n.y+5*(n.y>g?-1:1),stroke:h.textStyles.fill})]}),(0,_.jsx)(eO.motion.circle,{cx:c,cy:g,r:4,fill:t,stroke:t,style:{cursor:"pointer"},onMouseMove:o(e),onMouseLeave:s(e),onClick:a?f(a.bind(void 0,e)):void 0,onDoubleClick:r?b(r.bind(void 0,e)):void 0})]},`circle-${e.key}`)})]})},hQ=(e,t,i)=>{let n=(0,j.useRef)(Object.fromEntries(e.map(e=>[e.key,void 0]))),a=()=>e=>n.current[e.key],[r,o]=(0,j.useState)(()=>a());return(0,j.useEffect)(()=>{let r=t(0);if(0===r)return;let s=e.map(e=>{let s=e.key;return u5(n.current[s]??r,t(e.data),{duration:i,ease:"easeOut",onUpdate:e=>{n.current[s]=e,o(()=>a())}})});return()=>{s.forEach(e=>{e.stop()})}},[e,t]),r||console.log("no getter"),r};var d_=d_,hJ=e.i(844224),h0=tI,h1=e.i(593893),h2=tI,h3=e.i(212756),h3=h3;function h5(e,t){return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function h4(e,t,i=1){return"number"==typeof t&&(t={x:t,y:t}),{...e,x:e.x+t.x*i,y:e.y+t.y*i}}class h6{cell;radius;label;width;height;boundingRect;_angle;offset;constructor(e,t,i,n,a,r,o){this.cell=e,this.radius=i,this.label=n,this.width=a,this.height=r,this.boundingRect=o,this.offset=0,this.angle=t}get anchor(){let e=360*this.angle/(2*Math.PI);switch(!0){case e>=225&&e<=315:return{h:"middle",v:"end"};case e>=45&&e<=135:return{h:"middle",v:"start"};case e>135&&e<225:return{h:"end",v:"middle"};default:return{h:"start",v:"middle"}}}get key(){return this.cell.key}get closestCorner(){let e=this.angle,t=this.rect;return{x:e>=1.5*Math.PI||e<=Math.PI/2?t.x:t.x+this.width,y:e<=Math.PI?t.y:t.y+this.height}}get furthestCorner(){let e=this.angle,t=this.rect;return{x:e>=1.5*Math.PI||e<=Math.PI/2?t.x+this.width:t.x,y:e<=Math.PI?t.y+this.height:t.y}}getConnectionPoint(e=0){let t=this.rect,{x:i,y:n}=this.closestCorner,a=i/Math.cos(this.angle),r=n/Math.sin(this.angle),o=a;return h5({x:r*Math.cos(this.angle),y:n},t)?o=r:h5({x:i,y:a*Math.sin(this.angle)},t)||console.error("Line does not intersect rect"),{x:(o-e)*Math.cos(this.angle),y:(o-e)*Math.sin(this.angle)}}get rect(){var e,t;return{...(e=this._angle,h4({x:Math.cos(e)*(t=this.radius+this.offset),y:Math.sin(e)*t},this.anchorPos??0)),width:this.width,height:this.height}}get angle(){return this._angle}set angle(e){this._angle=function(e){let t=e;for(;t<0;)t+=2*Math.PI;return t%(2*Math.PI)}(e)}getOverflowingRadius(){let e=this.boundingRect,t=this.furthestCorner;if(t.ye.x+e.width||t.y>e.y+e.height){let i=Math.min(Math.abs(e.x/Math.cos(this.angle)),Math.abs(e.y/Math.sin(this.angle)));return Math.sqrt(t.x**2+t.y**2)-i}return 0}handleIntersection(e){let t=this.rect,i=e.rect,n=function(e,t,i=0){let n=h4(e,i),a=h4(t,i),r=e=>{let t={x:"width",y:"height"}[e];return a[e]>n[e]?[a[e],Math.max(n[e]+n[t]-a[e],0)]:[n[e],Math.max(a[e]+a[t]-n[e],0)]},[o,s]=r("x"),[l,d]=r("y");return 0!==s&&0!==d&&h4({x:o,y:l,width:s,height:d},-1*i)}(i,t,this.radius);if(!n)return 0;let a=(n.x>i.x?n.width:-1*n.width)*Math.sign(t.x),r=0>Math.sign(t.y)?-((n.y>i.y?i.height-n.height+t.height:n.height)*1):n.y>i.y?n.height:i.height-n.height,o=a/Math.cos(this.angle),s=r/Math.sin(this.angle),l=Math.sign(o)===Math.sign(s)?Math.min(Math.max(o,0),Math.max(s,0)):Math.max(o,s);return this.offset+=l,this.offset}get anchorPos(){var e,t;return e={w:this.width,h:this.height},{x:"start"===(t=this.anchor).h?0:"middle"===t.h?-(e.w/2):-1*e.w,y:"start"===t.v?0:"middle"===t.v?-(e.h/2):-1*e.h}}}let h9=({labels:e,radius:t,textStyles:i,colors:n,isFocused:a,explodeOffset:r,animationDuration:o=.2})=>(0,_.jsx)("g",{children:e.map((e,s)=>{let l=e.getConnectionPoint(5),d=a(e.cell.position),c=a(e.cell.position,!0),u=`opacity ${o}s, transform ${o}s`,p=c?`translate(${Math.cos(e.angle)*r}px, ${Math.sin(e.angle)*r}px)`:"";return(0,_.jsxs)("g",{opacity:d?1:.5,style:{transition:u,transform:p},children:[(0,_.jsx)("line",{x1:Math.cos(e.angle)*t,y1:Math.sin(e.angle)*t,x2:l.x,y2:l.y,stroke:i.fill,strokeWidth:c?2:1}),(0,_.jsx)("circle",{cx:l.x,cy:l.y,r:3,fill:n[s],stroke:i.fill}),(0,_.jsx)("text",{dominantBaseline:"hanging",x:e.rect.x,y:e.rect.y+3,...i,fontWeight:c?"bold":"normal",pointerEvents:"none",style:{userSelect:"none"},children:e.label})]},e.key)})}),h8=({data:e,TooltipInner:t,colorScheme:i=h0.DEFAULT_COLOR_SCHEME,isThumbnail:n=!1,width:a,height:r,chartType:o,textColor:s,accentColor:d,chartOptions:{donut:c,pie:u},hideLabels:p,showInlineLabels:h,onDataClick:m,onDataDoubleClick:g,animationDuration:f=h0.ANIMATION_DURATION,backgroundColor:b,onContextMenu:x})=>{let{dispatch:y}=(0,j.useContext)(hD.ChartContext),{renderTooltip:v,mouseMoveHandler:C,mouseLeaveHandler:w}=hj({TooltipInner:t}),S={top:15,right:15,bottom:15,left:15},k=u4(e),A=u6(e),E=k?k.getCells(e).filter(e=>!e.isEmpty):[];hR([A,k]),(0,j.useEffect)(()=>{let e="pie-no-labels";return A||p||y((0,h1.addFeedbackAction)(l.i18n._({id:"gMgGUM",message:"Chart does not have a label column"}),{severity:"warning",id:e,dismissable:!1})),()=>{y((0,h1.removeFeedback)(e))}},[A,p,y]),(0,j.useEffect)(()=>{let e="pie-single-row";return 1===E.length&&y((0,h1.addFeedbackAction)(l.i18n._({id:"uHTxZb",message:"This chart works better with more than one row"}),{severity:"info",id:e,dismissable:!0})),()=>{y((0,h1.removeFeedback)(e))}},[E.length,y]);let I=(0,R.useAppSelector)(B.selectTheme),M=(0,P.useFeatureFlag)("useNewChartingColorSet"),T=E.map(({position:e})=>e.row),D=(0,t_.resolveAccentColorForScheme)(d,i,I,M),N=(0,t_.makeColorScale)(D,T,i,{contrastColor:b,minContrast:1.3,theme:I}),[O,z]=(0,j.useState)(null),F=(e,t=!1)=>O?O.row===e.row&&O.column==O.column:!t;n&&(S.top=5,S.right=5,S.bottom=5,S.left=5);let H=n||p||!A,[W,U]=a{let[n,a]=(0,j.useState)(t);return(0,j.useEffect)(()=>{let{stop:t}=u5(n,e,{duration:i,onUpdate:e=>{a(e)}});return()=>{t()}},[e]),n})({targetValue:"donut"===o?c?.radius||.5:1,initialValue:1,duration:f}),q=u?.legendPosition??"bottom",Y=hO(),{labelPad:X,labels:Q}=(({showLabels:e,cells:t,radius:i,textStyles:n,chartWidth:a,margin:r=20,...o})=>{let s=t.map(e=>e.textValue).join("|");return(0,j.useMemo)(()=>{if(!e)return{labelPad:0,labels:[]};let s={x:-(a/2),y:-(a/2),width:a,height:a},l=(0,hV.pie)({value:e=>e.data,...o})(t),d=0,c=l.map(e=>{let{startAngle:t,endAngle:a}=e,r=e.data,o=r.textValue,{width:l,height:c}=(0,h3.default)(o,n)??{width:0,height:0},u=new h6(r,(t+a)/2-Math.PI/2,i,o,l,c,s),p=u.getOverflowingRadius();return p>d&&(d=p),u}),u=d,p=d,h=0;for(;u>0&&h++<2;){let e=d;d=0,u=0,c.forEach((t,i)=>{t.radius=t.radius-e,0!==i&&(u+=t.handleIntersection(c[i-1])),i===c.length-1&&(u+=t.handleIntersection(c[0]));let n=t.getOverflowingRadius();n>d&&(d=n)}),p+=d,u+=d}let m=r+p;return i-m<.25*i?{labelPad:0,labels:[]}:{labelPad:m,labels:c}},[s,n,i,a,r,e])})({showLabels:h,cells:E,radius:$,textStyles:Y,chartWidth:V,sort:null}),J=$-X,ee=J*K,et=e=>(0,_.jsx)(me,{cells:E,colors:N,donutThickness:ee,duration:f,isDummy:e,isFocused:F,isThumbnail:n,onClick:m,onDoubleClick:g,radius:J,setFocus:z,tooltipEnter:C,tooltipLeave:w}),ei=["top","left"].includes(q),en=["right","left"].includes(q),ea=`${en?"row":"column"}${ei?"-reverse":""}`;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(L.Flex,{height:"100%","data-test":"pie-chart-container",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",flexDirection:ea,gap:1,justifyContent:ei?"flex-end":"flex-start",onContextMenu:x,children:[(0,_.jsx)("svg",{style:{aspectRatio:"1",minHeight:"2em",overflow:"hidden"},viewBox:`0 0 ${W} ${U}`,children:(0,_.jsx)(d_.default,{top:G/2+S.top,left:Z+S.left,children:(0,_.jsxs)(_.Fragment,{children:[et(!0),et(!1),(0,_.jsx)(h9,{labels:Q,isFocused:F,radius:J,textStyles:Y,colors:[...N.values()],explodeOffset:15})]})})}),!H&&(0,_.jsx)(hc,{width:a,position:q,data:E,getColor:e=>N.get(e.position.row),render:({position:{row:t}})=>e.getCellOrThrow({row:t,column:A.id}).label,textColor:s,getOpacity:e=>F(e.position)?1:.2,onMouseOver:e=>()=>z(e.position),onMouseLeave:()=>()=>z(null)})]}),v()]})},h7=({arc:e,duration:t=.2,path:i,getColor:n,tooltipEnter:a,tooltipLeave:r,onClick:o,onDoubleClick:s,focused:l,setFocused:d,isThumbnail:c,radius:u,isDummy:p,isDonut:h,...m})=>{let{startAngle:g,endAngle:f}=e,b=n(e.data),[x,y]=(0,j.useState)(g),[v,C]=(0,j.useState)(g),[w,S]=(0,j.useState)(b),{clickHandler:k,doubleClickHandler:A}=hu();(0,j.useEffect)(()=>{u5(x,[x,f],{duration:t,onUpdate:e=>y(e)})},[f]),(0,j.useEffect)(()=>{u5(v,[v,g],{duration:t,onUpdate:e=>C(e)})},[g]),(0,j.useEffect)(()=>{u5(w,b,{duration:t,onUpdate:e=>S(e)})},[b]);let E=l?c?4:15:0,I=(v+x)/2,M=E>0?`translate(${Math.sin(I)*E}, ${-(Math.cos(I)*E*1)})`:"";return(0,_.jsx)("g",{transform:M,style:{transition:`transform ${t}s`},children:(0,_.jsx)("path",{d:i({...e,startAngle:v,endAngle:x}),fill:w,stroke:p||h?"transparent":"var(--card-color)",strokeWidth:.02*u,strokeLinecap:"round",strokeLinejoin:"round",onMouseMove:t=>{d(!0),a?.(e.data)(t)},onMouseLeave:t=>{d(!1),r?.(e.data)(t)},onClick:o?k(o.bind(void 0,e.data)):void 0,onDoubleClick:s?A(s.bind(void 0,e.data)):void 0,...m})})},me=({cells:e,colors:t,donutThickness:i,duration:n,isDummy:a,isFocused:r,isThumbnail:o,onClick:s,onDoubleClick:l,radius:d,setFocus:c,tooltipEnter:u,tooltipLeave:p})=>(0,_.jsx)(hJ.default,{data:e,outerRadius:d,innerRadius:a?0:d-i,pieValue:({data:e})=>e,pieSort:null,pieSortValues:null,padAngle:a?0:.016*(ie.map(e=>(0,_.jsx)(h7,{arc:e,...h,radius:d,isDonut:i{c(t?e.data.position:null)},getColor:e=>a?"transparent":t.get(e.position.row),tooltipEnter:u,tooltipLeave:p,duration:a?0:n,isThumbnail:o,onClick:s,onDoubleClick:l,isDummy:!!a},e.data.key))});function mt(e){return"object"==typeof e&&null!==e&&"ratio"in e}function mi(e){return"object"==typeof e&&null!==e&&"width"in e&&"height"in e}function mn(e){if(e&&"object"==typeof e&&!Array.isArray(e)){if("number"==typeof e.width&&"number"==typeof e.height)return{width:e.width,height:e.height};if("number"==typeof e.ratio)return{ratio:e.ratio}}return{ratio:.56}}e.s(["isChartDimensionAbsolute",0,mi,"isChartDimensionRatio",0,mt,"normalizeChartDimensions",0,mn],313307);var ma=e.i(45652),mr=e.i(85583),mo=e.i(275885),ms=j;class ml extends ms.Component{constructor(e){super(e),this.state={hasError:!1,errMessage:""}}static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message}}componentDidCatch(e,t){console.error("BlockErrorBoundary caught an error:",e,t),mr.datadogLogs.logger.error("block.render.error",{errorMessage:e.message,componentStack:t?.componentStack,blockType:this.props.errorMessage},e),mo.captureException(e,{extra:{componentStack:t?.componentStack,blockType:this.props.errorMessage}})}render(){return this.state.hasError?(0,_.jsx)(eg.Box,{fontFamily:"monospace",p:"1em",bg:"red.500",color:"white",borderRadius:"var(--box-border-radius)",fontSize:"1em",children:"Error rendering block: "+this.state.errMessage}):this.props.children}}e.s(["BlockErrorBoundary",0,ml],592799);var md=e.i(685290),mc=e.i(529545);let mu=({isResizing:e,onResizing:t,setIsResizing:i,cloneBoxProps:n={},showResizeControls:a,disableCloning:r,children:o,...s})=>{let l=(0,j.useRef)(null),d=(0,j.useRef)(null),c=(0,j.useRef)(void 0);return(0,j.useEffect)(()=>{r||(!0===e&&d.current&&c.current&&d.current.appendChild(c.current),!e&&c.current&&c.current.parentNode?.removeChild(c.current))},[e]),(0,_.jsxs)(_.Fragment,{children:[e&&!r?(0,_.jsx)(eg.Box,{filter:"blur(15px)",...n,ref:d,width:"100%",height:"100%",position:"relative","data-test":"resize-placeholder"}):(0,_.jsx)(eg.Box,{ref:l,width:"100%",height:"100%",filter:e?"blur(4px) opacity(0.75)":void 0,children:o}),a&&(0,_.jsx)(mc.ResizableControls,{setIsResizing:e=>{if(!r&&e){c.current=l.current?.cloneNode(!0);let e=c.current;e&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="auto",e.style.height="auto")}i(e)},onResizing:(e,...i)=>{let{width:n,height:a}=e,r=c.current;if(!r)return;let o={width:r.offsetWidth,height:r.offsetHeight},s=n/o.width,l=a/o.height;r.style.transform=`scale(${s}, ${l})`,r.style.transformOrigin="top left",t?.(e,...i)},...s})]})};e.s(["ResizeableCloned",0,mu],622456);var mp=e.i(402818),mh=e.i(52307),mm=e.i(387451),mg=e.i(96953),mf=e.i(281107),mb=e.i(279920),mx=e.i(285256),my=e.i(630619),mv=e.i(746706);let mC=e=>{let{state:t,dispatch:i}=(0,j.useContext)(hD.ChartContext),[n,a]=(0,j.useState)(new Date),r=(0,j.useRef)(!1),o=t.feedback;return((0,j.useEffect)(()=>{if(!o?.length)return;let e=[],t=o.filter(t=>{let i=t.dismissable;return i instanceof Date&&(!(i<=n)||(e.push(t.id),!1))});e.length&&i((0,h1.removeFeedback)(...e)),!r.current&&t.length&&(r.current=setTimeout(()=>{r.current=!1,a(new Date)},1e3))},[o,n,i]),t.feedback?.length)?(0,_.jsx)(s8.Stack,{marginY:2,...e,children:t.feedback?.map(e=>(0,_.jsxs)(di.Alert,{marginBottom:1,status:e.severity,children:[(0,_.jsx)(da.AlertIcon,{}),(0,_.jsx)(dn.AlertDescription,{flexGrow:1,children:e.message}),e.dismissable&&(0,_.jsx)(mv.CloseIcon,{cursor:"pointer",onClick:()=>{i((0,h1.removeFeedback)(e.id))}})]},e.id))}):null};var mw=e.i(707274),mS=e.i(765996),mk=e.i(287816);let mA=({onConvert:e,isLoading:t=!1})=>(0,_.jsx)(eg.Box,{bg:"blue.50",borderRadius:"md",px:4,py:3,mb:4,children:(0,_.jsxs)(L.Flex,{align:"center",justify:"space-between",gap:4,children:[(0,_.jsxs)(L.Flex,{align:"center",gap:3,children:[(0,_.jsx)(eg.Box,{color:"blue.500",children:(0,_.jsx)(eJ.FontAwesomeIcon,{icon:e8.faSparkles})}),(0,_.jsx)(ej.Text,{fontSize:"sm",color:"gray.700",children:(0,_.jsx)(eD.Trans,{message:"Update to the new chart format for more chart types and features",id:"1ME0KN"})})]}),(0,_.jsx)(a7.Button,{size:"sm",colorScheme:"blue",onClick:e,isLoading:t,flexShrink:0,children:(0,_.jsx)(eD.Trans,{message:"Update chart",id:"K7GQed"})})]})}),mE=(0,hD.withChartContext)(({onChange:e,onClose:t,data:i,isOpen:n,renderChart:a,attributes:r,updateAttributes:o,accentColor:s,selectedCell:l,cardColor:d,onConvertToGraphy:c})=>{let u=(0,R.useAppSelector)(B.selectTheme),p=(0,tT.getThemeColorSolid)((0,tT.getThemeBodyColor)(u));return(0,_.jsxs)(mh.Drawer,{placement:"bottom",onClose:t,isOpen:n,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,_.jsx)(mx.DrawerOverlay,{}),(0,_.jsxs)(mf.DrawerContent,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",transitionDuration:{enter:"0.4s"},children:[(0,_.jsx)(mg.DrawerCloseButton,{}),(0,_.jsxs)(mm.DrawerBody,{p:0,h:"100%",overflow:"auto","data-testid":"chart-editor-body",display:"flex",flexDir:"column",children:[(0,_.jsx)(mb.DrawerHeader,{children:(0,_.jsx)(eD.Trans,{message:"Edit chart",id:"44wbJb"})}),c&&(0,_.jsx)(eg.Box,{px:5,children:(0,_.jsx)(mA,{onConvert:c})}),(0,_.jsxs)(L.Flex,{direction:{base:"column",xl:"row-reverse"},overflow:"auto",gap:5,px:5,children:[(0,_.jsxs)(L.Flex,{direction:{base:"column",lg:"row",xl:"column"},width:{base:"auto",xl:"40%","2xl":"30%"},gap:5,children:[(0,_.jsx)(eg.Box,{flexGrow:{base:1,xl:0},flexShrink:0,flexBasis:"auto",borderRadius:"md",overflow:"hidden",children:(0,_.jsx)(eg.Box,{background:d,borderRadius:"md",padding:8,maxWidth:"100%",h:"xs",children:(0,_.jsx)(my.ParentSize,{style:{position:"relative",width:"100%",height:"100%"},children:({width:e,height:t})=>a({data:i,width:e,height:t,textColor:p})})})}),(0,_.jsx)(eg.Box,{background:"gray.50",borderRadius:"md",children:(0,_.jsx)(mS.ChartOptions,{attributes:r,updateAttributes:o,accentColor:s})})]}),(0,_.jsx)(mp.Divider,{display:{base:"block",xl:"none"}}),(0,_.jsxs)(eg.Box,{flexGrow:1,zIndex:1,overflow:{xl:"auto"},children:[(0,_.jsx)(mk.DataEditorWrapper,{onChange:e,data:i||mw.ChartData.createEmpty(2,3),selectedCell:l}),(0,_.jsx)(mC,{})]})]})]})]})]})}),m_=e=>(0,_.jsx)(ml,{errorMessage:l.i18n._({id:"ngl57B",message:"Unable to render chart"}),children:(0,_.jsx)(mI,{...e})}),mI=e=>{let{node:t,editor:i,selected:n,updateAttributes:a,decorations:r,getPos:o}=e,{chartType:d,colorScheme:c,data:u,hideLabels:p,showInlineLabels:h,chartAttributes:m={},horizontalAlign:g}=t.attrs,f=mn(t.attrs.dimensions),b=(0,j.useMemo)(()=>{try{return u?hU.chartObjectSerializer.parse(u):null}catch(e){return console.error("[DATALOSS] Error parsing serialized chart",e),console.log(u),null}},[u]),x=(0,R.useAppStore)(),y=(0,R.useAppSelector)(B.selectContentEditable),v=(0,O.useShouldRenderMobileVersion)(),C=(0,R.useAppSelector)(B.selectIsAllowedToEdit),w=(0,O.useEditorFocused)(),S=(0,R.useAppSelector)(B.selectExpandedChartId),k=y&&w&&C&&!eB.config.GAMMA_PUPPETEER_SERVICE,{theme:E,cardColor:I}=(0,rY.useCardColorMode)(r),{ref:M,isResizing:T,setIsResizing:D,resizeableSx:N}=(0,mc.useResizeable)(i),z=(0,j.useCallback)(e=>{a({dimensions:{width:e.width,height:e.height}})},[a]),[F,H]=(0,j.useState)(tI.ANIMATION_DURATION);(e=>{let t=(0,j.useRef)(!1),[i,n]=(0,j.useState)(!1);(0,j.useEffect)(()=>{if(t.current||null===e)return;let i=!1;e.columns.forEach((t,n)=>{let a=e.getCellAtIndex({row:0,column:n});i=(0,u8.updateColumnTypeFromCell)(a,e)||i}),t.current=!0,i&&n(i)},[e])})(b),(0,j.useEffect)(()=>{T?H(0):setTimeout(()=>{H(tI.ANIMATION_DURATION)},1e3*tI.ANIMATION_DURATION)},[T]);let W="var(--body-color)",U=(0,er.useIsThumbnailView)(),[V,G]=(0,j.useState)(),$=!U&&null!=S&&S===t.attrs.id,K=(0,j.useCallback)(e=>{e?x.dispatch((0,B.setExpandedChartId)({chartId:t.attrs.id})):x.dispatch((0,B.setExpandedChartId)({chartId:null}))},[x,t.attrs.id]),q=(0,P.useFeatureFlag)("chartConversion"),Y=(0,j.useMemo)(()=>u&&u.columns&&Array.isArray(u.columns)&&u.columns.length>0,[u]),X=(0,j.useCallback)(()=>{let e=o();"number"==typeof e&&(i.commands.convertChartToGraphyChart(e),K(!1))},[i,o,K]),Q=(0,j.useMemo)(()=>{switch(d){case"pie":case"donut":return h8;case"line":return hq;default:return hz}},[d]),J=(0,tT.getThemeColorSolid)((0,tT.getThemePrimaryAccentColor)(E)),ee=e=>{y&&C&&(G(e),K(!0))};(0,j.useEffect)(()=>{V&&b?.getCell(V.position)!==V&&G(void 0)},[V,$]);let et=({data:e,width:t,height:i,textColor:n=W,showEditInPlaceholder:a=!1,onContextMenu:r=()=>{}})=>{let o=e&&hW.ChartRange.nonEmpty(e)?.data;return!o||!u4(o)||o.isEmpty()?(0,_.jsx)(mL,{setEditing:a?K:void 0,onContextMenu:r}):(0,_.jsx)(Q,{animationDuration:F,data:o,colorScheme:c||void 0,width:t,height:i,accentColor:J,textColor:n,chartOptions:m,onDataDoubleClick:ee,hideLabels:p,showInlineLabels:h,backgroundColor:I,onContextMenu:r,TooltipInner:e=>(0,_.jsx)(_.Fragment,{children:u.columns.map(t=>(0,_.jsxs)(eg.Box,{as:"p",mb:1,children:[t.label&&(0,_.jsxs)(ej.Text,{as:"b",children:[t.label,": "]}),(0,_.jsx)(ej.Text,{as:"span",children:o.getCell({row:e.position.row,column:t.id})?.textValue},t.id)]},t.id))}),chartType:d,isThumbnail:U})},ei=mM(f),en="width"in f?f.width:A.CONTENT_WIDTH_PX;v&&(en=Math.min(en,A.CONTENT_WIDTH_PX/2));let ea=en*ei,eo=(0,Z.getAlignStyles)(g),es=(({editor:e,node:t,getPos:i})=>{let n=(0,j.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.chain().deleteSelectionAndSelectNear().run())},[e,i]),{attrs:a}=t,r=!!a.data,o=a.colorScheme,d=a.chartType,c=t=>{let n=i();"number"==typeof n&&(e.commands.selectNodeAtPos(n),e.chain().updateAttributes("chart",t).focus().run())},u=(0,lW.useEditorContextMenuItems)({editor:e,node:t,getPos:i});return[{key:"chart-options",title:(0,_.jsx)(eD.Trans,{message:"Chart",id:"nuBbBr"})},{divider:!0},...u,{divider:!0},{key:"edit-chart",label:r?(0,_.jsx)(eD.Trans,{message:"Edit chart data",id:"BhcOHV"}):(0,_.jsx)(eD.Trans,{message:"Add chart data",id:"UHoZ5e"}),icon:s.faPencil,onClick:()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.commands.editSelectedChart())}},{divider:!0},{key:"change-color-scheme",label:(0,_.jsx)(eD.Trans,{message:"Change color scheme",id:"q3f9iw"}),icon:s.faFillDrip,items:[{key:"default",label:l.i18n._({id:"ovBPCi",message:"Default"}),check:!o,onClick:()=>{c({colorScheme:void 0})}},...Object.entries(tI.CHART_COLORS_SCHEMES).map(([e,t])=>({key:e,label:t.label(),check:e===o,onClick:()=>{c({colorScheme:e})}}))]},{key:"horizontal-alignment",label:(0,_.jsx)(eD.Trans,{message:"Align",id:"9ms+e0"}),icon:s.faAlignLeft,items:Z.AlignmentCommands.map(({name:t,key:i,icon:n,checkActive:a,apply:r})=>{if(a&&r)return{key:i,label:t(),check:a(e),icon:n,onClick:()=>{r(e)}}}).filter(Boolean)},{divider:!0},{key:"switch-chart-type",label:(0,_.jsx)(eD.Trans,{message:"Switch chart type",id:"U2Nq+R"}),icon:s.faChartBar,items:Object.entries(tI.CHART_TYPES).map(([e,{label:t,icon:i}])=>({key:e,label:t(),icon:i,check:d===e,onClick:()=>c({chartType:e})}))},{divider:!0},{key:"delete",label:(0,_.jsx)(eD.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,onClick:n,color:"red.500"}]})(e),{onOpenContextMenu:el}=(0,sM.useEditorContextMenu)({editor:i,contextMenuItems:es,getPos:o});return(0,ma.useSSRMounted)()?(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{as:"div",...e,children:(0,_.jsx)(L.Flex,{w:"100%",dir:(0,Z.getAlignDirection)(r,g),className:md.MOVEABLE_WRAPPER_CLASSNAME,sx:N,css:eo,direction:"column",onDoubleClick:()=>{k&&K(!0)},_focusWithin:{shadow:"outline"},children:(0,_.jsxs)(eg.Box,{ref:M,className:"chart",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,maxW:"100%",minW:"min(10em, 100%)",minH:"min(10em, 100%)",width:mi(f)?mT(f.width):"calc(100% * var(--media-scale))",aspectRatio:!v&&ei?`1/${ei}`:void 0,position:"relative","data-drag-handle":!0,"data-scale-preview":!0,children:[(0,_.jsx)(mu,{showResizeControls:k&&n,imageWrapperRef:M,isResizing:T,setIsResizing:D,updateResizeAttrs:z,refreshDeps:[t.attrs],disableCloning:!0,keepRatio:!1,children:b?et({data:b,width:en,height:ea,showEditInPlaceholder:!U&&y,onContextMenu:el}):(0,_.jsx)(mL,{setEditing:U||!y||eB.config.GAMMA_PUPPETEER_SERVICE?void 0:K})}),(0,_.jsx)(mE,{renderChart:et,cardColor:I,data:b,isOpen:$,onClose:()=>K(!1),onChange:e=>{a({data:hU.chartObjectSerializer.serialize(e)})},attributes:t.attrs,updateAttributes:a,accentColor:J,selectedCell:V,onConvertToGraphy:q&&Y?X:void 0})]})})}):(0,_.jsx)(eg.Box,{w:en,h:ea})},mM=e=>mt(e)?e.ratio:e.height/e.width,mT=e=>`calc(${e} * var(--font-size) / 16)`,mL=({setEditing:e,onContextMenu:t})=>{let i=(0,oO.useIsThemeDark)();return(0,_.jsxs)(eQ.VStack,{spacing:3,justify:"center",contentEditable:!1,color:i?sR.PH_COLOR.DARK_COLOR:sR.PH_COLOR.LIGHT_COLOR,h:"100%",backgroundColor:i?sR.PH_COLOR.DARK_BG:sR.PH_COLOR.LIGHT_BG,borderRadius:"var(--box-border-radius)","data-testid":"chart-placeholder",onContextMenu:t,children:[(0,_.jsx)(eJ.FontAwesomeIcon,{size:"2x",icon:o.faChartSimple}),e&&(0,_.jsx)(a7.Button,{size:"xs",fontFamily:"body",onClick:()=>e(!0),children:(0,_.jsx)(eD.Trans,{message:"Add chart data",id:"UHoZ5e"})})]})};var mj=e.i(687461);let mP=()=>(0,rx.nanoid)(5),mD=new ea.PluginKey("UniqueMediaId"),mN=rv.UniqueAttribute.extend({name:"UniqueChartId"}).configure({attributeName:"id",types:["chart"],initialValue:mP,filterTransaction:ry.isLocalTransaction,pluginKey:mD}),mR=(0,tl.createTiptapNode)("chart",{selectable:!0,draggable:!0,addNodeView:()=>(0,rL.ReactNodeViewRenderer)(m_,{update:rj.attrsOrDecorationsChanged}),addCommands:()=>({insertChart:(e,t)=>({dispatch:i,editor:n,commands:a})=>{if(!i)return!1;let{schema:r}=n,o=r.nodes.chart,s=mP(),l=o.createChecked({id:s,chartType:e,data:t&&e?(0,mj.getSampleChartData)(e):void 0});return a.insertContent(l.toJSON())},editSelectedChart:()=>({state:e})=>{let t=e.selection;if(!(t instanceof ea.NodeSelection)||!mO(t.node))return!1;let i=t.node;return(0,R.getStore)().dispatch((0,B.setExpandedChartId)({chartId:i.attrs.id})),!0}}),addExtensions:()=>[mN],parseHTML:()=>[{tag:'div[data-type="chart"]',getAttrs:e=>({id:(0,tl.parseIdAttr)(e,mP),chartType:e.getAttribute("data-chart-type")||"bar",chartAttributes:(0,tl.parseJSONAttr)(e,"chartAttributes")??{},colorScheme:e.getAttribute("data-color-scheme")||null,dimensions:(0,tl.parseJSONAttr)(e,"dimensions")??{ratio:.56},hideLabels:"true"===e.getAttribute("data-hide-labels"),showInlineLabels:"true"===e.getAttribute("data-show-inline-labels"),data:(0,tl.parseJSONAttr)(e,"data")??null,...(0,tl.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{"data-type":"chart","data-id":e.attrs.id,"data-chart-type":e.attrs.chartType||"bar",...(0,tl.renderJSONAttrs)(e.attrs,"chartAttributes","dimensions","data"),...e.attrs.colorScheme&&{"data-color-scheme":e.attrs.colorScheme},...e.attrs.hideLabels&&{"data-hide-labels":"true"},...e.attrs.showInlineLabels&&{"data-show-inline-labels":"true"},...(0,tl.renderHorizontalAlign)(e.attrs)})]}),mO=e=>"chart"===e.type.name,mB=(0,tl.extendTiptapMark)(eb.default,"code",{priority:tm.ExtensionPriorityMap.Code,inclusive:!1,addKeyboardShortcuts(){return{"Mod-Shift-C":()=>this.editor.commands.toggleCode()}}});e.s(["CodeMark",0,mB],553901),e.s(["Diagram",()=>m5],138588),e.s(["DiagramView",()=>m3],59539);let mz={borderRadius:"0.125em",px:".05em",mx:"-.05em",boxDecorationBreak:"clone"},mF={default:{"mark.highlight":{color:"black","--link-color":"black",backgroundColor:"var(--highlight-color)",...mz}}};e.s(["highlightStyles",0,mF,"paddedTextBackground",0,mz],810983);let mH="var(--list-marker-text-color, var(--body-color))",mW={default:{"span.textColor":{color:"var(--text-color, var(--body-color))"},".block-numbered":{"li::before":{color:mH}},".block-bullet":{"li::marker":{color:mH}}}};e.s(["textColorStyles",0,mW],122488);let mU=e=>{let t,i;return{"[data-shape=image]":{".tl-inner-div":{}},img:{'&[src^="blob:"]':{animation:"loading-pulse-animation 1.5s infinite"}},...{text:{fill:"var(--body-color)"},"[data-shape-type=geo]":{path:{...aY.SvgShapeBackgroundSx,fill:"var(--shape-bg-color-override, var(--shape-bg-image-svg) var(--shape-bg-color))",vectorEffect:"none",strokeWidth:"var(--stroke-width)"},"&.tl-shape-background":{strokeWidth:0},".textbox":{padding:"12px"}},"[data-shape-type=arrow]":{"g, path":{stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--stroke-width)"},".tl-arrow-label":{color:"var(--shape-border-color-override, var(--body-color)) !important"},text:{fill:"var(--shape-border-color-override, var(--body-color))"}},"[data-shape-type=line]":{path:{stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--stroke-width)"}},"[data-shape-type=image]":{"[data-image-upload-status]":{".tl-image-container":{backgroundImage:"var(--temp-url)",objectFit:"cover",backgroundSize:"cover"}}},...{"div.textbox":{display:"flex",flexDirection:"column",alignItems:"var(--horizontal-align)",justifyContent:"var(--vertical-align)",textAlign:"var(--text-align)","--flex-align":"var(--horizontal-align)",height:"100%",...(0,eS.getHeadingStylesheet)(e),fontSize:`${(e.config.fontSize??1)*20}px`,color:"var(--body-color)",".ProseMirror":{padding:"8px",...(t=e,{lineHeight:1.4,letterSpacing:"var(--letter-spacing-body)",".block":{my:"1rem"},"> .first-block":{mt:"0rem"},"> .last-block":{mb:"0rem"},'.heading[level="1"], h1':(0,rJ.getFontSizeStyles)("h1",t),'.heading[level="2"], h2':(0,rJ.getFontSizeStyles)("h2",t),'.heading[level="3"], h3':(0,rJ.getFontSizeStyles)("h3",t),'.heading[level="4"], h4':(0,rJ.getFontSizeStyles)("h4",t),...mF.default,...mW.default,...(0,rJ.getFontSizeStylesheet)(t),".block-heading":{mt:"1rem",mb:"1rem","&.first-block":{mt:"0rem"},"&.last-block":{mb:"0rem"}},"a.link":{color:"var(--text-color, var(--link-color))",cursor:"pointer",fontWeight:"bold",textDecoration:"underline","&:hover":{color:"var(--text-color, var(--link-color))"},"&:active":{color:"var(--text-color, var(--link-color))"}},code:{backgroundColor:"var(--accent-color-background-muted)",color:"var(--body-color)",...mz}})}},foreignObject:{overflow:"visible","*":{wordWrap:"normal",whiteSpace:"pre-wrap"},"[data-autosize].textbox":{"> .text":{width:"max-content"}},"p.paragraph:empty::after":{content:'" "',whiteSpace:"pre",visibility:"hidden"},".textbox > .text":{padding:"8px",width:"100%",alignItems:"var(--flex-align)",display:"block",...e.config.contentStyles,...(i=e,{lineHeight:1.4,"> *":{my:"1rem","&:first-child":{mt:"0rem"},"&:last-child":{mb:"0rem"}},h1:(0,rJ.getFontSizeStyles)("h1",i),h2:(0,rJ.getFontSizeStyles)("h2",i),h3:(0,rJ.getFontSizeStyles)("h3",i),h4:(0,rJ.getFontSizeStyles)("h4",i),"h1, h2, h3, h4":{mt:"1rem",mb:"1rem",width:"100% !important"}}),".themed-heading":{position:"static"}}}}}}};e.s(["getShapeStyles",0,mU,"getStrokeWidth",0,(e,t)=>(t&&"none"===e&&(e="sm"),({none:0,sm:2,md:4,lg:6})[e])],389278);let mV="125em",mG=({svg:e,theme:t})=>{let i=(0,j.useMemo)(()=>({__html:e??""}),[e]);if(!e)return null;let n=mU(t);return(0,_.jsx)(eg.Box,{dangerouslySetInnerHTML:i,"data-testid":"diagram-svg",sx:{svg:{width:"100%",height:"auto",maxH:mV,...n}}})};var m$=e.i(812059),mZ=e.i(37026),mK=e.i(168489),mq=e.i(572383);e.i(477893);var mY=e.i(218378),mX=e.i(395478);let mQ=(0,mK.default)(async()=>(await e.A(535723)).Tldraw,{loadableGenerated:{modules:[172953]},ssr:!1}),mJ=e=>{let{theme:t=mX.DefaultLightTheme}=e,i=(0,mq.getThemeCSSVars)(t),n=mU(t),a=(0,mY.getThemeKnobsV3)(t),r={fill:a.shapeFill,strokeWidth:a.shapeBorder};return(0,_.jsx)(L.Flex,{sx:{...i,"--tl-font-draw":"var(--body-font)",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)",...n,"--tl-text-outline":"transparent","--color-background":"var(--card-color)"},position:"relative",h:"100%",w:"100%",className:"highlight-mask",children:(0,_.jsx)(mQ,{...e,defaultStyles:r})})},m0=async e=>{let t=Array.from(e.getCurrentPageShapeIds()),i=await e.getSvg(t,{padding:8,scale:1});if(i)return console.debug("generated svg",i),i},m1=({isOpen:e,isEditable:t,onClose:i,isDrawingEditorActive:n,setDrawingEditorActive:a,editor:r,...o})=>{let{node:s,updateAttributes:l,getPos:d}=o,{assets:c,shapes:u}=s.attrs,p=(0,R.useAppSelector)(B.selectTheme),[h,m]=(0,j.useState)();(0,j.useEffect)(()=>{h&&(!h||!u||(Array.from(h.getCurrentPageShapeIds()).length>0?h.updateShapes(u):h.createShapes(u),c&&Array.isArray(c)&&h.updateAssets(c)))},[u,c,h]);let g=(0,j.useCallback)(e=>{m(e),window.tldrawEditor=e,e.user.updateUserPreferences({isDarkMode:(0,tT.isThemeDark)(p)}),setTimeout(()=>{e.zoomToFit()})},[p]),f=(0,j.useCallback)(async()=>{if(!h)return;let e=await m0(h);e?l({svg:e.outerHTML}):l({svg:null})},[h,l]),b=(0,sU.useTiptapEditorEventCallback)((e,t)=>{let{view:i}=e;if(!t)return;let n=d();if(n){let e=i.state.tr.setNodeAttribute(n,"shapes",t.getCurrentPageShapes());i.dispatch(e);let a=i.state.tr.setNodeAttribute(n,"assets",t.getAssets());i.dispatch(a)}}),x=(0,em.useDebounced)(b,500),y=(0,j.useRef)(document.getElementById("diagram-editor-portal")),v=(0,j.useCallback)(()=>{t&&f(),a(!1),i()},[i,f,a,t]);return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)(mZ.Drawer,{placement:"bottom",onClose:v,isOpen:e,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,portalProps:{containerRef:y},children:[(0,_.jsx)(mx.DrawerOverlay,{}),(0,_.jsxs)(mZ.DrawerContent,{dir:"ltr",borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&a(!0)},transition:{duration:.4},overflow:"hidden",children:[(0,_.jsx)(mm.DrawerBody,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:n?(0,_.jsx)(mJ,{onMount:g,onChange:t?()=>{x(h)}:void 0,orgId:r.gammaOrgId,theme:p}):(0,_.jsx)(L.Flex,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,_.jsx)(oR.Spinner,{size:"xl"})})}),(0,_.jsx)(mg.DrawerCloseButton,{zIndex:400,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})};var m2=e.i(15272);let m3=e=>{let{node:t,selected:i,editor:n,getPos:a,decorations:r,updateAttributes:l}=e,{width:d,meta:c,id:u,horizontalAlign:p,svg:h,shapes:m}=t.attrs,g=(0,R.useAppSelector)(B.selectContentEditable),f=(0,R.useAppSelector)(B.selectIsAllowedToEdit),b=(0,O.useEditorFocused)(),x=g&&b&&f,y=(0,R.useAppSelector)(B.selectExpandedDrawingId),v=!!y&&y===u,[C,w]=(0,j.useState)(!1),S=(0,R.useAppSelector)(B.selectTheme),k=(0,oO.useIsThemeDark)(),{ref:A,setIsResizing:E,resizeableSx:I}=(0,mc.useResizeable)(n),{contextMenuItems:M}=(({editor:e,node:t,getPos:i})=>{let{id:n}=t.attrs,a=(0,j.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.chain().deleteSelectionAndSelectNear().run())},[e,i]),r=(0,j.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,m$.setDrawingExpanded)(n,!0))},[e,i,n]),o=(0,lW.useEditorContextMenuItems)({editor:e,node:t,getPos:i});return{contextMenuItems:[{key:"diagram-options",title:(0,_.jsx)(eD.Trans,{message:"Diagram",id:"i+ShMB"})},{divider:!0},...o,{divider:!0},{key:"edit-diagram",label:(0,_.jsx)(eD.Trans,{message:"Edit diagram...",id:"SsJ/l2"}),icon:s.faEdit,onClick:r},{divider:!0},{key:"add-comment",label:(0,_.jsx)(eD.Trans,{message:"Add comment",id:"oFsfkI"}),icon:s.faComment,onClick:()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,m2.addImageComment)(e.state.selection))}},{divider:!0},{key:"align",label:(0,_.jsx)(eD.Trans,{message:"Align",id:"9ms+e0"}),icon:s.faAlignLeft,items:Z.AlignmentCommands.map(({name:t,key:i,icon:n,checkActive:a,apply:r})=>({key:i,check:a?.(e),icon:n,label:t(),onClick:()=>{r&&r(e)}}))},{divider:!0},{key:"delete",label:(0,_.jsx)(eD.Trans,{message:"Delete",id:"cnGeoo"}),icon:s.faTrash,onClick:a,color:"red.500"}]}})({editor:n,node:t,getPos:a}),{onOpenContextMenu:T}=(0,sM.useEditorContextMenu)({editor:n,contextMenuItems:M,getPos:a}),P=(0,j.useCallback)(()=>{(0,m$.setDrawingExpanded)(u,!0)},[u]),D=(0,j.useCallback)(()=>{let e=a();"number"==typeof e&&n.chain().setNodeSelection(e).focus().run()},[n,a]),N=(0,j.useCallback)(()=>{(0,m$.setDrawingExpanded)(null,!1)},[]),z=(0,sU.useTiptapEditorEventCallback)((e,i)=>{l({...t.attrs,...i})}),F=d||c?.width,H=!h,W=m&&m.length>0,U=(0,Z.getAlignStyles)(p),V=(0,er.useIsThumbnailView)();return(0,_.jsx)(rP.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,_.jsxs)(L.Flex,{dir:(0,Z.getAlignDirection)(r,p),w:"100%",className:md.MOVEABLE_WRAPPER_CLASSNAME,css:{...U,".pptx-exporting-image":{".textbox":{visibility:"hidden"}}},sx:I,direction:"column",_focusWithin:{shadow:"outline"},onContextMenu:T,children:[(0,_.jsxs)(eg.Box,{ref:A,className:"diagram",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:F?`calc(${F} * var(--font-size) / 16)`:"100%",maxW:"100%",h:"auto",maxH:mV,position:"relative",minH:H?"6em":"auto","data-drag-handle":!0,children:[x&&i&&(0,_.jsx)(mc.ResizableControls,{imageWrapperRef:A,setIsResizing:E,updateResizeAttrs:z,refreshDeps:[t.attrs]}),(0,_.jsx)(mG,{svg:h,theme:S}),x&&!v&&!H&&(0,_.jsx)(eg.Box,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:D,onDoubleClick:P}),H&&(0,_.jsxs)(eQ.VStack,{spacing:3,justify:"center",contentEditable:!1,color:k?sR.PH_COLOR.DARK_COLOR:sR.PH_COLOR.LIGHT_COLOR,h:"7em",backgroundColor:k?sR.PH_COLOR.DARK_BG:sR.PH_COLOR.LIGHT_BG,borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",onDoubleClick:g?P:void 0,children:[(0,_.jsx)(eJ.FontAwesomeIcon,{size:"2x",icon:o.faShapes}),g&&!V&&(0,_.jsx)(a7.Button,{size:"xs",onClick:P,fontFamily:"body",children:W?(0,_.jsx)(eD.Trans,{message:"Open diagram",id:"3IPx8n"}):(0,_.jsx)(eD.Trans,{message:"Open blank diagram",id:"trQ3Gx"})})]})]}),v&&!V&&(0,_.jsx)(m1,{...e,isOpen:v,isEditable:g,onClose:N,isDrawingEditorActive:C,setDrawingEditorActive:w})]})})},m5=(0,tl.createTiptapNode)("diagram",{selectable:!0,draggable:!0,parseHTML:()=>[{tag:"div[class=diagram]",getAttrs:e=>({id:(0,tl.parseIdAttr)(e,m6),shapes:(0,tl.parseJSONAttr)(e,"shapes")??null,assets:(0,tl.parseJSONAttr)(e,"assets")??{},meta:(0,tl.parseJSONAttr)(e,"meta")??{},width:Number(e.getAttribute("data-width"))||null,svg:e.getAttribute("data-svg")||null,...(0,tl.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"diagram","data-id":e.attrs.id,...(0,tl.renderJSONAttrs)(e.attrs,"shapes","assets","meta"),...null!=e.attrs.width&&{"data-width":String(e.attrs.width)},...e.attrs.svg&&{"data-svg":e.attrs.svg},...(0,tl.renderHorizontalAlign)(e.attrs)})],addCommands(){let e=this.name;return{editSelectedDiagramBlock:()=>({state:t})=>{let i=(t=>{let{selection:i}=t;return i instanceof ea.NodeSelection&&i.node.type.name===e?i.node:void 0})(t);return i&&(0,R.getStore)().dispatch((0,B.setExpandedDrawingId)({drawingId:i.attrs.id})),!0}}},addExtensions:()=>[m9],addNodeView:()=>(0,rL.ReactNodeViewRenderer)(m3,{update:rj.attrsOrDecorationsChanged})}),m4=new ea.PluginKey("UniqueMediaId"),m6=()=>(0,rx.nanoid)(5),m9=rv.UniqueAttribute.extend({name:"UniqueDiagramId"}).configure({attributeName:"id",types:["diagram"],initialValue:m6,filterTransaction:ry.isLocalTransaction,pluginKey:m4});var m8=e.i(596523);let m7=()=>(0,_.jsx)(eH.NodeViewWrapper,{as:"div",children:(0,_.jsx)(eg.Box,{contentEditable:!1,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,"data-drag-handle":!0,"data-content-reference":!0,py:"0.25em",position:"relative",children:(0,_.jsx)(eg.Box,{as:"hr","aria-orientation":"horizontal",width:"100%",height:"0.075em",backgroundColor:"var(--body-color-muted)",border:"none"})})});e.s(["DividerView",0,m7],427387);let ge=/^(---|___|—-)/,gt=(0,tl.createTiptapNode)("divider",{selectable:!0,draggable:!0,parseHTML:()=>[{tag:'hr[class="divider"]'}],renderHTML:({HTMLAttributes:e})=>["hr",(0,ei.mergeAttributes)(e,{class:"divider"})],addNodeView:()=>(0,rL.ReactNodeViewRenderer)(m7),addInputRules(){return[(0,m8.blockInputRule)({find:ge,type:this.type})]}});e.s(["Divider",0,gt],602563);var gi=e.i(350461),gn=e.i(28561);e.i(420945);var ga=e.i(949488);e.i(312434);var gr=e.i(487914),go=e.i(271047),gs=e.i(672887),gl=e.i(770127);let gd=(0,j.memo)(({theme:e,id:t})=>{let i=(0,tT.isThemeDark)(e);return(0,_.jsx)(_.Fragment,{children:(0,_.jsxs)("filter",{id:t||"soft3d-small-inner-shadow",children:[(0,_.jsx)("feFlood",{floodColor:i?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",result:"flood1"}),(0,_.jsx)("feComposite",{operator:"out",in2:"SourceGraphic",in:"flood1",result:"composite1"}),(0,_.jsx)("feMorphology",{operator:"dilate",radius:.5,in:"composite1",result:"morphology1"}),(0,_.jsx)("feGaussianBlur",{stdDeviation:1.5,in:"morphology1",result:"blur1"}),(0,_.jsx)("feOffset",{dx:2,dy:2,in:"blur1",result:"offset1"}),(0,_.jsx)("feFlood",{floodColor:i?"rgba(255, 255, 255, 0.1)":"rgba(255, 255, 255, 0.75)",result:"flood2"}),(0,_.jsx)("feComposite",{operator:"out",in2:"SourceGraphic",in:"flood2",result:"composite2"}),(0,_.jsx)("feMorphology",{operator:"dilate",radius:.5,in:"composite2",result:"morphology2"}),(0,_.jsx)("feGaussianBlur",{stdDeviation:1.5,in:"morphology2",result:"blur2"}),(0,_.jsx)("feOffset",{dx:-2,dy:-2,in:"blur2",result:"offset2"}),(0,_.jsxs)("feMerge",{children:[(0,_.jsx)("feMergeNode",{in:"offset1"}),(0,_.jsx)("feMergeNode",{in:"offset2"})]}),(0,_.jsx)("feComposite",{operator:"atop",in2:"SourceGraphic"})]})})});gd.displayName="Soft3DSmallOuterShadow";let gc=(0,j.memo)(({theme:e})=>{let t=(0,mq.getThemeCSSVars)(e),i=(0,tT.getThemeBodyColor)(e),n=(0,tT.getThemePrimaryAccentColor)(e);return(0,_.jsx)(eg.Box,{as:"svg",width:"0",height:"0",sx:t,children:(0,_.jsxs)("defs",{children:[(0,_.jsx)(gu,{theme:e}),(0,_.jsx)(gu,{theme:e,rtl:!0}),(0,_.jsx)(gp,{theme:e}),(0,_.jsx)(gp,{theme:e,rtl:!0}),(0,_.jsx)(gm,{color:(0,tT.getThemeColorSolid)(n),id:"theme-accent-color-fill"}),(0,_.jsx)(gm,{color:(0,tT.getThemeColorSolid)(i),id:"theme-body-color-fill"}),(0,_.jsx)(gg,{theme:e})]})})});gc.displayName="ThemeSVGDefs";let gu=(0,j.memo)(({theme:e,rtl:t})=>{let i=(0,tT.getThemePrimaryAccentColor)(e);return"linear-gradient"!==i.type?null:(0,_.jsx)(gh,{gradient:i,id:t?"theme-accent-gradient-linear-rtl":"theme-accent-gradient-linear",rtl:t})});gu.displayName="ThemeAccentGradientLinearDef";let gp=(0,j.memo)(({theme:e,rtl:t})=>{let i=(0,tT.getThemePrimaryAccentColor)(e),n=(0,mY.getThemeKnobsV3)(e);if("linear-gradient"!==i.type)return null;let a=(0,tT.isThemeDark)(e),r=(0,tT.getThemeCardColorSolid)(e),o="semi"===n.shapeFill?(0,gl.blendedGradient)(i,r,.5):i,s=(0,gl.lightenedGradient)(o,a?.25:.9);return s?(0,_.jsx)(gh,{gradient:s,id:t?"theme-accent-background-gradient-linear-rtl":"theme-accent-background-gradient-linear",rtl:t}):null});gp.displayName="ThemeAccentBackgroundGradientLinearDef";let gh=(0,j.memo)(({gradient:e,id:t,rtl:i})=>{let n=(i?180-e.angle:e.angle)*Math.PI/180,a=50+50*Math.cos(n+Math.PI),r=50+50*Math.sin(n+Math.PI),o=50+50*Math.cos(n),s=50+50*Math.sin(n);return(0,_.jsx)("linearGradient",{id:t,x1:`${a}%`,y1:`${r}%`,x2:`${o}%`,y2:`${s}%`,children:e.stops.map(({color:e,position:t},i)=>(0,_.jsx)("stop",{offset:`${t}%`,stopColor:e},i))})});gh.displayName="LinearGradientDef";let gm=(0,j.memo)(({color:e,id:t})=>e?(0,_.jsxs)("filter",{id:t,children:[(0,_.jsx)("feFlood",{floodColor:e,result:"flood"}),(0,_.jsx)("feComposite",{in:"flood",in2:"SourceAlpha",operator:"in"})]}):null);gm.displayName="ColorFillDef";let gg=(0,j.memo)(({theme:e})=>{let t=(0,mY.getThemeKnobsV3)(e);return(0,_.jsx)(_.Fragment,{children:"soft3d"===t.shapeShadow&&(0,_.jsx)(gd,{theme:e,id:"theme-shape-shadow"})})});gg.displayName="ThemesV3SVGDefs";let gf=()=>(0,O.useShouldRenderMobileVersion)()?1:1.125;e.s(["useViewportScaleFactor",0,gf],967233),e.i(578014);var gb=e.i(612904),gx=e.i(645315),gy=e.i(641295),gv=e.i(428624);let gC=()=>{let e=(0,R.useAppSelector)(B.selectBackground),t=(0,R.useAppSelector)(B.selectTheme),i=(0,oO.useIsThemeDark)(),n=(0,lP.getDocOrThemeBackground)(t,e);return(0,lP.isBackgroundDark)(n)??i},gw=()=>{let e=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW,{src:t,width:i,height:n,paddingY:a,paddingX:r}=gM();if(!t)return null;let o=(0,eK.resizeAndProxyImageUrl)(t,eK.LOGO_RESIZE_PARAMS),s=e?{position:"absolute",right:`${r}px`,top:`${a}px`,justify:"end",align:"start",width:`${i}px`,height:`${n}px`}:{position:"sticky",left:`${r}px`,top:`calc(100% - ${n}px - ${a}px)`,justify:"start",width:`${i}px`,height:`${n}px`};return(0,_.jsx)(L.Flex,{...s,className:"logo",zIndex:gv.DOC_Z_INDEXES.customerLogo,borderRadius:"md",contentEditable:!1,userSelect:"none",children:(0,_.jsx)(eX.Image,{src:o,maxH:"100%",maxW:"100%",transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none","data-testid":"customer-logo","data-customer-logo-image":!0,objectFit:"contain",objectPosition:e?"top right":"bottom left"})})},gS=()=>{let e=(0,R.useAppSelector)(B.selectTheme),t=gC(),{src:i,width:n,height:a}=gk({theme:e,targetArea:gI,mode:(0,P.useFeatureFlag)("lightDarkLogos")?t?"dark":"light":void 0});if(!i)return null;let r=(0,eK.resizeAndProxyImageUrl)(i,eK.LOGO_RESIZE_PARAMS);return(0,_.jsx)(L.Flex,{w:"100%",justify:"center",align:"center",mt:6,mb:8,"data-id":"customer-logo-wrapper",children:(0,_.jsx)(eX.Image,{src:r,w:`${n}px`,zIndex:gv.DOC_Z_INDEXES.customerLogo,h:`${a}px`,transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none",objectFit:"contain",objectPosition:"bottom"})})},gk=({theme:e,mode:t,targetArea:i=g_})=>{let n=1,a=e.logoUrl,{logoImage:r}=(0,mY.getThemeLogoImageAndSrc)(e,{mode:t,fallbackToDefault:!0});if(r&&r.meta&&(n=(0,I.default)(r.meta.aspect_ratio||r.meta.width/r.meta.height,.5,3),a=r.src??a),!a)return{width:0,height:0,paddingY:0,paddingX:0};let o=Math.sqrt(i/n),s=i>8e3?30:i>5e3?24:18;return{width:Math.round(o*n),height:Math.round(o),paddingY:s,paddingX:s,src:a}},gA={base:900,lg:2500,xl:4900,"2xl":8100,"3xl":1e4},gE={base:1600,md:2500,lg:4225,xl:7225,"2xl":9025,"4xl":12100},g_=4900,gI=5625,gM=()=>{let e=(0,R.useAppSelector)(B.selectMode)===r6.EditorModeEnum.SLIDE_VIEW,t=(0,gy.useBreakpointValue)(e?gE:gA),i=eZ.isPdfExport?g_:eZ.isPptExport?8100:t,n=(0,R.useAppSelector)(B.selectTheme),a=(0,O.useShouldRenderMobileVersion)(),r=(0,P.useFeatureFlag)("lightDarkLogos"),o=gC();return{...gk({theme:n,mode:r?o?"dark":"light":void 0,targetArea:i}),position:e?"top-right":a?"bottom":"bottom-left"}},gT=(0,eO.motion)(eg.Box),gL=({editor:e,node:t,updateAttributes:i})=>{let n,a,r,o,s,l=(0,ga.useSelector)(B.selectMode),d=(0,R.useAppSelector)(B.selectEditable),c=(0,ga.useSelector)(B.selectIsAnyCommentOpen),u=(0,ga.useSelector)(B.selectPresentingCardId),p=(0,R.useAppSelector)(B.selectTheme),h=l===r6.EditorModeEnum.SLIDE_VIEW,m=(0,R.useAppSelector)(t=>{if((0,B.selectMode)(t)!==r6.EditorModeEnum.SLIDE_VIEW)return null;let i=(0,B.selectLocalCollaboratorSpotlight)(t);if(!i||!i?.cardId)return null;let[n]=(0,ei.findChildren)(e.state.doc,e=>(0,o4.isCardNode)(e)&&e.attrs.id===i.cardId);if(!n)return console.warn(`[usePresentingCardBackground] Unexpectedly couldnt find presentingCard ${i.cardId}`),null;let a=(0,rk.findParentNodes)(e.state.doc.resolve(n.pos+1),e=>(0,o4.isCardNode)(e)&&e.attrs.background&&!e.attrs.background.inside).pop();return a?a.node.attrs.background:(console.warn(`[usePresentingCardBackground] Unexpectedly couldnt find card at pos ${n.pos}`),null)},oY.default),{background:g}=t.attrs,f=(0,O.useShouldRenderMobileVersion)(),b=gf(),[x,y]=(n=!!(h&&u),a=!!(h&&!u),r=!!(!h&&u),o=!!(!h&&!u),s=(0,j.useRef)(n),(0,j.useEffect)(()=>{s.current=n},[n,o]),[a||r?s.current:n,n]);(0,et.useTiptapEditorEffect)(e=>{!t.attrs.docId&&e.gammaDocId&&i({...t.attrs,docId:e.gammaDocId})},[t.attrs,i]);let v=(0,er.useIsThumbnailView)(),C=(0,gs.getThemeStylesheet)(p,d),w=(0,tT.isThemeDark)(p),S=(0,lP.getDocOrThemeBackground)(p,g),k=(0,lP.getBackgroundProps)(S,w,v?eK.THUMBNAIL_RESIZE_JPG_PARAMS:void 0),A=(0,lP.getBackgroundProps)(h&&m&&m.type!==o2.BackgroundType.NONE?m:S,w,v?eK.THUMBNAIL_RESIZE_JPG_PARAMS:void 0);console.debug("%c[DocComponent] Doc is rerendering","background-color: chartreuse",{isPresentModeReady:y,isPresentModeReadyLagging:x,presentingCardId:u});let E=gM(),I={width:"100%",'[data-animate-value="doc"]':{display:x?"none":void 0},...E.src&&h?{"--logo-push-x":`${E.width+2*E.paddingX}px`,"--logo-push-y":`${E.height+2*E.paddingY}px`}:void 0},M=(0,sU.useTiptapEditorEventCallback)((e,t)=>{let i=t.target;return!(!e.view.dom.contains(i)||i.closest(`.${st.CARD_BODY_CLASS}`)&&!i.getAttribute("data-outside-card-body"))&&(e.state.selection instanceof ea.NodeSelection&&(0,gb.isMathNode)(e.state.selection.node)?e.chain().focus(e.state.selection.from).blur().run():e.commands.blur(),!0)});(0,j.useEffect)(()=>gr.keyboardHandler.on("keydown","DOC_BLUR",t=>!!(0,gn.default)("Esc")(t)&&!!e.isFocused&&(e.commands.blur(),t.preventDefault(),!0)),[e]);let T=(0,O.useCanWithSelectFile)("comment"),D=((e=!0)=>{let{cardMarginSettings:t}=(0,R.useAppSelector)(B.selectDocSettingsWithDefaults),i=(0,ll.hasThemeLogoCardMarginElement)(t);return e&&i})(!f),N=!f&&!h&&!D,z=(0,P.useFeatureFlag)("insertWidgetBottom")?gx.DOCUMENT_BOTTOM_PADDING_INSERT_WIDGET_BOTTOM:gx.DOCUMENT_BOTTOM_PADDING_DEFAULT;return(0,_.jsxs)(eH.NodeViewWrapper,{as:"div","data-testid":"doc-node-root",style:{height:"100%"},children:[(0,_.jsx)(go.ThemeFontLoader,{theme:p}),(0,_.jsx)(gc,{theme:p}),(0,_.jsx)(eg.Box,{onMouseDown:M,h:"100%",children:(0,_.jsxs)(L.Flex,{className:"doc-content-wrapper",direction:"column",align:"center",pos:"relative",pb:f||h||!T?"0px":c?gx.DOCUMENT_BOTTOM_PADDING_COMMENT_OPEN:z,sx:C,onDragOver:e3.preventDefaultToAllowDrop,minH:gi.default.env.STORYBOOK?"auto":"calc(var(--100vh) - var(--editor-padding-top, 0px))",children:[(0,_.jsx)(gj,{...k,visibility:y?"hidden":"visible",transitionProperty:"visibility",transitionDuration:"0s",transitionDelay:!eZ.isPuppeteer&&y?`${st.BETWEEN_CARD_TRANSITION_TIME}ms`:"0s"}),N&&(0,_.jsx)(L.Flex,{alignSelf:"start",pos:"absolute",inset:"0",h:"100%",children:(0,_.jsx)(gw,{})}),(0,_.jsx)(eR.AnimatePresence,{children:(0,_.jsx)(gT,{className:"motion-present-mode-bg","data-doc-background-element-present-mode":!0,"data-export-master":!0,position:"fixed",zIndex:gv.DOC_Z_INDEXES.presentBg,top:0,left:0,right:0,h:"100%",initial:{opacity:0},animate:{opacity:1},exit:{opacity:1},visibility:y?"visible":"hidden",transition:st.BETWEEN_CARDS_FRAMER_TRANSITION,css:eZ.isPuppeteer?void 0:{scrollbarGutter:"stable",overflow:"scroll"},...A},"presenting-background-"+u)}),(0,_.jsx)(L.Flex,{sx:I,justify:"center",className:(0,G.cx)("document-content",h?"is-present-mode":"is-doc-mode"),css:{"--viewport-scale-factor":`${b}`},pt:"var(--doc-padding-top)",children:(0,_.jsx)(eW.NodeViewContent,{style:{width:"100%"}})}),f&&(0,_.jsx)(gS,{})]})})]})},gj=e=>{let t=(0,O.useShouldRenderMobileVersion)(),i=(0,eU.isMobileOrTabletDevice)()||t,n=(0,eU.isMobileOrTabletDevice)()?{style:{touchAction:"none",display:"contents"}}:{};return(0,_.jsx)(L.Flex,{"data-doc-background-element":!0,position:"absolute",w:"var(--editor-width)",h:"100%",contentEditable:!1,userSelect:"none",clipPath:"inset(0)",top:0,left:0,...n,children:(0,_.jsx)(eg.Box,{"data-testid":"doc-background",width:"100%",height:"100%",position:"fixed",...i?{top:"0px"}:{},...e})})};function gP({mutation:e}){let t=e.target instanceof HTMLElement?e.target:e.target.parentElement,i="selection"!==e.type&&gR(t);return console.debug("[Document.ignoreMutation] isMutationOutsideDocContent:",i),!!i}e.s(["Doc",0,gL],266663);let gD=(0,tl.createTiptapNode)("doc",{topNode:!0}),gN=(0,tl.createTiptapNode)("document",{isolating:!0,defining:!0,selectable:!1,addCommands:()=>({updateDocumentSettings:e=>({commands:t})=>t.updateNestedAttributesAtPos(0,{settings:e})}),addNodeView:()=>(0,rL.ReactNodeViewRenderer)(gL,{update:rj.attrsOrDecorationsChanged,ignoreMutation:gP}),parseHTML:()=>[{tag:"div[class=gamma-doc]",getAttrs:e=>({...(0,tl.parseJSONAttr)(e,"aiOptions")?{aiOptions:(0,tl.parseJSONAttr)(e,"aiOptions")}:{},...(0,tl.parseJSONAttr)(e,"background")?{background:(0,tl.parseJSONAttr)(e,"background")}:{},...(0,tl.parseJSONAttr)(e,"docFlags")?{docFlags:(0,tl.parseJSONAttr)(e,"docFlags")}:{},...(0,tl.parseJSONAttr)(e,"customCode")?{customCode:(0,tl.parseJSONAttr)(e,"customCode")}:{},...(0,tl.parseJSONAttr)(e,"settings")?{settings:(0,tl.parseJSONAttr)(e,"settings")}:{},...(0,tl.parseJSONAttr)(e,"generateInfo")?{generateInfo:(0,tl.parseJSONAttr)(e,"generateInfo")}:{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,ei.mergeAttributes)(t,{class:"gamma-doc"},(0,tl.renderJSONAttrs)(e.attrs,"aiOptions","background","docFlags","customCode","settings","generateInfo")),0]}),gR=e=>{let t=e?.parentElement;return!!t&&!t.closest(".document-content")};e.s(["DocRoot",0,gD,"Document",0,gN,"documentIgnoreMutation",0,gP],211917);let gO=e.i(662752).PROXIMITY_THRESHOLD,gB=(e,t)=>{let i=e.nodeDOM(t),n=i?.querySelector("[data-grid-item]");return n?.getBoundingClientRect()||null};function gz(e,t,i){let n=e.posAtCoords({left:t,top:i})?.inside;if(!n||-1===n)return null;let{doc:a}=e.state,r=a.resolve(n),o=a.nodeAt(n),s=o&&"gridItem"===o.type.name?{node:o,pos:n}:(0,ei.findParentNodeClosestToPos)(r,e=>"gridItem"===e.type.name);if(!s)return null;let l=(0,ei.findParentNodeClosestToPos)(r,e=>"grid"===e.type.name);if(!l)return null;let d=gB(e,s.pos);return d?{node:s.node,pos:s.pos,rect:d,parentGrid:l.node,parentGridPos:l.pos}:null}function gF(e,t){return e.parentGridPos===t.parentGridPos}function gH(e,t,i,n,a){let r="horizontal"===a?Math.abs(i.clientX-(e.rect.left+e.rect.width/2)):Math.abs(i.clientY-(e.rect.top+e.rect.height/2)),o="horizontal"===a?Math.abs(i.clientX-(t.rect.left+t.rect.width/2)):Math.abs(i.clientY-(t.rect.top+t.rect.height/2)),s=r{if(!i||i.content.firstChild?.type.name!=="gridItem")return null;let n=gz(e,t.clientX-gO,t.clientY),a=gz(e,t.clientX+gO,t.clientY),r=gz(e,t.clientX,t.clientY-gO),o=gz(e,t.clientX,t.clientY+gO);return n&&a&&gF(n,a)&&gU(n,"horizontal")?gH(n,a,t,e,"horizontal"):r&&o&&gF(r,o)&&gU(r,"vertical")?gH(r,o,t,e,"vertical"):n&&!a&&gU(n,"horizontal")?gW(n,t,e,"right"):a&&!n&&gU(a,"horizontal")?gW(a,t,e,"left"):r&&!o&&gU(r,"vertical")?gW(r,t,e,"bottom"):o&&!r&&gU(o,"vertical")?gW(o,t,e,"top"):null},"getGridItemRect",0,gB],640901)},375231,692625,900870,152232,821502,716700,155069,865320,136715,508883,768331,783538,796350,668525,559420,758412,504671,482337,534635,898178,63435,275144,705956,178079,878132,84594,821988,965140,557683,e=>{"use strict";e.s(["DropCursor",()=>f],375231);var t=e.i(408122),i=e.i(755453),n=e.i(131254),a=e.i(175863),r=e.i(337840),o=e.i(647031),s=e.i(640901),l=e.i(321071),d=e.i(622758),c=e.i(15272),u=e.i(311524),p=e.i(45954),h=e.i(591378),m=e.i(713293);class g{editorView;width;color;class;cursor=null;element=null;timeout=null;handlers;constructor(e,t){this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let i=e=>this[t](e);return e.dom.addEventListener(t,i),{name:t,handler:i}}),this.dragover=(0,n.default)(this.dragover,100,{trailing:!1}).bind(this)}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursor&&t.doc!=e.state.doc&&(this.cursor.pos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){((e?.pos||null)!=this.cursor?.pos||e?.type!=this.cursor?.type||e?.side!=this.cursor?.side)&&(this.cursor=e,null==e?(this.element?.parentNode?.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,i;if(null==this.cursor||!this.editorView)return;let n=this.editorView.state.doc.resolve(this.cursor.pos),a,r=()=>"";if("replaceImage"===this.cursor.type)a=this.cursor.rect,r=()=>t.i18n._({id:"8OLLt2",message:"Drop to replace image"});else if("gallery"==this.cursor.type&&this.cursor.node?.type.name!=="gallery")a=this.cursor.rect,r=()=>t.i18n._({id:"pl+vw2",message:"Drop to make a gallery"});else if("blankRect"==this.cursor.type)a=this.cursor.rect,r=()=>"";else if("smartLayoutVariant"==this.cursor.type)a=this.cursor.rect,r=()=>t.i18n._({id:"hErHGD",message:"Drop to change layout"});else if("column"==this.cursor.type||"gallery"==this.cursor.type||"smartLayout"==this.cursor.type||"tableColumn"==this.cursor.type||"gridItem"==this.cursor.type){let e=this.cursor.rect;if(!e)return;if("tableColumn"===this.cursor.type){let i="right"==this.cursor.side?e.right:e.left;a={top:e.top,bottom:e.bottom,left:i-this.width/2,right:i+this.width/2},r=()=>t.i18n._({id:"6dfyH3",message:"Drop to reorder column"})}else if("gridItem"===this.cursor.type){let e=this.cursor.rect;if(!e)return;if("top"===this.cursor.side||"bottom"===this.cursor.side){let t="top"===this.cursor.side?e.top:e.bottom;a={left:e.left,right:e.right,top:t-2,bottom:t+2}}else{let t="left"===this.cursor.side?e.left:e.right;a={top:e.top,bottom:e.bottom,left:t-2,right:t+2}}}else{let t="right"==this.cursor.side||"bottom"==this.cursor.side,i=t?n.nodeAfter:n.nodeBefore,r=i&&((0,d.isLayoutCellNode)(i)||(0,p.isSmartLayoutCellNode)(i))?0:this.width;if("right"==this.cursor.side||"left"==this.cursor.side){let i=t?e.right+r:e.left-r;a={top:e.top,bottom:e.bottom,left:i-this.width/2,right:i+this.width/2}}else{let i=t?e.bottom+r:e.top-r;a={left:e.left,right:e.right,top:i-this.width/2,bottom:i+this.width/2}}}}else if(!n.parent.inlineContent){let e=n.nodeBefore,t=n.nodeAfter;if(e||t){let i=this.editorView.nodeDOM(this.cursor.pos-(e?e.nodeSize:0));if(!i||!(i instanceof Element))return;let n=i.getBoundingClientRect(),r=e?n.bottom:n.top;e&&t&&(r=(r+this.editorView.nodeDOM(this.cursor.pos).getBoundingClientRect().top)/2),a={left:n.left,right:n.right,top:r-this.width/2,bottom:r+this.width/2}}}if(!a){let e=this.editorView.coordsAtPos(this.cursor.pos);a={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let o=this.editorView.dom.offsetParent;if(this.element||(this.element=o.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),o&&(o!=document.body||"static"!=getComputedStyle(o).position)){let t=o.getBoundingClientRect();e=t.left-o.scrollLeft,i=t.top-o.scrollTop}else e=-pageXOffset,i=-pageYOffset;this.element.style.left=a.left-e+"px",this.element.style.top=a.top-i+"px",this.element.style.width=a.right-a.left+"px",this.element.style.height=a.bottom-a.top+"px",this.element.dataset.type=this.cursor.type;let s=r();this.element.innerHTML="tableColumn"===this.cursor.type?"":s,this.element.dataset.message=s}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}checkTableColumnDragEvent(e){if(e.dataTransfer?.types.includes("text/x-column-index")){let t=((e,t)=>{let i;if(!t.dataTransfer?.types.includes("text/x-column-index"))return null;let n=t.target;if(!n||!(n instanceof HTMLElement))return null;let a=n.closest("th.table-col-control");if(!a)return null;let r=a.getBoundingClientRect(),o=a.closest("table"),s=o?.getBoundingClientRect()||r,l=new DOMRect(r.left,s.top,r.width,s.height),d=.15*r.width,c=r.left+d,u=r.right-d;i=!(t.clientXu||t.clientX>r.left+r.width/2);let p=a.querySelector("[data-test-column-control]");return{pos:0,side:i?"right":"left",rect:l,colNumber:p?parseInt(p.getAttribute("data-test-column-control")||"0",10):0,tableNode:null}})(this.editorView,e);return t?(this.setCursor({...t,type:"tableColumn"}),this.scheduleRemoval(5e3)):this.setCursor(null),!0}return!1}dragover(e){if(!this.editorView.editable||this.checkTableColumnDragEvent(e))return;let t=(0,s.checkGridItemDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(t){this.setCursor({...t,type:"gridItem"}),this.scheduleRemoval(5e3);return}let i=(0,r.checkCardAccentDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(i){this.setCursor({...i,type:"blankRect"}),this.scheduleRemoval(5e3);return}let n=(0,h.checkSmartLayoutImageDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(n){this.setCursor({...n,type:"blankRect"}),this.scheduleRemoval(5e3);return}if((0,l.checkMediaDropTarget)(this.editorView,e,this.editorView.dragging?.slice))return void this.scheduleRemoval(20);let a=(0,u.checkImageReplacementDropTarget)(this.editorView,e,this.editorView.dragging?.slice,this.editorView.dragging?.operation||"insert");if(a)return void this.setCursor({type:"replaceImage",pos:a.pos,rect:a.rect,node:a.node});let p=(0,c.checkGalleryDropTarget)(this.editorView,e,this.editorView.dragging?.slice,!this.editorView.dragging);if(p){this.setCursor({...p,type:"gallery"}),this.scheduleRemoval(5e3);return}let g=(0,d.checkColumnDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(g){this.setCursor({...g,type:"column"}),this.scheduleRemoval(5e3);return}let f=(0,r.checkCreateCardAccentDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(f){this.setCursor({...f,type:"blankRect"}),this.scheduleRemoval(5e3);return}let b=(0,h.checkSmartLayoutVariantDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(b){this.setCursor({...b,type:"smartLayoutVariant"}),this.scheduleRemoval(5e3);return}let x=(0,h.checkSmartLayoutDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(x){this.setCursor({...x,type:"smartLayout"}),this.scheduleRemoval(5e3);return}let y=(0,o.checkBetweenCardsDropTarget)(this.editorView,e,this.editorView.dragging?.slice);if(y){this.setCursor({pos:y.pos,type:"default"}),this.scheduleRemoval(5e3);return}let v=(0,m.getDropPos)(this.editorView,e,this.editorView.dragging?.slice);null===v?this.setCursor(null):(this.setCursor({pos:v,type:"default"}),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}let f=i.Extension.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[function(e={}){return new a.Plugin({key:new a.PluginKey("dropCursor"),view:t=>new g(t,e)})}(this.options)]}}).configure({color:"var(--chakra-ring-color)",width:3,class:"ProseMirror-dropcursor"});e.s(["Drawing",()=>e3],900870);var b=e.i(353653),x=e.i(418755);e.i(566358);var y=e.i(907648);e.i(838054);var v=e.i(408767),C=e.i(551880),w=e.i(555999),S=e.i(767730),k=e.i(577281);e.s(["DrawingView",()=>e0],692625);var A=e.i(391398),E=e.i(428683),_=e.i(969641),I=e.i(613616),M=e.i(654656),T=e.i(524473),L=e.i(541075),j=e.i(198311),P=e.i(191788),D=e.i(572383),N=e.i(136484);let R=e=>`${e} !important`,O=e=>({fontFamily:R(e)}),B=e=>{let t={"[data-shape=image]":{".tl-inner-div":{}},img:{'&[src^="blob:"]':{animation:"loading-pulse-animation 1.5s infinite"}}},i=Object.values(b.ColorStyle),n=e?"dark":"light";return i.forEach(e=>{t[`[data-color="${e}"]`]={color:R(b.shapesShared.strokes[n][e]),":not(mask) > [fill], &[fill]":{"&:not([fill=none])":{fill:R(b.shapesShared.fills[n][e]),"text, tspan":{fill:R(b.shapesShared.strokes[n][e])}}},"[stroke]":{"&:not([stroke=none])":{stroke:R(b.shapesShared.strokes[n][e])}}}}),t},z=({svg:e,isDark:t,font:i})=>{let n=(0,P.useMemo)(()=>B(t),[t]),a=(0,P.useMemo)(()=>O(i),[i]),r=(0,P.useMemo)(()=>({__html:e??""}),[e]);return e?(0,A.jsx)(E.Box,{dangerouslySetInnerHTML:r,"data-testid":"drawing-svg",sx:{svg:{width:"100%",height:"auto",text:a,...n}}}):null};var F=e.i(914911),H=e.i(194552),W=e.i(864935),U=e.i(685290),V=e.i(529545),G=e.i(147349);e.i(828525);var $=e.i(37026),Z=e.i(387451),K=e.i(96953),q=e.i(285256),Y=e.i(455902),X=e.i(707065);e.i(615835);var Q=e.i(25747),J=e.i(335799),ee=e.i(555145),et=e.i(306841),ei=e.i(882255),en=e.i(50034),ea=e.i(500425);let er=P.createContext({});function eo(){return P.useContext(er)}var es=e.i(344233),el=e.i(641099),ed=e.i(843946),ec=e.i(358280);let eu={src:e.i(387767).default,width:500,height:500,blurWidth:8,blurHeight:8,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAIAAABLbSncAAAALUlEQVR42pWNwQkAAAgC3X/NbI+EIPr48HMciIoqki2urIs4+7EI28in8g/XGMPmquHKvrM+AAAAAElFTkSuQmCC"},ep={[b.ColorStyle.White]:"#f0f1f3",[b.ColorStyle.Gray]:"#788492",[b.ColorStyle.Green]:"#36b24d",[b.ColorStyle.Blue]:"#1c7ed6",[b.ColorStyle.Violet]:"#7746f1",[b.ColorStyle.Red]:"#ff2133",[b.ColorStyle.Orange]:"#ff9433",[b.ColorStyle.Yellow]:"#ffc936"},eh=e=>e.appState.currentStyle,em=e=>e.document.pageStates[e.appState.currentPageId].selectedIds,eg=e=>e.settings.isDarkMode?"dark":"light",ef=({style:e,colorMode:t})=>(0,A.jsx)(E.Box,{backgroundColor:e.isFilled?b.shapesShared.fills[t][e.color]:void 0,backgroundImage:e.isFilled?void 0:eu.src,backgroundSize:"4em",borderColor:b.shapesShared.strokes[t][e.color],borderWidth:"2px",h:"1em",w:"1em",borderRadius:"md"}),eb=Object.keys(b.shapesShared.defaultTextStyle),ex=(e,t)=>{let{page:i}=e,n={};if(t.length<=0)return{};{let e=new Set([]);t.map(e=>i.shapes[e]).forEach(t=>{eb.forEach(i=>{if(!e.has(i))if(void 0===n[i])n[i]=t.style[i];else{if(n[i]===t.style[i])return;e.add(i)}})}),e.forEach(e=>{delete n[e]})}return n},ey=()=>{let e=eo(),t=e.useStore(eg),i=e.useStore(eh),n=e.useStore(em),a=ex(e,n),r={...i,...a};return(0,A.jsxs)(et.Popover,{trigger:"hover",children:[(0,A.jsx)(en.PopoverTrigger,{children:(0,A.jsx)(es.IconButton,{icon:(0,A.jsx)(ef,{style:r,colorMode:t}),variant:"ghost",size:"sm","aria-label":""})}),(0,A.jsx)(ei.PopoverContent,{w:"fit-content",bg:"#F9FAFBFA",p:4,children:(0,A.jsxs)(M.VStack,{spacing:2,align:"flex-start",children:[(0,A.jsx)(ed.FormLabel,{children:(0,A.jsx)(ec.Trans,{message:"Fill",id:"TuM2Yu"})}),(0,A.jsx)(el.SimpleGrid,{columns:2,spacing:2,children:[!0,!1].map(i=>(0,A.jsx)(_.Button,{leftIcon:(0,A.jsx)(ef,{style:{...r,isFilled:i},colorMode:t}),variant:"ghost",size:"sm",isActive:r.isFilled===i,onClick:()=>e.style({isFilled:i}),children:i?(0,A.jsx)(ec.Trans,{message:"Solid",id:"5bi1la"}):(0,A.jsx)(ec.Trans,{message:"Outline",id:"dD7NPy"})},i?"fill":"outline"))}),(0,A.jsx)(ed.FormLabel,{children:(0,A.jsx)(ec.Trans,{message:"Colors",id:"1HfW/F"})}),(0,A.jsx)(el.SimpleGrid,{columns:4,spacing:2,w:"100%",children:Object.entries(b.ColorStyle).map(([i,n])=>ep[n]?(0,A.jsx)(es.IconButton,{icon:(0,A.jsx)(ef,{style:{...r,color:n},colorMode:t}),variant:"ghost",size:"md","aria-label":i,isActive:r.color===n,onClick:()=>e.style({color:n})},n):null)})]})})]})};var ev=e.i(216912),eC=e.i(896620);let ew=(0,ev.forwardRef)(({label:e,icon:t,tooltipPlacement:i="top",...n},a)=>(0,A.jsx)(eC.GammaTooltip,{placement:i,label:e,isDisabled:!e,children:(0,A.jsx)(es.IconButton,{"aria-label":e||"",ref:a,size:"sm",variant:"",icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:t}),color:"trueblue.600",textShadow:"0px 1px 0px rgba(0,0,0,0)",fontWeight:"500",borderRadius:"md",borderWidth:"1px",backdropFilter:"blur(20px)",borderColor:"transparent",_hover:{bg:"gray.50",borderColor:"gray.200"},_focus:{bg:"gray.50",borderColor:"gray.200"},_active:{bg:"trueblue.100",borderColor:"trueblue.200"},...n})})),eS=({children:e,...t})=>(0,A.jsx)(I.Flex,{bg:"#F9FAFBDD",p:1,borderWidth:"1px",borderColor:"whiteAlpha.600",borderRadius:"xl",shadow:"xl",...t,children:e}),ek={[b.AlignStyle.Start]:ea.faAlignLeft,[b.AlignStyle.Middle]:ea.faAlignCenter,[b.AlignStyle.End]:ea.faAlignRight},eA=()=>{let e=eo(),i=e.useStore(eh),n=e.useStore(em),a=ex(e,n),r={...i,...a};return(0,A.jsxs)(et.Popover,{trigger:"hover",children:[(0,A.jsx)(en.PopoverTrigger,{children:(0,A.jsx)(ew,{icon:ek[r.textAlign||b.AlignStyle.Start]})}),(0,A.jsx)(ei.PopoverContent,{background:"none",shadow:"none",w:"fit-content",children:(0,A.jsx)(eS,{direction:"column",children:(0,A.jsxs)(J.ButtonGroup,{children:[(0,A.jsx)(ew,{icon:ea.faAlignLeft,label:t.i18n._({id:"IR6Txi",message:"Align left"}),onClick:()=>e.style({textAlign:b.AlignStyle.Start}),isActive:r.textAlign===b.AlignStyle.Start},"align-left"),(0,A.jsx)(ew,{icon:ea.faAlignCenter,label:t.i18n._({id:"8nOdkO",message:"Align center"}),onClick:()=>e.style({textAlign:b.AlignStyle.Middle}),isActive:r.textAlign===b.AlignStyle.Middle},"align-center"),(0,A.jsx)(ew,{icon:ea.faAlignRight,label:t.i18n._({id:"pd0UH2",message:"Align right"}),onClick:()=>e.style({textAlign:b.AlignStyle.End}),isActive:r.textAlign===b.AlignStyle.End},"align-right"),(0,A.jsx)(ew,{icon:ea.faAlignJustify,label:t.i18n._({id:"18P2qJ",message:"Justify"}),onClick:()=>e.style({textAlign:b.AlignStyle.Justify}),isActive:r.textAlign===b.AlignStyle.Justify},"justify")]})})})]})},eE=e=>e.document.pageStates[e.appState.currentPageId].selectedIds.some(t=>void 0!==e.document.pages[e.appState.currentPageId].shapes[t].children),e_=e=>"idle"===e.appState.status&&e.document.pageStates[e.appState.currentPageId].selectedIds.length>0,eI=e=>e.document.pageStates[e.appState.currentPageId].selectedIds.length,eM=e=>{let t=e.appState.currentPageId,i=e.document.pages[t];for(let n of e.document.pageStates[t].selectedIds)if("text"in i.shapes[n])return!0;return!1},eT=P.memo(function(){let e=eo(),{isGammaOrgUser:i}=(0,Q.useUserContext)(),n=e.useStore(e_),a=e.useStore(eE),r=e.useStore(eI),o=e.useStore(eM);return(0,A.jsx)(I.Flex,{w:"100%",direction:"row",position:"absolute",bottom:2,align:"flex-end",justify:"center",zIndex:1,children:(0,A.jsx)(eS,{children:(0,A.jsxs)(ee.HStack,{spacing:2,children:[i&&(0,A.jsx)(ew,{icon:ea.faFileArrowDown,label:t.i18n._({id:"SpTWH3",message:"Download SVG"}),onClick:()=>e.exportImage(b.TDExportType.SVG,{scale:1,quality:1})},"download"),n&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ew,{icon:ea.faTrash,label:t.i18n._({id:"/Wgayn",message:"Delete selection"}),onClick:()=>e.delete(),"data-testid":"drawing-edit-toolbar-delete"},"delete"),(0,A.jsx)(eL,{}),r>=2&&(0,A.jsx)(ej,{}),r>=2||a?(0,A.jsx)(ew,{icon:ea.faObjectGroup,label:a?"Ungroup selection":"Group selection",onClick:()=>a?e.ungroup():e.group(),isActive:a},"group"):null]}),(0,A.jsx)(ey,{}),o&&(0,A.jsx)(eA,{})]})})})}),eL=()=>{let e=eo();return(0,A.jsxs)(et.Popover,{trigger:"hover",children:[(0,A.jsx)(en.PopoverTrigger,{children:(0,A.jsx)(ew,{icon:ea.faBringForward})}),(0,A.jsx)(ei.PopoverContent,{background:"none",shadow:"none",w:"fit-content",children:(0,A.jsxs)(eS,{direction:"row",children:[(0,A.jsx)(ew,{icon:ea.faBringFront,label:t.i18n._({id:"J6qWQV",message:"Move to front"}),onClick:()=>e.moveToFront()},"front"),(0,A.jsx)(ew,{icon:ea.faBringForward,label:t.i18n._({id:"9xFjqz",message:"Move forward"}),onClick:()=>e.moveForward()},"forward"),(0,A.jsx)(ew,{icon:ea.faSendBackward,label:t.i18n._({id:"OfSb1W",message:"Move backward"}),onClick:()=>e.moveBackward()},"backward"),(0,A.jsx)(ew,{icon:ea.faSendBack,label:t.i18n._({id:"/zBSYY",message:"Move to back"}),onClick:()=>e.moveToBack()},"back")]})})]})},ej=()=>{let e=eo();return(0,A.jsxs)(et.Popover,{trigger:"hover",children:[(0,A.jsx)(en.PopoverTrigger,{children:(0,A.jsx)(ew,{icon:ea.faObjectsAlignLeft})}),(0,A.jsx)(ei.PopoverContent,{background:"none",shadow:"none",w:"fit-content",children:(0,A.jsxs)(eS,{direction:"column",children:[(0,A.jsxs)(J.ButtonGroup,{children:[(0,A.jsx)(ew,{icon:ea.faObjectsAlignLeft,label:t.i18n._({id:"IR6Txi",message:"Align left"}),onClick:()=>e.align(b.AlignType.Left)},"align-left"),(0,A.jsx)(ew,{icon:ea.faObjectsAlignCenterHorizontal,label:t.i18n._({id:"8nOdkO",message:"Align center"}),onClick:()=>e.align(b.AlignType.CenterHorizontal)},"align-center"),(0,A.jsx)(ew,{icon:ea.faObjectsAlignRight,label:t.i18n._({id:"pd0UH2",message:"Align right"}),onClick:()=>e.align(b.AlignType.Right)},"align-right"),(0,A.jsx)(ew,{icon:ea.faDistributeSpacingHorizontal,label:t.i18n._({id:"8lqfXb",message:"Distribute horizontally"}),onClick:()=>e.distribute(b.DistributeType.Horizontal)},"distribute-h")]}),(0,A.jsxs)(J.ButtonGroup,{children:[(0,A.jsx)(ew,{icon:ea.faObjectsAlignTop,label:t.i18n._({id:"/Q0jUh",message:"Align top"}),onClick:()=>e.align(b.AlignType.Top)},"align-top"),(0,A.jsx)(ew,{icon:ea.faObjectsAlignCenterVertical,label:t.i18n._({id:"QhuQN2",message:"Align middle"}),onClick:()=>e.align(b.AlignType.CenterVertical)},"align-middle"),(0,A.jsx)(ew,{icon:ea.faObjectsAlignBottom,label:t.i18n._({id:"EPnxoe",message:"Align bottom"}),onClick:()=>e.align(b.AlignType.Bottom)},"align-bottom"),(0,A.jsx)(ew,{icon:ea.faDistributeSpacingVertical,label:t.i18n._({id:"a1NrWf",message:"Distribute vertically"}),onClick:()=>e.distribute(b.DistributeType.Vertical)},"distribute-v")]})]})})]})};var eP=e.i(402818),eD=e.i(575084);let eN=e=>e.appState.activeTool,eR=P.memo(function(){let e=eo(),i=e.useStore(eN);return(0,A.jsx)(I.Flex,{h:"100%",direction:"column",position:"absolute",right:2,align:"flex-end",justify:"center",zIndex:1,children:(0,A.jsx)(eS,{children:(0,A.jsx)(M.VStack,{spacing:2,children:[{icon:eD.faArrowPointer,label:t.i18n._({id:"rG3WVm",message:"Select"}),tool:"select"},{icon:ea.faEraser,label:t.i18n._({id:"Ajc4TJ",message:"Erase"}),tool:"erase"},{icon:eD.faHorizontalRule,label:t.i18n._({id:"rjuFFw",message:"Line"}),tool:b.TDShapeType.Line},{icon:eD.faArrowUpRight,label:t.i18n._({id:"zFkhx3",message:"Arrow"}),tool:b.TDShapeType.Arrow},{icon:eD.faRectangle,label:t.i18n._({id:"30KLDI",message:"Rectangle"}),tool:b.TDShapeType.Rectangle},{icon:eD.faCircle,label:t.i18n._({id:"7xMmki",message:"Circle"}),tool:b.TDShapeType.Ellipse},{icon:eD.faTriangle,label:t.i18n._({id:"ucHvJP",message:"Triangle"}),tool:b.TDShapeType.Triangle},{icon:eD.faText,label:t.i18n._({id:"xeiujy",message:"Text"}),tool:b.TDShapeType.Text}].map(({label:t,icon:n,tool:a})=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ew,{icon:n,label:t,onClick:()=>e.selectTool(a),isActive:i===a,tooltipPlacement:"left","data-testid":`drawing-insert-toolbar-${a}`},t),"select"==a&&(0,A.jsx)(eP.Divider,{},"selectDivider")]}))})})})});var eO=e.i(721455),eB=e.i(148318),ez=e.i(285042),eF=e.i(704273);let eH=e=>e.document.pageStates[e.appState.currentPageId].camera.zoom,eW=e=>e.settings.showGrid,eU=P.default.memo(function(){let e=eo(),i=e.useStore(eW);return(0,A.jsx)(I.Flex,{position:"absolute",top:2,left:2,zIndex:1,children:(0,A.jsx)(eS,{children:(0,A.jsxs)(ee.HStack,{spacing:2,children:[(0,A.jsx)(eV,{}),(0,A.jsx)(ew,{icon:eD.faGrid5,label:i?t.i18n._({id:"IsBZFj",message:"No grid"}):t.i18n._({id:"mWgfWA",message:"Snap to grid"}),isActive:i,onClick:()=>e.setSetting("showGrid",!i)},"grid")]})})})}),eV=P.default.memo(function(){let e=eo(),t=e.useStore(eH);return(0,A.jsxs)(eO.Menu,{children:[(0,A.jsxs)(eB.MenuButton,{as:_.Button,"data-test-id":"zoom-menu-button",size:"sm",variant:"ghost",leftIcon:(0,A.jsx)(L.FontAwesomeIcon,{icon:ea.faMagnifyingGlass}),children:[Math.round(100*t),"%"]}),(0,A.jsxs)(eF.MenuList,{children:[(0,A.jsx)(ez.MenuItem,{command:"#+",onClick:e.zoomIn,children:(0,A.jsx)(ec.Trans,{message:"Zoom in",id:"AWOSPo"})}),(0,A.jsx)(ez.MenuItem,{command:"#-",onClick:e.zoomOut,children:(0,A.jsx)(ec.Trans,{message:"Zoom out",id:"FjkaiT"})}),(0,A.jsx)(ez.MenuItem,{command:"⇧0",onClick:e.resetZoom,children:(0,A.jsx)(ec.Trans,{message:"Zoom to 100%",id:"41NrIs"})}),(0,A.jsx)(ez.MenuItem,{command:"⇧1",onClick:e.zoomToFit,"data-test-id":"zoom-to-fit-button",children:(0,A.jsx)(ec.Trans,{message:"Zoom to fit",id:"pLI1Is"})})]})]})});e.i(261991);var eG=e.i(305524);let e$={dash:b.DashStyle.Solid,isFilled:!0,color:b.ColorStyle.White},eZ=({isDark:e,font:t,...i})=>{var n;let{currentWorkspace:a}=(0,Q.useUserContext)(),[r,o]=(0,P.useState)(),[s,l]=(0,P.useState)(!1),d=(0,P.useCallback)(e=>{o(e),e.style(e$,[]),l(!0)},[]),{onAssetCreate:c,onAssetDelete:u}=(n=a?.id,{onAssetCreate:(0,P.useCallback)(async(e,t,i)=>{if(!n)return console.warn("[useAssetUpload] OrgId is required to upload assets"),!1;let a=URL.createObjectURL(t);console.debug("[useAssetUpload] Handling upload for file",{file:t,id:i,tempUrl:a});let r=t=>{let n=e.assets.find(e=>e.id===i);if(n){console.debug("[useAssetUpload] Upload complete. Replacing temp asset",{id:i,src:t.src});let a={document:{assets:{[i]:{...n,src:t.src}}}};e.patchState(a,"upload"),e.persist(a,"upload")}};return(0,eG.uploadFile)(t,n,{onOriginalFileUpload:r,onUploadComplete:r}),e.patchState({document:{assets:{[i]:{id:i,type:b.TDAssetType.Image,fileName:t.name,src:a}}}}),a},[n]),onAssetDelete:(0,P.useCallback)(async(e,t)=>!0,[])});(0,P.useEffect)(()=>{r&&void 0!==e&&r.setSetting("isDarkMode",e)},[r,e]);let p=(0,P.useMemo)(()=>B(e),[e]),h=(0,P.useMemo)(()=>O(t),[t]);return(0,A.jsxs)(I.Flex,{sx:{".tl-canvas":{"div, text, textarea":{...h},...p,'g[cursor="grab"][aria-label="link handle"]':{display:"none"}}},onDrop:()=>{},onPaste:()=>{},position:"relative",h:"100%",w:"100%",className:"highlight-mask",children:[(0,A.jsx)(X.Global,{styles:{"#__textLabelMeasure, #__textMeasure":{...h}}}),(0,A.jsxs)(er.Provider,{value:r||{},children:[(0,A.jsx)(b.Tldraw,{onAssetCreate:c,onAssetDelete:u,...i,onMount:(0,Y.callAllHandlers)(i.onMount,d)}),s&&!i.readOnly&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(eT,{}),(0,A.jsx)(eR,{})]}),s&&(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(eU,{})})]})]})};e.i(905506);var eK=e.i(84723);let eq=["tl-centered-g"],eY=async e=>{let t=await e.getSvg(e.shapes.map(e=>e.id),{padding:1});if(t)return eq.forEach(e=>{t.querySelector(`.${e}`)?.classList.remove(e)}),t.querySelectorAll(":not(mask)[id]").forEach(e=>e.removeAttribute("id")),t};var eX=e.i(812059);let eQ=({isOpen:e,isEditable:t,onClose:i,font:n,isDark:a,isDrawingEditorActive:r,setDrawingEditorActive:o,...s})=>{let{node:l,updateAttributes:d}=s,{page:c,assets:u}=l.attrs,[p,h]=(0,P.useState)();(0,P.useEffect)(()=>{(0,eX.setContent)(p,c,u)},[c,u,p,d]);let m=(0,P.useCallback)(e=>{h(e),window.tldrawEditor=e,(0,eX.initializeApp)(e,!0)},[]),g=(0,P.useCallback)(async()=>{if(!p)return;let e=await eY(p);if(!e)return;d({svg:e.outerHTML});let t=JSON.stringify({page:p.document.pages.page,assets:p.document.assets});console.debug("[DrawingEditor] Generated SVG",{svgSize:e.outerHTML.length,jsonSize:t.length,svgEl:e})},[p,d]),f=(0,P.useCallback)(()=>{p&&d({page:p.document.pages.page,assets:p.document.assets})},[d,p]),b=(0,eK.useDebounced)(f,500),x=(0,P.useCallback)(()=>{t&&g(),o(!1),i()},[i,g,o,t]);return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)($.Drawer,{placement:"bottom",onClose:x,isOpen:e,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,A.jsx)(q.DrawerOverlay,{}),(0,A.jsxs)($.DrawerContent,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&o(!0)},transition:{duration:.4},children:[(0,A.jsx)(Z.DrawerBody,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:r?(0,A.jsx)(eZ,{readOnly:!t,showPages:!1,onMount:m,onChangePage:t?b:void 0,autofocus:!1,isDark:a,font:n}):(0,A.jsx)(I.Flex,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,A.jsx)(G.Spinner,{size:"xl"})})}),(0,A.jsx)(K.DrawerCloseButton,{zIndex:2,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})},eJ=(0,j.motion)(E.Box),e0=e=>{let{node:t,updateAttributes:i,selected:n,editor:a,getPos:r}=e,{width:o,meta:s,id:l,horizontalAlign:d,svg:c,page:u}=t.attrs,p=(0,x.useAppSelector)(C.selectContentEditable),h=(0,x.useAppSelector)(C.selectIsAllowedToEdit),m=(0,N.useEditorFocused)(),g=p&&m&&h,f=(0,x.useAppSelector)(C.selectExpandedDrawingId),b=!!f&&f===l,[y,v]=(0,P.useState)(!1),w=(0,x.useAppSelector)(C.selectTheme),{isDark:S}=(0,F.getContainerOptions)(w),k=(0,D.getThemeCSSVars)(w)["--body-font"],{ref:j,setIsResizing:R,resizeableSx:O,onLayoutAnimationStart:B,onLayoutAnimationComplete:G}=(0,V.useResizeable)(a),$=(0,P.useCallback)(()=>{(0,eX.setDrawingExpanded)(l,!0)},[l]),Z=(0,P.useCallback)(()=>{let e=r();"number"==typeof e&&a.chain().setNodeSelection(e).focus().run()},[a,r]),K=(0,P.useCallback)(()=>{(0,eX.setDrawingExpanded)(null,!1)},[]),q=(0,P.useCallback)(e=>{i({...t.attrs,...e})},[t.attrs,i]),Y=o||s?.width,X=!c,Q=u&&Object.keys(u.shapes).length>0,J=(0,W.getAlignStyles)(d);return(0,A.jsx)(H.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,A.jsxs)(I.Flex,{w:"100%",className:U.MOVEABLE_WRAPPER_CLASSNAME,css:J,sx:O,direction:"column",_focusWithin:{shadow:"outline"},children:[(0,A.jsxs)(eJ,{ref:j,className:"drawing",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:Y?`calc(${Y} * var(--font-size) / 16)`:"100%",maxW:"100%",h:"auto",position:"relative",layout:!0,layoutDependency:d,transition:{duration:.15},onLayoutAnimationStart:B,onLayoutAnimationComplete:G,minH:X?"6em":"auto","data-drag-handle":!0,children:[g&&n&&(0,A.jsx)(V.ResizableControls,{imageWrapperRef:j,setIsResizing:R,updateResizeAttrs:q,refreshDeps:[t.attrs]}),!y&&(0,A.jsx)(z,{font:k,svg:c,isDark:S}),g&&!b&&!X&&(0,A.jsx)(E.Box,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:Z,onDoubleClick:$}),X&&(0,A.jsxs)(M.VStack,{spacing:3,justify:"center",contentEditable:!1,color:"gray.400",h:32,backgroundColor:"blackAlpha.50",borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",children:[(0,A.jsx)(L.FontAwesomeIcon,{size:"2x",icon:T.faShapes}),p&&(0,A.jsx)(_.Button,{size:"xs",onClick:$,children:Q?"Open diagram":"Add diagram"})]})]}),b&&(0,A.jsx)(eQ,{...e,isOpen:b,isEditable:p,onClose:K,isDark:S,font:k,isDrawingEditorActive:y,setDrawingEditorActive:v})]})})},e1=new a.PluginKey("UniqueMediaId"),e2=y.UniqueAttribute.extend({name:"UniqueDrawingId"}).configure({attributeName:"id",types:["drawing"],initialValue:eX.generateDrawingId,filterTransaction:w.isLocalTransaction,pluginKey:e1}),e3=(0,S.createTiptapNode)("drawing",{selectable:!0,draggable:!0,parseHTML:()=>[{tag:"div[class=drawing]",getAttrs(e){let t=e.getAttribute("data-width");return{id:(0,S.parseIdAttr)(e,eX.generateDrawingId),page:(0,S.parseJSONAttr)(e,"page"),assets:(0,S.parseJSONAttr)(e,"assets")??{},meta:(0,S.parseJSONAttr)(e,"meta")??{},fullWidthBlock:"true"===e.getAttribute("data-fullwidthblock"),width:t?Number(t):null,svg:e.getAttribute("data-svg"),...(0,S.parseHorizontalAlign)(e)}}},{tag:"tldraw",getAttrs:e=>{try{let t=new b.TldrawApp,i=JSON.parse(e.innerHTML);return t.insertContent(i,{select:!1}),{page:t.document.pages[t.currentPageId],assets:t.assets}}catch(t){return console.error("(caught) Error parsing Tldraw paste",t,e.innerHTML),!1}}}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"drawing","data-id":e.attrs.id,...(0,S.renderJSONAttrs)(e.attrs,"page","assets","meta"),...e.attrs.fullWidthBlock&&{"data-fullwidthblock":"true"},...null!=e.attrs.width&&{"data-width":String(e.attrs.width)},...null!=e.attrs.svg&&{"data-svg":e.attrs.svg},...(0,S.renderHorizontalAlign)(e.attrs)})],addCommands(){return this.name,{editSelectedDrawingBlock:()=>({state:e})=>{let t=(e=>{let{selection:t}=e;return t instanceof a.NodeSelection&&("drawing"===t.node.type.name||"diagram"===t.node.type.name)?t.node:void 0})(e);return t&&(0,x.getStore)().dispatch((0,C.setExpandedDrawingId)({drawingId:t.attrs.id})),!0}}},addExtensions:()=>[e2],addNodeView:()=>(0,v.ReactNodeViewRenderer)(e0,{update:k.attrsOrDecorationsChanged})}),e5=i.Extension.create({name:"dynamicNodes",extendNodeSchema:e=>({dynamic:(0,i.callOrReturn)((0,i.getExtensionField)(e,"dynamic",e))??!1})});e.s(["DynamicNodes",0,e5],152232);let e4=i.Extension.create({name:"fixRequiredAttrs",onBeforeCreate(){Object.values(this.editor.schema.nodes).forEach(e=>{Object.values(e.attrs||{}).forEach(e=>{void 0===e.default&&(e.hasDefault=!1)})})}});e.s(["FixRequiredAttrs",0,e4],821502);var e6=e.i(308822),e9=e.i(509510),e8=e.i(584875),e7=e.i(131339),te=e.i(444577),tt=e.i(438106),ti=e.i(517344),tn=e.i(320037),ta=e.i(255664);let tr=new a.Plugin({key:new a.PluginKey("footnote"),appendTransaction:(e,t,n)=>{let{selection:a}=n;a.eq(t.selection)||(e=>{if("footnote"!==e.$anchor.doc.type.name&&!e.empty&&!(0,ti.isFootnoteSelected)(e)&&(0,i.isTextSelection)(e)){let e=(0,ti.getExpandedFootnoteId)();if(!e)return;let t=document.querySelector(`[data-footnote-popover-id="${e}"] .ProseMirror`);t&&t.contains(document.activeElement)||(0,ti.setFootnoteExpanded)(null,!1)}})(a);let r=n.tr;return((0,ta.preventLeakyMarks)(e,t,n,r),((e,t,n,a)=>{if(!e.some(e=>e.docChanged))return;let{doc:r}=n,o=[],s=[];r.nodesBetween(0,n.doc.content.size,(e,t,i)=>{"footnote"===e.type.name&&o.push({from:t,to:t+e.nodeSize,node:e,parent:i}),e.marks.forEach(n=>{"footnoteLabel"===n.type.name&&s.push({from:t,to:t+e.nodeSize,mark:n,parent:i})})}),s.filter(({mark:e,parent:t})=>!o.find(({node:i,parent:n})=>i.attrs.noteId===e.attrs.noteId&&n===t)).forEach(({from:e,to:t,mark:i})=>a.removeMark(e,t,i));let l=e=>(0,i.getMarkType)("footnoteLabel",n.schema).create({noteId:e});s.filter(({mark:e})=>!e.attrs.noteId).forEach(({mark:e,from:t,to:i})=>{let n=o.find(({node:e,from:t})=>{let n=t>=i,a=!s.find(({mark:t})=>t.attrs.noteId==e.attrs.noteId);return n&&a});n&&a.removeMark(t,i,e).addMark(t,i,l(n.node.attrs.noteId))}),Object.entries((0,tn.default)(o,({node:e})=>e.attrs.noteId)).forEach(([e,t])=>{if(1==t.length||!e)return;let i=s.filter(({mark:t})=>t.attrs.noteId===e);t.slice(1).forEach(({from:e},t)=>{let n=(0,ti.generateFootnoteId)();a.setNodeMarkup(e,void 0,{noteId:n});let r=i[t+1];r&&(a.removeMark(r.from,r.to,r.mark),a.addMark(r.from,r.to,l(n)))})})})(e,0,n,r),r.docChanged)?(console.debug("[FootnotePlugin] Applied steps",r.steps),r):null}});var to=e.i(887527);e.i(314572);var ts=e.i(296446),tl=e.i(361183),td=e.i(335884),tc=e.i(959022),tu=e.i(432247),tp=e.i(398358),th=e.i(865080),tm=e.i(717834);let tg=(e,t)=>{let n=(0,x.useAppSelector)(C.selectExpandedNoteId);(0,th.useOutsideClick)({ref:t,enabled:!!(t&&n===e),handler(e){e.target?.closest(".footnote-popover")||e.target?.closest("[data-footnote-view]")||e.target?.closest("[data-footnote-label]")||a(!1)}});let a=(0,tm.useTiptapEditorEventCallback)((t,a)=>{let r=t.state.selection,o=(0,i.isTextSelection)(r)&&!r.empty,s=document.activeElement?.closest(".footnote-popover")||!!document.activeElement?.closest("[data-in-editor-focus]")||!!document.activeElement?.closest("[data-media-drawer-menu]"),l=void 0!==a?a:n!==e;s||(l&&!o?(0,ti.setFootnoteExpandedDebounced)(e,!0):!1===l&&(0,ti.setFootnoteExpandedDebounced)(e,!1))});return{onClick:a}},tf=(0,S.createTiptapMark)("footnoteLabel",{inclusive:!1,excludes:"link underline",priority:tt.ExtensionPriorityMap.FootnoteLabel,parseHTML:()=>[{tag:"span[class=footnote-label]"}],renderHTML:({HTMLAttributes:e})=>["span",(0,i.mergeAttributes)(e,{class:"footnote-label"}),0]}),tb=({node:e,editor:t,children:i,contentDOMRef:n})=>{let{noteId:a}=e.attrs,r=(0,td.useShouldUsePublishedVersion)(),o=(0,ts.useIsInReactProseMirror)(),{onClick:s}=tg(a),l=!(0,tp.isCardNotesEditor)(t),d=(0,P.useCallback)(()=>{l&&s()},[l,s]);return(0,A.jsx)(tc.NodeViewWrapper,{as:"span",className:"footnote-label-view",children:(0,A.jsx)(to.Text,{as:"span",className:"footnote-label",onClick:d,"data-footnote-label":!0,cursor:l?"pointer":void 0,children:r||o?(0,A.jsx)("span",{ref:n,children:i}):(0,A.jsx)(tu.NodeViewContent,{as:"span"})})})};e.s(["FootnoteLabel",0,tf,"FootnoteLabelView",0,function({markProps:e,children:t,ref:i}){let{editor:n}=(0,tl.useCurrentEditor)();if(!n)return null;let{contentDOMRef:a}=e;return(0,A.jsx)("span",{ref:i,children:(0,A.jsx)(tb,{editor:n,node:e.mark,contentDOMRef:a,children:t})})}],716700);let tx=/(?:^|\s)((?:\^)((?:[^^]+))(?:\^))$/,ty=(0,S.createTiptapNode)("footnote",{requiredAttrs:["noteId"],priority:tt.ExtensionPriorityMap.Footnote,parseHTML:()=>[{tag:"span[class=footnote]",getAttrs:()=>({noteId:(0,ti.generateFootnoteId)()}),getContent:(e,t)=>e6.Fragment.fromJSON(t,JSON.parse(e.getAttribute("data-content")||"{}"))},{tag:"div[class=imported-footnote]",getAttrs:()=>({noteId:(0,ti.generateFootnoteId)()})},{tag:"footnote[noteid]",getAttrs:e=>({noteId:e.getAttribute("noteid")})}],renderHTML:({node:e,HTMLAttributes:t})=>["span",(0,i.mergeAttributes)(t,{class:"footnote","data-content":JSON.stringify(e.content.toJSON())})],addInputRules(){var e;return[(e={find:tx,nodeType:this.type,markType:this.editor.schema.marks.footnoteLabel},new i.InputRule({find:e.find,handler:({state:t,range:n,match:a})=>{let{tr:r}=t,o=a[a.length-1],s=a[0],l=n.to;if(o){let a=s.search(/\S/),d=n.from+s.indexOf(o),c=d+o.length;if((0,i.getMarksBetween)(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(i=>i===e.markType&&i!==t.mark.type)).filter(e=>e.to>d).length)return;cn.from&&r.delete(n.from+a,d),l=n.from+a+o.length;let u=(0,ti.generateFootnoteId)();(0,ti.setFootnoteExpanded)(u,!0);let p=e.nodeType.createAndFill({noteId:u},e6.Fragment.empty);r.insert(l,p),r.addMark(n.from+a,l,e.markType.create({noteId:u})),r.removeStoredMark(e.markType)}}}))]},addKeyboardShortcuts:()=>({Enter:({editor:e})=>{if(!(0,ti.isFootnoteSelected)(e.state.selection))return!1;let t=e.state.selection.node.attrs.noteId;return(0,ti.setFootnoteExpanded)(t,!0),!0},Escape:()=>{let e=(0,ti.getExpandedFootnoteId)();return!!e&&((0,ti.setFootnoteExpanded)(e,!1),!0)},"Mod-Alt-f":({editor:e})=>e.commands.toggleFootnote()}),addProseMirrorPlugins:()=>[tr],addCommands:()=>({convertNoteToCard:e=>({chain:t,state:n})=>{let{doc:a}=n,r=(0,i.findChildren)(a,t=>"footnote"===t.type.name&&t.attrs.noteId===e);if(1!==r.length)throw Error(`Found the wrong number of footnotes nodes: ${r}`);let{node:o,pos:s}=r[0],l=(0,i.getMarkRange)(a.resolve(s-1),n.schema.marks.footnoteLabel,{noteId:o.attrs.noteId});if(!l)return console.error("Couldnt find the corresponding footnote mark",{node:o,pos:s}),!1;let d=a.textBetween(l.from,l.to),c={type:"card",attrs:{id:te.cardNanoid.generate()},content:[{type:"heading",attrs:{level:1},content:[{type:"text",text:d}]},...o.content.toJSON()]},u=new URL(window.location.href);u.hash=`card-${c.attrs.id}`,(0,e7.setCardCollapsed)(c.attrs.id,!1);let p=a.content.size-1;return t().setTextSelection(l).unsetMark("footnoteLabel").setLink({href:u.toString()}).insertContentAt(p,c).command(({tr:e})=>{let t=(0,e9.findSelectionInsideNode)(e.doc.resolve(p));return t&&e.setSelection(t),!0}).deleteRange({from:s,to:s+o.nodeSize}).focusDelayed().run()},toggleFootnote:()=>({chain:e,state:t,editor:i})=>{if(i.isActive("footnoteLabel"))return e().toggleMark("footnoteLabel").focus().run();let n=(0,ti.generateFootnoteId)();return(0,ti.setFootnoteExpanded)(n,!0),(0,e8.getNextAnimationFrame)().push(()=>{i.commands.forceHideBubbleMenu?.(!0),tv(n)},"toggleFootnote"),e().setMark("footnoteLabel",{noteId:n}).insertContentAt(t.selection.to,{type:"footnote",attrs:{noteId:n},content:[{type:"paragraph"}]}).run()}})}),tv=e=>{let t=document.querySelector(`[data-footnote-popover-id="${e}"] .ProseMirror`);if(!t)return;t.focus();let i=window.getSelection();if(!i)return;let n=document.createRange();n.setStart(t,0),n.setEnd(t,0),i.removeAllRanges(),i.addRange(n)};e.s(["Footnote",0,ty],155069),e.s(["FootnoteView",()=>ig],136715);var tC=e.i(470645),tw=e.i(760853),tS=e.i(358003);let tk=(e,t)=>t?`${e}.${t}, ${t}`:void 0;function tA(e){let{bg:t,bgColor:i,backgroundColor:n,shadow:a,boxShadow:r,shadowColor:o,...s}=e,{getArrowProps:l,getArrowInnerProps:d}=(0,tw.usePopoverContext)(),c=(0,tw.usePopoverStyles)();return(0,A.jsx)(tS.chakra.div,{...l(),className:"chakra-popover__arrow-positioner",children:(0,A.jsx)(tS.chakra.div,{className:(0,tC.cx)("chakra-popover__arrow",e.className),...d(s),__css:{"--popper-arrow-shadow-color":tk("colors",o),"--popper-arrow-bg":tk("colors",t??i??n),"--popper-arrow-shadow":tk("shadows",a??r),...c.arrow}})})}tA.displayName="PopoverArrow";var tE=e.i(891494),t_=e.i(935020),tI=e.i(876533);e.i(197071);var tM=e.i(653689),tT=e.i(133350),tL=e.i(636339),tj=e.i(835128),tP=e.i(708378),tD=e.i(615505),tN=e.i(783197),tR=e.i(529232),tO=e.i(579367),tB=e.i(261442),tz=e.i(52307),tF=e.i(281107),tH=e.i(279920),tW=e.i(864860),tU=e.i(917554),tV=e.i(295595),tG=e.i(606004),t$=e.i(297194),tZ=e.i(4877);let tK=({currentAttributes:e,updateAttributes:t,editor:i,isMounted:n})=>{let a=(0,P.useRef)({currentAttributes:e,updateAttributes:t,sourceKey:e.source});a.current.currentAttributes=e,a.current.updateAttributes=t,(0,P.useEffect)(()=>{a.current.sourceKey=a.current.currentAttributes.source},[e.tempUrl,e.src]),(0,P.useEffect)(()=>{if(!i||n)return;let{src:e,tempUrl:t,uploadStatus:r}=a.current.currentAttributes;t&&!e&&r!==t$.UploadStatus.Uploading&&(console.log("[useUploadOnUnmount] uploading tempUrl:",t),a.current.updateAttributes({uploadStatus:t$.UploadStatus.Uploading,source:a.current.sourceKey}),(0,tZ.uploadImageFileOrUrl)(i,t))},[i,n])};e.s(["useUploadOnUnmount",0,tK],865320);var tq=e.i(547119),tY=e.i(307591),tX=e.i(878917),tQ=e.i(267971),tJ=e.i(485527),t0=e.i(977581),t1=e.i(550963),t2=e.i(383156),t3=e.i(974952),t5=e.i(786928),t4=e.i(32113);let t6=P.default.memo(({editor:e})=>{(0,N.useEditorUpdateDuringSelection)();let t=(0,N.useEditorFocused)(),i=(0,t5.useToggleMediaDrawer)(),n=(0,x.useAppSelector)(C.selectEditable),r=e.state.selection,o=(0,P.useMemo)(()=>(0,t4.getSelectedMedia)(e,r),[e,r]),{currentMediaDrawerSourceKey:s,setMediaDrawerSourceKeyAction:l,isQuickAction:d}=(0,tQ.useDrawerSourceKey)(),c=tX.MediaSourcesMap[s],{isInOfflineMode:u}=(0,tG.useHealthCheck)(),p=!!(u&&!c?.availableOffline),h=(0,x.useAppSelector)(C.selectIsEditingMedia),m=o&&(0,t4.canEditInMediaDrawer)(e,o.type),g=t&&!!(h&&m&&n),f=(0,P.useRef)(null),b=(0,P.useCallback)(()=>{i({isOpen:!1}),r instanceof a.NodeSelection&&e.chain().selectNodeAtPos(r.from,!1).focus().run()},[e,r,i]),y=(0,tJ.useForwardUndo)(e);(0,P.useEffect)(()=>{m||i({isOpen:!1})},[m,i]),(0,P.useEffect)(()=>{g&&setTimeout(()=>{if(!f.current||p)return;let e=(0,tU.getAllFocusable)(f.current);e&&!(e.length<1)&&requestAnimationFrame(()=>{let t=e[0];t?.focus()})},100)},[p,g,e]),(0,P.useEffect)(()=>{if(!o)return;let{attrs:t,mediaType:i,type:n}=o;(0,t4.canEditInMediaDrawer)(e,n)&&(!e.isSiteNavbarEditor||(0,t0.editorHasFocus)(e))&&!d&&l("embed"===i&&null===t.source?tq.WebpageProvider.key:t.source||s)},[o,e,l,s,d]);let[v,w]=(0,P.useState)("");(0,P.useEffect)(()=>{o?.attrs?.query?w(o.attrs.query):w("")},[o?.attrs?.query]);let S=(0,tm.useTiptapEditorEventCallback)((e,t)=>{(0,t4.updateSelectedMedia)({editor:e,selection:r,sourceKey:s,attrs:t,resizeToFit:c?.resizeToFit})}),k={...o?.attrs,query:v||o?.attrs?.query};tK({currentAttributes:k,updateAttributes:S,editor:e,isMounted:g});let E=(0,P.useCallback)(()=>{(0,t4.updateSelectedMedia)({editor:e,selection:r,sourceKey:s,attrs:{source:s},nodeName:"mediaPlaceholder",resetAttrs:!0})},[s,r,e]),_=(0,t2.useDrawerSize)(),M=o?.editType||"node",T=(0,P.useCallback)(e=>o?.mediaType==="embed"?"embed"===e.nodeName||"video"===e.nodeName:o?.type.name==="image"||o?.type.name==="graphic"?"image"===e.nodeName||"graphic"===e.nodeName:o?.mediaType==="image"?"image"===e.nodeName:o?.mediaType==="icon"&&e?.key?(0,t1.isIconSource)(e.key)||"image.custom"===e.key:!!e.nodeName,[o]),L=tX.MediaPanelsMap[s];return(0,A.jsxs)(tz.Drawer,{isOpen:g,onClose:b,size:_,trapFocus:!1,blockScrollOnMount:!1,children:[(0,A.jsx)(q.DrawerOverlay,{background:"none"}),(0,A.jsxs)(tF.DrawerContent,{onKeyDown:y,"data-in-editor-focus":!0,"data-testid":"media-drawer","data-test-media-source":s,children:[(0,A.jsx)(tH.DrawerHeader,{fontSize:"x-large",children:(0,A.jsxs)(ee.HStack,{me:7,children:[(0,A.jsx)(ec.Trans,{message:"Media",id:"xYilR2"}),(0,A.jsx)(tW.Spacer,{}),o?.mediaType==="image"&&!e.isSiteNavbarEditor&&(0,A.jsx)(tV.ImageChatNarniaButton,{onClick:b,image:o?.attrs})]})}),(0,A.jsxs)(Z.DrawerBody,{overflowX:"hidden",sx:{scrollbarGutter:"stable"},display:"flex",flexDirection:"column",pt:0,children:[(0,A.jsx)(tY.OfflineInfoBox,{isInOfflineMode:p,description:(0,A.jsx)(ec.Trans,{message:"Media options will be available when you reconnect.",id:"2y7sUG"}),mb:6}),(0,A.jsx)(t3.MediaDrawerMenu,{currentSource:c,onChange:e=>l(e,!0),isValidSource:T}),c&&(0,A.jsx)(I.Flex,{ref:f,opacity:p?.4:1,pointerEvents:p?"none":"initial",flex:"1",direction:"column",children:(0,A.jsx)(L,{editor:e,updateAttributes:S,currentAttributes:k,resetToPlaceholder:E,editType:M,closeDrawer:b,mediaSearchQuery:v,setMediaSearchQuery:w})})]}),(0,A.jsx)(K.DrawerCloseButton,{"data-testid":"media-drawer-close"})]})]})});t6.displayName="MediaDrawer",e.i(478401);var t9=e.i(598401),t8=e.i(85547),t7=e.i(785872),ie=e.i(955312),it=e.i(921679),ii=e.i(639014),ia=e.i(807727);e.i(988162);var ir=e.i(391303);e.i(364146);var io=e.i(288294),is=e.i(196444);e.i(36025);var il=e.i(235512);e.i(503117);var id=e.i(493731);let ic=new a.PluginKey("SlashMenu"),iu=(0,id.createSuggestionExtension)({name:"slashMenu",char:"/",pluginKey:ic,MenuComponent:il.SlashMenuDropdown,priority:tt.ExtensionPriorityMap.SlashMenu});var ip=e.i(524617);let ih=i.Extension.create({name:"innerEditorExtension",addOptions:()=>({outerEditor:null,getPos:null}),addProseMirrorPlugins(){let{outerEditor:e,getPos:t}=this.options;return[new a.Plugin({appendTransaction:i=>{let n=i[0];if(!n)return null;if(!n.getMeta(t7.OUTER_EDITOR_META_KEY)&&e){let n=t();if("number"!=typeof n)return null;let r=e.state.tr,o=ip.StepMap.offset(n+1);for(let e=0;ee.commands.undo(),"Mod-y":()=>e.commands.redo()}}}),im=(e,t)=>{let i=t.mapResult(e.from,1),n=t.mapResult(e.to,-1),a=t.map(e.gapFrom,1),r=t.map(e.gapTo,1);return i.deletedAcross&&n.deletedAcross||an.pos?null:new ip.ReplaceAroundStep(i.pos,n.pos,a,r,e.slice,e.insert,e.structure)},ig=e=>{let{node:t,selected:i,editor:n}=e,{noteId:a}=t.attrs,r=(0,P.useRef)(null),o=(0,x.useAppSelector)(C.selectExpandedNoteId),s=(0,x.useAppSelector)(C.selectContentEditable),l=(0,td.useShouldUsePublishedVersion)(),{onClick:d}=tg(a,r),c=!!o&&o===a,u=!(0,tp.isCardNotesEditor)(n),p=(0,P.useCallback)(()=>{(0,ti.setFootnoteExpanded)(a,!1)},[a]),h=(0,P.useCallback)(()=>{u&&d()},[u,d]);return(0,tN.useIsThumbnailView)()?null:(0,A.jsx)(tc.NodeViewWrapper,{as:"span","data-testid":"footnote-nodeview-wrapper",children:(0,A.jsx)(tI.DarkModeProvider,{isDark:!1,children:(0,A.jsxs)(et.Popover,{isOpen:c,onClose:p,placement:"top",gutter:8,isLazy:!0,lazyBehavior:"unmount",autoFocus:!1,closeOnBlur:!1,closeOnEsc:!1,returnFocusOnClose:!1,children:[(0,A.jsx)(en.PopoverTrigger,{children:(0,A.jsx)(to.Text,{as:"span",onClick:h,_after:{content:"counter(footnote)",counterIncrement:"footnote",position:"relative",bottom:"0.6em",fontSize:"0.8em",shadow:i&&u?"outline":void 0,borderRadius:"sm"},pl:"1px",className:"footnote",contentEditable:!1,"data-footnote-view":!0,cursor:u?"pointer":void 0})}),(0,A.jsx)(t_.Portal,{children:(0,A.jsxs)(ei.PopoverContent,{zIndex:"popover",shadow:"md",borderRadius:"md",border:"1px solid",borderColor:"gray.200",w:"500px",maxW:"100vw","data-footnote-popover-test-id":a,p:0,ref:r,children:[(0,A.jsx)(tA,{}),(0,A.jsx)(tE.PopoverBody,{position:"relative",zIndex:"1",p:0,className:"footnote-popover","data-footnote-popover-id":a,children:(0,A.jsx)(iy,{...e,editable:s,onClose:p,shouldUsePublishedVersion:!!l})}),(0,A.jsx)(E.Box,{position:"absolute",top:"-8px",bottom:"-8px",left:0,right:0,zIndex:"0"})]})})]})})})},ib=(0,tP.default)({},tO.EditorStyles,{".ProseMirror":{px:8,py:4,overflow:"hidden auto",maxH:"300px",maxW:"100%",borderRadius:"md"}}),ix=({innerEditor:e,outerEditorEditable:t,outerEditorGammaOrgId:i,onClose:n})=>((0,tj.useTiptapEditorEffect)(e=>{e.setEditable(t)},[t]),(0,tj.useTiptapEditorEffect)(e=>{let t=()=>{setTimeout(()=>{(0,t0.editorHasFocus)(e)||n()},20)};return e.on("blur",t),()=>{e.off("blur",t)}},[n]),(0,tj.useTiptapEditorEffect)(e=>{i&&e.commands.initializeUploadExtension?.(i)},[i]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(tT.TiptapEditorContent,{editor:e}),(0,A.jsx)(t9.FormattingMenu,{editor:e}),(0,A.jsx)(t6,{editor:e})]})),iy=({editor:e,node:n,editable:a,selected:r,getPos:o,onClose:s,shouldUsePublishedVersion:l})=>{let{noteId:d}=n.attrs,c=(0,tm.useTiptapEditorEventCallback)(e=>e.commands.convertNoteToCard(d)),u=(0,tm.useTiptapEditorEventCallback)(e=>{let t=o();"number"==typeof t&&e.chain().focus().setNodeSelection(t).deleteSelection().run()}),p=((e,t,i,n,a,r=!0)=>(0,ie.useTiptapEditor)({extensions:[...(0,tR.getBaseExtensions)({isInnerEditor:!0}),iu,ii.EmojiShortcuts,is.FocusedNodes,ir.MediaUpload,ih.configure({outerEditor:e,getPos:n}),io.MentionSuggestionMenu,ia.FormattingBubbleMenu].filter(e=>!i||!i.includes(e.name)).map(e=>e.name===t?e.extend({topNode:!0}):e),content:{type:t,content:a.content.toJSON(),attrs:(0,it.default)(a.attrs)},editable:r,onBeforeCreate({editor:n}){e&&(n.schema.nodes={...e.schema.nodes},n.schema.marks={...e.schema.marks},n.schema.topNodeType=e?.schema.nodes[t],n.extensionManager.schema=n.schema,n.gammaOrgId=e.gammaOrgId,n.gammaDocId=e.gammaDocId,n.parentEditor=e),i?.forEach(e=>{n.schema.nodes[e]&&delete n.schema.nodes[e]})},onDestroy(){e.commands.forceHideBubbleMenu?.(!1)},immediatelyRender:!0}))(e,"footnote",["doc","document","card"],o,n,a&&!l);(0,P.useLayoutEffect)(()=>{let e=p?.view;if(!(e instanceof tD.EditorView))return;let t=e.state,i=n.content.findDiffStart(t.doc.content),a=n.content.findDiffEnd(t.doc.content);if(null!==i&&null!==a){let{a:r,b:o}=a,s=i-Math.min(r,o);s>0&&(r+=s,o+=s),e.dispatch(t.tr.replace(i,o,n.slice(i,r)).setMeta(t7.OUTER_EDITOR_META_KEY,!0).setMeta("preventAutolink",!0))}},[n,r,p.view]),(0,tM.useStopEvent)((e,t)=>!!p&&p.view instanceof tD.EditorView&&p.view.dom.contains(t.target));let h=(0,x.useAppSelector)(C.selectTheme),m=(0,D.getThemeCSSVars)(h,"#FFFFFF"),g=(0,P.useMemo)(()=>(0,tR.getBaseNodeViews)(),[]),f=(0,P.useMemo)(()=>(0,tR.getBaseMarkViews)(),[]);if(!p)return null;let b=(0,i.findChildren)(e.state.doc,e=>e.marks.some(e=>"footnoteLabel"===e.type.name&&e.attrs.noteId===d)).length>0;return(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(E.Box,{className:t8.CARD_CONTENT_CLASS,sx:ib,position:"relative",_focusWithin:{shadow:a&&!l?"outline":void 0},borderRadius:"md",css:m,children:[(0,A.jsx)(tL.TiptapEditorView,{editor:p,nodeViewComponents:g,markViewComponents:f,children:l?(0,A.jsx)(tT.TiptapEditorContent,{editor:p}):(0,A.jsx)(ix,{innerEditor:p,outerEditorEditable:a,outerEditorGammaOrgId:e.gammaOrgId,onClose:s})}),(0,A.jsxs)(J.ButtonGroup,{size:"sm",colorScheme:"gray",variant:"ghost",position:"absolute",right:4,top:2,onMouseDown:tB.preventDefaultToAvoidBlur,spacing:0,children:[a&&!l&&(0,A.jsxs)(eO.Menu,{autoSelect:!1,isLazy:!0,children:[(0,A.jsx)(eB.MenuButton,{as:es.IconButton,icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faEllipsis}),minW:6,h:6,isRound:!0,backgroundColor:"white"}),(0,A.jsx)(t_.Portal,{children:(0,A.jsxs)(eF.MenuList,{"data-in-editor-focus":!0,zIndex:"dropdown",children:[b&&(0,A.jsx)(ez.MenuItem,{icon:(0,A.jsxs)("span",{className:"fa-layers fa-fw",children:[(0,A.jsx)(L.FontAwesomeIcon,{icon:eD.faRectangle,fixedWidth:!0}),(0,A.jsx)(L.FontAwesomeIcon,{icon:eD.faArrowRight,inverse:!0,transform:"shrink-8"})]}),onClick:c,children:(0,A.jsx)(ec.Trans,{message:"Convert to card",id:"p/s15o"})}),(0,A.jsx)(ez.MenuItem,{icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faTrash,fixedWidth:!0}),color:"red.500",onClick:u,children:(0,A.jsx)(ec.Trans,{message:"Delete footnote",id:"sHHbXH"})})]})})]}),(0,A.jsx)(es.IconButton,{"aria-label":t.i18n._({id:"j+JKcM",message:"Close footnote"}),icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faTimes}),minW:6,h:6,isRound:!0,onClick:s,backgroundColor:"white"})]})]})})};e.s(["GraphyChart",()=>iQ],768331);var iv=e.i(85583),iC=e.i(462480),iw=e.i(265304),iS=e.i(536075),ik=e.i(428856);let iA={pie:"pie",donut:"donut",line:"line",bar:"column","horizontal-bar":"bar"};var iE=e.i(693774);e.i(528403);var i_=e.i(832300),iI=e.i(889601);let iM=new a.PluginKey("graphyChart");var iT=e.i(254140);e.s(["GraphyChartView",()=>i$],508883);var iL=e.i(357790),ij=e.i(168489),iP=e.i(44850),iD=e.i(313307),iN=e.i(686296),iR=e.i(650292),iO=e.i(45652),iB=e.i(592799),iz=e.i(892684),iF=e.i(622456),iH=e.i(465691),iW=e.i(283591);let iU=({chartData:e,onMigrate:t,width:i,height:n})=>{let[a,r]=(0,P.useState)(!1),o=(0,iW.useIsThemeDark)(),s=e.visualisationConfig?.type??"unknown",l=(0,P.useCallback)(async()=>{r(!0);let i=performance.now();iv.datadogLogs.logger.info("graphy.chart.migration.started",{chartType:s});try{let{config:n}=await (0,iT.migrateGraphConfig)(e),a=performance.now()-i;iv.datadogLogs.logger.info("graphy.chart.migration.success",{chartType:s,durationMs:a}),t(n)}catch(e){console.error("Failed to migrate legacy chart config:",e),iv.datadogLogs.logger.error("graphy.chart.migration.error",{chartType:s,errorMessage:e instanceof Error?e.message:"Unknown error"},e instanceof Error?e:void 0),r(!1)}},[e,s,t]);return(0,A.jsxs)(I.Flex,{direction:"column",align:"center",justify:"center",bg:o?"gray.700":"gray.100",borderRadius:"var(--box-border-radius)",w:i?`calc(${i} * var(--font-size) / 16)`:"100%",h:n?`calc(${n} * var(--font-size) / 16)`:"300px",maxW:"100%",p:"1em",gap:"0.75em",children:[(0,A.jsx)(to.Text,{color:o?"gray.300":"gray.600",fontSize:"0.875em",textAlign:"center",children:(0,A.jsx)(ec.Trans,{message:"This chart uses an older format and needs to be updated.",id:"g9cwAe"})}),(0,A.jsx)(_.Button,{onClick:l,isLoading:a,fontSize:"0.875em",px:"0.75em",py:"0.5em",h:"auto",minH:"0",minW:"0",children:(0,A.jsx)(ec.Trans,{message:"Update chart",id:"K7GQed"})})]})},iV=(0,ij.default)(()=>e.A(493189).then(e=>e.GraphProvider),{loadableGenerated:{modules:[793532]},ssr:!1}),iG=(0,ij.default)(()=>e.A(493189).then(e=>e.Graph),{loadableGenerated:{modules:[793532]},ssr:!1}),i$=e=>(0,A.jsx)(iB.BlockErrorBoundary,{errorMessage:t.i18n._({id:"ngl57B",message:"Unable to render chart"}),children:(0,A.jsx)(iZ,{...e})}),iZ=e=>{let t,{node:i,editor:n,decorations:a,updateAttributes:r,getPos:o,selected:s}=e,{chartType:l,horizontalAlign:d,chartData:c,googleSheetsSource:u}=i.attrs,p=(0,iD.normalizeChartDimensions)(i.attrs.dimensions),h=(0,x.useAppSelector)(C.selectContentEditable),m=(0,x.useAppSelector)(C.selectIsAllowedToEdit),g=(0,N.useEditorFocused)(),{isDark:f}=(0,iz.useCardColorMode)(a),[b,y]=(0,P.useState)(!1),v=(0,iO.useSSRMounted)(),w=h&&g&&m&&!iR.isPuppeteer,S=(0,W.getAlignStyles)(d),{ref:k,isResizing:_,setIsResizing:M,resizeableSx:T}=(0,V.useResizeable)(n),L=(0,tm.useTiptapEditorEventCallback)((e,t)=>{let{view:i}=e,n=o();if(n){let e=k.current?.parentElement?.parentElement,a=iL.CONTENT_WIDTH_PX*F;if(e){let t=parseFloat(getComputedStyle(e).fontSize);t>0&&e.clientWidth>0&&(a=e.clientWidth/(t/iL.BASE_FONT_SIZE))}let r=t.width?Math.min(t.width,a):t.width,o=i.state.tr.setNodeAttribute(n,"dimensions",{width:r,height:t.height});i.dispatch(o)}}),j=c&&(0,iT.chartNeedsUpgrade)(c),D=(0,N.useShouldRenderMobileVersion)(),R=(0,x.useAppSelector)((0,iP.selectStreamRunningForDoc)(n.gammaDocId)),O=(0,P.useCallback)(e=>{r({googleSheetsSource:e})},[r]),B="width"in p&&"height"in p,z=iq(p),{containerSize:F}=(t=a.find(e=>e.spec.isGraphyChartDecoration))?t.spec:{isGraphyChartDecoration:!0,containerSize:1},G=B?p.width:iL.CONTENT_WIDTH_PX*F,$=B?p.height:G*z,Z=(0,P.useMemo)(()=>p,[p]);return v?(0,A.jsxs)(H.AnnotatableNodeViewWrapper,{as:"div",...e,children:[(0,A.jsx)(I.Flex,{dir:(0,W.getAlignDirection)(a,d),className:U.MOVEABLE_WRAPPER_CLASSNAME,sx:T,css:S,direction:"column",maxWidth:"100%",children:(0,A.jsx)(E.Box,{ref:k,className:"chart","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,maxWidth:D||iR.isPuppeteer?"100%":void 0,w:B?`calc(${G} * var(--font-size) / 16)`:"calc(100% * var(--media-scale))",h:B&&!D?`calc(${$} * var(--font-size) / 16)`:void 0,aspectRatio:!B&&z?`1/${z}`:void 0,borderRadius:"var(--box-border-radius)",position:"relative","data-drag-handle":!0,children:(0,A.jsx)(iF.ResizeableCloned,{showResizeControls:w&&s,imageWrapperRef:k,isResizing:_,setIsResizing:M,updateResizeAttrs:L,refreshDeps:[Z],disableCloning:!0,keepRatio:!1,children:(0,A.jsx)(E.Box,{position:"relative",pointerEvents:_?"none":"auto",onDoubleClick:()=>{!w||_||j||y(!0)},children:c&&(0,iT.chartNeedsUpgrade)(c)?(0,A.jsx)(iU,{chartData:c,onMigrate:e=>r({chartData:e}),width:G,height:$}):(0,A.jsx)(iK,{chartType:l||"line",graphConfig:c,width:G,height:$,isInteractive:!_&&!iR.isPuppeteer,isDarkCard:f,animateTransitions:!R})})})})}),(0,A.jsx)(iH.GraphyChartEditorModal,{isOpen:b,onClose:()=>{y(!1)},onChange:e=>{let t=(0,ik.inferChartTypeFromGraphConfig)(e);t?r({chartData:e,chartType:t}):r({chartData:e})},initialConfig:c,googleSheetsSource:u,onGoogleSheetsSourceChange:O})]}):(0,A.jsx)(E.Box,{w:"100%",h:"300px"})},iK=(0,P.memo)(function({chartType:t,graphConfig:i,width:n,height:a,isInteractive:r,isDarkCard:o,animateTransitions:s}){let l=r&&!iR.isPuppeteer,d=(0,x.useAppSelector)(C.selectTheme),[c,u]=(0,P.useState)(void 0);(0,P.useEffect)(()=>{e.A(553364).then(e=>{u(o?e.graphyDarkTheme:e.graphyLightTheme)})},[o]);let p=(0,P.useMemo)(()=>(0,iN.getThemeAccentColors)(d).map(e=>(0,iN.getThemeColorSolid)(e)),[d]),h=(0,P.useMemo)(()=>{let e=i||(0,iT.createGraphConfigFromSampleData)(t),n=(0,iT.normalizeGraphConfigData)(e),a=n.appearance,r=a?.customSeriesColors,o=a?.colorScheme||"monochrome",s=(0,iT.calculateColorsNeeded)(n.data),l=n.type||t,c=Object.fromEntries(Object.entries((0,iT.generateSeriesStyles)(o,s,p,d,l,a?.customSolidColor)).map(([e,t])=>{let i=r?.[e]?.color;return[e,{customColor:i||t.customColor}]}));return{...n,appearance:n.appearance?{...n.appearance,seriesStyles:c}:void 0}},[t,i,p,d]),m=(0,P.useCallback)(e=>{let i=h.type||t;iv.datadogLogs.logger.error("graphy.chart.sdk.error",{chartType:i,errorMessage:e.error.message,componentStack:e.errorInfo.componentStack,dataRowCount:h.data?.rows?.length??0,dataColumnCount:h.data?.columns?.length??0},e.error)},[t,h]),g=(0,iT.getChartColorMode)(d);return(0,A.jsx)(E.Box,{className:`is-${g}`,bg:"transparent",w:"100%",h:"100%",children:(0,A.jsx)(iV,{config:h,theme:c,children:(0,A.jsx)(E.Box,{w:"100%",h:"100%",sx:{'[role="figure"]':{h:"100%",minH:l?void 0:`calc(${a} * var(--font-size) / 16)`}},children:(0,A.jsx)(iG,{isEditable:!1,mode:l?"editor":"static",animateTransitions:s,sizing:{mode:l?"keepAspectRatio":"responsive",intrinsicHeight:l?a:void 0,aspectRatio:l?n/a:void 0,width:l?void 0:`min(calc(${n} * var(--font-size) / 16), 100%)`,height:l?void 0:`calc(${a} * var(--font-size) / 16)`},renderTitle:()=>null,onError:m})})})})}),iq=e=>"ratio"in e?e.ratio:e.height/e.width,iY=()=>(0,iC.nanoid)(5),iX=y.UniqueAttribute.extend({name:"UniqueGraphyChartId"}).configure({attributeName:"id",types:["graphyChart"],initialValue:iY,filterTransaction:w.isLocalTransaction,pluginKey:new a.PluginKey("UniqueGraphyChartId")}),iQ=(0,S.createTiptapNode)("graphyChart",{selectable:!0,draggable:!0,addNodeView:()=>(0,v.ReactNodeViewRenderer)(i$,{update:k.attrsOrDecorationsChanged}),addCommands(){return{insertGraphyChart:e=>({commands:t})=>{let i=e?(0,iT.createGraphConfigFromSampleData)(e):null;return t.insertContent({type:this.name,attrs:{id:(0,iC.nanoid)(5),chartType:e||null,chartData:i}})},convertChartToGraphyChart:e=>({tr:t,state:i})=>{try{let n=i.doc.nodeAt(e);if(!n||"chart"!==n.type.name)return!1;let{chartType:r,chartData:o,dimensions:s}=function(e){let{chartType:t,data:i,colorScheme:n,dimensions:a}=e,r=iA[t]||"column",o=(0,ik.getChartTypeConfig)(r),s=o?.graphyConfig.type||"column",l=(0,iS.serializeToGraphyData)(i),d=l.config.properties.map(e=>({key:e.key,label:e.label})),c={type:s,data:{columns:d,rows:l.data},options:{},axes:{y:{min:0},showGridLines:!0},dataLabels:{showDataLabels:!1,dataLabelFormat:"pie"===s||"donut"===s?"percentage":"absolute"},appearance:{seriesStyles:{},colorScheme:n&&"default"!==n?n:"monochrome"}};return{chartType:r,chartData:c,dimensions:"ratio"in a?{ratio:a.ratio}:"width"in a&&"height"in a?{width:a.width,height:a.height}:{ratio:.56}}}(n.attrs),l=i.schema.nodes.graphyChart;if(!l)return!1;return t.setNodeMarkup(e,l,{id:(0,iC.nanoid)(5),chartType:r,chartData:o,dimensions:s,horizontalAlign:n.attrs.horizontalAlign}),t.setSelection(a.NodeSelection.create(t.doc,e)),!0}catch(e){return iv.datadogLogs.logger.error("graphy.chart.convert.error",{errorMessage:e instanceof Error?e.message:"Unknown"},e instanceof Error?e:void 0),!1}},convertTableToGraphyChart:()=>({tr:e,state:t})=>{try{let n=(0,i.findParentNode)(iw.isTableNode)(t.selection);if(!n)return!1;let{node:r,pos:o}=n,{chartType:s,chartData:l,warnings:d}=function(e){let t=[],{width:i,height:n}=i_.TableMap.get(e);if(i<2||n<2)throw Error("Table must have at least 2 columns and 2 rows to convert");let a=[];for(let e=0;e{if("tableRow"!==e.type.name)return;let o=0;e.forEach(e=>{let t;for(;o=i)return;let s=(t="",e.descendants(e=>(e.isText&&(t+=e.text),!0)),t.trim()),{colspan:l=1,rowspan:d=1}=e.attrs;for(let e=0;eiE.CHART_MAX_COLS&&t.push(`Table has ${r} data columns. Only first ${iE.CHART_MAX_COLS} will be used.`);let o=a[0].slice(1,iE.CHART_MAX_COLS+1),s=[{key:(0,iC.nanoid)(5),label:a[0][0]||"Label"},...o.map(e=>({key:(0,iC.nanoid)(5),label:e||"Value"}))],l=Math.min(n-1,iE.CHART_MAX_ROWS);n-1>iE.CHART_MAX_ROWS&&t.push(`Table has ${n-1} rows. Only first ${iE.CHART_MAX_ROWS} will be used.`);let d=[];for(let e=1;e<=l;e++){let n={};n[s[0].key]=a[e][0];let r=Math.min(i,iE.CHART_MAX_COLS+1);for(let i=1;i0&&console.warn("Table to chart conversion warnings:",d);let c=t.schema.nodes.graphyChart;if(!c)return!1;let u=c.create({id:(0,iC.nanoid)(5),chartType:s,chartData:l,dimensions:{ratio:.56}});return e.replaceWith(o,o+r.nodeSize,u),e.setSelection(a.NodeSelection.create(e.doc,o)),!0}catch(e){return iv.datadogLogs.logger.error("graphy.table.convert.error",{errorMessage:e instanceof Error?e.message:"Unknown"},e instanceof Error?e:void 0),!1}}}},addProseMirrorPlugins:()=>[new a.Plugin({key:iM,props:{decorations(e){var t;let i,n=(t=e.doc,i=[],t.descendants((e,n)=>{if("graphyChart"!==e.type.name)return;let a=(0,iI.getContainerSize)(t.resolve(n));i.push(tD.Decoration.node(n,n+e.nodeSize,{},{isGraphyChartDecoration:!0,containerSize:a}))}),i);return tD.DecorationSet.create(e.doc,n)}}})],addExtensions:()=>[iX],parseHTML:()=>[{tag:'div[data-type="graphyChart"]',getAttrs:e=>({id:(0,S.parseIdAttr)(e,iY),chartType:e.getAttribute("data-chart-type")||null,chartData:(0,S.parseJSONAttr)(e,"chart-data")??null,dimensions:(0,S.parseJSONAttr)(e,"dimensions")??{ratio:.56},googleSheetsSource:(0,S.parseJSONAttr)(e,"googleSheetsSource")??null})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{"data-type":"graphyChart",...e.attrs.chartType&&{"data-chart-type":e.attrs.chartType},...e.attrs.chartData&&{"data-chart-data":JSON.stringify(e.attrs.chartData)},...(0,S.renderJSONAttrs)(e.attrs,"dimensions","googleSheetsSource")})]});e.s(["Grid",()=>n$],796350);var iJ=e.i(55889),i0=e.i(285598),i1=e.i(662752),i2=e.i(77606),i3=e.i(946107);class i5{dragging;constructor(e=null){this.dragging=e}}let i4=new a.PluginKey("gridPlugin");e.s(["GridView",()=>nz],783538);var i6=e.i(343902),i9=e.i(143863);e.i(144786);var i8=e.i(731378);let i7=(0,P.memo)(({gap:e,onResizeMouseDown:t,isEditable:i,isVisible:n,canResize:a,gridId:r})=>{let o=(0,x.useAppSelector)(i8.selectShowGridItemDebugOverlay),s=(0,P.useCallback)(i=>{t(i,e)},[t,e]),l=`var(--grid-${r}-gap-${e.flowGroupIndex}-position, ${e.gridColumnStart}) / span 1`;return i&&n?(0,A.jsx)(E.Box,{className:"inner-row-column-control-cell",gridColumn:l,pointerEvents:"none",position:"relative",gridRow:"1 / -1",contentEditable:!1,children:(0,A.jsx)(E.Box,{className:"inner-row-column-control","data-grid-id":r,"data-gap-index":e.flowGroupIndex,position:"absolute",insetStart:`calc(-${i1.GAP/2}em + 1px)`,top:0,bottom:0,width:`${i1.GAP}em`,opacity:.9,cursor:a?"ew-resize":"default",pointerEvents:"auto",transitionProperty:"opacity",transitionDuration:"0.2s",onMouseDown:s,_hover:{opacity:1},children:(0,A.jsx)(E.Box,{sx:{position:"absolute",width:"2px",height:"100%",left:"50%",backgroundColor:a?o?"orange":"trueblue.300":"gray.300",opacity:1}})})}):null});i7.displayName="InnerRowColumnControl";var ne=e.i(176636);class nt{activeGrid=null;edges=[];visibleEdges=new Set;hasVisibleEdges(){return this.visibleEdges.size>0}clear(){return this.activeGrid=null,this.edges=[],this.visibleEdges=new Set,this}setActiveGrid(e){return this.activeGrid=e.setActiveGrid,this}setEdges(e){return this.edges=e.setEdges,this}setVisibleEdges(e){return this.visibleEdges=e.setVisibleEdges,this}apply(e){let t=e.getMeta(ni);return t&&"setActiveGrid"in t?this.setActiveGrid(t):t&&"setEdges"in t?this.setEdges(t):t&&"setVisibleEdges"in t?this.setVisibleEdges(t):t&&"clear"in t?this.clear():this}}let ni=new a.PluginKey("gridOuterControls"),nn=(e,t)=>{let i=e.state.tr.setMeta(ni,{setEdges:t});e.dispatch(i)},na=(e,t)=>{let i=e.state.tr.setMeta(ni,{setVisibleEdges:t});e.dispatch(i)};var nr=e.i(325059),no=e.i(625878);let ns=new a.PluginKey("gridResizing");class nl{activeCellHandle;draggingPrimary;draggingGap;handleInfo;activeGridPos;activeGridGaps;constructor(e=null,t=null,i=null,n=null,a=null,r=[]){this.activeCellHandle=e,this.draggingPrimary=t,this.draggingGap=i,this.handleInfo=n,this.activeGridPos=a,this.activeGridGaps=r}getActiveCellHandleAbs(e){return this.activeCellHandle?(0,no.relativeToAbsolutePos)(e,this.activeCellHandle):null}getParentGridOfActiveCellHandle(e){if(!this.activeCellHandle)return null;let t=(0,no.relativeToAbsolutePos)(e,this.activeCellHandle),n=t&&e.doc.resolve(t);return n?(0,i.findParentNodeClosestToPos)(n,e=>"grid"===e.type.name)??null:null}reset(){return this.activeCellHandle=null,this.draggingPrimary=null,this.handleInfo=null,this.activeGridPos=null,this.activeGridGaps=[],this}setCellHandle(e,t){return null===t.setCellHandle?(this.activeCellHandle=null,this.handleInfo=null):(this.activeCellHandle=(0,no.absoluteToRelativePos)(e,t.setCellHandle),this.handleInfo=t.handleInfo??null),this}setActiveGridPos(e){return this.activeGridPos=e.setActiveGridPos,this}setActiveGridGaps(e){return this.activeGridGaps=e.setActiveGridGaps,this}setDraggingPrimary(e){return this.draggingPrimary=e.setDraggingPrimary,this}setDraggingSecondary(e){return this.draggingGap=e.setDraggingSecondary,this}apply(e,t){let i=e.getMeta(ns);return i&&"setCellHandle"in i?this.setCellHandle(t,i):i&&"setActiveGridPos"in i?this.setActiveGridPos(i):i&&"setActiveGridGaps"in i?this.setActiveGridGaps(i):i&&"setDraggingPrimary"in i?this.setDraggingPrimary(i):i&&"setDraggingSecondary"in i?this.setDraggingSecondary(i):i&&"reset"in i?this.reset():this}}let nd=(e,t,i)=>{e.dispatch(e.state.tr.setMeta(ns,{setCellHandle:t,handleInfo:i??void 0}))},nc=(e,t)=>{e.dispatch(e.state.tr.setMeta(ns,{setDraggingPrimary:t}))},nu=(e,t)=>{e.dispatch(e.state.tr.setMeta(ns,{setDraggingSecondary:t}))},np=e=>{e.dispatch(e.state.tr.setMeta(ns,{reset:!0}))};function nh(e,t){let{node:i,offset:n}=e.domAtPos(t.start()),a=i.childNodes[n];do if(a&&a.classList&&a.classList.contains("node-grid"))return a;while(a=a.parentNode)return null}function nm(e,t){let i=e.domAtPos(t);return i.node.childNodes[i.offset].getBoundingClientRect()}function ng(e,t,i,n){let a=("horizontal"===n?e.clientX:e.clientY)-t,r="horizontal"===n&&(0,nr.isRtlEnabled)()?-a:a,o=Math.round(r/i);return{pixelDelta:a,adjustedDelta:r,spanDelta:o}}function nf(e,t,i,n){let a=e.state.tr;for(let[e,r]of n.entries()){let n=(0,ne.getCellPosInGrid)({pos:t,node:i},e),o=a.doc.resolve(n).nodeAfter,s={...o.attrs?.options||{}};void 0!==r.horizontalColumnSpan&&(s.horizontalColumnSpan=r.horizontalColumnSpan),void 0!==r.horizontalRowSpan&&(s.horizontalRowSpan=r.horizontalRowSpan),void 0!==r.verticalRowSpan&&(s.verticalRowSpan=r.verticalRowSpan),void 0!==r.verticalColumnSpan&&(s.verticalColumnSpan=r.verticalColumnSpan),a=a.setNodeMarkup(n,void 0,{options:s})}if(n.size>0){let e=n.keys().next().value,r=(0,ne.getCellPosInGrid)({pos:t,node:i},e);a=a.setMeta("annotationEvent",{type:"update-node-attrs",pos:r})}e.dispatch(a)}function nb(e,t,i,n,a){if(!e)return;let r=`--grid-${t}-item-${i}-resize-${a}`;e.style.setProperty(r,`${n}`),e.setAttribute(`data-resizing-item-${i}`,"true")}function nx(e,t,i,n){if(!e)return;let a=`--grid-${t}-item-${i}-resize-${n}`;e.style.removeProperty(a),e.removeAttribute(`data-resizing-item-${i}`)}function ny(e,t,i,n){if(!e)return;let a=`--grid-${t}-gap-${i}-position`;e.style.setProperty(a,`${n}`)}function nv(e,t,i){if(!e)return;let n=`--grid-${t}-gap-${i}-position`;e.style.removeProperty(n)}function nC(e,t,i,n){let a=n??(0,nr.isRtlEnabled)(),r=a?e-i.left:i.right-e,o=a?i.right-e:e-i.left;return{top:t-i.top,bottom:i.bottom-t,left:o,right:r}}function nw(e,t,i,n=i1.PROXIMITY_THRESHOLD){switch(i){case"top":return e.y>=t.top-n&&e.y<=t.top+n&&e.x>=t.left&&e.x<=t.right;case"bottom":return e.y>=t.bottom-n&&e.y<=t.bottom+n&&e.x>=t.left&&e.x<=t.right;case"left":return e.x>=t.left-n&&e.x<=t.left+n&&e.y>=t.top&&e.y<=t.bottom;case"right":return e.x>=t.right-n&&e.x<=t.right+n&&e.y>=t.top&&e.y<=t.bottom}}function nS(e,t,i,n,a,r=25){var o,s,l,d,c,u;let p,h,m,g,f,b,x,y,v,C,w=nm(e,t);if(!w)return[];let S=[],k=(o=i,s=n,p=(0,i2.getFlowGroups)(o),h=p[0]?.indices?.length>1,m=nA(o,s),g=nk(o,s),h||m||g),A=(l=i,d=n,f=(0,i2.getFlowGroups)(l),b=f[f.length-1]?.indices?.length>1,x=nA(l,d),y=nk(l,d),b||x||y),E=(c=i,u=n,v=(0,i2.getFlowGroups)(c).length>1,C=nk(c,u),v||C);return"horizontal"===n?(E&&(S.push({edge:"left",isBeforeGrid:!0,isPerpendicular:!0,isHovered:!!a&&nw(a,w,"left",r)}),S.push({edge:"right",isBeforeGrid:!1,isPerpendicular:!0,isHovered:!!a&&nw(a,w,"right",r)})),k&&S.push({edge:"top",isBeforeGrid:!0,isPerpendicular:!1,isHovered:!!a&&nw(a,w,"top",r)}),A&&S.push({edge:"bottom",isBeforeGrid:!1,isPerpendicular:!1,isHovered:!!a&&nw(a,w,"bottom",r)})):(E&&(S.push({edge:"top",isBeforeGrid:!0,isHovered:!!a&&nw(a,w,"top",r),isPerpendicular:!0}),S.push({edge:"bottom",isBeforeGrid:!1,isHovered:!!a&&nw(a,w,"bottom",r),isPerpendicular:!0})),k&&S.push({edge:"left",isBeforeGrid:!0,isPerpendicular:!1,isHovered:!!a&&nw(a,w,"left",r)}),A&&S.push({edge:"right",isBeforeGrid:!1,isPerpendicular:!1,isHovered:!!a&&nw(a,w,"right",r)})),S}function nk(e,t){let i="horizontal"===t?"vertical":"horizontal",n=!1;return e.forEach(e=>{"gridItem"===e.type.name&&e.forEach(e=>{"grid"===e.type.name&&(e.attrs?.options?.gridDirection||"horizontal")===i&&(n=!0)})}),n}function nA(e,t){let i=e.child(0);if("gridItem"!==i.type.name)return!1;let n=!1;return i.forEach(e=>{"grid"===e.type.name&&(e.attrs?.options?.gridDirection||"horizontal")===t&&(n=!0)}),n}let nE={enabled:!0,proximityThreshold:i1.PROXIMITY_THRESHOLD,requireFocusWhenSelected:!0,hideForNestedGrids:!0};function n_(e){let{activeGrid:t,edges:i}=e,n=new Set;return!t||t.isNested||(t.isSelected&&t.hasFocus?i.forEach(e=>{n.add(e.edge)}):t.isSelected||i.forEach(e=>{e.isHovered&&n.add(e.edge)})),n}var nI=e.i(940126);let nM={right:{top:0,bottom:0,right:"calc(0px - 1em)",width:"1em"},left:{top:"40px",bottom:0,left:"calc(0px - 1em)",width:"1em"},bottom:{left:0,right:0,bottom:"calc(0px - 1em)",height:"1em"},top:{left:0,right:0,top:"calc(0px - 1em)",height:"1em"}},nT=(0,P.memo)(({edge:e,isVisible:i,isEditable:n,editor:a,node:r,getPos:o})=>{var s;let l=(0,P.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),d=(0,P.useCallback)(()=>{let t=o();"number"==typeof t&&(e.isPerpendicular?a.commands.wrapGridInPerpendicularParent(r,t,e.isBeforeGrid?"before":"after"):e.isBeforeGrid?a.commands.addPrimaryGroup({gridNode:r,gridPos:t,before:!0}):a.commands.addPrimaryGroup({gridNode:r,gridPos:t,before:!1}))},[a,r,o,e]),c=(0,P.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),d()},[d]),u={position:"absolute",backgroundColor:"gray.300",opacity:.3,cursor:"pointer",...nM[e.edge],_hover:{opacity:1}},p="right"===(s=e.edge)||"left"===s?{position:"absolute",top:"left"===s?"calc(50% - 20px)":"50%",transform:"translateY(-50%)",insetInlineStart:"0",height:"26px",width:"1em"}:{position:"absolute",top:"0",transform:"translateX(-50%)",insetInlineStart:"50%",height:"1em",width:"26px"};return n&&i?(0,A.jsxs)(I.Flex,{className:"outer-row-column-control",...u,transitionProperty:"opacity",transitionDuration:"0.2s",contentEditable:!1,children:[(0,A.jsx)(I.Flex,{sx:{position:"absolute",width:"100%",height:"100%",top:"0",left:"0",backgroundColor:"gray.300",opacity:.3,borderRadius:"2px"},onMouseDown:c}),(0,A.jsx)(I.Flex,{...p,children:(0,A.jsx)(nI.BaseDragHandle,{isSelected:!1,isVisible:!0,onMouseDown:c,onDragStart:l,top:0,insetInlineStart:0,icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faPlus,size:"xs"}),label:"left"===e.edge||"right"===e.edge?t.i18n._({id:"AgvHni",message:"Add column"}):t.i18n._({id:"qZd/ph",message:"Add row"}),width:p.width,height:p.height})})]}):null});nT.displayName="OuterRowColumnControl";var nL=e.i(280484),nj=e.i(565647);function nP(e,t,i,n){let a=(0,nL.getGridDirection)(i),r=(0,i2.getFlowGroups)(i),o=i.attrs?.id||"unknown",s=[];try{if(!nm(e,t))return s;let l=nD({flowGroups:r,gridDirection:a,gridPos:t,gridNode:i,widthOverrides:n});l.length>0&&s.push({gridPos:t,gridId:o,gaps:l});let d=function e(t,i,n){let a=[];return n.forEach((n,r)=>{if("gridItem"!==n.type.name)return;let o=i+1+r;n.descendants((i,n)=>{if("grid"===i.type.name){let r=i.attrs?.options?.gridDirection||"horizontal";if("vertical"===r){let s=o+1+n;try{if(nm(t,s)){let n=i.attrs?.id||"unknown",o=(0,i2.getVerticalColumnGroupings)(i),l=nD({flowGroups:o,gridDirection:r,gridPos:s,gridNode:i,widthOverrides:void 0});a.push({gridPos:s,gridId:n,gaps:l});let d=e(t,s,i);a.push(...d)}}catch(e){console.error("Error calculating nested grid gap positions:",e)}}}})}),a}(e,t,i);s.push(...d)}catch(e){console.error("Error calculating gap position:",e)}return s}function nD({gridDirection:e,flowGroups:t,gridPos:i,gridNode:n,widthOverrides:a}){let r=[];if("horizontal"===e)return r;let o=(0,i2.calculateStretchedVerticalColumns)(n,a);return t.forEach((e,a)=>{let s=e.indices[e.indices.length-1];if(void 0===s)return;let l=(0,ne.getCellPosInGrid)({pos:i,node:n},s);if(a===t.length-1)return;let d=1;for(let e=0;e<=a;e++){let i=t[e].indices[0];d+=o.get(i)||4}r.push({gridColumnStart:d,flowGroupIndex:a,isVisible:!1,edge:"right",lastCellPos:l})}),r}function nN(e,t){let i=e,n=t-e;return ni1.MAX_ITEM_WIDTH?(n=i1.MAX_ITEM_WIDTH,i=t-i1.MAX_ITEM_WIDTH):it-i1.MIN_ITEM_WIDTH&&(i=t-i1.MIN_ITEM_WIDTH,n=i1.MIN_ITEM_WIDTH),{clampedDragWidth:i,clampedLinkedWidth:n}}function nR(e,t,i){let n=e.state.doc.resolve(i),a=[];for(let t=n.depth;t>0;t--){let i=n.node(t);if("grid"===i.type.name){let r=n.before(t),o=i.attrs?.options?.gridStyle;if(!(0,nj.isFlexibleGrid)(o))continue;let l=null;for(let e=t+1;e<=n.depth;e++)if("gridItem"===n.node(e).type.name&&e-1===t){l=n.before(e);break}if(null===l)continue;let d=(0,s.getGridItemRect)(e,l);if(!d)continue;a.push({gridPos:r,gridNode:i,cellPos:l,cellRect:d,isNested:t>1})}}let r=[];for(let i of a){let n=function(e,t,i,n,a,r){if(!n)return null;let o=e.state.doc.resolve(a).index(e.state.doc.resolve(i).depth+1);(0,nL.getGridDirection)(n);let{isLastInFlowGroup:s,flowGroupIndex:l}=function(e,t){let i=-1,n=!1;for(let a=0;a0&&n.bottom>0&&n.left>0&&n.right>0?[{edge:"top",distance:n.top},{edge:"bottom",distance:n.bottom},{edge:"left",distance:n.left},{edge:"right",distance:n.right}].reduce((e,t)=>t.distancee.distance-t.distance),r[0].handleInfo)}let nO=(e,t,i)=>(function(e,t,i,n=i1.PROXIMITY_THRESHOLD){let a=nC(e,t,i,void 0),r=a.bottom>0&&a.right>0&&a.left>0,o=a.right<0&&a.right>-n&&a.bottom>0&&a.top>0;return r&&a.right<=n||o})(e,t,i,s.GAP_SAMPLE_MARGIN);function nB({view:e,event:t}){let i=ns.getState(e.state);if(null!==i.activeGridPos&&i.activeGridGaps.length>0){let n=t.clientX,a=t.target;if(!a||!(a instanceof HTMLElement))return;let r=a.closest(".inner-row-column-control"),o=r?r.dataset.gridId:null,s=r?parseInt(r.dataset.gapIndex||"-1",10):-1,l=!1,d=i.activeGridGaps.map(t=>{let i=t.gaps.some(e=>e.isVisible),a=e.state.doc.nodeAt(t.gridPos);if(!a)return t;let r=a.attrs?.id,d=nm(e,t.gridPos);if(!d)return t;let c=d.width,u=t.gaps.map(e=>{let t=e.gridColumnStart/i1.FLEXIBLE_GRID_CROSS_SPAN_TOTAL,a=Math.abs(n-(d.left+t*c-i1.PROXIMITY_THRESHOLD)){let n,a,{node:r,decorations:o,editor:s,getPos:l}=e,{options:d}=r.attrs,c=(0,i3.findGridDecoration)(o),u=(n=o.find(e=>e.spec.isGridGapDecoration))?n.spec:{isGridGapDecoration:!0,gapPositions:[]},p=(a=o.find(e=>e.spec.isOuterControlsDecoration))?a.spec:{isOuterControlsDecoration:!0,outerEdges:[]},h=(0,x.useAppSelector)(C.selectEditable),m=c.isNestedGrid,g=c.isSubgrid,f=(0,P.useMemo)(()=>({onClick:e=>{if(e.currentTarget===e.target){let e=l();"number"==typeof e&&s.commands.selectNodeAtPos(e)}},cursor:h?"auto":"default"}),[s,l,h]),b=(e,t)=>{(({view:e,event:t,gap:n})=>{let a,r;if(!e.editable)return;let o=ns.getState(e.state);if(o?.draggingGap)return;let s=e.state.doc.resolve(n.lastCellPos),l=s.nodeAfter,d=(0,i.findParentNodeClosestToPos)(s,e=>"grid"===e.type.name);if(!d)return;let c=s.index(d.depth),u=(0,nL.getGridDirection)(d.node),p=(0,nL.getGridId)(d.node),h=nh(e,s),m=h?h.querySelector(".grid-resize-overlay"):null;if(!h)return;let g="right"===n.edge?h.offsetWidth:h.offsetHeight,f=g/i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,b="vertical"===u?(0,i2.calculateStretchedVerticalColumns)(d.node):new Map,x=n.flowGroupIndex,y=(0,i2.getFlowGroups)(d.node),v=y[x].indices[0],C=b.get(v)??(0,ne.getCrossSpan)(l.attrs?.options||{},u)??0;if(n.flowGroupIndex{let i=d.node.child(e),n=b.get(e)??(0,ne.getCrossSpan)(i.attrs?.options||{},u)??0;void 0!==n&&n>t&&(t=n)}),r=t||i1.MIN_ITEM_WIDTH}nu(e,{startCoord:"right"===n.edge?t.clientX:t.clientY,cellIndex:c,initialWidth:C??0,containerSize:g,pixelsPerUnit:f,linkedFlowGroupIndex:a,initialLinkedCrossSpan:r});let w=null,S=null;function k(){window.removeEventListener("mouseup",k),window.removeEventListener("mousemove",A);let t=ns.getState(e.state);if(t.draggingGap){if(null===w)return void nu(e,null);if(t.draggingGap)try{let a=e.state.doc.resolve(n.lastCellPos),r=(0,i.findParentNodeClosestToPos)(a,e=>"grid"===e.type.name);if(!r){console.error("[GridResize] Could not find parent grid"),nu(e,null);return}let o=a.before(r.depth),s=(0,nL.getGridDirection)(r.node),l=new Map,d=(0,i2.getFlowGroups)(r.node),c=d[n.flowGroupIndex];c.indices.forEach(e=>{"horizontal"===s?l.set(e,{horizontalRowSpan:w??void 0}):l.set(e,{verticalColumnSpan:w??void 0})});let{linkedFlowGroupIndex:u}=t.draggingGap;void 0!==u&&null!==S&&d[u].indices.forEach(e=>{"horizontal"===s?l.set(e,{horizontalRowSpan:S??void 0}):l.set(e,{verticalColumnSpan:S??void 0})});let p=r.node.attrs.id||"unknown";c.indices.forEach(e=>{nx(h,p,e,"cross"),m&&nx(m,p,e,"cross")}),void 0!==u&&d[u].indices.forEach(e=>{nx(h,p,e,"cross"),m&&nx(m,p,e,"cross")}),d.forEach((e,t)=>{nv(h,p,t),m&&nv(m,p,t)}),requestAnimationFrame(()=>{nf(e,o,r.node,l),nu(e,null);let i=new Map;l.forEach((e,t)=>{let n="horizontal"===s?e.horizontalRowSpan:e.verticalColumnSpan;void 0!==n&&i.set(t,n)});let n=nP(e,r.pos,r.node,i);t.setActiveGridGaps({setActiveGridGaps:n})})}catch(t){console.error("[GridResize] Error during finish:",t),np(e)}w=null,S=null}}function A(t){let i;if(!t.which)return k();let a=ns.getState(e.state);if(!a.draggingGap)return;let r=n.flowGroupIndex,o="right"===n.edge?"horizontal":"vertical",{startCoord:s,initialWidth:l,pixelsPerUnit:c,linkedFlowGroupIndex:u,initialLinkedCrossSpan:g}=a.draggingGap,{spanDelta:f}=ng(t,s,c,o),b=l+f,x=null;if(void 0!==u&&void 0!==g){let{clampedDragWidth:e,clampedLinkedWidth:t}=nN(b,l+g);i=e,x=t}else i=Math.max(i1.MIN_ITEM_WIDTH,Math.min(i1.MAX_ITEM_WIDTH,b));let y=(0,i2.getFlowGroups)(d.node),v=y[r];if(v.indices.forEach(e=>{nb(h,p,e,i,"cross")}),void 0!==u&&null!==x){let e=y[u],t=x;e.indices.forEach(e=>{nb(h,p,e,t,"cross")})}try{let e=new Map;if(v.indices.forEach(t=>{e.set(t,i)}),void 0!==u&&null!==x){let t=y[u],i=x;t.indices.forEach(t=>{e.set(t,i)})}let t=(0,i2.calculateStretchedVerticalColumns)(d.node,e);y.forEach((e,i)=>{let n=1;for(let e=0;e<=i;e++){let i=y[e].indices[0],a=t.get(i)||4;n+=a}ny(h,p,i,n),m&&ny(m,p,i,n)})}catch(e){console.error("Error updating gap positions during cross drag:",e)}w=i,S=x}return window.addEventListener("mouseup",k),window.addEventListener("mousemove",A),t.preventDefault()})({view:s.view,event:e,gap:t})},y=(0,P.useMemo)(()=>{let e=u.gapPositions??[];return(0,A.jsx)(A.Fragment,{children:e.map((e,t)=>(0,A.jsx)(i7,{gap:e,gridId:r.attrs.id,isVisible:e.isVisible,canResize:!0,isEditable:h,onResizeMouseDown:b},`gap-${t}`))})},[u.gapPositions,p.outerEdges,l,r,s,h,b]);return(0,A.jsxs)(H.AnnotatableNodeViewWrapper,{dir:c.direction,...e,style:{position:"relative",height:"100%"},className:(0,tC.cx)(h&&"is-editable","grid"),children:[!g&&(0,A.jsx)(i6.ContainerDragHandle,{handlePlacement:"outside",...e,"data-testid":"grid-drag-handle",label:t.i18n._({id:"HcGvxr",message:"Select grid"})}),(0,A.jsxs)(i9.GridWrapper,{gridStyle:d.gridStyle||"standard",spacing:d.spacing||"medium",cellSize:d.cellSize,horizontalAlign:d.horizontalAlign,orientation:d.orientation||"horizontal",gridDirection:d.gridDirection||"horizontal",numCells:c.numCells,containerSize:c.containerSize,onContextMenu:()=>{},selectLayoutForElementProps:f,gridNode:r,editor:s,crossEdgeControl:y,className:m?"grid-nested":g?"grid-nested-full-bleed":void 0,children:[(0,A.jsx)(tu.NodeViewContent,{"data-node-view-content-outer":"grid"}),p.outerEdges.map(e=>(0,A.jsx)(nT,{edge:e,isVisible:!0,isEditable:h,editor:s,node:r,getPos:l},`outer-edge-${e.edge}`))]})]})};function nF(e,t,i){let n=Math.floor(t/e.length),a=t-n*e.length;e.forEach((e,t)=>{let r=Math.max(i1.MIN_ITEM_WIDTH,Math.min(i1.MAX_ITEM_WIDTH,n+ +(tt.indices.includes(e));if(!a)return{newCellSpan:i1.DEFAULT_ITEM_WIDTH,cellUpdates:new Map};let r=new Map,o=i1.MIN_ITEM_WIDTH;if(a.spanTotal+ot.indices.includes(e));if(!a||1===a.indices.length)return{cellUpdates:new Map};let r=[];a.indices.forEach(i=>{if(i!==e){let e=t.child(i),a=(0,ne.getFlowSpan)(e.attrs.options||{},n);r.push({index:i,currentWidth:a})}});let o=new Map;return a.spanTotale.index),i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,o),{cellUpdates:o}}class nU{editorView;dropTargetPos=null;draggedPos=null;draggedCellIndex=null;draggedGroupIndex=null;targetGroupIndex=null;insertBeforeIndex=null;dropSide=null;handlers;constructor(e){this.editorView=e,this.handlers=["dragover","dragleave","dragend"].map(t=>{let i=e=>this[t](e);return e.dom.addEventListener(t,i),{name:t,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t)),this.clearHighlight()}dragover(e){e.preventDefault();let t=this.editorView.dragging;if(!t?.slice)return;let n=t.slice.content.firstChild;if(n?.type.name!=="gridItem")return;if(!this.draggedPos){let e=this.editorView.state.selection;e&&"from"in e&&(this.draggedPos=e.from)}if(!this.draggedPos)return;let a=(0,s.checkGridItemDropTarget)(this.editorView,e,t.slice);if(!a?.pos||!this.isInSameGrid(this.draggedPos,a?.pos)||this.draggedPos===a?.pos)return void this.clearHighlight();let r=this.editorView.state.doc.resolve(a?.pos),o=(0,i.findParentNodeClosestToPos)(r,e=>"grid"===e.type.name);if(!o)return;let l=this.editorView.state.doc.resolve(this.draggedPos).index(o.depth),d=r.index(o.depth),c=(0,i2.getFlowGroups)(o.node),u=c.findIndex(e=>e.indices.includes(l)),p=c.findIndex(e=>e.indices.includes(d));this.draggedCellIndex=l,this.draggedGroupIndex=u,this.targetGroupIndex=p,this.insertBeforeIndex=a?.side==="left"||a?.side==="top"?d:d+1,this.dropTargetPos=a?.pos||null,this.dropSide=a?.side||null}dragleave(e){let t=e.relatedTarget;t&&!this.editorView.dom.contains(t)&&this.clearHighlight()}dragend(e){this.clearState()}setHighlight(e){this.clearHighlight(),e.setAttribute("data-drop-target","true")}clearHighlight(){document.querySelectorAll("[data-drop-target]").forEach(e=>{e.removeAttribute("data-drop-target")})}clearState(){this.draggedPos=null,this.dropTargetPos=null,this.draggedCellIndex=null,this.draggedGroupIndex=null,this.targetGroupIndex=null,this.insertBeforeIndex=null,this.dropSide=null,this.clearHighlight()}isInSameGrid(e,t){let n=this.editorView.state.doc.resolve(e),a=this.editorView.state.doc.resolve(t),r=(0,i.findParentNodeClosestToPos)(n,e=>"grid"===e.type.name),o=(0,i.findParentNodeClosestToPos)(a,e=>"grid"===e.type.name);return!!(r&&o&&r.pos===o.pos)}calculateInsertPosition(e){return null===this.insertBeforeIndex?e.pos+1:this.insertBeforeIndex>=e.node.childCount?e.pos+e.node.nodeSize-1:(0,ne.getCellPosInGrid)(e,this.insertBeforeIndex)}handleDrop(e,t,i,n){let a=i.content.firstChild;return a?.type.name==="gridItem"&&(this.draggedPos&&null!==this.insertBeforeIndex&&null!==this.draggedGroupIndex&&null!==this.targetGroupIndex?(this.draggedGroupIndex===this.targetGroupIndex?this.reorderWithinSameGroup():this.moveToNewGroup(),this.clearState(),!0):(this.clearState(),!1))}reorderWithinSameGroup(){if(!this.draggedPos||null===this.insertBeforeIndex||null===this.draggedCellIndex||this.draggedCellIndex===this.insertBeforeIndex)return;let e=this.editorView.state.tr,t=this.editorView.state,n=t.doc.nodeAt(this.draggedPos);if(!n)return;let r=t.doc.resolve(this.draggedPos),o=(0,i.findParentNodeClosestToPos)(r,e=>"grid"===e.type.name);if(!o)return;let s=this.calculateInsertPosition(o),l=this.draggedPos+n.nodeSize;e.delete(this.draggedPos,l);let d=e.mapping.map(s);e.insert(d,n),e.setSelection(a.NodeSelection.create(e.doc,d)),this.editorView.dispatch(e)}moveToNewGroup(){let e;if(!this.draggedPos||null===this.insertBeforeIndex||null===this.draggedCellIndex)return;let t=this.editorView.state.tr,n=this.editorView.state,r=n.doc.nodeAt(this.draggedPos);if(!r)return;let o=n.doc.resolve(this.draggedPos),s=(0,i.findParentNodeClosestToPos)(o,e=>"grid"===e.type.name);if(!s)return;let{direction:l,style:d}=(0,nL.getGridMetadata)(s.node),c=nW(this.draggedCellIndex,s.node,d,l),{newCellSpan:u,cellUpdates:p}=nH("left"===this.dropSide||"top"===this.dropSide?this.insertBeforeIndex:Math.max(0,this.insertBeforeIndex-1),s.node,d,l),h=new Map(Array.from(c.cellUpdates).filter(([e])=>e!==this.draggedCellIndex));(0,ne.applyCellSpanUpdates)(t,s,h);let m=new Map(Array.from(p).filter(([e])=>e!==this.draggedCellIndex));(0,ne.applyCellSpanUpdates)(t,s,m);let g=t.mapping.map(this.draggedPos),f=g+r.nodeSize;t.delete(g,f);let b=this.calculateInsertPosition(s),x=t.mapping.map(b),y=(0,i2.getFlowGroups)(s.node)[this.targetGroupIndex];if(y&&y.indices.length>0){let t=y.indices[0],i=Math.abs(t-this.insertBeforeIndex);for(let e of y.indices){let n=Math.abs(e-this.insertBeforeIndex);n(0,iC.nanoid)(10),nG=y.UniqueAttribute.extend({name:"UniqueGridId"}).configure({attributeName:"id",types:["grid"],initialValue:nV,filterTransaction:w.isLocalTransaction,pluginKey:new a.PluginKey("UniqueGridId")}),n$=(0,S.createTiptapNode)("grid",{isolating:!0,containerHandle:!0,defining:!0,priority:tt.ExtensionPriorityMap.Grid,parseHTML:()=>[{tag:"div[class=grid]",getAttrs:e=>({id:(0,S.parseIdAttr)(e,nV),options:(0,S.parseJSONAttr)(e,"options")??{}})},{tag:"grid",getAttrs:e=>({id:(0,S.parseIdAttr)(e,nV),options:(0,S.parseJSONAttr)(e,"options")??{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"grid","data-id":e.attrs.id,...(0,S.renderJSONAttrs)(e.attrs,"options")}),0],addNodeView:()=>(0,v.ReactNodeViewRenderer)(nz,{update:k.numChildrenOrAttrsOrDecorationsChanged,ignoreMutation:iJ.ignoreDataMutation}),addProseMirrorPlugins(){let e;return[(this.editor,new a.Plugin({key:i4,state:{init:()=>new i5,apply:(e,t)=>t},props:{decorations:e=>(0,i3.decorateGrids)(e)}})),new a.Plugin({key:ns,state:{init:()=>new nl,apply:(e,t,i,n)=>t.apply(e,n)},view:e=>({update(e,t){((e,t)=>{let i=e.state,n=ns.getState(e.state);if(!n)return;let a=!t?.selection.eq(i.selection),r=t.doc!==i.doc&&null!==n.activeGridPos;if(!a&&!r)return;let o=a?(0,ne.findGridContainingSelection)(i):null!==n.activeGridPos?{pos:n.activeGridPos,node:i.doc.nodeAt(n.activeGridPos)}:null;if(!o)return;let{pos:s,node:l}=o;if(!l)return;let d=l.attrs?.options?.gridStyle;if((0,nj.isFlexibleGrid)(d))try{let t=nP(e,s,l);n.setActiveGridPos({setActiveGridPos:s}),n.setActiveGridGaps({setActiveGridGaps:t})}catch(e){console.error("Error calculating gap positions:",e)}})(e,t)}}),props:{handleDOMEvents:{mousemove:(e,t)=>(((e,t)=>{if(!e.editable||!t.target)return;let i=ns.getState(e.state);if(!i||i.draggingGap)return;let n=t.target.closest(".node-grid");if(!n)return;let a=function(e,t){try{let i=e.posAtDOM(t,0);if(null==i)return null;return(0,ne.findRootGridAtPos)(e.state,i)}catch(e){return null}}(e,n),r=a?a.pos:null;null!==r&&r!==i.activeGridPos?(function({view:e,pluginState:t,hoveredGridPos:i}){let n=e.state.doc.nodeAt(i);if(n&&(0,nj.isFlexibleGrid)(n.attrs?.options?.gridStyle)){let a=nP(e,i,n);t.setActiveGridPos({setActiveGridPos:i}),t.setActiveGridGaps({setActiveGridGaps:a})}}({view:e,pluginState:i,hoveredGridPos:r}),nB({view:e,event:t})):null!==r&&nB({view:e,event:t})})(e,t),((e,t)=>{if(!e.editable||!t.target||t.target.closest(".grid-resize-handle"))return;let i=ns.getState(e.state);if(i.draggingPrimary)return;let n=function(e,t){let i=e.posAtCoords({left:t.clientX,top:t.clientY})?.inside;if(i&&-1!==i){let n=e.state.doc.resolve(i);if(n.nodeAfter?.type.name==="gridItem"){let n=nR(e,t,i+1);if(n)return n}}let n=s.GAP_SAMPLE_MARGIN;for(let i of[{x:t.clientX+n,y:t.clientY},{x:t.clientX,y:t.clientY+n},{x:t.clientX-n,y:t.clientY},{x:t.clientX,y:t.clientY-n}]){let n=e.posAtCoords({left:i.x,top:i.y})?.inside;if(!n||-1===n)continue;let a=e.state.doc.resolve(n);if(a.nodeAfter?.type.name==="gridItem"){let i=nR(e,t,n+1);if(i)return i}}let a=t.target;if(!(a&&a.closest(".cell-edge-control")))return null}(e,t);if(void 0===n)return;let a=n?.cellPos??null;a!==i.getActiveCellHandleAbs(e.state)&&nd(e,a,n)})(e,t),!1),mouseleave(e){let t,i=ns.getState(e.state);if(null!==i.activeGridPos&&i.activeGridGaps.length>0){let t=!1;if(!(e.state.selection instanceof a.NodeSelection&&e.state.selection.from===i.activeGridPos)){let e=i.activeGridGaps.map(e=>e.gaps.some(e=>e.isVisible)?(t=!0,{...e,gaps:e.gaps.map(e=>({...e,isVisible:!1}))}):e);t&&i.setActiveGridGaps({setActiveGridGaps:e})}}return null===(t=ns.getState(e.state)).getActiveCellHandleAbs(e.state)||t.draggingPrimary||nd(e,null),!1}},decorations(e){let t=ns.getState(e),i=t.getActiveCellHandleAbs(e),n=t.handleInfo,a=[];if(null!==i&&n)try{let t=e.doc.resolve(i).nodeAfter;if(!t||"gridItem"!==t.type.name)return tD.DecorationSet.empty;let r={isGridItemResizeDecoration:!0,showPrimaryHandle:!n.isLastInFlowGroup},o=tD.Decoration.node(i,i+t.nodeSize,{},r);a.push(o)}catch(e){return console.error(`(caught) gridResizing error: ${e.message}`),tD.DecorationSet.empty}if(t?.activeGridPos!==null&&(t?.activeGridGaps.length||0)>0)try{t.activeGridGaps.forEach(t=>{let i=e.doc.nodeAt(t.gridPos);if(i){let e={isGridGapDecoration:!0,gapPositions:t.gaps};a.push(tD.Decoration.node(t.gridPos,t.gridPos+i.nodeSize,{},e))}})}catch(e){console.error("Error creating grid gap decorations:",e)}return tD.DecorationSet.create(e.doc,a)},nodeViews:{}}}),(e=null,new a.Plugin({key:new a.PluginKey("gridReorder"),view:t=>e=new nU(t),props:{handleDrop:(t,i,n,a)=>!!e&&e.handleDrop(t,i,n,a)}})),function(e={}){let t={...nE,...e};return new a.Plugin(t.enabled?{key:ni,state:{init:()=>new nt,apply:(e,t)=>t.apply(e)},view:e=>({update(e,t){((e,t)=>{var n;let r,o=e.state;if(!ni.getState(o)||t?.selection.eq(o.selection))return;let s=(0,ne.findRootGridContainingSelection)(o);if(!s||!s.node){let t;return t=e.state.tr.setMeta(ni,{clear:!0}),e.dispatch(t)}let{pos:l,node:d}=s,c=d.attrs.options.gridDirection||"horizontal",u=o.selection instanceof a.NodeSelection&&o.selection.from===l&&"grid"===o.selection.node.type.name,p=(n=o.doc.resolve(l),!!(0,i.findParentNodeClosestToPos)(n,e=>"gridItem"===e.type.name)),h={pos:l,node:d,direction:c,isSelected:u,isNested:p,hasFocus:e.hasFocus()};r=e.state.tr.setMeta(ni,{setActiveGrid:h}),e.dispatch(r);let m=nS(e,l,d,c);nn(e,m);let g=ni.getState(e.state);g&&na(e,n_(g))})(e,t)}}),props:{decorations(e){let t=ni.getState(e);if(!t||!t.activeGrid)return tD.DecorationSet.empty;let i=t.edges.filter(e=>t.visibleEdges.has(e.edge)),{pos:n,node:a}=t.activeGrid,r=tD.Decoration.node(n,n+a.nodeSize,{},{isOuterControlsDecoration:!0,outerEdges:i});return tD.DecorationSet.create(e.doc,[r])},handleDOMEvents:{mousemove(e,i){let n=ni.getState(e.state);if(!n||!n.activeGrid)return!1;let a={x:i.clientX,y:i.clientY},{pos:r,node:o,direction:s}=n.activeGrid,l=nS(e,r,o,s,a,t.proximityThreshold);nn(e,l);let d=ni.getState(e.state);return d&&na(e,n_(d)),!1},mouseleave(e,t){let i=ni.getState(e.state);if(!i)return!1;nn(e,i.edges.map(e=>({...e,isHovered:!1})));let n=ni.getState(e.state);return n&&na(e,n_(n)),!1}}}}:{key:ni,state:{init:()=>new nt,apply:(e,t)=>t}})}()]},addExtensions:()=>[nG],addCommands:()=>({handleDeleteOnGridItem:(e=!1,t=!0,n=!1)=>({dispatch:r,state:o,chain:s})=>{if(!r)return!0;let{selection:l}=o,d=l instanceof a.NodeSelection&&"gridItem"===l.node.type.name?{node:l.node,pos:l.from}:(0,i.findParentNode)(e=>"gridItem"===e.type.name)(o.selection);if(e&&d&&d.pos!==l.from)return!1;let c=(0,i.findParentNode)(e=>"grid"===e.type.name)(o.selection);if(!d||!c)return!1;let u=1===d.node.childCount&&d.node.firstChild?.type.name==="paragraph"&&d.node.firstChild?.content.size===0;return!!(n||u||l instanceof a.NodeSelection&&"gridItem"===l.node.type.name)&&(1==c.node.childCount?s().selectNodeAtPos(c.pos).deleteSelectionAndSelectNear(t?1:-1).run():s().deleteGridItemWithRedistribution(d.pos).run(),!0)},addGridItemWithRedistribution:(e,t="after")=>({tr:i,dispatch:n,state:r})=>{let o;if(!n)return!0;let s=(0,ne.getGridContext)(r,e);if(!s)return!1;let{gridParent:l,cellIndex:d,gridStyle:c}=s,u=r.doc.nodeAt(e);if(!u)return!1;let p=l.node.attrs.options?.gridDirection||"horizontal",{newCellSpan:h,cellUpdates:m}=nH(d,l.node,c,p);(0,ne.applyCellSpanUpdates)(i,l,m);let g=u.attrs.options,f="horizontal"===p?{...g,horizontalColumnSpan:h}:{...g,verticalRowSpan:h},b=(0,ne.createEmptyGridItem)(r.schema,f);o="after"===t?i.mapping.map(e+u.nodeSize):i.mapping.map(e),i.insert(o,b);let x=o+1;return i.setSelection(a.TextSelection.create(i.doc,x)),n(i.scrollIntoView()),!0},deleteGridItemWithRedistribution:e=>({tr:t,dispatch:i,state:n})=>{if(!i)return!0;let a=(0,ne.getGridContext)(n,e);if(!a)return!1;let{gridParent:r,cellIndex:o,gridStyle:s}=a,l=r.node.attrs.options?.gridDirection||"horizontal",{cellUpdates:d}=nW(o,r.node,s,l),c=t.doc.nodeAt(e),u=c?.nodeSize||0;(0,ne.applyCellSpanUpdates)(t,r,d);let p=t.mapping.map(e);c&&t.delete(p,p+u);let h=t.mapping.map(r.pos);(0,ne.unwrapGridIfNeeded)(t,h);let m=(0,i0.findSelectionNearOrGapCursor)(t.doc.resolve(Math.min(p,t.doc.content.size-1)),1);return m&&t.setSelection(m),i(t.scrollIntoView()),!0},addPrimaryGroup:({gridNode:e,gridPos:t,before:i})=>({tr:n,dispatch:r,state:o})=>{if(!r)return!0;let s=e.attrs.options?.gridStyle,l=e.attrs.options?.gridDirection||"horizontal";if(!(0,nj.isFlexibleGrid)(s))return!1;let d=(0,i2.getFlowGroups)(e),c=i?0:d.length-1,{newCellConfigs:u}=function(e,t,i,n="horizontal"){if(!(0,nj.isFlexibleGrid)(i))return{newCellConfigs:["horizontal"===n?{horizontalColumnSpan:i1.DEFAULT_ITEM_WIDTH}:{verticalRowSpan:i1.DEFAULT_ITEM_WIDTH}]};let a=(0,i2.getFlowGroups)(t)[e];if(!a)return{newCellConfigs:["horizontal"===n?{horizontalColumnSpan:i1.DEFAULT_ITEM_WIDTH}:{verticalRowSpan:i1.DEFAULT_ITEM_WIDTH}]};let r=[];return a.indices.forEach(e=>{let i=t.child(e).attrs.options||{},a=i.cellStyle,o=i.cellDecor,s=i.marker,l=i.innerLabel,d={};"horizontal"===n?(d.horizontalColumnSpan=i.horizontalColumnSpan??i1.DEFAULT_ITEM_WIDTH,void 0!==i.horizontalRowSpan&&(d.horizontalRowSpan=i.horizontalRowSpan)):(d.verticalRowSpan=i.verticalRowSpan??i1.DEFAULT_ITEM_WIDTH,void 0!==i.verticalColumnSpan&&(d.verticalColumnSpan=i.verticalColumnSpan)),r.push({...d,...a&&{cellStyle:a},...o&&{cellDecor:o},...s&&{marker:s},...l&&{innerLabel:l}})}),{newCellConfigs:r}}(c,e,s,l),p=d[c];if(!p)return!1;let h=i?(0,ne.getCellPosInGrid)({pos:t,node:e},p.indices[0]):(0,ne.getCellPosInGrid)({pos:t,node:e},p.indices[p.indices.length-1]+1),m=u.map(e=>(0,ne.createEmptyGridItem)(o.schema,e)),g=n.mapping.map(h);return n.insert(g,m),n.setSelection(a.TextSelection.create(n.doc,g+1)),r(n.scrollIntoView()),!0},wrapGridInPerpendicularParent:(e,t,i)=>({tr:n,dispatch:r,state:o})=>{if(!r)return!0;if(!e||"grid"!==e.type.name)return!1;let s="horizontal"===(e.attrs.options?.gridDirection||"horizontal")?"vertical":"horizontal",l="horizontal"===s?{horizontalColumnSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,horizontalRowSpan:i1.MIN_ITEM_WIDTH,cellStyle:"none"}:{verticalRowSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,verticalColumnSpan:i1.MIN_ITEM_WIDTH,cellStyle:"none"},d=(0,ne.createEmptyGridItem)(o.schema,l),c="horizontal"===s?{horizontalColumnSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,horizontalRowSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-i1.MIN_ITEM_WIDTH,cellStyle:"none"}:{verticalRowSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-i1.MIN_ITEM_WIDTH,verticalColumnSpan:i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-i1.MIN_ITEM_WIDTH,cellStyle:"none"},u=o.schema.nodes.gridItem.create({options:c},e),p="before"===i?[d,u]:[u,d],h=o.schema.nodes.grid.create({options:{gridDirection:s,gridStyle:"flexible",spacing:e.attrs.options?.spacing}},p),m=n.mapping.map(t);n.replaceWith(m,m+e.nodeSize,h);let g=("before"===i?m+1:m+1+u.nodeSize)+1;return n.setSelection(a.TextSelection.create(n.doc,g)),r(n.scrollIntoView()),!0}})});e.s(["GridItem",()=>n1],559420),e.s(["GridItemView",()=>n0],668525);var nZ=e.i(549678),nK=e.i(829814),nq=e.i(599294);let nY=(0,P.memo)(({edge:e,isVisible:i,onAdd:n,isEditable:a})=>{let r=(0,P.useCallback)(e=>{n()},[n]);if(!a||!i)return null;let o=(e=>{let t={position:"absolute",transform:"translateY(-50%)",zIndex:2};switch(e){case"right":return{...t,insetInlineEnd:"calc(-1 * var(--grid-padding) - 8px)",top:"50%",width:"16px",height:"20px"};case"left":return{...t,insetInlineStart:"calc(-1 * var(--grid-padding) - 8px)",top:"50%",width:"16px",height:"20px"};default:return{...t,insetInlineStart:"50%",transform:"translateX(-50%) translateY(-100%)",bottom:"calc(-1 * var(--grid-padding) - 8px)",width:"20px",height:"16px"}}})(e),s=((e,t)=>{switch(e){case"right":case"left":return{height:"20px",width:"16px"};default:return{height:"16px",width:"20px"}}})(e);return(0,A.jsx)(I.Flex,{className:"cell-edge-control",...o,transitionProperty:"opacity",transitionDuration:"0.2s",contentEditable:!1,children:(0,A.jsx)(I.Flex,{children:(0,A.jsx)(nI.BaseDragHandle,{isSelected:!1,isVisible:!0,onClick:r,top:0,insetInlineStart:0,icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faPlus,size:"xs"}),label:t.i18n._({id:"P/yGyM",message:"Add cell"}),width:s.width,height:s.height})})})});nY.displayName="CellAddButton";let nX=(0,P.memo)(({edge:e,onResizeMouseDown:t,isEditable:i,isSubgridParent:n})=>{let a,r=(0,x.useAppSelector)(i8.selectShowGridItemDebugOverlay),o="right"===e?{position:"absolute",insetInlineEnd:"calc(-1 * var(--grid-padding))",transform:"translateX(50%)",top:n?"0":"calc(-1 * var(--grid-padding) / 2)",bottom:n?"0":"calc(-1 * var(--grid-padding) / 2)",width:"var(--grid-padding)",zIndex:1}:{position:"absolute",left:"calc(-1 * var(--grid-padding))",right:"calc(-1 * var(--grid-padding))",bottom:"calc(-1 * var(--grid-padding))",height:"var(--grid-padding)",zIndex:1},s=(a={position:"absolute",borderRadius:"2px",height:"100%",width:"100%"},"right"===e?{...a,cursor:"ew-resize",top:"0",left:"50%",bottom:"0"}:{...a,cursor:"ns-resize",left:"0",top:"50%",right:"0"}),l=(0,P.useCallback)(i=>{t(i,e)},[t,e]);return i?(0,A.jsx)(I.Flex,{className:"cell-edge-control",...o,transitionProperty:"opacity",transitionDuration:"0.2s",contentEditable:!1,children:(0,A.jsx)(I.Flex,{sx:s,onMouseDown:l,children:(0,A.jsx)(E.Box,{sx:{width:"right"===e?"2px":"100%",height:"bottom"===e?"2px":void 0,backgroundColor:r?"green":"trueblue.300"}})})}):null});nX.displayName="CellResizeControl";let nQ=(0,P.memo)(({isThisGridItemFocused:e,gridDirection:t,resizeDecoration:n,isSubgridParent:a,isEditable:r,getPos:o,editor:s})=>{let l=(0,P.useCallback)((e,t)=>()=>{let i=o();"number"==typeof i&&("flow"===e?s.commands.addGridItemWithRedistribution(i,t):s.commands.convertGridItemToNestedGrid(i,t))},[s,o]),d=(0,P.useCallback)((e,t)=>{(({view:e,event:t,edge:n})=>{let a,r,o;if(!e.editable)return;let s=ns.getState(e.state),l=s.getActiveCellHandleAbs(e.state);if(null===l||s?.draggingPrimary)return;let d=e.state.doc.resolve(l),c=d.nodeAfter,u=(0,i.findParentNodeClosestToPos)(d,e=>"grid"===e.type.name);if(!u)return;let p=d.index(u.depth),h=(0,nL.getGridDirection)(u.node),m=(0,nL.getGridId)(u.node),g=nh(e,d);if(!g)return;let f="right"===n?g.offsetWidth:g.offsetHeight,b=f/i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL,x="horizontal"===h?(0,i2.calculateStretchedHorizontalColumns)(u.node):(0,i2.calculateStretchedVerticalRows)(u.node);a=x.get(p)??(0,ne.getFlowSpan)(c.attrs?.options||{},h);let y=(0,i2.getFlowGroups)(u.node),v=[];for(let e of y){let t=e.indices.indexOf(p);if(-1!==t){v=e.indices,t{let i=u.node.child(t);e!==(0,ne.getFlowSpan)(i.attrs?.options||{},h)&&nb(g,m,t,e,"flow")}),nc(e,{startCoord:"right"===n?t.clientX:t.clientY,cellIndex:p,initialWidth:a,containerSize:f,pixelsPerUnit:b,linkedCellIndex:r,initialLinkedWidth:o});let C=null,w=null,S=void 0!==r;function k(t){window.removeEventListener("mouseup",k),window.removeEventListener("mousemove",A);let n=ns.getState(e.state);if(n.draggingPrimary){if(null===C)return void nc(e,null);if(n.draggingPrimary)try{let t=n.getActiveCellHandleAbs(e.state);if(null===t){console.error("[GridResize] Active handle position is null"),nc(e,null);return}let a=e.state.doc.resolve(t),r=(0,i.findParentNodeClosestToPos)(a,e=>"grid"===e.type.name);if(!r){console.error("[GridResize] Could not find parent grid"),nc(e,null);return}let o=a.before(r.depth),s=r.node.attrs.options?.gridDirection||"horizontal",l=new Map;if(x.forEach((e,t)=>{let i=r.node.child(t),a=(0,ne.getFlowSpan)(i.attrs?.options||{},s);n.draggingPrimary&&(t===n.draggingPrimary.cellIndex||t===n.draggingPrimary.linkedCellIndex)||e!==a&&("horizontal"===s?l.set(t,{horizontalColumnSpan:e}):l.set(t,{verticalRowSpan:e}))}),"horizontal"===s?l.set(n.draggingPrimary.cellIndex,{horizontalColumnSpan:C}):l.set(n.draggingPrimary.cellIndex,{verticalRowSpan:C}),void 0!==n.draggingPrimary.linkedCellIndex&&null!==w&&("horizontal"===s?l.set(n.draggingPrimary.linkedCellIndex,{horizontalColumnSpan:w}):l.set(n.draggingPrimary.linkedCellIndex,{verticalRowSpan:w})),g&&r){let e=r.node.attrs.id||"unknown";for(let t=0;t{nf(e,o,r.node,l),nc(e,null)})}catch(t){console.error("[GridResize] Error during finish:",t),np(e)}C=null,w=null}}function A(t){if(!t.which)return k(t);let i=ns.getState(e.state),n=i.getActiveCellHandleAbs(e.state);if(!i.draggingPrimary||null===n)return;let{startCoord:a,initialWidth:r,pixelsPerUnit:o,linkedCellIndex:s,initialLinkedWidth:l,shouldPushLinkedCell:d}=i.draggingPrimary,{spanDelta:c}=ng(t,a,o,"horizontal"),f=r+c;for(let e of(0,i2.getFlowGroups)(u.node))if(e.indices.includes(p)){e.indices;break}if(S&&void 0!==s&&void 0!==l&&!d){let{clampedDragWidth:e,clampedLinkedWidth:t}=function(e,t,i,n,a,r,o="horizontal"){let s=0;return t.forEach(e=>{if(e!==i&&e!==n){let t=r.child(e),i=a.get(e)??(0,ne.getFlowSpan)(t.attrs?.options||{},o);s+=i}}),nN(e,i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-s)}(f,v,p,s,x,u.node,h);f=e,w=t,nb(g,m,s,t,"flow")}else f=function(e,t,i,n,a,r="horizontal"){if(1===t.length)return Math.max(i1.MIN_ITEM_WIDTH,Math.min(i1.MAX_ITEM_WIDTH,e));let o=0;t.forEach(e=>{if(e!==i){let t=a.child(e),i=n.get(e)??(0,ne.getFlowSpan)(t.attrs?.options||{},r);o+=i}});let s=i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-o;return Math.max(i1.MIN_ITEM_WIDTH,Math.min(s,e))}(f,v,p,x,u.node,h);if(nb(g,m,p,C=f,"flow"),g&&u){var b;let t,i,n;t=function(e,t,i,n,a,r="horizontal"){let o=new Map;return e.forEach((e,s,l)=>{let d=(0,ne.getFlowSpan)(e.attrs?.options||{},r);l===t?d=i:void 0!==n&&l===n&&null!=a&&(d=a),o.set(l,d)}),o}(b=u.node,p,C,s,w,h),i=(0,i2.getFlowGroups)(b),n=new Set,i.forEach(e=>{if(e.spanTotal0){let t=e.indices[e.indices.length-1];n.add(t)}}),b.forEach((e,a,r)=>{if(r!==p&&r!==s)if(n.has(r)){let e=function(e,t,i){let n={indices:[],spanTotal:0};for(let i of t)if(i.indices.includes(e)){n=i;break}return 0===n.indices.length?i.get(e)||i1.DEFAULT_ITEM_WIDTH:(i.get(e)||i1.DEFAULT_ITEM_WIDTH)+(i1.FLEXIBLE_GRID_FLOW_SPAN_TOTAL-n.spanTotal)}(r,i,t);nb(g,m,r,e,"flow")}else nb(g,m,r,(0,ne.getFlowSpan)(e.attrs?.options||{},h),"flow")}),(0,nq.dispatchContainerResizeEvent)(g);let a=ns.getState(e.state);if(a&&null!==a.activeGridPos&&u)try{let t=nP(e,u.pos,u.node),i=new Map(a.activeGridGaps.map((e,t)=>[t,e.gaps.some(e=>e.isVisible)])),n=t.map((e,t)=>({...e,gaps:e.gaps.map(e=>({...e,isVisible:i.get(t)??!1}))}));a.setActiveGridGaps({setActiveGridGaps:n})}catch(e){console.error("Error recalculating gaps during flow drag:",e)}}}return window.addEventListener("mouseup",k),window.addEventListener("mousemove",A),t.preventDefault()})({view:s.view,event:e,edge:t})},[s.view]),c=n.showPrimaryHandle,u="horizontal"===t?"right":null,p="horizontal"===t?"left":null,h="horizontal"===t?null:"left";return r?(0,A.jsxs)(A.Fragment,{children:[e&&!a&&(0,A.jsxs)(A.Fragment,{children:[p&&(0,A.jsx)(nY,{edge:p,isVisible:!0,onAdd:l("flow","before"),isEditable:r}),(0,A.jsx)(nY,{edge:"horizontal"===t?"right":"bottom",isVisible:!0,onAdd:l("flow","after"),isEditable:r}),(0,A.jsx)(nY,{edge:"horizontal"===t?"bottom":"right",isVisible:!0,onAdd:l("split","after"),isEditable:r}),h&&(0,A.jsx)(nY,{edge:h,isVisible:!0,onAdd:l("split","before"),isEditable:r})]}),c&&u&&(0,A.jsx)(nX,{edge:u,onResizeMouseDown:d,isEditable:r,isSubgridParent:a})]}):null});nQ.displayName="CellAddAndResizeControls";var nJ=e.i(380442);let n0=e=>{let t,{node:i,decorations:n,editor:a,getPos:r}=e,{options:o}=i.attrs,s=(0,x.useAppSelector)(C.selectTheme),l=(0,i3.findGridItemDecoration)(n),d=(t=n.find(e=>e?.spec?.isGridItemResizeDecoration))?t.spec:{isGridItemResizeDecoration:!0,showPrimaryHandle:!1},{firstChildSize:c}=(0,nZ.findFirstChildFontSizeDeco)(n),u=(0,x.useAppSelector)(C.selectEditable),p=(0,is.isFocusedAndEditable)(n),{isRootGridSelected:h,isLastCellInGroup:m,isSubgridParent:g,layoutOptions:f}=l,b=f.gridDirection||"horizontal",y=(0,nK.isSelectingNodeOrInside)(n),v=(0,P.useCallback)(()=>{if(!u)return;let e=r();"number"==typeof e&&a.commands.selectNodeAtPos(e)},[a,r,u]),w=(0,P.useMemo)(()=>({onClick:()=>{},cursor:u?"auto":"default"}),[u]),S=(0,P.useMemo)(()=>({cellOptions:o,theme:s,firstChildSize:c,isFocused:p,editor:a,getPos:r,selectCell:v,selectCellForElementProps:w,...l}),[o,l,v,p,a,c,r,w,s]),k=(0,P.useMemo)(()=>(0,A.jsx)(nQ,{isEditable:u,isThisGridItemFocused:y,isSubgridParent:g,gridDirection:b,resizeDecoration:d,editor:a,getPos:r}),[u,y,g,b,d,a,r]);return(0,A.jsx)(H.AnnotatableNodeViewWrapper,{style:{position:"relative"},"data-selection-ring":!0,...e,children:(0,A.jsx)(nJ.GridItem,{cellProps:S,cellStyle:o.cellStyle||"none",dragHandle:!g&&(0,A.jsx)(i6.ContainerDragHandle,{handlePlacement:"top",...e,"data-testid":"grid-item-drag-handle",label:(0,A.jsx)(I.Flex,{direction:"column",align:"center",children:(0,A.jsx)(ec.Trans,{message:"Select grid item",id:"kA/i9e"})})}),cellDecorConfig:o.cellDecor,markerConfig:o.marker,innerLabelConfig:o.innerLabel,gridStyle:l.layoutOptions.gridStyle||"standard",addButton:k,className:(0,tC.cx)(g&&"subgrid-parent"),children:(0,A.jsx)(tu.NodeViewContent,{})})})},n1=(0,S.createTiptapNode)("gridItem",{isolating:!0,selectable:!1,containerHandle:!0,imageKeyPath:"options.marker.iconData",parseHTML:()=>[{tag:"div[class=grid-item]",getAttrs:e=>({options:(0,S.parseJSONAttr)(e,"options")??{}})},{tag:"div",context:"grid/",getAttrs:e=>({options:(0,S.parseJSONAttr)(e,"options")??{}})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"grid-item",...(0,S.renderJSONAttrs)(e.attrs,"options")}),0],addNodeView:()=>(0,v.ReactNodeViewRenderer)(n0,{update:k.attrsOrDecorationsChanged}),addCommands:()=>({convertGridItemToNestedGrid:(e,t="after")=>({tr:n,dispatch:r,state:o})=>{if(!r)return!0;let s=o.doc.nodeAt(e);if(!s||"gridItem"!==s.type.name)return!1;let l=o.doc.resolve(e),d=(0,i.findParentNodeClosestToPos)(l,e=>"grid"===e.type.name);if(!d)return!1;let c="horizontal"===(d.node.attrs.options?.gridDirection||"horizontal")?"vertical":"horizontal",u=s.content,p=s.attrs.options?.cellStyle,h="horizontal"===c?{horizontalColumnSpan:12,cellStyle:p}:{verticalRowSpan:12,cellStyle:p},m=o.schema.nodes.gridItem.create({options:h},u),g=o.schema.nodes.gridItem.create({options:h},o.schema.nodes.paragraph.create()),f="before"===t?[g,m]:[m,g],b=o.schema.nodes.grid.create({options:{gridDirection:c,gridStyle:"flexible"}},f);n.setNodeMarkup(e,void 0,{...s.attrs,options:{...s.attrs.options,cellStyle:"none"}});let x=e+1,y=e+s.nodeSize-1;n.replaceWith(x,y,b);let v=("before"===t?x+1:x+1+m.nodeSize)+1;return n.setSelection(a.TextSelection.create(n.doc,v)),r(n.scrollIntoView()),!0}})});var n2=e.i(676095);let n3=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,n5=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,n4=(0,S.extendTiptapMark)(n2.default,"italic",{addInputRules(){return[(0,i.markInputRule)({find:n3,type:this.type}),(0,i.markInputRule)({find:n5,type:this.type})]}});function n6(e,t=1){let i=t>0,{parent:n,doc:a}=e,r=e.start(),o=e.after();if(n.type.spec.isolating){let e=a.resolve(i?o-1:r),t=(0,i0.findSelectionNearOrGapCursor)(e,i?1:-1);if(i){let e=a.resolve(t.to).node();if(e&&e.isTextblock&&0===e.content.size)return t.to+1}return i?t.to:t.from}let s=e.start(e.depth-1);return n6(e.doc.resolve(s),t)}e.s(["Italic",0,n4],758412),e.i(24439),e.i(103630),e.i(135053);let n9=e=>{let t=n6(e,-1);return e.pos===t?t8.CARD_DEPTH:t},n8=(e,t)=>{let i=n6(t,1);return t.pos===i?e.state.doc.content.size-t8.CARD_DEPTH:i},n7=i.Extension.create({name:"KeyMapOverride",priority:tt.ExtensionPriorityMap.KeyMapOverride,addOptions:()=>({addSelectionKeyMaps:!1}),addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.exitLabelGroup?.(),()=>e.exitButtonGroup?.(),({view:t,state:i,tr:n})=>(n.setMeta("annotationEvent",{type:"split-block",splitPos:i.selection.from,atBeginning:t.endOfTextblock("backward")}),e.splitBlock())]),t=()=>this.editor.commands.first(({commands:e})=>[()=>e.handleCardAccentDelete(),()=>e.handleDeleteOnCardImageItem(),()=>e.handleSmartLayoutDelete?.(!0,!1),()=>e.handleDeleteOnGridItem?.(!0,!1),()=>e.deleteSelectionAndSelectNear(-1),()=>e.deleteSelection(),({view:e,state:t,dispatch:i})=>((e,t)=>{let{$from:i}=e.selection,n=i.nodeBefore;if(!n)return!1;if("math_inline"==n.type.name){let n=i.index(i.depth),r=e.doc.resolve(i.posAtIndex(n-1));return t&&t(e.tr.setSelection(new a.NodeSelection(r))),!0}return n.type.name,!1})(t,i),()=>e.unwrapQuoteOnDelete(),({view:t,state:i,tr:n})=>{let a=e.joinBackward();return a&&n.setMeta("annotationEvent",{type:"join-backward",joinPos:i.selection.from,atBeginning:t.endOfTextblock("backward")}),a},()=>e.selectNodeBackward(),()=>e.handleLayoutDelete(!1),()=>e.handleButtonDelete(!0),()=>e.handleLabelDelete(!0),()=>e.deleteCardIfEmpty(!1)]),i=()=>this.editor.commands.first(({commands:e})=>[()=>e.handleCardAccentDelete(),()=>e.handleDeleteOnCardImageItem(),()=>e.handleSmartLayoutDelete?.(!0,!0),()=>e.handleDeleteOnGridItem?.(!0,!0),()=>e.deleteSelectionAndSelectNear(),()=>e.deleteSelection(),({view:t,state:i,tr:n})=>{let a=e.joinForward();return a&&n.setMeta("annotationEvent",{type:"join-forward",joinPos:i.selection.from,atEnd:t.endOfTextblock("forward")}),a},()=>e.selectNodeForward(),()=>e.handleLayoutDelete(!0),()=>e.handleButtonDelete(!0),()=>e.handleLabelDelete(!0),()=>e.deleteCardIfEmpty(!0)]),n=()=>this.editor.commands.first(({commands:e})=>[()=>e.handleSpaceToZoom()]),r={};return this.options.addSelectionKeyMaps&&(r={"Mod-a":({editor:e})=>{let{selection:t}=e.state;if(t instanceof a.NodeSelection&&t.node.type.spec.isolating)return e.commands.selectAllText();let i=n6(e.state.selection.$from,-1),n=n6(e.state.selection.$to,1);return t.from===i&&t.to===n?e.commands.selectAllText():(e.commands.command(({tr:e})=>(e.setSelection(a.TextSelection.create(e.doc,i,n)),!0)),!0)},"Mod-ArrowUp":({editor:e})=>{let t=n9(e.state.selection.$from);if(!t)return!1;let i=e.state.doc.resolve(t),n=(0,i0.findSelectionNearOrGapCursor)(i);return!!n&&e.chain().command(({tr:e})=>(e.setSelection(n),!0)).scrollIntoView().run()},"Mod-Shift-ArrowUp":({editor:e})=>{let t=n9(e.state.selection.$from);return!!t&&e.chain().setTextSelection({from:t,to:e.state.selection.to}).scrollIntoView().run()},"Mod-ArrowDown":({editor:e})=>{let t=n8(e,e.state.selection.$to),i=e.state.doc.resolve(t),n=(0,i0.findSelectionNearOrGapCursor)(i);return!!n&&e.chain().command(({tr:e})=>(e.setSelection(n),!0)).scrollIntoView().run()},"Mod-Shift-ArrowDown":({editor:e})=>{let t=n8(e,e.state.selection.$to);return e.chain().setTextSelection({from:e.state.selection.from,to:t}).scrollIntoView().run()},"Shift-Mod-a":({editor:e})=>e.commands.selectAllText()}),{...r,Enter:e,Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:i,"Mod-Delete":i,Space:n}}});e.s(["KeyMapOverride",0,n7],504671),i.Extension.create({name:"UndoInputRuleKeymap",priority:tt.ExtensionPriorityMap.UndoInputRuleKeymap,addKeyboardShortcuts:()=>({"Shift-Mod-a":({editor:e})=>e.commands.selectAllText(),"Mod-z":({editor:e})=>e.commands.undoInputRule(),Backspace:({editor:e})=>e.commands.undoInputRule(),"Mod-Backspace":({editor:e})=>e.commands.undoInputRule()})}),e.i(312434);var ae=e.i(487914);let at=i.Extension.create({name:"KeyBoardCatchall",priority:tt.ExtensionPriorityMap.KeyBoardCatchall,addKeyboardShortcuts:()=>({Tab:({editor:e})=>e.view instanceof tD.EditorView&&e.view.hasFocus(),"Shift-Tab":({editor:e})=>e.view instanceof tD.EditorView&&e.view.hasFocus()}),addProseMirrorPlugins:()=>[new a.Plugin({key:new a.PluginKey("KeyBoardCatchall"),props:{handleKeyDown:(e,t)=>ae.keyboardHandler.handleKeydown(t)}})]});e.s(["KeyBoardCatchall",0,at],482337),e.s([],534635);var ai=e.i(144294),an=e.i(750526),aa=e.i(233365),ar=e.i(948982),ao=e.i(462931);let as=e=>{let{node:t,decorations:i,getPos:n,editor:a}=e,{color:r,variant:o,icon:s,uppercase:l}=t.attrs,d=(0,nK.isFocusedInside)(i),c=(0,ar.isNodeViewEmpty)(i),u=s?.src||s?.tempUrl,{textColor:p}=(0,aa.getTextColorVarsForBackground)(r),h=(0,P.useCallback)(()=>{if(!a.isEditable)return;let e=n();"number"==typeof e&&a.commands.selectNodeAtPos(e)},[a,n]),m="solid"===o?{bg:r||"var(--accent-color-background-muted)"}:"outline"===o&&(iR.isPptExport||iR.isPdfExport)?{border:"max(1px, var(--shape-border-width)) solid var(--accent-color)"}:"outline"===o?{border:"0px",boxShadow:`inset 0 0 0 max(1px, var(--shape-border-width)) ${r||"var(--accent-color)"}`}:{px:"0"};return(0,A.jsx)(tc.NodeViewWrapper,{children:(0,A.jsxs)(E.Box,{"data-content-reference":!0,className:"label",display:"inline-flex",alignItems:"center",gap:"0.5em",px:"0.75em",py:"0.375em",...m,borderRadius:"var(--box-border-radius)",fontSize:"0.8em",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)",textTransform:l??!0?"uppercase":"none",sx:{outline:d?"2px solid var(--chakra-ring-color) !important":void 0},color:"solid"===o?p:"outline"===o||"plain"===o?r||"var(--accent-color)":void 0,children:[u&&(0,A.jsx)(I.Flex,{h:"1em",w:"1em",flexShrink:0,css:(0,an.getRecolorableIconSx)("currentColor"),contentEditable:!1,onClick:h,children:(0,A.jsx)(ao.AccessoryIcon,{image:s})}),(0,A.jsxs)(to.Text,{as:"div",position:"relative",display:"flex",children:[(0,A.jsx)(tu.NodeViewContent,{}),c&&(d||!u)&&(0,A.jsx)(to.Text,{opacity:"0.3",pointerEvents:"none",contentEditable:!1,insetStart:"0",children:(0,A.jsx)(ec.Trans,{message:"Label",id:"87a/t/"})})]})]})})};e.s(["LabelView",0,as],898178);let al=(0,S.createTiptapNode)("label",{defining:!0,isolating:!0,selectable:!1,accessoryImageKey:"icon",imageKeyPath:"icon",addNodeView:()=>(0,v.ReactNodeViewRenderer)(as,{update:k.attrsOrDecorationsChanged}),addCommands:()=>({addLabelToGroup:e=>({state:t,chain:i})=>{let n=t.doc.nodeAt(e);if(!n)return!1;let a=e+n.nodeSize-1;return i().insertContentAt(a,(0,ai.EMPTY_NODES)().label).selectInsertedNode().run(),!0},handleLabelDelete:e=>({dispatch:t,state:n,chain:a})=>{if(!t)return!0;let r=(0,i.findParentNode)(e=>"label"===e.type.name)(n.selection);if(!r||e&&!(0,t0.isNodeEmpty)(r.node))return!1;let o=(0,i.findParentNode)(e=>"labelGroup"===e.type.name)(n.selection);return o&&1===o.node.childCount?a().deleteNode("labelGroup").command(({tr:e})=>{let t=(0,i0.findSelectionNearOrGapCursor)(e.doc.resolve(o.pos));return t&&e.setSelection(t),!0}).focus().run():a().deleteNode("label").command(({tr:e})=>{let t=(0,i0.findSelectionNearOrGapCursor)(e.doc.resolve(r.pos-1),-1);return t&&e.setSelection(t),!0}).focus().run(),!0},exitLabelGroup:()=>({state:e,chain:t})=>{if(!(0,i.findParentNode)(e=>"label"===e.type.name)(e.selection))return!1;let n=(0,i.findParentNode)(e=>"labelGroup"===e.type.name)(e.selection);if(!n)return!1;let a=n.pos+n.node.nodeSize;return t().insertContentAt(a,{type:"paragraph"}).selectInsertedNode().run()}}),parseHTML:()=>[{tag:"label",getAttrs:e=>{if("string"==typeof e)return!1;let t=(0,S.parseJSONAttr)(e,"icon"),i=e.getAttribute("data-color")||null,n=e.getAttribute("data-variant")||null,a=e.getAttribute("data-uppercase"),r="true"===a||"false"!==a&&null;if(t)return{icon:t,color:i,variant:n,uppercase:r};let o=e.querySelector(":scope >icon");if(!o)return{color:i,variant:n,uppercase:r};let s=null,l=o.getAttribute("src"),d=o.getAttribute("source");return(l&&!s&&(s={src:l,source:d||"image.icon"}),s)?(o.remove(),{icon:s,color:i,variant:n,uppercase:r}):{color:i,variant:n,uppercase:r}}}],renderHTML:({node:e,HTMLAttributes:t})=>["label",(0,i.mergeAttributes)(t,(0,S.renderJSONAttrs)(e.attrs,"icon"),{"data-color":e.attrs.color||void 0,"data-variant":e.attrs.variant||void 0,"data-uppercase":null!=e.attrs.uppercase?String(e.attrs.uppercase):void 0}),0]});e.s(["Label",0,al],63435),e.s(["LabelGroup",()=>ah],705956),e.s(["LabelGroupView",()=>au],275144);var ad=e.i(133075);let ac=({editor:e,getPos:i,node:n})=>{let a=(0,x.useAppSelector)(C.selectContentEditable),r=n.childCount{let t=i();"number"==typeof t&&e.commands.addLabelToGroup(t)},[e,i]);return r&&a?(0,A.jsx)(I.Flex,{position:"relative",align:"center",children:(0,A.jsx)(eC.GammaTooltip,{label:(0,A.jsx)(ec.Trans,{message:"Add a label",id:"d85lwh"}),placement:"top",children:(0,A.jsx)(es.IconButton,{icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faPlus}),"aria-label":t.i18n._({id:"lyqwgn",message:"Add label"}),size:"xs",variant:"plain",isRound:!0,onClick:o,opacity:0,className:"add-label",transitionProperty:"opacity",transitionDuration:"normal",position:"absolute",insetInlineStart:0,top:"50%",transform:"translateY(-50%)",zIndex:"sticky"})})}):null},au=e=>{let{decorations:t,node:i}=e,{horizontalAlign:n}=i.attrs;return(0,A.jsx)(H.AnnotatableNodeViewWrapper,{...e,children:(0,A.jsxs)(I.Flex,{dir:(0,W.getAlignDirection)(t,n),w:"100%","data-selection-ring":"padded",borderRadius:"var(--box-border-radius)",direction:"row",justify:(0,W.getFlexAlign)(n)||"var(--flex-align)",gap:"0.5em",alignItems:"center",flexWrap:"wrap",sx:ap(),children:[(0,A.jsx)(tu.NodeViewContent,{}),(0,A.jsx)(ac,{...e})]})})},ap=()=>({"> [data-node-view-content]":{display:"contents","> [data-node-view-content-inner]":{display:"contents"}},_hover:{".add-label":{opacity:1}}}),ah=(0,S.createTiptapNode)("labelGroup",{allowGapCursor:!1,addNodeView:()=>(0,v.ReactNodeViewRenderer)(au,{update:k.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=label-group]",getAttrs:e=>(0,S.parseHorizontalAlign)(e)},{tag:"labels",getAttrs:e=>(0,S.parseHorizontalAlign)(e)}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"label-group",...(0,S.renderHorizontalAlign)(e.attrs)}),0]});e.s([],84594),e.i(693252),e.s(["SmartLayoutCell",()=>aE],878132);var am=e.i(391736);e.s(["SmartLayoutCellView",()=>aA],178079);var ag=e.i(661619),af=e.i(19654);e.i(18547);var ab=e.i(273141),ax=e.i(932132),ay=e.i(558247),av=e.i(584139),aC=e.i(103104),aw=e.i(98707),aS=e.i(922712),ak=e.i(706923);let aA=e=>{let{node:n,decorations:a,editor:r,getPos:o}=e,s=r.state.selection,l=s.node&&!!(0,p.isSmartLayoutNode)(s.node),{options:d,...c}=n.attrs,u=(0,ax.findSmartLayoutCellDecoration)(a),m=(0,ak.getSmartLayoutVariant)(u.smartLayoutAttrs.variantKey),g=m.config?ab.ConfigurableSmartLayoutCell:m.Cell,f=(0,x.useAppSelector)(C.selectTheme),b=(0,h.getSmartLayoutOptions)(u.smartLayoutAttrs,u.direction),{firstChildSize:y}=(0,nZ.findFirstChildFontSizeDeco)(a),v=u.index===u.numCells-1,w=(0,x.useAppSelector)(C.selectEditable),S=(0,tN.useIsThumbnailView)(),k=(0,is.isFocusedAndEditable)(a),_="number"==typeof u.emphasizedIndex&&u.emphasizedIndex!==u.index,M=(0,P.useCallback)(()=>{let e=o();if("number"!=typeof e)return;let t=r.state.doc.nodeAt(e);t&&r.commands.insertSmartLayoutCell(e+t.nodeSize)},[r,o]),j=m.addDirection?m.addDirection(b):"right",[D,N]=(0,ag.getInsetProps)(u.direction),R=(0,P.useCallback)(()=>{if(!w)return;let e=o();"number"==typeof e&&r.commands.selectNodeAtPos(e)},[r,o,w]);c.image;let{contextMenuItems:O}=(({variant:e,editor:t,node:n,getPos:a,deco:r,options:o})=>{let s=n.attrs,{id:l}=s,{editImage:d,changeFocalPoint:c}=(0,aw.useImageFormattingMenuActions)({editor:t,getPos:a}),u=null;try{let e=a();"number"==typeof e&&(u=t.state.doc.resolve(e))}catch(e){u=null}let h=u?(0,i.findParentNodeClosestToPos)(u,p.isSmartLayoutNode):null,{imageType:m,imageSlot:g}=e,f=(0,ay.useCanEditImageWithAI)(s.image??void 0)&&g&&"image"===m,{toggleBuddyChatPanel:b,isBuddyChatPanelOpen:x}=(0,av.useToggleBuddyChatPanel)(),{addColumnBefore:y,addColumnAfter:v,canChangeFocusPoint:C,hasImage:w,addDirection:S,parentVariant:k,cellOptions:E,handleDelete:_,selectParent:I,duplicateNode:M,updateAttributes:j}=(0,aw.useSmartLayoutCellFormattingMenuActions)({editor:t,node:n,parentNode:h?.node}),D=(0,P.useMemo)(()=>w?[{key:"edit-image",label:"icon"===m?(0,A.jsx)(ec.Trans,{message:"Edit icon...",id:"JE/4q/"}):(0,A.jsx)(ec.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:T.faEdit,onClick:d},...f?[{key:"ask-ai",label:(0,A.jsx)(ec.Trans,{message:"Edit with {AGENT_PROPER_NOUN}...",id:"IzVrMk",values:{AGENT_PROPER_NOUN:aC.AGENT_PROPER_NOUN}}),icon:eD.faSparkles,onClick:()=>{x||b()}}]:[],...C?[{key:"change-focus-point",label:(0,A.jsx)(ec.Trans,{message:"Change focus point",id:"BmxaoW"}),icon:T.faCrosshairs,onClick:()=>c(l)}]:[],{divider:!0}]:[],[w,m,d,f,C,x,b,c,l]),N=(0,P.useMemo)(()=>k?.cellOptions.length?k?.cellOptions.map(e=>{if(e.checkEnabled&&!e.checkEnabled({options:o,attrs:s}))return null;let t=E[e.key]??e.defaultValue?.({ctx:"menu"});return e.ControlMenu?e.ControlMenu(t,t=>{let i=a();"number"==typeof i&&j(i,{options:{...E,[e.key]:t}})},e):null}).filter(e=>null!==e):[],[E,a,o,k?.cellOptions,j,s]),R=(0,aS.useEditorContextMenuItems)({editor:t,getPos:a,node:n,includeCut:!1,imageSrc:s.image?.src}),O=r.index??0,B=e.name();return{contextMenuItems:[{key:"title",title:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(to.Text,{children:(0,A.jsx)(ec.Trans,{message:"Smart layout: {variantName}",id:"I6KeXh",values:{variantName:B}})}),(0,A.jsxs)(ee.HStack,{gap:1,children:[(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faArrowTurnDownRight}),(0,A.jsx)(to.Text,{children:(0,A.jsx)(ec.Trans,{message:"Item {cellNumber}",id:"MkTixW",values:{cellNumber:O+1}})})]})]})},{divider:!0},...R,{divider:!0},...D,{key:"add-item-before",label:(0,A.jsx)(ec.Trans,{message:"Add item before",id:"w7mkyz"}),icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faDiagramCells,rotation:"bottom"===S?void 0:270}),onClick:()=>{let e=a();"number"==typeof e&&y(e)}},{key:"add-item-after",label:(0,A.jsx)(ec.Trans,{message:"Add item after",id:"1e37Dl"}),icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faDiagramCells,rotation:"bottom"===S?180:90}),onClick:()=>{let e=a();"number"==typeof e&&v(e+n.nodeSize)}},{key:"duplicate",label:(0,A.jsx)(ec.Trans,{message:"Duplicate",id:"euc6Ns"}),icon:T.faCopy,onClick:()=>{let e=a();"number"==typeof e&&M(e+n.nodeSize)}},{divider:!0},...N.length?[...N,{key:"divider",divider:!0}]:[],{key:"edit-layout",label:(0,A.jsx)(ec.Trans,{message:"Edit overall layout",id:"UUpX+c"}),icon:T.faArrowTurnUp,onClick:()=>{let e=a();"number"==typeof e&&I(e)}},{divider:!0},{key:"delete",label:(0,A.jsx)(ec.Trans,{message:"Delete",id:"cnGeoo"}),icon:T.faTrash,onClick:_,color:"red.500"}]}})({variant:m,editor:r,node:n,getPos:o,deco:u,options:d}),{onOpenContextMenu:B}=(0,af.useEditorContextMenu)({editor:r,contextMenuItems:O,getPos:o}),z=(0,P.useMemo)(()=>({onClick:e=>{e.target===e.currentTarget&&R()},cursor:w?"auto":"default"}),[R,w]);return(0,A.jsx)(H.AnnotatableNodeViewWrapper,{...e,children:(0,A.jsx)(E.Box,{display:"contents",position:"relative","data-spotlight-parent":!0,className:_?"smart-layout-cell-not-emphasized":"",onContextMenu:l?void 0:B,style:{...(0,W.getAlignStylesParent)(b.horizontalAlign||m.baseHorizontalAlign?.({dir:u.direction}),u.direction)},children:g&&(0,A.jsxs)(g,{cellOptions:{...d,icon:c.image},layoutOptions:b,theme:f,...u,...c,...e,firstChildSize:y,isFocused:k,selectCell:R,variant:m,selectCellForElementProps:z,dragHandle:(0,A.jsx)(i6.ContainerDragHandle,{...e,handlePlacement:m.dragHandlePlacement??"top","data-testid":"smart-layout-cell-drag-handle",...m.dragHandleTopOffset&&{top:m.dragHandleTopOffset},label:(0,A.jsx)(I.Flex,{direction:"column",align:"center",children:(0,A.jsx)(ec.Trans,{message:"Select item<0>Drag to rearrange",id:"YkfVHA",components:{0:(0,A.jsx)(to.Text,{color:"gray.500"})}})})}),children:[(0,A.jsx)(tu.NodeViewContent,{style:{maxWidth:"100%",wordBreak:"break-word"}}),w&&v&&!S&&(0,A.jsx)(I.Flex,{position:"absolute",..."bottom"===j?{bottom:-3,[N]:0,width:"100%",height:6,justify:"center"}:{[N]:-3,bottom:0,height:"100%",width:6,align:"center"},opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",zIndex:"1",className:"add-button",children:(0,A.jsx)(eC.GammaTooltip,{label:(0,A.jsx)(ec.Trans,{message:"Add item",id:"NQ8llq"}),placement:"top",children:(0,A.jsx)(es.IconButton,{icon:(0,A.jsx)(L.FontAwesomeIcon,{icon:T.faPlus}),"aria-label":t.i18n._({id:"NQ8llq",message:"Add item"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:M,onMouseDown:tB.preventDefaultToAvoidBlur})})})]})})})},aE=(0,S.createTiptapNode)("smartLayoutCell",{isolating:!0,selectable:!1,containerHandle:!0,imageKeyPath:"image",accessoryImageKey:"image",parseHTML:()=>[{tag:"div[class=layout-item]",getAttrs:e=>({id:(0,S.parseIdAttr)(e,am.generateMediaId),options:(0,S.parseJSONAttr)(e,"options")??{},width:Number(e.getAttribute("data-width"))||null,image:(0,S.parseJSONAttr)(e,"image")??null,label:e.getAttribute("data-label")||null})},{tag:"div",context:"smartLayout/",getAttrs:e=>a_(e)},{tag:"smart-layout-item",getAttrs:e=>a_(e)}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"layout-item","data-id":e.attrs.id,...(0,S.renderJSONAttrs)(e.attrs,"options","image"),...null!=e.attrs.width&&{"data-width":String(e.attrs.width)},...e.attrs.label&&{"data-label":e.attrs.label}}),0],addNodeView:()=>(0,v.ReactNodeViewRenderer)(aA,{update:k.attrsOrDecorationsChanged})}),a_=e=>{let t,i=e.getAttribute("label")||e.getAttribute("number"),n=e.parentElement;t=n?.tagName.toLowerCase()==="smart-layout"?n.getAttribute("variant"):n?.tagName.toLowerCase()||n?.getAttribute("variant");let a=(0,ak.getSmartLayoutVariant)(t??void 0),r=[...a?.options.map(e=>e.key)||[],...a?.cellOptions.map(e=>e.key)||[]].reduce((t,i)=>{let n=e.getAttribute(i);if(n)try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t},{});return{image:aI(e,a),label:i,options:r}},aI=(e,t)=>{if(!t.imageSlot){let t=e.querySelector(":scope >icon");t&&t.remove();return}if("arrowBullets"===t.key&&t.defaultAttrs?.image){let i=e.querySelector(":scope >icon");return i&&i.remove(),t.defaultAttrs.image}let i=null;if("image"===t.imageType){let t=e.firstElementChild?.tagName.toLowerCase();("img"===t||"illustration"===t)&&(i=e.firstElementChild)}else"icon"===t.imageType&&((i=e.querySelector(":scope >icon"))||e.firstElementChild?.tagName.toLowerCase()!=="img"||(i=e.firstElementChild));if(!i)return;let n=null,a=i.getAttribute("src"),r=i.getAttribute("source");if(a){let e,t;if(i.hasAttribute("data-meta"))try{e=JSON.parse(i.getAttribute("data-meta")||"{}")}catch(e){console.warn("Failed to parse meta:",i.getAttribute("data-meta"))}if(i.hasAttribute("data-resize"))try{t=JSON.parse(i.getAttribute("data-resize")||"{}")}catch(e){console.warn("Failed to parse resize:",i.getAttribute("data-resize"))}n={src:a,source:r||"image.custom",meta:e,resize:t}}if(n)return i.remove(),n};e.s(["LayoutCell",()=>aj],557683),e.s(["LayoutCellView",()=>aL],965140);var aM=e.i(808707);let aT=e=>{let t=e.find(e=>e.spec.isLayoutCellDecoration);return t?t.spec:(console.error("[LayoutCell] Decoration not found. This should never happen!",e),{isLayoutCellDecoration:!0,colWidth:0,colIndex:0,layoutBackgroundColor:null})};e.s(["decorateLayouts",0,e=>{let{doc:t}=e,i=[];return t.descendants((e,t)=>{if(e.type.name!==aM.NODE_NAME)return;i.push(tD.Decoration.node(t,t+e.nodeSize,{},{isLayoutDecoration:!0}));let n=e.attrs.colWidths,a=e.attrs.backgroundColor;return e.forEach((e,r,o)=>{let s=t+1+r,l={isLayoutCellDecoration:!0,colWidth:n[o],colIndex:o,layoutBackgroundColor:a};i.push(tD.Decoration.node(s,s+e.nodeSize,{},l))}),!1}),tD.DecorationSet.create(t,i)},"findLayoutCellDecoration",0,aT],821988);let aL=e=>{let t,i,n,a,{node:r,decorations:o}=e,{verticalAlign:s,backgroundColor:l}=r.attrs,{layoutBackgroundColor:d}=aT(o),{backgroundColor:c,themeVars:u,marginStyles:p}=(t=(0,x.useAppSelector)(C.selectTheme),n=(i=l??d)&&(0,D.getThemeCSSVars)(t,i),a=(0,P.useMemo)(()=>{if(i)return{margin:"0 0.5em",paddingInlineStart:"1em",paddingInlineEnd:"1em"}},[i]),{backgroundColor:i,themeVars:n,marginStyles:a});return(0,A.jsxs)(tc.NodeViewWrapper,{className:"grid-cell",style:{position:"relative",justifyContent:s,...u,...p,...c&&{backgroundColor:"var(--card-background-color)",borderRadius:"var(--card-border-radius)"}},"data-selection-ring":!0,children:[(0,A.jsx)(i6.ContainerDragHandle,{handlePlacement:"top",...e,"data-testid":"column-drag-handle",label:(0,A.jsx)(I.Flex,{direction:"column",align:"center",children:(0,A.jsx)(ec.Trans,{message:"Select column<0>Drag to rearrange",id:"zWdF4l",components:{0:(0,A.jsx)(to.Text,{color:"gray.500"})}})})}),(0,A.jsx)(tu.NodeViewContent,{})]})},aj=(0,S.createTiptapNode)("gridCell",{isolating:!0,selectable:!1,containerHandle:!0,parseHTML:()=>[{tag:"div[class=column]",getAttrs:e=>({verticalAlign:e.getAttribute("verticalalign")||e.getAttribute("data-vertical-align")||null,backgroundColor:e.getAttribute("data-background-color")||null})},{tag:"div",context:"gridLayout/",getAttrs:e=>({verticalAlign:e.getAttribute("verticalalign")||e.getAttribute("data-vertical-align")||null,backgroundColor:e.getAttribute("data-background-color")||null})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"column",...e.attrs.verticalAlign&&{"data-vertical-align":e.attrs.verticalAlign},...e.attrs.backgroundColor&&{"data-background-color":e.attrs.backgroundColor}}),0],addNodeView:()=>(0,v.ReactNodeViewRenderer)(aL,{update:k.attrsOrDecorationsChanged})})},758991,184204,38459,516813,33716,457370,141399,537480,635363,887391,776847,553454,505130,259526,736379,327039,718456,951127,e=>{"use strict";let t,i,n,a;e.s(["Layout",()=>ed],758991);var r=e.i(755453),o=e.i(473226),s=e.i(175863);e.i(144786);var l=e.i(275316),d=e.i(55889),c=e.i(285598),u=e.i(599294),p=e.i(767730);e.i(838054);var h=e.i(408767),m=e.i(977581),g=e.i(6419),f=e.i(438106);e.i(84594);var b=e.i(693252),x=e.i(878132),y=e.i(777226),v=e.i(577281),C=e.i(912228),w=e.i(557683),S=e.i(321071),k=e.i(490800),A=e.i(204319),E=e.i(311524),_=e.i(597456),I=e.i(4877),M=e.i(821988),T=e.i(622758);class L{dragging;constructor(e=null){this.dragging=e}}let j=new s.PluginKey("layoutPlugin");var P=e.i(325059),D=e.i(625878);let N=new s.PluginKey("layoutResizing");class R{activeHandle;dragging;constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}getActiveHandleAbs(e){return this.activeHandle?(0,D.relativeToAbsolutePos)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?this.activeHandle=null:this.activeHandle=(0,D.absoluteToRelativePos)(e,t.setHandle),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let i=e.getMeta(N);return i&&"setHandle"in i?this.setHandle(t,i):i&&"setDragging"in i?this.setDragging(i):i&&"reset"in i?this.reset():this}}let O=(e,t)=>{e.dispatch(e.state.tr.setMeta(N,{setHandle:t}))},B=(e,t)=>{e.dispatch(e.state.tr.setMeta(N,{setDragging:t}))},z=(e,t)=>{let{node:i,offset:n}=e.domAtPos(t.start()),a=i.childNodes[n];do if(a&&a.classList&&a.classList.contains("node-gridLayout"))break;while(a=a.parentNode)return a};var F=e.i(615505);e.s(["LayoutView",()=>el],184204);var H=e.i(391398),W=e.i(613616),U=e.i(344233),V=e.i(641099),G=e.i(470645),$=e.i(524473),Z=e.i(541075);e.i(828525);var K=e.i(896620);e.i(314572);var q=e.i(835128),Y=e.i(358280),X=e.i(408122),Q=e.i(191788),J=e.i(783197),ee=e.i(136484),et=e.i(188407),ei=e.i(418755),en=e.i(432247),ea=e.i(551880),er=e.i(194552),eo=e.i(343902),es=e.i(808707);let el=e=>{let{node:t,editor:i,getPos:n}=e,a=t.content.childCount,r=(0,ei.useAppSelector)(ea.selectContentEditable),o=(0,ee.useShouldRenderMobileVersion)(),s=(0,J.useIsThumbnailView)();(({getPos:e,updateAttributes:t,node:i})=>{(0,q.useTiptapEditorEffect)(n=>{let a=e();if(void 0===a)return;let r=n.state.doc.resolve(a),o=[];try{o=(0,T.getLayoutChildren)(r)}catch(e){console.error("[caught] LayoutView Error getting layout children:",e);return}o.length!==i.attrs.colWidths.length&&t({colWidths:(0,y.createColumnWidths)(o.length)})},[i,t])})(e);let l=a%2==0,d=Math.min((0,et.useGammaBreakpointValue)({base:1,sm:l?2:1,md:l?2:3,lg:4})||4,a),c=(0,Q.useCallback)(()=>{let e=n();"number"==typeof e&&i.commands.addLayoutCell(e)},[i,n]),u=a`${e}%`).join(" ");return(0,H.jsx)(er.AnnotatableNodeViewWrapper,{...e,children:(0,H.jsxs)(V.SimpleGrid,{className:(0,G.cx)("grid-col-controls",r&&!s&&"is-editable"),columns:d,gap:"var(--grid-border)",position:"relative",gridTemplateColumns:p,"data-selection-ring":!0,children:[(0,H.jsx)(en.NodeViewContent,{className:"layout-content"}),(0,H.jsx)(eo.ContainerDragHandle,{...e,handlePlacement:"outside",label:X.i18n._({id:"Szg6OU",message:"Select layout"}),"data-testid":"layout-drag-handle"}),(0,H.jsx)(W.Flex,{contentEditable:!1,position:"absolute",top:"0",h:"100%",align:"center",w:6,insetInlineEnd:-3,className:"add-column",opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",children:u&&!s&&(0,H.jsx)(K.GammaTooltip,{label:(0,H.jsx)(Y.Trans,{message:"Add column",id:"AgvHni"}),placement:"top",children:(0,H.jsx)(U.IconButton,{icon:(0,H.jsx)(Z.FontAwesomeIcon,{icon:$.faPlus}),"aria-label":X.i18n._({id:"AgvHni",message:"Add column"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,zIndex:"1",onClick:c})})})]})})},ed=(0,p.createTiptapNode)("gridLayout",{defining:!1,isolating:!0,selectable:!1,priority:f.ExtensionPriorityMap.Layout,containerHandle:!0,parseHTML:()=>[{tag:"div[class=columns]",getAttrs:e=>eu(e)},{tag:"columns",getAttrs:e=>eu(e)}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,r.mergeAttributes)(t,{class:"columns",...e.attrs.colWidths?.length&&{"data-colWidths":JSON.stringify(e.attrs.colWidths)},...e.attrs.backgroundColor&&{"data-background-color":e.attrs.backgroundColor}}),0],addNodeView:()=>(0,h.ReactNodeViewRenderer)(el,{update:v.numChildrenOrAttrsOrDecorationsChanged,ignoreMutation:d.ignoreDataMutation}),addProseMirrorPlugins(){let e;return[(e=this.editor,new s.Plugin({key:j,state:{init:()=>new L,apply:(e,t)=>t},appendTransaction:(e,t,i)=>{if(!e.some(e=>e.docChanged))return null;let n=e.find(e=>e.selectionSet),a=i.tr;if(i.doc.descendants((e,t)=>{if("gridLayout"===e.type.name&&1==e.childCount){let i=a.mapping.map(t);a.replaceWith(i,a.mapping.map(t+e.nodeSize),e.child(0).content).setMeta("annotationEvent",{type:"unwrap-node",pos:i})}}),!a.docChanged)return null;if(n){let e=n.selection.$from.depth-a.selection.$from.depth,t=(0,c.findSelectionNearOrGapCursor)(a.doc.resolve(n.selection.from-e));t&&a.setSelection(t)}return a},props:{decorations:e=>(0,M.decorateLayouts)(e),handleDOMEvents:{drop(t,i){let n=i.target,a=n instanceof Element?n?.closest?.("[data-gamma-child-tiptap-editor]"):null;if(a){let e=t.dom;if(!a.contains(e))return!1}let r=t.dragging?.annotations;if(!j.getState(t.state))return!1;let o=t.dragging?.slice,s=null,l=null,d=(0,I.getDataTransferFiles)(i).filter(I.isUploadable);try{if(l=(0,S.checkMediaDropTarget)(t,i,o),s=(0,T.checkColumnDropTarget)(t,i,o),(0,E.checkImageReplacementDropTarget)(t,i,o,t.dragging?.operation||"insert"))return!1}catch(e){return!1}try{let{selection:n}=t.state,a=!n.empty&&0===d.length,c=o?.content.toJSON(),u=[];if(d.length>0&&(c=(u=(0,_.setupUploads)(e,d)).map(e=>e.content)),!c)return!1;if(c[0]?.type==="image"&&c[0].attrs?.resize&&(l||s)&&(c[0].attrs.resize=(0,A.getCropAttrsFromResize)(c[0].attrs.resize)),s?.node.type.name==="gridCell"){let{node:t,pos:n,side:o}=s,l="left"===o?n:n+t.nodeSize,d=c[0]?.type==="gridCell",p=r?.origNodePos,h=p&&d?(0,T.adjustColWidthsInRearrange)(p,l,e):void 0,m=d?c:{type:"gridCell",content:c},g=e.chain().insertContentAt({from:l,to:l},m,{updateSelection:!1});return h&&g.updateNestedAttributesAtPos(h.parentPos,{colWidths:h.colWidths}),g.command(({tr:e})=>(a&&e.deleteSelection(),r&&e.setMeta("annotationEvent",{type:"drop",dragging:r,droppedBlockPos:l+ +!d}),!0)).focusMapped(l,1).run(),u.length>0&&u.forEach(e=>{e.upload()}),i.preventDefault(),!0}if(!l&&!s)return;let{node:p,pos:h,side:m}=l||s;if(h>n.from&&h{if(a){let e=t.state.selection,n=i.mapping.map(e.from),a=i.mapping.map(e.to);i.delete(n,a)}if(r){let n="left"===m&&o?o.size:p.nodeSize,a=(0,g.computeLayoutCreateMoveInstructions)({side:m,view:t,tr:i,dragging:r,dropPos:h,dropNode:p,leftContentSize:n});requestAnimationFrame(()=>{e.commands.moveAnnotations?.(a)})}return!0}).focusMapped(h,x).run(),u.length>0&&u.forEach(e=>{e.upload()})}catch(e){console.error("(caught) [LayoutPlugin] handleDrop error:",e)}return i.preventDefault(),!0}}}})),new s.Plugin({key:N,state:{init:()=>new R,apply:(e,t,i,n)=>t.apply(e,n)},props:{attributes:e=>null!==N.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(e,t)=>!!l.featureFlags.get("layoutResizing")&&(((e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let i=N.getState(e.state);if(i.dragging)return;let n=function(e,t){let i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i||-1===i.inside)return null;let n=e.state.doc.resolve(i.inside);if(n.nodeAfter?.type.name!=="gridCell")return null;let a=e.nodeDOM(n.pos);if(!a)return null;let r=(0,P.isRtlEnabled)(),{left:o,right:s}=a.getBoundingClientRect(),l=s-t.clientX,d=t.clientX-o;if(r?l<=8:d<=8){let t=e.state.doc.resolve(n.before(n.depth)),i=((e,t)=>{for(let i=0;ie.pos===n.pos);return i?.pos||null}return(r?d<=8:l<=8)?n.pos:null}(e,t);n!==i.getActiveHandleAbs(e.state)&&O(e,n)})(e,t),!1),mouseleave(e){let t;return!!l.featureFlags.get("layoutResizing")&&(null===(t=N.getState(e.state)).getActiveHandleAbs(e.state)||t.dragging||O(e,null),!1)},mousedown:(e,t)=>!!l.featureFlags.get("layoutResizing")&&(!function(e,t){let i;if(!e.editable)return;let n=N.getState(e.state),a=n.getActiveHandleAbs(e.state);if(null===a||n.dragging)return;let r=e.state.doc.resolve(a),s=[...r.node().attrs.colWidths],l=(0,T.getColIndex)(r),d=(i=e.domAtPos(a)).node.childNodes[i.offset].offsetWidth,c=z(e,r),p=c.offsetWidth;B(e,{startX:t.clientX,startWidth:d,colWidths:s,tableWidth:p,colIndex:l});let h=null;function m(t){window.removeEventListener("mouseup",m),window.removeEventListener("mousemove",g);let i=N.getState(e.state);if(i.dragging){if(null===h)return void B(e,null);if(i.dragging)try{var n,a,r,o,s;let t,l,d,c,u=i.getActiveHandleAbs(e.state);n=e,a=u,r=h,t=n.state.doc.resolve(a).before(),l=n.state.tr.setNodeMarkup(t,void 0,{colWidths:[...r]}).setMeta("annotationEvent",{type:"update-node-attrs",pos:t}),n.dispatch(l),o=n,s=a,d=o.state.doc.resolve(s),(c=z(o,d).querySelector(".grid-col-controls"))&&(c.style.gridTemplateColumns=""),B(e,null)}catch(t){e.dispatch(e.state.tr.setMeta(N,{reset:!0}))}h=null}}function g(t){var i,n;let a;if(!t.which)return m(t);let r=N.getState(e.state),s=r.getActiveHandleAbs(e.state);if(!r.dragging||null===s)return;let{colIndex:l,colWidths:d}=r.dragging,p=function(e,t){let{tableWidth:i}=e,n=t.clientX-e.startX,a=(0,P.isRtlEnabled)()?-n:n;return(0,o.default)(100*a/i,0)}(r.dragging,t);i=c,n=h=(0,y.rebalanceColWidths)(d,l,p,15),(a=i.querySelector(".grid-col-controls"))&&(a.style.gridTemplateColumns=n.map(e=>`${e}%`).join(" ")),(0,u.dispatchContainerResizeEvent)(c)}window.addEventListener("mouseup",m),window.addEventListener("mousemove",g),t.preventDefault()}(e,t),!1)},decorations(e){let t=N.getState(e).getActiveHandleAbs(e);if(null!==t){let i=[];try{let n=document.createElement("div");return n.className="column-resize-handle",i.push(F.Decoration.widget(t+1,n)),F.DecorationSet.create(e.doc,i)}catch(e){return console.error(`(caught) layoutResizing error: ${e.message}`),F.DecorationSet.empty}}},nodeViews:{}}})]},addCommands(){return{useLayoutPreset:(e,t)=>({dispatch:i,tr:n,commands:a,view:o})=>{if(!i)return!0;let s=(0,T.getParentLayout)(n.doc.resolve(e));if(!s)return!0;let l=(0,T.getLayoutChildren)(s),d=t.length-l.length,p=[];for(;0!==d;){if(d<0){let t=(0,T.getLayoutCellResolvedPos)(n.doc.resolve(e),-1),i=t.nodeAfter;n.deleteRange(t.pos,t.pos+i.nodeSize),p=[...1===i.childCount&&(0,r.isNodeEmpty)(i.firstChild)?[]:i.content.toJSON(),...p],d++;continue}if(d>0){a.addLayoutCell(s.pos,!1),d--;continue}}n.setNodeAttribute(e,"colWidths",t);let h=(0,T.getLayoutCellResolvedPos)(n.doc.resolve(s.pos),-1);if(!h||!h.nodeAfter)return!0;let m=h.pos+h.nodeAfter.nodeSize-1;if(a.insertContentAt(m,p,{updateSelection:!1}),n.selection.from>m||n.selection.to>m){let e=n.doc.resolve(h.pos+1).end(),t=(0,c.findSelectionNearOrGapCursor)(n.doc.resolve(e),-1);t&&n.setSelection(t)}let g=z(o,s);return g&&(0,u.dispatchContainerResizeEvent)(g),!0},insertLayout:e=>({dispatch:t,commands:i})=>{if(!t)return!0;let n=Array.from(Array(e),e=>ec);return i.insertContentAndSelect({type:"gridLayout",attrs:{colWidths:(0,y.createColumnWidths)(e)},content:n})},addLayoutCell:(e,t=!0)=>({chain:i,state:n})=>{let a=n.doc.nodeAt(e);if(!a||a.type.name!==ed.name)return!1;let r=e+a.nodeSize-1,{colWidths:s}=a.attrs,l=s.length,d=(0,o.default)(100/(l+1),2),c=(0,y.addColWidth)(s,l,d,15),u=i().insertContentAt(r,ec,{updateSelection:!1});return t&&u.selectInsertedNode(),u.command(({tr:t})=>(t.setNodeAttribute(e,"colWidths",c),!0)).run(),!0},handleLayoutDelete:(e,t=!0)=>({tr:i,dispatch:n,state:a})=>{if(!n)return!0;let o=(0,r.findParentNode)(e=>e.type.name===w.LayoutCell.name)(a.selection),s=(0,r.findParentNode)(e=>e.type.name===ed.name)(a.selection);if(!o||!s)return!1;if(!t||(0,m.isTreeEmpty)(o.node)){if(2==s.node.childCount){let e=o.node===s.node.child(0),t=e?s.node.child(1):s.node.child(0),n=e?s.start+s.node.child(0).nodeSize+1:s.start+1,a=n+t.content.size;i.replaceWith(s.pos,s.pos+s.node.nodeSize,t.content);let r=(0,c.findSelectionNearOrGapCursor)(i.doc.resolve(s.pos+(e?0:t.content.size)),e?1:-1);r&&i.setSelection(r);let l=(0,g.computeDeleteLayoutAnnotationMoves)({insertPos:s.pos,contentPos:n,contentEnd:a,editor:this.editor});requestAnimationFrame(()=>{this.editor.commands.moveAnnotations?.(l)})}else{let t=i.doc.resolve(o.pos);(0,C.deleteLayoutCell)(i,t,e),i.setNodeAttribute(s.pos,"colWidths",(0,y.removeColWidth)(s.node.attrs.colWidths,[(0,T.getColIndex)(t)]))}return!0}let{parent:l}=a.selection.$from;return!!(a.selection.empty&&l.isTextblock&&(0,r.isNodeEmpty)(l))&&l==o.node.firstChild&&!e&&(i.deleteRange(a.selection.$from.before(),a.selection.$from.after()),!0)},goToNextLayoutCell:e=>({tr:t,state:i})=>{let n=(0,r.findParentNode)(e=>e.type.name===w.LayoutCell.name||e.type.name===x.SmartLayoutCell.name)(i.selection),a=(0,r.findParentNode)(e=>e.type.name===ed.name||e.type.name===b.SmartLayout.name)(i.selection);if(!n||!a)return!1;let o=i.doc.resolve(n.pos),l=e?o.index()+1:o.index()-1;if(l<0||l>=o.parent.childCount)return!1;let d=o.posAtIndex(l);return t.setSelection(s.Selection.near(i.doc.resolve(d))),!0}}},addKeyboardShortcuts:()=>({Tab:({editor:e})=>!l.featureFlags.get("arrowAutocomplete")&&e.commands.goToNextLayoutCell(!0),"Shift-Tab":({editor:e})=>!l.featureFlags.get("arrowAutocomplete")&&e.commands.goToNextLayoutCell(!1)})}),ec={type:"gridCell",content:[{type:"paragraph"}]};function eu(e){let t,i=0;e.childNodes.forEach(e=>{"DIV"===e.nodeName&&i++});try{let n=e.getAttribute("colWidths")??e.getAttribute("data-colWidths");if(n){let e=JSON.parse(n);Array.isArray(e)&&e.length===i&&e.every(e=>"number"==typeof e)&&((0,y.fixWidths)(e,10,100),t=e)}}catch(e){console.error("Error parsing AI generated colWidths",e)}return{colWidths:t??(0,y.createColumnWidths)(i),backgroundColor:e.getAttribute("data-background-color")||null}}e.s(["Bullet",()=>eb],516813),e.s(["BulletView",()=>eh],38459);var ep=e.i(864935);let eh=e=>{let{node:t,decorations:i}=e,{fontSize:n,placeholder:a}=t.attrs;return(0,H.jsx)(er.AnnotatableNodeViewWrapper,{dir:(0,ep.getAlignDirection)(i),...e,children:(0,H.jsx)(en.NodeViewContent,{as:"li","data-testid":"bullet-list-item","data-font-size":n,"data-placeholder":a})})};var em=e.i(53237),eg=e.i(127969);let ef=/^\s*([-*])\s$/,eb=(0,p.createTiptapNode)("bullet",{defining:!0,selectable:!1,allowFontSizes:"body",addNodeView:()=>(0,h.ReactNodeViewRenderer)(eh,{as:"ul",update:v.attrsOrDecorationsChanged,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addOptions:()=>({HTMLAttributes:{}}),addInputRules(){return[(0,em.listFilteredInputRule)({find:ef,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-Shift-8":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Bullet}),"Mod-.":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Bullet})}),parseHTML(){return[{tag:`li[variant="${this.name}"]`,getAttrs:e=>({fontSize:(0,p.parseFontSize)(e)})}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.mergeAttributes)(this.options.HTMLAttributes,t,{variant:this.name,indent:e.attrs.indent,...(0,p.renderFontSize)(e.attrs)}),0]}});e.s(["Numbered",()=>eC],457370),e.s(["NumberedView",()=>ey],33716);let ex=[e=>e.toString(),e=>String.fromCharCode(96+e),e=>(function(e){let t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},i="";for(let n of Object.keys(t)){let a=Math.floor(e/t[n]);e-=a*t[n],i+=n.repeat(a)}return i})(e).toLowerCase()],ey=e=>{let{decorations:t,node:i}=e,{indent:n,fontSize:a,placeholder:r}=i.attrs,o=t.find(e=>e.spec.listNumber)?.spec.listNumber,s=(ex[n%ex.length]||ex[0])(o);return(0,H.jsx)(er.AnnotatableNodeViewWrapper,{dir:(0,ep.getAlignDirection)(t),...e,children:(0,H.jsx)(en.NodeViewContent,{as:"li","data-list-counter":s,"data-font-size":a,"data-placeholder":r})})},ev=/^(\d+)\.\s$/,eC=(0,p.createTiptapNode)("numbered",{defining:!0,selectable:!1,allowFontSizes:"body",addOptions:()=>({HTMLAttributes:{}}),addNodeView:()=>(0,h.ReactNodeViewRenderer)(ey,{as:"ol",update:v.attrsOrDecorationsChanged,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addInputRules(){return[(0,em.listFilteredInputRule)({find:ev,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-/":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Numbered}),"Mod-Shift-7":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Numbered})}),parseHTML(){return[{tag:`li[variant="${this.name}"]`,getAttrs:e=>({fontSize:(0,p.parseFontSize)(e)})}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.mergeAttributes)(this.options.HTMLAttributes,t,{variant:this.name,indent:e.attrs.indent,...(0,p.renderFontSize)(e.attrs)}),0]}});e.s(["Todo",()=>eM],537480),e.s(["TodoView",()=>eE],141399);var ew=e.i(819197),eS=e.i(887527),ek=e.i(749e3),eA=e.i(82050);let eE=e=>{let{decorations:t,node:i,updateAttributes:n}=e,a=(0,ei.useAppSelector)(eA.selectFile),r=(0,ek.useCanEditableFile)("edit",a),{checked:o,fontSize:s,placeholder:l}=i.attrs;return(0,H.jsx)(er.AnnotatableNodeViewWrapper,{dir:(0,ep.getAlignDirection)(t),...e,children:(0,H.jsxs)(eS.Text,{as:"li",color:o?"var(--body-color-muted)":void 0,textDecoration:o?"line-through":void 0,transition:"color 250ms ease-out",position:"relative",className:"todo","data-font-size":s,children:[(0,H.jsx)(ew.Checkbox,{contentEditable:!1,suppressContentEditableWarning:!0,isChecked:o,onChange:e=>{r&&n({checked:e.target.checked})},position:"absolute"}),(0,H.jsx)(en.NodeViewContent,{as:"span",className:"todo-content","data-placeholder":l})]})})},e_=/^\s*\[[ ]?\]\s$/,eI=/^\s*\[x\]\s$/,eM=(0,p.createTiptapNode)("todo",{defining:!0,selectable:!1,allowFontSizes:"body",addOptions:()=>({HTMLAttributes:{}}),addNodeView:()=>(0,h.ReactNodeViewRenderer)(eE,{as:"ul",update:v.attrsOrDecorationsChanged,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addInputRules(){return[(0,em.listFilteredInputRule)({find:e_,type:this.type,getAttributes:{checked:!1}},this.editor.state.schema),(0,em.listFilteredInputRule)({find:eI,type:this.type,getAttributes:{checked:!0}},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-,":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Todo}),"Mod-Shift-9":({editor:e})=>e.commands.setListItems({variant:eg.ListVariant.Todo})}),parseHTML(){return[{tag:`li[variant="${this.name}"]`,getAttrs:e=>({fontSize:(0,p.parseFontSize)(e)})}]},renderHTML({node:e,HTMLAttributes:t}){return["li",(0,r.mergeAttributes)(this.options.HTMLAttributes,t,{variant:this.name,indent:e.attrs.indent,checked:e.attrs.checked,...(0,p.renderFontSize)(e.attrs)}),0]}});e.s(["Embed",()=>to],718456),e.i(261991);var eT=e.i(547119),eL=e.i(235704),ej=e.i(878917),eP=e.i(391736),eD=e.i(329860);e.s(["EmbedView",()=>tr],327039);var eN=e.i(428683),eR=e.i(198311),eO=e.i(367792),eB=e.i(849187),ez=e.i(495084),eF=e.i(842252),eH=e.i(979353),eW=e.i(196444),eU=e.i(15272),eV=e.i(641078),eG=e.i(335884);let e$=({attrs:e,inGallery:t,shouldDisableClick:i})=>{let n=(0,eD.getMediaSourceUrl)(e),a=e.displayStyle,r=(0,eG.useShouldUsePublishedVersion)(),o=(0,eD.getEmbedOrVideoClickBehavior)(e,"preview"===a&&!t),{handleOpenLinkWithInterstitial:s,handleOpenNativeLinkWithInterstitial:l,linkUrlSafe:d}=(0,eV.useOpenLinkWithInterstitial)(n),c="newTab"===o&&!i;return(0,Q.useMemo)(()=>c?{url:r?n:d,handleOpenLinkWithInterstitial:s,handleOpenNativeLinkWithInterstitial:l}:void 0,[s,l,d,n,c,r])};e.s(["useMediaOpenInNewTab",0,e$],635363),e.i(297036);var eZ=e.i(534316),eK=e.i(753128);e.s(["EmbedAndVideoClickOrZoomCapture",()=>eQ],887391);var eq=e.i(264333),eY=e.i(650292),eX=e.i(471194);let eQ=({enterZoom:e,zoomBoxProps:t,url:i,handleOpenLink:n,handleOpenInNewTab:a})=>{let r=(0,ei.useAppSelector)(ea.selectEditable);return eY.isPuppeteer?null:!r&&n&&i?(0,H.jsx)(eq.LinkBox,{inset:0,w:"100%",h:"100%",position:"absolute",zIndex:1,cursor:"pointer",children:(0,H.jsx)(eq.LinkOverlay,{onClick:n,href:i,target:"_blank",rel:"noopener nofollow"})}):(0,H.jsx)(eX.ZoomClickCapture,{enterZoom:e,doubleClickNonZoomHandler:r?a:void 0,...t})};e.s(["EmbedPlayer",()=>tt],736379);var eJ=e.i(892194),e0=e.i(695192);let e1={allowPopups:!1,noSandbox:!1,preventScroll:void 0},e2=({initialUrl:e,frameRef:t,iframeOptions:i,backgroundColor:n="white",onLoad:a,...r})=>{let{allowPopups:o,preventScroll:s,noSandbox:l}=i||e1,d=l?void 0:`allow-forms allow-scripts allow-same-origin allow-modals allow-pointer-lock ${o?"allow-popups allow-popups-to-escape-sandbox":""}`;return(0,H.jsx)(W.Flex,{w:"100%",h:"100%",direction:"column",background:n,...r,children:(0,H.jsx)("iframe",{ref:t,src:e,frameBorder:"0",width:"100%",height:"100%",allow:"encrypted-media; camera; microphone",allowFullScreen:!0,title:"Embedded app",sandbox:d,scrolling:s?"no":void 0,style:{flex:1},onLoad:()=>{a?.()}})})};e.s(["Browser",0,e2],776847),e.s([],553454);var e3=e.i(261442);let e5=(t=null,i=new Map,n={capture:!0,passive:!0},a=e=>{let a=e.replace(/^https?:/,"");i.delete(a),0===i.size&&t&&(window.removeEventListener("message",t,n),t=null)},(e,r)=>{if(i.set(e.replace(/^https?:/,""),r),t)return()=>a(e);let o=Math.floor(519*Math.random());return t=e=>{if("https://if-cdn.com"===e.origin)try{let t=JSON.parse(e.data);if(!("context"in t))return;t.messageId=Math.floor(519*Math.random()),t.listenerId=o;let n=t.context.replace(/^https?:/,"");if(i.has(n))return void i.get(n)(t)}catch(e){console.error(e)}},window.addEventListener("message",t,n),()=>a(e)});function e4(e){return!!e&&"if-cdn.com"===new URL(e).host}let e6=({html:e,onLoad:t,...i})=>{let{handlePreload:n}=(e=>{let[t,i]=(0,Q.useState)(null),n="function"==typeof e,a={resizeSettled:!1,loadFired:!1,preloadStart:-1/0,loadStart:-1/0,triggered:!1},r=(0,Q.useRef)({...a}),o=(0,Q.useRef)(e),s=(e=!1)=>{let{preloadStart:t,loadStart:i,resizeSettled:n,loadFired:a,triggered:s}=r.current,l=performance.now()-t,d=performance.now()-i;if(!s&&(e||n&&a)){console.debug(`[embed] firing onLoad ${d}ms after frame load`,{preloadDelta:l,loadDelta:d}),r.current.triggered=!0,o.current?.();return}};return(0,Q.useEffect)(()=>{o.current=e},[e]),(0,Q.useEffect)(()=>{if(!n||!e4(t))return()=>{r.current={...a}};r.current.preloadStart=performance.now();let e=null,i=e5(t,e=>{e&&"object"==typeof e&&"height"in e&&o.push(e.height),l(o.length?200:1e3)}),o=[],l=t=>{e&&(clearTimeout(e),e=null),r.current.resizeSettled||(e=setTimeout(()=>{e=null,r.current.resizeSettled=!0,i(),s()},t))};return l(1e3),()=>{e&&(clearTimeout(e),e=null),i(),r.current={...a}}},[t,n]),{handlePreload:e=>(i(e),()=>{r.current.loadStart=performance.now(),r.current.loadFired=!0,s(!e4(e))})}})(t),a=(0,Q.useRef)({frame:null,listener:null}),r=(0,Q.useMemo)(()=>({__html:e}),[e]);return(0,H.jsx)(eN.Box,{position:"relative",role:"group",className:"html-embed-viewer","data-selection-ring":"inside","data-selection-background":!0,borderRadius:"var(--box-border-radius)",contentEditable:!1,dangerouslySetInnerHTML:r,ref:e=>{if(!e){a.current.frame&&a.current.listener&&a.current.frame.removeEventListener("load",a.current.listener),a.current={frame:null,listener:null};return}let i=e?.getElementsByTagName("iframe");if(i?.length!==1)return void t?.();let r=i.item(0),o=r.src;if(r===a.current.frame)return;a.current.frame&&a.current.listener&&a.current.frame.removeEventListener("load",a.current.listener);let s=n(o);a.current={frame:r,listener:s},r.addEventListener("load",s)},...i})};e.s(["HtmlEmbed",0,e6],505130),e.s([],259526);var e9=e.i(335799),e8=e.i(865639);let e7=({frameRef:e,node:t,isStealth:i=!1,isDark:n})=>{let a=(0,eD.getMediaSourceUrl)(t.attrs),{handleOpenLinkWithInterstitial:r}=(0,eV.useOpenLinkWithInterstitial)(a);return(0,H.jsxs)(W.Flex,{direction:"row",background:n?"gray.700":"gray.50",align:"center",borderBottom:"1px solid",borderColor:n?"gray.600":"gray.200",w:"100%",p:1,zIndex:2,position:i?"absolute":"relative",transitionProperty:"common",transitionDuration:"normal",opacity:+!i,_hover:{opacity:1},fontFamily:"body",children:[(0,H.jsx)(e8.Input,{size:"xs",value:a,border:"0",noOfLines:1,color:n?"gray.200":"gray.600",pointerEvents:"none",readOnly:!0}),(0,H.jsxs)(e9.ButtonGroup,{size:"xs",spacing:1,variant:"ghost",colorScheme:"gray",ml:2,children:[(0,H.jsx)(K.GammaTooltip,{label:(0,H.jsx)(Y.Trans,{message:"Reload",id:"HpK/8d"}),placement:"top",children:(0,H.jsx)(U.IconButton,{isRound:!0,"aria-label":X.i18n._({id:"HpK/8d",message:"Reload"}),icon:(0,H.jsx)(Z.FontAwesomeIcon,{icon:$.faRedo}),onClick:()=>{if(!e.current)return;let t=e.current.src;e.current.src="about:blank",setTimeout(()=>{e.current&&(e.current.src=t)},50)}})}),(0,H.jsx)(K.GammaTooltip,{label:(0,H.jsx)(Y.Trans,{message:"Open in new tab",id:"Alx2/L"}),placement:"top",children:(0,H.jsx)(U.IconButton,{isRound:!0,"aria-label":X.i18n._({id:"Alx2/L",message:"Open in new tab"}),icon:(0,H.jsx)(Z.FontAwesomeIcon,{icon:$.faExternalLink}),onClick:r})})]})]})};var te=e.i(224960);let tt=({isZoomed:e,useStealthNav:t,onLoad:i,opacity:n,...a})=>{let{node:r}=a,o=(0,Q.useRef)(null),{colorMode:s}=(0,eJ.useColorMode)(),l="dark"===s,d=(0,ee.useShouldRenderMobileVersion)(),{url:c,proxy:u,source:p,embed:h}=r.attrs,m=(0,te.getEmbedProvider)(p),g=m.rewriteEmbedUrl&&c?m.rewriteEmbedUrl(c):c,f=u?(0,te.getProxiedUrl)(g):g||"about:blank",{isUntrusted:b}=(0,e0.useLinkInterstitial)(f);return m.preferHtml&&h?.html?(0,H.jsx)(e6,{html:h.html,w:e?"100%":void 0,onClick:e?e3.stopPropagation:void 0,onLoad:i,opacity:n,...m.minWidth?{minW:`min(${m.minWidth}, 100vw, 100%)`,left:"50%",transform:"translateX(-50%)"}:void 0}):b?(0,H.jsx)(W.Flex,{h:"100%",w:"100%",align:"center",justify:"center",children:"unknown embed"}):(0,H.jsxs)(W.Flex,{direction:"column",h:"100%",w:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",borderRadius:e?"lg":"var(--box-border-radius)",border:"1px solid",borderColor:l?"gray.600":"gray.200",overflow:"hidden",position:"relative","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,className:(0,G.cx)("embed-viewer"),onClick:e?e3.stopPropagation:void 0,children:[(0,H.jsx)(e7,{...a,frameRef:o,isDark:l,isStealth:t}),!e&&(0,H.jsx)(eX.ClickCapture,{...a,frameRef:o}),(0,H.jsx)(e2,{initialUrl:f,frameRef:o,iframeOptions:m.iframeOptions,onLoad:i,css:{aspectRatio:d?"1 / 1.618":"1.618 / 1"},flex:"1"})]})};var ti=e.i(525277);let tn=(0,eR.motion)(eN.Box),ta=(0,eR.motion)(W.Flex),tr=e=>{let{node:t,editor:i,decorations:n}=e,a=t.attrs,{source:r,embed:o,displayStyle:s,id:l,sourceUrl:d}=a,c=(0,te.getEmbedProvider)(r),{isZoomed:u,enterZoom:p,exitZoom:h}=(0,eZ.useMediaZoom)(l),m="inline"===s&&c.preferHtml&&o?.html,g=(0,eU.isNodeViewInGallery)(e),f=(0,ee.useShouldRenderMobileVersion)(),b=(0,ei.useAppSelector)(ea.selectEditable),x=(0,eW.isFocusedAndEditable)(n)||!(i.view instanceof F.EditorView&&i.view.hasFocus()),y=(0,eB.useFeatureFlag)("virtualizeEmbeds"),[v,C]=(0,Q.useState)(!1),w=!eO.config.GAMMA_PUPPETEER_SERVICE&&(m||"inline"===s)&&!g&&!(f&&c.forcePreviewOnMobile),{handleOpenLinkWithInterstitial:S,handleOpenNativeLinkWithInterstitial:k,url:A}=e$({attrs:a,inGallery:g,shouldDisableClick:!!(c.inlineInteractive&&w)})||{},E=(0,J.useIsThumbnailView)(),{inViewport:_,ref:I,dimensions:M}=(0,eH.useNodeIsInViewport)();return y&&w&&!E&&"embed.gdrive"!==c.key&&!1===_?(!0===v&&C(!1),(0,H.jsx)(er.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,H.jsx)(eF.VirtualizedPlaceholder,{ref:I,dimensions:M})})):(0,H.jsxs)(er.AnnotatableNodeViewWrapper,{...e,children:[(0,H.jsxs)(tn,{h:"100%",w:"calc(100% * var(--media-scale))",className:(0,G.cx)("embed-preview",!m&&!(c.inlineInteractive&&w)&&ez.CLICKABLE_BOX_CLASS),"data-export-as-image":!0,"data-export-link":d,position:"relative",overflow:m&&c.minWidth?"visible":"hidden","data-drag-handle":!0,ref:I,children:[w&&E?(0,H.jsx)(ti.ThumbnailEmbedPreview,{...e}):g?(0,H.jsx)(ti.MiniEmbedPreview,{...e}):w?(0,H.jsx)(eF.VirtualizedPlaceholder,{isLoading:!v,dimensions:M,enforceMinDimensions:"embed.twitter"===c.key,flexDir:"column",children:(0,H.jsx)(tt,{...e,opacity:+!!v,onLoad:()=>{C(!0)},useStealthNav:!0})}):(0,H.jsx)(ti.EmbedPreview,{...e}),c.inlineInteractive&&!f&&w?(0,H.jsx)(eN.Box,{position:"absolute",inset:0,zIndex:1,pointerEvents:b&&!x&&"inline"===s?"auto":"none",cursor:"default"}):c.inlineInteractive&&f&&w?(0,H.jsx)(H.Fragment,{}):(0,H.jsx)(eQ,{enterZoom:p,handleOpenLink:k,handleOpenInNewTab:S,url:A})]}),!g&&!E&&(0,H.jsx)(eK.ZoomableOverlay,{isZoomed:u,exitZoom:h,editor:i,children:(0,H.jsx)(ta,{h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,H.jsx)(tt,{...e,onLoad:()=>{C(!0)},isZoomed:!0})})})]})},to=(0,p.createTiptapNode)("embed",{draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,h.ReactNodeViewRenderer)(tr,{update:v.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=embed]",getAttrs:e=>({id:(0,p.parseIdAttr)(e,eP.generateMediaId),url:e.getAttribute("data-url")||void 0,source:e.getAttribute("data-source")||eT.WebpageProvider.key,thumbnail:(0,p.parseJSONAttr)(e,"thumbnail"),embed:(0,p.parseJSONAttr)(e,"embed"),meta:(0,p.parseJSONAttr)(e,"meta"),proxy:"true"===e.getAttribute("data-proxy")||void 0,sourceUrl:e.getAttribute("data-source-url")||void 0,displayStyle:e.getAttribute("data-display-style")||void 0,fullWidthBlock:"true"===e.getAttribute("data-full-width-block")||void 0,clickBehavior:e.getAttribute("data-click-behavior")||void 0,embedFetchStatus:(0,eD.toEmbedFetchStatus)(e.getAttribute("data-embed-fetch-status"))})}],renderHTML:({HTMLAttributes:e,node:t})=>["div",(0,r.mergeAttributes)(e,{class:"embed","data-id":t.attrs.id,...t.attrs.url&&{"data-url":t.attrs.url},...t.attrs.source&&{"data-source":t.attrs.source},...(0,p.renderJSONAttrs)(t.attrs,"thumbnail","embed","meta"),...t.attrs.proxy&&{"data-proxy":"true"},...t.attrs.sourceUrl&&{"data-source-url":t.attrs.sourceUrl},...t.attrs.displayStyle&&{"data-display-style":t.attrs.displayStyle},...t.attrs.fullWidthBlock&&{"data-full-width-block":"true"},...t.attrs.clickBehavior&&{"data-click-behavior":t.attrs.clickBehavior},...t.attrs.embedFetchStatus&&t.attrs.embedFetchStatus!==eD.EMBED_FETCH_STATUS_COMPLETE&&{"data-embed-fetch-status":t.attrs.embedFetchStatus}}),["a",{href:(0,eD.getMediaSourceUrl)(t),target:"_blank"},(0,eD.getMediaTitle)(t)]],addCommands:()=>({replaceEmbedsById:(e,t)=>({editor:i,chain:n})=>{let a=(0,r.findChildren)(i.state.doc,t=>"embed"===t.type.name&&t.attrs.id===e),o=n();return a.forEach(({pos:e,node:i})=>{o.insertContentAt({from:e,to:e+i.nodeSize},t,{updateSelection:!1})}),o.run(),!0},updateEmbedsById:(e,t)=>({editor:i,chain:n})=>{let a=(0,r.findChildren)(i.state.doc,t=>("embed"===t.type.name||"video"===t.type.name)&&t.attrs.id===e),o=n();return a.forEach(({pos:e})=>{o.updateAttributesAtPos(e,{thumbnail:t.thumbnail})}),o.run(),!0},insertEmbedAndFetchMetadata:(e,t,i=!1)=>({commands:n,editor:a})=>{let r=(0,eP.generateMediaId)();n.insertContent({type:"embed",attrs:{id:r,url:e,sourceUrl:e,displayStyle:t??"preview",meta:{title:"Loading..."}}},{updateSelection:!1});let o=!1;return(0,eL.fetchAndUpdateEmbedAttrsForUrlAndUploadThumbnail)(e,e=>{if(o)return void a.commands.updateEmbedsById(r,e);let i=ej.MediaSourcesMap[e.source];a.commands.replaceEmbedsById(r,{type:i?.nodeName||"embed",attrs:{...e,id:r,displayStyle:t??("video"===i.nodeName?"inline":"preview")}}),o=!0}).catch(t=>{console.warn("(caught) insertEmbedAndFetchMetadata error fetching url",t,e),i&&a.commands.replaceEmbedsById(r,e)}),!0}})});e.s(["GalleryPlugin",()=>tc,"PREVENT_FLEX_CLASSNAME",()=>ts],951127);let ts="gallery-prevent-flex";class tl{dragging;dragOperation;constructor(e=null,t=null){this.dragging=e,this.dragOperation=t}}let td=new s.PluginKey("galleryPlugin"),tc=e=>new s.Plugin({key:td,state:{init:()=>new tl,apply:(e,t)=>t},props:{handleDOMEvents:{drop(e){let t=e.dragging?.annotations,i=td.getState(e.state);if(!i)return!1;i.dragging=t,i.dragOperation=e.dragging?.operation||"insert"}},decorations:({doc:e})=>{let t=[];return e.descendants((e,i,n)=>{if((0,eU.isGalleryNode)(e))t.push(F.Decoration.node(i,i+e.nodeSize,{class:`gallery-layout-${e.attrs.layout}`},{children:e.content}));else if((0,eU.isGalleryNode)(n)){let a="image"===e.type.name&&e.attrs.resize?.clipType==="circle";t.push(F.Decoration.node(i,i+e.nodeSize,{class:a?ts:""},{inGallery:!0,layout:n.attrs.layout,dimensions:n.attrs.dimensions,thumbHeight:n.attrs.thumbHeight,thumbSpacing:n.attrs.thumbSpacing}))}}),F.DecorationSet.create(e,t)},handlePaste:(e,t,i)=>{let{selection:n,schema:a}=e.state;if(!(n instanceof s.NodeSelection&&(0,eU.isGalleryNode)(n.node)))return!1;if((0,eU.clipboardContainsGalleryContent)(a,i,t)){let t=e.state.tr.setSelection(s.TextSelection.create(e.state.doc,n.to-1));e.dispatch(t)}return!1},handleDrop:(t,i,n)=>{let a,r=td.getState(t.state),o=r?.dragging,s=r?.dragOperation||"insert";r&&(r.dragging=null,r.dragOperation=null);try{if((0,E.checkImageReplacementDropTarget)(t,i,n,s)||!(a=(0,eU.checkGalleryDropTarget)(t,i,n,!1)))return!1}catch(e){return console.error("(caught) [GalleryPlugin] handleDrop checkGalleryDropTarget error:",e),!1}try{let{selection:i}=t.state,r=n.content.toJSON(),{pos:s,side:l,node:d}=a,c=!i.empty,u=r.some(e=>"image"===e.type&&!e.attrs?.src),p=c&&!u;if(d&&(0,eU.isGalleryNode)(d)){let t="left"===l?s:s+1;e.chain().insertContentAt({from:t,to:t},r,{updateSelection:!1}).command(({tr:i})=>{if(p&&i.deleteSelection(),o){let n=e.state.tr;n.deleteSelection(),i.setMeta("annotationEvent",{type:"drop",dragging:o,droppedBlockPos:n.mapping.map(t)})}return!0}).focusMapped(t).run()}else if(d&&(0,eD.isMediaNode)(d)){let i="left"===l?[...r,d.toJSON()]:[d.toJSON(),...r];e.chain().insertContentAt({from:s,to:s+d.nodeSize},{type:"gallery",content:i},{updateSelection:!1}).command(({tr:i})=>{if(p&&i.deleteSelection(),o){let n=(0,g.computeMediaOnMediaGalleryCreationMoves)({side:l,view:t,tr:i,dragging:o,dropPos:s,dropNode:d});requestAnimationFrame(()=>{e.commands.moveAnnotations?.(n)})}return!0}).run()}}catch(e){console.error("(caught) [GalleryPlugin] handleDrop error:",e)}return!0}}})},694273,283098,892689,438486,236115,e=>{"use strict";e.s(["Gallery",()=>ey],694273);var t=e.i(755453),i=e.i(55889),n=e.i(767730);e.i(838054);var a=e.i(408767),r=e.i(438106),o=e.i(577281),s=e.i(951127);e.s(["GalleryView",()=>ex],236115);var l=e.i(391398),d=e.i(969641),c=e.i(613616),u=e.i(555145),p=e.i(344233),h=e.i(887527),m=e.i(654656),g=e.i(500425),f=e.i(524473),b=e.i(541075);e.i(828525);var x=e.i(896620),y=e.i(358280),v=e.i(408122),C=e.i(198311),w=e.i(191788),S=e.i(783197),k=e.i(469305),A=e.i(418755),E=e.i(283591),_=e.i(136484),I=e.i(19654),M=e.i(261442),T=e.i(466925),L=e.i(786928),j=e.i(432247),P=e.i(551880),D=e.i(194552),N=e.i(343902),R=e.i(864935),O=e.i(736379),B=e.i(525277),z=e.i(543315),F=e.i(59936),H=e.i(337130),W=e.i(597456);e.s([],438486),e.s(["Video",()=>ep],892689);var U=e.i(391736),V=e.i(329860);e.s(["VideoView",()=>eu],283098);var G=e.i(428683),$=e.i(470645),Z=e.i(367792);e.i(144786);var K=e.i(849187),q=e.i(495084),Y=e.i(842252),X=e.i(979353),Q=e.i(887391),J=e.i(224960),ee=e.i(15272),et=e.i(635363);e.i(297036);var ei=e.i(534316),en=e.i(753128);e.i(553454);var ea=e.i(776847);e.i(259526);var er=e.i(505130),eo=e.i(471194);e.i(261991);var es=e.i(879891),el=e.i(987541);let ed=16/9,ec=({isZoomed:e,onLoad:t,opacity:i,position:n="relative",...a})=>{let{node:r}=a,{embed:o,source:s,sourceUrl:d}=r.attrs,c=s&&es.MediaProvidersMap[s]?es.MediaProvidersMap[s]:el.CustomVideoProvider,u=(0,w.useRef)(null),p=c.preferHtml&&o?.html,h=o?.height&&!o?.width,m=o?.height&&o?.width?o.width/o.height:o?.aspectRatio||ed,g=e?{width:`min(var(--media-maxW), calc(var(--media-maxH) * ${m}))`,height:"video.tiktok"===s?void 0:h?o.height:`min(var(--media-maxH), calc(var(--media-maxW) / ${m}))`,alignContent:"center"}:p?{width:"100%"}:h?{height:o.height}:{height:0,pb:`${100/m}%`},f=o?.url||r.attrs.embedUrl||d,b=c&&c.rewriteEmbedUrl&&f?c.rewriteEmbedUrl(f):f;return(0,l.jsxs)(G.Box,{position:n,opacity:i,"data-content-reference":!0,"data-drag-handle":!0,...g,onClick:e?M.stopPropagation:void 0,transition:"opacity .2s",children:[!e&&(0,l.jsx)(eo.ClickCapture,{...a,frameRef:u}),p?(0,l.jsx)(er.HtmlEmbed,{html:o.html,w:e?"100%":void 0,onClick:e?M.stopPropagation:void 0,onLoad:t,...c.minWidth?{minW:`min(${c.minWidth}, 100vw, 100%)`,left:"50%",transform:"translateX(-50%)"}:void 0,maxW:c.maxWidth}):(0,l.jsx)(ea.Browser,{initialUrl:b,backgroundColor:"none",borderRadius:"var(--box-border-radius)",overflow:"hidden","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,className:(0,$.cx)("video-player"),onLoad:t,iframeOptions:{preventScroll:!0,...c.iframeOptions},position:"absolute",inset:0,frameRef:u})]})},eu=e=>{let{node:t,editor:i}=e,n=t.attrs,{source:a,embed:r,displayStyle:o,id:s,sourceUrl:d}=n,{isZoomed:u,enterZoom:p,exitZoom:h}=(0,ei.useMediaZoom)(s),m=(0,ee.isNodeViewInGallery)(e),g=(0,J.getEmbedProvider)(a),f=(0,K.useFeatureFlag)("virtualizeEmbeds"),[b,x]=(0,w.useState)(!1),y=(0,S.useIsThumbnailView)(),v=!Z.config.GAMMA_PUPPETEER_SERVICE&&"inline"===o,C="inline"===o&&g.preferHtml&&r?.html,{handleOpenLinkWithInterstitial:k,handleOpenNativeLinkWithInterstitial:A,url:E}=(0,et.useMediaOpenInNewTab)({attrs:n,inGallery:m,shouldDisableClick:v&&!m})||{},{inViewport:_,ref:I,dimensions:M}=(0,X.useNodeIsInViewport)();return f&&v&&!1===_&&!y?(!0===b&&x(!1),(0,l.jsx)(D.AnnotatableNodeViewWrapper,{...e,as:"div",children:(0,l.jsx)(Y.VirtualizedPlaceholder,{ref:I,dimensions:M})})):(0,l.jsxs)(D.AnnotatableNodeViewWrapper,{...e,as:"div",children:[(0,l.jsx)(G.Box,{h:"100%",w:"calc(100% * var(--media-scale))",className:(0,$.cx)("embed-preview",!v&&q.CLICKABLE_BOX_CLASS),"data-export-as-image":!0,"data-export-link":d,position:"relative",overflow:C&&g.minWidth?"visible":"hidden",ref:I,children:y?(0,l.jsx)(B.ThumbnailEmbedPreview,{...e}):m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.EmbedAndVideoClickOrZoomCapture,{enterZoom:p,url:E,handleOpenLink:A,handleOpenInNewTab:k}),(0,l.jsx)(B.MiniEmbedPreview,{...e})]}):v?(0,l.jsx)(Y.VirtualizedPlaceholder,{isLoading:!b,dimensions:M,children:(0,l.jsx)(ec,{opacity:+!!b,position:"static",onLoad:()=>{x(!0)},...e})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Q.EmbedAndVideoClickOrZoomCapture,{enterZoom:p,url:E,handleOpenLink:A,handleOpenInNewTab:k}),(0,l.jsx)(B.EmbedPreview,{...e})]})}),!m&&!y&&(0,l.jsx)(en.ZoomableOverlay,{isZoomed:u,exitZoom:h,editor:i,children:(0,l.jsx)(c.Flex,{width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,l.jsx)(ec,{onLoad:()=>{x(!0)},...e,isZoomed:!0})})})]})},ep=(0,n.createTiptapNode)("video",{draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,a.ReactNodeViewRenderer)(eu,{update:o.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=video]",getAttrs:e=>({id:(0,n.parseIdAttr)(e,U.generateMediaId),embedUrl:e.getAttribute("data-embed-url")||void 0,source:e.getAttribute("data-source")||void 0,thumbnail:(0,n.parseJSONAttr)(e,"thumbnail"),embed:(0,n.parseJSONAttr)(e,"embed"),meta:(0,n.parseJSONAttr)(e,"meta"),sourceUrl:e.getAttribute("data-source-url")||void 0,displayStyle:e.getAttribute("data-display-style")||void 0,fullWidthBlock:"true"===e.getAttribute("data-full-width-block")||void 0,clickBehavior:e.getAttribute("data-click-behavior")||void 0,embedFetchStatus:(0,V.toEmbedFetchStatus)(e.getAttribute("data-embed-fetch-status"))})}],addStorage:()=>({bookmarks:{}}),renderHTML:({HTMLAttributes:e,node:i})=>["div",(0,t.mergeAttributes)(e,{class:"video","data-id":i.attrs.id,...i.attrs.embedUrl&&{"data-embed-url":i.attrs.embedUrl},...i.attrs.source&&{"data-source":i.attrs.source},...(0,n.renderJSONAttrs)(i.attrs,"thumbnail","embed","meta"),...i.attrs.sourceUrl&&{"data-source-url":i.attrs.sourceUrl},...i.attrs.displayStyle&&{"data-display-style":i.attrs.displayStyle},...i.attrs.fullWidthBlock&&{"data-full-width-block":"true"},...i.attrs.clickBehavior&&{"data-click-behavior":i.attrs.clickBehavior},...i.attrs.embedFetchStatus&&i.attrs.embedFetchStatus!==V.EMBED_FETCH_STATUS_COMPLETE&&{"data-embed-fetch-status":i.attrs.embedFetchStatus}}),["a",{href:(0,V.getMediaSourceUrl)(i),target:"_blank"},(0,V.getMediaTitle)(i)]]});var eh=e.i(811477),em=e.i(224852),eg=e.i(536420),ef=e.i(922712);let eb=(0,C.motion)(c.Flex),ex=e=>{let{node:t,editor:i,getPos:n}=e,a=t.attrs,r=(0,_.useShouldRenderMobileVersion)(),o=(0,ee.getGalleryChildren)(e),C=0===o.length,U=(0,E.useIsThemeDark)(),V=C?em.DEFAULT_THUMB_HEIGHT_EM:r?em.MOBILE_THUMB_HEIGHT_EM:a.thumbHeight||em.DEFAULT_THUMB_HEIGHT_EM,G=a.layout,$="grid"===G?a.dimensions||"square":void 0,Z=(0,R.getFlexAlign)(a.horizontalAlign||"center"),K=(0,S.useIsThumbnailView)(),{isZoomed:q,isZoomComplete:Y,exitZoom:X,zoomedId:Q,setZoomedId:J}=(0,ei.useCarouselZoom)(o.map(e=>e.attrs.id)),et=(0,A.useAppSelector)(P.selectEditable),en=(0,w.useRef)(null),ea=(0,w.useRef)(null),er=(0,T.useDroppable)(en,e=>(0,ee.canDropInGallery)(i.view,e)),{contextMenuItems:eo}=(({editor:e,node:t,getPos:i})=>{let n=(0,w.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.chain().deleteSelectionAndSelectNear().run())},[e,i]),a=(0,eg.getGalleryLayoutOptions)(),r=t.attrs.layout;return{contextMenuItems:[...(0,ef.useEditorContextMenuItems)({editor:e,node:t,getPos:i}),{divider:!0},{key:"add-comment",label:(0,l.jsx)(y.Trans,{message:"Add comment",id:"oFsfkI"}),icon:f.faComment,onClick:()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,ee.addImageComment)(e.state.selection))}},{divider:!0},{key:"layout",label:(0,l.jsx)(y.Trans,{message:"Change layout",id:"vR68Ol"}),icon:f.faGrid2,items:Object.entries(a).map(([n,a])=>({key:n,label:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(h.Text,{children:a.title}),(0,l.jsx)(h.Text,{fontSize:"xxs",color:"gray.500",children:a.description})]}),icon:n===r?f.faCheck:void 0,onClick:()=>{let a=i();"number"==typeof a&&(e.commands.selectNodeAtPos(a),(0,eg.onLayoutChange)(n,t.attrs,e,e.state.selection))}}))},{key:"add-image",label:(0,l.jsx)(y.Trans,{message:"Add image...",id:"pVb3uA"}),icon:f.faRectangleHistoryCirclePlus,onClick:()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,ee.addImage)(i,e))}},{divider:!0},{key:"delete",label:(0,l.jsx)(y.Trans,{message:"Delete",id:"cnGeoo"}),icon:f.faTrash,onClick:n,color:"red.500"}]}})({editor:i,node:t,getPos:n}),{onOpenContextMenu:es}=(0,I.useEditorContextMenu)({editor:i,contextMenuItems:eo,getPos:n}),el=(0,w.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),(0,ee.addImage)(n,i)},[n,i]),ed=(0,w.useCallback)(e=>{let t=Array.from(e.target.files||[]);if(0===t.length)return;let a=n();if("number"!=typeof a)return;let r=i.state.doc.nodeAt(a);if(!r)return;let o=a+r.nodeSize-1;(0,W.insertAndUploadFiles)(i,t,o),e.target.value=""},[i,n]),eu=(0,w.useCallback)(e=>{e.stopPropagation(),e.preventDefault(),ea.current?.click()},[]),ep=(0,w.useCallback)(e=>{e.stopPropagation(),e.preventDefault();let t=n();if("number"!=typeof t)return;let a=i.state.doc.nodeAt(t);if(!a)return;let r=t+a.nodeSize-1;i.chain().insertContentAt(r,{type:"mediaPlaceholder",attrs:{source:k.AI_IMAGE_SOURCE_KEY}}).run(),setTimeout(()=>{i.commands.focus(),i.commands.setNodeSelection(r),(0,L.openMediaDrawer)()})},[i,n]),ex=(0,w.useCallback)(e=>{if(i.isEditable&&e.target.closest(".gallery, .block")?.classList.contains("gallery")){let e=n();"number"==typeof e&&i.commands.selectNodeAtPos(e)}},[i,n]),ey=(0,w.useMemo)(()=>"grid"===G?{overflow:"hidden",aspectRatio:"square"===$?"1":"landscape"===$?"4/3":"3/4"}:"logo"===G?{height:void 0}:{h:`${V}em`,flex:a.stretchFill||null===a.stretchFill?"1 1 auto":void 0},[G,$,V,a.stretchFill]),ev=(0,w.useMemo)(()=>"grid"===G?{justifyContent:"center",display:"grid",gridTemplateColumns:1===o.length?`repeat(auto-fit, ${a.thumbHeight}em)`:o.length<6?a.thumbHeight>=em.MAX_THUMB_HEIGHT_EM/(1+.1*o.length)?`repeat(auto-fit, minmax(${a.thumbHeight}em, 1fr))`:`repeat(auto-fit, ${a.thumbHeight}em)`:`repeat(auto-fit, minmax(${a.thumbHeight}em, 1fr))`,gap:a.thumbHeight>=em.MAX_THUMB_HEIGHT_EM/2?`${em.GALLERY_PADDING_EM}em`:a.thumbHeight<=em.MAX_THUMB_HEIGHT_EM/3?`${em.GALLERY_PADDING_EM/1.25}em`:`${em.GALLERY_PADDING_EM/1.5}em`}:{gap:a.thumbHeight<=em.DEFAULT_THUMB_HEIGHT_EM/3?`${em.GALLERY_PADDING_EM/2}em`:a.thumbHeight<=em.DEFAULT_THUMB_HEIGHT_EM/2?`${em.GALLERY_PADDING_EM/1.5}em`:`${em.GALLERY_PADDING_EM}em`,display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",placeContent:Z,w:o.length>=3&&(null===a.stretchFill||a.stretchFill)?"100%":void 0},[G,a.thumbHeight,a.stretchFill,Z,o.length]);return(0,l.jsxs)(D.AnnotatableNodeViewWrapper,{...e,children:[(0,l.jsx)("input",{ref:ea,type:"file",multiple:!0,accept:"image/*",style:{display:"none"},onChange:ed}),(0,l.jsxs)(c.Flex,{onContextMenu:et?es:void 0,className:"gallery",cursor:"default",onClick:ex,ref:en,align:Z,direction:"column",position:"relative","data-selection-ring":!0,"data-selection-background":!0,...C?er:{},css:{"--media-maxH":"flex"===G?`${V}em`:void 0,"--media-maxW":"100%"},w:"100%",sx:{".gallery-content":{w:"100%",display:"flex"===G?"contents":void 0},"[data-node-view-content-inner=gallery]":{...ev,".block":{...ey,[`&.${s.PREVENT_FLEX_CLASSNAME}`]:{flex:"0 0 auto"},my:0,transitionProperty:"filter",transitionDuration:"normal",_hover:{[`:not(.block-mediaPlaceholder) > :not(.${z.NON_CLICKABLE_CLASSNAME})`]:{filter:"brightness(0.9)"}},"[data-node-view-wrapper]":{h:"100%"}},".block-mediaPlaceholder":{overflow:"visible"}},".block-gallery.is-focused & .placeholder":{bg:U?H.PH_COLOR.DARK_GALLERY_BG:H.PH_COLOR.LIGHT_GALLERY_BG},".placeholder":{minW:"flex"===G?"12em":"logo"===G?"6em":void 0,h:"logo"===G?(0,ee.getGalleryLogoThumbHeightValue)(a.thumbHeight,a.thumbSpacing):void 0}},children:[C&&(0,l.jsxs)(m.VStack,{spacing:3,h:`${V}em`,justify:"center",contentEditable:!1,color:U?H.PH_COLOR.DARK_COLOR:H.PH_COLOR.LIGHT_COLOR,className:"gallery-placeholder","data-testid":"gallery-placeholder",userSelect:"none",children:[(0,l.jsx)(b.FontAwesomeIcon,{size:"2x",icon:g.faImages}),!et||K?null:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(u.HStack,{spacing:2,children:[(0,l.jsx)(d.Button,{size:"xs",leftIcon:(0,l.jsx)(b.FontAwesomeIcon,{icon:f.faArrowUpFromBracket}),onClick:eu,onMouseDown:M.preventDefaultToAvoidBlur,children:(0,l.jsx)(y.Trans,{message:"Upload image(s)",id:"7HONHL"})}),(0,l.jsx)(d.Button,{size:"xs",leftIcon:(0,l.jsx)(b.FontAwesomeIcon,{icon:f.faPlus}),onClick:ep,onMouseDown:M.preventDefaultToAvoidBlur,children:(0,l.jsx)(y.Trans,{message:"Create image",id:"uDOLh5"})})]}),(0,l.jsx)(h.Text,{color:U?H.PH_COLOR.DARK_ICON_COLOR:H.PH_COLOR.LIGHT_ICON_COLOR,fontSize:"sm",textAlign:"center",children:(0,l.jsx)(y.Trans,{message:"Or drag to add images, videos, or embeds",id:"oyPIji"})})]})]}),(0,l.jsx)(j.NodeViewContent,{className:"gallery-content",style:{display:C?"none":void 0}}),et&&!K&&!C&&(0,l.jsx)(c.Flex,{position:"absolute",bottom:"0",h:"grid"===G||"logo"===G?"100%":`${V}em`,align:"center",w:6,insetEnd:-3,className:"add-image",opacity:"0",transitionProperty:"opacity",zIndex:"tooltip",transitionDuration:"normal",children:(0,l.jsx)(x.GammaTooltip,{label:(0,l.jsx)(y.Trans,{message:"Add image",id:"P5MuiB"}),placement:"top",children:(0,l.jsx)(p.IconButton,{icon:(0,l.jsx)(b.FontAwesomeIcon,{icon:f.faPlus}),"aria-label":v.i18n._({id:"P5MuiB",message:"Add image"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:el})})}),(0,l.jsx)(N.ContainerDragHandle,{...e,handlePlacement:"outside",label:v.i18n._({id:"wnA/4R",message:"Select gallery"})})]}),(0,l.jsx)(eh.ZoomableCarousel,{isZoomed:q,isZoomComplete:Y,exitZoom:X,zoomedId:Q,setZoomedId:J,editor:i,children:o.filter(e=>e.attrs.id).map(e=>{let{id:t}=e.attrs,n=e.type.name;return{id:t,thumbnail:"image"===n?(0,l.jsx)(F.CroppedImage,{imageAttrs:e.attrs,objectFit:"cover",isThumbnail:!0}):(0,l.jsx)(B.MiniEmbedPreview,{node:e}),full:(0,l.jsx)(c.Flex,{justify:"center",align:"center",h:"100%",w:"100%",children:"image"===n?(0,l.jsx)(F.CroppedImage,{isZoomed:!0,imageAttrs:e.attrs}):"video"===n?(0,l.jsx)(eb,{width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,l.jsx)(ec,{isZoomed:!0,node:e,decorations:[],editor:i})}):(0,l.jsx)(eb,{h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,l.jsx)(O.EmbedPlayer,{isZoomed:!0,node:e,decorations:[],editor:i})})})}})})]})},ey=(0,n.createTiptapNode)("gallery",{isolating:!0,draggable:!0,selectable:!0,priority:r.ExtensionPriorityMap.Gallery,containerHandle:!0,expandable:!0,addNodeView:()=>(0,a.ReactNodeViewRenderer)(ex,{update:o.attrsOrDecorationsChanged,ignoreMutation:i.ignoreDataMutation}),addProseMirrorPlugins(){return[(0,s.GalleryPlugin)(this.editor)]},parseHTML:()=>[{tag:"div[class=gallery]",getAttrs:e=>{let t={},i=e.getAttribute("data-thumb-height");i&&(t.thumbHeight=Number(i));let a=e.getAttribute("data-layout");a&&(t.layout=a);let r=e.getAttribute("data-dimensions");r&&(t.dimensions=r);let o=e.getAttribute("data-stretch-fill");null!=o&&(t.stretchFill="true"===o);let s=e.getAttribute("data-thumb-spacing");s&&(t.thumbSpacing=Number(s));let l=e.getAttribute("data-full-width-block");return l&&(t.fullWidthBlock="true"===l),{...t,...(0,n.parseHorizontalAlign)(e)}}},{tag:"gallery",getAttrs:e=>(0,n.parseHorizontalAlign)(e)}],renderHTML:({node:e,HTMLAttributes:i})=>["div",(0,t.mergeAttributes)(i,{class:"gallery","data-thumb-height":String(e.attrs.thumbHeight),"data-layout":e.attrs.layout,"data-dimensions":e.attrs.dimensions,...null!=e.attrs.stretchFill&&{"data-stretch-fill":String(e.attrs.stretchFill)},...null!=e.attrs.thumbSpacing&&{"data-thumb-spacing":String(e.attrs.thumbSpacing)},...e.attrs.fullWidthBlock&&{"data-full-width-block":"true"},...(0,n.renderHorizontalAlign)(e.attrs)}),0]})},49459,888627,e=>{"use strict";e.s(["Graphic",()=>ey,"stopEvent",()=>ex],49459);var t=e.i(755453);e.i(838054);var i=e.i(408767),n=e.i(767730),a=e.i(577281),r=e.i(391736);e.s(["GraphicView",()=>eb],888627);var o=e.i(391398),s=e.i(428683),l=e.i(555145);e.i(828525);var d=e.i(876533),c=e.i(191788);e.i(144786);var u=e.i(849187),p=e.i(783197),h=e.i(460557),m=e.i(297194),g=e.i(418755),f=e.i(750526),b=e.i(786928),x=e.i(19654),y=e.i(432247),v=e.i(551880),C=e.i(899611),w=e.i(261442);e.i(905506);var S=e.i(267158),k=e.i(160396),A=e.i(194552),E=e.i(892684),_=e.i(864935),I=e.i(588748),M=e.i(196444),T=e.i(15185),L=e.i(820773),j=e.i(804508),P=e.i(456389),D=e.i(753748),N=e.i(604956),R=e.i(267971),O=e.i(529545),B=e.i(28561),z=e.i(220019);e.i(312434);var F=e.i(487914),H=e.i(316353);let W=(0,z.makeMoveable)([z.Clippable]),U=({currentCrop:e,imageWidth:t,imageHeight:i,imageWrapperRef:n,onSaveCrop:a})=>{let r=(0,g.useAppDispatch)(),s=(0,c.useRef)(null),[l,d]=(0,c.useState)((0,j.cropRectToClipStyles)(e)),u=(0,c.useCallback)(e=>{if(!n.current)return;let t=(0,j.clipStylesToCropRect)(e),i=(0,j.cropRectToMask)(t);n.current.style["-webkit-mask"]=i,n.current.style["-webkit-mask-repeat"]="no-repeat"},[n]),p=JSON.stringify(l);(0,c.useEffect)(()=>{u(l)},[u,p,l]);let h=(0,c.useCallback)(()=>{let e=(0,j.clipStylesToCropRect)(l),n=(0,j.enforceCropMinimum)(e,t,i);a(0===n.top&&0===n.right&&0===n.bottom&&0===n.left?null:n)},[l,t,i,a]),m=(0,c.useRef)({fn:h,confirmOnUnmount:!0});m.current.fn=h,(0,c.useEffect)(()=>H.eventEmitter.on("endClip",({confirm:e})=>{m.current.confirmOnUnmount=e,r((0,D.endCropping)())}),[r]),(0,c.useEffect)(()=>{let e=m.current;return()=>{e.confirmOnUnmount&&setTimeout(e.fn,0)}},[]),(0,c.useEffect)(()=>F.keyboardHandler.on("keydown","CLIPPABLE",e=>!!(0,B.default)("mod+x")(e)&&(e.preventDefault(),!0)),[]);let f=`inset(${l.join(" ")})`;return(0,o.jsx)(W,{ref:e=>{s.current=e},className:"clippable-control-wrapper data-clip-type-inset",target:n.current,renderDirections:["ne","nw","se","sw"],origin:!1,draggable:!1,clippable:!0,clipTargetBounds:!0,clipRelative:!0,clipArea:!0,defaultClipPath:"inset",customClipPath:f,dragWithClip:!0,keepRatio:!1,onClip:({clipStyles:e})=>{let n=(0,j.clipStylesToCropRect)(e),a=(0,j.enforceCropMinimum)(n,t,i);u((0,j.cropRectToClipStyles)(a))},onClipEnd:({lastEvent:e})=>{if(!e?.clipStyles)return;let n=(0,j.clipStylesToCropRect)(e.clipStyles),a=(0,j.enforceCropMinimum)(n,t,i);d((0,j.cropRectToClipStyles)(a))}})};var V=e.i(969641),G=e.i(147349),$=e.i(524473),Z=e.i(541075),K=e.i(896620),q=e.i(358280),Y=e.i(268236),X=e.i(178428);e.i(734710);var Q=e.i(430378),J=e.i(78387),ee=e.i(274560),et=e.i(35585);let ei=({editor:e,getPos:t,attrs:i,extract:n,isLoading:a})=>{let r=(0,ee.useGetStylesForHandleButtons)(),s=(0,g.useAppSelector)(et.selectCurrentWorkspaceId),d=(0,u.useFeatureFlag)("useIdeogramExtraction"),p=(0,c.useCallback)(async()=>{let a=t();if("number"!=typeof a||!s)return;let r=i.src;if(!r)return;let o=d?"ideogram":"datalab";try{let t=await n({workspaceId:s,imageUrl:r,provider:o}),l=t.data?.extractImageContent;if(!l)return;let{interactionId:d}=t;Q.analytics.track(J.SegmentEvents.AI_EXTRACT_TEXT_CLICKED,{interactionId:d,imageUrl:r,source:"graphic",provider:o,cost:l.cost,processingTime:l.processingTime,elementCount:l.elements?.length??0});let c=e.chain().updateAttributesAtPos(a,{src:l.backgroundImageUrl,meta:{...i.meta,width:l.backgroundWidth,height:l.backgroundHeight},extraction:{...l,originalImageUrl:r,originalMeta:i.meta?{width:i.meta.width,height:i.meta.height}:void 0,interactionId:d}});(c=(0,X.addPositionedTextboxesToChain)(c,e,a,l)).run()}catch(e){console.error("[GraphicExtractTextButton] Error extracting text:",e)}},[e,t,s,i.src,d,n]);return(0,o.jsx)(K.GammaTooltip,{label:(0,o.jsx)(q.Trans,{message:"Edit text",id:"T7vd8+"}),placement:"top",shouldWrapChildren:!0,children:(0,o.jsx)(V.Button,{leftIcon:a?(0,o.jsx)(G.Spinner,{size:"xs"}):(0,o.jsx)(Z.FontAwesomeIcon,{icon:$.faPenToSquare}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...r,px:2,onClick:p,isDisabled:a,children:(0,o.jsxs)(l.HStack,{spacing:1,children:[(0,o.jsx)(q.Trans,{message:"Edit text",id:"T7vd8+"}),(0,o.jsx)(Y.ReleaseStatusBadge,{badge:"beta",fontSize:"2xs"})]})})})},en=({editor:e,getPos:t,attrs:i})=>{let n=(0,ee.useGetStylesForHandleButtons)(),a=(0,c.useCallback)(()=>{let n=t();if("number"!=typeof n)return;let a=i.extraction?.originalImageUrl;if(!a)return;Q.analytics.track(J.SegmentEvents.AI_EXTRACT_TEXT_REVERTED,{interactionId:i.extraction?.interactionId,imageUrl:a,source:"graphic"});let r=i.extraction?.originalMeta,o=e.chain().updateAttributesAtPos(n,{src:a,...r&&{meta:{...i.meta,...r}},extraction:null});(o=(0,X.clearPositionedTextboxesFromChain)(o,e,n)).run()},[e,t,i.extraction]);return(0,o.jsx)(K.GammaTooltip,{label:(0,o.jsx)(q.Trans,{message:"Original image",id:"0Rfeda"}),placement:"top",shouldWrapChildren:!0,children:(0,o.jsx)(V.Button,{leftIcon:(0,o.jsx)(Z.FontAwesomeIcon,{icon:$.faRotateLeft}),alignItems:"center",fontFamily:"body",display:"flex",cursor:"pointer",...n,px:2,onClick:a,children:(0,o.jsx)(q.Trans,{message:"Original image",id:"0Rfeda"})})})};var ea=e.i(613616),er=e.i(389928),eo=e.i(297391),es=e.i(635273),el=e.i(697240);let ed=({editor:e,decorations:t,horizontalAlign:i,isUploading:n,isAIGenerating:a,hasError:r,model:s,onSelectAndFocus:l,onDoubleClick:d,onRetry:c})=>{let u=(0,p.useIsThumbnailView)(),h=(0,g.useAppSelector)(v.selectEditable),{hasEnoughCreditsToGenerateImage:m}=(0,er.useCreditStatus)(),f=(0,_.getAlignDirection)(t,i),b=(0,_.getAlignStyles)(i),x=s?(0,eo.getImageModelInfo)(s).estimatedTimeSeconds:void 0;return r?(0,o.jsx)(ea.Flex,{w:"100%",h:"100%",dir:f,direction:"column",sx:b,children:(0,o.jsx)(es.ImageGenerationErrorPlaceholder,{onRetry:h?c:void 0,isRetryDisabled:!m,retryDisabledReason:(0,o.jsx)(q.Trans,{message:"Can't retry - no credits available",id:"Ey8PF3"}),width:"18em",maxW:"100%",h:"10em",borderRadius:"var(--box-border-radius)","data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0})}):(0,o.jsx)(ea.Flex,{w:"100%",h:"100%",dir:f,direction:"column",sx:b,children:(0,o.jsx)(el.MediaPlaceholderImage,{icon:void 0,width:"18em",maxW:"100%",h:"10em",maxH:"100%",onSelectAndFocus:l,"data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0,borderRadius:"var(--box-border-radius)",hasQuickActions:!u,handleDoubleClick:h?d:void 0,isLoading:n||a,loadingProvider:"aiInfographic",estimatedTimeSeconds:u?void 0:x})})};var ec=e.i(575084),eu=e.i(558247),ep=e.i(584139),eh=e.i(103104),em=e.i(922712),eg=e.i(15272),ef=e.i(147573);let eb=e=>{let{node:t,editor:i,decorations:n,getPos:a,selected:r}=e,B=t.attrs,{src:z,tempUrl:F,uploadStatus:H,meta:W,showPlaceholder:V,horizontalAlign:G,width:Z,aiParams:K,id:Y,loadImageStatus:X,loadImageParams:Q,savedMediaId:J,crop:ee}=B,et=(0,g.useAppSelector)(v.selectEditable),ea=(0,u.useFeatureFlag)("editImageText"),{extract:er,isLoading:eo}=(0,h.useExtractImageContent)(),es=(0,b.useToggleMediaDrawer)(),el=(0,R.useSelectAndFocus)(i,a),eb=(0,c.useCallback)(()=>{et&&(el(),es({isOpen:!0}))},[et,es,el]),ex=(0,c.useCallback)(e=>{let t=a();"number"==typeof t&&((0,C.handleDragStart)(i,e.nativeEvent,t,eS.current||void 0),e.stopPropagation())},[i,a]),{ref:ey,isResizing:ev,setIsResizing:eC,resizeableSx:ew}=(0,O.useResizeable)(i),eS=(0,c.useRef)(null),ek=(0,c.useCallback)(e=>{let t=a();void 0!==t&&i.chain().updateAttributes("graphic",{width:e.width}).selectNodeAtPos(t).run()},[i,a]),eA=(0,p.useIsThumbnailView)(),eE=Q?.options?.model||K?.model,e_=H===m.UploadStatus.Uploading,eI=V||!z&&!F,eM=H===m.UploadStatus.Error,[eT,eL]=(0,c.useState)(!1),ej=(0,M.isFocusedAndEditable)(n),eP=t.childCount>0,{width:eD,height:eN}=W??{width:0,height:0},{isDark:eR}=(0,E.useCardColorMode)(n),eO=(0,_.getAlignStyles)(G),eB=eS.current&&ej&&et,ez=(0,M.isSelectingNode)(n),eF=!(0,j.isCropEmpty)(ee),eH=eD&&eN?eD/eN:1,eW=(0,c.useMemo)(()=>eF&&ee?(0,j.cropRectToTransform)(ee,eH):null,[eF,ee,eH]),eU=(0,g.useAppSelector)((0,D.selectIsIdCropping)(Y)),{confirmCrop:eV}=(0,ef.useGraphicCroppingControls)(i);(0,S.useEffectWhen)(()=>{eU&&!r&&Y&&eV({id:Y})},[r,eU,Y,eV],[r]);let{contextMenuItems:eG}=(({editor:e,node:t,getPos:i})=>{let n=t.attrs,{id:a,savedMediaId:r,extraction:s}=n,l={src:n.src,tempUrl:n.tempUrl,meta:n.meta??void 0,uploadStatus:n.uploadStatus},d=(0,eu.useCanEditImageWithAI)(l),p=(0,u.useFeatureFlag)("imageCardsDebug"),{startCrop:h}=(0,ef.useGraphicCroppingControls)(e),m=(0,b.useToggleMediaDrawer)(),{toggleBuddyChatPanel:g,isBuddyChatPanelOpen:f}=(0,ep.useToggleBuddyChatPanel)(),x=(0,c.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.chain().deleteSelectionAndSelectNear().run())},[e,i]),y=(0,c.useCallback)(()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),e.commands.convertImageToImageCard())},[e,i]),v=(0,em.useEditorContextMenuItems)({editor:e,node:t,getPos:i,imageSrc:n.src});return{contextMenuItems:(0,c.useMemo)(()=>e.isThumbnail?[]:[...v,{divider:!0},{key:"edit-image",label:(0,o.jsx)(q.Trans,{message:"Edit image...",id:"9IrgTy"}),icon:$.faEdit,onClick:t=>{e.view.focus(),m({isOpen:!0}),t.stopPropagation()}},...d?[{key:"ask-ai",label:(0,o.jsx)(q.Trans,{message:"Edit with {AGENT_PROPER_NOUN}...",id:"IzVrMk",values:{AGENT_PROPER_NOUN:eh.AGENT_PROPER_NOUN}}),icon:ec.faSparkles,onClick:()=>{f||g()}}]:[],...n.src?[{key:"crop",label:(0,o.jsx)(q.Trans,{message:"Crop",id:"qKx+US"}),icon:$.faCrop,onClick:()=>{if(!a)return;let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),h({id:a}))}}]:[],{divider:!0},{key:"turn-into-card",label:(0,o.jsx)(q.Trans,{message:"Turn into image card",id:"jUkA2U"}),icon:$.faExpand,onClick:y},{divider:!0},{key:"add-comment",label:(0,o.jsx)(q.Trans,{message:"Add comment",id:"oFsfkI"}),icon:$.faComment,onClick:()=>{let t=i();"number"==typeof t&&(e.commands.selectNodeAtPos(t),(0,eg.addImageComment)(e.state.selection))}},{divider:!0},{key:"align",label:(0,o.jsx)(q.Trans,{message:"Align",id:"9ms+e0"}),icon:$.faAlignLeft,items:_.AlignmentCommands.map(({name:t,key:i,icon:n,checkActive:a,apply:r})=>({key:i,icon:a&&a(e)?$.faCheck:n,label:t(),onClick:()=>{r&&r(e)}}))},...p?[{divider:!0},...r?[{key:"debug-datadog",label:"View trace in Datadog",icon:$.faBug,onClick:()=>{let e=Date.now(),t=new URLSearchParams({query:`@savedMediaId:${r} resource_name:ai.*`,spanType:"all",view:"spans",start:(e-2592e6).toString(),end:e.toString()});window.open(`https://app.datadoghq.com/apm/traces?${t.toString()}`,"_blank","noopener,noreferrer")}}]:[],...s?.originalImageUrl?[{key:"debug-original-image",label:"Open original image",icon:$.faExternalLink,onClick:()=>{window.open(s.originalImageUrl,"_blank","noopener,noreferrer")}}]:[]]:[],{divider:!0},{key:"delete",label:(0,o.jsx)(q.Trans,{message:"Delete",id:"cnGeoo"}),icon:$.faTrash,onClick:x,color:"red.500"}],[n.src,d,x,e,v,s,i,a,p,f,r,h,g,m,y])}})({editor:i,node:t,getPos:a,decorations:n}),{onOpenContextMenu:e$}=(0,x.useEditorContextMenu)({editor:i,getPos:a,contextMenuItems:eG}),eZ=(0,c.useCallback)(e=>{let t=a();void 0!==t&&i.chain().updateAttributesAtPos(t,{crop:e}).selectNodeAtPos(t).run()},[i,a]);return eI||eM?(0,o.jsx)(A.AnnotatableNodeViewWrapper,{...e,children:(0,o.jsx)(ed,{editor:i,decorations:n,horizontalAlign:G,isUploading:e_,isAIGenerating:"queued"===X&&!eA,hasError:eM,model:eE,onSelectAndFocus:el,onDoubleClick:eb,onRetry:eb})}):(0,o.jsx)(A.AnnotatableNodeViewWrapper,{...e,children:(0,o.jsxs)(N.MediaViewWrapper,{ref:ey,resizeableSx:ew,alignStyles:eO,horizontalAlign:G,editor:i,decorations:n,node:t,isDark:eR,isResizing:ev,getPos:a,onContextMenu:e$,sx:eU?P.ClippableStyles:void 0,contentEditable:!ez&&void 0,suppressContentEditableWarning:!0,children:[eU&&eS.current&&(0,o.jsx)(U,{imageWrapperRef:eS,currentCrop:ee,imageWidth:W?.width||1e3,imageHeight:W?.height||1e3,onSaveCrop:eZ}),eB&&r&&!eU&&(0,o.jsx)(O.ResizableControls,{imageWrapperRef:eS,setIsResizing:eC,updateResizeAttrs:ek,refreshDeps:[B,Z]}),(0,o.jsxs)(s.Box,{ref:eS,position:"relative",sx:{...f.ImageSx,"& > .positioned-boxes-wrapper":{pointerEvents:"none"}},"data-drag-handle":!0,"data-selection-ring":"inside","data-selection-background":!0,"data-node-graphic-testid":Y,w:Z?`calc(${Z} * var(--font-size) / 16)`:"fit-content",maxW:"calc(100% * var(--media-scale))",overflow:"hidden",borderRadius:"var(--box-border-radius)",onDoubleClick:eU?void 0:eb,css:{mask:eU?"":"none !important",...eW&&!eU?{aspectRatio:`${eW.croppedAspectRatio}`}:void 0},onDragStart:ex,children:[(0,o.jsxs)(s.Box,{transform:eU?void 0:eW?.transform,transformOrigin:eW&&!eU?"top left":void 0,children:[(0,o.jsx)(k.ImageOrVideo,{src:z||void 0,fallbackSrc:F||void 0,alt:"",w:"100%",objectFit:"contain",resizeParams:eA?k.THUMBNAIL_RESIZE_PARAMS:{width:2e3},onLoad:()=>{eL(!0)},borderRadius:"inherit",userSelect:"none",display:"block",onClick:el}),eT&&(eD>0||eP)&&(0,o.jsx)(s.Box,{pointerEvents:eU?"none":void 0,children:(0,o.jsx)(I.PositionedBoxesWrapper,{aspectRatio:(eD||1e3)/(eN||1e3),handleSelect:el,crop:eU?null:ee,editor:i,children:(0,o.jsx)(y.NodeViewContent,{})})}),(0,o.jsx)(L.MediaUploadIndicators,{uploadStatus:H??void 0,isEditable:et})]}),(ej||eo)&&!eU&&!eA&&(0,o.jsx)(s.Box,{position:"absolute",top:"0.5em",insetStart:"0.5em",zIndex:10,contentEditable:!1,"data-graphic-view-buttons":!0,children:(0,o.jsx)(d.DarkModeProvider,{isDark:!1,children:(0,o.jsxs)(l.HStack,{spacing:1,pointerEvents:"auto",onMouseDown:w.preventDefaultToAvoidBlur,children:[ea&&et&&(0,o.jsx)(o.Fragment,{children:eP?(0,o.jsx)(en,{editor:i,getPos:a,attrs:B}):(0,o.jsx)(ei,{editor:i,getPos:a,attrs:B,extract:er,isLoading:eo})}),(0,o.jsx)(T.DebugExtractionButtons,{traceId:J,extraction:B.extraction})]})})})]})]})})};function ex({event:e}){let t=e.type.startsWith("drag"),i="drop"===e.type;return!!(e.target instanceof HTMLElement&&e.target.closest("[data-graphic-view-buttons]"))||!t&&!i}let ey=(0,n.createTiptapNode)("graphic",{selectable:!0,draggable:!0,isolating:!0,addNodeView:()=>(0,i.ReactNodeViewRenderer)(eb,{update:a.numChildrenOrAttrsOrDecorationsChanged,stopEvent:ex}),parseHTML:()=>[{tag:"div[class=graphic]",getAttrs:e=>({id:(0,n.parseIdAttr)(e,r.generateMediaId),src:e.getAttribute("data-src")||void 0,source:e.getAttribute("data-source")||void 0,width:e.getAttribute("data-width")?Number(e.getAttribute("data-width")):void 0,meta:(0,n.parseJSONAttr)(e,"meta"),aiParams:(0,n.parseJSONAttr)(e,"aiParams"),crop:(0,n.parseJSONAttr)(e,"crop"),savedMediaId:e.getAttribute("data-saved-media-id")||void 0,...(0,n.parseHorizontalAlign)(e)})}],renderHTML({node:e,HTMLAttributes:i}){let a=e.attrs;return["div",(0,t.mergeAttributes)(i,{class:"graphic","data-id":a.id,...a.src&&{"data-src":a.src},...a.source&&{"data-source":a.source},...null!=a.width&&{"data-width":String(a.width)},...(0,n.renderJSONAttrs)(a,"meta","aiParams","crop"),...a.savedMediaId&&{"data-saved-media-id":a.savedMediaId},...(0,n.renderHorizontalAlign)(a)}),0]}})},15272,483733,357128,577482,529232,215531,e=>{"use strict";e.s(["addImage",()=>nM,"addImageComment",()=>nw,"canDropInGallery",()=>nA,"canGalleryContainSlice",()=>nk,"checkGalleryDropTarget",()=>nS,"clipboardContainsGalleryContent",()=>nE,"findParentGallery",()=>nm,"getGalleryChildren",()=>nC,"getGalleryLogoThumbHeightValue",()=>nI,"getGalleryThumbHeight",()=>nx,"getGalleryThumbSpacing",()=>ny,"isGalleryNode",()=>nh,"isNodeInGallery",()=>ng,"isNodeViewInGallery",()=>nf,"isNodeViewInGridGallery",()=>nb,"isNodeViewInLogoGallery",()=>nv],15272);var t,i=e.i(755453),n=e.i(308822),a=e.i(786928),r=e.i(49202);e.s(["generateHtmlFromNode",()=>ns,"generateTextFromNode",()=>nl],215531),e.s(["gammaTiptapNodeView",()=>nn,"getBaseExtensions",()=>ni,"getBaseMarkViews",()=>nr,"getBaseNodeViews",()=>na],529232),e.i(314572);var o=e.i(723641),s=e.i(388773),l=e.i(367792);e.i(601019);var d=e.i(539106),c=e.i(13948),u=e.i(383576),p=e.i(225335),h=e.i(908229),m=e.i(364247),g=e.i(838777),f=e.i(757451),b=e.i(385589),x=e.i(953433),y=e.i(928530),v=e.i(271910),C=e.i(135317),w=e.i(82206),S=e.i(708235),k=e.i(198905),A=e.i(131339),E=e.i(613037),_=e.i(729088),I=e.i(823299),M=e.i(701652),T=e.i(423686),L=e.i(967856),j=e.i(254311),P=e.i(274526),D=e.i(461679),N=e.i(179115),R=e.i(208815),O=e.i(431604),B=e.i(282845),z=e.i(432605),F=e.i(888919),H=e.i(978864),W=e.i(553901),U=e.i(86010),V=e.i(828260),G=e.i(138588),$=e.i(59539),Z=e.i(602563),K=e.i(427387),q=e.i(211917),Y=e.i(266663),X=e.i(250332),Q=e.i(375231),J=e.i(900870),ee=e.i(692625),et=e.i(152232),ei=e.i(639014),en=e.i(948982),ea=e.i(821502),er=e.i(676876),eo=e.i(155069),es=e.i(716700),el=e.i(136715),ed=e.i(768331),ec=e.i(508883),eu=e.i(796350),ep=e.i(559420),eh=e.i(668525),em=e.i(783538),eg=e.i(577298),ef=e.i(589193),eb=e.i(864713),ex=e.i(864935),ey=e.i(758412);e.i(534635);var ev=e.i(482337),eC=e.i(504671),ew=e.i(63435),eS=e.i(705956),ek=e.i(275144),eA=e.i(898178),eE=e.i(758991),e_=e.i(557683),eI=e.i(965140),eM=e.i(184204),eT=e.i(919352),eL=e.i(889628),ej=e.i(516813),eP=e.i(38459),eD=e.i(53237),eN=e.i(457370),eR=e.i(33716),eO=e.i(537480),eB=e.i(141399);e.i(578014);var ez=e.i(612904),eF=e.i(718456),eH=e.i(327039),eW=e.i(694273),eU=e.i(236115),eV=e.i(49459),eG=e.i(888627);e.i(419217);var e$=e.i(202545),eZ=e.i(154217),eK=e.i(175863),eq=e.i(418755),eY=e.i(551880),eX=e.i(753748),eQ=e.i(391736),eJ=e.i(329860);let e0=i.Extension.create({name:"media",addExtensions:()=>[eQ.UniqueMediaId],addCommands:()=>({handleSpaceToZoom:()=>({state:e})=>{if(e.selection instanceof eK.NodeSelection&&(0,eJ.isMediaNode)(e.selection.node)){let t=(0,eq.getStore)(),{id:i}=e.selection.node.attrs;return!!(i&&(0,eX.selectIsIdCropping)(i)(t.getState()))||(t.dispatch((0,eY.setMediaNodeExpanded)({nodeId:e.selection.node.attrs.id})),!0)}return!1}}),extendNodeSchema:e=>({accessoryImageKey:(0,i.callOrReturn)((0,i.getExtensionField)(e,"accessoryImageKey",e)),imageKeyPath:(0,i.callOrReturn)((0,i.getExtensionField)(e,"imageKeyPath",e))??""})});e.s(["Media",0,e0],483733),e.i(838054);var e1=e.i(408767),e2=e.i(767730),e3=e.i(438106),e5=e.i(485992);let e4=(0,e2.createTiptapNode)("mediaPlaceholder",{selectable:!0,draggable:!0,priority:e3.ExtensionPriorityMap.MediaPlaceholder,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(e5.MediaPlaceholderView),addKeyboardShortcuts:()=>({Enter:({editor:e})=>{let t=e.state.selection;return!!(t instanceof eK.NodeSelection&&(0,eJ.isMediaNode)(t.node))&&((0,a.openMediaDrawer)(),!0)}}),addCommands:()=>({insertMediaBlock:e=>({commands:t})=>(t.insertContentAndSelect({type:"mediaPlaceholder",attrs:{source:e}}),requestAnimationFrame(()=>{(0,a.openMediaDrawer)()}),!0)}),parseHTML:()=>[{tag:"img[placeholder=true]",priority:60,getAttrs:e=>({id:(0,e2.parseIdAttr)(e,eQ.generateMediaId),source:e.getAttribute("data-source")||null,...(0,e2.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["img",(0,i.mergeAttributes)(t,{placeholder:"true","data-id":e.attrs.id,...e.attrs.source&&{"data-source":e.attrs.source},...(0,e2.renderHorizontalAlign)(e.attrs)})]});e.i(438486);var e6=e.i(892689),e9=e.i(283098);e.i(338812);var e8=e.i(431026),e7=e.i(343857),te=e.i(500446),tt=e.i(272690),ti=e.i(379363),tn=e.i(180190),ta=e.i(979021);let tr=i.Extension.create({name:"placeholderText",addCommands:()=>({removeFilledPlaceholders:()=>({tr:e,dispatch:t})=>!t||(e.doc.descendants((t,i)=>{t.attrs.placeholder&&t.textContent&&(console.debug("Removing placeholder",t.attrs.placeholder,"at",i,"with content",t.textContent),e.setNodeAttribute(i,"placeholder",null))}),!0)}),onUpdate(){to(this.editor)}}),to=(0,ta.default)(e=>{e.isEditable&&e.commands.removeFilledPlaceholders()},100,{maxWait:1e3});var ts=e.i(577281),tl=e.i(391398),td=e.i(428683),tc=e.i(191788),tu=e.i(177890),tp=e.i(277051),th=e.i(432247);let tm=(0,tc.memo)(({html:e})=>(0,tl.jsx)("div",{className:"html-chrome",style:{display:"contents"},contentEditable:!1,suppressContentEditableWarning:!0,dangerouslySetInnerHTML:{__html:e}}));tm.displayName="HtmlChromeInner";let tg=({html:e})=>{let t=(0,tc.useMemo)(()=>e?tp.default.sanitize(e):"",[e]);return(0,tl.jsxs)(tl.Fragment,{children:[t?(0,tl.jsx)(tm,{html:t}):null,(0,tl.jsx)(th.NodeViewContent,{})]})},tf=e=>{let{node:t}=e,{area:i,style:n,html:a}=t.attrs,r=(0,tc.useMemo)(()=>{let e=(0,tu.parseCssStyleString)(n);return i&&!i.startsWith("auto-")?{...e,gridArea:i}:e},[n,i]);return(0,tl.jsx)(td.Box,{className:"html-container-item",style:r,"data-html-item":"container",children:(0,tl.jsx)(tg,{html:a||""})})},tb=(0,e2.createTiptapNode)("htmlContainerItem",{isolating:!0,defining:!0,selectable:!0,draggable:!1,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tf,{update:ts.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=html-container-item]",getAttrs:e=>{let t={},i=e.getAttribute("data-area");i&&(t.area=i);let n=e.getAttribute("data-style");return n&&(t.style=n),t.html=e.getAttribute("data-html")||"",t}}],renderHTML({node:e,HTMLAttributes:t}){let n={class:"html-container-item"};return e.attrs.area&&(n["data-area"]=e.attrs.area),e.attrs.style&&(n["data-style"]=e.attrs.style),n["data-html"]=e.attrs.html||"",["div",(0,i.mergeAttributes)(t,n),0]}});var tx=e.i(697240),ty=e.i(160396),tv=e.i(703460);let tC=e=>{let t,{node:i}=e,{area:n,style:a}=i.attrs,r=i.attrs.image,o=(0,tc.useMemo)(()=>{let e=(0,tu.parseCssStyleString)(a);return n&&!n.startsWith("auto-")?{...e,gridArea:n}:e},[a,n]),s=!!(t=r?.source)&&t.startsWith("image.icon"),l=r?.src;return(0,tl.jsx)(td.Box,{className:"html-image-item",style:o,"data-html-item":"image",children:s?(0,tl.jsx)(tv.SmartLayoutIconOrNumber,{image:r||null,color:"var(--body-color)",iconSize:2,boxProps:{w:"100%",h:"100%"}}):l?(0,tl.jsx)(ty.ImageOrVideo,{src:r.src,width:"100%",height:"100%",objectFit:"cover"}):(0,tl.jsx)(tx.MediaPlaceholderImage,{width:"100%",height:"100%"})})},tw=(0,e2.createTiptapNode)("htmlImageItem",{isolating:!0,selectable:!0,draggable:!1,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tC,{update:ts.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=html-image-item]",getAttrs:e=>{let t={},i=e.getAttribute("data-area");i&&(t.area=i);let n=e.getAttribute("data-style");n&&(t.style=n);let a=e.getAttribute("data-image");if(a)try{t.image=JSON.parse(a)}catch{}return t}}],renderHTML({node:e,HTMLAttributes:t}){let n={class:"html-image-item"};return e.attrs.area&&(n["data-area"]=e.attrs.area),e.attrs.style&&(n["data-style"]=e.attrs.style),e.attrs.image&&(n["data-image"]=JSON.stringify(e.attrs.image)),["div",(0,i.mergeAttributes)(t,n)]}}),tS=e=>{let{node:t}=e,{area:i,style:n}=t.attrs,a=(0,tc.useMemo)(()=>{let e=(0,tu.parseCssStyleString)(n);return i&&!i.startsWith("auto-")?{...e,gridArea:i}:e},[n,i]);return(0,tl.jsx)(td.Box,{className:"html-text-item",style:a,"data-html-item":"text",children:(0,tl.jsx)(th.NodeViewContent,{})})},tk=(0,e2.createTiptapNode)("htmlTextItem",{isolating:!0,defining:!0,selectable:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tS,{update:ts.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=html-text-item]",getAttrs:e=>{let t={},i=e.getAttribute("data-area");i&&(t.area=i);let n=e.getAttribute("data-style");return n&&(t.style=n),t}}],renderHTML({node:e,HTMLAttributes:t}){let n={class:"html-text-item"};return e.attrs.area&&(n["data-area"]=e.attrs.area),e.attrs.style&&(n["data-style"]=e.attrs.style),["div",(0,i.mergeAttributes)(t,n),0]}});e.i(144786);var tA=e.i(849187),tE=e.i(959022),t_=e.i(19654),tI=e.i(261442),tM=e.i(196444),tT=e.i(969987),tL=e.i(918327);let tj=({h:e,y:t,verticalAlign:i,isFocused:n,editor:a,getPos:r,elementRef:o,enabled:s})=>{let l=(0,tc.useRef)({h:e,y:t,verticalAlign:i,isFocused:n});l.current={h:e,y:t,verticalAlign:i,isFocused:n},(0,tc.useEffect)(()=>{if(!s)return;let e=o.current;if(!e)return;let t=e.querySelector("[data-node-view-content]");if(!t)return;let i=null,n=()=>{i=null;let{h:e,y:n,verticalAlign:o,isFocused:s}=l.current,d=t.offsetHeight;if(d<=0)return;let c=Math.ceil(d),u=c-e;if(1>=Math.abs(u))return;let p=n;"center"===o?p=n-u/2:"bottom"===o&&(p=n-u);let h=r();if(void 0===h)return;let{tr:m}=a.state,g=m.doc.nodeAt(h);if(g){if(m.setNodeMarkup(h,void 0,{...g.attrs,h:c,y:p}),s||function(e,t){let i=e.state.selection;if(!(i instanceof eK.TextSelection))return!1;let n=e.state.doc.nodeAt(t);return!!n&&i.from>t&&i.toe.pos===h);if(r){let t={...r.attrs,h:c,y:p},i=n.map(e=>e.attrs);for(let[a,r]of[...(0,tT.computeStickyPushes)(t,e,i).entries()].sort((e,t)=>{let i=n.find(t=>t.attrs.id===e[0]),a=n.find(e=>e.attrs.id===t[0]);return(a?.pos??0)-(i?.pos??0)})){let e=n.find(e=>e.attrs.id===a);if(e&&e.pos!==h){let t=m.doc.nodeAt(e.pos);t&&m.setNodeMarkup(e.pos,void 0,{...t.attrs,y:e.attrs.y+r.dy})}}}}a.view.dispatch(m)}},d=new ResizeObserver(()=>{null===i&&(i=requestAnimationFrame(n))});return d.observe(t),()=>{d.disconnect(),null!==i&&cancelAnimationFrame(i)}},[s,a,r,o])};function tP({canvasInteractionsEnabled:e,isTextbox:t,x:i,y:n,w:a,h:r,tempPosition:o,tempDimensions:s,isCanvasSelected:l,selected:d,cursor:c,isInBorderZone:u}){return{displayX:e?i:o.x,displayY:e?n:o.y,displayW:e?a:s.w,displayH:e?r:s.h,displaySelected:e?l:d,displayCursor:e?t?"text":"move":c,displayBorderZone:!e&&u}}var tD=e.i(53092),tN=e.i(524473),tR=e.i(408122),tO=e.i(234867);let tB=e=>{let{selection:t}=e.state;return t instanceof eK.NodeSelection&&"positionedContentBox"===t.node.type.name?"positionedContentBox":"positionedTextbox"},tz=e=>{let t=(0,tO.canBringForward)(e),i=(0,tO.canSendBackward)(e);return(0,tc.useMemo)(()=>[{key:"font-size-title",title:tR.i18n._({id:"cGeFup",message:"Font Size"})},{key:"font-size-increase",label:tR.i18n._({id:"pxFAp/",message:"Increase"}),icon:tN.faPlus,onClick:()=>e.commands.updatePositionedBoxFontSize(1)},{key:"font-size-decrease",label:tR.i18n._({id:"WGD1Al",message:"Decrease"}),icon:tN.faMinus,onClick:()=>e.commands.updatePositionedBoxFontSize(-1)},{divider:!0},{key:"h-align",label:tR.i18n._({id:"bqWPnx",message:"Horizontal Align"}),items:[{key:"h-align-left",label:tR.i18n._({id:"UlKSMd",message:"Left"}),icon:tN.faAlignLeft,onClick:()=>{let t=e.state.selection.from;e.chain().toggleHorizontalAlign("left").selectNodeAtPos(t).run()}},{key:"h-align-center",label:tR.i18n._({id:"VTRXqB",message:"Center"}),icon:tN.faAlignCenter,onClick:()=>{let t=e.state.selection.from;e.chain().toggleHorizontalAlign("center").selectNodeAtPos(t).run()}},{key:"h-align-right",label:tR.i18n._({id:"nOPbWJ",message:"Right"}),icon:tN.faAlignRight,onClick:()=>{let t=e.state.selection.from;e.chain().toggleHorizontalAlign("right").selectNodeAtPos(t).run()}}]},{key:"v-align",label:tR.i18n._({id:"mMHWqA",message:"Vertical Align"}),items:[{key:"v-align-top",label:tR.i18n._({id:"WWy8TN",message:"Top"}),icon:tN.faArrowUpToLine,onClick:()=>{let t=e.state.selection.from;e.chain().updateAttributes(tB(e),{verticalAlign:"top"}).selectNodeAtPos(t).run()}},{key:"v-align-center",label:tR.i18n._({id:"S1g3Ds",message:"Middle"}),icon:tN.faArrowsToLine,onClick:()=>{let t=e.state.selection.from;e.chain().updateAttributes(tB(e),{verticalAlign:"center"}).selectNodeAtPos(t).run()}},{key:"v-align-bottom",label:tR.i18n._({id:"zsiX7I",message:"Bottom"}),icon:tN.faArrowDownToLine,onClick:()=>{let t=e.state.selection.from;e.chain().updateAttributes(tB(e),{verticalAlign:"bottom"}).selectNodeAtPos(t).run()}}]},{divider:!0},{key:"bring-to-front",label:tR.i18n._({id:"uSpgqQ",message:"Bring to Front"}),icon:tN.faBringFront,onClick:()=>e.commands.bringToFront(),disabled:!t},{key:"bring-forward",label:tR.i18n._({id:"KAsIPs",message:"Bring Forward"}),icon:tN.faBringForward,onClick:()=>e.commands.bringForward(),disabled:!t},{key:"send-backward",label:tR.i18n._({id:"UvFh8B",message:"Send Backward"}),icon:tN.faSendBackward,onClick:()=>e.commands.sendBackward(),disabled:!i},{key:"send-to-back",label:tR.i18n._({id:"7q2+1G",message:"Send to Back"}),icon:tN.faSendBack,onClick:()=>e.commands.sendToBack(),disabled:!i},{divider:!0},{key:"delete",label:tR.i18n._({id:"cnGeoo",message:"Delete"}),icon:tN.faTrash,color:"red.500",onClick:()=>e.commands.deletePositionedBox()}],[i,t,e])},tF=e=>{let{node:t,editor:i,getPos:n,decorations:a}=e,{x:r,y:o,w:s,h:l,html:d,style:c}=t.attrs,u=(0,tA.useFeatureFlag)("canvasInteractions"),p=(0,tM.isSelectingNode)(a),h=(0,tM.isCanvasSelectingNode)(a),m=(0,tM.isFocusedInside)(a),g=(0,tc.useRef)(null),f=(0,tc.useCallback)(()=>g.current?g.current.closest(".positioned-boxes-wrapper"):null,[]),b=t.childCount>0,{tempPosition:x,tempDimensions:y,isInBorderZone:v,cursor:C,handleMouseDown:w,handleMouseMove:S,handleMouseLeave:k,ResizeHandles:A}=(0,tD.useBoxInteractions)({x:r,y:o,w:s,h:l,isImageBox:!b,editor:i,getPos:n,getContainerElement:f,elementRef:g,enabled:!u});tj({h:l,y:o,verticalAlign:"top",isFocused:m,editor:i,getPos:n,elementRef:g,enabled:u&&b});let E=tz(i),{onOpenContextMenu:_}=(0,t_.useEditorContextMenu)({editor:i,getPos:n,contextMenuItems:E}),I=(0,tc.useCallback)(e=>{_(e)},[_]),M=(0,tc.useMemo)(()=>(0,tu.parseCssStyleString)(c),[c]),{displayX:T,displayY:L,displayW:j,displayH:P,displaySelected:D,displayCursor:N,displayBorderZone:R}=tP({canvasInteractionsEnabled:u,isTextbox:b,x:r,y:o,w:s,h:l,tempPosition:x,tempDimensions:y,isCanvasSelected:h,selected:p,cursor:C,isInBorderZone:v}),O=u&&b;return(0,tl.jsx)(tE.NodeViewWrapper,{children:(0,tl.jsxs)(td.Box,{position:"absolute",insetStart:`${T-tD.BORDER_ZONE_HALF}px`,top:`${L-tD.BORDER_ZONE_HALF}px`,width:`${j+2*tD.BORDER_ZONE_HALF}px`,height:O?void 0:`${P+2*tD.BORDER_ZONE_HALF}px`,padding:O?`${tD.BORDER_ZONE_HALF}px`:0,cursor:N,onMouseMove:u?void 0:S,onMouseLeave:u?void 0:k,onMouseDown:u?void 0:w,onContextMenu:I,onDoubleClick:tI.stopPropagation,children:[(0,tl.jsx)(td.Box,{ref:g,position:O?"relative":"absolute",insetStart:O?void 0:`${tD.BORDER_ZONE_HALF}px`,top:O?void 0:`${tD.BORDER_ZONE_HALF}px`,insetEnd:O?void 0:`${tD.BORDER_ZONE_HALF}px`,bottom:O?void 0:`${tD.BORDER_ZONE_HALF}px`,width:O?"100%":void 0,overflow:O?"visible":"hidden",borderRadius:"sm",css:{outlineStyle:D||R?"solid":"none",outlineWidth:D?"2px":"1px",outlineColor:D?"var(--chakra-colors-blue-600)":R?"var(--chakra-ring-color)":"var(--grid-outline-color)"},style:M,className:"positioned-box positioned-html-box","data-content-reference":!0,children:(0,tl.jsx)(tg,{html:d||""})}),!u&&(0,tl.jsx)(A,{selected:p})]})})},tH=(0,e2.createTiptapNode)("positionedHtmlBox",{priority:e3.ExtensionPriorityMap.PositionedBox,selectable:!0,draggable:!1,isolating:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tF,{update:ts.numChildrenOrAttrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=positioned-html-box]",getAttrs:e=>{let t={},i=e.getAttribute("data-x");i&&(t.x=Number(i));let n=e.getAttribute("data-y");n&&(t.y=Number(n));let a=e.getAttribute("data-w");a&&(t.w=Number(a));let r=e.getAttribute("data-h");r&&(t.h=Number(r));let o=e.getAttribute("data-style");o&&(t.style=o);let s=e.getAttribute("data-html");return s&&(t.html=s),t}}],renderHTML({node:e,HTMLAttributes:t}){let n={class:"positioned-html-box","data-x":String(e.attrs.x),"data-y":String(e.attrs.y),"data-w":String(e.attrs.w),"data-h":String(e.attrs.h),"data-html":e.attrs.html||""};return e.attrs.style&&(n["data-style"]=e.attrs.style),["div",(0,i.mergeAttributes)(t,n),0]}}),tW=()=>new eK.Plugin({props:{handleDOMEvents:{mousedown:(e,t)=>{let i,n;if(n=t.target,n?.closest("foreignObject")===null||2===t.detail)return!1;let a=t.detail>=3,{clientX:r,clientY:o}=t,s=((e,t,i)=>{if("caretPositionFromPoint"in e){let n=e.caretPositionFromPoint(t,i);if(n)return{node:n.offsetNode,offset:n.offset}}if("caretRangeFromPoint"in e){let n=e.caretRangeFromPoint(t,i);if(n)return{node:n.startContainer,offset:n.startOffset}}return null})(e.dom.ownerDocument,r,o);if(!s)return!1;try{i=e.docView.posFromDOM(s.node,s.offset,1)}catch{return!1}if(i<0)return!1;let l=e.state.doc.resolve(i);if(!l.parent.isTextblock)return!1;if(a){let i=l.start(),n=l.end(),a=eK.TextSelection.create(e.state.doc,i,n);e.dispatch(e.state.tr.setSelection(a)),t.preventDefault()}else{let t=eK.TextSelection.create(e.state.doc,i);e.dispatch(e.state.tr.setSelection(t))}return!0}}}});var tU=e.i(285598),tV=e.i(896678);let tG=e=>{let{x:t,y:i}=e.attrs;return e.type.create({...e.attrs,x:(t??0)+20,y:(i??0)+20},e.content,e.marks)},t$=e=>{let t=e.type.contentMatch;if(!t)return!1;let i=e.type.schema.nodes.positionedTextbox;return!!i&&null!==t.matchType(i)},tZ=(e,t,a)=>{let r,o,s;if(r=!1,a.content.descendants(e=>!(0,tV.isPositionedBoxNode)(e)||(r=!0,!1)),!r)return!1;let{state:l}=e,{selection:d,tr:c}=l,u=(o=[],a.content.descendants(e=>{(0,tV.isPositionedBoxNode)(e)&&o.push(e)}),o);if(0===u.length)return!1;if(d instanceof eK.NodeSelection&&(0,tV.isPositionedBoxNode)(d.node)){let t=d.from+d.node.nodeSize,i=t;for(let e of u){let t=tG(e);c.insert(i,t),i+=t.nodeSize}return c.setSelection(eK.NodeSelection.create(c.doc,t)),c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"),e.dispatch(c),!0}if(d instanceof eK.NodeSelection&&t$(d.node)){let t=d.from+d.node.nodeSize-1,i=t;for(let e of u){let t=tG(e);c.insert(i,t),i+=t.nodeSize}return c.setSelection(eK.NodeSelection.create(c.doc,t)),c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"),e.dispatch(c),!0}let p=(0,i.findParentNode)(t$)(d);if(p){let t=p.pos+p.node.nodeSize-1,i=t;for(let e of u){let t=tG(e);c.insert(i,t),i+=t.nodeSize}return c.setSelection(eK.NodeSelection.create(c.doc,t)),c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"),e.dispatch(c),!0}let h=(s=[],(a.content.descendants(e=>(0,tV.isPositionedBoxNode)(e)?(e.content.forEach(e=>{s.push(e)}),!1):!e.isBlock||!!(0,tV.isPositionedBoxNode)(e)||(s.push(e),!1)),0===s.length)?n.Slice.empty:new n.Slice(n.Fragment.from(s),0,0));if(0===h.content.childCount)return!1;c.replaceSelection(h);let m=(0,tU.createSelectionNearLastTo)(c);return m&&c.setSelection(m),c.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste"),e.dispatch(c),!0},tK=()=>new eK.Plugin({key:new eK.PluginKey("positionedBoxPaste"),props:{handlePaste:tZ}});var tq=e.i(588748),tY=e.i(658729);let tX=e=>{let{node:t,editor:i,getPos:n,decorations:a}=e,{x:r,y:o,w:s,h:l,fontSize:d,verticalAlign:c,horizontalAlign:u,style:p}=t.attrs,h=(0,tc.useMemo)(()=>(0,tu.parseCssStyleString)(p),[p]),m=(0,tA.useFeatureFlag)("canvasInteractions"),g="positionedContentBox"===t.type.name,f=u??(g?null:"center"),b={...(0,ex.getAlignStyles)(f),...(0,ex.getAlignStylesParent)(f,"rtl")},x=(e=>{switch(e){case"center":return"center";case"bottom":return"flex-end";default:return"flex-start"}})(c),y=(0,tM.isFocusedInside)(a),v=(0,tM.isSelectingNode)(a),C=(0,tM.isCanvasSelectingNode)(a),w=(0,tM.isCanvasMultiSelectingNode)(a),S=(0,tc.useRef)(null),k=(0,tq.useCropBounds)(),A=(0,tc.useCallback)(()=>S.current?S.current.closest(".positioned-boxes-wrapper"):null,[]),{tempPosition:E,tempDimensions:_,isInBorderZone:I,cursor:M,handleMouseDown:T,handleMouseMove:L,handleMouseLeave:j,ResizeHandles:P}=(0,tD.useBoxInteractions)({x:r,y:o,w:s,h:l,isImageBox:!1,editor:i,getPos:n,getContainerElement:A,elementRef:S,crop:k,enabled:!m});(({h:e,y:t,verticalAlign:i,isFocused:n,editor:a,getPos:r,getContainerElement:o,elementRef:s,canvasInteractionsEnabled:l})=>{(0,tc.useEffect)(()=>{if(l||!n)return;let d=()=>{let n=s.current?.querySelector(".positioned-box-content");if(!n)return;let l=n.querySelector("[data-node-view-content]");if(!l||!o())return;let d=l.offsetHeight;if(d>e+2){let n=Math.ceil(d),o=n-e,s=t;"center"===i?s=t-o/2:"bottom"===i&&(s=t-o);let l=r();void 0!==l&&a.commands.updateAttributesAtPos(l,{h:n,y:s})}};d();let c=()=>{requestAnimationFrame(d)};return a.on("update",c),()=>{a.off("update",c)}},[n,e,t,i,a,r,o,s,l])})({h:l,y:o,verticalAlign:c,isFocused:y,editor:i,getPos:n,getContainerElement:A,elementRef:S,canvasInteractionsEnabled:m}),tj({h:l,y:o,verticalAlign:c,isFocused:y,editor:i,getPos:n,elementRef:S,enabled:m});let D=tz(i),{onOpenContextMenu:N}=(0,t_.useEditorContextMenu)({editor:i,getPos:n,contextMenuItems:D}),R=(0,tc.useCallback)(e=>{N(e)},[N]),{displayX:O,displayY:B,displayW:z,displayH:F,displaySelected:H,displayCursor:W,displayBorderZone:U}=tP({canvasInteractionsEnabled:m,isTextbox:!0,x:r,y:o,w:s,h:l,tempPosition:E,tempDimensions:_,isCanvasSelected:C,selected:v,cursor:M,isInBorderZone:I});return(0,tl.jsx)(tE.NodeViewWrapper,{children:(0,tl.jsxs)(td.Box,{position:"absolute",insetStart:`${O-tD.BORDER_ZONE_HALF}px`,top:`${B-tD.BORDER_ZONE_HALF}px`,width:`${z+2*tD.BORDER_ZONE_HALF}px`,height:m?void 0:`${F+2*tD.BORDER_ZONE_HALF}px`,padding:m?`${tD.BORDER_ZONE_HALF}px`:0,cursor:m?"move":W,onMouseMove:m?void 0:L,onMouseLeave:m?void 0:j,onMouseDown:m?void 0:T,onContextMenu:R,onDoubleClick:tI.stopPropagation,children:[(0,tl.jsx)(td.Box,{ref:S,position:m?"relative":"absolute",insetStart:m?void 0:`${tD.BORDER_ZONE_HALF}px`,top:m?void 0:`${tD.BORDER_ZONE_HALF}px`,insetEnd:m?void 0:`${tD.BORDER_ZONE_HALF}px`,bottom:m?void 0:`${tD.BORDER_ZONE_HALF}px`,width:m?"100%":void 0,cursor:m?w?"move":"text":void 0,overflow:"visible",borderRadius:"sm",css:{outlineStyle:H||y||U?"solid":"none",outlineWidth:H?"2px":"1px",outlineColor:H?"var(--chakra-colors-blue-600)":y||U?"var(--chakra-ring-color)":"var(--grid-outline-color)"},userSelect:U?"none":"auto",className:g?"positioned-box positioned-content-box":"positioned-box positioned-textbox","data-content-reference":!0,style:h,children:(0,tl.jsx)(td.Box,{className:"positioned-box-content",w:"100%",h:"100%",display:"flex",flexDirection:"column",justifyContent:x,css:b,fontSize:`${d??tY.BASE_FONT_SIZE}px`,children:(0,tl.jsx)(th.NodeViewContent,{})})}),!m&&(0,tl.jsx)(P,{selected:v}),m&&(C||y)&&(0,tl.jsx)(td.Box,{"data-canvas-resize-handle":!0,"data-resize-handle":"width",position:"absolute",insetEnd:`${tD.BORDER_ZONE_HALF-2}px`,top:"50%",transform:"translate(50%, -50%)",width:"4px",height:"30%",minHeight:"16px",maxHeight:"40px",borderRadius:"2px",bg:"var(--chakra-colors-blue-600)",cursor:"ew-resize",contentEditable:!1,pointerEvents:"auto",zIndex:10})]})})},tQ=(0,e2.createTiptapNode)("positionedContentBox",{priority:e3.ExtensionPriorityMap.PositionedBox,selectable:!1,draggable:!1,isolating:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tX,{update:ts.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=positioned-content-box]",getAttrs:e=>{let t={},i=e.getAttribute("data-x");i&&(t.x=Number(i));let n=e.getAttribute("data-y");n&&(t.y=Number(n));let a=e.getAttribute("data-w");a&&(t.w=Number(a));let r=e.getAttribute("data-h");r&&(t.h=Number(r));let o=e.getAttribute("data-font-size");o&&(t.fontSize=o);let s=e.getAttribute("data-vertical-align");return s&&(t.verticalAlign=s),{...t,...(0,e2.parseHorizontalAlign)(e)}}}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"positioned-content-box","data-x":String(e.attrs.x),"data-y":String(e.attrs.y),"data-w":String(e.attrs.w),"data-h":String(e.attrs.h),...null!=e.attrs.fontSize&&{"data-font-size":String(e.attrs.fontSize)},...e.attrs.verticalAlign&&"top"!==e.attrs.verticalAlign&&{"data-vertical-align":e.attrs.verticalAlign},...(0,e2.renderHorizontalAlign)(e.attrs)}),0],addProseMirrorPlugins:()=>[tK(),tW()]}),tJ=e=>{let t,{node:i,editor:n,getPos:a,decorations:r}=e,o=i.attrs,{x:s,y:l,w:d,h:c,style:u}=o,p=o.image,h=(0,tA.useFeatureFlag)("canvasInteractions"),m=(0,eq.useAppSelector)(eY.selectEditable),g=(0,tM.isSelectingNode)(r),f=(0,tM.isCanvasSelectingNode)(r),b=(0,tc.useRef)(null),x=(0,tc.useCallback)(()=>b.current?b.current.closest(".positioned-boxes-wrapper"):null,[]),{tempPosition:y,tempDimensions:v,isInBorderZone:C,cursor:w,handleMouseDown:S,handleMouseMove:k,handleMouseLeave:A,ResizeHandles:E}=(0,tD.useBoxInteractions)({x:s,y:l,w:d,h:c,isImageBox:!0,editor:n,getPos:a,getContainerElement:x,elementRef:b,enabled:!h}),_=tz(n),{onOpenContextMenu:I}=(0,t_.useEditorContextMenu)({editor:n,getPos:a,contextMenuItems:_}),M=(0,tc.useCallback)(e=>{I(e)},[I]),T=(0,tc.useRef)(!1),L=(0,tc.useCallback)(e=>{T.current=g,S(e)},[g,S]),j=(0,tc.useCallback)(()=>T.current,[]),P=(0,tc.useMemo)(()=>(0,tu.parseCssStyleString)(u),[u]),D="var(--body-color)",N=!!(t=p?.source)&&t.startsWith("image.icon"),R=p?.src,{displayX:O,displayY:B,displayW:z,displayH:F,displaySelected:H,displayCursor:W,displayBorderZone:U}=tP({canvasInteractionsEnabled:h,isTextbox:!1,x:s,y:l,w:d,h:c,tempPosition:y,tempDimensions:v,isCanvasSelected:f,selected:g,cursor:w,isInBorderZone:C});return(0,tl.jsx)(tE.NodeViewWrapper,{children:(0,tl.jsxs)(td.Box,{position:"absolute",insetStart:`${O-tD.BORDER_ZONE_HALF}px`,top:`${B-tD.BORDER_ZONE_HALF}px`,width:`${z+2*tD.BORDER_ZONE_HALF}px`,height:`${F+2*tD.BORDER_ZONE_HALF}px`,cursor:W,onMouseMove:h?void 0:k,onMouseLeave:h?void 0:A,onMouseDown:h?void 0:L,onContextMenu:M,onDoubleClick:tI.stopPropagation,children:[(0,tl.jsx)(td.Box,{ref:b,position:"absolute",insetStart:`${tD.BORDER_ZONE_HALF}px`,top:`${tD.BORDER_ZONE_HALF}px`,insetEnd:`${tD.BORDER_ZONE_HALF}px`,bottom:`${tD.BORDER_ZONE_HALF}px`,overflow:"visible",borderRadius:N?"sm":0,css:{outlineStyle:H||U?"solid":"none",outlineWidth:H?"2px":"1px",outlineColor:H?"var(--chakra-colors-blue-600)":"var(--chakra-ring-color)",color:N?D:void 0,fill:N?D:void 0},style:P,className:"positioned-box positioned-imagebox","data-content-reference":!0,children:N?(0,tl.jsx)(tv.SmartLayoutIconOrNumber,{image:p||null,selectCell:m?j:void 0,color:D,iconSize:2,boxProps:{w:"100%",h:"100%"}}):R?(0,tl.jsx)(td.Box,{w:"100%",h:"100%",overflow:"hidden",children:(0,tl.jsx)(ty.ImageOrVideo,{src:p.src,width:"100%",height:"100%",objectFit:"cover"})}):(0,tl.jsx)(tx.MediaPlaceholderImage,{width:"100%",height:"100%",onSelectAndFocus:m?j:void 0,css:{overflow:"hidden"}})}),!h&&(0,tl.jsx)(E,{selected:g})]})})},t0=(0,e2.createTiptapNode)("positionedImageBox",{priority:e3.ExtensionPriorityMap.PositionedBox,selectable:!0,draggable:!1,isolating:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tJ,{update:ts.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"div[class=positioned-imagebox]",getAttrs:e=>{let t={},i=e.getAttribute("data-x");i&&(t.x=Number(i));let n=e.getAttribute("data-y");n&&(t.y=Number(n));let a=e.getAttribute("data-w");a&&(t.w=Number(a));let r=e.getAttribute("data-h");r&&(t.h=Number(r));let o=e.getAttribute("data-style");o&&(t.style=o);let s=e.getAttribute("data-image");if(s)try{t.image=JSON.parse(s)}catch{}return t}}],renderHTML({node:e,HTMLAttributes:t}){let n={class:"positioned-imagebox","data-x":String(e.attrs.x),"data-y":String(e.attrs.y),"data-w":String(e.attrs.w),"data-h":String(e.attrs.h)};return e.attrs.style&&(n["data-style"]=e.attrs.style),e.attrs.image&&(n["data-image"]=JSON.stringify(e.attrs.image)),["div",(0,i.mergeAttributes)(t,n)]}}),t1=e=>"positionedTextbox"===e||"positionedContentBox"===e,t2=e=>{let{selection:t,doc:i}=e;if(!(t instanceof eK.NodeSelection))return null;let n=t.node;if(!t1(n.type.name))return null;let a=t.from,r=i.resolve(a),o=r.before(r.depth),s=r.parent,l=0,d=0;return s.forEach((e,t)=>{t1(e.type.name)&&(o+t+1===a&&(l=d),d++)}),{node:n,pos:a,$pos:r,parentPos:o,parent:s,index:l,siblingCount:d}},t3=(e,t,i)=>{let n,a=t2(e);if(!a)return!1;let{node:r,pos:o,parentPos:s,parent:l,index:d,siblingCount:c}=a,u=Math.max(0,Math.min(c-1,i));if(u===d)return!1;if(!t)return!0;let{tr:p}=e,h=0;if(u===c-1){let e=s+1;l.forEach((t,i)=>{t1(t.type.name)&&(e=s+i+1+t.nodeSize)}),n=e}else{let e=s+1;l.forEach((t,i)=>{t1(t.type.name)&&(h===u&&(e=s+i+1),h++)}),n=e}let m=r.nodeSize;p.delete(o,o+m);let g=p.mapping.map(n);return p.insert(g,r),p.setSelection(eK.NodeSelection.create(p.doc,g)),t(p),!0},t5=(0,e2.createTiptapNode)("positionedTextbox",{priority:e3.ExtensionPriorityMap.PositionedBox,selectable:!1,draggable:!1,isolating:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(tX,{update:ts.attrsOrDecorationsChanged}),addCommands:()=>({bringToFront:()=>({state:e,dispatch:t})=>{let i=t2(e);return!!i&&t3(e,t,i.siblingCount-1)},bringForward:()=>({state:e,dispatch:t})=>{let i=t2(e);return!!i&&t3(e,t,i.index+1)},sendBackward:()=>({state:e,dispatch:t})=>{let i=t2(e);return!!i&&t3(e,t,i.index-1)},sendToBack:()=>({state:e,dispatch:t})=>!!t2(e)&&t3(e,t,0),deletePositionedBox:()=>({state:e,chain:t})=>{let{selection:i}=e;return i instanceof eK.NodeSelection&&!!t1(i.node.type.name)&&(t().deleteSelection().run(),!0)},updatePositionedBoxFontSize:e=>({state:t,chain:i})=>{let{selection:n}=t;if(!(n instanceof eK.NodeSelection))return!1;let a=n.node;if(!t1(a.type.name))return!1;let r=Math.max(8,Math.round((a.attrs.fontSize??tY.BASE_FONT_SIZE)+e));return i().focus().updateAttributes(a.type.name,{fontSize:r}).selectNodeAtPos(n.from).run(),!0}}),parseHTML:()=>[{tag:"div[class=positioned-box]",getAttrs:e=>{let t={},i=e.getAttribute("data-x");i&&(t.x=Number(i));let n=e.getAttribute("data-y");n&&(t.y=Number(n));let a=e.getAttribute("data-w");a&&(t.w=Number(a));let r=e.getAttribute("data-h");r&&(t.h=Number(r));let o=e.getAttribute("data-font-size");o&&(t.fontSize=o);let s=e.getAttribute("data-vertical-align");return s&&(t.verticalAlign=s),{...t,...(0,e2.parseHorizontalAlign)(e)}}}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"positioned-box","data-x":String(e.attrs.x),"data-y":String(e.attrs.y),"data-w":String(e.attrs.w),"data-h":String(e.attrs.h),...null!=e.attrs.fontSize&&{"data-font-size":String(e.attrs.fontSize)},...e.attrs.verticalAlign&&"top"!==e.attrs.verticalAlign&&{"data-vertical-align":e.attrs.verticalAlign},...(0,e2.renderHorizontalAlign)(e.attrs)}),0],addProseMirrorPlugins:()=>[tK(),tW()]});var t4=e.i(615505),t6=e.i(509510);let t9=i.Extension.create({name:"focusHelpers",addCommands:()=>({focusDelayed:()=>({editor:e})=>(requestAnimationFrame(()=>e.view instanceof t4.EditorView&&e.commands.focus()),!0),insertContentAndSelect:(e,t=1)=>({chain:i,state:n})=>i().insertContent(e,{updateSelection:!1}).selectInsertedNode(t).run(),focusMapped:(e,t=0,i=-1)=>({tr:n,view:a})=>{let r=n.mapping.map(e,i)+t;try{let e=(0,t6.findSelectionInsideNode)(n.doc.resolve(r));e&&n.setSelection(e),a.focus()}catch(e){console.error("[focusMapped] error selecting pos",r,e)}return!0},selectInsertedNode:(e=1)=>({tr:t,view:i})=>{let n=(0,t6.getInsertedNodePos)(t);if(!n)return!1;let a=(0,t6.findSelectionInsideNode)(n,e);return!!a&&(t.setSelection(a),i.focus(),!0)},selectNodeAtPos:(e,t=!1)=>({state:i,tr:n,view:a})=>{try{n.setSelection(eK.NodeSelection.create(i.doc,e)),t&&n.scrollIntoView(),a.focus()}catch(t){console.warn("[selectNodeAtPos] Error selecting node",e,t)}return!0},selectInsideNodeAtPos:(e,t)=>({tr:i,state:n})=>{let a=n.doc.resolve(e),r=(0,t6.findSelectionInsideNode)(a,t);return!!r&&(i.setSelection(r),!0)},deleteSelectionAndSelectNear:(e=1)=>({tr:t,state:i})=>{let{selection:n}=i;if(n.empty)return!1;t.deleteSelection().scrollIntoView();let a=(0,tU.findSelectionNearOrGapCursor)(t.doc.resolve(n.from),e);return a&&t.setSelection(a),!0}})});e.s(["FocusHelpers",0,t9],357128);var t8=e.i(417692),t7=e.i(889601),ie=e.i(837438);let it=new eK.PluginKey("smartDiagram");var ii=e.i(865080),ia=e.i(717834),ir=e.i(990272);e.i(905506);var io=e.i(45652),is=e.i(592799),il=e.i(194552),id=e.i(892684),ic=e.i(635273),iu=e.i(932132);let ip=e=>{let{node:t,editor:i,getPos:n}=e,{templateKey:a,aiGenerateStatus:r,data:o}=t.attrs,s=(0,eq.useAppSelector)(eY.selectEditable),l=(0,io.useSSRMounted)(),d=(0,tc.useCallback)(()=>{let e=n();"number"==typeof e&&(i.view.dispatch(i.state.tr.setNodeAttribute(e,"aiGenerateStatus","queued")),setTimeout(()=>{(0,t8.triggerSmartDiagramGeneration)(i,i.state,e)},0))},[i,n]);if(!l)return null;if("queued"===r||!a)return(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,children:(0,tl.jsx)(tx.MediaPlaceholderImage,{isLoading:!0,loadingProvider:"aiGenerated",borderRadius:"var(--box-border-radius)",h:"10em","data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0})});let c=a?(0,ir.getSmartDiagramTemplate)(a):void 0;return c&&("error"!==r||o)?(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,children:(0,tl.jsx)(is.BlockErrorBoundary,{errorMessage:"Unable to render smart diagram",children:(0,tl.jsx)(ih,{...e,template:c})})}):(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,children:(0,tl.jsx)(ic.ImageGenerationErrorPlaceholder,{onRetry:s?d:void 0,borderRadius:"var(--box-border-radius)",h:"10em","data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0})})},ih=({node:e,editor:t,decorations:i,updateAttributes:n,getPos:a,template:r})=>{let o,s=e.attrs,{data:l,horizontalAlign:d,showIcons:c}=s,u=r.Component,{bodyColor:p,primaryColor:h,primaryColorLight:m}=(0,id.useCardColorMode)(i),{isFullBleed:g}=(0,iu.findFullBleedDecoration)(i),[f,b]=(0,tc.useState)(!1),x=(0,tc.useRef)(null),y=(0,eq.useAppSelector)(eY.selectEditable),v=(0,eq.useAppSelector)(eY.selectTheme),{isSelected:C,selectedKeyPath:w,layoutContainerSize:S}=(o=i.find(e=>e.spec.isSmartDiagramDecoration))?o.spec:{isSmartDiagramDecoration:!0,selectedKeyPath:void 0,isSelected:!1,layoutContainerSize:1},k=t.isFocused,A=!!(C&&!w&&k),E=(0,ia.useTiptapEditorEventCallback)((e,t)=>{let i=a();if("number"==typeof i)try{let n=e.state.doc.nodeAt(i)?.attrs,a=n?.data;if(!a)return;let r=JSON.parse(JSON.stringify(a)),o=t(r);if(JSON.stringify(o)===JSON.stringify(a))return;let s=e.state.tr;s.setNodeAttribute(i,"data",o).setSelection(eK.Selection.fromJSON(s.doc,e.state.selection.toJSON())),e.view.dispatch(s)}catch(e){console.error("Error updating smart diagram data",e)}}),_=(0,ia.useTiptapEditorEventCallback)((e,t)=>{let i=a();if("number"!=typeof i)return;let n=t?.target;if(!n?.closest("[data-in-editor-focus]"))try{e.commands.selectNodeAtPos(i)}catch(e){console.error("Error selecting node",e)}}),I=(0,tc.useCallback)(t=>{n({...e.attrs,...t}),_()},[e.attrs,n,_]),M=(0,ia.useTiptapEditorEventCallback)((e,t)=>{let i=a();if("number"!=typeof i)return;let n=e.state.doc.resolve(i),r=new ie.DiagramItemSelection(n,t);e.view.dispatch(e.state.tr.setSelection(r))}),T=(0,ex.getAlignDirection)(i,d),L=(0,ex.getAlignDirectionFromDecorations)(i);return(0,ii.useOutsideClick)({enabled:(f||C)&&y,ref:x,handler:e=>{let t=e.target;if(!(t instanceof Element))return;let i=t.closest("[data-active-menu]"),n=t.closest("[data-insert-widget-popover]");(!i||n||!k)&&f&&b(!1)}}),(0,tl.jsx)("div",{ref:x,children:(0,tl.jsx)(u,{data:l,theme:v,updateData:E,updateResizeAttrs:I,selectItem:M,selectNode:_,editor:t,isNodeSelected:A,selectedKeyPath:w??null,alignDirection:T,svgDirection:L,isEditable:y,attrs:s,layoutContainerSize:S,showIcons:c,colors:{bodyColor:p,accentColor:h,accentColorLight:m},isTextMenuVisible:f,setIsTextMenuVisible:b,isFullBleed:g})})};function im({event:e,defaultStopEvent:t}){return!!(e.target instanceof HTMLElement&&e.target.closest(".smart-diagram-selection-box"))||t(e)}let ig=(0,e2.createTiptapNode)("smartDiagram",{isolating:!0,defining:!0,selectable:!0,parseHTML:()=>[{tag:"div[class=smart-diagram]",getAttrs:e=>({id:(0,e2.parseIdAttr)(e,eQ.generateMediaId),data:(0,e2.parseJSONAttr)(e,"data")??{},aiGenerateParams:(0,e2.parseJSONAttr)(e,"aiGenerateParams")??null,templateKey:e.getAttribute("data-templatekey")||null,aiGenerateStatus:e.getAttribute("data-aigeneratestatus")||null,width:Number(e.getAttribute("data-width"))||null,showIcons:"false"!==e.getAttribute("data-show-icons"),...(0,e2.parseHorizontalAlign)(e)})}],renderHTML:({node:e,HTMLAttributes:t})=>["div",(0,i.mergeAttributes)(t,{class:"smart-diagram","data-id":e.attrs.id,...(0,e2.renderJSONAttrs)(e.attrs,"data","aiGenerateParams"),...e.attrs.templateKey&&{"data-templatekey":e.attrs.templateKey},...e.attrs.aiGenerateStatus&&{"data-aigeneratestatus":e.attrs.aiGenerateStatus},...null!=e.attrs.width&&{"data-width":String(e.attrs.width)},...!e.attrs.showIcons&&{"data-show-icons":"false"},...(0,e2.renderHorizontalAlign)(e.attrs)})],addNodeView:()=>(0,e1.ReactNodeViewRenderer)(ip,{update:ts.attrsOrDecorationsChanged}),addProseMirrorPlugins:()=>[new eK.Plugin({key:it,props:{decorations(e){let{doc:t,selection:i}=e,n=[];return t.descendants((t,a)=>{let r,o;if("smartDiagram"!==t.type.name)return;let s=(0,t7.getContainerSize)(e.doc.resolve(a)),{isSelected:l,selectedKeyPath:d}=(r=i,o=t,r instanceof eK.NodeSelection&&r.node===o?{isSelected:!0}:r instanceof ie.DiagramItemSelection&&r.node===o?{isSelected:!0,selectedKeyPath:r.keyPath}:{isSelected:!1,selectedKeyPath:void 0});n.push(t4.Decoration.node(a,a+t.nodeSize,{},{isSmartDiagramDecoration:!0,isSelected:l,selectedKeyPath:d,layoutContainerSize:s}))}),t4.DecorationSet.create(t,n)}}})],addCommands(){return{insertSmartDiagram:({attrs:e,selectedText:t,allowGeneration:n=!0})=>({chain:a,state:r})=>{let{selection:o}=r,s=(0,i.findParentNode)(e=>"smartLayout"===e.type.name)(o),l=(0,i.findParentNodeClosestToPos)(r.doc.resolve(o.from),e=>"gridLayout"===e.type.name),d=o.from,c=s||l;c&&(d=c.pos+c.node.nodeSize);let u=n?(0,t8.createSmartDiagramGenerateData)(this.editor,t):{};return a().insertContentAt(d,{type:this.name,attrs:{...e,templateKey:e.templateKey,id:(0,eQ.generateMediaId)(),...u}}).selectInsertedNode().command(({tr:e,state:t})=>{if(n){let i=e.selection.from;return(0,t8.triggerSmartDiagramGeneration)(this.editor,t,i)}return!0}).run()},updateSmartDiagramData:(e,t,i)=>({chain:n})=>n().updateAttributeKeyPathAtPos(e,"data."+t,i).run()}}});e.i(84594);var ib=e.i(693252),ix=e.i(878132),iy=e.i(178079),iv=e.i(843002),iC=e.i(415756),iw=e.i(202599),iS=e.i(230279);e.i(528403);var ik=e.i(951190);let iA=i.Extension.create({name:"TableCommands",addCommands:()=>({selectColumn:e=>({tr:t,dispatch:i})=>{if(!i)return!0;let{doc:n}=t,a=n.resolve(e),r=ik.CellSelection.colSelection(a);return t.setSelection(r),!0},selectRow:e=>({tr:t,dispatch:i})=>{if(!i)return!0;let{doc:n}=t,a=n.resolve(e),r=ik.CellSelection.rowSelection(a);return t.setSelection(r),!0},selectTable:e=>({tr:t,dispatch:i})=>{if(!i)return!0;let{doc:n}=t,a=n.resolve(e),r=ik.CellSelection.colSelection(a),o=ik.CellSelection.rowSelection(r.$anchorCell,r.$headCell);return t.setSelection(o),!0}})});var iE=e.i(548402);let i_=(0,e2.createTiptapNode)("tableCell",{tableRole:"cell",isolating:!0,selectable:!1,addCommands:()=>({setTableCellBackgroundColor:e=>({state:t,dispatch:i})=>{let{selection:n}=t;if(i){let a=t.tr;n instanceof ik.CellSelection&&n.forEachCell((t,i)=>{"tableCell"===t.type.name&&a.setNodeMarkup(i,void 0,{...t.attrs,backgroundColor:e})}),i(a)}return!0},unsetTableCellBackgroundColor:()=>({state:e,dispatch:t})=>{let{selection:i}=e;if(t){let n=e.tr;if(i instanceof ik.CellSelection)i.forEachCell((e,t)=>{"tableCell"===e.type.name&&e.attrs.backgroundColor&&n.setNodeMarkup(t,void 0,{...e.attrs,backgroundColor:null})});else{let{from:t,to:a}=i;e.doc.nodesBetween(t,a,(e,t)=>{"tableCell"===e.type.name&&e.attrs.backgroundColor&&n.setNodeMarkup(t,void 0,{...e.attrs,backgroundColor:null})})}t(n)}return!0}}),parseHTML:()=>[{tag:"td",getAttrs:e=>({colspan:Number(e.getAttribute("colspan"))||1,rowspan:Number(e.getAttribute("rowspan"))||1,backgroundColor:e.getAttribute("data-background-color")||null})},{tag:"th",getAttrs:e=>({colspan:Number(e.getAttribute("colspan"))||1,rowspan:Number(e.getAttribute("rowspan"))||1,backgroundColor:e.getAttribute("data-background-color")||null})}],renderHTML({node:e,HTMLAttributes:t}){let{backgroundColor:n,colspan:a,rowspan:r}=e.attrs,o={};if(a>1&&(o.colspan=a),r>1&&(o.rowspan=r),n){let e=(0,iE.makeColorReadable)("#272525",n,4.5,!0);o["data-background-color"]=n,o.style=`background-color: ${n}; --table-cell-text-color: ${e};`}return["td",(0,i.mergeAttributes)(t,o),0]}});var iI=e.i(613616),iM=e.i(136484),iT=e.i(343902),iL=e.i(339891);let ij=e=>{let t=(0,iM.useShouldRenderMobileVersion)(),{decorations:i}=e,n=(0,iL.hasFirstTableRowDeco)(i);return(0,tl.jsxs)(il.AnnotatableNodeViewWrapper,{...e,commentStackPosition:"after",className:n?"table-row-wrapper is-first-table-row":"table-row-wrapper",style:{display:"contents"},hideComments:t,children:[(0,tl.jsx)("div",{style:{position:"relative",padding:0},children:(0,tl.jsx)(iP,{...e})}),(0,tl.jsx)(th.NodeViewContent,{as:"div",className:"table-row-content",style:{display:"contents"}})]})},iP=(0,tc.memo)(({...e})=>{let{getPos:t,editor:i}=e;return(0,tl.jsx)(iI.Flex,{height:"100%",align:"center",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,tl.jsx)(iT.ContainerDragHandle,{...e,handlePlacement:"custom",label:tR.i18n._({id:"9c44h0",message:"Select row"}),onClick:()=>{let e=t();"number"!=typeof e||i.chain().focus().selectRow(e+1).run()},insetInlineStart:"-0.5em",top:"1em",zIndex:"3","data-testid":"table-row-control"})})});iP.displayName="RowControl";let iD=(0,e2.createTiptapNode)("tableRow",{selectable:!1,tableRole:"row",containerHandle:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(ij,{update:ts.attrsOrDecorationsChanged,as:"tr"}),parseHTML:()=>[{tag:"tr"}],renderHTML:({HTMLAttributes:e})=>["tr",(0,i.mergeAttributes)(e),0]}),iN=(0,e2.createTiptapNode)("text");e.i(539262);var iR=e.i(742014),iO=e.i(475463),iB=e.i(761657),iz=e.i(596523),iF=e.i(470645),iH=e.i(772177);let iW=e=>{let{node:t,decorations:i}=e,{level:n,horizontalAlign:a,placeholder:r}=t.attrs,o=r||(n===iU.DefaultTitle?tR.i18n._({id:"wja8aL",message:"Untitled"}):tR.i18n._({id:"MHrjPM",message:"Title"}));return(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,style:{display:"flex",flexDirection:"column",...(0,ex.getAlignStyles)(a)},children:(0,tl.jsx)(th.NodeViewContent,{dir:(0,ex.getAlignDirection)(i),level:n,className:(0,iF.cx)("title",iH.HEADING_CLASS),"data-placeholder":o,style:{minWidth:"min(100%, 10em)",...(0,ex.getAlignSelfStyles)(a)}})})};var iU=((t={})[t.DefaultTitle=1]="DefaultTitle",t[t.LargeTitle=2]="LargeTitle",t[t.XLargeTitle=3]="XLargeTitle",t);let iV=(0,e2.createTiptapNode)("title",{defining:!0,selectable:!1,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(iW,{update:ts.attrsOrDecorationsChanged}),parseHTML:()=>[{tag:"h1[class=title]",getAttrs:e=>(0,e2.parseHorizontalAlign)(e)},{tag:"display[size]",getAttrs:e=>({level:(e=>{switch(e){case"md":default:return 1;case"lg":return 2;case"xl":return 3}})(e.getAttribute("size")),...(0,e2.parseHorizontalAlign)(e)})}],addInputRules(){return(0,iB.getTitleSizeMetaOptions)().map(([,e])=>{let{inputRegex:t,level:i}=e;return t?(0,iz.textblockTypeInputRule)({find:t,type:this.type,getAttributes:{level:i}}):null}).filter(e=>!!e)},renderHTML:({node:e,HTMLAttributes:t})=>["h1",(0,i.mergeAttributes)(t,{class:"title",level:e.attrs.level,...(0,e2.renderHorizontalAlign)(e.attrs)}),0]});var iG=e.i(977581),i$=e.i(714521),iZ=e.i(536913),iK=e.i(969641),iq=e.i(887527),iY=e.i(575084),iX=e.i(541075),iQ=e.i(661619);let iJ="1.5em",i0=e=>{let{node:t,decorations:i}=e,{level:n,fontSize:a,placeholder:r,horizontalAlign:o}=t.attrs,{toggleId:s="",isEmpty:l}=i.find(e=>e.spec.isToggleDecoration)?.spec||{},d=(0,ex.getAlignStyles)(o),c=(0,ex.getAlignDirection)(i),[u]=(0,iQ.getInsetProps)(c),p=(0,eq.useAppSelector)(eY.selectEditable),h=(0,eq.useAppSelector)(eY.selectIsStatic),m=(0,eq.useAppSelector)((0,eY.selectToggleExpanded)(s))||h,g=(0,tc.useCallback)(()=>{(0,iZ.setToggleOpen)(s,!m)},[s,m]);return(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,hideComments:!m,children:(0,tl.jsxs)(iq.Text,{as:"div",dir:c,display:"flex",flexDirection:"column",position:"relative",onClick:p?void 0:g,cursor:p?void 0:"pointer",style:{display:"flex",flexDirection:"column",...(0,ex.getAlignStyles)(o)},children:[(0,tl.jsx)(iK.Button,{[u]:`calc(0.125em - ${iJ})`,position:"absolute",variant:"ghost",colorScheme:"gray",color:l?"var(--body-color-muted)":"var(--body-color)",onClick:p?g:void 0,contentEditable:!1,onMouseDown:tI.preventDefaultToAvoidBlur,fontSize:"1em",lineHeight:"inherit",height:"100%",px:2,marginStart:-2,minW:"unset","data-testid":"toggle-button",children:(0,tl.jsx)(iq.Text,{transform:`rotate(${m?90:180*("rtl"===c)}deg)`,transformOrigin:"center",transitionProperty:"transform",transitionDuration:"normal",fontSize:"0.75em",children:(0,tl.jsx)(iX.FontAwesomeIcon,{icon:iY.faPlay})})}),(0,tl.jsx)(th.NodeViewContent,{dir:c,level:n,"data-placeholder":r||tR.i18n._({id:"JFciKP",message:"Toggle"}),"data-font-size":a,className:(0,iF.cx)((0,i$.isHeadingStyle)(a)&&iH.HEADING_CLASS),style:{minWidth:"min(100%, 10em)",textAlign:d.textAlign,...(0,ex.getAlignSelfStyles)(o)}})]})})},i1=(0,e2.createTiptapNode)("toggleSummary",{selectable:!1,allowFontSizes:"heading body",addNodeView:()=>(0,e1.ReactNodeViewRenderer)(i0,{update:ts.attrsOrDecorationsChanged}),renderHTML:({node:e,HTMLAttributes:t})=>["summary",{...t,...(0,e2.renderFontSize)(e.attrs),...(0,e2.renderHorizontalAlign)(e.attrs)},0],parseHTML:()=>[{tag:"summary",getAttrs:e=>({fontSize:(0,e2.parseFontSize)(e),...(0,e2.parseHorizontalAlign)(e)})}]}),i2=e=>{let{decorations:t,node:i}=e,n=(0,ex.getAlignDirection)(t),[a]=(0,iQ.getInsetProps)(n),r=(0,eq.useAppSelector)(eY.selectIsStatic),o=(0,eq.useAppSelector)((0,eY.selectToggleExpanded)(i.attrs.id))||r;return(0,tl.jsx)(il.AnnotatableNodeViewWrapper,{...e,hideComments:o,readOnly:!o,children:(0,tl.jsxs)(td.Box,{dir:n,ps:iJ,position:"relative","data-open":!!o,className:"toggle",borderRadius:"var(--box-border-radius)","data-selection-ring":"padded",children:[(0,tl.jsx)(th.NodeViewContent,{}),o&&(0,tl.jsx)(td.Box,{position:"absolute",[a]:"0.375em",bottom:"0.25em",top:"2.5em",borderStart:"1px solid",borderColor:"var(--neutral-border-color)"})]})})};var i3=e.i(78383);let i5=/^\s*([+])\s$/,i4=(0,e2.createTiptapNode)("toggle",{selectable:!1,isolating:!0,priority:e3.ExtensionPriorityMap.Toggle,expandable:!0,addNodeView:()=>(0,e1.ReactNodeViewRenderer)(i2,{update:ts.attrsOrDecorationsChanged}),addProseMirrorPlugins:()=>[new eK.Plugin({key:new eK.PluginKey("TogglePlugin"),props:{handlePaste(e,t,a){let{selection:r,tr:o}=e.state,s=(0,i.findParentNode)(iZ.isToggleSummaryNode)(r);if(!s)return!1;let l=null,d=null,c=[];if(a.content.descendants(e=>{e.isTextblock&&(l?c.push(e):(l=e.content,d=(0,i$.fontSizeFromNode)(e)||null))}),!l)return;d&&o.setNodeAttribute(s.pos,"fontSize",d),o.replaceSelection(n.Slice.maxOpen(l));let u=o.mapping.map(s.pos+s.node.nodeSize);o.replaceRange(u,u,n.Slice.maxOpen(n.Fragment.fromArray(c)));let p=(0,tU.createSelectionNearLastTo)(o,-1);return p&&o.setSelection(p),e.dispatch(o),!0},decorations({doc:e}){let t=[];return e.descendants((e,i,n)=>{if(!n||!(0,iZ.isToggleSummaryNode)(e))return;let a=(0,iG.fragmentToArray)(n.content).slice(1).every(e=>(0,iG.isNodeEmpty)(e)),r=t4.Decoration.node(i,i+e.nodeSize,{},{isToggleDecoration:!0,toggleId:n.attrs.id,isEmpty:a});t.push(r)}),t4.DecorationSet.create(e,t)}}})],addInputRules(){var e;return[(e={find:i5,innerType:this.editor.schema.nodes.toggleSummary,outerType:this.type,getInnerAttributes:e=>({fontSize:(0,i$.fontSizeFromNode)(e)}),getOuterAttributes:()=>{let e=(0,i3.generateToggleId)();return(0,iZ.setToggleOpen)(e,!0),{id:e}}},new i.InputRule({find:e.find,handler:({state:t,range:n,match:a})=>{let r=t.doc.resolve(n.from);if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),e.outerType))return;let o=(0,i.callOrReturn)(e.getOuterAttributes,void 0,r.parent)||{},s=(0,i.callOrReturn)(e.getInnerAttributes,void 0,r.parent)||{},l=t.tr.delete(n.from,n.to),d=l.doc.resolve(n.from),c=d.parent,u=e.outerType.createAndFill(o,[e.innerType.create(s,c.content)]);l.replaceWith(d.before(),d.after(),u);let p=(0,tU.findSelectionNearOrGapCursor)(l.doc.resolve(n.from));p&&l.setSelection(p)}}))]},addCommands(){return{unwrapToggle:()=>({state:e,editor:t,tr:a})=>{if(!t.isActive("toggleSummary"))return!1;let{selection:r,schema:o}=e,s=(0,i.findParentNode)(iZ.isToggleNode)(r);if(!s||s.start+1!==r.from||!r.empty)return!1;let l=(0,iG.fragmentToArray)(s.node.content),d=l[0],{type:c,level:u}=(0,i$.getFontSizeOption)(d.attrs.fontSize),p=["heading"===c?o.nodes.heading.create({level:u},d.content):o.nodes.paragraph.create({fontSize:d.attrs.fontSize},d.content)].concat(l.slice(1));a.replaceWith(s.pos,s.pos+s.node.nodeSize,n.Fragment.from(p)).setMeta("annotationEvent",{type:"unwrap-node",pos:s.pos});let h=a.doc.resolve(s.pos),m=(0,t6.findSelectionInsideNode)(h);return m&&a.setSelection(m),!0},joinBackwardInToggle:()=>({state:e,editor:t,chain:n})=>{if(t.isActive("toggleSummary"))return!1;let{selection:a}=e,r=(0,i.findParentNode)(iZ.isToggleNode)(a);if(!r)return!1;let o=(0,iG.fragmentToArray)(r.node.content).slice(1);return!!a.empty&&0===a.$from.parentOffset&&1===o.length&&(n().command(({tr:e})=>{let i=e.doc.resolve(r.pos+1).end();return e.insert(i,t.schema.nodes.paragraph.create()),!0}).joinBackward(),!0)},wrapWithToggle:(e,t=!0)=>({state:i,tr:a})=>{let r,{doc:o,selection:s,schema:l}=i,d=s.$from.blockRange(s.$to);if(!d)return!1;let c=[];o.nodesBetween(s.from,s.to,(e,t,i)=>{if(i===d.parent)return c.push(e),!1});let u=[];if(!e&&c[0].isTextblock&&c[0].textContent.length<100){let e=(0,i$.fontSizeFromNode)(c[0]);r=l.nodes.toggleSummary.create({fontSize:e},c[0].content),u=c.slice(1)}else{let t=e?l.text(e):null;r=l.nodes.toggleSummary.create(null,t),u=c}let p=(0,i3.generateToggleId)();t&&(0,iZ.setToggleOpen)(p,!0);let h=this.editor.schema.nodes.toggle.createAndFill({id:p},n.Fragment.fromArray([r,...u]));if(!h)return!1;let{start:m,end:g}=d;a.replaceRangeWith(m,g,h).setMeta("annotationEvent",{type:"wrap-nodes",start:m,end:g,level:1});let f=(0,t6.getInsertedNodePos)(a);if(!f)return!1;let b=(0,t6.findSelectionInsideNode)(f,-1);return b&&a.setSelection(b),!0},enterInToggle:()=>({editor:e,state:t,chain:n})=>{if(!e.isActive("toggle"))return!1;let a=(0,i.findParentNode)(iZ.isToggleNode)(t.selection);if(!a||(0,iZ.isToggleOpen)(a.node.attrs.id))return!1;let{selection:r}=e.state,{$from:o}=r;if(o.parentOffset===o.parent.nodeSize-2){let e=a.pos+a.node.nodeSize;return n().insertContentAt(e,{type:"paragraph"}).selectInsertedNode().run(),!0}return(0,iZ.setToggleOpen)(a.node.attrs.id,!0),!0}}},addKeyboardShortcuts:()=>({Enter:({editor:e})=>e.commands.enterInToggle(),Backspace:({editor:e})=>e.commands.first(({commands:e})=>[()=>e.unwrapToggle(),()=>e.joinBackwardInToggle()])}),addExtensions:()=>[i3.UniqueToggleId,i1],renderHTML:({HTMLAttributes:e})=>["details",e,0],parseHTML:()=>[{tag:"details",getAttrs:e=>({id:(0,e2.parseIdAttr)(e,i3.generateToggleId)})}]});var i6=e.i(520100);let i9=(0,e2.extendTiptapMark)(i6.default,"underline",{parseHTML:()=>[{tag:"u"},{style:"text-decoration=underline"},{style:"text-decoration-line=underline"}]});var i8=e.i(693416),i7=e.i(507402);let ne=i.Extension.create({name:"updateAttributesAtPos",addCommands:()=>({updateAttributesAtPos:(e,t)=>({tr:i})=>(Object.entries(t).forEach(([t,n])=>{i.setNodeAttribute(e,t,n)}),!0),updateNestedAttributesAtPos:(e,t)=>({tr:i})=>{let n=i.doc.nodeAt(e);return!!n&&(Object.entries(t).forEach(([t,a])=>{let r=(0,i7.default)(a)?{...n.attrs[t],...a}:a;i.setNodeAttribute(e,t,r)}),!0)},updateAttributeKeyPathAtPos:(e,t,i)=>({tr:n,state:a})=>{let r=a.doc.nodeAt(e)?.attrs;if(!r)return!1;let o=JSON.parse(JSON.stringify(r));return Object.entries((0,i8.default)(o,t,i)).forEach(([t,i])=>{n.setNodeAttribute(e,t,i)}),!0}})});e.s(["UpdateAttributes",0,ne],577482);var nt=e.i(55889);let ni=({isInnerEditor:e=!1}={})=>[i.Extension.create({name:"selectAllTextCommand",addCommands:()=>({selectAllText:d.selectAllText})}),q.DocRoot,q.Document,X.DocumentAttrsExtension,v.Card,_.CardIdsExtension.configure({enabled:!l.config.GAMMA_PUPPETEER_SERVICE}),A.CardCollapse,E.CardCommands,L.CardLayoutItem,T.CardAccentLayoutItem,I.CardImageItem,C.CardCanvasItem,S.CardCodeItem,P.CardNotes,ne,iN,eg.HardBreak,eT.Link.configure({openOnClick:!1}),W.CodeMark,ez.Math,h.Bold,ey.Italic,i9,iC.Strike,eD.List,ej.Bullet,eN.Numbered,eO.Todo,iV,ef.Heading,ti.Paragraph,u.Blockquote,x.CalloutBox,H.CodeBlock,ex.HorizontalAlign,iR.Highlight,m.Button,g.ButtonGroup,ew.Label,eS.LabelGroup,iO.TextColor,er.FontSize,tr,iw.Table.extend({resizable:!0,allowTableNodeSelection:!0}),iD,i_,iA,B.Chart,ed.GraphyChart,e0,e4,e$.Image,e6.Video,eF.Embed,J.Drawing,G.Diagram,eW.Gallery,eV.Graphic,te.UserMention,e8.CardMention,e7.DocMention,ei.EmojiNode,Z.Divider,eE.Layout,eu.Grid,ep.GridItem,e_.LayoutCell,ib.SmartLayout,ix.SmartLayoutCell,ig,eo.Footnote,es.FootnoteLabel,U.Contributors,R.CardTableOfContents,i4,t5,tQ,t0,tH,tk,tw,tb,et.DynamicNodes,en.EmptyNodes,c.BlockClass,ea.FixRequiredAttrs,F.Clipboard,Q.DropCursor,s.Gapcursor,t9,eC.KeyMapOverride.configure({addSelectionKeyMaps:!e}),ev.KeyBoardCatchall];function nn(e){return(0,o.tiptapNodeView)({...e,stopEvent:({event:t,defaultStopEvent:i})=>"contextmenu"!==t.type&&(e.stopEvent?e.stopEvent({event:t,defaultStopEvent:i}):i(t))})}let na=()=>({document:(0,o.tiptapNodeView)({component:Y.Doc,extension:q.Document,ignoreMutation:q.documentIgnoreMutation}),card:nn({component:N.SwitchingCardView,extension:v.Card,ignoreMutation:v.cardIgnoreMutation}),cardLayoutItem:nn({component:j.CardLayoutItemView,extension:L.CardLayoutItem}),cardAccentLayoutItem:nn({component:j.CardLayoutItemView,extension:T.CardAccentLayoutItem}),cardImageItem:nn({component:M.CardImageItemView,extension:I.CardImageItem}),cardCanvasItem:nn({component:w.CardCanvasItemView,extension:C.CardCanvasItem}),cardCodeItem:nn({component:k.CardCodeItemView,extension:S.CardCodeItem}),cardNotes:nn({component:D.CardNotesNodeView,extension:P.CardNotes,ignoreMutation:()=>!0}),bullet:nn({component:eP.BulletView,extension:ej.Bullet,as:"ul",attrs:({node:e})=>({indent:e.attrs.indent})}),numbered:nn({component:eR.NumberedView,extension:eN.Numbered,as:"ol",attrs:({node:e})=>({indent:e.attrs.indent})}),todo:nn({component:eB.TodoView,extension:eO.Todo,as:"ul",attrs:({node:e})=>({indent:e.attrs.indent})}),title:nn({component:iW,extension:iV}),heading:nn({component:eb.HeadingView,extension:ef.Heading}),paragraph:nn({component:tn.ParagraphView,extension:ti.Paragraph}),blockquote:nn({component:p.BlockquoteView,extension:u.Blockquote}),calloutBox:nn({component:y.CalloutBoxView,extension:x.CalloutBox}),codeBlock:nn({component:H.CodeBlockView,extension:H.CodeBlock}),button:nn({component:b.ButtonView,extension:m.Button}),buttonGroup:nn({component:f.ButtonGroupView,extension:g.ButtonGroup}),table:nn({component:iS.TableView,extension:iw.Table}),tableRow:nn({component:ij,extension:iD,as:"tr"}),chart:nn({component:z.ChartView,extension:B.Chart}),graphyChart:nn({component:ec.GraphyChartView,extension:ed.GraphyChart}),mediaPlaceholder:nn({component:e5.MediaPlaceholderView,extension:e4}),image:nn({component:eZ.ImageView,extension:e$.Image}),labelGroup:nn({component:ek.LabelGroupView,extension:eS.LabelGroup}),video:nn({component:e9.VideoView,extension:e6.Video}),embed:nn({component:eH.EmbedView,extension:eF.Embed}),drawing:nn({component:ee.DrawingView,extension:J.Drawing}),diagram:nn({component:$.DiagramView,extension:G.Diagram}),gallery:nn({component:eU.GalleryView,extension:eW.Gallery,ignoreMutation:nt.ignoreDataMutation}),positionedTextbox:nn({component:tX,extension:t5}),positionedContentBox:nn({component:tX,extension:tQ}),positionedImageBox:nn({component:tJ,extension:t0}),positionedHtmlBox:nn({component:tF,extension:tH}),htmlTextItem:nn({component:tS,extension:tk}),htmlImageItem:nn({component:tC,extension:tw}),htmlContainerItem:nn({component:tf,extension:tb}),mention:nn({component:te.UserMentionNodeView,extension:te.UserMention}),cardMention:nn({component:e8.CardMentionNodeView,extension:e8.CardMention}),docMention:nn({component:tt.DocMentionNodeView,extension:e7.DocMention}),divider:nn({component:K.DividerView,extension:Z.Divider}),graphic:nn({component:eG.GraphicView,extension:eV.Graphic,stopEvent:eV.stopEvent}),gridLayout:nn({component:eM.LayoutView,extension:eE.Layout,ignoreMutation:nt.ignoreDataMutation}),grid:nn({component:em.GridView,extension:eu.Grid,ignoreMutation:nt.ignoreDataMutation}),gridItem:nn({component:eh.GridItemView,extension:ep.GridItem}),gridCell:nn({component:eI.LayoutCellView,extension:e_.LayoutCell}),label:nn({component:eA.LabelView,extension:ew.Label}),smartLayout:nn({component:iv.SmartLayoutView,extension:ib.SmartLayout}),smartLayoutCell:nn({component:iy.SmartLayoutCellView,extension:ix.SmartLayoutCell}),smartDiagram:nn({component:ip,extension:ig,ignoreMutation:()=>!0,stopEvent:im}),footnote:nn({component:el.FootnoteView,extension:eo.Footnote,ignoreMutation:()=>!0}),contributors:nn({component:V.ContributorsView,extension:U.Contributors}),tableOfContents:nn({component:O.CardTableOfContentsView,extension:R.CardTableOfContents}),toggle:nn({component:i2,extension:i4}),toggleSummary:nn({component:i0,extension:i1})}),nr=()=>({footnoteLabel:es.FootnoteLabelView,link:eL.LinkView}),no=new Set(["bullet","numbered","todo","title","heading","paragraph","image","blockquote","embed","video"]),ns=(e,t)=>{if(no.has(e.type.name)){let n={type:"card",content:[e.toJSON()]},a=ni().map(e=>t?.includes(e.name)?e instanceof i.Mark?e.extend({renderHTML:()=>["span",0]}):e.extend({renderHTML:()=>""}):e);return(0,i.generateHTML)(n||{},a)}return""},nl=(e,t)=>{if(no.has(e.type.name)){let n={type:"card",content:[e.toJSON()]},a=ni().map(e=>t?.includes(e.name)?(e instanceof i.Mark,e.extend({renderText:()=>""})):e);return(0,i.generateText)(n||{},a)}return""};var nd=e.i(6419),nc=e.i(103630),nu=e.i(457776),np=e.i(4877);let nh=e=>"gallery"===e.type.name,nm=e=>(0,i.findParentNodeClosestToPos)(e,nh),ng=e=>!!nm(e),nf=({decorations:e})=>e.some(e=>e.spec.inGallery),nb=({decorations:e})=>e.some(e=>"grid"===e.spec.layout),nx=({decorations:e})=>e.find(e=>e.spec.thumbHeight)?.spec.thumbHeight,ny=({decorations:e})=>e.find(e=>e.spec.thumbSpacing)?.spec.thumbSpacing,nv=({decorations:e})=>e.some(e=>"logo"===e.spec.layout),nC=({decorations:e})=>{let t=e.find(e=>e.spec.children)?.spec.children;return t?(0,iG.fragmentToArray)(t):[]},nw=e=>{let t=(0,nd.findNearestAnnotatableParent)(e.$from);t&&!(0,nc.isCardNode)(t.node)?r.TiptapEventBus.emit(r.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:t.pos,text:ns(e.node)}):r.TiptapEventBus.emit(r.EventBusEvent.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:e.from,text:ns(e.node)})},nS=(e,t,i,n)=>{let a,r;if(i&&!nk(i,e.state.schema))return null;let o=e.posAtCoords({left:t.clientX,top:t.clientY});if(!o)return null;let{doc:s}=e.state,{pos:l}=o,d=s.resolve(l),c=nm(d);if(c&&c.node.childCount>0)l=o.pos,(a=(0,iG.rectAtPos)(l,e))||l!=c.pos+c.node.nodeSize-1||(l-=1,a=(0,iG.rectAtPos)(l,e)),r=c.node;else{l=o.inside;try{r=s.resolve(l).nodeAfter}catch(e){return null}if(!r||!(0,eJ.isMediaNode)(r)||r==i?.content.firstChild||n)return null;let t=d.parent;if(t&&!n_(e.state.schema,t))return null;if("image"===r.type.name){let t=e.nodeDOM(l);a=t?.querySelector("[data-node-image-testid]")?.getBoundingClientRect()}else a=(0,iG.rectAtPos)(l,e)}if(!a)return null;let u=t.clientX-a.left,p=a.right-t.clientX,h=u>p?"right":"left";return("left"==h?u<0:p<0)&&!c?null:{pos:l,side:h,rect:a,node:r}},nk=(e,t)=>e.content.size>0&&t.nodes.gallery.validContent(e.content),nA=(e,t)=>{let i=e.dragging?.slice;if(!i){let e=[...t.dataTransfer.items];return e.length>0&&e.every(e=>e.type.startsWith("image/"))}return nk(i,e.state.schema)},nE=(e,t,i)=>{let n=(0,np.getUploadsFromClipboardEvent)(i,t);return(0,nu.sliceLooksLikeLink)(t)||nk(t,e)||n&&n.length>0},n_=(e,t)=>{let i=e.nodes[t.type.name];return!!i&&i.validContent(n.Fragment.fromJSON(e,[{type:"gallery",content:[]}]))},nI=(e,t)=>`calc(${.25*e}em + ${t}em)`,nM=(e,t)=>{try{let i=e();if("number"!=typeof i)return;let n=t.state.doc.nodeAt(i);if(!n)return;let r=n.lastChild?.attrs.source,o=i+n?.nodeSize-1;t.chain().insertContentAt(o,{type:"mediaPlaceholder",attrs:{source:r||"image.custom"}}).run(),setTimeout(()=>{t.commands.focus(),t.commands.setNodeSelection(o),(0,a.openMediaDrawer)()})}catch(e){console.error("(caught) [GalleryView] addImage",e)}}},755161,29110,e=>{"use strict";e.s(["HANDLE_HOVERING_ATTR",()=>S],755161);var t=e.i(755453),i=e.i(175863),n=e.i(325059);e.i(418755),e.i(899611),e.i(509510),e.i(379457),e.i(584875),e.i(337840),e.i(578014),e.i(612904),e.i(753748),e.i(713293),e.s(["HANDLE_WIDTH",()=>f,"blockAtCoords",()=>v,"getHandleOffset",()=>C,"hasContainerDragHandle",()=>w],29110);var a=e.i(24439),r=e.i(103630),o=e.i(795478),s=e.i(131339),l=e.i(85547),d=e.i(106147),c=e.i(15272),u=e.i(329860),p=e.i(896678),h=e.i(45954),m=e.i(265304),g=e.i(536913);let f=24,b=26,x=e=>(0,m.isTableCellNode)(e)||(0,h.isSmartLayoutCellNode)(e)||(0,o.isCalloutBoxNode)(e)||(0,d.isGridItemNode)(e)||(0,p.isPositionedBoxNode)(e),y=(e,i,n,r)=>{if(r&&x(r))return!1;if(!r){let e=n.state.doc.resolve(i);if((0,t.findParentNodeClosestToPos)(e,x))return!1}if(w(e)||(0,g.isToggleSummaryNode)(e)||!(0,a.isBlockNode)(e))return!1;if((0,u.isMediaNode)(e)){let e=n.state.doc.resolve(i);return!(0,c.isNodeInGallery)(e)}return!0},v=(e,i)=>{let a,r=(0,n.isRtlEnabled)()?-b:b,o=Math.max(i.posAtCoords(e)?.inside||-1,i.posAtCoords({...e,left:e.left+r})?.inside||-1,i.posAtCoords({...e,left:e.left+r+22})?.inside||-1);if(-1==o)return;try{a=i.state.doc.resolve(o)}catch(e){return}let s=a.nodeAfter,l=s&&y(s,o,i,a.parent)?{pos:o,depth:a.depth,node:s}:(0,t.findParentNodeClosestToPos)(a,e=>y(e,o,i));if(!l)return;let{pos:d,depth:c,node:u}=l,p=i.nodeDOM(d);if(!(p instanceof HTMLElement))return;let h=p,m=p.querySelector("[data-content-reference]");if(m){let e=i.posAtDOM(m,0);(u.isAtom&&e===d||e===d+1)&&(h=m)}return{pos:d,depth:c,el:h,node:u}},C=(e,t)=>{let i={left:0,right:0,top:0};if(e.isTextblock){let e=t.querySelector("[data-node-view-content]")||t;i.top=(parseInt(window.getComputedStyle(e).lineHeight)-22)/2}else if((0,r.isCardNode)(e))if((0,s.isCardCollapsed)(e)){let e=t.clientWidth*(l.NESTED_CARD_HOVER_SCALE-1)/2;i.left=-e,i.right=e}else i.left=32,i.right=32,i.top=12;else"divider"===e.type.name?i.top=(t.clientHeight-22)/2:(0,m.isTableNode)(e)&&(i.left=-22,i.right=-22);return i},w=e=>e.type.spec.containerHandle,S="data-drag-handle-hovering";new i.PluginKey("globalDragHandle")}]); //# sourceMappingURL=03fbxxjlkymsi.js.map