KISA 제보 취약점(KVE-2026-1914/1919/2019/2029/2041/2042/2043/2044)과 그 수정 과정에서 드러난 자격증명 전송로 결함을 함께 해소한다. globalHeaders 는 데이터소스와 apiCall 핸들러에만 적용되는데, 코어 ApiClient 를 직접 부르는 경로들이 그 사실을 모른 채 게이트된 엔드포인트를 호출하고 있었다. 서버는 정당한 사용자를 거부하고 화면은 이미 버튼을 내준 뒤라, 예외도 로그도 없이 그 자리만 비는 형태로만 드러났다. 전송로 10축을 전수 열거해 6건을 고치고, 같은 실수가 반복되지 않도록 규정과 coverage 에 등재했다. 아웃바운드 프록시가 사이트 자기 자신으로 가는 내부 요청까지 가로채 저장이 수십 초씩 걸리던 문제도 함께 고쳤다. 실패가 폴백으로 삼켜져 화면에는 지연으로만 나타났다.
88 lines
359 KiB
JavaScript
88 lines
359 KiB
JavaScript
var SirsoftBasic=(function(ee,d,C,tr){"use strict";function bd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const A=bd(C),yd=()=>window.G7Core,R=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=yd()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return d.jsx("button",{ref:a,className:l,...o,children:e})});R.displayName="Button";const j=C.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("div",{ref:n,className:t,...r,children:e})),te=({children:e,className:t="",...r})=>d.jsx("span",{className:t,...r,children:e}),En=({children:e,className:t="",...r})=>d.jsx("svg",{className:t,...r,children:e}),At=C.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...c},i)=>{const u=l==="radio"||l==="checkbox",g=C.useRef(!1),p=C.useRef(null);C.useImperativeHandle(i,()=>p.current);const[m,x]=C.useState(a??s??"");C.useEffect(()=>{!u&&!g.current&&a!==void 0&&x(a)},[a,u]);const k=C.useCallback(()=>{g.current=!0},[]),M=C.useCallback(y=>{if(g.current=!1,n){const E=y.target.value;x(E);const O=new Event("change",{bubbles:!0});Object.defineProperty(O,"target",{writable:!1,value:{value:E}}),Object.defineProperty(O,"currentTarget",{writable:!1,value:{value:E}}),n(O)}},[n]),v=C.useCallback(y=>{const E=y.target.value;x(E),!g.current&&n&&n(y)},[n]),T=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:I,formdata:S,...N}=c;if(u)return d.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...N});const w=a!==void 0?{value:m}:{defaultValue:s};return d.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:T,onCompositionStart:k,onCompositionEnd:M,...w,...N})});At.displayName="Input";const ds=C.forwardRef(({accept:e,maxSize:t,onChange:r,onError:n,buttonText:o="Browse",placeholder:a="No file selected",className:s="",disabled:l,...f},h)=>{const c=C.useRef(null),i=h||c,[u,g]=C.useState(""),p={},m={};Object.entries(f).forEach(([v,T])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=T:m[v]=T});const x=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),k=C.useCallback(v=>{const T=v.target.files?.[0]||null;if(!T){g(""),r?.(null);return}if(t&&T.size>t*1024*1024){const I=`File size exceeds ${t}MB limit`;n?.(I),i.current&&(i.current.value=""),g("");return}g(T.name),r?.(T)},[t,r,n,i]),M=C.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return d.jsxs(j,{className:`flex items-center gap-2 ${s}`,...p,children:[d.jsx(At,{ref:i,type:"file",accept:e,onChange:k,disabled:l,className:"hidden",...m}),d.jsx(R,{type:"button",onClick:x,disabled:l,className:"px-4 py-2 bg-gray-100 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 rounded-md text-sm font-medium text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed",children:o}),d.jsx(te,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&d.jsx(R,{type:"button",onClick:M,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:d.jsx(En,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ds.displayName="FileInput";var nt=(e=>(e.User="fa-user",e.Users="fa-users",e.UserCircle="fa-user-circle",e.UserPlus="fa-user-plus",e.UserMinus="fa-user-minus",e.UserShield="fa-user-shield",e.Search="fa-search",e.Edit="fa-edit",e.Pencil="fa-pencil-alt",e.Trash="fa-trash",e.Save="fa-save",e.Plus="fa-plus",e.Minus="fa-minus",e.Check="fa-check",e.Times="fa-times",e.Download="fa-download",e.Upload="fa-upload",e.Copy="fa-copy",e.ExternalLink="fa-external-link-alt",e.Home="fa-home",e.ChevronLeft="fa-chevron-left",e.ChevronRight="fa-chevron-right",e.ChevronUp="fa-chevron-up",e.ChevronDown="fa-chevron-down",e.AngleLeft="fa-angle-left",e.AngleRight="fa-angle-right",e.AngleUp="fa-angle-up",e.AngleDown="fa-angle-down",e.ArrowUp="fa-arrow-up",e.ArrowDown="fa-arrow-down",e.ArrowLeft="fa-arrow-left",e.ArrowRight="fa-arrow-right",e.Bars="fa-bars",e.EllipsisVertical="fa-ellipsis-v",e.EllipsisHorizontal="fa-ellipsis-h",e.CheckCircle="fa-check-circle",e.TimesCircle="fa-times-circle",e.ExclamationCircle="fa-exclamation-circle",e.ExclamationTriangle="fa-exclamation-triangle",e.InfoCircle="fa-info-circle",e.QuestionCircle="fa-question-circle",e.XCircle="fa-times-circle",e.ShoppingCart="fa-shopping-cart",e.ShoppingBag="fa-shopping-bag",e.CreditCard="fa-credit-card",e.Tag="fa-tag",e.Tags="fa-tags",e.File="fa-file",e.FileAlt="fa-file-alt",e.Folder="fa-folder",e.FolderOpen="fa-folder-open",e.Envelope="fa-envelope",e.Phone="fa-phone",e.Comment="fa-comment",e.Comments="fa-comments",e.Cog="fa-cog",e.Cogs="fa-cogs",e.Settings="fa-cog",e.Wrench="fa-wrench",e.Sliders="fa-sliders-h",e.Image="fa-image",e.Images="fa-images",e.Video="fa-video",e.Camera="fa-camera",e.Heart="fa-heart",e.Star="fa-star",e.ThumbsUp="fa-thumbs-up",e.ThumbsDown="fa-thumbs-down",e.Share="fa-share",e.Clock="fa-clock",e.Calendar="fa-calendar",e.CalendarAlt="fa-calendar-alt",e.Lock="fa-lock",e.Unlock="fa-unlock",e.Eye="fa-eye",e.EyeSlash="fa-eye-slash",e.Bell="fa-bell",e.Flag="fa-flag",e.Map="fa-map",e.MapMarker="fa-map-marker-alt",e.Globe="fa-globe",e.Link="fa-link",e.Unlink="fa-unlink",e.Sun="fa-sun",e.Moon="fa-moon",e.ChartBar="fa-chart-bar",e.ChartLine="fa-chart-line",e.ChartPie="fa-chart-pie",e.ChartArea="fa-chart-area",e.Spinner="fa-spinner",e.CircleNotch="fa-circle-notch",e.CheckBadge="fa-badge-check",e.BellSlash="fa-bell-slash",e.BookOpen="fa-book-open",e.Building="fa-building",e.FileCircleCheck="fa-file-circle-check",e.WandMagicSparkles="fa-wand-magic-sparkles",e.UserXmark="fa-user-xmark",e.Cube="fa-cube",e.Cubes="fa-cubes",e.Plug="fa-plug",e.PuzzlePiece="fa-puzzle-piece",e.Fire="fa-fire",e.CommentDots="fa-comment-dots",e.DollarSign="fa-dollar-sign",e.Bars2="fa-bars",e.X="fa-times",e.List="fa-list",e.ThLarge="fa-th-large",e.Inbox="fa-inbox",e.Box="fa-box",e.PaperPlane="fa-paper-plane",e.FileText="fa-file-alt",e.Paperclip="fa-paperclip",e.Truck="fa-truck",e.Sync="fa-sync",e.RotateLeft="fa-rotate-left",e.MapPin="fa-map-marker-alt",e.HelpCircle="fa-question-circle",e))(nt||{});const vd={user:"fa-user",users:"fa-users","user-circle":"fa-user-circle","user-plus":"fa-user-plus","user-minus":"fa-user-minus","user-shield":"fa-user-shield",search:"fa-search",edit:"fa-edit",pencil:"fa-pencil-alt",trash:"fa-trash",save:"fa-save",plus:"fa-plus",minus:"fa-minus",check:"fa-check",times:"fa-times",download:"fa-download",upload:"fa-upload",copy:"fa-copy","external-link":"fa-external-link-alt",home:"fa-home","chevron-left":"fa-chevron-left","chevron-right":"fa-chevron-right","chevron-up":"fa-chevron-up","chevron-down":"fa-chevron-down","angle-left":"fa-angle-left","angle-right":"fa-angle-right","angle-up":"fa-angle-up","angle-down":"fa-angle-down","arrow-up":"fa-arrow-up","arrow-down":"fa-arrow-down","arrow-left":"fa-arrow-left","arrow-right":"fa-arrow-right",bars:"fa-bars","ellipsis-vertical":"fa-ellipsis-v","ellipsis-v":"fa-ellipsis-v","ellipsis-horizontal":"fa-ellipsis-h","ellipsis-h":"fa-ellipsis-h","check-circle":"fa-check-circle","times-circle":"fa-times-circle","x-circle":"fa-times-circle","exclamation-circle":"fa-exclamation-circle","exclamation-triangle":"fa-exclamation-triangle","info-circle":"fa-info-circle","question-circle":"fa-question-circle","shopping-cart":"fa-shopping-cart","shopping-bag":"fa-shopping-bag","credit-card":"fa-credit-card",tag:"fa-tag",tags:"fa-tags",file:"fa-file","file-alt":"fa-file-alt",folder:"fa-folder","folder-open":"fa-folder-open",envelope:"fa-envelope",phone:"fa-phone",comment:"fa-comment",comments:"fa-comments",cog:"fa-cog",cogs:"fa-cogs",settings:"fa-cog",wrench:"fa-wrench",sliders:"fa-sliders-h",image:"fa-image",images:"fa-images",video:"fa-video",camera:"fa-camera",heart:"fa-heart",star:"fa-star","thumbs-up":"fa-thumbs-up","thumbs-down":"fa-thumbs-down",share:"fa-share",clock:"fa-clock",calendar:"fa-calendar","calendar-alt":"fa-calendar-alt",lock:"fa-lock",unlock:"fa-unlock",eye:"fa-eye","eye-slash":"fa-eye-slash",bell:"fa-bell",flag:"fa-flag",map:"fa-map","map-marker":"fa-map-marker-alt",globe:"fa-globe",link:"fa-link",unlink:"fa-unlink",sun:"fa-sun",moon:"fa-moon","chart-bar":"fa-chart-bar","chart-line":"fa-chart-line","chart-pie":"fa-chart-pie","chart-area":"fa-chart-area",spinner:"fa-spinner","circle-notch":"fa-circle-notch","check-badge":"fa-badge-check","badge-check":"fa-badge-check",cube:"fa-cube",cubes:"fa-cubes",plug:"fa-plug","puzzle-piece":"fa-puzzle-piece",flame:"fa-fire",fire:"fa-fire","message-square":"fa-comment-dots","dollar-sign":"fa-dollar-sign",menu:"fa-bars",x:"fa-times",list:"fa-list","layout-grid":"fa-th-large","th-large":"fa-th-large",grid:"fa-th-large",inbox:"fa-inbox",package:"fa-box",box:"fa-box",send:"fa-paper-plane","paper-plane":"fa-paper-plane","file-text":"fa-file-alt",paperclip:"fa-paperclip",truck:"fa-truck","refresh-cw":"fa-sync",sync:"fa-sync","undo-2":"fa-rotate-left","rotate-left":"fa-rotate-left","map-pin":"fa-map-marker-alt","help-circle":"fa-question-circle","alert-triangle":"fa-exclamation-triangle","bell-off":"fa-bell-slash","book-open":"fa-book-open",building:"fa-building","edit-2":"fa-edit","edit-3":"fa-edit","file-check":"fa-file-circle-check",mail:"fa-envelope",sparkles:"fa-wand-magic-sparkles","trash-2":"fa-trash","user-x":"fa-user-xmark"},fe=({name:e,iconStyle:t="solid",size:r,color:n,spin:o=!1,pulse:a=!1,fixedWidth:s=!1,ariaLabel:l,className:f="",style:h,...c})=>{const i={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},u=typeof e=="string"?e:String(e),g=vd[u],p=g?String(g).replace(/^fa-/,""):u.replace(/^fa-/,""),m=[i[t],`fa-${p}`,r&&`fa-${r}`,o&&"fa-spin",a&&"fa-pulse",s&&"fa-fw",n,f].filter(Boolean).join(" "),x=l||p.replace(/-/g," ");return d.jsx("i",{className:m,style:h,"aria-label":x,role:"img",...c})},Tr=(e,t)=>window.G7Core?.t?.(e,t)??e,ko={minLength:{key:"minLength",labelKey:"auth.password_input.rules.minLength",defaultParam:6,validate:(e,t=6)=>e.length>=t},maxLength:{key:"maxLength",labelKey:"auth.password_input.rules.maxLength",defaultParam:20,validate:(e,t=20)=>e.length<=t},hasUppercase:{key:"hasUppercase",labelKey:"auth.password_input.rules.hasUppercase",validate:e=>/[A-Z]/.test(e)},hasLowercase:{key:"hasLowercase",labelKey:"auth.password_input.rules.hasLowercase",validate:e=>/[a-z]/.test(e)},hasNumber:{key:"hasNumber",labelKey:"auth.password_input.rules.hasNumber",validate:e=>/[0-9]/.test(e)},hasSpecial:{key:"hasSpecial",labelKey:"auth.password_input.rules.hasSpecial",validate:e=>/[!@#$%^&*(),.?":{}|<>]/.test(e)},noSpaces:{key:"noSpaces",labelKey:"auth.password_input.rules.noSpaces",validate:e=>!/\s/.test(e)},minTypes:{key:"minTypes",labelKey:"auth.password_input.rules.minTypes",defaultParam:3,validate:(e,t=3)=>{let r=0;return/[A-Z]/.test(e)&&r++,/[a-z]/.test(e)&&r++,/[0-9]/.test(e)&&r++,/[!@#$%^&*(),.?":{}|<>]/.test(e)&&r++,r>=t}}},us=[ko.minLength];function wd(e){const[t,r]=e.split(":"),n=ko[t];if(!n)return null;const o=r?parseInt(r,10):n.defaultParam;return{rule:n,param:isNaN(o)?n.defaultParam:o}}const fs=C.forwardRef(({label:e,error:t,showToggle:r=!0,showValidation:n=!1,isConfirmField:o=!1,confirmTarget:a,onMatchChange:s,onValidityChange:l,rules:f,enableRules:h,showRules:c,wrapperClassName:i="",validationClassName:u="",className:g="",onChange:p,value:m,defaultValue:x,disabled:k,...M},v)=>{const T=C.useRef(null);C.useImperativeHandle(v,()=>T.current);const[I,S]=C.useState(!1),[N,w]=C.useState(!1),[y,E]=C.useState(m??x??"");C.useEffect(()=>{m!==void 0&&E(m)},[m]);const O=C.useMemo(()=>f&&f.length>0?f.map(H=>({rule:H,param:H.defaultParam})):h&&h.length>0?h.map(H=>wd(H)).filter(H=>H!==null):us.map(H=>({rule:H,param:H.defaultParam})),[f,h]),$=C.useMemo(()=>!c||c.length===0?O:O.filter(H=>c.includes(H.rule.key)),[O,c]),P=C.useMemo(()=>!n||o?{}:$.reduce((H,{rule:W,param:Q})=>(H[W.key]=W.validate(y,Q),H),{}),[y,$,n,o]),L=C.useMemo(()=>!o||a===void 0?!0:y===a&&y.length>0,[o,y,a]),U=C.useMemo(()=>n?Object.values(P).every(H=>H):!0,[P,n]);C.useEffect(()=>{if(l&&n&&!o){const H=Object.entries(P).filter(([,W])=>!W).map(([W])=>W);l(U,H)}},[U,P,l,n,o]),C.useEffect(()=>{s&&o&&s(L)},[L,s,o]);const _=C.useCallback(()=>{S(H=>!H)},[]),b=C.useCallback(H=>{const W=H.target.value;E(W),p&&p(H)},[p]),z=C.useCallback(H=>{w(H.getModifierState("CapsLock"))},[]),{loadingactions:F,formdata:G,...X}=M,B={},Y={};for(const[H,W]of Object.entries(X))H.startsWith("data-editor-")||H==="onMouseMove"||H==="onMouseLeave"?B[H]=W:Y[H]=W;return d.jsxs("div",{className:`relative ${i}`,...B,children:[d.jsxs("div",{className:"relative",children:[d.jsx("input",{ref:T,type:I?"text":"password",className:`${g} ${r?"pr-10":""}`,value:m!==void 0?m:void 0,defaultValue:m===void 0?x:void 0,onChange:b,onKeyDown:z,onKeyUp:z,disabled:k,...Y}),r&&d.jsx("button",{type:"button",onClick:_,disabled:k,className:"absolute right-2 top-1/2 -translate-y-1/2 p-1 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200 disabled:opacity-50 disabled:cursor-not-allowed dark:disabled:opacity-50","aria-label":Tr(I?"auth.password_input.hide":"auth.password_input.show"),children:d.jsx(fe,{name:I?"eye-slash":"eye",className:"w-5 h-5"})})]}),N&&!I&&d.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-sm text-yellow-600 dark:text-yellow-400",children:[d.jsx(fe,{name:"triangle-exclamation",className:"w-4 h-4"}),d.jsx("span",{children:Tr("auth.password_input.caps_lock_on")})]}),o&&a!==void 0&&y.length>0&&d.jsxs("div",{className:`mt-2 flex items-center gap-1.5 text-sm ${L?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400"}`,children:[d.jsx(fe,{name:L?"check-circle":"xmark-circle",className:"w-4 h-4"}),d.jsx("span",{children:Tr(L?"auth.password_input.match":"auth.password_input.mismatch")})]}),n&&!o&&y.length>0&&d.jsx("div",{className:`mt-2 space-y-1 ${u}`,children:$.map(({rule:H,param:W})=>{const Q=P[H.key],be=W!==void 0?{count:W}:void 0;return d.jsxs("div",{className:`flex items-center gap-1.5 text-sm ${Q?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"}`,children:[d.jsx(fe,{name:Q?"check-circle":"circle",className:"w-4 h-4"}),d.jsx("span",{children:Tr(H.labelKey,be)})]},H.key)})}),t&&d.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:t})]})});fs.displayName="PasswordInput";const Co=({label:e,error:t,className:r="",onChange:n,value:o,defaultValue:a,...s})=>{const l=C.useRef(!1),f=C.useRef(null),[h,c]=C.useState(o??a??"");C.useEffect(()=>{!l.current&&o!==void 0&&c(o)},[o]);const i=C.useCallback(()=>{l.current=!0},[]),u=C.useCallback(M=>{if(l.current=!1,n){const v=M.target.value;c(v);const T=new Event("change",{bubbles:!0});Object.defineProperty(T,"target",{writable:!1,value:{value:v}}),Object.defineProperty(T,"currentTarget",{writable:!1,value:{value:v}}),n(T)}},[n]),g=C.useCallback(M=>{const v=M.target.value;c(v),!l.current&&n&&n(M)},[n]),{loadingactions:p,formdata:m,...x}=s,k=o!==void 0?{value:h}:{defaultValue:a};return d.jsx("textarea",{ref:f,className:r,onChange:g,onCompositionStart:i,onCompositionEnd:u,...k,...x})},Ar=({children:e,className:t="",...r})=>d.jsx("label",{className:t,...r,children:e}),Gt=({children:e,className:t="",...r})=>d.jsx("p",{className:t,...r,children:e}),jt=({className:e="",alt:t="",...r})=>d.jsx("img",{className:e,alt:t,...r}),xd=({children:e,className:t="",...r})=>d.jsx("h1",{className:t,...r,children:e}),gs=({children:e,className:t="",...r})=>d.jsx("h2",{className:t,...r,children:e}),Tn=({children:e,className:t="",...r})=>d.jsx("h3",{className:t,...r,children:e}),hs=({children:e,className:t="",...r})=>d.jsx("h4",{className:t,...r,children:e}),_o=({children:e,className:t="",...r})=>d.jsx("ul",{className:t,...r,children:e}),kd=({children:e,className:t="",...r})=>d.jsx("ol",{className:t,...r,children:e}),er=({children:e,className:t="",...r})=>d.jsx("li",{className:t,...r,children:e}),So=({children:e,className:t="",...r})=>d.jsx("a",{className:t,...r,children:e}),Eo=({children:e,className:t="",...r})=>d.jsx("form",{className:t,...r,children:e}),Cd=window.G7Core?.createLogger?.("Comp:Select")??{log:(...e)=>console.log("[Comp:Select]",...e),warn:(...e)=>console.warn("[Comp:Select]",...e),error:(...e)=>console.error("[Comp:Select]",...e)};function _d(e){const t=window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[e];return t||{ko:"한국어",en:"English",ja:"日本語",zh:"中文",es:"Español",fr:"Français",de:"Deutsch"}[e]||e}const ps=({children:e,label:t,error:r,options:n,className:o="",value:a,onChange:s,disabled:l,searchable:f=!1,searchPlaceholder:h,editorAttrs:c,...i})=>{const[u,g]=C.useState(!1),[p,m]=C.useState(""),[x,k]=C.useState(null),M=C.useRef(null),v=C.useRef(null),T=C.useRef(null),I=C.useRef(null),S=C.useMemo(()=>n?Array.isArray(n)?n.length===0?[]:typeof n[0]=="string"?n.map(_=>({value:_,label:_d(_)})):n:(Cd.warn("options prop is not an array:",n),null):null,[n]),N=C.useMemo(()=>S&&S.find(b=>String(b.value)===String(a))?.label||"",[S,a]),w=C.useMemo(()=>{if(!S)return null;if(!f||p.trim()==="")return S;const _=p.trim().toLowerCase();return S.filter(b=>b.label.toLowerCase().includes(_)||String(b.value).toLowerCase().includes(_))},[S,f,p]);C.useEffect(()=>{if(u&&f){m("");const _=setTimeout(()=>T.current?.focus(),0);return()=>clearTimeout(_)}u||m("")},[u,f]);const y=C.useCallback(()=>{if(!v.current)return;const _=v.current.getBoundingClientRect(),b=window.innerHeight-_.bottom,F=b<280&&_.top>b;k(F?{bottom:window.innerHeight-_.top+4,left:_.left,width:_.width}:{top:_.bottom+4,left:_.left,width:_.width})},[]);C.useEffect(()=>{if(!u){k(null);return}return y(),window.addEventListener("scroll",y,!0),window.addEventListener("resize",y),()=>{window.removeEventListener("scroll",y,!0),window.removeEventListener("resize",y)}},[u,y]),C.useEffect(()=>{const _=b=>{const z=b.target;M.current&&!M.current.contains(z)&&(!I.current||!I.current.contains(z))&&g(!1)};return u&&document.addEventListener("mousedown",_),()=>{document.removeEventListener("mousedown",_)}},[u]),C.useEffect(()=>{const _=b=>{b.key==="Escape"&&u&&(g(!1),v.current?.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[u]);const E=()=>{l||g(!u)},O=_=>{s&&s({target:{value:_},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),v.current?.focus()};if(!S)return d.jsx("select",{className:o,value:a,onChange:s,disabled:l,...c,...i,children:e});const $=o&&o.includes("bg-"),P=o&&/text-(gray|red|blue|green|yellow|white|black|indigo|purple|pink|orange|amber|emerald|teal|cyan|slate)-\d+|text-white|text-black/.test(o),L=$?`${o}${P?"":" text-gray-700 dark:text-gray-200"}`:`w-full px-4 py-2.5 bg-gray-100 dark:bg-gray-700 border-0 rounded-xl text-gray-700 dark:text-gray-200 font-medium focus:ring-2 focus:ring-blue-500 focus:outline-none ${o}`,U={...c,...i};return d.jsxs(j,{ref:M,className:"relative",...U,children:[d.jsxs(R,{ref:v,type:"button",onClick:E,disabled:l,className:`${L} flex items-center justify-between gap-2 text-left cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed`,"aria-haspopup":"listbox","aria-expanded":u,children:[d.jsx(te,{className:"truncate",children:N||" "}),d.jsx(En,{className:`w-4 h-4 flex-shrink-0 transition-transform duration-200 ${u?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),u&&x&&tr.createPortal(d.jsxs(j,{ref:I,className:"fixed z-[9999] bg-white dark:bg-gray-800 rounded-2xl shadow-lg border border-gray-200 dark:border-gray-600 overflow-hidden",style:{top:x.top,bottom:x.bottom,left:x.left,width:x.width},role:"listbox",children:[f&&d.jsx(j,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:d.jsx(At,{ref:T,type:"text",value:p,onChange:_=>m(_.target.value),placeholder:h??"Search...",className:"w-full px-3 py-2 bg-gray-100 dark:bg-gray-700 border-0 rounded-lg text-sm text-gray-700 dark:text-gray-200 placeholder-gray-400 dark:placeholder-gray-500 focus:ring-2 focus:ring-blue-500 focus:outline-none",role:"searchbox","aria-label":h??"Search"})}),d.jsxs(j,{className:"py-2 max-h-60 overflow-auto",children:[w&&w.length===0&&d.jsx(j,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:p?"No results":""}),(w??[]).map(_=>{const b=String(_.value)===String(a);return d.jsxs(R,{type:"button",onClick:()=>!_.disabled&&O(_.value),disabled:_.disabled,className:`w-full px-4 py-3 text-left flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors ${b?"text-blue-600 dark:text-blue-400 font-medium":"text-gray-700 dark:text-gray-200"} ${_.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,role:"option","aria-selected":b,children:[d.jsx(te,{children:_.label}),b&&d.jsx(En,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},_.value)})]})]}),document.body)]})},Sd=({children:e,className:t="",...r})=>d.jsx("option",{className:t,...r,children:e}),Ed=({children:e,className:t="",...r})=>d.jsx("optgroup",{className:t,...r,children:e}),ms=C.forwardRef(({label:e,className:t="",...r},n)=>d.jsx("input",{ref:n,type:"checkbox",className:t,...r}));ms.displayName="Checkbox";const Td=({children:e,className:t="",...r})=>d.jsx("table",{className:t,...r,children:e}),Ad=({children:e,className:t="",...r})=>d.jsx("thead",{className:t,...r,children:e}),Nd=({children:e,className:t="",...r})=>d.jsx("tbody",{className:t,...r,children:e}),Od=({children:e,className:t="",...r})=>d.jsx("tr",{className:t,...r,children:e}),Md=({children:e,className:t="",...r})=>d.jsx("th",{className:t,...r,children:e}),Id=({children:e,className:t="",...r})=>d.jsx("td",{className:t,...r,children:e}),Zr=C.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("nav",{ref:n,className:t,...r,children:e}));Zr.displayName="Nav";const bs=({children:e,className:t="",...r})=>d.jsx("section",{className:t,...r,children:e}),Dd=({children:e,className:t="",...r})=>d.jsx("code",{className:t,...r,children:e}),To=C.forwardRef(({className:e="",...t},r)=>d.jsx("hr",{ref:r,className:e,...t})),Pd=C.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("header",{ref:n,className:t,...r,children:e})),ys=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,Ao=e=>{const t=ys(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Ld=()=>{const e=localStorage.getItem("g7_color_scheme");return e&&["auto","light","dark"].includes(e)?e:"auto"},An=({onThemeChange:e,className:t="",autoText:r="System",lightText:n="Light",darkText:o="Dark",id:a,editorAttrs:s})=>{const l=Ld(),[f,h]=C.useState(l),[c,i]=C.useState(!1),u=C.useRef(null);C.useEffect(()=>{Ao(f)},[]),C.useEffect(()=>{if(f!=="auto")return;const m=window.matchMedia("(prefers-color-scheme: dark)"),x=()=>{Ao("auto")};return m.addEventListener("change",x),()=>m.removeEventListener("change",x)},[f]),C.useEffect(()=>{const m=x=>{u.current&&!u.current.contains(x.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const g=m=>{h(m),localStorage.setItem("g7_color_scheme",m),Ao(m),i(!1),e?.(m)},p=()=>ys(f)==="dark"?nt.Moon:nt.Sun;return d.jsxs(j,{ref:u,className:`relative ${t}`,id:a,...s,children:[d.jsx(R,{onClick:()=>i(!c),className:"p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors text-gray-600 dark:text-gray-400","aria-label":"Toggle theme",children:d.jsx(fe,{name:p(),className:"w-5 h-5"})}),c&&d.jsx(j,{className:"absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50",children:d.jsxs(j,{className:"py-2",children:[d.jsxs(R,{onClick:()=>g("auto"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${f==="auto"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[d.jsx(fe,{name:nt.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&d.jsx(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(R,{onClick:()=>g("light"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${f==="light"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[d.jsx(fe,{name:nt.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&d.jsx(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),d.jsxs(R,{onClick:()=>g("dark"),className:`
|
||
w-full px-4 py-2 text-left hover:bg-gray-50 dark:hover:bg-gray-700 flex items-center gap-3 transition-colors
|
||
${f==="dark"?"bg-gray-50 dark:bg-gray-700":""}
|
||
`,children:[d.jsx(fe,{name:nt.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),d.jsx(te,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&d.jsx(fe,{name:nt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},$d=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:An,default:An},Symbol.toStringTag,{value:"Module"})),vs={xs:"w-6 h-6 text-xs",sm:"w-8 h-8 text-sm",md:"w-10 h-10 text-base",lg:"w-12 h-12 text-lg",xl:"w-16 h-16 text-xl","2xl":"w-24 h-24 text-2xl","3xl":"w-32 h-32 text-3xl","4xl":"w-40 h-40 text-4xl","5xl":"w-48 h-48 text-5xl"},Fd="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Ud="grayscale opacity-50",No={normal:"bg-gradient-to-br from-blue-500 to-purple-600",withdrawn:"bg-gray-300 dark:bg-gray-600",guest:"bg-gray-200 dark:bg-gray-700"},Qr=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const c=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=C.useMemo(()=>[vs[n]||vs.md,Fd,u?Ud:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?No.guest:u?No.withdrawn:No.normal,x=()=>g?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(fe,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?d.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:d.jsx(fe,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):d.jsx(j,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return d.jsx(j,{className:p,id:f,...h,children:c&&!g&&!u?d.jsx(jt,{src:c,alt:i,className:"w-full h-full object-cover"}):x()})},zd=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Qr},Symbol.toStringTag,{value:"Module"})),Hd=window.G7Core?.createLogger?.("Comp:SlotContainer")??{log:(...e)=>console.log("[Comp:SlotContainer]",...e),warn:(...e)=>console.warn("[Comp:SlotContainer]",...e),error:(...e)=>console.error("[Comp:SlotContainer]",...e)};function ws(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const Nn=({slotId:e,className:t="",emptyContent:r,style:n,id:o,children:a})=>{const[s,l]=C.useState([]),[,f]=C.useState({}),h=C.useCallback(()=>{const p=window.__slotContextValue;if(p)return p;const m=window.G7Core;return m&&m.getSlotContext?.()||null},[]),c=C.useCallback(()=>{const p=h();p&&p.isEnabled&&l(p.getSlotComponents(e))},[e,h]);C.useEffect(()=>{const p=h();return!p||!p.isEnabled?void 0:(c(),p.subscribeToSlot(e,()=>{c(),f({})}))},[e,h,c]);const i=C.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?d.jsx(j,{className:t,style:n,id:o,children:r}):a?d.jsx(j,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(Hd.error("G7Core or DynamicRenderer not available"),null):d.jsxs(j,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:x,parentFormContext:k,getParentComponentContext:M,translationContext:v}=p,T=ws(m,o);return d.jsx(u,{componentDef:T,dataContext:x,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:M?.(),parentFormContextProp:k,isRootRenderer:!1},T.id||`slot-${e}-${p.order}`)}),a]})},Gd=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:Nn,default:Nn,scopeSlotChildDef:ws},Symbol.toStringTag,{value:"Module"})),On=({notifications:e=[],unreadCount:t=0,hasMore:r=!1,loading:n=!1,titleText:o="알림",emptyText:a="알림이 없습니다.",markAllReadText:s="모두 읽음",deleteAllText:l="모두 삭제",unreadOnlyText:f="안 읽은 알림만",unreadOnly:h=!1,onNotificationClick:c,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:x,dropdownAlign:k="right",className:M="",id:v,editorAttrs:T})=>{const[I,S]=C.useState(!1),N=C.useRef(null),w=C.useRef(null),y=C.useRef(null),E=C.useRef(null),O=C.useRef(new Set),$=C.useRef(u),P=C.useRef(r),L=C.useRef(n),U=C.useRef(e.length),_=C.useRef(-1);C.useEffect(()=>{$.current=u,P.current=r,L.current=n,U.current=e.length}),C.useEffect(()=>{if(!E.current||!y.current||!I)return;_.current=-1;const G=new IntersectionObserver(([X])=>{X.isIntersecting&&(L.current||!P.current||_.current!==U.current&&(_.current=U.current,$.current?.()))},{root:y.current,threshold:.1});return G.observe(E.current),()=>G.disconnect()},[I]),C.useEffect(()=>{if(!y.current||!I)return;const G=new IntersectionObserver(B=>{B.forEach(Y=>{const H=Y.target.getAttribute("data-notification-id"),W=Y.target.getAttribute("data-unread")==="true";H&&W&&Y.isIntersecting&&O.current.add(H)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>G.observe(B)),()=>G.disconnect()},[I,e]);const b=t>0?t:e.filter(G=>!G.read).length,z=C.useCallback(()=>{if(I){if(b>0){const G=Array.from(O.current).filter(X=>{const B=e.find(Y=>String(Y.id)===String(X));return B&&!B.read});G.length>0&&i?.(G)}O.current.clear(),S(!1)}},[I,i,b,e]);C.useEffect(()=>{if(!I)return;const G=X=>{N.current&&!N.current.contains(X.target)&&z()};return document.addEventListener("mousedown",G),()=>document.removeEventListener("mousedown",G)},[I,z]);const F=C.useCallback(()=>{I?z():S(!0)},[I,z]);return C.useLayoutEffect(()=>{const G=w.current;if(!I||!G)return;G.style.transform="";const X=G.getBoundingClientRect(),B=typeof window<"u"?window.innerWidth:0;if(X.width===0&&X.height===0)return;const Y=8;let H=0;X.right>B-Y?H=-(X.right-(B-Y)):X.left<Y&&(H=Y-X.left),H!==0&&(G.style.transform=`translateX(${H}px)`)},[I,k,e.length]),d.jsxs(j,{ref:N,className:`relative ${M}`,id:v,...T,children:[d.jsxs(R,{onClick:F,className:"relative p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors cursor-pointer","aria-label":o,children:[d.jsx(fe,{name:nt.Bell,className:"w-5 h-5"}),b>0&&d.jsx(te,{className:"absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center text-xs font-bold text-white bg-red-500 dark:bg-red-600 rounded-full",children:b>99?"99+":b})]}),I&&d.jsxs(j,{ref:w,className:`absolute ${k==="left"?"left-0":"right-0"} mt-2 w-80 max-w-[calc(100vw-1rem)] bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg z-50`,children:[d.jsxs(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[d.jsxs(j,{className:"flex items-center gap-3 min-w-0",children:[d.jsx(te,{className:"font-semibold text-gray-900 dark:text-white",children:o}),x&&d.jsxs(j,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>x(!h),children:[d.jsx(At,{type:"checkbox",checked:h,onChange:G=>{G.stopPropagation(),x(G.target.checked)},onClick:G=>G.stopPropagation(),className:"w-3.5 h-3.5 rounded border-gray-300 dark:border-gray-600 text-blue-600 dark:text-blue-400 focus:ring-blue-500 dark:focus:ring-blue-400 cursor-pointer"}),d.jsx(te,{className:"text-xs text-gray-600 dark:text-gray-400",children:f})]})]}),d.jsxs(j,{className:"flex items-center gap-3 flex-shrink-0",children:[g&&b>0&&d.jsx(R,{onClick:()=>{g(),O.current.clear()},className:"text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 hover:underline cursor-pointer",children:s}),p&&e.length>0&&d.jsx(R,{onClick:()=>{p()},className:"text-xs text-red-600 dark:text-red-400 hover:text-red-800 dark:hover:text-red-300 hover:underline cursor-pointer",children:l})]})]}),d.jsx(j,{ref:y,className:"max-h-96 overflow-y-auto",children:e.length===0&&!n?d.jsx(j,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:d.jsx(te,{children:a})}):d.jsxs(d.Fragment,{children:[e.map(G=>{const X=!G.read;return d.jsxs(j,{"data-notification-id":G.id,"data-unread":X?"true":"false",onClick:()=>{G.onClick?.(),c?.(G),S(!1)},className:`group flex items-start gap-3 px-4 py-3 text-left border-b border-gray-100 dark:border-gray-700 transition-colors cursor-pointer ${X?"bg-blue-50/70 dark:bg-blue-900/20 hover:bg-blue-50 dark:hover:bg-blue-900/30":"bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700/50 opacity-70"}`,children:[G.iconName&&d.jsx(fe,{name:G.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${X?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),d.jsxs(j,{className:"flex-1 min-w-0",children:[d.jsx(j,{className:`text-sm truncate ${X?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:G.title}),d.jsx(j,{className:`text-sm mt-1 line-clamp-2 ${X?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:G.message}),d.jsx(j,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:G.time})]}),d.jsxs(j,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[X&&d.jsx(te,{className:"w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full mt-1.5"}),m&&d.jsx(R,{onClick:B=>{B.stopPropagation(),m(G)},className:"p-1 text-gray-400 dark:text-gray-500 hover:text-red-600 dark:hover:text-red-400 rounded hover:bg-red-50 dark:hover:bg-red-900/20 cursor-pointer opacity-0 group-hover:opacity-100 transition-opacity","aria-label":"Delete notification",children:d.jsx(fe,{name:nt.Trash,className:"w-4 h-4"})})]})]},G.id)}),r&&d.jsx(j,{ref:E,className:"px-4 py-3 text-center",children:n?d.jsx(te,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):d.jsx(te,{className:"text-sm text-gray-400 dark:text-gray-500"})}),n&&!r&&e.length>0&&d.jsx(j,{className:"px-4 py-2 text-center",children:d.jsx(te,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},jd=Object.freeze(Object.defineProperty({__proto__:null,NotificationCenter:On,default:On},Symbol.toStringTag,{value:"Module"})),Qe=(e,t)=>window.G7Core?.t?.(e,t)??e,vt=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},xs=({logo:e,siteName:t="그누보드7",user:r,cartCount:n=0,notificationCount:o=0,boards:a=[],maxVisibleBoards:s=5,onMobileMenuOpen:l,availableLocales:f=[],currentLocale:h="ko",shopBase:c="/shop",className:i="",editorAttrs:u,notifications:g=[],notificationHasMore:p=!1,notificationLoading:m=!1,notificationUnreadOnly:x=!1,notificationTitleText:k,notificationEmptyText:M,notificationMarkAllReadText:v,notificationDeleteAllText:T,notificationUnreadOnlyText:I,onNotificationClose:S,onNotificationClick:N,onNotificationLoadMore:w,onNotificationMarkAllRead:y,onNotificationDeleteAll:E,onNotificationDelete:O,onNotificationUnreadOnlyToggle:$})=>{const[P,L]=C.useState(""),[U,_]=C.useState(!1),[b,z]=C.useState(!1),[F,G]=C.useState(!1),[X,B]=C.useState({top:0,left:0}),[Y,H]=C.useState(window.location.pathname),W=C.useRef(null),Q=C.useRef(null),be=C.useRef(null),pe=window.G7Core?.useResponsive,ne=pe?.(),Ae=ne?ne.width<768:typeof window<"u"&&window.innerWidth<768;C.useEffect(()=>{const K=()=>H(window.location.pathname);window.addEventListener("popstate",K);const oe=history.pushState;return history.pushState=function(...ae){oe.apply(this,ae),H(window.location.pathname)},()=>{window.removeEventListener("popstate",K),history.pushState=oe}},[]);const ve=(K,oe=!1)=>oe?Y===K:Y===K||Y.startsWith(K+"/"),We=()=>{const K=c==="/"?"":c;return Y.startsWith(`${K}/products`)||Y.startsWith(`${K}/cart`)||Y.startsWith(`${K}/checkout`)||Y.startsWith(`${K}/category`)},me=K=>{const oe="px-3 py-2 text-sm font-medium whitespace-nowrap cursor-pointer rounded-lg transition-colors";return K?`${oe} bg-gray-900 text-white dark:bg-white dark:text-gray-900`:`${oe} text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white hover:bg-gray-100 dark:hover:bg-gray-800`};C.useEffect(()=>{const K=oe=>{W.current&&!W.current.contains(oe.target)&&_(!1),Q.current&&!Q.current.contains(oe.target)&&z(!1),be.current&&!be.current.contains(oe.target)&&G(!1)};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[]);const Te=a.slice(0,s),ge=a.slice(s),Oe=K=>{K.preventDefault(),P.trim()&&vt(`/search?q=${encodeURIComponent(P)}`)},we=async()=>{window.G7Core?.dispatch?.({handler:"logout"})},$e=K=>{window.G7Core?.dispatch?.({handler:"setLocale",target:K}),G(!1)},ze=K=>window.G7Core?.state?.get?.("_global.appConfig.localeNames")?.[K]??(K==="ko"?"한국어":K==="en"?"English":K==="ja"?"日本語":K==="zh"?"中文":K==="es"?"Español":K==="fr"?"Français":K==="de"?"Deutsch":K.toUpperCase());return d.jsxs(Pd,{...u??{},className:`sticky top-0 z-50 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 ${i}`,children:[d.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs(j,{className:"flex items-center justify-between h-16",children:[d.jsx(R,{onClick:()=>vt("/"),className:"flex items-center gap-2 flex-shrink-0 cursor-pointer",children:e?d.jsx(jt,{src:e,alt:t,className:"h-8"}):d.jsx(te,{className:"text-xl font-bold text-gray-900 dark:text-white",children:t})}),!Ae&&d.jsx(Eo,{onSubmit:Oe,className:"flex flex-1 max-w-lg mx-8",children:d.jsxs(j,{className:"relative w-full",children:[d.jsx(At,{type:"text",value:P,onChange:K=>L(K.target.value),placeholder:Qe("common.search_placeholder"),className:"w-full px-4 py-2 pl-10 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-blue-500 focus:border-blue-500"}),d.jsx(fe,{name:"search",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500"})]})}),d.jsxs(j,{className:"flex items-center gap-2",children:[d.jsx(An,{autoText:Qe("common.theme.auto"),lightText:Qe("common.theme.light"),darkText:Qe("common.theme.dark")}),r?.uuid&&d.jsx(On,{notifications:g,unreadCount:o,hasMore:p,loading:m,unreadOnly:x,titleText:k??Qe("mypage.notifications.title"),emptyText:M??Qe("mypage.notifications.empty"),markAllReadText:v??Qe("mypage.notifications.mark_all_read"),deleteAllText:T??Qe("mypage.notifications.delete_all"),unreadOnlyText:I??Qe("mypage.notifications.unread_only"),onClose:S,onNotificationClick:N,onLoadMore:w,onMarkAllRead:y,onDeleteAll:E,onDelete:O,onUnreadOnlyToggle:$,dropdownAlign:"right"}),d.jsxs(R,{onClick:()=>vt(`${c}/cart`),className:"relative p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:[d.jsx(fe,{name:"shopping-cart",className:"w-5 h-5"}),n>0&&d.jsx(te,{className:"absolute -top-1 -right-1 w-5 h-5 flex items-center justify-center text-xs bg-blue-500 text-white rounded-full",children:n>99?"99+":n})]}),f&&f.length>1&&d.jsxs(j,{ref:be,className:"relative",children:[d.jsxs(R,{onClick:()=>G(!F),className:"flex items-center gap-1.5 px-2.5 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg cursor-pointer transition-colors","aria-haspopup":"listbox","aria-expanded":F,"aria-label":Qe("common.language"),children:[d.jsx(fe,{name:"globe",className:"w-4 h-4"}),d.jsx(te,{className:"font-medium uppercase",children:h}),d.jsx(fe,{name:"chevron-down",className:"w-3 h-3"})]}),F&&d.jsx(j,{role:"listbox",className:"absolute right-0 mt-2 w-44 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-50 overflow-hidden",children:f.map(K=>{const oe=K===h;return d.jsxs(R,{role:"option","aria-selected":oe,onClick:()=>$e(K),className:`w-full px-4 py-2.5 text-left text-sm flex items-center gap-3 cursor-pointer transition-colors ${oe?"bg-blue-50 dark:bg-blue-900/20 text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[d.jsx(fe,{name:"globe",className:"w-4 h-4"}),d.jsx(te,{className:"flex-1 font-medium",children:ze(K)}),oe&&d.jsx(fe,{name:"check",className:"w-4 h-4"})]},K)})})]}),d.jsx(Nn,{slotId:"header_currency",id:"header_currency_slot_desktop",className:"flex items-center"}),r?.uuid?d.jsxs(j,{ref:W,className:"relative",children:[d.jsxs(R,{onClick:()=>_(!U),className:"flex items-center gap-2 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",children:[d.jsx(Qr,{avatar:r.avatar,name:r.name,size:"sm"}),d.jsx(te,{className:"hidden sm:inline text-sm font-medium",children:r.name}),d.jsx(fe,{name:"chevron-down",className:"w-4 h-4"})]}),U&&d.jsxs(j,{className:"absolute right-0 mt-2 w-56 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-50",children:[d.jsx(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:d.jsxs(j,{className:"flex items-center gap-3",children:[d.jsx(Qr,{avatar:r.avatar,name:r.name,size:"md"}),d.jsxs(j,{children:[d.jsx(j,{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.name}),d.jsx(j,{className:"text-xs text-gray-500 dark:text-gray-400",children:Qe("common.member")})]})]})}),d.jsxs(j,{className:"py-1",children:[r.is_admin&&d.jsxs(d.Fragment,{children:[d.jsxs(So,{href:"/admin",className:"block w-full text-left px-4 py-2 text-sm text-blue-600 dark:text-blue-400 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer font-medium",children:[d.jsx(fe,{name:"settings",className:"inline w-4 h-4 mr-2"}),Qe("common.admin_menu")]}),d.jsx(To,{className:"my-1 border-gray-200 dark:border-gray-700"})]}),d.jsxs(R,{onClick:()=>{vt("/mypage"),_(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(fe,{name:"user",className:"inline w-4 h-4 mr-2"}),Qe("common.mypage")]}),d.jsxs(R,{onClick:()=>{vt("/mypage/orders"),_(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(fe,{name:"shopping-bag",className:"inline w-4 h-4 mr-2"}),Qe("mypage.tabs.orders")]}),d.jsxs(R,{onClick:()=>{vt("/mypage/wishlist"),_(!1)},className:"block w-full text-left px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(fe,{name:"heart",className:"inline w-4 h-4 mr-2"}),Qe("mypage.tabs.wishlist")]})]}),d.jsx(To,{className:"my-1 border-gray-200 dark:border-gray-700"}),d.jsxs(R,{onClick:we,className:"block w-full text-left px-4 py-2 text-sm text-red-600 dark:text-red-400 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer",children:[d.jsx(fe,{name:"log-out",className:"inline w-4 h-4 mr-2"}),Qe("auth.logout")]})]})]}):d.jsxs(j,{className:"flex items-center gap-1.5",children:[d.jsx(R,{onClick:()=>vt("/login?redirect=/mypage/orders"),className:"px-2.5 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:Qe("shop.guest_order_form.nav_link")}),d.jsx(R,{onClick:()=>vt("/login"),className:"px-2.5 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:Qe("auth.login")}),d.jsx(R,{onClick:()=>vt("/register"),className:"ml-1 px-3 py-2 text-sm font-medium text-white bg-emerald-500 rounded-lg hover:bg-emerald-600 cursor-pointer",children:Qe("auth.register_link")})]}),Ae&&d.jsx(R,{onClick:l,className:"p-2 text-gray-600 dark:text-gray-400",children:d.jsx(fe,{name:"menu",className:"w-6 h-6"})})]})]})}),!Ae&&d.jsx(Zr,{className:"border-t border-gray-200 dark:border-gray-800",children:d.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs(j,{className:"flex items-center gap-1 h-12 overflow-x-auto",children:[d.jsx(R,{onClick:()=>vt("/"),className:me(ve("/",!0)),"data-testid":"nav-home",children:Qe("nav.home")}),d.jsxs(R,{onClick:()=>vt("/boards/popular"),className:`flex items-center gap-1 ${me(ve("/boards/popular"))}`,"data-testid":"nav-popular",children:[d.jsx(te,{className:"text-orange-500",children:"🔥"}),Qe("nav.popular")]}),d.jsxs(R,{onClick:()=>vt(`${c==="/"?"":c}/products`),className:`flex items-center gap-1 ${me(We())}`,"data-testid":"nav-shop",children:[d.jsx(te,{children:"🛒"}),Qe("nav.shop")]}),Te.map(K=>d.jsxs(R,{onClick:()=>vt(`/board/${K.slug}`),className:me(ve(`/board/${K.slug}`)),children:[K.icon&&d.jsx(te,{className:"mr-1",children:K.icon}),K.name]},K.id)),ge.length>0&&d.jsxs(j,{ref:Q,className:"relative",children:[d.jsxs(R,{onClick:()=>{if(!b&&Q.current){const K=Q.current.getBoundingClientRect();B({top:K.bottom+4,left:K.left})}z(!b)},className:"flex items-center gap-1 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 hover:text-gray-900 dark:hover:text-white",children:[Qe("nav.more"),d.jsx(fe,{name:"chevron-down",className:"w-4 h-4"})]}),b&&d.jsx(j,{className:"fixed w-48 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-50",style:{top:`${X.top}px`,left:`${X.left}px`},children:ge.map(K=>{const oe=ve(`/board/${K.slug}`);return d.jsxs(R,{onClick:()=>{vt(`/board/${K.slug}`),z(!1)},className:`block w-full text-left px-4 py-2 text-sm cursor-pointer ${oe?"bg-gray-900 text-white dark:bg-white dark:text-gray-900":"text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}`,children:[K.icon&&d.jsx(te,{className:"mr-1",children:K.icon}),K.name]},K.id)})})]})]})})})]})},Bd=Object.freeze(Object.defineProperty({__proto__:null,default:xs},Symbol.toStringTag,{value:"Module"})),Wd=C.forwardRef(({children:e,className:t="",...r},n)=>d.jsx("footer",{ref:n,className:t,...r,children:e})),Nt=(e,t)=>window.G7Core?.t?.(e,t)??e,Vd=768,ks=1024,Kd=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},Cs=({siteName:e="그누보드7",siteDescription:t,copyrightText:r,socialLinks:n={},linkGroups:o,className:a="",editorAttrs:s})=>{const l=new Date().getFullYear(),h=window.G7Core?.useResponsive,i=h?.()?.width??(typeof window<"u"?window.innerWidth:ks),u=i<Vd,g=i>=ks,p=u?1:g?5:2,m=[{title:Nt("footer.community"),links:[{label:Nt("nav.home"),href:"/"},{label:Nt("nav.popular"),href:"/boards/popular"},{label:Nt("footer.all_boards"),href:"/boards"}]},{title:Nt("footer.info"),links:[{label:Nt("footer.about"),href:"/page/about"},{label:Nt("footer.faq"),href:"/page/faq"},{label:Nt("footer.contact"),href:"/page/contact"}]},{title:Nt("footer.policy"),links:[{label:Nt("footer.terms"),href:"/page/terms"},{label:Nt("footer.privacy"),href:"/page/privacy"},{label:Nt("footer.refund"),href:"/page/refund"}]}],x=o||m,k={github:"github",twitter:"twitter",discord:"discord",facebook:"facebook",instagram:"instagram"};return d.jsx(Wd,{...s??{},className:`bg-gray-50 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 ${a}`,children:d.jsxs(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[d.jsxs(j,{className:"grid gap-8",style:{gridTemplateColumns:`repeat(${p}, minmax(0, 1fr))`},children:[d.jsxs(j,{style:g?{gridColumn:"span 2 / span 2"}:void 0,children:[d.jsx(Tn,{className:"text-lg font-bold text-gray-900 dark:text-white",children:e}),t&&d.jsx(Gt,{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:t}),d.jsx(j,{className:"mt-4 flex items-center gap-4",children:Object.entries(n).map(([M,v])=>v?d.jsx(So,{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":M,children:d.jsx(fe,{name:k[M],className:"w-5 h-5"})},M):null)})]}),x.map((M,v)=>d.jsxs(j,{children:[d.jsx(hs,{className:"text-sm font-semibold text-gray-900 dark:text-white uppercase tracking-wider",children:M.title}),d.jsx(_o,{className:"mt-4 space-y-2",children:M.links.map((T,I)=>d.jsx(er,{children:d.jsx(R,{onClick:()=>Kd(T.href),className:"text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:T.label})},I))})]},v))]}),d.jsxs(j,{className:"mt-8 pt-8 border-t border-gray-200 dark:border-gray-800 flex justify-between items-center gap-4",style:{flexDirection:u?"column":"row"},children:[d.jsx(Gt,{className:"text-sm text-gray-500 dark:text-gray-400",children:r||`© ${l} ${e}. All rights reserved.`}),d.jsx(Gt,{className:"text-sm text-gray-500 dark:text-gray-400",children:Nt("footer.powered_by")})]})]})})},Yd=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"})),Bt=(e,t)=>window.G7Core?.t?.(e,t)??e,Lt=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},_s=({isOpen:e,onClose:t,logo:r,siteName:n="그누보드7",user:o,boards:a=[],cartCount:s=0})=>{const l=C.useRef(null),h=window.G7Core?.useResponsive,c=h?.(),i=c?c.width<1024:typeof window<"u"&&window.innerWidth<1024;C.useEffect(()=>{const g=p=>{p.key==="Escape"&&t()};return e&&(document.addEventListener("keydown",g),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",g),document.body.style.overflow=""}},[e,t]);const u=g=>{g.target===g.currentTarget&&t()};return!e||!i?null:d.jsxs(j,{className:"fixed inset-0 z-50",onClick:u,children:[d.jsx(j,{className:"fixed inset-0 bg-black/50 transition-opacity"}),d.jsxs(j,{ref:l,className:`fixed inset-y-0 left-0 w-80 max-w-[85vw] bg-white dark:bg-gray-900 shadow-xl transform transition-transform duration-300 ${e?"translate-x-0":"-translate-x-full"}`,children:[d.jsxs(j,{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800",children:[d.jsx(R,{onClick:()=>{t(),Lt("/")},className:"flex items-center gap-2 cursor-pointer",children:r?d.jsx(jt,{src:r,alt:n,className:"h-8"}):d.jsx(te,{className:"text-xl font-bold text-gray-900 dark:text-white",children:n})}),d.jsx(R,{onClick:t,className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":"메뉴 닫기",children:d.jsx(fe,{name:"x",className:"w-6 h-6"})})]}),o?d.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:d.jsxs(j,{className:"flex items-center gap-3",children:[o.avatar?d.jsx(jt,{src:o.avatar,alt:o.name,className:"w-12 h-12 rounded-full"}):d.jsx(j,{className:"w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center text-white text-lg font-medium",children:(o.name||"U").charAt(0).toUpperCase()}),d.jsxs(j,{children:[d.jsx(Gt,{className:"font-medium text-gray-900 dark:text-white",children:o.name}),d.jsx(R,{onClick:()=>{t(),Lt("/mypage")},className:"text-sm text-blue-600 dark:text-blue-400 hover:underline cursor-pointer",children:Bt("common.mypage")})]})]})}):d.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:d.jsxs(j,{className:"flex gap-2",children:[d.jsx(R,{onClick:()=>{t(),Lt("/login")},className:"flex-1 py-2 text-center text-sm font-medium text-white bg-gray-900 dark:bg-white dark:text-gray-900 rounded-lg cursor-pointer",children:Bt("auth.login")}),d.jsx(R,{onClick:()=>{t(),Lt("/register")},className:"flex-1 py-2 text-center text-sm font-medium text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer",children:Bt("auth.register")})]})}),d.jsx(Zr,{className:"p-4 overflow-y-auto max-h-[calc(100vh-200px)]",children:d.jsxs(_o,{className:"space-y-1",children:[d.jsx(er,{children:d.jsxs(R,{onClick:()=>{t(),Lt("/")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(fe,{name:"home",className:"w-5 h-5"}),Bt("nav.home")]})}),d.jsx(er,{children:d.jsxs(R,{onClick:()=>{t(),Lt("/popular")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(te,{className:"text-orange-500",children:"🔥"}),Bt("nav.popular")]})}),d.jsx(er,{children:d.jsxs(R,{onClick:()=>{t(),Lt("/shop")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(te,{children:"🛒"}),Bt("nav.shop")]})}),d.jsx(er,{children:d.jsxs(R,{onClick:()=>{t(),Lt("/cart")},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[d.jsx(fe,{name:"shopping-cart",className:"w-5 h-5"}),Bt("nav.cart"),s>0&&d.jsx(te,{className:"ml-auto px-2 py-0.5 text-xs bg-blue-500 text-white rounded-full",children:s})]})}),d.jsx(er,{className:"my-4 border-t border-gray-200 dark:border-gray-800"}),d.jsx(er,{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:Bt("nav.boards")}),a.map(g=>d.jsx(er,{children:d.jsxs(R,{onClick:()=>{t(),Lt(`/board/${g.slug}`)},className:"flex items-center gap-3 px-3 py-2 w-full text-left text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg cursor-pointer",children:[g.icon&&d.jsx(te,{children:g.icon}),g.name]})},g.id))]})}),d.jsx(j,{className:"absolute bottom-0 left-0 right-0 p-4 border-t border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900",children:d.jsxs(j,{className:"flex items-center justify-between text-sm text-gray-500 dark:text-gray-400",children:[d.jsx(R,{onClick:()=>{t(),Lt("/about")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Bt("footer.about")}),d.jsx(R,{onClick:()=>{t(),Lt("/terms")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Bt("footer.terms")}),d.jsx(R,{onClick:()=>{t(),Lt("/privacy")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Bt("footer.privacy")})]})})]})]})},Xd=Object.freeze(Object.defineProperty({__proto__:null,default:_s},Symbol.toStringTag,{value:"Module"}));function Ss(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function qd(e){if(Array.isArray(e))return e}function Zd(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,o,a,s,l=[],f=!0,h=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(f=(n=a.call(r)).done)&&(l.push(n.value),l.length!==t);f=!0);}catch(c){h=!0,o=c}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw o}}return l}}function Qd(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jd(e,t){return qd(e)||Zd(e,t)||Rd(e,t)||Qd()}function Rd(e,t){if(e){if(typeof e=="string")return Ss(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ss(e,t):void 0}}const Es=Object.entries,Ts=Object.setPrototypeOf,eu=Object.isFrozen,tu=Object.getPrototypeOf,ru=Object.getOwnPropertyDescriptor;let ot=Object.freeze,lt=Object.seal,Nr=Object.create,As=typeof Reflect<"u"&&Reflect,Oo=As.apply,Mo=As.construct;ot||(ot=function(t){return t}),lt||(lt=function(t){return t}),Oo||(Oo=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return t.apply(r,o)}),Mo||(Mo=function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return new t(...n)});const dr=tt(Array.prototype.forEach),nu=tt(Array.prototype.lastIndexOf),Ns=tt(Array.prototype.pop),Jr=tt(Array.prototype.push),ou=tt(Array.prototype.splice),Or=Array.isArray,Rr=tt(String.prototype.toLowerCase),Io=tt(String.prototype.toString),Os=tt(String.prototype.match),en=tt(String.prototype.replace),Ms=tt(String.prototype.indexOf),au=tt(String.prototype.trim),su=tt(Number.prototype.toString),lu=tt(Boolean.prototype.toString),Is=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),Ds=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),wt=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),gt=tt(RegExp.prototype.test),ur=iu(TypeError);function tt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return Oo(e,t,n)}}function iu(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Mo(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(Ts&&Ts(e,null),!Or(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(eu(t)||(t[n]=a),o=a)}e[o]=!0}return e}function cu(e){for(let t=0;t<e.length;t++)wt(e,t)||(e[t]=null);return e}function Ot(e){const t=Nr(null);for(const n of Es(e)){var r=Jd(n,2);const o=r[0],a=r[1];wt(e,o)&&(Or(a)?t[o]=cu(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=Ot(a):t[o]=a)}return t}function du(e){switch(typeof e){case"string":return e;case"number":return su(e);case"boolean":return lu(e);case"bigint":return Is?Is(e):"0";case"symbol":return Ds?Ds(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Wt(t,"toString");if(typeof r=="function"){const n=r(t);return typeof n=="string"?n:tn(n)}return tn(e)}default:return tn(e)}}function Wt(e,t){for(;e!==null;){const n=ru(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=tu(e)}function r(){return null}return r}function uu(e){try{return gt(e,""),!0}catch{return!1}}const Ps=ot(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Do=ot(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Po=ot(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),fu=ot(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Lo=ot(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),gu=ot(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ls=ot(["#text"]),$s=ot(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),$o=ot(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Fs=ot(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Mn=ot(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),hu=lt(/{{[\w\W]*|^[\w\W]*}}/g),pu=lt(/<%[\w\W]*|^[\w\W]*%>/g),mu=lt(/\${[\w\W]*/g),bu=lt(/^data-[\-\w.\u00B7-\uFFFF]+$/),yu=lt(/^aria-[\-\w]+$/),Us=lt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vu=lt(/^(?:\w+script|data):/i),wu=lt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),xu=lt(/^html$/i),ku=lt(/^[a-z][.\w]*(-[.\w]+)+$/i),zs=lt(/<[/\w!]/g),Hs=lt(/<[/\w]/g),Cu=lt(/<\/no(script|embed|frames)/i),_u=lt(/\/>/i),Mt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gs=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],Su=ot(Ge({},Gs)),Eu=(function(){const e={};return dr(Gs,t=>{e[t]=lt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ot(e)})(),Tu=function(){return typeof window>"u"?null:window},Au=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(n=r.getAttribute(o));const a="dompurify"+(n?"#"+n:"");try{return t.createPolicy(a,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},js=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},rr=function(t,r,n,o){return wt(t,r)&&Or(t[r])?Ge(o.base?Ot(o.base):{},t[r],o.transform):n},Fo=function(t,r,n){const o=wt(t,r)?t[r]:void 0;return o&&typeof o=="object"?Ot(o):n()};function Bs(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Tu();const t=J=>Bs(J);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Mt.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const n=r,o=n.currentScript;e.DocumentFragment;const a=e.HTMLTemplateElement,s=e.Node,l=e.Element,f=e.NodeFilter,h=e.NamedNodeMap;h===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,i=e.trustedTypes,u=l.prototype,g=Wt(u,"cloneNode"),p=Wt(u,"remove"),m=Wt(u,"nextSibling"),x=Wt(u,"childNodes"),k=Wt(u,"parentNode"),M=Wt(u,"shadowRoot"),v=Wt(u,"attributes"),T=s&&s.prototype?Wt(s.prototype,"nodeType"):null,I=s&&s.prototype?Wt(s.prototype,"nodeName"):null,S=s&&s.prototype?Wt(s.prototype,"ownerDocument"):null,N=function(D){return T?T(D):D.nodeType},w=function(D){return I?I(D):D.nodeName};if(typeof a=="function"){const J=r.createElement("template");J.content&&J.content.ownerDocument&&(r=J.content.ownerDocument)}let y,E="",O,$=!1,P=0;const L=function(){if(P>0)throw ur('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},U=function(D){L(),P++;try{return y.createHTML(D)}finally{P--}},_=function(D){L(),P++;try{return y.createScriptURL(D)}finally{P--}},b=function(){return $||(O=Au(i,o),$=!0),O},z=r,F=z.implementation,G=z.createNodeIterator,X=z.createDocumentFragment,B=z.getElementsByTagName,Y=n.importNode;let H=js();t.isSupported=typeof Es=="function"&&typeof k=="function"&&F&&F.createHTMLDocument!==void 0;const W=hu,Q=pu,be=mu,se=bu,pe=yu,ne=vu,Ae=wu,ve=ku;let We=Us,me=null;const Te=Ge({},[...Ps,...Do,...Po,...Lo,...Ls]);let ge=null;const Oe=Ge({},[...$s,...$o,...Fs,...Mn]);let we=Object.seal(Nr(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,ze=null;const K=Object.seal(Nr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ae=!0,ce=!1,ke=!0,Ee=!1,Be=!0,Me=!1,Ke=!1,Pe=null,q=null,le=!1,de=!1,ue=!1,ie=!1,Fe=!0,Ce=!1;const Ie="user-content-";let Ne=!0,He=!1,je={},_e=null;const xe=Ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let De=null;const Ye=Ge({},["audio","video","img","source","image","track"]);let rt=null;const qe=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Je="http://www.w3.org/1998/Math/MathML",Zt="http://www.w3.org/2000/svg",Ve="http://www.w3.org/1999/xhtml";let bt=Ve,St=!1,Pt=null;const _r=Ge({},[Je,Zt,Ve],Io),lr=ot(["mi","mo","mn","ms","mtext"]);let Ht=Ge({},lr);const ir=ot(["annotation-xml"]);let Sr=Ge({},ir);const Vm=Ge({},["title","style","font","a","script"]);let _n=null;const Km=["application/xhtml+xml","text/html"],Ym="text/html";let et=null,Xr=null;const Xm=r.createElement("form"),od=function(D){return D instanceof RegExp||D instanceof Function},ss=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Xr&&Xr===D)return;(!D||typeof D!="object")&&(D={}),D=Ot(D),_n=Km.indexOf(D.PARSER_MEDIA_TYPE)===-1?Ym:D.PARSER_MEDIA_TYPE,et=_n==="application/xhtml+xml"?Io:Rr,me=rr(D,"ALLOWED_TAGS",Te,{transform:et}),ge=rr(D,"ALLOWED_ATTR",Oe,{transform:et}),Pt=rr(D,"ALLOWED_NAMESPACES",_r,{transform:Io}),rt=rr(D,"ADD_URI_SAFE_ATTR",qe,{transform:et,base:qe}),De=rr(D,"ADD_DATA_URI_TAGS",Ye,{transform:et,base:Ye}),_e=rr(D,"FORBID_CONTENTS",xe,{transform:et}),$e=rr(D,"FORBID_TAGS",Ot({}),{transform:et}),ze=rr(D,"FORBID_ATTR",Ot({}),{transform:et}),je=wt(D,"USE_PROFILES")?D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?Ot(D.USE_PROFILES):D.USE_PROFILES:!1,oe=D.ALLOW_ARIA_ATTR!==!1,ae=D.ALLOW_DATA_ATTR!==!1,ce=D.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ee=D.SAFE_FOR_TEMPLATES||!1,Be=D.SAFE_FOR_XML!==!1,Me=D.WHOLE_DOCUMENT||!1,de=D.RETURN_DOM||!1,ue=D.RETURN_DOM_FRAGMENT||!1,ie=D.RETURN_TRUSTED_TYPE||!1,le=D.FORCE_BODY||!1,Fe=D.SANITIZE_DOM!==!1,Ce=D.SANITIZE_NAMED_PROPS||!1,Ne=D.KEEP_CONTENT!==!1,He=D.IN_PLACE||!1,We=uu(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:Us,bt=typeof D.NAMESPACE=="string"?D.NAMESPACE:Ve,Ht=Fo(D,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ge({},lr)),Sr=Fo(D,"HTML_INTEGRATION_POINTS",()=>Ge({},ir));const V=Fo(D,"CUSTOM_ELEMENT_HANDLING",()=>Nr(null));if(we=Nr(null),wt(V,"tagNameCheck")&&od(V.tagNameCheck)&&(we.tagNameCheck=V.tagNameCheck),wt(V,"attributeNameCheck")&&od(V.attributeNameCheck)&&(we.attributeNameCheck=V.attributeNameCheck),wt(V,"allowCustomizedBuiltInElements")&&typeof V.allowCustomizedBuiltInElements=="boolean"&&(we.allowCustomizedBuiltInElements=V.allowCustomizedBuiltInElements),lt(we),Ee&&(ae=!1),ue&&(de=!0),je&&(me=Ge({},Ls),ge=Nr(null),je.html===!0&&(Ge(me,Ps),Ge(ge,$s)),je.svg===!0&&(Ge(me,Do),Ge(ge,$o),Ge(ge,Mn)),je.svgFilters===!0&&(Ge(me,Po),Ge(ge,$o),Ge(ge,Mn)),je.mathMl===!0&&(Ge(me,Lo),Ge(ge,Fs),Ge(ge,Mn))),K.tagCheck=null,K.attributeCheck=null,wt(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?K.tagCheck=D.ADD_TAGS:Or(D.ADD_TAGS)&&(me===Te&&(me=Ot(me)),Ge(me,D.ADD_TAGS,et))),wt(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?K.attributeCheck=D.ADD_ATTR:Or(D.ADD_ATTR)&&(ge===Oe&&(ge=Ot(ge)),Ge(ge,D.ADD_ATTR,et))),wt(D,"ADD_FORBID_CONTENTS")&&Or(D.ADD_FORBID_CONTENTS)&&(_e===xe&&(_e=Ot(_e)),Ge(_e,D.ADD_FORBID_CONTENTS,et)),Ne&&(me["#text"]=!0),Me&&Ge(me,["html","head","body"]),me.table&&(Ge(me,["tbody"]),delete $e.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw ur('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ur('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Z=y;y=D.TRUSTED_TYPES_POLICY;try{E=U("")}catch(re){throw y=Z,re}}else D.TRUSTED_TYPES_POLICY===null?(y=void 0,E=""):(y===void 0&&(y=b()),y&&typeof E=="string"&&(E=U("")));ot&&ot(D),Xr=D},ad=Ge({},[...Do,...Po,...fu]),sd=Ge({},[...Lo,...gu]),qm=function(D,V,Z){return V.namespaceURI===Ve?D==="svg":V.namespaceURI===Je?D==="svg"&&(Z==="annotation-xml"||Ht[Z]):!!ad[D]},Zm=function(D,V,Z){return V.namespaceURI===Ve?D==="math":V.namespaceURI===Zt?D==="math"&&Sr[Z]:!!sd[D]},Qm=function(D,V,Z){return V.namespaceURI===Zt&&!Sr[Z]||V.namespaceURI===Je&&!Ht[Z]?!1:!sd[D]&&(Vm[D]||!ad[D])},Jm=function(D){let V=k(D);(!V||!V.tagName)&&(V={namespaceURI:bt,tagName:"template"});const Z=Rr(D.tagName),re=Rr(V.tagName);return Pt[D.namespaceURI]?D.namespaceURI===Zt?qm(Z,V,re):D.namespaceURI===Je?Zm(Z,V,re):D.namespaceURI===Ve?Qm(Z,V,re):!!(_n==="application/xhtml+xml"&&Pt[D.namespaceURI]):!1},cr=function(D){Jr(t.removed,{element:D});try{k(D).removeChild(D)}catch{if(p(D),!k(D))throw ur("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},ld=function(D,V,Z){try{D.removeAttributeNode(V)}catch{try{D.removeAttribute(Z)}catch{}}},mo=function(D){bo(D);const V=x(D);if(V){const re=[];dr(V,he=>{Jr(re,he)}),dr(re,he=>{try{p(he)}catch{}})}const Z=v(D);if(Z)for(let re=Z.length-1;re>=0;--re){const he=Z[re],Se=he&&he.name;typeof Se=="string"&&ld(D,he,Se)}},Er=function(D,V,Z){if(!Z)try{Z=V.getAttributeNode(D)}catch{Z=null}Jr(t.removed,{attribute:Z||null,from:V});try{Z?V.removeAttributeNode(Z):V.removeAttribute(D)}catch{try{V.removeAttribute(D)}catch{}}if(D==="is")if(de||ue)try{cr(V)}catch{}else try{V.setAttribute(D,"")}catch{}},Rm=function(D){const V=v(D);if(V)for(let Z=V.length-1;Z>=0;--Z){const re=V[Z],he=re&&re.name;typeof he!="string"||ge[et(he)]||ld(D,re,he)}},bo=function(D){const V=[D];for(;V.length>0;){const Z=V.pop();N(Z)===Mt.element&&Rm(Z);const he=x(Z);if(he)for(let Se=he.length-1;Se>=0;--Se)V.push(he[Se])}},id=function(D,V){return Be?D==="patchsrc"?!0:D==="for"&&V!=="label"&&V!=="output":!1},eb=function(D){if(!Be)return;const V=[D];for(;V.length>0;){const Z=V.pop(),re=N(Z);if(re===Mt.processingInstruction||re===Mt.comment&>(Hs,Z.data)){try{p(Z)}catch{}continue}if(re===Mt.element){const Se=Z,Ze=et(w(Z));try{Se.hasAttribute&&Se.hasAttribute("patchsrc")&&Se.removeAttribute("patchsrc"),Se.hasAttribute&&Se.hasAttribute("for")&&id("for",Ze)&&Se.removeAttribute("for")}catch{}}const he=x(Z);if(he)for(let Se=he.length-1;Se>=0;--Se)V.push(he[Se])}},cd=function(D){let V=null,Z=null;if(le)D="<remove></remove>"+D;else{const Se=Os(D,/^[\r\n\t ]+/);Z=Se&&Se[0]}_n==="application/xhtml+xml"&&bt===Ve&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const re=y?U(D):D;if(bt===Ve)try{V=new c().parseFromString(re,_n)}catch{}if(!V||!V.documentElement){V=F.createDocument(bt,"template",null);try{V.documentElement.innerHTML=St?E:re}catch{}}const he=V.body||V.documentElement;return D&&Z&&he.insertBefore(r.createTextNode(Z),he.childNodes[0]||null),bt===Ve?B.call(V,Me?"html":"body")[0]:Me?V.documentElement:he},dd=function(D){const V=S?S(D):D.ownerDocument;return G.call(V||D,D,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},yo=function(D){return D=en(D,W," "),D=en(D,Q," "),D=en(D,be," "),D},ls=function(D){var V;D.normalize();const Z=S?S(D):D.ownerDocument,re=G.call(Z||D,D,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let he=re.nextNode();for(;he;)he.data=yo(he.data),he=re.nextNode();const Se=(V=D.querySelectorAll)===null||V===void 0?void 0:V.call(D,"template");Se&&dr(Se,Ze=>{qr(Ze.content)&&ls(Ze.content)})},vo=function(D){const V=I?I(D):null;return typeof V!="string"||et(V)!=="form"?!1:typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||D.attributes!==v(D)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function"||D.nodeType!==T(D)||D.childNodes!==x(D)},qr=function(D){if(!T||typeof D!="object"||D===null)return!1;try{return T(D)===Mt.documentFragment}catch{return!1}},Sn=function(D){if(!T||typeof D!="object"||D===null)return!1;try{return typeof T(D)=="number"}catch{return!1}};function Rt(J,D,V){J.length!==0&&dr(J,Z=>{Z.call(t,D,V,Xr)})}const tb=function(D,V){return!!(Be&&D.hasChildNodes()&&!Sn(D.firstElementChild)&>(zs,D.textContent)&>(zs,D.innerHTML)||Be&&D.namespaceURI===Ve&&Su[V]&&(Sn(D.firstElementChild)||typeof D.textContent=="string"&>(Eu[V],D.textContent))||D.nodeType===Mt.processingInstruction||Be&&D.nodeType===Mt.comment&>(Hs,D.data))},wo=function(D,V){if(D instanceof RegExp)return gt(D,V);if(D instanceof Function){for(var Z=arguments.length,re=new Array(Z>2?Z-2:0),he=2;he<Z;he++)re[he-2]=arguments[he];return!!D(V,...re)}return!1},rb=function(D,V,Z){if(!$e[V]&&pd(V)&&wo(we.tagNameCheck,V))return!1;if(Ne&&!_e[V]){const re=k(D),he=x(D);if(he&&re){const Se=he.length;for(let Ze=Se-1;Ze>=0;--Ze){const Re=D===Z?g(he[Ze],!0):he[Ze];re.insertBefore(Re,m(D))}}}return cr(D),!0},ud=function(D,V,Z,re){return D.length===0?V:V===Z||V===re?Ot(V):V},fd=function(D,V){return D===V||k(D)!==null?!1:(He&&bo(D),!0)},gd=function(D,V){if(Rt(H.beforeSanitizeElements,D,null),fd(D,V))return!0;if(vo(D))return cr(D),!0;const Z=et(w(D));if(me=ud(H.uponSanitizeElement,me,Te,Pe),Rt(H.uponSanitizeElement,D,{tagName:Z,allowedTags:me}),fd(D,V))return!0;if(tb(D,Z))return cr(D),!0;if($e[Z]||!(K.tagCheck instanceof Function&&K.tagCheck(Z))&&!me[Z]){const he=rb(D,Z,V);return he===!1&&Rt(H.afterSanitizeElements,D,null),he}if(N(D)===Mt.element&&!Jm(D)||(Z==="noscript"||Z==="noembed"||Z==="noframes")&>(Cu,D.innerHTML))return cr(D),!0;if(Ee&&D.nodeType===Mt.text){const he=yo(D.textContent);D.textContent!==he&&(Jr(t.removed,{element:D.cloneNode()}),D.textContent=he)}return Rt(H.afterSanitizeElements,D,null),!1},hd=function(D,V,Z){if(ze[V]||id(V,D)||Fe&&(V==="id"||V==="name")&&(Z in r||Z in Xm))return!1;const re=ge[V]||K.attributeCheck instanceof Function&&K.attributeCheck(V,D);return ae&>(se,V)||oe&>(pe,V)?!0:re?rt[V]||gt(We,en(Z,Ae,""))||(V==="src"||V==="xlink:href"||V==="href")&&D!=="script"&&Ms(Z,"data:")===0&&De[D]||ce&&!gt(ne,en(Z,Ae,""))?!0:!Z:pd(D)&&wo(we.tagNameCheck,D)&&wo(we.attributeNameCheck,V,D)||V==="is"&&we.allowCustomizedBuiltInElements&&wo(we.tagNameCheck,Z)},nb=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pd=function(D){return!nb[Rr(D)]&>(ve,D)},ob=function(D,V,Z,re){if(y&&typeof i=="object"&&typeof i.getAttributeType=="function"&&!Z)switch(i.getAttributeType(D,V)){case"TrustedHTML":return U(re);case"TrustedScriptURL":return _(re)}return re},ab=function(D,V,Z,re){try{Z?D.setAttributeNS(Z,V,re):D.setAttribute(V,re),vo(D)?cr(D):Ns(t.removed)}catch{Er(V,D)}},md=function(D){Rt(H.beforeSanitizeAttributes,D,null);const V=D.attributes;if(!V||vo(D))return;ge=ud(H.uponSanitizeAttribute,ge,Oe,q);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ge,forceKeepAttr:void 0};let re=V.length;const he=et(D.nodeName);for(;re--;){const Se=V[re],Ze=Se.name,Re=Se.namespaceURI,Et=Se.value,Tt=et(Ze),cs=Et;let yt=Ze==="value"?cs:au(cs);if(Z.attrName=Tt,Z.attrValue=yt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,Rt(H.uponSanitizeAttribute,D,Z),yt=Z.attrValue,Ce&&(Tt==="id"||Tt==="name")&&Ms(yt,Ie)!==0&&(Er(Ze,D,Se),yt=Ie+yt),Be&>(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,yt)){Er(Ze,D,Se);continue}if(Tt==="attributename"&&Os(yt,"href")){Er(Ze,D,Se);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){Er(Ze,D,Se);continue}if(!ke&>(_u,yt)){Er(Ze,D,Se);continue}if(Ee&&(yt=yo(yt)),!hd(he,Tt,yt)){Er(Ze,D,Se);continue}yt=ob(he,Tt,Re,yt),yt!==cs&&ab(D,Ze,Re,yt)}}Rt(H.afterSanitizeAttributes,D,null)},xo=function(D){let V=null;const Z=dd(D);for(Rt(H.beforeSanitizeShadowDOM,D,null);V=Z.nextNode();)if(Rt(H.uponSanitizeShadowNode,V,null),gd(V,D),md(V),qr(V.content)&&xo(V.content),N(V)===Mt.element){const re=M(V);qr(re)&&(is(re),xo(re))}Rt(H.afterSanitizeShadowDOM,D,null)},is=function(D){const V=[{node:D,shadow:null}];for(;V.length>0;){const Z=V.pop();if(Z.shadow){xo(Z.shadow);continue}const re=Z.node,Se=N(re)===Mt.element,Ze=x(re);if(Ze)for(let Re=Ze.length-1;Re>=0;--Re)V.push({node:Ze[Re],shadow:null});if(Se){const Re=I?I(re):null;if(typeof Re=="string"&&et(Re)==="template"){const Et=re.content;qr(Et)&&V.push({node:Et,shadow:null})}}if(Se){const Re=M(re);qr(Re)&&V.push({node:null,shadow:Re},{node:Re,shadow:null})}}};return t.sanitize=function(J){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,Z=null,re=null,he=null;if(St=!J,St&&(J="<!-->"),typeof J!="string"&&!Sn(J)&&(J=du(J),typeof J!="string"))throw ur("dirty is not a string, aborting");if(!t.isSupported)return J;Ke?(me=Pe,ge=q):ss(D),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(me=Ot(me)),H.uponSanitizeAttribute.length>0&&(ge=Ot(ge)),t.removed=[];const Se=He&&typeof J!="string"&&Sn(J);if(Se){eb(J);const Et=w(J);if(typeof Et=="string"){const Tt=et(Et);if(!me[Tt]||$e[Tt])throw mo(J),ur("root node is forbidden and cannot be sanitized in-place")}if(vo(J))throw mo(J),ur("root node is clobbered and cannot be sanitized in-place");try{is(J)}catch(Tt){throw mo(J),Tt}}else if(Sn(J))V=cd("<!---->"),Z=V.ownerDocument.importNode(J,!0),Z.nodeType===Mt.element&&Z.nodeName==="BODY"||Z.nodeName==="HTML"?V=Z:V.appendChild(Z),is(Z);else{if(!de&&!Ee&&!Me&&J.indexOf("<")===-1)return y&&ie?U(J):J;if(V=cd(J),!V)return de?null:ie?E:""}V&&le&&cr(V.firstChild);const Ze=Se?J:V;try{const Et=dd(Ze);for(;re=Et.nextNode();)gd(re,Ze),md(re),qr(re.content)&&xo(re.content)}catch(Et){throw Se&&(mo(J),dr(t.removed,Tt=>{Tt.element&&bo(Tt.element)})),Et}if(Se)return dr(t.removed,Et=>{Et.element&&bo(Et.element)}),Ee&&ls(J),J;if(de){if(Ee&&ls(V),ue)for(he=X.call(V.ownerDocument);V.firstChild;)he.appendChild(V.firstChild);else he=V;return(ge.shadowroot||ge.shadowrootmode)&&(he=Y.call(n,he,!0)),he}let Re=Me?V.outerHTML:V.innerHTML;return Me&&me["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&>(xu,V.ownerDocument.doctype.name)&&(Re="<!DOCTYPE "+V.ownerDocument.doctype.name+`>
|
||
`+Re),Ee&&(Re=yo(Re)),y&&ie?U(Re):Re},t.setConfig=function(){let J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ss(J),Ke=!0,Pe=me,q=ge},t.clearConfig=function(){Xr=null,Ke=!1,Pe=null,q=null,y=O,E=""},t.isValidAttribute=function(J,D,V){Xr||ss({});const Z=et(J),re=et(D);return hd(Z,re,V)},t.addHook=function(J,D){typeof D=="function"&&wt(H,J)&&Jr(H[J],D)},t.removeHook=function(J,D){if(wt(H,J)){if(D!==void 0){const V=nu(H[J],D);return V===-1?void 0:ou(H[J],V,1)[0]}return Ns(H[J])}},t.removeHooks=function(J){wt(H,J)&&(H[J]=[])},t.removeAllHooks=function(){H=js()},t}var Uo=Bs();const Nu=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&(n.preferredCurrency||n.defaultCurrency)||""},[t,r]=C.useState(e);return C.useEffect(()=>{const n=window.G7Core?.state?.subscribe;if(r(e()),typeof n!="function")return;const o=n(a=>{r(a&&(a.preferredCurrency||a.defaultCurrency)||"")});return typeof o=="function"?o:void 0},[]),t},Ou=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},Mu=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},Ws=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=Nu(),f=v=>{const T=`multi_currency_${v}`,I=e[T];if(I&&I[l])return I[l].formatted;const S=`${v}_formatted`;return e[S]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",c=f("selling_price"),i=f("list_price"),u=e.discount_rate&&e.discount_rate>0,g=e.sales_status&&e.sales_status!=="on_sale",p=e.labels??[],m=v=>Uo.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),x=e.name_highlighted,k=e.description_highlighted??e.short_description,M=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,T=e.product_code??e.id;Ou(`${v}/products/${T}`,n)}};return d.jsxs(R,{onClick:M,className:`block w-full text-left group bg-white dark:bg-gray-800 rounded-lg border border-gray-200 dark:border-gray-700 overflow-hidden hover:shadow-lg transition-shadow cursor-pointer ${o}`,id:a,...s,children:[d.jsxs(j,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[d.jsx(jt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&d.jsx(j,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:d.jsx(te,{className:`text-lg font-bold ${e.sales_status==="sold_out"?"text-red-300":e.sales_status==="suspended"?"text-amber-300":"text-blue-300"}`,style:{textShadow:"0 1px 4px rgba(0,0,0,0.6)"},children:e.sales_status_label??e.sales_status})}),u&&e.sales_status!=="sold_out"&&e.sales_status!=="suspended"&&d.jsxs(te,{className:"absolute top-2 left-2 px-2 py-1 bg-red-500 text-white text-xs font-bold rounded",children:[e.discount_rate,"%"]}),p.length>0&&d.jsx(j,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,T)=>d.jsx(te,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},T))})]}),d.jsxs(j,{className:"p-4",children:[d.jsxs(j,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&d.jsx(te,{className:"inline-block text-xs font-medium text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/30 px-2 py-0.5 rounded",children:e.primary_category}),e.brand_name&&d.jsx(te,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),x?d.jsx(j,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(x)}}):d.jsx(Tn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),k&&d.jsx(j,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400 line-clamp-2 [&_mark]:bg-yellow-200 [&_mark]:dark:bg-yellow-500/40 [&_mark]:px-0.5 [&_mark]:rounded",dangerouslySetInnerHTML:{__html:m(k)}}),d.jsxs(j,{className:"mt-1.5 flex items-center gap-1",children:[Mu(e.rating_avg??0).map((v,T)=>d.jsxs(te,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&d.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&d.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&d.jsx("i",{className:"fa-regular fa-star"})]},T)),d.jsx(te,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),d.jsxs(te,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),d.jsxs(j,{className:"mt-2 flex items-baseline gap-2",children:[d.jsx(te,{className:"font-bold text-gray-900 dark:text-white",children:c}),i&&u&&d.jsx(te,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},Iu=Object.freeze(Object.defineProperty({__proto__:null,default:Ws},Symbol.toStringTag,{value:"Module"})),Du={ALLOWED_TAGS:["svg","g","defs","title","desc","rect","circle","ellipse","line","polyline","polygon","path","text","tspan","linearGradient","radialGradient","stop","clipPath"],ALLOWED_ATTR:["xmlns","width","height","viewBox","role","aria-label","aria-hidden","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","opacity","transform","x","y","x1","y1","x2","y2","cx","cy","r","rx","ry","d","points","width","height","text-anchor","dominant-baseline","font-family","font-size","font-weight","offset","stop-color","stop-opacity","gradientUnits","id","clip-path"],FORBID_TAGS:["script","foreignObject","image","use","a","style"],FORBID_ATTR:["onload","onerror","onclick","onmouseover","onfocus","onblur","href","xlink:href"]},zo=({brandMark:e,size:t=32,className:r="",id:n,editorAttrs:o})=>{const a=e?.svg,s=e?.text,l=C.useMemo(()=>!a||a.trim()===""?"":Uo.sanitize(a,Du),[a]),f={width:`${t}px`,height:`${t}px`,flex:`0 0 ${t}px`};if(l)return d.jsx(j,{id:n,"aria-hidden":"true",className:`inline-flex items-center justify-center ${r}`.trim(),style:f,dangerouslySetInnerHTML:{__html:l},...o});if(s&&s.trim()!==""){const h=e?.class??"bg-gray-500 text-white";return d.jsx(te,{id:n,"aria-hidden":"true",className:`inline-flex items-center justify-center rounded-lg text-xs font-bold ${h} ${r}`.trim(),style:f,...o,children:s})}return null},Pu=Object.freeze(Object.defineProperty({__proto__:null,BrandMark:zo,default:zo},Symbol.toStringTag,{value:"Module"})),Vs="carousel",rn="controller",Lu="navigation",$u="no-scroll",Ho="portal",Fu="root",Ks="toolbar",Uu="counter",nn="fullscreen",Ys="slideshow",on="thumbnails",Xs="zoom",Mr="loading",Go="playing",an="error",sn="complete",zu="placeholder",ln=e=>`active-slide-${e}`,Hu=ln(Mr),Gu=ln(Go),ju=ln(an),Bu=ln(sn),qs="fullsize",Ir="flex_center",Wu="no_scroll",Zs="no_scroll_padding",jo="slide",Qs="slide_wrapper",Vu="slide_wrapper_interactive",nr="prev",or="next",Bo="swipe",Dr="close",Js="onPointerDown",Rs="onPointerMove",el="onPointerUp",tl="onPointerLeave",rl="onPointerCancel",Wo="onKeyDown",Ku="onKeyUp",Vo="onWheel",Yu="Escape",Xu="ArrowLeft",qu="ArrowRight",Zu="button",In="icon",nl="contain",ol="cover",al="Unknown action type",sl="yarl__";function ht(...e){return[...e].filter(Boolean).join(" ")}function ye(e){return`${sl}${e}`}function Xe(e){return`--${sl}${e}`}function fr(e,t){return`${e}${t?`_${t}`:""}`}function gr(e){return t=>fr(e,t)}function hr(e,t){var r;return(r=e?.[t])!==null&&r!==void 0?r:t}function ll(e,t,r){return hr(e,"{index} of {total}").replace(/\{index}/g,`${qo(r,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function Pr(...e){return()=>{e.forEach(t=>{t()})}}function $t(e,t,r){return()=>{const n=A.useContext(r);if(!n)throw new Error(`${e} must be used within a ${t}.Provider`);return n}}function Ko(){return typeof window<"u"}function Yo(e,t=0){const r=10**t;return Math.round((e+Number.EPSILON)*r)/r}function pr(e){return e.type===void 0||e.type==="image"}function Xo(e,t){return e.imageFit===ol||e.imageFit!==nl&&t===ol}function Dn(e){return typeof e=="string"?Number.parseInt(e,10):e}function Pn(e){if(typeof e=="number")return{pixel:e};if(typeof e=="string"){const t=Dn(e);return e.endsWith("%")?{percent:t}:{pixel:t}}return{pixel:0}}function Qu(e,t){const r=Pn(t),n=r.percent!==void 0?e.width/100*r.percent:r.pixel;return{width:Math.max(e.width-2*n,0),height:Math.max(e.height-2*n,0)}}function Ju(){return(Ko()?window?.devicePixelRatio:void 0)||1}function qo(e,t){return t>0?(e%t+t)%t:0}function Zo(e){return e.length>0}function Qo(e,t){return e[qo(t,e.length)]}function Jo(e,t){return Zo(e)?Qo(e,t):void 0}function il(e){return pr(e)?e.src:void 0}function Ln(e,t,r){if(!r)return e;const{buttons:n,...o}=e,a=n.findIndex(l=>l===t),s=A.isValidElement(r)?A.cloneElement(r,{key:t},null):r;if(a>=0){const l=[...n];return l.splice(a,1,s),{buttons:l,...o}}return{buttons:[s,...n],...o}}function cl(e,t,r=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),r))}const Ru=Number(A.version.split(".")[0])>=19;function ef(e){return{inert:Ru?e:e?"":void 0}}function tf(e){e.scrollTop}const Ro={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Dr]},labels:{},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},carousel:{finite:!1,preload:2,padding:"16px",spacing:"30%",imageFit:nl,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Ft(e,t){return{name:e,component:t}}function it(e,t){return{module:e,children:t}}function dl(e,t,r){return e.module.name===t?r(e):e.children?[it(e.module,e.children.flatMap(n=>{var o;return(o=dl(n,t,r))!==null&&o!==void 0?o:[]}))]:[e]}function Lr(e,t,r){return e.flatMap(n=>{var o;return(o=dl(n,t,r))!==null&&o!==void 0?o:[]})}function rf(e,t=[],r=[]){let n=e;const o=g=>{const p=[...n];for(;p.length>0;){const m=p.pop();if(m?.module.name===g)return!0;m?.children&&p.push(...m.children)}return!1},a=(g,p)=>{if(g===""){n=[it(p,n)];return}n=Lr(n,g,m=>[it(p,[m])])},s=(g,p)=>{n=Lr(n,g,m=>[it(m.module,[it(p,m.children)])])},l=(g,p,m)=>{n=Lr(n,g,x=>{var k;return[it(x.module,[...m?[it(p)]:[],...(k=x.children)!==null&&k!==void 0?k:[],...m?[]:[it(p)]])]})},f=(g,p,m)=>{n=Lr(n,g,x=>[...m?[it(p)]:[],x,...m?[]:[it(p)]])},h=g=>{s(rn,g)},c=(g,p)=>{n=Lr(n,g,m=>[it(p,m.children)])},i=g=>{n=Lr(n,g,p=>p.children)},u=g=>{r.push(g)};return t.forEach(g=>{g({contains:o,addParent:a,append:s,addChild:l,addSibling:f,addModule:h,replace:c,remove:i,augment:u})}),{config:n,augmentation:g=>r.reduce((p,m)=>m(p),g)}}const ul=A.createContext(null),ea=$t("useA11yContext","A11yContext",ul);function nf({children:e}){const[t,r]=A.useState(!1),[n,o]=A.useState(!1),a=A.useMemo(()=>({focusWithin:t,trackFocusWithin:(l,f)=>{const h=c=>i=>{var u;i.currentTarget.contains(i.relatedTarget)||r(c),(u=c?l:f)===null||u===void 0||u(i)};return{onFocus:h(!0),onBlur:h(!1)}},autoPlaying:n,setAutoPlaying:o}),[t,n]);return A.createElement(ul.Provider,{value:a},e)}const fl=A.createContext(null),$r=$t("useDocument","DocumentContext",fl);function of({nodeRef:e,children:t}){const r=A.useMemo(()=>{const n=a=>{var s;return((s=a||e.current)===null||s===void 0?void 0:s.ownerDocument)||document};return{getOwnerDocument:n,getOwnerWindow:a=>{var s;return((s=n(a))===null||s===void 0?void 0:s.defaultView)||window}}},[e]);return A.createElement(fl.Provider,{value:r},t)}const gl=A.createContext(null),Fr=$t("useEvents","EventsContext",gl);function af({children:e}){const[t]=A.useState({});A.useEffect(()=>()=>{Object.keys(t).forEach(n=>delete t[n])},[t]);const r=A.useMemo(()=>{const n=(s,l)=>{var f;(f=t[s])===null||f===void 0||f.splice(0,t[s].length,...t[s].filter(h=>h!==l))};return{publish:(...[s,l])=>{var f;(f=t[s])===null||f===void 0||f.forEach(h=>h(l))},subscribe:(s,l)=>(t[s]||(t[s]=[]),t[s].push(l),()=>n(s,l)),unsubscribe:n}},[t]);return A.createElement(gl.Provider,{value:r},e)}const hl=A.createContext(null),ct=$t("useLightboxProps","LightboxPropsContext",hl);function pl({children:e,...t}){return A.createElement(hl.Provider,{value:t},e)}const ml=A.createContext(null),Ut=$t("useLightboxState","LightboxStateContext",ml),bl=A.createContext(null),sf=$t("useLightboxDispatch","LightboxDispatchContext",bl);function lf(e,t){switch(t.type){case"swipe":{const{slides:r}=e,n=t?.increment||0,o=e.globalIndex+n,a=qo(o,r.length),s=Jo(r,a),l=n||t.duration!==void 0?{increment:n,duration:t.duration,easing:t.easing}:void 0;return{slides:r,currentIndex:a,globalIndex:o,currentSlide:s,animation:l}}case"update":return t.slides!==e.slides||t.index!==e.currentIndex?{slides:t.slides,currentIndex:t.index,globalIndex:t.index,currentSlide:Jo(t.slides,t.index)}:e;default:throw new Error(al)}}function cf({slides:e,index:t,children:r}){const[n,o]=A.useReducer(lf,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Jo(e,t)});A.useEffect(()=>{o({type:"update",slides:e,index:t})},[e,t]);const a=A.useMemo(()=>({...n,state:n,dispatch:o}),[n,o]);return A.createElement(bl.Provider,{value:o},A.createElement(ml.Provider,{value:a},r))}const yl=A.createContext(null),cn=$t("useTimeouts","TimeoutsContext",yl);function df({children:e}){const[t]=A.useState([]);A.useEffect(()=>()=>{t.forEach(n=>window.clearTimeout(n)),t.splice(0,t.length)},[t]);const r=A.useMemo(()=>{const n=s=>{t.splice(0,t.length,...t.filter(l=>l!==s))};return{setTimeout:(s,l)=>{const f=window.setTimeout(()=>{n(f),s()},l);return t.push(f),f},clearTimeout:s=>{s!==void 0&&(n(s),window.clearTimeout(s))}}},[t]);return A.createElement(yl.Provider,{value:r},e)}const Ur=A.forwardRef(function({label:t,className:r,icon:n,renderIcon:o,onClick:a,style:s,...l},f){const{styles:h,labels:c}=ct(),i=hr(c,t);return A.createElement("button",{ref:f,type:"button",title:i,"aria-label":i,className:ht(ye(Zu),r),onClick:a,style:{...s,...h.button},...l},o?o():A.createElement(n,{className:ye(In),style:h.icon}))});function vl(e,t){const r=n=>A.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true",focusable:"false",...n},t);return r.displayName=e,r}function xt(e,t){return vl(e,A.createElement("g",{fill:"currentColor"},A.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function uf(e,t){return vl(e,A.createElement(A.Fragment,null,A.createElement("defs",null,A.createElement("mask",{id:"strike"},A.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),A.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),A.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),A.createElement("g",{fill:"currentColor",mask:"url(#strike)"},A.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const ff=xt("Close",A.createElement("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),gf=xt("Previous",A.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),hf=xt("Next",A.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),pf=xt("Loading",A.createElement(A.Fragment,null,Array.from({length:8}).map((e,t,r)=>A.createElement("line",{key:t,x1:"12",y1:"6.5",x2:"12",y2:"1.8",strokeLinecap:"round",strokeWidth:"2.6",stroke:"currentColor",strokeOpacity:1/r.length*(t+1),transform:`rotate(${360/r.length*t}, 12, 12)`})))),mf=xt("Error",A.createElement("path",{d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})),Vt=Ko()?A.useLayoutEffect:A.useEffect;function ta(){const[e,t]=A.useState(!1);return A.useEffect(()=>{var r,n;const o=(r=window.matchMedia)===null||r===void 0?void 0:r.call(window,"(prefers-reduced-motion: reduce)");t(o?.matches);const a=s=>t(s.matches);return(n=o?.addEventListener)===null||n===void 0||n.call(o,"change",a),()=>{var s;return(s=o?.removeEventListener)===null||s===void 0?void 0:s.call(o,"change",a)}},[]),e}function bf(e){let t=0,r=0,n=0;const a=window.getComputedStyle(e).transform.match(/matrix.*\((.+)\)/);if(a){const s=a[1].split(",").map(Dn);s.length===6?(t=s[4],r=s[5]):s.length===16&&(t=s[12],r=s[13],n=s[14])}return{x:t,y:r,z:n}}function ra(e,t){const r=A.useRef(void 0),n=A.useRef(void 0),o=ta();return Vt(()=>{var a,s,l;if(e.current&&r.current!==void 0&&!o){const{keyframes:f,duration:h,easing:c,onfinish:i}=t(r.current,e.current.getBoundingClientRect(),bf(e.current))||{};if(f&&h){(a=n.current)===null||a===void 0||a.cancel(),n.current=void 0;try{n.current=(l=(s=e.current).animate)===null||l===void 0?void 0:l.call(s,f,{duration:h,easing:c})}catch(u){console.error(u)}n.current&&(n.current.onfinish=()=>{n.current=void 0,i?.()})}}r.current=void 0}),{prepareAnimation:a=>{r.current=a},isAnimationPlaying:()=>{var a;return((a=n.current)===null||a===void 0?void 0:a.playState)==="running"}}}function wl(){const e=A.useRef(null),t=A.useRef(void 0),[r,n]=A.useState();return{setContainerRef:A.useCallback(a=>{e.current=a,t.current&&(t.current.disconnect(),t.current=void 0);const s=()=>{if(a){const l=window.getComputedStyle(a),f=h=>parseFloat(h)||0;n({width:Math.round(a.clientWidth-f(l.paddingLeft)-f(l.paddingRight)),height:Math.round(a.clientHeight-f(l.paddingTop)-f(l.paddingBottom))})}else n(void 0)};s(),a&&typeof ResizeObserver<"u"&&(t.current=new ResizeObserver(s),t.current.observe(a))},[]),containerRef:e,containerRect:r}}function $n(){const e=A.useRef(void 0),{setTimeout:t,clearTimeout:r}=cn();return A.useCallback((n,o)=>{r(e.current),e.current=t(n,o>0?o:0)},[t,r])}function Le(e){const t=A.useRef(e);return Vt(()=>{t.current=e}),A.useCallback((...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function xl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function na(e,t){return A.useMemo(()=>e==null&&t==null?null:r=>{xl(e,r),xl(t,r)},[e,t])}function kl(e,t=!1){const r=A.useRef(!1);Vt(()=>{t&&r.current&&(r.current=!1,e())},[t,e]);const n=A.useCallback(()=>{r.current=!0},[]),o=A.useCallback(()=>{r.current=!1},[]);return{onFocus:n,onBlur:o}}function Fn(){const[e,t]=A.useState(!1);return Vt(()=>{t(window.getComputedStyle(window.document.documentElement).direction==="rtl")},[]),e}function Cl(){const[e]=A.useState({}),t=A.useCallback((o,a)=>{var s;(s=e[o])===null||s===void 0||s.forEach(l=>{a.isPropagationStopped()||l(a)})},[e]),r=A.useMemo(()=>({onPointerDown:o=>t(Js,o),onPointerMove:o=>t(Rs,o),onPointerUp:o=>t(el,o),onPointerLeave:o=>t(tl,o),onPointerCancel:o=>t(rl,o),onKeyDown:o=>t(Wo,o),onKeyUp:o=>t(Ku,o),onWheel:o=>t(Vo,o)}),[t]),n=A.useCallback((o,a)=>(e[o]||(e[o]=[]),e[o].unshift(a),()=>{const s=e[o];s&&s.splice(0,s.length,...s.filter(l=>l!==a))}),[e]);return{registerSensors:r,subscribeSensors:n}}function _l(e,t){const r=A.useRef(0),n=$n(),o=Le((...a)=>{r.current=Date.now(),e(a)});return A.useCallback((...a)=>{n(()=>{o(a)},t-(Date.now()-r.current))},[t,o,n])}const oa=gr("slide"),aa=gr("slide_image");function mr({slide:e,offset:t,render:r,rect:n,imageFit:o,imageProps:a,onClick:s,onLoad:l,onError:f,style:h}){var c,i,u,g,p,m,x,k;const[M,v]=A.useState(Mr),{publish:T}=Fr(),{setTimeout:I}=cn(),S=A.useRef(null);A.useEffect(()=>{t===0&&T(ln(M))},[t,M,T]);const N=Le(B=>{("decode"in B?B.decode():Promise.resolve()).catch(()=>{}).then(()=>{B.parentNode&&(v(sn),I(()=>{l?.(B)},0))})}),w=A.useCallback(B=>{S.current=B,B?.complete&&N(B)},[N]),y=A.useCallback(B=>{N(B.currentTarget)},[N]),E=Le(()=>{v(an),f?.()}),O=Xo(e,o),$=(B,Y)=>Number.isFinite(B)?B:Y,P=$(Math.max(...((i=(c=e.srcSet)===null||c===void 0?void 0:c.map(B=>B.width))!==null&&i!==void 0?i:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((u=S.current)===null||u===void 0?void 0:u.naturalWidth)||0),L=$(Math.max(...((p=(g=e.srcSet)===null||g===void 0?void 0:g.map(B=>B.height))!==null&&p!==void 0?p:[]).concat(e.height?[e.height]:[]).filter(Boolean)),((m=S.current)===null||m===void 0?void 0:m.naturalHeight)||0),U=P&&L?{maxWidth:`min(${P}px, 100%)`,maxHeight:`min(${L}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},_=(x=e.srcSet)===null||x===void 0?void 0:x.sort((B,Y)=>B.width-Y.width).map(B=>`${B.src} ${B.width}w`).join(", "),b=()=>n&&!O&&e.width&&e.height?n.height/e.height*e.width:Number.MAX_VALUE,z=_&&n&&Ko()?`${Math.round(Math.min(b(),n.width))}px`:void 0,{style:F,className:G,...X}=a||{};return A.createElement(A.Fragment,null,A.createElement("img",{ref:w,onLoad:y,onError:E,onClick:s,draggable:!1,className:ht(ye(aa()),O&&ye(aa("cover")),M!==sn&&ye(aa("loading")),G),style:{...U,...h,...F},...X,alt:(k=e.alt)!==null&&k!==void 0?k:"",sizes:z,srcSet:_,src:e.src}),M!==sn&&A.createElement("div",{className:ye(oa(zu))},M===Mr&&(r?.iconLoading?r.iconLoading():A.createElement(pf,{className:ht(ye(In),ye(oa(Mr)))})),M===an&&(r?.iconError?r.iconError():A.createElement(mf,{className:ht(ye(In),ye(oa(an)))}))))}const yf=A.forwardRef(function({className:t,children:r,onFocus:n,onBlur:o,...a},s){const l=A.useRef(null),{trackFocusWithin:f}=ea();return A.createElement(of,{nodeRef:l},A.createElement("div",{ref:na(s,l),className:ht(ye("root"),t),...f(n,o),...a},r))});var pt;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL",e[e.ANIMATION=3]="ANIMATION"})(pt||(pt={}));function Sl(e,t,r,n,o){A.useEffect(()=>o?()=>{}:Pr(e(Js,t),e(Rs,r),e(el,n),e(tl,n),e(rl,n)),[e,t,r,n,o])}var Kt;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(Kt||(Kt={}));const sa=30;function vf({disableSwipeNavigation:e,closeOnBackdropClick:t},r,n,o,a,s,l,f,h,c,i,u,g,p,m,x){const k=A.useRef(0),M=A.useRef([]),v=A.useRef(void 0),T=A.useRef(0),I=A.useRef(Kt.NONE),S=A.useCallback(P=>{v.current===P.pointerId&&(v.current=void 0,I.current=Kt.NONE);const L=M.current;L.splice(0,L.length,...L.filter(U=>U.pointerId!==P.pointerId))},[]),N=A.useCallback(P=>{S(P),P.persist(),M.current.push(P)},[S]),w=A.useCallback(P=>M.current.find(({pointerId:L})=>P.pointerId===L),[]),y=Le(P=>{N(P)}),E=(P,L)=>i&&P>L||c&&P<-L,O=Le(P=>{const L=w(P);if(L)if(v.current===P.pointerId){const U=Date.now()-T.current,_=k.current;I.current===Kt.SWIPE?Math.abs(_)>.3*o||Math.abs(_)>5&&U<a?f(_,U):h(_):I.current===Kt.PULL&&(E(_,2*sa)?p(_,U):m(_)),k.current=0,I.current=Kt.NONE}else{const{target:U}=P;t&&U instanceof HTMLElement&&U===L.target&&(U.classList.contains(ye(jo))||U.classList.contains(ye(Qs)))&&x()}S(P)}),$=Le(P=>{const L=w(P);if(L){const U=v.current===P.pointerId;if(P.buttons===0){U&&k.current!==0?O(P):S(L);return}const _=P.clientX-L.clientX,b=P.clientY-L.clientY;if(v.current===void 0){const z=F=>{N(P),v.current=P.pointerId,T.current=Date.now(),I.current=F};Math.abs(_)>Math.abs(b)&&Math.abs(_)>sa&&n(_)?e||(z(Kt.SWIPE),s()):Math.abs(b)>Math.abs(_)&&E(b,sa)&&(z(Kt.PULL),u())}else U&&(I.current===Kt.SWIPE?(k.current=_,l(_)):I.current===Kt.PULL&&(k.current=b,g(b)))}});Sl(r,y,$,O)}function wf({preventDefaultWheelX:e,preventDefaultWheelY:t}){const r=A.useRef(null),n=Le(o=>{const a=Math.abs(o.deltaX)>Math.abs(o.deltaY);(a&&e||!a&&t||o.ctrlKey)&&o.preventDefault()});return A.useCallback(o=>{var a;o?o.addEventListener("wheel",n,{passive:!1}):(a=r.current)===null||a===void 0||a.removeEventListener("wheel",n),r.current=o},[n])}function xf(e,t,r,n,o,a,s,l,f){const h=A.useRef(0),c=A.useRef(0),i=A.useRef(void 0),u=A.useRef(void 0),g=A.useRef(0),p=A.useRef(void 0),m=A.useRef(0),{setTimeout:x,clearTimeout:k}=cn(),M=A.useCallback(()=>{i.current&&(k(i.current),i.current=void 0)},[k]),v=A.useCallback(()=>{u.current&&(k(u.current),u.current=void 0)},[k]),T=Le(()=>{e!==pt.SWIPE&&(h.current=0,m.current=0,M(),v())});A.useEffect(T,[e,T]);const I=Le(N=>{u.current=void 0,h.current===N&&f(h.current)}),S=Le(N=>{if(N.ctrlKey||Math.abs(N.deltaY)>Math.abs(N.deltaX))return;const w=y=>{g.current=y,k(p.current),p.current=y>0?x(()=>{g.current=0,p.current=void 0},300):void 0};if(e===pt.NONE){if(Math.abs(N.deltaX)<=1.2*Math.abs(g.current)){w(N.deltaX);return}if(!r(-N.deltaX))return;if(c.current+=N.deltaX,M(),Math.abs(c.current)>30)c.current=0,w(0),m.current=Date.now(),a();else{const y=c.current;i.current=x(()=>{i.current=void 0,y===c.current&&(c.current=0)},o)}}else if(e===pt.SWIPE){let y=h.current-N.deltaX;if(y=Math.min(Math.abs(y),n)*Math.sign(y),h.current=y,s(y),v(),Math.abs(y)>.2*n){w(N.deltaX),l(y,Date.now()-m.current);return}u.current=x(()=>I(y),2*o)}else w(N.deltaX)});A.useEffect(()=>t(Vo,S),[t,S])}const El=gr("container"),Tl=A.createContext(null),Yt=$t("useController","ControllerContext",Tl);function kf({children:e,...t}){var r;const{carousel:n,animation:o,controller:a,on:s,styles:l,render:f}=t,{closeOnPullUp:h,closeOnPullDown:c,preventDefaultWheelX:i,preventDefaultWheelY:u}=a,[g,p]=A.useState(),m=Ut(),x=sf(),[k,M]=A.useState(pt.NONE),v=A.useRef(0),T=A.useRef(0),I=A.useRef(1),{registerSensors:S,subscribeSensors:N}=Cl(),{subscribe:w,publish:y}=Fr(),E=$n(),O=$n(),$=$n(),{containerRef:P,setContainerRef:L,containerRect:U}=wl(),_=na(wf({preventDefaultWheelX:i,preventDefaultWheelY:u}),L),b=A.useRef(null),z=na(b,void 0),{getOwnerDocument:F}=$r(),G=Fn(),X=K=>(G?-1:1)*(typeof K=="number"?K:1),B=Le(()=>{var K;return(K=P.current)===null||K===void 0?void 0:K.focus()}),Y=Le(()=>t),H=Le(()=>m),W=A.useCallback(K=>y(nr,K),[y]),Q=A.useCallback(K=>y(or,K),[y]),be=A.useCallback(()=>y(Dr),[y]),se=K=>!(n.finite&&(X(K)>0&&m.currentIndex===0||X(K)<0&&m.currentIndex===m.slides.length-1)),pe=K=>{var oe;v.current=K,(oe=P.current)===null||oe===void 0||oe.style.setProperty(Xe("swipe_offset"),`${Math.round(K)}px`)},ne=K=>{var oe,ae;T.current=K,I.current=(()=>{const Ee=c&&K>0?K:h&&K<0?-K:0;return Math.min(Math.max(Yo(1-Ee/60*(1-.5),2),.5),1)})(),(oe=P.current)===null||oe===void 0||oe.style.setProperty(Xe("pull_offset"),`${Math.round(K)}px`),(ae=P.current)===null||ae===void 0||ae.style.setProperty(Xe("pull_opacity"),`${I.current}`)},{prepareAnimation:Ae}=ra(b,(K,oe,ae)=>{if(b.current&&U)return{keyframes:[{transform:`translate(0, ${K.rect.y-oe.y+ae.y}px)`,opacity:K.opacity},{transform:"translate(0, 0)",opacity:1}],duration:K.duration,easing:o.easing.fade}}),ve=(K,oe)=>{if(h||c){ne(K);let ae=0;b.current&&(ae=o.fade*(oe?2:1),Ae({rect:b.current.getBoundingClientRect(),opacity:I.current,duration:ae})),$(()=>{ne(0),M(pt.NONE)},ae),M(pt.ANIMATION),oe||be()}},{prepareAnimation:We,isAnimationPlaying:me}=ra(b,(K,oe,ae)=>{var ce;if(b.current&&U&&(!((ce=m.animation)===null||ce===void 0)&&ce.duration)){const ke=Pn(n.spacing),Ee=(ke.percent?ke.percent*U.width/100:ke.pixel)||0;return{keyframes:[{transform:`translate(${X(m.globalIndex-K.index)*(U.width+Ee)+K.rect.x-oe.x+ae.x}px, 0)`},{transform:"translate(0, 0)"}],duration:m.animation.duration,easing:m.animation.easing}}}),Te=Le(K=>{var oe,ae;const ce=K.offset||0,ke=ce?o.swipe:(oe=o.navigation)!==null&&oe!==void 0?oe:o.swipe,Ee=!ce&&!me()?o.easing.navigation:o.easing.swipe;let{direction:Be}=K;const Me=(ae=K.count)!==null&&ae!==void 0?ae:1;let Ke=pt.ANIMATION,Pe=ke*Me;if(!Be){const le=U?.width,de=K.duration||0,ue=le?ke/le*Math.abs(ce):ke;Me!==0?(de<ue?Pe=Pe/ue*Math.max(de,ue/5):le&&(Pe=ke/le*(le-Math.abs(ce))),Be=X(ce)>0?nr:or):Pe=ke/2}let q=0;Be===nr?se(X(1))?q=-Me:(Ke=pt.NONE,Pe=ke):Be===or&&(se(X(-1))?q=Me:(Ke=pt.NONE,Pe=ke)),Pe=Math.round(Pe),O(()=>{pe(0),M(pt.NONE)},Pe),b.current&&We({rect:b.current.getBoundingClientRect(),index:m.globalIndex}),M(Ke),y(Bo,{type:"swipe",increment:q,duration:Pe,easing:Ee})});A.useEffect(()=>{var K,oe;!((K=m.animation)===null||K===void 0)&&K.increment&&(!((oe=m.animation)===null||oe===void 0)&&oe.duration)&&E(()=>x({type:"swipe",increment:0}),m.animation.duration)},[m.animation,x,E]);const ge=[N,se,U?.width||0,o.swipe,()=>M(pt.SWIPE),K=>pe(K),(K,oe)=>Te({offset:K,duration:oe,count:1}),K=>Te({offset:K,count:0})],Oe=[()=>{c&&M(pt.PULL)},K=>ne(K),K=>ve(K),K=>ve(K,!0)];vf(a,...ge,h,c,...Oe,be),xf(k,...ge);const we=Le(()=>{a.focus&&F().querySelector(`.${ye(Ho)} .${ye(El())}`)&&B()});A.useEffect(we,[we]);const $e=Le(()=>{var K;(K=s.view)===null||K===void 0||K.call(s,{index:m.currentIndex})});A.useEffect($e,[m.globalIndex,$e]),A.useEffect(()=>Pr(w(nr,K=>Te({direction:nr,...K})),w(or,K=>Te({direction:or,...K})),w(Bo,K=>x(K))),[w,Te,x]);const ze=A.useMemo(()=>({prev:W,next:Q,close:be,focus:B,slideRect:U?Qu(U,n.padding):{width:0,height:0},containerRect:U||{width:0,height:0},subscribeSensors:N,containerRef:P,setCarouselRef:z,toolbarWidth:g,setToolbarWidth:p}),[W,Q,be,B,N,U,P,z,g,p,n.padding]);return A.useImperativeHandle(a.ref,()=>({prev:W,next:Q,close:be,focus:B,getLightboxProps:Y,getLightboxState:H}),[W,Q,be,B,Y,H]),A.createElement("div",{ref:_,className:ht(ye(El()),ye(Ir)),style:{...k===pt.SWIPE?{[Xe("swipe_offset")]:`${Math.round(v.current)}px`}:null,...k===pt.PULL?{[Xe("pull_offset")]:`${Math.round(T.current)}px`,[Xe("pull_opacity")]:`${I.current}`}:null,...a.touchAction!=="none"?{[Xe("controller_touch_action")]:a.touchAction}:null,...l.container},tabIndex:-1,...S},U&&A.createElement(Tl.Provider,{value:ze},e,(r=f.controls)===null||r===void 0?void 0:r.call(f)))}const Cf=Ft(rn,kf);function br(e){return fr(Vs,e)}function Al(e){return fr(jo,e)}function _f({slide:e,offset:t}){const r=A.useRef(null),{currentIndex:n,slides:o}=Ut(),{slideRect:a,focus:s}=Yt(),{render:l,carousel:{imageFit:f,imageProps:h},on:{click:c},styles:{slide:i},labels:u}=ct(),{getOwnerDocument:g}=$r(),p=t!==0;A.useEffect(()=>{var x;p&&(!((x=r.current)===null||x===void 0)&&x.contains(g().activeElement))&&s()},[p,s,g]);const m=()=>{var x,k,M,v;let T=(x=l.slide)===null||x===void 0?void 0:x.call(l,{slide:e,offset:t,rect:a});return!T&&pr(e)&&(T=A.createElement(mr,{slide:e,offset:t,render:l,rect:a,imageFit:f,imageProps:h,onClick:p?void 0:()=>c?.({index:n})})),T?A.createElement(A.Fragment,null,(k=l.slideHeader)===null||k===void 0?void 0:k.call(l,{slide:e}),((M=l.slideContainer)!==null&&M!==void 0?M:(({children:I})=>I))({slide:e,children:T}),(v=l.slideFooter)===null||v===void 0?void 0:v.call(l,{slide:e})):null};return A.createElement("div",{ref:r,className:ht(ye(Al()),!p&&ye(Al("current")),ye(Ir)),...ef(p),style:i,role:"group","aria-roledescription":hr(u,"Slide"),"aria-label":ll(u,o,n+t)},m())}function Sf(){const e=ct().styles.slide;return A.createElement("div",{className:ye(jo),style:e})}function Ef({carousel:e,labels:t}){const{slides:r,currentIndex:n,globalIndex:o}=Ut(),{setCarouselRef:a}=Yt(),{autoPlaying:s,focusWithin:l}=ea(),f=Pn(e.spacing),h=Pn(e.padding),c=cl(e,r,1),i=[];if(Zo(r))for(let u=n-c;u<=n+c;u+=1){const g=Qo(r,u),p=o-n+u,m=e.finite&&(u<0||u>r.length-1);i.push(m?{key:p}:{key:[`${p}`,il(g)].filter(Boolean).join("|"),offset:u-n,slide:g})}return A.createElement("div",{ref:a,className:ht(ye(br()),i.length>0&&ye(br("with_slides"))),style:{[`${Xe(br("slides_count"))}`]:i.length,[`${Xe(br("spacing_px"))}`]:f.pixel||0,[`${Xe(br("spacing_percent"))}`]:f.percent||0,[`${Xe(br("padding_px"))}`]:h.pixel||0,[`${Xe(br("padding_percent"))}`]:h.percent||0},role:"region","aria-live":s&&!l?"off":"polite","aria-roledescription":hr(t,"Carousel"),"aria-label":hr(t,"Photo gallery")},i.map(({key:u,slide:g,offset:p})=>g?A.createElement(_f,{key:u,slide:g,offset:p}):A.createElement(Sf,{key:u})))}const Tf=Ft(Vs,Ef);function Nl(){const{carousel:e}=ct(),{slides:t,currentIndex:r}=Ut(),n=t.length===0||e.finite&&r===0,o=t.length===0||e.finite&&r===t.length-1;return{prevDisabled:n,nextDisabled:o}}function Ol(e){var t;const r=Fn(),{publish:n}=Fr(),{animation:o}=ct(),{prevDisabled:a,nextDisabled:s}=Nl(),l=((t=o.navigation)!==null&&t!==void 0?t:o.swipe)/2,f=_l(()=>n(nr),l),h=_l(()=>n(or),l),c=Le(i=>{switch(i.key){case Yu:n(Dr);break;case Xu:(r?s:a)||(r?h:f)();break;case qu:(r?a:s)||(r?f:h)();break}});A.useEffect(()=>e(Wo,c),[e,c])}function Ml({label:e,icon:t,renderIcon:r,action:n,onClick:o,disabled:a,style:s}){return A.createElement(Ur,{label:e,icon:t,renderIcon:r,className:ye(`navigation_${n}`),disabled:a,onClick:o,style:s,...kl(Yt().focus,a)})}function Af({render:{buttonPrev:e,buttonNext:t,iconPrev:r,iconNext:n},styles:o}){const{prev:a,next:s,subscribeSensors:l}=Yt(),{prevDisabled:f,nextDisabled:h}=Nl();return Ol(l),A.createElement(A.Fragment,null,e?e():A.createElement(Ml,{label:"Previous",action:nr,icon:gf,renderIcon:r,style:o.navigationPrev,disabled:f,onClick:a}),t?t():A.createElement(Ml,{label:"Next",action:or,icon:hf,renderIcon:n,style:o.navigationNext,disabled:h,onClick:s}))}const Nf=Ft(Lu,Af),Il=ye(Wu),Of=ye(Zs);function Mf(e){return"style"in e}function Dl(e,t,r){const n=window.getComputedStyle(e),o=r?"padding-left":"padding-right",a=r?n.paddingLeft:n.paddingRight,s=e.style.getPropertyValue(o);return e.style.setProperty(o,`${(Dn(a)||0)+t}px`),()=>{s?e.style.setProperty(o,s):e.style.removeProperty(o)}}function If({noScroll:{disabled:e},children:t}){const r=Fn(),{getOwnerDocument:n,getOwnerWindow:o}=$r();return A.useEffect(()=>{if(e)return()=>{};const a=[],s=o(),{body:l,documentElement:f}=n(),h=Math.round(s.innerWidth-f.clientWidth);if(h>0){a.push(Dl(l,h,r));const c=l.getElementsByTagName("*");for(let i=0;i<c.length;i+=1){const u=c[i];Mf(u)&&s.getComputedStyle(u).getPropertyValue("position")==="fixed"&&!u.classList.contains(Of)&&a.push(Dl(u,h,r))}}return l.classList.add(Il),()=>{l.classList.remove(Il),a.forEach(c=>c())}},[r,e,n,o]),A.createElement(A.Fragment,null,t)}const Df=Ft($u,If);function Pl(e){return fr(Ho,e)}function Ll(e,t,r){const n=e.getAttribute(t);return e.setAttribute(t,r),()=>{n?e.setAttribute(t,n):e.removeAttribute(t)}}function Pf({children:e,animation:t,styles:r,className:n,on:o,portal:a,close:s,labels:l}){const[f,h]=A.useState(!1),[c,i]=A.useState(!1),u=A.useRef([]),g=A.useRef(null),{setTimeout:p}=cn(),{subscribe:m}=Fr(),k=ta()?0:t.fade;A.useEffect(()=>(h(!0),()=>{h(!1),i(!1)}),[]);const M=Le(()=>{u.current.forEach(S=>S()),u.current=[]}),v=Le(()=>{var S;i(!1),M(),(S=o.exiting)===null||S===void 0||S.call(o),p(()=>{var N;(N=o.exited)===null||N===void 0||N.call(o),s()},k)});A.useEffect(()=>m(Dr,v),[m,v]);const T=Le(S=>{var N,w,y;tf(S),i(!0),(N=o.entering)===null||N===void 0||N.call(o);const E=(y=(w=S.parentNode)===null||w===void 0?void 0:w.children)!==null&&y!==void 0?y:[];for(let O=0;O<E.length;O+=1){const $=E[O];["TEMPLATE","SCRIPT","STYLE"].indexOf($.tagName)===-1&&$!==S&&(u.current.push(Ll($,"inert","")),u.current.push(Ll($,"aria-hidden","true")))}u.current.push(()=>{var O,$;($=(O=g.current)===null||O===void 0?void 0:O.focus)===null||$===void 0||$.call(O)}),p(()=>{var O;(O=o.entered)===null||O===void 0||O.call(o)},k)}),I=A.useCallback(S=>{S?T(S):M()},[T,M]);return f?tr.createPortal(A.createElement(yf,{ref:I,className:ht(n,ye(Pl()),ye(Zs),c&&ye(Pl("open"))),"aria-modal":!0,role:"dialog","aria-label":hr(l,"Lightbox"),style:{...t.fade!==Ro.animation.fade?{[Xe("fade_animation_duration")]:`${k}ms`}:null,...t.easing.fade!==Ro.animation.easing.fade?{[Xe("fade_animation_timing_function")]:t.easing.fade}:null,...r.root},onFocus:S=>{g.current||(g.current=S.relatedTarget)}},e),a.root||document.body):null}const Lf=Ft(Ho,Pf);function $f({children:e}){return A.createElement(A.Fragment,null,e)}const Ff=Ft(Fu,$f);function Uf(e){return fr(Ks,e)}function zf({toolbar:{buttons:e},render:{buttonClose:t,iconClose:r},styles:n}){const{close:o,setToolbarWidth:a}=Yt(),{setContainerRef:s,containerRect:l}=wl();Vt(()=>{a(l?.width)},[a,l?.width]);const f=()=>t?t():A.createElement(Ur,{key:Dr,label:"Close",icon:ff,renderIcon:r,onClick:o});return A.createElement("div",{ref:s,style:n.toolbar,className:ye(Uf())},e?.map(h=>h===Dr?f():h))}const Hf=Ft(Ks,zf);function $l(e,t){var r;return A.createElement(e.module.component,{key:e.module.name,...t},(r=e.children)===null||r===void 0?void 0:r.map(n=>$l(n,t)))}function Gf(e,t={}){const{easing:r,...n}=e,{easing:o,...a}=t;return{easing:{...r,...o},...n,...a}}function jf({carousel:e,animation:t,render:r,toolbar:n,controller:o,noScroll:a,on:s,plugins:l,slides:f,index:h,...c}){const{animation:i,carousel:u,render:g,toolbar:p,controller:m,noScroll:x,on:k,slides:M,index:v,plugins:T,...I}=Ro,{config:S,augmentation:N}=rf([it(Lf,[it(Df,[it(Cf,[it(Tf),it(Hf),it(Nf)])])])],l||T),w=N({animation:Gf(i,t),carousel:{...u,...e},render:{...g,...r},toolbar:{...p,...n},controller:{...m,...o},noScroll:{...x,...a},on:{...k,...s},...I,...c});return w.open?A.createElement(pl,{...w},A.createElement(cf,{slides:f||M,index:Dn(h||v)},A.createElement(df,null,A.createElement(af,null,A.createElement(nf,null,$l(it(Ff,S),w)))))):null}const Bf={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1};function Wf(e){return Math.min(Math.max(e,Number.EPSILON),1)}function Fl(e){const{minZoom:t,...r}={...Bf,...e};return{minZoom:Wf(t),...r}}function Vf(e,t,r,n){const o=A.useRef(void 0),a=A.useRef(void 0),{zoom:s}=ct().animation,l=ta(),f=Le(()=>{var h,c,i;if((h=o.current)===null||h===void 0||h.cancel(),o.current=void 0,a.current&&n?.current){try{o.current=(i=(c=n.current).animate)===null||i===void 0?void 0:i.call(c,[{transform:a.current},{transform:`scale(${e}) translateX(${t}px) translateY(${r}px)`}],{duration:l?0:s??500,easing:o.current?"ease-out":"ease-in-out"})}catch(u){console.error(u)}a.current=void 0,o.current&&(o.current.onfinish=()=>{o.current=void 0})}});return Vt(f,[e,t,r,f]),A.useCallback(()=>{a.current=n?.current?window.getComputedStyle(n.current).transform:void 0},[n])}function Kf(e,t){const{on:r}=ct(),n=Le(()=>{var o;t||(o=r.zoom)===null||o===void 0||o.call(r,{zoom:e})});A.useEffect(n,[e,n])}function Un(){const{zoom:e}=ct();return Fl(e)}function Yf(e,t){var r,n;let o={width:0,height:0},a={width:0,height:0};const{currentSlide:s}=Ut(),{imageFit:l}=ct().carousel,{maxZoomPixelRatio:f}=Un();if(e&&s){const c={...s,...t};if(pr(c)){const i=Xo(c,l),u=Math.max(...(((r=c.srcSet)===null||r===void 0?void 0:r.map(p=>p.width))||[]).concat(c.width?[c.width]:[])),g=Math.max(...(((n=c.srcSet)===null||n===void 0?void 0:n.map(p=>p.height))||[]).concat(c.height?[c.height]:[]));u>0&&g>0&&e.width>0&&e.height>0&&(a=i?{width:Math.round(Math.min(u,e.width/e.height*g)),height:Math.round(Math.min(g,e.height/e.width*u))}:{width:u,height:g},a={width:a.width*f,height:a.height*f},o=i?{width:Math.min(e.width,a.width,u),height:Math.min(e.height,a.height,g)}:{width:Math.round(Math.min(e.width,e.height/g*u,u)),height:Math.round(Math.min(e.height,e.width/u*g,g))})}}const h=o.width?Math.max(Yo(a.width/o.width,5),1):1;return{imageRect:o,maxZoom:h}}function Ul(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function zl(e,t,r=100,n=2){return e*Math.min(1+Math.abs(t/r),n)**Math.sign(t)}function Xf(e,t,r,n,o,a,s,l,f){const h=A.useRef([]),c=A.useRef(0),i=A.useRef(void 0),{globalIndex:u}=Ut(),{getOwnerWindow:g}=$r(),{containerRef:p,subscribeSensors:m}=Yt(),{keyboardMoveDistance:x,zoomInMultiplier:k,wheelZoomDistanceFactor:M,scrollToZoom:v,doubleTapDelay:T,doubleClickDelay:I,doubleClickMaxStops:S,pinchZoomDistanceFactor:N,pinchZoomV4:w}=Un(),y=A.useCallback(z=>{if(p.current){const{pageX:F,pageY:G}=z,{scrollX:X,scrollY:B}=g(),{left:Y,top:H,width:W,height:Q}=p.current.getBoundingClientRect();return[F-Y-X-W/2,G-H-B-Q/2]}return[]},[p,g]),E=Le(z=>{const{key:F,metaKey:G,ctrlKey:X}=z,B=G||X,Y=()=>{z.preventDefault(),z.stopPropagation()};if(e>1){const H=(W,Q)=>{Y(),l(W,Q)};F==="ArrowDown"?H(0,x):F==="ArrowUp"?H(0,-x):F==="ArrowLeft"?H(-x,0):F==="ArrowRight"&&H(x,0)}F==="+"||B&&F==="="?(Y(),o()):F==="-"||B&&F==="_"?(Y(),a()):B&&F==="0"&&(Y(),s(1))}),O=Le(z=>{if((z.ctrlKey||v)&&Math.abs(z.deltaY)>Math.abs(z.deltaX)){z.stopPropagation(),s(zl(e,-z.deltaY,M),!0,...y(z));return}e>1&&(z.stopPropagation(),v||l(z.deltaX,z.deltaY))}),$=A.useCallback(z=>{const F=h.current;F.splice(0,F.length,...F.filter(G=>G.pointerId!==z.pointerId))},[]),P=A.useCallback(z=>{$(z),z.persist(),h.current.push(z)},[$]),L=Le(z=>{var F;const G=h.current;if(z.pointerType==="mouse"&&z.buttons>1||!(!((F=f?.current)===null||F===void 0)&&F.contains(z.target)))return;e>1&&z.stopPropagation();const{timeStamp:X}=z;if(G.length===0&&X-c.current<(z.pointerType==="touch"?T:I)){c.current=0;const B=e>=1?e!==r?e*Math.max(r**(1/S),k):1:e!==t?e/Math.max(t**(-1/S),k):1;s(B,!1,...y(z))}else c.current=X;if(P(z),G.length===2){const B=Ul(G[0],G[1]);i.current={previousDistance:B,initialDistance:Math.max(B,1),initialZoom:e}}}),U=Le(z=>{const F=h.current,G=F.find(X=>X.pointerId===z.pointerId);if(F.length===2&&i.current){z.stopPropagation(),P(z);const X=Ul(F[0],F[1]),B=w?i.current.initialZoom/i.current.initialDistance*X:zl(e,X-i.current.previousDistance,N);s(B,!0,...F.map(Y=>y(Y)).reduce((Y,H)=>H.map((W,Q)=>Y[Q]+W/2))),i.current.previousDistance=X;return}e>1&&(z.stopPropagation(),G&&(F.length===1&&l((G.clientX-z.clientX)/e,(G.clientY-z.clientY)/e),P(z)))}),_=A.useCallback(z=>{const F=h.current;F.length===2&&F.find(G=>G.pointerId===z.pointerId)&&(i.current=void 0),$(z)},[$]),b=A.useCallback(()=>{const z=h.current;z.splice(0,z.length),c.current=0,i.current=void 0},[]);Sl(m,L,U,_,n),A.useEffect(b,[u,b]),A.useEffect(()=>n?()=>{}:Pr(b,m(Wo,E),m(Vo,O)),[n,m,b,E,O])}function qf(e,t,r){const[n,o]=A.useState(1),[a,s]=A.useState(0),[l,f]=A.useState(0),h=Vf(n,a,l,r),{currentSlide:c,globalIndex:i}=Ut(),{containerRect:u,slideRect:g}=Yt(),{minZoom:p,zoomInMultiplier:m}=Un(),x=c&&pr(c)?c.src:void 0,k=!x||!r?.current;Vt(()=>{o(1),s(0),f(0)},[i,x]);const M=A.useCallback((N,w,y)=>{const E=y||n,O=a-(N||0),$=l-(w||0),P=(e.width*E-g.width)/2/E,L=(e.height*E-g.height)/2/E;s(Math.min(Math.abs(O),Math.max(P,0))*Math.sign(O)),f(Math.min(Math.abs($),Math.max(L,0))*Math.sign($))},[n,a,l,g,e.width,e.height]),v=A.useCallback((N,w,y,E)=>{const O=Yo(N+.01<t?N-.01>p?N:p:t,5);w||h(),M(y?y*(1/n-1/O):0,E?E*(1/n-1/O):0,O),o(O)},[n,p,t,M,h]),T=Le(()=>{n>1&&(n>t&&v(t,!0),M())});Vt(T,[u.width,u.height,T]);const I=A.useCallback(()=>{const N=n*m;v(n<1&&N>1?1:N)},[n,m,v]),S=A.useCallback(()=>{const N=n/m;v(n>1&&N<1?1:N)},[n,m,v]);return{zoom:n,offsetX:a,offsetY:l,disabled:k,changeOffsets:M,changeZoom:v,zoomIn:I,zoomOut:S}}const Hl=A.createContext(null),la=$t("useZoom","ZoomControllerContext",Hl);function Zf({children:e}){const[t,r]=A.useState(),{slideRect:n}=Yt(),{ref:o,minZoom:a}=Un(),{imageRect:s,maxZoom:l}=Yf(n,t?.imageDimensions),{zoom:f,offsetX:h,offsetY:c,disabled:i,changeZoom:u,changeOffsets:g,zoomIn:p,zoomOut:m}=qf(s,l,t?.zoomWrapperRef);Kf(f,i),Xf(f,a,l,i,p,m,u,g,t?.zoomWrapperRef);const x=A.useMemo(()=>({zoom:f,minZoom:a,maxZoom:l,offsetX:h,offsetY:c,disabled:i,zoomIn:p,zoomOut:m,changeZoom:u}),[f,a,l,h,c,i,p,m,u]);A.useImperativeHandle(o,()=>x,[x]);const k=A.useMemo(()=>({...x,setZoomWrapper:r}),[x,r]);return A.createElement(Hl.Provider,{value:k},e)}const Qf=xt("ZoomIn",A.createElement(A.Fragment,null,A.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),A.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),Jf=xt("ZoomOut",A.createElement("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})),Gl=A.forwardRef(function({zoomIn:t,onLoseFocus:r},n){const o=A.useRef(!1),a=A.useRef(!1),{zoom:s,minZoom:l,maxZoom:f,zoomIn:h,zoomOut:c,disabled:i}=la(),{render:u}=ct(),g=i||(t?s>=f:s<=l);return A.useEffect(()=>{g&&o.current&&a.current&&r(),g||(o.current=!0)},[g,r]),A.createElement(Ur,{ref:n,disabled:g,label:t?"Zoom in":"Zoom out",icon:t?Qf:Jf,renderIcon:t?u.iconZoomIn:u.iconZoomOut,onClick:t?h:c,onFocus:()=>{a.current=!0},onBlur:()=>{a.current=!1}})});function Rf(){const e=A.useRef(null),t=A.useRef(null),{focus:r}=Yt(),n=A.useCallback(s=>{var l,f;!((l=s.current)===null||l===void 0)&&l.disabled?r():(f=s.current)===null||f===void 0||f.focus()},[r]),o=A.useCallback(()=>n(e),[n]),a=A.useCallback(()=>n(t),[n]);return A.createElement(A.Fragment,null,A.createElement(Gl,{zoomIn:!0,ref:e,onLoseFocus:a}),A.createElement(Gl,{ref:t,onLoseFocus:o}))}function eg(){const{render:e}=ct(),t=la();return e.buttonZoom?A.createElement(A.Fragment,null,e.buttonZoom(t)):A.createElement(Rf,null)}function tg(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function rg({current:e,preload:t},{type:r,source:n}){switch(r){case"fetch":return e?{current:e,preload:n}:{current:n};case"done":return n===t?{current:n}:{current:e,preload:t};default:throw new Error(al)}}function ng(e){var t,r;const[{current:n,preload:o},a]=A.useReducer(rg,{}),{slide:s,rect:l,imageFit:f,render:h,interactive:c}=e,i=s.srcSet.sort((I,S)=>I.width-S.width),u=(t=s.width)!==null&&t!==void 0?t:i[i.length-1].width,g=(r=s.height)!==null&&r!==void 0?r:i[i.length-1].height,p=Xo(s,f),m=Math.max(...i.map(I=>I.width)),x=Math.min((p?Math.max:Math.min)(l.width,u*(l.height/g)),m),k=Ju(),M=Le(()=>{var I;const S=(I=i.find(N=>N.width>=x*k))!==null&&I!==void 0?I:i[i.length-1];(!n||i.findIndex(N=>N.src===n)<i.findIndex(N=>N===S))&&a({type:"fetch",source:S.src})});Vt(M,[l.width,l.height,k,M]);const v=Le(I=>a({type:"done",source:I})),T={WebkitTransform:c?"initial":"translateZ(0)"};return p||Object.assign(T,l.width/l.height<u/g?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),A.createElement(A.Fragment,null,o&&o!==n&&A.createElement(mr,{key:"preload",...e,offset:void 0,slide:{...s,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...T},onLoad:()=>v(o),render:{...h,iconLoading:()=>null,iconError:()=>null}}),n&&A.createElement(mr,{key:"current",...e,slide:{...s,src:n,srcSet:void 0},style:T}))}function og({render:e,slide:t,offset:r,rect:n}){var o;const[a,s]=A.useState(),l=A.useRef(null),{zoom:f,maxZoom:h,offsetX:c,offsetY:i,setZoomWrapper:u}=la(),g=f>1,{carousel:p,on:m}=ct(),{currentIndex:x}=Ut();Vt(()=>r===0?(u({zoomWrapperRef:l,imageDimensions:a}),()=>u(void 0)):()=>{},[r,a,u]);let k=(o=e.slide)===null||o===void 0?void 0:o.call(e,{slide:t,offset:r,rect:n,zoom:f,maxZoom:h});if(!k&&pr(t)){const M={slide:t,offset:r,rect:n,render:e,imageFit:p.imageFit,imageProps:p.imageProps,onClick:r===0?()=>{var v;return(v=m.click)===null||v===void 0?void 0:v.call(m,{index:x})}:void 0};k=tg(t)?A.createElement(ng,{...M,slide:t,interactive:g,rect:r===0?{width:n.width*f,height:n.height*f}:n}):A.createElement(mr,{onLoad:v=>s({width:v.naturalWidth,height:v.naturalHeight}),...M})}return k?A.createElement("div",{ref:l,className:ht(ye(qs),ye(Ir),ye(Qs),g&&ye(Vu)),style:r===0?{transform:`scale(${f}) translateX(${c}px) translateY(${i}px)`}:void 0},k):null}const ag=({augment:e,addModule:t})=>{e(({zoom:r,toolbar:n,render:o,controller:a,...s})=>{const l=Fl(r);return{zoom:l,toolbar:Ln(n,Xs,A.createElement(eg,null)),render:{...o,slide:f=>{var h;return pr(f.slide)?A.createElement(og,{render:o,...f}):(h=o.slide)===null||h===void 0?void 0:h.call(o,f)}},controller:{...a,preventDefaultWheelY:l.scrollToZoom},...s}}),t(Ft(Xs,Zf))},sg={separator:"/",container:{}},jl=e=>({...sg,...e});function lg({counter:e}){const{slides:t,currentIndex:r}=Ut(),{separator:n,container:{className:o,...a},className:s,...l}=jl(e);return t.length===0?null:A.createElement("div",{className:ht(ye("counter"),o||s),...l,...a,"aria-hidden":!0},r+1," ",n," ",t.length)}function ig({augment:e,addChild:t}){e(({counter:r,...n})=>({counter:jl(r),...n})),t(rn,Ft(Uu,lg))}const cg={autoplay:!1,delay:3e3,ref:null},Bl=e=>({...cg,...e}),Wl=A.createContext(null),dg=$t("useSlideshow","SlideshowContext",Wl);function ug({slideshow:e,carousel:{finite:t},on:r,children:n}){const{autoplay:o,delay:a,ref:s}=Bl(e),l=A.useRef(o),[f,h]=A.useState(o),c=A.useRef(void 0),i=A.useRef(void 0),{slides:u,currentIndex:g}=Ut(),{setTimeout:p,clearTimeout:m}=cn(),{subscribe:x}=Fr(),{next:k}=Yt(),{setAutoPlaying:M}=ea();A.useEffect(()=>M(f),[f,M]);const v=u.length===0||t&&g===u.length-1,T=A.useCallback(()=>{!f&&!v&&h(!0)},[f,v]),I=A.useCallback(()=>{f&&h(!1)},[f]),S=A.useCallback(()=>{m(c.current),c.current=void 0},[m]),N=Le(()=>{S(),!(!f||v||i.current===Mr||i.current===Go)&&(c.current=p(()=>{f&&(i.current=void 0,k())},a))});A.useEffect(N,[g,f,N]),A.useEffect(()=>{f&&v&&h(!1)},[g,f,v]);const w=Le(()=>{var O;return(O=r.slideshowStart)===null||O===void 0?void 0:O.call(r)}),y=Le(()=>{var O;return(O=r.slideshowStop)===null||O===void 0?void 0:O.call(r)});A.useEffect(()=>{f?w():l.current&&y(),l.current=f},[f,w,y]),A.useEffect(()=>Pr(S,x(Hu,()=>{i.current=Mr,S()}),x(Gu,()=>{i.current=Go,S()}),x(ju,()=>{i.current=an,N()}),x(Bu,()=>{i.current=sn,N()})),[x,S,N]);const E=A.useMemo(()=>({playing:f,disabled:v,play:T,pause:I}),[f,v,T,I]);return A.useImperativeHandle(s,()=>E,[E]),A.createElement(Wl.Provider,{value:E},n)}const fg=xt("Play",A.createElement("path",{d:"M8 5v14l11-7z"})),gg=xt("Pause",A.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function hg(){const{playing:e,disabled:t,play:r,pause:n}=dg(),{render:o}=ct(),a=kl(Yt().focus,t);return o.buttonSlideshow?A.createElement(A.Fragment,null,o.buttonSlideshow({playing:e,disabled:t,play:r,pause:n})):A.createElement(Ur,{label:e?"Pause":"Play",icon:e?gg:fg,renderIcon:e?o.iconSlideshowPause:o.iconSlideshowPlay,onClick:e?n:r,disabled:t,...a})}function pg({augment:e,addModule:t}){e(({slideshow:r,toolbar:n,...o})=>({toolbar:Ln(n,Ys,A.createElement(hg,null)),slideshow:Bl(r),...o})),t(Ft(Ys,ug))}const mg={auto:!1,ref:null},Vl=e=>({...mg,...e}),Kl=A.createContext(null),bg=$t("useFullscreen","FullscreenContext",Kl);function yg({fullscreen:e,on:t,children:r}){const{auto:n,ref:o}=Vl(e),a=A.useRef(null),[s,l]=A.useState(),[f,h]=A.useState(!1),c=A.useRef(!1),{getOwnerDocument:i}=$r();Vt(()=>{var v,T,I,S;const N=i();l(!((S=(I=(T=(v=N.fullscreenEnabled)!==null&&v!==void 0?v:N.webkitFullscreenEnabled)!==null&&T!==void 0?T:N.mozFullScreenEnabled)!==null&&I!==void 0?I:N.msFullscreenEnabled)!==null&&S!==void 0&&S))},[i]);const u=A.useCallback(()=>{var v;const T=i(),I=T.fullscreenElement||T.webkitFullscreenElement||T.mozFullScreenElement||T.msFullscreenElement;return((v=I?.shadowRoot)===null||v===void 0?void 0:v.fullscreenElement)||I},[i]),g=A.useCallback(()=>{const v=a.current;try{v.requestFullscreen?v.requestFullscreen().catch(()=>{}):v.webkitRequestFullscreen?v.webkitRequestFullscreen():v.mozRequestFullScreen?v.mozRequestFullScreen():v.msRequestFullscreen&&v.msRequestFullscreen()}catch{}},[]),p=A.useCallback(()=>{if(!u())return;const v=i();try{v.exitFullscreen?v.exitFullscreen().catch(()=>{}):v.webkitExitFullscreen?v.webkitExitFullscreen():v.mozCancelFullScreen?v.mozCancelFullScreen():v.msExitFullscreen&&v.msExitFullscreen()}catch{}},[u,i]);A.useEffect(()=>{const v=i(),T=()=>{h(u()===a.current)};return Pr(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(I=>(v.addEventListener(I,T),()=>v.removeEventListener(I,T))))},[u,i]);const m=Le(()=>{var v;return(v=t.enterFullscreen)===null||v===void 0?void 0:v.call(t)}),x=Le(()=>{var v;return(v=t.exitFullscreen)===null||v===void 0?void 0:v.call(t)});A.useEffect(()=>{f&&(c.current=!0),c.current&&(f?m:x)()},[f,m,x]);const k=Le(()=>{var v;return(v=n?g:null)===null||v===void 0||v(),p});A.useEffect(k,[k]);const M=A.useMemo(()=>({fullscreen:f,disabled:s,enter:g,exit:p}),[f,s,g,p]);return A.useImperativeHandle(o,()=>M,[M]),A.createElement("div",{ref:a,className:ht(ye(nn),ye(qs))},A.createElement(Kl.Provider,{value:M},r))}const vg=xt("EnterFullscreen",A.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),wg=xt("ExitFullscreen",A.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function xg(){var e;const{fullscreen:t,disabled:r,enter:n,exit:o}=bg(),{render:a}=ct();return r?null:a.buttonFullscreen?A.createElement(A.Fragment,null,(e=a.buttonFullscreen)===null||e===void 0?void 0:e.call(a,{fullscreen:t,disabled:r,enter:n,exit:o})):A.createElement(Ur,{disabled:r,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?wg:vg,renderIcon:t?a.iconExitFullscreen:a.iconEnterFullscreen,onClick:t?o:n})}function kg({augment:e,contains:t,addParent:r}){e(({fullscreen:n,toolbar:o,...a})=>({toolbar:Ln(o,nn,A.createElement(xg,null)),fullscreen:Vl(n),...a})),r(t(on)?on:rn,Ft(nn,yg))}const yr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},ia=e=>({...yr,...e});function Yl(){const{thumbnails:e}=ct();return ia(e)}const vr=e=>fr(on,e),dt=e=>vr(fr("thumbnail",e)),Cg=xt("VideoThumbnail",A.createElement("path",{d:"M10 16.5l6-4.5-6-4.5v9zM12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"})),_g=xt("UnknownThumbnail",A.createElement("path",{d:"M23 18V6c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zM8.5 12.5l2.5 3.01L14.5 11l4.5 6H5l3.5-4.5z"}));function Sg({slide:e,render:t,rect:r,imageFit:n}){var o;const a=(o=t.thumbnail)===null||o===void 0?void 0:o.call(t,{slide:e,render:t,rect:r,imageFit:n});if(a)return a;const s={render:t,rect:r,imageFit:n};if(e.thumbnail)return A.createElement(mr,{slide:{src:e.thumbnail},...s});if(pr(e))return A.createElement(mr,{slide:e,...s});const l=ye(dt(In));return e.type==="video"?A.createElement(A.Fragment,null,e.poster&&A.createElement(mr,{slide:{src:e.poster},...s}),A.createElement(Cg,{className:l})):A.createElement(_g,{className:l})}const Eg=gr("active"),ca=gr("fadein"),da=gr("fadeout"),Tg=gr("placeholder"),Xl="delay",ql="duration";function Ag({slide:e,index:t,onClick:r,fadeIn:n,fadeOut:o,placeholder:a,onLoseFocus:s}){const l=A.useRef(null),{render:f,styles:h,labels:c}=ct(),{slides:i,globalIndex:u}=Ut(),{getOwnerDocument:g}=$r(),{width:p,height:m,imageFit:x}=Yl(),k={width:p,height:m},M=t===u,v=Le(s);return A.useEffect(()=>{o&&g().activeElement===l.current&&v()},[o,v,g]),A.createElement("button",{ref:l,type:"button",className:ht(ye(Ir),ye(dt()),M&&ye(dt(Eg())),n&&ye(dt(ca())),o&&ye(dt(da())),a&&ye(dt(Tg()))),style:{...n?{[Xe(dt(ca(ql)))]:`${n.duration}ms`,[Xe(dt(ca(Xl)))]:`${n.delay}ms`}:null,...o?{[Xe(dt(da(ql)))]:`${o.duration}ms`,[Xe(dt(da(Xl)))]:`${o.delay}ms`}:null,...h.thumbnail},onClick:r,"aria-current":M?!0:void 0,"aria-label":ll(c,i,t)},e&&Sg({slide:e,render:f,rect:k,imageFit:x}))}function Zl(e){return["top","bottom"].includes(e)}function Ql(e,t){return t+2*(e.border+e.padding)+e.gap}function Ng(e){const{thumbnail:t,poster:r}=e||{thumbnail:"placeholder"};return typeof t=="string"&&t||typeof r=="string"&&r||e&&il(e)||void 0}function Jl({visible:e,containerRef:t}){const r=A.useRef(null),n=Fn(),{publish:o,subscribe:a}=Fr(),{carousel:s,styles:l,labels:f}=ct(),{slides:h,globalIndex:c,animation:i}=Ut(),{registerSensors:u,subscribeSensors:g}=Cl();Ol(g);const p=Yl(),{position:m,width:x,height:k,border:M,borderStyle:v,borderColor:T,borderRadius:I,padding:S,gap:N,vignette:w}=p,y=i?.duration!==void 0&&i?.increment||0,E=i?.duration||0,{prepareAnimation:O}=ra(r,_=>({keyframes:Zl(m)?[{transform:`translateX(${(n?-1:1)*Ql(p,x)*y+_}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${Ql(p,k)*y+_}px)`},{transform:"translateY(0)"}],duration:E,easing:i?.easing})),$=Le(()=>{let _=0;if(t.current&&r.current){const b=t.current.getBoundingClientRect(),z=r.current.getBoundingClientRect();_=Zl(m)?z.left-b.left-(b.width-z.width)/2:z.top-b.top-(b.height-z.height)/2}O(_)});A.useEffect(()=>Pr(a(Bo,$)),[a,$]);const P=cl(s,h),L=[];if(Zo(h))for(let _=c-P-Math.abs(y);_<=c+P+Math.abs(y);_+=1){const z=s.finite&&(_<0||_>h.length-1)||y<0&&_<c-P||y>0&&_>c+P?null:Qo(h,_),F=[`${_}`,Ng(z)].filter(Boolean).join("|");L.push({key:F,index:_,slide:z})}const U=_=>()=>{_>c?o(or,{count:_-c}):_<c&&o(nr,{count:c-_})};return A.createElement("div",{className:ht(ye(vr("container")),ye(Ir)),style:{...e?null:{display:"none"},...x!==yr.width?{[Xe(dt("width"))]:`${x}px`}:null,...k!==yr.height?{[Xe(dt("height"))]:`${k}px`}:null,...M!==yr.border?{[Xe(dt("border"))]:`${M}px`}:null,...v?{[Xe(dt("border_style"))]:v}:null,...T?{[Xe(dt("border_color"))]:T}:null,...I!==yr.borderRadius?{[Xe(dt("border_radius"))]:`${I}px`}:null,...S!==yr.padding?{[Xe(dt("padding"))]:`${S}px`}:null,...N!==yr.gap?{[Xe(dt("gap"))]:`${N}px`}:null,...l.thumbnailsContainer}},A.createElement("nav",{ref:r,style:l.thumbnailsTrack,className:ht(ye(vr("track")),ye(Ir)),"aria-label":hr(f,"Thumbnails"),tabIndex:-1,...u},L.map(({key:_,index:b,slide:z})=>{const F=E/Math.abs(y||1),G=y>0&&b>c+P-y&&b<=c+P||y<0&&b<c-P-y&&b>=c-P?{duration:F,delay:((y>0?b-(c+P-y):c-P-y-b)-1)*F}:void 0,X=y>0&&b<c-P||y<0&&b>c+P?{duration:F,delay:(y>0?y-(c-P-b):-y-(b-(c+P)))*F}:void 0;return A.createElement(Ag,{key:_,index:b,slide:z,fadeIn:G,fadeOut:X,placeholder:!z,onClick:U(b),onLoseFocus:()=>{var B;return(B=r.current)===null||B===void 0?void 0:B.focus()}})})),w&&A.createElement("div",{className:ye(vr("vignette"))}))}const Rl=A.createContext(null),Og=$t("useThumbnails","ThumbnailsContext",Rl);function Mg({children:e,...t}){const{ref:r,position:n,hidden:o}=ia(t.thumbnails),[a,s]=A.useState(!o),l=A.useRef(null),f=A.useMemo(()=>({visible:a,show:()=>s(!0),hide:()=>s(!1)}),[a]);return A.useImperativeHandle(r,()=>f,[f]),A.createElement(pl,{...t},A.createElement(Rl.Provider,{value:f},A.createElement("div",{ref:l,className:ht(ye(vr()),ye(vr(`${n}`)))},["start","top"].includes(n)&&A.createElement(Jl,{containerRef:l,visible:a}),A.createElement("div",{className:ye(vr("wrapper"))},e),["end","bottom"].includes(n)&&A.createElement(Jl,{containerRef:l,visible:a}))))}const ei=()=>A.createElement(A.Fragment,null,A.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),A.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),Ig=xt("ThumbnailsVisible",ei()),Dg=uf("ThumbnailsHidden",ei());function Pg(){const{visible:e,show:t,hide:r}=Og(),{render:n}=ct();return n.buttonThumbnails?A.createElement(A.Fragment,null,n.buttonThumbnails({visible:e,show:t,hide:r})):A.createElement(Ur,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?Ig:Dg,renderIcon:e?n.iconThumbnailsVisible:n.iconThumbnailsHidden,onClick:e?r:t})}function Lg({augment:e,contains:t,append:r,addParent:n}){e(({thumbnails:a,toolbar:s,...l})=>{const f=ia(a);return{toolbar:Ln(s,on,f.showToggle?A.createElement(Pg,null):null),thumbnails:f,...l}});const o=Ft(on,Mg);t(nn)?r(nn,o):n(rn,o)}const $g="X-Board-Secret-View-Token";function zn(){const e=window.G7Core?.state?.get?.("_global")?.secretViewToken;return typeof e=="string"&&e!==""?{[$g]:e}:{}}const It=({className:e="",children:t,style:r,...n})=>d.jsx("i",{className:e,style:r,...n,children:t}),ua=e=>{if(!e||typeof window>"u"||!window.location||!/^(https?:)?\/\//i.test(e))return!1;try{return new URL(e,window.location.href).origin!==window.location.origin}catch{return!1}},fa=window.G7Core,Hn=(e,t)=>fa?.t?.(e,t)??e,Fg=async(e,t)=>{try{const r=await fa.api.get(e,{responseType:"blob",headers:zn()});if(r){const n=URL.createObjectURL(r),o=document.createElement("a");o.href=n,o.download=t,document.body.appendChild(o),o.click(),document.body.removeChild(o),URL.revokeObjectURL(n)}}catch(r){console.error("Failed to download file:",r),fa?.toast?.error?.(Hn("common.download_failed"))}},Ug=(e,t)=>{const r=document.createElement("a");r.href=e,r.download=t,r.target="_blank",document.body.appendChild(r),r.click(),document.body.removeChild(r)},ti=async e=>{const t=e.downloadUrl||e.src,r=e.filename||e.title||"image";e.downloadRequiresAuth&&!ua(t)?await Fg(t,r):Ug(t,r)},zg=({image:e,index:t,onDownload:r})=>{const[n,o]=C.useState(!1),a=async s=>{if(s.stopPropagation(),r){r(e,t);return}o(!0);try{await ti(e)}finally{o(!1)}};return d.jsx(R,{type:"button",onClick:a,disabled:n,className:"yarl__button flex items-center justify-center","aria-label":Hn("common.download"),title:Hn("common.download"),children:n?d.jsx(It,{className:"fa-solid fa-spinner fa-spin text-white"}):d.jsx(It,{className:"fa-solid fa-download text-white"})})},zr=({images:e,isOpen:t,onClose:r,startIndex:n=0,enableZoom:o=!0,enableSlideshow:a=!1,enableFullscreen:s=!0,showCounter:l=!0,showDownload:f=!0,showThumbnails:h=!0,onDownload:c,editorAttrs:i,id:u})=>{const[g,p]=C.useState(n),m=C.useRef(n),x=e.map(v=>({src:v.src,title:v.title,description:v.description})),k=[];o&&k.push(ag),a&&k.push(pg),s&&k.push(kg),l&&k.push(ig),h&&k.push(Lg);const M=e[g];if(C.useEffect(()=>{m.current=g},[g]),i){const v=(e??[]).slice(0,4);return d.jsx(j,{id:u,className:"grid grid-cols-2 gap-2 p-3 rounded-lg border border-dashed border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-800",...i,children:v.length>0?v.map((T,I)=>d.jsx(jt,{src:T.thumbnail||T.src,alt:T.title||"",className:"w-full aspect-square object-cover rounded bg-gray-200 dark:bg-gray-700"},I)):d.jsxs(j,{className:"col-span-2 flex items-center justify-center py-6 text-sm text-gray-400 dark:text-gray-500",children:[d.jsx(It,{className:"fa-regular fa-images mr-2"}),Hn("editor.component.image_gallery")]})})}return d.jsx(jf,{open:t,close:r,slides:x,index:g,plugins:k,on:{view:({index:v})=>{v!==m.current&&p(v)}},zoom:{maxZoomPixelRatio:3,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:300,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,scrollToZoom:!0},carousel:{finite:!0,preload:2,padding:"16px",spacing:"30%"},animation:{fade:250,swipe:500,easing:{fade:"ease",swipe:"ease-out",navigation:"ease-in-out"}},controller:{closeOnBackdropClick:!0,closeOnPullDown:!0,closeOnPullUp:!0},thumbnails:{position:"bottom",width:120,height:80,border:2,borderRadius:4,padding:4,gap:16,showToggle:!1,vignette:!0},toolbar:{buttons:[f&&M&&d.jsx(zg,{image:M,index:g,onDownload:c},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},ri=()=>{const[e,t]=C.useState(!1),[r,n]=C.useState([]),[o,a]=C.useState(0),s=C.useCallback((f,h=0)=>{n(f),a(h),t(!0)},[]),l=C.useCallback(()=>{t(!1)},[]);return{isOpen:e,openGallery:s,closeGallery:l,galleryProps:{images:r,isOpen:e,onClose:l,startIndex:o}}};zr.displayName="ImageGallery";const ni=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:zr,default:zr,executeImageDownload:ti,useImageGallery:ri},Symbol.toStringTag,{value:"Module"})),Hg=window.G7Core,ga=(e,t)=>Hg?.t?.(e,t)??e,Gn=e=>e.url??e.download_url,jn=({images:e=[],className:t="",id:r,editorAttrs:n})=>{const[o,a]=C.useState(0),{openGallery:s,galleryProps:l}=ri(),f=C.useMemo(()=>e.map(c=>({src:Gn(c),title:c.alt_text_current??"",thumbnail:Gn(c),downloadUrl:c.download_url,filename:c.alt_text_current??`image-${c.id}`})),[e]);if(!e||e.length===0)return d.jsx(j,{className:`flex items-center justify-center bg-gray-100 dark:bg-gray-700 rounded-lg aspect-square ${t}`,id:r,...n,children:d.jsxs(j,{className:"text-center text-gray-400 dark:text-gray-500",children:[d.jsx(fe,{name:"image",size:"3x",className:"mb-3 opacity-50"}),d.jsx(j,{className:"text-sm",children:ga("shop.no_image")})]})});const h=e[o]??e[0];return d.jsxs(j,{id:r,className:t,...n,children:[d.jsx(j,{className:"relative overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-700 aspect-square mb-3",children:d.jsx(R,{type:"button",className:"w-full h-full cursor-zoom-in block",onClick:()=>s(f,o),"aria-label":ga("shop.view_image"),children:d.jsx(jt,{src:Gn(h),alt:h.alt_text_current??"",className:"w-full h-full object-contain"})})}),e.length>1&&d.jsx(j,{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((c,i)=>d.jsx(R,{type:"button",className:`flex-shrink-0 w-16 h-16 rounded-md overflow-hidden border-2 transition-colors cursor-pointer ${i===o?"border-gray-900 dark:border-white":"border-gray-200 dark:border-gray-600 hover:border-gray-400 dark:hover:border-gray-400"}`,onClick:()=>a(i),"aria-label":c.alt_text_current??`${ga("shop.image")} ${i+1}`,children:d.jsx(jt,{src:Gn(c),alt:c.alt_text_current??"",className:"w-full h-full object-cover"})},c.id))}),d.jsx(zr,{...l})]})};jn.displayName="ProductImageViewer";const Gg=Object.freeze(Object.defineProperty({__proto__:null,ProductImageViewer:jn,default:jn},Symbol.toStringTag,{value:"Module"})),oi=({value:e,min:t=1,max:r=999,onChange:n,size:o="md",disabled:a=!1,className:s="",id:l,editorAttrs:f})=>{const c={sm:{container:"h-8",button:"w-8 h-8 text-sm",input:"w-10 text-sm"},md:{container:"h-10",button:"w-10 h-10",input:"w-14"},lg:{container:"h-12",button:"w-12 h-12 text-lg",input:"w-16 text-lg"}}[o],i=()=>{e>t&&!a&&n(e-1)},u=()=>{e<r&&!a&&n(e+1)},g=k=>{const M=parseInt(k.target.value,10);if(!isNaN(M)){const v=Math.max(t,Math.min(r,M));n(v)}},p=k=>{const M=parseInt(k.target.value,10);isNaN(M)||M<t?n(t):M>r&&n(r)},m=a||e<=t,x=a||e>=r;return d.jsxs(j,{className:`inline-flex items-center border border-gray-300 dark:border-gray-600 rounded-lg ${c.container} ${s}`,id:l,...f,children:[d.jsx(R,{type:"button",onClick:i,disabled:m,className:`${c.button} flex items-center justify-center text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-l-lg transition-colors`,"aria-label":"수량 감소",children:d.jsx(fe,{name:"minus",className:"w-4 h-4"})}),d.jsx(At,{type:"number",value:e,onChange:g,onBlur:p,min:t,max:r,disabled:a,className:`${c.input} text-center border-x border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,"aria-label":"수량"}),d.jsx(R,{type:"button",onClick:u,disabled:x,className:`${c.button} flex items-center justify-center text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed rounded-r-lg transition-colors`,"aria-label":"수량 증가",children:d.jsx(fe,{name:"plus",className:"w-4 h-4"})})]})},jg=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"})),Bg=window.G7Core?.createLogger?.("Comp:PostReactions")??{log:(...e)=>console.log("[Comp:PostReactions]",...e),warn:(...e)=>console.warn("[Comp:PostReactions]",...e),error:(...e)=>console.error("[Comp:PostReactions]",...e)},ai=(e,t)=>window.G7Core?.t?.(e,t)??e,Wg=[{type:"like",emoji:"👍",labelKey:"board.reactions.like",activeColor:"bg-blue-100 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400"},{type:"funny",emoji:"😂",labelKey:"board.reactions.funny",activeColor:"bg-yellow-100 dark:bg-yellow-900/30 text-yellow-600 dark:text-yellow-400"},{type:"agree",emoji:"👌",labelKey:"board.reactions.agree",activeColor:"bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400"},{type:"thanks",emoji:"🙏",labelKey:"board.reactions.thanks",activeColor:"bg-purple-100 dark:bg-purple-900/30 text-purple-600 dark:text-purple-400"},{type:"wow",emoji:"😮",labelKey:"board.reactions.wow",activeColor:"bg-orange-100 dark:bg-orange-900/30 text-orange-600 dark:text-orange-400"}],si=({reactions:e,userReaction:t,postId:r,onReact:n,size:o="md",className:a="",id:s,editorAttrs:l})=>{const f={sm:"px-2 py-1 text-xs gap-1",md:"px-3 py-1.5 text-sm gap-1.5",lg:"px-4 py-2 text-base gap-2"},h={sm:"text-sm",md:"text-base",lg:"text-lg"},c=u=>e.find(p=>p.type===u)?.count??0,i=async u=>{if(n){n(u);return}try{if(!(await fetch(`/api/posts/${r}/reactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:u}),credentials:"include"})).ok)throw new Error("리액션 처리 실패");window.location.reload()}catch(g){Bg.error("리액션 오류:",g)}};return d.jsx(j,{className:`flex flex-wrap gap-2 ${a}`,id:s,...l,children:Wg.map(u=>{const g=c(u.type),p=t===u.type;return d.jsxs(R,{onClick:()=>i(u.type),className:`
|
||
inline-flex items-center rounded-full border transition-colors
|
||
${f[o]}
|
||
${p?`${u.activeColor} border-transparent`:"border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"}
|
||
`,title:ai(u.labelKey),children:[d.jsx(te,{className:h[o],children:u.emoji}),d.jsx(te,{children:ai(u.labelKey)}),g>0&&d.jsx(te,{className:"font-medium",children:g})]},u.type)})})},Vg=Object.freeze(Object.defineProperty({__proto__:null,default:si},Symbol.toStringTag,{value:"Module"})),Bn=window.G7Core?.createLogger?.("Comp:RichTextEditor")??{log:(...e)=>console.log("[Comp:RichTextEditor]",...e),warn:(...e)=>console.warn("[Comp:RichTextEditor]",...e),error:(...e)=>console.error("[Comp:RichTextEditor]",...e)},Dt=(e,t)=>window.G7Core?.t?.(e,t)??e,li=({name:e,initialValue:t="",placeholder:r,onChange:n,imageUploadUrl:o="/api/upload/image",minHeight:a="300px",disabled:s=!1,className:l="",id:f,editorAttrs:h})=>{const c=C.useRef(null),[i,u]=C.useState(t),[g,p]=C.useState(!1),[m,x]=C.useState(!1),[k,M]=C.useState("");C.useEffect(()=>{c.current&&!c.current.innerHTML&&(c.current.innerHTML=t)},[t]),C.useEffect(()=>{n&&n(i)},[i,n]);const v=E=>{Bn.log("Apply format:",E)},T=async E=>{const O=new FormData;O.append("file",E);try{const $=await fetch(o,{method:"POST",body:O,credentials:"include"});if(!$.ok)throw new Error("업로드 실패");const P=await $.json();Bn.log("Image uploaded:",P.url)}catch($){Bn.error("이미지 업로드 오류:",$)}},I=E=>{const O=E.target.files?.[0];O&&T(O)},S=()=>{k&&(Bn.log("Insert link:",k),x(!1),M(""))},N=[{format:"bold",icon:"B",title:Dt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Dt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Dt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Dt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Dt("editor.toolbar.code")}],w=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Dt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Dt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Dt("editor.toolbar.blockquote")}];return d.jsxs(j,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[d.jsxs(j,{className:"flex flex-wrap items-center gap-1 p-2 bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:[d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:N.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:E.title,children:E.icon},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:w.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.format),disabled:s,className:"px-2 h-8 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",children:E.label},E.format))}),d.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(E=>d.jsx(R,{type:"button",onClick:()=>v(E.format),disabled:s,className:"w-8 h-8 flex items-center justify-center text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:E.title,children:E.icon},E.format))}),d.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[d.jsx(R,{type:"button",onClick:()=>x(!0),disabled:s,className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50",title:Dt("editor.toolbar.link"),children:"🔗"}),d.jsxs(Ar,{className:"w-8 h-8 flex items-center justify-center text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded cursor-pointer",children:["🖼",d.jsx(At,{type:"file",accept:"image/*",onChange:I,disabled:s,className:"hidden"})]})]}),d.jsxs(R,{type:"button",onClick:()=>p(!g),disabled:s,className:`px-2 h-8 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-700 rounded disabled:opacity-50 ${g?"bg-gray-200 dark:bg-gray-700":""}`,children:["</>",Dt("editor.toolbar.code_view")]})]}),g?d.jsx(Co,{value:i,onChange:E=>u(E.target.value),placeholder:r,disabled:s,className:"w-full p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none resize-none",style:{minHeight:a}}):d.jsx(j,{ref:c,contentEditable:!s,onInput:E=>u(E.currentTarget.innerHTML),className:"p-4 bg-white dark:bg-gray-900 text-gray-900 dark:text-white focus:outline-none prose dark:prose-invert max-w-none",style:{minHeight:a},"data-placeholder":r}),d.jsx(At,{type:"hidden",name:e,value:i}),m&&d.jsx(j,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:d.jsxs(j,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[d.jsx(Tn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:Dt("editor.link_modal.title")}),d.jsx(At,{type:"url",value:k,onChange:E=>M(E.target.value),placeholder:"https://example.com",className:"w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white mb-4"}),d.jsxs(j,{className:"flex justify-end gap-2",children:[d.jsx(R,{type:"button",onClick:()=>{x(!1),M("")},className:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg",children:Dt("common.cancel")}),d.jsx(R,{type:"button",onClick:S,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",children:Dt("editor.link_modal.insert")})]})]})})]})},Kg=Object.freeze(Object.defineProperty({__proto__:null,default:li},Symbol.toStringTag,{value:"Module"})),ha=({content:e,text:t,isHtml:r=!0,className:n="",purifyConfig:o,id:a,editorAttrs:s})=>{const l=t??e??"";if(!l||l.trim()==="")return null;if(!r){const i=`
|
||
whitespace-pre-wrap
|
||
text-gray-900 dark:text-gray-100
|
||
font-sans
|
||
${n}
|
||
`.trim().replace(/\s+/g," ");return d.jsx(j,{className:i,id:a,...s,children:l})}const f={FORBID_TAGS:["script","noscript","iframe","frame","frameset","object","embed","applet","portal","form","input","textarea","select","button","style","link","meta","base","body","head","html","title","svg","math","audio","video","source","track","canvas","details","dialog","plaintext","xmp","listing","marquee","noframes","noembed","template","slot"],FORBID_ATTR:["onerror","onload","onclick","onmouseover","onfocus","onblur","ontoggle","oncanplay","onloadstart","formaction","xlink:href","action"],ALLOW_DATA_ATTR:!0,ADD_ATTR:["target"]},h=C.useMemo(()=>{const i=o?{...f,...o,FORBID_TAGS:[...f.FORBID_TAGS,...o.FORBID_TAGS||[]],FORBID_ATTR:[...f.FORBID_ATTR,...o.FORBID_ATTR||[]]}:f;return Uo.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,x)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${x} rel="noopener noreferrer">`:g)},[l,o]),c=`
|
||
prose dark:prose-invert max-w-none
|
||
prose-p:my-2
|
||
prose-headings:font-bold prose-headings:mt-6 prose-headings:mb-4
|
||
prose-h1:text-2xl prose-h2:text-xl prose-h3:text-lg
|
||
prose-a:text-blue-600 dark:prose-a:text-blue-400
|
||
prose-a:no-underline hover:prose-a:underline
|
||
prose-blockquote:border-l-4 prose-blockquote:border-gray-300 dark:prose-blockquote:border-gray-600
|
||
prose-blockquote:pl-4 prose-blockquote:italic
|
||
prose-code:bg-gray-100 dark:prose-code:bg-gray-800
|
||
prose-code:px-1 prose-code:py-0.5 prose-code:rounded
|
||
prose-pre:bg-gray-100 dark:prose-pre:bg-gray-800
|
||
prose-pre:p-4 prose-pre:rounded-lg prose-pre:overflow-x-auto
|
||
[&_table]:w-full [&_table]:border-collapse [&_table]:border [&_table]:border-gray-300
|
||
dark:[&_table]:border-gray-600
|
||
[&_th]:border [&_th]:border-gray-300 [&_th]:px-4 [&_th]:py-2 [&_th]:bg-gray-100 [&_th]:text-left
|
||
dark:[&_th]:border-gray-600 dark:[&_th]:bg-gray-800
|
||
[&_td]:border [&_td]:border-gray-300 [&_td]:px-4 [&_td]:py-2
|
||
dark:[&_td]:border-gray-600
|
||
[&_tr:hover]:bg-gray-50 dark:[&_tr:hover]:bg-gray-700/50
|
||
after:content-[''] after:block after:clear-both
|
||
${n}
|
||
`.trim().replace(/\s+/g," ");return d.jsx(j,{id:a,className:c,dangerouslySetInnerHTML:{__html:h},...s})},Yg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ha},Symbol.toStringTag,{value:"Module"})),pa=()=>window.G7Core,ma=(e,t)=>pa()?.t?.(e,t)??e,ii=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:c="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[x,k]=C.useState(r),[M,v]=C.useState(e),[T,I]=C.useState(!1);C.useEffect(()=>{k(r)},[r]),C.useEffect(()=>{v(e)},[e]);const S=C.useCallback(y=>{const E=y.target.value;if(v(E),t){const O=pa()?.createChangeEvent?.({value:E,name:i,type:"textarea"})??{target:{name:i,value:E}};t(O)}},[t,i]),N=C.useCallback(y=>{const E=y.target.checked;if(k(E),E||I(!1),n){const O=pa()?.createChangeEvent?.({checked:E,name:u,type:"checkbox"})??{target:{name:u,checked:E}};n(O)}},[n,u]),w=C.useCallback(()=>{I(y=>!y)},[]);return d.jsxs(j,{className:`space-y-2 ${c}`,id:p,...m,children:[d.jsxs(j,{className:"flex items-center justify-between",children:[s&&d.jsx(Ar,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),d.jsxs(j,{className:"flex items-center gap-3",children:[x&&!g&&d.jsx(R,{type:"button",onClick:w,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${T?"text-gray-700 dark:text-gray-200 bg-gray-200 dark:bg-gray-600 border border-gray-300 dark:border-gray-500 hover:bg-gray-300 dark:hover:bg-gray-500 focus:ring-gray-400 dark:focus:ring-gray-500":"text-blue-600 dark:text-blue-400 bg-white dark:bg-gray-700 border border-blue-300 dark:border-blue-600 hover:bg-blue-50 dark:hover:bg-gray-600 focus:ring-blue-500 dark:focus:ring-blue-600"}`,children:ma(T?"common.preview_off":"common.preview")}),l&&d.jsxs(Ar,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[d.jsx(At,{type:"checkbox",name:u,checked:x,onChange:N,disabled:g,className:"w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600"}),d.jsx(j,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:ma("common.html_mode")})]})]})]}),!T&&d.jsx(Co,{name:i,value:M,onChange:S,placeholder:a,rows:o,readOnly:g,className:`block w-full rounded-lg border px-3 py-2 text-sm placeholder-gray-400 dark:placeholder-gray-500 focus:outline-none focus:ring-1 disabled:opacity-50 disabled:cursor-not-allowed ${x?"font-mono bg-white dark:bg-gray-800 border-blue-300 dark:border-blue-600 text-gray-800 dark:text-gray-200 focus:border-blue-500 focus:ring-blue-500":"bg-white dark:bg-gray-800 border-gray-300 dark:border-gray-600 text-gray-900 dark:text-white focus:border-blue-500 focus:ring-blue-500"}`}),T&&d.jsx(j,{className:"p-4 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-800 min-h-[400px]",children:d.jsx(ha,{content:M,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Xg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:ii},Symbol.toStringTag,{value:"Module"})),ci=e=>window.G7Core?.t?.(e)??e,ba=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=C.useState(!1),[h,c]=C.useState(!1),i=C.useRef(null),u=C.useCallback(()=>{if(i.current){const x=i.current.scrollHeight;c(x>e)}},[e]);C.useEffect(()=>{u();const x=i.current;if(!x)return;const k=x.querySelectorAll("img");k.forEach(v=>{v.complete||v.addEventListener("load",u)});let M=null;return typeof ResizeObserver<"u"&&(M=new ResizeObserver(u),M.observe(x)),()=>{k.forEach(v=>{v.removeEventListener("load",u)}),M?.disconnect()}},[u,o]);const g=()=>{f(x=>!x)},p=t||ci("sirsoft-ecommerce.shop.product.expand_detail"),m=r||ci("sirsoft-ecommerce.shop.product.collapse_detail");return d.jsxs(j,{className:n,id:a,...s,children:[d.jsxs(j,{className:"relative",children:[d.jsx(j,{ref:i,className:!l&&h?"overflow-hidden transition-[max-height] duration-300 ease-in-out":"transition-[max-height] duration-300 ease-in-out",style:!l&&h?{maxHeight:`${e}px`}:void 0,children:o}),!l&&h&&d.jsx(j,{className:"absolute bottom-0 left-0 right-0 h-24 bg-gradient-to-t from-white dark:from-gray-900 to-transparent pointer-events-none"})]}),h&&d.jsxs(R,{type:"button",onClick:g,className:"flex items-center justify-center w-full py-3.5 bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors cursor-pointer gap-1.5",children:[d.jsx(te,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),d.jsx(fe,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},qg=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:ba,default:ba},Symbol.toStringTag,{value:"Module"})),Zg=(e,t)=>window.G7Core?.t?.(e,t)??e,ya=({isOpen:e,onClose:t,title:r,icon:n,iconClassName:o="text-gray-500 dark:text-gray-400",closeOnBackdropClick:a=!0,closeOnOverlayClick:s,showCloseButton:l=!0,closeOnEscape:f=!0,children:h,width:c="500px",className:i="",style:u})=>{const g=s!==void 0?s:a,p=C.useRef(null),m=C.useRef(null);if(C.useEffect(()=>{const k=M=>{M.key==="Escape"&&e&&f&&t()};if(e&&f)return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[e,t,f]),C.useEffect(()=>{if(e&&p.current){m.current=document.activeElement;const k=p.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),M=k[0],v=k[k.length-1];M?.focus();const T=I=>{I.key==="Tab"&&(I.shiftKey?document.activeElement===M&&(I.preventDefault(),v?.focus()):document.activeElement===v&&(I.preventDefault(),M?.focus()))};return document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T),m.current?.focus()}}},[e]),C.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const x=u?.zIndex??50;return d.jsxs(j,{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:x},onClick:g?t:void 0,children:[d.jsx(j,{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),d.jsxs(j,{ref:p,className:`relative bg-white dark:bg-gray-800 rounded-lg shadow-xl max-h-[90vh] max-w-[calc(100vw-2rem)] overflow-hidden ${i}`,style:{width:c,...u?{...u,zIndex:void 0}:{}},onClick:k=>k.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,children:[(r||n||l)&&d.jsxs(j,{className:"flex items-center justify-between p-4",children:[(r||n)&&d.jsxs(j,{id:"modal-title",className:"flex items-center gap-3 text-lg font-semibold text-gray-900 dark:text-white",children:[n&&d.jsx(fe,{name:n,size:"md",className:o}),r]}),l&&d.jsx(R,{onClick:t,className:"ml-auto text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300 focus:outline-none","aria-label":Zg("common.close_modal"),children:d.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),d.jsx(j,{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-140px)]",children:h})]})]})},Qg=Object.freeze(Object.defineProperty({__proto__:null,Modal:ya},Symbol.toStringTag,{value:"Module"})),va=(e,t)=>window.G7Core?.t?.(e,t)??e,wa=({isOpen:e,onClose:t,title:r,message:n,confirmText:o,cancelText:a,onConfirm:s,onCancel:l,confirmButtonVariant:f="primary",cancelButtonVariant:h="secondary",width:c="500px",closeOnOverlay:i=!0,isLoading:u=!1,loadingText:g})=>{const p=o??va("common.confirm"),m=a??va("common.cancel"),x=g??va("common.loading"),k=()=>{s()},M=()=>{u||(l?.(),t())},v=()=>{u||t()},T={primary:"bg-blue-600 text-white hover:bg-blue-700",secondary:"bg-gray-200 dark:bg-gray-700 text-gray-800 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600",danger:"bg-red-600 text-white hover:bg-red-700",ghost:"bg-transparent text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700"};return d.jsxs(ya,{isOpen:e,onClose:v,title:r,width:c,children:[d.jsx(j,{className:"py-2",children:typeof n=="string"?d.jsx(Gt,{className:"text-gray-700 dark:text-gray-300",children:n}):n}),d.jsxs(j,{className:"flex justify-end gap-3 mt-6",children:[d.jsx(R,{onClick:M,disabled:u,className:"px-4 py-2 bg-white dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-300 dark:border-gray-600 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed",children:d.jsx(te,{children:m})}),d.jsxs(R,{onClick:k,disabled:u,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${T[f]}`,children:[u&&d.jsx(It,{className:"fa-solid fa-spinner w-4 h-4 animate-spin"}),d.jsx(te,{children:u?x:p})]})]})]})},Jg=Object.freeze(Object.defineProperty({__proto__:null,ConfirmDialog:wa},Symbol.toStringTag,{value:"Module"})),di=C.createContext(null),ui=({value:e,children:t})=>d.jsx(di.Provider,{value:e,children:t}),Rg=()=>{const e=C.useContext(di);if(!e)throw new Error("useFileUploaderContext must be used within FileUploaderProvider");return e};function eh(e,t){return t.forEach((function(r){r&&typeof r!="string"&&!Array.isArray(r)&&Object.keys(r).forEach((function(n){if(n!=="default"&&!(n in e)){var o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return r[n]}})}}))})),Object.freeze(e)}function fi(e,t){return new Promise((function(r,n){let o;return th(e).then((function(a){try{return o=a,r(new Blob([t.slice(0,2),o,t.slice(2)],{type:"image/jpeg"}))}catch(s){return n(s)}}),n)}))}const th=e=>new Promise(((t,r)=>{const n=new FileReader;n.addEventListener("load",(({target:{result:o}})=>{const a=new DataView(o);let s=0;if(a.getUint16(s)!==65496)return r("not a valid JPEG");for(s+=2;;){const l=a.getUint16(s);if(l===65498)break;const f=a.getUint16(s+2);if(l===65505&&a.getUint32(s+4)===1165519206){const h=s+10;let c;switch(a.getUint16(h)){case 18761:c=!0;break;case 19789:c=!1;break;default:return r("TIFF header contains invalid endian")}if(a.getUint16(h+2,c)!==42)return r("TIFF header contains invalid version");const i=a.getUint32(h+4,c),u=h+i+2+12*a.getUint16(h+i,c);for(let g=h+i+2;g<u;g+=12)if(a.getUint16(g,c)==274){if(a.getUint16(g+2,c)!==3)return r("Orientation data type is invalid");if(a.getUint32(g+4,c)!==1)return r("Orientation data count is invalid");a.setUint16(g+8,1,c);break}return t(o.slice(s,s+2+f))}s+=2+f}return t(new Blob)})),n.readAsArrayBuffer(e)}));var Wn={},rh={get exports(){return Wn},set exports(e){Wn=e}};(function(e){var t,r,n={};rh.exports=n,n.parse=function(o,a){for(var s=n.bin.readUshort,l=n.bin.readUint,f=0,h={},c=new Uint8Array(o),i=c.length-4;l(c,i)!=101010256;)i--;f=i,f+=4;var u=s(c,f+=4);s(c,f+=2);var g=l(c,f+=2),p=l(c,f+=4);f+=4,f=p;for(var m=0;m<u;m++){l(c,f),f+=4,f+=4,f+=4,l(c,f+=4),g=l(c,f+=4);var x=l(c,f+=4),k=s(c,f+=4),M=s(c,f+2),v=s(c,f+4);f+=6;var T=l(c,f+=8);f+=4,f+=k+M+v,n._readLocal(c,T,h,g,x,a)}return h},n._readLocal=function(o,a,s,l,f,h){var c=n.bin.readUshort,i=n.bin.readUint;i(o,a),c(o,a+=4),c(o,a+=2);var u=c(o,a+=2);i(o,a+=2),i(o,a+=4),a+=4;var g=c(o,a+=8),p=c(o,a+=2);a+=2;var m=n.bin.readUTF8(o,a,g);if(a+=g,a+=p,h)s[m]={size:f,csize:l};else{var x=new Uint8Array(o.buffer,a);if(u==0)s[m]=new Uint8Array(x.buffer.slice(a,a+l));else{if(u!=8)throw"unknown compression method: "+u;var k=new Uint8Array(f);n.inflateRaw(x,k),s[m]=k}}},n.inflateRaw=function(o,a){return n.F.inflate(o,a)},n.inflate=function(o,a){return o[0],o[1],n.inflateRaw(new Uint8Array(o.buffer,o.byteOffset+2,o.length-6),a)},n.deflate=function(o,a){a==null&&(a={level:6});var s=0,l=new Uint8Array(50+Math.floor(1.1*o.length));l[s]=120,l[s+1]=156,s+=2,s=n.F.deflateRaw(o,l,s,a.level);var f=n.adler(o,0,o.length);return l[s+0]=f>>>24&255,l[s+1]=f>>>16&255,l[s+2]=f>>>8&255,l[s+3]=f>>>0&255,new Uint8Array(l.buffer,0,s+4)},n.deflateRaw=function(o,a){a==null&&(a={level:6});var s=new Uint8Array(50+Math.floor(1.1*o.length)),l=n.F.deflateRaw(o,s,l,a.level);return new Uint8Array(s.buffer,0,l)},n.encode=function(o,a){a==null&&(a=!1);var s=0,l=n.bin.writeUint,f=n.bin.writeUshort,h={};for(var c in o){var i=!n._noNeed(c)&&!a,u=o[c],g=n.crc.crc(u,0,u.length);h[c]={cpr:i,usize:u.length,crc:g,file:i?n.deflateRaw(u):u}}for(var c in h)s+=h[c].file.length+30+46+2*n.bin.sizeUTF8(c);s+=22;var p=new Uint8Array(s),m=0,x=[];for(var c in h){var k=h[c];x.push(m),m=n._writeHeader(p,m,c,k,0)}var M=0,v=m;for(var c in h)k=h[c],x.push(m),m=n._writeHeader(p,m,c,k,1,x[M++]);var T=m-v;return l(p,m,101010256),m+=4,f(p,m+=4,M),f(p,m+=2,M),l(p,m+=2,T),l(p,m+=4,v),m+=4,m+=2,p.buffer},n._noNeed=function(o){var a=o.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(a)!=-1},n._writeHeader=function(o,a,s,l,f,h){var c=n.bin.writeUint,i=n.bin.writeUshort,u=l.file;return c(o,a,f==0?67324752:33639248),a+=4,f==1&&(a+=2),i(o,a,20),i(o,a+=2,0),i(o,a+=2,l.cpr?8:0),c(o,a+=2,0),c(o,a+=4,l.crc),c(o,a+=4,u.length),c(o,a+=4,l.usize),i(o,a+=4,n.bin.sizeUTF8(s)),i(o,a+=2,0),a+=2,f==1&&(a+=2,a+=2,c(o,a+=6,h),a+=4),a+=n.bin.writeUTF8(o,a,s),f==0&&(o.set(u,a),a+=u.length),a},n.crc={table:(function(){for(var o=new Uint32Array(256),a=0;a<256;a++){for(var s=a,l=0;l<8;l++)1&s?s=3988292384^s>>>1:s>>>=1;o[a]=s}return o})(),update:function(o,a,s,l){for(var f=0;f<l;f++)o=n.crc.table[255&(o^a[s+f])]^o>>>8;return o},crc:function(o,a,s){return 4294967295^n.crc.update(4294967295,o,a,s)}},n.adler=function(o,a,s){for(var l=1,f=0,h=a,c=a+s;h<c;){for(var i=Math.min(h+5552,c);h<i;)f+=l+=o[h++];l%=65521,f%=65521}return f<<16|l},n.bin={readUshort:function(o,a){return o[a]|o[a+1]<<8},writeUshort:function(o,a,s){o[a]=255&s,o[a+1]=s>>8&255},readUint:function(o,a){return 16777216*o[a+3]+(o[a+2]<<16|o[a+1]<<8|o[a])},writeUint:function(o,a,s){o[a]=255&s,o[a+1]=s>>8&255,o[a+2]=s>>16&255,o[a+3]=s>>24&255},readASCII:function(o,a,s){for(var l="",f=0;f<s;f++)l+=String.fromCharCode(o[a+f]);return l},writeASCII:function(o,a,s){for(var l=0;l<s.length;l++)o[a+l]=s.charCodeAt(l)},pad:function(o){return o.length<2?"0"+o:o},readUTF8:function(o,a,s){for(var l,f="",h=0;h<s;h++)f+="%"+n.bin.pad(o[a+h].toString(16));try{l=decodeURIComponent(f)}catch{return n.bin.readASCII(o,a,s)}return l},writeUTF8:function(o,a,s){for(var l=s.length,f=0,h=0;h<l;h++){var c=s.charCodeAt(h);if((4294967168&c)==0)o[a+f]=c,f++;else if((4294965248&c)==0)o[a+f]=192|c>>6,o[a+f+1]=128|c>>0&63,f+=2;else if((4294901760&c)==0)o[a+f]=224|c>>12,o[a+f+1]=128|c>>6&63,o[a+f+2]=128|c>>0&63,f+=3;else{if((4292870144&c)!=0)throw"e";o[a+f]=240|c>>18,o[a+f+1]=128|c>>12&63,o[a+f+2]=128|c>>6&63,o[a+f+3]=128|c>>0&63,f+=4}}return f},sizeUTF8:function(o){for(var a=o.length,s=0,l=0;l<a;l++){var f=o.charCodeAt(l);if((4294967168&f)==0)s++;else if((4294965248&f)==0)s+=2;else if((4294901760&f)==0)s+=3;else{if((4292870144&f)!=0)throw"e";s+=4}}return s}},n.F={},n.F.deflateRaw=function(o,a,s,l){var f=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][l],h=n.F.U,c=n.F._goodIndex;n.F._hash;var i=n.F._putsE,u=0,g=s<<3,p=0,m=o.length;if(l==0){for(;u<m;)i(a,g,u+(O=Math.min(65535,m-u))==m?1:0),g=n.F._copyExact(o,u,O,a,g+8),u+=O;return g>>>3}var x=h.lits,k=h.strt,M=h.prev,v=0,T=0,I=0,S=0,N=0,w=0;for(m>2&&(k[w=n.F._hash(o,0)]=0),u=0;u<m;u++){if(N=w,u+1<m-2){w=n.F._hash(o,u+1);var y=u+1&32767;M[y]=k[w],k[w]=y}if(p<=u){(v>14e3||T>26697)&&m-u>100&&(p<u&&(x[v]=u-p,v+=2,p=u),g=n.F._writeBlock(u==m-1||p==m?1:0,x,v,S,o,I,u-I,a,g),v=T=S=0,I=u);var E=0;u<m-2&&(E=n.F._bestMatch(o,u,M,N,Math.min(f[2],m-u),f[3]));var O=E>>>16,$=65535&E;if(E!=0){$=65535&E;var P=c(O=E>>>16,h.of0);h.lhst[257+P]++;var L=c($,h.df0);h.dhst[L]++,S+=h.exb[P]+h.dxb[L],x[v]=O<<23|u-p,x[v+1]=$<<16|P<<8|L,v+=2,p=u+O}else h.lhst[o[u]]++;T++}}for(I==u&&o.length!=0||(p<u&&(x[v]=u-p,v+=2,p=u),g=n.F._writeBlock(1,x,v,S,o,I,u-I,a,g),v=0,T=0,v=T=S=0,I=u);(7&g)!=0;)g++;return g>>>3},n.F._bestMatch=function(o,a,s,l,f,h){var c=32767&a,i=s[c],u=c-i+32768&32767;if(i==c||l!=n.F._hash(o,a-u))return 0;for(var g=0,p=0,m=Math.min(32767,a);u<=m&&--h!=0&&i!=c;){if(g==0||o[a+g]==o[a+g-u]){var x=n.F._howLong(o,a,u);if(x>g){if(p=u,(g=x)>=f)break;u+2<x&&(x=u+2);for(var k=0,M=0;M<x-2;M++){var v=a-u+M+32768&32767,T=v-s[v]+32768&32767;T>k&&(k=T,i=v)}}}u+=(c=i)-(i=s[c])+32768&32767}return g<<16|p},n.F._howLong=function(o,a,s){if(o[a]!=o[a-s]||o[a+1]!=o[a+1-s]||o[a+2]!=o[a+2-s])return 0;var l=a,f=Math.min(o.length,a+258);for(a+=3;a<f&&o[a]==o[a-s];)a++;return a-l},n.F._hash=function(o,a){return(o[a]<<8|o[a+1])+(o[a+2]<<4)&65535},n.saved=0,n.F._writeBlock=function(o,a,s,l,f,h,c,i,u){var g,p,m,x,k,M,v,T,I,S=n.F.U,N=n.F._putsF,w=n.F._putsE;S.lhst[256]++,p=(g=n.F.getTrees())[0],m=g[1],x=g[2],k=g[3],M=g[4],v=g[5],T=g[6],I=g[7];var y=32+((u+3&7)==0?0:8-(u+3&7))+(c<<3),E=l+n.F.contSize(S.fltree,S.lhst)+n.F.contSize(S.fdtree,S.dhst),O=l+n.F.contSize(S.ltree,S.lhst)+n.F.contSize(S.dtree,S.dhst);O+=14+3*v+n.F.contSize(S.itree,S.ihst)+(2*S.ihst[16]+3*S.ihst[17]+7*S.ihst[18]);for(var $=0;$<286;$++)S.lhst[$]=0;for($=0;$<30;$++)S.dhst[$]=0;for($=0;$<19;$++)S.ihst[$]=0;var P=y<E&&y<O?0:E<O?1:2;if(N(i,u,o),N(i,u+1,P),u+=3,P==0){for(;(7&u)!=0;)u++;u=n.F._copyExact(f,h,c,i,u)}else{var L,U;if(P==1&&(L=S.fltree,U=S.fdtree),P==2){n.F.makeCodes(S.ltree,p),n.F.revCodes(S.ltree,p),n.F.makeCodes(S.dtree,m),n.F.revCodes(S.dtree,m),n.F.makeCodes(S.itree,x),n.F.revCodes(S.itree,x),L=S.ltree,U=S.dtree,w(i,u,k-257),w(i,u+=5,M-1),w(i,u+=5,v-4),u+=4;for(var _=0;_<v;_++)w(i,u+3*_,S.itree[1+(S.ordr[_]<<1)]);u+=3*v,u=n.F._codeTiny(T,S.itree,i,u),u=n.F._codeTiny(I,S.itree,i,u)}for(var b=h,z=0;z<s;z+=2){for(var F=a[z],G=F>>>23,X=b+(8388607&F);b<X;)u=n.F._writeLit(f[b++],L,i,u);if(G!=0){var B=a[z+1],Y=B>>16,H=B>>8&255,W=255&B;w(i,u=n.F._writeLit(257+H,L,i,u),G-S.of0[H]),u+=S.exb[H],N(i,u=n.F._writeLit(W,U,i,u),Y-S.df0[W]),u+=S.dxb[W],b+=G}}u=n.F._writeLit(256,L,i,u)}return u},n.F._copyExact=function(o,a,s,l,f){var h=f>>>3;return l[h]=s,l[h+1]=s>>>8,l[h+2]=255-l[h],l[h+3]=255-l[h+1],h+=4,l.set(new Uint8Array(o.buffer,a,s),h),f+(s+4<<3)},n.F.getTrees=function(){for(var o=n.F.U,a=n.F._hufTree(o.lhst,o.ltree,15),s=n.F._hufTree(o.dhst,o.dtree,15),l=[],f=n.F._lenCodes(o.ltree,l),h=[],c=n.F._lenCodes(o.dtree,h),i=0;i<l.length;i+=2)o.ihst[l[i]]++;for(i=0;i<h.length;i+=2)o.ihst[h[i]]++;for(var u=n.F._hufTree(o.ihst,o.itree,7),g=19;g>4&&o.itree[1+(o.ordr[g-1]<<1)]==0;)g--;return[a,s,u,f,c,g,l,h]},n.F.getSecond=function(o){for(var a=[],s=0;s<o.length;s+=2)a.push(o[s+1]);return a},n.F.nonZero=function(o){for(var a="",s=0;s<o.length;s+=2)o[s+1]!=0&&(a+=(s>>1)+",");return a},n.F.contSize=function(o,a){for(var s=0,l=0;l<a.length;l++)s+=a[l]*o[1+(l<<1)];return s},n.F._codeTiny=function(o,a,s,l){for(var f=0;f<o.length;f+=2){var h=o[f],c=o[f+1];l=n.F._writeLit(h,a,s,l);var i=h==16?2:h==17?3:7;h>15&&(n.F._putsE(s,l,c,i),l+=i)}return l},n.F._lenCodes=function(o,a){for(var s=o.length;s!=2&&o[s-1]==0;)s-=2;for(var l=0;l<s;l+=2){var f=o[l+1],h=l+3<s?o[l+3]:-1,c=l+5<s?o[l+5]:-1,i=l==0?-1:o[l-1];if(f==0&&h==f&&c==f){for(var u=l+5;u+2<s&&o[u+2]==f;)u+=2;(g=Math.min(u+1-l>>>1,138))<11?a.push(17,g-3):a.push(18,g-11),l+=2*g-2}else if(f==i&&h==f&&c==f){for(u=l+5;u+2<s&&o[u+2]==f;)u+=2;var g=Math.min(u+1-l>>>1,6);a.push(16,g-3),l+=2*g-2}else a.push(f,0)}return s>>>1},n.F._hufTree=function(o,a,s){var l=[],f=o.length,h=a.length,c=0;for(c=0;c<h;c+=2)a[c]=0,a[c+1]=0;for(c=0;c<f;c++)o[c]!=0&&l.push({lit:c,f:o[c]});var i=l.length,u=l.slice(0);if(i==0)return 0;if(i==1){var g=l[0].lit;return u=g==0?1:0,a[1+(g<<1)]=1,a[1+(u<<1)]=1,1}l.sort((function(T,I){return T.f-I.f}));var p=l[0],m=l[1],x=0,k=1,M=2;for(l[0]={lit:-1,f:p.f+m.f,l:p,r:m,d:0};k!=i-1;)p=x!=k&&(M==i||l[x].f<l[M].f)?l[x++]:l[M++],m=x!=k&&(M==i||l[x].f<l[M].f)?l[x++]:l[M++],l[k++]={lit:-1,f:p.f+m.f,l:p,r:m};var v=n.F.setDepth(l[k-1],0);for(v>s&&(n.F.restrictDepth(u,s,v),v=s),c=0;c<i;c++)a[1+(u[c].lit<<1)]=u[c].d;return v},n.F.setDepth=function(o,a){return o.lit!=-1?(o.d=a,a):Math.max(n.F.setDepth(o.l,a+1),n.F.setDepth(o.r,a+1))},n.F.restrictDepth=function(o,a,s){var l=0,f=1<<s-a,h=0;for(o.sort((function(i,u){return u.d==i.d?i.f-u.f:u.d-i.d})),l=0;l<o.length&&o[l].d>a;l++){var c=o[l].d;o[l].d=a,h+=f-(1<<s-c)}for(h>>>=s-a;h>0;)(c=o[l].d)<a?(o[l].d++,h-=1<<a-c-1):l++;for(;l>=0;l--)o[l].d==a&&h<0&&(o[l].d--,h++);h!=0&&console.log("debt left")},n.F._goodIndex=function(o,a){var s=0;return a[16|s]<=o&&(s|=16),a[8|s]<=o&&(s|=8),a[4|s]<=o&&(s|=4),a[2|s]<=o&&(s|=2),a[1|s]<=o&&(s|=1),s},n.F._writeLit=function(o,a,s,l){return n.F._putsF(s,l,a[o<<1]),l+a[1+(o<<1)]},n.F.inflate=function(o,a){var s=Uint8Array;if(o[0]==3&&o[1]==0)return a||new s(0);var l=n.F,f=l._bitsF,h=l._bitsE,c=l._decodeTiny,i=l.makeCodes,u=l.codes2map,g=l._get17,p=l.U,m=a==null;m&&(a=new s(o.length>>>2<<3));for(var x,k,M=0,v=0,T=0,I=0,S=0,N=0,w=0,y=0,E=0;M==0;)if(M=f(o,E,1),v=f(o,E+1,2),E+=3,v!=0){if(m&&(a=n.F._check(a,y+131072)),v==1&&(x=p.flmap,k=p.fdmap,N=511,w=31),v==2){T=h(o,E,5)+257,I=h(o,E+5,5)+1,S=h(o,E+10,4)+4,E+=14;for(var O=0;O<38;O+=2)p.itree[O]=0,p.itree[O+1]=0;var $=1;for(O=0;O<S;O++){var P=h(o,E+3*O,3);p.itree[1+(p.ordr[O]<<1)]=P,P>$&&($=P)}E+=3*S,i(p.itree,$),u(p.itree,$,p.imap),x=p.lmap,k=p.dmap,E=c(p.imap,(1<<$)-1,T+I,o,E,p.ttree);var L=l._copyOut(p.ttree,0,T,p.ltree);N=(1<<L)-1;var U=l._copyOut(p.ttree,T,I,p.dtree);w=(1<<U)-1,i(p.ltree,L),u(p.ltree,L,x),i(p.dtree,U),u(p.dtree,U,k)}for(;;){var _=x[g(o,E)&N];E+=15&_;var b=_>>>4;if(!(b>>>8))a[y++]=b;else{if(b==256)break;var z=y+b-254;if(b>264){var F=p.ldef[b-257];z=y+(F>>>3)+h(o,E,7&F),E+=7&F}var G=k[g(o,E)&w];E+=15&G;var X=G>>>4,B=p.ddef[X],Y=(B>>>4)+f(o,E,15&B);for(E+=15&B,m&&(a=n.F._check(a,y+131072));y<z;)a[y]=a[y++-Y],a[y]=a[y++-Y],a[y]=a[y++-Y],a[y]=a[y++-Y];y=z}}}else{(7&E)!=0&&(E+=8-(7&E));var H=4+(E>>>3),W=o[H-4]|o[H-3]<<8;m&&(a=n.F._check(a,y+W)),a.set(new s(o.buffer,o.byteOffset+H,W),y),E=H+W<<3,y+=W}return a.length==y?a:a.slice(0,y)},n.F._check=function(o,a){var s=o.length;if(a<=s)return o;var l=new Uint8Array(Math.max(s<<1,a));return l.set(o,0),l},n.F._decodeTiny=function(o,a,s,l,f,h){for(var c=n.F._bitsE,i=n.F._get17,u=0;u<s;){var g=o[i(l,f)&a];f+=15&g;var p=g>>>4;if(p<=15)h[u]=p,u++;else{var m=0,x=0;p==16?(x=3+c(l,f,2),f+=2,m=h[u-1]):p==17?(x=3+c(l,f,3),f+=3):p==18&&(x=11+c(l,f,7),f+=7);for(var k=u+x;u<k;)h[u]=m,u++}}return f},n.F._copyOut=function(o,a,s,l){for(var f=0,h=0,c=l.length>>>1;h<s;){var i=o[h+a];l[h<<1]=0,l[1+(h<<1)]=i,i>f&&(f=i),h++}for(;h<c;)l[h<<1]=0,l[1+(h<<1)]=0,h++;return f},n.F.makeCodes=function(o,a){for(var s,l,f,h,c=n.F.U,i=o.length,u=c.bl_count,g=0;g<=a;g++)u[g]=0;for(g=1;g<i;g+=2)u[o[g]]++;var p=c.next_code;for(s=0,u[0]=0,l=1;l<=a;l++)s=s+u[l-1]<<1,p[l]=s;for(f=0;f<i;f+=2)(h=o[f+1])!=0&&(o[f]=p[h],p[h]++)},n.F.codes2map=function(o,a,s){for(var l=o.length,f=n.F.U.rev15,h=0;h<l;h+=2)if(o[h+1]!=0)for(var c=h>>1,i=o[h+1],u=c<<4|i,g=a-i,p=o[h]<<g,m=p+(1<<g);p!=m;)s[f[p]>>>15-a]=u,p++},n.F.revCodes=function(o,a){for(var s=n.F.U.rev15,l=15-a,f=0;f<o.length;f+=2){var h=o[f]<<a-o[f+1];o[f]=s[h]>>>l}},n.F._putsE=function(o,a,s){s<<=7&a;var l=a>>>3;o[l]|=s,o[l+1]|=s>>>8},n.F._putsF=function(o,a,s){s<<=7&a;var l=a>>>3;o[l]|=s,o[l+1]|=s>>>8,o[l+2]|=s>>>16},n.F._bitsE=function(o,a,s){return(o[a>>>3]|o[1+(a>>>3)]<<8)>>>(7&a)&(1<<s)-1},n.F._bitsF=function(o,a,s){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16)>>>(7&a)&(1<<s)-1},n.F._get17=function(o,a){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16)>>>(7&a)},n.F._get25=function(o,a){return(o[a>>>3]|o[1+(a>>>3)]<<8|o[2+(a>>>3)]<<16|o[3+(a>>>3)]<<24)>>>(7&a)},n.F.U=(t=Uint16Array,r=Uint32Array,{next_code:new t(16),bl_count:new t(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new t(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new r(32),flmap:new t(512),fltree:[],fdmap:new t(32),fdtree:[],lmap:new t(32768),ltree:[],ttree:[],dmap:new t(32768),dtree:[],imap:new t(512),itree:[],rev15:new t(32768),lhst:new r(286),dhst:new r(30),ihst:new r(19),lits:new r(15e3),strt:new t(65536),prev:new t(32768)}),(function(){for(var o=n.F.U,a=0;a<32768;a++){var s=a;s=(4278255360&(s=(4042322160&(s=(3435973836&(s=(2863311530&s)>>>1|(1431655765&s)<<1))>>>2|(858993459&s)<<2))>>>4|(252645135&s)<<4))>>>8|(16711935&s)<<8,o.rev15[a]=(s>>>16|s<<16)>>>17}function l(f,h,c){for(;h--!=0;)f.push(0,c)}for(a=0;a<32;a++)o.ldef[a]=o.of0[a]<<3|o.exb[a],o.ddef[a]=o.df0[a]<<4|o.dxb[a];l(o.fltree,144,8),l(o.fltree,112,9),l(o.fltree,24,7),l(o.fltree,8,8),n.F.makeCodes(o.fltree,9),n.F.codes2map(o.fltree,9,o.flmap),n.F.revCodes(o.fltree,9),l(o.fdtree,32,5),n.F.makeCodes(o.fdtree,5),n.F.codes2map(o.fdtree,5,o.fdmap),n.F.revCodes(o.fdtree,5),l(o.itree,19,0),l(o.ltree,286,0),l(o.dtree,30,0),l(o.ttree,320,0)})()})();var nh=eh({__proto__:null,default:Wn},[Wn]);const Xt=(function(){var e={nextZero(c,i){for(;c[i]!=0;)i++;return i},readUshort:(c,i)=>c[i]<<8|c[i+1],writeUshort(c,i,u){c[i]=u>>8&255,c[i+1]=255&u},readUint:(c,i)=>16777216*c[i]+(c[i+1]<<16|c[i+2]<<8|c[i+3]),writeUint(c,i,u){c[i]=u>>24&255,c[i+1]=u>>16&255,c[i+2]=u>>8&255,c[i+3]=255&u},readASCII(c,i,u){let g="";for(let p=0;p<u;p++)g+=String.fromCharCode(c[i+p]);return g},writeASCII(c,i,u){for(let g=0;g<u.length;g++)c[i+g]=u.charCodeAt(g)},readBytes(c,i,u){const g=[];for(let p=0;p<u;p++)g.push(c[i+p]);return g},pad:c=>c.length<2?`0${c}`:c,readUTF8(c,i,u){let g,p="";for(let m=0;m<u;m++)p+=`%${e.pad(c[i+m].toString(16))}`;try{g=decodeURIComponent(p)}catch{return e.readASCII(c,i,u)}return g}};function t(c,i,u,g){const p=i*u,m=a(g),x=Math.ceil(i*m/8),k=new Uint8Array(4*p),M=new Uint32Array(k.buffer),{ctype:v}=g,{depth:T}=g,I=e.readUshort;if(v==6){const F=p<<2;if(T==8)for(var S=0;S<F;S+=4)k[S]=c[S],k[S+1]=c[S+1],k[S+2]=c[S+2],k[S+3]=c[S+3];if(T==16)for(S=0;S<F;S++)k[S]=c[S<<1]}else if(v==2){const F=g.tabs.tRNS;if(F==null){if(T==8)for(S=0;S<p;S++){var N=3*S;M[S]=255<<24|c[N+2]<<16|c[N+1]<<8|c[N]}if(T==16)for(S=0;S<p;S++)N=6*S,M[S]=255<<24|c[N+4]<<16|c[N+2]<<8|c[N]}else{var w=F[0];const G=F[1],X=F[2];if(T==8)for(S=0;S<p;S++){var y=S<<2;N=3*S,M[S]=255<<24|c[N+2]<<16|c[N+1]<<8|c[N],c[N]==w&&c[N+1]==G&&c[N+2]==X&&(k[y+3]=0)}if(T==16)for(S=0;S<p;S++)y=S<<2,N=6*S,M[S]=255<<24|c[N+4]<<16|c[N+2]<<8|c[N],I(c,N)==w&&I(c,N+2)==G&&I(c,N+4)==X&&(k[y+3]=0)}}else if(v==3){const F=g.tabs.PLTE,G=g.tabs.tRNS,X=G?G.length:0;if(T==1)for(var E=0;E<u;E++){var O=E*x,$=E*i;for(S=0;S<i;S++){y=$+S<<2;var P=3*(L=c[O+(S>>3)]>>7-((7&S)<<0)&1);k[y]=F[P],k[y+1]=F[P+1],k[y+2]=F[P+2],k[y+3]=L<X?G[L]:255}}if(T==2)for(E=0;E<u;E++)for(O=E*x,$=E*i,S=0;S<i;S++)y=$+S<<2,P=3*(L=c[O+(S>>2)]>>6-((3&S)<<1)&3),k[y]=F[P],k[y+1]=F[P+1],k[y+2]=F[P+2],k[y+3]=L<X?G[L]:255;if(T==4)for(E=0;E<u;E++)for(O=E*x,$=E*i,S=0;S<i;S++)y=$+S<<2,P=3*(L=c[O+(S>>1)]>>4-((1&S)<<2)&15),k[y]=F[P],k[y+1]=F[P+1],k[y+2]=F[P+2],k[y+3]=L<X?G[L]:255;if(T==8)for(S=0;S<p;S++){var L;y=S<<2,P=3*(L=c[S]),k[y]=F[P],k[y+1]=F[P+1],k[y+2]=F[P+2],k[y+3]=L<X?G[L]:255}}else if(v==4){if(T==8)for(S=0;S<p;S++){y=S<<2;var U=c[_=S<<1];k[y]=U,k[y+1]=U,k[y+2]=U,k[y+3]=c[_+1]}if(T==16)for(S=0;S<p;S++){var _;y=S<<2,U=c[_=S<<2],k[y]=U,k[y+1]=U,k[y+2]=U,k[y+3]=c[_+2]}}else if(v==0)for(w=g.tabs.tRNS?g.tabs.tRNS:-1,E=0;E<u;E++){const F=E*x,G=E*i;if(T==1)for(var b=0;b<i;b++){var z=(U=255*(c[F+(b>>>3)]>>>7-(7&b)&1))==255*w?0:255;M[G+b]=z<<24|U<<16|U<<8|U}else if(T==2)for(b=0;b<i;b++)z=(U=85*(c[F+(b>>>2)]>>>6-((3&b)<<1)&3))==85*w?0:255,M[G+b]=z<<24|U<<16|U<<8|U;else if(T==4)for(b=0;b<i;b++)z=(U=17*(c[F+(b>>>1)]>>>4-((1&b)<<2)&15))==17*w?0:255,M[G+b]=z<<24|U<<16|U<<8|U;else if(T==8)for(b=0;b<i;b++)z=(U=c[F+b])==w?0:255,M[G+b]=z<<24|U<<16|U<<8|U;else if(T==16)for(b=0;b<i;b++)U=c[F+(b<<1)],z=I(c,F+(b<<1))==w?0:255,M[G+b]=z<<24|U<<16|U<<8|U}return k}function r(c,i,u,g){const p=a(c),m=Math.ceil(u*p/8),x=new Uint8Array((m+1+c.interlace)*g);return i=c.tabs.CgBI?o(i,x):n(i,x),c.interlace==0?i=s(i,c,0,u,g):c.interlace==1&&(i=(function(M,v){const T=v.width,I=v.height,S=a(v),N=S>>3,w=Math.ceil(T*S/8),y=new Uint8Array(I*w);let E=0;const O=[0,0,4,0,2,0,1],$=[0,4,0,2,0,1,0],P=[8,8,8,4,4,2,2],L=[8,8,4,4,2,2,1];let U=0;for(;U<7;){const b=P[U],z=L[U];let F=0,G=0,X=O[U];for(;X<I;)X+=b,G++;let B=$[U];for(;B<T;)B+=z,F++;const Y=Math.ceil(F*S/8);s(M,v,E,F,G);let H=0,W=O[U];for(;W<I;){let Q=$[U],be=E+H*Y<<3;for(;Q<T;){var _;if(S==1&&(_=(_=M[be>>3])>>7-(7&be)&1,y[W*w+(Q>>3)]|=_<<7-((7&Q)<<0)),S==2&&(_=(_=M[be>>3])>>6-(7&be)&3,y[W*w+(Q>>2)]|=_<<6-((3&Q)<<1)),S==4&&(_=(_=M[be>>3])>>4-(7&be)&15,y[W*w+(Q>>1)]|=_<<4-((1&Q)<<2)),S>=8){const se=W*w+Q*N;for(let pe=0;pe<N;pe++)y[se+pe]=M[(be>>3)+pe]}be+=S,Q+=z}H++,W+=b}F*G!=0&&(E+=G*(1+Y)),U+=1}return y})(i,c)),i}function n(c,i){return o(new Uint8Array(c.buffer,2,c.length-6),i)}var o=(function(){const c={H:{}};return c.H.N=function(i,u){const g=Uint8Array;let p,m,x=0,k=0,M=0,v=0,T=0,I=0,S=0,N=0,w=0;if(i[0]==3&&i[1]==0)return u||new g(0);const y=c.H,E=y.b,O=y.e,$=y.R,P=y.n,L=y.A,U=y.Z,_=y.m,b=u==null;for(b&&(u=new g(i.length>>>2<<5));x==0;)if(x=E(i,w,1),k=E(i,w+1,2),w+=3,k!=0){if(b&&(u=c.H.W(u,N+(1<<17))),k==1&&(p=_.J,m=_.h,I=511,S=31),k==2){M=O(i,w,5)+257,v=O(i,w+5,5)+1,T=O(i,w+10,4)+4,w+=14;let F=1;for(var z=0;z<38;z+=2)_.Q[z]=0,_.Q[z+1]=0;for(z=0;z<T;z++){const B=O(i,w+3*z,3);_.Q[1+(_.X[z]<<1)]=B,B>F&&(F=B)}w+=3*T,P(_.Q,F),L(_.Q,F,_.u),p=_.w,m=_.d,w=$(_.u,(1<<F)-1,M+v,i,w,_.v);const G=y.V(_.v,0,M,_.C);I=(1<<G)-1;const X=y.V(_.v,M,v,_.D);S=(1<<X)-1,P(_.C,G),L(_.C,G,p),P(_.D,X),L(_.D,X,m)}for(;;){const F=p[U(i,w)&I];w+=15&F;const G=F>>>4;if(!(G>>>8))u[N++]=G;else{if(G==256)break;{let X=N+G-254;if(G>264){const Q=_.q[G-257];X=N+(Q>>>3)+O(i,w,7&Q),w+=7&Q}const B=m[U(i,w)&S];w+=15&B;const Y=B>>>4,H=_.c[Y],W=(H>>>4)+E(i,w,15&H);for(w+=15&H;N<X;)u[N]=u[N++-W],u[N]=u[N++-W],u[N]=u[N++-W],u[N]=u[N++-W];N=X}}}}else{(7&w)!=0&&(w+=8-(7&w));const F=4+(w>>>3),G=i[F-4]|i[F-3]<<8;b&&(u=c.H.W(u,N+G)),u.set(new g(i.buffer,i.byteOffset+F,G),N),w=F+G<<3,N+=G}return u.length==N?u:u.slice(0,N)},c.H.W=function(i,u){const g=i.length;if(u<=g)return i;const p=new Uint8Array(g<<1);return p.set(i,0),p},c.H.R=function(i,u,g,p,m,x){const k=c.H.e,M=c.H.Z;let v=0;for(;v<g;){const T=i[M(p,m)&u];m+=15&T;const I=T>>>4;if(I<=15)x[v]=I,v++;else{let S=0,N=0;I==16?(N=3+k(p,m,2),m+=2,S=x[v-1]):I==17?(N=3+k(p,m,3),m+=3):I==18&&(N=11+k(p,m,7),m+=7);const w=v+N;for(;v<w;)x[v]=S,v++}}return m},c.H.V=function(i,u,g,p){let m=0,x=0;const k=p.length>>>1;for(;x<g;){const M=i[x+u];p[x<<1]=0,p[1+(x<<1)]=M,M>m&&(m=M),x++}for(;x<k;)p[x<<1]=0,p[1+(x<<1)]=0,x++;return m},c.H.n=function(i,u){const g=c.H.m,p=i.length;let m,x,k,M;const v=g.j;for(var T=0;T<=u;T++)v[T]=0;for(T=1;T<p;T+=2)v[i[T]]++;const I=g.K;for(m=0,v[0]=0,x=1;x<=u;x++)m=m+v[x-1]<<1,I[x]=m;for(k=0;k<p;k+=2)M=i[k+1],M!=0&&(i[k]=I[M],I[M]++)},c.H.A=function(i,u,g){const p=i.length,m=c.H.m.r;for(let x=0;x<p;x+=2)if(i[x+1]!=0){const k=x>>1,M=i[x+1],v=k<<4|M,T=u-M;let I=i[x]<<T;const S=I+(1<<T);for(;I!=S;)g[m[I]>>>15-u]=v,I++}},c.H.l=function(i,u){const g=c.H.m.r,p=15-u;for(let m=0;m<i.length;m+=2){const x=i[m]<<u-i[m+1];i[m]=g[x]>>>p}},c.H.M=function(i,u,g){g<<=7&u;const p=u>>>3;i[p]|=g,i[p+1]|=g>>>8},c.H.I=function(i,u,g){g<<=7&u;const p=u>>>3;i[p]|=g,i[p+1]|=g>>>8,i[p+2]|=g>>>16},c.H.e=function(i,u,g){return(i[u>>>3]|i[1+(u>>>3)]<<8)>>>(7&u)&(1<<g)-1},c.H.b=function(i,u,g){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16)>>>(7&u)&(1<<g)-1},c.H.Z=function(i,u){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16)>>>(7&u)},c.H.i=function(i,u){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16|i[3+(u>>>3)]<<24)>>>(7&u)},c.H.m=(function(){const i=Uint16Array,u=Uint32Array;return{K:new i(16),j:new i(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new i(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new u(32),J:new i(512),_:[],h:new i(32),$:[],w:new i(32768),C:[],v:[],d:new i(32768),D:[],u:new i(512),Q:[],r:new i(32768),s:new u(286),Y:new u(30),a:new u(19),t:new u(15e3),k:new i(65536),g:new i(32768)}})(),(function(){const i=c.H.m;for(var u=0;u<32768;u++){let p=u;p=(2863311530&p)>>>1|(1431655765&p)<<1,p=(3435973836&p)>>>2|(858993459&p)<<2,p=(4042322160&p)>>>4|(252645135&p)<<4,p=(4278255360&p)>>>8|(16711935&p)<<8,i.r[u]=(p>>>16|p<<16)>>>17}function g(p,m,x){for(;m--!=0;)p.push(0,x)}for(u=0;u<32;u++)i.q[u]=i.S[u]<<3|i.T[u],i.c[u]=i.p[u]<<4|i.z[u];g(i._,144,8),g(i._,112,9),g(i._,24,7),g(i._,8,8),c.H.n(i._,9),c.H.A(i._,9,i.J),c.H.l(i._,9),g(i.$,32,5),c.H.n(i.$,5),c.H.A(i.$,5,i.h),c.H.l(i.$,5),g(i.Q,19,0),g(i.C,286,0),g(i.D,30,0),g(i.v,320,0)})(),c.H.N})();function a(c){return[1,null,3,1,2,null,4][c.ctype]*c.depth}function s(c,i,u,g,p){let m=a(i);const x=Math.ceil(g*m/8);let k,M;m=Math.ceil(m/8);let v=c[u],T=0;if(v>1&&(c[u]=[0,0,1][v-2]),v==3)for(T=m;T<x;T++)c[T+1]=c[T+1]+(c[T+1-m]>>>1)&255;for(let I=0;I<p;I++)if(k=u+I*x,M=k+I+1,v=c[M-1],T=0,v==0)for(;T<x;T++)c[k+T]=c[M+T];else if(v==1){for(;T<m;T++)c[k+T]=c[M+T];for(;T<x;T++)c[k+T]=c[M+T]+c[k+T-m]}else if(v==2)for(;T<x;T++)c[k+T]=c[M+T]+c[k+T-x];else if(v==3){for(;T<m;T++)c[k+T]=c[M+T]+(c[k+T-x]>>>1);for(;T<x;T++)c[k+T]=c[M+T]+(c[k+T-x]+c[k+T-m]>>>1)}else{for(;T<m;T++)c[k+T]=c[M+T]+l(0,c[k+T-x],0);for(;T<x;T++)c[k+T]=c[M+T]+l(c[k+T-m],c[k+T-x],c[k+T-m-x])}return c}function l(c,i,u){const g=c+i-u,p=g-c,m=g-i,x=g-u;return p*p<=m*m&&p*p<=x*x?c:m*m<=x*x?i:u}function f(c,i,u){u.width=e.readUint(c,i),i+=4,u.height=e.readUint(c,i),i+=4,u.depth=c[i],i++,u.ctype=c[i],i++,u.compress=c[i],i++,u.filter=c[i],i++,u.interlace=c[i],i++}function h(c,i,u,g,p,m,x,k,M){const v=Math.min(i,p),T=Math.min(u,m);let I=0,S=0;for(let U=0;U<T;U++)for(let _=0;_<v;_++)if(x>=0&&k>=0?(I=U*i+_<<2,S=(k+U)*p+x+_<<2):(I=(-k+U)*i-x+_<<2,S=U*p+_<<2),M==0)g[S]=c[I],g[S+1]=c[I+1],g[S+2]=c[I+2],g[S+3]=c[I+3];else if(M==1){var N=c[I+3]*.00392156862745098,w=c[I]*N,y=c[I+1]*N,E=c[I+2]*N,O=g[S+3]*(1/255),$=g[S]*O,P=g[S+1]*O,L=g[S+2]*O;const b=1-N,z=N+O*b,F=z==0?0:1/z;g[S+3]=255*z,g[S+0]=(w+$*b)*F,g[S+1]=(y+P*b)*F,g[S+2]=(E+L*b)*F}else if(M==2)N=c[I+3],w=c[I],y=c[I+1],E=c[I+2],O=g[S+3],$=g[S],P=g[S+1],L=g[S+2],N==O&&w==$&&y==P&&E==L?(g[S]=0,g[S+1]=0,g[S+2]=0,g[S+3]=0):(g[S]=w,g[S+1]=y,g[S+2]=E,g[S+3]=N);else if(M==3){if(N=c[I+3],w=c[I],y=c[I+1],E=c[I+2],O=g[S+3],$=g[S],P=g[S+1],L=g[S+2],N==O&&w==$&&y==P&&E==L)continue;if(N<220&&O>20)return!1}return!0}return{decode:function(i){const u=new Uint8Array(i);let g=8;const p=e,m=p.readUshort,x=p.readUint,k={tabs:{},frames:[]},M=new Uint8Array(u.length);let v,T=0,I=0;const S=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(u[N]!=S[N])throw"The input is not a PNG file!";for(;g<u.length;){const U=p.readUint(u,g);g+=4;const _=p.readASCII(u,g,4);if(g+=4,_=="IHDR")f(u,g,k);else if(_=="iCCP"){for(var w=g;u[w]!=0;)w++;p.readASCII(u,g,w-g),u[w+1];const b=u.slice(w+2,g+U);let z=null;try{z=n(b)}catch{z=o(b)}k.tabs[_]=z}else if(_=="CgBI")k.tabs[_]=u.slice(g,g+4);else if(_=="IDAT"){for(N=0;N<U;N++)M[T+N]=u[g+N];T+=U}else if(_=="acTL")k.tabs[_]={num_frames:x(u,g),num_plays:x(u,g+4)},v=new Uint8Array(u.length);else if(_=="fcTL"){I!=0&&((L=k.frames[k.frames.length-1]).data=r(k,v.slice(0,I),L.rect.width,L.rect.height),I=0);const b={x:x(u,g+12),y:x(u,g+16),width:x(u,g+4),height:x(u,g+8)};let z=m(u,g+22);z=m(u,g+20)/(z==0?100:z);const F={rect:b,delay:Math.round(1e3*z),dispose:u[g+24],blend:u[g+25]};k.frames.push(F)}else if(_=="fdAT"){for(N=0;N<U-4;N++)v[I+N]=u[g+N+4];I+=U-4}else if(_=="pHYs")k.tabs[_]=[p.readUint(u,g),p.readUint(u,g+4),u[g+8]];else if(_=="cHRM")for(k.tabs[_]=[],N=0;N<8;N++)k.tabs[_].push(p.readUint(u,g+4*N));else if(_=="tEXt"||_=="zTXt"){k.tabs[_]==null&&(k.tabs[_]={});var y=p.nextZero(u,g),E=p.readASCII(u,g,y-g),O=g+U-y-1;if(_=="tEXt")P=p.readASCII(u,y+1,O);else{var $=n(u.slice(y+2,y+2+O));P=p.readUTF8($,0,$.length)}k.tabs[_][E]=P}else if(_=="iTXt"){k.tabs[_]==null&&(k.tabs[_]={}),y=0,w=g,y=p.nextZero(u,w),E=p.readASCII(u,w,y-w);const b=u[w=y+1];var P;u[w+1],w+=2,y=p.nextZero(u,w),p.readASCII(u,w,y-w),w=y+1,y=p.nextZero(u,w),p.readUTF8(u,w,y-w),O=U-((w=y+1)-g),b==0?P=p.readUTF8(u,w,O):($=n(u.slice(w,w+O)),P=p.readUTF8($,0,$.length)),k.tabs[_][E]=P}else if(_=="PLTE")k.tabs[_]=p.readBytes(u,g,U);else if(_=="hIST"){const b=k.tabs.PLTE.length/3;for(k.tabs[_]=[],N=0;N<b;N++)k.tabs[_].push(m(u,g+2*N))}else if(_=="tRNS")k.ctype==3?k.tabs[_]=p.readBytes(u,g,U):k.ctype==0?k.tabs[_]=m(u,g):k.ctype==2&&(k.tabs[_]=[m(u,g),m(u,g+2),m(u,g+4)]);else if(_=="gAMA")k.tabs[_]=p.readUint(u,g)/1e5;else if(_=="sRGB")k.tabs[_]=u[g];else if(_=="bKGD")k.ctype==0||k.ctype==4?k.tabs[_]=[m(u,g)]:k.ctype==2||k.ctype==6?k.tabs[_]=[m(u,g),m(u,g+2),m(u,g+4)]:k.ctype==3&&(k.tabs[_]=u[g]);else if(_=="IEND")break;g+=U,p.readUint(u,g),g+=4}var L;return I!=0&&((L=k.frames[k.frames.length-1]).data=r(k,v.slice(0,I),L.rect.width,L.rect.height)),k.data=r(k,M,k.width,k.height),delete k.compress,delete k.interlace,delete k.filter,k},toRGBA8:function(i){const u=i.width,g=i.height;if(i.tabs.acTL==null)return[t(i.data,u,g,i).buffer];const p=[];i.frames[0].data==null&&(i.frames[0].data=i.data);const m=u*g*4,x=new Uint8Array(m),k=new Uint8Array(m),M=new Uint8Array(m);for(let T=0;T<i.frames.length;T++){const I=i.frames[T],S=I.rect.x,N=I.rect.y,w=I.rect.width,y=I.rect.height,E=t(I.data,w,y,i);if(T!=0)for(var v=0;v<m;v++)M[v]=x[v];if(I.blend==0?h(E,w,y,x,u,g,S,N,0):I.blend==1&&h(E,w,y,x,u,g,S,N,1),p.push(x.buffer.slice(0)),I.dispose!=0){if(I.dispose==1)h(k,w,y,x,u,g,S,N,0);else if(I.dispose==2)for(v=0;v<m;v++)x[v]=M[v]}}return p},_paeth:l,_copyTile:h,_bin:e}})();(function(){const{_copyTile:e}=Xt,{_bin:t}=Xt,r=Xt._paeth;var n={table:(function(){const w=new Uint32Array(256);for(let y=0;y<256;y++){let E=y;for(let O=0;O<8;O++)1&E?E=3988292384^E>>>1:E>>>=1;w[y]=E}return w})(),update(w,y,E,O){for(let $=0;$<O;$++)w=n.table[255&(w^y[E+$])]^w>>>8;return w},crc:(w,y,E)=>4294967295^n.update(4294967295,w,y,E)};function o(w,y,E,O){y[E]+=w[0]*O>>4,y[E+1]+=w[1]*O>>4,y[E+2]+=w[2]*O>>4,y[E+3]+=w[3]*O>>4}function a(w){return Math.max(0,Math.min(255,w))}function s(w,y){const E=w[0]-y[0],O=w[1]-y[1],$=w[2]-y[2],P=w[3]-y[3];return E*E+O*O+$*$+P*P}function l(w,y,E,O,$,P,L){L==null&&(L=1);const U=O.length,_=[];for(var b=0;b<U;b++){const W=O[b];_.push([W>>>0&255,W>>>8&255,W>>>16&255,W>>>24&255])}for(b=0;b<U;b++){let W=4294967295;for(var z=0,F=0;F<U;F++){var G=s(_[b],_[F]);F!=b&&G<W&&(W=G,z=F)}}const X=new Uint32Array($.buffer),B=new Int16Array(y*E*4),Y=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(b=0;b<Y.length;b++)Y[b]=255*((Y[b]+.5)/16-.5);for(let W=0;W<E;W++)for(let Q=0;Q<y;Q++){var H;b=4*(W*y+Q),L!=2?H=[a(w[b]+B[b]),a(w[b+1]+B[b+1]),a(w[b+2]+B[b+2]),a(w[b+3]+B[b+3])]:(G=Y[4*(3&W)+(3&Q)],H=[a(w[b]+G),a(w[b+1]+G),a(w[b+2]+G),a(w[b+3]+G)]),z=0;let be=16777215;for(F=0;F<U;F++){const ne=s(H,_[F]);ne<be&&(be=ne,z=F)}const se=_[z],pe=[H[0]-se[0],H[1]-se[1],H[2]-se[2],H[3]-se[3]];L==1&&(Q!=y-1&&o(pe,B,b+4,7),W!=E-1&&(Q!=0&&o(pe,B,b+4*y-4,3),o(pe,B,b+4*y,5),Q!=y-1&&o(pe,B,b+4*y+4,1))),P[b>>2]=z,X[b>>2]=O[z]}}function f(w,y,E,O,$){$==null&&($={});const{crc:P}=n,L=t.writeUint,U=t.writeUshort,_=t.writeASCII;let b=8;const z=w.frames.length>1;let F,G=!1,X=33+(z?20:0);if($.sRGB!=null&&(X+=13),$.pHYs!=null&&(X+=21),$.iCCP!=null&&(F=pako.deflate($.iCCP),X+=21+F.length+4),w.ctype==3){for(var B=w.plte.length,Y=0;Y<B;Y++)w.plte[Y]>>>24!=255&&(G=!0);X+=8+3*B+4+(G?8+1*B+4:0)}for(var H=0;H<w.frames.length;H++)z&&(X+=38),X+=(se=w.frames[H]).cimg.length+12,H!=0&&(X+=4);X+=12;const W=new Uint8Array(X),Q=[137,80,78,71,13,10,26,10];for(Y=0;Y<8;Y++)W[Y]=Q[Y];if(L(W,b,13),b+=4,_(W,b,"IHDR"),b+=4,L(W,b,y),b+=4,L(W,b,E),b+=4,W[b]=w.depth,b++,W[b]=w.ctype,b++,W[b]=0,b++,W[b]=0,b++,W[b]=0,b++,L(W,b,P(W,b-17,17)),b+=4,$.sRGB!=null&&(L(W,b,1),b+=4,_(W,b,"sRGB"),b+=4,W[b]=$.sRGB,b++,L(W,b,P(W,b-5,5)),b+=4),$.iCCP!=null){const pe=13+F.length;L(W,b,pe),b+=4,_(W,b,"iCCP"),b+=4,_(W,b,"ICC profile"),b+=11,b+=2,W.set(F,b),b+=F.length,L(W,b,P(W,b-(pe+4),pe+4)),b+=4}if($.pHYs!=null&&(L(W,b,9),b+=4,_(W,b,"pHYs"),b+=4,L(W,b,$.pHYs[0]),b+=4,L(W,b,$.pHYs[1]),b+=4,W[b]=$.pHYs[2],b++,L(W,b,P(W,b-13,13)),b+=4),z&&(L(W,b,8),b+=4,_(W,b,"acTL"),b+=4,L(W,b,w.frames.length),b+=4,L(W,b,$.loop!=null?$.loop:0),b+=4,L(W,b,P(W,b-12,12)),b+=4),w.ctype==3){for(L(W,b,3*(B=w.plte.length)),b+=4,_(W,b,"PLTE"),b+=4,Y=0;Y<B;Y++){const pe=3*Y,ne=w.plte[Y],Ae=255&ne,ve=ne>>>8&255,We=ne>>>16&255;W[b+pe+0]=Ae,W[b+pe+1]=ve,W[b+pe+2]=We}if(b+=3*B,L(W,b,P(W,b-3*B-4,3*B+4)),b+=4,G){for(L(W,b,B),b+=4,_(W,b,"tRNS"),b+=4,Y=0;Y<B;Y++)W[b+Y]=w.plte[Y]>>>24&255;b+=B,L(W,b,P(W,b-B-4,B+4)),b+=4}}let be=0;for(H=0;H<w.frames.length;H++){var se=w.frames[H];z&&(L(W,b,26),b+=4,_(W,b,"fcTL"),b+=4,L(W,b,be++),b+=4,L(W,b,se.rect.width),b+=4,L(W,b,se.rect.height),b+=4,L(W,b,se.rect.x),b+=4,L(W,b,se.rect.y),b+=4,U(W,b,O[H]),b+=2,U(W,b,1e3),b+=2,W[b]=se.dispose,b++,W[b]=se.blend,b++,L(W,b,P(W,b-30,30)),b+=4);const pe=se.cimg;L(W,b,(B=pe.length)+(H==0?0:4)),b+=4;const ne=b;_(W,b,H==0?"IDAT":"fdAT"),b+=4,H!=0&&(L(W,b,be++),b+=4),W.set(pe,b),b+=B,L(W,b,P(W,ne,b-ne)),b+=4}return L(W,b,0),b+=4,_(W,b,"IEND"),b+=4,L(W,b,P(W,b-4,4)),b+=4,W.buffer}function h(w,y,E){for(let O=0;O<w.frames.length;O++){const $=w.frames[O];$.rect.width;const P=$.rect.height,L=new Uint8Array(P*$.bpl+P);$.cimg=g($.img,P,$.bpp,$.bpl,L,y,E)}}function c(w,y,E,O,$){const P=$[0],L=$[1],U=$[2],_=$[3],b=$[4],z=$[5];let F=6,G=8,X=255;for(var B=0;B<w.length;B++){const ge=new Uint8Array(w[B]);for(var Y=ge.length,H=0;H<Y;H+=4)X&=ge[H+3]}const W=X!=255,Q=(function(Oe,we,$e,ze,K,oe){const ae=[];for(var ce=0;ce<Oe.length;ce++){const Pe=new Uint8Array(Oe[ce]),q=new Uint32Array(Pe.buffer);var ke;let le=0,de=0,ue=we,ie=$e,Fe=ze?1:0;if(ce!=0){const Ce=oe||ze||ce==1||ae[ce-2].dispose!=0?1:2;let Ie=0,Ne=1e9;for(let He=0;He<Ce;He++){var Ee=new Uint8Array(Oe[ce-1-He]);const je=new Uint32Array(Oe[ce-1-He]);let _e=we,xe=$e,De=-1,Ye=-1;for(let qe=0;qe<$e;qe++)for(let Je=0;Je<we;Je++)q[Me=qe*we+Je]!=je[Me]&&(Je<_e&&(_e=Je),Je>De&&(De=Je),qe<xe&&(xe=qe),qe>Ye&&(Ye=qe));De==-1&&(_e=xe=De=Ye=0),K&&((1&_e)==1&&_e--,(1&xe)==1&&xe--);const rt=(De-_e+1)*(Ye-xe+1);rt<Ne&&(Ne=rt,Ie=He,le=_e,de=xe,ue=De-_e+1,ie=Ye-xe+1)}Ee=new Uint8Array(Oe[ce-1-Ie]),Ie==1&&(ae[ce-1].dispose=2),ke=new Uint8Array(ue*ie*4),e(Ee,we,$e,ke,ue,ie,-le,-de,0),Fe=e(Pe,we,$e,ke,ue,ie,-le,-de,3)?1:0,Fe==1?u(Pe,we,$e,ke,{x:le,y:de,width:ue,height:ie}):e(Pe,we,$e,ke,ue,ie,-le,-de,0)}else ke=Pe.slice(0);ae.push({rect:{x:le,y:de,width:ue,height:ie},img:ke,blend:Fe,dispose:0})}if(ze)for(ce=0;ce<ae.length;ce++){if((Ke=ae[ce]).blend==1)continue;const Pe=Ke.rect,q=ae[ce-1].rect,le=Math.min(Pe.x,q.x),de=Math.min(Pe.y,q.y),ue={x:le,y:de,width:Math.max(Pe.x+Pe.width,q.x+q.width)-le,height:Math.max(Pe.y+Pe.height,q.y+q.height)-de};ae[ce-1].dispose=1,ce-1!=0&&i(Oe,we,$e,ae,ce-1,ue,K),i(Oe,we,$e,ae,ce,ue,K)}let Be=0;if(Oe.length!=1)for(var Me=0;Me<ae.length;Me++){var Ke;Be+=(Ke=ae[Me]).rect.width*Ke.rect.height}return ae})(w,y,E,P,L,U),be={},se=[],pe=[];if(O!=0){const ge=[];for(H=0;H<Q.length;H++)ge.push(Q[H].img.buffer);const Oe=(function(K){let oe=0;for(var ae=0;ae<K.length;ae++)oe+=K[ae].byteLength;const ce=new Uint8Array(oe);let ke=0;for(ae=0;ae<K.length;ae++){const Ee=new Uint8Array(K[ae]),Be=Ee.length;for(let Me=0;Me<Be;Me+=4){let Ke=Ee[Me],Pe=Ee[Me+1],q=Ee[Me+2];const le=Ee[Me+3];le==0&&(Ke=Pe=q=0),ce[ke+Me]=Ke,ce[ke+Me+1]=Pe,ce[ke+Me+2]=q,ce[ke+Me+3]=le}ke+=Be}return ce.buffer})(ge),we=m(Oe,O);for(H=0;H<we.plte.length;H++)se.push(we.plte[H].est.rgba);let $e=0;for(H=0;H<Q.length;H++){const ze=(Ae=Q[H]).img.length;var ne=new Uint8Array(we.inds.buffer,$e>>2,ze>>2);pe.push(ne);const K=new Uint8Array(we.abuf,$e,ze);z&&l(Ae.img,Ae.rect.width,Ae.rect.height,se,K,ne),Ae.img.set(K),$e+=ze}}else for(B=0;B<Q.length;B++){var Ae=Q[B];const ge=new Uint32Array(Ae.img.buffer);var ve=Ae.rect.width;for(Y=ge.length,ne=new Uint8Array(Y),pe.push(ne),H=0;H<Y;H++){const Oe=ge[H];if(H!=0&&Oe==ge[H-1])ne[H]=ne[H-1];else if(H>ve&&Oe==ge[H-ve])ne[H]=ne[H-ve];else{let we=be[Oe];if(we==null&&(be[Oe]=we=se.length,se.push(Oe),se.length>=300))break;ne[H]=we}}}const We=se.length;for(We<=256&&b==0&&(G=We<=2?1:We<=4?2:We<=16?4:8,G=Math.max(G,_)),B=0;B<Q.length;B++){(Ae=Q[B]).rect.x,Ae.rect.y,ve=Ae.rect.width;const ge=Ae.rect.height;let Oe=Ae.img;new Uint32Array(Oe.buffer);let we=4*ve,$e=4;if(We<=256&&b==0){we=Math.ceil(G*ve/8);var me=new Uint8Array(we*ge);const ze=pe[B];for(let K=0;K<ge;K++){H=K*we;const oe=K*ve;if(G==8)for(var Te=0;Te<ve;Te++)me[H+Te]=ze[oe+Te];else if(G==4)for(Te=0;Te<ve;Te++)me[H+(Te>>1)]|=ze[oe+Te]<<4-4*(1&Te);else if(G==2)for(Te=0;Te<ve;Te++)me[H+(Te>>2)]|=ze[oe+Te]<<6-2*(3&Te);else if(G==1)for(Te=0;Te<ve;Te++)me[H+(Te>>3)]|=ze[oe+Te]<<7-1*(7&Te)}Oe=me,F=3,$e=1}else if(W==0&&Q.length==1){me=new Uint8Array(ve*ge*3);const ze=ve*ge;for(H=0;H<ze;H++){const K=3*H,oe=4*H;me[K]=Oe[oe],me[K+1]=Oe[oe+1],me[K+2]=Oe[oe+2]}Oe=me,F=2,$e=3,we=3*ve}Ae.img=Oe,Ae.bpl=we,Ae.bpp=$e}return{ctype:F,depth:G,plte:se,frames:Q}}function i(w,y,E,O,$,P,L){const U=Uint8Array,_=Uint32Array,b=new U(w[$-1]),z=new _(w[$-1]),F=$+1<w.length?new U(w[$+1]):null,G=new U(w[$]),X=new _(G.buffer);let B=y,Y=E,H=-1,W=-1;for(let be=0;be<P.height;be++)for(let se=0;se<P.width;se++){const pe=P.x+se,ne=P.y+be,Ae=ne*y+pe,ve=X[Ae];ve==0||O[$-1].dispose==0&&z[Ae]==ve&&(F==null||F[4*Ae+3]!=0)||(pe<B&&(B=pe),pe>H&&(H=pe),ne<Y&&(Y=ne),ne>W&&(W=ne))}H==-1&&(B=Y=H=W=0),L&&((1&B)==1&&B--,(1&Y)==1&&Y--),P={x:B,y:Y,width:H-B+1,height:W-Y+1};const Q=O[$];Q.rect=P,Q.blend=1,Q.img=new Uint8Array(P.width*P.height*4),O[$-1].dispose==0?(e(b,y,E,Q.img,P.width,P.height,-P.x,-P.y,0),u(G,y,E,Q.img,P)):e(G,y,E,Q.img,P.width,P.height,-P.x,-P.y,0)}function u(w,y,E,O,$){e(w,y,E,O,$.width,$.height,-$.x,-$.y,2)}function g(w,y,E,O,$,P,L){const U=[];let _,b=[0,1,2,3,4];P!=-1?b=[P]:(y*O>5e5||E==1)&&(b=[0]),L&&(_={level:0});const z=nh;for(var F=0;F<b.length;F++){for(let B=0;B<y;B++)p($,w,B,O,E,b[F]);U.push(z.deflate($,_))}let G,X=1e9;for(F=0;F<U.length;F++)U[F].length<X&&(G=F,X=U[F].length);return U[G]}function p(w,y,E,O,$,P){const L=E*O;let U=L+E;if(w[U]=P,U++,P==0)if(O<500)for(var _=0;_<O;_++)w[U+_]=y[L+_];else w.set(new Uint8Array(y.buffer,L,O),U);else if(P==1){for(_=0;_<$;_++)w[U+_]=y[L+_];for(_=$;_<O;_++)w[U+_]=y[L+_]-y[L+_-$]+256&255}else if(E==0){for(_=0;_<$;_++)w[U+_]=y[L+_];if(P==2)for(_=$;_<O;_++)w[U+_]=y[L+_];if(P==3)for(_=$;_<O;_++)w[U+_]=y[L+_]-(y[L+_-$]>>1)+256&255;if(P==4)for(_=$;_<O;_++)w[U+_]=y[L+_]-r(y[L+_-$],0,0)+256&255}else{if(P==2)for(_=0;_<O;_++)w[U+_]=y[L+_]+256-y[L+_-O]&255;if(P==3){for(_=0;_<$;_++)w[U+_]=y[L+_]+256-(y[L+_-O]>>1)&255;for(_=$;_<O;_++)w[U+_]=y[L+_]+256-(y[L+_-O]+y[L+_-$]>>1)&255}if(P==4){for(_=0;_<$;_++)w[U+_]=y[L+_]+256-r(0,y[L+_-O],0)&255;for(_=$;_<O;_++)w[U+_]=y[L+_]+256-r(y[L+_-$],y[L+_-O],y[L+_-$-O])&255}}}function m(w,y){const E=new Uint8Array(w),O=E.slice(0),$=new Uint32Array(O.buffer),P=x(O,y),L=P[0],U=P[1],_=E.length,b=new Uint8Array(_>>2);let z;if(E.length<2e7)for(var F=0;F<_;F+=4)z=k(L,G=E[F]*.00392156862745098,X=E[F+1]*.00392156862745098,B=E[F+2]*.00392156862745098,Y=E[F+3]*.00392156862745098),b[F>>2]=z.ind,$[F>>2]=z.est.rgba;else for(F=0;F<_;F+=4){var G=E[F]*.00392156862745098,X=E[F+1]*(1/255),B=E[F+2]*(1/255),Y=E[F+3]*(1/255);for(z=L;z.left;)z=M(z.est,G,X,B,Y)<=0?z.left:z.right;b[F>>2]=z.ind,$[F>>2]=z.est.rgba}return{abuf:O.buffer,inds:b,plte:U}}function x(w,y,E){E==null&&(E=1e-4);const O=new Uint32Array(w.buffer),$={i0:0,i1:w.length,bst:null,est:null,tdst:0,left:null,right:null};$.bst=I(w,$.i0,$.i1),$.est=S($.bst);const P=[$];for(;P.length<y;){let U=0,_=0;for(var L=0;L<P.length;L++)P[L].est.L>U&&(U=P[L].est.L,_=L);if(U<E)break;const b=P[_],z=v(w,O,b.i0,b.i1,b.est.e,b.est.eMq255);if(b.i0>=z||b.i1<=z){b.est.L=0;continue}const F={i0:b.i0,i1:z,bst:null,est:null,tdst:0,left:null,right:null};F.bst=I(w,F.i0,F.i1),F.est=S(F.bst);const G={i0:z,i1:b.i1,bst:null,est:null,tdst:0,left:null,right:null};for(G.bst={R:[],m:[],N:b.bst.N-F.bst.N},L=0;L<16;L++)G.bst.R[L]=b.bst.R[L]-F.bst.R[L];for(L=0;L<4;L++)G.bst.m[L]=b.bst.m[L]-F.bst.m[L];G.est=S(G.bst),b.left=F,b.right=G,P[_]=F,P.push(G)}for(P.sort(((U,_)=>_.bst.N-U.bst.N)),L=0;L<P.length;L++)P[L].ind=L;return[$,P]}function k(w,y,E,O,$){if(w.left==null)return w.tdst=(function(F,G,X,B,Y){const H=G-F[0],W=X-F[1],Q=B-F[2],be=Y-F[3];return H*H+W*W+Q*Q+be*be})(w.est.q,y,E,O,$),w;const P=M(w.est,y,E,O,$);let L=w.left,U=w.right;P>0&&(L=w.right,U=w.left);const _=k(L,y,E,O,$);if(_.tdst<=P*P)return _;const b=k(U,y,E,O,$);return b.tdst<_.tdst?b:_}function M(w,y,E,O,$){const{e:P}=w;return P[0]*y+P[1]*E+P[2]*O+P[3]*$-w.eMq}function v(w,y,E,O,$,P){for(O-=4;E<O;){for(;T(w,E,$)<=P;)E+=4;for(;T(w,O,$)>P;)O-=4;if(E>=O)break;const L=y[E>>2];y[E>>2]=y[O>>2],y[O>>2]=L,E+=4,O-=4}for(;T(w,E,$)>P;)E-=4;return E+4}function T(w,y,E){return w[y]*E[0]+w[y+1]*E[1]+w[y+2]*E[2]+w[y+3]*E[3]}function I(w,y,E){const O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],$=[0,0,0,0],P=E-y>>2;for(let L=y;L<E;L+=4){const U=w[L]*.00392156862745098,_=w[L+1]*(1/255),b=w[L+2]*(1/255),z=w[L+3]*(1/255);$[0]+=U,$[1]+=_,$[2]+=b,$[3]+=z,O[0]+=U*U,O[1]+=U*_,O[2]+=U*b,O[3]+=U*z,O[5]+=_*_,O[6]+=_*b,O[7]+=_*z,O[10]+=b*b,O[11]+=b*z,O[15]+=z*z}return O[4]=O[1],O[8]=O[2],O[9]=O[6],O[12]=O[3],O[13]=O[7],O[14]=O[11],{R:O,m:$,N:P}}function S(w){const{R:y}=w,{m:E}=w,{N:O}=w,$=E[0],P=E[1],L=E[2],U=E[3],_=O==0?0:1/O,b=[y[0]-$*$*_,y[1]-$*P*_,y[2]-$*L*_,y[3]-$*U*_,y[4]-P*$*_,y[5]-P*P*_,y[6]-P*L*_,y[7]-P*U*_,y[8]-L*$*_,y[9]-L*P*_,y[10]-L*L*_,y[11]-L*U*_,y[12]-U*$*_,y[13]-U*P*_,y[14]-U*L*_,y[15]-U*U*_],z=b,F=N;let G=[Math.random(),Math.random(),Math.random(),Math.random()],X=0,B=0;if(O!=0)for(let H=0;H<16&&(G=F.multVec(z,G),B=Math.sqrt(F.dot(G,G)),G=F.sml(1/B,G),!(H!=0&&Math.abs(B-X)<1e-9));H++)X=B;const Y=[$*_,P*_,L*_,U*_];return{Cov:b,q:Y,e:G,L:X,eMq255:F.dot(F.sml(255,Y),G),eMq:F.dot(G,Y),rgba:(Math.round(255*Y[3])<<24|Math.round(255*Y[2])<<16|Math.round(255*Y[1])<<8|Math.round(255*Y[0])<<0)>>>0}}var N={multVec:(w,y)=>[w[0]*y[0]+w[1]*y[1]+w[2]*y[2]+w[3]*y[3],w[4]*y[0]+w[5]*y[1]+w[6]*y[2]+w[7]*y[3],w[8]*y[0]+w[9]*y[1]+w[10]*y[2]+w[11]*y[3],w[12]*y[0]+w[13]*y[1]+w[14]*y[2]+w[15]*y[3]],dot:(w,y)=>w[0]*y[0]+w[1]*y[1]+w[2]*y[2]+w[3]*y[3],sml:(w,y)=>[w*y[0],w*y[1],w*y[2],w*y[3]]};Xt.encode=function(y,E,O,$,P,L,U){$==null&&($=0),U==null&&(U=!1);const _=c(y,E,O,$,[!1,!1,!1,0,U,!1]);return h(_,-1),f(_,E,O,P,L)},Xt.encodeLL=function(y,E,O,$,P,L,U,_){const b={ctype:0+($==1?0:2)+(P==0?0:4),depth:L,frames:[]},z=($+P)*L,F=z*E;for(let G=0;G<y.length;G++)b.frames.push({rect:{x:0,y:0,width:E,height:O},img:new Uint8Array(y[G]),blend:0,dispose:1,bpp:Math.ceil(z/8),bpl:Math.ceil(F/8)});return h(b,0,!0),f(b,E,O,U,_)},Xt.encode.compress=c,Xt.encode.dither=l,Xt.quantize=m,Xt.quantize.getKDtree=x,Xt.quantize.getNearest=k})();const gi={toArrayBuffer(e,t){const r=e.width,n=e.height,o=r<<2,a=e.getContext("2d").getImageData(0,0,r,n),s=new Uint32Array(a.data.buffer),l=(32*r+31)/32<<2,f=l*n,h=122+f,c=new ArrayBuffer(h),i=new DataView(c),u=1<<20;let g,p,m,x,k=u,M=0,v=0,T=0;function I(w){i.setUint16(v,w,!0),v+=2}function S(w){i.setUint32(v,w,!0),v+=4}function N(w){v+=w}I(19778),S(h),N(4),S(122),S(108),S(r),S(-n>>>0),I(1),I(32),S(3),S(f),S(2835),S(2835),N(8),S(16711680),S(65280),S(255),S(4278190080),S(1466527264),(function w(){for(;M<n&&k>0;){for(x=122+M*l,g=0;g<o;)k--,p=s[T++],m=p>>>24,i.setUint32(x+g,p<<8|m),g+=4;M++}T<s.length?(k=u,setTimeout(w,gi._dly)):t(c)})()},toBlob(e,t){this.toArrayBuffer(e,(r=>{t(new Blob([r],{type:"image/bmp"}))}))},_dly:9};var kt={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},oh={[kt.CHROME]:16384,[kt.FIREFOX]:11180,[kt.DESKTOP_SAFARI]:16384,[kt.IE]:8192,[kt.IOS]:4096,[kt.ETC]:8192};const xa=typeof window<"u",hi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Vn=xa&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),ah=(xa||hi)&&(Vn&&Vn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),pi=(xa||hi)&&(Vn&&Vn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function ka(e,t,r=Date.now()){return new Promise((n=>{const o=e.split(","),a=o[0].match(/:(.*?);/)[1],s=globalThis.atob(o[1]);let l=s.length;const f=new Uint8Array(l);for(;l--;)f[l]=s.charCodeAt(l);const h=new Blob([f],{type:a});h.name=t,h.lastModified=r,n(h)}))}function mi(e){return new Promise(((t,r)=>{const n=new pi;n.onload=()=>t(n.result),n.onerror=o=>r(o),n.readAsDataURL(e)}))}function bi(e){return new Promise(((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=o=>r(o),n.src=e}))}function wr(){if(wr.cachedResult!==void 0)return wr.cachedResult;let e=kt.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=kt.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=kt.IOS:/Safari/i.test(t)?e=kt.DESKTOP_SAFARI:/Firefox/i.test(t)?e=kt.FIREFOX:(/MSIE/i.test(t)||document.documentMode)&&(e=kt.IE),wr.cachedResult=e,wr.cachedResult}function yi(e,t){const r=wr(),n=oh[r];let o=e,a=t,s=o*a;const l=o>a?a/o:o/a;for(;s>n*n;){const f=(n+o)/2,h=(n+a)/2;f<h?(a=h,o=h*l):(a=f*l,o=f),s=o*a}return{width:o,height:a}}function Kn(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),n===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function vi(e,t){const{width:r,height:n}=yi(e.width,e.height),[o,a]=Kn(r,n);return t&&/jpe?g/.test(t)&&(a.fillStyle="white",a.fillRect(0,0,o.width,o.height)),a.drawImage(e,0,0,o.width,o.height),o}function Yn(){return Yn.cachedResult!==void 0||(Yn.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Yn.cachedResult}function Xn(e,t={}){return new Promise((function(r,n){let o,a;var s=function(){try{return a=vi(o,t.fileType||e.type),r([o,a])}catch(f){return n(f)}},l=function(f){try{var h=function(c){try{throw c}catch(i){return n(i)}};try{let c;return mi(e).then((function(i){try{return c=i,bi(c).then((function(u){try{return o=u,(function(){try{return s()}catch(g){return n(g)}})()}catch(g){return h(g)}}),h)}catch(u){return h(u)}}),h)}catch(c){h(c)}}catch(c){return n(c)}};try{if(Yn()||[kt.DESKTOP_SAFARI,kt.MOBILE_SAFARI].includes(wr()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then((function(f){try{return o=f,s()}catch{return l()}}),l)}catch{l()}}))}function qn(e,t,r,n,o=1){return new Promise((function(a,s){let l;if(t==="image/png"){let h,c,i;return h=e.getContext("2d"),{data:c}=h.getImageData(0,0,e.width,e.height),i=Xt.encode([c.buffer],e.width,e.height,4096*o),l=new Blob([i],{type:t}),l.name=r,l.lastModified=n,f.call(this)}{let h=function(){return f.call(this)};if(t==="image/bmp")return new Promise((c=>gi.toBlob(e,c))).then(function(c){try{return l=c,l.name=r,l.lastModified=n,h.call(this)}catch(i){return s(i)}}.bind(this),s);{let c=function(){return h.call(this)};if(typeof OffscreenCanvas=="function"&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:o}).then(function(i){try{return l=i,l.name=r,l.lastModified=n,c.call(this)}catch(u){return s(u)}}.bind(this),s);{let i;return i=e.toDataURL(t,o),ka(i,r,n).then(function(u){try{return l=u,c.call(this)}catch(g){return s(g)}}.bind(this),s)}}}function f(){return a(l)}}))}function Qt(e){e.width=0,e.height=0}function Hr(){return new Promise((function(e,t){let r,n,o,a;return Hr.cachedResult!==void 0?e(Hr.cachedResult):ka("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(s){try{return r=s,Xn(r).then((function(l){try{return n=l[1],qn(n,r.type,r.name,r.lastModified).then((function(f){try{return o=f,Qt(n),Xn(o).then((function(h){try{return a=h[0],Hr.cachedResult=a.width===1&&a.height===2,e(Hr.cachedResult)}catch(c){return t(c)}}),t)}catch(h){return t(h)}}),t)}catch(f){return t(f)}}),t)}catch(l){return t(l)}}),t)}))}function wi(e){return new Promise(((t,r)=>{const n=new pi;n.onload=o=>{const a=new DataView(o.target.result);if(a.getUint16(0,!1)!=65496)return t(-2);const s=a.byteLength;let l=2;for(;l<s;){if(a.getUint16(l+2,!1)<=8)return t(-1);const f=a.getUint16(l,!1);if(l+=2,f==65505){if(a.getUint32(l+=2,!1)!=1165519206)return t(-1);const h=a.getUint16(l+=6,!1)==18761;l+=a.getUint32(l+4,h);const c=a.getUint16(l,h);l+=2;for(let i=0;i<c;i++)if(a.getUint16(l+12*i,h)==274)return t(a.getUint16(l+12*i+8,h))}else{if((65280&f)!=65280)break;l+=a.getUint16(l,!1)}}return t(-1)},n.onerror=o=>r(o),n.readAsArrayBuffer(e)}))}function xi(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:o}=t;let a,s=e;return isFinite(o)&&(r>o||n>o)&&([s,a]=Kn(r,n),r>n?(s.width=o,s.height=n/r*o):(s.width=r/n*o,s.height=o),a.drawImage(e,0,0,s.width,s.height),Qt(e)),s}function ki(e,t){const{width:r}=e,{height:n}=e,[o,a]=Kn(r,n);switch(t>4&&t<9?(o.width=n,o.height=r):(o.width=r,o.height=n),t){case 2:a.transform(-1,0,0,1,r,0);break;case 3:a.transform(-1,0,0,-1,r,n);break;case 4:a.transform(1,0,0,-1,0,n);break;case 5:a.transform(0,1,1,0,0,0);break;case 6:a.transform(0,1,-1,0,n,0);break;case 7:a.transform(0,-1,-1,0,n,r);break;case 8:a.transform(0,-1,1,0,0,r)}return a.drawImage(e,0,0,r,n),Qt(e),o}function Ci(e,t,r=0){return new Promise((function(n,o){let a,s,l,f,h,c,i,u,g,p,m,x,k,M,v,T,I,S,N,w;function y(O=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;a+=O,t.onProgress(Math.min(a,100))}function E(O){if(t.signal&&t.signal.aborted)throw t.signal.reason;a=Math.min(Math.max(O,a),100),t.onProgress(a)}return a=r,s=t.maxIteration||10,l=1024*t.maxSizeMB*1024,y(),Xn(e,t).then(function(O){try{return[,f]=O,y(),h=xi(f,t),y(),new Promise((function($,P){var L;if(!(L=t.exifOrientation))return wi(e).then(function(_){try{return L=_,U.call(this)}catch(b){return P(b)}}.bind(this),P);function U(){return $(L)}return U.call(this)})).then(function($){try{return c=$,y(),Hr().then(function(P){try{return i=P?h:ki(h,c),y(),u=t.initialQuality||1,g=t.fileType||e.type,qn(i,g,e.name,e.lastModified,u).then(function(L){try{{let _=function(){if(s--&&(v>l||v>k)){let z,F;return z=w?.95*N.width:N.width,F=w?.95*N.height:N.height,[I,S]=Kn(z,F),S.drawImage(N,0,0,z,F),u*=g==="image/png"?.85:.95,qn(I,g,e.name,e.lastModified,u).then((function(G){try{return T=G,Qt(N),N=I,v=T.size,E(Math.min(99,Math.floor((M-v)/(M-l)*100))),_}catch(X){return o(X)}}),o)}return[1]},b=function(){return Qt(N),Qt(I),Qt(h),Qt(i),Qt(f),E(100),n(T)};if(p=L,y(),m=p.size>l,x=p.size>e.size,!m&&!x)return E(100),n(p);var U;return k=e.size,M=p.size,v=M,N=i,w=!t.alwaysKeepResolution&&m,(U=function(z){for(;z;){if(z.then)return void z.then(U,o);try{if(z.pop){if(z.length)return z.pop()?b.call(this):z;z=_}else z=z.call(this)}catch(F){return o(F)}}}.bind(this))(_)}}catch(_){return o(_)}}.bind(this),o)}catch(L){return o(L)}}.bind(this),o)}catch(P){return o(P)}}.bind(this),o)}catch($){return o($)}}.bind(this),o)}))}const sh=`
|
||
let scriptImported = false
|
||
self.addEventListener('message', async (e) => {
|
||
const { file, id, imageCompressionLibUrl, options } = e.data
|
||
options.onProgress = (progress) => self.postMessage({ progress, id })
|
||
try {
|
||
if (!scriptImported) {
|
||
// console.log('[worker] importScripts', imageCompressionLibUrl)
|
||
self.importScripts(imageCompressionLibUrl)
|
||
scriptImported = true
|
||
}
|
||
// console.log('[worker] self', self)
|
||
const compressedFile = await imageCompression(file, options)
|
||
self.postMessage({ file: compressedFile, id })
|
||
} catch (e) {
|
||
// console.error('[worker] error', e)
|
||
self.postMessage({ error: e.message + '\\n' + e.stack, id })
|
||
}
|
||
})
|
||
`;let Ca;function lh(e,t){return new Promise(((r,n)=>{Ca||(Ca=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(sh));const o=new Worker(Ca);o.addEventListener("message",(function(s){if(t.signal&&t.signal.aborted)o.terminate();else if(s.data.progress===void 0){if(s.data.error)return n(new Error(s.data.error)),void o.terminate();r(s.data.file),o.terminate()}else t.onProgress(s.data.progress)})),o.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",(()=>{n(t.signal.reason),o.terminate()})),o.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})}))}function mt(e,t){return new Promise((function(r,n){let o,a,s,l,f,h;if(o={...t},s=0,{onProgress:l}=o,o.maxSizeMB=o.maxSizeMB||Number.POSITIVE_INFINITY,f=typeof o.useWebWorker!="boolean"||o.useWebWorker,delete o.useWebWorker,o.onProgress=g=>{s=g,typeof l=="function"&&l(s)},!(e instanceof Blob||e instanceof ah))return n(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(new Error("The file given is not an image"));if(h=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!f||typeof Worker!="function"||h)return Ci(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var c=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return Ci(e,o).then((function(p){try{return a=p,c()}catch(m){return n(m)}}),n)}catch(p){return n(p)}};try{return o.libURL=o.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",lh(e,o).then((function(g){try{return a=g,c()}catch{return i()}}),i)}catch{i()}function u(){try{a.name=e.name,a.lastModified=e.lastModified}catch{}try{o.preserveExif&&e.type==="image/jpeg"&&(!o.fileType||o.fileType&&o.fileType===e.type)&&(a=fi(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=mi,mt.getFilefromDataUrl=ka,mt.loadImage=bi,mt.drawImageInCanvas=vi,mt.drawFileInCanvas=Xn,mt.canvasToFile=qn,mt.getExifOrientation=wi,mt.handleMaxWidthOrHeight=xi,mt.followExifOrientation=ki,mt.cleanupCanvasMemory=Qt,mt.isAutoOrientationInBrowser=Hr,mt.approximateBelowMaximumCanvasSizeOfBrowser=yi,mt.copyExifWithoutOrientation=fi,mt.getBrowserName=wr,mt.version="2.0.2";const ih=window.G7Core,Zn=e=>{const t=["B","KB","MB","GB"];let r=0,n=e;for(;n>=1024&&r<t.length-1;)n/=1024,r++;return`${n.toFixed(2)} ${t[r]}`},_i=e=>{if(e&&typeof e=="object"){const t=e;if(t.response?.data?.message)return t.response.data.message;if(t.response?.data?.errors){const r=Object.values(t.response.data.errors)[0];if(Array.isArray(r)&&r[0])return r[0]}if(t.message)return t.message}return e instanceof Error?e.message:"업로드 실패"},Si=e=>e?e.startsWith("image/")?"fa-file-image":e.startsWith("video/")?"fa-file-video":e.startsWith("audio/")?"fa-file-audio":e==="application/pdf"?"fa-file-pdf":e.includes("word")||e.includes("document")?"fa-file-word":e.includes("excel")||e.includes("spreadsheet")?"fa-file-excel":e.includes("zip")||e.includes("compressed")?"fa-file-zipper":"fa-file":"fa-file",at=(e,t)=>ih?.t?.(e,t)??e,ch="2.0.2";function dh(){const e=window?.G7Core?.asset;if(typeof e?.template=="function")return e.template("sirsoft-basic",`vendor/browser-image-compression/${ch}/browser-image-compression.js`)}const xr=window.G7Core;function Ei(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:c,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:x,onReorder:k,uploadTriggerEvent:M,confirmBeforeRemove:v,uploadParams:T}=e,[I,S]=C.useState(i),[N,w]=C.useState([]),[y,E]=C.useState(!1),O=C.useRef(null),$=C.useRef(0),P=C.useRef(new Set),L=C.useRef(new Map),[U,_]=C.useState(!1),[b,z]=C.useState(null),[F,G]=C.useState(!1),X=C.useRef(!1),[B,Y]=C.useState([]),H=C.useRef(i),[W,Q]=C.useState(!1),[be,se]=C.useState(0),pe=C.useRef(0),[ne,Ae]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(N)},[N,g]);const We=C.useMemo(()=>{const q=H.current;return q===i?q:q.length!==i.length?(H.current=i,i):q.length===0&&i.length===0?q:i.some((de,ue)=>de.id!==q[ue]?.id)?(H.current=i,i):q},[i]);C.useEffect(()=>{if(X.current)return;const q=We.filter(ue=>!P.current.has(ue.id)&&(!ue.hash||!P.current.has(ue.hash))),le=new Set(q.map(ue=>ue.id)),de=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!P.current.has(ue.id));S([...q,...de])},[We]);const me=C.useCallback(async q=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0,libURL:dh()};return await mt(q,le)},[f]),Te=C.useCallback(async q=>{const le=I.length+N.length,de=Math.max(0,o-le),ue=Array.from(q).slice(0,de);if(q.length>de){const ie=Array.from(q).slice(de),Fe=at("attachment.upload_limit_exceeded",{max:o});m?.(Fe,ie[0]??q[0])}for(const ie of ue){if(ie.size>a*1024*1024){m?.(`[${ie.name}] 파일 크기(${Zn(ie.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,ie);continue}if(l){const Ce="."+ie.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(He=>He.trim().toLowerCase()).some(He=>{if(He.includes("/")){if(He.endsWith("/*")){const je=He.slice(0,-2);return ie.type.toLowerCase().startsWith(je+"/")}return ie.type.toLowerCase()===He}return Ce===He})){m?.(`[${ie.name}] 허용되지 않는 파일 형식입니다. (허용: ${l})`,ie);continue}}const Fe={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:ie,original_filename:ie.name,mime_type:ie.type,size:ie.size,size_formatted:Zn(ie.size),status:"pending",progress:0};if(ie.type.startsWith("image/")&&(Fe.preview=URL.createObjectURL(ie)),w(Ce=>[...Ce,Fe]),ie.type.startsWith("image/")&&f){w(Ce=>Ce.map(Ie=>Ie.id===Fe.id?{...Ie,status:"compressing"}:Ie));try{const Ce=await me(ie);w(Ie=>Ie.map(Ne=>Ne.id===Fe.id?{...Ne,compressedBlob:Ce,size:Ce.size,size_formatted:Zn(Ce.size),status:"pending",progress:0}:Ne))}catch{w(Ce=>Ce.map(Ie=>Ie.id===Fe.id?{...Ie,status:"error",error:"이미지 압축 실패"}:Ie))}}}},[I.length,N.length,o,a,l,f,me,m]),ge=C.useCallback(async q=>{const le=new FormData,de=q.compressedBlob?new File([q.compressedBlob],q.original_filename,{type:q.mime_type}):q.file;le.append("file",de),t&&le.append("attachmentable_type",t),r&&le.append("attachmentable_id",String(r)),le.append("collection",n),h.forEach(ue=>{le.append("role_ids[]",String(ue))}),T&&Object.entries(T).forEach(([ue,ie])=>{le.append(ue,ie)});try{const ue=await xr.api.post(u.upload,le,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Fe=>{const Ce=Math.round(Fe.loaded*100/(Fe.total??1));w(Ie=>Ie.map(Ne=>Ne.id===q.id?{...Ne,progress:Ce}:Ne))}});return ue?.data?.data??ue?.data}catch(ue){const ie=_i(ue);throw new Error(ie)}},[t,r,n,h,u.upload]),Oe=C.useCallback(async()=>{const q=N.filter(Ce=>Ce.status==="pending"||Ce.status==="error");if(q.length===0)return[];const le=[],de=new Map,ue=[...q],ie=async()=>{for(;ue.length>0&&$.current<s;){const Ce=ue.shift();$.current++,w(Ie=>Ie.map(Ne=>Ne.id===Ce.id?{...Ne,status:"uploading",progress:0}:Ne));try{const Ie=await ge(Ce);if(Ie)le.push(Ie),de.set(String(Ce.id),String(Ie.hash)),L.current.set(Ie.id,Ie),w(Ne=>Ne.filter(He=>He.id!==Ce.id)),S(Ne=>[...Ne,Ie]),Y(Ne=>{if(Ne.length===0)return Ne;const He=String(Ce.id);return Ne.some(_e=>String(_e)===He)?Ne.map(_e=>String(_e)===He?String(Ie.hash):_e):Ne}),Ce.preview&&URL.revokeObjectURL(Ce.preview);else{const Ne=at("attachment.upload_response_invalid");w(He=>He.map(je=>je.id===Ce.id?{...je,status:"error",error:Ne}:je)),m?.(`[${Ce.original_filename}] ${Ne}`,Ce.file)}}catch(Ie){const Ne=Ie instanceof Error?Ie.message:"업로드 실패";w(He=>He.map(je=>je.id===Ce.id?{...je,status:"error",error:Ne}:je)),m?.(`[${Ce.original_filename}] ${Ne}`,Ce.file)}finally{$.current--}}},Fe=Array(Math.min(s,q.length)).fill(null).map(()=>ie());if(await Promise.all(Fe),le.length>0&&(p?.(le),u.reorder&&B.length>0&&k)){const Ce=[...I,...le],Ie=B.map(je=>de.get(String(je))??je),Ne=new Map(Ie.map((je,_e)=>[String(je),_e])),He=[...Ce].sort((je,_e)=>{const xe=Ne.get(String(je.hash))??Ce.length,De=Ne.get(String(_e.hash))??Ce.length;return xe-De}).map((je,_e)=>({...je,sort_order:_e,order:_e+1}));k(He)}return le},[N,s,ge,p,m,B,I,k,u.reorder]);C.useEffect(()=>{if(!M)return;const q=xr.componentEvent.on(M,async()=>{const le=await Oe();return{uploadedAttachments:le,existingFiles:I,allFiles:[...I,...le]}});return()=>{q()}},[M,Oe,I]),C.useEffect(()=>{c&&N.some(q=>q.status==="pending")&&Oe()},[c,N,Oe]);const we=C.useCallback(async q=>{G(!0);try{if(q.id&&u.delete){const de=u.delete.replace(":id",String(q.id));await xr.api.delete(de)}const le=q.hash||q.id;q.id&&(P.current.add(q.id),L.current.delete(q.id)),q.hash&&P.current.add(q.hash),S(de=>de.filter(ue=>(ue.hash||ue.id)!==le)),x?.(q.hash||q.id),_(!1),z(null)}catch{console.error("첨부파일 삭제 실패")}finally{G(!1)}},[x,u.delete]),$e=C.useCallback(async q=>{"hash"in q?v?(z(q),_(!0)):await we(q):(q.preview&&URL.revokeObjectURL(q.preview),w(le=>le.filter(de=>de.id!==q.id)))},[v,we]),ze=C.useCallback(q=>{w(le=>le.map(de=>de.id===q.id?{...de,status:"pending",error:void 0}:de))},[]),K=C.useCallback(async q=>{const{arrayMove:le}=await Promise.resolve().then(()=>V0),{active:de,over:ue}=q;if(!ue||de.id===ue.id)return;const ie=[...I,...N];let Fe;if(B.length===0)Fe=ie;else{const xe=new Map(B.map((De,Ye)=>[String(De),Ye]));Fe=[...ie].sort((De,Ye)=>{const rt="hash"in De?String(De.hash):String(De.id),qe="hash"in Ye?String(Ye.hash):String(Ye.id);return(xe.get(rt)??ie.length)-(xe.get(qe)??ie.length)})}const Ce=Fe.findIndex(xe=>"hash"in xe?xe.hash===de.id:xe.id===de.id),Ie=Fe.findIndex(xe=>"hash"in xe?xe.hash===ue.id:xe.id===ue.id),Ne=le(Fe,Ce,Ie);Y(Ne.map(xe=>"hash"in xe?xe.hash:xe.id));const He=Ne.filter(xe=>"hash"in xe),je=Ne.filter(xe=>!("hash"in xe));X.current=!0,S(He),w(je);const _e=He.map((xe,De)=>({...xe,sort_order:De,order:De+1}));if(He.length>0&&u.reorder){const xe=He.map((De,Ye)=>({id:De.id,order:Ye+1}));try{const De=await xr.api.patch(u.reorder,{order:xe});xr.toast.success(De.message)}catch(De){const Ye=De instanceof Error?De.message:at("attachment.reorder_failed");xr.toast.error(Ye)}}k?.(_e)},[I,N,B,u.reorder,k]),oe=C.useMemo(()=>[...I,...N].filter(q=>"is_image"in q?q.is_image:q.mime_type?.startsWith("image/")??!1),[I,N]),ae=C.useCallback(q=>{const le=oe.findIndex(de=>"hash"in q&&"hash"in de?de.hash===q.hash:"id"in q&&"id"in de&&!("hash"in q)&&!("hash"in de)?de.id===q.id:!1);le!==-1&&(pe.current+=1,se(le),Q(!0))},[oe]);C.useEffect(()=>{let q=!1;return(async()=>{const de=I.filter(ie=>ie.is_image),ue=new Set(de.map(ie=>ie.id));for(const[ie,Fe]of ve.current)ue.has(ie)||(URL.revokeObjectURL(Fe),ve.current.delete(ie));for(const ie of de){if(q)break;if(!ve.current.has(ie.id)){if(ua(ie.download_url)){ve.current.set(ie.id,ie.download_url),Ae(new Map(ve.current));continue}try{const Fe=await xr.api.get(ie.download_url,{responseType:"blob",headers:zn()});if(!q&&Fe){const Ce=URL.createObjectURL(Fe);ve.current.set(ie.id,Ce),Ae(new Map(ve.current))}}catch(Fe){console.error("Failed to load authenticated image:",Fe)}}}})(),()=>{q=!0}},[I]),C.useEffect(()=>()=>{ve.current.forEach(q=>URL.revokeObjectURL(q)),ve.current.clear()},[]);const ce=C.useCallback(async q=>{const{executeImageDownload:le}=await Promise.resolve().then(()=>ni);await le({src:q.download_url,downloadUrl:q.download_url,filename:q.original_filename,downloadRequiresAuth:!0})},[]),ke=C.useMemo(()=>{const q=[...I,...N];if(B.length===0)return q;const le=new Map(B.map((de,ue)=>[String(de),ue]));return[...q].sort((de,ue)=>{const ie="hash"in de?String(de.hash):String(de.id),Fe="hash"in ue?String(ue.hash):String(ue.id),Ce=le.get(ie)??q.length,Ie=le.get(Fe)??q.length;return Ce-Ie})},[I,N,B]),Ee=ke.length,Be=Ee>0,Me=Ee<o,Ke=C.useCallback(()=>w([]),[]),Pe=C.useCallback(()=>N,[N]);return{existingFiles:I,pendingFiles:N,isDragOver:y,setIsDragOver:E,isDeleting:F,totalCount:Ee,hasFiles:Be,canAddMore:Me,allItems:ke,imageFiles:oe,handleFiles:Te,handleRemove:$e,handleRetry:ze,handleUploadAll:Oe,handleOpenGallery:ae,handleDownload:ce,handleDragEnd:K,inputRef:O,galleryOpen:W,setGalleryOpen:Q,galleryStartIndex:be,galleryKeyRef:pe,confirmDialogOpen:U,setConfirmDialogOpen:_,itemToDelete:b,executeRemoveAttachment:we,authenticatedImageUrls:ne,clear:Ke,getPendingFiles:Pe}}const Ti=({isDragOver:e,canAddMore:t,onFiles:r,setIsDragOver:n,inputRef:o,accept:a,maxFiles:s,maxSize:l,children:f})=>d.jsxs(j,{className:`
|
||
relative border-2 border-dashed rounded-lg transition-colors
|
||
${e?"border-blue-500 bg-blue-50 dark:bg-blue-900/20":"border-gray-300 dark:border-gray-600"}
|
||
`,onDragOver:h=>{h.preventDefault(),t&&n(!0)},onDragLeave:()=>n(!1),onDrop:h=>{h.preventDefault(),n(!1),t&&r(h.dataTransfer.files)},children:[d.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&d.jsxs(j,{className:"p-8 text-center cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:()=>o.current?.click(),children:[d.jsx(It,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),d.jsx(Gt,{className:"text-sm text-gray-600 dark:text-gray-400",children:at("attachment.drop_or_click")}),d.jsxs(Gt,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[at("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function uh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>n=>{t.forEach(o=>o(n))},t)}const Qn=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function _a(e){return"nodeType"in e}function Ct(e){var t,r;return e?Gr(e)?e:_a(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function Sa(e){const{Document:t}=Ct(e);return e instanceof t}function dn(e){return Gr(e)?!1:e instanceof Ct(e).HTMLElement}function Ai(e){return e instanceof Ct(e).SVGElement}function jr(e){return e?Gr(e)?e.document:_a(e)?Sa(e)?e:dn(e)||Ai(e)?e.ownerDocument:document:document:document}const Jt=Qn?C.useLayoutEffect:C.useEffect;function Ea(e){const t=C.useRef(e);return Jt(()=>{t.current=e}),C.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function fh(){const e=C.useRef(null),t=C.useCallback((n,o)=>{e.current=setInterval(n,o)},[]),r=C.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,r]}function un(e,t){t===void 0&&(t=[e]);const r=C.useRef(e);return Jt(()=>{r.current!==e&&(r.current=e)},t),r}function fn(e,t){const r=C.useRef();return C.useMemo(()=>{const n=e(r.current);return r.current=n,n},[...t])}function Jn(e){const t=Ea(e),r=C.useRef(null),n=C.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function Ta(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Aa={};function gn(e,t){return C.useMemo(()=>{if(t)return t;const r=Aa[e]==null?0:Aa[e]+1;return Aa[e]=r,e+"-"+r},[e,t])}function Ni(e){return function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];return n.reduce((a,s)=>{const l=Object.entries(s);for(const[f,h]of l){const c=a[f];c!=null&&(a[f]=c+e*h)}return a},{...t})}}const Br=Ni(1),hn=Ni(-1);function gh(e){return"clientX"in e&&"clientY"in e}function Na(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function hh(e){if(!e)return!1;const{TouchEvent:t}=Ct(e.target);return t&&e instanceof t}function Oa(e){if(hh(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return gh(e)?{x:e.clientX,y:e.clientY}:null}const pn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[pn.Translate.toString(e),pn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),Oi="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ph(e){return e.matches(Oi)?e:e.querySelector(Oi)}const mh={display:"none"};function bh(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:mh},r)}function yh(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return C.createElement("div",{id:t,style:o,role:"status","aria-live":n,"aria-atomic":!0},r)}function vh(){const[e,t]=C.useState("");return{announce:C.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Mi=C.createContext(null);function wh(e){const t=C.useContext(Mi);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xh(){const[e]=C.useState(()=>new Set),t=C.useCallback(n=>(e.add(n),()=>e.delete(n)),[e]);return[C.useCallback(n=>{let{type:o,event:a}=n;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,a)})},[e]),t]}const kh={draggable:`
|
||
To pick up a draggable item, press the space bar.
|
||
While dragging, use the arrow keys to move the item.
|
||
Press space again to drop the item in its new position, or press escape to cancel.
|
||
`},Ch={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function _h(e){let{announcements:t=Ch,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=kh}=e;const{announce:a,announcement:s}=vh(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),wh(C.useMemo(()=>({onDragStart(i){let{active:u}=i;a(t.onDragStart({active:u}))},onDragMove(i){let{active:u,over:g}=i;t.onDragMove&&a(t.onDragMove({active:u,over:g}))},onDragOver(i){let{active:u,over:g}=i;a(t.onDragOver({active:u,over:g}))},onDragEnd(i){let{active:u,over:g}=i;a(t.onDragEnd({active:u,over:g}))},onDragCancel(i){let{active:u,over:g}=i;a(t.onDragCancel({active:u,over:g}))}}),[a,t])),!f)return null;const c=C.createElement(C.Fragment,null,C.createElement(bh,{id:n,value:o.draggable}),C.createElement(yh,{id:l,announcement:s}));return r?tr.createPortal(c,r):c}var st;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(st||(st={}));function Rn(){}function Ii(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Sh(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return C.useMemo(()=>[...t].filter(n=>n!=null),[...t])}const qt=Object.freeze({x:0,y:0});function Di(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Pi(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function Eh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Li(e){let{left:t,top:r,height:n,width:o}=e;return[{x:t,y:r},{x:t+o,y:r},{x:t,y:r+n},{x:t+o,y:r+n}]}function $i(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Fi(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}const Th=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Fi(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Di(Fi(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Pi)},Ah=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Li(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Li(f),c=o.reduce((u,g,p)=>u+Di(h[p],g),0),i=Number((c/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Pi)};function Nh(e,t){const r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),s=o-n,l=a-r;if(n<o&&r<a){const f=t.width*t.height,h=e.width*e.height,c=s*l,i=c/(f+h-c);return Number(i.toFixed(4))}return 0}const Oh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=[];for(const a of n){const{id:s}=a,l=r.get(s);if(l){const f=Nh(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(Eh)};function Mh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Ui(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:qt}function Ih(e){return function(r){for(var n=arguments.length,o=new Array(n>1?n-1:0),a=1;a<n;a++)o[a-1]=arguments[a];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...r})}}const Dh=Ih(1);function Ph(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Lh(e,t,r){const n=Ph(t);if(!n)return e;const{scaleX:o,scaleY:a,x:s,y:l}=n,f=e.left-s-(1-o)*parseFloat(r),h=e.top-l-(1-a)*parseFloat(r.slice(r.indexOf(" ")+1)),c=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:c,height:i,top:h,right:f+c,bottom:h+i,left:f}}const $h={ignoreTransform:!1};function Wr(e,t){t===void 0&&(t=$h);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:c}=Ct(e).getComputedStyle(e);h&&(r=Lh(r,h,c))}const{top:n,left:o,width:a,height:s,bottom:l,right:f}=r;return{top:n,left:o,width:a,height:s,bottom:l,right:f}}function zi(e){return Wr(e,{ignoreTransform:!0})}function Fh(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Uh(e,t){return t===void 0&&(t=Ct(e).getComputedStyle(e)),t.position==="fixed"}function zh(e,t){t===void 0&&(t=Ct(e).getComputedStyle(e));const r=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const a=t[o];return typeof a=="string"?r.test(a):!1})}function eo(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(Sa(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!dn(o)||Ai(o)||r.includes(o))return r;const a=Ct(e).getComputedStyle(o);return o!==e&&zh(o,a)&&r.push(o),Uh(o,a)?r:n(o.parentNode)}return e?n(e):r}function Hi(e){const[t]=eo(e,1);return t??null}function Ma(e){return!Qn||!e?null:Gr(e)?e:_a(e)?Sa(e)||e===jr(e).scrollingElement?window:dn(e)?e:null:null}function Gi(e){return Gr(e)?e.scrollX:e.scrollLeft}function ji(e){return Gr(e)?e.scrollY:e.scrollTop}function Ia(e){return{x:Gi(e),y:ji(e)}}var ut;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ut||(ut={}));function Bi(e){return!Qn||!e?!1:e===document.scrollingElement}function Wi(e){const t={x:0,y:0},r=Bi(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,a=e.scrollLeft<=t.x,s=e.scrollTop>=n.y,l=e.scrollLeft>=n.x;return{isTop:o,isLeft:a,isBottom:s,isRight:l,maxScroll:n,minScroll:t}}const Hh={x:.2,y:.2};function Gh(e,t,r,n,o){let{top:a,left:s,right:l,bottom:f}=r;n===void 0&&(n=10),o===void 0&&(o=Hh);const{isTop:h,isBottom:c,isLeft:i,isRight:u}=Wi(e),g={x:0,y:0},p={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!h&&a<=t.top+m.height?(g.y=ut.Backward,p.y=n*Math.abs((t.top+m.height-a)/m.height)):!c&&f>=t.bottom-m.height&&(g.y=ut.Forward,p.y=n*Math.abs((t.bottom-m.height-f)/m.height)),!u&&l>=t.right-m.width?(g.x=ut.Forward,p.x=n*Math.abs((t.right-m.width-l)/m.width)):!i&&s<=t.left+m.width&&(g.x=ut.Backward,p.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:g,speed:p}}function jh(e){if(e===document.scrollingElement){const{innerWidth:a,innerHeight:s}=window;return{top:0,left:0,right:a,bottom:s,width:a,height:s}}const{top:t,left:r,right:n,bottom:o}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Vi(e){return e.reduce((t,r)=>Br(t,Ia(r)),qt)}function Bh(e){return e.reduce((t,r)=>t+Gi(r),0)}function Wh(e){return e.reduce((t,r)=>t+ji(r),0)}function Vh(e,t){if(t===void 0&&(t=Wr),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);Hi(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Kh=[["x",["left","right"],Bh],["y",["top","bottom"],Wh]];class Da{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=eo(r),o=Vi(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of Kh)for(const f of s)Object.defineProperty(this,f,{get:()=>{const h=l(n),c=o[a]-h;return this.rect[f]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mn{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var n;return(n=this.target)==null?void 0:n.removeEventListener(...r)})},this.target=t}add(t,r,n){var o;(o=this.target)==null||o.addEventListener(t,r,n),this.listeners.push([t,r,n])}}function Yh(e){const{EventTarget:t}=Ct(e);return e instanceof t?e:jr(e)}function Pa(e,t){const r=Math.abs(e.x),n=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t?n>t.y:!1}var zt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(zt||(zt={}));function Ki(e){e.preventDefault()}function Xh(e){e.stopPropagation()}var Ue;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Ue||(Ue={}));const Yi={start:[Ue.Space,Ue.Enter],cancel:[Ue.Esc],end:[Ue.Space,Ue.Enter,Ue.Tab]},qh=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case Ue.Right:return{...r,x:r.x+25};case Ue.Left:return{...r,x:r.x-25};case Ue.Down:return{...r,y:r.y+25};case Ue.Up:return{...r,y:r.y-25}}};class La{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:r}}=t;this.props=t,this.listeners=new mn(jr(r)),this.windowListeners=new mn(Ct(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(zt.Resize,this.handleCancel),this.windowListeners.add(zt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(zt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Vh(n),r(qt)}handleKeyDown(t){if(Na(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Yi,coordinateGetter:s=qh,scrollBehavior:l="smooth"}=o,{code:f}=t;if(a.end.includes(f)){this.handleEnd(t);return}if(a.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=n.current,c=h?{x:h.left,y:h.top}:qt;this.referenceCoordinates||(this.referenceCoordinates=c);const i=s(t,{active:r,context:n.current,currentCoordinates:c});if(i){const u=hn(i,c),g={x:0,y:0},{scrollableAncestors:p}=n.current;for(const m of p){const x=t.code,{isTop:k,isRight:M,isLeft:v,isBottom:T,maxScroll:I,minScroll:S}=Wi(m),N=jh(m),w={x:Math.min(x===Ue.Right?N.right-N.width/2:N.right,Math.max(x===Ue.Right?N.left:N.left+N.width/2,i.x)),y:Math.min(x===Ue.Down?N.bottom-N.height/2:N.bottom,Math.max(x===Ue.Down?N.top:N.top+N.height/2,i.y))},y=x===Ue.Right&&!M||x===Ue.Left&&!v,E=x===Ue.Down&&!T||x===Ue.Up&&!k;if(y&&w.x!==i.x){const O=m.scrollLeft+u.x,$=x===Ue.Right&&O<=I.x||x===Ue.Left&&O>=S.x;if($&&!u.y){m.scrollTo({left:O,behavior:l});return}$?g.x=m.scrollLeft-O:g.x=x===Ue.Right?m.scrollLeft-I.x:m.scrollLeft-S.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(E&&w.y!==i.y){const O=m.scrollTop+u.y,$=x===Ue.Down&&O<=I.y||x===Ue.Up&&O>=S.y;if($&&!u.x){m.scrollTo({top:O,behavior:l});return}$?g.y=m.scrollTop-O:g.y=x===Ue.Down?m.scrollTop-I.y:m.scrollTop-S.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Br(hn(i,this.referenceCoordinates),g))}}}handleMove(t,r){const{onMove:n}=this.props;t.preventDefault(),n(r)}handleEnd(t){const{onEnd:r}=this.props;t.preventDefault(),this.detach(),r()}handleCancel(t){const{onCancel:r}=this.props;t.preventDefault(),this.detach(),r()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}La.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Yi,onActivation:o}=t,{active:a}=r;const{code:s}=e.nativeEvent;if(n.start.includes(s)){const l=a.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Xi(e){return!!(e&&"distance"in e)}function qi(e){return!!(e&&"delay"in e)}class $a{constructor(t,r,n){var o;n===void 0&&(n=Yh(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;const{event:a}=t,{target:s}=a;this.props=t,this.events=r,this.document=jr(s),this.documentListeners=new mn(this.document),this.listeners=new mn(n),this.windowListeners=new mn(Ct(s)),this.initialCoordinates=(o=Oa(a))!=null?o:qt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:n}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(zt.Resize,this.handleCancel),this.windowListeners.add(zt.DragStart,Ki),this.windowListeners.add(zt.VisibilityChange,this.handleCancel),this.windowListeners.add(zt.ContextMenu,Ki),this.documentListeners.add(zt.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(qi(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Xi(r)){this.handlePending(r);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,r){const{active:n,onPending:o}=this.props;o(n,t,this.initialCoordinates,r)}handleStart(){const{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=!0,this.documentListeners.add(zt.Click,Xh,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(zt.SelectionChange,this.removeTextSelection),r(t))}handleMove(t){var r;const{activated:n,initialCoordinates:o,props:a}=this,{onMove:s,options:{activationConstraint:l}}=a;if(!o)return;const f=(r=Oa(t))!=null?r:qt,h=hn(o,f);if(!n&&l){if(Xi(l)){if(l.tolerance!=null&&Pa(h,l.tolerance))return this.handleCancel();if(Pa(h,l.distance))return this.handleStart()}if(qi(l)&&Pa(h,l.tolerance))return this.handleCancel();this.handlePending(l,h);return}t.cancelable&&t.preventDefault(),s(f)}handleEnd(){const{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleCancel(){const{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r()}handleKeydown(t){t.code===Ue.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Zh={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Fa extends $a{constructor(t){const{event:r}=t,n=jr(r.target);super(t,Zh,n)}}Fa.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!r.isPrimary||r.button!==0?!1:(n?.({event:r}),!0)}}];const Qh={move:{name:"mousemove"},end:{name:"mouseup"}};var Ua;(function(e){e[e.RightClick=2]="RightClick"})(Ua||(Ua={}));class Jh extends $a{constructor(t){super(t,Qh,jr(t.event.target))}}Jh.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Ua.RightClick?!1:(n?.({event:r}),!0)}}];const za={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Rh extends $a{constructor(t){super(t,za)}static setup(){return window.addEventListener(za.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(za.move.name,t)};function t(){}}}Rh.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;const{touches:o}=r;return o.length>1?!1:(n?.({event:r}),!0)}}];var bn;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(bn||(bn={}));var to;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(to||(to={}));function e0(e){let{acceleration:t,activator:r=bn.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:s=5,order:l=to.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:c,delta:i,threshold:u}=e;const g=r0({delta:i,disabled:!a}),[p,m]=fh(),x=C.useRef({x:0,y:0}),k=C.useRef({x:0,y:0}),M=C.useMemo(()=>{switch(r){case bn.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case bn.DraggableRect:return o}},[r,o,f]),v=C.useRef(null),T=C.useCallback(()=>{const S=v.current;if(!S)return;const N=x.current.x*k.current.x,w=x.current.y*k.current.y;S.scrollBy(N,w)},[]),I=C.useMemo(()=>l===to.TreeOrder?[...h].reverse():h,[l,h]);C.useEffect(()=>{if(!a||!h.length||!M){m();return}for(const S of I){if(n?.(S)===!1)continue;const N=h.indexOf(S),w=c[N];if(!w)continue;const{direction:y,speed:E}=Gh(S,w,M,t,u);for(const O of["x","y"])g[O][y[O]]||(E[O]=0,y[O]=0);if(E.x>0||E.y>0){m(),v.current=S,p(T,s),x.current=E,k.current=y;return}}x.current={x:0,y:0},k.current={x:0,y:0},m()},[t,T,n,m,a,s,JSON.stringify(M),JSON.stringify(g),p,h,I,c,JSON.stringify(u)])}const t0={x:{[ut.Backward]:!1,[ut.Forward]:!1},y:{[ut.Backward]:!1,[ut.Forward]:!1}};function r0(e){let{delta:t,disabled:r}=e;const n=Ta(t);return fn(o=>{if(r||!n||!o)return t0;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[ut.Backward]:o.x[ut.Backward]||a.x===-1,[ut.Forward]:o.x[ut.Forward]||a.x===1},y:{[ut.Backward]:o.y[ut.Backward]||a.y===-1,[ut.Forward]:o.y[ut.Forward]||a.y===1}}},[r,t,n])}function n0(e,t){const r=t!=null?e.get(t):void 0,n=r?r.node.current:null;return fn(o=>{var a;return t==null?null:(a=n??o)!=null?a:null},[n,t])}function o0(e,t){return C.useMemo(()=>e.reduce((r,n)=>{const{sensor:o}=n,a=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,n)}));return[...r,...a]},[]),[e,t])}var yn;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(yn||(yn={}));var Ha;(function(e){e.Optimized="optimized"})(Ha||(Ha={}));const Zi=new Map;function a0(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,s]=C.useState(null),{frequency:l,measure:f,strategy:h}=o,c=C.useRef(e),i=x(),u=un(i),g=C.useCallback(function(k){k===void 0&&(k=[]),!u.current&&s(M=>M===null?k:M.concat(k.filter(v=>!M.includes(v))))},[u]),p=C.useRef(null),m=fn(k=>{if(i&&!r)return Zi;if(!k||k===Zi||c.current!==e||a!=null){const M=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){M.set(v.id,v.rect.current);continue}const T=v.node.current,I=T?new Da(f(T),T):null;v.rect.current=I,I&&M.set(v.id,I)}return M}return k},[e,a,r,i,f]);return C.useEffect(()=>{c.current=e},[e]),C.useEffect(()=>{i||g()},[r,i]),C.useEffect(()=>{a&&a.length>0&&s(null)},[JSON.stringify(a)]),C.useEffect(()=>{i||typeof l!="number"||p.current!==null||(p.current=setTimeout(()=>{g(),p.current=null},l))},[l,i,g,...n]),{droppableRects:m,measureDroppableContainers:g,measuringScheduled:a!=null};function x(){switch(h){case yn.Always:return!1;case yn.BeforeDragging:return r;default:return!r}}}function Qi(e,t){return fn(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function s0(e,t){return Qi(e,t)}function l0(e){let{callback:t,disabled:r}=e;const n=Ea(t),o=C.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:a}=window;return new a(n)},[n,r]);return C.useEffect(()=>()=>o?.disconnect(),[o]),o}function ro(e){let{callback:t,disabled:r}=e;const n=Ea(t),o=C.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:a}=window;return new a(n)},[r]);return C.useEffect(()=>()=>o?.disconnect(),[o]),o}function i0(e){return new Da(Wr(e),e)}function Ji(e,t,r){t===void 0&&(t=i0);const[n,o]=C.useState(null);function a(){o(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??r)!=null?h:null}const c=t(e);return JSON.stringify(f)===JSON.stringify(c)?f:c})}const s=l0({callback(f){if(e)for(const h of f){const{type:c,target:i}=h;if(c==="childList"&&i instanceof HTMLElement&&i.contains(e)){a();break}}}}),l=ro({callback:a});return Jt(()=>{a(),e?(l?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),s?.disconnect())},[e]),n}function c0(e){const t=Qi(e);return Ui(e,t)}const Ri=[];function d0(e){const t=C.useRef(e),r=fn(n=>e?n&&n!==Ri&&e&&t.current&&e.parentNode===t.current.parentNode?n:eo(e):Ri,[e]);return C.useEffect(()=>{t.current=e},[e]),r}function u0(e){const[t,r]=C.useState(null),n=C.useRef(e),o=C.useCallback(a=>{const s=Ma(a.target);s&&r(l=>l?(l.set(s,Ia(s)),new Map(l)):null)},[]);return C.useEffect(()=>{const a=n.current;if(e!==a){s(a);const l=e.map(f=>{const h=Ma(f);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,Ia(h)]):null}).filter(f=>f!=null);r(l.length?new Map(l):null),n.current=e}return()=>{s(e),s(a)};function s(l){l.forEach(f=>{const h=Ma(f);h?.removeEventListener("scroll",o)})}},[o,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Br(a,s),qt):Vi(e):qt,[e,t])}function ec(e,t){t===void 0&&(t=[]);const r=C.useRef(null);return C.useEffect(()=>{r.current=null},t),C.useEffect(()=>{const n=e!==qt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?hn(e,r.current):qt}function f0(e){C.useEffect(()=>{if(!Qn)return;const t=e.map(r=>{let{sensor:n}=r;return n.setup==null?void 0:n.setup()});return()=>{for(const r of t)r?.()}},e.map(t=>{let{sensor:r}=t;return r}))}function g0(e,t){return C.useMemo(()=>e.reduce((r,n)=>{let{eventName:o,handler:a}=n;return r[o]=s=>{a(s,t)},r},{}),[e,t])}function tc(e){return C.useMemo(()=>e?Fh(e):null,[e])}const rc=[];function h0(e,t){t===void 0&&(t=Wr);const[r]=e,n=tc(r?Ct(r):null),[o,a]=C.useState(rc);function s(){a(()=>e.length?e.map(f=>Bi(f)?n:new Da(t(f),f)):rc)}const l=ro({callback:s});return Jt(()=>{l?.disconnect(),s(),e.forEach(f=>l?.observe(f))},[e]),o}function p0(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return dn(t)?t:e}function m0(e){let{measure:t}=e;const[r,n]=C.useState(null),o=C.useCallback(h=>{for(const{target:c}of h)if(dn(c)){n(i=>{const u=t(c);return i?{...i,width:u.width,height:u.height}:u});break}},[t]),a=ro({callback:o}),s=C.useCallback(h=>{const c=p0(h);a?.disconnect(),c&&a?.observe(c),n(c?t(c):null)},[t,a]),[l,f]=Jn(s);return C.useMemo(()=>({nodeRef:l,rect:r,setRef:f}),[r,l,f])}const b0=[{sensor:Fa,options:{}},{sensor:La,options:{}}],y0={current:{}},no={draggable:{measure:zi},droppable:{measure:zi,strategy:yn.WhileDragging,frequency:Ha.Optimized},dragOverlay:{measure:Wr}};class vn extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return!r})}getNodeFor(t){var r,n;return(r=(n=this.get(t))==null?void 0:n.node.current)!=null?r:void 0}}const v0={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new vn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Rn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:no,measureDroppableContainers:Rn,windowRect:null,measuringScheduled:!1},w0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Rn,draggableNodes:new Map,over:null,measureDroppableContainers:Rn},oo=C.createContext(w0),nc=C.createContext(v0);function x0(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vn}}}function k0(e,t){switch(t.type){case st.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case st.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case st.DragEnd:case st.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case st.RegisterDroppable:{const{element:r}=t,{id:n}=r,o=new vn(e.droppable.containers);return o.set(n,r),{...e,droppable:{...e.droppable,containers:o}}}case st.SetDroppableDisabled:{const{id:r,key:n,disabled:o}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;const s=new vn(e.droppable.containers);return s.set(r,{...a,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case st.UnregisterDroppable:{const{id:r,key:n}=t,o=e.droppable.containers.get(r);if(!o||n!==o.key)return e;const a=new vn(e.droppable.containers);return a.delete(r),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function C0(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=C.useContext(oo),a=Ta(n),s=Ta(r?.id);return C.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!Na(a)||document.activeElement===a.target)return;const l=o.get(s);if(!l)return;const{activatorNode:f,node:h}=l;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const c of[f.current,h.current]){if(!c)continue;const i=ph(c);if(i){i.focus();break}}})}},[n,t,o,s,a]),null}function _0(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function S0(e){return C.useMemo(()=>({draggable:{...no.draggable,...e?.draggable},droppable:{...no.droppable,...e?.droppable},dragOverlay:{...no.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function E0(e){let{activeNode:t,measure:r,initialRect:n,config:o=!0}=e;const a=C.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;Jt(()=>{if(!s&&!l||!t){a.current=!1;return}if(a.current||!n)return;const h=t?.node.current;if(!h||h.isConnected===!1)return;const c=r(h),i=Ui(c,n);if(s||(i.x=0),l||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){const u=Hi(h);u&&u.scrollBy({top:i.y,left:i.x})}},[t,s,l,n,r])}const oc=C.createContext({...qt,scaleX:1,scaleY:1});var ar;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ar||(ar={}));const T0=C.memo(function(t){var r,n,o,a;let{id:s,accessibility:l,autoScroll:f=!0,children:h,sensors:c=b0,collisionDetection:i=Oh,measuring:u,modifiers:g,...p}=t;const m=C.useReducer(k0,void 0,x0),[x,k]=m,[M,v]=xh(),[T,I]=C.useState(ar.Uninitialized),S=T===ar.Initialized,{draggable:{active:N,nodes:w,translate:y},droppable:{containers:E}}=x,O=N!=null?w.get(N):null,$=C.useRef({initial:null,translated:null}),P=C.useMemo(()=>{var _e;return N!=null?{id:N,data:(_e=O?.data)!=null?_e:y0,rect:$}:null},[N,O]),L=C.useRef(null),[U,_]=C.useState(null),[b,z]=C.useState(null),F=un(p,Object.values(p)),G=gn("DndDescribedBy",s),X=C.useMemo(()=>E.getEnabled(),[E]),B=S0(u),{droppableRects:Y,measureDroppableContainers:H,measuringScheduled:W}=a0(X,{dragging:S,dependencies:[y.x,y.y],config:B.droppable}),Q=n0(w,N),be=C.useMemo(()=>b?Oa(b):null,[b]),se=je(),pe=s0(Q,B.draggable.measure);E0({activeNode:N!=null?w.get(N):null,config:se.layoutShiftCompensation,initialRect:pe,measure:B.draggable.measure});const ne=Ji(Q,B.draggable.measure,pe),Ae=Ji(Q?Q.parentElement:null),ve=C.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:w,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),We=E.getNodeFor((r=ve.current.over)==null?void 0:r.id),me=m0({measure:B.dragOverlay.measure}),Te=(n=me.nodeRef.current)!=null?n:Q,ge=S?(o=me.rect)!=null?o:ne:null,Oe=!!(me.nodeRef.current&&me.rect),we=c0(Oe?null:ne),$e=tc(Te?Ct(Te):null),ze=d0(S?We??Q:null),K=h0(ze),oe=_0(g,{transform:{x:y.x-we.x,y:y.y-we.y,scaleX:1,scaleY:1},activatorEvent:b,active:P,activeNodeRect:ne,containerNodeRect:Ae,draggingNodeRect:ge,over:ve.current.over,overlayNodeRect:me.rect,scrollableAncestors:ze,scrollableAncestorRects:K,windowRect:$e}),ae=be?Br(be,y):null,ce=u0(ze),ke=ec(ce),Ee=ec(ce,[ne]),Be=Br(oe,ke),Me=ge?Dh(ge,oe):null,Ke=P&&Me?i({active:P,collisionRect:Me,droppableRects:Y,droppableContainers:X,pointerCoordinates:ae}):null,Pe=$i(Ke,"id"),[q,le]=C.useState(null),de=Oe?oe:Br(oe,Ee),ue=Mh(de,(a=q?.rect)!=null?a:null,ne),ie=C.useRef(null),Fe=C.useCallback((_e,xe)=>{let{sensor:De,options:Ye}=xe;if(L.current==null)return;const rt=w.get(L.current);if(!rt)return;const qe=_e.nativeEvent,Je=new De({active:L.current,activeNode:rt,event:qe,options:Ye,context:ve,onAbort(Ve){if(!w.get(Ve))return;const{onDragAbort:St}=F.current,Pt={id:Ve};St?.(Pt),M({type:"onDragAbort",event:Pt})},onPending(Ve,bt,St,Pt){if(!w.get(Ve))return;const{onDragPending:lr}=F.current,Ht={id:Ve,constraint:bt,initialCoordinates:St,offset:Pt};lr?.(Ht),M({type:"onDragPending",event:Ht})},onStart(Ve){const bt=L.current;if(bt==null)return;const St=w.get(bt);if(!St)return;const{onDragStart:Pt}=F.current,_r={activatorEvent:qe,active:{id:bt,data:St.data,rect:$}};tr.unstable_batchedUpdates(()=>{Pt?.(_r),I(ar.Initializing),k({type:st.DragStart,initialCoordinates:Ve,active:bt}),M({type:"onDragStart",event:_r}),_(ie.current),z(qe)})},onMove(Ve){k({type:st.DragMove,coordinates:Ve})},onEnd:Zt(st.DragEnd),onCancel:Zt(st.DragCancel)});ie.current=Je;function Zt(Ve){return async function(){const{active:St,collisions:Pt,over:_r,scrollAdjustedTranslate:lr}=ve.current;let Ht=null;if(St&&lr){const{cancelDrop:ir}=F.current;Ht={activatorEvent:qe,active:St,collisions:Pt,delta:lr,over:_r},Ve===st.DragEnd&&typeof ir=="function"&&await Promise.resolve(ir(Ht))&&(Ve=st.DragCancel)}L.current=null,tr.unstable_batchedUpdates(()=>{k({type:Ve}),I(ar.Uninitialized),le(null),_(null),z(null),ie.current=null;const ir=Ve===st.DragEnd?"onDragEnd":"onDragCancel";if(Ht){const Sr=F.current[ir];Sr?.(Ht),M({type:ir,event:Ht})}})}}},[w]),Ce=C.useCallback((_e,xe)=>(De,Ye)=>{const rt=De.nativeEvent,qe=w.get(Ye);if(L.current!==null||!qe||rt.dndKit||rt.defaultPrevented)return;const Je={active:qe};_e(De,xe.options,Je)===!0&&(rt.dndKit={capturedBy:xe.sensor},L.current=Ye,Fe(De,xe))},[w,Fe]),Ie=o0(c,Ce);f0(c),Jt(()=>{ne&&T===ar.Initializing&&I(ar.Initialized)},[ne,T]),C.useEffect(()=>{const{onDragMove:_e}=F.current,{active:xe,activatorEvent:De,collisions:Ye,over:rt}=ve.current;if(!xe||!De)return;const qe={active:xe,activatorEvent:De,collisions:Ye,delta:{x:Be.x,y:Be.y},over:rt};tr.unstable_batchedUpdates(()=>{_e?.(qe),M({type:"onDragMove",event:qe})})},[Be.x,Be.y]),C.useEffect(()=>{const{active:_e,activatorEvent:xe,collisions:De,droppableContainers:Ye,scrollAdjustedTranslate:rt}=ve.current;if(!_e||L.current==null||!xe||!rt)return;const{onDragOver:qe}=F.current,Je=Ye.get(Pe),Zt=Je&&Je.rect.current?{id:Je.id,rect:Je.rect.current,data:Je.data,disabled:Je.disabled}:null,Ve={active:_e,activatorEvent:xe,collisions:De,delta:{x:rt.x,y:rt.y},over:Zt};tr.unstable_batchedUpdates(()=>{le(Zt),qe?.(Ve),M({type:"onDragOver",event:Ve})})},[Pe]),Jt(()=>{ve.current={activatorEvent:b,active:P,activeNode:Q,collisionRect:Me,collisions:Ke,droppableRects:Y,draggableNodes:w,draggingNode:Te,draggingNodeRect:ge,droppableContainers:E,over:q,scrollableAncestors:ze,scrollAdjustedTranslate:Be},$.current={initial:ge,translated:Me}},[P,Q,Ke,Me,w,Te,ge,Y,E,q,ze,Be]),e0({...se,delta:y,draggingRect:Me,pointerCoordinates:ae,scrollableAncestors:ze,scrollableAncestorRects:K});const Ne=C.useMemo(()=>({active:P,activeNode:Q,activeNodeRect:ne,activatorEvent:b,collisions:Ke,containerNodeRect:Ae,dragOverlay:me,draggableNodes:w,droppableContainers:E,droppableRects:Y,over:q,measureDroppableContainers:H,scrollableAncestors:ze,scrollableAncestorRects:K,measuringConfiguration:B,measuringScheduled:W,windowRect:$e}),[P,Q,ne,b,Ke,Ae,me,w,E,Y,q,H,ze,K,B,W,$e]),He=C.useMemo(()=>({activatorEvent:b,activators:Ie,active:P,activeNodeRect:ne,ariaDescribedById:{draggable:G},dispatch:k,draggableNodes:w,over:q,measureDroppableContainers:H}),[b,Ie,P,ne,k,G,w,q,H]);return C.createElement(Mi.Provider,{value:v},C.createElement(oo.Provider,{value:He},C.createElement(nc.Provider,{value:Ne},C.createElement(oc.Provider,{value:ue},h)),C.createElement(C0,{disabled:l?.restoreFocus===!1})),C.createElement(_h,{...l,hiddenTextDescribedById:G}));function je(){const _e=U?.autoScrollEnabled===!1,xe=typeof f=="object"?f.enabled===!1:f===!1,De=S&&!_e&&!xe;return typeof f=="object"?{...f,enabled:De}:{enabled:De}}}),A0=C.createContext(null),ac="button",N0="Draggable";function O0(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=gn(N0),{activators:s,activatorEvent:l,active:f,activeNodeRect:h,ariaDescribedById:c,draggableNodes:i,over:u}=C.useContext(oo),{role:g=ac,roleDescription:p="draggable",tabIndex:m=0}=o??{},x=f?.id===t,k=C.useContext(x?oc:A0),[M,v]=Jn(),[T,I]=Jn(),S=g0(s,t),N=un(r);Jt(()=>(i.set(t,{id:t,key:a,node:M,activatorNode:T,data:N}),()=>{const y=i.get(t);y&&y.key===a&&i.delete(t)}),[i,t]);const w=C.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":n,"aria-pressed":x&&g===ac?!0:void 0,"aria-roledescription":p,"aria-describedby":c.draggable}),[n,g,m,x,p,c.draggable]);return{active:f,activatorEvent:l,activeNodeRect:h,attributes:w,isDragging:x,listeners:n?void 0:S,node:M,over:u,setNodeRef:v,setActivatorNodeRef:I,transform:k}}function M0(){return C.useContext(nc)}const I0="Droppable",D0={timeout:25};function P0(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=gn(I0),{active:s,dispatch:l,over:f,measureDroppableContainers:h}=C.useContext(oo),c=C.useRef({disabled:r}),i=C.useRef(!1),u=C.useRef(null),g=C.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:x}={...D0,...o},k=un(m??n),M=C.useCallback(()=>{if(!i.current){i.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{h(Array.isArray(k.current)?k.current:[k.current]),g.current=null},x)},[x]),v=ro({callback:M,disabled:p||!s}),T=C.useCallback((w,y)=>{v&&(y&&(v.unobserve(y),i.current=!1),w&&v.observe(w))},[v]),[I,S]=Jn(T),N=un(t);return C.useEffect(()=>{!v||!I.current||(v.disconnect(),i.current=!1,v.observe(I.current))},[I,v]),C.useEffect(()=>(l({type:st.RegisterDroppable,element:{id:n,key:a,disabled:r,node:I,rect:u,data:N}}),()=>l({type:st.UnregisterDroppable,key:a,id:n})),[n]),C.useEffect(()=>{r!==c.current.disabled&&(l({type:st.SetDroppableDisabled,id:n,key:a,disabled:r}),c.current.disabled=r)},[n,a,r,l]),{active:s,rect:u,isOver:f?.id===n,node:I,over:f,setNodeRef:S}}function Ga(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function L0(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function ao(e){return e!==null&&e>=0}function $0(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function F0(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const so=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=Ga(t,n,r),s=t[o],l=a[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},sc="Sortable",lc=C.createContext({activeIndex:-1,containerId:sc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:so,disabled:{draggable:!1,droppable:!1}});function ic(e){let{children:t,id:r,items:n,strategy:o=so,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:f,over:h,measureDroppableContainers:c}=M0(),i=gn(sc,r),u=l.rect!==null,g=C.useMemo(()=>n.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),p=s!=null,m=s?g.indexOf(s.id):-1,x=h?g.indexOf(h.id):-1,k=C.useRef(g),M=!$0(g,k.current),v=x!==-1&&m===-1||M,T=F0(a);Jt(()=>{M&&p&&c(g)},[M,g,p,c]),C.useEffect(()=>{k.current=g},[g]);const I=C.useMemo(()=>({activeIndex:m,containerId:i,disabled:T,disableTransforms:v,items:g,overIndex:x,useDragOverlay:u,sortedRects:L0(g,f),strategy:o}),[m,i,T.draggable,T.droppable,v,g,x,f,u,o]);return C.createElement(lc.Provider,{value:I},t)}const cc=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Ga(r,n,o).indexOf(t)},dc=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:o,items:a,newIndex:s,previousItems:l,previousContainerId:f,transition:h}=e;return!h||!n||l!==a&&o===s?!1:r?!0:s!==o&&t===f},U0={duration:200,easing:"ease"},uc="transform",z0=pn.Transition.toString({property:uc,duration:0,easing:"linear"}),H0={roleDescription:"sortable"};function G0(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,s]=C.useState(null),l=C.useRef(r);return Jt(()=>{if(!t&&r!==l.current&&n.current){const f=o.current;if(f){const h=Wr(n.current,{ignoreTransform:!0}),c={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(c.x||c.y)&&s(c)}}r!==l.current&&(l.current=r)},[t,r,n,o]),C.useEffect(()=>{a&&s(null)},[a]),a}function fc(e){let{animateLayoutChanges:t=dc,attributes:r,disabled:n,data:o,getNewIndex:a=cc,id:s,strategy:l,resizeObserverConfig:f,transition:h=U0}=e;const{items:c,containerId:i,activeIndex:u,disabled:g,disableTransforms:p,sortedRects:m,overIndex:x,useDragOverlay:k,strategy:M}=C.useContext(lc),v=j0(n,g),T=c.indexOf(s),I=C.useMemo(()=>({sortable:{containerId:i,index:T,items:c},...o}),[i,o,T,c]),S=C.useMemo(()=>c.slice(c.indexOf(s)),[c,s]),{rect:N,node:w,isOver:y,setNodeRef:E}=P0({id:s,data:I,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...f}}),{active:O,activatorEvent:$,activeNodeRect:P,attributes:L,setNodeRef:U,listeners:_,isDragging:b,over:z,setActivatorNodeRef:F,transform:G}=O0({id:s,data:I,attributes:{...H0,...r},disabled:v.draggable}),X=uh(E,U),B=!!O,Y=B&&!p&&ao(u)&&ao(x),H=!k&&b,W=H&&Y?G:null,be=Y?W??(l??M)({rects:m,activeNodeRect:P,activeIndex:u,overIndex:x,index:T}):null,se=ao(u)&&ao(x)?a({id:s,items:c,activeIndex:u,overIndex:x}):T,pe=O?.id,ne=C.useRef({activeId:pe,items:c,newIndex:se,containerId:i}),Ae=c!==ne.current.items,ve=t({active:O,containerId:i,isDragging:b,isSorting:B,id:s,index:T,items:c,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:h,wasDragging:ne.current.activeId!=null}),We=G0({disabled:!ve,index:T,node:w,rect:N});return C.useEffect(()=>{B&&ne.current.newIndex!==se&&(ne.current.newIndex=se),i!==ne.current.containerId&&(ne.current.containerId=i),c!==ne.current.items&&(ne.current.items=c)},[B,se,i,c]),C.useEffect(()=>{if(pe===ne.current.activeId)return;if(pe!=null&&ne.current.activeId==null){ne.current.activeId=pe;return}const Te=setTimeout(()=>{ne.current.activeId=pe},50);return()=>clearTimeout(Te)},[pe]),{active:O,activeIndex:u,attributes:L,data:I,rect:N,index:T,newIndex:se,items:c,isOver:y,isSorting:B,isDragging:b,listeners:_,node:w,overIndex:x,over:z,setNodeRef:X,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:U,transform:We??be,transition:me()};function me(){if(We||Ae&&ne.current.newIndex===T)return z0;if(!(H&&!Na($)||!h)&&(B||ve))return pn.Transition.toString({...h,property:uc})}}function j0(e,t){var r,n;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(n=e?.droppable)!=null?n:t.droppable}}function wn(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const B0=[Ue.Down,Ue.Right,Ue.Up,Ue.Left],gc=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(B0.includes(e.code)){if(e.preventDefault(),!r||!n)return;const f=[];a.getEnabled().forEach(i=>{if(!i||i!=null&&i.disabled)return;const u=o.get(i.id);if(u)switch(e.code){case Ue.Down:n.top<u.top&&f.push(i);break;case Ue.Up:n.top>u.top&&f.push(i);break;case Ue.Left:n.left>u.left&&f.push(i);break;case Ue.Right:n.left<u.left&&f.push(i);break}});const h=Ah({collisionRect:n,droppableRects:o,droppableContainers:f});let c=$i(h,"id");if(c===s?.id&&h.length>1&&(c=h[1].id),c!=null){const i=a.get(r.id),u=a.get(c),g=u?o.get(u.id):null,p=u?.node.current;if(p&&g&&i&&u){const x=eo(p).some((S,N)=>l[N]!==S),k=hc(i,u),M=W0(i,u),v=x||!k?{x:0,y:0}:{x:M?n.width-g.width:0,y:M?n.height-g.height:0},T={x:g.left,y:g.top};return v.x&&v.y?T:hn(T,v)}}}};function hc(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function W0(e,t){return!wn(e)||!wn(t)||!hc(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const V0=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:ic,arrayMove:Ga,defaultAnimateLayoutChanges:dc,defaultNewIndexGetter:cc,hasSortableData:wn,rectSortingStrategy:so,sortableKeyboardCoordinates:gc,useSortable:fc},Symbol.toStringTag,{value:"Module"})),K0=window.G7Core,pc=({file:e,onRemove:t,onRetry:r,onImageClick:n,onDownload:o,isPrimary:a,onPrimaryClick:s})=>{const{attributes:l,listeners:f,setNodeRef:h,transform:c,transition:i,isDragging:u}=fc({id:"hash"in e?e.hash:e.id}),g={transform:pn.Transform.toString(c),transition:i,opacity:u?.5:1},p="status"in e&&e.status!==void 0,m=p?e.status:"done",x=m==="uploading",k=m==="compressing",M=m==="error",v=p?e.progress:100,T=p?e.preview:void 0,I=p?e.mime_type?.startsWith("image/")??!1:e.is_image,[S,N]=C.useState(void 0),w=!p&&I?e.download_url:void 0;C.useEffect(()=>{if(!w){N(void 0);return}if(ua(w)){N(w);return}let E=!0,O;return(async()=>{try{const P=await K0.api.get(w,{responseType:"blob",headers:zn()});E&&P&&(O=URL.createObjectURL(P),N(O))}catch(P){console.error("Failed to load authenticated image:",P)}})(),()=>{E=!1,O&&URL.revokeObjectURL(O)}},[w]);const y=S;return d.jsxs(j,{ref:h,style:g,className:"relative group bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsxs(j,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${I||!p?"cursor-pointer":""}`,onClick:()=>{x||k||(I&&n?n():!p&&o&&o())},children:[T||y?d.jsx(jt,{src:T||y,alt:e.original_filename,className:"w-full h-full object-cover"}):d.jsx(It,{className:`fa-solid ${Si(e.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(x||k)&&d.jsxs(j,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[d.jsx(j,{className:"w-3/4 h-2 bg-gray-700 dark:bg-gray-600 rounded-full overflow-hidden",children:d.jsx(j,{className:"h-full bg-blue-500 dark:bg-blue-400 transition-all",style:{width:`${v}%`}})}),d.jsxs(te,{className:"text-white text-xs mt-1",children:[v,"%"]})]}),M&&d.jsx(j,{className:"absolute inset-0 bg-red-500/50 dark:bg-red-600/50 flex items-center justify-center",children:d.jsx(It,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),s&&d.jsx(R,{type:"button",onClick:E=>{E.stopPropagation(),s()},className:`absolute top-1.5 left-1.5 z-10 p-1 rounded-full transition-colors ${a?"bg-yellow-500 text-white":"bg-gray-800/50 text-gray-300 hover:bg-yellow-500 hover:text-white opacity-0 group-hover:opacity-100"}`,title:at(a?"attachment.primary_image":"attachment.set_as_primary"),children:d.jsx(It,{className:"fa-solid fa-star text-xs"})}),d.jsxs(j,{className:"absolute inset-0 bg-black/0 group-hover:bg-black/40 transition-colors flex items-start justify-end p-1 gap-1 opacity-0 group-hover:opacity-100",children:[d.jsx(R,{type:"button",...l,...f,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-gray-600 dark:text-gray-300 hover:bg-white cursor-grab active:cursor-grabbing",title:at("attachment.drag_to_reorder"),onClick:E=>E.stopPropagation(),children:d.jsx(It,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&o&&d.jsx(R,{type:"button",onClick:E=>{E.stopPropagation(),o()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:at("common.download"),children:d.jsx(It,{className:"fa-solid fa-download text-sm"})}),M&&r&&d.jsx(R,{type:"button",onClick:E=>{E.stopPropagation(),r()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:at("common.retry"),children:d.jsx(It,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),d.jsx(R,{type:"button",onClick:E=>{E.stopPropagation(),t()},disabled:x||k,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:at("common.delete"),children:d.jsx(It,{className:"fa-solid fa-times text-sm"})})]})]}),d.jsxs(j,{className:`p-2 ${!p&&o?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&o&&o()},children:[d.jsx(Gt,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:e.original_filename,children:e.original_filename}),d.jsx(Gt,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.size_formatted})]})]})},mc=({allItems:e,canAddMore:t,totalCount:r,maxFiles:n,maxSize:o,accept:a,onRemove:s,onRetry:l,onImageClick:f,onDownload:h,onDragEnd:c,onAddClick:i,enablePrimarySelection:u,primaryFileId:g,onPrimaryChange:p})=>{const m=Sh(Ii(Fa,{activationConstraint:{distance:8}}),Ii(La,{coordinateGetter:gc}));return d.jsxs(j,{className:"p-3",children:[d.jsx(T0,{sensors:m,collisionDetection:Th,onDragEnd:c,children:d.jsx(ic,{items:e.map(x=>"hash"in x?x.hash:x.id),strategy:so,children:d.jsxs(j,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[e.map(x=>{const k="hash"in x,M=k?x.is_image:x.mime_type?.startsWith("image/")??!1;return d.jsx(pc,{file:x,onRemove:()=>s(x),onRetry:"status"in x&&x.status==="error"?()=>l(x):void 0,onImageClick:M?()=>f(x):void 0,onDownload:k?()=>h(x):void 0,isPrimary:u&&k&&(x.hash||x.id)===g,onPrimaryClick:u&&k?()=>p?.(x.hash||x.id):void 0},k?x.hash:x.id)}),t&&d.jsxs(j,{className:"aspect-square flex flex-col items-center justify-center border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-lg cursor-pointer hover:border-gray-400 dark:hover:border-gray-500 hover:bg-gray-50 dark:hover:bg-gray-800/50 transition-colors",onClick:i,children:[d.jsx(It,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),d.jsx(te,{className:"text-xs text-gray-500 dark:text-gray-400",children:at("common.add")})]})]})})}),d.jsxs(j,{className:"mt-3 pt-3 border-t border-gray-200 dark:border-gray-700 flex justify-between items-center text-xs text-gray-500 dark:text-gray-400",children:[d.jsx(te,{children:at("attachment.attached_count",{count:r,max:n})}),d.jsxs(te,{children:[at("attachment.max_size",{size:o}),a&&` (${a})`]})]})]})},Y0=[],X0=[],lo=C.forwardRef(({uploadTriggerEvent:e,attachmentableType:t,attachmentableId:r,collection:n="default",maxFiles:o=10,maxSize:a=10,maxConcurrentUploads:s=3,accept:l,imageCompression:f,roleIds:h=X0,autoUpload:c=!0,onFilesChange:i,onChange:u,onUploadComplete:g,onUploadError:p,onRemove:m,onReorder:x,initialFiles:k=Y0,className:M="",confirmBeforeRemove:v=!1,confirmRemoveTitle:T,confirmRemoveMessage:I,apiEndpoints:S,uploadParams:N,enablePrimarySelection:w=!1,primaryFileId:y,onPrimaryChange:E,id:O,editorAttrs:$},P)=>{const L={upload:S?.upload??"/api/attachments",delete:S?.delete??"/api/attachments/:id",reorder:S?.reorder??"/api/attachments/reorder"},U=C.useRef(u??i);U.current=u??i;const _=C.useCallback(G=>{const X=U.current;if(!X)return;X({target:{value:G,files:G},preventDefault:()=>{},stopPropagation:()=>{}})},[]),b=Ei({attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:c,initialFiles:k,endpoints:L,onFilesChange:_,onUploadComplete:g,onUploadError:p,onRemove:m,onReorder:x,uploadTriggerEvent:e,confirmBeforeRemove:v,uploadParams:N});C.useImperativeHandle(P,()=>({uploadAll:b.handleUploadAll,clear:b.clear,getPendingFiles:b.getPendingFiles}));const z=C.useMemo(()=>b.imageFiles.map(G=>{const X=!("hash"in G),B=G,Y=G;return X?{src:B.preview||"",filename:B.original_filename,title:B.original_filename,downloadRequiresAuth:!1}:{src:b.authenticatedImageUrls.get(Y.id)||Y.download_url,downloadUrl:Y.download_url,filename:Y.original_filename,title:Y.original_filename,downloadRequiresAuth:!0}}),[b.imageFiles,b.authenticatedImageUrls]),F=C.useMemo(()=>({existingFiles:b.existingFiles,pendingFiles:b.pendingFiles,isDragOver:b.isDragOver,isDeleting:b.isDeleting,maxFiles:o,maxSize:a,accept:l,endpoints:L,confirmBeforeRemove:v,totalCount:b.totalCount,hasFiles:b.hasFiles,canAddMore:b.canAddMore,allItems:b.allItems,imageFiles:b.imageFiles,handleFiles:b.handleFiles,handleRemove:b.handleRemove,handleRetry:b.handleRetry,handleUploadAll:b.handleUploadAll,handleOpenGallery:b.handleOpenGallery,handleDownload:b.handleDownload,handleDragEnd:b.handleDragEnd,setIsDragOver:b.setIsDragOver,inputRef:b.inputRef,galleryOpen:b.galleryOpen,setGalleryOpen:b.setGalleryOpen,galleryStartIndex:b.galleryStartIndex,galleryKeyRef:b.galleryKeyRef,confirmDialogOpen:b.confirmDialogOpen,setConfirmDialogOpen:b.setConfirmDialogOpen,itemToDelete:b.itemToDelete,executeRemoveAttachment:b.executeRemoveAttachment,authenticatedImageUrls:b.authenticatedImageUrls}),[b,o,a,l,L,v]);return d.jsx(ui,{value:F,children:d.jsxs(j,{id:O,className:M,...$,children:[d.jsx(Ti,{isDragOver:b.isDragOver,canAddMore:b.canAddMore,onFiles:b.handleFiles,setIsDragOver:b.setIsDragOver,inputRef:b.inputRef,accept:l,maxFiles:o,maxSize:a,children:b.hasFiles&&d.jsx(mc,{allItems:b.allItems,canAddMore:b.canAddMore,totalCount:b.totalCount,maxFiles:o,maxSize:a,accept:l,onRemove:b.handleRemove,onRetry:b.handleRetry,onImageClick:b.handleOpenGallery,onDownload:b.handleDownload,onDragEnd:b.handleDragEnd,onAddClick:()=>b.inputRef.current?.click(),enablePrimarySelection:w,primaryFileId:y,onPrimaryChange:E})}),v&&d.jsx(wa,{isOpen:b.confirmDialogOpen,onClose:()=>{b.isDeleting||b.setConfirmDialogOpen(!1)},title:T??at("attachment.delete_confirm_title"),message:I??at("attachment.delete_confirm_message"),confirmText:at("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{b.itemToDelete&&b.executeRemoveAttachment(b.itemToDelete)},isLoading:b.isDeleting,loadingText:at("attachment.deleting")}),z.length>0&&b.galleryOpen&&d.jsx(zr,{images:z,isOpen:!0,onClose:()=>b.setGalleryOpen(!1),startIndex:b.galleryStartIndex,showDownload:!0},`gallery-${b.galleryKeyRef.current}`)]})})});lo.displayName="FileUploader";const q0=Object.freeze(Object.defineProperty({__proto__:null,FileDropZone:Ti,FileList:mc,FileUploader:lo,FileUploaderProvider:ui,SortableThumbnailItem:pc,default:lo,extractErrorMessage:_i,fileUploaderT:at,formatFileSize:Zn,getFileIcon:Si,useFileUploader:Ei,useFileUploaderContext:Rg},Symbol.toStringTag,{value:"Module"})),bc=({provider:e,className:t="w-5 h-5"})=>{switch(e){case"google":return d.jsxs("svg",{className:t,viewBox:"0 0 24 24",children:[d.jsx("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),d.jsx("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),d.jsx("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),d.jsx("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]});case"naver":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M16.273 12.845L7.376 0H0v24h7.727V11.155L16.624 24H24V0h-7.727z"})});case"kakao":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M12 3c5.799 0 10.5 3.664 10.5 8.185 0 4.52-4.701 8.184-10.5 8.184a13.5 13.5 0 0 1-1.727-.11l-4.408 2.883c-.501.265-.678.236-.472-.413l.892-3.678c-2.88-1.46-4.785-3.99-4.785-6.866C1.5 6.665 6.201 3 12 3zm5.519 8.625h-.634v2.916h-.97v-2.916h-.633v-.848h2.237v.848zm-3.294 2.916h-.97V10.77h.97v3.771zm-1.97 0h-.97v-2.77l-.658 1.53h-.629l-.665-1.53v2.77h-.97V10.77h1.13l.822 1.912.814-1.912h1.126v3.771zm-4.49 0h-.97V10.77h.97v3.771z"})});case"facebook":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})});case"apple":return d.jsx("svg",{className:t,viewBox:"0 0 24 24",children:d.jsx("path",{fill:"currentColor",d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})});default:return null}},yc=(e,t)=>window.G7Core?.t?.(e,t)??e,Z0=[{id:"google",name:"Google",color:"bg-white dark:bg-gray-800",textColor:"text-gray-700 dark:text-gray-300"},{id:"naver",name:"네이버",color:"bg-[#03C75A]",textColor:"text-white"},{id:"kakao",name:"카카오",color:"bg-[#FEE500]",textColor:"text-[#000000]/85"},{id:"facebook",name:"Facebook",color:"bg-[#1877F2]",textColor:"text-white"},{id:"apple",name:"Apple",color:"bg-black dark:bg-white",textColor:"text-white dark:text-black"}],vc=({providers:e=["google","naver","kakao"],mode:t="login",variant:r="full",className:n="",id:o,editorAttrs:a})=>{const s=h=>{const c=encodeURIComponent(window.location.href);window.location.href=`/api/auth/${h}?redirect=${c}`},l=h=>t==="register"?yc("auth.social.register_with",{provider:h}):yc("auth.social.login_with",{provider:h}),f=Z0.filter(h=>e.includes(h.id));return r==="icon"?d.jsx(j,{className:`flex justify-center gap-4 ${n}`,id:o,...a,children:f.map(h=>d.jsx(R,{onClick:()=>s(h.id),className:`w-12 h-12 flex items-center justify-center rounded-full ${h.color} ${h.textColor} border border-gray-200 dark:border-gray-700 hover:opacity-90 transition-opacity`,"aria-label":l(h.name),children:d.jsx(bc,{provider:h.id,className:"w-5 h-5"})},h.id))}):d.jsx(j,{className:`space-y-3 ${n}`,id:o,...a,children:f.map(h=>d.jsxs(R,{onClick:()=>s(h.id),className:`w-full flex items-center justify-center gap-3 px-4 py-3 rounded-lg font-medium border border-gray-200 dark:border-gray-700 ${h.color} ${h.textColor} hover:opacity-90 transition-opacity`,children:[d.jsx(bc,{provider:h.id,className:"w-5 h-5"}),d.jsx(te,{children:l(h.name)})]},h.id))})},Q0=Object.freeze(Object.defineProperty({__proto__:null,default:vc},Symbol.toStringTag,{value:"Module"})),J0=(e,t)=>window.G7Core?.t?.(e,t)??e,R0={success:nt.CheckCircle,error:nt.XCircle,warning:nt.ExclamationTriangle,info:nt.InfoCircle},wc={success:{bg:"bg-green-50 dark:bg-green-900/20 border-green-200 dark:border-green-800",text:"text-green-800 dark:text-green-300"},error:{bg:"bg-red-50 dark:bg-red-900/20 border-red-200 dark:border-red-800",text:"text-red-800 dark:text-red-300"},warning:{bg:"bg-yellow-50 dark:bg-yellow-900/20 border-yellow-200 dark:border-yellow-800",text:"text-yellow-800 dark:text-yellow-300"},info:{bg:"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800",text:"text-blue-800 dark:text-blue-300"}},ep={"top-left":"top-4 left-4","top-center":"top-4 left-1/2 -translate-x-1/2","top-right":"top-4 right-4","bottom-left":"bottom-4 left-4","bottom-center":"bottom-4 left-1/2 -translate-x-1/2","bottom-right":"bottom-4 right-4"},ja=({toasts:e,position:t="bottom-center",duration:r=3e3,onRemove:n})=>{const[o,a]=C.useState(new Map),s=C.useCallback(l=>{a(f=>{const h=new Map(f);return h.set(l,!1),h}),setTimeout(()=>{if(n)n(l);else{const f=window.G7Core;f?.state?.update&&f.state.update(h=>({toasts:(Array.isArray(h.toasts)?h.toasts:[]).filter(i=>i.id!==l)}))}},300)},[n]);return C.useEffect(()=>{!e||e.length===0||e.forEach(l=>{if(o.has(l.id))return;a(h=>{const c=new Map(h);return c.set(l.id,!0),c});const f=l.duration||r;f>0&&setTimeout(()=>{s(l.id)},f)})},[e,r,s,o]),!e||e.length===0?null:d.jsx(j,{className:`fixed z-[9999] flex flex-col gap-2 ${ep[t]}`,"aria-live":"polite","aria-atomic":"true",children:e.map(l=>d.jsx(tp,{toast:l,position:t,isVisible:o.get(l.id)??!0,onClose:()=>s(l.id)},l.id))})},tp=({toast:e,position:t,isVisible:r,onClose:n})=>{const o=wc[e.type]||wc.info,a=e.icon?e.icon:R0[e.type],s=t.startsWith("bottom")?"translate-y-2":"-translate-y-2";return d.jsxs(j,{className:`
|
||
flex items-center gap-3 p-4 rounded-lg border shadow-lg
|
||
min-w-[300px] max-w-md
|
||
transition-all duration-300
|
||
${o.bg}
|
||
${r?"opacity-100 translate-y-0":`opacity-0 ${s}`}
|
||
`,role:"alert",children:[d.jsx(fe,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),d.jsx(te,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),d.jsx(R,{onClick:n,className:`flex-shrink-0 p-1 rounded hover:bg-black/10 dark:hover:bg-white/10 ${o.text} focus:outline-none`,"aria-label":J0("common.close"),children:d.jsx(fe,{name:nt.Times,className:"w-4 h-4"})})]})},rp=Object.freeze(Object.defineProperty({__proto__:null,Toast:ja,default:ja},Symbol.toStringTag,{value:"Module"})),np=window.G7Core?.createLogger?.("Comp:PageTransition")??{log:(...e)=>console.log("[Comp:PageTransition]",...e),warn:(...e)=>console.warn("[Comp:PageTransition]",...e),error:(...e)=>console.error("[Comp:PageTransition]",...e)},Ba=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){np.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?d.jsxs(j,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[d.jsx(j,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:d.jsx(j,{className:"h-full bg-blue-700 animate-[loading_1.5s_ease-in-out_infinite]",style:{width:"30%",animation:"loading 1.5s ease-in-out infinite"}})}),d.jsx("style",{children:`
|
||
@keyframes loading {
|
||
0% {
|
||
transform: translateX(-100%);
|
||
}
|
||
50% {
|
||
transform: translateX(300%);
|
||
}
|
||
100% {
|
||
transform: translateX(-100%);
|
||
}
|
||
}
|
||
`})]}):null},op=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Ba,default:Ba},Symbol.toStringTag,{value:"Module"})),xc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},Wa=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){xc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{xc.log("isPending changed:",s),n(s)})},[]),r?d.jsx(j,{className:`fixed inset-0 z-40 bg-white/30 dark:bg-gray-900/30 backdrop-blur-sm transition-opacity duration-150 pointer-events-none ${e}`,style:t,role:"status","aria-label":"페이지 전환 중","data-testid":"page-transition-blur"}):null},ap=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:Wa,default:Wa},Symbol.toStringTag,{value:"Module"})),kc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Cc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),sp=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),lp=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),ip=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),cp=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),_c={DataGrid:(e,t)=>d.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>d.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:d.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[d.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),d.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),d.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>d.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>d.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>d.jsxs("div",{children:[d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2 mb-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),d.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>d.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>d.jsxs("div",{className:"rounded-lg overflow-hidden",children:[d.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),d.jsxs("div",{className:"p-3 space-y-2",children:[d.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>d.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>d.jsx("div",{className:`h-9 w-28 bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 ${e}`}),Header:e=>d.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex items-center justify-between h-16",children:[d.jsxs("div",{className:"flex items-center gap-8",children:[d.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>d.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),d.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>d.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 mt-auto",children:d.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:d.jsxs("div",{className:"flex flex-col items-center gap-4",children:[d.jsx("div",{className:`h-4 w-32 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),d.jsx("div",{className:`h-3 w-48 bg-gray-100 dark:bg-gray-800 rounded ${e}`}),d.jsx("div",{className:"flex gap-3",children:Array.from({length:3},(t,r)=>d.jsx("div",{className:`h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))}),d.jsx("div",{className:`h-3 w-40 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]})})}),Modal:()=>d.jsx(d.Fragment,{}),Toast:()=>d.jsx(d.Fragment,{}),ConfirmDialog:()=>d.jsx(d.Fragment,{})};function dp(e){if(!e||e.length===0)return[];const t=e.filter(n=>n.if),r=e.filter(n=>!n.if);if(r.length>0&&t.length>0){const n=t.filter(o=>!Sc(o.if));return n.length>1&&up(n)?[...r,Ec(n)]:[...r,...n]}if(t.length>1&&r.length===0){const n=t.filter(o=>!Sc(o.if));return n.length===0?[]:n.length===1?n:[Ec(n)]}return e}function Sc(e){const t=e.replace(/^\{\{|\}\}$/g,"").trim();return t.startsWith("!")||/\b(hasError|isError|isLoading|error|Error)\b/.test(t)||/===\s*0\s*(\)|\}|$)/.test(t)}function up(e){if(e.length<2)return!1;const t=[];for(const n of e){const o=(n.if||"").replace(/^\{\{|\}\}$/g,"").trim(),a=o.match(/^(.+?)\s*===\s*['"]/);if(a)t.push(a[1].trim());else{const s=o.match(/(.+?)\s*===\s*['"]/);if(!s)return!1;t.push(s[1].trim())}}const r=t[0];return t.every(n=>n===r)}function Ec(e){return e.reduce((t,r)=>Va(r)>Va(t)?r:t)}function Va(e){return e.children?e.children.length+e.children.reduce((t,r)=>t+Va(r),0):0}function fp(e){return e.includes("{{")?e.replace(/\{\{([^}]+)\}\}/g,(t,r)=>{const n=r.match(/\?[\s]*['"]([^'"]*)['"]\s*:\s*['"]/);return n?n[1]:""}):e}function Ka(e,t){if(!e)return"";let r=e;return r=r.replace(/\b(bg-\S+|text-\S+|border\b|border-\S+|shadow\S*|ring-\S+|outline-\S+|divide-\S+|opacity-\S+|font-\S+|tracking-\S+|leading-\S+|whitespace-\S+|truncate|line-clamp-\S+|underline|no-underline|decoration-\S+|cursor-\S+|hover:\S+|focus:\S+|active:\S+|group-hover:\S+|transition\S*|duration-\S+|ease-\S+|animate-\S+|dark:\S+)\b/g,"").replace(/\s{2,}/g," ").trim(),(t==="Grid"||/\bgrid-cols-\d/.test(r))&&(r=r.replace(/\bgrid-cols-(\d+)/g,(n,o)=>{const a=parseInt(o);return a>4?`grid-cols-${Math.ceil(a/2)}`:`grid-cols-${a}`})),r}function gp(e){const{name:t,props:r}=e;if(!r||!t)return"";const n=[];if(t==="Flex"){n.push("flex");const o=r.direction||"row",a={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};a[o]&&n.push(a[o]);const s=r.justify||"start",l={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};l[s]&&n.push(l[s]);const f=r.align||"stretch",h={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};h[f]&&n.push(h[f]);const c=r.wrap||"nowrap",i={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};i[c]&&n.push(i[c]),r.gap&&r.gap>0&&n.push(`gap-${r.gap}`)}if(t==="Grid"){n.push("grid");const o=r.cols||1;if(n.push(`grid-cols-${o}`),r.responsive){const a=r.responsive;a.sm&&n.push(`sm:grid-cols-${a.sm}`),a.md&&n.push(`md:grid-cols-${a.md}`),a.lg&&n.push(`lg:grid-cols-${a.lg}`),a.xl&&n.push(`xl:grid-cols-${a.xl}`),a["2xl"]&&n.push(`2xl:grid-cols-${a["2xl"]}`)}r.gap!==void 0&&r.gap>0&&n.push(`gap-${r.gap}`),r.rowGap!==void 0&&r.rowGap>0&&n.push(`gap-y-${r.rowGap}`),r.colGap!==void 0&&r.colGap>0&&n.push(`gap-x-${r.colGap}`)}return n.join(" ")}function hp(e){switch(e){case"pulse":return"animate-pulse";case"wave":return"animate-pulse";case"none":return"";default:return"animate-pulse"}}function io(e,t,r,n){return!e||e.length===0?[]:dp(e).map((a,s)=>Tc(a,t,r,s,n))}function pp(e,t){const r=e.props?.className||e.className||"";return e.responsive?t>=1024&&e.responsive.desktop?.props?.className?e.responsive.desktop.props.className:t>=768&&e.responsive.tablet?.props?.className?e.responsive.tablet.props.className:r:r}function mp(e,t){const r=e.split(/\s+/).filter(Boolean),n=[],o=[];for(const f of r){const h=f.match(/^(sm|md|lg|xl|2xl):(.+)$/);if(h){const[,c,i]=h;if(Cc.has(i)){n.push({breakpoint:kc[c]||0,display:i});continue}(kc[c]||0)<=t&&o.push(i);continue}if(Cc.has(f)){n.push({breakpoint:0,display:f});continue}o.push(f)}if(n.length===0)return{visible:!0,className:e};n.sort((f,h)=>f.breakpoint-h.breakpoint);let a="";for(const f of n)f.breakpoint<=t&&(a=f.display);a||(a=n[0].display);const s=a!=="hidden",l=s?[a,...o].join(" "):"";return{visible:s,className:l}}function bp(e){const t=e.match(/\bgrid-cols-\[([^\]]+)\]/);if(!t)return{className:e};const r=t[1].replace(/_/g," ");return{className:e.replace(/\bgrid-cols-\[([^\]]+)\]/,"").replace(/\s{2,}/g," ").trim(),style:{gridTemplateColumns:r}}}function Tc(e,t,r,n,o){const{name:a,children:s,iteration:l}=e,f=pp(e,o),h=gp(e),c=h?`${h} ${f}`.trim():f,i=fp(c),u=mp(i,o);if(!a||!u.visible)return null;const g=u.className;if(l)return d.jsx(C.Fragment,{children:Array.from({length:r},(m,x)=>Tc({...e,iteration:void 0},t,r,x,o))},n);if(_c[a])return d.jsx("div",{className:g,children:_c[a](t,r)},n);if(sp.has(a)){const m=Ka(g,a);if(!s||s.length===0){const T=/\b(h-\S|w-\S)/.test(m)?`${m} bg-gray-200 dark:bg-gray-700 rounded ${t}`:`${m} h-3.5 w-full bg-gray-200 dark:bg-gray-700 rounded ${t}`.trim();return d.jsx("div",{className:T},n)}const x=io(s,t,r,o);if(!(x.length>0&&x.some(v=>v!==null)))return null;const M=bp(m);return d.jsx("div",{className:M.className,style:M.style,children:x},n)}const p=Ka(g,a);if(lp.has(a)){const m={H1:"h-7",H2:"h-6",H3:"h-5",H4:"h-5",H5:"h-4",H6:"h-4",P:"h-3.5",Span:"h-3",Label:"h-3",A:"h-3.5",Badge:"h-5 w-16"},x={H1:"w-3/5",H2:"w-2/5",H3:"w-1/3",H4:"w-1/3",H5:"w-1/4",H6:"w-1/4",P:"w-full",Span:"w-1/4",Label:"w-1/4",A:"w-1/3",Strong:"w-1/5",Em:"w-1/4",Small:"w-1/5",Badge:"w-16"},k=m[a]||"h-3.5",M=x[a]||"w-full",v=a.startsWith("H")?"mb-2 mt-1":"mb-1.5";return d.jsx("div",{className:`${k} ${M} bg-gray-200 dark:bg-gray-700 rounded ${t} ${v} ${p}`.trim()},n)}if(ip.has(a))return a==="Textarea"?d.jsx("div",{className:`h-20 w-full bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 mb-2 ${t}`},n):a==="Checkbox"||a==="Radio"||a==="Toggle"?d.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n):d.jsx("div",{className:`h-9 w-full bg-gray-100 dark:bg-gray-800 rounded border border-gray-200 dark:border-gray-700 mb-2 ${t}`},n);if(cp.has(a))return a==="Avatar"||a==="AvatarUploader"?d.jsx("div",{className:`h-10 w-10 bg-gray-200 dark:bg-gray-700 rounded-full ${t}`},n):a==="ProductImageViewer"?d.jsx("div",{className:`h-80 w-full bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):d.jsx("div",{className:`h-40 w-full bg-gray-200 dark:bg-gray-700 rounded mb-2 ${t}`},n);if(a==="Button"){if(s&&s.length>0){const m=Ka(g,a),x=io(s,t,r,o);if(!(x.length>0&&x.some(T=>T!==null)))return null;const v=/\b(border|rounded|px-\d|py-\d)/.test(f)?"border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800/50 rounded-lg":"";return d.jsx("div",{className:`${m} ${v}`.trim(),children:x},n)}return d.jsx("div",{className:`h-9 w-24 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n)}return a==="Icon"?d.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):s&&s.length>0?d.jsx("div",{className:p,children:io(s,t,r,o)},n):d.jsx("div",{className:`h-3.5 w-full bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n)}const Ya=({components:e,options:t})=>{const r=hp(t.animation),o=window.G7Core?.useResponsive,a=o?.(),s=a?a.width:typeof window<"u"?window.innerWidth:1024;return d.jsx("div",{className:"w-full",role:"status","aria-busy":"true","aria-label":"Loading...",children:io(e,r,t.iteration_count,s)})},yp=Object.freeze(Object.defineProperty({__proto__:null,PageSkeleton:Ya,default:Ya},Symbol.toStringTag,{value:"Module"})),vp=(e,t)=>window.G7Core?.t?.(e,t)??e,Ac=({options:e})=>{const t=document.documentElement.classList.contains("dark"),r=t?"rgb(17,24,39)":"rgb(249,250,251)",n=t?"#6b7280":"#9ca3af",o=t?"#9ca3af":"#6b7280";return d.jsxs("div",{style:{position:"absolute",inset:0,zIndex:2147483647,overflow:"hidden",background:r,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",paddingTop:"15%",gap:"12px"},children:[d.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${n}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),d.jsx("span",{style:{color:o,fontSize:"14px"},children:e?.text||vp("nav.loading")})]})},wp=Object.freeze(Object.defineProperty({__proto__:null,default:Ac},Symbol.toStringTag,{value:"Module"})),Vr=(e,t)=>window.G7Core?.t?.(e,t)??e,Nc=({currentPage:e,totalPages:t,onPageChange:r,maxVisiblePages:n=5,showFirstLast:o=!0,showFirst:a,showLast:s,hasMorePages:l,className:f="",style:h,prevText:c,nextText:i,id:u,editorAttrs:g})=>{const p=t!=null,m=p?t:0,x=p?e<m:l??!1,k=(a??o)&&p,M=(s??o)&&p,v=C.useMemo(()=>{const N=[];if(!p){const w=Math.floor(n/2),y=e<=n?1:e-w;y>1&&(N.push(1),y>2&&N.push("..."));for(let E=y;E<=e;E++)N.push(E);return l&&(N.push(e+1),N.push("...")),N}if(m<=n+2)for(let w=1;w<=m;w++)N.push(w);else{const w=Math.floor(n/2);let y=Math.max(2,e-w),E=Math.min(m-1,e+w);e<=w+1?E=n:e>=m-w&&(y=m-n+1),N.push(1),y>2&&N.push("...");for(let O=y;O<=E;O++)N.push(O);E<m-1&&N.push("..."),m>1&&N.push(m)}return N},[e,m,p,n,l]),T=N=>{N<1||N===e||p&&N>m||r(N)},I=()=>{e>1&&r(e-1)},S=()=>{x&&r(e+1)};return d.jsxs(j,{className:`flex items-center gap-2 ${f}`,style:h,role:"navigation","aria-label":Vr("common.pagination"),id:u,...g,children:[k&&d.jsx(R,{onClick:()=>T(1),disabled:e===1,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Vr("common.first_page"),children:"«"}),d.jsx(R,{onClick:I,disabled:e===1,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Vr("common.prev_page"),children:c||d.jsx(d.Fragment,{children:"‹"})}),d.jsx(j,{className:"flex items-center gap-1",children:v.map((N,w)=>{if(N==="...")return d.jsx(te,{className:"px-3 py-1 text-sm text-gray-500 dark:text-gray-400",children:"..."},`ellipsis-${w}`);const y=N,E=y===e;return d.jsx(R,{onClick:()=>T(y),className:`px-3 py-1 text-sm border rounded ${E?"bg-blue-500 dark:bg-blue-600 text-white border-blue-500 dark:border-blue-600":"border-gray-300 dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800"}`,"aria-label":Vr("common.page_n",{n:y}),"aria-current":E?"page":void 0,children:y},y)})}),d.jsx(R,{onClick:S,disabled:!x,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Vr("common.next_page"),children:i||d.jsx(d.Fragment,{children:"›"})}),M&&d.jsx(R,{onClick:()=>T(m),disabled:e===m,className:"px-3 py-1 text-sm border border-gray-300 dark:border-gray-600 rounded hover:bg-gray-100 dark:hover:bg-gray-700 disabled:opacity-50 disabled:cursor-not-allowed text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-800","aria-label":Vr("common.last_page"),children:"»"})]})},xp=Object.freeze(Object.defineProperty({__proto__:null,Pagination:Nc},Symbol.toStringTag,{value:"Module"})),Oc=(e,t)=>window.G7Core?.t?.(e,t)??e,Mc=({name:e="search",placeholder:t,value:r,onChange:n,onSubmit:o,showButton:a=!1,suggestions:s=[],onSuggestionClick:l,showSuggestions:f=!1,className:h="",style:c,id:i,editorAttrs:u})=>{const g=t??Oc("common.search_placeholder"),[p,m]=C.useState(""),[x,k]=C.useState(!1),M=C.useRef(null),v=C.useRef(""),T=r!==void 0?r:p,I=f&&x&&s.length>0&&T.length>0;C.useEffect(()=>{r!==void 0&&(v.current=r)},[r]);const S=y=>{const E=y.target.value;m(E),n?.(y),v.current!==""&&E===""&&!y.nativeEvent.inputType&&setTimeout(()=>{const O=M.current?.querySelector("form");O&&O.requestSubmit()},0),v.current=E},N=y=>{m(y.text);const E={target:{value:y.text,name:e}};n?.(E),l?.(y),k(!1)},w=y=>{y.preventDefault(),o?.(y)};return d.jsxs(j,{ref:M,className:`relative ${h}`,style:c,id:i,...u,children:[d.jsx(Eo,{onSubmit:w,className:"relative",children:d.jsxs(j,{className:`relative flex items-center ${a?"gap-2":""}`,children:[d.jsxs(j,{className:"relative flex-1",children:[d.jsx(j,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:d.jsx(fe,{name:nt.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),d.jsx(At,{type:"search",name:e,value:T,onChange:S,onFocus:()=>k(!0),onBlur:()=>setTimeout(()=>k(!1),200),placeholder:g,className:"w-full pl-10 pr-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-700 text-gray-900 dark:text-white text-sm"})]}),a&&d.jsx(R,{type:"submit",className:"px-4 py-2 bg-gray-800 dark:bg-gray-600 text-white rounded-lg hover:bg-gray-900 dark:hover:bg-gray-500 transition-colors text-sm font-medium cursor-pointer h-[42px]",children:Oc("common.search")})]})}),I&&d.jsx(j,{className:"absolute z-10 w-full mt-2 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg max-h-64 overflow-y-auto",children:s.map(y=>d.jsx(j,{className:"px-4 py-3 hover:bg-gray-50 dark:hover:bg-gray-700 cursor-pointer border-b border-gray-100 dark:border-gray-700 last:border-b-0 transition-colors",onClick:()=>N(y),children:d.jsxs(j,{className:"flex items-center gap-2",children:[d.jsx(fe,{name:nt.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),d.jsx(te,{className:"text-sm text-gray-700 dark:text-gray-300",children:y.text})]})},y.id))})]})},kp=Object.freeze(Object.defineProperty({__proto__:null,SearchBar:Mc},Symbol.toStringTag,{value:"Module"})),_t=window.G7Core,Cp={sm:"md",md:"lg",lg:"xl",xl:"2xl","2xl":"3xl"};function Xa({src:e,fallbackText:t="U",size:r="lg",uploadEndpoint:n="/api/me/avatar",deleteEndpoint:o="/api/me/avatar",onUploadSuccess:a,onUploadError:s,onDeleteSuccess:l,onDeleteError:f,showDeleteButton:h=!0,accept:c="image/*",maxSize:i=5,className:u="",uploadButtonText:g,deleteButtonText:p,readOnly:m=!1,confirmDelete:x=!0,deleteConfirmMessage:k,confirmUpload:M=!0,uploadConfirmMessage:v,uploadSuccessActions:T,uploadErrorActions:I,deleteSuccessActions:S,deleteErrorActions:N,id:w,editorAttrs:y}){const E=C.useRef(null),[O,$]=C.useState(!1),[P,L]=C.useState(!1),[U,_]=C.useState(void 0),[b,z]=C.useState(null),[F,G]=C.useState(!1),[X,B]=C.useState(!1),[Y,H]=C.useState(null),[W,Q]=C.useState(null),be=C.useRef(`avatar-upload-${Math.random().toString(36).slice(2,11)}`).current;C.useEffect(()=>{if(Y){const ae=URL.createObjectURL(Y);return Q(ae),()=>URL.revokeObjectURL(ae)}else Q(null)},[Y]);const se=C.useCallback(ae=>_t?.t?.(ae)??ae,[]),pe=C.useCallback(()=>{const ae=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return ae?decodeURIComponent(ae[1]):null},[]),ne=C.useCallback(()=>_t?.api?.getToken?.()??null,[]),Ae=C.useCallback(async ae=>{B(!1),H(null),$(!0),z(null);try{const ce=new FormData;ce.append("avatar",ae);const ke=pe(),Ee=ne(),Be=await fetch(n,{method:"POST",headers:{Accept:"application/json",...ke&&{"X-XSRF-TOKEN":ke},...Ee&&{Authorization:`Bearer ${Ee}`}},credentials:"include",body:ce});if(!Be.ok){const Pe=await Be.json().catch(()=>({}));throw new Error(Pe.message||se("attachment.upload_failed"))}const Me=await Be.json(),Ke=Me.data||Me;Ke.avatar&&_(Ke.avatar),a?.(Ke),_t?.toast?.success?.(se("mypage.profile.avatar_uploaded")),T?.length?T.forEach(Pe=>_t?.dispatch?.(Pe)):_t?.refetchDataSource?.("user")}catch(ce){const ke=ce instanceof Error?ce:new Error(String(ce));z(ke.message),s?.(ke),_t?.toast?.error?.(ke.message),I?.length&&I.forEach(Ee=>_t?.dispatch?.(Ee))}finally{$(!1),E.current&&(E.current.value="")}},[n,a,s,pe,ne,se]),ve=C.useCallback(async ae=>{const ce=ae.target.files?.[0];if(!ce)return;z(null);const ke=i*1024*1024;if(ce.size>ke){const Ee=new Error(se("attachment.file_too_large").replace(":max",`${i}MB`));z(Ee.message),s?.(Ee),_t?.toast?.error?.(Ee.message);return}if(c&&!ce.type.match(c.replace("*",".*"))){const Ee=new Error(se("attachment.invalid_file_type"));z(Ee.message),s?.(Ee),_t?.toast?.error?.(Ee.message);return}M?(H(ce),B(!0)):Ae(ce)},[i,c,s,M,Ae,se]),We=C.useCallback(async()=>{G(!1),L(!0),z(null);try{const ae=pe(),ce=ne(),ke=await fetch(o,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",...ae&&{"X-XSRF-TOKEN":ae},...ce&&{Authorization:`Bearer ${ce}`}},credentials:"include"});if(!ke.ok){const Ee=await ke.json().catch(()=>({}));throw new Error(Ee.message||se("attachment.delete_failed"))}_(null),l?.(),_t?.toast?.success?.(se("mypage.profile.avatar_deleted")),S?.length?S.forEach(Ee=>_t?.dispatch?.(Ee)):_t?.refetchDataSource?.("user")}catch(ae){const ce=ae instanceof Error?ae:new Error(String(ae));z(ce.message),f?.(ce),_t?.toast?.error?.(ce.message),N?.length&&N.forEach(ke=>_t?.dispatch?.(ke))}finally{L(!1)}},[o,l,f,pe,ne,se]),me=C.useCallback(()=>{x?G(!0):We()},[x,We]),Te=C.useCallback(()=>{G(!1)},[]),ge=C.useCallback(()=>{B(!1),H(null),E.current&&(E.current.value="")},[]),Oe=C.useCallback(()=>{Y&&Ae(Y)},[Y,Ae]),we=U===void 0?e:U,$e=!!we,ze=Cp[r]||"lg",K=F||X,oe=()=>d.jsxs(j,{className:"flex items-center justify-center gap-2",children:[d.jsx(At,{ref:E,id:be,type:"file",accept:c,className:"hidden",onChange:ve,disabled:O}),!$e&&d.jsxs(Ar,{htmlFor:be,className:`inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${O?"opacity-50 cursor-not-allowed":""}`,children:[O?d.jsx(fe,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(fe,{name:"image",size:"sm"}),d.jsx(te,{children:g||se("mypage.profile.register_avatar")})]}),$e&&d.jsxs(d.Fragment,{children:[d.jsxs(Ar,{htmlFor:be,className:`inline-flex items-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors cursor-pointer ${O?"opacity-50 cursor-not-allowed":""}`,children:[O?d.jsx(fe,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(fe,{name:"upload",size:"sm"}),d.jsx(te,{children:g||se("common.change")})]}),h&&d.jsxs(R,{type:"button",className:"inline-flex items-center gap-2 px-4 py-2 border border-red-300 dark:border-red-600 text-red-600 dark:text-red-400 rounded-lg text-sm font-medium hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",onClick:me,disabled:P,children:[P?d.jsx(fe,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(fe,{name:"trash-2",size:"sm"}),d.jsx(te,{children:p||se("common.delete")})]})]})]});return d.jsxs(j,{className:`flex flex-col items-center gap-3 ${u}`,id:w,...y,children:[X&&W?d.jsxs(j,{className:"relative",children:[d.jsx(jt,{src:W,alt:"Preview",className:`rounded-full object-cover ${r==="sm"?"w-10 h-10":r==="md"?"w-12 h-12":r==="lg"?"w-16 h-16":r==="xl"?"w-24 h-24":"w-32 h-32"}`}),d.jsx(j,{className:"absolute inset-0 rounded-full bg-blue-500/20 border-2 border-blue-500 border-dashed"})]}):d.jsx(Qr,{avatar:we||void 0,name:t,size:ze}),!m&&d.jsxs(j,{className:"w-[220px] flex flex-col items-center gap-2",children:[X&&Y&&d.jsxs(j,{className:"w-full p-3 bg-blue-50 dark:bg-blue-950/50 border border-blue-200 dark:border-blue-800 rounded-lg",children:[d.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[d.jsx(fe,{name:"upload",size:"sm",className:"text-blue-600 dark:text-blue-400 shrink-0"}),d.jsx(te,{className:"text-sm font-medium text-blue-800 dark:text-blue-300",children:v||se("mypage.profile.upload_avatar_confirm")})]}),d.jsxs(j,{className:"text-xs text-blue-600 dark:text-blue-400 truncate mb-3",title:Y.name,children:[Y.name," (",(Y.size/1024/1024).toFixed(2),"MB)"]}),d.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[d.jsxs(R,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-blue-600 hover:bg-blue-700 text-white rounded-md text-sm font-medium transition-colors disabled:opacity-50",onClick:Oe,disabled:O,children:[O?d.jsx(fe,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(fe,{name:"check",size:"sm"}),d.jsx(te,{children:se("common.confirm")})]}),d.jsx(R,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:ge,children:d.jsx(te,{children:se("common.cancel")})})]})]}),F&&d.jsxs(j,{className:"w-full p-3 bg-red-50 dark:bg-red-950/50 border border-red-200 dark:border-red-800 rounded-lg",children:[d.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[d.jsx(fe,{name:"alert-triangle",size:"sm",className:"text-red-600 dark:text-red-400 shrink-0"}),d.jsx(te,{className:"text-sm font-medium text-red-800 dark:text-red-300",children:k||se("mypage.profile.delete_avatar_confirm")})]}),d.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[d.jsxs(R,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-red-600 hover:bg-red-700 text-white rounded-md text-sm font-medium transition-colors disabled:opacity-50",onClick:We,disabled:P,children:[P?d.jsx(fe,{name:"spinner",size:"sm",className:"animate-spin"}):d.jsx(fe,{name:"trash-2",size:"sm"}),d.jsx(te,{children:se("common.delete")})]}),d.jsx(R,{type:"button",className:"inline-flex items-center justify-center gap-1.5 px-3 py-2 bg-white dark:bg-gray-800 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-md text-sm font-medium hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",onClick:Te,children:d.jsx(te,{children:se("common.cancel")})})]})]}),!K&&oe()]}),b&&!K&&d.jsxs(j,{className:"flex items-center gap-2 text-sm text-red-600 dark:text-red-400",children:[d.jsx(fe,{name:"alert-circle",size:"sm"}),d.jsx(te,{children:b})]})]})}const _p=Object.freeze(Object.defineProperty({__proto__:null,AvatarUploader:Xa,default:Xa},Symbol.toStringTag,{value:"Module"})),Ic=()=>window.G7Core,co=(e,t)=>window.G7Core?.t?.(e,t)??e,Dc={horizontal:"flex items-center gap-1.5",vertical:"flex flex-col items-start"},Sp=()=>[{key:"view_profile",label:co("userinfo.view_profile"),icon:"user",path:"/users/{{userId}}"},{key:"view_posts",label:co("userinfo.view_posts"),icon:"file-lines",path:"/users/{{userId}}/posts"}],qa=({text:e,title:t})=>e?d.jsx(te,{className:"text-sm text-gray-500 dark:text-gray-400",title:t,children:e}):null,Pc=({author:e,name:t,userId:r,subText:n,subTextTitle:o,isGuest:a=!1,isWithdrawn:s=!1,showDropdown:l=!0,clickable:f=!0,profilePath:h="/users/{userId}",className:c="",layout:i="vertical",text:u,stopPropagation:g=!1,menuItems:p,hideMenuItems:m=[],appendMenuItems:x=[],id:k,editorAttrs:M})=>{const v=r??e?.uuid,T=a||e?.is_guest||!1,I=s||e?.status==="withdrawn",S=I?co("userinfo.withdrawn_user"):u??t??e?.name??"",[N,w]=C.useState(!1),[y,E]=C.useState({top:0,left:0}),O=C.useRef(null),$=C.useRef(null),P=C.useRef(null),L=h.replace("{userId}",String(v??"")),U=`${Dc[i]} ${c}`;C.useEffect(()=>{if(!N)return;const H=Q=>{const be=Q.target,se=O.current?.contains(be),pe=$.current?.contains(be);!se&&!pe&&w(!1)},W=()=>w(!1);return document.addEventListener("mousedown",H),window.addEventListener("scroll",W,!0),window.addEventListener("resize",W),()=>{document.removeEventListener("mousedown",H),window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}},[N]);const _=C.useCallback(()=>{if(p&&p.length>0)return p.filter(Q=>Q.show!==!1);let W=Sp().filter(Q=>!m.includes(Q.key)&&Q.show!==!1);return x&&x.length>0&&(W=[...W,...x.filter(Q=>Q.show!==!1)]),W},[p,m,x]),b=C.useCallback(()=>{if(P.current){const H=P.current.getBoundingClientRect();E({top:H.bottom+4,left:H.left})}},[]),z=C.useCallback((H,W)=>{if(W.stopPropagation(),W.preventDefault(),w(!1),H.onClick)H.onClick();else if(H.path){const Q=H.path.replace(/\{\{userId\}\}/g,String(v??"")),be=Ic();be?.navigate?be.navigate(Q):window.location.href=Q}},[v]),F=C.useCallback(H=>{H.preventDefault(),g&&H.stopPropagation(),!(T||!v)&&(l?(N||b(),w(W=>!W)):f&&Ic()?.navigate?.(L))},[g,T,v,l,N,b,f,L]);if(T||!v)return d.jsxs(j,{className:U,id:k,...M,children:[d.jsxs(j,{className:"flex items-center gap-1.5 text-gray-400 dark:text-gray-500",children:[d.jsx(te,{children:S}),d.jsx(te,{className:"text-xs px-1.5 py-0.5 bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 rounded",children:co("userinfo.guest_badge")})]}),d.jsx(qa,{text:n,title:o})]});if(I)return d.jsxs(j,{className:U,id:k,...M,children:[d.jsx(te,{className:"text-gray-400 dark:text-gray-500 line-through",children:S}),d.jsx(qa,{text:n,title:o})]});const G=_(),B=/\btext-\S+/.test(c)?"":"text-gray-900 dark:text-white",Y=l||f?`${B} hover:text-blue-600 dark:hover:text-blue-400 cursor-pointer font-medium`.trim():`${B} font-medium`.trim();return d.jsxs(j,{ref:O,className:`relative inline-block ${c}`,id:k,...M,children:[d.jsxs(j,{className:Dc[i],children:[d.jsx(R,{ref:P,onClick:F,className:Y,children:S}),d.jsx(qa,{text:n,title:o})]}),l&&N&&G.length>0&&tr.createPortal(d.jsx(j,{ref:$,className:"fixed w-40 bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg shadow-lg py-1 z-[9999]",style:{top:y.top,left:y.left},"data-testid":"author-dropdown-menu",children:G.map(H=>d.jsxs(R,{onClick:W=>z(H,W),className:"flex items-center justify-start gap-2 w-full text-left px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 cursor-pointer","data-testid":`menu-item-${H.key}`,children:[H.icon&&d.jsx(fe,{name:H.icon,className:"w-4 h-4"}),d.jsx(te,{children:H.label})]},H.key))}),document.body)]})},Ep=Object.freeze(Object.defineProperty({__proto__:null,UserInfo:Pc},Symbol.toStringTag,{value:"Module"})),Lc=({tabs:e,activeTabId:t,onTabChange:r,variant:n="underline",className:o="",style:a,hiddenTabIds:s=[],mobileBreakpoint:l=768,id:f,editorAttrs:h})=>{const i=window.G7Core?.useResponsive,u=i?.(),g=u?u.width<l:typeof window<"u"&&window.innerWidth<l,p=v=>{!v.disabled&&v.id!==t&&r?.(v.id)},m=v=>{const T=v.target.value,I=Number(T),S=typeof T=="string"&&T!==""&&!Number.isNaN(I)?I:T,N=e.find(w=>String(w.id)===String(S));N&&p(N)},x=s.length>0?e.filter(v=>!s.includes(v.id)):e;if(g)return d.jsx(j,{className:`relative ${o}`,style:a,id:f,...h,children:d.jsx(ps,{value:t!==void 0?String(t):"",onChange:m,options:x.map(v=>({value:String(v.id),label:v.badge!==void 0?`${v.label} (${v.badge})`:v.label,disabled:v.disabled})),className:"w-full"})});const k=v=>{const T=v.id===t,I="flex items-center gap-2 px-3 py-2 font-medium text-sm transition-all shrink-0 whitespace-nowrap";if(v.disabled)return`${I} opacity-50 cursor-not-allowed text-gray-400 dark:text-gray-600`;switch(n){case"pills":return T?`${I} bg-blue-600 dark:bg-blue-500 text-white rounded-lg`:`${I} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`;case"underline":return T?`${I} text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white`:`${I} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 border-b-2 border-transparent hover:border-gray-300 dark:hover:border-gray-600`;default:return T?`${I} text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20 border-b-2 border-blue-600 dark:border-blue-400`:`${I} text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-200 hover:bg-gray-50 dark:hover:bg-gray-700 border-b-2 border-transparent`}},M=n==="underline"?"flex gap-0 border-b border-gray-200 dark:border-gray-700":"flex gap-2";return d.jsx(j,{className:`relative ${o}`,style:a,id:f,...h,children:d.jsx(Zr,{className:M,children:x.map(v=>d.jsxs(R,{type:"button",onClick:()=>p(v),disabled:v.disabled,className:k(v),children:[v.iconName&&d.jsx(fe,{name:v.iconName,size:"sm"}),d.jsx(te,{children:v.label}),v.badge!==void 0&&d.jsx(j,{className:"flex items-center justify-center min-w-5 h-5 px-1.5 bg-red-500 text-white text-xs font-bold rounded-full",children:d.jsx(te,{children:v.badge})})]},v.id))})})},Tp=Object.freeze(Object.defineProperty({__proto__:null,TabNavigation:Lc},Symbol.toStringTag,{value:"Module"})),Ap={Header:()=>Promise.resolve().then(()=>Bd),Footer:()=>Promise.resolve().then(()=>Yd),MobileNav:()=>Promise.resolve().then(()=>Xd),SlotContainer:()=>Promise.resolve().then(()=>Gd),NotificationCenter:()=>Promise.resolve().then(()=>jd),ProductCard:()=>Promise.resolve().then(()=>Iu),BrandMark:()=>Promise.resolve().then(()=>Pu),ImageGallery:()=>Promise.resolve().then(()=>ni),ProductImageViewer:()=>Promise.resolve().then(()=>Gg),QuantitySelector:()=>Promise.resolve().then(()=>jg),PostReactions:()=>Promise.resolve().then(()=>Vg),RichTextEditor:()=>Promise.resolve().then(()=>Kg),HtmlContent:()=>Promise.resolve().then(()=>Yg),HtmlEditor:()=>Promise.resolve().then(()=>Xg),ExpandableContent:()=>Promise.resolve().then(()=>qg),FileUploader:()=>Promise.resolve().then(()=>q0),ConfirmDialog:()=>Promise.resolve().then(()=>Jg),SocialLoginButtons:()=>Promise.resolve().then(()=>Q0),Toast:()=>Promise.resolve().then(()=>rp),PageTransitionIndicator:()=>Promise.resolve().then(()=>op),PageTransitionBlur:()=>Promise.resolve().then(()=>ap),PageSkeleton:()=>Promise.resolve().then(()=>yp),PageLoading:()=>Promise.resolve().then(()=>wp),ThemeToggle:()=>Promise.resolve().then(()=>$d),Pagination:()=>Promise.resolve().then(()=>xp),SearchBar:()=>Promise.resolve().then(()=>kp),Avatar:()=>Promise.resolve().then(()=>zd),AvatarUploader:()=>Promise.resolve().then(()=>_p),UserInfo:()=>Promise.resolve().then(()=>Ep),Modal:()=>Promise.resolve().then(()=>Qg),TabNavigation:()=>Promise.resolve().then(()=>Tp)},Np=({id:e,className:t,style:r,children:n,editorAttrs:o})=>d.jsx(j,{id:e,className:t,style:r,...o,children:n}),Op=({id:e,children:t,cols:r=1,responsive:n,gap:o,rowGap:a,colGap:s,autoRows:l,autoCols:f,flow:h="row",className:c="",style:i,onClick:u,editorAttrs:g})=>{const p=["grid"];if(r&&p.push(`grid-cols-${r}`),n&&(n.sm&&p.push(`sm:grid-cols-${n.sm}`),n.md&&p.push(`md:grid-cols-${n.md}`),n.lg&&p.push(`lg:grid-cols-${n.lg}`),n.xl&&p.push(`xl:grid-cols-${n.xl}`),n["2xl"]&&p.push(`2xl:grid-cols-${n["2xl"]}`)),o!==void 0&&o>0&&p.push(`gap-${o}`),a!==void 0&&a>0&&p.push(`gap-y-${a}`),s!==void 0&&s>0&&p.push(`gap-x-${s}`),l){const x={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};p.push(x[l])}if(f){const x={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};p.push(x[f])}const m={row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"};return p.push(m[h]),c&&p.push(c),d.jsx(j,{id:e,className:p.join(" "),style:i,onClick:u,...g,children:t})},Mp=({id:e,children:t,direction:r="row",justify:n="start",align:o="stretch",wrap:a="nowrap",gap:s=0,grow:l=!1,shrink:f=!0,className:h="",style:c,onClick:i,editorAttrs:u})=>{const g=["flex"],p={row:"flex-row","row-reverse":"flex-row-reverse",col:"flex-col","col-reverse":"flex-col-reverse"};g.push(p[r]);const m={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};g.push(m[a]);const x={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};g.push(x[n]);const k={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return g.push(k[o]),s>0&&g.push(`gap-${s}`),l===!0?g.push("flex-grow"):typeof l=="number"&&l>0&&g.push(`flex-grow-${l}`),f===!1?g.push("shrink-0"):f===!0?g.push("flex-shrink"):typeof f=="number"&&f>0&&g.push(`flex-shrink-${f}`),h&&g.push(h),d.jsx(j,{id:e,className:g.join(" "),style:c,onClick:i,...u,children:t})},Ip=({id:e,title:t,subtitle:r,children:n,padding:o="md",background:a="none",maxWidth:s,centered:l=!1,border:f=!1,shadow:h="none",rounded:c=!1,className:i="",style:u,onClick:g,editorAttrs:p})=>{const m=[],x={none:"p-0",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};m.push(x[o]);const k={none:"",white:"bg-white dark:bg-gray-700",gray:"bg-gray-50 dark:bg-gray-800",primary:"bg-blue-50 dark:bg-blue-900/20",secondary:"bg-gray-50 dark:bg-gray-800"};if(a!=="none"&&m.push(k[a]),s){const v={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl","4xl":"max-w-4xl","6xl":"max-w-6xl","7xl":"max-w-7xl",full:"max-w-full"};m.push(v[s])}l&&m.push("mx-auto"),f&&m.push("border","border-gray-200","dark:border-gray-700");const M={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return h!=="none"&&m.push(M[h]),c&&m.push("rounded-lg"),i&&m.push(i),d.jsxs(bs,{id:e,className:m.join(" "),style:u,onClick:g,...p,children:[(t||r)&&d.jsxs(j,{className:"mb-4",children:[t&&d.jsx(gs,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:t}),r&&d.jsx(Gt,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:r})]}),n]})},Dp=({id:e,leftWidth:t="250px",rightWidth:r="300px",leftSlot:n,centerSlot:o,rightSlot:a,className:s="",style:l,editorAttrs:f})=>{const h=`flex flex-row w-full h-full ${s}`.trim(),c={width:t,flexShrink:0},i={flex:1,minWidth:0},u={width:r,flexShrink:0};return d.jsxs(j,{id:e,className:h,style:l,...f,children:[d.jsx(j,{className:"flex flex-col",style:c,children:n}),d.jsx(j,{className:"flex flex-col",style:i,children:o}),d.jsx(j,{className:"flex flex-col",style:u,children:a})]})},Pp={identifier:"sirsoft-basic",vendor:"sirsoft",name:{ko:"Basic",en:"Basic"},version:"1.1.3",license:"MIT",description:{ko:"그누보드7 기본 사용자 템플릿",en:"Gnuboard7 default user template"},type:"user",locales:["ko","en"],author:{name:"sirsoft",email:"contact@sirsoft.com",url:"https://sirsoft.com"},release_date:"2026-01-07",g7_version:">=7.0.10",dependencies:{modules:{"sirsoft-board":">=1.0.0","sirsoft-ecommerce":">=1.1.0","sirsoft-page":">=1.1.0"},plugins:{"sirsoft-daum_postcode":">=1.0.0"}},assets:{css:["dist/css/components.css"],js:["dist/js/components.iife.js"],fonts:[],images:[]},components:{basic:["a","button","checkbox","div","form","h1","h2","h3","h4","hr","icon","img","input","label","li","nav","p","section","select","span","svg","table","tbody","td","textarea","th","thead","tr","ul"],composite:["header","footer","mobile-nav","product-card","rich-text-editor","image-gallery","quantity-selector","post-reactions","social-login-buttons","file-uploader","card","modal","toast","pagination","stat-card","status-badge","tab-navigation","empty-state","loading-spinner","breadcrumb","search-bar","dropdown"],layout:["container","flex","grid","section"]},preview:{thumbnail:"preview/thumbnail.png",screenshots:["preview/screenshot1.png","preview/screenshot2.png"]},error_config:{layouts:{401:"errors/401",403:"errors/403",404:"errors/404",500:"errors/500",503:"errors/503",maintenance:"errors/maintenance"}},features:{dark_mode:!0,responsive:!0,multi_language:!0,multi_currency:!0},github_url:"https://github.com/gnuboard/g7-template-sirsoft-basic",github_changelog_url:"https://github.com/gnuboard/g7-template-sirsoft-basic/blob/main/CHANGELOG.md",externals:[{id:"fontawesome",type:"style",asset:"vendor/font-awesome/6.4.0/css/all.inlined.css"},{id:"pretendard",type:"webfont",asset:"vendor/pretendard/1.3.9/pretendard-variable.css"}]},Lp={KRW:0,JPY:0};function $p(){try{const t=(window.G7Core?.state?.get?.()||{})?.modules?.["sirsoft-ecommerce"]?.language_currency;return Array.isArray(t?.currencies)?t.currencies:[]}catch{return[]}}function Kr(e,t){if(!Number.isFinite(e))return"0";const r=$p(),n=t||r.find(a=>a.is_default)?.code;if(!n)return e.toLocaleString();const o=r.find(a=>a.code===n)?.decimal_places??Lp[n]??2;try{return new Intl.NumberFormat(void 0,{style:"currency",currency:n,minimumFractionDigits:o,maximumFractionDigits:o}).format(e)}catch{return`${e.toLocaleString(void 0,{minimumFractionDigits:o,maximumFractionDigits:o})} ${n}`}}function uo(e,t,r,n=0){if(!e)return;const o=f=>f?.value??f?.price??0;let a;for(const[f,h]of Object.entries(e))if(h?.is_default){a=f;break}a=a??(e.KRW?"KRW":void 0);const s=a?o(e[a]):0,l={};for(const[f,h]of Object.entries(e)){const c=o(h);let i;r?i=r[f]?.value??0:n>0&&f===a?i=n:n>0&&s>0?i=n*c/s:i=0;const u=(c+i)*t;l[f]={value:u,formatted:Kr(u,f)}}return l}function fo(e){const t={};for(const n of e){const o=n?.multiCurrencyTotalPrice;if(o)for(const[a,s]of Object.entries(o)){const l=s?.value??s?.price??0;t[a]=(t[a]??0)+l}}const r={};for(const[n,o]of Object.entries(t))r[n]={value:o,formatted:Kr(o,n)};return r}function $c(e,t){if(!e||!t?.length)return 0;let r=0;for(const n of t){const o=e[n.id];if(o==null)continue;const a=n.values?.find(s=>s.id===Number(o));a&&(r+=a.price_adjustment??0)}return r}function Fc(e,t){if(!e||!t?.length)return;const r={};let n=!1;for(const a of t){const s=e[a.id];if(s==null)continue;const f=a.values?.find(h=>h.id===Number(s))?.multi_currency_price_adjustment;if(f){n=!0;for(const[h,c]of Object.entries(f)){const i=c?.value??c?.price??0;r[h]=(r[h]??0)+i}}}if(!n)return;const o={};for(const[a,s]of Object.entries(r))o[a]={value:s};return o}function go(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function Fp(e,t,r){if(t&&r in t)return t[r];if(Array.isArray(e)){const n=e.find(o=>typeof o.key=="string"?o.key===r:o.key?.ko===r||Object.values(o.key).includes(r));return n?typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]:void 0}return e[r]}function Up(e,t){if(t)return t;if(!Array.isArray(e))return e;const r={};for(const n of e){const o=typeof n.key=="string"?n.key:n.key?.ko??Object.values(n.key)[0]??"",a=typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]??"";o&&(r[o]=a)}return r}function zp(e,t,r){return r.find(n=>!n?.option_values||!n?.is_active?!1:e.every(o=>{const a=go(o),s=t?.[a];return Fp(n.option_values,n.option_values_localized,a)===s}))}function Hp(e,t){const r=e.params;if(!r)return;const{optionGroups:n,options:o,selectedOptionItems:a,preferredCurrency:s}=r;let l;if(r.newGroupName&&r.newValue?l={...r.currentSelection??{},[r.newGroupName]:r.newValue}:l=r.currentSelection??{},!n?.every(S=>{const N=go(S);return l?.[N]}))return;const h=zp(n,l,o??[]);if(!h){t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const c=n.map(S=>l[go(S)]).join("_"),i=a??[];if(i.find(S=>S.id===c)){const S=window.G7Core;S?.toast?.warning?.(S?.t?.("sirsoft-ecommerce.shop.already_added_option")??"이미 추가된 옵션입니다."),t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const g=h.selling_price??0,p={};n.forEach(S=>{const N=go(S);p[N]=l[N]});const m=r.additionalOptionGroups??[],x={};for(const S of m){if(!S.is_required)continue;const N=S.values?.find(w=>w.is_default);N&&(x[S.id]=N.id)}const k=$c(x,m),M=Fc(x,m),v=g+k,T={id:c,optionId:h.id,options:p,optionValues:Up(h.option_values,h.option_values_localized),quantity:1,stock:h.stock_quantity??999,unitPrice:g,unitPriceFormatted:Kr(g,s),totalPrice:v,totalPriceFormatted:Kr(v,s),multiCurrencyUnitPrice:h.multi_currency_selling_price,multiCurrencyTotalPrice:uo(h.multi_currency_selling_price,1,M,k),additionalOptionSelections:x,additionalOptionsTotal:k,additionalOptionsMultiCurrencyTotal:M},I=[...i,T];t.setState?.({selectedOptionItems:I,selectedTotalMultiCurrency:fo(I),currentSelection:{},__mergeMode:"shallow"})}function Gp(e,t){const r=e.params;if(!r)return;const{selectedOptionItems:n,preferredCurrency:o}=r,a=Number(r.itemIndex)||0,s=Number(r.newQuantity)||1,l=(n??[]).map((f,h)=>{if(h!==a)return f;const c=f?.unitPrice??0,i=f?.additionalOptionsTotal??0,u=(c+i)*s;return{...f,quantity:s,totalPrice:u,totalPriceFormatted:Kr(u,o),multiCurrencyTotalPrice:uo(f?.multiCurrencyUnitPrice,s,f?.additionalOptionsMultiCurrencyTotal,i)}});t.setState?.({selectedOptionItems:l,selectedTotalMultiCurrency:fo(l)})}function jp(e,t){const r=e.params;if(!r)return;const{selectedOptionItems:n,additionalOptionGroups:o,preferredCurrency:a}=r,s=Number(r.itemIndex)||0,l=Number(r.additionalOptionId),f=Object.prototype.hasOwnProperty.call(r,"customText"),h=r.valueId===""||r.valueId==null?null:Number(r.valueId),c=(n??[]).map((i,u)=>{if(u!==s)return i;const g={...i.additionalOptionSelections??{}},p={...i.additionalOptionCustomTexts??{}};if(f){const T=String(r.customText??"");T.trim()===""?delete p[l]:p[l]=T}else h==null?(delete g[l],delete p[l]):(g[l]=h,(o??[]).find(S=>S.id===l)?.values?.find(S=>S.id===h)?.allow_custom_text||delete p[l]);const m=$c(g,o),x=Fc(g,o),k=i?.unitPrice??0,M=i?.quantity??1,v=(k+m)*M;return{...i,additionalOptionSelections:g,additionalOptionCustomTexts:p,additionalOptionsTotal:m,additionalOptionsMultiCurrencyTotal:x,totalPrice:v,totalPriceFormatted:Kr(v,a),multiCurrencyTotalPrice:uo(i?.multiCurrencyUnitPrice,M,x,m)}});t.setState?.({selectedOptionItems:c,selectedTotalMultiCurrency:fo(c)})}function Bp(e,t){const r=e.params;if(!r)return;const n=Number(r.itemIndex)||0,o=(r.selectedOptionItems??[]).filter((a,s)=>s!==n);t.setState?.({selectedOptionItems:o,selectedTotalMultiCurrency:fo(o)})}function Wp(e,t){const r=e.params;if(!r)return;const n=Math.max(1,Number(r.newQuantity)||1);t.setState?.({noOptionQuantity:n,noOptionTotalMultiCurrency:uo(r.multiCurrencyUnitPrice,n)})}const xn=window.G7Core?.createLogger?.("Handler:Cart")??{log:(...e)=>console.log("[Handler:Cart]",...e),warn:(...e)=>console.warn("[Handler:Cart]",...e),error:(...e)=>console.error("[Handler:Cart]",...e)};function kr(e){const t=window.G7Core;t?.state?.setLocal?(t.state.setLocal(e),xn.log("Local state updated:",e)):xn.warn("G7Core.state.setLocal not available")}function Uc(){return window.G7Core?.state?.getLocal?.()||{}}function Vp(){return window.G7Core?.state?.get?.()||{}}function Kp(e,t="info"){const r=window.G7Core;r?.toast?.show?r.toast.show(e,t):xn.warn("G7Core.toast.show not available, message:",e)}function Yp(e){const t=window.G7Core;return t?.t?t.t(e):e}function zc(){const e=window.G7Core;if(e?.dispatch){const r=Uc().selectedItems||[];e.dispatch({handler:"refetchDataSource",params:{dataSourceId:"cartItems"}}),xn.log("Refetching cartItems with selected_ids:",r)}else xn.warn("G7Core.dispatch not available")}function Xp(e,t){const{itemId:r,selectedItems:n}=e?.params||{},o=n||[];let a;o.includes(r)?a=o.filter(h=>h!==r):a=[...o,r];const l=Vp().cartItems?.data?.items||[],f=l.length>0&&a.length===l.length;kr({selectedItems:a,allSelected:f}),zc()}function qp(e,t){const{allItemIds:r,isSelected:n}=e?.params||{};kr({selectedItems:n?r:[],allSelected:n}),zc()}function Zp(e,t){const{optionName:r,optionValue:n}=e?.params||{},a=Uc().selectedOptions||{};kr({selectedOptions:{...a,[r]:n}})}function Qp(e,t){const{targetIds:r}=e?.params||{};if(!r||r.length===0){Kp(Yp("shop.cart.select_items_to_delete"),"warning");return}kr({deleteModal:{visible:!0,targetIds:r}})}function Jp(e,t){const{targetItem:r}=e?.params||{};kr({optionModal:{visible:!0,targetItem:r},selectedOptions:r?.options||{},selectedQuantity:r?.quantity})}function Rp(e,t){const{selectedItems:r}=e?.params||{};if(!r||r.length===0){kr({isCalculating:!1});return}kr({isCalculating:!0})}const Cr=window.G7Core?.createLogger?.("Handler:CartOptionChange")??{log:(...e)=>console.log("[Handler:CartOptionChange]",...e),warn:(...e)=>console.warn("[Handler:CartOptionChange]",...e),error:(...e)=>console.error("[Handler:CartOptionChange]",...e)};function Za(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function em(e,t,r){if(t&&r in t)return t[r];if(Array.isArray(e)){const n=e.find(o=>typeof o.key=="string"?o.key===r:o.key?.ko===r||Object.values(o.key).includes(r));return n?typeof n.value=="string"?n.value:n.value?.ko??Object.values(n.value)[0]:void 0}return e[r]}function Hc(e,t,r){return!e||!t?.length?null:t.every(a=>{const s=Za(a);return e[s]})?r?.find(a=>t.every(s=>{const l=Za(s);return em(a.option_values,a.option_values_localized,l)===e[l]}))||null:(Cr.log("Not all options selected yet"),null)}function tm(e,t){const{selectedOptions:r,optionGroups:n,options:o}=e?.params||{};Cr.log("findMatchingOption called:",{selectedOptions:r,optionGroups:n,optionsCount:o?.length});const a=Hc(r,n,o);return Cr.log("Matched option:",a),{matchedOption:a}}function rm(e,t){const{currentOptionValues:r,optionGroups:n,options:o}=e?.params||{};if(Cr.log("initCartOptionSelection called:",{currentOptionValues:r,optionGroups:n,optionsCount:o?.length}),!n?.length||!r)return Cr.log("No option groups or current values, returning empty"),{selectedOptions:{},matchedOption:null};const a={};for(const l of n){const f=Za(l),h=r[f],c=l.values_localized??(Array.isArray(l.values)?l.values.map(i=>typeof i=="string"?i:i?.ko??""):[]);h&&c.includes(h)&&(a[f]=h)}Cr.log("Initial selectedOptions:",a);const s=Hc(a,n,o||[]);return Cr.log("Matched option:",s),{selectedOptions:a,matchedOption:s}}const kn="g7_cart_key",nm="/api/modules/sirsoft-ecommerce/cart/key",Qa="g7_guest_order_token",Gc="g7_guest_order_number",Ja="g7_guest_order_expires_at",ft=window.G7Core?.createLogger?.("Handler:Storage")??{log:(...e)=>console.log("[Handler:Storage]",...e),warn:(...e)=>console.warn("[Handler:Storage]",...e),error:(...e)=>console.error("[Handler:Storage]",...e)};async function jc(){try{const e=await fetch(nm,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}});return e.ok?(await e.json()).data?.cart_key||null:(ft.error("Failed to issue cartKey from API:",e.status),null)}catch(e){return ft.error("Error issuing cartKey from API:",e),null}}function sr(e){const t=window.G7Core;t?.state?.set?(t.state.set(e),ft.log("Global state updated:",e)):ft.warn("G7Core.state.set not available")}function om(){try{const e=window.G7Config;return e?.user?e.user:(window.G7Core?.state?.get?.()||{}).currentUser||null}catch{return null}}async function am(e,t){let r=null;try{r=localStorage.getItem(kn)}catch{}if(r)ft.log("Existing cartKey loaded:",r);else if(r=await jc(),r)try{localStorage.setItem(kn,r),ft.log("New cartKey issued from API:",r)}catch{}else ft.error("Failed to issue cartKey from API");sr({cartKey:r})}function sm(e,t){try{return localStorage.getItem(kn)}catch{return null}}function Bc(e,t){try{localStorage.removeItem(kn),ft.log("cartKey removed from localStorage")}catch{}sr({cartKey:null})}async function lm(e,t){if(om()){Bc();return}const n=await jc();if(n){try{localStorage.setItem(kn,n),ft.log("New cartKey regenerated from API:",n)}catch{}sr({cartKey:n})}else ft.error("Failed to regenerate cartKey from API")}function im(e,t){const{key:r,value:n}=e?.params||{};if(!r){ft.warn("saveToStorage: key is required");return}try{localStorage.setItem(r,n),ft.log("Saved to storage:",r,n)}catch{}}function cm(e,t){const{key:r,defaultValue:n}=e?.params||{};if(!r)return ft.warn("loadFromStorage: key is required"),n||null;try{return localStorage.getItem(r)||n||null}catch{return n||null}}function Ra(){try{sessionStorage.removeItem(Qa),sessionStorage.removeItem(Gc),sessionStorage.removeItem(Ja)}catch{}}function dm(e,t){let r=null,n=null;try{r=sessionStorage.getItem(Qa),n=sessionStorage.getItem(Ja)}catch{}let o=!1;if(r){const a=n?new Date(n).getTime():NaN;(isNaN(a)||a<=Date.now())&&(Ra(),r=null,o=!0)}if(r){sr({guestOrderToken:r}),ft.log("Guest order token loaded from sessionStorage");return}if(!o){const s=window.G7Core?.state?.get?.("_global")?.guestOrderToken;if(typeof s=="string"&&s!==""){ft.log("Guest order token preserved from in-memory _global (sessionStorage empty)");return}}sr({guestOrderToken:null}),ft.log("No guest order token (visitor not authenticated)")}function um(e,t){const{token:r,orderNumber:n,expiresAt:o}=e?.params||{};if(!r||!n||!o){ft.warn("saveGuestOrderToken: token, orderNumber, expiresAt are required");return}try{sessionStorage.setItem(Qa,r),sessionStorage.setItem(Gc,n),sessionStorage.setItem(Ja,o)}catch{}sr({guestOrderToken:r})}function fm(e,t){Ra(),sr({guestOrderToken:null})}function gm(e,t){Ra(),sr({guestOrderToken:null})}function Wc(e){const t=window.G7Core?.state?.get?.()?.[e];return typeof t=="string"&&t.length>0?t:void 0}function hm(e,t){const r=e?.params??{},{product:n,priceField:o,currencyCode:a}=r,s=a||Wc("preferredCurrency")||Wc("defaultCurrency")||"",l=`multi_currency_${o}`,f=n[l];if(f&&f[s])return f[s].formatted;const h=`${o}_formatted`;return n[h]||String(n[o])}const Vc={KRW:"₩",USD:"$",JPY:"¥",CNY:"元",EUR:"€",GBP:"£"},pm={KRW:0,JPY:0};function Kc(){try{const t=(window.G7Core?.state?.get?.()||{})?.modules?.["sirsoft-ecommerce"]?.language_currency;return Array.isArray(t?.currencies)?t.currencies:[]}catch{return[]}}function Yc(e){const t=window.G7Core?.state?.get?.()?.[e];return typeof t=="string"&&t.length>0?t:void 0}function mm(e,t){const r=e?.params??{},{value:n,currencyCode:o,locale:a}=r,s=Kc(),l=o||Yc("preferredCurrency")||Yc("defaultCurrency")||s.find(u=>u.is_default)?.code;if(!l)return n.toLocaleString(a);const f=s.find(u=>u.code===l),h=f?.symbol&&f.symbol.length>0?f.symbol:Vc[l]??"",c=f?.decimal_places??pm[l]??2,i=n.toLocaleString(a,{minimumFractionDigits:c,maximumFractionDigits:c});return h?l==="KRW"||h==="₩"||h==="원"?`${i}원`:`${h}${i}`:`${i} ${l}`}function bm(e){const t=Kc().find(r=>r.code===e);return t?.symbol&&t.symbol.length>0?t.symbol:Vc[e]||e}const es=window.G7Core?.createLogger?.("Handler:Currency")??{log:(...e)=>console.log("[Handler:Currency]",...e),warn:(...e)=>console.warn("[Handler:Currency]",...e),error:(...e)=>console.error("[Handler:Currency]",...e)},Xc="g7_preferred_currency";function ym(){try{const e=window.G7Core?.state?.get?.()||{};return e.defaultCurrency||e?.modules?.["sirsoft-ecommerce"]?.language_currency?.default_currency||""}catch{return""}}function qc(e){window.G7Core?.state?.set?.({preferredCurrency:e})}function vm(e,t){const r=e?.params??{},{defaultCurrency:n=ym()}=r;let o=n;try{if(typeof window<"u"&&window.localStorage){const a=localStorage.getItem(Xc);a&&Zc(a)&&(o=a)}}catch{es.warn("localStorage 접근 불가, 기본 통화 사용:",n)}return qc(o),o}function wm(e,t){const{currencyCode:r}=e?.params??{};if(!Zc(r)){es.warn("유효하지 않은 통화 코드:",r);return}try{typeof window<"u"&&window.localStorage&&localStorage.setItem(Xc,r)}catch{es.warn("localStorage 저장 실패")}qc(r)}function Zc(e){return typeof e=="string"&&/^[A-Z]{3}$/.test(e)}const Yr=window.G7Core?.createLogger?.("Handler:SetTheme")??{log:(...e)=>console.log("[Handler:SetTheme]",...e),warn:(...e)=>console.warn("[Handler:SetTheme]",...e),error:(...e)=>console.error("[Handler:SetTheme]",...e)},ts=["auto","light","dark"],Qc="g7_color_scheme",xm=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,ho=e=>{const t=xm(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function km(){try{const e=localStorage.getItem(Qc),t=e&&ts.includes(e)?e:"auto";ho(t),Yr.log("Initial theme applied:",t)}catch(e){Yr.warn("Failed to load initial theme:",e),ho("auto")}}async function Cm(e,t){const r=e?.target;if(r&&typeof r=="string"&&ts.includes(r)){ho(r);return}km()}async function _m(e,t){let r;if(e?.target&&typeof e.target=="string"&&!e.target.includes("{{")&&(r=e.target),!r||typeof r!="string"){Yr.warn("Invalid theme:",r);return}if(!ts.includes(r)){Yr.warn("Unsupported theme:",r);return}const n=r;try{localStorage.setItem(Qc,n)}catch(o){Yr.error("Failed to save theme to localStorage:",o);return}ho(n),Yr.log("Theme changed to:",n)}const Sm=window.G7Core?.createLogger?.("Handler:RedirectToLoginWithReturn")??{log:(...e)=>console.log("[Handler:RedirectToLoginWithReturn]",...e),warn:(...e)=>console.warn("[Handler:RedirectToLoginWithReturn]",...e),error:(...e)=>console.error("[Handler:RedirectToLoginWithReturn]",...e)};async function Em(e,t){const r=window.G7Core;if(!r?.dispatch){Sm.error("G7Core.dispatch 가 초기화되지 않아 로그인 리다이렉트를 실행할 수 없습니다.");return}const n=window.location.pathname+window.location.search;await r.dispatch({handler:"navigate",params:{path:"/login",query:{redirect:n}}})}const rs=window.G7Core?.createLogger?.("Handler:DownloadAttachment")??{log:(...e)=>console.log("[Handler:DownloadAttachment]",...e),warn:(...e)=>console.warn("[Handler:DownloadAttachment]",...e),error:(...e)=>console.error("[Handler:DownloadAttachment]",...e)};async function Tm(e,t){const r=window.G7Core,{url:n,filename:o}=e?.params||{};if(!n){rs.warn("다운로드 URL 이 없어 요청을 건너뜁니다.");return}if(!r?.api?.get){rs.error("G7Core.api.get 이 초기화되지 않아 다운로드를 실행할 수 없습니다.");return}try{const a=await r.api.get(n,{responseType:"blob",headers:zn()});if(a){const s=URL.createObjectURL(a),l=document.createElement("a");l.href=s,l.download=o||"",document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(s)}}catch(a){rs.error("첨부파일 다운로드 실패",a),r?.toast?.error?.(r?.t?.("common.download_failed")??"Download failed")}}const po={"sirsoft-basic.addSelectedItemIfComplete":Hp,"sirsoft-basic.updateSelectedItemQuantity":Gp,"sirsoft-basic.removeSelectedItem":Bp,"sirsoft-basic.updateNoOptionQuantity":Wp,"sirsoft-basic.setBlockAdditionalOption":jp,"sirsoft-basic.getDisplayPrice":hm,"sirsoft-basic.formatCurrency":mm,"sirsoft-basic.getCurrencySymbol":bm,"sirsoft-basic.loadPreferredCurrency":vm,"sirsoft-basic.savePreferredCurrency":wm,setTheme:_m,initTheme:Cm,redirectToLoginWithReturn:Em,downloadAttachment:Tm,toggleCartItemSelection:Xp,selectAllCartItems:qp,setCartOption:Zp,openCartDeleteModal:Qp,openCartOptionModal:Jp,recalculateCart:Rp,findMatchingOption:tm,initCartOptionSelection:rm,initCartKey:am,getCartKey:sm,clearCartKey:Bc,regenerateCartKey:lm,saveToStorage:im,loadFromStorage:cm,initGuestOrderToken:dm,saveGuestOrderToken:um,clearGuestOrderToken:fm,clearGuestTokenOnEntry:gm},Cn=window.G7Core?.createLogger?.("Template:sirsoft-basic:IdentityLauncher")??{log:(...e)=>console.log("[Template:sirsoft-basic:IdentityLauncher]",...e),warn:(...e)=>console.warn("[Template:sirsoft-basic:IdentityLauncher]",...e),error:(...e)=>console.error("[Template:sirsoft-basic:IdentityLauncher]",...e)};function Am(e){const t=window.G7Core,r=t?.state?.getLocal?.()??{},n=t?.state?.getGlobal?.()??t?.state?.get?.()??{},o=(...f)=>f.find(h=>typeof h=="string"&&h.length>0),a=o(e.target?.email,n?.currentUser?.email,n?.user?.email,n?.auth?.user?.email,e.purpose==="signup"?r?.registerForm?.email:void 0,e.purpose==="password_reset"?r?.passwordResetForm?.email:void 0,e.purpose==="password_reset"?r?.email:void 0),s=o(e.target?.phone,n?.currentUser?.phone,n?.user?.phone,n?.auth?.user?.phone);if(!a&&!s)return null;const l={};return a&&(l.email=a),s&&(l.phone=s),l}function Nm(){const t=window.G7Core?.api?.getToken?.()??null;return t?{Authorization:`Bearer ${t}`}:{}}function Om(){try{const e=typeof window<"u"?window.localStorage?.getItem("g7_locale"):null;return e?{"Accept-Language":e}:{}}catch{return{}}}async function Mm(e,t){const r={purpose:e.purpose};e.provider_id&&(r.provider_id=e.provider_id),t&&(r.target=t);const n=e.challenge_start_url||"/api/identity/challenges",o=await fetch(n,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json",Accept:"application/json",...Om(),...Nm()},body:JSON.stringify(r)}),a=await o.json().catch(()=>null);if(!o.ok||!a?.success){const l=a?.message??`Challenge 시작 실패 (HTTP ${o.status})`;throw new Error(l)}const s=a.data??a;return{id:s.id,expires_at:s.expires_at,render_hint:s.render_hint??e.render_hint??"text_code",public_payload:s.public_payload,redirect_url:s.redirect_url,max_attempts:typeof s.max_attempts=="number"?s.max_attempts:void 0}}async function Im(e){const t=window.G7Core,r=t?.identity;if(!t?.dispatch||!t?.state||!r)return Cn.error("G7Core 또는 G7Core.identity 가 초기화되지 않아 launcher 를 실행할 수 없습니다."),{status:"failed",failureCode:"G7_NOT_READY"};if(e.render_hint==="external_redirect"||e.redirect_url)return r.redirectExternally(e);const n=Am(e);let o;try{o=await Mm(e,n)}catch(p){Cn.error("Challenge 시작 실패:",p);try{await t.dispatch({handler:"toast",params:{type:"error",message:p instanceof Error?p.message:"본인인증 시작에 실패했습니다."}})}catch{}return{status:"failed",failureCode:"CHALLENGE_START_FAILED",reason:p instanceof Error?p.message:String(p)}}if(o.redirect_url)return r.redirectExternally({...e,render_hint:"external_redirect",redirect_url:o.redirect_url});const a=o.expires_at?new Date(o.expires_at).getTime():0,s=a>0?Math.max(0,Math.floor((a-Date.now())/1e3)):0,l=typeof o.max_attempts=="number"?o.max_attempts:0;t.state.set({identityChallenge:{policy_key:e.policy_key,purpose:e.purpose,provider_id:e.provider_id??null,render_hint:o.render_hint,challenge_id:o.id,expires_at:o.expires_at,public_payload:o.public_payload??{},target:n??null,code:"",error:null,attempts:0,maxAttempts:l,remainingSeconds:s,resendCooldown:0}});let f=a,h=0;const c=window.setInterval(()=>{const p=f>0?Math.max(0,Math.floor((f-Date.now())/1e3)):0;h=Math.max(0,h-1),t.state.set({identityChallenge:{remainingSeconds:p,resendCooldown:h}})},1e3);let i=null;try{i=t.state.subscribe?.(p=>{const m=p?.identityChallenge?.expires_at;if(typeof m=="string"){const k=new Date(m).getTime();Number.isFinite(k)&&k!==f&&(f=k)}const x=p?.identityChallenge?.resendCooldown;typeof x=="number"&&x>h&&(h=x)})??null}catch{}const u=r.createDeferred();try{await t.dispatch({handler:"openModal",target:"identity-challenge-modal"})}catch(p){return Cn.error("openModal 실패 — 풀페이지로 폴백:",p),window.clearInterval(c),i?.(),r.redirectExternally({...e,render_hint:"external_redirect",redirect_url:`/identity/challenge?challenge_id=${encodeURIComponent(o.id)}&return=${encodeURIComponent(window.location.href)}`})}const g=await u;return window.clearInterval(c),i?.(),g}function Dm(){const e=window.G7Core?.identity;if(!e?.setLauncher){Cn.warn("G7Core.identity 가 아직 초기화되지 않아 launcher 등록을 건너뜁니다. 코어 부트스트랩 순서를 확인하세요.");return}e.setLauncher(Im),Cn.log("IDV launcher registered (sirsoft-basic)")}const Jc=window.G7Core?.createLogger?.("Template:sirsoft-basic:device")??{log:(...e)=>console.log("[Template:sirsoft-basic:device]",...e),warn:(...e)=>console.warn("[Template:sirsoft-basic:device]",...e)};function Pm(){if(typeof navigator>"u")return!1;const e=navigator,t=(e.userAgent||"").toLowerCase(),r=((e.userAgentData?.platform??e.platform)||"").toLowerCase(),n=e.maxTouchPoints??0;return/iphone|ipad|ipod/.test(t)||/iphone|ipad|ipod|ios/.test(r)?!0:/macintosh|mac os x/.test(t)&&n>1}function Lm(){const e=window.G7Core;if(!e?.state?.get||!e?.state?.set){Jc.warn("G7Core.state not available; skip iOS device correction");return}if(!Pm())return;const r=(e.state.get()||{}).appConfig||{};r.isIos!==!0&&(e.state.set({appConfig:{...r,isIos:!0}}),Jc.log("appConfig.isIos corrected to true by client signals (iPadOS desktop-UA)"))}function $m(e){const t=e.icons;return Array.isArray(t)?t.filter(r=>!!r&&typeof r=="object"&&typeof r.value=="string"):[]}function Fm(e,t){const r=e.label;return typeof r=="string"?r.startsWith("$t:")?t(r.slice(3)):r:e.value}function Um(e,t,r){if(r==="")return!0;const n=r.toLowerCase();return e.value.toLowerCase().includes(n)||t.toLowerCase().includes(n)?!0:(e.keywords??[]).some(o=>o.toLowerCase().includes(n))}function zm({entry:e}){const t=e.preview;return t?.html?d.jsx("span",{className:"g7le-icon-preview",dangerouslySetInnerHTML:{__html:t.html},style:os}):t?.className?d.jsx("span",{className:`g7le-icon-preview ${t.className}`,style:os}):d.jsx("i",{className:`fas fa-${e.value}`,style:os,"aria-hidden":"true"})}function Hm({control:e,value:t,onChange:r,t:n}){const o=$m(e),a=t==null?"":String(t),s=typeof e.iconColumns=="number"?e.iconColumns:6,l=e.iconSearchPlaceholder,f=typeof l=="string"&&l.startsWith("$t:")?n(l.slice(3)):n("layout_editor.icon_picker.search_placeholder"),[h,c]=C.useState("");if(o.length===0)return d.jsx("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Rc,children:d.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-free","data-testid":"g7le-widget-icon-picker-free",value:a,placeholder:n("layout_editor.icon_picker.free_input_hint"),onChange:g=>r(g.target.value===""?void 0:g.target.value),style:ed})});const i=g=>Fm(g,n),u=o.filter(g=>Um(g,i(g),h));return d.jsxs("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Rc,children:[d.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-search","data-testid":"g7le-widget-icon-picker-search",value:h,placeholder:f,onChange:g=>c(g.target.value),style:ed}),d.jsxs("div",{className:"g7le-icon-grid","data-testid":"g7le-widget-icon-picker-grid",style:{...Gm,gridTemplateColumns:`repeat(${s}, minmax(0, 1fr))`},children:[d.jsx("button",{type:"button","data-testid":"g7le-icon-cell-none",title:n("layout_editor.icon_picker.none"),onClick:()=>r(void 0),"aria-pressed":a==="",style:a===""?td:ns,children:d.jsx("span",{style:jm,children:"—"})}),u.map(g=>{const p=g.value===a;return d.jsx("button",{type:"button","data-testid":`g7le-icon-cell-${g.value}`,title:i(g),"aria-pressed":p,onClick:()=>r(g.value),style:p?td:ns,children:d.jsx(zm,{entry:g})},g.value)})]}),u.length===0&&d.jsx("div",{"data-testid":"g7le-widget-icon-picker-empty",style:Bm,children:n("layout_editor.icon_picker.no_results")})]})}const Rc={display:"flex",flexDirection:"column",gap:6,width:"100%"},ed={padding:"5px 8px",fontSize:12,border:"1px solid #cbd5e1",borderRadius:6,width:"100%"},Gm={display:"grid",gap:4,maxHeight:220,overflowY:"auto",padding:2},ns={display:"flex",alignItems:"center",justifyContent:"center",minHeight:34,padding:4,border:"1px solid #e2e8f0",borderRadius:6,background:"#fff",cursor:"pointer"},td={...ns,border:"2px solid #2563eb",background:"#eff6ff"},os={display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:16,lineHeight:1},jm={fontSize:10,color:"#475569",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},Bm={fontSize:11,color:"#94a3b8",fontStyle:"italic",padding:"4px 2px"},rd=window.G7Core?.createLogger?.("Template:sirsoft-basic:EditorWidgets")??{log:(...e)=>console.log("[Template:sirsoft-basic:EditorWidgets]",...e),warn:(...e)=>console.warn("[Template:sirsoft-basic:EditorWidgets]",...e)};function Wm(){if(typeof window>"u")return;const e=window.G7Core?.layoutEditor;if(!e?.registerWidget){rd.warn("G7Core.layoutEditor 미노출 — icon-picker 위젯 등록 보류");return}e.registerWidget("icon-picker",Hm),rd.log("편집기 위젯 'icon-picker' 등록됨(Font Awesome 검색 그리드)")}const as=window.G7Core?.createLogger?.("Template:sirsoft-basic")??{log:(...e)=>console.log("[Template:sirsoft-basic]",...e),warn:(...e)=>console.warn("[Template:sirsoft-basic]",...e),error:(...e)=>console.error("[Template:sirsoft-basic]",...e)};typeof window<"u"&&(window.G7TemplateHandlers=po);function nd(){if(typeof window<"u"){let e=0;const t=50,r=()=>{const n=window.G7Core?.getActionDispatcher?.();n?(Object.entries(po).forEach(([o,a])=>{n.registerHandler(o,a)}),as.log(`${Object.keys(po).length} custom handler(s) registered:`,Object.keys(po)),Dm(),Lm()):(e++,e<=t?(as.warn(`ActionDispatcher not found, retrying... (${e}/${t})`),setTimeout(r,100)):as.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?r():window.addEventListener("load",r)}}return Wm(),nd(),ee.A=So,ee.Avatar=Qr,ee.AvatarUploader=Xa,ee.BrandMark=zo,ee.Button=R,ee.Checkbox=ms,ee.Code=Dd,ee.ConfirmDialog=wa,ee.Container=Np,ee.Div=j,ee.ExpandableContent=ba,ee.FileInput=ds,ee.FileUploader=lo,ee.Flex=Mp,ee.Footer=Cs,ee.Form=Eo,ee.Grid=Op,ee.H1=xd,ee.H2=gs,ee.H3=Tn,ee.H4=hs,ee.Header=xs,ee.Hr=To,ee.HtmlContent=ha,ee.HtmlEditor=ii,ee.Icon=fe,ee.IconName=nt,ee.ImageGallery=zr,ee.Img=jt,ee.Input=At,ee.Label=Ar,ee.Li=er,ee.MobileNav=_s,ee.Modal=ya,ee.Nav=Zr,ee.NotificationCenter=On,ee.Ol=kd,ee.Optgroup=Ed,ee.Option=Sd,ee.P=Gt,ee.PageLoading=Ac,ee.PageSkeleton=Ya,ee.PageTransitionBlur=Wa,ee.PageTransitionIndicator=Ba,ee.Pagination=Nc,ee.PasswordInput=fs,ee.PostReactions=si,ee.ProductCard=Ws,ee.ProductImageViewer=jn,ee.QuantitySelector=oi,ee.RichTextEditor=li,ee.SearchBar=Mc,ee.Section=bs,ee.SectionLayout=Ip,ee.Select=ps,ee.SlotContainer=Nn,ee.SocialLoginButtons=vc,ee.Span=te,ee.Svg=En,ee.TabNavigation=Lc,ee.Table=Td,ee.Tbody=Nd,ee.Td=Id,ee.Textarea=Co,ee.Th=Md,ee.Thead=Ad,ee.ThemeToggle=An,ee.ThreeColumnLayout=Dp,ee.Toast=ja,ee.Tr=Od,ee.Ul=_o,ee.UserInfo=Pc,ee.availablePasswordRules=ko,ee.compositeComponents=Ap,ee.defaultPasswordRules=us,ee.initTemplate=nd,ee.templateMetadata=Pp,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}),ee})({},ReactJSXRuntime,React,ReactDOM);
|