PageSourceSearch

https://adflex.ai/_next/static/chunks/55169.2c2fa1124f03610c.js

js adflex.ai collected 2026-10-05 11:50:10 UTC 411,528 bytes, 56 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="50fa17ea-b205-466e-be50-650d6c520b43",e._sentryDebugIdIdentifier="sentry-dbid-50fa17ea-b205-466e-be50-650d6c520b43")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21504,35299,55169],{1842:(e,t,n)=>{"use strict";n.d(t,{o:()=>E});var r=n(95155),i=n(12115),a=n(50546),o=n(34001),l=n(90842),s=n(24729),d=n(22884),c=n(55228),u=n(6234),p=n(36918),h=n(56861),m=n(59963),f=n(51265),g=n(50997),x=n(10620),v=n(14464);async function b(e,t){let n=Date.now(),r=((e=[])=>e.filter(e=>e.fontFamily).flatMap(e=>{var t,n;return(0,v.qw)("",{fontFamily:e.fontFamily,fontWeight:null!=(t=e.fontWeight)?t:"normal",fontStyle:null!=(n=e.fontStyle)?n:"normal"})}))(t.fonts).map(t=>e.loadFont(t.family,t.style,t.weight).catch(()=>{})),i=await (await fetch(t.json)).json(),a=3e3-(Date.now()-n);if(a>0){let e;await Promise.race([Promise.all(r),new Promise(t=>{e=setTimeout(t,a)})]),clearTimeout(e)}return i}var y=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let w=async e=>(0,p.kt)(e),j=(0,a.PA)(({onSelect:e,onRemove:t,font:n})=>(0,r.jsxs)("div",{style:{fontFamily:(0,h.z)(n.fontFamily)},className:"polotno-font-item pn:relative pn:mb-2.5 pn:flex pn:h-[100px] pn:cursor-pointer pn:flex-col pn:justify-center pn:rounded-md pn:bg-black/40 pn:text-center pn:text-[25px] pn:text-white pn:shadow-[0_0_5px_rgba(16,22,26,0.3)]",onClick:e,children:[n.fontFamily," text",(0,r.jsx)(f.$,{style:{position:"absolute",right:0,bottom:0},variant:"ghost",size:"icon-sm",onClick:e=>{e.stopPropagation(),t()},children:(0,r.jsx)(l.dc,{name:"action.remove"})})]})),k=e=>{var{onSelect:t}=e,n=y(e,["onSelect"]);return(0,r.jsx)(f.$,Object.assign({},n,{draggable:!0,className:"polotno-close-panel",onClick:()=>t(),onDragStart:()=>{(0,m.oc)(({x:e,y:n})=>{t({x:e,y:n})})},onDragEnd:()=>{(0,m.oc)(null)}}))},C=[{previewSize:"25px",fontSize:76,labelKey:"sidePanel.createHeader",textKey:"sidePanel.headerText"},{previewSize:"18px",fontSize:44,labelKey:"sidePanel.createSubHeader",textKey:"sidePanel.subHeaderText"},{previewSize:"14px",fontSize:30,labelKey:"sidePanel.createBody",textKey:"sidePanel.bodyText"}],E=(0,a.PA)(({store:e})=>{i.useEffect(()=>{e.loadFont("Roboto")},[]);let t=t=>{var n;let r=t.width||e.width/2,i=((null==t?void 0:t.x)||e.width/2)-r/2,a=((null==t?void 0:t.y)||e.height/2)-t.fontSize/2,o=(e.width+e.height)/2160,l=null==(n=e.activePage)?void 0:n.addElement(Object.assign(Object.assign({type:"text",fontFamily:"Roboto"},t),{x:i,y:a,width:r,fontSize:t.fontSize*o}));(0,d.Fr)()||null==l||l.toggleEditMode(!0)};i.useEffect(()=>{e.fonts.forEach(t=>e.loadFont(t.fontFamily))},[e.fonts]);let{data:n,error:a}=(0,o.u)((0,c.oF)(),u.G),[p,h]=i.useState("text"),[m,v]=i.useState(null),y=i.useRef(null),E=e=>{y.current=e,v(e)};return(0,r.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsx)(g.tU,{value:p,onValueChange:e=>h(String(e)),className:"pn:mb-3",children:(0,r.jsxs)(g.j7,{className:"pn:w-full pn:h-10",children:[(0,r.jsx)(g.Xi,{value:"text",children:(0,s.t)("sidePanel.text")}),(0,r.jsx)(g.Xi,{value:"font",children:(0,s.t)("sidePanel.myFonts")})]})}),"text"===p&&(0,r.jsxs)("div",{className:"polotno-text-panel-container pn:flex pn:flex-col",style:{height:"calc(100% - 52px)"},children:[C.map(({previewSize:e,fontSize:n,labelKey:i,textKey:a})=>(0,r.jsx)(k,{style:{fontSize:e},variant:"ghost",className:"pn:mb-[5px] pn:w-full pn:h-auto pn:min-h-[2.5rem] pn:py-1 pn:justify-start pn:font-['Roboto']",onSelect:e=>{t(Object.assign(Object.assign({},e),{fontSize:n,text:(0,s.t)(a),fontFamily:"Roboto"}))},children:(0,s.t)(i)},i)),(0,r.jsx)(x.b,{shadowEnabled:!1,images:null==n?void 0:n.items,getPreview:e=>e.preview,getImageClassName:e=>e.json.indexOf("plain")>=0?"polotno-text-preview-plain":"",isLoading:!n,error:a,getIsLoading:e=>e.json===m,onSelect:async(t,n)=>{if(y.current===t.json)return;E(t.json);let r=await b(e,t).finally(()=>{y.current===t.json&&E(null)});if(!e.activePage)return;
1let i=(e.width+e.height)/2160,a=n?n.x-r.width/2*i:e.width/2-r.width/2*i,o=n?n.y-r.height/2*i:e.height/2-r.height/2*i;e.history.transaction(()=>{let t=r.pages[0].children,n=[];t.forEach(t=>{delete t.id;let{id:r}=e.activePage.addElement(Object.assign(Object.assign({},t),{fontSize:t.fontSize*i,x:t.x*i+a,y:t.y*i+o,width:t.width*i,height:t.height*i}));n.push(r)}),e.selectElements(n)})}})]}),"font"===p&&(0,r.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"calc(100% - 62px)"},children:[(0,r.jsxs)("label",{htmlFor:"polotno-font-upload",children:[(0,r.jsxs)(f.$,{style:{width:"100%"},onClick:()=>{var e;null==(e=document.querySelector("#polotno-font-upload"))||e.click()},children:[(0,r.jsx)(l.dc,{name:"text.uploadFont"}),(0,s.t)("sidePanel.uploadFont")]}),(0,r.jsx)("input",{type:"file",accept:".ttf, .otf, .woff, .woff2, .eot",id:"polotno-font-upload",style:{display:"none"},onChange:async t=>{let{target:n}=t;for(let t of Array.from(n.files||[])){let n=await w(t),r=t.name.split(".")[0].replace(/,/g,"");e.addFont({fontFamily:r,url:n})}n.value=""}})]}),(0,r.jsx)("div",{style:{paddingTop:"20px",overflow:"auto",height:"100%"},children:e.fonts.map((n,i)=>(0,r.jsx)(j,{font:n,onSelect:()=>{t({fontSize:80,text:"Cool text",fontFamily:n.fontFamily})},onRemove:()=>{e.find(e=>("text"===e.type&&e.fontFamily===n.fontFamily&&e.set({fontFamily:"Roboto"}),!1)),e.removeFont(n.fontFamily)}},i))})]})]})})},5379:(e,t,n)=>{"use strict";n.d(t,{D:()=>d,N:()=>c});var r=n(12115),i=(e,t,n,r,i,a,o,l)=>{let s=document.documentElement,d=["light","dark"];function c(t){var n;(Array.isArray(e)?e:[e]).forEach(e=>{let n="class"===e,r=n&&a?i.map(e=>a[e]||e):i;n?(s.classList.remove(...r),s.classList.add(a&&a[t]?a[t]:t)):s.setAttribute(e,t)}),n=t,l&&d.includes(n)&&(s.style.colorScheme=n)}if(r)c(r);else try{let e=localStorage.getItem(t)||n,r=o&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;c(r)}catch(e){}},a=["light","dark"],o="(prefers-color-scheme: dark)",l=r.createContext(void 0),s={setTheme:e=>{},themes:[]},d=()=>{var e;return null!=(e=r.useContext(l))?e:s},c=e=>r.useContext(l)?r.createElement(r.Fragment,null,e.children):r.createElement(p,{...e}),u=["light","dark"],p=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:i=!0,storageKey:s="theme",themes:d=u,defaultTheme:c=n?"system":"light",attribute:p="data-theme",value:x,children:v,nonce:b,scriptProps:y})=>{let[w,j]=r.useState(()=>m(s,c)),[k,C]=r.useState(()=>"system"===w?g():w),E=x?Object.values(x):d,S=r.useCallback(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=g());let o=x?x[r]:r,l=t?f(b):null,s=document.documentElement,d=e=>{"class"===e?(s.classList.remove(...E),o&&s.classList.add(o)):e.startsWith("data-")&&(o?s.setAttribute(e,o):s.removeAttribute(e))};if(Array.isArray(p)?p.forEach(d):d(p),i){let e=a.includes(c)?c:null,t=a.includes(r)?r:e;s.style.colorScheme=t}null==l||l()},[b]),P=r.useCallback(e=>{let t="function"==typeof e?e(w):e;j(t);try{localStorage.setItem(s,t)}catch(e){}},[w]),N=r.useCallback(t=>{C(g(t)),"system"===w&&n&&!e&&S("system")},[w,e]);r.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),r.useEffect(()=>{let e=e=>{e.key===s&&(e.newValue?j(e.newValue):P(c))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[P]),r.useEffect(()=>{S(null!=e?e:w)},[e,w]);let A=r.useMemo(()=>({theme:w,setTheme:P,forcedTheme:e,resolvedTheme:"system"===w?k:w,themes:n?[...d,"system"]:d,systemTheme:n?k:void 0}),[w,P,e,k,n,d]);return r.createElement(l.Provider,{value:A},r.createElement(h,{forcedTheme:e,storageKey:s,attribute:p,enableSystem:n,enableColorScheme:i,defaultTheme:c,value:x,themes:d,nonce:b,scriptProps:y}),v)},h=r.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:a,enableColorScheme:o,defaultTheme:l,value:s,themes:d,nonce:c,scriptProps:u})=>{let p=JSON.stringify([n,t,l,e,d,s,a,o]).slice(1,-1);return r.createElement("script",{...u,suppressHydrationWarning:!0,nonce:"",dangerouslySetInnerHTML:{__html:`(${i.toString()})(${p})`}})}),m=(e,t)=>
1{let n;try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t},f=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},g=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")},6132:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},6234:(e,t,n)=>{"use strict";n.d(t,{G:()=>a,W:()=>o});var r=n(12115),i=n(67016);let a=e=>fetch(e).then(e=>e.json()),o=({defaultQuery:e="",timeout:t=1e3,getAPI:n,getSize:o=e=>e.total_pages,fetchFunc:l=a})=>{var s;let[d,c]=(0,r.useState)(e),u=(0,r.useRef)(void 0),{data:p,error:h,size:m,setSize:f,mutate:g}=(0,i.Ay)(e=>n({query:d,page:e+1}),l,{revalidateAll:!1,revalidateOnFocus:!1,revalidateFirstPage:!1}),x=!p&&!h||!!(m>0&&p&&void 0===p[m-1]),v=0===(null==(s=null==p?void 0:p[0])?void 0:s.length),b=null==p?void 0:p[p.length-1],y=v||b&&o(b)===m;return{setQuery:(0,r.useCallback)(e=>{clearTimeout(u.current),u.current=setTimeout(()=>{c(e)},t)},[t]),isLoading:x,loadMore:()=>{y||f(m+1)},isReachingEnd:y,data:null==p?void 0:p.filter(Boolean),items:(null==p?void 0:p.flat())||[],hasMore:!y,reset:g,error:h}}},6331:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowBigLeft",[["path",{d:"M18 15h-6v4l-7-7 7-7v4h6v6z",key:"lbrdak"}]])},9469:(e,t,n)=>{"use strict";n.d(t,{K:()=>s});var r=n(95155),i=n(69819),a=n(68047),o=n(63768),l=n(85341);function s({label:e,value:t,onChange:n,min:s,max:d,step:c=1,disabled:u,className:p,visible:h=!0,enabled:m,onEnabledChange:f,sliderMax:g,sliderValue:x,onCommit:v}){if(!h)return null;let b=e=>{let t=e;return"number"==typeof s&&(t=Math.max(s,t)),"number"==typeof d&&(t=Math.min(d,t)),t},y=(0,r.jsx)(l.O,{value:t,onValueChange:e=>n(b(e)),min:s,max:d,step:c,disabled:u,style:{width:64}}),w=e=>Number.isInteger(c)?Math.round(e):e,j=(0,r.jsx)(a.A,{value:[null!=x?x:t],onValueChange:e=>n(b(w((0,i.V)(e)))),onValueCommitted:v?e=>v(b(w((0,i.V)(e)))):void 0,min:s,max:null!=g?g:d,step:c,disabled:u});return(0,r.jsxs)("div",f?{className:(0,i.cn)("pn:py-1",p),children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:gap-2 pn:py-1",children:[(0,r.jsx)("label",{className:"pn:text-sm pn:font-medium",children:e}),(0,r.jsx)(o.d,{checked:!!m,onCheckedChange:f,disabled:u})]}),m&&(0,r.jsxs)("div",{className:"pn:mt-1.5 pn:flex pn:items-center pn:gap-2.5 pn:rounded-lg pn:bg-muted/60 pn:px-3 pn:py-2.5",children:[(0,r.jsx)("div",{className:"pn:flex-1",children:j}),y]})]}:{className:(0,i.cn)("pn:flex pn:flex-col pn:gap-2 pn:py-2",p),children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:gap-2",children:[(0,r.jsx)("label",{className:"pn:text-sm",children:e}),y]}),j]})}},10620:(e,t,n)=>{"use strict";n.d(t,{b:()=>c});var r=n(95155),i=n(12115),a=n(59963),o=n(24729),l=n(69819),s=n(6369);let d=({url:e,credit:t,onSelect:n,crossOrigin:i,shadowEnabled:o,itemHeight:d,className:c,onLoad:u,alt:p,pending:h})=>{let m=null==o||o;return(0,r.jsx)("div",{role:"button",onClick:()=>{n()},className:"polotno-close-panel pn:group/img-wrap pn:p-[5px] pn:w-full pn:md:[&_.credit]:opacity-0 pn:md:hover:[&_.credit]:opacity-100 pn:[&_.credit]:opacity-100",children:(0,r.jsxs)("div",{"data-shadowenabled":m,className:(0,l.cn)("pn:relative pn:overflow-hidden pn:rounded-[5px]",m?"pn:shadow-[0_0_5px_rgba(16,22,26,0.3),0_0_0_1px_rgba(16,22,26,0.12)] pn:dark:shadow-[0_0_0_1px_rgba(255,255,255,0.16)]":""),children:[(0,r.jsx)("img",{className:(0,l.cn)("pn:block pn:max-h-[300px] pn:min-h-[50px] pn:w-full pn:cursor-pointer pn:object-contain",c),style:{height:null!=d?d:"auto"},src:e,draggable:!0,loading:"lazy",crossOrigin:i,alt:p,onDragStart:()=>{(0,a.oc)(({x:e,y:t},r,i)=>{n({x:e,y:t},r,i)})},onDragEnd:()=>{(0,a.oc)(null)},onLoad:u}),h&&(0,r.jsx)("div",{className:"pn:absolute pn:inset-0 pn:flex pn:items-center pn:justify-center pn:bg-background/70",children:(0,r.jsx)(s.y,{className:"pn:size-5 pn:text-muted-foreground"})}),t&&(0,r.jsx)("div",{className:"credit pn:absolute pn:bottom-0 pn:left-0 pn:w-full pn:bg-gradient-to-b pn:from-transparent pn:via-black/40 pn:to-black/60 pn:p-[3px] pn:pt-[10px] pn:text-center pn:text-[10px] pn:text-white pn:[&_a]:text-white pn:[&_a]:underline",children:t})]})})}
1,c=({images:e,onSelect:t,isLoading:n,getPreview:a,loadMore:l,getCredit:c,getAlt:u,getImageClassName:p,getIsLoading:h,rowsNumber:m,crossOrigin:f="anonymous",shadowEnabled:g,itemHeight:x,error:v,hideNoResults:b=!1})=>{let y=m||2,w=i.useRef(null),j=[];for(var k=0;k<y;k++)j.push((e||[]).filter((e,t)=>t%y===k));let C=i.useRef(null),E=()=>{var t;let r=w.current,i=!!r&&r.scrollHeight>r.offsetHeight+5,a=e&&e.length,o=Array.from(null!=(t=null==r?void 0:r.querySelectorAll("img"))?t:[]).every(e=>e.complete);!i&&l&&!n&&a&&o&&(C.current||(C.current=window.setTimeout(()=>{C.current=null,l&&l()},100)))},S=()=>{E()};return i.useEffect(()=>(E(),()=>{null!==C.current&&window.clearTimeout(C.current),C.current=null}),[e&&e.length,n]),(0,r.jsxs)("div",{onScroll:e=>{let t=e.target.scrollHeight-e.target.scrollTop-e.target.offsetHeight;l&&!n&&t<200&&l()},ref:w,className:"pn:h-full pn:overflow-auto",children:[j.map((e,n)=>(0,r.jsx)("div",{className:"pn:float-left",style:{width:100/y+"%"},children:e.map((e,n)=>(0,r.jsx)(d,{url:a(e),onSelect:(n,r,i)=>t(e,n,r,i),credit:c&&c(e),crossOrigin:f,shadowEnabled:g,itemHeight:x,className:p&&p(e),onLoad:S,alt:u&&u(e)||"",pending:null==h?void 0:h(e)},n))},n)),n&&(0,r.jsx)("div",{className:"pn:clear-both pn:flex pn:justify-center pn:p-[30px]",children:(0,r.jsx)(s.y,{className:"pn:size-5 pn:text-muted-foreground"})}),!n&&(!e||!e.length)&&!v&&!b&&(0,r.jsx)("p",{className:"pn:p-[30px] pn:text-center",children:(0,o.t)("sidePanel.noResults")}),v&&(0,r.jsx)("p",{className:"pn:clear-both pn:p-[30px] pn:text-center",children:(0,o.t)("sidePanel.error")})]})}},10718:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var a=typeof n;if("string"===a||"number"===a)e.push(n);else if(Array.isArray(n)){if(n.length){var o=i.apply(null,n);o&&e.push(o)}}else if("object"===a)if(n.toString===Object.prototype.toString)for(var l in n)r.call(n,l)&&n[l]&&e.push(l);else e.push(n.toString())}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0===(n=(function(){return i}).apply(t,[]))||(e.exports=n)}()},12438:(e,t,n)=>{"use strict";n.d(t,{TS:()=>i,ez:()=>a,vn:()=>r});let r=4,i=e=>0===e.button&&e.isPrimary,a=(e,{slopX:t=0,onMove:n,onEnd:r})=>{e.preventDefault();let{pointerId:i}=e,a=e.clientX,o=0===t,l=!1,s=e=>{if(e.pointerId===i){if(!o){if(Math.abs(e.clientX-a)<t)return;o=!0}l=!0,n(e)}},d=e=>{e.pointerId===i&&(window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),null==r||r({moved:l,cancelled:"pointercancel"===e.type}))};window.addEventListener("pointermove",s),window.addEventListener("pointerup",d),window.addEventListener("pointercancel",d)}},13905:(e,t,n)=>{"use strict";n.d(t,{sk:()=>Z,qd:()=>Y,Ay:()=>G});var r,i=n(95155),a=n(12115),o=n(50546),l=n(24729),s=n(82297),d=n(27024),c=n(90842),u=n(73363),p=n(51265),h=n(80039),m=n(85341),f=n(69819),g=n(63927),x=n(41760),v=n(50785),b=n(45881),y=n(21383),w=(r=function(e,t){return e&&(0,v.A)(e,t,b.A)},function(e,t){if(null==e)return e;if(!(0,y.A)(e))return r(e,t);for(var n=e.length,i=-1,a=Object(e);++i<n&&!1!==t(a[i],i,a););return e}),j=n(92729),k=n(64536);let C=function(e,t){return((0,k.A)(e)?x.A:w)(e,"function"==typeof t?t:j.A)};var E=n(50205);let S=(e,t)=>{let n=e.hex?(0,E.A)(e.hex):(0,E.A)(e),r=n.toHsl(),i=n.toHsv(),a=n.toRgb(),o=n.toHex();return 0===r.s&&(r.h=t||0,i.h=t||0),{hsl:r,hex:"000000"===o&&0===a.a?"transparent":"#"+o,rgb:a,hsv:i,oldHue:e.h||t||r.h,source:e.source}},P={},N=((e,t,n,r)=>{let i=e+"-"+t+"-"+n+(r?"-server":"");if(P[i])return P[i];let a=((e,t,n,r)=>{if("undefined"==typeof document&&!r)return null;let i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;let a=i.getContext("2d");return a?(a.fillStyle=e,a.fillRect(0,0,i.width,i.height),a.fillStyle=t,a.fillRect(0,0,n,n),a.translate(n,n),a.fillRect(0,0,n,n),i.toDataURL()):null})(e,t,n,r);return P[i]=a,a})("transparent","rgba(0,0,0,.08)",8)||void 0,A=N?`url(${N})`:void 0;function M({hsl:e,hsv:t,onChange:n}){let r=a.useRef(null),o=(0,g._)(t=>{r.current&&n(((e,t,n)=>{let{width:r,height:i}=n.getBoundingClientRect(),a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,o="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,l=a-(n.getBoundingClientRect().left+window.pageXOffset);l<0?l=0:l>r&&(l=r);let s=o-(n.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>i&&(s=i);let d=l/r,c=1-s/i;return{h:t.h,s:d,v:c,a:t.a,source:"hsv"}})(t,e,r.current))}),l=(0,g._)(()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l)});return a.useEffect(()=>()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",l)},[o,l]),(0,i.jsxs)("div",{ref:r,className:"pn:relative pn:aspect-[5/3] pn:w-full pn:cursor-crosshair pn:touch-none pn:overflow-hidden pn:rounded-sm pn:ring-1 pn:ring-inset pn:ring-black/15 pn:dark:ring-white/15",style:{background:`hsl(${e.h}, 100%, 50%)`},onMouseDown:e=>{o(e),window.addEventListener("mousemove",o),window.addEventListener("mouseup",l)},onTouchStart:e=>o(e),onTouchMove:e=>o(e),children:[(0,i.jsx)("div",{className:"pn:absolute pn:inset-0",style:{background:"linear-gradient(to right, #fff, rgba(255,255,255,0))"},children:(0,i.jsx)("div",{className:"pn:absolute pn:inset-0",style:{background:"linear-gradient(to top, #000, rgba(0,0,0,0))"}})}),(0,i.jsx)("div",{className:"pn:pointer-events-none pn:absolute pn:size-3 pn:-translate-x-1/2 pn:-translate-y-1/2 pn:rounded-full pn:border-2 pn:border-white pn:shadow-[0_0_0_1px_rgba(0,0,0,0.3)]",style:{left:100*t.s+"%",top:-100*t.v+100+"%"}})]})}function O({ariaLabel:e,style:t,pointerLeft:n,calc:r,onChange:o,children:l}){let s=a.useRef(null),d=(0,g._)(e=>{if(s.current){let t=r(e,s.current);t&&o(t)}}),c=(0,g._)(()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",c)});return a.useEffect(()=>()=>{window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",c)},[d,c]),(0,i.jsxs)("div",{ref:s,role:"slider","aria-label":e,className:"pn:relative pn:h-2.5 pn:w-full pn:cursor-pointer pn:touch-none pn:rounded-full pn:ring-1 pn:ring-inset pn:ring-black/15 pn:dark:ring-white/15",style:t,onMouseDown:e=>{d(e),window.addEventListener("mousemove",d),window.addEventListener("mouseup",c)},onTouchStart:e=>d(e),onTouchMove:e=>d(e),children:[l,(0,i.jsx)("div",{className:"pn:pointer-events-none pn:absolute pn:top-1/2 pn:size-3.5 pn:-translate-x-1/2 pn:-translate-y-1/2 pn:rounded-full pn:border-2 pn:border-white pn:bg-transparent pn:shadow-[0_0_0_1px_rgba(0,0,0,0.4)]",style:{left:100*Math.min(1,Math.max(0,n))+"%"}})]})}function T({hsl:e,onChange:t}){return(0,i.jsx)(O,{ariaLabel:"Hue",style:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"},pointerLeft:e.h/360,calc:(t,n)=>{let r=((e,t,n,r)=>{let i=r.clientWidth,a=r.clientHeight,o="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=o-(r.getBoundingClientRect().left+window.pageXOffset),d=l-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){let e;if(e=d<0?359:d>a?0:360*(-100*d/a+100)/100,n.h!==e)return{h:e,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{let e;if(e=s<0?0:s>i?359:100*s/i*360/100,n.h!==e)return{h:e,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null})(t,"horizontal",e,n);return r&&r.h>=360&&(r.h=359),r},onChange:t})}function R({hsl:e,rgb:t,onChange:n}){let r=`linear-gradient(to right, rgba(${t.r},${t.g},${t.b},0), rgba(${t.r},${t.g},${t.b}
1,1))`;return(0,i.jsx)(O,{ariaLabel:"Alpha",style:{background:A},pointerLeft:t.a,calc:(n,r)=>((e,t,n,r,i)=>{let a=i.clientWidth,o=i.clientHeight,l="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,d=l-(i.getBoundingClientRect().left+window.pageXOffset),c=s-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){let e;if(e=c<0?0:c>o?1:Math.round(100*c/o)/100,t.a!==e)return{h:t.h,s:t.s,l:t.l,a:e,source:"rgb"}}else{let e;if(r!==(e=d<0?0:d>a?1:Math.round(100*d/a)/100))return{h:t.h,s:t.s,l:t.l,a:e,source:"rgb"}}return null})(n,e,"horizontal",t.a,r),onChange:n,children:(0,i.jsx)("div",{className:"pn:absolute pn:inset-0 pn:rounded-full",style:{background:r}})})}function _({hex:e,onChange:t}){let[n,r]=a.useState(e.replace("#",""));return a.useEffect(()=>{r(e.replace("#",""))},[e]),(0,i.jsx)(h.p,{value:n,spellCheck:!1,onChange:e=>{let n=e.target.value.replace("#","");r(n),(e=>{if("transparent"===e)return!0;let t=+("#"===String(e).charAt(0));return e.length!==4+t&&e.length<7+t&&(0,E.A)(e).isValid()})("#"+n)&&t({hex:"#"+n,source:"hex"})},className:"pn:h-7 pn:w-full pn:text-center pn:uppercase",style:{fontSize:11,paddingLeft:4,paddingRight:4}})}function z({children:e}){return(0,i.jsx)("span",{className:"pn:text-[11px] pn:text-muted-foreground",children:e})}function I({rgb:e,hsl:t,hex:n,disableAlpha:r,onChange:a}){let o={stepper:!1,style:{fontSize:11,paddingLeft:3,paddingRight:3}};return(0,i.jsxs)("div",{className:"pn:grid pn:items-end pn:gap-1.5 pn:pt-3",style:{gridTemplateColumns:"2fr "+(r?"1fr 1fr 1fr":"1fr 1fr 1fr 1fr")},children:[(0,i.jsxs)("div",{className:"pn:flex pn:min-w-0 pn:flex-col pn:items-center pn:gap-1",children:[(0,i.jsx)(_,{hex:n,onChange:a}),(0,i.jsx)(z,{children:"Hex"})]}),["r","g","b"].map(t=>(0,i.jsxs)("div",{className:"pn:flex pn:min-w-0 pn:flex-col pn:items-center pn:gap-1",children:[(0,i.jsx)(m.O,Object.assign({value:e[t],min:0,max:255,onValueChange:n=>a(Object.assign(Object.assign({},e),{[t]:n,source:"rgb"})),className:"pn:h-7 pn:w-full pn:text-center"},o)),(0,i.jsx)(z,{children:t.toUpperCase()})]},t)),!r&&(0,i.jsxs)("div",{className:"pn:flex pn:min-w-0 pn:flex-col pn:items-center pn:gap-1",children:[(0,i.jsx)(m.O,Object.assign({value:Math.round(100*e.a),min:0,max:100,onValueChange:e=>a({h:t.h,s:t.s,l:t.l,a:Math.min(100,Math.max(0,e))/100,source:"rgb"}),className:"pn:h-7 pn:w-full pn:text-center"},o)),(0,i.jsx)(z,{children:"A"})]})]})}function D({colors:e,onChange:t}){return e&&e.length?(0,i.jsx)("div",{className:"pn:mt-3 pn:grid pn:grid-cols-8 pn:gap-1.5 pn:border-t pn:border-border pn:pt-3",children:e.map(e=>{let n="string"==typeof e?{color:e}:e;return(0,i.jsx)("button",{type:"button",title:n.title||n.color,"aria-label":n.title||n.color,onMouseDown:e=>e.preventDefault(),onClick:()=>t({hex:n.color,source:"hex"}),className:"pn:aspect-square pn:w-full pn:cursor-pointer pn:rounded-sm pn:ring-1 pn:ring-inset pn:ring-black/15 pn:dark:ring-white/15",style:{background:n.color}},n.color+(n.title||""))})}):null}function F({rgb:e}){return(0,i.jsx)("div",{className:"pn:relative pn:size-7 pn:shrink-0 pn:self-center pn:overflow-hidden pn:rounded-sm",style:{background:A},children:(0,i.jsx)("div",{className:"pn:absolute pn:inset-0 pn:rounded-sm pn:ring-1 pn:ring-inset pn:ring-black/20 pn:dark:ring-white/20",style:{background:`rgba(${e.r},${e.g},${e.b},${e.a})`}})})}let L=({color:e,onChange:t,presetColors:n=[],disableAlpha:r=!1,className:o=""})=>{let[l,s]=a.useState(()=>S(e,0)),d=a.useRef(l.oldHue);a.useEffect(()=>{let t=S(e,d.current);d.current=t.oldHue,s(e=>e.rgb.r===t.rgb.r&&e.rgb.g===t.rgb.g&&e.rgb.b===t.rgb.b&&Math.round(255*e.rgb.a)===Math.round(255*t.rgb.a)?e:t)},[e]);let{rgb:h,hsl:m,hsv:x,hex:v}=l,b=(0,g._)((e,n)=>{var r;if(!(e=>{let t=0,n=0;return C(["r","g","b","a","h","s","l","v"],r=>{e[r]&&(t+=1,isNaN(e[r])||(n+=1),"s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1)}),t===n&&e})(e))return;let i=S(e,null!=(r=e.h)?r:d.current);d.current=i.oldHue,s(i),t(i,n)}),y=(0,g._)((e,t)=>{b(0===h.a?Object.assign(Object.assign({},e),{a:1}):e,t)}),[w,j]=a.useState(!1),k=a.useRef(null),E=(0,g._)(()=>{k.current&&(k.current.destroy(),k.current=null)}),P=(0,g._)(e=>{var t;if(w){let n=null==(t=k.current)?void 0:t.fill();n&&b(u.A.Util.colorToRGBA(n)),E(),function(e){var t;let n=e.target;for(;n;){if(null==(t=n.classList)?void 0:t.contains("color-picker-button"))return!0;n=n.parentElement}return!1}(e)||j(!1),e.stopPropagation(),e.stopImmediatePropagation()}}),N=(0,g._)(e=>{if(!w)return;let t=u.A.stages.find(t=>{var n;let r=null==(n=t.getContent().parentElement)?void 0:n.parentElement;if(!r)return!1;let i=r.getBoundingClientRect();return i.left<e.clientX&&i.left+i.width>e.clientX&&i.top<e.clientY&&i.top+i.height>e.clientY});if(!t)return void E();let n=t.getContent().getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=t.children[0],o=a.getNativeCanvasElement(),l=a.getCanvas().getPixelRatio(),{data:s}=o.getContext("2d").getImageData(r*l,i*l,1,1),d=t.findOne(".line-guides");d.findOne(".picker")||(k.current&&k.current.destroy(),k.current=ne
1w u.A.Circle({name:"picker",radius:14,stroke:"black",strokeWidth:1}),d.add(k.current)),k.current.setAbsolutePosition({x:r-15,y:i-15}),k.current.fill("rgb("+s[0]+","+s[1]+","+s[2]+")")});return a.useEffect(()=>(window.addEventListener("mousemove",N),window.addEventListener("mousedown",P,!0),window.addEventListener("touchstart",P,!0),()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mousedown",P,!0),window.removeEventListener("touchstart",P,!0),E()}),[N,P,E]),a.useEffect(()=>{w||E()},[w,E]),a.useEffect(()=>(w&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor=""}),[w]),(0,i.jsxs)("div",{className:(0,f.cn)("polotno-color-picker pn:flex pn:w-full pn:flex-col",o),onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:[(0,i.jsx)(M,{hsl:m,hsv:x,onChange:y}),(0,i.jsxs)("div",{className:"pn:flex pn:items-stretch pn:gap-2 pn:pt-3",children:[(0,i.jsxs)("div",{className:"pn:flex pn:flex-1 pn:flex-col pn:justify-center pn:gap-2",style:{paddingLeft:8,paddingRight:8},children:[(0,i.jsx)(T,{hsl:m,onChange:y}),!r&&(0,i.jsx)(R,{hsl:m,rgb:h,onChange:b})]}),(0,i.jsx)(F,{rgb:h}),(0,i.jsx)(p.$,{variant:"ghost",size:"icon-sm",className:(0,f.cn)("color-picker-button pn:size-7 pn:self-center",w&&"pn:bg-muted"),onClickCapture:e=>{j(e=>!e),e.stopPropagation()},children:(0,i.jsx)(c.dc,{name:"action.eyeDropper",className:"pn:size-4"})})]}),(0,i.jsx)(I,{rgb:h,hsl:m,hex:v,disableAlpha:r,onChange:b}),(0,i.jsx)(D,{colors:n,onChange:b})]})};var B=n(9469),$=n(16548),W=n(50997),V=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let H=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"].reverse(),q=e=>{var{style:t,color:n,onChange:r}=e,o=V(e,["style","color","onChange"]);let[l,s]=a.useState(n);a.useEffect(()=>{s(n)},[n]);let d=a.useRef(void 0),c=a.useRef(void 0);return(0,i.jsx)("div",{className:"pn-color-picker-solid",style:t,onMouseDown:e=>{"INPUT"!==e.target.tagName&&e.preventDefault()},children:(0,i.jsx)(L,Object.assign({color:l},o,{onChange:e=>{let{r:t,g:n,b:i,a:a}=e.rgb,o=`rgba(${t},${n},${i},${a})`;s(o),c.current=o,d.current||(d.current=window.setTimeout(()=>{d.current=0,r(c.current||o)},50))}}))})},K=e=>e.map(e=>`${e.color} ${100*e.offset}%`).join(","),U=({value:e,onChange:t,preset:n})=>{let{rotation:r,stops:o}=(0,s.H0)(e),d=a.useRef(o);d.current=o;let c=a.useRef(r);c.current=r;let[u,p]=a.useState(0),[h,m]=a.useState(-1),f=a.useRef(null),g=a.useRef(!1),x=e=>{g.current=!0};return a.useEffect(()=>{h>-1&&(d.current.splice(h,1),t(`linear-gradient(${c.current}deg, ${K(d.current)})`),m(-1))},[h]),a.useEffect(()=>{var e;null==(e=f.current)||e.focus()},[]),a.useEffect(()=>{let e=e=>{if(g.current){let n=f.current.getBoundingClientRect(),r=e.clientX-n.left,i=r/n.width;if(o.length>2&&(i<-.5||i>1.5))return p(0),g.current=!1,void m(u);let a=Math.min(1,Math.max(0,r/n.width)),l=[...d.current];l[u].offset=a,t(`linear-gradient(${c.current}deg, ${K(l)})`)}},n=()=>{g.current=!1};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n)}},[u,d]),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{style:{width:"calc(100% - 35px)",height:"60px",position:"relative"},children:[(0,i.jsx)("div",{ref:f,tabIndex:0,style:{position:"absolute",top:0,left:0,width:"100%",marginLeft:"15px",height:"100%",zIndex:0,outline:"none"},onKeyDownCapture:e=>{"Backspace"===e.key&&(e.preventDefault(),e.stopPropagation(),d.current.length<=2||(d.current.splice(u,1),u>=d.current.length&&p(d.current.length-1),t(`linear-gradient(${c.current}deg, ${K(d.current)})`)))},onMouseDown:e=>{let n=e.currentTarget.getBoundingClientRect(),i=Math.min(1,Math.max(0,(e.clientX-n.left)/n.width)),a=o[0].color;o.push({color:a,offset:i}),o.sort((e,t)=>
1e.offset-t.offset),p(o.findIndex(e=>e.offset===i)),x(),t(`linear-gradient(${r}deg, ${K(o)})`)}}),o.map(({offset:e,color:t},n)=>(0,i.jsx)("div",{style:{position:"absolute",top:"10px",left:100*e+"%",border:n===u?"2px solid rgb(0, 161, 255)":"2px solid rgb(0, 0, 0, 0)",padding:"2px"},onMouseDown:e=>{e.stopPropagation(),p(n),x()},children:(0,i.jsx)(Y,{background:t,style:{margin:0}})},n))]}),(0,i.jsx)("div",{style:{width:"calc(100% - 30px)",height:"10px",marginLeft:"15px",background:`linear-gradient(90deg,${K(o)})`}}),(0,i.jsx)("div",{style:{padding:"10px"},children:(0,i.jsx)(B.K,{label:(0,l.t)("toolbar.colorPicker.angle"),value:r,min:0,max:360,onChange:e=>{t(`linear-gradient(${e}deg,${K(o)})`)}})}),(0,i.jsx)(q,{color:o[u].color,presetColors:n,onChange:e=>{let n=[...o];n[u].color=e,t(`linear-gradient(${r}deg, ${K(n)})`)}})]})},X=(0,o.PA)(({value:e,onChange:t,preset:n,store:r})=>{let[o,d]=a.useState((0,s.bn)(e)?"gradient":"solid");return(0,i.jsx)("div",{style:{padding:"5px"},children:(0,i.jsxs)(W.tU,{value:o,onValueChange:e=>d(e),className:"pn:w-full",children:[(0,i.jsxs)(W.j7,{className:"pn:flex pn:w-full pn:flex-row",children:[(0,i.jsx)(W.Xi,{value:"solid",className:"pn:flex-1",children:(0,l.t)("toolbar.colorPicker.solid")}),(0,i.jsx)(W.Xi,{value:"gradient",className:"pn:flex-1",children:(0,l.t)("toolbar.colorPicker.linear")})]}),(0,i.jsx)(W.av,{value:"solid",className:"pn:w-full",children:(0,i.jsx)(q,{color:e,onChange:t,presetColors:n,style:{padding:"0"}})}),(0,i.jsx)(W.av,{value:"gradient",className:"ember-panel pn:w-full",children:(0,i.jsx)(U,{value:e,onChange:t,store:r,preset:n})})]})})}),Y=a.forwardRef(function(e,t){var{size:n=30,background:r,style:a={},className:o,children:l=null}=e,s=V(e,["size","background","style","className","children"]);let d="string"==typeof r?r:"transparent",c=d.includes("gradient")?d:`linear-gradient(${d}, ${d}), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 8 8'%3E%3Cg fill='rgba(112, 112, 116, 1)' fill-opacity='1'%3E%3Cpath fill-rule='evenodd' d='M0 0h4v4H0V0zm4 4h4v4H4V4z'/%3E%3C/g%3E%3C/svg%3E")`;return(0,i.jsx)("div",Object.assign({ref:t,role:"button",tabIndex:0,"aria-label":"Pick color",onMouseDown:e=>e.preventDefault(),className:(0,f.cn)("pn:flex pn:cursor-pointer pn:items-center pn:justify-center pn:overflow-hidden pn:rounded-md pn:border pn:border-foreground
1/30",o),style:Object.assign({width:n+"px",height:n+"px",backgroundImage:c},a)},s,{children:l}))}),Z=({value:e,onChange:t,size:n,store:r,gradientEnabled:o,children:l,style:c,onOpen:u,onClose:p})=>{let h=(e=>{let t=(e=>{let t=[];e.pages.forEach(e=>{e.children.forEach(e=>{e.shadowEnabled&&t.push(e.shadowColor),"text"===e.type&&(t.push(e.fill),e.backgroundEnabled&&t.push(e.backgroundColor),e.strokeWidth&&t.push(e.stroke)),"svg"===e.type&&t.push(...e.colorsReplace.values()),"figure"===e.type&&(t.push(e.fill),e.strokeWidth&&t.push(e.stroke)),"line"===e.type&&t.push(e.color)})});let n=[];return t.forEach(e=>{if((0,s.bn)(e)){let{stops:t}=(0,s.H0)(e);n.push(...t.map(e=>e.color))}else n.push(e)}),[...new Set(n)]})(e).slice(0,8).filter(e=>!H.find(t=>(0,d.b)(t,e)));return t.concat(H.slice(0,16-t.length).reverse())})(r),[m,f]=a.useState(!1);return(0,i.jsxs)($.AM,{open:m,onOpenChange:e=>{f(e),e?null==u||u():null==p||p()},children:[(0,i.jsx)($.Wv,{nativeButton:!1,render:(0,i.jsx)(Y,{size:n,background:e,style:c,children:l})}),(0,i.jsx)($.hl,{className:"pn:w-[280px] pn:p-0",initialFocus:!1,children:o?(0,i.jsx)(X,{preset:h,value:e,onChange:t,store:r}):(0,i.jsx)("div",{style:{padding:"5px"},children:(0,i.jsx)(q,{color:e,onChange:t,presetColors:h})})})]})},G=Z}
1,18514:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},20063:(e,t,n)=>{"use strict";var r=n(47260);n.o(r,"notFound")&&n.d(t,{notFound:function(){return r.notFound}}),n.o(r,"useParams")&&n.d(t,{useParams:function(){return r.useParams}}),n.o(r,"usePathname")&&n.d(t,{usePathname:function(){return r.usePathname}}),n.o(r,"useRouter")&&n.d(t,{useRouter:function(){return r.useRouter}}),n.o(r,"useSearchParams")&&n.d(t,{useSearchParams:function(){return r.useSearchParams}})},21113:()=>{},21190:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])},24033:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},25667:(e,t,n)=>{"use strict";n.d(t,{B8:()=>N,UC:()=>M,bL:()=>P,l9:()=>A});var r=n(12115),i=n(92556),a=n(3468),o=n(87308),l=n(76842),s=n(97602),d=n(66218),c=n(59478),u=n(68946),p=n(95155),h=Object.defineProperty,m=(e,t)=>h(e,"name",{value:t,configurable:!0}),f="Tabs",[g,x]=(0,a.A)(f,[o.RG]),v=(0,o.RG)(),[b,y]=g(f),w=r.forwardRef(m(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o="horizontal",dir:l,activationMode:h="automatic",...m}=e,g=(0,d.j)(l),[x,v]=(0,c.i)({prop:r,onChange:i,defaultProp:a??"",caller:f});return(0,p.jsx)(b,{scope:n,baseId:(0,u.B)(),value:x,onValueChange:v,orientation:o,dir:g,activationMode:h,children:(0,p.jsx)(s.sG.div,{dir:g,"data-orientation":o,...m,ref:t})})},"Tabs")),j=r.forwardRef(m(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=y("TabsList",n),l=v(n);return(0,p.jsx)(o.bL,{asChild:!0,...l,orientation:a.orientation,dir:a.dir,loop:r,children:(0,p.jsx)(s.sG.div,{role:"tablist","aria-orientation":a.orientation,...i,ref:t})})},"TabsList")),k=r.forwardRef(m(function(e,t){let{__scopeTabs:n,value:r,disabled:a=!1,...l}=e,d=y("TabsTrigger",n),c=v(n),u=E(d.baseId,r),h=S(d.baseId,r),m=r===d.value;return(0,p.jsx)(o.q7,{asChild:!0,...c,focusable:!a,active:m,children:(0,p.jsx)(s.sG.button,{type:"button",role:"tab","aria-selected":m,"aria-controls":h,"data-state":m?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...l,ref:t,onMouseDown:(0,i.mK)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():d.onValueChange(r)}),onKeyDown:(0,i.mK)(e.onKeyDown,e=>{!a&&e.target===e.currentTarget&&[" ","Enter"].includes(e.key)&&d.onValueChange(r)}),onFocus:(0,i.mK)(e.onFocus,()=>{let e="manual"!==d.activationMode;m||a||!e||d.onValueChange(r)})})})},"TabsTrigger")),C=r.forwardRef(m(function(e,t){let{__scopeTabs:n,value:i,forceMount:a,children:o,...d}=e,c=y("TabsContent",n),u=E(c.baseId,i),h=S(c.baseId,i),m=i===c.value,f=r.useRef(m);return r.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,p.jsx)(l.C,{present:a||m,children:({present:n})=>(0,p.jsx)(s.sG.div,{"data-state":m?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":u,hidden:!n,id:h,tabIndex:0,...d,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:n&&o})})},"TabsContent"));function E(e,t){return`${e}-trigger-${t}`}function S(e,t){return`${e}-content-${t}`}m(E,"makeTriggerId"),m(S,"makeContentId");var P=w,N=j,A=k,M=C},27599:(e,t,n)=>{"use strict";n.d(t,{bL:()=>y,zi:()=>w});var r=n(12115),i=n(92556),a=n(94446),o=n(3468),l=n(59478),s=n(84288),d=n(97602),c=n(95155),u=Object.defineProperty,p=(e,t)=>u(e,"name",{value:t,configurable:!0}),h="Switch",[m,f]=(0,o.A)(h),[g,x]=m(h);function v(e){let{__scopeSwitch:t,checked:n,children:i,defaultChecked:a,disabled:o,form:s,name:d,onCheckedChange:u,required:p,value:m="on",internal_do_not_use_render:f}=e,[x,v]=(0,l.i)({prop:n,defaultProp:a??!1,onChange:u,caller:h}),[b,y]=r.useState(null),[w,j]=r.useState(null),C=r.useRef(!1),[E,S]=r.useReducer(e=>e+1,0),P=!b||!!s||!!b.closest("form"),N={checked:x,setChecked:v,disabled:o,control:b,setControl:y,name:d,form:s,value:m,hasConsumerStoppedPropagationRef:C,userInteractionCount:E,onUserInteraction:S,required:p,defaultChecked:a,isFormControl:P,bubbleInput:w,setBubbleInput:j};return(0,c.jsx)(g,{scope:t,...N,children:k(f)?f(N):i})}p(v,"SwitchProvider");var b=r.forwardRef(p(function({__scopeSwitch:e,onClick:t,...n},o){let{control:l,form:s,value:u,disabled:h,checked:m,required:f,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:b,onUserInteraction:y,isFormControl:w,bubbleInput:j}=x("SwitchTrigger",e),k=(0,a.s)(o,g),E=r.useRef(m);return r.useEffect(()=>{let e=s?l?.ownerDocument.getElementById(s):l?.form;if(e instanceof HTMLFormElement){let t=p(()=>v(E.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[l,s,v]),(0,c.jsx)(d.sG.button,{type:"button",role:"switch","aria-checked":m,"aria-required":f,"data-state":C(m),"data-disabled":h?"":void 0,disabled:h,value:u,...n,ref:k,onClick:(0,i.mK)(t,e=>{y(),v(e=>!e),j&&w&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())})})},"SwitchTrigger")),y=r.forwardRef(p(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:l,value:s,onCheckedChange:d,form:u,...p}=e;return(0,c.jsx)(v,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:l,required:o,onCheckedChange:d,name:r,form:u,value:s,internal_do_not_use_render:({isFormControl:e})=>(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(b,{...p,ref:t,__scopeSwitch:n}),e&&(0,c.jsx)(j,{__scopeSwitch:n})]})})},"Switch")),w=r.forwardRef(p(function(e,t){let{__scopeSwitch:n,...r}=e,i=x("SwitchThumb",n);return(0,c.jsx)(d.sG.span,{"data-state":C(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})},"SwitchThumb")),j=r.forwardRef(p(function({__scopeSwitch:e,onClick:t,...n},o){let{control:l,hasConsumerStoppedPropagationRef:u,userInteractionCount:p,checked:h,defaultChecked:m,required:f,disabled:g,name:v,value:b,form:y,bubbleInput:w,setBubbleInput:j}=x("SwitchBubbleInput",e),k=(0,a.s)(o,j),C=(0,s.X)(l),E=r.useRef(!1),S=r.useRef(h),P=r.useRef(p);r.useEffect(()=>{if(!w)return;let e=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set,t=p!==P.current;P.current=p;let n=S.current!==h;S.current=h;let r=!(t&&u.current);if(n&&e){E.current=!t;let n=new Event("click",{bubbles:r});e.call(w,h),w.dispatchEvent(n),E.current=!1}},[w,h,u,p]);let N=r.useRef(h);return(0,c.jsx)(d.sG.input,{type:"checkbox","aria-hidden":!0,defaultChecked:m??N.current,required:f,disabled:g,name:v,value:b,form:y,...n,tabIndex:-1,ref:k,onClick:(0,i.mK)(t,e=>{E.current&&e.stopPropagation()}),style:{...n.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})}
1,"SwitchBubbleInput"));function k(e){return"function"==typeof e}function C(e){return e?"checked":"unchecked"}p(k,"isFunction"),p(C,"getState")},27937:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},29135:(e,t,n)=>{"use strict";n.d(t,{M7:()=>t3});var r=n(95155),i=n(12115),a=n(50546),o=n(9635),l=n(9475),s=n(45954),d=n(72094),c=n(69819),u=n(90842),p=n(51265);let h=(0,a.PA)(({store:e})=>(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:pr-[10px]",children:[(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.history.undo()},disabled:!e.history.canUndo,"aria-label":"Undo",children:(0,r.jsx)(u.dc,{name:"action.undo",className:"pn:size-4"})}),(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.history.redo()},disabled:!e.history.canRedo,"aria-label":"Redo",children:(0,r.jsx)(u.dc,{name:"action.redo",className:"pn:size-4"})})]})),m="u">typeof window?i.useLayoutEffect:i.useEffect;function f(e){if(void 0!==e)switch(typeof e){case"number":return e;case"string":if(e.endsWith("px"))return parseFloat(e)}}let g=null;function x({containerElement:e,direction:t,isRtl:n,scrollOffset:r}){if("horizontal"===t&&n)switch(function(e=!1){if(null===g||e){let e=document.createElement("div"),t=e.style;t.width="50px",t.height="50px",t.overflow="scroll",t.direction="rtl";let n=document.createElement("div"),r=n.style;return r.width="100px",r.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?g="positive-descending":(e.scrollLeft=1,g=0===e.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(e),g}return g}()){case"negative":return-r;case"positive-descending":if(e){let{clientWidth:t,scrollLeft:n,scrollWidth:r}=e;return r-t-n}}return r}function v(e,t="Assertion error"){if(!e)throw console.error(t),Error(t)}function b(e,t){if(e===t)return!0;if(!!e!=!!t||(v(void 0!==e),v(void 0!==t),Object.keys(e).length!==Object.keys(t).length))return!1;for(let n in e)if(!Object.is(t[n],e[n]))return!1;return!0}function y({cachedBounds:e,itemCount:t,itemSize:n}){if(0===t)return 0;if("number"==typeof n)return t*n;{let n=e.get(0===e.size?0:e.size-1);return v(void 0!==n,"Unexpected bounds cache miss"),t*((n.scrollOffset+n.size)/e.size)}}function w({cachedBounds:e,containerScrollOffset:t,containerSize:n,itemCount:r,overscanCount:i}){let a=r-1,o=0,l=-1,s=0,d=-1,c=0;for(;c<a;){let n=e.get(c);if(n.scrollOffset+n.size>t)break;c++}for(s=Math.max(0,(o=c)-i);c<a;){let r=e.get(c);if(r.scrollOffset+r.size>=t+n)break;c++}return d=Math.min(r-1,(l=Math.min(a,c))+i),o<0&&(o=0,l=-1,s=0,d=-1),{startIndexVisible:o,stopIndexVisible:l,startIndexOverscan:s,stopIndexOverscan:d}}function j(e,t){let{ariaAttributes:n,style:r,...i}=e,{ariaAttributes:a,style:o,...l}=t;return b(n,a)&&b(r,o)&&b(i,l)}function k({children:e,className:t,defaultHeight:n=0,listRef:a,onResize:o,onRowsRendered:l,overscanCount:s=3,rowComponent:d,rowCount:c,rowHeight:u,rowKey:p,rowProps:h,tagName:g="div",style:k,...C}){let E=(0,i.useMemo)(()=>h,Object.values(h)),S=(0,i.useMemo)(()=>(0,i.memo)(d,j),[d]),[P,N]=(0,i.useState)(null),A=null!=u&&"object"==typeof u&&"getAverageRowHeight"in u&&"function"==typeof u.getAverageRowHeight,{getCellBounds:M,getEstimatedSize:O,scrollToIndex:T,startIndexOverscan:R,startIndexVisible:_,stopIndexOverscan:z,stopIndexVisible:I}=function({containerElement:e,containerStyle:t,defaultContainerSize:n=0,direction:r,isRtl:a=!1,itemCount:o,itemProps:l,itemSize:s,onResize:d,overscanCount:c}){let{height:u=n,width:p=n}=function({box:e,defaultHeight:t,defaultWidth:n,disabled:r,element:a,mode:o,style:l}){let{styleHeight:s,styleWidth:d}=(0,i.useMemo)(()=>({styleHeight:f(l?.height),styleWidth:f(l?.width)}),[l?.height,l?.width]),[c,u]=(0,i.useState)({height:t,width:n}),p=r||"only-height"===o&&void 0!==s||"only-width"===o&&void 0!==d||void 0!==s&&void 0!==d;return m(()=>{if(null===a||p)return;let t=new ResizeObserver(e=>{for(let t of e){let{contentRect:e,target:n}=t;a===n&&u(t=>t.height===e.height&&t.width===e.width?t:{height:e.height,width:e.width})}});return t.observe(a,{box:e}),()=>{t?.unobserve(a)}},[e,p,a,s,d]),(0,i.useMemo)(()=>({height:s??c.height,width:d??c.width}),[c,s,d])}({defaultHeight:"vertical"===r?n:void 0,defaultWidth:"horizontal"===r?n:void 0,element:e,mode:"vertical"===r?"only-height":"only-width",style:t}),h=(0,i.useRef)({height:0,width:0}),g="vertical"===r?u:p,j=function({containerSize:e,itemSize:t}){let n;return"string"==typeof t?(v(t.endsWith("%"),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),v(void 0!==e,"Container size must be defined if a percentage item size is specified"),n=e*parseInt(t)/100):n=t,n}({containerSize:g,itemSize:s});(0,i.useLayoutEffect)(()=>
1{if("function"==typeof d){let e=h.current;(e.height!==u||e.width!==p)&&(d({height:u,width:p},{...e}),e.height=u,e.width=p)}},[u,d,p]);let k=function({itemCount:e,itemProps:t,itemSize:n}){return(0,i.useMemo)(()=>(function({itemCount:e,itemProps:t,itemSize:n}){let r=new Map;return{get(i){for(v(i<e,`Invalid index ${i}`);r.size-1<i;){let e,a=r.size;switch(typeof n){case"function":e=n(a,t);break;case"number":e=n}if(0===a)r.set(a,{size:e,scrollOffset:0});else{let t=r.get(a-1);v(void 0!==t,`Unexpected bounds cache miss for index ${i}`),r.set(a,{scrollOffset:t.scrollOffset+t.size,size:e})}}let a=r.get(i);return v(void 0!==a,`Unexpected bounds cache miss for index ${i}`),a},set(e,t){r.set(e,t)},get size(){return r.size}}})({itemCount:e,itemProps:t,itemSize:n}),[e,t,n])}({itemCount:o,itemProps:l,itemSize:j}),C=(0,i.useCallback)(e=>k.get(e),[k]),[E,S]=(0,i.useState)(()=>w({cachedBounds:k,containerScrollOffset:0,containerSize:g,itemCount:o,overscanCount:c})),{startIndexVisible:P,startIndexOverscan:N,stopIndexVisible:A,stopIndexOverscan:M}={startIndexVisible:Math.min(o-1,E.startIndexVisible),startIndexOverscan:Math.min(o-1,E.startIndexOverscan),stopIndexVisible:Math.min(o-1,E.stopIndexVisible),stopIndexOverscan:Math.min(o-1,E.stopIndexOverscan)},O=(0,i.useCallback)(()=>y({cachedBounds:k,itemCount:o,itemSize:j}),[k,o,j]),T=(0,i.useCallback)(t=>w({cachedBounds:k,containerScrollOffset:x({containerElement:e,direction:r,isRtl:a,scrollOffset:t}),containerSize:g,itemCount:o,overscanCount:c}),[k,e,g,r,a,o,c]);return m(()=>{S(T(("vertical"===r?e?.scrollTop:e?.scrollLeft)??0))},[e,r,T]),m(()=>{if(!e)return;let t=()=>{S(t=>{let{scrollLeft:n,scrollTop:i}=e,l=w({cachedBounds:k,containerScrollOffset:x({containerElement:e,direction:r,isRtl:a,scrollOffset:"vertical"===r?i:n}),containerSize:g,itemCount:o,overscanCount:c});return b(l,t)?t:l})};return e.addEventListener("scroll",t),()=>{e.removeEventListener("scroll",t)}},[k,e,g,r,o,c]),{getCellBounds:C,getEstimatedSize:O,scrollToIndex:function(e){let t=(0,i.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return m(()=>{t.current=e},[e]),(0,i.useCallback)((...e)=>t.current?.(...e),[t])}(({align:t="auto",containerScrollOffset:n,index:i})=>{let l=function({align:e,cachedBounds:t,index:n,itemCount:r,itemSize:i,containerScrollOffset:a,containerSize:o}){if(n<0||n>=r)throw RangeError(`Invalid index specified: ${n}`,{cause:`Index ${n} is not within the range of 0 - ${r-1}`});let l=y({cachedBounds:t,itemCount:r,itemSize:i}),s=t.get(n),d=Math.max(0,Math.min(l-o,s.scrollOffset)),c=Math.max(0,s.scrollOffset-o+s.size);switch("smart"===e&&(e=a>=c&&a<=d?"auto":"center"),e){case"start":return d;case"end":return c;case"center":return s.scrollOffset<=o/2?0:s.scrollOffset+s.size/2>=l-o/2?l-o:s.scrollOffset+s.size/2-o/2;default:return a>=c&&a<=d?a:a<c?c:d}}({align:t,cachedBounds:k,containerScrollOffset:n,containerSize:g,index:i,itemCount:o,itemSize:j});if(e){if(l=x({containerElement:e,direction:r,isRtl:a,scrollOffset:l}),"function"!=typeof e.scrollTo){let e=T(l);b(E,e)||S(e)}return l}}),startIndexOverscan:N,startIndexVisible:P,stopIndexOverscan:M,stopIndexVisible:A}}({containerElement:P,containerStyle:k,defaultContainerSize:n,direction:"vertical",itemCount:c,itemProps:E,itemSize:(0,i.useMemo)(()=>A?e=>u.getRowHeight(e)??u.getAverageRowHeight():u,[A,u]),onResize:o,overscanCount:s});(0,i.useImperativeHandle)(a,()=>({get element(){return P},scrollToRow({align:e="auto",behavior:t="auto",index:n}){let r=T({align:e,containerScrollOffset:P?.scrollTop??0,index:n});"function"==typeof P?.scrollTo&&P.scrollTo({behavior:t,top:r})}}),[P,T]),m(()=>{if(!P)return;let e=Array.from(P.children).filter((e,t)=>{if(e.hasAttribute("aria-hidden"))return!1;let n=`${R+t}`;return e.setAttribute("data-react-window-index",n),!0});if(A)return u.observeRowElements(e)},[P,A,u,R,z]),(0,i.useEffect)(()=>{R>=0&&z>=0&&l&&l({startIndex:_,stopIndex:I},{startIndex:R,stopIndex:z})},[l,R,_,z,I]);let D=(0,i.useMemo)(()=>{let e=[];
1if(c>0)for(let t=R;t<=z;t++){let n=M(t);e.push((0,i.createElement)(S,{...E,ariaAttributes:{"aria-posinset":t+1,"aria-setsize":c,role:"listitem"},key:p?p(t,E):t,index:t,style:{position:"absolute",left:0,transform:`translateY(${n.scrollOffset}px)`,height:A?void 0:n.size,width:"100%"}}))}return e},[S,M,A,c,p,E,R,z]),F=(0,r.jsx)("div",{"aria-hidden":!0,style:{height:O(),width:"100%",zIndex:-1}});return(0,i.createElement)(g,{role:"list",...C,className:t,ref:N,style:{position:"relative",maxHeight:"100%",flexGrow:1,overflowY:"auto",...k}},D,e,F)}var C=n(34001),E=n(7050),S=n(55228),P=n(24729),N=n(85341),A=n(84629),M=n(9469),O=n(16548),T=n(19994),R=n(25048),_=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};function z(e,t){return e[(e.indexOf(t)+1)%e.length]}let I=()=>(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"3",y1:"6",x2:"21",y2:"6",strokeWidth:"1"}),(0,r.jsx)("line",{x1:"3",y1:"12",x2:"21",y2:"12",strokeWidth:"2"}),(0,r.jsx)("line",{x1:"3",y1:"18",x2:"21",y2:"18",strokeWidth:"3"})]}),D={solid:()=>(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("line",{x2:"24",y1:"50%",y2:"50%",stroke:"currentColor",strokeWidth:"2"})}),large:()=>(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("line",{x1:"-1",x2:"25",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"12 2",strokeWidth:"2"})}),medium:()=>(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"6 2",strokeWidth:"2"})}),small:()=>(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("line",{x1:"1",x2:"23",y1:"50%",y2:"50%",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})},F=e=>{var{active:t,onClick:n,icon:i}=e,a=_(e,["active","onClick","icon"]);return(0,r.jsx)(p.$,Object.assign({variant:"outline",size:"sm",onClick:n,className:(0,c.cn)(t&&"pn:bg-muted")},a,{children:i}))};var L=n(57950),B=n(56861),$=n(13905),W=n(97458),V=n(53063),H=n(68047),q=n(63768),K=n(73629);let U=({checked:e,label:t,onChange:n})=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"8px"},children:[(0,r.jsx)("label",{className:"pn:text-xs",children:t}),(0,r.jsx)(q.d,{checked:e,onCheckedChange:n})]}),X=(0,a.PA)(({element:e,store:t,enabled:n})=>{let i=e.animations.find(e=>"enter"===e.type),a=e.animations.find(e=>"exit"===e.type);return n?(0,r.jsxs)(V.e,{fill:!0,children:[(0,r.jsx)(p.$,{variant:"outline",size:"sm",className:(0,c.cn)("pn:flex-1",(null==i?void 0:i.enabled)&&!(null==a?void 0:a.enabled)&&"pn:bg-accent pn:text-accent-foreground"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!1})})},children:"Enter"}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",className:(0,c.cn)("pn:flex-1",(null==i?void 0:i.enabled)&&(null==a?void 0:a.enabled)&&"pn:bg-accent pn:text-accent-foreground"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!0})})},children:"Both"}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",className:(0,c.cn)("pn:flex-1",(null==a?void 0:a.enabled)&&!(null==i?void 0:i.enabled)&&"pn:bg-accent pn:text-accent-foreground"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!1}),e.setAnimation("exit",{enabled:!0})})},children:"Exit"})]}):null}),Y=["right","left","up","down","bottom-right","bottom-left","top-right","top-left"],Z={right:(0,r.jsx)(u.dc,{name:"animation.directionRight",className:"pn:size-4"}),left:(0,r.jsx)(u.dc,{name:"animation.directionLeft",className:"pn:size-4"}),up:(0,r.jsx)(u.dc,{name:"animation.directionUp",className:"pn:size-4"}),down:(0,r.jsx)(u.dc,{name:"animation.directionDown",className:"pn:size-4"}),"bottom-right":(0,r.jsx)(u.dc,{name:"animation.directionBottomRight",className:"pn:size-4"}),"bottom-left":(0,r.jsx)(u.dc,{name:"animation.directionBottomLeft",className:"pn:size-4"}),"top-right":(0,r.jsx)(u.dc,{name:"animation.directionTopRight",className:"pn:size-4"}),"top-left":(0,r.jsx)(u.dc,{name:"animation.directionTopLeft",className:"pn:size-4"})}
1,G=(0,a.PA)(({value:e,onChange:t})=>(0,r.jsx)("div",{style:{paddingTop:"10px"},children:(0,r.jsxs)(K.l6,{value:e,onValueChange:e=>{null!==e&&t(e)},children:[(0,r.jsx)(K.bq,{className:"pn:w-full",children:(0,r.jsx)(K.yv,{children:(0,r.jsxs)("span",{className:"pn:flex pn:items-center pn:gap-2",children:[Z[e],e]})})}),(0,r.jsx)(K.gC,{children:Y.map(e=>(0,r.jsx)(K.eb,{value:e,children:(0,r.jsxs)("span",{className:"pn:flex pn:items-center pn:gap-2",children:[Z[e],e]})},e))})]})})),Q=(0,a.PA)(({element:e})=>{let t=e.animations.find(e=>"enter"===e.type);return t?(0,r.jsxs)("div",{style:{padding:"10px"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,r.jsx)("div",{children:"Delay"}),(0,r.jsx)("div",{children:(0,r.jsx)(N.Q,{value:parseFloat((t.delay/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{delay:1e3*t})},style:{width:"50px"},step:.01,min:0,max:2.5})})]}),(0,r.jsx)(H.A,{min:0,max:1e3,step:1,value:[t.delay],onValueChange:t=>{let n=(0,c.V)(t);e.setAnimation("enter",{delay:n})}})]}):null}),J=(0,a.PA)(({element:e})=>{let t=e.animations.find(e=>"enter"===e.type);return t?(0,r.jsxs)("div",{style:{padding:"10px"},children:[(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingTop:"5px",paddingBottom:"5px"},children:[(0,r.jsx)("div",{children:"Duration"}),(0,r.jsx)("div",{children:(0,r.jsx)(N.Q,{value:parseFloat((t.duration/1e3).toFixed(2)),onValueChange:t=>{e.setAnimation("enter",{duration:1e3*t}),e.setAnimation("exit",{duration:1e3*t})},style:{width:"50px"},step:.01,min:0,max:2.5})})]}),(0,r.jsx)(H.A,{min:0,max:2500,step:1,value:[t.duration],onValueChange:t=>{let n=(0,c.V)(t);e.setAnimation("enter",{duration:n}),e.setAnimation("exit",{duration:n})}})]}):null});(0,a.PA)(({element:e,store:t,elements:n})=>{var i,a;let o=n||[e],l=o[0],s=(e,n)=>{t.history.transaction(()=>{o.forEach(t=>{t.setAnimation("enter",Object.assign({name:e},n)),t.setAnimation("exit",Object.assign(Object.assign({name:e},n),{from:n.to,to:n.from}))})}),n.enabled&&(t.play({animatedElementsIds:o.map(e=>e.id),currentTime:l.page.startTime}),setTimeout(()=>{t.stop()},1e3))},d=(e,t)=>{var n;return!!((e?null==(n=l.animations)?void 0:n.filter(t=>t.name===e):l.animations)||[]).find(e=>e.enabled)};return(0,r.jsxs)(O.AM,{children:[(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"sm",children:(0,P.t)("toolbar.animate")})}),(0,r.jsxs)(O.hl,{align:"start",initialFocus:!1,style:{padding:"15px",paddingTop:"25px",width:"230px"},children:[(0,r.jsx)(U,{checked:d("fade"),label:(0,P.t)("toolbar.fade"),onChange:e=>{s("fade",{enabled:e})}}),(0,r.jsx)(U,{checked:d("move"),label:(0,P.t)("toolbar.move"),onChange:e=>{s("move",{enabled:e})}}),(0,r.jsx)(U,{checked:d("zoom"),label:(0,P.t)("toolbar.zoom"),onChange:e=>{s("zoom",{enabled:e})}}),(0,r.jsx)(X,{element:l,store:t,enabled:d()}),d("move")&&(0,r.jsx)(G,{value:(null==(a=null==(i=l.animations.find(e=>"move"===e.name))?void 0:i.data)?void 0:a.direction)||"right",onChange:e=>{s("move",{data:{direction:e},enabled:!0})}}),d()&&(0,r.jsx)(Q,{store:t,element:l}),d()&&(0,r.jsx)(J,{store:t,element:l}),(0,r.jsx)(U,{checked:d("rotate"),label:(0,P.t)("toolbar.rotate"),onChange:e=>{var n;n={enabled:e},t.history.transaction(()=>{o.forEach(e=>{e.setAnimation("loop",Object.assign({name:"rotate"},n))})}),n.enabled&&(t.play({animatedElementsIds:o.map(e=>e.id),currentTime:l.page.startTime}),setTimeout(()=>{t.stop()},1e3))}})]})]})});let ee=(0,a.PA)(({element:e,store:t})=>e.contentEditable?(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("animation")},children:(0,P.t)("toolbar.animate")}):null);var et=n(34363),en=n(16500);let er=(0,E.Lu)(),ei=({fontFamily:e,handleClick:t,modifiers:n,store:a,isCustom:o})=>{let[l,s]=i.useState(!o);if(i.useEffect(()=>{l||a.loadFont(e)},[e,l]),"_divider"===e)return(0,r.jsx)("div",{style:{paddingTop:"10px"},children:(0,r.jsx)(R.w,{})});let d=l?(0,r.jsx)("img",{src:(0,S.wC)(e),alt:e,onError:()=>{s(!1)},className:"pn:h-5 pn:dark:invert"}):e;return(0,r.jsx)("button",{type:"button",onClick:t,disabled:n.disabled,"data-active":n.active||void 0,className:(0,
1c.cn)("pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-left pn:text-sm pn:hover:bg-muted",n.active&&"pn:bg-muted"),style:{fontFamily:(0,B.z)(e)},children:d})},ea=({index:e,style:t,filteredFonts:n,activeFont:i,onFontSelect:a,store:o})=>{let l=n[e];return(0,r.jsx)("div",{style:t,children:(0,r.jsx)(ei,{fontFamily:l,modifiers:{active:i===l},handleClick:()=>a(l),store:o,isCustom:o.fonts.find(e=>e.fontFamily===l)||E.Mz.find(e=>e.fontFamily===l)},l)})},eo=({onChange:e,defaultValue:t})=>{let n=i.useRef(null);return i.useEffect(()=>{n.current&&n.current.focus()},[]),(0,r.jsxs)(A.MG,{children:[(0,r.jsx)("span",{className:"pn:flex pn:items-center pn:pl-2 pn:pr-1 pn:text-muted-foreground",children:(0,r.jsx)(u.dc,{name:"action.search",className:"pn:size-3.5 pn:shrink-0 pn:opacity-50"})}),(0,r.jsx)("input",{ref:n,"data-slot":"input-group-control",defaultValue:t,onChange:t=>e(t.target.value),className:"pn:h-full pn:w-full pn:flex-1 pn:border-0 pn:bg-transparent pn:px-2 pn:text-xs pn:outline-none pn:placeholder:text-muted-foreground"})]})},el=({store:e,fonts:t,activeFont:n,activeFontLabel:a,onFontSelect:o,mixed:l,mixedFonts:d,open:c,onOpenChange:h})=>{let[m,f]=i.useState(""),g=t.filter(e=>(null==e?void 0:e.toLowerCase().indexOf(m.toLowerCase()))>=0);return(0,r.jsxs)(O.AM,{open:c,onOpenChange:h,children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsxs)(p.$,{variant:"ghost",size:"sm",className:"pn:gap-1 pn:overflow-hidden pn:whitespace-nowrap",style:{fontFamily:l?void 0:(0,B.z)(n),fontStyle:l?"italic":void 0,color:l?"#5c7080":void 0},"aria-label":(0,P.t)("toolbar.fontFamily"),children:[(0,r.jsx)("span",{className:"pn:truncate",children:l?(0,P.t)("toolbar.fontFamilyMixed"):a}),(0,r.jsx)(u.dc,{name:"ui.chevronDown",className:"pn:size-3 pn:shrink-0 pn:opacity-50"})]})})}),(0,r.jsx)(s.ZI,{children:l&&d&&d.length>0?`${(0,P.t)("toolbar.fontsInSelection")}: ${d.join(", ")}`:(0,P.t)("toolbar.fontFamily")})]}),(0,r.jsx)(O.hl,{className:"pn:w-[230px] pn:p-2",align:"start",children:(0,r.jsxs)("div",{children:[(0,r.jsx)(eo,{onChange:e=>f(e),defaultValue:m}),(0,r.jsx)("div",{style:{paddingTop:"5px"},children:(0,r.jsx)(k,{style:{height:Math.min(400,30*g.length)+10,width:210},rowCount:g.length,rowHeight:30,rowComponent:ea,rowProps:{filteredFonts:g,activeFont:n,onFontSelect:o,store:e}})})]})})]})},es={},ed=e=>es[e]?Promise.resolve(es[e]):fetch(e).then(e=>e.json()).then(t=>(es[e]=t,t)),ec=(0,a.PA)(({elements:e,store:t})=>{let[n,a]=i.useState(!1),{data:o,mutate:l}=(0,C.u)(n?(0,S.yb)():null,ed,{isPaused:()=>(0,E.nR)(),fallbackData:[]});i.useEffect(()=>{l()},[(0,E.nR)()]);let s=t.fonts.concat(E.Mz).map(e=>e.fontFamily).concat((null==o?void 0:o.length)&&!(0,E.nR)()?o:er),d=e[0].fontFamily;d.length>15&&(d=d.slice(0,15)+"...");let c=[];t.find(e=>("text"===e.type&&c.push(e.fontFamily),!1));let u=[...new Set(c.concat("_divider").concat(s))];return(0,r.jsx)(el,{fonts:u,activeFont:e[0].fontFamily,activeFontLabel:d,store:t,open:n,onOpenChange:a,onFontSelect:n=>{t.history.transaction(()=>{e.forEach(e=>{e.set({fontFamily:n})})})}})}),eu=(0,a.PA)(({elements:e,store:t})=>{let[n,a]=i.useState(!1),[o,l]=i.useState(!1);return(0,r.jsxs)(s.m_,{open:!o&&n,onOpenChange:e=>{o||a(e)},children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(N.Q,{"aria-label":(0,P.t)("toolbar.fontSize"),onFocus:()=>l(!0),onBlur:()=>l(!1),onValueChange:n=>{t.history.transaction(()=>{e.forEach(e=>{e.set({fontSize:n,width:Math.max(n,e.width)})})})},value:Math.round(e[0].fontSize),style:{width:"50px"},min:5,max:4*t.height})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.fontSize")})]})}),ep=["left","center","right","justify"],eh=["top","middle","bottom"],em={top:(0,r.jsx)(u.dc,{name:"text.valignTop",className:"pn:size-4"}),middle:(0,r.jsx)(u.dc,{name:"text.valignMiddle",className:"pn:size-4"}),bottom:(0,r.jsx)(u.dc,{name:"text.valignBottom",className:"pn:size-4"})},ef=(0,a.PA)(({elements:e,store:t})=>{let n=e[0],i=(0,L.eX)(n.fontWeight),a="italic"===n.fontStyle,l=n.textDecoration.indexOf("underline")>=0,d=n.textDecoration.indexOf("line-through")>=0;return(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-0.5",children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=z(ep,n.align);t.history.transaction(()=>
1{e.forEach(e=>{e.set({align:r})})})},"aria-label":(0,P.t)("toolbar.textAlign"),children:"left"===n.align?(0,r.jsx)(u.dc,{name:"text.alignLeft",className:"pn:size-4"}):"center"===n.align?(0,r.jsx)(u.dc,{name:"text.alignCenter",className:"pn:size-4"}):"right"===n.align?(0,r.jsx)(u.dc,{name:"text.alignRight",className:"pn:size-4"}):(0,r.jsx)(u.dc,{name:"text.alignJustify",className:"pn:size-4"})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.textAlign")})]}),o.Mv.textVerticalResizeEnabled&&(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=z(eh,n.verticalAlign);t.history.transaction(()=>{e.forEach(e=>{e.set({verticalAlign:r})})})},"aria-label":(0,P.t)("toolbar.verticalAlign"),children:em[n.verticalAlign]})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.verticalAlign")})]}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.bold"),active:i,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=(0,L.eX)(n.fontWeight);t.history.transaction(()=>{e.forEach(e=>{e.set({fontWeight:r?"400":"700"})})})},children:(0,r.jsx)(u.dc,{name:"text.bold",className:"pn:size-4"})}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.italic"),active:a,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r="italic"===n.fontStyle;t.history.transaction(()=>{e.forEach(e=>{r?e.set({fontStyle:"normal"}):e.set({fontStyle:"italic"})})})},children:(0,r.jsx)(u.dc,{name:"text.italic",className:"pn:size-4"})}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.underline"),active:l,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("underline")>=0?r=r.filter(e=>"underline"!==e):r.push("underline"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})},children:(0,r.jsx)(u.dc,{name:"text.underline",className:"pn:size-4"})}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.strikethrough"),active:d,onMouseDown:e=>{e.preventDefault()},onClick:()=>{let r=n.textDecoration.split(" ");r.indexOf("line-through")>=0?r=r.filter(e=>"line-through"!==e):r.push("line-through"),t.history.transaction(()=>{e.forEach(e=>{e.set({textDecoration:r.join(" ")})})})},children:(0,r.jsx)(u.dc,{name:"text.strikethrough",className:"pn:size-4"})})]})}),eg=(0,a.PA)(({elements:e,store:t})=>{let n="uppercase"==e[0].textTransform;return(0,r.jsx)("div",{className:"pn:flex pn:items-center pn:gap-0.5",children:(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.uppercase"),active:n,onMouseDown:e=>{e.preventDefault()},onClick:()=>{t.history.transaction(()=>{e.forEach(e=>{e.set({textTransform:"uppercase"===e.textTransform?"none":"uppercase"})})})},children:(0,r.jsx)(u.dc,{name:"text.uppercase",className:"pn:size-4"})})})}),ex=(0,a.PA)(({elements:e,store:t})=>(0,r.jsx)($.sk,{value:e[0].fill,gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),ev=(0,a.PA)(({elements:e,store:t})=>{let n=e[0],i=n=>{t.history.transaction(()=>{e.forEach(e=>{e.set(n)})})},a="number"==typeof n.lineHeight?100*n.lineHeight:120;return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.spacing"),children:(0,r.jsx)(u.dc,{name:"text.spacing",className:"pn:size-5"})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.spacing")})]}),(0,r.jsxs)(O.hl,{align:"start",className:"pn:w-[230px] pn:p-[15px]",children:[(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.lineHeight"),value:Math.round(a),onChange:e=>i({lineHeight:e/100}),min:50,max:250}),(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.letterSpacing"),value:Math.round(100*n.letterSpacing),onChange:e=>i({letterSpacing:e/100}),min:-50,max:250})]})]})}),eb={TextFontFamily:ec,TextFontSize:eu,TextFontVariant:ef,TextTransform:eg,TextFill:ex,TextSpacing:ev,TextAiWrite:en.n,TextFilters:W.Ay,TextAnimations:ee},ey=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextTransform","TextFilters",o.Mv.animationsEnabled&&"TextAnimations",o.Mv.aiTextEnabled&&"TextAiWrite"],a=(0,et.z)({type:"text",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=(null==t?void 0:t[i])||eb[i];return a?(0,r.jsx)(a,{elements:n,element:n[0],store:e},i):null}})});var ew=n(76455),ej=n(37124),ek=n(14464),eC=n(79641),eE=n(18493);let eS=(0,ew.A)("div")`
2  position: relative;
3  display: inline-block;
4
5  &.polotno-mixed input {
6    color: transparent !important;
7  }
8  &.polotno-mixed:focus-within input {
9    color: inherit !important;
10  }
11  /* Hide the "—" overlay on focus (the digits are revealed above) so the two
12     never stack. Target the overlay's stable class rather than 
12interpolating
13     \`\${FontSizeMixedOverlay}\`: our goober \`styled\` wraps components in
14     forwardRef, so that interpolation stringifies to "[object Object]". */
15  &:focus-within .polotno-fs-mixed-overlay {
16    display: none;
17  }
18`,eP=(0,ew.A)("span")`
19  position: absolute;
20  left: 11px;
21  top: 0;
22  bottom: 0;
23  display: flex;
24  align-items: center;
25  pointer-events: none;
26  font-size: inherit;
27  color: inherit;
28`,eN=e=>{let t=(0,eE.xN)();return!!t&&t.store===e&&!!t.instance},eA=null,eM=()=>{ej.ZR.pendingToolbarInteraction=!0,eA&&clearTimeout(eA),eA=setTimeout(()=>{ej.ZR.pendingToolbarInteraction=!1,eA=null},100)},eO=e=>{var t;(t=e.target)&&("INPUT"===t.tagName||"TEXTAREA"===t.tagName||"SELECT"===t.tagName||t.isContentEditable)||e.preventDefault(),eM()},eT=(0,a.PA)(({store:e,isActive:t,toggle:n,icon:i,ariaLabel:a,tooltipContent:o})=>{let{format:l,applyTextFormat:s}=(0,eE.oP)(e);return(0,r.jsx)(T.p,{label:o||a||"",active:t(l),onMouseDown:e=>{e.preventDefault()},onClick:()=>n(l,s),children:i})}),eR=(e,t,n)=>t({textDecoration:function(e,t){let n="underline"===t?"line-through":"underline",r=new Set;return(0,eC.HH)(e,t)||r.add(t),(0,eC.HH)(e,n)&&r.add(n),(0,eC.pU)(r)}(e,n)},{decorationTokens:[n]}),e_=(0,a.PA)(({store:e})=>(0,r.jsx)(eT,{store:e,isActive:e=>(0,ek.eX)(e.fontWeight.value),toggle:(e,t)=>t({fontWeight:(0,ek.eX)(e.fontWeight.value)?400:700}),icon:(0,r.jsx)(u.dc,{name:"text.bold",className:"pn:size-4"}),tooltipContent:(0,P.t)("toolbar.bold")})),ez=(0,a.PA)(({element:e,store:t,elements:n,components:i})=>{let a=(null==i?void 0:i.TextBold)||e_;return(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-0.5",children:[(0,r.jsx)(a,{element:e,store:t}),(0,r.jsx)(eT,{store:t,isActive:e=>"italic"===e.fontStyle.value,toggle:(e,t)=>t({fontStyle:"italic"===e.fontStyle.value?"normal":"italic"}),icon:(0,r.jsx)(u.dc,{name:"text.italic",className:"pn:size-4"}),tooltipContent:(0,P.t)("toolbar.italic")}),(0,r.jsx)(eT,{store:t,isActive:e=>(0,eC.HH)(e,"underline"),toggle:(e,t)=>eR(e,t,"underline"),icon:(0,r.jsx)(u.dc,{name:"text.underline",className:"pn:size-4"}),tooltipContent:(0,P.t)("toolbar.underline")}),(0,r.jsx)(eT,{store:t,isActive:e=>(0,eC.HH)(e,"line-through"),toggle:(e,t)=>eR(e,t,"line-through"),icon:(0,r.jsx)(u.dc,{name:"text.strikethrough",className:"pn:size-4"}),tooltipContent:(0,P.t)("toolbar.strikethrough")}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.textAlign"),onClick:()=>{let r=z(ep,e.align);t.history.transaction(()=>{n.forEach(e=>{e.set({align:r})})})},children:"left"===e.align?(0,r.jsx)(u.dc,{name:"text.alignLeft",className:"pn:size-4"}):"center"===e.align?(0,r.jsx)(u.dc,{name:"text.alignCenter",className:"pn:size-4"}):"right"===e.align?(0,r.jsx)(u.dc,{name:"text.alignRight",className:"pn:size-4"}):(0,r.jsx)(u.dc,{name:"text.alignJustify",className:"pn:size-4"})}),o.Mv.textVerticalResizeEnabled&&(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let n=z(eh,e.verticalAlign);t.history.transaction(()=>{e.set({verticalAlign:n})})},"aria-label":(0,P.t)("toolbar.verticalAlign"),children:em[e.verticalAlign]})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.verticalAlign")})]}),(0,r.jsx)(T.p,{label:(0,P.t)("toolbar.listFormat"),onMouseDown:e=>{e.preventDefault()},onClick:()=>{var t;let n=window.__polotnoQuill,r=!n;n=n||(({html:e})=>{let t=document.createElement("div");document.body.appendChild(t),t.style.display="none",t.style.whiteSpace="pre-wrap";let n=(0,ej.Gx)(t);return(0,ej.Ld)(n,e),n})({html:e.text}),r&&n.setSelection(0,n.getLength(),"api");let i=n.getSelection(!0)||(null==(t=(0,eE.xN)())?void 0:t.lastSelection)||{index:0,length:n.getLength()},a=n.getFormat(i);a.list?"bullet"===a.list?n.format("list","ordered"):n.format("list",!1):n.format("list","bullet"),r&&(e.set({text:(0,ek.wb)(n.root.innerHTML,{fontSize:e.fontSize,fontFamily:e.fontFamily})}),n.root.parentElement.remove())},children:(()=>{let e=(0,eE.xN)();return"bullet"===(e&&e.store===t?e.currentFormat:{}).list?(0,r.jsx)(u.dc,{name:"text.numberedList",className:"pn:size-5"}):(0,r.jsx)(u.dc,{name:"text.bulletList",className:"pn:size-5"})})()})]})}),eI=(0,a.PA)(({element:e,store:t})=>{var n;let{format:i,applyTextFormat:a}=(0,eE.oP)(t);return(0,r.jsx)("div",{"data-polotno-keep-focus":!0,onMouseDown:eO,children:(0,r.jsx)($.sk,{value:null!=(n=i.fill.value)?n:e.fill,gradientEnabled:!0,onClose:()=>{let e=(0,eE.xN)();(null==e?void 0:e.instance)&&e.lastSelection&&e.instance.setSelection(e.lastSelection)},onChange:e=>a({fill:e}),store:t})})}),eD=(0,a.PA)(({element:e})=>{let t="rtl"===e.dir,n=(0,P.t)("toolbar.textDirection");return(0,r.jsx)(T.p,{label:n,onClick:()=>{e.set({dir:t?"ltr":"rtl"})},children:(0,r.jsx)(u.dc,t?{name:"text.paragraph",className:"pn:size-5 pn:-scale-x-100"}:{name:"text.richText",className:"pn:size-5"})})}),eF=(0,E.Lu)(),eL={TextFontFamily:(0,a.PA)(({elements:e,store:t})=>{var n;let{format:a,applyTextFormat:o}=(0,eE.oP)(t),l=eN(t),s=a.fontFamily.mixed,d=s?Array.from(new Set(e.flatMap(e=>(0,ek.v0)(e.text,e.fontFamily)))).sort((e,t)=>
28e.localeCompare(t,void 0,{sensitivity:"base"})):void 0,[c,u]=i.useState(!1),{data:p,mutate:h}=(0,C.u)(c?(0,S.yb)():null,ed,{isPaused:()=>(0,E.nR)(),fallbackData:[]});i.useEffect(()=>{h()},[(0,E.nR)()]);let m=t.fonts.concat(E.Mz).map(e=>e.fontFamily).concat((null==p?void 0:p.length)&&!(0,E.nR)()?p:eF),f=[];t.find(e=>("text"===e.type&&f.push(e.fontFamily),!1));let g=[...new Set(f.concat("_divider").concat(m))],x=null!=(n=a.fontFamily.value)?n:e[0].fontFamily,v=x;v.length>15&&(v=v.slice(0,15)+"...");let b=(0,r.jsx)(el,{fonts:g,activeFont:x,activeFontLabel:v,store:t,mixed:s,mixedFonts:d,open:c,onOpenChange:u,onFontSelect:e=>o({fontFamily:e})});return l?(0,r.jsx)("div",{"data-polotno-keep-focus":!0,onMouseDown:eO,children:b}):b}),TextFontSize:(0,a.PA)(({elements:e,store:t})=>{let{format:n}=(0,eE.oP)(t),i=eN(t),a=n.fontSize.mixed,o=n.fontSize.value,l=e.map(e=>new Proxy(e,{get:(e,n)=>"fontSize"===n?null!=o?o:e.fontSize:"set"===n?n=>((e,n)=>{if(!n.fontSize)return void e.set(n);let r=(0,eE.xN)();if(r&&r.store===t&&r.instance){let{scope:e,isEmpty:t}=(0,eE.Fi)(r.instance,r.lastSelection);if("partial"===e||"collapsed"===e&&t)return void(0,eE.Z2)(r.instance,{fontSize:n.fontSize},r.lastSelection)}let{attrsToSet:i}=(0,eC.ps)(e,{fontSize:n.fontSize});e.set(Object.assign(Object.assign({},n),i))})(e,n):Reflect.get(e,n)})),s=(0,r.jsxs)(eS,{className:a?"polotno-mixed":"",children:[(0,r.jsx)(eu,{elements:l,store:t}),a&&(0,r.jsx)(eP,{className:"polotno-fs-mixed-overlay","aria-hidden":!0,children:"—"})]});return i?(0,r.jsx)("div",{"data-polotno-keep-focus":!0,onMouseDown:eM,children:s}):s}),TextFontVariant:ez,TextTransform:eg,TextFilters:W.Ay,TextFill:eI,TextSpacing:ev,TextDirection:eD,TextAnimations:ee,TextAiWrite:en.n},eB=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=e.selectedElements[0],a=["TextFill","TextFontFamily","TextFontSize","TextFontVariant","TextSpacing","TextTransform","TextFilters",o.Mv.animationsEnabled&&"TextAnimations",o.Mv.aiTextEnabled&&"TextAiWrite"],l=(0,et.z)({type:"text",usedItems:a,components:t});return(0,r.jsx)(et.S,{items:l,itemRender:a=>{if("TextBold"===a)return null;let o=(null==t?void 0:t[a])||eL[a];return(0,r.jsx)(o,{element:i,elements:n,store:e,components:t},a)}})});var e$=n(35184);let eW=({elements:e})=>(0,r.jsxs)(e$.rI,{children:[(0,r.jsx)(e$.ty,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"sm",children:(0,P.t)("toolbar.flip")})}),(0,r.jsxs)(e$.SQ,{align:"start",children:[(0,r.jsxs)(e$._2,{onSelect:t=>{t.preventDefault(),e.forEach(e=>{e.set({flipX:!e.flipX})})},children:[(0,r.jsx)(u.dc,{name:"toolbar.flipHorizontal",className:"pn:size-4"}),(0,P.t)("toolbar.flipHorizontally")]}),(0,r.jsxs)(e$._2,{onSelect:t=>{t.preventDefault(),e.forEach(e=>{e.set({flipY:!e.flipY})})},children:[(0,r.jsx)(u.dc,{name:"toolbar.flipVertical",className:"pn:size-4"}),(0,P.t)("toolbar.flipVertically")]})]})]});var eV=n(6369),eH=n(96136);let eq=async(e,t)=>{let n=await fetch((0,S.hS)(),{method:"POST",body:JSON.stringify({url:e}),signal:t});return 200!==n.status?(alert((0,P.t)("error.removeBackground")),e):(await n.json()).url},eK=(0,a.PA)(({isOpen:e,onClose:t,element:n})=>{let[a,o]=i.useState(n.src),l=i.useRef(null);i.useEffect(()=>(o(n.src),()=>{var e;null==(e=l.current)||e.abort(),l.current=null}),[n.src]);let[s,d]=i.useState(!1),c=()=>{var e;null==(e=l.current)||e.abort()},u=a!==n.src;return(0,r.jsx)(eH.lG,{open:e,onOpenChange:e=>{e||(c(),t())},children:(0,r.jsxs)(eH.Cf,{className:"pn:w-[80%] pn:max-w-[700px]",children:[(0,r.jsx)(eH.c7,{children:(0,r.jsx)(eH.L3,{children:(0,P.t)("toolbar.removeBackgroundTitle")})}),(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:a,style:{width:"100%",maxHeight:"400px",objectFit:"contain"}})}),(0,r.jsxs)(eH.Es,{className:"pn:relative",children:[!u&&(0,r.jsxs)(r.Fragment,{children:[s&&(0,r.jsx)(p.$,{variant:"outline",onClick:c,children:(0,P.t)("toolbar.cancelRemoveBackground")}),(0,r.jsxs)(p.$,{onClick:async()=>{let e=new AbortController;l.current=e,d(!0);try{let t=await eq(n.src,e.signal);e.signal.aborted||o(t)}catch(e){"AbortError"!==(null==e?void 0:e.name)&&console.error(e)}finally{l.current===e&&(l.current=null),d(!1)}},disabled:s,children:[s&&(0,r.jsx)(eV.y,{className:"pn:mr-2"}
28),(0,P.t)("toolbar.removeBackground")]})]}),u&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(p.$,{variant:"outline",onClick:()=>{o(n.src),t()},disabled:s,children:[s&&(0,r.jsx)(eV.y,{className:"pn:mr-2"}),(0,P.t)("toolbar.cancelRemoveBackground")]}),(0,r.jsxs)(p.$,{onClick:()=>{n.set({src:a}),t()},disabled:s,children:[s&&(0,r.jsx)(eV.y,{className:"pn:mr-2"}),(0,P.t)("toolbar.confirmRemoveBackground")]})]})]})]})})});var eU=n(17063);let eX=(0,a.PA)(({element:e,store:t,elements:n})=>e.contentEditable?e.clipSrc?(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:()=>{n.forEach(e=>{e.set({clipSrc:""})})},children:(0,P.t)("toolbar.removeClip")}):(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")},children:(0,P.t)("toolbar.clip")}):null),eY=(0,a.PA)(({element:e})=>e.contentEditable?e.stretchEnabled?null:(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClickCapture:t=>{t.stopPropagation(),e.toggleCropMode(!0)},"aria-label":(0,P.t)("toolbar.crop"),children:(0,r.jsx)(u.dc,{name:"toolbar.crop",className:"pn:size-4"})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.crop")})]}):null);(0,a.PA)(({element:e})=>e.clipSrc?(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:()=>{e.set({clipSrc:""})},children:(0,P.t)("toolbar.removeClip")}):null);let eZ={ImageFlip:eW,ImageFilters:W.Ay,ImageFitToBackground:({element:e})=>(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClick:async()=>{let{page:t}=e,n=t.computedBleed,r=t.computedWidth+n.left+n.right,i=t.computedHeight+n.top+n.bottom,a=await (0,eU.pG)(e.src),o=e.stretchEnabled?{cropX:0,cropY:0,cropWidth:1,cropHeight:1}:(0,eU.$d)({width:r,height:i},a);e.set(Object.assign({x:-n.left,y:-n.top,width:r,height:i,rotation:0},o))},children:(0,P.t)("toolbar.fitToBackground")}),ImageCrop:eY,ImageClip:eX,ImageRemoveBackground:({element:e})=>{let[t,n]=i.useState(!1);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClick:()=>{n(!0)},children:(0,P.t)("toolbar.removeBackground")}),(0,r.jsx)(eK,{isOpen:t,onClose:()=>{n(!1)},element:e})]})},ImageAnimations:ee},eG=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements[0],a=n._cropModeEnabled,l=i.useRef({});i.useEffect(()=>{a&&(l.current={x:n.x,y:n.y,width:n.width,height:n.height,cropX:n.cropX,cropY:n.cropY,cropWidth:n.cropWidth,cropHeight:n.cropHeight})},[a]);let s=["ImageFlip","ImageFilters","ImageFitToBackground","ImageClip","ImageCrop",o.Mv.animationsEnabled&&"ImageAnimations",o.Mv.removeBackgroundEnabled&&"ImageRemoveBackground"],d=(0,et.z)({type:"image",usedItems:s,components:t});return(0,r.jsxs)(r.Fragment,{children:[!a&&(0,r.jsx)(et.S,{items:d,itemRender:i=>{let a=t[i]||eZ[i];return(0,r.jsx)(a,{element:n,store:e,elements:e.selectedElements},i)}}),a&&(0,r.jsxs)("div",{className:"pn:flex pn:items-center",children:[(0,r.jsxs)(p.$,{variant:"ghost",size:"sm",onClickCapture:()=>{n.toggleCropMode(!1)},children:[(0,r.jsx)(u.dc,{name:"action.confirm",className:"pn:size-4"}),(0,P.t)("toolbar.cropDone")]}),(0,r.jsxs)(p.$,{variant:"ghost",size:"sm",onClickCapture:()=>{n.set(Object.assign({},l.current)),n.toggleCropMode(!1)},children:[(0,r.jsx)(u.dc,{name:"action.close",className:"pn:size-4"}),(0,P.t)("toolbar.cropCancel")]})]})]})});var eQ=n(27024),eJ=n(41251),e0=n(82297);let e1=(e,t)=>Array.from(e.keys()).find(e=>eQ.b(e,t)),e2=(e,t)=>{let n=e1(e,t);return e.get(n||"")||t},e5=(e,t,n)=>{let r=e1(e.colorsReplace,t)||t;e.replaceColor(r,n)},e3=(0,a.PA)(({element:e,color:t,store:n})=>{let i=e2(e.colorsReplace,t);return(0,r.jsxs)("div",{className:"pn-svg-color-row pn:flex pn:items-center pn:gap-2",children:[(0,r.jsx)($.Ay,{value:i,onChange:n=>e5(e,t,n),store:n,gradientEnabled:!0}),(0,r.jsx)("span",{className:"pn:truncate pn:text-xs pn:text-muted-foreground",children:(0,e0.bn)(i)?(0,P.t)("toolbar.colorPicker.linear"):i})]})}),e4={SvgFlip:eW,SvgFilters:W.Ay,SvgColors:(0,a.PA)(({element:e,store:t})=>{let n=(0,eJ.O)(e.src),i=e.colorsReplace;if(e.maskSrc||0===n.length)return null;if(1===n.length){let a=n[0];return(0,r.jsx)($.Ay,{value:e2(i,a),onChange:t=>e5(e,a,t),store:t,gradientEnabled:!0})}let a=(e=>{let t=e.slice(0,8),n=t.length||1;return`linear-gradient(90deg, ${t.map((e,t)=>`${e} ${t/n*100}% ${(t+1)/n*100}%`).join(", ")})`})(n.map(e=>(0,e0.wj)(e2(i,e)))),o=i.size>0;return(0,r.jsxs)(O.AM,{children:[(0,r.jsx)(O.Wv,{nativeButton:!1,render:(0,r.jsx)($.qd,{background:a,"aria-label":(0,P.t)("toolbar.colorPicker.colors")})}),(0,r.jsxs)(O.hl,{className:"pn:w-[220px] pn:p-2",align:"start",children:[(0,r.jsxs)("div",{className:"pn:mb-2 pn:flex pn:items-center pn:justify-between",children:[(0,r.jsx)("span",{className:"pn:text-xs pn:font-medium",children:(0,P.t)("toolbar.colorPicker.colors")}),o&&(0,r.jsx)(p.$,{variant:"ghost",size:"sm","data-pn-reset-colors":"",onClick:()=>e.resetColors(),children:(0,P.t)("toolbar.colorPicker.resetColors")})]}),(0,r.jsxs)("div",{className:"pn:mb-2 pn:flex pn:items-center pn:gap-2 pn:border-b pn:pb-2",children:[(0,r.jsx)($.Ay,{value:e2(i,n[0]),onChange:t=>n.forEach(n=>e5(e,n,t)),store:t,gradientEnabled:!0}),(0,r.jsx)("span",{className:"pn:text-xs",children:(0,P.t)("toolbar.colorPicker.recolorAll")})]}),(0,r.jsx)("div",{className:"pn:flex pn:max-h-[280px] pn:flex-col pn:gap-2 pn:overflow-y-auto",children:n.map(n=>(0,r.jsx)(e3,{element:e,color:n,store:t},n))})]})]})}),SvgAnimations:ee}
28,e7=(0,a.PA)(({store:e,hideSvgEffects:t,components:n})=>{let i=e.selectedElements,a=["SvgFlip",!t&&"SvgFilters","SvgColors",o.Mv.animationsEnabled&&"SvgAnimations"].filter(e=>!!e),l=(0,et.z)({type:"svg",usedItems:a,components:n});return(0,r.jsx)(et.S,{items:l,itemRender:t=>{let a=n[t]||e4[t];return(0,r.jsx)(a,{elements:i,element:i[0],store:e},t)}})});var e8=n(48428);let e6=(0,a.PA)(({store:e,elements:t})=>{let n=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})};return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.lineStyle"),children:(0,r.jsx)(u.dc,{name:"action.settings",className:"pn:size-4"})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.lineStyle")})]}),(0,r.jsxs)(O.hl,{className:"pn:w-[230px] pn:p-4",align:"start",children:[(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.lineSize"),value:t[0].height,onChange:n=>{(n=>{e.history.transaction(()=>{t.forEach(e=>{let{middleLeft:t,middleRight:r}=(0,e8.Bc)(e),{x:i,y:a,rotation:o}=(0,e8.uA)(t,r,n);e.set({x:i,y:a,rotation:o,height:n})})})})(n)},min:1,max:100}),(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:pt-4 pn:pb-1",children:[(0,r.jsx)(F,{active:0===t[0].dash.length,onClick:()=>{n({dash:[]})},icon:(0,r.jsx)(D.solid,{})}),(0,r.jsx)(F,{active:4===t[0].dash[0],onClick:()=>{n({dash:[4,1]})},icon:(0,r.jsx)(D.large,{})}),(0,r.jsx)(F,{active:2===t[0].dash[0],onClick:()=>{n({dash:[2,1]})},icon:(0,r.jsx)(D.medium,{})}),(0,r.jsx)(F,{active:1===t[0].dash[0],onClick:()=>{n({dash:[1,1]})},icon:(0,r.jsx)(D.small,{})})]})]})]})}),e9=(0,a.PA)(({elements:e,store:t})=>(0,r.jsx)($.sk,{value:e[0].color,gradientEnabled:!1,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({color:n})})}),store:t})),te={"":(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 16 8"})})}),arrow:(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13",fill:"none",strokeLinejoin:"round",strokeLinecap:"round"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),triangle:(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 8 3 L 1 8 L 8 13 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),bar:(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 3 L 1 13",strokeLinejoin:"round",strokeLinecap:"round"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),square:(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 4 L 9 4 L 9 12 L 1 12 Z",fill:"currentColor",strokeLinejoin:"round",strokeLinecap:"round"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})}),circle:(0,r.jsx)("span",{"aria-hidden":"true",className:"pn:inline-flex",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[(0,r.jsx)("circle",{cx:"4",cy:"8",r:"4",fill:"currentColor"}),(0,r.jsx)("path",{stroke:"currentColor",strokeWidth:"2",d:"M 1 8 L 15 8",strokeLinejoin:"round",strokeLinecap:"round"})]})})},tt=({type:e,active:t,onClick:n,flipped:i})=>{let a=te[e];return(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:n,className:(0,
28c.cn)(t&&"pn:bg-muted"),children:i?(0,r.jsx)("span",{style:{transform:"scaleX(-1)",display:"inline-flex"},children:a}):a})},tn=(0,a.PA)(({elements:e,store:t,property:n})=>{let i="endHead"===n,a=te[e[0][n]],o=i?(0,r.jsx)("span",{style:{transform:"scaleX(-1)",display:"inline-flex"},children:a}):a,l=r=>{t.history.transaction(()=>{e.forEach(e=>{e.set({[n]:r})})})},d=(0,P.t)("startHead"===n?"toolbar.lineStartHead":"toolbar.lineEndHead");return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":d,children:o})})}),(0,r.jsx)(s.ZI,{children:d})]}),(0,r.jsxs)(O.hl,{className:"pn:w-[150px] pn:p-2.5",align:"start",children:[(0,r.jsx)("div",{className:"pn:flex pn:items-center pn:justify-between",children:["","arrow","triangle"].map(t=>(0,r.jsx)(tt,{type:t,active:e[0][n]===t,onClick:()=>{l(t)},flipped:i},t))}),(0,r.jsx)("div",{className:"pn:flex pn:items-center pn:justify-between",children:["bar","square","circle"].map(t=>(0,r.jsx)(tt,{type:t,active:e[0][n]===t,onClick:()=>{l(t)},flipped:i},t))})]})]})}),tr={LineSettings:e6,LineColor:e9,LineHeads:(0,a.PA)(({elements:e,store:t})=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(tn,{elements:e,store:t,property:"startHead"}),(0,r.jsx)(tn,{elements:e,store:t,property:"endHead"})]})),LineAnimations:ee},ti=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements[0],i=["LineColor","LineSettings","LineHeads",o.Mv.animationsEnabled&&"LineAnimations"].filter(e=>!!e),a=(0,et.z)({type:"line",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tr[i];return(0,r.jsx)(a,{element:n,store:e,elements:e.selectedElements},i)}})});var ta=n(91908),to=n(19009),tl=n(12438);let ts=(0,a.PA)(({element:e})=>{let t=i.useRef(null),[n,a]=i.useState([]);i.useEffect(()=>{a([])},[e.src]);let o=async()=>{if(!e.src||n.length)return;let{width:r,height:i}=await (0,to.H0)(e.src);if(!t.current)return;let{src:o}=e,l=t.current.offsetHeight,s=Math.ceil(t.current.offsetWidth/(r/i*l)),d=await (0,to.qZ)(o),c=document.createElement("video");c.crossOrigin="anonymous",c.src=o;let u=document.createElement("canvas");u.width=480;try{await new Promise((e,t)=>{c.addEventListener("loadeddata",()=>{let t=c.videoWidth/c.videoHeight;u.height=480/t,e()}),c.addEventListener("error",t)}),a([]);for(let e=0;e<s;e++){let t=e*d/s,n=await (0,to.XW)(c,u,t);a(e=>e.concat(n))}}catch(e){console.error("Error generating previews:",e)}},l=n=>(0,r.jsx)("div",{className:"polotno-video-trim-handle pn:w-[10px] pn:touch-pan-y pn:pointer-coarse:w-5",style:Object.assign(Object.assign({position:"absolute",top:"0"},"start"===n?{left:100*e.startTime+"%"}:{right:100-100*e.endTime+"%"}),{height:"30px",borderRadius:"0px",backgroundColor:"rgb(0, 161, 255, 0.9)",cursor:"ew-resize"}),onPointerDown:r=>((n,r)=>{if(!(0,tl.TS)(n))return;let i=n.clientX,{width:a}=t.current.getBoundingClientRect(),o=e.startTime,l=e.endTime;(0,tl.ez)(n,{slopX:tl.vn,onMove:t=>{let n=(t.clientX-i)/a;"start"===r?e.set({startTime:(0,c.q)(o+n,0,l)}):e.set({endTime:(0,c.q)(l+n,o,1)})}})})(r,n)});return(0,r.jsxs)(O.AM,{onOpenChange:e=>{e&&setTimeout(o,0)},children:[(0,r.jsx)(O.Wv,{render:(0,r.jsxs)(p.$,{variant:"ghost",size:"sm",children:[(0,r.jsx)(u.dc,{name:"toolbar.trim",className:"pn:size-4"}),"Trim"]})}),(0,r.jsx)(O.hl,{align:"start",className:"pn:p-3",style:{width:"600px"},children:(0,r.jsxs)("div",{className:"pn:flex pn:items-center",children:[(0,r.jsx)("div",{className:"pn:flex pn:h-[30px] pn:items-center pn:rounded-md pn:border pn:border-input pn:px-3 pn:text-sm pn:tabular-nums",children:(e.duration*(e.endTime-e.startTime)/1e3).toFixed(2)}),(0,r.jsx)("span",{className:"pn:ml-1 pn:text-xs pn:text-muted-foreground",children:(0,P.t)("toolbar.seconds")}),(0,r.jsxs)("div",{style:{flex:1,height:"30px",display:"flex",position:"relative",overflow:"hidden",marginLeft:"10px",borderRadius:"4px"},ref:t,children:[n.map((e,t)=>(0,r.jsx)("img",{src:e,style:{width:"auto",height:"100%",objectFit:"cover"}},t)),(0,r.jsx)("div",{style:{position:"absolute",top:"0",left:0,width:100*e.startTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),(0,r.jsx)("div",{style:{position:"absolute",top:"0",right:"0%",width:100-100*e.endTime+"%",height:"30px",backgroundColor:"rgb(0, 0, 0, 0.5)"}}),l("start"),l("end")]})]})})]})}),td=(0,a.PA)(({element:e})=>{let t=Math.round(100*e.volume),n=t=>
28{e.set({volume:t/100})};return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.volume"),children:(0,r.jsx)(u.dc,{name:"action.unmuted",className:"pn:size-4"})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.volume")})]}),(0,r.jsx)(O.hl,{style:{padding:"10px",width:"250px"},align:"start",children:(0,r.jsxs)("div",{style:{display:"flex",width:"100%",justifyContent:"space-between"},children:[(0,r.jsx)("div",{style:{paddingTop:"7px",paddingLeft:"10px",width:"calc(100% - 80px)"},children:(0,r.jsx)(H.A,{value:[t],onValueChange:e=>{n((0,c.V)(e))},min:0,max:100,step:1})}),(0,r.jsx)(N.O,{value:t,onValueChange:e=>{n((0,c.q)(e,0,100))},style:{width:"50px",padding:"0 5px",marginLeft:"10px"},min:0,max:100})]})})]})}),tc={VideoTrim:ts,VideoAnimations:ee,VideoVolume:td,VideoSpeed:(0,a.PA)(({element:e})=>(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsxs)(p.$,{variant:"ghost",size:"sm","aria-label":(0,P.t)("toolbar.speed"),children:[(0,r.jsx)(u.dc,{name:"toolbar.duration",className:"pn:size-4"}),e.speed,"\xd7"]})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.speed")})]}),(0,r.jsxs)(O.hl,{style:{padding:"10px",width:"250px"},align:"start",children:[(0,r.jsx)("div",{style:{fontSize:"12px",marginBottom:"8px"},children:(0,P.t)("toolbar.speed")}),(0,r.jsx)(ta.DB,{value:e.speed,onChange:t=>e.set({speed:t})})]})]})),VideoClip:(0,a.PA)(({element:e,store:t})=>e.contentEditable?e.clipSrc?(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:()=>{e.set({clipSrc:""})},children:(0,P.t)("toolbar.removeClip")}):(0,r.jsx)(p.$,{variant:"ghost",size:"sm",onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("image-clip")},children:(0,P.t)("toolbar.clip")}):null)},tu=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=["VideoTrim","VideoVolume","VideoSpeed","VideoClip",o.Mv.animationsEnabled&&"VideoAnimations"],a=(0,et.z)({type:"video",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tc[i];return(0,r.jsx)(a,{elements:n,element:n[0],store:e},i)}})}),tp=(0,a.PA)(({elements:e,store:t})=>(0,r.jsx)($.sk,{value:e[0].fill,gradientEnabled:!0,onChange:n=>t.history.transaction(()=>{e.forEach(e=>{e.set({fill:n})})}),store:t})),th=(0,a.PA)(({store:e,elements:t})=>{let n=n=>{e.history.transaction(()=>{t.forEach(e=>{e.set(n)})})},i=Math.min(t[0].width,t[0].height)/2,a=Math.max(t[0].width,t[0].height)/2;return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.strokeSettings"),children:(0,r.jsx)(I,{})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.strokeSettings")})]}),(0,r.jsxs)(O.hl,{className:"pn:w-[270px] pn:p-4",align:"start",children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:pb-4",children:[(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:()=>{n({strokeWidth:0})},className:(0,c.cn)("pn:h-[34px] pn:w-[44px]",0===t[0].strokeWidth&&"pn:bg-muted"),children:(0,r.jsx)(u.dc,{name:"action.none",className:"pn:size-5"})}),[{dash:[],active:0===t[0].dash.length,Icon:D.solid},{dash:[4,1],active:4===t[0].dash[0],Icon:D.large},{dash:[2,1],active:2===t[0].dash[0],Icon:D.medium},{dash:[1,1],active:1===t[0].dash[0],Icon:D.small}].map(({dash:e,active:i,Icon:a},o)=>(0,r.jsx)(F,{active:!!t[0].strokeWidth&&i,onClick:()=>{n({dash:e,strokeWidth:t[0].strokeWidth||10})},icon:(0,r.jsx)(a,{})},o))]}),(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.strokeWidth"),value:Math.round(t[0].strokeWidth),sliderValue:t[0].strokeWidth,onChange:e=>{n({strokeWidth:e})},min:0,max:Math.round(i),sliderMax:i}),"rect"===t[0].subType&&(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.cornerRadius"),value:Math.round(t[0].cornerRadius),sliderValue:t[0].cornerRadius,onChange:e=>{n({cornerRadius:e})},min:0,max:Math.round(a),sliderMax:a})]})]})}),tm={FigureFill:tp,FigureStroke:(0,a.PA)(({elements:e,store:t})=>e.find(e=>e.strokeWidth)?(0,r.jsx)($.sk,{value:e[0].stroke,gradientEnabled:!0,onChange:n=>t.history.transaction(()=>
28{e.forEach(e=>{e.set({stroke:n})})}),store:t}):null),FigureSettings:th,FigureAnimations:ee,FigureFilters:W.VD},tf=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements[0],i=["FigureFill","FigureStroke","FigureSettings","FigureFilters",o.Mv.animationsEnabled&&"FigureAnimations"].filter(e=>!!e),a=(0,et.z)({type:"figure",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tm[i];return(0,r.jsx)(a,{element:n,store:e,elements:e.selectedElements},i)}})}),tg={GifFilters:W.Ay,GifAnimations:ee},tx=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=["GifFilters",o.Mv.animationsEnabled&&"GifAnimations"].filter(e=>!!e),a=(0,et.z)({type:"gif",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tg[i];return(0,r.jsx)(a,{elements:n,element:n[0],store:e},i)}})}),tv={ManyAnimations:ee},tb=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=[o.Mv.animationsEnabled&&"ManyAnimations"],a=(0,et.z)({type:"many",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tv[i];return(0,r.jsx)(a,{elements:n,element:n[0],store:e},i)}})}),ty={stroke:"currentColor",strokeWidth:1,strokeOpacity:.25},tw={stroke:"currentColor",strokeWidth:2},tj=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("rect",Object.assign({x:"2",y:"2",width:"16",height:"16",fill:"none"},ty)),(0,r.jsx)("line",Object.assign({x1:"10",y1:"2",x2:"10",y2:"18"},ty)),(0,r.jsx)("line",Object.assign({x1:"2",y1:"10",x2:"18",y2:"10"},ty))]}),tk=({children:e})=>(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,r.jsx)(tj,{}),e]}),tC=[{key:"all",labelKey:"toolbar.borderModeAll",icon:()=>(0,r.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:[(0,r.jsx)("rect",Object.assign({x:"2",y:"2",width:"16",height:"16",fill:"none"},tw)),(0,r.jsx)("line",Object.assign({x1:"10",y1:"2",x2:"10",y2:"18"},tw)),(0,r.jsx)("line",Object.assign({x1:"2",y1:"10",x2:"18",y2:"10"},tw))]})},{key:"outer",labelKey:"toolbar.borderModeOuter",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("rect",Object.assign({x:"2",y:"2",width:"16",height:"16",fill:"none"},tw))})},{key:"inner",labelKey:"toolbar.borderModeInner",icon:()=>(0,r.jsxs)(tk,{children:[(0,r.jsx)("line",Object.assign({x1:"10",y1:"2",x2:"10",y2:"18"},tw)),(0,r.jsx)("line",Object.assign({x1:"2",y1:"10",x2:"18",y2:"10"},tw))]})},{key:"topOnly",labelKey:"toolbar.borderModeTopOnly",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"2",y1:"2",x2:"18",y2:"2"},tw))})},{key:"innerHorizontal",labelKey:"toolbar.borderModeInnerHorizontal",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"2",y1:"10",x2:"18",y2:"10"},tw))})},{key:"bottomOnly",labelKey:"toolbar.borderModeBottomOnly",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"2",y1:"18",x2:"18",y2:"18"},tw))})},{key:"leftOnly",labelKey:"toolbar.borderModeLeftOnly",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"2",y1:"2",x2:"2",y2:"18"},tw))})},{key:"innerVertical",labelKey:"toolbar.borderModeInnerVertical",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"10",y1:"2",x2:"10",y2:"18"},tw))})},{key:"rightOnly",labelKey:"toolbar.borderModeRightOnly",icon:()=>(0,r.jsx)(tk,{children:(0,r.jsx)("line",Object.assign({x1:"18",y1:"2",x2:"18",y2:"18"},tw))})}],tE=(0,a.PA)(({elements:e,store:t})=>{let n,a,o=e[0],l="tablecell"===o.type,d=l?t.selectedElements[0]:o,[h,m]=i.useState("all");if(l){let e=d.getFocusedCellRange();n=e?e.maxRow-e.minRow+1:1,a=e?e.maxCol-e.minCol+1:1}else n=d.rows,a=d.cols;let f=n>1,g=a>1,x=e=>"innerHorizontal"===e?!f:("innerVertical"===e||"inner"===e&&!f)&&!g;i.useEffect(()=>{x(h)&&m("all")},[h,f,g]);let v={all:"top",outer:"top",topOnly:"top",topBottom:"top",bottomOnly:"bottom",innerHorizontal:"bottom",inner:"bottom",leftOnly:"left",rightOnly:"right",innerVertical:"right"}[h],b=l?o:"bottomOnly"===h?d.getCell(d.rows-1,0):"rightOnly"===h?d.getCell(0,d.cols-1):d.getCell(0,0),y=(null==b?void 0:b.getEffectiveBorder)?b.getEffectiveBorder(v):{color:d.borderColor,width:d.borderWidth,style:d.borderStyle},w=y.color,j=y.width,k=y.style,C=(n,r={})=>{var i,a;let o=j<=0||"none"===k,s=null!=(i=r.style)?i:o?"solid":k,c=void 0!==r.width?r.width:o?1:j,u={color:null!=(a=r.color)?a:w,width:c,style:s};t.history.transaction(()=>
28{d.applyBorderMode(n,u),"all"!==n||l||e.forEach(e=>e.set({borderColor:u.color,borderWidth:u.width,borderStyle:u.style}))})},E=e=>{C(h,{style:e})};return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.tableBorderSettings"),children:(0,r.jsx)(I,{})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.tableBorderSettings")})]}),(0,r.jsx)(O.hl,{className:"pn:w-auto pn:p-3",align:"start",children:(0,r.jsxs)("div",{className:"pn:flex pn:gap-3",children:[(0,r.jsx)("div",{className:"pn:grid pn:grid-cols-[repeat(3,32px)] pn:auto-rows-[32px] pn:gap-1",children:tC.map(({key:e,labelKey:t,icon:n})=>{let i=x(e);return(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"outline",size:"sm",disabled:i,className:(0,c.cn)("pn:size-8 pn:p-0",!i&&h===e&&"pn:bg-muted"),onClick:()=>{m(e)},"aria-label":(0,P.t)(t),children:(0,r.jsx)(n,{})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)(t)})]},e)})}),(0,r.jsx)("div",{className:"pn:w-px pn:bg-border"}),(0,r.jsxs)("div",{className:"pn:flex pn:w-[170px] pn:flex-col pn:gap-2",children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between",children:[(0,r.jsx)("span",{className:"pn:text-xs",children:(0,P.t)("toolbar.tableBorderColor")}),(0,r.jsx)($.sk,{value:w,onChange:e=>{C(h,{color:e})},store:t})]}),(0,r.jsx)(M.K,{label:(0,P.t)("toolbar.tableBorderWidth"),value:j,onChange:e=>{C(h,{width:e})},min:0,max:20}),(0,r.jsxs)("div",{className:"pn:flex pn:justify-between pn:gap-1",children:[(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:()=>E("none"),className:(0,c.cn)("pn:flex-1","none"===k&&"pn:bg-muted"),children:(0,r.jsx)(u.dc,{name:"action.none",className:"pn:size-4"})}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:()=>E("solid"),className:(0,c.cn)("pn:flex-1","solid"===k&&"pn:bg-muted"),children:(0,r.jsx)("svg",{width:"20",height:"14",viewBox:"0 0 20 14",children:(0,r.jsx)("line",{x2:"20",y1:"7",y2:"7",stroke:"currentColor",strokeWidth:"2"})})}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:()=>E("dashed"),className:(0,c.cn)("pn:flex-1","dashed"===k&&"pn:bg-muted"),children:(0,r.jsx)("svg",{width:"20",height:"14",viewBox:"0 0 20 14",children:(0,r.jsx)("line",{x2:"20",y1:"7",y2:"7",stroke:"currentColor",strokeDasharray:"4 2",strokeWidth:"2"})})}),(0,r.jsx)(p.$,{variant:"outline",size:"sm",onClick:()=>E("dotted"),className:(0,c.cn)("pn:flex-1","dotted"===k&&"pn:bg-muted"),children:(0,r.jsx)("svg",{width:"20",height:"14",viewBox:"0 0 20 14",children:(0,r.jsx)("line",{x2:"20",y1:"7",y2:"7",stroke:"currentColor",strokeDasharray:"2 2",strokeWidth:"2"})})})]})]})]})})]})}),tS=()=>(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,r.jsx)("rect",{x:"1",y:"1",width:"14",height:"14",rx:"1",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),(0,r.jsx)("line",{x1:"5.5",y1:"1",x2:"5.5",y2:"15",stroke:"currentColor",strokeWidth:"1"}),(0,r.jsx)("line",{x1:"10.5",y1:"1",x2:"10.5",y2:"15",stroke:"currentColor",strokeWidth:"1"}),(0,r.jsx)("line",{x1:"1",y1:"5.5",x2:"15",y2:"5.5",stroke:"currentColor",strokeWidth:"1"}),(0,r.jsx)("line",{x1:"1",y1:"10.5",x2:"15",y2:"10.5",stroke:"currentColor",strokeWidth:"1"})]}),tP=(0,a.PA)(({element:e,store:t})=>{let n=e.focusedCells[0],i=null==n?void 0:n.row,a=null==n?void 0:n.col;return(0,r.jsxs)("div",{className:"pn:p-1",children:[null!=n&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"pn:px-2 pn:py-1 pn:text-xs pn:font-semibold pn:text-muted-foreground",children:(0,P.t)("toolbar.tableRows")}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.addRow(i)})},children:(0,P.t)("toolbar.insertRowAbove")}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.addRow(i+1)})},children:(0,P.t)("toolbar.insertRowBelow")}
28),(0,r.jsx)("button",{type:"button",disabled:e.rows<=1,className:(0,c.cn)("pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",e.rows<=1&&"pn:pointer-events-none pn:opacity-50"),onClick:()=>{t.history.transaction(()=>{e.removeRow(i)})},children:(0,P.t)("toolbar.deleteRow")}),(0,r.jsx)("div",{className:"pn:my-1 pn:border-t pn:border-border"}),(0,r.jsx)("div",{className:"pn:px-2 pn:py-1 pn:text-xs pn:font-semibold pn:text-muted-foreground",children:(0,P.t)("toolbar.tableColumns")}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.addColumn(a)})},children:(0,P.t)("toolbar.insertColumnLeft")}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.addColumn(a+1)})},children:(0,P.t)("toolbar.insertColumnRight")}),(0,r.jsx)("button",{type:"button",disabled:e.cols<=1,className:(0,c.cn)("pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",e.cols<=1&&"pn:pointer-events-none pn:opacity-50"),onClick:()=>{t.history.transaction(()=>{e.removeColumn(a)})},children:(0,P.t)("toolbar.deleteColumn")}),(0,r.jsx)("div",{className:"pn:my-1 pn:border-t pn:border-border"})]}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.distributeRowsEvenly()})},children:(0,P.t)("toolbar.distributeRowsEvenly")}),(0,r.jsx)("button",{type:"button",className:"pn:flex pn:w-full pn:items-center pn:rounded-sm pn:px-2 pn:py-1.5 pn:text-sm pn:hover:bg-muted",onClick:()=>{t.history.transaction(()=>{e.distributeColumnsEvenly()})},children:(0,P.t)("toolbar.distributeColumnsEvenly")})]})}),tN=(0,a.PA)(({elements:e,store:t})=>{let n=e[0];return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm","aria-label":(0,P.t)("toolbar.tableStructure"),children:(0,r.jsx)(tS,{})})})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.tableStructure")})]}),(0,r.jsx)(O.hl,{className:"pn:w-auto pn:p-0",align:"start",children:(0,r.jsx)(tP,{element:n,store:t})})]})});(0,a.PA)(({elements:e,store:t})=>(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(W.Q7,{value:e[0].cellPadding,onValueChange:n=>t.history.transaction(()=>{e.forEach(e=>e.set({cellPadding:n}))}),style:{width:"64px"},min:0,max:50})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.cellPadding")})]}));let tA={TableBorderSettings:tE,TextFontFamily:ec,TextFontSize:eu,TextFill:ex,CellBackgroun
28d:(0,a.PA)(({elements:e,store:t})=>(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)($.sk,{value:e[0].cellBackground,onChange:n=>t.history.transaction(()=>{e.forEach(e=>e.set({cellBackground:n}))}),store:t})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.cellBackground")})]})),TextFontVariant:ef,CellVerticalAlign:(0,a.PA)(({elements:e,store:t})=>{let n=e[0];return(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",onClick:()=>{let r=z(eh,n.verticalAlign);t.history.transaction(()=>{e.forEach(e=>e.set({verticalAlign:r}))})},"aria-label":(0,P.t)("toolbar.verticalAlign"),children:em[n.verticalAlign]})}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.verticalAlign")})]})}),TextSpacing:ev},tM=Object.assign(Object.assign({},{TableStructure:tN,TableAnimations:ee}),tA),tO=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements[0],i=n.focusedCells,a=i.length>0,l=["TableBorderSettings","CellBackground","TableStructure",...a?["TextFontFamily","TextFontSize","TextFill","TextFontVariant","CellVerticalAlign","TextSpacing"]:[],o.Mv.animationsEnabled&&"TableAnimations"],s=(0,et.z)({type:"table",usedItems:l,components:t});return(0,r.jsx)(et.S,{items:s,itemRender:o=>{let l,s=(null==t?void 0:t[o])||tM[o],d=!!tA[o];
28return d&&!a&&"TableBorderSettings"!==o&&"CellBackground"!==o?null:(l=d?a?i:"TableBorderSettings"===o?e.selectedElements:n.cells.slice():e.selectedElements,(0,r.jsx)(s,{element:n,store:e,elements:l},o))}})});var tT=n(48394);let tR=(0,a.PA)(({store:e})=>e.activePage?(0,r.jsx)($.sk,{value:e.activePage.background||"white",onChange:t=>{e.activePage.set({background:t})},store:e,gradientEnabled:!0}):null),t_={PageDuration:(0,a.PA)(({store:e})=>{if(!e.activePage)return null;let{duration:t}=e.activePage;return(0,r.jsxs)(O.AM,{children:[(0,r.jsx)(O.Wv,{render:(0,r.jsxs)(p.$,{variant:"ghost",size:"sm",children:[(0,r.jsx)(u.dc,{name:"toolbar.duration",className:"pn:mr-1 pn:size-4"}),(e.activePage.duration/1e3).toFixed(1),"s"]})}),(0,r.jsxs)(O.hl,{side:"bottom",className:"pn:w-[230px] pn:p-[15px]",children:[(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.duration"),className:"pn:py-[5px]",children:(0,r.jsx)("div",{children:(0,r.jsx)(N.Q,{value:t/1e3,onValueChange:t=>{e.activePage.set({duration:1e3*t})},style:{width:"50px"},min:0})})}),(0,r.jsx)(H.A,{value:[Math.min(t/1e3,50)],onValueChange:t=>{let n=(0,c.V)(t);e.activePage.set({duration:1e3*n})},min:0,max:50,step:.1})]})]})}),PageBackground:tR},tz=(0,a.PA)(({store:e,components:t})=>{let n=["PageBackground",o.Mv.animationsEnabled&&"PageDuration"],i=(0,et.z)({type:"page",usedItems:n,components:t});return(0,r.jsx)(et.S,{items:i,itemRender:n=>{let i=t[n]||t_[n];return(0,r.jsx)(i,{store:e},n)}})}),tI={GroupAnimations:ee},tD=(0,a.PA)(({store:e,components:t})=>{let n=e.selectedElements,i=[o.Mv.animationsEnabled&&"GroupAnimations"],a=(0,et.z)({type:"group",usedItems:i,components:t});return(0,r.jsx)(et.S,{items:a,itemRender:i=>{let a=t[i]||tI[i];return(0,r.jsx)(a,{elements:n,element:n[0],store:e},i)}})});var tF=n(47185),tL=n(93026),tB=n(99577),t$=n(38475);let tW=(0,a.PA)(({store:e})=>{let{lock:t,locked:n,disabled:i}=(0,t$.V)({store:e}),a=(0,r.jsx)(u.dc,n?{name:"action.lock",className:"pn:size-4"}:{name:"action.unlock",className:"pn:size-4"}),o=(0,P.t)(n?"toolbar.lockedDescription":"toolbar.unlockedDescription");return(0,r.jsx)(T.p,{label:o,hideTooltipWhenDisabled:!0,disabled:i,onClick:()=>t(),children:a})});var tV=n(6522);let tH=(0,a.PA)(({store:e})=>{var t,n;let i=e.selectedShapes.length>0,a=t=>{t=Math.max(0,Math.min(t,100)),e.selectedShapes.forEach(e=>{e.set({opacity:t/100})})},o=Math.round(100*(null!=(n=null==(t=e.selectedShapes[0])?void 0:t.opacity)?n:0));return(0,r.jsxs)(O.AM,{children:[(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",disabled:!i,"aria-label":(0,P.t)("toolbar.transparency"),children:(0,r.jsx)(u.dc,{name:"toolbar.opacity",className:"pn:size-4"})})})}),i&&(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.transparency")})]}),(0,r.jsxs)(O.hl,{side:"bottom",className:"pn:w-auto pn:px-5 pn:py-2.5",children:[(0,r.jsx)("div",{className:"pn:mb-2 pn:text-center",children:(0,P.t)("toolbar.transparency")}),(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-4",children:[(0,r.jsx)(H.A,{style:{width:150},value:[o],onValueChange:e=>a((0,c.V)(e)),min:0,max:100,step:1}),(0,r.jsx)(N.O,{value:o,onValueChange:e=>a(e),min:0,max:100,style:{width:"64px"},onFocus:e=>e.currentTarget.select()})]})]})]})}),tq=(0,a.PA)(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElements[0]||{},i=t=>{e.selectedElements.forEach(e=>{e.set(t)})};return(0,r.jsxs)(O.AM,{children:[(0,r.jsx)(O.Wv,{render:(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",disabled:!t,"aria-label":"Admin settings",children:(0,r.jsx)(u.dc,{name:"action.settings",className:"pn:size-4"})})}),(0,r.jsxs)(O.hl,{align:"start",className:"pn:flex pn:flex-col pn:gap-3 pn:w-[220px] pn:px-[15px] pn:pt-[25px] pn:pb-[15px]",children:[(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.selectable"),children:(0,r.jsx)(q.d,{checked:n.selectable,onCheckedChange:e=>{i({selectable:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.draggable"),children:(0,r.jsx)(q.d,{checked:n.draggable,onCheckedChange:e=>{i({draggable:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.removable"),children:(0,r.jsx)(q.d,{checked:n.removable,onCheckedChange:e=>{i({removable:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.resizable"),children:(0,r.jsx)(q.d,{checked:n.resizable,onCheckedChange:e=>{i({resizable:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.contentEditable"),children:(0,r.jsx)(q.d,{checked:n.contentEditable,onCheckedChange:e=>{i({contentEditable:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.styleEditable"),children:(0,r.jsx)(q.d,{checked:n.styleEditable,onCheckedChange:e=>{i({styleEditable:e})}})}),(0,r.jsx)(R.w,{className:"pn:my-1"}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.alwaysOnTop"),children:(0,r.jsx)(q.d,{checked:n.alwaysOnTop,onCheckedChange:e=>{i({alwaysOnTop:e})}})}),(0,r.jsx)(tT.R,{label:(0,P.t)("toolbar.showInExport"),children:(0,r.jsx)(q.d,{checked:n.showInExport,onCheckedChange:e=>{i({showInExport:e})}})})]})]})});var tK=n(42840);let tU=["opacity","visible","height","width","shadowEnabled","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","blurEnabled","blurRadius","brightnessEnabled","brightness","sepiaEnabled","grayscaleEnabled"],tX=[...tU,"fontSize","fontWeight","fontFamily","lineHeight","stroke","strokeWidth","textDecoration","fill","align","verticalAlign","letterSpacing","backgroundEnabled","backgroundColor","backgroundOpacity","backgroundCornerRadius","backgroundPadding"],tY=[...tU,"flipX","flipY","keepRatio","borderColor","borderSize","cornerRadius","cropX","cropY","cropWidth","cropHeight"],tZ=[...tU,"flipX","flipY","keepRatio","borderColor","borderSize","cornerRadius","cropX","cropY","cropWidth","cropHeight"],tG=[...tU,"color","dash","endHead","startHead"],tQ=["fontSize","fontFamily","fontWeight","fontStyle","textDecoration","fill","align","verticalAlign","lineHeight","letterSpacing","cellBackgroun
28d","cellPadding","borders"],tJ={figure:[...tU,"dash","cornerRadius","fill","stroke","strokeWidth"],image:tY,line:tG,svg:[...tU,"cornerRadius","borderColor","borderSize","colorsReplace","cropHeight","cropWidth","cropX","cropY","flipX","flipY","keepRatio"],text:tX,video:tZ,table:[...tU,"borderColor","borderWidth","borderStyle"]},t0=["width","height"],t1=(0,a.PA)(({store:e})=>{let{disabled:t,elementToCopy:n,setElementToCopy:a}=(e=>{let[t,n]=(0,i.useState)(null);return(0,i.useEffect)(()=>{let r=e.selectedElements;t&&(r.forEach(e=>{let n=((e,t)=>{let n=new Set(t);return[...new Set(e)].filter(e=>n.has(e))})(tJ[e.type],tJ[t.type]).reduce((e,n)=>{let r=t[n];return Array.isArray(r)?r=[...r]:"object"==typeof r&&null!==r&&(r=Object.assign({},r)),Object.assign(Object.assign({},e),{[n]:r})},{});e.type!==t.type&&t0.forEach(e=>{delete n[e]}),e.set(Object.assign({},n)),"table"===t.type&&"table"===e.type&&function(e,t){let n=Math.min(e.rows,t.rows),r=Math.min(e.cols,t.cols);for(let i=0;i<n;i++)for(let n=0;n<r;n++){let r=e.getCell(i,n),a=t.getCell(i,n);if(!r||!a)continue;let o={};for(let e of tQ)o[e]=r[e];a.set(o)}}(t,e)}),n(null))},[e.selectedElements[0]]),{elementToCopy:t,disabled:1!==e.selectedElements.length,setElementToCopy:n}})(e),o=(0,r.jsx)(p.$,{variant:"ghost",size:"icon-sm",className:(0,c.cn)(n&&"pn:bg-primary pn:text-primary-foreground pn:hover:bg-primary/90 pn:hover:text-primary-foreground"),disabled:t,onClick:()=>{a(e.selectedElements[0])},"aria-label":(0,P.t)("toolbar.copyStyle"),children:t2});return t?o:(0,r.jsxs)(s.m_,{children:[(0,r.jsx)(s.k$,{render:o}),(0,r.jsx)(s.ZI,{children:(0,P.t)("toolbar.copyStyle")})]})}),t2=(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",className:"pn:size-4",children:[(0,r.jsx)("rect",{width:"16",height:"6",x:"2",y:"2",rx:"2"}),(0,r.jsx)("path",{d:"M10 16v-2a2 2 0 0 1 2-2h8a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-2"}),(0,r.jsx)("rect",{width:"4",height:"6",x:"8",y:"16",rx:"1"})]}),t5={text:ey,image:eG,svg:e7,many:tb,line:ti,video:tu,figure:tf,gif:tx,table:tO,page:tz,group:tD},t3=(0,a.PA)(({store:e,downloadButtonEnabled:t,components:n={}})=>{let a=1===new Set(e.selectedElements.map(e=>e.type)).size,u=1===e.selectedElements.length,p=e.selectedElements[0],m=e.selectedElements.every(e=>e.styleEditable),f=m&&u&&p?t5[p.type]:void 0;a&&p?f=t5[p.type]:e.selectedElements.length>1&&(f=t5.many),0===e.selectedElements.length&&1===e._selectedPagesIds.length&&(f=t5.page),a&&p&&"text"===p.type&&(o.Mv.htmlRenderEnabled||o.Mv.renderTagTextEnabled)&&t5.text===ey&&(f=eB);let g=u&&!!(null==p?void 0:p._cropModeEnabled),x=i.useRef(n);(Object.keys(n).some(e=>n[e]!==x.current[e])||Object.keys(x.current).some(e=>!(e in n)))&&(x.current=Object.assign({},n));let v=x.current,{containerRef:b,condensed:y}=function(e=480){let t=(0,i.useRef)(null),[n,r]=(0,i.useState)(!1),a=(0,i.useCallback)(()=>{t.current&&r(t.current.clientWidth<e)},[e]);return(0,i.useEffect)(()=>{let e=t.current;if(!e)return;let n=new ResizeObserver(()=>a());n.observe(e);let r=new MutationObserver(()=>a());return r.observe(e,{childList:!0,subtree:!0,attributes:!0}),window.addEventListener("resize",a),requestAnimationFrame(a),()=>{n.disconnect(),r.disconnect(),window.removeEventListener("resize",a)}},[a]),{containerRef:t,condensed:n}}(480),w=(null==v?void 0:v.ActionControls)||(t?tF.f:null),j=(null==v?void 0:v.Position)||tV.I,k=(null==v?void 0:v.Opacity)||tH,C=(null==v?void 0:v.Lock)||tW,E=(null==v?void 0:v.Duplicate)||tL.U,S=(null==v?void 0:v.Remove)||tB.d,P=(null==v?void 0:v.Group)||tK._,N=(null==v?void 0:v.History)||h,A=(null==v?void 0:v.Admin)||tq,M=(null==v?void 0:v.CopyStyle)||t1;return(0,r.jsx)(d.a,{elementRef:b,children:(0,r.jsx)(s.Bc,{delay:300,children:(0,r.jsx)(l.Fp,{ref:b,attached:"bottom",className:(0,c.cn)("pn-toolbar polotno-toolbar pn:min-w-0 pn:max-w-full pn:overflow-x-auto pn:overflow-y-hidden",y&&"pn-toolbar--condensed condensed"),children:(0,r.jsxs)("div",{className:"pn-toolbar-inner pn:flex pn:h-full pn:w-full pn:min-w-0 pn:items-center pn:max-md:flex",children:[!g&&(0,r.jsx)(N,{store:e}),f&&m&&(0,r.jsx)(f,{store:e,components:v}),!g&&(0,r.jsxs)(l.Fp.Group,{align:"right",className:"pn:gap-0.5",children:["admin"===e.role&&(0,r.jsx)(A,{store:e}),(0,r.jsx)(P,{store:e}),(0,r.jsx)(j,{store:e}),m&&(0,r.jsx)(k,{store:e}),(0,r.jsx)(C,{store:e}),(0,r.jsx)(E,{store:e}),(0,r.jsx)(S,{store:e}),(0,r.jsx)(M,{store:e}),w&&(0,r.jsxs)(i.Fragment,{children:[(0,r.jsx)(l.Fp.Divider,{}),(0,r.jsx)(w,{store:e})]})]})]})})})})})},31369:(e,t,n)=>{"use strict";n.d(t,{x:()=>o});var r=n(12115),i=n(99793);let a=r.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:i.tE,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function o(){return r.useContext(a)}},32467:(e,t,n)=>{"use strict";n.d(t,{DX:()=>d,Dc:()=>u,TL:()=>s});var r,i=n(12115),a=n(94446),o=Object.defineProperty,l=(e,t)=>
28o(e,"name",{value:t,configurable:!0});function s(e){let t=i.forwardRef((t,n)=>{let{children:r,...o}=t,l=null,s=!1,d=[];x(r)&&"function"==typeof w&&(r=w(r._payload)),i.Children.forEach(r,e=>{if(f(e)){s=!0;let t="child"in e.props?e.props.child:e.props.children;x(t)&&"function"==typeof w&&(t=w(t._payload)),l=p(e,t),d.push(l?.props?.children)}else d.push(e)}),l?l=i.cloneElement(l,void 0,d):!s&&1===i.Children.count(r)&&i.isValidElement(r)&&(l=r);let c=l?m(l):void 0,u=(0,a.s)(n,c);if(!l){if(r||0===r)throw Error(s?y(e):b(e));return r}let g=h(o,l.props??{});return l.type!==i.Fragment&&(g.ref=n?u:c),i.cloneElement(l,g)});return t.displayName=`${e}.Slot`,t}l(s,"createSlot");var d=s("Slot"),c=Symbol.for("radix.slottable");function u(e){let t=l(e=>"child"in e?e.children(e.child):e.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=c,t}l(u,"createSlottable");var p=l((e,t)=>{if("child"in e.props){let t=e.props.child;return i.isValidElement(t)?i.cloneElement(t,void 0,e.props.children(t.props.children)):null}return i.isValidElement(t)?t:null},"getSlottableElementFromSlottable");function h(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):"style"===r?n[r]={...i,...a}:"className"===r&&(n[r]=[i,a].filter(Boolean).join(" "))}return{...e,...n}}function m(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}function f(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===c}l(h,"mergeProps"),l(m,"getElementRef"),l(f,"isSlottable");var g=Symbol.for("react.lazy");function x(e){return null!=e&&"object"==typeof e&&"$$typeof"in e&&e.$$typeof===g&&"_payload"in e&&v(e._payload)}function v(e){return"object"==typeof e&&null!==e&&"then"in e}l(x,"isLazyComponent"),l(v,"isPromiseLike");var b=l(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),y=l(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),w=(r||(r=n.t(i,2)))[" use ".trim().toString()]},34357:(e,t,n)=>{"use strict";n.d(t,{YQ:()=>i,d7:()=>o});var r=n(12115);function i(e,t,n,i){var a=this,o=(0,r.useRef)(null),l=(0,r.useRef)(0),s=(0,r.useRef)(0),d=(0,r.useRef)(null),c=(0,r.useRef)([]),u=(0,r.useRef)(),p=(0,r.useRef)(),h=(0,r.useRef)(e),m=(0,r.useRef)(!0),f=(0,r.useRef)(),g=(0,r.useRef)();h.current=e;var x="undefined"!=typeof window,v=!t&&0!==t&&x;if("function"!=typeof e)throw TypeError("Expected a function");t=+t||0;var b=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,w=!!n.flushOnExit&&y,j="maxWait"in n,k="debounceOnServer"in n&&!!n.debounceOnServer,C=j?Math.max(+n.maxWait||0,t):null,E=(0,r.useMemo)(function(){var e=function(e){var t=c.current,n=u.current;return c.current=u.current=null,l.current=e,s.current=s.current||e,p.current=h.current.apply(n,t)},n=function(e,t){v&&cancelAnimationFrame(d.current),d.current=v?requestAnimationFrame(e):setTimeout(e,t)},r=function(e){if(!m.current)return!1;var n=e-o.current;return!o.current||n>=t||n<0||j&&e-l.current>=C},E=function(t){return d.current=null,y&&c.current?e(t):(c.current=u.current=null,p.current)},S=function e(){var i=Date.now();if(b&&s.current===l.current&&P(),r(i))return E(i);if(m.current){var a=t-(i-o.current);n(e,j?Math.min(a,C-(i-l.current)):a)}},P=function(){i&&i({})},N=function(){if(x||k){var i,s=Date.now(),h=r(s);if(c.current=[].slice.call(arguments),u.current=a,o.current=s,w&&!f.current&&(f.current=function(){var e;"hidden"===(null==(e=globalThis.document)?void 0:e.visibilityState)&&g.current.flush()},null==(i=globalThis.document)||null==i.addEventListener||i.addEventListener("visibilitychange",f.current)),h){
28if(!d.current&&m.current)return l.current=o.current,n(S,t),b?e(o.current):p.current;if(j)return n(S,t),e(o.current)}return d.current||n(S,t),p.current}};return N.cancel=function(){var e=d.current;e&&(v?cancelAnimationFrame(d.current):clearTimeout(d.current)),l.current=0,c.current=o.current=u.current=d.current=null,e&&i&&i({})},N.isPending=function(){return!!d.current},N.flush=function(){return d.current?E(Date.now()):p.current},N},[b,j,t,C,y,w,v,x,k,i]);return g.current=E,(0,r.useEffect)(function(){return m.current=!0,function(){var e;w&&g.current.flush(),f.current&&(null==(e=globalThis.document)||null==e.removeEventListener||e.removeEventListener("visibilitychange",f.current),f.current=null),m.current=!1}},[w]),E}function a(e,t){return e===t}function o(e,t,n){var o=n&&n.equalityFn||a,l=(0,r.useRef)(e),s=(0,r.useState)({})[1],d=i((0,r.useCallback)(function(e){l.current=e,s({})},[s]),t,n,s),c=(0,r.useRef)(e);return o(c.current,e)||(d(e),c.current=e),[l.current,d]}},35299:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},35795:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]])},36499:(e,t,n)=>{"use strict";n.d(t,{H:()=>o});var r=n(12115),i=n(99793);let a=r.createContext({controlId:void 0,registerControlId:i.tE,labelId:void 0,setLabelId:i.tE,messageIds:[],setMessageIds:i.tE,getDescriptionProps:e=>e});function o(){return r.useContext(a)}},37135:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});
28let r=(0,n(71847).A)("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]])},37354:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]])},37494:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},37772:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])},38091:(e,t,n)=>{"use strict";function r(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}n.d(t,{B:()=>r})},39867:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},39926:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]])},41251:(e,t,n)=>{"use strict";n.d(t,{O:()=>a});var r=n(12115),i=n(27024);let a=e=>{let[t,n]=r.useState([]);return r.useEffect(()=>{let t=!1;return(async()=>{n([]);let r=await (0,i.EM)(e),a=(0,i.jM)(r);t||n(a)})(),()=>{t=!0}},[e]),t}},42196:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},44173:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Crop",[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]])},46046:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},47185:(e,t,n)=>{"use strict";n.d(t,{f:()=>g});var r=n(95155),i=n(12115),a=n(50546),o=n(90842),l=n(51265),s=n(6369),d=n(35184),c=n(24729),u=n(45824),p=n(55228),h=n(29592),m=n(9635);let f=e=>{let t=[];return e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&t.push(e.text)})}),t.join(" ").split(" ").slice(0,6).join(" ").replace(/\s/g,"-").toLowerCase()||"polotno"},g=(0,a.PA)(({store:e})=>{let[t,n]=i.useState(!1);return(0,r.jsxs)(d.rI,{children:[(0,r.jsx)(d.ty,{render:(0,r.jsxs)(l.$,{variant:"ghost",size:"sm",className:"polotno-download-button",disabled:t,children:[t?(0,r.jsx)(s.y,{className:"pn:mr-1.5"}):(0,r.jsx)(o.dc,{name:"download.export",className:"pn:mr-1.5 pn:size-4"}),(0,c.t)("toolbar.download")]})}),(0,r.jsxs)(d.SQ,{align:"end",children:[(0,r.jsxs)(d._2,{onClick:async()=>{e.pages.forEach((t,n)=>{let r=e.pages.length>1?"-"+(n+1):"";e.saveAsImage({pageId:t.id,fileName:f(e)+r+".png"})})},children:[(0,r.jsx)(o.dc,{name:"download.image",className:"pn:size-4"}),(0,c.t)("toolbar.saveAsImage")]}),(0,r.jsxs)(d._2,{onClick:async()=>{n(!0),await e.saveAsPDF({fileName:f(e)+".pdf",includeBleed:!0}),n(!1)},children:[(0,r.jsx)(o.dc,{name:"download.pdf",className:"pn:size-4"}),(0,c.t)("toolbar.saveAsPDF")]}),m.Mv.animationsEnabled&&(0,r.jsxs)(d._2,{onClick:async()=>{n(!0);try{await (async({store:e,onProgress:t})=>{let n=e.toJSON(),r=await fetch(`${(0,p.dw)()}/renders?KEY=${(0,h.i7)()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({design:n,pixelRatio:1,format:"mp4"})}),i=await r.json();for(;;){let n=await fetch(`${(0,p.dw)()}/renders/${i.id}?KEY=${(0,h.i7)()}`),r=await n.json();if("done"===r.status){(0,u.P)(r.output,f(e)+".mp4");break}if("error"===r.status)throw Error("Failed to render video");null==t||t(r.progress||0,r.status||"processing"),await new Promise(e=>setTimeout(e,5e3))}})({store:e})}catch(e){console.error("Video export failed:",e),alert("Failed to export video. Please try again.")}n(!1)},children:[(0,r.jsx)(o.dc,{name:"download.video",className:"pn:size-4"}),"Save as Video"]})]})]})})},48394:(e,t,n)=>{"use strict";n.d(t,{R:()=>l});var r=n(95155),i=n(12115),a=n(69819),o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let l=i.forwardRef((e,t)=>
28{var{label:n,children:i,className:l}=e,s=o(e,["label","children","className"]);return(0,r.jsxs)("div",Object.assign({ref:t,"data-slot":"field-row",className:(0,a.cn)("pn:flex pn:items-center pn:justify-between",l)},s,{children:[(0,r.jsx)("span",{className:"pn:text-sm",children:n}),i]}))});l.displayName="FieldRow"},48916:(e,t,n)=>{"use strict";n.d(t,{V$:()=>d});var r=n(27970),i=n(12115),a=n(99793),o=n(62113);let l={invalid:void 0,name:void 0,validityData:{state:o.ZV,errors:[],error:"",value:"",initialValue:null},setValidityData:a.tE,disabled:void 0,setTouched:a.tE,setDirty:a.tE,setFilled:a.tE,setFocused:a.tE,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:o.mk,registerFieldControl:a.tE,validation:{getValidationProps:(e,t=a.t0)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:a.tE,getInputControl:()=>null,commit:async()=>{},change:a.tE}},s=i.createContext(l);function d(e=!0){let t=i.useContext(s);if(t.setValidityData===a.tE&&!e)throw Error((0,r.A)(28));return t}},49476:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]])},49675:(e,t,n)=>{"use strict";let r;n.d(t,{A:()=>l});let i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)},a=new Uint8Array(16),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));let l=function(e,t,n){if(i.randomUUID&&!t&&!e)return i.randomUUID();var l=e,s=n;let d=(l=l||{}).random??l.rng?.()??function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(a)}();if(d.length<16)throw Error("Random bytes length must be >= 16");if(d[6]=15&d[6]|64,d[8]=63&d[8]|128,t){if((s=s||0)<0||s+16>t.length)throw RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[s+e]=d[e];return t}return function(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}(d)}},50997:(e,t,n)=>{"use strict";n.d(t,{tU:()=>$,av:()=>q,j7:()=>V,Xi:()=>H});var r=n(95155),i=n(12115),a=n(83101),o=n(6993),l=n(33593),s=n(98627),d=n(80873),c=n(25379),u=n(27970);let p=i.createContext(void 0);function h(){let e=i.useContext(p);if(void 0===e)throw Error((0,u.A)(64));return e}let m={tabActivationDirection:e=>({"data-activation-direction":e})};var f=n(35836),g=n(39174);let x=i.forwardRef(function(e,t){let{className:n,defaultValue:a=0,onValueChange:u,orientation:h="horizontal",render:x,value:y,style:w,...j}=e,k=void 0!==e.defaultValue,C=i.useRef([]),[E,S]=i.useState(()=>new Map),[P,N]=(0,o.q)({controlled:y,default:a,name:"Tabs",state:"value"}),A=void 0!==y,[M,O]=i.useState(()=>new Map),T=i.useRef(void 0),R=i.useCallback(e=>v(M,e),[M]),[_,z]=i.useState(()=>({previousValue:P,tabActivationDirection:"none"})),{previousValue:I,tabActivationDirection:D}=_,F=D,L=!1;I!==P&&(F=b(I,P,h,M),L=null!=I&&null!=P&&null==R(P));let B=L?I:P,$=I!==B||D!==F;(0,l.g)(()=>{$&&z({previousValue:B,tabActivationDirection:F})},[B,$,F]);let W=(0,s.K)((e,t)=>{t.activationDirection=b(P,e,h,M),u?.(e,t),t.isCanceled||N(e)}),V=(0,s.K)((e,t)=>{u?.(e,(0,f.d)(t,void 0,void 0,{activationDirection:"none"}))}),H=(0,s.K)((e,t)=>(S(n=>{let r=new Map(n);return r.set(e,t),r}),()=>{S(n=>{if(n.get(e)!==t)return n;let r=new Map(n);return r.delete(e),r})})),q=i.useCallback(e=>E.get(e),[E]),K=i.useCallback(e=>{for(let t of M.values())if(e===t.value)return t.id},[M]),U=i.useMemo(()=>({getTabElementBySelectedValue:R,getTabIdByPanelValue:K,getTabPanelIdByValue:q,onValueChange:W,orientation:h,registerMountedTabPanel:H,setTabMap:O,tabActivationDirection:F,value:P}),[R,K,q,W,h,H,O,F,P]),X=i.useMemo(()=>{for(let e of M.values())if(e.value===P)return e},[M,P]),Y=i.useMemo(()=>{for(let e of M.values())if(!e.disabled)return e.value},[M]),Z=i.useRef(!k),G=i.useRef(a),Q=i.useRef(k),J=i.useRef(!1);(0,l.g)(()=>
28{if(A)return;function e(e,t){N(e),z({previousValue:e,tabActivationDirection:"none"}),V(e,t),Z.current=!1}if(0===M.size){J.current&&null!==P&&!T.current?.isConnected&&e(null,g.c);return}J.current=!0,T.current=M.keys().next().value;let t=X?.disabled,n=null==X&&null!==P;if(t||P!==G.current||(Q.current=!1),Q.current&&t&&P===G.current)return;let r=Z.current;if(t||n){let n=Y??null;if(P===n){Z.current=!1;return}let i=g.c;r?i=g.Vh:t&&(i=g.r9),e(n,i);return}r&&null!=X&&(V(P,g.Vh),Z.current=!1)},[Y,A,V,X,N,M,P]);let ee={orientation:h,tabActivationDirection:F},et=(0,d.o)("div",e,{state:ee,ref:t,props:j,stateAttributesMapping:m});return(0,r.jsx)(p.Provider,{value:U,children:(0,r.jsx)(c.u,{elementsRef:C,children:et})})});function v(e,t){for(let[n,r]of e.entries())if(t===r.value)return n;return null}function b(e,t,n,r){if(null==e||null==t)return"none";let[i,a,o]="horizontal"===n?["left","left","right"]:["top","up","down"],l=v(r,e),s=v(r,t);if(null==l||null==s)return l!==s&&("number"==typeof e||"string"==typeof e)&&typeof e==typeof t?t>e?o:a:"none";let d=l.getBoundingClientRect()[i],c=s.getBoundingClientRect()[i];return c<d?a:c>d?o:"none"}var y=n(99793),w=n(84535);let j=i.createContext(void 0),k=i.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:a,loopFocus:o=!0,render:d,style:c,...u}=e,{orientation:p,setTabMap:f,tabActivationDirection:g}=h(),[x,v]=i.useState(0),[b,k]=i.useState(null),C=i.useRef(new Set),E=i.useRef(new Set),S=i.useRef(null);(0,l.g)(()=>{if("undefined"==typeof ResizeObserver)return;let e=new ResizeObserver(()=>{C.current.forEach(e=>{e()})});return S.current=e,b&&e.observe(b),E.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),S.current=null}},[b]);let P=(0,s.K)(e=>(C.current.add(e),()=>{C.current.delete(e)})),N=(0,s.K)(e=>(E.current.add(e),S.current?.observe(e),()=>{E.current.delete(e),S.current?.unobserve(e)})),A=i.useMemo(()=>({activateOnFocus:n,registerIndicatorUpdateListener:P,registerTabResizeObserverElement:N,tabsListElement:b}),[n,P,N,b]);return(0,r.jsx)(j.Provider,{value:A,children:(0,r.jsx)(w.Y,{render:d,className:a,style:c,state:{orientation:p,tabActivationDirection:g},refs:[t,k],props:[{"aria-orientation":"vertical"===p?"vertical":void 0,role:"tablist"},u],stateAttributesMapping:m,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:o,orientation:p,onHighlightedIndexChange:v,onMapChange:f,disabledIndices:y.Ml})})});var C=n(38919),E=n(99892),S=n(79574),P=n(80304),N=n(24328),A=n(79234),M=n(28787);let O=i.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:a,value:o,id:c,nativeButton:p=!0,style:x,...v}=e,{value:b,getTabPanelIdByValue:y,onValueChange:w,orientation:k,tabActivationDirection:O}=h(),{activateOnFocus:T,registerTabResizeObserverElement:R,tabsListElement:_}=function(){let e=i.useContext(j);if(void 0===e)throw Error((0,u.A)(65));return e}(),{highlightedIndex:z,onHighlightedIndexChange:I}=(0,A.G)(),D=(0,E.e)(c),F=i.useMemo(()=>({disabled:r,id:D,value:o}),[r,D,o]),{compositeProps:L,compositeRef:B,index:$}=(0,N.k)({metadata:F}),W=o===b,V=i.useRef(!1),H=i.useRef(null),q=(0,s.K)(e=>{H.current?.(),H.current=e?R(e):null});(0,l.g)(()=>{if(V.current){V.current=!1;return}if(W&&$>-1&&z!==$){if(null!=_){let e=(0,M.RS)((0,C.R)(_));if(e&&(0,M.gR)(_,e))return}r||I($)}},[W,$,z,I,r,_]);let{getButtonProps:K,buttonRef:U}=(0,S.s)({disabled:r,native:p,focusableWhenDisabled:!0}),X=y(o),Y=i.useRef(!1),Z=i.useRef(!1);function G(e){w(o,(0,f.d)(g.dv,e.nativeEvent,void 0,{activationDirection:"none"}))}return(0,d.o)("button",e,{state:{disabled:r,active:W,orientation:k,tabActivationDirection:O},ref:[t,U,B,q],props:[L,{role:"tab","aria-controls":X,"aria-selected":W,id:D,onClick:function(e){W||r||G(e)},onFocus:function(e){W||r||T&&(!Y.current||Z.current)&&G(e)},onPointerDown:function(e){if(W||r)return;Y.current=!0,Z.current=0===e.button;let t=(0,C.R)(e.currentTarget);function n(){Y.current=!1,Z.current=!1,t.removeEventListener("pointerup",n),t.removeEventListener("pointercancel",n)}t.addEventListener("pointerup",n),t.addEventListener("pointercancel",n)},[P.h]:W?"":void 0,onKeyDownCapture(){V.current=!0}},v,K],stateAttributesMapping:m})});var T=n(8303),R=n(9797),_=n(76347),z=n(37025),I=n(35479);let D={...m,...R.G},F=i.forwardRef(function(e,t){let{className:n,value:r,render:a,keepMounted:o=!1,style:s,...c}=e,{value:u,getTabIdByPanelValue:p,orientation:m,tabActivationDirection:f,registerMountedTabPanel:g}=h(),x=(0,E.e)(),{ref:v,index:b}
28=(0,I.q)(),y=r===u,{mounted:w,transitionStatus:j,setMounted:k}=(0,z.$)(y),C=!w,S=p(r),P=i.useRef(null),N=(0,d.o)("div",e,{state:{hidden:C,orientation:m,tabActivationDirection:f,transitionStatus:j},ref:[t,v,P],props:[{"aria-labelledby":S,hidden:C,id:x,role:"tabpanel",tabIndex:y?0:-1,inert:(0,T.Y)(!y),"data-index":b},c],stateAttributesMapping:D});return((0,_.v)({open:y,ref:P,onComplete(){y||k(!1)}}),(0,l.g)(()=>{if(null!=x&&(!C||o))return g(r,x)},[C,o,r,x,g]),o||w)?N:null});var L=n(69819),B=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let $=i.forwardRef((e,t)=>{var{className:n,orientation:i="horizontal"}=e,a=B(e,["className","orientation"]);return(0,r.jsx)(x,Object.assign({ref:t,"data-slot":"tabs",orientation:i,className:(0,L.cn)("pn:group/tabs pn:flex pn:gap-2 pn:data-[orientation=horizontal]:flex-col",n)},a))});$.displayName="Tabs";let W=(0,a.F)("pn:group/tabs-list pn:inline-flex pn:w-fit pn:items-center pn:justify-center pn:rounded-lg pn:p-[3px] pn:text-muted-foreground pn:group-data-[orientation=horizontal]/tabs:h-9 pn:group-data-[orientation=vertical]/tabs:h-fit pn:group-data-[orientation=vertical]/tabs:flex-col pn:data-[variant=line]:rounded-none",{variants:{variant:{default:"pn:bg-muted",line:"pn:gap-1 pn:bg-transparent"}},defaultVariants:{variant:"default"}}),V=i.forwardRef((e,t)=>{var{className:n,variant:i="default"}=e,a=B(e,["className","variant"]);return(0,r.jsx)(k,Object.assign({ref:t,"data-slot":"tabs-list","data-variant":i,className:(0,L.cn)(W({variant:i}),n)},a))});V.displayName="TabsList";let H=i.forwardRef((e,t)=>{var{className:n}=e,i=B(e,["className"]);return(0,r.jsx)(O,Object.assign({ref:t,"data-slot":"tabs-trigger",className:(0,L.cn)("pn:relative pn:inline-flex pn:h-[calc(100%-1px)] pn:flex-1 pn:items-center pn:justify-center pn:gap-1.5 pn:rounded-md pn:border pn:border-transparent pn:px-2 pn:py-1 pn:text-sm pn:font-medium pn:whitespace-nowrap pn:text-foreground/60 pn:transition-all pn:group-data-[orientation=vertical]/tabs:w-full pn:group-data-[orientation=vertical]/tabs:justify-start pn:hover:text-foreground pn:focus-visible:border-ring pn:focus-visible:ring-[3px] pn:focus-visible:ring-ring/50 pn:focus-visible:outline-1 pn:focus-visible:outline-ring pn:disabled:pointer-events-none pn:disabled:opacity-50 pn:group-data-[variant=default]/tabs-list:data-active:shadow-sm pn:group-data-[variant=line]/tabs-list:data-active:shadow-none pn:dark:text-muted-foreground pn:dark:hover:text-foreground pn:[&_svg]:pointer-events-none pn:[&_svg]:shrink-0 pn:[&_svg:not([class*='size-'])]:size-4","pn:group-data-[variant=line]/tabs-list:bg-transparent pn:group-data-[variant=line]/tabs-list:data-active:bg-transparent pn:dark:group-data-[variant=line]/tabs-list:data-active:border-transparent pn:dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","pn:data-active:bg-background pn:data-active:text-foreground pn:dark:data-active:border-input pn:dark:data-active:bg-input/30 pn:dark:data-active:text-foreground","pn:after:absolute pn:after:bg-foreground pn:after:opacity-0 pn:after:transition-opacity pn:group-data-[orientation=horizontal]/tabs:after:inset-x-0 pn:group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] pn:group-data-[orientation=horizontal]/tabs:after:h-0.5 pn:group-data-[orientation=vertical]/tabs:after:inset-y-0 pn:group-data-[orientation=vertical]/tabs:after:-right-1 pn:group-data-[orientation=vertical]/tabs:after:w-0.5 pn:group-data-[variant=line]/tabs-list:data-active:after:opacity-100",n)},i))});H.displayName="TabsTrigger";let q=i.forwardRef((e,t)=>{var{className:n}=e,i=B(e,["className"]);return(0,r.jsx)(F,Object.assign({ref:t,"data-slot":"tabs-content",className:(0,L.cn)("pn:flex-1 pn:outline-none",n)},i))});q.displayName="TabsContent"},52210:(e,t,n)=>{"use strict";n.d(t,{Dg:()=>f});var r=n(95155),i=n(50546),a=n(90842),o=n(69819),l=n(72995),s=n(51265),d=n(16548),c=n(24729);let u=[.1,.25,.5,.75,1,1.5,2,3,5],p=u[u.length-1],h=u[0],m=(0,i.PA)(({store:e})=>{let t=Math.max(p,e.scaleToFit),n=Math.min(h,e.scaleToFit),i=e.scale<t,o=e.scale>n;return(0,r.jsxs)("div",{className:"pn:flex pn:h-[35px] pn:items-center",children:[(0,r.jsx)(s.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.setScale(e.scale/1.2)},disabled:!o,"aria-label":"Zoom out",children:(0,r.jsx)(a.dc,{name:"toolbar.zoomOut",className:"pn:size-4"})}),(0,r.jsxs)(d.AM,{children:[(0,r.jsx)(d.Wv,{render:(0,r.jsx)(s.$,{variant:"ghost",size:"sm","aria-label":"Zoom level",children:Math.round(100*e.scale)+"%"})}),(0,r.jsx)(d.hl,{className:"pn:w-auto pn:min-w-[80px] pn:p-1",children:(0,r.jsxs)("div",{className:"pn:flex pn:flex-col",children:[u.map(t=>(0,r.jsx)(s.$,{variant:"ghost",size:"sm",className:"pn:justify-start",onClick:async()=>{e.setScale(t)},children:Math.round(100*t)+"%"},t)),(0,r.jsx)(s.$,{variant:"ghost",size:"sm",className:"pn:justify-start",onClick:async()=>{e.setScale(e.scaleToFit)},children:(0,c.t)("scale.reset")})]})})]}),(0,r.jsx)(s.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.setScale(1.2*e.scale)},disabled:!i,"aria-label":"Zoom in",children:(0,r.jsx)(a.dc,{name:"toolbar.zoomIn",className:"pn:size-4"})})]})}),f=(0,i.PA)(({store:e})=>(0,r.jsx)("div",{className:"pn:relative pn:h-0",children:(0,r.jsx)("div",{className:(0,o.cn)((0,l.a)(),"pn:absolute pn:bottom-[5px] pn:left-1/2 pn:-translate-x-1/2 pn:overflow-hidden pn:max-md:hidden"),children:(0,r.jsx)("div",{className:"pn:flex pn:h-full pn:items-center pn:px-[5px]",children:(0,r.jsx)(m,{store:e})})})}))},52759:(e,t,n)=>{"use strict";n.d(t,{n:()=>o});var r=n(12115);let i=r.createContext(void 0),a={disableStyleElements:!1};function o(){return r.useContext(i)??a}},52987:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])},53063:(e,t,n)=>{"use strict";n.d(t,{e:()=>d});var r=n(95155),i=n(12115),a=n(83101),o=n(69819),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let s=(0,a.F)("pn:flex pn:w-fit pn:items-stretch pn:has-[>[data-slot=button-group]]:gap-2 pn:[&>*]:focus-visible:relative pn:[&>*]:focus-visible:z-10 pn:has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md pn:[&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit pn:[&>input]:flex-1",{variants:{orientation:{horizontal:"pn:[&>*:not(:first-child)]:rounded-l-none pn:[&>*:not(:first-child)]:border-l-0 pn:[&>*:not(:last-child)]:rounded-r-none",vertical:"pn:flex-col pn:[&>*:not(:first-child)]:rounded-t-none pn:[&>*:not(:first-child)]:border-t-0 pn:[&>*:not(:last-child)]:rounded-b-none"}},defaultVariants:{orientation:"horizontal"}}),d=i.forwardRef((e,t)=>
28{var{className:n,orientation:i,fill:a=!1}=e,d=l(e,["className","orientation","fill"]);return(0,r.jsx)("div",Object.assign({ref:t,role:"group","data-slot":"button-group","data-orientation":i,className:(0,o.cn)(s({orientation:i}),a&&"pn:w-full",n)},d))});d.displayName="ButtonGroup"},54690:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]])},55535:(e,t,n)=>{"use strict";function r(e){return null==e?void 0:`${e}-label`}function i(e,t){return e??t}n.d(t,{$:()=>r,_:()=>i})},57828:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])},58803:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var r=n(99809),i=n(12115),a=["variant","color","size"],o=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M14.55 22.42c-.33 0-.64-.22-.73-.56-.1-.4.13-.81.53-.92a9.256 9.256 0 006.89-8.95c0-5.1-4.15-9.25-9.25-9.25-4.33 0-7.17 2.53-8.5 4.06h2.94c.41 0 .75.34.75.75s-.32.76-.74.76H2.01c-.07 0-.14-.01-.21-.03a.899.899 0 01-.24-.12.659.659 0 01-.21-.23c-.05-.1-.09-.2-.1-.31V3c0-.41.34-.75.75-.75s.75.34.75.75v2.39C4.38 3.64 7.45 1.25 12 1.25c5.93 0 10.75 4.82 10.75 10.75 0 4.88-3.29 9.16-8.01 10.4-.06.01-.13.02-.19.02zM11.29 22.73c-.02 0-.05 0-.07-.01-1.07-.07-2.12-.31-3.12-.7a.751.751 0 01-.43-.97c.15-.38.59-.58.97-.43.86.34 1.77.54 2.69.61h.01c.4.02.7.36.7.76v.04a.76.76 0 01-.75.7zm-5.51-2.15c-.17 0-.33-.05-.47-.16-.84-.67-1.57-1.46-2.18-2.35a.73.73 0 01.19-1.04.76.76 0 011.04.19c.53.77 1.16 1.45 1.89 2.02.17.14.28.35.28.58 0 .17-.05.34-.16.48-.14.18-.36.28-.59.28zM2.44 15.7c-.33 0-.62-.21-.71-.52-.32-1.03-.48-2.1-.48-3.18 0-.41.34-.75.75-.75s.75.34.75.75c0 .93.14 1.85.41 2.73.02.07.03.15.03.23 0 .33-.21.61-.52.71-.08.02-.15.03-.23.03z"}),i.createElement("path",{fill:t,d:"M12 16a4 4 0 100-8 4 4 0 000 8z"}))},l=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M14.55 21.67C18.84 20.54 22 16.64 22 12c0-5.52-4.44-10-10-10C5.33 2 2 7.56 2 7.56m0 0V3m0 4.56H6.44"}),i.createElement("path",{stroke:t,strokeDasharray:"3 3",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M2 12c0 5.52 4.48 10 10 10"}))},s=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M14.55 22.42c-.33 0-.64-.22-.73-.56-.1-.4.13-.81.53-.92a9.256 9.256 0 006.89-8.95c0-5.1-4.15-9.25-9.25-9.25-4.33 0-7.17 2.53-8.5 4.06h2.94c.41 0 .75.34.75.75s-.32.76-.74.76H2.01c-.07 0-.14-.01-.21-.03a.899.899 0 01-.24-.12.659.659 0 01-.21-.23c-.05-.1-.09-.2-.1-.31V3c0-.41.34-.75.75-.75s.75.34.75.75v2.39C4.38 3.64 7.45 1.25 12 1.25c5.93 0 10.75 4.82 10.75 10.75 0 4.88-3.29 9.16-8.01 10.4-.06.01-.13.02-.19.02z",opacity:".4"}),i.createElement("path",{fill:t,d:"M11.29 22.73c-.02 0-.05 0-.07-.01-1.07-.07-2.12-.31-3.12-.7a.751.751 0 01-.43-.97c.15-.38.59-.58.97-.43.86.34 1.77.54 2.69.61h.01c.4.02.7.36.7.76v.04a.76.76 0 01-.75.7zm-5.51-2.15c-.17 0-.33-.05-.47-.16-.84-.67-1.57-1.46-2.18-2.35a.73.73 0 01.19-1.04.76.76 0 011.04.19c.53.77 1.16 1.45 1.89 2.02.17.14.28.35.28.58 0 .17-.05.34-.16.48-.14.18-.36.28-.59.28zM2.44 15.7c-.33 0-.62-.21-.71-.52-.32-1.03-.48-2.1-.48-3.18 0-.41.34-.75.75-.75s.75.34.75.75c0 .93.14 1.85.41 2.73.02.07.03.15.03.23 0 .33-.21.61-.52.71-.08.02-.15.03-.23.03z"}),i.createElement("path",{fill:t,d:"M12 16a4 4 0 100-8 4 4 0 000 8z",opacity:".4"}))},d=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M14.55 21.67C18.84 20.54 22 16.64 22 12c0-5.52-4.44-10-10-10C5.33 2 2 7.56 2 7.56m0 0V3m0 4.56H6.44"}),i.createElement("path",{stroke:t,strokeDasharray:"3 3",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M2 12c0 5.52 4.48 10 10 10"}))},c=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{fill:t,d:"M14.55 22.42c-.33 0-.64-.22-.73-.56-.11-.4.13-.81.54-.92a9.256 9.256 0 006.89-8.95c0-5.1-4.15-9.25-9.25-9.25-4.33 0-7.17 2.53-8.5 4.06h2.94a.755.755 0 010 1.51H2.01c-.05 0-.14-.01-.21-.03a.899.899 0 01-.24-.12.659.659 0 01-.21-.23.808.808 
280 01-.1-.31V3c0-.41.34-.75.75-.75s.75.34.75.75v2.39C4.38 3.64 7.45 1.25 12 1.25c5.93 0 10.75 4.82 10.75 10.75 0 4.88-3.29 9.16-8.01 10.4-.06.01-.13.02-.19.02zM11.29 22.73c-.02 0-.04-.01-.05-.01-1.08-.07-2.14-.31-3.14-.7a.747.747 0 01-.43-.97c.15-.38.6-.57.97-.43.87.34 1.78.54 2.7.61.39.02.7.36.7.76l-.01.04c-.02.39-.35.7-.74.7zm-5.51-2.15c-.17 0-.33-.06-.47-.16-.84-.68-1.58-1.47-2.18-2.35a.73.73 0 01.19-1.04.77.77 0 011.04.18v.01c.01.01.02.03.03.04a9.21 9.21 0 001.86 1.98c.17.14.28.35.28.58 0 .17-.05.34-.16.48-.15.18-.36.28-.59.28zM2.44 15.7c-.33 0-.62-.21-.71-.52-.32-1.03-.48-2.1-.48-3.18v-.01c.01-.41.34-.74.75-.74s.75.34.75.75c0 .94.14 1.86.41 2.73.02.08.03.15.03.23a.747.747 0 01-.75.74z"}))},u=function(e){var t=e.color;return i.createElement(i.Fragment,null,i.createElement("path",{stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M14.55 21.67C18.84 20.54 22 16.64 22 12c0-5.52-4.44-10-10-10C5.33 2 2 7.56 2 7.56m0 0V3m0 4.56H6.44"}),i.createElement("path",{stroke:t,strokeDasharray:"3 3",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M2 12c0 5.52 4.48 10 10 10",opacity:".4"}))},p=function(e,t){switch(e){case"Bold":return i.createElement(o,{color:t});case"Broken":return i.createElement(l,{color:t});case"Bulk":return i.createElement(s,{color:t});case"Linear":default:return i.createElement(d,{color:t});case"Outline":return i.createElement(c,{color:t});case"TwoTone":return i.createElement(u,{color:t})}},h=(0,i.forwardRef)(function(e,t){var n=e.variant,o=e.color,l=e.size,s=void 0===l?"24":l,d=(0,r._)(e,a);return i.createElement("svg",(0,r.a)({},d,{xmlns:"http://www.w3.org/2000/svg",ref:t,width:s,height:s,viewBox:"0 0 24 24",fill:"none"}),p(void 0===n?"Linear":n,void 0===o?"currentColor":o))});h.displayName="Refresh2"},59427:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},59847:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])},59863:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});function r(e,t){if(!e)throw Error("Invariant failed")}},60890:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]])},62113:(e,t,n)=>{"use strict";n.d(t,{ZV:()=>r,dc:()=>a,mk:()=>i});let r={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},i={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},a={valid:e=>null===e?null:e?{"data-valid":""}:{"data-invalid":""}}},63242:(e,t,n)=>{"use strict";n.d(t,{g:()=>ec});var r=n(95155),i=n(12115),a=n(50546),o=n(90842),l=n(9635),s=n(24729),d=n(69819),c=n(51265),u=n(72995),p=n(9475),h=n(90853),m=n(73910),f=n(15030),g=n(57659),x=n(35184),v=n(12438),b=n(6369);let y=e=>(0,r.jsx)(b.y,Object.assign({className:"pn:size-6 pn:text-[#09f]"},e));var w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let j=i.forwardRef((e,t)=>{var{className:n}=e,i=w(e,["className"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)("pn:pointer-events-none pn:absolute pn:inset-0 pn:flex pn:items-center pn:overflow-hidden pn:text-ellipsis pn:whitespace-nowrap pn:px-3 pn:text-[11px] pn:font-medium pn:text-black/75 pn:dark:text-white/[0.92]",n)},i))});j.displayName="TrackLabel";let k=i.forwardRef((e,t)=>
28{var{className:n}=e,i=w(e,["className"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)("pn:pointer-events-none pn:max-w-[45%] pn:flex-none pn:overflow-hidden pn:text-ellipsis pn:whitespace-nowrap pn:text-[11px] pn:font-medium pn:text-black/75 pn:dark:text-white/[0.92]",n)},i))});k.displayName="TrackInlineLabel";let C=e=>{var{value:t,onCommit:n,onCancel:a,className:o}=e,l=w(e,["value","onCommit","onCancel","className"]);let[s,c]=i.useState(t),u=i.useRef(!1);return(0,r.jsx)("input",Object.assign({autoFocus:!0,value:s,onFocus:e=>e.target.select(),onChange:e=>c(e.target.value),onBlur:()=>{u.current||(u.current=!0,n(s.trim()))},onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key?(e.preventDefault(),e.target.blur()):"Escape"===e.key&&(e.preventDefault(),u.current=!0,a())},onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),className:(0,d.cn)("pn:absolute pn:inset-0 pn:z-30 pn:w-full pn:rounded-[10px] pn:bg-white/85 pn:px-3 pn:outline-none pn:ring-1 pn:ring-primary pn:text-[11px] pn:font-medium pn:text-black/75 pn:dark:bg-black/70 pn:dark:text-white/[0.92]",o)},l))};C.displayName="TrackNameInput";let E=i.forwardRef((e,t)=>{var{className:n}=e,i=w(e,["className"]);return(0,r.jsx)("svg",Object.assign({ref:t,className:(0,d.cn)("pn:[&_path]:fill-black/50 pn:dark:[&_path]:fill-white/70",n)},i))});E.displayName="WaveformSvg";let S=i.forwardRef((e,t)=>{var{className:n}=e,i=w(e,["className"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)("pn:absolute pn:[&:hover_.polotno-track-menu]:pointer-events-auto pn:[&:hover_.polotno-track-menu]:opacity-100",n)},i))});S.displayName="TrackWrapper";let P=i.forwardRef((e,t)=>{var{className:n,style:i}=e,a=w(e,["className","style"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)("pn:absolute pn:cursor-move pn:touch-pan-y pn:overflow-hidden pn:rounded-[10px] pn:border pn:border-primary/55 pn:bg-gradient-to-br pn:from-primary/15 pn:to-primary/35 pn:shadow-sm",n),style:i},a))});P.displayName="TrackContainer";let N=i.forwardRef((e,t)=>{var{className:n}=e,i=w(e,["className"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)("polotno-track-menu pn:pointer-events-none pn:absolute pn:top-1/2 pn:right-3 pn:z-20 pn:-translate-y-1/2 pn:opacity-0",n)},i))});N.displayName="TrackMenu";let A=()=>(0,r.jsx)(x.ty,{render:(0,r.jsx)(c.$,{variant:"secondary",size:"icon-sm",style:{minHeight:"20px",borderRadius:"10px"},children:(0,r.jsx)(o.dc,{name:"action.more",className:"pn:size-4"})})});A.displayName="TrackMenuButton";let M=i.forwardRef((e,t)=>{var{className:n,side:i}=e,a=w(e,["className","side"]);return(0,r.jsx)("div",Object.assign({ref:t,className:(0,d.cn)('polotno-track-handle pn:pointer-events-auto pn:absolute pn:top-px pn:flex pn:h-[calc(100%-2px)] pn:w-[min(0.75rem,33%)] pn:cursor-ew-resize pn:touch-pan-y pn:items-center pn:justify-center pn:before:h-3/4 pn:before:w-2 pn:before:rounded pn:before:border pn:before:border-white/60 pn:before:bg-black/60 pn:before:content-[""] pn:pointer-coarse:w-[min(1.25rem,33%)]',"left"===i?"pn:left-0":"pn:right-0",n)},a))});M.displayName="TrackHandleBase";let O=i.forwardRef((e,t)=>(0,r.jsx)(M,Object.assign({ref:t,side:"left"},e)));O.displayName="TrackHandleLeft";let T=i.forwardRef((e,t)=>(0,r.jsx)(M,Object.assign({ref:t,side:"right"},e)));T.displayName="TrackHandleRight";let R=[],_=!1,z=async()=>{var e;if(_||0===R.length)return;_=!0;let{page:t,setPreview:n}=R.shift();try{n(await t.store.toDataURL({pageId:t.id,pixelRatio:.1,quickMode:!0}))}catch(t){"EXPORT_FAILED"===(null==t?void 0:t.code)&&["workspace-not-mounted","unmounted-during-export"].includes(null==(e=t.details)?void 0:e.reason)||t instanceof Error&&"string"==typeof t.message&&(t.message.includes("Canvas was unmounted.")||t.message.includes("<Workspace /> component is not mounted"))||console.error(t)}finally{_=!1}z()},I=(0,a.PA)(({page:e,scale:t})=>{let[n,a]=i.useState(null),d=e.store.activePage===e||e.store._selectedPagesIds.includes(e.id),c=i.useRef(null),u=e.store.pages.indexOf(e),p=60/e.computedHeight*e.computedWidth,h=l.Mv.animationsEnabled?e.duration*t:p,b=e.store.pages.length>1;return i.useLayoutEffect(()=>{c.current&&(c.current.style.width=h+"px")},[u,h]),(({page:e,setPreview:t,groupRef:n})=>{let r=i.useRef(!1);i.useEffect(()=>{let i=()=>{R.push({page:e,setPreview:e=>t(e)}),z()},a=null,o=null,l=Date.now(),s=()=>{a&&clearTimeout(a),r.current&&(o||(o=setTimeout(()=>{Date.now()-l>=6e3&&(i(),l=Date.now(),o=null)},6e3)),a=setTimeout(()=>{i(),l=Date.now(),a=null,o&&(clearTimeout(o),o=null)},300))},d=null,c=(0,f.aQ)(e,e=>{(0,g.b)(d,e)||(s(),d=e)}),u=(0,m.e)(e,()=>e.children.some(e=>e._editModeEnabled),e=>{e||s()}),p=new IntersectionObserver(e=>
28{e.forEach(e=>{e.isIntersecting?(r.current=!0,s()):(a&&clearTimeout(a),o&&clearTimeout(o),r.current=!1)})},{threshold:.1});return n.current&&p.observe(n.current),()=>{p.disconnect(),a&&clearTimeout(a),o&&clearTimeout(o),c(),u(),R=R.filter(t=>t.page!==e)}},[n,e,t])})({page:e,setPreview:a,groupRef:c}),(0,r.jsxs)("div",{ref:c,style:{width:h+"px",marginRight:l.Mv.animationsEnabled?"0px":"10px",height:"60px",display:"flex",position:"relative",borderRadius:"15px",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.18)"},className:"polotno-page-container pn:[&:hover_.polotno-track-menu]:pointer-events-auto pn:[&:hover_.polotno-track-menu]:opacity-100"+(d?" sortable-selected":""),children:[(0,r.jsx)("div",{style:{width:"100%",height:"100%",borderRadius:"15px",backgroundImage:n?`url("${n}")`:"none",backgroundRepeat:"repeat-x",backgroundSize:"auto 100%",backgroundColor:"white",display:"flex",justifyContent:"center",alignItems:"center"},onClick:t=>{let{store:n}=e,r=n._selectedPagesIds.length?n._selectedPagesIds:n.activePage?[n.activePage.id]:[],i=r.includes(e.id),a=t.shiftKey;if(a&&i){let t=r.filter(t=>t!==e.id);n.selectPages(t)}else if(a&&!i){let t=r.concat([e.id]);n.selectPages(t)}else n.selectPages([e.id])},children:!n&&(0,r.jsx)(y,{})}),(0,r.jsx)("div",{style:{position:"absolute",top:"0",left:"0px",bottom:"0px",right:"0px",borderRadius:"15px",border:d?"2px solid rgb(0, 161, 255, 0.9)":"2px solid var(--pn-border)",zIndex:1,pointerEvents:"none"}}),l.Mv.animationsEnabled&&(0,r.jsxs)("div",{style:{position:"absolute",zIndex:1,bottom:"5px",left:"5px",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",padding:"2px 7px",textAlign:"center",borderRadius:"4rem"},children:[(e.duration/1e3).toFixed(1),"s"]}),l.Mv.animationsEnabled&&(0,r.jsx)(T,{className:"pn:z-[2] pn:before:h-1/2",onPointerDown:n=>{if(!(0,v.TS)(n))return;let r=n.clientX,i=e.duration;(0,v.ez)(n,{slopX:v.vn,onMove:n=>{let a=(n.clientX-r)/t;e.set({duration:Math.max(1e3,i+a)})}})}}),d&&(0,r.jsx)(N,{className:"polotno-page-menu pn:top-[5px] pn:right-4 pn:translate-y-0",onClick:e=>{e.stopPropagation()},children:(0,r.jsxs)(x.rI,{children:[(0,r.jsx)(A,{}),(0,r.jsxs)(x.SQ,{side:"top",className:"pn:whitespace-nowrap",children:[(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault();let n=e.store,r=(n.selectedPages||[]).filter(Boolean),i=r.length?r:n.activePage?[n.activePage]:[];if(!i.length)return;let a=new Set(i.map(e=>e.id)),o=n.pages.filter(e=>a.has(e.id)),l=o[o.length-1],s=o.map(e=>e.clone()),d=n.pages.indexOf(l);s.forEach((e,t)=>{e.setZIndex(d+1+t)}),n.selectPages(s.map(e=>e.id))},children:[(0,r.jsx)(o.dc,{name:"action.duplicate",className:"pn:size-4"}),(0,s.t)("pagesTimeline.duplicatePage")]}),(0,r.jsxs)(x._2,{onSelect:t=>{var n,r,i;t.preventDefault();let a=e.store.addPage({bleed:(null==(n=e.store.activePage)?void 0:n.bleed)||0,width:(null==(r=e.store.activePage)?void 0:r.width)||"auto",height:(null==(i=e.store.activePage)?void 0:i.height)||"auto"}),o=e.store.pages.indexOf(e);a.setZIndex(o+1)},children:[(0,r.jsx)(o.dc,{name:"action.add",className:"pn:size-4"}),(0,s.t)("pagesTimeline.addPage")]}),b&&(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault();let n=e.store,r=(n.selectedPages||[]).filter(Boolean),i=r.length?r.map(e=>e.id):n.activePage?[n.activePage.id]:[];i.length&&n.deletePages(i)},children:[(0,r.jsx)(o.dc,{name:"action.remove",className:"pn:size-4"}),(0,s.t)("pagesTimeline.removePage")]})]})]})})]})}),D=(0,a.PA)(({store:e,scale:t})=>{let n=e.pages.map(e=>({id:e.id}));return(0,r.jsx)(h.ReactSortable,{list:n,setList:t=>{t.forEach(({id:t},n)=>{let r=e.pages.find(e=>e.id===t);r&&e.pages.indexOf(r)!==n&&r.setZIndex(n)})},direction:"horizontal",style:{display:"flex",flexDirection:"row"},delay:500,delayOnTouchOnly:!0,filter:".polotno-track-handle",preventOnFilter:!1,className:"polotno-pages-container",children:n.map(({id:n})=>{let i=e.pages.find(e=>e.id===n);return i?(0,r.jsx)(I,{page:i,scale:t},n):null})})}),F="rgb(0, 161, 255)",L=(0,a.PA)(({store:e,scale:t,variant:n="timeline",dragAreaRef:a})=>{let o=i.useRef(null),l=e.effectiveTime,s=i.useCallback(n=>{var r,i;let l=(null==a?void 0:a.current)||(null==(r=o.current)?void 0:r.parentElement);if(!l)return;let s=l.getBoundingClientRect(),c=l.scrollLeft||0,u=n-s.left+c;u-=parseFloat(window.getComputedStyle(l).paddingLeft)||0,e.setCurrentTime((0,d.q)(u/t,0,e.duration)),null==(i=e.checkActivePage)||i.call(e)},[a,t,e]),c=i.useCallback(e=>{(0,v.TS)(e)&&(e.stopPropagation(),s(e.clientX),(0,v.ez)(e,{onMove:e=>s(e.clientX)}))},[s]),u="ruler"===n?{wrapper:{top:0,width:12,height:"100%",transform:"translateX(-6px)",display:"flex",flexDirection:"column",alignItems:"center"},line:{flex:1}}:{wrapper:{top:0,width:12,height:"100%",transform:"translateX(-6px)"},line:{height:"100%",margin:"0 auto"}};return(0,r.jsxs)("div",{ref:o,onPointerDown:c,className:"polotno-current-time pn:touch-pan-y",style:Object.assign(Object.assign({position:"absolute",left:l*t+"px"},u.wrapper),{cursor:"col-resize"}),children:[(0,r.jsx)("svg",{width:"12",height:"8",viewBox:"0 0 12 8",style:{display:"block",filter:"drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3))"},children:(0,r.jsx)("path",{d:"M0 0 H12 L6 8 Z",fill:F,stroke:F,strokeWidth:"2",strokeLinejoin:"round"})}),(0,r.jsx)("div",{style:Object.assign({width:"2px",backgroundColor:F},u.line)})]})});function B(e){let t=[],n=[];return e.forEach(({item:e,start:r,end:i})=>{let a=0;for(;a<n.length&&n[a]>r;)a++;t.push({item:e,row:a}),n[a]=i}),t}var $=n(68047),W=n(91908);let V={},H=null;async function q(e){if(V[e])return V[e];let t="undefined"==typeof window?null:H=H||new AudioContext;if(!t)return[];let n=await fetch(e),r=await n.arrayBuffer(),i=(await t.decodeAudioData(r)).getChannelData(0),a=Math.max(1,Math.floor(i.length/500)),o=Array(500).fill(0);for(let e=0;e<500;e++){let t=0,n=e*a;for(let e=0;e<a&&n+e<i.length;e++)t=Math.max(t,Math.abs(i[n+e]));o[e]=t}let l=Math.max(...o)||1,s=o.map(e=>Number((e/l).toFixed(4)));return V[e]=s,s}var K=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let U=({position:e,store:t,scale:n})=>{for(let r of t.pages){let t=r.startTime,i=r.startTime+r.duration;if(Math.abs(e-t)<10/n)return t;if(Math.abs(e-i)<10/n)return i}return null},X=(0,a.PA)(({audio:e,scale:t,store:n,label:a,row:l})=>{let[c,u]=i.useState(1),p=i.useRef(null),[h,m]=i.useState(!1),f=0===e.volume,g=()=>{f?e.set({volume:c>0?c:1}):(u(e.volume),e.set({volume:0}))},b=(t=e.startTime,n=e.endTime,r=e.speed)=>Math.max(0,(n-t)*(e.duration||0)/r),w=e=>Math.max(0,n.duration-e),j=(e,t=b())=>Math.min(Math.max(0,e),w(t)),M=b(),R=n.duration*t-e.delay*t,_=Math.min(M*t,R),z=e.delay*t,{data:I,isLoading:D}=function(e){let[t,n]=i.useState(null),[r,a]=i.useState(!1),[o,l]=i.useState(null);return i.useEffect(()=>{e?(a(!0),q(e).then(e=>{n(e),a(!1)}).catch(e=>{console.error("Error generating waveform:",e),l(e),a(!1)})):n(null)},[e]),{data:t,isLoading:r,error:o}}(e.src),F=e.visibleDuration*t,L=function(e,t=20){return i.useMemo(()=>e?function(e,t){if(!e.length||t<=0)return{path:"",width:0};let n=t/2,r=Math.max(1,e.length-1),i="";for(let t=0;t<e.length;t++){let r=t,a=n-e[t]*n;i+=0===t?`M ${r},${a}`:` L ${r},${a}`}for(let t=e.length-1;t>=0;t--)i+=` L ${t},${n+e[t]*n}`;return{path:i+=" Z",width:r}}(e,t):{path:"",width:0},[e,t])}(I,20).path,B=(r,i)=>{if(!(0,v.TS)(r))return;r.stopPropagation();let a=r.clientX,o=e.endTime,l=e.startTime,s=e.delay,d=e.duration||1,c=e.speed;(0,v.ez)(r,{slopX:v.vn,onMove:r=>{let u=(r.clientX-a)/t;if("start"===i)if(u>=0){let r=Math.min(u*c,Math.max(0,o-.1-l)*d);if(r<=0)return;let i=l+r/d,a=(e.endTime-i)*d/c,p=s+r/c,h=w(a),m=Math.min(Math.max(0,p),h),f=U({position:m,store:n,scale:t}),g=(m=Math.min(Math.max(0,null!=f?f:m),h))-p;i=Math.min(e.endTime-.1,Math.max(0,i+g*c/d)),e.set({delay:m,startTime:i})}else{let r=Math.min(-u*c,l*d);if(r<=0)return;let i=Math.max(0,l-r/d),a=(e.endTime-i)*d/c,o=s-r/c,p=w(a),h=Math.min(Math.max(0,o),p),m=U({position:h,store:n,scale:t}),f=(h=Math.min(Math.max(0,null!=m?m:h),p))-o;i=Math.max(0,Math.min(e.endTime-.1,i+f*c/d)),e.set({delay:h,startTime:i})}else{let r=z/t+_/t,i=r+u,a=U({position:i,store:n,scale:t}),l=((i=null!=a?a:i)-r)*c/e.duration,s=Math.min(1,Math.max(e.startTime+.1,o+l));e.set({endTime:s})}},onEnd:({moved:r})=>{r&&(()=>{if("start"===i){let r=U({position:e.delay,store:n,scale:t});if(null!=r&&r!==e.delay){let t=j(r,b(e.startTime,e.endTime)),n=t-e.delay,i=Math.max(0,Math.min(e.endTime-.1,e.startTime+n*c/d));e.set({delay:t,startTime:i})}}})()}})};return(0,r.jsx)(S,{ref:p,style:{left:`${z}px`,top:28*l+"px",width:`${_}px`,height:"24px"},className:"polotno-audio-container",children:(0,r.jsxs)(P,{style:{width:"100%",height:"100%"},onPointerDown:r=>{if(!(0,v.TS)(r))return;let i=r.clientX;(0,v.ez)(r,{slopX:v.vn,onMove:r=>{let a,o=(r.clientX-i)/t,l=z/t+o,s=l+M,d=U({position:l,store:n,scale:t}),c=U({position:s,store:n,scale:t}),u=null!==d?Math.abs(l-d):1/0,p=null!==c?Math.abs(s-c):1/0;a=j(null!==d&&u<p?d:null!==c?c-M:l),e.set({delay:j(a)})}})},children:[(0,r.jsx)("div",{style:{position:"absolute",left:"4px",top:"50%",transform:"translateY(-50%)",zIndex:10,pointerEvents:"auto"},onClick:e=>{e.stopPropagation(),g()},onPointerDown:e=>e.stopPropagation(),children:(0,r.jsx)(o.dc,f?{name:"action.muted",className:"pn:size-3.5",style:{opacity:.7,cursor:"pointer"}}:{name:"action.unmuted",className:"pn:size-3.5",style:{opacity:.7,cursor:"pointer"}})}),(0,r.jsx)("div",{style:{position:"absolute",inset:"0 0 0 0",display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%",gap:"8px",paddingLeft:"22px"},children:[!h&&(0,r.jsx)(k,{children:a}),L&&(0,r.jsx)("div",{style:{flex:1,height:"14px",overflow:"hidden",opacity:f?.4:1},children:(0,r.jsx)(E,{width:F,height:"14",viewBox:`0 0 ${F} 20`,preserveAspectRatio:"none",style:{width:F+"px",height:"14px",transform:`translateX(-${e.startTime*F}px)`},children:(0,r.jsx)("path",{d:L})})}),D&&(0,r.jsx)("div",{style:{flex:1,display:"flex",justifyContent:"center",alignItems:"center"},children:(0,r.jsx)(y,{})})]})}),h&&(0,r.jsx)(C,{value:e.name,onCommit:t=>{e.set({name:t}),m(!1)},onCancel:()=>m(!1)}),(0,r.jsx)(O,{onPointerDown:e=>B(e,"start")}),(0,r.jsx)(T,{onPointerDown:e=>B(e,"end")}),(0,r.jsx)(N,{onClick:e=>{e.stopPropagation()},onPointerDown:e=>e.stopPropagation(),children:(0,r.jsxs)(x.rI,{children:[(0,r.jsx)(A,{}),(0,r.jsxs)(x.SQ,{side:"top",align:"start",anchor:p,style:{width:"220px"},children:[(0,r.jsxs)("div",{style:{padding:"8px 12px"},children:[(0,r.jsxs)("div",{style:{fontSize:"12px",marginBottom:"6px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,r.jsx)("span",{children:(0,s.t)("pagesTimeline.volume")}),(0,r.jsxs)("span",{children:[Math.round(100*e.volume),"%"]})]}
28),(0,r.jsx)($.A,{value:[e.volume],min:0,max:1,step:.01,onValueChange:t=>(t=>{let n=Math.max(0,Math.min(1,t));n>0&&u(n),e.set({volume:n})})((0,d.V)(t))})]}),(0,r.jsxs)("div",{style:{padding:"8px 12px"},children:[(0,r.jsx)("div",{style:{fontSize:"12px",marginBottom:"6px"},children:(0,s.t)("pagesTimeline.speed")}),(0,r.jsx)(W.DB,{value:e.speed,onChange:t=>{let n=b(e.startTime,e.endTime,t);e.set({speed:t,delay:j(e.delay,n)})}})]}),(0,r.jsx)(x.mB,{}),(0,r.jsxs)(x._2,{onSelect:e=>{e.preventDefault(),m(!0)},children:[(0,r.jsx)(o.dc,{name:"action.rename"}),(0,s.t)("pagesTimeline.renameAudio")]}),(0,r.jsxs)(x._2,{onSelect:e=>{e.preventDefault(),g()},children:[(0,r.jsx)(o.dc,f?{name:"action.unmuted"}:{name:"action.muted"}),(0,s.t)(f?"pagesTimeline.unmuteAudio":"pagesTimeline.muteAudio")]}),(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault(),(()=>{let t=e.toJSON(),r=e.visibleDuration,i=e.delay+r,a=n.duration-i,o=e.delay;a>=r?o=i:a>0&&(o=Math.max(0,n.duration-r));let{id:l}=t,s=K(t,["id"]);n.addAudio(Object.assign(Object.assign({},s),{delay:o}))})()},children:[(0,r.jsx)(o.dc,{name:"action.duplicate"}),(0,s.t)("pagesTimeline.duplicateAudio")]}),(0,r.jsx)(x.mB,{}),(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault(),n.removeAudio(e.id)},children:[(0,r.jsx)(o.dc,{name:"action.remove"}),(0,s.t)("pagesTimeline.removeAudio")]})]})]})})]})})}),Y=(0,a.PA)(({store:e,scale:t,width:n})=>{let i=B(e.audios.map(e=>({item:e,start:e.delay,end:e.delay+e.visibleDuration}))),a=28*Math.max(i.reduce((e,t)=>Math.max(e,t.row),-1)+1,1);return i.length?(0,r.jsx)("div",{style:{position:"relative",minWidth:n+"px",height:a+"px",marginTop:"12px"},className:"polotno-audios-container",children:i.map(({item:n,row:i})=>(0,r.jsx)(X,{audio:n,scale:t,store:e,label:n.name||`audio-${e.audios.indexOf(n)+1}`,row:i},n.id))}):null});var Z=n(85162),G=n(59799),Q=n(31485);function J(e,t){var n;let r=null==(n=e.page)?void 0:n.duration;if(!r)return!1;let{start:i,end:a}=(0,G.Nm)(e.animations,r);return t>i+G.wl&&t<a-G.wl}let ee=(0,a.PA)(({element:e,store:t})=>{var n;let i=t.effectiveTime-((null==(n=e.page)?void 0:n.startTime)||0),a=J(e,i);return(0,r.jsxs)(x._2,{disabled:!a,onSelect:n=>{n.preventDefault();let r=function(e,t){if(!J(e,t))return null;let n=e.page.duration,{start:r}=(0,G.Nm)(e.animations,n),i=e.clone({},{skipSelect:!0});if(i.setZIndex(e.zIndex+1),e.setAnimation("exit",{name:"none",delay:n-t,enabled:!0}),i.setAnimation("enter",{name:"none",delay:t,enabled:!0}),"video"===e.type){let n=(e.endTime-e.startTime)*e.duration,a=e.speed||1;if(n>0){let o=(0,G.um)(t,0,r,n,e.startTime*e.duration,a),l=(0,d.q)(o/e.duration,e.startTime,e.endTime);i.set({startTime:l}),(t-r)*a<n&&e.set({endTime:l})}}return i}(e,i);r&&t.selectElements([r.id])},children:[(0,r.jsx)(o.dc,{name:"action.split"}),(0,s.t)("contextMenu.split")]})}),et=(e,t)=>{let n=e.animations.find(e=>e.type===t);n&&n.enabled||e.setAnimation(t,{name:"none",enabled:!0})},en=(e,t,n,r)=>{let i=(0,d.q)(n,0,t-G.wl),a=(0,d.q)(r,i+G.wl,t);et(e,"enter"),et(e,"exit"),e.setAnimation("enter",{delay:i}),e.setAnimation("exit",{delay:Math.max(0,t-a)})},er=(0,a.PA)(({element:e,page:t,store:n,scale:a,row:l})=>{let c=t.duration,u=t.startTime,p=u+c,{start:h,end:m}=(0,G.Nm)(e.animations,c),f=(u+h)*a,g=e.name||e.type||(0,s.t)("toolbar.element"),[b,y]=i.useState(!1),[w,k]=i.useState(null),E=()=>{k(e=>null===e?l:e)},M=()=>{k(null)},R=(t,n)=>{if(!(0,v.TS)(t))return;t.stopPropagation();let r=t.clientX;(0,v.ez)(t,{slopX:v.vn,onMove:t=>{E();let i=(t.clientX-r)/a;if("start"===n)en(e,c,(0,d.q)(u+h+i,u,u+m-G.wl)-u,m);else{let t=(0,d.q)(u+m+i,u+h+G.wl,p);en(e,c,h,t-u)}},onEnd:M})};return(0,r.jsx)(S,{style:{left:`${f}px`,top:26*(null!=w?w:l)+"px",width:`${(m-h)*a}px`,minWidth:"6px",height:"22px"},children:(0,r.jsxs)(P,{style:{width:"100%",height:"100%",outline:n.selectedElements.find(t=>t.id===e.id)?"2px solid var(--pn-primary, var(--primary, #137cbd))":"none",outlineOffset:"-1px"},onPointerDown:t=>{if(!(0,v.TS)(t))return;t.stopPropagation();let r=t.clientX,i=m-h;(0,v.ez)(t,{slopX:v.vn,onMove:t=>{E();let n=(t.clientX-r)/a,o=(0,d.q)(u+h+n,u,p-i)-u;en(e,c,o,o+i)},onEnd:({moved:t,cancelled:r})=>
28{M(),t||r||(n.selectElements([e.id]),(0,G.nX)(e))}})},children:[b?(0,r.jsx)(C,{value:e.name||"",onCommit:t=>{e.set({name:t}),y(!1)},onCancel:()=>y(!1)}):(0,r.jsx)(j,{children:g}),(0,r.jsx)(O,{onPointerDown:e=>R(e,"start")}),(0,r.jsx)(T,{onPointerDown:e=>R(e,"end")}),(0,r.jsx)(N,{onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:(0,r.jsxs)(x.rI,{children:[(0,r.jsx)(A,{}),(0,r.jsxs)(x.SQ,{side:"top",className:"pn:whitespace-nowrap",children:[(0,r.jsx)(ee,{element:e,store:n}),(0,r.jsxs)(x._2,{onSelect:e=>{e.preventDefault(),y(!0)},children:[(0,r.jsx)(o.dc,{name:"action.rename"}),(0,s.t)("contextMenu.rename")]}),(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault(),(0,Q.V)([e],n)},children:[(0,r.jsx)(o.dc,{name:"action.duplicate"}),(0,s.t)("contextMenu.duplicate")]}),(0,r.jsxs)(x._2,{onSelect:t=>{t.preventDefault(),n.deleteElements([e.id])},children:[(0,r.jsx)(o.dc,{name:"action.remove"}),(0,s.t)("contextMenu.remove")]})]})]})})]})})}),ei=(0,a.PA)(({store:e,scale:t,width:n})=>{let i=e.pages.slice();if(!i.length)return null;let a=i.flatMap(e=>(e=>{let t=[];for(let n of e.children)"group"===n.type?(0,Z.Zf)(n,e=>{"group"!==e.type&&t.push(e)}):t.push(n);return t})(e).map(t=>({element:t,page:e}))).filter(({element:t})=>t.selectable||"admin"===e.role);if(!a.length)return null;let o=B(a.map(({element:e,page:t})=>{let n=(0,G.Nm)(e.animations,t.duration);return{element:e,page:t,start:t.startTime+n.start,end:t.startTime+n.end}}).sort((e,t)=>e.start-t.start).filter(e=>e.end>e.start).map(e=>({item:e,start:e.start,end:e.end}))).map(({item:e,row:t})=>({element:e.element,page:e.page,row:t,start:e.start,end:e.end}));if(!o.length)return null;let l=o.reduce((e,t)=>Math.max(e,t.row),-1)+1;return(0,r.jsx)("div",{style:{position:"relative",minWidth:n+"px",height:26*l+"px",marginTop:"12px"},className:"polotno-elements-container",children:o.map(({element:n,row:i,page:a})=>(0,r.jsx)(er,{element:n,store:e,page:a,scale:t,row:i},`${a.id}-${n.id}`))})});var ea=n(53063),eo=n(63768);let el=e=>{let t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3);return`${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`},es=(0,a.PA)(({store:e,scale:t,onScaleChange:n})=>{let i=e.effectiveTime;return(0,r.jsx)("div",{className:"pn:@container pn:w-full",children:(0,r.jsxs)("div",{className:"pn:grid pn:w-full pn:grid-cols-[1fr_auto_1fr] pn:items-center pn:gap-3 pn:@max-[520px]:flex pn:@max-[520px]:flex-wrap pn:@max-[520px]:justify-center pn:@max-[520px]:gap-x-2 pn:@max-[520px]:gap-y-1",children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:gap-2",children:[(0,r.jsxs)("label",{className:"pn:flex pn:cursor-pointer pn:items-center pn:gap-2 pn:whitespace-nowrap pn:text-xs pn:font-medium pn:select-none",title:(0,s.t)("pagesTimeline.editAsVideoHint"),children:[(0,r.jsx)(eo.d,{"aria-label":(0,s.t)("pagesTimeline.editAsVideo"),checked:"playhead"===e.timingPreview,onCheckedChange:t=>e.setTimingPreview(t?"playhead":"all")}),(0,s.t)("pagesTimeline.editAsVideo")]}),(0,r.jsxs)("div",{className:"pn:whitespace-nowrap pn:text-[13px] pn:font-medium pn:tabular-nums pn:opacity-[0.85]",children:[el(i)," / ",el(e.duration)]})]}),(0,r.jsxs)("div",{className:"polotno-play-button-container pn:inline-flex pn:items-center pn:justify-center pn:gap-2 pn:@max-[520px]:gap-1",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"pn:size-[30px]","aria-label":(0,s.t)("pagesTimeline.rewind"),title:(0,s.t)("pagesTimeline.rewind"),onClick:()=>e.stop(),children:(0,r.jsx)(o.dc,{name:"pagesTimeline.rewind",className:"pn:size-[20px]"})}),(0,r.jsx)(c.$,{variant:"ghost",size:"icon",className:"pn:size-[30px]","aria-label":e.isPlaying?"Pause":"Play",onClick:()=>{if(e.isPlaying)e.pause();else{let t=e.currentTime>=e.duration?0:e.effectiveTime;e.play({startTime:t})}},children:e.isPlaying?(0,r.jsx)(o.dc,{name:"pagesTimeline.pause",className:"pn:size-[25px]"}):(0,r.jsx)(o.dc,{name:"pagesTimeline.play",className:"pn:size-[25px]"})})]}),n&&t&&(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-end pn:gap-1.5",children:[(0,r.jsx)("div",{className:"pn:text-xs pn:font-medium pn:tabular-nums pn:opacity-60 pn:@max-[520px]:hidden",children:"Zoom timeline"}),(0,r.jsxs)(ea.e,{className:"pn:items-center",children:[(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",className:"pn:size-[30px]",onClick:()=>{n&&t&&n(Math.max(t/1.5,.005))},title:"Zoom out timeline","aria-label":"Zoom out timeline",children:(0,r.jsx)("span",{className:"pn:font-bold",children:"−"})}),(0,r.jsx)(c.$,{variant:"ghost",size:"icon-sm",className:"pn:size-[30px]",onClick:()=>{n&&t&&n(Math.min(1.5*t,.2))},title:"Zoom in timeline","aria-label":"Zoom in timeline",children:(0,r.jsx)("span",{className:"pn:font-bold",children:"+"})})]})]})]})})}),ed=(0,a.PA)(({store:e,scale:t,minWidth:n=0})=>{let a=i.useRef(null),o=Math.max(e.duration,0),l=Math.max(1,Math.ceil(o/1e3)),s=Math.max(o*t,n,120),c=1e3*t,u=[1,2,5,10,15,30,60,120,300,600],p=u.find(e=>e*c>=70)||u[u.length-1],h=Math.max(1,Math.ceil(20/c)),m=i.useCallback(n=>{var r;if(!a.current)return;let i=a.current.getBoundingClientRect(),o=(0,d.q)(n-i.left,0,i.width);e.setCurrentTime((0,d.q)(o/t,0,e.duration)),null==(r=e.checkActivePage)||r.call(e)},[t,e]),f=i.useCallback(e=>{(0,v.TS)(e)&&(m(e.clientX),(0,v.ez)(e,{onMove:e=>m(e.clientX)}))},[m]);return(0,r.jsx)("div",{ref:a,className:"polotno-time-ruler pn:relative pn:h-6 pn:cursor-pointer pn:touch-pan-y pn:select-none pn:text-inherit",onPointerDown:f,style:{minWidth:s+"px",width:s+"px"},children:Array.from({length:l+1},(e,n)=>{let i=n%p==0,a=n%h==0&&!i;return i||a?(0,r.jsxs)("div",{style:{position:"absolute",left:1e3*n*t+"px",to
28p:0,transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:4,pointerEvents:"none"},children:[a&&(0,r.jsx)("div",{className:"pn:size-1 pn:rounded-full pn:bg-current pn:opacity-50"}),i&&(0,r.jsx)("div",{className:"pn:mt-1 pn:text-center pn:text-[11px] pn:tabular-nums pn:opacity-70",children:n<60?`${n}s`:`${Math.floor(n/60)}m${n%60?n%60+"s":""}`})]},n):null})})}),ec=(0,a.PA)(({store:e,defaultOpened:t=!1})=>{let n=i.useRef(null),[a,h]=i.useState(t),[m,f]=i.useState(.02),[g,x]=i.useState(()=>(e=>{if(!l.Mv.animationsEnabled)return 65;let t=e.pages.reduce((e,t)=>e+t.children.length,0),n=25*e.audios.length+20*t+140;return(0,d.q)(n,140,420)})(e)),[b,y]=i.useState(!1),w=e.duration*m;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{position:"relative",height:"0px"},children:(0,r.jsxs)(c.$,{variant:"ghost",size:"sm",onClick:()=>{h(!a)},className:(0,d.cn)((0,u.a)(),"pn:absolute pn:bottom-[5px] pn:left-[5px] pn:z-[1] pn:dark:hover:bg-accent"),children:[l.Mv.animationsEnabled&&!a?(0,r.jsx)(o.dc,{name:"pagesTimeline.play",className:"pn:size-4"}):null,(0,s.t)("pagesTimeline.pages")]})}),(0,r.jsxs)(p.Fp,{attached:"top",style:{padding:"5px",height:"auto",zIndex:1,position:"relative",overflow:"visible",display:a?"block":"none"},className:"polotno-pages-timeline pn:whitespace-normal pn:bg-background",children:[l.Mv.animationsEnabled&&(0,r.jsx)("div",{onPointerDown:e=>{if(!(0,v.TS)(e))return;let t=e.clientY;y(!0),(0,v.ez)(e,{onMove:e=>{let n=g-(e.clientY-t);x((0,d.q)(n,140,420))},onEnd:()=>y(!1)})},className:"pn:group/pn-resize-handle pn:absolute pn:top-0 pn:left-0 pn:right-0 pn:flex pn:h-[14px] pn:-translate-y-1/2 pn:cursor-ns-resize pn:touch-none pn:items-center pn:justify-center"+(b?" active":""),title:"Drag to adjust timeline height",children:(0,r.jsx)("div",{className:"pn:h-1 pn:w-full pn:rounded-[2px] pn:transition-colors pn:group-hover/pn-resize-handle:bg-primary"+(b?" pn:bg-primary":" pn:bg-transparent")})}),l.Mv.animationsEnabled&&(0,r.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,r.jsx)(es,{store:e,scale:m,onScaleChange:f})}),(0,r.jsx)("div",{dir:"ltr",style:{width:"100%",position:"relative",height:g},children:(0,r.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,bottom:0,overflowX:"auto",padding:"0 24px"},ref:n,children:(0,r.jsxs)("div",{style:{position:"relative",minWidth:l.Mv.animationsEnabled?w+"px":void 0},children:[l.Mv.animationsEnabled&&(0,r.jsx)(ed,{store:e,scale:m,minWidth:w}),(0,r.jsxs)("div",{style:{position:"relative",display:"flex"},children:[(0,r.jsx)("div",{style:{position:"relative",minWidth:l.Mv.animationsEnabled?w+"px":void 0,height:"60px"},children:(0,r.jsx)(D,{store:e,scale:m})}),(0,r.jsx)(c.$,{variant:"ghost",size:"icon",style:{width:"60px",height:"60px",marginLeft:"12px"},onClick:()=>{var t;e.addPage({bleed:(null==(t=e.activePage)?void 0:t.bleed)||0})},children:(0,r.jsx)(o.dc,{name:"action.add",className:"pn:size-4"})})]}),l.Mv.animationsEnabled&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ei,{store:e,scale:m,width:w}),(0,r.jsx)(Y,{store:e,scale:m,width:w})]}),l.Mv.animationsEnabled&&(0,r.jsx)(L,{store:e,scale:m,dragAreaRef:n,variant:"timeline"})]})})})]})]})})},63768:(e,t,n)=>{"use strict";n.d(t,{d:()=>A});var r=n(95155),i=n(12115),a=n(6993),o=n(42433),l=n(33593),s=n(78437),d=n(99793),c=n(80873),u=n(99892),p=n(79574),h=n(27970);let m=i.createContext(void 0),f={...n(62113).dc,checked:e=>e?{"data-checked":""}:{"data-unchecked":""}};var g=n(68388),x=n(48916),v=n(90845),b=n(31369),y=n(36499),w=n(74614),j=n(35836),k=n(39174),C=n(47023);let E=i.forwardRef(function(e,t){let{checked:n,className:h,defaultChecked:E,"aria-labelledby":S,form:P,id:N,inputRef:A,name:M,nativeButton:O=!1,onCheckedChange:T,readOnly:R=!1,required:_=!1,disabled:z=!1,render:I,uncheckedValue:D,value:F,style:L,...B}=e,{clearErrors:$}=(0,b.x)(),{state:W,setTouched:V,setDirty:H,validityData:q,setFilled:K,setFocused:U,validationMode:X,disabled:Y,name:Z,validation:G}=(0,x.V$)(),{labelId:Q}=(0,y.H)(),J=Y||z,ee=Z??M,et=i.useRef(null),en=(0,o.a)(et,A,G.inputRef),er=i.useRef(null),ei=(0,u.e)(),ea=(0,w.l)({id:N,implicit:!1,controlRef:er}),eo=O?void 0:ea,[el,es]=(0,a.q)({controlled:n,default:!!E,name:"Switch",state:"checked"});(0,v.I)(er,ei,el,void 0,!J,M),(0,l.g)(()=>{et.current&&K(et.current.checked)},[K]),(0,C.x)(el,()=>{$(ee),H(el!==q.initialValue),K(el),G.change(el)});let{getButtonProps:ed,buttonRef:ec}=(0,p.s)({disabled:J,native:O}),eu=function(e,t,n,r=!0,a){let[o,s]=i.useState(),d=(0,u.e)(a?`${a}-label`:void 0),c=e??t??o;return(0,l.g)(()=>{let i=e||t||!r?void 0:function(e,t){let n=function(e){if(!e)return;let t=e.parentElement;if(t&&"LABEL"===t.tagName)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}(n.current,d);o!==i&&s(i)}),c}(S,Q,et,!O,eo),ep={...G.getValidationProps(J),checked:el,disabled:J,form:P,id:eo,name:ee,required:_,style:ee?s.a:s.Q,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:en,onChange(e){if(e.nativeEvent.defaultPrevented)return;if(R)return void e.preventDefault();let t=e.currentTarget.checked,n=(0,j.d)(k.dv,e.nativeEvent);T?.(t,n),n.isCanceled||es(t)},onClick(e){e.stopPropagation()},onFocus(){er.current?.focus()},...void 0!==F?{value:F}:d.t0},eh=i.useMemo(()=>({...W,checked:el,disabled:J,readOnly:R,required:_}),[W,el,J,R,_]),em=(0,c.o)("span",e,{state:eh,ref:[t,er,ec],props:[{id:O?ea:ei,role:"switch","aria-checked":el,"aria-readonly":R||void 0,"aria-required":_||void 0,"aria-labelledby":eu,onF
28ocus(){J||U(!0)},onBlur(){let e=et.current;e&&!J&&(V(!0),U(!1),"onBlur"===X&&G.commit(e.checked))},onClick(e){if(R||J)return;e.preventDefault();let t=et.current;t&&(0,g.B)(t,e)}},B,ed,e=>G.getValidationProps(J,e)],stateAttributesMapping:f});return(0,r.jsxs)(m.Provider,{value:eh,children:[em,!el&&ee&&void 0!==D&&(0,r.jsx)("input",{type:"hidden",form:P,name:ee,value:D,disabled:J}),(0,r.jsx)("input",{...ep,suppressHydrationWarning:!0})]})}),S=i.forwardRef(function(e,t){let{render:n,className:r,style:a,...o}=e,l=function(){let e=i.useContext(m);if(void 0===e)throw Error((0,h.A)(63));return e}();return(0,c.o)("span",e,{state:l,ref:t,stateAttributesMapping:f,props:o})});var P=n(69819),N=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let A=i.forwardRef((e,t)=>{var{className:n}=e,i=N(e,["className"]);return(0,r.jsx)(E,Object.assign({ref:t,"data-slot":"switch",className:(0,P.cn)("pn:peer pn:group/switch pn:relative pn:inline-flex pn:shrink-0 pn:items-center pn:rounded-full pn:border pn:border-transparent pn:shadow-xs pn:transition-all pn:outline-none pn:after:absolute pn:after:-inset-x-3 pn:after:-inset-y-2 pn:focus-visible:border-ring pn:focus-visible:ring-[3px] pn:focus-visible:ring-ring/50 pn:aria-invalid:border-destructive pn:aria-invalid:ring-[3px] pn:aria-invalid:ring-destructive/20 pn:dark:aria-invalid:border-destructive/50 pn:dark:aria-invalid:ring-destructive/40 pn:data-disabled:cursor-not-allowed pn:data-disabled:opacity-50 pn:h-[1.15rem] pn:w-8 pn:data-checked:bg-primary pn:data-unchecked:bg-input pn:dark:data-unchecked:bg-input/80",n)},i,{children:(0,r.jsx)(S,{"data-slot":"switch-thumb",className:(0,P.cn)("pn:pointer-events-none pn:block pn:rounded-full pn:bg-background pn:ring-0 pn:transition-transform pn:size-4 pn:data-checked:translate-x-[calc(100%-2px)] pn:data-unchecked:translate-x-0 pn:dark:data-checked:bg-primary-foreground pn:dark:data-unchecked:bg-foreground")})}))});A.displayName="Switch"},63787:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Pentagon",[["path",{d:"M10.83 2.38a2 2 0 0 1 2.34 0l8 5.74a2 2 0 0 1 .73 2.25l-3.04 9.26a2 2 0 0 1-1.9 1.37H7.04a2 2 0 0 1-1.9-1.37L2.1 10.37a2 2 0 0 1 .73-2.25z",key:"2hea0t"}]])},68047:(e,t,n)=>{"use strict";n.d(t,{A:()=>eh});var r,i=n(95155),a=n(12115),o=n(38919),l=n(6993),s=n(98627),d=n(33593),c=n(35836),u=n(47023),p=n(99892),h=n(80873),m=n(85182),f=n(38091),g=n(28787),x=n(25379),v=n(48916),b=n(90845),y=n(31369),w=n(36499),j=n(55535);function k(e,t){return e-t}function C(e,t,n,r,i,a){let o=(0,m.q)(e,n,r);if(!i)return o;let l=a.slice();return l[t]=(0,m.q)(o,a[t-1]??-1/0,a[t+1]??1/0),l.sort(k)}function E(e,t,n){if(!Array.isArray(e))return!0;let r=t*n;for(let t=0;t<e.length-1;t+=1)if(!(Math.abs(e[t]-e[t+1])>=r))return!1;return!0}var S=n(62113);let P=()=>null,N={activeThumbIndex:P,max:P,min:P,minStepsBetweenValues:P,step:P,values:P,...S.dc};var A=n(27970);let M=a.createContext(void 0);function O(){let e=a.useContext(M);if(void 0===e)throw Error((0,A.A)(62));return e}var T=n(39174);let R=a.forwardRef(function(e,t){let{"aria-labelledby":n,className:r,defaultValue:S,disabled:P=!1,id:A,format:O,largeStep:R=10,locale:_,render:z,max:I=100,min:D=0,minStepsBetweenValues:F=0,form:L,name:B,onValueChange:$,onValueCommitted:W,orientation:V="horizontal",step:H=1,thumbCollisionBehavior:q="push",thumbAlignment:K="center",value:U,style:X,...Y}=e,Z=(0,p.e)(A),G=(0,j.$)(Z),Q=(0,s.K)($),J=(0,s.K)(W),{clearErrors:ee}=(0,y.x)(),{state:et,disabled:en,name:er,setTouched:ei,setDirty:ea,validityData:eo,validation:el}=(0,v.V$)(),{labelId:es}=(0,w.H)(),[ed,ec]=a.useState(),eu=n??(0,j._)(es,ed),ep=en||P,eh=er??B,[em,ef]=(0,l.q)({controlled:U,default:S??D,name:"Slider"}),eg=a.useRef(null),ex=a.useRef(null),ev=a.useRef([]),eb=a.useRef(null),ey=a.useRef(-1),ew=a.useRef(null),ej=a.useRef(T.dv),[ek,eC]=a.useState(-1),[eE,eS]=a.useState(-1),[eP,eN]=a.useState(!1),[eA,eM]=a.use
28State(()=>new Map),[eO,eT]=a.useState([void 0,void 0]),eR=(0,s.K)(e=>{eC(e),-1!==e&&eS(e)}),e_=(0,s.K)(e=>{e&&(ex.current=e)}),ez=Array.isArray(em),eI=a.useMemo(()=>ez?em.map(e=>(0,m.q)(e,D,I)).sort(k):[(0,m.q)(em,D,I)],[I,D,ez,em]),eD=ez?eI:eI[0];(0,b.I)(el.inputRef,Z,eD,void 0,!ep,B),(0,u.x)(eD,()=>{ee(eh),el.change(eD);let e=eo.initialValue;ea(Array.isArray(eD)&&Array.isArray(e)?!(0,f.B)(eD,e):eD!==e)});let eF=(0,s.K)((e,t)=>{var n,r;if(Number.isNaN(e)||(n=e)===(r=em)||Array.isArray(n)&&Array.isArray(r)&&(0,f.B)(n,r))return!1;let i=t.event,a=new i.constructor(i.type,i);return Object.defineProperty(a,"target",{writable:!0,value:{value:e,name:eh}}),t.event=a,Q(e,t),!t.isCanceled&&(ej.current=t.reason,ef(e),!0)}),eL=(0,s.K)((e,t,n)=>{let r=C(e,t,D,I,ez,eI);if(E(r,H,F)){let e="key"in n?T.QJ:T.pf,i=eF(r,(0,c.d)(e,n.nativeEvent,void 0,{activeThumbIndex:t}));ei(!0),i&&J(r,(0,c.M)(e,n.nativeEvent))}});(0,d.g)(()=>{if(!ep)return;let e=(0,g.RS)((0,o.R)(eg.current));(0,g.gR)(eg.current,e)&&e.blur(),-1!==ek&&eR(-1)},[ek,ep,eR]);let eB=a.useMemo(()=>({...et,activeThumbIndex:ek,disabled:ep,dragging:eP,orientation:V,max:I,min:D,minStepsBetweenValues:F,step:H,values:eI}),[et,ek,ep,eP,I,D,F,V,H,eI]),e$=a.useMemo(()=>({active:ek,controlRef:ex,disabled:ep,dragging:eP,validation:el,format:O,handleInputChange:eL,indicatorPosition:eO,inset:"center"!==K,labelId:eu,rootLabelId:G,largeStep:R,lastUsedThumbIndex:eE,lastChangeReasonRef:ej,form:L,locale:_,max:I,min:D,minStepsBetweenValues:F,name:eh,onValueCommitted:J,orientation:V,pressedThumbCenterOffsetRef:eb,pressedThumbIndexRef:ey,pressedValuesRef:ew,registerFieldControlRef:e_,renderBeforeHydration:"edge"===K,setActive:eR,setDragging:eN,setIndicatorPosition:eT,setLabelId:ec,setValue:eF,state:eB,step:H,thumbCollisionBehavior:q,thumbMap:eA,thumbRefs:ev,values:eI}
28),[ek,eu,G,ep,eP,el,O,eL,eO,R,eE,L,_,I,D,F,eh,J,V,e_,eR,eF,eB,H,q,K,eA,eI]),eW=(0,h.o)("div",e,{state:eB,ref:[t,eg],props:[{"aria-labelledby":eu,id:Z,role:"group"},Y,e=>el.getValidationProps(ep,e)],stateAttributesMapping:N});return(0,i.jsx)(M.Provider,{value:e$,children:(0,i.jsx)(x.u,{elementsRef:ev,onMapChange:eM,children:eW})})});var _=n(2066),z=n(62159),I=n(48514),D=n(62909),F=n(32083);function L(e,t){let n=e.getBoundingClientRect();return t?(n.top+n.bottom)/2:(n.left+n.right)/2}function B(e){if(0===e)return 0;if(1>Math.abs(e)){let t=e.toExponential().split("e-"),n=t[0].split(".")[1];return(n?n.length:0)+parseInt(t[1],10)}let t=e.toString().split(".")[1];return t?t.length:0}function $(e,t,n){return Number((Math.round((e-n)/t)*t+n).toFixed(Math.max(B(t),B(n))))}function W(e,t,n,r,i,a,o,l){let s=e.slice(),d=a*o,c=s.length-1,u=l??e;s[t]=(0,m.q)(n,r+t*d,i-(c-t)*d);for(let e=t+1;e<=c;e+=1){let t=s[e-1]+d,n=i-(c-e)*d,r=u[e],a=Math.max(s[e],t);r<a&&(a=Math.max(r,t)),s[e]=(0,m.q)(a,t,n)}for(let e=t-1;e>=0;e-=1){let t=s[e+1]-d,n=r+e*d,i=u[e],a=Math.min(s[e],t);i>a&&(a=Math.min(i,t)),s[e]=(0,m.q)(a,n,t)}for(let e=0;e<=c;e+=1)s[e]=Number(s[e].toFixed(12));return s}let V=a.forwardRef(function(e,t){let{render:n,className:r,style:i,...l}=e,{disabled:d,dragging:u,inset:p,lastChangeReasonRef:f,max:x,min:v,minStepsBetweenValues:b,onValueCommitted:y,orientation:w,pressedThumbCenterOffsetRef:j,pressedThumbIndexRef:k,pressedValuesRef:C,registerFieldControlRef:S,renderBeforeHydration:P,setActive:A,setDragging:M,setValue:R,state:B,step:V,thumbCollisionBehavior:H,thumbRef
28s:q,values:K}=O(),U=(0,F.j)(),X=K.length>1,Y="vertical"===w,Z=a.useRef(null),G=a.useRef(null),Q=(0,s.K)(e=>{e&&null==G.current&&(G.current=(0,_.zk)(e).getComputedStyle(e))}),J=a.useRef(null),ee=a.useRef(0),et=a.useRef(0),en=a.useRef(null),er=(0,D.u)(K);function ei(e){return e?.querySelector('input[type="range"]')}function ea(e){k.current=e,q.current[e]||(j.current=null)}function eo(){k.current=-1,j.current=null}function el(e){return!!(0,_.vq)(e)&&q.current.some(t=>!!(0,_.vq)(t)&&!!(0,g.gR)(t,e)&&ei(t)?.disabled===!0)}function es(e){let t=Z.current,n=k.current;if(!t||n<0||n>=K.length)return n>=K.length&&(en.current=null),null;let{width:r,height:i,bottom:a,left:o,right:l}=t.getBoundingClientRect(),s=function(e,t){if(!e)return{start:0,end:0};function n(e){let t=null!=e?parseFloat(e):0;return Number.isNaN(t)?0:t}let r=t?"Top":"InlineStart",i=t?"Bottom":"InlineEnd";return{start:n(e[`border${r}Width`])+n(e[`padding${r}`]),end:n(e[`border${i}Width`])+n(e[`padding${i}`])}}(G.current,Y),d=et.current,c=(Y?i:r)-s.start-s.end-2*d,u=j.current??0,p=e.x-u,h=e.y-u,f=Y?a-h-s.end:("rtl"===U?l-p:p-o)-s.start,g=(x-v)*(0,m.q)((f-d)/c,0,1)+v;return(g=$(g,V,v),g=(0,m.q)(g,v,x),X)?function(e,t,n,r,i,a,o,l,s,d){let c=n??t,u=r??t;if(!(c.length>1))return{value:a,thumbIndex:0,didSwap:!1};let p=s*d;if("push"===e)return{value:W(c,i,a,o,l,s,d),thumbIndex:i,didSwap:!1};let h=c.slice(),f=h[i-1],g=h[i+1],x=null!=f?f+p:o,v=null!=g?g-p:l,b=Number((0,m.q)(a,x,v).toFixed(12));if(h[i]=b,"swap"!==e)return{value:h,thumbIndex:i,didSwap:!1};{let e=c[i],t=a>e,n=a<e,r=t&&null!=g&&a>=g-1e-7,x=n&&null!=f&&a<=f+1e-7;if(!r&&!x)return{value:h,thumbIndex:i,didSwap:!1};let v=r?i+1:i-1,y=h.map((e,t)=>{if(t===i)return b;let n=u[t];return null!=n?n:c[t]}),w=a;w=r?Math.max(a,h[v]):Math.min(a,h[v]);let j=W(h,v,w,o,l,s,d,y),k=r?v-1:v+1,C=j[k-1],E=j[k+1],S=null!=C?C+p:o;S=Math.max(S,o+k*p);let P=null!=E?E-p:l;P=Math.min(P,l-(j.length-1-k)*p);let N=(0,m.q)(b,S,P);return j[k]=Number(N.toFixed(12)),{value:j,thumbIndex:v,didSwap:!0}}}(H,K,er.current,C.current,n,g,v,x,V,b):{value:g,thumbIndex:n,didSwap:!1}}function ed(e){C.current=X?K.slice():null,en.current=null,er.current=K;let t=k.current,n=t;if(t>-1&&t<K.length){if(K[t]===x){let e=t;for(;e>0&&K[e-1]===x;)e-=1;n=e}}else{let t,r=Y?"y":"x";n=-1;for(let i=0;i<q.current.length;i+=1){let a=q.current[i];if((0,_.vq)(a)&&!ei(a)?.disabled){let o=L(a,Y),l=Math.abs(e[r]-o);(void 0===t||l<=t)&&(n=i,t=l)}}}if(n>-1&&n!==t&&ea(n),p){let e=q.current[n];(0,_.vq)(e)&&(et.current=e.getBoundingClientRect()[Y?"height":"width"]/2)}}function ec(e){let t=ei(q.current?.[e]);t&&t.focus({preventScroll:!0,focusVisible:!1})}function eu(e,t,n){let r=R(e.value,(0,c.d)(t,n,void 0,{activeThumbIndex:e.thumbIndex}));return r&&(en.current=e.value,er.current=Array.isArray(e.value)?e.value:[e.value],e.didSwap&&(ea(e.thumbIndex),ec(e.thumbIndex))),r}let ep=(0,s.K)(e=>{let t=function(e,t){if(null!=t.current&&e.changedTouches){for(let n=0;n<e.changedTouches.length;n+=1){let r=e.changedTouches[n];if(r.identifier===t.current)return{x:r.clientX,y:r.clientY}}return null}return{x:e.clientX,y:e.clientY}}(e,J);if(null==t)return;if(ee.current+=1,"pointermove"===e.type&&0===e.buttons)return void eh(e);let n=es(t);null!=n&&E(n.value,V,b)&&(!u&&ee.current>2&&M(!0),eu(n,T.$E,e))}),eh=(0,s.K)(e=>{A(-1),M(!1),j.current=null;let t=en.current;if(Array.isArray(t)&&t.length!==K.length&&(en.current=null),null!=en.current){let t=f.current;y(en.current,(0,c.M)(t,e))}"pointerType"in e&&Z.current?.hasPointerCapture(e.pointerId)&&Z.current?.releasePointerCapture(e.pointerId),k.current=-1,J.current=null,ef()}),em=(0,s.K)(e=>{if(d)return;if(el((0,g.EW)(e)))return void eo();let t=e.changedTouches[0];if(null==t)return;J.current=t.identifier;let n={x:t.clientX,y:t.clientY};ed(n);let r=es(n);if(null==r)return;ec(r.thumbIndex),eu(r,T.ru,e),ee.current=0;let i=(0,o.R)(Z.current);i.addEventListener("touchmove",ep,{passive:!0}),i.addEventListener("touchend",eh,{passive:!0})}),ef=(0,s.K)(()=>{let e=(0,o.R)(Z.current);e.removeEventListener("pointermove",ep),e.removeEventListener("pointerup",eh),e.removeEventListener("touchmove",ep),e.removeEventListener("touchend",eh),C.current=null,en.current=null}),eg=(0,I.NR)();return a.useEffect(()=>{let e=Z.current;if(!e)return()=>ef();let t=(0,z.q)(e,"touchstart",em,{passive:!0});return()=>{t(),eg.cancel(),ef()}},[ef,em,Z,eg]),a.useEffect(()=>{d&&ef()},[d,ef]),(0,h.o)("div",e,{state:B,ref:[t,S,Z,Q],props:[{"data-base-ui-slider-control":P?"":void 0,onPointerDown(e){let t=Z.current,n=(0,g.EW)(e.nativeEvent);if(!t||d||e.defaultPrevented||!(0,_.vq)(n)||0!==e.button)return;if(el(n))return void eo();let r={x:e.clientX,y:e.clientY};ed(r);let i=es(r);if(null==i)return;(0,g.gR)(q.current[i.thumbIndex],(0,g.RS)((0,o.R)(t)))?e.preventDefault():eg.request(()=>{ec(i.thumbIndex)}),M(!0),null==j.current&&eu(i,T.ru,e.nativeEvent),e.nativeEvent.pointerId&&t.setPointerCapture(e.nativeEvent.pointerId),ee.current=0;let a=(0,o.R)(t);a.addEventListener("pointermove",ep,{passive:!0}),a.addEventListener("pointerup",eh,{once:!0})}},l],stateAttributesMapping:N})}),H=a.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{state:o}=O();return(0,h.o)("div",e,{state:o,ref:t,props:[{style:{position:"relative"}}
28,a],stateAttributesMapping:N})});var q=n(14806),K=n(99793);function U(){return K.tE}function X(){return!1}function Y(){return!0}function Z(){return(0,q.useSyncExternalStore)(U,X,Y)}let G=a.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{indicatorPosition:o,inset:l,max:s,min:d,orientation:c,renderBeforeHydration:u,state:p,values:m}=O(),f=Z(),g=function(e,t,n,r,i,a){let o={visibility:a||n&&(void 0===r||t&&void 0===i)?"hidden":void 0,position:e?"absolute":"relative",[e?"width":"height"]:"inherit"},l=`${r??0}%`,s=`${(i??0)-(r??0)}%`;return n&&(o["--start-position"]=l,l="var(--start-position)",t&&(o["--relative-size"]=s,s="var(--relative-size)")),o[e?"bottom":"insetInlineStart"]=t?l:0,o[e?"height":"width"]=t?s:l,o}("vertical"===c,m.length>1,l,l?o[0]:(m[0]-d)*100/(s-d),l?o[1]:(m[m.length-1]-d)*100/(s-d),l&&u&&f);return(0,h.o)("div",e,{state:p,ref:t,props:[{"data-base-ui-slider-indicator":u?"":void 0,style:g,suppressHydrationWarning:u||void 0},a],stateAttributesMapping:N})});var Q=n(42433),J=n(78437);let ee=new Map;function et(e,t,n){return null==e?"":(function(e,t){let n=JSON.stringify({locale:function e(t){return Array.isArray(t)?t.map(t=>e(t)).join(","):null==t?"":String(t)}(e),options:t}),r=ee.get(n);if(r)return r;let i=new Intl.NumberFormat(e,t);return ee.set(n,i),i})(t,n).format(e)}var en=n(82668),er=n(63142),ei=n(35479),ea=n(52759);function eo(e){let{script:t}=e,{nonce:n}=(0,ea.n)();return Z()?(0,i.jsx)("script",{nonce:n,dangerouslySetInnerHTML:{__html:t},suppressHydrationWarning:!0}):null}var el=n(56824),es=n(74614);let ed=new Set([...er.jF,er.w_,er.dB]),ec=a.forwardRef(function(e,t){let n,o,l,{render:c,children:u,className:f,"aria-describedby":x,"aria-label":b,"aria-labelledby":y,"aria-valuetext":w,disabled:j=!1,getAriaLabel:k,getAriaValueText:E,id:S,index:P,inputRef:A,onBlur:M,onFocus:T,onKeyDown:R,tabIndex:z,style:I,...D}=e,W=(0,p.e)(S),{active:V,lastUsedThumbIndex:H,controlRef:q,disabled:K,validation:U,format:X,handleInputChange:Y,inset:G,labelId:ee,largeStep:ea,locale:ec,max:eu,min:ep,minStepsBetweenValues:eh,form:em,name:ef,orientation:eg,pressedThumbCenterOffsetRef:ex,pressedThumbIndexRef:ev,renderBeforeHydration:eb,setActive:ey,setIndicatorPosition:ew,state:ej,step:ek,thumbRefs:eC,values:eE}=O(),eS=(0,F.j)(),eP=j||K,eN=eE.length>1,eA="vertical"===eg,eM="rtl"===eS,{setTouched:eO,setFocused:eT,validationMode:eR}=(0,v.V$)(),e_=a.useRef(null),ez=a.useRef(null),eI=a.useRef(!1),eD=(0,s.K)(e=>{eI.current||T?.(e)}),eF=(0,s.K)(e=>{eI.current||M?.(e)}),eL=(0,p.e)(),eB=(0,es.l)(),e$=eN?eL:eB,eW=a.useMemo(()=>({inputId:e$}),[e$]),{ref:eV,index:eH}=(0,ei.q)({metadata:eW}),eq=eN?P??eH:0,eK=eq===eE.length-1,eU=eE[eq],eX=(eU-ep)*100/(eu-ep),[eY,eZ]=a.useState(),eG=Z(),eQ=H>=0&&H<eE.length?H:-1,eJ=(0,s.K)(()=>{let e=q.current,t=e_.current;if(!e||!t)return;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=eA?"height":"width",a=r[i]-n[i],o=(n[i]/2+a*eX/100)/r[i]*100,l=Number.isFinite(o)?o:void 0;eZ(l),0===eq?ew(e=>[l,e[1]]):eK&&ew(e=>[e[0],l])});(0,d.g)(()=>{G&&queueMicrotask(eJ)},[eJ,G]),(0,d.g)(()=>{G&&eJ()},[eJ,G,eX]),(0,d.g)(()=>{if(!G)return;let e=q.current,t=e_.current;if(!e||!t)return;let n=(0,_.zk)(e).ResizeObserver;if("function"!=typeof n)return;let r=new n(eJ);return r.observe(e),r.observe(t),()=>{r.disconnect()}},[q,eJ,G]);let e0=eA?"bottom":"insetInlineStart",e1=eA?"left":"top";eN?V===eq?n=2:eQ===eq&&(n=1):V===eq&&(n=1),o=G||Number.isFinite(eX)?{position:"absolute",[e0]:G?"var(--position)":`${eX}%`,[e1]:"50%",translate:`${(eA||!eM?-1:1)*50}% ${(eA?1:-1)*50}%`,zIndex:n,...G&&{"--position":`${eY??0}%`,visibility:eb&&eG||void 0===eY?"hidden":void 0}}:J.Q,eA&&(l=eM?"vertical-rl":"vertical-lr");let e2="function"==typeof k?k(eq):b,e5=(0,en.v6)({"aria-label":e2,"aria-labelledby":y??(null==e2?ee:void 0),"aria-describedby":x,"aria-orientation":eg,"aria-valuenow":eU,"aria-valuetext":"function"==typeof E?E(et(eU,ec,X),eU,eq):w??function(e,t,n,r){if(!(t<0))return 2===e.length?`${et(e[t],r,n)} ${0===t?"start":"end"} range`:n?et(e[t],r,n):void 0}(eE,eq,X,ec),disabled:eP,form:em,id:e$,max:eu,min:ep,name:ef,onChange(e){Y(e.currentTarget.valueAsNumber,eq,e)},onFocus(e){let t=eI.current;eI.current=!1,ey(eq),eT(!0),t&&e.stopPropagation()},onBlur(e){if(eI.current)return void e.stopPropagation();ey(-1),eC.current.some(t=>(0,g.gR)(t,e.relatedTarget))||(eO(!0),eT(!1),"onBlur"===eR&&U.commit(C(eU,eq,ep,eu,eN,eE)))},onKeyDown(e){if(e.defaultPrevented||!ed.has(e.key))return;er.jF.has(e.key)&&e.stopPropagation();let t=null,n=0,r=e.shiftKey?ea:ek,i=$(eU,ek,ep);switch(e.key){case er.il:n=1;break;case er.RJ:n=eM?-1:1;break;case er.Jd:n=-1;break;case er.eR:n=eM?1:-1;break;case er.w_:r=ea,n=1;break;case er.dB:r=ea,n=-1;break;case er.Kp:t=eN&&Number.isFinite(eE[eq+1])?eE[eq+1]-ek*eh:eu;break;case er.yZ:t=eN&&Number.isFinite(eE[eq-1])?eE[eq-1]+ek*eh:ep}if(0!==n&&(t=function(e,t,n,r,i){let a=Number((e+t*n).toFixed(Math.max(B(e),B(t),B(r))));return(0,m.q)(a,r,i)}(i,r,n,ep,eu)),null!==t){let n=e.currentTarget;(0,el.em)(n)||(eI.current=!0,n.blur(),n.focus({preventScroll:!0,focusVisible:!0})),Y(t,eq,e),e.preventDefault()}},step:ek,style:{...J.Q,width:"100%",height:"100%",writingMode:l},tabIndex:z,type:"range",value:eU??""},e=>U.getValidationProps(eP,e),{onFocus:eD,onBlur:eF,onKeyDown:R}),e3=(0,Q.a)(ez,U.inputRef,A);return(0,h.o)("div",e,{state:ej,ref:[t,eV,e_],props:[{"data-index":eq,children:(0,i.jsxs)(a.Fragment,{children:[u,(0,i.jsx)("input",{ref:e3,...e5,suppressHydrationWarning:!0}),G&&eK&&eb&&(r||(r=(0,i.jsx)(eo,{script:""})))]}),id:W,onPointerDown(e){if(eP)return;ev.current=eq;let t=L(e.currentTarget,eA);ex.current=(eA?e.clientY:e.clientX)-t},style:o,suppressHydrationWarning:eb||void 0},D],stateAttributesMapping:N})});var eu=n(69819),ep=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let eh=a.forwardRef((e,t)=>
28{var{className:n,defaultValue:r,value:o,min:l=0,max:s=100}=e,d=ep(e,["className","defaultValue","value","min","max"]);let c=a.useMemo(()=>Array.isArray(o)?o:Array.isArray(r)?r:[l,s],[o,r,l,s]);return(0,i.jsx)(R,Object.assign({ref:t,"data-slot":"slider",defaultValue:r,value:o,min:l,max:s,className:(0,eu.cn)("pn:relative pn:w-full pn:data-[orientation=vertical]:h-full pn:data-[orientation=vertical]:min-h-44 pn:data-[orientation=vertical]:w-auto",n)},d,{children:(0,i.jsxs)(V,{className:(0,eu.cn)("pn:relative pn:flex pn:w-full pn:touch-none pn:items-center pn:select-none pn:data-[disabled]:opacity-50 pn:data-[orientation=vertical]:h-full pn:data-[orientation=vertical]:w-auto pn:data-[orientation=vertical]:flex-col"),children:[(0,i.jsx)(H,{"data-slot":"slider-track",className:(0,eu.cn)("pn:relative pn:grow pn:overflow-hidden pn:rounded-full pn:bg-muted pn:data-[orientation=horizontal]:h-1.5 pn:data-[orientation=horizontal]:w-full pn:data-[orientation=vertical]:h-full pn:data-[orientation=vertical]:w-1.5"),children:(0,i.jsx)(G,{"data-slot":"slider-range",className:(0,eu.cn)("pn:absolute pn:bg-primary pn:data-[orientation=horizontal]:h-full pn:data-[orientation=vertical]:w-full")})}),Array.from({length:c.length},(e,t)=>(0,i.jsx)(ec,{"data-slot":"slider-thumb",className:"pn:block pn:size-4 pn:shrink-0 pn:rounded-full pn:border pn:border-primary pn:bg-background pn:shadow-sm pn:ring-ring/50 pn:transition-[color,box-shadow] pn:hover:ring-4 pn:focus-visible:ring-4 pn:focus-visible:outline-hidden pn:disabled:pointer-events-none pn:disabled:opacity-50"},t))]})}))});eh.displayName="Slider"},69065:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Images",[["path",{d:"M18 22H4a2 2 0 0 1-2-2V6",key:"pblm9e"}],["path",{d:"m22 13-1.296-1.296a2.41 2.41 0 0 0-3.408 0L11 18",key:"nf6bnh"}],["circle",{cx:"12",cy:"8",r:"2",key:"1822b1"}],["rect",{width:"16",height:"16",x:"6",y:"2",rx:"2",key:"12espp"}]])},69410:(e,t,n)=>{"use strict";n.d(t,{Zq:()=>r.Zq,b:()=>r.b});var r=n(27024);n(41251)},69427:(e,t,n)=>{"use strict";n.d(t,{vu:()=>tD,nE:()=>tM,bs:()=>m.b,yj:()=>tR,nm:()=>tA,p7:()=>u,wv:()=>t$,pZ:()=>t_,JN:()=>tP,TH:()=>tN,xN:()=>tO});var r=n(95155),i=n(12115),a=n(50546),o=n(9635),l=n(22884),s=n(24729),d=n(69819),c=n(72094);let u=({children:e,name:t,onClick:n,active:i,iconSize:a})=>(0,r.jsxs)("div",{role:"button",onClick:n,className:(0,d.cn)("polotno-side-panel-tab pn-section-tab pn:w-full pn:cursor-pointer pn:whitespace-pre pn:text-center pn:text-[12px]","pn:pt-[15px] pn:pl-[5px] pn:pr-[5px] pn:h-[72px]","pn:max-md:h-[54px] pn:max-md:pt-[9px] pn:max-md:min-w-[72px] pn:max-md:w-min","pn:pn-mobile:h-[54px] pn:pn-mobile:pt-[9px] pn:pn-mobile:min-w-[72px] pn:pn-mobile:w-min","pn:hover:bg-sidebar-accent pn:hover:text-sidebar-accent-foreground",i&&"active pn:bg-sidebar-accent pn:text-sidebar-accent-foreground"),children:[(0,r.jsx)("div",{style:{fontSize:(a||14)+"px"},children:e}),(0,r.jsx)("div",{style:{paddingTop:"5px"},children:t})]});var p=n(38228),h=n(85162),m=n(10620),f=n(55228),g=n(6234),x=n(87763),v=n(84629);let b=i.forwardRef(({placeholder:e,onChange:t,className:n,style:i},a)=>(0,r.jsxs)(v.MG,{className:n,style:i,children:[(0,r.jsx)(v.Sq,{children:(0,r.jsx)(x.A,{})}),(0,r.jsx)(v.iV,{ref:a,placeholder:e,onChange:t,type:"search"})]}));b.displayName="SearchInput";var y=n(63768);let w=(e,t)=>{let n=i.useRef(!0);i.useEffect(()=>{n.current?n.current=!1:e()},t)},j=(0,a.PA)(({sizeQuery:e,query:t,store:n})=>{let{setQuery:i,loadMore:a,hasMore:o,data:l,isLoading:s,reset:d,error:c}=(0,g.W)({getAPI:({page:t,query:n})=>(0,f.nI)({page:t,query:n,sizeQuery:e}),getSize:e=>e.totalPages});return w(()=>{d()},[e]),w(()=>{i(t)},[t]),(0,r.jsx)(m.b,{images:null==l?void 0:l.map(e=>e.items).flat(),getPreview:e=>e.preview,isLoading:s,onSelect:async e=>{let t=await fetch(e.json),r=await t.json();if(n.pages.length<=1)n.loadJSON(r,!0);else{let e=JSON.parse(JSON.stringify(n.toJSON()));e.width===r.width&&e.height===r.height||r.pages.forEach(e=>{e.width=e.width||r.width,e.height=e.height||r.height}),(0,h.Zf)({children:r.pages},e=>{e.id=(0,p.Ak)(10)});let t=n.pages.indexOf(n.activePage);e.pages.splice(t,1,...r.pages),n.loadJSON(e,!0)}}
28,loadMore:o&&a,error:c})}),k=(0,a.PA)(({store:e})=>{let[t,n]=i.useState(!0),[a,o]=i.useState(""),l=t?`${e.width}x${e.height}`:"all";return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsx)(b,{style:{marginBottom:"20px"},placeholder:(0,s.t)("sidePanel.searchPlaceholder"),onChange:e=>{o(e.target.value)}}),(0,r.jsxs)("label",{className:"pn:flex pn:items-center pn:justify-between",style:{marginTop:"8px",marginBottom:"25px"},children:[(0,r.jsxs)("span",{className:"pn:text-sm",children:[(0,s.t)("sidePanel.searchTemplatesWithSameSize")," "]}),(0,r.jsx)(y.d,{checked:t,onCheckedChange:e=>{n(!!e)}})]}),(0,r.jsx)(j,{store:e,sizeQuery:"size="+l,query:a})]})});var C=n(1842);function E(e){return(0,r.jsxs)("span",{children:["Photo by"," ",(0,r.jsx)("a",{href:`https://unsplash.com/@${e.user.username}?utm_source=polotno&utm_medium=referral`,target:"_blank",children:e.user.name})," ","on"," ",(0,r.jsx)("a",{href:"https://unsplash.com/?utm_source=polotno&utm_medium=referral",target:"_blank",children:"Unsplash"})]})}var S=n(23727);let P=({store:e})=>{let{setQuery:t,loadMore:n,isReachingEnd:i,data:a,isLoading:o,error:l}=(0,g.W)({defaultQuery:"",getAPI:({page:e,query:t})=>(0,f.xW)({page:e,query:t})});return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsx)(b,{style:{marginBottom:"20px"},placeholder:(0,s.t)("sidePanel.searchPlaceholder"),onChange:e=>{t(e.target.value)}}),(0,r.jsxs)("p",{className:"pn:text-center pn:text-sm pn:text-muted-foreground",children:["Photos by"," ",(0,r.jsx)("a",{href:"https://unsplash.com/",target:"_blank",className:"pn:font-medium pn:text-foreground pn:underline pn:underline-offset-2",children:"Unsplash"})]}),(0,r.jsx)(m.b,{images:null==a?void 0:a.map(e=>e.results).flat().filter(Boolean),getPreview:e=>e.urls.small,getAlt:e=>e.alt_description||"",onSelect:async(t,n,r)=>{fetch((0,f.rP)(t.id)),(0,S.g)({src:t.urls.regular,store:e,droppedPos:n,targetElement:r})},isLoading:o,error:l,loadMore:!i&&n,getCredit:E})]})};var N=n(15030),A=n(69410),M=n(36411);let O=async e=>{let t=await fetch(f.tl.nounProjectDownload(e)),n=await t.text();return await (0,A.Zq)(n)},T=({store:e,query:t})=>{let{data:n,isLoading:a,loadMore:o,setQuery:l,hasMore:s}=(0,g.W)({defaultQuery:t,getAPI:({page:e,query:t})=>f.tl.nounProjectList({query:t,page:e}),getSize:e=>e.pagesNumber});return i.useEffect(()=>{l(t)},[t]),(0,r.jsx)("div",{className:"pn:h-full pn:overflow-hidden",children:(0,r.jsx)(m.b,{shadowEnabled:!1,images:null==n?void 0:n.map(e=>e.icons).flat(),getPreview:e=>e.preview_url_84,getImageClassName:()=>"polotno-element-preview",isLoading:a,onSelect:async(t,n,r)=>{if(r&&"image"===r.type&&r.contentEditable||r&&"video"===r.type&&r.contentEditable){let e=await O(t.id);return void r.set({clipSrc:e})}e.history.transaction(async()=>{var r;let i=((null==n?void 0:n.x)||e.width/2)-100,a=((null==n?void 0:n.y)||e.height/2)-100,o=null==(r=e.activePage)?void 0:r.addElement({type:"svg",width:200,height:200,x:i,y:a}),l=await O(t.id);o&&(0,N._n)(o)&&await o.set({src:l})})},rowsNumber:4,loadMore:s&&o})})},R=[{preview:(0,A.Zq)('\n<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n  <path stroke="#C0BFBF" strokeWidth="4" d="M 1 8 L 30 8"></path>\n</svg>\n'),data:{}},{preview:(0,A.Zq)('\n<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n  <path stroke="#C0BFBF" strokeWidth="4" stroke-dasharray="4 2" d="M 1 8 L 30 8"></path>\n</svg>\n'),data:{dash:[4,2]}},{preview:(0,A.Zq)('\n<svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n  <path stroke="#C0BFBF" strokeWidth="4" stroke-dasharray="1 1" d="M 1 8 L 30 8"></path>\n</svg>\n'),data:{dash:[1,1]}},{preview:(0,A.Zq)('\n    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="2"\n      d="M 25 6 L 29 8 L 25 10"\n      fill="none"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="4" d="M 1 8 L 29 8"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n  </svg>\n'),data:{endHead:"arrow"}},{preview:(0,A.Zq)('\n    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="2"\n      d="M 25 6 L 29 8 L 25 10 Z"\n      fill="#C0BFBF"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="4" d="M 1 8 L 29 8"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n    <circle cx="3" cy="8" r="2" fill="#C0BFBF"></circle>\n  </svg>\n'),data:{startHead:"circle",endHead:"triangle"}},{preview:(0,A.Zq)('\n    <svg xmlns="http://www.w3.org/2000/svg" width="32" height="16">\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="2"\n      d="M 1 6 L 5 6 L 5 10 L 1 10 Z"\n      fill="#C0BFBF"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="4" d="M 1 8 L 29 8"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n      stroke-dasharray="2 1"\n    ></path>\n    <path\n      stroke="#C0BFBF"\n      strokeWidth="4" d="M 29 6 L 29 10"\n      strokeLinejoin="round"\n      strokeLinecap="round"\n    ></path>\n  </svg>\n'),data:{startHead:"square",endHead:"bar",dash:[2,1]}}];function _(e,t){let n="#C0BFBF",r="";for(let e=1;e<t;e++){let i=Math.round(e/t*80);r+=`<line x1="${i}" y1="0" x2="${i}" y2="60" stroke="${n}" stroke-width="1.5"/>`}for(let t=1;t<e;t++){let i=Math.round(t/e*60);r+=`<line x1="0" y1="${i}" x2="80" y2="${i}" stroke="${n}" stroke-width="1.5"/>`}return`<svg xmlns="http://www.w3.org/2000/svg" width="80" height="60"><rect x="0.5" y="0.5" width="79" height="59" fill="none" stroke="${n}" stroke-width="1.5" rx="2"/>${r}</svg>`}let z=[{rows:2,cols:2,preview:(0,A.Zq)(_(2,2))},{rows:3,cols:3,preview:(0,A.Zq)(_(3,3))},{rows:4,cols:3,preview:(0,A.Zq)(_(4,3))},{rows:3,cols:4,preview:(0,A.Zq)(_(3,4))},{rows:4,cols:4,preview:(0,A.Zq)(_(4,4))},{rows:5,cols:3,preview:(0,A.Zq)(_(5,3))}],I="rgba(191, 191, 191, 100)",D=({store:e})=>(0,r.jsx)(m.b,{shadowEnabled:!1,rowsNumber:3,images:R,getPreview:e=>e.preview,itemHeight:50,isLoading:!1,onSelect:async(t,n)=>{let r=e.activePage;if(!r)return;let i=r.computedWidth/3;r.addElement(Object.assign({type:"line",x:n?n.x:r.computedWidth/2-i/2,y:n?n.y:r.computedHeight/2,color:I,width:i},t.data))}}),F=Object.keys(M.QE),L=[{width:300,height:300,fill:"rgba(191, 191, 191, 100)",stroke:"#0c0c0c",strokeWidth:0,url:""}],B=[];
28F.forEach(e=>{L.forEach(t=>{B.push(Object.assign({subType:e},t))})}),B.forEach(e=>{e.url=(0,A.Zq)((0,M.Qu)(e))});let $=({store:e})=>{let t=Math.ceil(B.length/4)||1;return(0,r.jsx)("div",{style:{height:110*t+"px"},children:(0,r.jsx)(m.b,{shadowEnabled:!1,rowsNumber:4,images:B,getPreview:e=>e.url,isLoading:!1,itemHeight:100,onSelect:async(t,n,r)=>{if(r&&"image"===r.type&&r.contentEditable||r&&"video"===r.type&&r.contentEditable)return void r.set({clipSrc:t.url});let i=e.activePage;if(!i)return;let a=(i.computedWidth+i.computedHeight)/2160,o=t.width*a,l=t.height*a,s=((null==n?void 0:n.x)||i.computedWidth/2)-o/2,d=((null==n?void 0:n.y)||i.computedHeight/2)-l/2;i.addElement(Object.assign(Object.assign({type:"figure"},t),{x:s,y:d,width:o,height:l,fill:I}))}})})},W=({store:e})=>(0,r.jsx)(m.b,{shadowEnabled:!1,rowsNumber:3,images:z,getPreview:e=>e.preview,itemHeight:70,isLoading:!1,onSelect:async(t,n)=>{let r=e.activePage;if(!r)return;let i=(r.computedWidth+r.computedHeight)/2160,a=400*i,o=300*i,l=((null==n?void 0:n.x)||r.computedWidth/2)-a/2,s=((null==n?void 0:n.y)||r.computedHeight/2)-o/2;r.addElement({type:"table",x:l,y:s,width:a,height:o,rows:t.rows,cols:t.cols,fontSize:Math.round(30*i)})}}),V=({store:e})=>(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col pn:overflow-auto",children:[(0,r.jsx)("p",{className:"pn:mt-0 pn:mb-2 pn:text-sm",children:(0,s.t)("sidePanel.tables")}),(0,r.jsx)("div",{style:{height:"170px"},children:(0,r.jsx)(W,{store:e})}),(0,r.jsx)("p",{className:"pn:mt-0 pn:mb-2 pn:text-sm",children:(0,s.t)("sidePanel.lines")}),(0,r.jsx)("div",{style:{height:"220px"},children:(0,r.jsx)(D,{store:e})}),(0,r.jsx)("p",{className:"pn:mt-0 pn:mb-2 pn:text-sm",children:(0,s.t)("sidePanel.shapes")}),(0,r.jsx)($,{store:e})]}),H=({store:e})=>{let[t,n]=i.useState(""),a=function(e,t){let[n,r]=(0,i.useState)(e);return(0,i.useEffect)(()=>{let t=setTimeout(()=>{r(e)},500);return()=>{clearTimeout(t)}},[e,500]),n}(t,500),o=!!a;return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsx)(b,{style:{marginBottom:"20px"},placeholder:(0,s.t)("sidePanel.searchPlaceholder"),onChange:e=>{n(e.target.value)}}),o&&(0,r.jsx)(T,{query:a,store:e}),!o&&(0,r.jsx)(V,{store:e})]})};var q=n(80881),K=n(58479),U=n(90842),X=n(13905);let Y="gradient",Z=(0,K.sH)(["white","rgb(82, 113, 255)","rgb(255, 145, 77)","rgb(126, 217, 87)","rgb(255, 222, 89)","rgb(203, 108, 230)","rgb(0, 0, 0, 0)"]),G=(0,a.PA)(({store:e})=>{var t;let{setQuery:n,loadMore:i,isReachingEnd:a,data:o,isLoading:l,error:d}=(0,g.W)({defaultQuery:Y,getAPI:({page:e,query:t})=>(0,f.xW)({page:e,query:t})});return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-around",paddingBottom:"10px"},children:[(0,r.jsx)(X.sk,{value:(null==(t=e.activePage)?void 0:t.background)||"white",onChange:t=>{var n;null==(n=e.activePage)||n.set({background:t})},store:e,position:"bottom-left",gradientEnabled:!0,children:(0,r.jsx)(U.dc,{name:"background.colorPicker",className:"pn:size-5 pn:text-white",style:{mixBlendMode:"difference"}})}),Z.map(t=>(0,r.jsx)(X.qd,{background:t,onClick:()=>{var n;null==(n=e.activePage)||n.set({background:t})}},t))]}),(0,r.jsx)(b,{style:{marginBottom:"20px"},placeholder:(0,s.t)("sidePanel.searchPlaceholder"),onChange:e=>{n(e.target.value||Y)}}),(0,r.jsxs)("p",{className:"pn:text-center pn:text-sm pn:text-muted-foreground",children:["Photos by"," ",(0,r.jsx)("a",{href:"https://unsplash.com/",target:"_blank",className:"pn:font-medium pn:text-foreground pn:underline pn:underline-offset-2",children:"Unsplash"})]}),(0,r.jsx)(m.b,{images:null==o?void 0:o.map(e=>e.results).flat().filter(Boolean),isLoading:l,getPreview:e=>e.urls.small,getAlt:e=>e.alt_description||"",loadMore:!a&&i,onSelect:async t=>{var n;fetch((0,f.rP)(t.id)),null==(n=e.activePage)||n.set({background:t.urls.regular})},error:d,getCredit:E})]})});(0,a.PA)(({store:e})=>{let[t,n]=i.useState({}),a=()=>{let t={};e.pages.forEach(n=>{let r=e.toDataURL({pageId:n.id,pixelRatio:.2});t[n.id]=r}),n(t)};return i.useEffect(()=>{let e=setInterval(a,1e3);return()=>clearInterval(e)},[]),(0,r.jsx)("div",{style:{height:"100%"},children:(0,r.jsx)(m.b,{images:e.pages.slice(),getPreview:n=>t[n.id]||e.pages.indexOf(n),onSelect:async t=>{e.selectPage(t.id)},isLoading:!1,rowsNumber:2})})});var Q=n(51265),J=n(80039),ee=n(90853),et=n(82653);let en=(0,a.PA)(({element:e,store:t})=>{let n=t.selectedElements.indexOf(e)>=0,[a,o]=i.useState(!1),l=()=>o(!1),c=a?e.name:e.name||(0,et._M)(e.text)||`#${e.id}`;return(0,r.jsx)("div",{onMouseDown:n=>{let r=n.ctrlKey||n.metaKey||n.shiftKey?[...t.selectedElementsIds]:[];0>r.indexOf(e.id)&&r.push(e.id),t.selectElements(r)},className:(0,d.cn)("pn:rounded-md pn:border pn:bg-card pn:p-[5px] pn:mx-[1px] pn:mb-[5px] pn:shadow-sm",n&&"selected pn:border-primary pn:bg-primary/10"),style:{display:e.selectable||"admin"===t.role?"auto":"none"},children:(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between",children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center",style:{lineHeight:"30px"},children:[(0,r.jsx)("div",{className:"drag-handle",style:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"move",height:"30px"},children:(0,r.jsx)(U.dc,{name:"action.dragHandle",className:"pn:size-4"})}),(0,r.jsx)("div",{style:{padding:"0 7px",opacity:.5,width:"60px"},children:(0,s.t)("sidePanel.layerTypes."+e.type)}),(0,r.jsx)("div",{style:{maxWidth:"142px"},children:(0,r.jsx)(J.p,{value:c,onFocus:()=>o(!0),onBlur:l,placeholder:(0,s.t)("sidePanel.namePlaceholder"),onChange:t=>{e.set({name:t.target.value})},onKeyDown:e=>{"Enter"!==e.key&&"Escape"!==e.key||(l(),e.target.blur())},className:"pn:h-7 pn:border-none pn:bg-transparent pn:dark:bg-transparent pn:px-1 pn:shadow-none pn:focus-visible:ring-1",style:{minWidth:130}})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)(Q.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.set({visible:!e.visible})},children:(null==e?void 0:e.visible)?(0,r.jsx)(U.dc,{name:"action.visible"}):(0,r.jsx)(U.dc,{name:"action.hidden"})}),(0,r.jsx)(Q.$,{variant:"ghost",size:"icon-sm",onClick:()=>{e.set({draggable:e.locked,contentEditable:e.locked,styleEditable:e.locked,resizable:e.locked,removable:e.locked})},children:(null==e?void 0:e.locked)?(0,r.jsx)(U.dc,{name:"action.lock"}):(0,r.jsx)(U.dc,{name:"action.unlock"})}),(0,r.jsx)(Q.$,{variant:"ghost",size:"icon-sm",disabled:!e.removable,onClick:()=>
28{t.deleteElements([e.id])},style:{marginLeft:"auto"},children:(0,r.jsx)(U.dc,{name:"action.remove"})})]})]})})}),er=(0,a.PA)(({store:e})=>{var t;let n=(null==(t=e.activePage)?void 0:t.children.map(e=>({id:e.id})))||[];n.reverse();let i=(0,l.Fr)();return(0,r.jsxs)("div",{style:{height:"100%",overflow:"auto"},children:[(0,r.jsx)("div",{style:{height:"40px",paddingTop:"5px"},children:(0,s.t)("sidePanel.layersTip")}),(0,r.jsxs)("div",{children:[0===n.length?(0,r.jsx)("div",{children:(0,s.t)("sidePanel.noLayers")}):null,(0,r.jsx)(ee.ReactSortable,{list:n,setList:t=>{let n=t.filter(e=>null!=e&&null!=e.id);n.forEach((t,r)=>{var i,a;let o=n.length-r-1,l=String(t.id),s=e.getElementById(l),d=null==(i=e.activePage)?void 0:i.children.indexOf(s);s&&d!==o&&(null==(a=e.activePage)||a.setElementZIndex(s.id,o))})},direction:"horizontal",handle:i?".drag-handle":void 0,children:n.map(({id:t})=>{let n=e.getElementById(t);return(0,r.jsx)(en,{element:n,store:e},t)})})]})]})});var ei=n(81638),ea=n(73629),eo=n(45954),el=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let es=[{name:"Instagram",icon:(0,r.jsx)(U.dc,{name:"size.instagram"}),sizes:[["Post",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.instagram"})],["Story",1080,1920,"px",(0,r.jsx)(U.dc,{name:"size.instagram"})],["Ad",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.instagram"})]]},{name:"Facebook",icon:(0,r.jsx)(U.dc,{name:"size.facebook"}),sizes:[["Post (Landscape)",1200,630,"px",(0,r.jsx)(U.dc,{name:"size.facebook"})],["Post (Square)",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.facebook"})],["Cover",851,315,"px",(0,r.jsx)(U.dc,{name:"size.facebook"})]]},{name:"Youtube",icon:(0,r.jsx)(U.dc,{name:"size.youtube"}),sizes:[["Thumbnail",1280,720,"px",(0,r.jsx)(U.dc,{name:"size.youtube"})],["Channel",2560,1440,"px",(0,r.jsx)(U.dc,{name:"size.youtube"})],["Short",1080,1920,"px",(0,r.jsx)(U.dc,{name:"size.youtube"})]]},{name:"LinkedIn",icon:(0,r.jsx)(U.dc,{name:"size.linkedin"}),sizes:[["Post",1200,627,"px",(0,r.jsx)(U.dc,{name:"size.linkedin"})],["Banner",1584,396,"px",(0,r.jsx)(U.dc,{name:"size.linkedin"})],["Square",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.linkedin"})]]},{name:"Twitter",icon:(0,r.jsx)(U.dc,{name:"size.twitter"}),sizes:[["Post",1600,900,"px",(0,r.jsx)(U.dc,{name:"size.twitter"})],["Header",1500,500,"px",(0,r.jsx)(U.dc,{name:"size.twitter"})],["Square",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.twitter"})]]},{name:"Video",icon:(0,r.jsx)(U.dc,{name:"size.video"}),sizes:[["Full HD",1920,1080,"px",(0,r.jsx)(U.dc,{name:"size.video"})],["4K UHD",3840,2160,"px",(0,r.jsx)(U.dc,{name:"size.video"})],["Vertical HD",1080,1920,"px",(0,r.jsx)(U.dc,{name:"size.video"})],["Square HD",1080,1080,"px",(0,r.jsx)(U.dc,{name:"size.video"})]]},{name:"Print",icon:(0,r.jsx)(U.dc,{name:"size.print"}),sizes:[["Invitation",14,14,"cm",(0,r.jsx)(U.dc,{name:"size.print"})],["A4 Portrait",21,29.7,"cm",(0,r.jsx)(U.dc,{name:"size.print"})],["A4 Landscape",29.7,21,"cm",(0,r.jsx)(U.dc,{name:"size.print"})],["A3",29.7,42,"cm",(0,r.jsx)(U.dc,{name:"size.print"})],["Letter Portrait",8.5,11,"in",(0,r.jsx)(U.dc,{name:"size.print"})],["Letter Landscape",11,8.5,"in",(0,r.jsx)(U.dc,{name:"size.print"})],["Business card",3.5,2,"in",(0,r.jsx)(U.dc,{name:"size.businessCard"})],["Poster",18,24,"in",(0,r.jsx)(U.dc,{name:"size.print"})]]}],ed=e=>{var{value:t,onChange:n}=e,a=el(e,["value","onChange"]);let[o,l]=i.useState(t.toString()),s=i.useRef(t);s.current=o;let c=()=>{n(Math.max(a.min||0,parseFloat(s.current)))};i.useEffect(()=>{l(String(t))},[t]);let u=Number(a.step)||1,p=e=>{let r=parseFloat(s.current),i=(Number.isNaN(r)?Number(t)||0:r)+e*u;"number"==typeof a.min&&(i=Math.max(a.min,i)),"number"==typeof a.max&&(i=Math.min(a.max,i)),l(String(i=parseFloat(i.toFixed(4)))),n(i)},{className:h}=a,m=el(a,["className"]);return(0,r.jsxs)("div",{className:"pn:relative",children:[(0,r.jsx)(J.p,Object.assign({},m,{type:"number",value:o.toString(),className:(0,d.cn)("pn:pr-6 pn:[appearance:textfield] pn:[&::-webkit-inner-spin-button]:appearance-none pn:[&::-webkit-outer-spin-button]:appearance-none",h),onChange:e=>{let t=e.target.value;Number.isNaN(parseFloat(t))?""===t&&l(t):l(t)},onBlur:c,onFocus:e=>e.target.select(),onKeyDown:e=>{"Enter"===e.key&&c()}})),(0,r.jsxs)("div",{className:"pn:absolute pn:inset-y-0 pn:right-0 pn:flex pn:w-5 pn:flex-col pn:border-l pn:border-input",children:[(0,r.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Increment",className:"pn:flex pn:flex-1 pn:appearance-none pn:cursor-pointer pn:items-center pn:justify-center pn:border-0 pn:bg-transparent pn:text-muted-foreground pn:hover:bg-muted pn:hover:text-foreground",onClick:()=>p(1),children:(0,r.jsx)(U.dc,{name:"ui.chevronUp",className:"pn:size-3"})}),(0,r.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Decrement",className:"pn:flex pn:flex-1 pn:appearance-none pn:cursor-pointer pn:items-center pn:justify-center pn:border-0 pn:border-t pn:border-input pn:bg-transparent pn:text-muted-foreground pn:hover:bg-muted pn:hover:text-foreground",onClick:()=>p(-1),children:(0,r.jsx)(U.dc,{name:"ui.chevronDown",className:"pn:size-3"})})]})]})},ec=({width:e,height:t})=>{let n=e/t,i=n>=1?18:Math.max(4,18*n),a=n>=1?Math.max(4,18/n):18;return(0,r.jsx)("span",{className:"pn:flex pn:size-5 pn:shrink-0 pn:items-center pn:justify-center pn:text-muted-foreground",children:(0,r.jsx)("span",{className:"pn:rounded-[2px] pn:border pn:border-current",style:{width:i,height:a}})})},eu=(0,a.PA)(({store:e})=>{var t,n,a,o;let[l,d]=i.useState(!0),[c,u]=i.useState(!1),[p,h]=i.useState(e.width),[m,f]=i.useState(e.height),g=(0,ei.Aw)({px:10,unit:e.unit,dpi:e.dpi}),x=(null==(t=e.activePage)?void 0:t.computedWidth)||e.width;i.useEffect(()=>{h((0,ei.XG)({px:x,unit:e.unit,dpi:e.dpi}))},[x,e.unit,e.dpi]);let v=(null==(n=e.activePage)?void 0:n.computedHeight)||e.height;i.useEffect(()=>{f((0,ei.XG)({px:v,unit:e.unit,dpi:e.dpi}))},[v,e.unit,e.dpi]);let b=(t,n,r)=>{var i,a,o,l;e.setSize(t,n,r),"auto"!==(null==(i=e.activePage)?void 0:i.width)&&(null==(a=e.activePage)||a.set({width:t})),"auto"!==(null==(o=e.activePage)?void 0:o.height)&&(null==(l=e.activePage)||l.set({height:n}))},w=(0,ei.XG)({px:null!=(o=null==(a=e.activePage)?void 0:a.computedBleed.top)?o:0,unit:e.unit,dpi:e.dpi});return(0,r.jsxs)("div",{style:{height:"100%",overflow:"auto",paddingRight:"3px"},children:[(0,r.jsxs)("div",{style:{paddingBottom:"15px"},children:[(0,r.jsxs)("label",{className:"pn:flex pn:items-center pn:justify-between",style:{marginTop:"8px",marginBottom:"25px"},children:[(0,r.jsxs)("span",{className:"pn:flex pn:items-center pn:gap-1.5",children:[(0,s.t)("sidePanel.useMagicResize")," ",(0,r.jsxs)(eo.m_,{children:[(0,r.jsx)(eo.k$,{render:(0,r.jsx)("span",{className:"pn:inline-flex",children:(0,r.jsx)(U.dc,{name:"action.help",className:"pn:size-4"})})}),(0,r.jsx)(eo.ZI,{children:(0,s.t)("sidePanel.magicResizeDescription")})]})]}),(0,r.jsx)(y.d,{checked:l,onCheckedChange:e=>{d(!!e)}})]}),(0,r.jsxs)("div",{className:"pn:inline-block pn:w-1/2",children:[(0,s.t)("sidePanel.width")," (",e.unit,")"]}),(0,r.jsx)("div",{className:"pn:inline-block pn:w-1/2",children:(0,r.jsx)(ed,{value:p,onChange:e=>{e||(e=g),h(e)},min:g,max:1e4,step:"px"===e.unit?1:.1})})]}),(0,r.jsxs)("div",{style:{paddingBottom:"15px"},children:[(0,r.jsxs)("div",{className:"pn:inline-block pn:w-1/2",children:[(0,s.t)("sidePanel.height")," (",e.unit,")"]}),(0,r.jsx)("div",{className:"pn:inline-block pn:w-1/2",children:(0,r.jsx)(ed,{value:m,onChange:e=>{e||(e=g),f(e)},min:g,max:1e4,step:"px"===e.unit?1:.1})})]}),(0,r.jsxs)("div",{style:{paddingBottom:"15px"},children:[(0,r.jsx)("div",{className:"pn:inline-block pn:w-1/2",children:(0,s.t)("sidePanel.units")}),(0,r.jsx)("div",{className:"pn:inline-block pn:w-1/2",children:(0,r.jsxs)(ea.l6,{value:e.unit,onValueChange:t=>{e.setUnit({unit:t,dpi:e.dpi})},children:[(0,r.jsx)(ea.bq,{className:"pn:w-full",children:(0,r.jsx)(ea.yv,{})}),(0,r.jsxs)(ea.gC,{children:[(0,r.jsx)(ea.eb,{value:"px",children:"px"}),(0,r.jsx)(ea.eb,{value:"cm",children:"cm"}),(0,r.jsx)(ea.eb,{value:"in",children:"in"})]})]})})]}),(0,r.jsx)("div",{style:{paddingBottom:"15px"},children:(0,r.jsx)(Q.$,{className:"pn:w-full",variant:"default",onClick:()=>{b((0,ei.S7)({unitVal:p,dpi:e.dpi,unit:e.unit}),(0,ei.S7)({unitVal:m,dpi:e.dpi,unit:e.unit}),l)},children:(0,s.t)("sidePanel.resize")})}),(0,r.jsxs)(Q.$,{variant:"ghost",className:"pn:mb-1.5 pn:w-full pn:justify-start pn:gap-1 pn:px-2 pn:text-[13px] pn:font-normal pn:text-muted-foreground",onClick:()=>u(!c),children:[(0,r.jsx)(U.dc,{name:c?"ui.chevronDown":"ui.chevronRight",className:"pn:size-3"}),(0,s.t)("sidePanel.advanced")]}),c&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{style:{paddingBottom:"15px"},children:[(0,r.jsxs)("div",{className:"pn:inline-block pn:w-1/2",children:[(0,s.t)("sidePanel.bleed")," (",e.unit,")"]}),(0,r.jsx)("div",{className:"pn:inline-block pn:w-1/2",children:(0,r.jsx)(ed,{"aria-label":"bleed",value:w,onChange:t=>{if(!Number.isFinite(t))return;let n=(0,ei.S7)({unitVal:t,dpi:e.dpi,unit:e.unit});
28e.pages.forEach(e=>{e.set({bleed:n,bleedTop:void 0,bleedRight:void 0,bleedBottom:void 0,bleedLeft:void 0})}),n>0&&e.toggleBleed(!0)},min:0,max:1e3,step:"px"===e.unit?1:.1})})]}),(0,r.jsxs)("label",{className:"pn:flex pn:items-center pn:justify-between",style:{paddingBottom:"15px"},children:[(0,r.jsx)("span",{children:(0,s.t)("sidePanel.showBleed")}),(0,r.jsx)(y.d,{"aria-label":"show bleed",checked:e.bleedVisible,onCheckedChange:t=>{e.toggleBleed(!!t)}})]})]}),es.map(({name:t,icon:n,sizes:a})=>(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-1.5 pn:pt-3 pn:pb-1 pn:text-[13px] pn:font-semibold",children:[n,t]}),(0,r.jsx)("div",{className:"pn:mb-1.5 pn:flex pn:flex-col",children:a.map(([t,n,i,a])=>(0,r.jsxs)(Q.$,{variant:"ghost",className:"pn:h-9 pn:w-full pn:justify-start pn:gap-2.5 pn:px-2 pn:text-[13px] pn:font-normal",onClick:()=>{let t=(0,ei.S7)({unitVal:n,dpi:e.dpi,unit:a}),r=(0,ei.S7)({unitVal:i,dpi:e.dpi,unit:a});e.setUnit({unit:a,dpi:e.dpi}),b(t,r,l)},children:[(0,r.jsx)(ec,{width:n,height:i}),(0,r.jsx)("span",{className:"pn:truncate",children:t}),(0,r.jsxs)("span",{className:"pn:ml-auto pn:shrink-0 pn:text-xs pn:text-muted-foreground",children:[n,"\xd7",i," ",a]})]},t))})]},t))]})});var ep=n(41251),eh=n(98627),em=n(6993),ef=n(99793),eg=n(80873),ex=n(84535),ev=n(78337);let eb=i.createContext(void 0),ey=i.createContext(void 0),ew=i.forwardRef(function(e,t){let{defaultValue:n,disabled:a=!1,loopFocus:o=!0,onValueChange:l,orientation:s="horizontal",multiple:d=!1,value:c,className:u,render:p,style:h,...m}=e,f=(0,ev.S)(!0),g=i.useContext(eb),x=void 0!==c||void 0!==n,v=(f?.disabled??!1)||(g?.disabled??!1)||a,[b,y]=(0,em.q)({controlled:c,default:void 0===c?n??ef.Ml:void 0,name:"ToggleGroup",state:"value"}),w=(0,eh.K)((e,t,n)=>{let r;d?(r=b.slice(),t?r.push(e):r.splice(b.indexOf(e),1)):r=t?[e]:[],l?.(r,n),n.isCanceled||y(r)}),j={disabled:v,multiple:d,orientation:s},k=i.useMemo(()=>({disabled:v,setGroupValue:w,value:b,isValueInitialized:x}),[v,w,b,x]),C={role:"group"},E=(0,eg.o)("div",e,{enabled:!!f,state:j,ref:t,props:[C,m]});return(0,r.jsx)(ey.Provider,{value:k,children:f?E:(0,r.jsx)(ex.Y,{render:p,className:u,style:h,state:j,refs:[t],props:[C,m],loopFocus:o,enableHomeAndEndKeys:!0,orientation:s})})});var ej=n(99892),ek=n(79574),eC=n(11323),eE=n(35836),eS=n(39174);let eP=i.forwardRef(function(e,t){let{className:n,defaultPressed:a=!1,disabled:o=!1,form:l,onPressedChange:s,pressed:d,render:c,type:u,value:p,nativeButton:h=!0,style:m,...f}=e,g=(0,ej.e)(p||void 0),x=i.useContext(ey),v=x?.value??[],b=x?void 0:a,y=(o||x?.disabled)??!1,[w,j]=(0,em.q)({controlled:x?void 0!==g&&v.
28indexOf(g)>-1:d,default:b,name:"Toggle",state:"pressed"}),{getButtonProps:k,buttonRef:C}=(0,ek.s)({disabled:y,native:h}),E={disabled:y,pressed:w},S=[C,t],P=[{"aria-pressed":w,onClick(e){let t=!w,n=(0,eE.d)(eS.dv,e.nativeEvent);s?.(t,n),!n.isCanceled&&(g&&x?.setGroupValue?.(g,t,n),n.isCanceled||j(t))}},f,k],N=(0,eg.o)("button",e,{enabled:!x,state:E,ref:S,props:P}),A=i.useMemo(()=>({disabled:y,focusableWhenDisabled:!1}),[y]);return x?(0,r.jsx)(eC.l,{tag:"button",render:c,className:n,style:m,metadata:A,state:E,refs:S,props:P}):N});var eN=n(83101),eA=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let eM=(0,eN.F)("pn:inline-flex pn:items-center pn:justify-center pn:gap-2 pn:rounded-md pn:text-sm pn:font-medium pn:whitespace-nowrap pn:transition-[color,box-shadow] pn:outline-none pn:hover:bg-muted pn:hover:text-muted-foreground pn:focus-visible:border-ring pn:focus-visible:ring-[3px] pn:focus-visible:ring-ring/50 pn:disabled:pointer-events-none pn:disabled:opacity-50 pn:aria-invalid:border-destructive pn:aria-invalid:ring-destructive/20 pn:data-pressed:bg-accent pn:data-pressed:text-accent-foreground pn:dark:aria-invalid:ring-destructive/40 pn:[&_svg]:pointer-events-none pn:[&_svg]:shrink-0 pn:[&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"pn:bg-transparent",outline:"pn:border pn:border-input pn:bg-transparent pn:shadow-xs pn:hover:bg-accent pn:hover:text-accent-foreground"},size:{default:"pn:h-9 pn:min-w-9 pn:px-2"}},defaultVariants:{variant:"default",size:"default"}});i.forwardRef((e,t)=>{var{className:n,variant:i,size:a}=e,o=eA(e,["className","variant","size"]);return(0,r.jsx)(eP,Object.assign({ref:t,"data-slot":"toggle",className:(0,d.cn)(eM({variant:i,size:a,className:n}))},o))}).displayName="Toggle";var eO=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let eT=i.createContext({size:"default",variant:"default"}),eR=i.forwardRef((e,t)=>{var{className:n,variant:i,size:a,children:o}=e,l=eO(e,["className","variant","size","children"]);return(0,r.jsx)(ew,Object.assign({ref:t,"data-slot":"toggle-group","data-variant":i,"data-size":a,className:(0,d.cn)("pn:group/toggle-group pn:flex pn:w-fit pn:items-center pn:rounded-md",n)},l,{children:(0,r.jsx)(eT.Provider,{value:{variant:i,size:a},children:o})}))});eR.displayName="ToggleGroup";let e_=i.forwardRef((e,t)=>{var{className:n,children:a,variant:o,size:l}=e,s=eO(e,["className","children","variant","size"]);let c=i.useContext(eT);return(0,r.jsx)(eP,Object.assign({ref:t,"data-slot":"toggle-group-item","data-variant":c.variant||o,"data-size":c.size||l,className:(0,d.cn)(eM({variant:c.variant||o,size:c.size||l}),"pn:w-auto pn:min-w-0 pn:shrink-0 pn:px-3 pn:focus:z-10 pn:focus-visible:z-10","pn:rounded-none pn:shadow-none pn:first:rounded-l-md pn:last:rounded-r-md pn:data-[variant=outline]:border-l-0 pn:data-[variant=outline]:first:border-l",n)},s,{children:a}))});e_.displayName="ToggleGroupItem";var ez=n(9469),eI=n(48394);let eD=(e,t,n)=>Math.max(t,Math.min(n,e)),eF=(e,t)=>Array.from(e.keys()).find(e=>A.b(e,t)),eL=(0,a.PA)(({store:e})=>{let{brushType:t,strokeWidth:n,stroke:a,opacity:o}=e.toolOptions,l="selection"===e.tool,s=e.selectedElements,d=1===s.length&&"svg"===s[0].type,c=d?s[0]:null,u=(0,ep.O)((null==c?void 0:c.src)||""),p=u.length>0?u[0]:null;return i.useEffect(()=>()=>{e.setTool("selection")},[]),(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col pn:overflow-auto pn:pr-1",children:[(0,r.jsxs)("div",{style:{marginBottom:"30px"},children:[(0,r.jsx)("h3",{className:"pn:mb-[15px] pn:text-sm pn:font-semibold pn:uppercase pn:text-muted-foreground",children:"Tool"}),(0,r.jsx)("div",{style:{padding:"0 5px"},children:(0,r.jsxs)(eR,{variant:"outline",value:[l?"selection":t],onValueChange:t=>{let r=t[0];r&&("selection"===r?e.setTool("selection"):(e.selectElements([]),e.setTool("draw"),e.setToolOptions({brushType:r,opacity:"highlighter"===r?.5:1,strokeWidth:"highlighter"===r?30:n||5})))},className:"pn:w-full",children:[(0,r.jsxs)(e_,{value:"selection",className:"pn:flex-1",children:[(0,r.jsx)(U.dc,{name:"draw.select"}),"Selection"]}),(0,r.jsxs)(e_,{value:"brush",className:"pn:flex-1",children:[(0,r.jsx)(U.dc,{name:"draw.brush"}),"Brush"]}),(0,r.jsxs)(e_,{value:"highlighter",className:"pn:flex-1",children:[(0,r.jsx)(U.dc,{name:"draw.highlighter"}),"Highlighter"]})]})})]}
28),!d&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{marginBottom:"30px",opacity:l?.5:1},children:(0,r.jsx)(ez.K,{label:"Stroke Width",value:n,onChange:t=>{var n;return n=eD(t,1,50),void e.setToolOptions({strokeWidth:n})},min:1,max:50,disabled:l})}),(0,r.jsx)("div",{style:{marginBottom:"30px",opacity:l?.5:1,pointerEvents:l?"none":"auto"},children:(0,r.jsx)(eI.R,{label:"Color",className:"pn:py-[5px]",children:(0,r.jsx)(X.Ay,{value:a,size:30,onChange:t=>{e.setToolOptions({stroke:t})},store:e})})}),(0,r.jsx)("div",{style:{marginBottom:"30px",opacity:l?.5:1},children:(0,r.jsx)(ez.K,{label:"Opacity",value:Math.round(100*o),onChange:t=>{var n;return n=eD(t,0,100)/100,void e.setToolOptions({opacity:n})},min:0,max:100,disabled:l})})]}),d&&p&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{marginBottom:"30px"},children:(0,r.jsx)(eI.R,{label:"Color",className:"pn:py-[5px]",children:(0,r.jsx)(X.Ay,{value:((e,t)=>{let n=eF(e,t);return e.get(n||"")||t})(c.colorsReplace,p),size:30,onChange:e=>{if(c&&p){let t=eF(c.colorsReplace,p)||p;c.replaceColor(t,e)}},store:e,gradientEnabled:!0})})}),(0,r.jsx)("div",{style:{marginBottom:"30px"},children:(0,r.jsx)(ez.K,{label:"Opacity",value:Math.round(100*c.opacity),onChange:e=>{var t;return t=eD(e,0,100)/100,void(c&&c.set({opacity:t}))},min:0,max:100})})]})]})});var eB=n(89897),e$=n(29592),eW=n(59963),eV=n(6369);let eH=({items:e,onSelect:t,loadMore:n,isLoading:a,error:o,getCredit:l})=>{let s=(0,i.useRef)(null),d=(0,i.useCallback)(e=>{a||(s.current&&s.current.disconnect(),s.current=new IntersectionObserver(e=>{e[0].isIntersecting&&n()}),e&&s.current.observe(e))},[a]);if(o)return(0,r.jsx)("div",{children:o.message});if(!e||0===e.length)return null;let c=e.filter((e,t)=>t%2==1),u=e.filter((e,t)=>t%2==0);return(0,r.jsxs)("div",{className:"pn:h-full pn:overflow-auto",children:[[c,u].map((e,n)=>(0,r.jsx)("div",{className:"pn:float-left pn:w-1/2",children:e.map(e=>(0,r.jsx)(eq,{item:e,onClick:()=>t(e),onDragStart:()=>{(0,eW.oc)((n,r)=>{t(e,n,r)})},onDragEnd:()=>(0,eW.oc)(null),getCredit:l},e.id))},n)),(0,r.jsx)("div",{ref:d,className:"pn:clear-both pn:flex pn:justify-center pn:p-12",children:a&&(0,r.jsx)(eV.y,{className:"pn:size-5 pn:text-muted-foreground"})})]})},eq=({item:e,onClick:t,onDragEnd:n,onDragStart:a,getCredit:o})=>{var l;let s,d=(0,i.useRef)(null),c=(null==(l=e.video_files.find(e=>"sd"===e.quality))?void 0:l.link)||"";if(!c)return null;let u=new Date(1e3*e.duration).toISOString();return s=e.duration>3600?u.substring(11,19):u.substring(14,19),(0,r.jsx)("div",{className:"pn:group/video pn:w-full pn:p-[5px] pn:hover:[&_.video-grid__item-credit]:opacity-100",children:(0,r.jsxs)("div",{className:"pn:relative",draggable:!0,onClick:t,onDragEnd:n,onDragStart:a,onMouseEnter:()=>{var e,t;null==(t=null==(e=d.current)?void 0:e.play())||t.catch(()=>{})},onMouseLeave:()=>{var e;null==(e=d.current)||e.pause(),d.current&&(d.current.currentTime=0)},children:[(0,r.jsx)("video",{poster:e.video_pictures[0].picture,controls:!1,ref:d,muted:!0,preload:"none",playsInline:!0,className:"pn:block pn:max-h-[300px] pn:min-h-[50px] pn:w-full pn:cursor-pointer pn:rounded-[5px] pn:object-cover pn:shadow-[0_0_5px_rgba(16,22,26,0.3)]",children:(0,r.jsx)("source",{src:c})}),(0,r.jsx)("div",{className:"pn:absolute pn:right-2 pn:top-2 pn:flex pn:items-center pn:justify-center pn:rounded-full pn:bg-black/50 pn:px-[7px] pn:py-[2px] pn:text-center pn:text-white",children:(0,r.jsx)("span",{className:"pn:text-xs",children:s})}),o&&(0,r.jsx)("div",{className:"video-grid__item-credit pn:absolute pn:inset-x-0 pn:bottom-0 pn:bg-gradient-to-b pn:from-transparent pn:via-black/40 pn:to-black/60 pn:p-[3px] pn:text-center pn:text-[10px] pn:text-white pn:opacity-0 pn:[&_a]:text-white pn:[&_a]:underline",children:o(e)})]})})},eK=(0,a.PA)(({store:e})=>{var t;let{setQuery:n,loadMore:i,isReachingEnd:a,data:o,isLoading:l,error:d}=(0,g.W)({defaultQuery:"",getAPI:({page:e,query:t})=>(({query:e,page:t})=>`https://api.polotno.com/api/pexels/videos/${e?"search":"popular"}?query=${e}&per_page=20&page=${t}&KEY=${(0,e$.i7)()}`)({page:e,query:t}),getSize:e=>e.total_results/e.per_page});return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsx)(b,{style:{marginBottom:"20px"},placeholder:(0,s.t)("sidePanel.searchPlaceholder"),onChange:e=>{n(e.target.value)}}),(0,r.jsxs)("p",{className:"pn:text-center pn:text-sm pn:text-muted-foreground",children:["Videos by"," ",(0,r.jsx)("a",{href:"https://www.pexels.com/",target:"_blank",className:"pn:font-medium pn:text-foreground pn:underline pn:underline-offset-2",children:"Pexels"})]}),(0,r.jsx)(eH,{items:null!=(t=null==o?void 0:o.map(e=>
28e.videos).flat().filter(Boolean))?t:[],onSelect:async(t,n,r)=>{var i;let a=(null==(i=t.video_files.find(e=>"hd"===e.quality))?void 0:i.link)||t.video_files[0].link;(0,eB.w)({src:a,store:e,droppedPos:n,targetElement:r,attrs:{width:t.width,height:t.height}})},isLoading:l,error:d,loadMore:!a&&i,getCredit:e=>(0,r.jsxs)("span",{children:["Video by"," ",(0,r.jsx)("a",{href:e.user.url,target:"_blank",rel:"noreferrer",children:e.user.name})," ","on"," ",(0,r.jsx)("a",{href:"https://pexels.com/?utm_source=polotno&utm_medium=referral",target:"_blank",rel:"noreferrer noopener",children:"Pexels"})]})})]})});var eU=n(16183);function eX({title:e,onClose:t}){return(0,r.jsxs)("div",{className:"pn:flex pn:justify-between",children:[(0,r.jsx)("h3",{className:"pn:m-0 pn:leading-[30px]",children:e}),(0,r.jsx)(Q.$,{variant:"ghost",size:"icon-sm",onClick:t,children:(0,r.jsx)(eU.A,{})})]})}var eY=n(27024);let eZ=Object.keys(M.QE),eG=[{width:300,height:300,fill:"lightgray",stroke:"#0c0c0c",strokeWidth:0,url:""}],eQ=[];eZ.forEach(e=>{eG.forEach(t=>{eQ.push(Object.assign({subType:e},t))})}),eQ.forEach(e=>{e.url=(0,eY.Zq)((0,M.Qu)(e))});let eJ=(0,a.PA)(({store:e})=>{let t=Math.ceil(eQ.length/4)||1,n=e.selectedElements.map(e=>e.id).join(","),a="image-clip"===e.openedSidePanel;return i.useEffect(()=>{a&&(n||e.restoreSidePanel())},[a,n]),(0,r.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto"},children:[(0,r.jsx)(eX,{title:(0,s.t)("sidePanel.clipImage"),onClose:()=>e.restoreSidePanel()}),(0,r.jsx)("div",{style:{height:110*t+"px"},children:(0,r.jsx)(m.b,{shadowEnabled:!1,rowsNumber:4,images:eQ,getPreview:e=>e.url,isLoading:!1,itemHeight:100,onSelect:async(t,n,r)=>{(r?[r]:e.selectedElements).forEach(e=>{("image"===e.type||"video"===e.type)&&e.contentEditable&&e.set({clipSrc:t.url})})}})})]})});var e0=n(85341);let e1=(0,a.PA)(({element:e,store:t,enabled:n})=>{let i=e.animations.find(e=>"enter"===e.type),a=e.animations.find(e=>"exit"===e.type);return n?(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{style:{padding:"10px 0px"},children:"Animate"}),(0,r.jsxs)("div",{style:{display:"flex",gap:10},children:[(0,r.jsx)(Q.$,{variant:"outline",className:(0,d.cn)("pn:flex-1",(null==i?void 0:i.enabled)&&!(null==a?void 0:a.enabled)&&"pn:bg-muted"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!1})})},children:"Enter"}),(0,r.jsx)(Q.$,{variant:"outline",className:(0,d.cn)("pn:flex-1",(null==i?void 0:i.enabled)&&(null==a?void 0:a.enabled)&&"pn:bg-muted"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!0}),e.setAnimation("exit",{enabled:!0})})},children:"Both"}),(0,r.jsx)(Q.$,{variant:"outline",className:(0,d.cn)("pn:flex-1",(null==a?void 0:a.enabled)&&!(null==i?void 0:i.enabled)&&"pn:bg-muted"),onClick:()=>{t.history.transaction(()=>{e.setAnimation("enter",{enabled:!1}),e.setAnimation("exit",{enabled:!0})})},children:"Exit"})]})]}):null}),e2=["right","left","up","down","bottom-right","bottom-left","top-right","top-left"],e5={right:(0,r.jsx)(U.dc,{name:"animation.directionRight"}),left:(0,r.jsx)(U.dc,{name:"animation.directionLeft"}),up:(0,r.jsx)(U.dc,{name:"animation.directionUp"}),down:(0,r.jsx)(U.dc,{name:"animation.directionDown"}),"bottom-right":(0,r.jsx)(U.dc,{name:"animation.directionBottomRight"}),"bottom-left":(0,r.jsx)(U.dc,{name:"animation.directionBottomLeft"}),"top-right":(0,r.jsx)(U.dc,{name:"animation.directionTopRight"}),"top-left":(0,r.jsx)(U.dc,{name:"animation.directionTopLeft"})},e3=(0,a.PA)(({value:e,onChange:t})=>(0,r.jsxs)("div",{style:{paddingTop:"10px"},children:[(0,r.jsx)("div",{style:{paddingBottom:"10px"},children:"Direction"}),(0,r.jsxs)(ea.l6,{value:e,onValueChange:e=>{null!==e&&t(e)},children:[(0,r.jsx)(ea.bq,{className:"pn:w-full",children:(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-2",children:[e5[e],(0,r.jsx)(ea.yv,{})]})}),(0,r.jsx)(ea.gC,{children:e2.map(e=>(0,r.jsx)(ea.eb,{value:e,children:(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:gap-2",children:[e5[e],e]})},e))})]})]}
28)),e4=(0,a.PA)(({value:e,onChange:t})=>(0,r.jsxs)("div",{style:{paddingTop:"10px"},children:[(0,r.jsx)("div",{style:{paddingBottom:"10px"},children:"Direction"}),(0,r.jsxs)(ea.l6,{value:e,onValueChange:e=>{null!==e&&t(e)},children:[(0,r.jsx)(ea.bq,{className:"pn:w-full",children:(0,r.jsx)(ea.yv,{children:"out"===e?"Zoom Out":"Zoom In"})}),(0,r.jsxs)(ea.gC,{children:[(0,r.jsx)(ea.eb,{value:"in",children:"Zoom In"}),(0,r.jsx)(ea.eb,{value:"out",children:"Zoom Out"})]})]})]})),e7=(0,a.PA)(({element:e})=>{let t=e.animations.find(e=>"enter"===e.type);if(!t)return null;let n=e.page.duration;return(0,r.jsx)("div",{style:{padding:"10px"},children:(0,r.jsx)(ez.K,{label:"Delay",value:parseFloat((t.delay/1e3).toFixed(2)),onChange:t=>{e.setAnimation("enter",{delay:1e3*t})},min:0,max:n/1e3,step:.01})})}),e8=(0,a.PA)(({element:e,store:t})=>{let n=e.animations.find(e=>"loop"===e.type&&e.enabled);if(!n)return null;let i=500/n.duration;return(0,r.jsx)("div",{style:{padding:"10px"},children:(0,r.jsx)(ez.K,{label:"Speed",value:i,onChange:t=>{e.setAnimation("loop",{duration:500/t})},min:.1,max:3,step:.01,onCommit:()=>{let n=t.activePage;t.play({animatedElementsIds:[e.id],currentTime:e.page.startTime}),setTimeout(()=>{t.stop(),n&&t.selectPage(n.id)},1e3)}})})}),e6=(0,a.PA)(({element:e})=>{let t=e.animations.find(e=>"enter"===e.type);if(!t)return null;let n=e.page.duration;return(0,r.jsx)("div",{style:{padding:"10px"},children:(0,r.jsx)(ez.K,{label:"Duration",value:parseFloat((t.duration/1e3).toFixed(2)),onChange:t=>{e.setAnimation("enter",{duration:1e3*t}),e.setAnimation("exit",{duration:1e3*t})},min:0,max:n/1e3,step:.01})})}),e9=(0,a.PA)(({element:e,store:t,animationName:n})=>{var i,a;let o=e.animations.find(e=>e.name===n&&e.enabled);if(!o)return null;let l=null!=(a=null==(i=o.data)?void 0:i.strength)?a:1,d=Math.max(3,l);return(0,r.jsx)("div",{style:{padding:"10px"},children:(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.strength"),value:parseFloat(l.toFixed(2)),onChange:r=>(r=>{t.history.transaction(()=>{e.animations.forEach(t=>{if(t.name===n){let n=t.data||{};e.setAnimation(t.type,{data:Object.assign(Object.assign({},n),{strength:r})})}})});let i=t.activePage;(()=>{let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{(()=>{t.isPlaying||(t.play({animatedElementsIds:[e.id],currentTime:e.page.startTime}),setTimeout(()=>{t.stop(),i&&t.selectPage(i.id)},1e3))})(...r)},300)}})()()})(r),min:.1,sliderMax:d,step:.05})})}),te=(0,a.PA)(({element:e})=>{let t=e.animations.find(e=>"exit"===e.type);if(!t)return null;let n=e.page.duration;return(0,r.jsx)("div",{style:{padding:"10px"},children:(0,r.jsx)(ez.K,{label:"End Delay",value:parseFloat((t.delay/1e3).toFixed(2)),onChange:t=>{e.setAnimation("exit",{delay:1e3*t})},min:0,max:n/1e3,step:.01})})}),tt=[{key:"move",icon:"animation.typeMove",label:"toolbar.move"},{key:"fade",icon:"animation.typeFade",label:"toolbar.fade"},{key:"zoom",icon:"animation.typeZoom",label:"toolbar.zoom"}],tn=[{key:"rotate",icon:"animation.typeRotate",label:"toolbar.rotate"},{key:"blink",icon:"animation.typeBlink",label:"toolbar.blink"},{key:"bounce",icon:"animation.typeBounce",label:"toolbar.bounce"}],tr=(0,a.PA)(({store:e})=>{var t,n,a,o;let l=e.selectedElements,c=l[0],u=l.map(e=>e.id).join(","),p="animation"===e.openedSidePanel;if(i.useEffect(()=>{p&&(c&&c.animations||e.restoreSidePanel())},[p,u]),!c||!c.animations)return null;let h=(t,n)=>{if(e.history.transaction(()=>{l.forEach(e=>{e.setAnimation("enter",Object.assign({name:t},n)),e.setAnimation("exit",Object.assign(Object.assign({name:t},n),{from:n.to,to:n.from}))})}),n.enabled){let t=e.activePage;e.play({animatedElementsIds:l.map(e=>e.id),currentTime:c.page.startTime}),setTimeout(()=>{e.stop(),t&&e.selectPage(t.id)},1e3)}},m=e=>{var t;return!!((e?null==(t=c.animations)?void 0:t.filter(t=>t.name===e||t.type===e):c.animations)||[]).find(e=>e.enabled)},f=m("move")||m("fade")||m("zoom"),g=m("rotate")||m("blink")||m("bounce");return(0,r.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"},children:[(0,r.jsx)("div",{style:{paddingBottom:"10px"},children:(0,r.jsx)(eX,{title:(0,s.t)("sidePanel.animate"),onClose:()=>e.restoreSidePanel()})}),(0,r.jsxs)("div",{style:{paddingTop:"10px",lineHeight:"35px"},children:["Animations"," ",(0,r.jsx)(Q.$,{variant:"outline",style:{marginLeft:"10px",display:f?"inline-flex":"none"},onClick:()=>{c.set({animations:[]})},children:"Remove All"})]}),(0,r.jsxs)("div",{style:{paddingTop:"25px"},children:[(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"5px",paddingBottom:"10px"},children:tt.map(({key:e,icon:t,label:n})=>(0,r.jsx)("div",{children:(0,r.jsxs)(Q.$,{variant:"outline",size:"lg",className:(0,d.cn)("pn:flex pn:h-auto pn:w-full pn:flex-col pn:items-center pn:gap-2 pn:p-5",m(e)&&"pn:bg-muted"),onClick:()=>{h(e,{enabled:!m(e)})},children:[(0,r.jsx)(U.dc,{name:t}),(0,s.t)(n)]})},e))}),(0,r.jsxs)("div",{className:"pn:bg-black/5 pn:dark:bg-white/5",style:{display:f?"block":"none",padding:"10px"},children:[(0,r.jsx)(e1,{element:c,store:e,enabled:m("enter")||m("exit")}),m("move")&&(0,r.jsx)(e3,{value:(null==(n=null==(t=c.animations.find(e=>"move"===e.name))?void 0:t.data)?void 0:n.direction)||"right",onCh
28ange:e=>{h("move",{data:{direction:e},enabled:!0})}}),m("move")&&(0,r.jsx)(e9,{store:e,element:c,animationName:"move"}),m("zoom")&&(0,r.jsx)(e4,{value:(null==(o=null==(a=c.animations.find(e=>"zoom"===e.name))?void 0:a.data)?void 0:o.direction)||"in",onChange:e=>{h("zoom",{data:{direction:e},enabled:!0})}}),m("zoom")&&(0,r.jsx)(e9,{store:e,element:c,animationName:"zoom"}),m("enter")&&(0,r.jsx)(e7,{store:e,element:c}),m("enter")&&(0,r.jsx)(e6,{store:e,element:c}),m("exit")&&(0,r.jsx)(te,{store:e,element:c})]}),(0,r.jsxs)("div",{style:{paddingTop:"10px",lineHeight:"35px"},children:["Effects"," ",(0,r.jsx)(Q.$,{variant:"outline",style:{marginLeft:"10px",display:g?"inline-flex":"none"},onClick:()=>{c.set({animations:[]})},children:"Remove All"})]}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(100px, 1fr))",gap:"5px",paddingTop:"10px"},children:tn.map(({key:t,icon:n,label:i})=>(0,r.jsx)("div",{children:(0,r.jsxs)(Q.$,{variant:"outline",size:"lg",className:(0,d.cn)("pn:flex pn:h-auto pn:w-full pn:flex-col pn:items-center pn:gap-2 pn:p-5",m(t)&&"pn:bg-muted"),onClick:()=>{((t,n)=>{if(e.history.transaction(()=>{l.forEach(e=>{e.setAnimation("loop",Object.assign({name:t},n))})}),n.enabled){let t=e.activePage;e.play({animatedElementsIds:l.map(e=>e.id),currentTime:c.page.startTime}),setTimeout(()=>{e.stop(),t&&e.selectPage(t.id)},1e3)}})(t,{enabled:!m(t)})},children:[(0,r.jsx)(U.dc,{name:n}),(0,s.t)(i)]})},t))}),g&&(0,r.jsx)(e8,{store:e,element:c}),m("bounce")&&(0,r.jsx)(e9,{store:e,element:c,animationName:"bounce"})]})]})});var ti=n(68047);function ta({label:e,enabled:t,onEnabledChange:n,visible:i=!0,disabled:a,className:o,children:l}){if(!i)return null;let s=!n||!!t;return(0,r.jsxs)("div",{className:(0,d.cn)("pn:py-1",o),children:[(0,r.jsxs)("div",{className:"pn:flex pn:items-center pn:justify-between pn:gap-2 pn:py-1",children:[(0,r.jsx)("label",{className:"pn:text-sm pn:font-medium",children:e}),n&&(0,r.jsx)(y.d,{checked:!!t,onCheckedChange:n,disabled:a})]}),s&&(0,r.jsx)("div",{className:"pn:mt-1.5 pn:rounded-lg pn:bg-muted/60 pn:px-3 pn:py-1",children:l})]})}var to=n(53389),tl=n(62513),ts=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let td=({title:e,imageSrc:t,effect:n,onClick:i,active:a})=>{let o=tg(n);return(0,r.jsxs)("div",{className:"pn:flex pn:flex-col pn:gap-2 pn:cursor-pointer pn:flex-grow-0 pn:w-[calc(33%-16px)]",onClick:i,children:[(0,r.jsxs)("div",{className:"pn:relative pn:h-[90px] pn:rounded-[10px] pn:box-border",children:[(0,r.jsx)("div",{"data-active":a?"true":void 0,className:(0,d.cn)("pn:absolute pn:-left-1 pn:-top-1 pn:-bottom-1 pn:-right-1 pn:flex pn:rounded-[15px] pn:p-[2px] pn:transition-[border] pn:duration-200 pn:border-2 pn:border-transparent",a&&"pn:border-white")}),(0,r.jsx)(o,{src:t})]}),(0,r.jsx)("span",{className:"pn:text-center",children:e})]})},tc=e=>{var{className:t,style:n}=e,i=ts(e,["className","style"]);return(0,r.jsx)("img",Object.assign({className:(0,d.cn)("pn:h-full pn:w-full pn:rounded-[10px] pn:object-cover",t),style:n},i))},tu=e=>(0,r.jsx)(tc,Object.assign({style:{filter:"sepia(1)"}},e)),tp=e=>(0,r.jsx)(tc,Object.assign({style:{filter:"grayscale(1)"}},e)),th=e=>{let t=(0,tl.cR)(tl.dc.warm);return(0,r.jsx)(tc,Object.assign({style:{filter:null==t?void 0:t.filter}},e))},tm=e=>{let t=(0,tl.cR)(tl.dc.cold),n=null==t?void 0:t.html,i=null==t?void 0:t.filter;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{style:{display:"none"},dangerouslySetInnerHTML:{__html:n||""}}),(0,r.jsx)(tc,Object.assign({style:{filter:i}},e))]})},tf=e=>{let t=(0,tl.cR)(tl.dc.natural);return(0,r.jsx)(tc,Object.assign({style:{filter:null==t?void 0:t.filter}},e))},tg=e=>{switch(e){case tl.dc.sepia:return tu;case tl.dc.grayscale:return tp;case tl.dc.warm:return th;case tl.dc.cold:return tm;case tl.dc.natural:return tf;default:return tc}};var tx=n(97458),tv=n(68129);let tb=[{value:"round",labelKey:"toolbar.joinRound"},{value:"miter",labelKey:"toolbar.joinMiter"},{value:"bevel",labelKey:"toolbar.joinBevel"}],ty=({join:e})=>(0,r.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:(0,r.jsx)("path",{d:"M7 21 L7 7 L21 7",stroke:"currentColor",strokeWidth:"9",strokeLinejoin:e,strokeLinecap:"butt"})}),tw=(e,t,n)=>Math.max(t,Math.min(n,e)),tj=(e,t)=>Math.max(e,Math.ceil(t)),tk=(e,t)=>Math.min(e,Math.floor(t)),tC=[["temperature","toolbar.temperature"],["contrast","toolbar.contrast"],["shadows","toolbar.shadows"],["white","toolbar.white"],["black","toolbar.black"],["vibrance","toolbar.vibrance"],["saturation","toolbar.saturation"]],tE=({store:e,color:t,onColorChange:n,value:i,onValueChange:a,min:o,max:l,sliderMax:s})=>(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",padding:"8px 0"},children:[(0,r.jsx)(X.sk,{value:t,size:30,gradientEnabled:!0,onChange:n,store:e}),(0,r.jsx)("div",{style:{flex:1,paddingLeft:"10px",paddingRight:"10px"},children:(0,r.jsx)(ti.A,{value:[i],onValueChange:e=>a(tw(Math.round((0,d.V)(e)),o,l)),min:o,max:null!=s?s:l,step:1})}),(0,r.jsx)(e0.O,{value:Math.round(i),onValueChange:e=>a(tw(e,o,l)),min:o,max:l,style:{width:64}})]}),tS=(0,a.PA)(({store:e})=>{var t;let n=e.selectedElements,a=n[0],o=n.map(e=>e.id).join(","),l="effects"===e.openedSidePanel;if(i.useEffect(()=>{l&&(a&&a.filters||e.restoreSidePanel())},[l,o]),!a||!a.filters)return null;let d="text"===a.type,c="image"===a.type,u="svg"===a.type,p=c||u,h=Math.min(a.width,a.height)/2,m=Math.min(null!=(t=a.cornerRadius)?t:0,h),f=t=>{e.history.transaction(()=>
28{n.forEach(e=>{e.set(t)})})},g=(t,r)=>{e.history.transaction(()=>{n.forEach(e=>{let n=Number(r);return 0==r||r||(n=e.filters.has(t)?null:1),to.tW.includes(t)||e.set({grayscaleEnabled:"grayscale"===t&&!!r,sepiaEnabled:"sepia"===t&&!!r}),e.setFilter(t,n)})})};return(0,r.jsxs)("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"auto",padding:"0 10px"},children:[(0,r.jsx)(eX,{title:(0,s.t)("sidePanel.effects"),onClose:()=>e.restoreSidePanel()}),p&&(0,r.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"16px",marginTop:"16px"},children:(0,r.jsxs)("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[(0,r.jsx)(td,{active:a.grayscaleEnabled,onClick:()=>{g("grayscale",!a.grayscaleEnabled)},title:(0,s.t)("toolbar.grayscale"),imageSrc:a.src,effect:tl.dc.grayscale}),(0,r.jsx)(td,{active:a.sepiaEnabled,onClick:()=>{g("sepia",!a.sepiaEnabled)},title:(0,s.t)("toolbar.sepia"),imageSrc:a.src,effect:tl.dc.sepia}),(0,r.jsx)(td,{active:a.filters.has("cold"),onClick:()=>{g("cold",a.filters.has("cold")?null:1)},title:(0,s.t)("toolbar.cold"),imageSrc:a.src,effect:tl.dc.cold}),(0,r.jsx)(td,{active:a.filters.has("natural"),onClick:()=>{g("natural",a.filters.has("natural")?null:1)},title:(0,s.t)("toolbar.natural"),imageSrc:a.src,effect:tl.dc.natural}),(0,r.jsx)(td,{active:a.filters.has("warm"),onClick:()=>{g("warm",a.filters.has("warm")?null:1)},title:(0,s.t)("toolbar.warm"),imageSrc:a.src,effect:tl.dc.warm})]})}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.blur"),enabled:a.blurEnabled,visible:p||d,onEnabledChange:e=>{f({blurEnabled:e})},value:a.blurRadius,onChange:e=>{f({blurRadius:e})},min:0,max:100}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.brightness"),visible:p,enabled:a.brightnessEnabled,onEnabledChange:e=>{f({brightnessEnabled:e})},value:Math.round(100*a.brightness),onChange:e=>{f({brightness:e/100})},min:-100,max:100}),tC.map(([e,t])=>{var n,i;return(0,r.jsx)(ez.K,{label:(0,s.t)(t),visible:p,enabled:a.filters.has(e),onEnabledChange:t=>{g(e,t?0:null)},value:Math.round(100*(null!=(i=null==(n=a.filters.get(e))?void 0:n.intensity)?i:0)),onChange:t=>{g(e,t/100)},min:-100,max:100},e)}),d&&(0,r.jsxs)(ta,{label:(0,s.t)("toolbar.curvedText")||"Curved text",enabled:!!a.curveEnabled,onEnabledChange:e=>f({curveEnabled:e}),children:[(0,r.jsx)(eI.R,{label:(0,s.t)("toolbar.curvePower")||"Curve",className:"pn:py-2",children:(0,r.jsx)(e0.O,{value:Math.round(100*a.curvePower),onValueChange:e=>{f({curvePower:tw(e,-100,100)/100})},style:{width:64},min:-100,max:100})}),(0,r.jsx)(tx.sh,{textEl:a,eachSet:f})]}),d&&(0,r.jsxs)(ta,{label:(0,s.t)("toolbar.textStroke"),enabled:!!a.strokeWidth,onEnabledChange:e=>f({strokeWidth:2*!!e}),children:[(0,r.jsx)(tE,{store:e,color:a.stroke,onColorChange:e=>{f({stroke:e})},value:a.strokeWidth,onValueChange:e=>{f({strokeWidth:e})},min:1,max:Math.max(1,Math.round(a.fontSize/2)),sliderMax:Math.max(1,a.fontSize/2)}),(0,r.jsx)(eI.R,{label:(0,s.t)("toolbar.strokeLineJoin"),className:"pn:py-2",children:(0,r.jsx)(eR,{variant:"outline",value:[(0,tv.wc)(a.strokeLineJoin)],onValueChange:e=>{let t=e[0];t&&f({strokeLineJoin:t})},children:tb.map(({value:e,labelKey:t})=>(0,r.jsx)(e_,{value:e,"aria-label":(0,s.t)(t),title:(0,s.t)(t),children:(0,r.jsx)(ty,{join:e})},e))})})]}),d&&(0,r.jsxs)(ta,{label:(0,s.t)("toolbar.textBackground"),enabled:!!a.backgroundEnabled,onEnabledChange:e=>f({backgroundEnabled:e}),children:[(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.backgroundCornerRadius"),value:Math.round(100*a.backgroundCornerRadius),onChange:e=>f({backgroundCornerRadius:e/100}),min:0,max:100}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.backgroundPadding"),value:Math.round(100*a.backgroundPadding),onChange:e=>f({backgroundPadding:e/100}),min:0,max:100}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.opacity"),value:Math.round(100*a.backgroundOpacity),onChange:e=>f({backgroundOpacity:e/100}),min:0,max:100}),(0,r.jsx)(eI.R,{label:(0,s.t)("toolbar.color"),className:"pn:py-2",children:(0,r.jsx)(X.sk,{value:a.backgroundColor,size:30,onChange:e=>{f({backgroundColor:e})},store:e})})]}),p&&(0,r.jsx)(ta,{label:(0,s.t)("toolbar.border"),enabled:!!a.borderSize,onEnabledChange:e=>f({borderSize:2*!!e}),children:(0,r.jsx)(tE,{store:e,color:a.borderColor,onColorChange:e=>{f({borderColor:e})},value:a.borderSize,onValueChange:e=>{f({borderSize:e})},min:1,max:Math.max(1,Math.round(h)),sliderMax:Math.max(1,h)})}),p&&(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.cornerRadius"),visible:p,enabled:0!==a.cornerRadius,onEnabledChange:e=>{f({cornerRadius:e?Math.min(a.width/4,a.height/4):0})},value:Math.round(m),sliderValue:m,onChange:e=>{f({cornerRadius:e})},min:1,max:Math.round(h),sliderMax:h}),(0,r.jsxs)(ta,{label:(0,s.t)("toolbar.shadow"),enabled:a.shadowEnabled,onEnabledChange:e=>f({shadowEnabled:e}),children:[(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.blur"),value:Math.round(a.shadowBlur),sliderValue:a.shadowBlur,onChange:e=>{f({shadowBlur:e})},min:0,max:tj(50,a.shadowBlur)}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.offsetX"),value:Math.round(a.shadowOffsetX),sliderValue:a.shadowOffsetX,onChange:e=>{f({shadowOffsetX:e})},min:tk(-50,a.shadowOffsetX),max:tj(50,a.shadowOffsetX)}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.offsetY"),value:Math.round(a.shadowOffsetY),sliderValue:a.shadowOffsetY,onChange:e=>{f({shadowOffsetY:e})},min:tk(-50,a.shadowOffsetY),max:tj(50,a.shadowOffsetY)}),(0,r.jsx)(ez.K,{label:(0,s.t)("toolbar.opacity"),value:Math.round(100*a.shadowOpacity),onChange:e=>{f({shadowOpacity:e/100})},min:0,max:100}),(0,r.jsx)(eI.R,{label:(0,s.t)("toolbar.color"),className:"pn:py-2",children:(0,r.jsx)(X.sk,{value:a.shadowColor,size:30,onChange:e=>{f({shadowColor:e})},store:e})})]})]})}),tP={name:"templates",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.templates")}
28,e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.templates"})}))),Panel:({store:e})=>(0,r.jsx)(k,{store:e})},tN={name:"text",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.text")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.text"})}))),Panel:({store:e})=>(0,r.jsx)(C.o,{store:e})},tA={name:"photos",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.photos")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.photos"})}))),Panel:({store:e})=>(0,r.jsx)(P,{store:e})},tM={name:"elements",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.elements"),iconSize:16},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.elements"})}))),Panel:({store:e})=>(0,r.jsx)(H,{store:e})},tO={name:"upload",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.upload")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.upload"})}))),Panel:({store:e})=>(0,r.jsx)(q.y,{store:e})},tT={name:"background",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.background")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.background"})}))),Panel:({store:e})=>(0,r.jsx)(G,{store:e})};(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.pages")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.pages"})})));let tR={name:"layers",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.layers")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.layers"})}))),Panel:({store:e})=>(0,r.jsx)(er,{store:e})},t_={name:"size",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.resize")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.resize"})}))),Panel:({store:e})=>(0,r.jsx)(eu,{store:e})},tz={name:"draw",Tab:(0,a.PA)(e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.draw")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.draw"})}))),Panel:({store:e})=>(0,r.jsx)(eL,{store:e})},tI={name:"videos",Tab:e=>(0,r.jsx)(u,Object.assign({name:(0,s.t)("sidePanel.videos")},e,{children:(0,r.jsx)(U.dc,{name:"sidePanel.videos"})})),Panel:eK},tD=[tP,tN,tA,tM,tz,tO,tT,tR,t_],tF={name:"animation",Tab:()=>null,Panel:tr},tL=[{name:"image-clip",Tab:()=>null,Panel:eJ},{name:"effects",Tab:()=>null,Panel:tS}],tB=({onClick:e})=>(0,r.jsxs)("div",{className:"pn-side-panel-hide-button pn:absolute pn:right-[-14px] pn:top-1/2 pn:z-10 pn:h-24 pn:w-[15px] pn:cursor-pointer pn:max-md:hidden pn:pn-mobile:hidden",onClick:e,children:[(0,r.jsx)("svg",{width:"15",height:"96",viewBox:"0 0 16 96",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{className:"pn:stroke-border pn:fill-background",d:"M 1 7 C 2 9 4 10 7.2 13.28 C 7.45 13.4625 7.6 13.6 7.7 13.8048 L 7.8 13.8 C 9.8 15.8 11.6 17.6 12.9 19.7 C 14 21.6 14.7 23.9 14.9 27 H 15 V 68 C 15 71.7 14.3 74.3 13 76.6 C 11.7 78.8 9.9 80.5 7.8 82.6344 L 7.79 82.6 C 7.6 82.8 7.4507 83 7.2729 83.2127 C 3.9102 86.5228 2 87 1 90"})}),(0,r.jsx)("div",{className:"pn:absolute pn:left-1/2 pn:top-1/2 pn:text-[0.5rem] pn:text-muted-foreground pn:hover:text-foreground",style:{transform:"translate(-50%, -50%) scaleY(2)"},children:"<"})]}),t$=(0,a.PA)(({store:e,sections:t,defaultSection:n="photos"})=>{(()=>{let t=i.useRef(!0);t.current&&(t.current=!1,e.openSidePanel(n))})();let a=(0,l.Iu)();i.useLayoutEffect(()=>{a?e.openSidePanel(""):e.openSidePanel(n)},[a]);let s=[...t||tD];if(tL.forEach(e=>{s.find(t=>t.name===e.name)||s.push(e)}),o.Mv.animationsEnabled){if(!s.find(e=>"videos"===e.name)){let e=Math.floor(s.length/2);s.splice(e,0,tI)}if(!s.find(e=>"animations"===e.name)){let e=Math.floor(s.length/2);s.splice(e,0,tF)}}let u=s.filter(e=>{var t;return null==(t=e.visibleInList)||t}),p=t=>{let n=t.target,r=n.closest(".polotno-close-panel"),i=n.closest(".polotno-mobile");r&&(a||i)&&e.openSidePanel("")},h=i.useRef(null),m=i.useRef(null),f=i.useRef(new Set);return e.openedSidePanel&&f.current.add(e.openedSidePanel),(0,r.jsx)(c.a,{elementRef:m,children:(0,r.jsxs)("div",{ref:m,className:(0,d.cn)("polotno-side-panel pn-side-panel pn:relative pn:flex pn:h-full pn:bg-background pn:p-0 pn:text-foreground","pn:md:border-r pn:md:border-border","pn:max-md:h-auto pn:max-md:w-full pn:pn-mobile:h-auto pn:pn-mobile:w-full","pn:max-md:border-t pn:max-md:border-border pn:pn-mobile:border-t pn:pn-mobile:border-border",!e.openedSidePanel&&"collapsed"),children:[(0,r.jsx)("div",{ref:h,className:(0,d.cn)("polotno-side-tabs-container pn:bg-background pn:max-md:w-full pn:max-md:overflow-auto pn:pn-mobile:w-full pn:pn-mobile:overflow-auto pn:md:overflow-y-auto pn:md:overflow-x-hidden pn:md:min-w-[72px]",e.openedSidePanel&&"pn:md:border-r pn:md:border-border"),children:(0,r.jsx)("div",{className:"polotno-side-tabs-inner pn:flex pn:flex-col pn:max-md:flex-row pn:max-md:min-w-min pn:pn-mobile:flex-row pn:pn-mobile:min-w-min",children:u.map(({name:t,Tab:n})=>(0,r.jsx)(n,{active:t===e.openedSidePanel,onClick:()=>{t===e.openedSidePanel&&a?e.openSidePanel(""):e.openSidePanel(t)}},t))})}),s.map(({name:t,Panel:n})=>f.current.has(t)&&(0,r.jsx)("div",{className:(0,d.cn)("polotno-panel-container pn-side-panel-content pn:h-full pn:px-2.5 pn:pt-2.5","pn:w-[var(--pn-sidebar-width,350px)]",!e.openedSidePanel&&"pn:w-0",t!==e.openedSidePanel&&"pn:hidden","pn:max-md:absolute pn:max-md:bottom-[54px] pn:max-md:z-[100] pn:max-md:!h-[50vh] pn:max-md:w-full pn:max-md:bg-background","pn:pn-mobile:absolute pn:
28pn-mobile:bottom-[54px] pn:pn-mobile:z-[100] pn:pn-mobile:!h-[50vh] pn:pn-mobile:w-full pn:pn-mobile:bg-background"),onClick:p,children:(0,r.jsx)(n,{store:e})},t)),e.openedSidePanel&&a&&(0,r.jsx)("div",{className:"polotno-close-panel",style:{position:"absolute",left:0,bottom:"72px",width:"100vw",height:"100vh",zIndex:99,backgroundColor:"rgba(0,0,0,0.05)"},onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&(0,r.jsx)(tB,{onClick:()=>e.openSidePanel("")})]})})});t$.displayName="SidePanel"},70198:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Files",[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]])},70532:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])},71360:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});
28let r=(0,n(71847).A)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},72995:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});let r=(0,n(83101).F)("pn:h-[35px] pn:rounded-md pn:bg-background pn:shadow-md")},73629:(e,t,n)=>{"use strict";n.d(t,{l6:()=>tc,gC:()=>th,eb:()=>tm,bq:()=>tp,yv:()=>tu});var r=n(95155),i=n(12115),a=n(90977),o=n(57951),l=n(37898),s=n(78437),d=n(42433),c=n(1882),u=n(98590),p=n(6993),h=n(33593),m=n(98627),f=n(62909),g=n(30227),x=n(11330),v=n(99793),b=n(2066),y=n(5480),w=n(2428),j=n(49943),k=n(3068),C=n(15108),E=n(89072),S=n(37676),P=n(82443),N=n(27970);let A=i.createContext(null);function M(){let e=i.useContext(A);if(null===e)throw Error((0,N.A)(60));return e}var O=n(48916),T=n(90845),R=n(74614),_=n(37025);let z=(e,t)=>Object.is(e,t);function I(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function D(e,t,n){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&I(e,t,n)):-1}function F(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function L(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function B(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return F(e)}function $(e,t){return t&&null!=e?t(e)??"":e&&"object"==typeof e&&"value"in e&&"label"in e?F(e.value):F(e)}function W(e,t,n){if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return t[e]??B(e,n);if(Array.isArray(t)){let r=L(t)?t.flatMap(e=>e.items):t;if(null==e||"object"!=typeof e){let t=r.find(t=>t.value===e);return t&&null!=t.label?t.label:B(e,n)}if("value"in e){let t=r.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return B(e,n)}let V={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==$(t,r))},hasNullItemLabel:(e,t)=>!!t&&function(e){if(!Array.isArray(e))return null!=e&&"null"in e;if(L(e)){for(let t of e)for(let e of t.items)if(e&&null==e.value&&null!=e.label)return!0;return!1}for(let t of e)if(t&&null==t.value&&null!=t.label)return!0;return!1}(e.items),open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>I(t,e,n)):I(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};var H=n(35836),q=n(39174),K=n(76347),U=n(31369),X=n(38091),Y=n(47023),Z=n(53876),G=n(85182);function Q(e,t){return Math.max(0,e-t)}function J(e,t){if(t<=0)return 0;let n=(0,G.q)(e,0,t),r=t-n,i=n<=1,a=r<=1;return i&&a?n<=r?0:t:i?0:a?t:n}var ee=n(53060),et=n(82668);let en=i.createContext(void 0);var er=n(80873);let ei=i.forwardRef(function(e,t){let{render:n,className:a,style:o,...l}=e,[s,d]=i.useState(),c=i.useMemo(()=>({labelId:s,setLabelId:d}),[s,d]),u=(0,er.o)("div",e,{ref:t,props:[{role:"group","aria-labelledby":s},l]});return(0,r.jsx)(en.Provider,{value:c,children:u})}),ea={value:()=>null},eo=i.forwardRef(function(e,t){let{className:n,render:a,children:o,placeholder:l,style:s,...d}=e,{store:c,valueRef:u}=M(),p=(0,x.P)(c,V.value),h=(0,x.P)(c,V.items),m=(0,x.P)(c,V.itemToStringLabel),f=(0,x.P)(c,V.hasSelectedValue),g=!f&&null!=l&&null==o,v=(0,x.P)(c,V.hasNullItemLabel,g),b=null;if("function"==typeof o)b=o(p);else if(null!=o)b=o;else if(g&&!v)b=l;
28else if(Array.isArray(p))b=p.reduce((e,t,n)=>(n>0&&e.push(", "),e.push((0,r.jsx)(i.Fragment,{children:W(t,h,m)},n)),e),[]);else b=W(p,h,m);return(0,er.o)("span",e,{state:{value:p,placeholder:!f},ref:[t,u],props:[{children:b},d],stateAttributesMapping:ea})});var el=n(38919),es=n(11606),ed=n(36499),ec=n(25011),eu=n(62113),ep=n(58289),eh=n(56824),em=n(28787),ef=n(79574),eg=n(55535);let ex={...ec.jL,...eu.dc,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},ev=i.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:o=!1,nativeButton:l=!0,style:s,...d}=e,{setTouched:c,setFocused:u,validationMode:p,state:h,disabled:m}=(0,O.V$)(),{labelId:g}=(0,ed.H)(),{store:v,setOpen:b,selectionRef:y,validation:w,readOnly:j,required:k,alignItemWithTriggerActiveRef:C,disabled:E}=M(),S=m||E||o,P=(0,x.P)(v,V.open),N=(0,x.P)(v,V.mounted),A=(0,x.P)(v,V.value),T=(0,x.P)(v,V.triggerProps),_=(0,x.P)(v,V.positionerElement),z=(0,x.P)(v,V.listElement),I=(0,x.P)(v,V.popupSide),D=(0,x.P)(v,V.id),F=(0,x.P)(v,V.labelId),L=(0,x.P)(v,V.hasSelectedValue),B=N&&_?I:null,$=a??D,W=(0,eg._)(g,F);(0,R.l)({id:$});let K=(0,f.u)(_),U=i.useRef(null),{getButtonProps:X,buttonRef:Y}=(0,ef.s)({disabled:S,native:l}),Z=v.useStateSetter("triggerElement"),G=(0,es.Z)(),Q=(0,es.Z)(),J=(0,es.Z)();i.useEffect(()=>{if(P)return J.start(400,()=>{y.current.allowUnselectedMouseUp=!0,y.current.allowSelectedMouseUp=!0}),()=>{J.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},Q.clear()},[P,y,Q,J]);let ee=(0,et.v6)(T,{id:$,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-controls":P?z?.id??(0,eh.nd)(_)?.id:void 0,"aria-labelledby":W,"aria-readonly":j||void 0,"aria-required":k||void 0,tabIndex:S?-1:0,onFocus(e){u(!0),P&&C.current&&b(!1,(0,H.d)(q.dv,e.nativeEvent)),G.start(0,()=>{v.set("forceMount",!0)})},onBlur(e){(0,em.gR)(_,e.relatedTarget)||(c(!0),u(!1),"onBlur"===p&&w.commit(A))},onMouseDown(e){if(P)return;let t=(0,el.R)(e.currentTarget);function n(e){if(!U.current)return;let t=e.target;!((0,em.gR)(U.current,t)||(0,em.gR)(K.current,t))&&((0,ep.U)(e,U.current)||b(!1,(0,H.d)(q.LO,e)))}Q.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},d,X),en=w.getValidationProps(S,ee);en.role="combobox";let ei={...h,open:P,disabled:S,value:A,readOnly:j,popupSide:B,placeholder:!L};return(0,er.o)("button",e,{ref:[t,U,Y,Z],state:ei,stateAttributesMapping:ex,props:en})}),eb=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=M(),l=(0,x.P)(o,V.open);return(0,er.o)("span",e,{state:{open:l},ref:t,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:ec.qV})});var ey=n(24093);let ew=i.forwardRef(function(e,t){let{store:n}=M(),i=(0,x.P)(n,V.mounted),a=(0,x.P)(n,V.forceMount);return i||a?(0,r.jsx)(ey.XF,{ref:t,...e}):null});var ej=n(8303),ek=n(25379),eC=n(86322);let eE=i.createContext(void 0);function eS(){let e=i.useContext(eE);if(!e)throw Error((0,N.A)(59));return e}var eP=n(65637),eN=n(18516);function eA(e,t){e&&Object.assign(e.style,t)}let eM={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"};var eO=n(11383),eT=n(90755);let eR={position:"fixed"},e_=i.forwardRef(function(e,t){let{anchor:n,className:a,render:o,positionMethod:l,side:s,align:d,sideOffset:c,alignOffset:u,collisionBoundary:p="clipping-ancestors",collisionPadding:f,arrowPadding:g,sticky:v,disableAnchorTracking:b,alignItemWithTrigger:y=!0,collisionAvoidance:w=eN.uD,style:j,...k}=e,{store:C,listRef:E,labelsRef:S,alignItemWithTriggerActiveRef:P,selectedItemTextRef:N,valuesRef:A,initialValueRef:O,popupRef:T,setValue:R,floatingContext:_}=M(),z=(0,x.P)(C,V.open),I=(0,x.P)(C,V.mounted),F=(0,x.P)(C,V.modal),L=(0,x.P)(C,V.value),B=(0,x.P)(C,V.openMethod),$=(0,x.P)(C,V.positionerElement),W=(0,x.P)(C,V.triggerElement),K=(0,x.P)(C,V.isItemEqualToValue),U=(0,x.P)(C,V.transitionStatus),X=i.useRef(null),Y=i.useRef(null),[Z,G]=i.useState(y),Q=I&&Z&&"touch"!==B;I||Z===y||G(y),i.useImperativeHandle(P,()=>Q),(0,eT.G)((Q||F)&&z,"touch"===B,$,W);let J=(0,eC.s)({anchor:n,floatingRootContext:_,positionMethod:l,mounted:I,side:s,sideOffset:c,align:d,alignOffset:u,arrowPadding:g,collisionBoundary:p,collisionPadding:f,sticky:v,disableAnchorTracking:b??Q,collisionAvoidance:w,keepMounted:!0}),ee=Q?"none":J.side,et=Q?eR:J.positionerStyles,en={open:z,side:ee,align:J.align,anchorHidden:J.anchorHidden};(0,h.g)(()=>{C.set("popupSide",J.side)},[C,J.side]);let er=C.useStateSetter("positionerElement"),ei=(0,eO.i)(e,en,{styles:et,transitionStatus:U,props:k,refs:[t,er],hidden:!I,inert:!z}),ea=i.useRef(0),eo=(0,m.K)(e=>{if(0===A.current.length)return;let t=ea.current;if(ea.current=e.size,e.size===t)return;let n=(0,H.d)(q.dv);if(0!==t&&!C.state.multiple&&null!==L&&-1===D(A.current,L,K)){let e=O.current,t=null!=e&&-1!==D(A.current,e,K)?e:null;R(t,n),null===t&&(C.set("selectedIndex",null),N.current=null)}if(0!==t&&C.state.multiple&&Array.isArray(L)){let e=L.filter(e=>-1!==D(A.current,e,K));e.length!==L.length&&(R(e,n),0===e.length&&(C.set("selectedIndex",null),N.current=null))}if(z&&Q){C.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:""};eA($,e),eA(T.current,e)}}),el=i.useMemo(()=>({...J,side:ee,alignItemWithTriggerActive:Q,setControlledAlignItemWithTrigger:G,scrollUpArrowRef:X,scrollDownArrowRef:Y}),[J,ee,Q,G]);return(0,r.jsx)(ek.u,{elementsRef:E,labelsRef:S,onMapChange:eo,children:(0,r.jsxs)(eE.Provider,{value:el,children:[I&&F&&(0,r.jsx)(eP.W,{inert:(0,ej.Y)(!z),cutout:W}),ei]})})});var ez=n(87827),eI=n(62159),eD=n(22024),eF=n(48514),eL=n(18437),eB=n(20861);let e$="base-ui-disable-scrollbar",eW={className:e$,getElement:e=>(0,r.jsx)("style",{nonce:e,href:e$,precedence:"base-ui:low",children:`.${e$}{scrollbar-width:none}.${e$}::-webkit-scrollbar{display:none}`})};var eV=n(9797),eH=n(78337),eq=n(63142),eK=n(6043),eU=n(52759),eX=n(32083);let eY={...ec.GW,...eV.G},eZ=i.forwardRef(function(e,t){let{render:n,className:a,style:o,finalFocus:l,...s}=e,{store:d,popupRef:c,onOpenChangeComplete:u,setOpen:p,valueRef:f,firstItemTextRef:g,selectedItemTextRef:v,multiple:y,handleScrollArrowVisibility:w,scrollHandlerRef:j,listRef:k,highlightItemOnHover:C,floatingContext:E}=M(),{side:S,align:P,alignItemWithTriggerActive:N,isPositioned:A,setControlledAlignItemWithTrigger:O}=eS(),T=null!=(0,eH.S)(!0),R=(0,eX.j)(),{nonce:_,disableStyleElements:z}=(0,eU.n)(),I=(0,x.P)(d,V.id),D=(0,x.P)(d,V.open),F=(0,x.P)(d,V.openMethod),L=(0,x.P)(d,V.mounted),B=(0,x.P)(d,V.popupProps),$=(0,x.P)(d,V.transitionStatus),W=(0,x.P)(d,V.triggerElement),U=(0,x.P)(d,V.positionerElement),X=(0,x.P)(d,V.listElement),Y=i.useRef(!1),Z=i.useRef(!1),Q=i.useRef({}),J=(0,eF.NR)(),ee=(0,m.K)(e=>{var t;if(!U||!c.current||!Z.current)return;let n="0px"===U.style.top,r="0px"===U.style.bottom;if(Y.current||!N||!n&&!r)return void w(e);let i=eJ(U),a=(t=U.getBoundingClientRect().height,t/i.y),o=(0,el.R)(U),l=(0,b.zk)(U),s=l.getComputedStyle(U),d=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),p=eG(l.getComputedStyle(c.current)),h=Math.min(o.documentElement.clientHeight-d-u,p),m=e.scrollTop,f=eQ(e),g=null,x=e=>{U.style.height=`${e}px`},v=n?f-m:m,y=Math.min(a+v,h);if(v<=1){let t=(0,G.q)(v,0,h-a);t>0&&x(a+t),e.scrollTop=n?f:0,h-(a+t)<=1&&(Y.current=!0),w(e);return}if(h-y>1)g=n?1/0:0;else if(r&&m<f){let e=a+v-h;g=m-(v-e)}let j=Math.ceil(y);if(0!==j&&x(j),null!=g){let t=(0,G.q)(g,0,eQ(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}j>=h-1&&(Y.current=!0),w(e)});i.useImperativeHandle(j,()=>ee,[ee]),(0,K.v)({open:D,ref:c,onComplete(){D&&u?.(!0)}}),(0,h.g)(()=>{U&&c.current&&!Object.keys(Q.current).length&&(Q.current={top:U.style.top||"0",left:U.style.left||"0",right:U.style.right,height:U.style.height,bottom:U.style.bottom,minHeight:U.style.minHeight,maxHeight:U.style.maxHeight,marginTop:U.style.marginTop,marginBottom:U.style.marginBottom})},[c,U]),(0,h.g)(()=>{D||N||(Z.current=!1,Y.current=!1,eA(U,Q.current))},[D,N,U,c]),(0,h.g)(()=>
28{let e=c.current;if(!D||!W||!U||!e||N&&!A||"ending"===d.state.transitionStatus)return;if(Z.current=!0,e.style.removeProperty("--transform-origin"),!N)return void J.request(()=>w(X||e));let t=function(e){let{style:t}=e,n={};for(let[e,r]of e1)n[e]=t.getPropertyValue(e),t.setProperty(e,r,"important");return()=>{for(let[e]of e1){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}(e);try{let t,n=v.current;n?.isConnected||(n=!V.hasSelectedValue(d.state)&&g.current?.isConnected?g.current:null);let r=f.current,i=(0,b.zk)(U),a=i.getComputedStyle(U),o=i.getComputedStyle(e),l=(0,el.R)(W),s=eJ(W),c=e0(W.getBoundingClientRect(),s),u=e0(U.getBoundingClientRect(),s),p=c.height,h=X||e,m=h.scrollHeight,x=parseFloat(o.borderBottomWidth),y=parseFloat(a.marginTop)||10,j=parseFloat(a.marginBottom)||10,E=parseFloat(a.minHeight)||100,S=eG(o),P=l.documentElement.clientHeight-y-j,N=l.documentElement.clientWidth,A=P-c.bottom+p,M="rtl"===R?c.right-u.width:c.left,T=0;if(n&&r){let e=e0(r.getBoundingClientRect(),s);t=e0(n.getBoundingClientRect(),s),M=u.left+("rtl"===R?e.right-t.right:e.left-t.left);let i=e.top-c.top+e.height/2;T=t.top-u.top+t.height/2-i}let _=A+T+j+x,z=Math.min(P,_),I=P-y-j,D=_-z;U.style.left=`${(0,G.q)(M,5,N-5-u.width)}px`,U.style.height=`${z}px`,U.style.maxHeight="none",U.style.marginTop=`${y}px`,U.style.marginBottom=`${j}px`,e.style.height="100%";let F=eQ(h),L=D>=F-1;L&&(z=Math.min(P,u.height)-(D-F));let B=c.top<20||c.bottom>P-20||Math.ceil(z)+1<Math.min(m,E),$=(i.visualViewport?.scale??1)!==1&&eD.Fp;if(B||$){eA(U,Q.current),O(!1);return}let H=Math.max(E,z);
28if(L){let e=Math.max(0,P-_);U.style.top=u.height>=I?"0":`${e}px`,U.style.height=`${z}px`,h.scrollTop=eQ(h)}else U.style.bottom="0",h.scrollTop=D;if(t){let n=u.top,r=u.height,i=t.top+t.height/2,a=(0,G.q)(r>0?(i-n)/r*100:50,0,100);e.style.setProperty("--transform-origin",`50% ${a}%`)}(H===P||z>=S)&&(Y.current=!0),w(h),C&&null===d.state.selectedIndex&&null===d.state.activeIndex&&null!=k.current[0]&&d.set("activeIndex",0)}finally{t()}},[d,D,U,W,f,g,v,c,w,N,O,J,X,k,C,R,A]),i.useEffect(()=>{if(!N||!U||!D)return;let e=(0,b.zk)(U);return(0,eI.q)(e,"resize",function(e){p(!1,(0,H.d)(q.L5,e))})},[p,N,U,D]);let et={...X?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":y||void 0,id:`${I}-list`},onKeyDown(e){T&&eq.jF.has(e.key)&&e.stopPropagation()},onScroll(e){X||ee(e.currentTarget)},...N&&{style:X?{height:"100%"}:eM},className:!X&&N?eW.className:void 0},en=(0,er.o)("div",e,{ref:[t,c],state:{open:D,transitionStatus:$,side:S,align:P},stateAttributesMapping:eY,props:[B,et,(0,eK.d)($),s]});return(0,r.jsxs)(i.Fragment,{children:[!z&&eW.getElement(_),(0,r.jsx)(eL.s,{context:E,modal:!1,disabled:!L,openInteractionType:F,returnFocus:l,restoreFocus:!0,children:en})]})});function eG(e){let t=e.maxHeight;return t.endsWith("px")&&parseFloat(t)||1/0}function eQ(e){return Q(e.scrollHeight,e.clientHeight)}function eJ(e){return eB.iD.getScale(e)}function e0(e,t){return(0,ez.B1)({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}let e1=[["transform","none"],["scale","1"],["translate","0 0"]],e2=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:l,multiple:s}=M(),{alignItemWithTriggerActive:d}=eS(),c=(0,x.P)(o,V.hasScrollArrows),u=(0,x.P)(o,V.openMethod),p=(0,x.P)(o,V.id),h={id:`${p}-list`,role:"listbox","aria-multiselectable":s||void 0,onScroll(e){l.current?.(e.currentTarget)},...d&&{style:eM},className:c&&"touch"!==u?eW.className:void 0},m=o.useStateSetter("listElement");return(0,er.o)("div",e,{ref:[t,m],props:[h,a]})});var e5=n(99892);let e3=i.forwardRef(function(e,t){let{render:n,className:r,style:a,id:o,...l}=e,{setLabelId:s}=function(){let e=i.useContext(en);if(void 0===e)throw Error((0,N.A)(56));return e}(),d=(0,e5.e)(o);return(0,h.g)(()=>(s(d),()=>{s(e=>e===d?void 0:e)}),[d,s]),(0,er.o)("div",e,{ref:t,props:[{id:d},l]})});var e4=n(35479);let e7=i.createContext(void 0);function e8(){let e=i.useContext(e7);if(!e)throw Error((0,N.A)(57));return e}var e6=n(13788);let e9=i.memo(i.forwardRef(function(e,t){let{render:n,className:a,style:o,value:l=null,label:s,disabled:d=!1,nativeButton:c=!1,...u}=e,p=i.useRef(null),m=(0,e4.q)({guess:!0,label:s,textRef:p}),{store:f,itemProps:g,setOpen:v,setValue:b,selectionRef:y,typingRef:w,valuesRef:j,multiple:k,selectedItemTextRef:C,disabled:E,readOnly:S}=M(),P=E||d,N=(0,x.P)(f,V.isActive,m.index),A=(0,x.P)(f,V.open),O=(0,x.P)(f,V.isSelected,l),T=(0,x.P)(f,V.isSelectedByFocus,m.index),R=(0,x.P)(f,V.isItemEqualToValue),_=m.index,z=i.useRef(null);(0,h.g)(()=>{let e=j.current;return e[_]=l,()=>{delete e[_]}},[_,l,j]),(0,h.g)(()=>{let e=f.state.value,t=e;k&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),void 0!==t&&I(l,t,R)&&(f.set("selectedIndex",_),p.current&&(C.current=p.current))},[_,k,R,f,l,C]);let D=i.useRef("mouse"),F=i.useRef(!1),{getButtonProps:L,buttonRef:B}=(0,ef.s)({disabled:P,focusableWhenDisabled:!0,native:c,composite:!0});function $(){y.current.dragY=0}let W=(0,er.o)("div",e,{ref:[B,t,m.ref,z],state:{disabled:P,selected:O,highlighted:N},props:[g,{role:"option","aria-selected":O,tabIndex:A&&N?0:-1,onKeyDown(e){f.set("activeIndex",_)," "===e.key&&w.current&&e.preventDefault()},onClick(e){let t="touch"!==D.current,n=e.nativeEvent.pointerType,r=t&&(0,e6.YF)(e.nativeEvent)&&(void 0!==n||N),i=t&&!r&&!F.current;F.current=!1,P||i||function(e){if(E||S)return;let t=f.state.value;if(k){let n=Array.isArray(t)?t:[];b(O?n.filter(e=>!I(l,e,R)):[...n,l],(0,H.d)(q.Bo,e))}else b(l,(0,H.d)(q.Bo,e)),v(!1,(0,H.d)(q.Bo,e))}(e.nativeEvent)},onPointerEnter(e){D.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){let t=y.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){D.current=e.pointerType,F.current=!0,$()}
28,onMouseUp(){if($(),P||"touch"===D.current||F.current)return;let e=!y.current.allowSelectedMouseUp&&O,t=!y.current.allowUnselectedMouseUp&&!O;e||t||(F.current=!0,z.current?.click(),F.current=!1)}},u,L]}),K=i.useMemo(()=>({selected:O,index:_,textRef:p,selectedByFocus:T}),[O,_,p,T]);return(0,r.jsx)(e7.Provider,{value:K,children:W})})),te=i.forwardRef(function(e,t){let{selected:n}=e8();return e.keepMounted||n?(0,r.jsx)(tt,{...e,ref:t}):null}),tt=i.memo(i.forwardRef((e,t)=>{let{render:n,className:r,style:a,keepMounted:o,...l}=e,{selected:s}=e8(),d=i.useRef(null),{transitionStatus:c,setMounted:u}=(0,_.$)(s),p=(0,er.o)("span",e,{ref:[t,d],state:{selected:s,transitionStatus:c},props:[{"aria-hidden":!0,children:"✔️"},l],stateAttributesMapping:eV.G});return(0,K.v)({open:s,ref:d,onComplete(){s||u(!1)}}),p})),tn=i.memo(i.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:a}=e8(),{firstItemTextRef:o,selectedItemTextRef:l}=M(),{render:s,className:d,style:c,...u}=e,p=i.useCallback(e=>{e&&(0===n&&(o.current=e),a&&(l.current=e))},[o,l,n,a]);return(0,er.o)("div",e,{ref:[p,t,r],props:u})})),tr=i.forwardRef(function(e,t){let{className:n,render:r,orientation:i="horizontal",style:a,...o}=e;return(0,er.o)("div",e,{state:{orientation:i},ref:t,props:[{role:"presentation"},o]})}),ti=i.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...l}=e,s="up"===a,{store:d,popupRef:c,listRef:u,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:m}=M(),{side:f,scrollDownArrowRef:g,scrollUpArrowRef:v}=eS(),b=s?V.scrollUpArrowVisible:V.scrollDownArrowVisible,y=(0,x.P)(d,b),w=(0,x.P)(d,V.openMethod),j=y&&"touch"!==w,k=(0,es.Z)(),C=s?v:g,{mounted:E,transitionStatus:S,setMounted:P}=(0,_.$)(j);(0,h.g)(()=>(m.current+=1,d.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),0===m.current&&d.set("hasScrollArrows",!1)}),[d,m]),(0,K.v)({open:j,ref:C,onComplete(){j||P(!1)}});let N=(0,er.o)("div",e,{ref:[t,C],state:{direction:a,visible:j,side:f,transitionStatus:S},props:[{"aria-hidden":!0,children:s?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||k.isStarted()||(d.set("activeIndex",null),k.start(40,function e(){let t=d.state.listElement??c.current;if(!t)return;d.set("activeIndex",null),p(t);let n=Q(t.scrollHeight,t.clientHeight),r=J(t.scrollTop,n),i=r===(s?0:n),a=u.current;if(r!==t.scrollTop&&(t.scrollTop=r),i)return void k.clear();if(a.length>0){let e=C.current?.offsetHeight||0;t.scrollTop=function(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),l=e[o];return o<t&&l?J(l.offsetTop-i,a):0}let o=e.length-1,l=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>l){o=Math.max(0,t-1);break}}let s=Math.min(e.length-1,o+1),d=e[s];return s>o&&d?J(d.offsetTop+d.offsetHeight-r+i,a):a}(a,s,r,t.clientHeight,e,n)}k.start(40,e)}))},onMouseLeave(){k.clear()}},l],stateAttributesMapping:eV.G});return E||o?N:null}),ta=i.forwardRef(function(e,t){return(0,r.jsx)(ti,{...e,ref:t,direction:"up"})}),to=i.forwardRef(function(e,t){return(0,r.jsx)(ti,{...e,ref:t,direction:"down"})});var tl=n(69819),ts=n(72094),td=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let tc=function(e){let{id:t,value:n,defaultValue:a=null,onValueChange:o,open:l,defaultOpen:N=!1,onOpenChange:M,name:F,form:L,autoComplete:W,disabled:G=!1,readOnly:en=!1,required:er=!1,modal:ei=!0,actionsRef:ea,inputRef:eo,onOpenChangeComplete:el,items:es,multiple:ed=!1,itemToStringLabel:ec,itemToStringValue:eu,isItemEqualToValue:ep=z,highlightItemOnHover:eh=!0,children:em}=e,{clearErrors:ef}=(0,U.x)(),{setDirty:eg,setTouched:ex,setFocused:ev,validityData:eb,setFilled:ey,name:ew,disabled:ej,validation:ek,validationMode:eC}=(0,O.V$)(),eE=(0,R.l)({id:t}),eS=ej||G,eP=ew??F,[eN,eA]=(0,p.q)({controlled:n,default:ed?a??v.Ml:a,name:"Select",state:"value"}),[eM,eO]=(0,p.q)({controlled:l,default:N,name:"Select",state:"open"}),eT=i.useRef([]),eR=i.useRef([]),e_=i.useRef(null),ez=i.useRef(null),eI=i.useRef(0),eD=i.useRef(null),eF=i.useRef([]),eL=i.useRef(!1),eB=i.useRef(null),e$=i.useRef(null),eW=i.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),eV=i.useRef(!1),{mounted:eH,setMounted:eq,transitionStatus:eK}=(0,_.$)(eM),{openMethod:eU,triggerProps:eX}=(0,Z.G)(eM),eY=(0,c.j)(()=>new g.H({id:eE,labelId:void 0,modal:ei,multiple:ed,itemToStringLabel:ec,itemToStringValue:eu,isItemEqualToValue:ep,value:eN,open:eM,mounted:eH,transitionStatus:eK,items:es,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,eZ=(0,x.P)(eY,V.activeIndex),eG=(0,x.P)(eY,V.selectedIndex),eQ=(0,x.P)(eY,V.triggerElement),eJ=(0,x.P)(eY,V.positionerElement),e0=function(e){let[t,n]=i.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}(eU),e1=eU??e0,e2=i.useMemo(()=>ed?"":$(eN,eu),[ed,eN,eu]),e5=i.useMemo(()=>ed&&Array.isArray(eN)?eN.map(e=>$(e,eu)):$(eN,eu),[ed,eN,eu]),e3=(0,f.u)(eQ),e4=(0,m.K)(()=>e5);(0,T.I)(e3,eE,eN,e4,!eS,F);let e7=i.useRef(eN),e8=ed?Array.isArray(eN)&&eN.length>0:null!=eN&&""!==e2;(0,h.g)(()=>{ey(e8)},[e8,ey]),(0,h.g)(function(){let e=eN,t=!1;if(ed){let n=Array.isArray(eN)?eN:[];t=0===n.length,e=n[n.length-1]}let n=t?-1:D(eF.current,e,ep),r=-1===n?null:n;null===r&&(e$.current=null),eM||eY.set("selectedIndex",r)},[ed,eM,eN,ep,eY]),(0,Y.x)(eN,()=>{ef(eP),eg(function(e){let t=eb.initialValue;return Array.isArray(e)&&Array.isArray(t)?!(0,X.B)(e,t,(e,t)=>I(e,t,ep)):e!==t}(eN)),ek.change(eN)});let e6=(0,m.K)((e,t)=>
28{M?.(e,t),!t.isCanceled&&(eO(e),e||t.reason!==q.Xn&&t.reason!==q.Np||(ex(!0),ev(!1),"onBlur"===eC&&ek.commit(eN)))}),e9=(0,m.K)(()=>{eq(!1),eY.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),el?.(!1)});(0,K.v)({enabled:!ea,open:eM,ref:e_,onComplete(){eM||e9()}}),i.useImperativeHandle(ea,()=>({unmount:e9}),[e9]);let te=(0,m.K)((e,t)=>{o?.(e,t),t.isCanceled||eA(e)}),tt=(0,m.K)(e=>{let t=Q(e.scrollHeight,e.clientHeight),n=J(e.scrollTop,t);eY.set("scrollUpArrowVisible",n>0),eY.set("scrollDownArrowVisible",n<t)}),tn=function(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=(0,y.B)(),a=null!=(0,j.R1)(),o=(0,c.j)(()=>new k.K({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new w.Z,floatingId:i,syncOnly:!1,nested:a})).current;return(0,h.g)(()=>{let e={open:t,floatingId:i};void 0!==r.reference&&(e.referenceElement=r.reference,e.domReferenceElement=(0,b.vq)(r.reference)?r.reference:null),void 0!==r.floating&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}({open:eM,onOpenChange:e6,elements:{reference:eQ,floating:eJ}}),tr=(0,C.k)(tn,{enabled:!en&&!eS,event:"mousedown"}),ti=(0,E.s)(tn),ta=(0,S.C)(tn,{enabled:!en&&!eS,listRef:eT,activeIndex:eZ,selectedIndex:eG,disabledIndices:v.Ml,onNavigate(e){(null!==e||eM)&&eY.set("activeIndex",e)},focusItemOnHover:eh}),to=(0,P.l)(tn,{enabled:!en&&!eS&&(eM||!ed),listRef:eR,activeIndex:eZ,selectedIndex:eG,disabledIndices:e=>(0,u.F)(eT.current[e]),onMatch(e){eM?eY.set("activeIndex",e):te(eF.current[e],(0,H.d)(q.dv))},onTyping(e){eL.current=e}}),tl=i.useMemo(()=>(0,et.v6)(to.reference,ta.reference,ti.reference,tr.reference,eX),[tr.reference,to.reference,ta.reference,ti.reference,eX]),ts=i.useMemo(()=>(0,et.v6)(ee.Ls,to.floating,ta.floating,ti.floating),[to.floating,ta.floating,ti.floating]),td=ta.item??v.t0,tc=i.useRef(!0);tc.current&&(tc.current=!1,eY.update({popupProps:ts,triggerProps:tl})),eY.useSyncedValues({id:eE,modal:ei,multiple:ed,value:eN,open:eM,mounted:eH,transitionStatus:eK,popupProps:ts,triggerProps:tl,items:es,itemToStringLabel:ec,itemToStringValue:eu,isItemEqualToValue:ep,openMethod:e1});let tu=i.useMemo(()=>({store:eY,floatingContext:tn,required:er,disabled:eS,readOnly:en,multiple:ed,highlightItemOnHover:eh,setValue:te,setOpen:e6,listRef:eT,popupRef:e_,scrollHandlerRef:ez,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:eI,itemProps:td,valueRef:eD,valuesRef:eF,labelsRef:eR,typingRef:eL,selectionRef:eW,firstItemTextRef:eB,selectedItemTextRef:e$,validation:ek,onOpenChangeComplete:el,alignItemWithTriggerActiveRef:eV,initialValueRef:e7}),[eY,tn,er,eS,en,ed,eh,te,e6,td,ek,el,tt]),tp=(0,d.a)(eo,ek.inputRef),th=ed?void 0:eP,tm=i.useMemo(()=>ed&&Array.isArray(eN)&&eP?eN.map(e=>{let t=$(e,eu);return(0,r.jsx)("input",{type:"hidden",form:L,name:eP,value:t,disabled:eS},t)}):null,[ed,eN,L,eP,eu,eS]);return(0,r.jsxs)(A.Provider,{value:tu,children:[em,(0,r.jsx)("input",{...ek.getValidationProps(eS,{onFocus(){eY.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||eS||en)return;let t=e.currentTarget.value,n=(0,H.d)(q.dv,e.nativeEvent);eY.set("forceMount",!0),queueMicrotask(function(){if(ed)return;let e=t.toLowerCase(),r=eF.current.findIndex(t=>$(t,eu).toLowerCase()===e||B(t,ec).toLowerCase()===e);-1===r&&(r=eF.current.findIndex((t,n)=>{let r=eR.current[n];return null!=r&&r.toLowerCase()===e}));let i=eF.current[r];null!=i&&te(i,n)})}}),id:eE&&null==th?`${eE}-hidden-input`:void 0,form:L,name:th,autoComplete:W,value:e2,disabled:eS,required:er&&!(ed&&e8),readOnly:en,ref:tp,style:eP?s.a:s.Q,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),tm]})};function tu(e){var t=td(e,[]);return(0,r.jsx)(eo,Object.assign({"data-slot":"select-value"},t))}i.forwardRef((e,t)=>{var{className:n}=e,i=td(e,["className"]);return(0,r.jsx)(ei,Object.assign({ref:t,"data-slot":"select-group",className:(0,tl.cn)("pn:scroll-my-1",n)},i))}).displayName="SelectGroup";let tp=i.forwardRef((e,t)=>
28{var{className:n,size:i="default",children:o}=e,l=td(e,["className","size","children"]);return(0,r.jsxs)(ev,Object.assign({ref:t,"data-slot":"select-trigger","data-size":i,className:(0,tl.cn)("pn:flex pn:w-fit pn:items-center pn:justify-between pn:gap-2 pn:rounded-md pn:border pn:border-input pn:bg-transparent pn:px-3 pn:py-2 pn:text-sm pn:whitespace-nowrap pn:shadow-xs pn:transition-[color,box-shadow] pn:outline-none pn:focus-visible:border-ring pn:focus-visible:ring-[3px] pn:focus-visible:ring-ring/50 pn:disabled:cursor-not-allowed pn:disabled:opacity-50 pn:aria-invalid:border-destructive pn:aria-invalid:ring-destructive/20 pn:data-[placeholder]:text-muted-foreground pn:data-[size=default]:h-9 pn:data-[size=sm]:h-8 pn:*:data-[slot=select-value]:line-clamp-1 pn:*:data-[slot=select-value]:flex pn:*:data-[slot=select-value]:items-center pn:*:data-[slot=select-value]:gap-2 pn:dark:bg-input/30 pn:dark:hover:bg-input/50 pn:dark:aria-invalid:ring-destructive/40 pn:[&_svg]:pointer-events-none pn:[&_svg]:shrink-0 pn:[&_svg:not([class*='size-'])]:size-4 pn:[&_svg:not([class*='text-'])]:text-muted-foreground",n)},l,{children:[o,(0,r.jsx)(eb,{render:(0,r.jsx)(a.A,{className:"pn:size-4 pn:opacity-50"})})]}))});tp.displayName="SelectTrigger";let th=i.forwardRef((e,t)=>{var{className:n,children:i,side:a,align:o="center",sideOffset:l,alignItemWithTrigger:s=!0}=e,d=td(e,["className","children","side","align","sideOffset","alignItemWithTrigger"]);let c=(0,ts.O)(),{container:u,className:p}=c,h=td(c,["container","className"]);return(0,r.jsx)(ew,{container:u,children:(0,r.jsx)(e_,{side:a,align:o,sideOffset:l,alignItemWithTrigger:s,positionMethod:"fixed",className:"pn:z-50",children:(0,r.jsxs)(eZ,Object.assign({ref:t,"data-slot":"select-content","data-align-trigger":s},h,{className:(0,tl.cn)(p,"pn:relative pn:z-50 max-h-(--available-height) pn:min-w-[8rem] origin-(--transform-origin) pn:overflow-x-hidden pn:overflow-y-auto pn:rounded-md pn:border pn:bg-popover pn:text-popover-foreground pn:shadow-md pn:data-[align-trigger=true]:animate-none pn:data-[side=bottom]:slide-in-from-top-2 pn:data-[side=left]:slide-in-from-right-2 pn:data-[side=right]:slide-in-from-left-2 pn:data-[side=top]:slide-in-from-bottom-2 pn:data-[closed]:animate-out pn:data-[closed]:fade-out-0 pn:data-[closed]:zoom-out-95 pn:data-[open]:animate-in pn:data-[open]:fade-in-0 pn:data-[open]:zoom-in-95",n)},d,{children:[(0,r.jsx)(tf,{}),(0,r.jsx)(e2,{className:"pn:p-1",children:i}),(0,r.jsx)(tg,{})]}))})})});th.displayName="SelectContent",i.forwardRef((e,t)=>{var{className:n}=e,i=td(e,["className"]);return(0,r.jsx)(e3,Object.assign({ref:t,"data-slot":"select-label",className:(0,tl.cn)("pn:px-2 pn:py-1.5 pn:text-xs pn:text-muted-foreground",n)},i))}).displayName="SelectLabel";let tm=i.forwardRef((e,t)=>{var{className:n,children:i}=e,a=td(e,["className","children"]);return(0,r.jsxs)(e9,Object.assign({ref:t,"data-slot":"select-item",className:(0,tl.cn)("pn:relative pn:flex pn:w-full pn:cursor-default pn:items-center pn:gap-2 pn:rounded-sm pn:py-1.5 pn:pr-8 pn:pl-2 pn:text-sm pn:outline-hidden pn:select-none pn:data-highlighted:bg-accent pn:data-highlighted:text-accent-foreground pn:data-[disabled]:pointer-events-none pn:data-[disabled]:opacity-50 pn:[&_svg]:pointer-events-none pn:[&_svg]:shrink-0 pn:[&_svg:not([class*='size-'])]:size-4 pn:[&_svg:not([class*='text-'])]:text-muted-foreground pn:*:[span]:last:flex pn:*:[span]:last:items-center pn:*:[span]:last:gap-2",n)},a,{children:[(0,r.jsx)("span",{"data-slot":"select-item-indicator",className:"pn:absolute pn:right-2 pn:flex pn:size-3.5 pn:items-center pn:justify-center",children:(0,r.jsx)(te,{children:(0,r.jsx)(o.A,{className:"pn:size-4"})})}),(0,r.jsx)(tn,{children:i})]}))});tm.displayName="SelectItem",i.forwardRef((e,t)=>{var{className:n}=e,i=td(e,["className"]);return(0,r.jsx)(tr,Object.assign({ref:t,"data-slot":"select-separator",className:(0,tl.cn)("pn:pointer-events-none pn:-mx-1 pn:my-1 pn:h-px pn:bg-border",n)},i))}).displayName="SelectSeparator";let tf=i.forwardRef((e,t)=>{var{className:n}=e,i=td(e,["className"]);return(0,r.jsx)(ta,Object.assign({ref:t,"data-slot":"select-scroll-up-button",className:(0,tl.cn)("pn:flex pn:cursor-default pn:items-center pn:justify-center pn:py-1",n)},i,{children:(0,r.jsx)(l.A,{className:"pn:size-4"})}))});tf.displayName="SelectScrollUpButton";let tg=i.forwardRef((e,t)=>
28{var{className:n}=e,i=td(e,["className"]);return(0,r.jsx)(to,Object.assign({ref:t,"data-slot":"select-scroll-down-button",className:(0,tl.cn)("pn:flex pn:cursor-default pn:items-center pn:justify-center pn:py-1",n)},i,{children:(0,r.jsx)(a.A,{className:"pn:size-4"})}))});tg.displayName="SelectScrollDownButton"},74054:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]])},74614:(e,t,n)=>{"use strict";n.d(t,{l:()=>u});var r=n(12115),i=n(33593),a=n(98627),o=n(1882),l=n(2066),s=n(99793),d=n(99892),c=n(36499);function u(e={}){let{id:t,implicit:n=!1,controlRef:p}=e,{controlId:h,registerControlId:m}=(0,c.H)(),f=(0,d.e)(t),g=n?h:void 0,x=(0,o.j)(()=>Symbol()),v=r.useRef(!1),b=r.useRef(null!=t),y=(0,a.K)(()=>{v.current&&m!==s.tE&&(v.current=!1,m(x.current,void 0))});return(0,i.g)(()=>{let e;if(m!==s.tE){if(n){let n=p?.current;e=(0,l.vq)(n)&&null!=n.closest("label")?t??null:g??f}else if(null!=t)b.current=!0,e=t;else{if(!b.current)return void y();e=f}if(void 0===e)return void y();v.current=!0,m(x.current,e)}},[t,p,g,m,n,f,x,y]),r.useEffect(()=>y,[y]),h??f}},76551:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Signature",[["path",{d:"m21 17-2.156-1.868A.5.5 0 0 0 18 15.5v.5a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1c0-2.545-3.991-3.97-8.5-4a1 1 0 0 0 0 5c4.153 0 4.745-11.295 5.708-13.5a2.5 2.5 0 1 1 3.31 3.284",key:"y32ogt"}],["path",{d:"M3 21h18",key:"itz85i"}]])},77262:(e,t,n)=>{"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(null,arguments)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){var r,i;r=t,i=n[t],(r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(r))in e?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}n.r(t),n.d(t,{MultiDrag:()=>td,Sortable:()=>e$,Swap:()=>e8,default:()=>tp});var d=s(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),c=s(/Edge/i),u=s(/firefox/i),p=s(/safari/i)&&!s(/chrome/i)&&!s(/android/i),h=s(/iP(ad|od|hone)/i),m=s(/chrome/i)&&s(/android/i),f={capture:!1,passive:!1};function g(e,t,n){e.addEventListener(t,n,!d&&f)}function x(e,t,n){e.removeEventListener(t,n,!d&&f)}function v(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){}return!1}}function b(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function y(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&v(e,t):v(e,t))||r&&e===n)return e;if(e===n)break}while(e=b(e))}return null}var w=/\s+/g;function j(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(w," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(w," ")}}
28function k(e,t,n){var r=e&&e.style;if(r)if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];else t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}function C(e,t){var n="";if("string"==typeof e)n=e;else do{var r=k(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function E(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function S(){var e=document.scrollingElement;return e||document.documentElement}function P(e,t,n,r,i){if(e.getBoundingClientRect||e===window){if(e!==window&&e.parentNode&&e!==S()?(o=(a=e.getBoundingClientRect()).top,l=a.left,s=a.bottom,c=a.right,u=a.height,p=a.width):(o=0,l=0,s=window.innerHeight,c=window.innerWidth,u=window.innerHeight,p=window.innerWidth),(t||n)&&e!==window&&(i=i||e.parentNode,!d))do if(i&&i.getBoundingClientRect&&("none"!==k(i,"transform")||n&&"static"!==k(i,"position"))){var a,o,l,s,c,u,p,h=i.getBoundingClientRect();o-=h.top+parseInt(k(i,"border-top-width")),l-=h.left+parseInt(k(i,"border-left-width")),s=o+a.height,c=l+a.width;break}while(i=i.parentNode);if(r&&e!==window){var m=C(i||e),f=m&&m.a,g=m&&m.d;m&&(o/=g,l/=f,p/=f,u/=g,s=o+u,c=l+p)}return{top:o,left:l,bottom:s,right:c,width:p,height:u}}}function N(e,t,n){for(var r=R(e,!0),i=P(e)[t];r;){var a=P(r)[n];if(!("top"===n||"left"===n?i>=a:i<=a))return r;if(r===S())break;r=R(r,!1)}return!1}function A(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if("none"!==o[a].style.display&&o[a]!==e$.ghost&&(r||o[a]!==e$.dragged)&&y(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function M(e,t){for(var n=e.lastElementChild;n&&(n===e$.ghost||"none"===k(n,"display")||t&&!v(n,t));)n=n.previousElementSibling;return n||null}function O(e,t){var n=0;if(!e||!e.parentNode)return -1;for(;e=e.previousElementSibling;)"TEMPLATE"!==e.nodeName.toUpperCase()&&e!==e$.clone&&(!t||v(e,t))&&n++;return n}function T(e){var t=0,n=0,r=S();if(e)do{var i=C(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function R(e,t){if(!e||!e.getBoundingClientRect)return S();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=k(n);if(n.clientWidth<n.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!n.getBoundingClientRect||n===document.body)return S();if(r||t)return n;r=!0}}while(n=n.parentNode);return S()}function _(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function z(e,t){return function(){if(!Y){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),Y=setTimeout(function(){Y=void 0},t)}}}function I(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function D(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function F(e,t){k(e,"position","absolute"),k(e,"top",t.top),k(e,"left",t.left),k(e,"width",t.width),k(e,"height",t.height)}function L(e){k(e,"position",""),k(e,"top",""),k(e,"left",""),k(e,"width",""),k(e,"height","")}function B(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(y(i,t.draggable,e,!1)&&!i.animated&&i!==n){var a,o,l,s,d=P(i);r.left=Math.min(null!=(a=r.left)?a:1/0,d.left),r.top=Math.min(null!=(o=r.top)?o:1/0,d.top),r.right=Math.max(null!=(l=r.right)?l:-1/0,d.right),r.bottom=Math.max(null!=(s=r.bottom)?s:-1/0,d.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var $="Sortable"+new Date().getTime(),W=[],V={initializeByDefault:!0},H={mount:function(e){for(var t in V)!V.hasOwnProperty(t)||t in e||(e[t]=V[t]);W.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}
vendor: 8,962 bytes, line 28
28),W.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+"Global";W.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](o({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](o({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var a in W.forEach(function(r){var a=r.pluginName;if(e.options[a]||r.initializeByDefault){var o=new r(e,t,e.options);o.sortable=e,o.options=e.options,e[a]=o,i(n,o.defaults)}}),e.options)if(e.options.hasOwnProperty(a)){var o=this.modifyOption(e,a,e.options[a]);void 0!==o&&(e.options[a]=o)}},getEventProperties:function(e,t){var n={};return W.forEach(function(r){"function"==typeof r.eventProperties&&i(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return W.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function q(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,l=e.toEl,s=e.fromEl,u=e.oldIndex,p=e.newIndex,h=e.oldDraggableIndex,m=e.newDraggableIndex,f=e.originalEvent,g=e.putSortable,x=e.extraEventProperties;if(t=t||n&&n[$]){var v,b=t.options,y="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||d||c?(v=document.createEvent("Event")).initEvent(r,!0,!0):v=new CustomEvent(r,{bubbles:!0,cancelable:!0}),v.to=l||n,v.from=s||n,v.item=i||n,v.clone=a,v.oldIndex=u,v.newIndex=p,v.oldDraggableIndex=h,v.newDraggableIndex=m,v.originalEvent=f,v.pullMode=g?g.lastPutMode:void 0;var w=o(o({},x),H.getEventProperties(r,t));for(var j in w)v[j]=w[j];n&&n.dispatchEvent(v),b[y]&&b[y].call(t,v)}}var K=["evt"],U=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,i=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&({}).propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(n,K);H.pluginEvent.bind(e$)(e,t,o({dragEl:Z,parentEl:G,ghostEl:Q,rootEl:J,nextEl:ee,lastDownEl:et,cloneEl:en,cloneHidden:er,dragStarted:eg,putSortable:ed,activeSortable:e$.active,originalEvent:r,oldIndex:ei,oldDraggableIndex:eo,newIndex:ea,newDraggableIndex:el,hideGhostForTarget:eD,unhideGhostForTarget:eF,cloneNowHidden:function(){er=!0},cloneNowShown:function(){er=!1},dispatchSortableEvent:function(e){X({sortable:t,name:e,originalEvent:r})}},i))};function X(e){q(o({putSortable:ed,cloneEl:en,targetEl:Z,rootEl:J,oldIndex:ei,oldDraggableIndex:eo,newIndex:ea,newDraggableIndex:el},e))}var Y,Z,G,Q,J,ee,et,en,er,ei,ea,eo,el,es,ed,ec,eu,ep,eh,em,ef,eg,ex,ev,eb,ey,ew=!1,ej=!1,ek=[],eC=!1,eE=!1,eS=[],eP=!1,eN=[],eA="undefined"!=typeof document,eM=c||d?"cssFloat":"float",eO=eA&&!m&&!h&&"draggable"in document.createElement("div"),eT=function(){if(eA){if(d)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),eR=function(e,t){var n=k(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=A(e,0,t),a=A(e,1,t),o=i&&k(i),l=a&&k(a),s=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+P(i).width,d=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+P(a).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&o.float&&"none"!==o.float){var c="left"===o.float?"left":"right";return a&&("both"===l.clear||l.clear===c)?"vertical":"horizontal"}return i&&("block"===o.display||"flex"===o.display||"table"===o.display||"grid"===o.display||s>=r&&"none"===n[eM]||a&&"none"===n[eM]&&s+d>r)?"vertical":"horizontal"},e_=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,l=n?t.right:t.bottom,s=n?t.width:t.height;return r===o||i===l||r+a/2===o+s/2},ez=function(e,t){var n;return ek.some(function(r){var i=r[$].options.emptyInsertThreshold;if(!(!i||M(r))){var a=P(r),o=e>=a.left-i&&e<=a.right+i,l=t>=a.top-i&&t<=a.bottom+i;if(o&&l)return n=r}}),n},eI=function(e){function t(e,n){return function(r,i,a,o){var l=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(null==e&&(n||l))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,i,a,o),n)(r,i,a,o);var s=(n?r:i).options.group.name;return!0===e||"string"==typeof e&&e===s||e.join&&e.indexOf(s)>-1}}var n={},r=e.group;r&&"object"==l(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},eD=function(){!eT&&Q&&k(Q,"display","none")},eF=function(){!eT&&Q&&k(Q,"display","")};eA&&!m&&document.addEventListener("click",function(e){if(ej)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),ej=!1,!1},!0);var eL=function(e){if(Z){var t=ez((e=e.touches?e.touches[0]:e).clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[$]._onDragOver(n)}}},eB=function(e){Z&&Z.parentNode[$]._isOutsideThisEl(e.target)};function e$(e,t){if(!(e&&e.nodeType&&1===e.nodeType))throw"Sortable: `el` must be an HTMLElement, not ".concat(({}).toString.call(e));this.el=e,this.options=t=i({},t),e[$]=this;var n,r,a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return eR(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==e$.supportPointer&&"PointerEvent"in window&&(!p||h),emptyInsertThreshold:5};for(var l in H.initializePlugins(this,e,a),a)l in t||(t[l]=a[l]);for(var s in eI(t),this)"_"===s.charAt(0)&&"function"==typeof this[s]&&(this[s]=this[s].bind(this));this.nativeDraggable=!t.forceFallback&&eO,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?g(e,"pointerdown",this._onTapStart):(g(e,"mousedown",this._onTapStart),g(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(g(e,"dragover",this),g(e,"dragenter",this)),ek.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),i(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==k(e,"display")&&e!==e$.ghost){r.push({target:e,rect:P(e)});var t=o({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=C(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return -1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation){clearTimeout(n),"function"==typeof e&&e();return}var i=!1,a=0;r.forEach(function(e){var n,r,o,l,s=0,d=e.target,c=d.fromRect,u=P(d),p=d.prevFromRect,h=d.prevToRect,m=e.rect,f=C(d,!0);f&&(u.top-=f.f,u.left-=f.e),d.toRect=u,d.thisAnimationDuration&&_(p,u)&&!_(c,u)&&(m.top-u.top)/(m.left-u.left)==(c.top-u.top)/(c.left-u.left)&&(n=m,r=p,o=h,l=t.options,s=Math.sqrt(Math.pow(r.top-n.top,2)+Math.pow(r.left-n.left,2))/Math.sqrt(Math.pow(r.top-o.top,2)+Math.pow(r.left-o.left,2))*l.animation),_(u,c)||(d.prevFromRect=c,d.prevToRect=u,s||(s=t.options.animation),t.animate(d,m,u,s)),s&&(i=!0,a=Math.max(a,s),clearTimeout(d.animationResetTimer),d.animationResetTimer=setTimeout(function(){d.animationTime=0,d.prevFromRect=null,d.fromRect=null,d.prevToRect=null,d.thisAnimationDuration=null},s),d.thisAnimationDuration=s)}),clearTimeout(n),i?n=setTimeout(function(){"function"==typeof e&&e()},a):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){k(e,"transition",""),k(e,"transform","");var i=C(this.el),a=i&&i.a,o=i&&i.d,l=(t.left-n.left)/(a||1),s=(t.top-n.top)/(o||1);e.animatingX=!!l,e.animatingY=!!s,k(e,"transform","translate3d("+l+"px,"+s+"px,0)"),this.forRepaintDummy=e.offsetWidth,k(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),k(e,"transform","translate3d(0,
280,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){k(e,"transition",""),k(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function eW(e,t,n,r,i,a,o,l){var s,u,p=e[$],h=p.options.onMove;return!window.CustomEvent||d||c?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=t,s.from=e,s.dragged=n,s.draggedRect=r,s.related=i||t,s.relatedRect=a||P(t),s.willInsertAfter=l,s.originalEvent=o,e.dispatchEvent(s),h&&(u=h.call(p,s,o)),u}function eV(e){e.draggable=!1}function eH(){eP=!1}function eq(e){return setTimeout(e,0)}function eK(e){return clearTimeout(e)}e$.prototype={constructor:e$,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(ex=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(o||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,d=r.filter;if(function(e){eN.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&eN.push(r)}}(n),!(Z||/mousedown|pointerdown/.test(a)&&0!==e.button||r.disabled||s.isContentEditable||!this.nativeDraggable&&p&&l&&"SELECT"===l.tagName.toUpperCase()||(l=y(l,r.draggable,n,!1))&&l.animated)&&et!==l){if(ei=O(l),eo=O(l,r.draggable),"function"==typeof d){if(d.call(this,e,l,this)){X({sortable:t,rootEl:s,name:"filter",targetEl:l,toEl:n,fromEl:n}),U("filter",t,{evt:e}),i&&e.preventDefault();return}}else if(d&&(d=d.split(",").some(function(r){if(r=y(s,r.trim(),n,!1))return X({sortable:t,rootEl:r,name:"filter",targetEl:l,fromEl:n,toEl:n}),U("filter",t,{evt:e}),!0}))){i&&e.preventDefault();return}(!r.handle||y(s,r.handle,n,!1))&&this._prepareDragStart(e,o,l)}}},_prepareDragStart:function(e,t,n){var r,i=this,a=i.el,o=i.options,l=a.ownerDocument;if(n&&!Z&&n.parentNode===a){var s=P(n);if(J=a,G=(Z=n).parentNode,ee=Z.nextSibling,et=n,es=o.group,e$.dragged=Z,em=(ec={target:Z,clientX:(t||e).clientX,clientY:(t||e).clientY}).clientX-s.left,ef=ec.clientY-s.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Z.style["will-change"]="all",r=function(){if(U("delayEnded",i,{evt:e}),e$.eventCanceled)return void i._onDrop();i._disableDelayedDragEvents(),!u&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(e,t),X({sortable:i,name:"choose",originalEvent:e}),j(Z,o.chosenClass,!0)},o.ignore.split(",").forEach(function(e){E(Z,e.trim(),eV)}),g(l,"dragover",eL),g(l,"mousemove",eL),g(l,"touchmove",eL),o.supportPointer?(g
vendor: 5,409 bytes, line 28
28(l,"pointerup",i._onDrop),this.nativeDraggable||g(l,"pointercancel",i._onDrop)):(g(l,"mouseup",i._onDrop),g(l,"touchend",i._onDrop),g(l,"touchcancel",i._onDrop)),u&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:e}),!o.delay||o.delayOnTouchOnly&&!t||this.nativeDraggable&&(c||d))r();else{if(e$.eventCanceled)return void this._onDrop();o.supportPointer?(g(l,"pointerup",i._disableDelayedDrag),g(l,"pointercancel",i._disableDelayedDrag)):(g(l,"mouseup",i._disableDelayedDrag),g(l,"touchend",i._disableDelayedDrag),g(l,"touchcancel",i._disableDelayedDrag)),g(l,"mousemove",i._delayedDragTouchMoveHandler),g(l,"touchmove",i._delayedDragTouchMoveHandler),o.supportPointer&&g(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(r,o.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&eV(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;x(e,"mouseup",this._disableDelayedDrag),x(e,"touchend",this._disableDelayedDrag),x(e,"touchcancel",this._disableDelayedDrag),x(e,"pointerup",this._disableDelayedDrag),x(e,"pointercancel",this._disableDelayedDrag),x(e,"mousemove",this._delayedDragTouchMoveHandler),x(e,"touchmove",this._delayedDragTouchMoveHandler),x(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?g(document,"pointermove",this._onTouchMove):t?g(document,"touchmove",this._onTouchMove):g(document,"mousemove",this._onTouchMove):(g(Z,"dragend",this),g(J,"dragstart",this._onDragStart));try{document.selection?eq(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(ew=!1,J&&Z){U("dragStarted",this,{evt:t}),this.nativeDraggable&&g(document,"dragover",eB);var n=this.options;e||j(Z,n.dragClass,!1),j(Z,n.ghostClass,!0),e$.active=this,e&&this._appendGhost(),X({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(eu){this._lastX=eu.clientX,this._lastY=eu.clientY,eD();for(var e=document.elementFromPoint(eu.clientX,eu.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(eu.clientX,eu.clientY))!==t;)t=e;if(Z.parentNode[$]._isOutsideThisEl(e),t)do{if(t[$]&&t[$]._onDragOver({clientX:eu.clientX,clientY:eu.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=b(t));eF()}},_onTouchMove:function(e){if(ec){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=Q&&C(Q,!0),o=Q&&a&&a.a,l=Q&&a&&a.d,s=h&&ey&&T(ey),d=(i.clientX-ec.clientX+r.x)/(o||1)+(s?s[0]-eS[0]:0)/(o||1),c=(i.clientY-ec.clientY+r.y)/(l||1)+(s?s[1]-eS[1]:0)/(l||1);if(!e$.active&&!ew){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(Q){a?(a.e+=d-(ep||0),a.f+=c-(eh||0)):a={a:1,b:0,c:0,d:1,e:d,f:c};var u="matrix(".concat(a.a,",").concat(a.b,",").concat(a.c,",").concat(a.d,",").concat(a.e,",").concat(a.f,")");k(Q,"webkitTransform",u),k(Q,"mozTransform",u),k(Q,"msTransform",u),k(Q,"transform",u),ep=d,eh=c,eu=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Q){var e=this.options.fallbackOnBody?document.body:J,t=P(Z,!0,h,!0,e),n=this.options;if(h){for(ey=e;"static"===k(ey,"position")&&"none"===k(ey,"transform")&&ey!==document;)ey=ey.parentNode;ey!==document.body&&ey!==document.documentElement?(ey===document&&(ey=S()),t.top+=ey.scrollTop,t.left+=ey.scrollLeft):ey=S(),eS=T(ey)}j(Q=Z.cloneNode(!0),n.ghostClass,!1),j(Q,n.fallbackClass,!0),j(Q,n.dragClass,!0),k(Q,"transition",""),k(Q,"transform",""),k(Q,"box-sizing","border-box"),k(Q,"margin",0),k(Q,"top",t.top),k(Q,"left",t.left),k(Q,"width",t.width),k(Q,"height",t.height),k(Q,"opacity","0.8"),k(Q,"position",h?"absolute":"fixed"),k(Q,"zIndex","100000"),k(Q,"pointerEvents","none"),e$.ghost=Q,e.appendChild(Q),k(Q,"transform-origin",em/parseInt(Q.style.width)*100+"% "+ef/parseInt(Q.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(U("dragStart",this,{evt:e}),e$.eventCanceled)return void this._onDrop();U("setupClone",this),e$.eventCanceled||((en=D(Z)).removeAttribute("id"),en.draggable=!1,en.style["will-change"]="",this._hideClone(),j(en,this.options.chosenClass,!1),e$.clone=en),n.cloneId=eq(function(){U("clone",n),e$.eventCanceled||(n.options.removeCloneOnHide||J.insertBefore(en,Z),n._hideClone(),X({sortable:n,name:"clone"}))}),t||j(Z,i.dragClass,!0),t?(ej=!0,n._loopId=setInterval(n._emulateDragOver,50)):(x(document,"mouseup",n._onDrop),x(document,"touchend",n._onDrop),x(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",i.setData&&i.setData.call(n,r,Z)),g(document,"drop",n),k(Z,"transform","translateZ(0)")),ew=!0,n._dragStartId=eq(n._dragStarted.bind(n,t,e)),g(document,"selectstart",n),eg=!0,window.getSelection().removeAllRanges(),p&&k(document.body,"user-select","none")},_onDragOver:function(e){var t,n,r,i,a=this.el,l=e.target,s=this.options,d=s.group,c=e$.active,u=es===d,p=s.sort,h=ed||c,m=this,f=!1;
28if(!eP){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),l=y(l,s.draggable,a,!0),ei("dragOver"),e$.eventCanceled)return f;if(Z.contains(e.target)||l.animated&&l.animatingX&&l.animatingY||m._ignoreWhileAnimating===l)return ec(!1);if(ej=!1,c&&!s.disabled&&(u?p||(r=G!==J):ed===this||(this.lastPutMode=es.checkPull(this,c,Z,e))&&d.checkPut(this,c,Z,e))){if(i="vertical"===this._getDirection(e,l),t=P(Z),ei("dragOverValid"),e$.eventCanceled)return f;if(r)return G=J,eo(),this._hideClone(),ei("revert"),e$.eventCanceled||(ee?J.insertBefore(Z,ee):J.appendChild(Z)),ec(!0);var g=M(a,s.draggable);if(!g||(v=e,b=i,w=this,C=P(M(w.el,w.options.draggable)),E=B(w.el,w.options,Q),(b?v.clientX>E.right+10||v.clientY>C.bottom&&v.clientX>C.left:v.clientY>E.bottom+10||v.clientX>C.right&&v.clientY>C.top)&&!g.animated)){if(g===Z)return ec(!1);if(g&&a===e.target&&(l=g),l&&(n=P(l)),!1!==eW(J,a,Z,t,l,n,e,!!l))return eo(),g&&g.nextSibling?a.insertBefore(Z,g.nextSibling):a.appendChild(Z),G=a,eu(),ec(!0)}else if(g&&(S=e,T=i,R=this,_=P(A(R.el,0,R.options,!0)),z=B(R.el,R.options,Q),T?S.clientX<z.left-10||S.clientY<_.top&&S.clientX<_.right:S.clientY<z.top-10||S.clientY<_.bottom&&S.clientX<_.left)){var x=A(a,0,s,!0);if(x===Z)return ec(!1);if(n=P(l=x),!1!==eW(J,a,Z,t,l,n,e,!1))return eo(),a.insertBefore(Z,x),G=a,eu(),ec(!0)}else if(l.parentNode===a){n=P(l);var v,b,w,C,E,S,T,R,_,z,D,F,L=0,W=Z.parentNode!==a,V=!e_(Z.animated&&Z.toRect||t,l.animated&&l.toRect||n,i),H=i?"top":"left",q=N(l,"top","top")||N(Z,"top","top"),K=q?q.scrollTop:void 0;if(ex!==l&&(F=n[H],eC=!1,eE=!V&&s.invertSwap||W),0!==(L=function(e,t,n,r,i,a,o,l){var s,d=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,p=r?n.bottom:n.right,h=!1;if(!o){if(l&&eb<c*i){if(!eC&&(1===ev?d>u+c*a/2:d<p-c*a/2)&&(eC=!0),eC)h=!0;else if(1===ev?d<u+eb:d>p-eb)return-ev}else if(d>u+c*(1-i)/2&&d<p-c*(1-i)/2){return s=t,O(Z)<O(s)?1:-1}}return(h=h||o)&&(d<u+c*a/2||d>p-c*a/2)?d>u+c/2?1:-1:0}(e,l,n,i,V?1:s.swapThreshold,null==s.invertedSwapThreshold?s.swapThreshold:s.invertedSwapThreshold,eE,ex===l))){var Y=O(Z);do Y-=L,D=G.children[Y];while(D&&("none"===k(D,"display")||D===Q))}if(0===L||D===l)return ec(!1);ex=l,ev=L;var et=l.nextElementSibling,en=!1,er=eW(J,a,Z,t,l,n,e,en=1===L);if(!1!==er)return(1===er||-1===er)&&(en=1===er),eP=!0,setTimeout(eH,30),eo(),en&&!et?a.appendChild(Z):l.parentNode.insertBefore(Z,en?et:l),q&&I(q,0,K-q.scrollTop),G=Z.parentNode,void 0===F||eE||(eb=Math.abs(F-P(l)[H])),eu(),ec(!0)}if(a.contains(Z))return ec(!1)}return!1}function ei(s,d){U(s,m,o({evt:e,isOwner:u,axis:i?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:p,fromSortable:h,target:l,completed:ec,onMove:function(n,r){return eW(J,a,Z,t,n,P(n),e,r)},changed:eu},d))}function eo(){ei("dragOverAnimationCapture"),m.captureAnimationState(),m!==h&&h.captureAnimationState()}function ec(t){return ei("dragOverCompleted",{insertion:t}),t&&(u?c._hideClone():c._showClone(m),m!==h&&(j(Z,ed?ed.options.ghostClass:c.options.ghostClass,!1),j(Z,s.ghostClass,!0)),ed!==m&&m!==e$.active?ed=m:m===e$.active&&ed&&(ed=null),h===m&&(m._ignoreWhileAnimating=l),m.animateAll(function(){ei("dragOverAnimationComplete"),m._ignoreWhileAnimating=null}),m!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(l!==Z||Z.animated)&&(l!==a||l.animated)||(ex=null),s.dragoverBubble||e.rootEl||l===document||(Z.parentNode[$]._isOutsideThisEl(e.target),t||eL(e)),!s.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),f=!0}function eu(){ea=O(Z),el=O(Z,s.draggable),X({sortable:m,name:"change",toEl:a,newIndex:ea,newDraggableIndex:el,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){x(document,"mousemove",this._onTouchMove),x(document,"touchmove",this._onTouchMove),x(document,"pointermove",this._onTouchMove),x(document,"dragover",eL),x(document,"mousemove",eL),x(document,"touchmove",eL)},_offUpEvents:function(){var e=this.el.ownerDocument;x(e,"mouseup",this._onDrop),x(e,"touchend",this._onDrop),x(e,"pointerup",this._onDrop),x(e,"pointercancel",this._onDrop),x(e,"touchcancel",this._onDrop),x(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;if(ea=O(Z),el=O(Z,n.draggable),U("drop",this,{evt:e}),G=Z&&Z.parentNode,ea=O(Z),el=O(Z,n.draggable),e$.eventCanceled)return void this._nulling(
28);ew=!1,eE=!1,eC=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),eK(this.cloneId),eK(this._dragStartId),this.nativeDraggable&&(x(document,"drop",this),x(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),p&&k(document.body,"user-select",""),k(Z,"transform",""),e&&(eg&&(e.cancelable&&e.preventDefault(),n.dropBubble||e.stopPropagation()),Q&&Q.parentNode&&Q.parentNode.removeChild(Q),(J===G||ed&&"clone"!==ed.lastPutMode)&&en&&en.parentNode&&en.parentNode.removeChild(en),Z&&(this.nativeDraggable&&x(Z,"dragend",this),eV(Z),Z.style["will-change"]="",eg&&!ew&&j(Z,ed?ed.options.ghostClass:this.options.ghostClass,!1),j(Z,this.options.chosenClass,!1),X({sortable:this,name:"unchoose",toEl:G,newIndex:null,newDraggableIndex:null,originalEvent:e}),J!==G?(ea>=0&&(X({rootEl:G,name:"add",toEl:G,fromEl:J,originalEvent:e}),X({sortable:this,name:"remove",toEl:G,originalEvent:e}),X({rootEl:G,name:"sort",toEl:G,fromEl:J,originalEvent:e}),X({sortable:this,name:"sort",toEl:G,originalEvent:e})),ed&&ed.save()):ea!==ei&&ea>=0&&(X({sortable:this,name:"update",toEl:G,originalEvent:e}),X({sortable:this,name:"sort",toEl:G,originalEvent:e})),e$.active&&((null==ea||-1===ea)&&(ea=ei,el=eo),X({sortable:this,name:"end",toEl:G,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){U("nulling",this),J=Z=G=Q=ee=en=et=er=ec=eu=eg=ea=el=ei=eo=ex=ev=ed=es=e$.dragged=e$.ghost=e$.clone=e$.active=null;var e=this.el;eN.forEach(function(t){e.contains(t)&&(t.checked=!0)}),eN.length=ep=eh=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":var t;Z&&(this._onDragOver(e),(t=e).dataTransfer&&(t.dataTransfer.dropEffect="move"),t.cancelable&&t.preventDefault());break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)y(e=n[r],a.draggable,this.el,!1)&&t.push(e.getAttribute(a.dataIdAttr)||function(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];y(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return y(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=H.modifyOption(this,e,t);void 0!==r?n[e]=r:n[e]=t,"group"===e&&eI(n)},destroy:function(){U("destroy",this);var e=this.el;e[$]=null,x(e,"mousedown",this._onTapStart),x(e,"touchstart",this._onTapStart),x(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(x(e,"dragover",this),x(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ek.splice(ek.indexOf(this.el),1),this.el=null},_hideClone:function(){!er&&(U("hideClone",this),e$.eventCanceled||(k(en,"display","none"),this.options.removeCloneOnHide&&en.parentNode&&en.parentNode.removeChild(en),er=!0))},_showClone:function(e){if("clone"!==e.lastPutMode)return void this._hideClone();if(er){if(U("showClone",this),e$.eventCanceled)return;Z.parentNode!=J||this.options.group.revertClone?ee?J.insertBefore(en,ee):J.appendChild(en):J.insertBefore(en,Z),this.options.group.revertClone&&this.animate(Z,en),k(en,"display",""),er=!1}}},eA&&g(document,"touchmove",function(e){(e$.active||ew)&&e.cancelable&&e.preventDefault()}),e$.utils={on:g,off:x,css:k,find:E,is:function(e,t){return!!y(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:z,closest:y,toggleClass:j,clone:D,index:O,nextTick:eq,cancelNextTick:eK,detectDirection:eR,getChild:A,expando:$},e$.get=function(e){return e[$]},e$.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat(({}).toString.call(e));e.utils&&(e$.utils=o(o({}
28,e$.utils),e.utils)),H.mount(e)})},e$.create=function(e,t){return new e$(e,t)},e$.version="1.15.7";var eU,eX,eY,eZ,eG,eQ,eJ=[],e0=!1;function e1(){eJ.forEach(function(e){clearInterval(e.pid)}),eJ=[]}function e2(){clearInterval(eQ)}var e5=z(function(e,t,n,r){if(t.scroll){var i,a=(e.touches?e.touches[0]:e).clientX,o=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,s=t.scrollSpeed,d=S(),c=!1;eX!==n&&(eX=n,e1(),eU=t.scroll,i=t.scrollFn,!0===eU&&(eU=R(n,!0)));var u=0,p=eU;do{var h=p,m=P(h),f=m.top,g=m.bottom,x=m.left,v=m.right,b=m.width,y=m.height,w=void 0,j=void 0,C=h.scrollWidth,E=h.scrollHeight,N=k(h),A=h.scrollLeft,M=h.scrollTop;h===d?(w=b<C&&("auto"===N.overflowX||"scroll"===N.overflowX||"visible"===N.overflowX),j=y<E&&("auto"===N.overflowY||"scroll"===N.overflowY||"visible"===N.overflowY)):(w=b<C&&("auto"===N.overflowX||"scroll"===N.overflowX),j=y<E&&("auto"===N.overflowY||"scroll"===N.overflowY));var O=w&&(Math.abs(v-a)<=l&&A+b<C)-(Math.abs(x-a)<=l&&!!A),T=j&&(Math.abs(g-o)<=l&&M+y<E)-(Math.abs(f-o)<=l&&!!M);if(!eJ[u])for(var _=0;_<=u;_++)eJ[_]||(eJ[_]={});(eJ[u].vx!=O||eJ[u].vy!=T||eJ[u].el!==h)&&(eJ[u].el=h,eJ[u].vx=O,eJ[u].vy=T,clearInterval(eJ[u].pid),(0!=O||0!=T)&&(c=!0,eJ[u].pid=setInterval((function(){r&&0===this.layer&&e$.active._onTouchMove(eG);var t=eJ[this.layer].vy?eJ[this.layer].vy*s:0,n=eJ[this.layer].vx?eJ[this.layer].vx*s:0;("function"!=typeof i||"continue"===i.call(e$.dragged.parentNode[$],n,t,e,eG,eJ[this.layer].el))&&I(eJ[this.layer].el,n,t)}).bind({layer:u}),24))),u++}while(t.bubbleScroll&&p!==d&&(p=R(p,!1)));e0=c}},30),e3=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var s=n||i;o();var d=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,c=document.elementFromPoint(d.clientX,d.clientY);l(),s&&!s.el.contains(c)&&(a("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function e4(){}function e7(){}function e8(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){e6=e.dragEl},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,i=e.activeSortable,a=e.changed,o=e.cancel;if(i.options.swap){var l=this.sortable.el,s=this.options;if(n&&n!==l){var d=e6;!1!==r(n)?(j(n,s.swapClass,!0),e6=n):e6=null,d&&d!==e6&&j(d,s.swapClass,!1)}a(),t(!0),o()}},drop:function(e){var t,n,r,i,a,o,l=e.activeSortable,s=e.putSortable,d=e.dragEl,c=s||this.sortable,u=this.options;e6&&j(e6,u.swapClass,!1),e6&&(u.swap||s&&s.options.swap)&&d!==e6&&(c.captureAnimationState(),c!==l&&l.captureAnimationState(),t=d,n=e6,a=t.parentNode,o=n.parentNode,!a||!o||a.isEqualNode(n)||o.isEqualNode(t)||(r=O(t),i=O(n),a.isEqualNode(o)&&r<i&&i++,a.insertBefore(n,a.children[r]),o.insertBefore(t,o.children[i])),c.animateAll(),c!==l&&l.animateAll())},nulling:function(){e6=null}},i(e,{pluginName:"swap",eventProperties:function(){return{swapItem:e6}}})}e4.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=A(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:e3},i(e4,{pluginName:"revertOnSpill"}),e7.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:e3},i(e7,{pluginName:"removeOnSpill"});var e6,e9,te,tt,tn,tr,ti=[],ta=[],to=!1,tl=!1,ts=!1;function td(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.avoidImplicitDeselect||(e.options.supportPointer?g(document,"pointerup",this._deselectMultiDrag):(g(document,"mouseup",this._deselectMultiDrag),g(document,"touchend",this._deselectMultiDrag))),g(document,"keydown",this._checkKeyDown),g(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,avoidImplicitDeselect:!1,setData:function(t,n){var r="";
vendor: 4,235 bytes, line 28
28ti.length&&te===e?ti.forEach(function(e,t){r+=(t?", ":"")+e.textContent}):r=n.textContent,t.setData("Text",r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){tt=e.dragEl},delayEnded:function(){this.isMultiDrag=~ti.indexOf(tt)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<ti.length;r++)ta.push(D(ti[r])),ta[r].sortableIndex=ti[r].sortableIndex,ta[r].draggable=!1,ta[r].style["will-change"]="",j(ta[r],this.options.selectedClass,!1),ti[r]===tt&&j(ta[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,i=e.cancel;this.isMultiDrag&&!this.options.removeCloneOnHide&&ti.length&&te===t&&(tc(!0,n),r("clone"),i())},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(tc(!1,n),ta.forEach(function(e){k(e,"display","")}),t(),tr=!1,r())},hideClone:function(e){var t=this;e.sortable;var n=e.cloneNowHidden,r=e.cancel;this.isMultiDrag&&(ta.forEach(function(e){k(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),tr=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&te&&te.multiDrag._deselectMultiDrag(),ti.forEach(function(e){e.sortableIndex=O(e)}),ti=ti.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),ts=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){ti.forEach(function(e){e!==tt&&k(e,"position","absolute")});var r=P(tt,!1,!0,!0);ti.forEach(function(e){e!==tt&&F(e,r)}),tl=!0,to=!0}n.animateAll(function(){tl=!1,to=!1,t.options.animation&&ti.forEach(function(e){L(e)}),t.options.sort&&tu()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;tl&&~ti.indexOf(t)&&(n(!1),r())},revert:function(e){var t,n,r=e.fromSortable,i=e.rootEl,a=e.sortable,o=e.dragRect;ti.length>1&&(ti.forEach(function(e){a.addAnimationState({target:e,rect:tl?P(e):o}),L(e),e.fromRect=o,r.removeAnimationState(e)}),tl=!1,t=!this.options.removeCloneOnHide,n=i,ti.forEach(function(e,r){var i=n.children[e.sortableIndex+(t?Number(r):0)];i?n.insertBefore(e,i):n.appendChild(e)}))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,i=e.activeSortable,a=e.parentEl,o=e.putSortable,l=this.options;if(r){if(n&&i._hideClone(),to=!1,l.animation&&ti.length>1&&(tl||!n&&!i.options.sort&&!o)){var s=P(tt,!1,!0,!0);ti.forEach(function(e){e!==tt&&(F(e,s),a.appendChild(e))}),tl=!0}if(!n)if(tl||tu(),ti.length>1){var d=tr;i._showClone(t),i.options.animation&&!tr&&d&&ta.forEach(function(e){i.addAnimationState({target:e,rect:tn}),e.fromRect=tn,e.thisAnimationDuration=null})}else i._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(ti.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){tn=i({},t);var a=C(tt,!0);tn.top-=a.f,tn.left-=a.e}},dragOverAnimationComplete:function(){tl&&(tl=!1,tu())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,i=e.sortable,a=e.dispatchSortableEvent,o=e.oldIndex,l=e.putSortable,s=l||this.sortable;if(t){var d=this.options,c=r.children;if(!ts)if(d.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),j(tt,d.selectedClass,!~ti.indexOf(tt)),~ti.indexOf(tt))ti.splice(ti.indexOf(tt),1),e9=null,q({sortable:i,rootEl:n,name:"deselect",targetEl:tt,originalEvent:t});else{if(ti.push(tt),q({sortable:i,rootEl:n,name:"select",targetEl:tt,originalEvent:t}),t.shiftKey&&e9&&i.el.contains(e9)){var u=O(e9),p=O(tt);~u&&~p&&u!==p&&function(){p>u?(a=u,e=p):(a=p,e=u+1);for(var e,a,o=d.filter;a<e;a++)!~ti.indexOf(c[a])&&y(c[a],d.draggable,r,!1)&&(o&&("function"==typeof o?o.call(i,t,c[a],i):o.split(",").some(function(e){return y(c[a],e.trim(),r,!1)}))||(j(c[a],d.selectedClass,!0),ti.push(c[a]),q({sortable:i,rootEl:n,name:"select",targetEl:c[a],originalEvent:t})))}()}else e9=tt;te=s}if(ts&&this.isMultiDrag){if(tl=!1,(r[$].options.sort||r!==n)&&ti.length>1){var h=P(tt),m=O(tt,":not(."+this.options.selectedClass+")");if(!to&&d.animation&&(tt.thisAnimationDuration=null),s.captureAnimationState(),!to&&(d.animation&&(tt.fromRect=h,ti.forEac
28h(function(e){if(e.thisAnimationDuration=null,e!==tt){var t=tl?P(e):h;e.fromRect=t,s.addAnimationState({target:e,rect:t})}})),tu(),ti.forEach(function(e){c[m]?r.insertBefore(e,c[m]):r.appendChild(e),m++}),o===O(tt))){var f=!1;ti.forEach(function(e){if(e.sortableIndex!==O(e)){f=!0;return}}),f&&(a("update"),a("sort"))}ti.forEach(function(e){L(e)}),s.animateAll()}te=s}(n===r||l&&"clone"!==l.lastPutMode)&&ta.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=ts=!1,ta.length=0},destroyGlobal:function(){this._deselectMultiDrag(),x(document,"pointerup",this._deselectMultiDrag),x(document,"mouseup",this._deselectMultiDrag),x(document,"touchend",this._deselectMultiDrag),x(document,"keydown",this._checkKeyDown),x(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==ts&&ts||te!==this.sortable||e&&y(e.target,this.options.draggable,this.sortable.el,!1))&&(!e||0===e.button))for(;ti.length;){var t=ti[0];j(t,this.options.selectedClass,!1),ti.shift(),q({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvent:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},i(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[$];!t||!t.options.multiDrag||~ti.indexOf(e)||(te&&te!==t&&(te.multiDrag._deselectMultiDrag(),te=t),j(e,t.options.selectedClass,!0),ti.push(e))},deselect:function(e){var t=e.parentNode[$],n=ti.indexOf(e);t&&t.options.multiDrag&&~n&&(j(e,t.options.selectedClass,!1),ti.splice(n,1))}},eventProperties:function(){var e,t=this,n=[],i=[];return ti.forEach(function(e){var r;n.push({multiDragElement:e,index:e.sortableIndex}),r=tl&&e!==tt?-1:tl?O(e,":not(."+t.options.selectedClass+")"):O(e),i.push({multiDragElement:e,index:r})}),{items:function(e){if(Array.isArray(e))return r(e)}(e=ti)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return r(e,void 0);var n=({}).toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),clones:[].concat(ta),oldIndicies:n,newIndicies:i}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function tc(e,t){ta.forEach(function(n,r){var i=t.children[n.sortableIndex+(e?Number(r):0)];i?t.insertBefore(n,i):t.appendChild(n)})}function tu(){ti.forEach(function(e){e!==tt&&e.parentNode&&e.parentNode.removeChild(e)})}e$.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?g(document,"dragover",this._handleAutoScroll):this.options.supportPointer?g(document,"pointermove",this._handleFallbackAutoScroll):t.touches?g(document,"touchmove",this._handleFallbackAutoScroll):g(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?x(document,"dragover",this._handleAutoScroll):(x(document,"pointermove",this._handleFallbackAutoScroll),x(document,"touchmove",this._handleFallbackAutoScroll),x(document,"mousemove",this._handleFallbackAutoScroll)),e2(),e1(),clearTimeout(Y),Y=void 0},nulling:function(){eG=eX=eU=e0=eQ=eY=eZ=null,eJ.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(eG=e,t||this.options.forceAutoScrollFallback||c||d||p){e5(e,this.options,a,t);var o=R(a,!0);e0&&(!eQ||r!==eY||i!==eZ)&&(eQ&&e2(),eQ=setInterval(function(){var a=R(document.elementFromPoint(r,i),!0);a!==o&&(o=a,e1()),e5(e,n.options,a,t)},10),eY=r,eZ=i)}else{if(!this.options.bubbleScroll||R(a,!0)===S())return void e1();e5(e,this.options,R(a,!1),!1)}}},i(e,{pluginName:"scroll",initializeByDefault:!0})}),e$.mount(e7,e4);let tp=e$}
28,78288:(e,t,n)=>{"use strict";n.d(t,{Lw:()=>r.L}),n(7050),n(80881),n(1842),n(33716),n(37240),n(27337),n(85162),n(46511),n(59963),n(29135),n(27955),n(59103);var r=n(24729);n(90842),n(55228),n(13905),n(67004),n(9635)},80039:(e,t,n)=>{"use strict";n.d(t,{p:()=>k});var r=n(95155),i=n(12115),a=n(6993),o=n(33593),l=n(38919),s=n(98627),d=n(48916),c=n(90845),u=n(31369),p=n(36499),h=n(74614),m=n(62113),f=n(80873),g=n(35836),x=n(39174),v=n(28787);let b=i.forwardRef(function(e,t){let{render:n,className:r,id:b,name:y,value:w,disabled:j=!1,onValueChange:k,defaultValue:C,autoFocus:E=!1,style:S,...P}=e,{state:N,name:A,disabled:M,setTouched:O,setDirty:T,validityData:R,setFocused:_,setFilled:z,validationMode:I,validation:D}=(0,d.V$)(),{clearErrors:F}=(0,u.x)(),L=M||j,B=A??y,$={...N,disabled:L},{labelId:W}=(0,p.H)(),V=(0,h.l)({id:b});(0,o.g)(()=>{let e=null!=w;D.inputRef.current?.value||e&&""!==w?z(!0):e&&""===w&&z(!1)},[D.inputRef,z,w]);let H=i.useRef(null);(0,o.g)(()=>{E&&H.current===(0,v.RS)((0,l.R)(H.current))&&_(!0)},[E,_]);let[q]=(0,a.q)({controlled:w,default:C,name:"FieldControl",state:"value"}),K=void 0!==w,U=K?q:void 0,X=(0,s.K)(()=>D.inputRef.current?.value);return(0,c.I)(D.inputRef,V,U,X,!L,y),(0,f.o)("input",e,{ref:[t,H],state:$,props:[{id:V,disabled:L,name:B,ref:D.inputRef,"aria-labelledby":W,autoFocus:E,...K?{value:U}:{defaultValue:C},onChange(e){let t=e.currentTarget.value;k?.(t,(0,g.d)(x.dv,e.nativeEvent)),T(t!==(R.initialValue??"")),z(""!==t),e.nativeEvent.defaultPrevented||(F(B),D.change(t))},onFocus(){_(!0)},onBlur(e){O(!0),_(!1),"onBlur"===I&&D.commit(e.currentTarget.value)},onKeyDown(e){"INPUT"===e.currentTarget.tagName&&"Enter"===e.key&&(O(!0),D.commit(e.currentTarget.value))}},P,e=>D.getValidationProps(L,e)],stateAttributesMapping:m.dc})}),y=i.forwardRef(function(e,t){return(0,r.jsx)(b,{ref:t,...e})});var w=n(69819),j=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let k=i.forwardRef((e,t)=>{var{className:n,type:i}=e,a=j(e,["className","type"]);return(0,r.jsx)(y,Object.assign({ref:t,type:i,"data-slot":"input",className:(0,w.cn)("pn:h-9 pn:w-full pn:min-w-0 pn:rounded-md pn:border pn:border-input pn:bg-transparent pn:px-3 pn:py-1 pn:text-base pn:shadow-xs pn:transition-[color,box-shadow] pn:outline-none pn:selection:bg-primary pn:selection:text-primary-foreground pn:file:inline-flex pn:file:h-7 pn:file:border-0 pn:file:bg-transparent pn:file:text-sm pn:file:font-medium pn:file:text-foreground pn:placeholder:text-muted-foreground pn:disabled:pointer-events-none pn:disabled:cursor-not-allowed pn:disabled:opacity-50 pn:md:text-sm pn:dark:bg-input/30","pn:focus-visible:border-ring pn:focus-visible:ring-[3px] pn:focus-visible:ring-ring/50","pn:aria-invalid:border-destructive pn:aria-invalid:ring-destructive/20 pn:dark:aria-invalid:ring-destructive/40",n)},a))});k.displayName="Input"},80304:(e,t,n)=>{"use strict";n.d(t,{h:()=>r});let r="data-composite-item-active"},80881:(e,t,n)=>{"use strict";n.d(t,{y:()=>v});var r=n(95155),i=n(12115),a=n(90842),o=n(19009),l=n(36918),s=n(78409),d=n(10620),c=n(24729),u=n(69819),p=n(51265);let h=[],m=0;function f(){let e=new Blob(['\n    <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100">\n      <circle cx="50" cy="50" r="45" fill="#f0f0f0" stroke="#ccc" stroke-width="2"/>\n      <path d="M40,35 L40,65 L55,50 L70,50 M70,35 Q80,50 70,65" fill="none" stroke="#666" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>\n    </svg>\n  '],{type:"image/svg+xml"});return URL.createObjectURL(e)}async function g(e,t){if("audio"===t)return f();let n=URL.createObjectURL(e);if("video"!==t)return n;try{return await (0,o.iN)(n)}finally{URL.revokeObjectURL(n)}}let x=e=>{e.startsWith("blob:")&&URL.revokeObjectURL(e)},v=({store:e})=>{let[t,n]=i.useState(h),[v,b]=i.useState([]),[y,w]=i.useState(null),j=i.useRef(null);i.useEffect(()=>{h=t},[t]);let k=[...v,...t];return(0,r.jsxs)("div",{className:"pn:flex pn:h-full pn:flex-col",children:[(0,r.jsx)("div",{style:{height:"45px",paddingTop:"5px"},children:(0,c.t)("sidePanel.uploadTip")}),(0,r.jsx)("div",{style:{marginBottom:"20px"},children:(0,r.jsxs)("label",{htmlFor:"input-file",children:[(0,r.jsxs)(p.$,{variant:"outline",style:{width:"100%"},onClick:()=>{var e;null==(e=j.current)||e.click()},children:[(0,r.jsx)(a.dc,{name:"action.add"}),(0,c.t)("sidePanel.uploadImage")]}),(0,r.jsx)("input",{type:"file",ref:j,style:{display:"none"},accept:l.Go,onChange:async e=>{var t;let{target:r}=e,i=Array.from(null!=(t=r.files)?t:[]);r.value="",w(null);let a=[];for(let e of i){let t=(0,l.Tr)(e);
28t&&a.push({file:e,type:t})}a.length<i.length&&w((0,c.t)("sidePanel.uploadUnsupported"));let s=await Promise.all(a.map(async({file:e,type:t})=>({id:m++,preview:await g(e,t),pending:!0})));for(let[e,{file:t,type:r}]of(b(e=>[...s,...e]),a.entries())){let i=s[e];try{let e=await (0,l.st)()(t),i=e;"video"===r?i=await (0,o.iN)(e):"audio"===r&&(i=f()),n(n=>[{url:e,type:r,preview:i,name:t.name},...n])}catch(e){console.error(e),w((0,c.t)("sidePanel.uploadFailed"))}finally{b(e=>e.filter(e=>e.id!==i.id)),x(i.preview)}}},multiple:!0})]})}),y&&(0,r.jsx)("div",{className:"pn:pb-[10px] pn:text-center pn:text-xs pn:text-muted-foreground",children:y}),(0,r.jsx)(d.b,{images:k,isLoading:!1,getPreview:e=>e.preview,getImageClassName:e=>"pending"in e?(0,u.cn)("pn:animate-pulse pn:opacity-50"):"",hideNoResults:!0,onSelect:async(t,n,r)=>{"pending"in t||(0,s.V)({url:t.url,type:t.type,store:e,droppedPos:n,targetElement:r,name:t.name})}})]})}},82100:(e,t,n)=>{"use strict";n.d(t,{Mz:()=>_,i3:()=>I,UC:()=>z,bL:()=>R,Bk:()=>b});var r=n(12115
28),i=n(88334),a=n(20861),o=n(97602),l=n(95155),s=Object.defineProperty,d=r.forwardRef(s(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,l.jsx)(o.sG.svg,{...a,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,l.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0})),c=n(94446),u=n(3468),p=n(70222),h=n(4129),m=n(84288),f=Object.defineProperty,g=(e,t)=>f(e,"name",{value:t,configurable:!0}),x="Popper",[v,b]=(0,u.A)(x),[y,w]=v(x),j=g(e=>{let{__scopePopper:t,children:n}=e,[i,a]=r.useState(null),[o,s]=r.useState(void 0);return(0,l.jsx)(y,{scope:t,anchor:i,onAnchorChange:a,placementState:o,setPlacementState:s,children:n})},"Popper"),k=r.forwardRef(g(function(e,t){let{__scopePopper:n,virtualRef:i,...a}=e,s=w("PopperAnchor",n),d=r.useRef(null),u=s.onAnchorChange,p=r.useCallback(e=>{d.current=e,e&&u(e)},[u]),h=(0,c.s)(t,p),m=r.useRef(null);r.useEffect(()=>{if(!i)return;let e=m.current;m.current=i.current,e!==m.current&&u(m.current)});let f=s.placementState&&T(s.placementState),g=f?.[0],x=f?.[1];return i?null:(0,l.jsx)(o.sG.div,{"data-radix-popper-side":g,"data-radix-popper-align":x,...a,ref:h})},"PopperAnchor")),C="PopperContent",[E,S]=v(C),P=r.forwardRef(g(function(e,t){let{__scopePopper:n,side:s="bottom",sideOffset:d=0,align:u="center",alignOffset:f=0,arrowPadding:x=0,avoidCollisions:v=!0,collisionBoundary:b=[],collisionPadding:y=0,sticky:j="partial",hideWhenDetached:k=!1,updatePositionStrategy:S="optimized",onPlaced:P,...N}=e,A=w(C,n),[R,_]=r.useState(null),z=(0,c.s)(t,_),[I,D]=r.useState(null),F=(0,m.X)(I),L=F?.width??0,B=F?.height??0,$="number"==typeof y?y:{top:0,right:0,bottom:0,left:0,...y},W=Array.isArray(b)?b:[b],V=W.length>0,H={padding:$,boundary:W.filter(M),altBoundary:V},{refs:q,floatingStyles:K,placement:U,isPositioned:X,middlewareData:Y}=(0,i.we)({strategy:"fixed",placement:s+("center"!==u?"-"+u:""),whileElementsMounted:g((...e)=>(0,a.ll)(...e,{animationFrame:"always"===S}),"whileElementsMounted"),elements:{reference:A.anchor},middleware:[(0,i.cY)({mainAxis:d+B,alignmentAxis:f}),v&&(0,i.BN)({mainAxis:!0,crossAxis:!1,limiter:"partial"===j?(0,i.ER)():void 0,...H}),v&&(0,i.UU)({...H}),(0,i.Ej)({...H,apply:g(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty("--radix-popper-available-width",`${n}px`),o.setProperty("--radix-popper-available-height",`${r}px`),o.setProperty("--radix-popper-anchor-width",`${i}px`),o.setProperty("--radix-popper-anchor-height",`${a}px`)},"apply")}),I&&(0,i.UE)({element:I,padding:x}),O({arrowWidth:L,arrowHeight:B}),k&&(0,i.jD)({strategy:"referenceHidden",...H,boundary:V?H.boundary:void 0})]}),Z=A.setPlacementState;(0,h.N)(()=>(Z(U),()=>{Z(void 0)}),[U,Z]);let[G,Q]=T(U),J=(0,p.c)(P);(0,h.N)(()=>{X&&J?.()},[X,J]);let ee=Y.arrow?.x,et=Y.arrow?.y,en=Y.arrow?.centerOffset!==0,[er,ei]=r.useState();return(0,h.N)(()=>{R&&ei(window.getComputedStyle(R).zIndex)},[R]),(0,l.jsx)("div",{ref:q.setFloating,"data-radix-popper-content-wrapper":"",style:{...K,transform:X?K.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:er,"--radix-popper-transform-origin":[Y.transformOrigin?.x,Y.transformOrigin?.y].join(" "),...Y.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,l.jsx)(E,{scope:n,placedSide:G,placedAlign:Q,onArrowChange:D,arrowX:ee,arrowY:et,shouldHideArrow:en,children:(0,l.jsx)(o.sG.div,{"data-side":G,"data-align":Q,...N,ref:z,style:{...N.style,animation:X?N.style?.animation:"none"}})})})},"PopperContent")),N={top:"bottom",right:"left",bottom:"top",left:"right"},A=r.forwardRef(g(function(e,t){let{__scopePopper:n,...r}=e,i=S("PopperArrow",n),a=N[i.placedSide];return(0,l.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,l.jsx)(d,{...r,ref:t,style:{...r.style,display:"block"}})})},"PopperArrow"));function M(e){return null!==e}g(M,"isNotNull");var O=g(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[s,d]=T(n),c={start:"0%",center:"50%",end:"100%"}[d],u=(i.arrow?.x??0)+o/2,p=(i.arrow?.y??0)+l/2,h="",m="";return"bottom"===s?(h=a?c:`${u}px`,m=`${-l}px`):"top"===s?(h=a?c:`${u}px`,m=`${r.floating.height+l}px`):"right"===s?(h=`${-l}px`,m=a?c:`${p}px`):"left"===s&&(h=`${r.floating.width+l}px`,m=a?c:`${p}px`),{data:{x:h,y:m}}}}),"transformOrigin");function T(e){let[t,n="center"]=e.split("-");return[t,n]}g(T,"getSideAndAlignFromPlacement");var R=j,_=k,z=P,I=A},82286:(e,t,n)=>{"use strict";n.d(t,{Mz:()=>H,UC:()=>U,ZL:()=>K,bL:()=>V,bm:()=>X,l9:()=>q});var r=n(12115),i=n(92556),a=n(94446),o=n(3468),l=n(1987),s=n(19526),d=n(69666),c=n(68946),u=n(82100),p=n(75433),h=n(76842),m=n(97602),f=n(32467),g=n(59478),x=n(97745),v=n(14432),b=n(95155),y=Object.defineProperty,w=(e,t)=>y(e,"name",{value:t,configurable:!0}),j="Popover",[k,C]=(0,o.A)(j,[u.Bk]),E=(0,u.Bk)(),[S,P]=k(j),N=w(e=>{let{__scopePopover:t,children:n,open:i,defaultOpen:a,onOpenChange:o,modal:l=!1}=e,s=E(t),d=r.useRef(null),[p,h]=r.useState(!1),[m,f]=(0,g.i)({prop:i,defaultProp:a??!1,onChange:o,caller:j});return(0,b.jsx)(u.bL,{...s,children:(0,b.jsx)(S,{scope:t,contentId:(0,c.B)(),triggerRef:d,open:m,onOpenChange:f,onOpenToggle:r.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:p,onCustomAnchorAdd:r.useCallback(()=>h(!0),[]),onCustomAnchorRemove:r.useCallback(()=>h(!1),[]),modal:l,children:n})})},"Popover"),A=r.forwardRef(w(function(e,t){let{__scopePopover:n,...i}=e,a=P("PopoverAnchor",n),o=E(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:s}=a;return r.useEffect(()=>(l(),()=>s()),[l,s]),(0,b.jsx)(u.Mz,{...o,...i,ref:t})},"PopoverAnchor")),M=r.forwardRef(w(function(e,t){let{__scopePopover:n,...r}=e,o=P("PopoverTrigger",n),l=E(n),s=(0,a.s)(t,o.triggerRef),d=(0,b.jsx)(m.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.open?o.contentId:void 0,"data-state":W(o.open),...r,ref:s,onClick:(0,i.mK)(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?d:(0,b.jsx)(u.Mz,{asChild:!0,...l,children:d})},"PopoverTrigger")),O="PopoverPortal",[T,R]=k(O,{forceMount:void 0}),_=w(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=P(O,t);return(0,b.jsx)(T,{scope:t,forceMount:n,children:(0,b.jsx)(h.C,{present:n||a.open,children:(0,b.jsx)(p.Z,{asChild:!0,container:i,children:r})})})},"PopoverPortal"),z="PopoverContent",I=r.forwardRef(w(function(e,t){let n=R(z,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=P(z,e.__scopePopover);return(0,b.jsx)(h.C,{present:r||a.open,children:a.modal?(0,b.jsx)(F,{...i,ref:t}):(0,b.jsx)(L,{...i,ref:t})})},"PopoverContent")),D=(0,f.TL)("PopoverContent.RemoveScroll"),F=r.forwardRef(w(function(e,t){let n=P(z,e.__scopePopover),o=r.useRef(null),l=(0,a.s)(t,o),s=r.useRef(!1);return r.useEffect(()=>{let e=o.current;if(e)return(0,x.Eq)(e)},[]),(0,b.jsx)(v.A,{as:D,allowPinchZoom:!0,children:(0,b.jsx)(B,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,i.mK)(e.onCloseAutoFocus,e=>{e.preventDefault(),s.current||n.triggerRef.current?.focus()}),onPointerDownOutside:(0,i.mK)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;s.current=2===t.button||n},{checkForDefaultPrevented:!1}),onFocusOutside:(0,i.mK)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},"PopoverContentModal")),L=r.forwardRef(w(function(e,t){let n=P(z,e.__scopePopover),i=r.useRef(!1),a=r.useRef(!1);return(0,b.jsx)(B,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(i.current||n.triggerRef.current?.focus(),t.preventDefault()),i.current=!1,a.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(i.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));let r=t.target;n.triggerRef.current?.contains(r)&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})},"PopoverContentNonModal")),B=r.forwardRef(w(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:m,...f}=e,g=P(z,n),x=E(n);return(0,s.Oh)(),(0,b.jsx)(d.n,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,b.jsx)(l.qW,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:m,onEscapeKeyDown:c,onPointerDownOutside:p,onFocusOutside:h,onDismiss:()=>g.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,b.jsx)(u.UC,{"data-state":W(g.open),role:"dialog",id:g.contentId,...x,...f,ref:t,style:{...f.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})},"PopoverContentImpl")),$=r.forwardRef(w(function(e,t){let{__scopePopover:n,...r}=e,a=P("PopoverClose",n);return(0,b.jsx)(m.sG.button,{type:"button",...r,ref:t,onClick:(0,i.mK)(e.onClick,()=>a.onOpenChange(!1))})},"PopoverClose"));function W(e){return e?"open":"closed"}w(W,"getState");var V=N,H=A,q=M,K=_,U=I,X=$},83101:(e,t,n)=>{"use strict";n.d(t,{F:()=>o});var r=n(2821);let i=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=r.$,o=(e,t)=>n=>{var r;if((null==t?void 0:t.variants)==null)return a(e,null==n?void 0:n.class,null==n?void 0:n.className);let{variants:o,defaultVariants:l}=t,s=Object.keys(o).map(e=>{let t=null==n?void 0:n[e],r=null==l?void 0:l[e];
28if(null===t)return null;let a=i(t)||i(r);return o[e][a]}),d=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return void 0===r||(e[n]=r),e},{});return a(e,s,null==t||null==(r=t.compoundVariants)?void 0:r.reduce((e,t)=>{let{class:n,className:r,...i}=t;return Object.entries(i).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...l,...d}[t]):({...l,...d})[t]===n})?[...e,n,r]:e},[]),null==n?void 0:n.class,null==n?void 0:n.className)}},84288:(e,t,n)=>{"use strict";n.d(t,{X:()=>a});var r=n(12115),i=n(4129);function a(e){let[t,n]=r.useState(void 0);return(0,i.N)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let a=t[0];if("borderBoxSize"in a){let e=a.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(a,"name",{value:"useSize",configurable:!0})},84535:(e,t,n)=>{"use strict";n.d(t,{Y:()=>b});var r=n(12115),i=n(99793),a=n(25379),o=n(98590),l=n(98627),s=n(42433),d=n(33593),c=n(63142),u=n(18277),p=n(80304),h=n(28787);let m=[];var f=n(79234),g=n(80873),x=n(32083),v=n(95155);function b(e){let{render:t,className:n,style:b,refs:y=i.Ml,props:w=i.Ml,state:j=i.t0,stateAttributesMapping:k,highlightedIndex:C,onHighlightedIndexChange:E,orientation:S,grid:P,loopFocus:N,onLoop:A,enableHomeAndEndKeys:M,onMapChange:O,stopEventPropagation:T=!0,rootRef:R,disabledIndices:_,modifierKeys:z,highlightItemOnHover:I=!1,tag:D="div",...F}=e,{props:L,highlightedIndex:B,onHighlightedIndexChange:$,elementsRef:W,onMapChange:V,relayKeyboardEvent:H}=function(e){let{loopFocus:t=!0,orientation:n="both",grid:i,onLoop:a,direction:f,highlightedIndex:g,onHighlightedIndexChange:x,rootRef:v,enableHomeAndEndKeys:b=!1,stopEventPropagation:y,disabledIndices:w,modifierKeys:j=m}=e,[k,C]=r.useState(0),E=null!=i,S=r.useRef(null),P=(0,s.a)(S,v),N=r.useRef([]),A=r.useRef(!1),M=g??k,O=(0,l.K)((e,t=!1)=>{if((x??C)(e),t){let t=N.current[e];(0,c.$v)(S.current,t,f,n)}}),T=(0,l.K)(e=>{if(0===e.size||A.current)return;A.current=!0;let t=Array.from(e.keys()),r=t.find(e=>e?.hasAttribute(p.h))??null,i=r?e.get(r)?.index??-1:-1;if(-1!==i)O(i);else if((0,u.FP)(t,M,w)){let e=(0,u.BF)(t,{disabledIndices:w});(0,u.du)(t,e)||O(e)}(0,c.$v)(S.current,r,f,n)});(0,d.g)(()=>{if(null==w||null!=g||!A.current)return;let e=N.current;if((0,u.FP)(e,M,w)){let t=(0,u.BF)(e,{disabledIndices:w});(0,u.du)(e,t)||O(t)}},[w,g,M,N,O]);let R=(0,l.K)((e,t,n)=>a?a(e,t,n,N):n),_=(0,l.K)(e=>{let r=e.key===c.yZ||e.key===c.Kp;if(!c.jF.has(e.key)||!b&&r||function(e,t){for(let n of c.rT)if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}(e,j)||!S.current)return;let l="rtl"===f,s=l?c.eR:c.RJ,d=l?c.RJ:c.eR,p="vertical"===n?c.Jd:s,m="vertical"===n?c.il:d,g=(0,h.EW)(e.nativeEvent);if(null!=g&&(0,c.Qi)(g)&&!(0,o.F)(g)){let t=g.selectionStart,n=g.selectionEnd,r=g.value;if(null==t||e.shiftKey||t!==n||e.key!==m&&t<r.length||e.key!==p&&t>0)return}let x=M,v=(0,u.Zb)(N,w),k=(0,u.vB)(N,w);null!=i&&(x=i({disabledIndices:w,elementsRef:N,event:e,highlightedIndex:M,loopFocus:t,maxIndex:k,minIndex:v,onLoop:R,orientation:n,rtl:l}));let C="vertical"!==n&&e.key===s||"horizontal"!==n&&e.key===c.Jd,P="vertical"!==n&&e.key===d||"horizontal"!==n&&e.key===c.il;b&&(e.key===c.yZ?x=v:e.key===c.Kp&&(x=k)),x===M&&(C||P)&&(t&&x===k&&C?(x=v,a&&(x=a(e,M,x,N))):t&&x===v&&P?(x=k,a&&(x=a(e,M,x,N))):x=(0,u.BF)(N.current,{startingIndex:x,decrement:P,disabledIndices:w})),x===M||(0,u.du)(N.current,x)||(y&&e.stopPropagation(),(E||r||C||P)&&e.preventDefault(),O(x,!0),queueMicrotask(()=>{N.current[x]?.focus()}))});return{props:{ref:P,onFocus(e){let t=S.current,n=(0,h.EW)(e.nativeEvent);t&&null!=n&&(0,c.Qi)(n)&&n.setSelectionRange(0,n.value.length)},onKeyDown:_},highlightedIndex:M,onHighlightedIndexChange:O,elementsRef:N,onMapChange:T,relayKeyboardEvent:_}}({grid:P,loopFocus:N,onLoop:A,orientation:S,highlightedIndex:C,onHighlightedIndexChange:E,rootRef:R,stopEventPropagation:T,enableHomeAndEndKeys:M,direction:(0,x.j)(),disabledIndices:_,modifierKeys:z}),q=(0,g.o)(D,e,{state:j,ref:y,props:[L,...w,F],stateAttributesMapping:k}),K=r.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:$,highlightItemOnHover:I,relayKeyboardEvent:H}),[B,$,I,H]);return(0,v.jsx)(f.H.Provider,{value:K,children:(0,v.jsx)(a.u,{elementsRef:W,onMapChange:e=>{O?.(e),V(e)},children:q})})}}
28,84629:(e,t,n)=>{"use strict";n.d(t,{MG:()=>d,Sq:()=>u,iV:()=>p});var r=n(95155),i=n(12115),a=n(83101),o=n(69819),l=n(80039),s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let d=i.forwardRef((e,t)=>{var{className:n}=e,i=s(e,["className"]);return(0,r.jsx)("div",Object.assign({ref:t,"data-slot":"input-group",role:"group",className:(0,o.cn)("pn:group/input-group pn:relative pn:flex pn:w-full pn:items-center pn:rounded-md pn:border pn:border-input pn:shadow-xs pn:transition-[color,box-shadow] pn:outline-none pn:dark:bg-input/30","pn:h-9 pn:min-w-0 pn:has-[>textarea]:h-auto","pn:has-[>[data-align=inline-start]]:[&>input]:pl-2","pn:has-[>[data-align=inline-end]]:[&>input]:pr-2","pn:has-[>[data-align=block-start]]:h-auto pn:has-[>[data-align=block-start]]:flex-col pn:has-[>[data-align=block-start]]:[&>input]:pb-3","pn:has-[>[data-align=block-end]]:h-auto pn:has-[>[data-align=block-end]]:flex-col pn:has-[>[data-align=block-end]]:[&>input]:pt-3","pn:has-[[data-slot=input-group-control]:focus-visible]:border-ring pn:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] pn:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50","pn:has-[[data-slot][aria-invalid=true]]:border-destructive pn:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 pn:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",n)},i))});d.displayName="InputGroup";let c=(0,a.F)("pn:flex pn:h-auto pn:cursor-text pn:items-center pn:justify-center pn:gap-2 pn:py-1.5 pn:text-sm pn:font-medium pn:text-muted-foreground pn:select-none pn:group-data-[disabled=true]/input-group:opacity-50 pn:[&>kbd]:rounded-[calc(var(--radius)-5px)] pn:[&>svg:not([class*='size-'])]:size-4",{variants:{align:{"inline-start":"pn:order-first pn:pl-3 pn:has-[>button]:ml-[-0.45rem] pn:has-[>kbd]:ml-[-0.35rem]","inline-end":"pn:order-last pn:pr-3 pn:has-[>button]:mr-[-0.45rem] pn:has-[>kbd]:mr-[-0.35rem]","block-start":"pn:order-first pn:w-full pn:justify-start pn:px-3 pn:pt-3 pn:group-has-[>input]/input-group:pt-2.5 pn:[.border-b]:pb-3","block-end":"pn:order-last pn:w-full pn:justify-start pn:px-3 pn:pb-3 pn:group-has-[>input]/input-group:pb-2.5 pn:[.border-t]:pt-3"}},defaultVariants:{align:"inline-start"}}),u=i.forwardRef((e,t)=>{var{className:n,align:i="inline-start"}=e,a=s(e,["className","align"]);return(0,r.jsx)("div",Object.assign({ref:t,role:"group","data-slot":"input-group-addon","data-align":i,className:(0,o.cn)(c({align:i}),n),onClick:e=>{var t,n;e.target.closest("button")||null==(n=null==(t=e.currentTarget.parentElement)?void 0:t.querySelector("input"))||n.focus()}},a))});u.displayName="InputGroupAddon";let p=i.forwardRef((e,t)=>{var{className:n}=e,i=s(e,["className"]);return(0,r.jsx)(l.p,Object.assign({ref:t,"data-slot":"input-group-control",className:(0,o.cn)("pn:flex-1 pn:rounded-none pn:border-0 pn:bg-transparent pn:shadow-none pn:focus-visible:ring-0 pn:dark:bg-transparent",n)},i))});p.displayName="InputGroupInput"},84926:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},85182:(e,t,n)=>{"use strict";function r(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}n.d(t,{q:()=>r})},85341:(e,t,n)=>{"use strict";n.d(t,{O:()=>c,Q:()=>u});var r=n(95155),i=n(12115),a=n(37898),o=n(90977),l=n(69819),s=n(80039),d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};let c=i.forwardRef((e,t)=>
28{var{value:n,onValueChange:c}=e,u=d(e,["value","onValueChange"]);let[p,h]=i.useState(n.toString()),m=i.useRef(p);i.useEffect(()=>{h(n.toString()),m.current=n.toString()},[n]);let{min:f,max:g}=u,x="number"==typeof f||"number"==typeof g,{buttonPosition:v,onBlur:b,className:y,stepper:w=!0,style:j,disabled:k}=u,C=d(u,["buttonPosition","onBlur","className","stepper","style","disabled"]),E=Number(u.step)||1,S=e=>{if(k)return;let t=parseFloat(m.current),r=(Number.isNaN(t)?Number(n)||0:t)+e*E;"number"==typeof f&&(r=Math.max(f,r)),"number"==typeof g&&(r=Math.min(g,r)),m.current=String(r=parseFloat(r.toFixed(4))),h(String(r)),c(r)},P=i.useRef({}),N=()=>{clearTimeout(P.current.timeout),clearInterval(P.current.interval),P.current={}},A=(e,t)=>{if(!k){try{e.currentTarget.setPointerCapture(e.pointerId)}catch(e){}S(t),P.current.timeout=window.setTimeout(()=>{P.current.interval=window.setInterval(()=>S(t),50)},300)}};i.useEffect(()=>N,[]);let M=(0,r.jsx)(s.p,Object.assign({ref:t,type:"number",value:p,onChange:e=>{let t=e.target.value;h(t);let n=Number(t);Number.isNaN(n)||"number"==typeof f&&n<f||"number"==typeof g&&n>g||c(n)},onBlur:e=>{var t;if(x){let t=Number(e.target.value);if(!Number.isNaN(t)){let e=t;"number"==typeof f&&(e=Math.max(f,e)),"number"==typeof g&&(e=Math.min(g,e)),h(e.toString()),e!==t&&c(e)}}null==(t=u.onBlur)||t.call(u,e)},disabled:k,className:(0,l.cn)("pn:h-8 pn:text-center pn:text-sm pn:[appearance:textfield] pn:[&::-webkit-inner-spin-button]:appearance-none pn:[&::-webkit-outer-spin-button]:appearance-none",w&&"pn:pr-6",y),style:w?void 0:j},C));return w?(0,r.jsxs)("div",{className:"pn:relative pn:w-full pn:min-w-16",style:j,children:[M,(0,r.jsxs)("div",{className:"pn:absolute pn:inset-y-0 pn:right-0 pn:flex pn:w-5 pn:flex-col pn:border-l pn:border-input",children:[(0,r.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Increment",disabled:k,className:"pn:flex pn:flex-1 pn:cursor-pointer pn:appearance-none pn:items-center pn:justify-center pn:border-0 pn:bg-transparent pn:text-muted-foreground pn:hover:bg-muted pn:hover:text-foreground pn:disabled:pointer-events-none pn:disabled:opacity-50",onMouseDown:e=>e.preventDefault(),onPointerDown:e=>A(e,1),onPointerUp:N,onPointerCancel:N,children:(0,r.jsx)(a.A,{className:"pn:size-3"})}),(0,r.jsx)("button",{type:"button",tabIndex:-1,"aria-label":"Decrement",disabled:k,className:"pn:flex pn:flex-1 pn:cursor-pointer pn:appearance-none pn:items-center pn:justify-center pn:border-0 pn:border-t pn:border-input pn:bg-transparent pn:text-muted-foreground pn:hover:bg-muted pn:hover:text-foreground pn:disabled:pointer-events-none pn:disabled:opacity-50",onMouseDown:e=>e.preventDefault(),onPointerDown:e=>A(e,-1),onPointerUp:N,onPointerCancel:N,children:(0,r.jsx)(o.A,{className:"pn:size-3"})})]})]}):M});c.displayName="NumericInput";let u=c},86651:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},87308:(e,t,n)=>{"use strict";n.d(t,{q7:()=>q,bL:()=>H,RG:()=>R});var r=n(12115),i=n.t(r,2),a=n(92556),o=n(88167),l=n(94446),s=n(3468),d=n(68946),c=n(97602),u=n(70222),p=n(59478),h=n(66218),m=n(4129),f=Object.defineProperty,g=(e,t)=>f(e,"name",{value:t,configurable:!0}),x=!1;function v(){let[e,t]=r.useState(x);return r.useEffect(()=>{x||(x=!0,t(!0))},[]),e}g(v,"useIsHydrated");var b=i[" useSyncExternalStore ".trim().toString()];function y(){return()=>{}}function w(){return b(y,()=>!0,()=>!1)}g(y,"subscribe"),g(w,"useIsHydratedModern");var j="function"==typeof b?w:v,k=n(95155),C=Object.defineProperty,E=(e,t)=>C(e,"name",{value:t,configurable:!0}),S="rovingFocusGroup.onEntryFocus",P={bubbles:!1,cancelable:!0},N="RovingFocusGroup",[A,M,O]=(0,o.N)(N),[T,R]=(0,s.A)(N,[O]),[_,z]=T(N),I=r.forwardRef(E(function(e,t){return(0,k.jsx)(A.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(A.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,k.jsx)(D,{...e,ref:t})})})},"RovingFocusGroup")),D=r.forwardRef(E(function(e,t){let{__scopeRovingFocusGroup:n,orientation:i,loop:o=!1,dir:s,currentTabStopId:d,defaultCurrentTabStopId:m,onCurrentTabStopIdChange:f,onEntryFocus:g,preventScrollOnEntryFocus:x=!1,...v}=e,b=r.useRef(null),y=(0,l.s)(t,b),w=(0,h.j)(s),[j,C]=(0,p.i)({prop:d,defaultProp:m??null,onChange:f,caller:N}),[E,A]=r.useState(!1),O=(0,u.c)(g),T=M(n),R=r.useRef(!1),[z,I]=r.useState(0);return r.useEffect(()=>{let e=b.current;if(e)return e.addEventListener(S,O),()=>e.removeEventListener(S,O)},[O]),(0,k.jsx)(_,{scope:n,orientation:i,dir:w,loop:o,currentTabStopId:j,onItemFocus:r.useCallback(e=>C(e),[C]),onItemShiftTab:r.useCallback(()=>A(!0),[]),onFocusableItemAdd:r.useCallback(()=>I(e=>e+1),[]),onFocusableItemRemove:r.useCallback(()=>I(e=>e-1),[]),children:(0,k.jsx)(c.sG.div,{tabIndex:E||0===z?-1:0,"data-orientation":i,...v,ref:y,style:{outline:"none",...e.style},onMouseDown:(0,a.mK)(e.onMouseDown,()=>{R.current=!0}),onFocus:(0,a.mK)(e.onFocus,e=>{let t=!R.current;if(e.target===e.currentTarget&&t&&!E){let t=new CustomEvent(S,P);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=T().filter(e=>
28e.focusable);W([e.find(e=>e.active),e.find(e=>e.id===j),...e].filter(Boolean).map(e=>e.ref.current),x)}}R.current=!1}),onBlur:(0,a.mK)(e.onBlur,()=>A(!1))})})},"RovingFocusGroupImpl")),F=r.forwardRef(E(function(e,t){let{__scopeRovingFocusGroup:n,focusable:i=!0,active:o=!1,tabStopId:l,children:s,...u}=e,p=(0,d.B)(),h=l||p,f=z("RovingFocusGroupItem",n),g=f.currentTabStopId===h,x=M(n),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:y}=f,w=j();return(0,m.N)(()=>{if(w&&i)return v(),()=>b()},[w,i,v,b]),r.useEffect(()=>{if(!w&&i)return v(),()=>b()},[w,i,v,b]),(0,k.jsx)(A.ItemSlot,{scope:n,id:h,focusable:i,active:o,children:(0,k.jsx)(c.sG.span,{tabIndex:g?0:-1,"data-orientation":f.orientation,...u,ref:t,onMouseDown:(0,a.mK)(e.onMouseDown,e=>{i?f.onItemFocus(h):e.preventDefault()}),onFocus:(0,a.mK)(e.onFocus,()=>f.onItemFocus(h)),onKeyDown:(0,a.mK)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void f.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=$(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=x().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)n.reverse();else if("prev"===t||"next"===t){"prev"===t&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?V(n,r+1):n.slice(r+1)}setTimeout(()=>W(n))}}),children:"function"==typeof s?s({isCurrentTabStop:g,hasTabStop:null!=y}):s})})},"RovingFocusGroupItem")),L={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}function $(e,t,n){let r=B(e.key,n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(r))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)))return L[r]}function W(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function V(e,t){return e.map((n,r)=>e[(t+r)%e.length])}E(B,"getDirectionAwareKey"),E($,"getFocusIntent"),E(W,"focusFirst"),E(V,"wrapArray");var H=I,q=F},89002:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Sticker",[["path",{d:"M15.5 3H5a2 2 0 0 0-2 2v14c0 1.1.9 2 2 2h14a2 2 0 0 0 2-2V8.5L15.5 3Z",key:"1wis1t"}],["path",{d:"M14 3v4a2 2 0 0 0 2 2h4",key:"36rjfy"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M10 16s.8 1 2 1c1.3 0 2-1 2-1",key:"1vvgv3"}]])},89500:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},i=class e{constructor(e,t,n,r,i,a){this.startPoint=e,this.control2=t,this.control1=n,this.endPoint=r,this.startWidth=i,this.endWidth=a}startPoint;control2;control1;endPoint;startWidth;endWidth;static fromPoints(t,n){let r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new e(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(e,t,n){let i=e.x-t.x,a=e.y-t.y,o=t.x-n.x,l=t.y-n.y,s={x:(e.x+t.x)/2,y:(e.y+t.y)/2},d={x:(t.x+n.x)/2,y:(t.y+n.y)/2},c=Math.sqrt(i*i+a*a),u=Math.sqrt(o*o+l*l),p=s.x-d.x,h=s.y-d.y,m=c+u==0?0:u/(c+u),f={x:d.x+p*m,y:d.y+h*m},g=t.x-f.x,x=t.y-f.y;return{c1:new r(s.x+g,s.y+x),c2:new r(d.x+g,d.y+x)}}length(){let e,t,n=0;for(let r=0;r<=10;r+=1){let i=r/10,a=this.point(i,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),o=this.point(i,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){let r=a-e,i=o-t;n+=Math.sqrt(r*r+i*i)}e=a,t=o}return n}point(e,t,n,r,i){return t*(1-e)*(1-e)*(1-e)+3*n*(1-e)*(1-e)*e+3*r*(1-e)*e*e+i*e*e*e}},a=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}},o=class e extends a{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?function(e,t=250){let n,r,i,a=0,o=null,l=()=>{a=Date.now(),o=null,n=e.apply(r,i),o||(r=null,i=[])};return function(...s){let d=Date.now(),c=t-(d-a);return r=this,i=s,c<=0||c>t?(o&&(clearTimeout(o),o=null),a=d,n=e.apply(r,i),o||(r=null,i=[])):o||(o=window.setTimeout(l,c)),n}}(e.prototype._strokeUpdate,this.throttle):e.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handlePointerCancel=this._handlePointerCancel.bind(this),this._handleTouchCancel=this._handleTouchCancel.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}canvas;dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){let{_ctx:e,canvas:t}=this;e.fillStyle=this.backgroundColor,e.clearRect(0,0,t.width,t.height),e.fillRect(0,0,t.width,t.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){let e=this._data,t=this._dataUrl,n=this._dataUrlOptions;this.clear(),t&&this.fromDataURL(t,n),this.fromData(e,{clear:!1})}fromDataURL(e,t={}){return new Promise((n,r)=>{let i=new Image,a=t.ratio||window.devicePixelRatio||1,o=t.width||this.canvas.width/a,l=t.height||this.canvas.height/a,s=t.xOffset||0,d=t.yOffset||0;this._reset(this._getPointGroupOptions()),i.onload=()=>{this._ctx.drawImage(i,s,d,o,l),n()},i.onerror=e=>{r(e)},i.crossOrigin="anonymous",i.src=e,this._isEmpty=!1,this._dataUrl=e,this._dataUrlOptions={...t}})}toDataURL(e="image/png",t){return"image/svg+xml"===e?("object"!=typeof t&&(t=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(t))}`):("number"!=typeof t&&(t=void 0),this.canvas.toDataURL(e,t))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none",this.canvas.style.webkitUserSelect="none";let e=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!e?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.style.webkitUserSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){let e=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}_removeMoveUpEventListeners(){let{removeEventListener:e}=this._getListenerFunctions();e("pointermove",this._handlePointerMove),e("pointerup",this._handlePointerUp),e("pointercancel",this._handlePointerCancel),e("mousemove",this._handleMouseMove),e("mouseup",this._handleMouseUp),e("touchmove",this._handleTouchMove),e("touchend",this._handleTouchEnd),e("touchcancel",this._handleTouchCancel)}isEmpty(){return this._isEmpty}fromData(e,{clear:t=!0}={}){t&&this.clear(),this._fromData(e,this._drawCurve.bind(this),this._drawDot.bind(this),this._drawLine.bind(this)),this._data=this._data.concat(e)}toData(){return this._data}_isLeftButtonPressed(e,t){return t?1===e.buttons:(1&e.buttons)==1}_pointerEventToSignatureEvent(e){return{event:e,type:e.type,x:e.clientX,y:e.clientY,pressure:"pressure"in e?e.pressure:0}}_touchEventToSignatureEvent(e){let t=e.changedTouches[0];return{event:e,type:e.type,x:t.clientX,y:t.clientY,pressure:t.force}}_handleMouseDown(e){this._isLeftButtonPressed(e,!0)&&!this._drawingStroke&&this._strokeBegin(this._pointerEventToSignatureEvent(e))}
28_handleMouseMove(e){if(!this._isLeftButtonPressed(e,!0)||!this._drawingStroke)return void this._strokeEnd(this._pointerEventToSignatureEvent(e),!1);this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e))}_handleMouseUp(e){this._isLeftButtonPressed(e)||this._strokeEnd(this._pointerEventToSignatureEvent(e))}_handleTouchStart(e){1!==e.targetTouches.length||this._drawingStroke||(e.cancelable&&e.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(e)))}_handleTouchMove(e){if(1===e.targetTouches.length){if(e.cancelable&&e.preventDefault(),!this._drawingStroke)return void this._strokeEnd(this._touchEventToSignatureEvent(e),!1);this._strokeMoveUpdate(this._touchEventToSignatureEvent(e))}}_handleTouchEnd(e){0===e.targetTouches.length&&(e.cancelable&&e.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(e)))}_handlePointerCancel(e){this._allowPointerId(e)&&(e.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(e),!1))}_handleTouchCancel(e){e.cancelable&&e.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(e),!1)}_getPointerId(e){return e.persistentDeviceId||e.pointerId}_allowPointerId(e,t=!1){return void 0===this._strokePointerId?t:this._getPointerId(e)===this._strokePointerId}_handlePointerDown(e){!this._drawingStroke&&this._isLeftButtonPressed(e)&&this._allowPointerId(e,!0)&&(this._strokePointerId=this._getPointerId(e),e.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(e)))}_handlePointerMove(e){if(this._allowPointerId(e)){if(!this._isLeftButtonPressed(e,!0)||!this._drawingStroke)return void this._strokeEnd(this._pointerEventToSignatureEvent(e),!1);e.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(e))}}_handlePointerUp(e){!this._isLeftButtonPressed(e)&&this._allowPointerId(e)&&(e.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(e)))}_getPointGroupOptions(e){return{penColor:e&&"penColor"in e?e.penColor:this.penColor,dotSize:e&&"dotSize"in e?e.dotSize:this.dotSize,minWidth:e&&"minWidth"in e?e.minWidth:this.minWidth,maxWidth:e&&"maxWidth"in e?e.maxWidth:this.maxWidth,velocityFilterWeight:e&&"velocityFilterWeight"in e?e.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:e&&"compositeOperation"in e?e.compositeOperation:this.compositeOperation}}_strokeBegin(e){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:e,cancelable:!0})))return;let{addEventListener:t}=this._getListenerFunctions();switch(e.event.type){case"mousedown":t("mousemove",this._handleMouseMove,{passive:!1}),t("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":t("touchmove",this._handleTouchMove,{passive:!1}),t("touchend",this._handleTouchEnd,{passive:!1}),t("touchcancel",this._handleTouchCancel,{passive:!1});break;case"pointerdown":t("pointermove",this._handlePointerMove,{passive:!1}),t("pointerup",this._handlePointerUp,{passive:!1}),t("pointercancel",this._handlePointerCancel,{passive:!1})}this._drawingStroke=!0;let n=this._getPointGroupOptions(),r={...n,points:[]};this._data.push(r),this._reset(n),this._strokeUpdate(e)}_strokeUpdate(e){if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(e);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:e}));let t=this._createPoint(e.x,e.y,e.pressure),n=this._data[this._data.length-1],r=n.points,i=r.length>0&&r[r.length-1],a=!!i&&t.distanceTo(i)<=this.minDistance,o=this._getPointGroupOptions(n);if(!i||!(i&&a)){let e=this._addPoint(t,o);i?e&&this._drawCurve(e,o):this._drawDot(t,o),r.push({time:t.time,x:t.x,y:t.y,pressure:t.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:e}))}_strokeEnd(e,t=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(t&&this._strokeUpdate(e),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:e})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(e){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(e.minWidth+e.maxWidth)/2,this._ctx.fillStyle=e.penColor,this._ctx.globalCompositeOperation=e.compositeOperation}_createPoint(e,t,n){let i=this.canvas.getBoundingClientRect();return new r(e-i.left,t-i.top,n,new Date().getTime())}_addPoint(e,t){let{_lastPoints:n}=this;if(n.push(e),n.length>2){3===n.length&&n.unshift(n[0]);let e=this._calculateCurveWidths(n[1],n[2],t),r=i.fromPoints(n,e);return n.shift(),r}return null}_calculateCurveWidths(e,t,n){let r=n.velocityFilterWeight*t.velocityFrom(e)+(1-n.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(r,n),a={end:i,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=i,a}_strokeWidth(e,t){return Math.max(t.maxWidth/(e+1),t.minWidth)}_drawCurveSegment(e,t,n){let r=this._ctx;r.moveTo(e,t),r.arc(e,t,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(e,t){let n=this._ctx,r=e.endWidth-e.startWidth,i=2*Math.ceil(e.length());n.beginPath(),n.fillStyle=t.penColor;for(let n=0;n<i;n+=1){let a=n/i,o=a*a,l=o*a,s=1-a,d=s*s,c=d*s,u=c*e.startPoint.x;u+=3*d*a*e.control1.x+3*s*o*e.control2.x+l*e.endPoint.x;let p=c*e.startPoint.y;p+=3*d*a*e.control1.y+3*s*o*e.control2.y+l*e.endPoint.y;let h=Math.min(e.startWidth+l*r,t.maxWidth);this._drawCurveSegment(u,p,h)}n.closePath(),n.fill()}_getDotSize(e){return e.dotSize>0?e.dotSize:(e.minWidth+e.maxWidth)/2}_drawDot(e,t){let n=this._ctx,r=this._getDotSize(t);n.beginPath(),this._drawCurveSegment(e.x,e.y,r),n.closePath(),n.fillStyle=t.penColor,n.fill()}_drawLine(e,t,n){let r=this._ctx;r.save(),r.beginPath(),r.moveTo(e.x,e.y),r.lineTo(t.x,t.y),r.lineWidth=2*this._getDotSize(n),r.lineCap="round",r.strokeStyle=n.penColor,r.stroke(),r.restore(
28),this._isEmpty=!1}_fromData(e,t,n,i){for(let a of e){let{points:e}=a,o=this._getPointGroupOptions(a);if(e.length>2)for(let n=0;n<e.length;n+=1){let i=e[n],a=new r(i.x,i.y,i.pressure,i.time);0===n&&this._reset(o);let l=this._addPoint(a,o);l&&t(l,o)}else 2===e.length?(this._reset(o),i(e[0],e[1],o)):(this._reset(o),n(e[0],o))}}toSVG({includeBackgroundColor:e=!1,includeDataUrl:t=!1}={}){let n=this._data,r=Math.max(window.devicePixelRatio||1,1),i=this.canvas.width/r,a=this.canvas.height/r,o=document.createElementNS("http://www.w3.org/2000/svg","svg");if(o.setAttribute("xmlns","http://www.w3.org/2000/svg"),o.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),o.setAttribute("viewBox",`0 0 ${i} ${a}`),o.setAttribute("width",i.toString()),o.setAttribute("height",a.toString()),e&&this.backgroundColor){let e=document.createElement("rect");e.setAttribute("width","100%"),e.setAttribute("height","100%"),e.setAttribute("fill",this.backgroundColor),o.appendChild(e)}if(t&&this._dataUrl){let e=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,t=this._dataUrlOptions?.width||this.canvas.width/e,n=this._dataUrlOptions?.height||this.canvas.height/e,r=this._dataUrlOptions?.xOffset||0,i=this._dataUrlOptions?.yOffset||0,a=document.createElement("image");a.setAttribute("x",r.toString()),a.setAttribute("y",i.toString()),a.setAttribute("width",t.toString()),a.setAttribute("height",n.toString()),a.setAttribute("preserveAspectRatio","none"),a.setAttribute("href",this._dataUrl),o.appendChild(a)}return this._fromData(n,(e,{penColor:t})=>{let n=document.createElement("path");if(!isNaN(e.control1.x)&&!isNaN(e.control1.y)&&!isNaN(e.control2.x)&&!isNaN(e.control2.y)){let r=`M ${e.startPoint.x.toFixed(3)},${e.startPoint.y.toFixed(3)} C ${e.control1.x.toFixed(3)},${e.control1.y.toFixed(3)} ${e.control2.x.toFixed(3)},${e.control2.y.toFixed(3)} ${e.endPoint.x.toFixed(3)},${e.endPoint.y.toFixed(3)}`;n.setAttribute("d",r),n.setAttribute("stroke-width",(2.25*e.endWidth).toFixed(3)),n.setAttribute("stroke",t),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),o.appendChild(n)}},(e,{penColor:t,dotSize:n,minWidth:r,maxWidth:i})=>{let a=document.createElement("circle");a.setAttribute("r",(n>0?n:(r+i)/2).toString()),a.setAttribute("cx",e.x.toString()),a.setAttribute("cy",e.y.toString()),a.setAttribute("fill",t),o.appendChild(a)},(e,t,n)=>{let r=document.createElement("line");r.setAttribute("x1",e.x.toString()),r.setAttribute("y1",e.y.toString()),r.setAttribute("x2",t.x.toString()),r.setAttribute("y2",t.y.toString()),r.setAttribute("stroke",n.penColor),r.setAttribute("stroke-width",(2*this._getDotSize(n)).toString()),r.setAttribute("stroke-linecap","round"),o.appendChild(r)}),o.outerHTML}}},89715:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},89987:()=>{},90368:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]])},90845:(e,t,n)=>{"use strict";n.d(t,{I:()=>o});var r=n(33593),i=n(1882),a=n(48916);function o(e,t,n,l,s=!0,d){let{registerFieldControl:c}=(0,a.V$)(),u=(0,i.j)(()=>Symbol());(0,r.g)(()=>{let r=u.current;if(!s)return void c(r,void 0);c(r,{controlRef:e,getValue:l,id:t,name:d,value:n})},[e,s,l,t,d,c,u,n]),(0,r.g)(()=>{let e=u.current;return()=>{c(e,void 0)}},[c,u])}},90853:(e,t,n)=>{var r=n(77262),i=n(10718),a=n(12115),o=n(59863);function l(e){return e&&e.__esModule?e.default:e}function s(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function d(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function c(e){e.forEach(e=>d(e.element))}function u(e){e.forEach(e=>{!function(e,t,n){let r=e.children[n]||null;e.insertBefore(t,r)}(e.parentElement,e.element,e.oldIndex)})}function p(e,t){var n,r;let i=f(e),a={parentElement:e.from},o=[];switch(i){case"normal":o=[{element:e.item,newIndex:e.newIndex,oldIndex:e.oldIndex,parentElement:e.from}];break;case"swap":o=[{element:e.item,oldIndex:e.oldIndex,newIndex:e.newIndex,...a},{element:e.swapItem,oldIndex:e.newIndex,newIndex:e.oldIndex,...a}];break;case"multidrag":o=e.oldIndicies.map((t,n)=>({element:t.multiDragElement,oldIndex:t.index,newIndex:e.newIndicies[n].index,...a}))}return n=o,r=t,n.map(e=>({...e,item:r[e.oldIndex]})).sort((e,t)=>
28e.oldIndex-t.oldIndex)}function h(e,t){let n=[...t];return e.concat().reverse().forEach(e=>n.splice(e.oldIndex,1)),n}function m(e,t,n,r){let i=[...t];return e.forEach(e=>{let t=r&&n&&r(e.item,n);i.splice(e.newIndex,0,t||e.item)}),i}function f(e){return e.oldIndicies&&e.oldIndicies.length>0?"multidrag":e.swapItem?"swap":"normal"}s(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),s(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),s(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),s(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),s(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),s(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),s(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),s(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),s(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),s(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),s(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),s(e.exports,"ReactSortable",()=>x);let g={dragging:null};class x extends a.Component{static defaultProps={clone:e=>e};constructor(e){super(e),this.ref=(0,a.createRef)();let t=[...e.list].map(e=>Object.assign(e,{chosen:!1,selected:!1}));e.setList(t,this.sortable,g),l(o)(!e.plugins,`
29Plugins prop is no longer supported.
30Instead, mount it with "Sortable.mount(new MultiDrag())"
31Please read the updated README.md at https://github.com/SortableJS/react-sortablejs.
32      `)}componentDidMount(){if(null===this.ref.current)return;let e=this.makeOptions();l(r).create(this.ref.current,e)}componentDidUpdate(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){let{tag:e,style:t,className:n,id:r}=this.props;return(0,a.createElement)(e&&null!==e?e:"div",{ref:this.ref,...{style:t,className:n,id:r}},this.getChildren())}getChildren(){let{children:e,dataIdAttr:t,selectedClass:n="sortable-selected",chosenClass:r="sortable-chosen",dragClass:o="sortable-drag",fallbackClass:s="sortable-falback",ghostClass:d="sortable-ghost",swapClass:c="sortable-swap-highlight",filter:u="sortable-filter",list:p}=this.props;if(!e||null==e)return null;let h=t||"data-id";return a.Children.map(e,(e,t)=>{if(void 0===e)return;let o=p[t]||{},{className:s}=e.props,d="string"==typeof u&&{[u.replace(".","")]:!!o.filtered},c=l(i)(s,{[n]:o.selected,[r]:o.chosen,...d});return(0,a.cloneElement)(e,{[h]:e.key,className:c})})}get sortable(){let e=this.ref.current;if(null===e)return null;let t=Object.keys(e).find(e=>e.includes("Sortable"));return t?e[t]:null}makeOptions(){let e=function(e){let{list:t,setList:n,children:r,tag:i,style:a,className:o,clone:l,onAdd:s,onChange:d,onChoose:c,onClone:u,onEnd:p,onFilter:h,onRemove:m,onSort:f,onStart:g,onUnchoose:x,onUpdate:v,onMove:b,onSpill:y,onSelect:w,onDeselect:j,...k}=e;return k}(this.props);["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"].forEach(t=>e[t]=this.prepareOnHandlerPropAndDOM(t)),["onChange","onClone","onFilter","onSort"].forEach(t=>e[t]=this.prepareOnHandlerProp(t));let t=(e,t)=>{let{onMove:n}=this.props,r=e.willInsertAfter||-1;if(!n)return r;let i=n(e,t,this.sortable,g);return void 0!==i&&i};return{...e,onMove:t}}prepareOnHandlerPropAndDOM(e){return t=>{this.callOnHandlerProp(t,e),this[e](t)}}prepareOnHandlerProp(e){return t=>{this.callOnHandlerProp(t,e)}}callOnHandlerProp(e,t){let n=this.props[t];n&&n(e,this.sortable,g)}onAdd(e){let{list:t,setList:n,clone:r}=this.props,i=p(e,[...g.dragging.props.list]);c(i),n(m(i,t,e,r).map(e=>Object.assign(e,{selected:!1})),this.sortable,g)}onRemove(e){let{list:t,setList:n}=this.props,r=f(e),i=p(e,t);u(i);let a=[...t];if("clone"!==e.pullMode)a=h(i,a);else{let t=i;switch(r){case"multidrag":t=i.map((t,n)=>({...t,element:e.clones[n]}));break;case"normal":t=i.map(t=>({...t,element:e.clone}));break;default:l(o)(!0,`mode "${r}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${r}" plugin`)}c(t),i.forEach(t=>{let n=t.oldIndex,r=this.props.clone(t.item,e);a.splice(n,1,r)})}n(a=a.map(e=>Object.assign(e,{selected:!1})),this.sortable,g)}onUpdate(e){let{list:t,setList:n}=this.props,r=p(e,t);return c(r),u(r),n(function(e,t){let n=h(e,t);return m(e,n)}(r,t),this.sortable,g)}onStart(){g.dragging=this}onEnd(){g.dragging=null}onChoose(e){let{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(t,{chosen:!0})),r}),this.sortable,g)}onUnchoose(e){let{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(r,{chosen:!1})),r}),this.sortable,g)}onSpill(e){let{removeOnSpill:t,revertOnSpill:n}=this.props;t&&!n&&d(e.item)}onSelect(e){let{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(t=>{let n=t.index;if(-1===n){console.log(`"${e.type}" had indice of "${t.index}", which is probably -1 and doesn't usually happen here.`),console.log(e);return}r[n].selected=!0}),n(r,this.sortable,g)}onDeselect(e){let{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(e=>{let t=e.index;-1!==t&&(r[t].selected=!0)}),n(r,this.sortable,g)}}!function(e,t){Object.keys(t).forEach(function(n){"default"===n||"__esModule"===n||e.hasOwnProperty(n)||Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[n]}})})}(e.exports,{})},91456:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},91908:(e,t,n)=>{"use strict";n.d(t,{DB:()=>l});var r=n(95155),i=n(68047),a=n(85341),o=n(69819);
32function l({value:e,onChange:t}){let n=e=>t((0,o.q)(e,.25,2));return(0,r.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px",width:"100%"},children:[(0,r.jsx)("div",{style:{flex:1},children:(0,r.jsx)(i.A,{value:[e],min:.25,max:2,step:.05,onValueChange:e=>n((0,o.V)(e))})}),(0,r.jsx)(a.O,{value:e,onValueChange:n,style:{width:"64px"},min:.25,max:2,step:.05})]})}},93179:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(12115);function i(){return(i=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a=["cdnSuffix","cdnUrl","countryCode","style","svg"];let o=function(e){var t=e.cdnSuffix,n=e.cdnUrl,o=e.countryCode,l=e.style,s=e.svg,d=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,a);if("string"!=typeof o)return null;if(void 0!==s&&s){var c=""+(void 0===n?"https://cdn.jsdelivr.net/gh/lipis/flag-icons/flags/4x3/":n)+o.toLowerCase()+"."+(void 0===t?"svg":t);return(0,r.createElement)("img",Object.assign({},d,{src:c,style:i({display:"inline-block",width:"1em",height:"1em",verticalAlign:"middle"},l)}))}var u=o.toUpperCase().replace(/./g,function(e){return String.fromCodePoint(e.charCodeAt(0)+127397)});return(0,r.createElement)("span",Object.assign({role:"img"},d,{style:i({display:"inline-block",fontSize:"1em",lineHeight:"1em",verticalAlign:"middle"},l)}),u)}},93499:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},94446:(e,t,n)=>{"use strict";n.d(t,{s:()=>s});var r=n(12115),i=Object.defineProperty,a=(e,t)=>i(e,"name",{value:t,configurable:!0});function o(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=o(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];"function"==typeof n?n():o(e[t],null)}}}}function s(...e){return r.useCallback(l(...e),e)}a(o,"setRef"),a(l,"composeRefs"),a(s,"useComposedRefs")},94610:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]])},97458:(e,t,n)=>{"use strict";n.d(t,{Ay:()=>f,Q7:()=>u.Q,VD:()=>m,sh:()=>h});var r=n(95155),i=n(12115),a=n(50546),o=n(90842),l=n(24729),s=n(9635),d=n(51265),c=n(69819),u=n(85341),p=n(68047);let h=(0,a.PA)(({textEl:e,eachSet:t})=>{let[n,a]=i.useState(null),o=i.useRef(0),l=i.useRef(null),d=null!=n?n:100*e.curvePower,u=s.Mv.htmlRenderEnabled&&!s.Mv.renderTagTextEnabled?300:0,h=e=>{t({curvePower:e/100}),o.current=Date.now()};return(0,r.jsx)(p.A,{value:[d],onValueChange:e=>{let t=(0,c.V)(e),n=(0,c.q)(t,-100,100);if(a(n),l.current&&clearTimeout(l.current),0===u)return void h(n);let r=Date.now()-o.current;r>=u?h(n):l.current=setTimeout(()=>{h(n)},u-r)},onValueCommitted:e=>{let t=(0,c.V)(e);l.current&&clearTimeout(l.current),a(null),h((0,c.q)(t,-100,100))},min:-100,max:100,step:1})});(0,a.PA)(e=>(console.error("[polotno] FiltersPicker was removed — effects live in the Effects side panel (use EffectsPicker / the default export). Rendering nothing."),null));let m=(0,a.PA)(({element:e,store:t})=>e.contentEditable?(0,r.jsxs)(d.$,{variant:"ghost",size:"sm",onClickCapture:e=>{e.stopPropagation(),t.openSidePanel("effects")},children:[(0,r.jsx)(o.dc,{name:"toolbar.filters"}),(0,l.t)("toolbar.effects")]}):null),f=m},97591:(e,t,n)=>{"use strict";n.d(t,{I2:()=>h,mQ:()=>p,tf:()=>u});var r=n(95155),i=n(12115);n(12669),n(6387),n(29135),n(69427),n(52210),n(47185);var a=n(76455),o=n(22884),l=n(72094);n(61736);let s=(0,a.A)("div")`
33  display: flex;
34  height: 100%;
35  width: 100%;
36  max-height: 100vh;
37
38  ${(0,o.Q9)("\n    flex-direction: column-reverse;\n  ")}
39`,d=(0,a.A)("div")`
40  height: 100%;
41  width: auto;
42  max-height: 100vh;
43
44  ${(0,o.Q9)("\n    height: auto;\n    width: 100vw;\n  ")}
45`,c=(0,a.A)("div")`
46  display: flex;
47  height: 100%;
48  width: 100%;
49  flex: 1;
50  /* Allow this flex child to shrink below its content's intrinsic width
51     (default min-width:auto would let the toolbar's content force the page
52     wider than the viewport, causing horizontal page scroll). */
53  min-width: 0;
54  flex-direction: column;
55  position: relative;
56`,u=i.forwardRef((e,t)=>
56{let n=i.useRef(null),a=i.useCallback(e=>{n.current=e,"function"==typeof t?t(e):t&&(t.current=e)},[t]);return(0,r.jsx)(l.a,{elementRef:n,children:(0,r.jsx)(s,Object.assign({},e,{ref:a,className:`polotno-ui ${e.className||""}`.trim()}))})}),p=i.forwardRef((e,t)=>(0,r.jsx)(d,Object.assign({},e,{ref:t}))),h=i.forwardRef((e,t)=>(0,r.jsx)(c,Object.assign({},e,{ref:t})))},98590:(e,t,n)=>{"use strict";function r(e){return null==e||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")}n.d(t,{F:()=>r})},99708:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(71847).A)("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]])},99809:(e,t,n)=>{"use strict";function r(){return(r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}n.d(t,{_:()=>i,a:()=>r})}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.