Files
Gnuboard7/templates/_bundled/sirsoft-basic/dist/js/components.iife.js
T
HeuJung 0ae3289c60 fix(ecommerce,basic): 배송정책 스냅샷 형태 정규화로 주문 상세 배송정보 누락 해소
마이페이지·비회원 주문 상세에서 상품별 배송정책명과 개별 배송비 줄이 아무 안내
없이 통째로 사라졌다. 주문에 보관하는 배송정책 스냅샷이 항목 목록과 배송지 메타를
한 배열에 섞어 담고 있어, PHP 배열이 non-sequential 이 되면서 json_encode 가 리스트가
아니라 객체로 직렬화했기 때문이다.

서버 소비자는 정수 키 판별로 관용 처리해 무사했고 배열을 전제한 화면만 죽었다.
한 컬럼에 두 의미를 담은 구조 자체를 items + address 로 분리했다.

이미 저장된 주문은 화면만 고쳐서는 낫지 않으므로 업그레이드 스텝으로 함께 정규화한다.
2026-08-04 09:39:00 +09:00

89 lines
358 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var SirsoftBasic=(function(ee,c,C,or){"use strict";function ad(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 T=ad(C),sd=()=>window.G7Core,J=C.forwardRef(({children:e,variant:t="primary",size:r="md",className:n="",...o},a)=>{const s="inline-flex items-center justify-center",l=sd()?.style?.mergeClasses?.(s,n)??`${s} ${n}`;return c.jsx("button",{ref:a,className:l,...o,children:e})});J.displayName="Button";const j=C.forwardRef(({children:e,className:t="",...r},n)=>c.jsx("div",{ref:n,className:t,...r,children:e})),re=({children:e,className:t="",...r})=>c.jsx("span",{className:t,...r,children:e}),En=({children:e,className:t="",...r})=>c.jsx("svg",{className:t,...r,children:e}),Et=C.forwardRef(({label:e,error:t,className:r="",onChange:n,onKeyPress:o,value:a,defaultValue:s,type:l="text",checked:f,defaultChecked:h,...d},i)=>{const u=l==="radio"||l==="checkbox",g=C.useRef(!1),p=C.useRef(null);C.useImperativeHandle(i,()=>p.current);const[m,w]=C.useState(a??s??"");C.useEffect(()=>{!u&&!g.current&&a!==void 0&&w(a)},[a,u]);const x=C.useCallback(()=>{g.current=!0},[]),O=C.useCallback(y=>{if(g.current=!1,n){const N=y.target.value;w(N);const I=new Event("change",{bubbles:!0});Object.defineProperty(I,"target",{writable:!1,value:{value:N}}),Object.defineProperty(I,"currentTarget",{writable:!1,value:{value:N}}),n(I)}},[n]),v=C.useCallback(y=>{const N=y.target.value;w(N),!g.current&&n&&n(y)},[n]),E=C.useCallback(y=>{g.current||o&&o(y)},[o]),{loadingactions:A,formdata:_,...M}=d;if(u)return c.jsx("input",{ref:p,type:l,className:r,onChange:n,checked:f,defaultChecked:h,value:a,...M});const k=a!==void 0?{value:m}:{defaultValue:s};return c.jsx("input",{ref:p,type:l,className:r,onChange:v,onKeyPress:E,onCompositionStart:x,onCompositionEnd:O,...k,...M})});Et.displayName="Input";const ss=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 d=C.useRef(null),i=h||d,[u,g]=C.useState(""),p={},m={};Object.entries(f).forEach(([v,E])=>{v.startsWith("data-editor-")||v==="id"||v==="onMouseMove"||v==="onMouseLeave"?p[v]=E:m[v]=E});const w=C.useCallback(()=>{!l&&i.current&&i.current.click()},[l,i]),x=C.useCallback(v=>{const E=v.target.files?.[0]||null;if(!E){g(""),r?.(null);return}if(t&&E.size>t*1024*1024){const A=`File size exceeds ${t}MB limit`;n?.(A),i.current&&(i.current.value=""),g("");return}g(E.name),r?.(E)},[t,r,n,i]),O=C.useCallback(v=>{v.stopPropagation(),i.current&&(i.current.value=""),g(""),r?.(null)},[r,i]);return c.jsxs(j,{className:`flex items-center gap-2 ${s}`,...p,children:[c.jsx(Et,{ref:i,type:"file",accept:e,onChange:x,disabled:l,className:"hidden",...m}),c.jsx(J,{type:"button",onClick:w,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}),c.jsx(re,{className:"flex-1 text-sm text-gray-600 dark:text-gray-400 truncate",children:u||a}),u&&!l&&c.jsx(J,{type:"button",onClick:O,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200","aria-label":"Clear file",children:c.jsx(En,{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})});ss.displayName="FileInput";var rt=(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))(rt||{});const ld={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"},ge=({name:e,iconStyle:t="solid",size:r,color:n,spin:o=!1,pulse:a=!1,fixedWidth:s=!1,ariaLabel:l,className:f="",style:h,...d})=>{const i={solid:"fas",regular:"far",light:"fal",duotone:"fad",brands:"fab"},u=typeof e=="string"?e:String(e),g=ld[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(" "),w=l||p.replace(/-/g," ");return c.jsx("i",{className:m,style:h,"aria-label":w,role:"img",...d})},Tr=(e,t)=>window.G7Core?.t?.(e,t)??e,vo={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}}},ls=[vo.minLength];function id(e){const[t,r]=e.split(":"),n=vo[t];if(!n)return null;const o=r?parseInt(r,10):n.defaultParam;return{rule:n,param:isNaN(o)?n.defaultParam:o}}const is=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:d,wrapperClassName:i="",validationClassName:u="",className:g="",onChange:p,value:m,defaultValue:w,disabled:x,...O},v)=>{const E=C.useRef(null);C.useImperativeHandle(v,()=>E.current);const[A,_]=C.useState(!1),[M,k]=C.useState(!1),[y,N]=C.useState(m??w??"");C.useEffect(()=>{m!==void 0&&N(m)},[m]);const I=C.useMemo(()=>f&&f.length>0?f.map(G=>({rule:G,param:G.defaultParam})):h&&h.length>0?h.map(G=>id(G)).filter(G=>G!==null):ls.map(G=>({rule:G,param:G.defaultParam})),[f,h]),F=C.useMemo(()=>!d||d.length===0?I:I.filter(G=>d.includes(G.rule.key)),[I,d]),P=C.useMemo(()=>!n||o?{}:F.reduce((G,{rule:W,param:Q})=>(G[W.key]=W.validate(y,Q),G),{}),[y,F,n,o]),L=C.useMemo(()=>!o||a===void 0?!0:y===a&&y.length>0,[o,y,a]),$=C.useMemo(()=>n?Object.values(P).every(G=>G):!0,[P,n]);C.useEffect(()=>{if(l&&n&&!o){const G=Object.entries(P).filter(([,W])=>!W).map(([W])=>W);l($,G)}},[$,P,l,n,o]),C.useEffect(()=>{s&&o&&s(L)},[L,s,o]);const S=C.useCallback(()=>{_(G=>!G)},[]),b=C.useCallback(G=>{const W=G.target.value;N(W),p&&p(G)},[p]),z=C.useCallback(G=>{k(G.getModifierState("CapsLock"))},[]),{loadingactions:U,formdata:H,...Y}=O,B={},X={};for(const[G,W]of Object.entries(Y))G.startsWith("data-editor-")||G==="onMouseMove"||G==="onMouseLeave"?B[G]=W:X[G]=W;return c.jsxs("div",{className:`relative ${i}`,...B,children:[c.jsxs("div",{className:"relative",children:[c.jsx("input",{ref:E,type:A?"text":"password",className:`${g} ${r?"pr-10":""}`,value:m!==void 0?m:void 0,defaultValue:m===void 0?w:void 0,onChange:b,onKeyDown:z,onKeyUp:z,disabled:x,...X}),r&&c.jsx("button",{type:"button",onClick:S,disabled:x,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(A?"auth.password_input.hide":"auth.password_input.show"),children:c.jsx(ge,{name:A?"eye-slash":"eye",className:"w-5 h-5"})})]}),M&&!A&&c.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-sm text-yellow-600 dark:text-yellow-400",children:[c.jsx(ge,{name:"triangle-exclamation",className:"w-4 h-4"}),c.jsx("span",{children:Tr("auth.password_input.caps_lock_on")})]}),o&&a!==void 0&&y.length>0&&c.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:[c.jsx(ge,{name:L?"check-circle":"xmark-circle",className:"w-4 h-4"}),c.jsx("span",{children:Tr(L?"auth.password_input.match":"auth.password_input.mismatch")})]}),n&&!o&&y.length>0&&c.jsx("div",{className:`mt-2 space-y-1 ${u}`,children:F.map(({rule:G,param:W})=>{const Q=P[G.key],me=W!==void 0?{count:W}:void 0;return c.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:[c.jsx(ge,{name:Q?"check-circle":"circle",className:"w-4 h-4"}),c.jsx("span",{children:Tr(G.labelKey,me)})]},G.key)})}),t&&c.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:t})]})});is.displayName="PasswordInput";const wo=({label:e,error:t,className:r="",onChange:n,value:o,defaultValue:a,...s})=>{const l=C.useRef(!1),f=C.useRef(null),[h,d]=C.useState(o??a??"");C.useEffect(()=>{!l.current&&o!==void 0&&d(o)},[o]);const i=C.useCallback(()=>{l.current=!0},[]),u=C.useCallback(O=>{if(l.current=!1,n){const v=O.target.value;d(v);const E=new Event("change",{bubbles:!0});Object.defineProperty(E,"target",{writable:!1,value:{value:v}}),Object.defineProperty(E,"currentTarget",{writable:!1,value:{value:v}}),n(E)}},[n]),g=C.useCallback(O=>{const v=O.target.value;d(v),!l.current&&n&&n(O)},[n]),{loadingactions:p,formdata:m,...w}=s,x=o!==void 0?{value:h}:{defaultValue:a};return c.jsx("textarea",{ref:f,className:r,onChange:g,onCompositionStart:i,onCompositionEnd:u,...x,...w})},Nr=({children:e,className:t="",...r})=>c.jsx("label",{className:t,...r,children:e}),Ut=({children:e,className:t="",...r})=>c.jsx("p",{className:t,...r,children:e}),zt=({className:e="",alt:t="",...r})=>c.jsx("img",{className:e,alt:t,...r}),cd=({children:e,className:t="",...r})=>c.jsx("h1",{className:t,...r,children:e}),cs=({children:e,className:t="",...r})=>c.jsx("h2",{className:t,...r,children:e}),Tn=({children:e,className:t="",...r})=>c.jsx("h3",{className:t,...r,children:e}),ds=({children:e,className:t="",...r})=>c.jsx("h4",{className:t,...r,children:e}),xo=({children:e,className:t="",...r})=>c.jsx("ul",{className:t,...r,children:e}),dd=({children:e,className:t="",...r})=>c.jsx("ol",{className:t,...r,children:e}),rr=({children:e,className:t="",...r})=>c.jsx("li",{className:t,...r,children:e}),ko=({children:e,className:t="",...r})=>c.jsx("a",{className:t,...r,children:e}),Co=({children:e,className:t="",...r})=>c.jsx("form",{className:t,...r,children:e}),ud=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 fd(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 us=({children:e,label:t,error:r,options:n,className:o="",value:a,onChange:s,disabled:l,searchable:f=!1,searchPlaceholder:h,editorAttrs:d,...i})=>{const[u,g]=C.useState(!1),[p,m]=C.useState(""),[w,x]=C.useState(null),O=C.useRef(null),v=C.useRef(null),E=C.useRef(null),A=C.useRef(null),_=C.useMemo(()=>n?Array.isArray(n)?n.length===0?[]:typeof n[0]=="string"?n.map(S=>({value:S,label:fd(S)})):n:(ud.warn("options prop is not an array:",n),null):null,[n]),M=C.useMemo(()=>_&&_.find(b=>String(b.value)===String(a))?.label||"",[_,a]),k=C.useMemo(()=>{if(!_)return null;if(!f||p.trim()==="")return _;const S=p.trim().toLowerCase();return _.filter(b=>b.label.toLowerCase().includes(S)||String(b.value).toLowerCase().includes(S))},[_,f,p]);C.useEffect(()=>{if(u&&f){m("");const S=setTimeout(()=>E.current?.focus(),0);return()=>clearTimeout(S)}u||m("")},[u,f]);const y=C.useCallback(()=>{if(!v.current)return;const S=v.current.getBoundingClientRect(),b=window.innerHeight-S.bottom,U=b<280&&S.top>b;x(U?{bottom:window.innerHeight-S.top+4,left:S.left,width:S.width}:{top:S.bottom+4,left:S.left,width:S.width})},[]);C.useEffect(()=>{if(!u){x(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 S=b=>{const z=b.target;O.current&&!O.current.contains(z)&&(!A.current||!A.current.contains(z))&&g(!1)};return u&&document.addEventListener("mousedown",S),()=>{document.removeEventListener("mousedown",S)}},[u]),C.useEffect(()=>{const S=b=>{b.key==="Escape"&&u&&(g(!1),v.current?.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[u]);const N=()=>{l||g(!u)},I=S=>{s&&s({target:{value:S},preventDefault:()=>{},stopPropagation:()=>{},type:"change"}),g(!1),v.current?.focus()};if(!_)return c.jsx("select",{className:o,value:a,onChange:s,disabled:l,...d,...i,children:e});const F=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=F?`${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}`,$={...d,...i};return c.jsxs(j,{ref:O,className:"relative",...$,children:[c.jsxs(J,{ref:v,type:"button",onClick:N,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:[c.jsx(re,{className:"truncate",children:M||" "}),c.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:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),u&&w&&or.createPortal(c.jsxs(j,{ref:A,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:w.top,bottom:w.bottom,left:w.left,width:w.width},role:"listbox",children:[f&&c.jsx(j,{className:"p-2 border-b border-gray-200 dark:border-gray-600",children:c.jsx(Et,{ref:E,type:"text",value:p,onChange:S=>m(S.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"})}),c.jsxs(j,{className:"py-2 max-h-60 overflow-auto",children:[k&&k.length===0&&c.jsx(j,{className:"px-4 py-3 text-sm text-gray-500 dark:text-gray-400 text-center",children:p?"No results":""}),(k??[]).map(S=>{const b=String(S.value)===String(a);return c.jsxs(J,{type:"button",onClick:()=>!S.disabled&&I(S.value),disabled:S.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"} ${S.disabled?"opacity-50 cursor-not-allowed":"cursor-pointer"}`,role:"option","aria-selected":b,children:[c.jsx(re,{children:S.label}),b&&c.jsx(En,{className:"w-5 h-5 text-blue-600 dark:text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})]},S.value)})]})]}),document.body)]})},gd=({children:e,className:t="",...r})=>c.jsx("option",{className:t,...r,children:e}),hd=({children:e,className:t="",...r})=>c.jsx("optgroup",{className:t,...r,children:e}),fs=C.forwardRef(({label:e,className:t="",...r},n)=>c.jsx("input",{ref:n,type:"checkbox",className:t,...r}));fs.displayName="Checkbox";const pd=({children:e,className:t="",...r})=>c.jsx("table",{className:t,...r,children:e}),md=({children:e,className:t="",...r})=>c.jsx("thead",{className:t,...r,children:e}),bd=({children:e,className:t="",...r})=>c.jsx("tbody",{className:t,...r,children:e}),yd=({children:e,className:t="",...r})=>c.jsx("tr",{className:t,...r,children:e}),vd=({children:e,className:t="",...r})=>c.jsx("th",{className:t,...r,children:e}),wd=({children:e,className:t="",...r})=>c.jsx("td",{className:t,...r,children:e}),Qr=C.forwardRef(({children:e,className:t="",...r},n)=>c.jsx("nav",{ref:n,className:t,...r,children:e}));Qr.displayName="Nav";const gs=({children:e,className:t="",...r})=>c.jsx("section",{className:t,...r,children:e}),xd=({children:e,className:t="",...r})=>c.jsx("code",{className:t,...r,children:e}),So=C.forwardRef(({className:e="",...t},r)=>c.jsx("hr",{ref:r,className:e,...t})),kd=C.forwardRef(({children:e,className:t="",...r},n)=>c.jsx("header",{ref:n,className:t,...r,children:e})),hs=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,_o=e=>{const t=hs(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},Cd=()=>{const e=localStorage.getItem("g7_color_scheme");return e&&["auto","light","dark"].includes(e)?e:"auto"},Nn=({onThemeChange:e,className:t="",autoText:r="System",lightText:n="Light",darkText:o="Dark",id:a,editorAttrs:s})=>{const l=Cd(),[f,h]=C.useState(l),[d,i]=C.useState(!1),u=C.useRef(null);C.useEffect(()=>{_o(f)},[]),C.useEffect(()=>{if(f!=="auto")return;const m=window.matchMedia("(prefers-color-scheme: dark)"),w=()=>{_o("auto")};return m.addEventListener("change",w),()=>m.removeEventListener("change",w)},[f]),C.useEffect(()=>{const m=w=>{u.current&&!u.current.contains(w.target)&&i(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const g=m=>{h(m),localStorage.setItem("g7_color_scheme",m),_o(m),i(!1),e?.(m)},p=()=>hs(f)==="dark"?rt.Moon:rt.Sun;return c.jsxs(j,{ref:u,className:`relative ${t}`,id:a,...s,children:[c.jsx(J,{onClick:()=>i(!d),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:c.jsx(ge,{name:p(),className:"w-5 h-5"})}),d&&c.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:c.jsxs(j,{className:"py-2",children:[c.jsxs(J,{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:[c.jsx(ge,{name:rt.Settings,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:r}),f==="auto"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(J,{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:[c.jsx(ge,{name:rt.Sun,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:n}),f==="light"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]}),c.jsxs(J,{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:[c.jsx(ge,{name:rt.Moon,className:"w-5 h-5 text-gray-600 dark:text-gray-400"}),c.jsx(re,{className:"flex-1 text-left text-gray-900 dark:text-white",children:o}),f==="dark"&&c.jsx(ge,{name:rt.Check,className:"w-4 h-4 text-blue-600 dark:text-blue-400 ml-auto"})]})]})})]})},Sd=Object.freeze(Object.defineProperty({__proto__:null,ThemeToggle:Nn,default:Nn},Symbol.toStringTag,{value:"Module"})),ps={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"},_d="rounded-full overflow-hidden flex-shrink-0 border border-gray-200 dark:border-gray-700",Ed="grayscale opacity-50",Eo={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"},Jr=({author:e,name:t,avatar:r,size:n="md",className:o="",text:a,isWithdrawn:s=!1,isGuest:l=!1,id:f,editorAttrs:h})=>{const d=r??e?.avatar,i=a??t??e?.name??"?",u=s||e?.status==="withdrawn",g=l||e?.is_guest||!1,p=C.useMemo(()=>[ps[n]||ps.md,_d,u?Ed:"",o].filter(Boolean).join(" "),[n,u,o]),m=g?Eo.guest:u?Eo.withdrawn:Eo.normal,w=()=>g?c.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:c.jsx(ge,{name:"user",className:"text-gray-400 dark:text-gray-500"})}):u?c.jsx(j,{className:`w-full h-full flex items-center justify-center ${m}`,children:c.jsx(ge,{name:"user",className:"text-gray-500 dark:text-gray-400"})}):c.jsx(j,{className:`w-full h-full flex items-center justify-center text-white font-semibold ${m}`,children:i.charAt(0).toUpperCase()});return c.jsx(j,{className:p,id:f,...h,children:d&&!g&&!u?c.jsx(zt,{src:d,alt:i,className:"w-full h-full object-cover"}):w()})},Td=Object.freeze(Object.defineProperty({__proto__:null,Avatar:Jr},Symbol.toStringTag,{value:"Module"})),Nd=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 ms(e,t){return t&&e&&typeof e.id=="string"&&e.id.length>0?{...e,id:`${e.id}__${t}`}:e}const An=({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},[]),d=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:(d(),p.subscribeToSlot(e,()=>{d(),f({})}))},[e,h,d]);const i=C.useCallback(()=>{const p=window.G7Core;return p?p.getDynamicRenderer?.():null},[]);if(s.length===0)return r?c.jsx(j,{className:t,style:n,id:o,children:r}):a?c.jsx(j,{className:t,style:n,id:o,children:a}):null;const u=i(),g=window.G7Core;return!u||!g?(Nd.error("G7Core or DynamicRenderer not available"),null):c.jsxs(j,{className:t,style:n,id:o,children:[s.map(p=>{const{componentDef:m,dataContext:w,parentFormContext:x,getParentComponentContext:O,translationContext:v}=p,E=ms(m,o);return c.jsx(u,{componentDef:E,dataContext:w,translationContext:v,registry:g.getComponentRegistry(),bindingEngine:g.getDataBindingEngine(),translationEngine:g.getTranslationEngine(),actionDispatcher:g.getActionDispatcher(),parentComponentContext:O?.(),parentFormContextProp:x,isRootRenderer:!1},E.id||`slot-${e}-${p.order}`)}),a]})},Ad=Object.freeze(Object.defineProperty({__proto__:null,SlotContainer:An,default:An,scopeSlotChildDef:ms},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:d,onClose:i,onLoadMore:u,onMarkAllRead:g,onDeleteAll:p,onDelete:m,onUnreadOnlyToggle:w,dropdownAlign:x="right",className:O="",id:v,editorAttrs:E})=>{const[A,_]=C.useState(!1),M=C.useRef(null),k=C.useRef(null),y=C.useRef(null),N=C.useRef(null),I=C.useRef(new Set),F=C.useRef(u),P=C.useRef(r),L=C.useRef(n),$=C.useRef(e.length),S=C.useRef(-1);C.useEffect(()=>{F.current=u,P.current=r,L.current=n,$.current=e.length}),C.useEffect(()=>{if(!N.current||!y.current||!A)return;S.current=-1;const H=new IntersectionObserver(([Y])=>{Y.isIntersecting&&(L.current||!P.current||S.current!==$.current&&(S.current=$.current,F.current?.()))},{root:y.current,threshold:.1});return H.observe(N.current),()=>H.disconnect()},[A]),C.useEffect(()=>{if(!y.current||!A)return;const H=new IntersectionObserver(B=>{B.forEach(X=>{const G=X.target.getAttribute("data-notification-id"),W=X.target.getAttribute("data-unread")==="true";G&&W&&X.isIntersecting&&I.current.add(G)})},{root:y.current,threshold:.5});return y.current.querySelectorAll("[data-notification-id]").forEach(B=>H.observe(B)),()=>H.disconnect()},[A,e]);const b=t>0?t:e.filter(H=>!H.read).length,z=C.useCallback(()=>{if(A){if(b>0){const H=Array.from(I.current).filter(Y=>{const B=e.find(X=>String(X.id)===String(Y));return B&&!B.read});H.length>0&&i?.(H)}I.current.clear(),_(!1)}},[A,i,b,e]);C.useEffect(()=>{if(!A)return;const H=Y=>{M.current&&!M.current.contains(Y.target)&&z()};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[A,z]);const U=C.useCallback(()=>{A?z():_(!0)},[A,z]);return C.useLayoutEffect(()=>{const H=k.current;if(!A||!H)return;H.style.transform="";const Y=H.getBoundingClientRect(),B=typeof window<"u"?window.innerWidth:0;if(Y.width===0&&Y.height===0)return;const X=8;let G=0;Y.right>B-X?G=-(Y.right-(B-X)):Y.left<X&&(G=X-Y.left),G!==0&&(H.style.transform=`translateX(${G}px)`)},[A,x,e.length]),c.jsxs(j,{ref:M,className:`relative ${O}`,id:v,...E,children:[c.jsxs(J,{onClick:U,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:[c.jsx(ge,{name:rt.Bell,className:"w-5 h-5"}),b>0&&c.jsx(re,{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})]}),A&&c.jsxs(j,{ref:k,className:`absolute ${x==="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:[c.jsxs(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700 flex items-center justify-between gap-2",children:[c.jsxs(j,{className:"flex items-center gap-3 min-w-0",children:[c.jsx(re,{className:"font-semibold text-gray-900 dark:text-white",children:o}),w&&c.jsxs(j,{className:"flex items-center gap-1.5 cursor-pointer select-none",onClick:()=>w(!h),children:[c.jsx(Et,{type:"checkbox",checked:h,onChange:H=>{H.stopPropagation(),w(H.target.checked)},onClick:H=>H.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"}),c.jsx(re,{className:"text-xs text-gray-600 dark:text-gray-400",children:f})]})]}),c.jsxs(j,{className:"flex items-center gap-3 flex-shrink-0",children:[g&&b>0&&c.jsx(J,{onClick:()=>{g(),I.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&&c.jsx(J,{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})]})]}),c.jsx(j,{ref:y,className:"max-h-96 overflow-y-auto",children:e.length===0&&!n?c.jsx(j,{className:"px-4 py-8 text-center text-gray-500 dark:text-gray-400",children:c.jsx(re,{children:a})}):c.jsxs(c.Fragment,{children:[e.map(H=>{const Y=!H.read;return c.jsxs(j,{"data-notification-id":H.id,"data-unread":Y?"true":"false",onClick:()=>{H.onClick?.(),d?.(H),_(!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 ${Y?"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:[H.iconName&&c.jsx(ge,{name:H.iconName,className:`w-5 h-5 mt-0.5 flex-shrink-0 ${Y?"text-blue-600 dark:text-blue-400":"text-gray-400 dark:text-gray-500"}`}),c.jsxs(j,{className:"flex-1 min-w-0",children:[c.jsx(j,{className:`text-sm truncate ${Y?"font-semibold text-gray-900 dark:text-white":"font-normal text-gray-600 dark:text-gray-400"}`,children:H.title}),c.jsx(j,{className:`text-sm mt-1 line-clamp-2 ${Y?"text-gray-700 dark:text-gray-300":"text-gray-500 dark:text-gray-500"}`,children:H.message}),c.jsx(j,{className:"text-gray-400 dark:text-gray-500 text-xs mt-1 font-mono",children:H.time})]}),c.jsxs(j,{className:"flex flex-col items-center gap-2 flex-shrink-0",children:[Y&&c.jsx(re,{className:"w-2 h-2 bg-blue-500 dark:bg-blue-400 rounded-full mt-1.5"}),m&&c.jsx(J,{onClick:B=>{B.stopPropagation(),m(H)},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:c.jsx(ge,{name:rt.Trash,className:"w-4 h-4"})})]})]},H.id)}),r&&c.jsx(j,{ref:N,className:"px-4 py-3 text-center",children:n?c.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."}):c.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500"})}),n&&!r&&e.length>0&&c.jsx(j,{className:"px-4 py-2 text-center",children:c.jsx(re,{className:"text-sm text-gray-400 dark:text-gray-500",children:"..."})})]})})]})]})},Od=Object.freeze(Object.defineProperty({__proto__:null,NotificationCenter:On,default:On},Symbol.toStringTag,{value:"Module"})),qe=(e,t)=>window.G7Core?.t?.(e,t)??e,wt=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},bs=({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:d="/shop",className:i="",editorAttrs:u,notifications:g=[],notificationHasMore:p=!1,notificationLoading:m=!1,notificationUnreadOnly:w=!1,notificationTitleText:x,notificationEmptyText:O,notificationMarkAllReadText:v,notificationDeleteAllText:E,notificationUnreadOnlyText:A,onNotificationClose:_,onNotificationClick:M,onNotificationLoadMore:k,onNotificationMarkAllRead:y,onNotificationDeleteAll:N,onNotificationDelete:I,onNotificationUnreadOnlyToggle:F})=>{const[P,L]=C.useState(""),[$,S]=C.useState(!1),[b,z]=C.useState(!1),[U,H]=C.useState(!1),[Y,B]=C.useState({top:0,left:0}),[X,G]=C.useState(window.location.pathname),W=C.useRef(null),Q=C.useRef(null),me=C.useRef(null),pe=window.G7Core?.useResponsive,ne=pe?.(),ce=ne?ne.width<768:typeof window<"u"&&window.innerWidth<768;C.useEffect(()=>{const K=()=>G(window.location.pathname);window.addEventListener("popstate",K);const oe=history.pushState;return history.pushState=function(...te){oe.apply(this,te),G(window.location.pathname)},()=>{window.removeEventListener("popstate",K),history.pushState=oe}},[]);const ve=(K,oe=!1)=>oe?X===K:X===K||X.startsWith(K+"/"),Se=()=>{const K=d==="/"?"":d;return X.startsWith(`${K}/products`)||X.startsWith(`${K}/cart`)||X.startsWith(`${K}/checkout`)||X.startsWith(`${K}/category`)},ze=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)&&S(!1),Q.current&&!Q.current.contains(oe.target)&&z(!1),me.current&&!me.current.contains(oe.target)&&H(!1)};return document.addEventListener("mousedown",K),()=>document.removeEventListener("mousedown",K)},[]);const ie=a.slice(0,s),De=a.slice(s),Ae=K=>{K.preventDefault(),P.trim()&&wt(`/search?q=${encodeURIComponent(P)}`)},ke=async()=>{window.G7Core?.dispatch?.({handler:"logout"})},je=K=>{window.G7Core?.dispatch?.({handler:"setLocale",target:K}),H(!1)},$e=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 c.jsxs(kd,{...u??{},className:`sticky top-0 z-50 bg-white dark:bg-gray-900 border-b border-gray-200 dark:border-gray-800 ${i}`,children:[c.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:c.jsxs(j,{className:"flex items-center justify-between h-16",children:[c.jsx(J,{onClick:()=>wt("/"),className:"flex items-center gap-2 flex-shrink-0 cursor-pointer",children:e?c.jsx(zt,{src:e,alt:t,className:"h-8"}):c.jsx(re,{className:"text-xl font-bold text-gray-900 dark:text-white",children:t})}),!ce&&c.jsx(Co,{onSubmit:Ae,className:"flex flex-1 max-w-lg mx-8",children:c.jsxs(j,{className:"relative w-full",children:[c.jsx(Et,{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"}),c.jsx(ge,{name:"search",className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500"})]})}),c.jsxs(j,{className:"flex items-center gap-2",children:[c.jsx(Nn,{autoText:qe("common.theme.auto"),lightText:qe("common.theme.light"),darkText:qe("common.theme.dark")}),r?.uuid&&c.jsx(On,{notifications:g,unreadCount:o,hasMore:p,loading:m,unreadOnly:w,titleText:x??qe("mypage.notifications.title"),emptyText:O??qe("mypage.notifications.empty"),markAllReadText:v??qe("mypage.notifications.mark_all_read"),deleteAllText:E??qe("mypage.notifications.delete_all"),unreadOnlyText:A??qe("mypage.notifications.unread_only"),onClose:_,onNotificationClick:M,onLoadMore:k,onMarkAllRead:y,onDeleteAll:N,onDelete:I,onUnreadOnlyToggle:F,dropdownAlign:"right"}),c.jsxs(J,{onClick:()=>wt(`${d}/cart`),className:"relative p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:[c.jsx(ge,{name:"shopping-cart",className:"w-5 h-5"}),n>0&&c.jsx(re,{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&&c.jsxs(j,{ref:me,className:"relative",children:[c.jsxs(J,{onClick:()=>H(!U),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":U,"aria-label":qe("common.language"),children:[c.jsx(ge,{name:"globe",className:"w-4 h-4"}),c.jsx(re,{className:"font-medium uppercase",children:h}),c.jsx(ge,{name:"chevron-down",className:"w-3 h-3"})]}),U&&c.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 c.jsxs(J,{role:"option","aria-selected":oe,onClick:()=>je(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:[c.jsx(ge,{name:"globe",className:"w-4 h-4"}),c.jsx(re,{className:"flex-1 font-medium",children:$e(K)}),oe&&c.jsx(ge,{name:"check",className:"w-4 h-4"})]},K)})})]}),c.jsx(An,{slotId:"header_currency",id:"header_currency_slot_desktop",className:"flex items-center"}),r?.uuid?c.jsxs(j,{ref:W,className:"relative",children:[c.jsxs(J,{onClick:()=>S(!$),className:"flex items-center gap-2 p-2 text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white",children:[c.jsx(Jr,{avatar:r.avatar,name:r.name,size:"sm"}),c.jsx(re,{className:"hidden sm:inline text-sm font-medium",children:r.name}),c.jsx(ge,{name:"chevron-down",className:"w-4 h-4"})]}),$&&c.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:[c.jsx(j,{className:"px-4 py-3 border-b border-gray-200 dark:border-gray-700",children:c.jsxs(j,{className:"flex items-center gap-3",children:[c.jsx(Jr,{avatar:r.avatar,name:r.name,size:"md"}),c.jsxs(j,{children:[c.jsx(j,{className:"text-sm font-medium text-gray-900 dark:text-white",children:r.name}),c.jsx(j,{className:"text-xs text-gray-500 dark:text-gray-400",children:qe("common.member")})]})]})}),c.jsxs(j,{className:"py-1",children:[r.is_admin&&c.jsxs(c.Fragment,{children:[c.jsxs(ko,{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:[c.jsx(ge,{name:"settings",className:"inline w-4 h-4 mr-2"}),qe("common.admin_menu")]}),c.jsx(So,{className:"my-1 border-gray-200 dark:border-gray-700"})]}),c.jsxs(J,{onClick:()=>{wt("/mypage"),S(!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:[c.jsx(ge,{name:"user",className:"inline w-4 h-4 mr-2"}),qe("common.mypage")]}),c.jsxs(J,{onClick:()=>{wt("/mypage/orders"),S(!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:[c.jsx(ge,{name:"shopping-bag",className:"inline w-4 h-4 mr-2"}),qe("mypage.tabs.orders")]}),c.jsxs(J,{onClick:()=>{wt("/mypage/wishlist"),S(!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:[c.jsx(ge,{name:"heart",className:"inline w-4 h-4 mr-2"}),qe("mypage.tabs.wishlist")]})]}),c.jsx(So,{className:"my-1 border-gray-200 dark:border-gray-700"}),c.jsxs(J,{onClick:ke,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:[c.jsx(ge,{name:"log-out",className:"inline w-4 h-4 mr-2"}),qe("auth.logout")]})]})]}):c.jsxs(j,{className:"flex items-center gap-1.5",children:[c.jsx(J,{onClick:()=>wt("/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")}),c.jsx(J,{onClick:()=>wt("/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")}),c.jsx(J,{onClick:()=>wt("/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")})]}),ce&&c.jsx(J,{onClick:l,className:"p-2 text-gray-600 dark:text-gray-400",children:c.jsx(ge,{name:"menu",className:"w-6 h-6"})})]})]})}),!ce&&c.jsx(Qr,{className:"border-t border-gray-200 dark:border-gray-800",children:c.jsx(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:c.jsxs(j,{className:"flex items-center gap-1 h-12 overflow-x-auto",children:[c.jsx(J,{onClick:()=>wt("/"),className:ze(ve("/",!0)),"data-testid":"nav-home",children:qe("nav.home")}),c.jsxs(J,{onClick:()=>wt("/boards/popular"),className:`flex items-center gap-1 ${ze(ve("/boards/popular"))}`,"data-testid":"nav-popular",children:[c.jsx(re,{className:"text-orange-500",children:"🔥"}),qe("nav.popular")]}),c.jsxs(J,{onClick:()=>wt(`${d==="/"?"":d}/products`),className:`flex items-center gap-1 ${ze(Se())}`,"data-testid":"nav-shop",children:[c.jsx(re,{children:"🛒"}),qe("nav.shop")]}),ie.map(K=>c.jsxs(J,{onClick:()=>wt(`/board/${K.slug}`),className:ze(ve(`/board/${K.slug}`)),children:[K.icon&&c.jsx(re,{className:"mr-1",children:K.icon}),K.name]},K.id)),De.length>0&&c.jsxs(j,{ref:Q,className:"relative",children:[c.jsxs(J,{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"),c.jsx(ge,{name:"chevron-down",className:"w-4 h-4"})]}),b&&c.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:`${Y.top}px`,left:`${Y.left}px`},children:De.map(K=>{const oe=ve(`/board/${K.slug}`);return c.jsxs(J,{onClick:()=>{wt(`/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&&c.jsx(re,{className:"mr-1",children:K.icon}),K.name]},K.id)})})]})]})})})]})},Md=Object.freeze(Object.defineProperty({__proto__:null,default:bs},Symbol.toStringTag,{value:"Module"})),Id=C.forwardRef(({children:e,className:t="",...r},n)=>c.jsx("footer",{ref:n,className:t,...r,children:e})),Tt=(e,t)=>window.G7Core?.t?.(e,t)??e,Dd=768,ys=1024,Pd=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},vs=({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:ys),u=i<Dd,g=i>=ys,p=u?1:g?5:2,m=[{title:Tt("footer.community"),links:[{label:Tt("nav.home"),href:"/"},{label:Tt("nav.popular"),href:"/boards/popular"},{label:Tt("footer.all_boards"),href:"/boards"}]},{title:Tt("footer.info"),links:[{label:Tt("footer.about"),href:"/page/about"},{label:Tt("footer.faq"),href:"/page/faq"},{label:Tt("footer.contact"),href:"/page/contact"}]},{title:Tt("footer.policy"),links:[{label:Tt("footer.terms"),href:"/page/terms"},{label:Tt("footer.privacy"),href:"/page/privacy"},{label:Tt("footer.refund"),href:"/page/refund"}]}],w=o||m,x={github:"github",twitter:"twitter",discord:"discord",facebook:"facebook",instagram:"instagram"};return c.jsx(Id,{...s??{},className:`bg-gray-50 dark:bg-gray-900 border-t border-gray-200 dark:border-gray-800 ${a}`,children:c.jsxs(j,{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[c.jsxs(j,{className:"grid gap-8",style:{gridTemplateColumns:`repeat(${p}, minmax(0, 1fr))`},children:[c.jsxs(j,{style:g?{gridColumn:"span 2 / span 2"}:void 0,children:[c.jsx(Tn,{className:"text-lg font-bold text-gray-900 dark:text-white",children:e}),t&&c.jsx(Ut,{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:t}),c.jsx(j,{className:"mt-4 flex items-center gap-4",children:Object.entries(n).map(([O,v])=>v?c.jsx(ko,{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":O,children:c.jsx(ge,{name:x[O],className:"w-5 h-5"})},O):null)})]}),w.map((O,v)=>c.jsxs(j,{children:[c.jsx(ds,{className:"text-sm font-semibold text-gray-900 dark:text-white uppercase tracking-wider",children:O.title}),c.jsx(xo,{className:"mt-4 space-y-2",children:O.links.map((E,A)=>c.jsx(rr,{children:c.jsx(J,{onClick:()=>Pd(E.href),className:"text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white cursor-pointer",children:E.label})},A))})]},v))]}),c.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:[c.jsx(Ut,{className:"text-sm text-gray-500 dark:text-gray-400",children:r||`© ${l} ${e}. All rights reserved.`}),c.jsx(Ut,{className:"text-sm text-gray-500 dark:text-gray-400",children:Tt("footer.powered_by")})]})]})})},Ld=Object.freeze(Object.defineProperty({__proto__:null,default:vs},Symbol.toStringTag,{value:"Module"})),Ht=(e,t)=>window.G7Core?.t?.(e,t)??e,Pt=e=>{window.G7Core?.dispatch?.({handler:"navigate",params:{path:e}})},ws=({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,d=h?.(),i=d?d.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:c.jsxs(j,{className:"fixed inset-0 z-50",onClick:u,children:[c.jsx(j,{className:"fixed inset-0 bg-black/50 transition-opacity"}),c.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:[c.jsxs(j,{className:"flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-800",children:[c.jsx(J,{onClick:()=>{t(),Pt("/")},className:"flex items-center gap-2 cursor-pointer",children:r?c.jsx(zt,{src:r,alt:n,className:"h-8"}):c.jsx(re,{className:"text-xl font-bold text-gray-900 dark:text-white",children:n})}),c.jsx(J,{onClick:t,className:"p-2 text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200","aria-label":"메뉴 닫기",children:c.jsx(ge,{name:"x",className:"w-6 h-6"})})]}),o?c.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:c.jsxs(j,{className:"flex items-center gap-3",children:[o.avatar?c.jsx(zt,{src:o.avatar,alt:o.name,className:"w-12 h-12 rounded-full"}):c.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()}),c.jsxs(j,{children:[c.jsx(Ut,{className:"font-medium text-gray-900 dark:text-white",children:o.name}),c.jsx(J,{onClick:()=>{t(),Pt("/mypage")},className:"text-sm text-blue-600 dark:text-blue-400 hover:underline cursor-pointer",children:Ht("common.mypage")})]})]})}):c.jsx(j,{className:"p-4 border-b border-gray-200 dark:border-gray-800",children:c.jsxs(j,{className:"flex gap-2",children:[c.jsx(J,{onClick:()=>{t(),Pt("/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:Ht("auth.login")}),c.jsx(J,{onClick:()=>{t(),Pt("/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:Ht("auth.register")})]})}),c.jsx(Qr,{className:"p-4 overflow-y-auto max-h-[calc(100vh-200px)]",children:c.jsxs(xo,{className:"space-y-1",children:[c.jsx(rr,{children:c.jsxs(J,{onClick:()=>{t(),Pt("/")},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:[c.jsx(ge,{name:"home",className:"w-5 h-5"}),Ht("nav.home")]})}),c.jsx(rr,{children:c.jsxs(J,{onClick:()=>{t(),Pt("/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:[c.jsx(re,{className:"text-orange-500",children:"🔥"}),Ht("nav.popular")]})}),c.jsx(rr,{children:c.jsxs(J,{onClick:()=>{t(),Pt("/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:[c.jsx(re,{children:"🛒"}),Ht("nav.shop")]})}),c.jsx(rr,{children:c.jsxs(J,{onClick:()=>{t(),Pt("/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:[c.jsx(ge,{name:"shopping-cart",className:"w-5 h-5"}),Ht("nav.cart"),s>0&&c.jsx(re,{className:"ml-auto px-2 py-0.5 text-xs bg-blue-500 text-white rounded-full",children:s})]})}),c.jsx(rr,{className:"my-4 border-t border-gray-200 dark:border-gray-800"}),c.jsx(rr,{className:"px-3 py-2 text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider",children:Ht("nav.boards")}),a.map(g=>c.jsx(rr,{children:c.jsxs(J,{onClick:()=>{t(),Pt(`/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&&c.jsx(re,{children:g.icon}),g.name]})},g.id))]})}),c.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:c.jsxs(j,{className:"flex items-center justify-between text-sm text-gray-500 dark:text-gray-400",children:[c.jsx(J,{onClick:()=>{t(),Pt("/about")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Ht("footer.about")}),c.jsx(J,{onClick:()=>{t(),Pt("/terms")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Ht("footer.terms")}),c.jsx(J,{onClick:()=>{t(),Pt("/privacy")},className:"hover:text-gray-700 dark:hover:text-gray-200 cursor-pointer",children:Ht("footer.privacy")})]})})]})]})},Fd=Object.freeze(Object.defineProperty({__proto__:null,default:ws},Symbol.toStringTag,{value:"Module"}));function xs(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 $d(e){if(Array.isArray(e))return e}function Ud(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(d){h=!0,o=d}finally{try{if(!f&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw o}}return l}}function zd(){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 Hd(e,t){return $d(e)||Ud(e,t)||Gd(e,t)||zd()}function Gd(e,t){if(e){if(typeof e=="string")return xs(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)?xs(e,t):void 0}}const ks=Object.entries,Cs=Object.setPrototypeOf,jd=Object.isFrozen,Bd=Object.getPrototypeOf,Wd=Object.getOwnPropertyDescriptor;let ut=Object.freeze,ft=Object.seal,Ar=Object.create,Ss=typeof Reflect<"u"&&Reflect,To=Ss.apply,No=Ss.construct;ut||(ut=function(t){return t}),ft||(ft=function(t){return t}),To||(To=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)}),No||(No=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 Or=tt(Array.prototype.forEach),Kd=tt(Array.prototype.lastIndexOf),_s=tt(Array.prototype.pop),Mr=tt(Array.prototype.push),Vd=tt(Array.prototype.splice),ar=Array.isArray,Rr=tt(String.prototype.toLowerCase),Ao=tt(String.prototype.toString),Es=tt(String.prototype.match),en=tt(String.prototype.replace),Ts=tt(String.prototype.indexOf),Yd=tt(String.prototype.trim),Xd=tt(Number.prototype.toString),Zd=tt(Boolean.prototype.toString),Ns=typeof BigInt>"u"?null:tt(BigInt.prototype.toString),As=typeof Symbol>"u"?null:tt(Symbol.prototype.toString),at=tt(Object.prototype.hasOwnProperty),tn=tt(Object.prototype.toString),st=tt(RegExp.prototype.test),hr=qd(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 To(e,t,n)}}function qd(e){return function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return No(e,r)}}function Ge(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Rr;if(Cs&&Cs(e,null),!ar(t))return e;let n=t.length;for(;n--;){let o=t[n];if(typeof o=="string"){const a=r(o);a!==o&&(jd(t)||(t[n]=a),o=a)}e[o]=!0}return e}function Qd(e){for(let t=0;t<e.length;t++)at(e,t)||(e[t]=null);return e}function yt(e){const t=Ar(null);for(const n of ks(e)){var r=Hd(n,2);const o=r[0],a=r[1];at(e,o)&&(ar(a)?t[o]=Qd(a):a&&typeof a=="object"&&a.constructor===Object?t[o]=yt(a):t[o]=a)}return t}function Jd(e){switch(typeof e){case"string":return e;case"number":return Xd(e);case"boolean":return Zd(e);case"bigint":return Ns?Ns(e):"0";case"symbol":return As?As(e):"Symbol()";case"undefined":return tn(e);case"function":case"object":{if(e===null)return tn(e);const t=e,r=Zt(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 Zt(e,t){for(;e!==null;){const n=Wd(e,t);if(n){if(n.get)return tt(n.get);if(typeof n.value=="function")return tt(n.value)}e=Bd(e)}function r(){return null}return r}function Rd(e){try{return st(e,""),!0}catch{return!1}}const Os=ut(["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"]),Oo=ut(["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"]),Mo=ut(["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"]),eu=ut(["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"]),Io=ut(["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"]),tu=ut(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ms=ut(["#text"]),Is=ut(["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"]),Do=ut(["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","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","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"]),Ds=ut(["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=ut(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ru=ft(/{{[\w\W]*|^[\w\W]*}}/g),nu=ft(/<%[\w\W]*|^[\w\W]*%>/g),ou=ft(/\${[\w\W]*/g),au=ft(/^data-[\-\w.\u00B7-\uFFFF]+$/),su=ft(/^aria-[\-\w]+$/),Ps=ft(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),lu=ft(/^(?:\w+script|data):/i),iu=ft(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cu=ft(/^html$/i),du=ft(/^[a-z][.\w]*(-[.\w]+)+$/i),Ls=ft(/<[/\w!]/g),Fs=ft(/<[/\w]/g),uu=ft(/<\/no(script|embed|frames)/i),fu=ft(/\/>/i),Nt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gu=function(){return typeof window>"u"?null:window},hu=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}},$s=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},sr=function(t,r,n,o){return at(t,r)&&ar(t[r])?Ge(o.base?yt(o.base):{},t[r],o.transform):n};function Us(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:gu();const t=R=>Us(R);if(t.version="3.4.12",t.removed=[],!e||!e.document||e.document.nodeType!==Nt.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 d=e.DOMParser,i=e.trustedTypes,u=l.prototype,g=Zt(u,"cloneNode"),p=Zt(u,"remove"),m=Zt(u,"nextSibling"),w=Zt(u,"childNodes"),x=Zt(u,"parentNode"),O=Zt(u,"shadowRoot"),v=Zt(u,"attributes"),E=s&&s.prototype?Zt(s.prototype,"nodeType"):null,A=s&&s.prototype?Zt(s.prototype,"nodeName"):null;if(typeof a=="function"){const R=r.createElement("template");R.content&&R.content.ownerDocument&&(r=R.content.ownerDocument)}let _,M="",k,y=!1,N=0;const I=function(){if(N>0)throw hr('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.')},F=function(D){I(),N++;try{return _.createHTML(D)}finally{N--}},P=function(D){I(),N++;try{return _.createScriptURL(D)}finally{N--}},L=function(){return y||(k=hu(i,o),y=!0),k},$=r,S=$.implementation,b=$.createNodeIterator,z=$.createDocumentFragment,U=$.getElementsByTagName,H=n.importNode;let Y=$s();t.isSupported=typeof ks=="function"&&typeof x=="function"&&S&&S.createHTMLDocument!==void 0;const B=ru,X=nu,G=ou,W=au,Q=su,me=lu,se=iu,pe=du;let ne=Ps,ce=null;const ve=Ge({},[...Os,...Oo,...Mo,...Io,...Ms]);let Se=null;const ze=Ge({},[...Is,...Do,...Ds,...Mn]);let ie=Object.seal(Ar(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}})),De=null,Ae=null;const ke=Object.seal(Ar(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let je=!0,$e=!0,K=!1,oe=!0,te=!1,ae=!0,be=!1,Me=!1,Xe=null,Fe=null,Ve=!1,Oe=!1,Z=!1,le=!1,he=!0,ue=!1;const fe="user-content-";let Le=!0,_e=!1,Ee={},we=null;const He=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 Ke=null;const Ne=Ge({},["audio","video","img","source","image","track"]);let xe=null;const Ie=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),We="http://www.w3.org/1998/Math/MathML",Je="http://www.w3.org/2000/svg",Be="http://www.w3.org/1999/xhtml";let Ze=Be,Jt=!1,et=null;const Rt=Ge({},[We,Je,Be],Ao),It=ut(["mi","mo","mn","ms","mtext"]);let Dt=Ge({},It);const fr=ut(["annotation-xml"]);let nr=Ge({},fr);const er=Ge({},["title","style","font","a","script"]);let Vt=null;const Sn=["application/xhtml+xml","text/html"],Tm="text/html";let Qe=null,Zr=null;const Nm=r.createElement("form"),qc=function(D){return D instanceof RegExp||D instanceof Function},rs=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Zr&&Zr===D)return;(!D||typeof D!="object")&&(D={}),D=yt(D),Vt=Sn.indexOf(D.PARSER_MEDIA_TYPE)===-1?Tm:D.PARSER_MEDIA_TYPE,Qe=Vt==="application/xhtml+xml"?Ao:Rr,ce=sr(D,"ALLOWED_TAGS",ve,{transform:Qe}),Se=sr(D,"ALLOWED_ATTR",ze,{transform:Qe}),et=sr(D,"ALLOWED_NAMESPACES",Rt,{transform:Ao}),xe=sr(D,"ADD_URI_SAFE_ATTR",Ie,{transform:Qe,base:Ie}),Ke=sr(D,"ADD_DATA_URI_TAGS",Ne,{transform:Qe,base:Ne}),we=sr(D,"FORBID_CONTENTS",He,{transform:Qe}),De=sr(D,"FORBID_TAGS",yt({}),{transform:Qe}),Ae=sr(D,"FORBID_ATTR",yt({}),{transform:Qe}),Ee=at(D,"USE_PROFILES")?D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?yt(D.USE_PROFILES):D.USE_PROFILES:!1,je=D.ALLOW_ARIA_ATTR!==!1,$e=D.ALLOW_DATA_ATTR!==!1,K=D.ALLOW_UNKNOWN_PROTOCOLS||!1,oe=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,te=D.SAFE_FOR_TEMPLATES||!1,ae=D.SAFE_FOR_XML!==!1,be=D.WHOLE_DOCUMENT||!1,Oe=D.RETURN_DOM||!1,Z=D.RETURN_DOM_FRAGMENT||!1,le=D.RETURN_TRUSTED_TYPE||!1,Ve=D.FORCE_BODY||!1,he=D.SANITIZE_DOM!==!1,ue=D.SANITIZE_NAMED_PROPS||!1,Le=D.KEEP_CONTENT!==!1,_e=D.IN_PLACE||!1,ne=Rd(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:Ps,Ze=typeof D.NAMESPACE=="string"?D.NAMESPACE:Be,Dt=at(D,"MATHML_TEXT_INTEGRATION_POINTS")&&D.MATHML_TEXT_INTEGRATION_POINTS&&typeof D.MATHML_TEXT_INTEGRATION_POINTS=="object"?yt(D.MATHML_TEXT_INTEGRATION_POINTS):Ge({},It),nr=at(D,"HTML_INTEGRATION_POINTS")&&D.HTML_INTEGRATION_POINTS&&typeof D.HTML_INTEGRATION_POINTS=="object"?yt(D.HTML_INTEGRATION_POINTS):Ge({},fr);const V=at(D,"CUSTOM_ELEMENT_HANDLING")&&D.CUSTOM_ELEMENT_HANDLING&&typeof D.CUSTOM_ELEMENT_HANDLING=="object"?yt(D.CUSTOM_ELEMENT_HANDLING):Ar(null);if(ie=Ar(null),at(V,"tagNameCheck")&&qc(V.tagNameCheck)&&(ie.tagNameCheck=V.tagNameCheck),at(V,"attributeNameCheck")&&qc(V.attributeNameCheck)&&(ie.attributeNameCheck=V.attributeNameCheck),at(V,"allowCustomizedBuiltInElements")&&typeof V.allowCustomizedBuiltInElements=="boolean"&&(ie.allowCustomizedBuiltInElements=V.allowCustomizedBuiltInElements),ft(ie),te&&($e=!1),Z&&(Oe=!0),Ee&&(ce=Ge({},Ms),Se=Ar(null),Ee.html===!0&&(Ge(ce,Os),Ge(Se,Is)),Ee.svg===!0&&(Ge(ce,Oo),Ge(Se,Do),Ge(Se,Mn)),Ee.svgFilters===!0&&(Ge(ce,Mo),Ge(Se,Do),Ge(Se,Mn)),Ee.mathMl===!0&&(Ge(ce,Io),Ge(Se,Ds),Ge(Se,Mn))),ke.tagCheck=null,ke.attributeCheck=null,at(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?ke.tagCheck=D.ADD_TAGS:ar(D.ADD_TAGS)&&(ce===ve&&(ce=yt(ce)),Ge(ce,D.ADD_TAGS,Qe))),at(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?ke.attributeCheck=D.ADD_ATTR:ar(D.ADD_ATTR)&&(Se===ze&&(Se=yt(Se)),Ge(Se,D.ADD_ATTR,Qe))),at(D,"ADD_URI_SAFE_ATTR")&&ar(D.ADD_URI_SAFE_ATTR)&&Ge(xe,D.ADD_URI_SAFE_ATTR,Qe),at(D,"FORBID_CONTENTS")&&ar(D.FORBID_CONTENTS)&&(we===He&&(we=yt(we)),Ge(we,D.FORBID_CONTENTS,Qe)),at(D,"ADD_FORBID_CONTENTS")&&ar(D.ADD_FORBID_CONTENTS)&&(we===He&&(we=yt(we)),Ge(we,D.ADD_FORBID_CONTENTS,Qe)),Le&&(ce["#text"]=!0),be&&Ge(ce,["html","head","body"]),ce.table&&(Ge(ce,["tbody"]),delete De.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw hr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const q=_;_=D.TRUSTED_TYPES_POLICY;try{M=F("")}catch(de){throw _=q,de}}else D.TRUSTED_TYPES_POLICY===null?(_=void 0,M=""):(_===void 0&&(_=L()),_&&typeof M=="string"&&(M=F("")));ut&&ut(D),Zr=D},Qc=Ge({},[...Oo,...Mo,...eu]),Jc=Ge({},[...Io,...tu]),Am=function(D,V,q){return V.namespaceURI===Be?D==="svg":V.namespaceURI===We?D==="svg"&&(q==="annotation-xml"||Dt[q]):!!Qc[D]},Om=function(D,V,q){return V.namespaceURI===Be?D==="math":V.namespaceURI===Je?D==="math"&&nr[q]:!!Jc[D]},Mm=function(D,V,q){return V.namespaceURI===Je&&!nr[q]||V.namespaceURI===We&&!Dt[q]?!1:!Jc[D]&&(er[D]||!Qc[D])},Im=function(D){let V=x(D);(!V||!V.tagName)&&(V={namespaceURI:Ze,tagName:"template"});const q=Rr(D.tagName),de=Rr(V.tagName);return et[D.namespaceURI]?D.namespaceURI===Je?Am(q,V,de):D.namespaceURI===We?Om(q,V,de):D.namespaceURI===Be?Mm(q,V,de):!!(Vt==="application/xhtml+xml"&&et[D.namespaceURI]):!1},gr=function(D){Mr(t.removed,{element:D});try{x(D).removeChild(D)}catch{if(p(D),!x(D))throw hr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},po=function(D){ns(D);const V=w(D);if(V){const de=[];Or(V,Ce=>{Mr(de,Ce)}),Or(de,Ce=>{try{p(Ce)}catch{}})}const q=v(D);if(q)for(let de=q.length-1;de>=0;--de){const Ce=q[de],Te=Ce&&Ce.name;if(typeof Te=="string")try{D.removeAttribute(Te)}catch{}}},Er=function(D,V){try{Mr(t.removed,{attribute:V.getAttributeNode(D),from:V})}catch{Mr(t.removed,{attribute:null,from:V})}if(V.removeAttribute(D),D==="is")if(Oe||Z)try{gr(V)}catch{}else try{V.setAttribute(D,"")}catch{}},Dm=function(D){const V=v(D);if(V)for(let q=V.length-1;q>=0;--q){const de=V[q],Ce=de&&de.name;if(!(typeof Ce!="string"||Se[Qe(Ce)]))try{D.removeAttribute(Ce)}catch{}}},ns=function(D){const V=[D];for(;V.length>0;){const q=V.pop();(E?E(q):q.nodeType)===Nt.element&&Dm(q);const Ce=w(q);if(Ce)for(let Te=Ce.length-1;Te>=0;--Te)V.push(Ce[Te])}},Pm=function(D){if(!ae)return;const V=[D];for(;V.length>0;){const q=V.pop(),de=E?E(q):q.nodeType;if(de===Nt.processingInstruction||de===Nt.comment&&st(Fs,q.data)){try{p(q)}catch{}continue}if(de===Nt.element){const Te=q,Re=Qe(A?A(q):q.nodeName);try{Te.hasAttribute&&Te.hasAttribute("patchsrc")&&Te.removeAttribute("patchsrc"),Te.hasAttribute&&Te.hasAttribute("for")&&Re!=="label"&&Re!=="output"&&Te.removeAttribute("for")}catch{}}const Ce=w(q);if(Ce)for(let Te=Ce.length-1;Te>=0;--Te)V.push(Ce[Te])}},Rc=function(D){let V=null,q=null;if(Ve)D="<remove></remove>"+D;else{const Te=Es(D,/^[\r\n\t ]+/);q=Te&&Te[0]}Vt==="application/xhtml+xml"&&Ze===Be&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const de=_?F(D):D;if(Ze===Be)try{V=new d().parseFromString(de,Vt)}catch{}if(!V||!V.documentElement){V=S.createDocument(Ze,"template",null);try{V.documentElement.innerHTML=Jt?M:de}catch{}}const Ce=V.body||V.documentElement;return D&&q&&Ce.insertBefore(r.createTextNode(q),Ce.childNodes[0]||null),Ze===Be?U.call(V,be?"html":"body")[0]:be?V.documentElement:Ce},ed=function(D){return b.call(D.ownerDocument||D,D,f.SHOW_ELEMENT|f.SHOW_COMMENT|f.SHOW_TEXT|f.SHOW_PROCESSING_INSTRUCTION|f.SHOW_CDATA_SECTION,null)},mo=function(D){return D=en(D,B," "),D=en(D,X," "),D=en(D,G," "),D},os=function(D){var V;D.normalize();const q=b.call(D.ownerDocument||D,D,f.SHOW_TEXT|f.SHOW_COMMENT|f.SHOW_CDATA_SECTION|f.SHOW_PROCESSING_INSTRUCTION,null);let de=q.nextNode();for(;de;)de.data=mo(de.data),de=q.nextNode();const Ce=(V=D.querySelectorAll)===null||V===void 0?void 0:V.call(D,"template");Ce&&Or(Ce,Te=>{qr(Te.content)&&os(Te.content)})},bo=function(D){const V=A?A(D):null;return typeof V!="string"||Qe(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!==E(D)||D.childNodes!==w(D)},qr=function(D){if(!E||typeof D!="object"||D===null)return!1;try{return E(D)===Nt.documentFragment}catch{return!1}},_n=function(D){if(!E||typeof D!="object"||D===null)return!1;try{return typeof E(D)=="number"}catch{return!1}};function tr(R,D,V){R.length!==0&&Or(R,q=>{q.call(t,D,V,Zr)})}const Lm=function(D,V){return!!(ae&&D.hasChildNodes()&&!_n(D.firstElementChild)&&st(Ls,D.textContent)&&st(Ls,D.innerHTML)||ae&&D.namespaceURI===Be&&V==="style"&&_n(D.firstElementChild)||D.nodeType===Nt.processingInstruction||ae&&D.nodeType===Nt.comment&&st(Fs,D.data))},Fm=function(D,V){if(!De[V]&&nd(V)&&(ie.tagNameCheck instanceof RegExp&&st(ie.tagNameCheck,V)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(V)))return!1;if(Le&&!we[V]){const q=x(D),de=w(D);if(de&&q){const Ce=de.length;for(let Te=Ce-1;Te>=0;--Te){const Re=_e?de[Te]:g(de[Te],!0);q.insertBefore(Re,m(D))}}}return gr(D),!0},td=function(D,V){if(tr(Y.beforeSanitizeElements,D,null),D!==V&&x(D)===null)return!0;if(bo(D))return gr(D),!0;const q=Qe(A?A(D):D.nodeName);if(tr(Y.uponSanitizeElement,D,{tagName:q,allowedTags:ce}),D!==V&&x(D)===null)return!0;if(Lm(D,q))return gr(D),!0;if(De[q]||!(ke.tagCheck instanceof Function&&ke.tagCheck(q))&&!ce[q]){const Ce=Fm(D,q);return Ce===!1&&tr(Y.afterSanitizeElements,D,null),Ce}if((E?E(D):D.nodeType)===Nt.element&&!Im(D)||(q==="noscript"||q==="noembed"||q==="noframes")&&st(uu,D.innerHTML))return gr(D),!0;if(te&&D.nodeType===Nt.text){const Ce=mo(D.textContent);D.textContent!==Ce&&(Mr(t.removed,{element:D.cloneNode()}),D.textContent=Ce)}return tr(Y.afterSanitizeElements,D,null),!1},rd=function(D,V,q){if(Ae[V]||ae&&V==="patchsrc"||ae&&V==="for"&&D!=="label"&&D!=="output"||he&&(V==="id"||V==="name")&&(q in r||q in Nm))return!1;const de=Se[V]||ke.attributeCheck instanceof Function&&ke.attributeCheck(V,D);if(!($e&&st(W,V))){if(!(je&&st(Q,V))){if(de){if(!xe[V]){if(!st(ne,en(q,se,""))){if(!((V==="src"||V==="xlink:href"||V==="href")&&D!=="script"&&Ts(q,"data:")===0&&Ke[D])){if(!(K&&!st(me,en(q,se,"")))){if(q)return!1}}}}}else if(!(nd(D)&&(ie.tagNameCheck instanceof RegExp&&st(ie.tagNameCheck,D)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(D))&&(ie.attributeNameCheck instanceof RegExp&&st(ie.attributeNameCheck,V)||ie.attributeNameCheck instanceof Function&&ie.attributeNameCheck(V,D))||V==="is"&&ie.allowCustomizedBuiltInElements&&(ie.tagNameCheck instanceof RegExp&&st(ie.tagNameCheck,q)||ie.tagNameCheck instanceof Function&&ie.tagNameCheck(q))))return!1}}return!0},$m=Ge({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),nd=function(D){return!$m[Rr(D)]&&st(pe,D)},Um=function(D,V,q,de){if(_&&typeof i=="object"&&typeof i.getAttributeType=="function"&&!q)switch(i.getAttributeType(D,V)){case"TrustedHTML":return F(de);case"TrustedScriptURL":return P(de)}return de},zm=function(D,V,q,de){try{q?D.setAttributeNS(q,V,de):D.setAttribute(V,de),bo(D)?gr(D):_s(t.removed)}catch{Er(V,D)}},od=function(D){tr(Y.beforeSanitizeAttributes,D,null);const V=D.attributes;if(!V||bo(D))return;const q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let de=V.length;const Ce=Qe(D.nodeName);for(;de--;){const Te=V[de],Re=Te.name,bt=Te.namespaceURI,Yt=Te.value,_t=Qe(Re),Xt=Yt;let vt=Re==="value"?Xt:Yd(Xt);if(q.attrName=_t,q.attrValue=vt,q.keepAttr=!0,q.forceKeepAttr=void 0,tr(Y.uponSanitizeAttribute,D,q),vt=q.attrValue,ue&&(_t==="id"||_t==="name")&&Ts(vt,fe)!==0&&(Er(Re,D),vt=fe+vt),ae&&st(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,vt)){Er(Re,D);continue}if(_t==="attributename"&&Es(vt,"href")){Er(Re,D);continue}if(!q.forceKeepAttr){if(!q.keepAttr){Er(Re,D);continue}if(!oe&&st(fu,vt)){Er(Re,D);continue}if(te&&(vt=mo(vt)),!rd(Ce,_t,vt)){Er(Re,D);continue}vt=Um(Ce,_t,bt,vt),vt!==Xt&&zm(D,Re,bt,vt)}}tr(Y.afterSanitizeAttributes,D,null)},yo=function(D){let V=null;const q=ed(D);for(tr(Y.beforeSanitizeShadowDOM,D,null);V=q.nextNode();)if(tr(Y.uponSanitizeShadowNode,V,null),td(V,D),od(V),qr(V.content)&&yo(V.content),(E?E(V):V.nodeType)===Nt.element){const Ce=O(V);qr(Ce)&&(as(Ce),yo(Ce))}tr(Y.afterSanitizeShadowDOM,D,null)},as=function(D){const V=[{node:D,shadow:null}];for(;V.length>0;){const q=V.pop();if(q.shadow){yo(q.shadow);continue}const de=q.node,Te=(E?E(de):de.nodeType)===Nt.element,Re=w(de);if(Re)for(let bt=Re.length-1;bt>=0;--bt)V.push({node:Re[bt],shadow:null});if(Te){const bt=A?A(de):null;if(typeof bt=="string"&&Qe(bt)==="template"){const Yt=de.content;qr(Yt)&&V.push({node:Yt,shadow:null})}}if(Te){const bt=O(de);qr(bt)&&V.push({node:null,shadow:bt},{node:bt,shadow:null})}}};return t.sanitize=function(R){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},V=null,q=null,de=null,Ce=null;if(Jt=!R,Jt&&(R="<!-->"),typeof R!="string"&&!_n(R)&&(R=Jd(R),typeof R!="string"))throw hr("dirty is not a string, aborting");if(!t.isSupported)return R;Me?(ce=Xe,Se=Fe):rs(D),(Y.uponSanitizeElement.length>0||Y.uponSanitizeAttribute.length>0)&&(ce=yt(ce)),Y.uponSanitizeAttribute.length>0&&(Se=yt(Se)),t.removed=[];const Te=_e&&typeof R!="string"&&_n(R);if(Te){Pm(R);const _t=A?A(R):R.nodeName;if(typeof _t=="string"){const Xt=Qe(_t);if(!ce[Xt]||De[Xt])throw po(R),hr("root node is forbidden and cannot be sanitized in-place")}if(bo(R))throw po(R),hr("root node is clobbered and cannot be sanitized in-place");try{as(R)}catch(Xt){throw po(R),Xt}}else if(_n(R))V=Rc("<!---->"),q=V.ownerDocument.importNode(R,!0),q.nodeType===Nt.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?V=q:V.appendChild(q),as(q);else{if(!Oe&&!te&&!be&&R.indexOf("<")===-1)return _&&le?F(R):R;if(V=Rc(R),!V)return Oe?null:le?M:""}V&&Ve&&gr(V.firstChild);const Re=Te?R:V,bt=ed(Re);try{for(;de=bt.nextNode();)td(de,Re),od(de),qr(de.content)&&yo(de.content)}catch(_t){throw Te&&(po(R),Or(t.removed,Xt=>{Xt.element&&ns(Xt.element)})),_t}if(Te)return Or(t.removed,_t=>{_t.element&&ns(_t.element)}),te&&os(R),R;if(Oe){if(te&&os(V),Z)for(Ce=z.call(V.ownerDocument);V.firstChild;)Ce.appendChild(V.firstChild);else Ce=V;return(Se.shadowroot||Se.shadowrootmode)&&(Ce=H.call(n,Ce,!0)),Ce}let Yt=be?V.outerHTML:V.innerHTML;return be&&ce["!doctype"]&&V.ownerDocument&&V.ownerDocument.doctype&&V.ownerDocument.doctype.name&&st(cu,V.ownerDocument.doctype.name)&&(Yt="<!DOCTYPE "+V.ownerDocument.doctype.name+`>
`+Yt),te&&(Yt=mo(Yt)),_&&le?F(Yt):Yt},t.setConfig=function(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};rs(R),Me=!0,Xe=ce,Fe=Se},t.clearConfig=function(){Zr=null,Me=!1,Xe=null,Fe=null,_=k,M=""},t.isValidAttribute=function(R,D,V){Zr||rs({});const q=Qe(R),de=Qe(D);return rd(q,de,V)},t.addHook=function(R,D){typeof D=="function"&&at(Y,R)&&Mr(Y[R],D)},t.removeHook=function(R,D){if(at(Y,R)){if(D!==void 0){const V=Kd(Y[R],D);return V===-1?void 0:Vd(Y[R],V,1)[0]}return _s(Y[R])}},t.removeHooks=function(R){at(Y,R)&&(Y[R]=[])},t.removeAllHooks=function(){Y=$s()},t}var Po=Us();const pu=()=>{const e=()=>{const n=window.G7Core?.state?.get?.();return n&&n.preferredCurrency||"KRW"},[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||"KRW")});return typeof o=="function"?o:void 0},[]),t},mu=(e,t=!1)=>{window.G7Core?.dispatch?.({handler:"navigate",params:t?{path:e,mergeQuery:!0,query:{}}:{path:e}})},bu=e=>{const t=Math.round(e*2)/2;return[1,2,3,4,5].map(r=>t>=r?"full":t>=r-.5?"half":"empty")},zs=({product:e,onClick:t,shopBase:r="/shop",preserveListQuery:n=!1,className:o="",id:a,editorAttrs:s})=>{const l=pu(),f=v=>{const E=`multi_currency_${v}`,A=e[E];if(A&&A[l])return A[l].formatted;const _=`${v}_formatted`;return e[_]},h=e.name_localized??(typeof e.name=="string"?e.name:"")??"",d=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=>Po.sanitize(v,{ALLOWED_TAGS:["mark"],ALLOWED_ATTR:[]}),w=e.name_highlighted,x=e.description_highlighted??e.short_description,O=()=>{if(t)t(e.id);else{const v=r==="/"?"":r,E=e.product_code??e.id;mu(`${v}/products/${E}`,n)}};return c.jsxs(J,{onClick:O,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:[c.jsxs(j,{className:"relative aspect-square overflow-hidden bg-gray-100 dark:bg-gray-700",children:[c.jsx(zt,{src:e.thumbnail_url,alt:h,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-200",loading:"lazy"}),g&&c.jsx(j,{className:"absolute inset-0 bg-black/50 flex items-center justify-center",children:c.jsx(re,{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"&&c.jsxs(re,{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&&c.jsx(j,{className:"absolute bottom-2 right-2 flex gap-1 flex-wrap justify-end",children:p.map((v,E)=>c.jsx(re,{className:"text-xs text-white font-medium px-1.5 py-0.5 rounded",style:{backgroundColor:v.color||"#6b7280"},children:v.name},E))})]}),c.jsxs(j,{className:"p-4",children:[c.jsxs(j,{className:"flex items-center gap-1.5 flex-wrap",children:[e.primary_category&&c.jsx(re,{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&&c.jsx(re,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.brand_name})]}),w?c.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(w)}}):c.jsx(Tn,{className:"mt-1 font-medium text-gray-900 dark:text-white line-clamp-1",children:h}),x&&c.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(x)}}),c.jsxs(j,{className:"mt-1.5 flex items-center gap-1",children:[bu(e.rating_avg??0).map((v,E)=>c.jsxs(re,{className:`text-xs ${v==="empty"?"text-gray-300 dark:text-gray-600":"text-yellow-400"}`,children:[v==="full"&&c.jsx("i",{className:"fa-solid fa-star"}),v==="half"&&c.jsx("i",{className:"fa-solid fa-star-half-stroke"}),v==="empty"&&c.jsx("i",{className:"fa-regular fa-star"})]},E)),c.jsx(re,{className:"text-xs text-gray-600 dark:text-gray-400 ml-0.5",children:(e.rating_avg??0).toFixed(1)}),c.jsxs(re,{className:"text-xs text-gray-400 dark:text-gray-500",children:["(",e.review_count??0,")"]})]}),c.jsxs(j,{className:"mt-2 flex items-baseline gap-2",children:[c.jsx(re,{className:"font-bold text-gray-900 dark:text-white",children:d}),i&&u&&c.jsx(re,{className:"text-sm text-gray-500 dark:text-gray-400 line-through",children:i})]})]})]})},yu=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"})),vu={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"]},Lo=({brandMark:e,size:t=32,className:r="",id:n,editorAttrs:o})=>{const a=e?.svg,s=e?.text,l=C.useMemo(()=>!a||a.trim()===""?"":Po.sanitize(a,vu),[a]),f={width:`${t}px`,height:`${t}px`,flex:`0 0 ${t}px`};if(l)return c.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 c.jsx(re,{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},wu=Object.freeze(Object.defineProperty({__proto__:null,BrandMark:Lo,default:Lo},Symbol.toStringTag,{value:"Module"})),Hs="carousel",rn="controller",xu="navigation",ku="no-scroll",Fo="portal",Cu="root",Gs="toolbar",Su="counter",nn="fullscreen",js="slideshow",on="thumbnails",Bs="zoom",Ir="loading",$o="playing",an="error",sn="complete",_u="placeholder",ln=e=>`active-slide-${e}`,Eu=ln(Ir),Tu=ln($o),Nu=ln(an),Au=ln(sn),Ws="fullsize",Dr="flex_center",Ou="no_scroll",Ks="no_scroll_padding",Uo="slide",Vs="slide_wrapper",Mu="slide_wrapper_interactive",lr="prev",ir="next",zo="swipe",Pr="close",Ys="onPointerDown",Xs="onPointerMove",Zs="onPointerUp",qs="onPointerLeave",Qs="onPointerCancel",Ho="onKeyDown",Iu="onKeyUp",Go="onWheel",Du="Escape",Pu="ArrowLeft",Lu="ArrowRight",Fu="button",In="icon",Js="contain",Rs="cover",el="Unknown action type",tl="yarl__";function ht(...e){return e.filter(Boolean).join(" ")}function ye(e){return`${tl}${e}`}function Ye(e){return`--${tl}${e}`}function pr(e,t){return`${e}${t?`_${t}`:""}`}function mr(e){return t=>pr(e,t)}function br(e,t){var r;return(r=e?.[t])!==null&&r!==void 0?r:t}function rl(e,t,r){return br(e,"{index} of {total}").replace(/\{index}/g,`${Ko(r,t.length)+1}`).replace(/\{total}/g,`${t.length}`)}function Lr(...e){return()=>{e.forEach(t=>{t()})}}function At(e,t,r){return()=>{const n=T.useContext(r);if(!n)throw new Error(`${e} must be used within a ${t}.Provider`);return n}}function jo(){return typeof window<"u"}function Bo(e,t=0){const r=10**t;return Math.round((e+Number.EPSILON)*r)/r}function cr(e){return e.type===void 0||e.type==="image"}function Wo(e,t){return e.imageFit===Rs||e.imageFit!==Js&&t===Rs}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 $u(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 Uu(){return(jo()?window?.devicePixelRatio:void 0)||1}function Ko(e,t){return t>0?(e%t+t)%t:0}function Vo(e){return e.length>0}function Yo(e,t){return e[Ko(t,e.length)]}function Xo(e,t){return Vo(e)?Yo(e,t):void 0}function nl(e){return cr(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=T.isValidElement(r)?T.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 ol(e,t,r=0){return Math.min(e.preload,Math.max(e.finite?t.length-1:Math.floor(t.length/2),r))}const zu=Number(T.version.split(".")[0])>=19;function Hu(e){return{inert:zu?e:e?"":void 0}}function Gu(e){e.scrollTop}const Zo={open:!1,close:()=>{},index:0,slides:[],render:{},plugins:[],toolbar:{buttons:[Pr]},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:Js,imageProps:{}},controller:{ref:null,focus:!0,aria:!1,touchAction:"none",closeOnPullUp:!1,closeOnPullDown:!1,closeOnBackdropClick:!1,closeOnEscape:!0,preventDefaultWheelX:!0,preventDefaultWheelY:!1,disableSwipeNavigation:!1},portal:{},noScroll:{disabled:!1},on:{},styles:{},className:""};function Lt(e,t){return{name:e,component:t}}function lt(e,t){return{module:e,children:t}}function al(e,t,r){return e.module.name===t?r(e):e.children?[lt(e.module,e.children.flatMap(n=>{var o;return(o=al(n,t,r))!==null&&o!==void 0?o:[]}))]:[e]}function Fr(e,t,r){return e.flatMap(n=>{var o;return(o=al(n,t,r))!==null&&o!==void 0?o:[]})}function ju(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=[lt(p,n)];return}n=Fr(n,g,m=>[lt(p,[m])])},s=(g,p)=>{n=Fr(n,g,m=>[lt(m.module,[lt(p,m.children)])])},l=(g,p,m)=>{n=Fr(n,g,w=>{var x;return[lt(w.module,[...m?[lt(p)]:[],...(x=w.children)!==null&&x!==void 0?x:[],...m?[]:[lt(p)]])]})},f=(g,p,m)=>{n=Fr(n,g,w=>[...m?[lt(p)]:[],w,...m?[]:[lt(p)]])},h=g=>{s(rn,g)},d=(g,p)=>{n=Fr(n,g,m=>[lt(p,m.children)])},i=g=>{n=Fr(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:d,remove:i,augment:u})}),{config:n,augmentation:g=>r.reduce((p,m)=>m(p),g)}}const sl=T.createContext(null),qo=At("useA11yContext","A11yContext",sl);function Bu({children:e}){const[t,r]=T.useState(!1),[n,o]=T.useState(!1),a=T.useMemo(()=>({focusWithin:t,trackFocusWithin:(l,f)=>{const h=d=>i=>{var u;i.currentTarget.contains(i.relatedTarget)||r(d),(u=d?l:f)===null||u===void 0||u(i)};return{onFocus:h(!0),onBlur:h(!1)}},autoPlaying:n,setAutoPlaying:o}),[t,n]);return T.createElement(sl.Provider,{value:a},e)}const ll=T.createContext(null),$r=At("useDocument","DocumentContext",ll);function Wu({nodeRef:e,children:t}){const r=T.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 T.createElement(ll.Provider,{value:r},t)}const il=T.createContext(null),Ur=At("useEvents","EventsContext",il);function Ku({children:e}){const[t]=T.useState({});T.useEffect(()=>()=>{Object.keys(t).forEach(n=>delete t[n])},[t]);const r=T.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 T.createElement(il.Provider,{value:r},e)}const cl=T.createContext(null),it=At("useLightboxProps","LightboxPropsContext",cl);function dl({children:e,...t}){return T.createElement(cl.Provider,{value:t},e)}const ul=T.createContext(null),Ft=At("useLightboxState","LightboxStateContext",ul),fl=T.createContext(null),Vu=At("useLightboxDispatch","LightboxDispatchContext",fl);function Yu(e,t){switch(t.type){case"swipe":{const{slides:r}=e,n=t?.increment||0,o=e.globalIndex+n,a=Ko(o,r.length),s=Xo(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:Xo(t.slides,t.index)}:e;default:throw new Error(el)}}function Xu({slides:e,index:t,children:r}){const[n,o]=T.useReducer(Yu,{slides:e,currentIndex:t,globalIndex:t,currentSlide:Xo(e,t)}),[a,s]=T.useState(e),[l,f]=T.useState(t);(e!==a||t!==l)&&(s(e),f(t),o({type:"update",slides:e,index:t}));const h=T.useMemo(()=>({...n,state:n,dispatch:o}),[n,o]);return T.createElement(fl.Provider,{value:o},T.createElement(ul.Provider,{value:h},r))}const gl=T.createContext(null),Zu=At("useRTLContext","RTLContext",gl);function qu({isRTL:e,children:t}){const r=T.useMemo(()=>({isRTL:e}),[e]);return T.createElement(gl.Provider,{value:r},t)}const hl=T.createContext(null),cn=At("useTimeouts","TimeoutsContext",hl);function Qu({children:e}){const[t]=T.useState([]);T.useEffect(()=>()=>{t.forEach(n=>window.clearTimeout(n)),t.splice(0,t.length)},[t]);const r=T.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 T.createElement(hl.Provider,{value:r},e)}const zr=T.forwardRef(function({label:t,className:r,icon:n,renderIcon:o,onClick:a,style:s,...l},f){const{styles:h,labels:d}=it(),i=br(d,t);return T.createElement("button",{ref:f,type:"button",title:i,"aria-label":i,className:ht(ye(Fu),r),onClick:a,style:{...s,...h.button},...l},o?o():T.createElement(n,{className:ye(In),style:h.icon}))});function pl(e,t){const r=n=>T.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 pl(e,T.createElement("g",{fill:"currentColor"},T.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t))}function Ju(e,t){return pl(e,T.createElement(T.Fragment,null,T.createElement("defs",null,T.createElement("mask",{id:"strike"},T.createElement("path",{d:"M0 0h24v24H0z",fill:"white"}),T.createElement("path",{d:"M0 0L24 24",stroke:"black",strokeWidth:4}))),T.createElement("path",{d:"M0.70707 2.121320L21.878680 23.292883",stroke:"currentColor",strokeWidth:2}),T.createElement("g",{fill:"currentColor",mask:"url(#strike)"},T.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),t)))}const Ru=xt("Close",T.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"})),ef=xt("Previous",T.createElement("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})),tf=xt("Next",T.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"})),rf=xt("Loading",T.createElement(T.Fragment,null,Array.from({length:8}).map((e,t,r)=>T.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)`})))),nf=xt("Error",T.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"})),Gt=jo()?T.useLayoutEffect:T.useEffect;function Qo(){const[e,t]=T.useState(!1);return T.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 of(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 Jo(e,t){const r=T.useRef(void 0),n=T.useRef(void 0),o=Qo();return Gt(()=>{var a,s,l;if(e.current&&r.current!==void 0&&!o){const{keyframes:f,duration:h,easing:d,onfinish:i}=t(r.current,e.current.getBoundingClientRect(),of(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:d})}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 ml(){const e=T.useRef(null),t=T.useRef(void 0),[r,n]=T.useState();return{setContainerRef:T.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 Fn(){const e=T.useRef(void 0),{setTimeout:t,clearTimeout:r}=cn();return T.useCallback((n,o)=>{r(e.current),e.current=t(n,o>0?o:0)},[t,r])}function Pe(e){const t=T.useRef(e);return Gt(()=>{t.current=e}),T.useCallback((...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}function bl(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function Ro(e,t){return T.useMemo(()=>e==null&&t==null?null:r=>{bl(e,r),bl(t,r)},[e,t])}function yl(e,t=!1){const r=T.useRef(!1);Gt(()=>{t&&r.current&&(r.current=!1,e())},[t,e]);const n=T.useCallback(()=>{r.current=!0},[]),o=T.useCallback(()=>{r.current=!1},[]);return{onFocus:n,onBlur:o}}function $n(){return Zu().isRTL}function vl(){const[e]=T.useState({}),t=T.useCallback((o,a)=>{var s;(s=e[o])===null||s===void 0||s.forEach(l=>{a.isPropagationStopped()||l(a)})},[e]),r=T.useMemo(()=>({onPointerDown:o=>t(Ys,o),onPointerMove:o=>t(Xs,o),onPointerUp:o=>t(Zs,o),onPointerLeave:o=>t(qs,o),onPointerCancel:o=>t(Qs,o),onKeyDown:o=>t(Ho,o),onKeyUp:o=>t(Iu,o),onWheel:o=>t(Go,o)}),[t]),n=T.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 wl(e,t){const r=T.useRef(0),n=Fn(),o=Pe((...a)=>{r.current=Date.now(),e(a)});return T.useCallback((...a)=>{n(()=>{o(a)},t-(Date.now()-r.current))},[t,o,n])}const ea=mr("slide"),ta=mr("slide_image");function yr({slide:e,offset:t,render:r,rect:n,imageFit:o,imageProps:a,onClick:s,onLoad:l,onError:f,style:h}){var d,i,u,g,p,m,w,x;const[O,v]=T.useState(Ir),{publish:E}=Ur(),{setTimeout:A}=cn(),_=T.useRef(null);T.useEffect(()=>{t===0&&E(ln(O))},[t,O,E]);const M=Pe(B=>{("decode"in B?B.decode():Promise.resolve()).catch(()=>{}).then(()=>{B.parentNode&&(v(sn),A(()=>{l?.(B)},0))})}),k=T.useCallback(B=>{_.current=B,B?.complete&&M(B)},[M]),y=T.useCallback(B=>{M(B.currentTarget)},[M]),N=Pe(()=>{v(an),f?.()}),I=Wo(e,o),F=(B,X)=>Number.isFinite(B)?B:X,P=F(Math.max(...((i=(d=e.srcSet)===null||d===void 0?void 0:d.map(B=>B.width))!==null&&i!==void 0?i:[]).concat(e.width?[e.width]:[]).filter(Boolean)),((u=_.current)===null||u===void 0?void 0:u.naturalWidth)||0),L=F(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=_.current)===null||m===void 0?void 0:m.naturalHeight)||0),$=P&&L?{maxWidth:`min(${P}px, 100%)`,maxHeight:`min(${L}px, 100%)`}:{maxWidth:"100%",maxHeight:"100%"},S=(w=e.srcSet)===null||w===void 0?void 0:w.slice().sort((B,X)=>B.width-X.width).map(B=>`${B.src} ${B.width}w`).join(", "),b=()=>n&&!I&&e.width&&e.height?n.height/e.height*e.width:Number.MAX_VALUE,z=S&&n&&jo()?`${Math.round(Math.min(b(),n.width))}px`:void 0,{style:U,className:H,...Y}=(typeof a=="function"?a(e):a)||{};return T.createElement(T.Fragment,null,T.createElement("img",{ref:k,onLoad:y,onError:N,onClick:s,draggable:!1,className:ht(ye(ta()),I&&ye(ta("cover")),O!==sn&&ye(ta("loading")),H),style:{...$,...h,...U},...Y,alt:(x=e.alt)!==null&&x!==void 0?x:"",sizes:z,srcSet:S,src:e.src}),O!==sn&&T.createElement("div",{className:ye(ea(_u))},O===Ir&&(r?.iconLoading?r.iconLoading():T.createElement(rf,{className:ht(ye(In),ye(ea(Ir)))})),O===an&&(r?.iconError?r.iconError():T.createElement(nf,{className:ht(ye(In),ye(ea(an)))}))))}const af=T.forwardRef(function({className:t,children:r,onFocus:n,onBlur:o,...a},s){const l=T.useRef(null),[f,h]=T.useState(!1),{trackFocusWithin:d}=qo(),i=Pe(()=>{if(l.current){const u=window.getComputedStyle(l.current).direction==="rtl";u!==f&&h(u)}});return T.useEffect(i),T.createElement(Wu,{nodeRef:l},T.createElement(qu,{isRTL:f},T.createElement("div",{ref:Ro(s,l),className:ht(ye("root"),t),...d(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 xl(e,t,r,n,o){T.useEffect(()=>o?()=>{}:Lr(e(Ys,t),e(Xs,r),e(Zs,n),e(qs,n),e(Qs,n)),[e,t,r,n,o])}var jt;(function(e){e[e.NONE=0]="NONE",e[e.SWIPE=1]="SWIPE",e[e.PULL=2]="PULL"})(jt||(jt={}));const ra=30;function sf({disableSwipeNavigation:e,closeOnBackdropClick:t},r,n,o,a,s,l,f,h,d,i,u,g,p,m,w){const x=T.useRef(0),O=T.useRef([]),v=T.useRef(void 0),E=T.useRef(0),A=T.useRef(jt.NONE),_=T.useCallback(P=>{v.current===P.pointerId&&(v.current=void 0,A.current=jt.NONE);const L=O.current;L.splice(0,L.length,...L.filter($=>$.pointerId!==P.pointerId))},[]),M=T.useCallback(P=>{_(P),P.persist(),O.current.push(P)},[_]),k=T.useCallback(P=>O.current.find(({pointerId:L})=>P.pointerId===L),[]),y=Pe(P=>{M(P)}),N=(P,L)=>i&&P>L||d&&P<-L,I=Pe(P=>{const L=k(P);if(L)if(v.current===P.pointerId){const $=Date.now()-E.current,S=x.current;A.current===jt.SWIPE?Math.abs(S)>.3*o||Math.abs(S)>5&&$<a?f(S,$):h(S):A.current===jt.PULL&&(N(S,2*ra)?p(S,$):m(S)),x.current=0,A.current=jt.NONE}else{const{target:$}=P;t&&$ instanceof HTMLElement&&$===L.target&&($.classList.contains(ye(Uo))||$.classList.contains(ye(Vs)))&&w()}_(P)}),F=Pe(P=>{const L=k(P);if(L){const $=v.current===P.pointerId;if(P.buttons===0){$&&x.current!==0?I(P):_(L);return}const S=P.clientX-L.clientX,b=P.clientY-L.clientY;if(v.current===void 0){const z=U=>{M(P),v.current=P.pointerId,E.current=Date.now(),A.current=U};Math.abs(S)>Math.abs(b)&&Math.abs(S)>ra&&n(S)?e||(z(jt.SWIPE),s()):Math.abs(b)>Math.abs(S)&&N(b,ra)&&(z(jt.PULL),u())}else $&&(A.current===jt.SWIPE?(x.current=S,l(S)):A.current===jt.PULL&&(x.current=b,g(b)))}});xl(r,y,F,I)}function lf({preventDefaultWheelX:e,preventDefaultWheelY:t}){const r=T.useRef(null),n=Pe(o=>{const a=Math.abs(o.deltaX)>Math.abs(o.deltaY);(a&&e||!a&&t||o.ctrlKey)&&o.preventDefault()});return T.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 cf(e,t,r,n,o,a,s,l,f){const h=T.useRef(0),d=T.useRef(0),i=T.useRef(void 0),u=T.useRef(void 0),g=T.useRef(0),p=T.useRef(void 0),m=T.useRef(0),{setTimeout:w,clearTimeout:x}=cn(),O=T.useCallback(()=>{i.current&&(x(i.current),i.current=void 0)},[x]),v=T.useCallback(()=>{u.current&&(x(u.current),u.current=void 0)},[x]),E=Pe(()=>{e!==pt.SWIPE&&(h.current=0,m.current=0,O(),v())});T.useEffect(E,[e,E]);const A=Pe(M=>{u.current=void 0,h.current===M&&f(h.current)}),_=Pe(M=>{if(M.ctrlKey||Math.abs(M.deltaY)>Math.abs(M.deltaX))return;const k=y=>{g.current=y,x(p.current),p.current=y>0?w(()=>{g.current=0,p.current=void 0},300):void 0};if(e===pt.NONE){if(Math.abs(M.deltaX)<=1.2*Math.abs(g.current)){k(M.deltaX);return}if(!r(-M.deltaX))return;if(d.current+=M.deltaX,O(),Math.abs(d.current)>30)d.current=0,k(0),m.current=Date.now(),a();else{const y=d.current;i.current=w(()=>{i.current=void 0,y===d.current&&(d.current=0)},o)}}else if(e===pt.SWIPE){let y=h.current-M.deltaX;if(y=Math.min(Math.abs(y),n)*Math.sign(y),h.current=y,s(y),v(),Math.abs(y)>.2*n){k(M.deltaX),l(y,Date.now()-m.current);return}u.current=w(()=>A(y),2*o)}else k(M.deltaX)});T.useEffect(()=>t(Go,_),[t,_])}const kl=mr("container"),Cl=T.createContext(null),Bt=At("useController","ControllerContext",Cl);function df({children:e,...t}){var r;const{carousel:n,animation:o,controller:a,on:s,styles:l,render:f}=t,{closeOnPullUp:h,closeOnPullDown:d,preventDefaultWheelX:i,preventDefaultWheelY:u}=a,[g,p]=T.useState(),m=Ft(),w=Vu(),[x,O]=T.useState(pt.NONE),v=T.useRef(0),E=T.useRef(0),A=T.useRef(1),{registerSensors:_,subscribeSensors:M}=vl(),{subscribe:k,publish:y}=Ur(),N=Fn(),I=Fn(),F=Fn(),{containerRef:P,setContainerRef:L,containerRect:$}=ml(),S=Ro(lf({preventDefaultWheelX:i,preventDefaultWheelY:u}),L),b=T.useRef(null),z=Ro(b,void 0),{getOwnerDocument:U}=$r(),H=$n(),Y=K=>(H?-1:1)*(typeof K=="number"?K:1),B=Pe(()=>{var K;return(K=P.current)===null||K===void 0?void 0:K.focus()}),X=Pe(()=>t),G=Pe(()=>m),W=T.useCallback(K=>y(lr,K),[y]),Q=T.useCallback(K=>y(ir,K),[y]),me=T.useCallback(()=>y(Pr),[y]),se=K=>!(n.finite&&(Y(K)>0&&m.currentIndex===0||Y(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(Ye("swipe_offset"),`${Math.round(K)}px`)},ne=K=>{var oe,te;E.current=K,A.current=(()=>{const Me=d&&K>0?K:h&&K<0?-K:0;return Math.min(Math.max(Bo(1-Me/60*(1-.5),2),.5),1)})(),(oe=P.current)===null||oe===void 0||oe.style.setProperty(Ye("pull_offset"),`${Math.round(K)}px`),(te=P.current)===null||te===void 0||te.style.setProperty(Ye("pull_opacity"),`${A.current}`)},{prepareAnimation:ce}=Jo(b,(K,oe,te)=>{if(b.current&&$)return{keyframes:[{transform:`translate(0, ${K.rect.y-oe.y+te.y}px)`,opacity:K.opacity},{transform:"translate(0, 0)",opacity:1}],duration:K.duration,easing:o.easing.fade}}),ve=(K,oe)=>{if(h||d){ne(K);let te=0;b.current&&(te=o.fade*(oe?2:1),ce({rect:b.current.getBoundingClientRect(),opacity:A.current,duration:te})),F(()=>{ne(0),O(pt.NONE)},te),O(pt.ANIMATION),oe||me()}},{prepareAnimation:Se,isAnimationPlaying:ze}=Jo(b,(K,oe,te)=>{var ae;if(b.current&&$&&(!((ae=m.animation)===null||ae===void 0)&&ae.duration)){const be=Pn(n.spacing),Me=(be.percent?be.percent*$.width/100:be.pixel)||0;return{keyframes:[{transform:`translate(${Y(m.globalIndex-K.index)*($.width+Me)+K.rect.x-oe.x+te.x}px, 0)`},{transform:"translate(0, 0)"}],duration:m.animation.duration,easing:m.animation.easing}}}),ie=Pe(K=>{var oe,te;const ae=K.offset||0,be=ae?o.swipe:(oe=o.navigation)!==null&&oe!==void 0?oe:o.swipe,Me=!ae&&!ze()?o.easing.navigation:o.easing.swipe;let{direction:Xe}=K;const Fe=(te=K.count)!==null&&te!==void 0?te:1;let Ve=pt.ANIMATION,Oe=be*Fe;if(!Xe){const le=$?.width,he=K.duration||0,ue=le?be/le*Math.abs(ae):be;Fe!==0?(he<ue?Oe=Oe/ue*Math.max(he,ue/5):le&&(Oe=be/le*(le-Math.abs(ae))),Xe=Y(ae)>0?lr:ir):Oe=be/2}let Z=0;Xe===lr?se(Y(1))?Z=-Fe:(Ve=pt.NONE,Oe=be):Xe===ir&&(se(Y(-1))?Z=Fe:(Ve=pt.NONE,Oe=be)),Oe=Math.round(Oe),I(()=>{pe(0),O(pt.NONE)},Oe),b.current&&Se({rect:b.current.getBoundingClientRect(),index:m.globalIndex}),O(Ve),y(zo,{type:"swipe",increment:Z,duration:Oe,easing:Me})});T.useEffect(()=>{var K,oe;!((K=m.animation)===null||K===void 0)&&K.increment&&(!((oe=m.animation)===null||oe===void 0)&&oe.duration)&&N(()=>w({type:"swipe",increment:0}),m.animation.duration)},[m.animation,w,N]);const De=[M,se,$?.width||0,o.swipe,()=>O(pt.SWIPE),K=>pe(K),(K,oe)=>ie({offset:K,duration:oe,count:1}),K=>ie({offset:K,count:0})],Ae=[()=>{d&&O(pt.PULL)},K=>ne(K),K=>ve(K),K=>ve(K,!0)];sf(a,...De,h,d,...Ae,me),cf(x,...De);const ke=Pe(()=>{a.focus&&U().querySelector(`.${ye(Fo)} .${ye(kl())}`)&&B()});T.useEffect(ke,[ke]);const je=Pe(()=>{var K;(K=s.view)===null||K===void 0||K.call(s,{index:m.currentIndex})});T.useEffect(je,[m.globalIndex,je]),T.useEffect(()=>Lr(k(lr,K=>ie({direction:lr,...K})),k(ir,K=>ie({direction:ir,...K})),k(zo,K=>w(K))),[k,ie,w]);const $e=T.useMemo(()=>({prev:W,next:Q,close:me,focus:B,slideRect:$?$u($,n.padding):{width:0,height:0},containerRect:$||{width:0,height:0},subscribeSensors:M,containerRef:P,setCarouselRef:z,toolbarWidth:g,setToolbarWidth:p}),[W,Q,me,B,M,$,P,z,g,p,n.padding]);return T.useImperativeHandle(a.ref,()=>({prev:W,next:Q,close:me,focus:B,getLightboxProps:X,getLightboxState:G}),[W,Q,me,B,X,G]),T.createElement("div",{ref:S,className:ht(ye(kl()),ye(Dr)),style:{...x===pt.SWIPE?{[Ye("swipe_offset")]:`${Math.round(v.current)}px`}:null,...x===pt.PULL?{[Ye("pull_offset")]:`${Math.round(E.current)}px`,[Ye("pull_opacity")]:`${A.current}`}:null,...a.touchAction!=="none"?{[Ye("controller_touch_action")]:a.touchAction}:null,...l.container},tabIndex:-1,..._},$&&T.createElement(Cl.Provider,{value:$e},e,(r=f.controls)===null||r===void 0?void 0:r.call(f)))}const uf=Lt(rn,df);function vr(e){return pr(Hs,e)}function Sl(e){return pr(Uo,e)}function ff({slide:e,offset:t}){const r=T.useRef(null),{currentIndex:n,slides:o}=Ft(),{slideRect:a,focus:s}=Bt(),{render:l,carousel:{imageFit:f,imageProps:h},on:{click:d},styles:{slide:i},labels:u}=it(),{getOwnerDocument:g}=$r(),p=t!==0;T.useEffect(()=>{var w;p&&(!((w=r.current)===null||w===void 0)&&w.contains(g().activeElement))&&s()},[p,s,g]);const m=()=>{var w,x,O,v;let E=(w=l.slide)===null||w===void 0?void 0:w.call(l,{slide:e,offset:t,rect:a});return!E&&cr(e)&&(E=T.createElement(yr,{slide:e,offset:t,render:l,rect:a,imageFit:f,imageProps:h,onClick:p?void 0:()=>d?.({index:n})})),E?T.createElement(T.Fragment,null,(x=l.slideHeader)===null||x===void 0?void 0:x.call(l,{slide:e}),((O=l.slideContainer)!==null&&O!==void 0?O:(({children:A})=>A))({slide:e,children:E}),(v=l.slideFooter)===null||v===void 0?void 0:v.call(l,{slide:e})):null};return T.createElement("div",{ref:r,className:ht(ye(Sl()),!p&&ye(Sl("current")),ye(Dr)),...Hu(p),style:i,role:"group","aria-roledescription":br(u,"Slide"),"aria-label":rl(u,o,n+t)},m())}function gf(){const e=it().styles.slide;return T.createElement("div",{className:ye(Uo),style:e})}function hf({carousel:e,labels:t}){const{slides:r,currentIndex:n,globalIndex:o}=Ft(),{setCarouselRef:a}=Bt(),{autoPlaying:s,focusWithin:l}=qo(),f=Pn(e.spacing),h=Pn(e.padding),d=ol(e,r,1),i=[];if(Vo(r))for(let u=n-d;u<=n+d;u+=1){const g=Yo(r,u),p=o-n+u,m=e.finite&&(u<0||u>r.length-1);i.push(m?{key:p}:{key:[`${p}`,nl(g)].filter(Boolean).join("|"),offset:u-n,slide:g})}return T.createElement("div",{ref:a,className:ht(ye(vr()),i.length>0&&ye(vr("with_slides"))),style:{[`${Ye(vr("slides_count"))}`]:i.length,[`${Ye(vr("spacing_px"))}`]:f.pixel||0,[`${Ye(vr("spacing_percent"))}`]:f.percent||0,[`${Ye(vr("padding_px"))}`]:h.pixel||0,[`${Ye(vr("padding_percent"))}`]:h.percent||0},role:"region","aria-live":s&&!l?"off":"polite","aria-roledescription":br(t,"Carousel"),"aria-label":br(t,"Photo gallery")},i.map(({key:u,slide:g,offset:p})=>g?T.createElement(ff,{key:u,slide:g,offset:p}):T.createElement(gf,{key:u})))}const pf=Lt(Hs,hf);function _l(){const{carousel:e}=it(),{slides:t,currentIndex:r}=Ft(),n=t.length===0||e.finite&&r===0,o=t.length===0||e.finite&&r===t.length-1;return{prevDisabled:n,nextDisabled:o}}function El(e){var t;const r=$n(),{publish:n}=Ur(),{animation:o,controller:a}=it(),{prevDisabled:s,nextDisabled:l}=_l(),f=((t=o.navigation)!==null&&t!==void 0?t:o.swipe)/2,h=wl(()=>n(lr),f),d=wl(()=>n(ir),f),i=Pe(u=>{switch(u.key){case Du:if(!a.closeOnEscape)return;n(Pr);break;case Pu:(r?l:s)||(r?d:h)();break;case Lu:(r?s:l)||(r?h:d)();break;default:return}u.stopPropagation()});T.useEffect(()=>e(Ho,i),[e,i])}function Tl({label:e,icon:t,renderIcon:r,action:n,onClick:o,disabled:a,style:s}){return T.createElement(zr,{label:e,icon:t,renderIcon:r,className:ye(`navigation_${n}`),disabled:a,onClick:o,style:s,...yl(Bt().focus,a)})}function mf({render:{buttonPrev:e,buttonNext:t,iconPrev:r,iconNext:n},styles:o}){const{prev:a,next:s,subscribeSensors:l}=Bt(),{prevDisabled:f,nextDisabled:h}=_l();return El(l),T.createElement(T.Fragment,null,e?e():T.createElement(Tl,{label:"Previous",action:lr,icon:ef,renderIcon:r,style:o.navigationPrev,disabled:f,onClick:a}),t?t():T.createElement(Tl,{label:"Next",action:ir,icon:tf,renderIcon:n,style:o.navigationNext,disabled:h,onClick:s}))}const bf=Lt(xu,mf),Nl=ye(Ou),yf=ye(Ks);function vf(e){return"style"in e}function Al(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 wf({noScroll:{disabled:e},children:t}){const r=$n(),{getOwnerDocument:n,getOwnerWindow:o}=$r();return T.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(Al(l,h,r));const d=l.getElementsByTagName("*");for(let i=0;i<d.length;i+=1){const u=d[i];vf(u)&&s.getComputedStyle(u).getPropertyValue("position")==="fixed"&&!u.classList.contains(yf)&&a.push(Al(u,h,r))}}return l.classList.add(Nl),()=>{l.classList.remove(Nl),a.forEach(d=>d())}},[r,e,n,o]),T.createElement(T.Fragment,null,t)}const xf=Lt(ku,wf);function Ol(e){return pr(Fo,e)}function Ml(e,t,r){const n=e.getAttribute(t);return e.setAttribute(t,r),()=>{n?e.setAttribute(t,n):e.removeAttribute(t)}}function kf({portal:{root:e,container:{className:t,style:r,...n}={}},animation:o,styles:a,className:s,on:l,close:f,labels:h,children:d}){const[i,u]=T.useState(!1),[g,p]=T.useState(!1),m=T.useRef([]),w=T.useRef(null),{setTimeout:x}=cn(),{subscribe:O}=Ur(),E=Qo()?0:o.fade;T.useEffect(()=>(u(!0),()=>{u(!1),p(!1)}),[]);const A=Pe(()=>{m.current.forEach(y=>y()),m.current=[]}),_=Pe(()=>{var y;p(!1),A(),(y=l.exiting)===null||y===void 0||y.call(l),x(()=>{var N;(N=l.exited)===null||N===void 0||N.call(l),f()},E)});T.useEffect(()=>O(Pr,_),[O,_]);const M=Pe(y=>{var N,I,F;Gu(y),p(!0),(N=l.entering)===null||N===void 0||N.call(l);const P=(F=(I=y.parentNode)===null||I===void 0?void 0:I.children)!==null&&F!==void 0?F:[];for(let L=0;L<P.length;L+=1){const $=P[L];["TEMPLATE","SCRIPT","STYLE"].indexOf($.tagName)===-1&&$!==y&&(m.current.push(Ml($,"inert","")),m.current.push(Ml($,"aria-hidden","true")))}m.current.push(()=>{var L,$;($=(L=w.current)===null||L===void 0?void 0:L.focus)===null||$===void 0||$.call(L)}),x(()=>{var L;(L=l.entered)===null||L===void 0||L.call(l)},E)}),k=T.useCallback(y=>{y?M(y):A()},[M,A]);return i?or.createPortal(T.createElement(af,{ref:k,className:ht(s,t,ye(Ol()),ye(Ks),g&&ye(Ol("open"))),"aria-modal":!0,role:"dialog","aria-label":br(h,"Lightbox"),style:{...o.fade!==Zo.animation.fade?{[Ye("fade_animation_duration")]:`${E}ms`}:null,...o.easing.fade!==Zo.animation.easing.fade?{[Ye("fade_animation_timing_function")]:o.easing.fade}:null,...a.root,...r},onFocus:y=>{w.current||(w.current=y.relatedTarget)},...n},d),(typeof e=="function"?e():e)||document.body):null}const Cf=Lt(Fo,kf);function Sf({children:e}){return T.createElement(T.Fragment,null,e)}const _f=Lt(Cu,Sf);function Ef(e){return pr(Gs,e)}function Tf({toolbar:{buttons:e},render:{buttonClose:t,iconClose:r},styles:n}){const{close:o,setToolbarWidth:a}=Bt(),{setContainerRef:s,containerRect:l}=ml();Gt(()=>{a(l?.width)},[a,l?.width]);const f=()=>t?t():T.createElement(zr,{key:Pr,label:"Close",icon:Ru,renderIcon:r,onClick:o});return T.createElement("div",{ref:s,style:n.toolbar,className:ye(Ef())},e?.map(h=>h===Pr?f():h))}const Nf=Lt(Gs,Tf);function Il(e,t){var r;return T.createElement(e.module.component,{key:e.module.name,...t},(r=e.children)===null||r===void 0?void 0:r.map(n=>Il(n,t)))}function Af(e,t={}){const{easing:r,...n}=e,{easing:o,...a}=t;return{easing:{...r,...o},...n,...a}}function Of({carousel:e,animation:t,render:r,toolbar:n,controller:o,noScroll:a,on:s,plugins:l,slides:f,index:h,...d}){const{animation:i,carousel:u,render:g,toolbar:p,controller:m,noScroll:w,on:x,slides:O,index:v,plugins:E,...A}=Zo,{config:_,augmentation:M}=ju([lt(Cf,[lt(xf,[lt(uf,[lt(pf),lt(Nf),lt(bf)])])])],l||E),k=M({animation:Af(i,t),carousel:{...u,...e},render:{...g,...r},toolbar:{...p,...n},controller:{...m,...o},noScroll:{...w,...a},on:{...x,...s},...A,...d});return k.open?T.createElement(dl,{...k},T.createElement(Xu,{slides:f||O,index:Dn(h||v)},T.createElement(Qu,null,T.createElement(Ku,null,T.createElement(Bu,null,Il(lt(_f,_),k)))))):null}const Dl={minZoom:1,maxZoomPixelRatio:1,zoomInMultiplier:2,doubleTapDelay:300,doubleClickDelay:500,doubleClickMaxStops:2,keyboardMoveDistance:50,wheelZoomDistanceFactor:100,pinchZoomDistanceFactor:100,pinchZoomV4:!1,scrollToZoom:!1,maxZoom:8};function Mf(e){return Math.min(Math.max(e,Number.EPSILON),1)}function Pl(e){const{minZoom:t,...r}={...Dl,...e};return{minZoom:Mf(t),...r}}function If(e,t,r,n){const o=T.useRef(void 0),a=T.useRef(void 0),{zoom:s}=it().animation,l=Qo(),f=Pe(()=>{var h,d,i;if((h=o.current)===null||h===void 0||h.cancel(),o.current=void 0,a.current&&n?.current){try{o.current=(i=(d=n.current).animate)===null||i===void 0?void 0:i.call(d,[{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 Gt(f,[e,t,r,f]),T.useCallback(()=>{a.current=n?.current?window.getComputedStyle(n.current).transform:void 0},[n])}function Df(e,t){const{on:r}=it(),n=Pe(()=>{var o;t||(o=r.zoom)===null||o===void 0||o.call(r,{zoom:e})});T.useEffect(n,[e,n])}function Un(){const{zoom:e}=it();return Pl(e)}function Pf(e,t){var r;const n=typeof e=="function"?(r=e(t))!==null&&r!==void 0?r:Dl.maxZoom:e;return Math.max(n,1)}function Lf(e,t){var r,n;let o={width:0,height:0},a={width:0,height:0};const{currentSlide:s}=Ft(),{imageFit:l}=it().carousel,{maxZoomPixelRatio:f,maxZoom:h}=Un();if(e&&s){const i={...s,...t};if(cr(i)){const u=Wo(i,l),g=Math.max(...(((r=i.srcSet)===null||r===void 0?void 0:r.map(m=>m.width))||[]).concat(i.width?[i.width]:[])),p=Math.max(...(((n=i.srcSet)===null||n===void 0?void 0:n.map(m=>m.height))||[]).concat(i.height?[i.height]:[]));g>0&&p>0&&e.width>0&&e.height>0&&(a=u?{width:Math.round(Math.min(g,e.width/e.height*p)),height:Math.round(Math.min(p,e.height/e.width*g))}:{width:g,height:p},a={width:a.width*f,height:a.height*f},o=u?{width:Math.min(e.width,a.width,g),height:Math.min(e.height,a.height,p)}:{width:Math.round(Math.min(e.width,e.height/p*g,g)),height:Math.round(Math.min(e.height,e.width/g*p,p))})}else e.width>0&&e.height>0&&(t&&t.width>0&&t.height>0?o={width:Math.min(e.width,t.width),height:Math.min(e.height,t.height)}:o={width:e.width,height:e.height})}const d=s&&o.width?cr(s)?Math.max(Bo(a.width/o.width,5),1):Pf(h,s):1;return{imageRect:o,maxZoom:d}}function Ll(e,t){return Math.hypot(e.clientX-t.clientX,e.clientY-t.clientY)}function Fl(e,t,r=100,n=2){return e*Math.min(1+Math.abs(t/r),n)**Math.sign(t)}function Ff(e,t,r,n,o,a,s,l,f){const h=T.useRef([]),d=T.useRef(0),i=T.useRef(void 0),{globalIndex:u}=Ft(),{getOwnerWindow:g}=$r(),{containerRef:p,subscribeSensors:m}=Bt(),{keyboardMoveDistance:w,zoomInMultiplier:x,wheelZoomDistanceFactor:O,scrollToZoom:v,doubleTapDelay:E,doubleClickDelay:A,doubleClickMaxStops:_,pinchZoomDistanceFactor:M,pinchZoomV4:k}=Un(),y=T.useCallback(z=>{if(p.current){const{pageX:U,pageY:H}=z,{scrollX:Y,scrollY:B}=g(),{left:X,top:G,width:W,height:Q}=p.current.getBoundingClientRect();return[U-X-Y-W/2,H-G-B-Q/2]}return[]},[p,g]),N=Pe(z=>{const{key:U,metaKey:H,ctrlKey:Y}=z,B=H||Y,X=()=>{z.preventDefault(),z.stopPropagation()};if(e>1){const G=(W,Q)=>{X(),l(W,Q)};U==="ArrowDown"?G(0,w):U==="ArrowUp"?G(0,-w):U==="ArrowLeft"?G(-w,0):U==="ArrowRight"&&G(w,0)}U==="+"||B&&U==="="?(X(),o()):U==="-"||B&&U==="_"?(X(),a()):B&&U==="0"&&(X(),s(1))}),I=Pe(z=>{if((z.ctrlKey||v)&&Math.abs(z.deltaY)>Math.abs(z.deltaX)){z.stopPropagation(),s(Fl(e,-z.deltaY,O),!0,...y(z));return}e>1&&(z.stopPropagation(),v||l(z.deltaX,z.deltaY))}),F=T.useCallback(z=>{const U=h.current;U.splice(0,U.length,...U.filter(H=>H.pointerId!==z.pointerId))},[]),P=T.useCallback(z=>{F(z),z.persist(),h.current.push(z)},[F]),L=Pe(z=>{var U;const H=h.current;if(z.pointerType==="mouse"&&z.buttons>1||!(!((U=f?.current)===null||U===void 0)&&U.contains(z.target)))return;e>1&&z.stopPropagation();const{timeStamp:Y}=z;if(H.length===0&&Y-d.current<(z.pointerType==="touch"?E:A)){d.current=0;const B=e>=1?e!==r?e*Math.max(r**(1/_),x):1:e!==t?e/Math.max(t**(-1/_),x):1;s(B,!1,...y(z))}else d.current=Y;if(P(z),H.length===2){const B=Ll(H[0],H[1]);i.current={previousDistance:B,initialDistance:Math.max(B,1),initialZoom:e}}}),$=Pe(z=>{const U=h.current,H=U.find(Y=>Y.pointerId===z.pointerId);if(U.length===2&&i.current){z.stopPropagation(),P(z);const Y=Ll(U[0],U[1]),B=k?i.current.initialZoom/i.current.initialDistance*Y:Fl(e,Y-i.current.previousDistance,M);s(B,!0,...U.map(X=>y(X)).reduce((X,G)=>G.map((W,Q)=>X[Q]+W/2))),i.current.previousDistance=Y;return}e>1&&(z.stopPropagation(),H&&(U.length===1&&l((H.clientX-z.clientX)/e,(H.clientY-z.clientY)/e),P(z)))}),S=T.useCallback(z=>{const U=h.current;U.length===2&&U.find(H=>H.pointerId===z.pointerId)&&(i.current=void 0),F(z)},[F]),b=T.useCallback(()=>{const z=h.current;z.splice(0,z.length),d.current=0,i.current=void 0},[]);xl(m,L,$,S,n),T.useEffect(b,[u,b]),T.useEffect(()=>n?()=>{}:Lr(b,m(Ho,N),m(Go,I)),[n,m,b,N,I])}function $f(e,t,r){const[n,o]=T.useState(1),[a,s]=T.useState(0),[l,f]=T.useState(0),h=If(n,a,l,r),{currentSlide:d,globalIndex:i}=Ft(),{containerRect:u,slideRect:g}=Bt(),{minZoom:p,zoomInMultiplier:m}=Un(),w=d&&cr(d)?d.src:void 0,x=!r?.current;Gt(()=>{o(1),s(0),f(0)},[i,w]);const O=T.useCallback((M,k,y)=>{const N=y||n,I=a-(M||0),F=l-(k||0),P=(e.width*N-g.width)/2/N,L=(e.height*N-g.height)/2/N;s(Math.min(Math.abs(I),Math.max(P,0))*Math.sign(I)),f(Math.min(Math.abs(F),Math.max(L,0))*Math.sign(F))},[n,a,l,g,e.width,e.height]),v=T.useCallback((M,k,y,N)=>{const I=Bo(M+.01<t?M-.01>p?M:p:t,5);k||h(),O(y?y*(1/n-1/I):0,N?N*(1/n-1/I):0,I),o(I)},[n,p,t,O,h]),E=Pe(()=>{n>1&&(n>t&&v(t,!0),O())});Gt(E,[u.width,u.height,E]);const A=T.useCallback(()=>{const M=n*m;v(n<1&&M>1?1:M)},[n,m,v]),_=T.useCallback(()=>{const M=n/m;v(n>1&&M<1?1:M)},[n,m,v]);return{zoom:n,offsetX:a,offsetY:l,disabled:x,changeOffsets:O,changeZoom:v,zoomIn:A,zoomOut:_}}const $l=T.createContext(null),na=At("useZoom","ZoomControllerContext",$l);function Uf({children:e}){const[t,r]=T.useState(),{slideRect:n}=Bt(),{ref:o,minZoom:a}=Un(),{imageRect:s,maxZoom:l}=Lf(n,t?.imageDimensions),{zoom:f,offsetX:h,offsetY:d,disabled:i,changeZoom:u,changeOffsets:g,zoomIn:p,zoomOut:m}=$f(s,l,t?.zoomWrapperRef);Df(f,i),Ff(f,a,l,i,p,m,u,g,t?.zoomWrapperRef);const w=T.useMemo(()=>({zoom:f,minZoom:a,maxZoom:l,offsetX:h,offsetY:d,disabled:i,zoomIn:p,zoomOut:m,changeZoom:u}),[f,a,l,h,d,i,p,m,u]);T.useImperativeHandle(o,()=>w,[w]);const x=T.useMemo(()=>({...w,setZoomWrapper:r}),[w,r]);return T.createElement($l.Provider,{value:x},e)}const zf=xt("ZoomIn",T.createElement(T.Fragment,null,T.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"}),T.createElement("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"}))),Hf=xt("ZoomOut",T.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"})),Ul=T.forwardRef(function({zoomIn:t,onLoseFocus:r},n){const o=T.useRef(!1),a=T.useRef(!1),{zoom:s,minZoom:l,maxZoom:f,zoomIn:h,zoomOut:d,disabled:i}=na(),{render:u}=it(),g=i||(t?s>=f:s<=l);return T.useEffect(()=>{g&&o.current&&a.current&&r(),g||(o.current=!0)},[g,r]),T.createElement(zr,{ref:n,disabled:g,label:t?"Zoom in":"Zoom out",icon:t?zf:Hf,renderIcon:t?u.iconZoomIn:u.iconZoomOut,onClick:t?h:d,onFocus:()=>{a.current=!0},onBlur:()=>{a.current=!1}})});function Gf(){const e=T.useRef(null),t=T.useRef(null),{focus:r}=Bt(),n=T.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=T.useCallback(()=>n(e),[n]),a=T.useCallback(()=>n(t),[n]);return T.createElement(T.Fragment,null,T.createElement(Ul,{zoomIn:!0,ref:e,onLoseFocus:a}),T.createElement(Ul,{ref:t,onLoseFocus:o}))}function jf(){const{render:e}=it(),t=na();return e.buttonZoom?T.createElement(T.Fragment,null,e.buttonZoom(t)):T.createElement(Gf,null)}function Bf(e){var t;return(((t=e.srcSet)===null||t===void 0?void 0:t.length)||0)>0}function Wf({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(el)}}function Kf(e){var t,r;const[{current:n,preload:o},a]=T.useReducer(Wf,{}),{slide:s,rect:l,imageFit:f,render:h,interactive:d}=e,i=s.srcSet.sort((A,_)=>A.width-_.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=Wo(s,f),m=Math.max(...i.map(A=>A.width)),w=Math.min((p?Math.max:Math.min)(l.width,u*(l.height/g)),m),x=Uu(),O=Pe(()=>{var A;const _=(A=i.find(M=>M.width>=w*x))!==null&&A!==void 0?A:i[i.length-1];(!n||i.findIndex(M=>M.src===n)<i.findIndex(M=>M===_))&&a({type:"fetch",source:_.src})});Gt(O,[l.width,l.height,x,O]);const v=Pe(A=>a({type:"done",source:A})),E={WebkitTransform:d?"initial":"translateZ(0)"};return p||Object.assign(E,l.width/l.height<u/g?{width:"100%",height:"auto"}:{width:"auto",height:"100%"}),T.createElement(T.Fragment,null,o&&o!==n&&T.createElement(yr,{key:"preload",...e,offset:void 0,slide:{...s,src:o,srcSet:void 0},style:{position:"absolute",visibility:"hidden",...E},onLoad:()=>v(o),render:{...h,iconLoading:()=>null,iconError:()=>null}}),n&&T.createElement(yr,{key:"current",...e,slide:{...s,src:n,srcSet:void 0},style:E}))}function Vf({render:e,slide:t,offset:r,rect:n}){var o;const[a,s]=T.useState(),l=T.useRef(null),f=cr(t),{zoom:h,maxZoom:d,offsetX:i,offsetY:u,setZoomWrapper:g}=na(),p=h>1,{carousel:m,on:w}=it(),{currentIndex:x}=Ft();Gt(()=>{if(r!==0||f||!l.current)return()=>{};const v=()=>{const A=l.current;if(!A)return;let _=0,M=0;for(const k of A.children)k instanceof HTMLElement&&(_=Math.max(_,k.offsetWidth),M=Math.max(M,k.offsetHeight));s(k=>k&&k.width===_&&k.height===M?k:{width:_,height:M})};if(v(),typeof ResizeObserver>"u")return()=>{};const E=new ResizeObserver(v);for(const A of l.current.children)E.observe(A);return()=>E.disconnect()},[r,f,n]),Gt(()=>r===0?(g({zoomWrapperRef:l,imageDimensions:a}),()=>g(void 0)):()=>{},[r,a,g]);let O=(o=e.slide)===null||o===void 0?void 0:o.call(e,{slide:t,offset:r,rect:n,zoom:h,maxZoom:d});if(!O&&f){const v={slide:t,offset:r,rect:n,render:e,imageFit:m.imageFit,imageProps:m.imageProps,onClick:r===0?()=>{var E;return(E=w.click)===null||E===void 0?void 0:E.call(w,{index:x})}:void 0};O=Bf(t)?T.createElement(Kf,{...v,slide:t,interactive:p,rect:r===0?{width:n.width*h,height:n.height*h}:n}):T.createElement(yr,{onLoad:E=>s({width:E.naturalWidth,height:E.naturalHeight}),...v})}return O?T.createElement("div",{ref:l,className:ht(ye(Ws),ye(Dr),ye(Vs),p&&ye(Mu)),style:r===0?{transform:`scale(${h}) translateX(${i}px) translateY(${u}px)`}:void 0},O):null}const Yf=({augment:e,addModule:t})=>{e(({zoom:r,toolbar:n,render:o,controller:a,...s})=>{const l=Pl(r);return{zoom:l,toolbar:Ln(n,Bs,T.createElement(jf,null)),render:{...o,slide:f=>{var h,d;return cr(f.slide)||f.slide.type!=null&&(!((h=l.supports)===null||h===void 0)&&h.includes(f.slide.type))?T.createElement(Vf,{render:o,...f}):(d=o.slide)===null||d===void 0?void 0:d.call(o,f)}},controller:{...a,preventDefaultWheelY:l.scrollToZoom},...s}}),t(Lt(Bs,Uf))},Xf={separator:"/",container:{}},zl=e=>({...Xf,...e});function Zf({counter:e}){const{slides:t,currentIndex:r}=Ft(),{separator:n,container:{className:o,...a},className:s,...l}=zl(e);return t.length===0?null:T.createElement("div",{className:ht(ye("counter"),o||s),...l,...a,"aria-hidden":!0},r+1," ",n," ",t.length)}function qf({augment:e,addChild:t}){e(({counter:r,...n})=>({counter:zl(r),...n})),t(rn,Lt(Su,Zf))}const Qf={autoplay:!1,delay:3e3,ref:null},Hl=e=>({...Qf,...e}),Gl=T.createContext(null),Jf=At("useSlideshow","SlideshowContext",Gl);function Rf({slideshow:e,carousel:{finite:t},on:r,children:n}){const{autoplay:o,delay:a,ref:s}=Hl(e),l=T.useRef(o),[f,h]=T.useState(o),d=T.useRef(void 0),i=T.useRef(void 0),{slides:u,currentIndex:g}=Ft(),{setTimeout:p,clearTimeout:m}=cn(),{subscribe:w}=Ur(),{next:x}=Bt(),{setAutoPlaying:O}=qo();T.useEffect(()=>O(f),[f,O]);const v=u.length===0||t&&g===u.length-1,E=T.useCallback(()=>{!f&&!v&&h(!0)},[f,v]),A=T.useCallback(()=>{f&&h(!1)},[f]),_=T.useCallback(()=>{m(d.current),d.current=void 0},[m]),M=Pe(()=>{_(),!(!f||v||i.current===Ir||i.current===$o)&&(d.current=p(()=>{f&&(i.current=void 0,x())},a))});T.useEffect(M,[g,f,M]),T.useEffect(()=>{f&&v&&h(!1)},[g,f,v]);const k=Pe(()=>{var I;return(I=r.slideshowStart)===null||I===void 0?void 0:I.call(r)}),y=Pe(()=>{var I;return(I=r.slideshowStop)===null||I===void 0?void 0:I.call(r)});T.useEffect(()=>{f?k():l.current&&y(),l.current=f},[f,k,y]),T.useEffect(()=>Lr(_,w(Eu,()=>{i.current=Ir,_()}),w(Tu,()=>{i.current=$o,_()}),w(Nu,()=>{i.current=an,M()}),w(Au,()=>{i.current=sn,M()})),[w,_,M]);const N=T.useMemo(()=>({playing:f,disabled:v,play:E,pause:A}),[f,v,E,A]);return T.useImperativeHandle(s,()=>N,[N]),T.createElement(Gl.Provider,{value:N},n)}const eg=xt("Play",T.createElement("path",{d:"M8 5v14l11-7z"})),tg=xt("Pause",T.createElement("path",{d:"M6 19h4V5H6v14zm8-14v14h4V5h-4z"}));function rg(){const{playing:e,disabled:t,play:r,pause:n}=Jf(),{render:o}=it(),a=yl(Bt().focus,t);return o.buttonSlideshow?T.createElement(T.Fragment,null,o.buttonSlideshow({playing:e,disabled:t,play:r,pause:n})):T.createElement(zr,{label:e?"Pause":"Play",icon:e?tg:eg,renderIcon:e?o.iconSlideshowPause:o.iconSlideshowPlay,onClick:e?n:r,disabled:t,...a})}function ng({augment:e,addModule:t}){e(({slideshow:r,toolbar:n,...o})=>({toolbar:Ln(n,js,T.createElement(rg,null)),slideshow:Hl(r),...o})),t(Lt(js,Rf))}const og={auto:!1,ref:null},jl=e=>({...og,...e}),Bl=T.createContext(null),ag=At("useFullscreen","FullscreenContext",Bl);function sg({fullscreen:e,on:t,children:r}){const{auto:n,ref:o}=jl(e),a=T.useRef(null),[s,l]=T.useState(),[f,h]=T.useState(!1),d=T.useRef(!1),{getOwnerDocument:i}=$r();Gt(()=>{var v,E,A,_;const M=i();l(!((_=(A=(E=(v=M.fullscreenEnabled)!==null&&v!==void 0?v:M.webkitFullscreenEnabled)!==null&&E!==void 0?E:M.mozFullScreenEnabled)!==null&&A!==void 0?A:M.msFullscreenEnabled)!==null&&_!==void 0&&_))},[i]);const u=T.useCallback(()=>{var v;const E=i(),A=E.fullscreenElement||E.webkitFullscreenElement||E.mozFullScreenElement||E.msFullscreenElement;return((v=A?.shadowRoot)===null||v===void 0?void 0:v.fullscreenElement)||A},[i]),g=T.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=T.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]);T.useEffect(()=>{const v=i(),E=()=>{h(u()===a.current)};return Lr(...["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].map(A=>(v.addEventListener(A,E),()=>v.removeEventListener(A,E))))},[u,i]);const m=Pe(()=>{var v;return(v=t.enterFullscreen)===null||v===void 0?void 0:v.call(t)}),w=Pe(()=>{var v;return(v=t.exitFullscreen)===null||v===void 0?void 0:v.call(t)});T.useEffect(()=>{f&&(d.current=!0),d.current&&(f?m:w)()},[f,m,w]);const x=Pe(()=>{var v;return(v=n?g:null)===null||v===void 0||v(),p});T.useEffect(x,[x]);const O=T.useMemo(()=>({fullscreen:f,disabled:s,enter:g,exit:p}),[f,s,g,p]);return T.useImperativeHandle(o,()=>O,[O]),T.createElement("div",{ref:a,className:ht(ye(nn),ye(Ws))},T.createElement(Bl.Provider,{value:O},r))}const lg=xt("EnterFullscreen",T.createElement("path",{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"})),ig=xt("ExitFullscreen",T.createElement("path",{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"}));function cg(){var e;const{fullscreen:t,disabled:r,enter:n,exit:o}=ag(),{render:a}=it();return r?null:a.buttonFullscreen?T.createElement(T.Fragment,null,(e=a.buttonFullscreen)===null||e===void 0?void 0:e.call(a,{fullscreen:t,disabled:r,enter:n,exit:o})):T.createElement(zr,{disabled:r,label:t?"Exit Fullscreen":"Enter Fullscreen",icon:t?ig:lg,renderIcon:t?a.iconExitFullscreen:a.iconEnterFullscreen,onClick:t?o:n})}function dg({augment:e,contains:t,addParent:r}){e(({fullscreen:n,toolbar:o,...a})=>({toolbar:Ln(o,nn,T.createElement(cg,null)),fullscreen:jl(n),...a})),r(t(on)?on:rn,Lt(nn,sg))}const wr={ref:null,position:"bottom",width:120,height:80,border:1,borderRadius:4,padding:4,gap:16,imageFit:"contain",vignette:!0,hidden:!1,showToggle:!1},oa=e=>({...wr,...e});function Wl(){const{thumbnails:e}=it();return oa(e)}const xr=e=>pr(on,e),ct=e=>xr(pr("thumbnail",e)),ug=xt("VideoThumbnail",T.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"})),fg=xt("UnknownThumbnail",T.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 gg({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 T.createElement(yr,{slide:{src:e.thumbnail},...s});if(cr(e))return T.createElement(yr,{slide:e,...s});const l=ye(ct(In));return e.type==="video"?T.createElement(T.Fragment,null,e.poster&&T.createElement(yr,{slide:{src:e.poster},...s}),T.createElement(ug,{className:l})):T.createElement(fg,{className:l})}const hg=mr("active"),aa=mr("fadein"),sa=mr("fadeout"),pg=mr("placeholder"),Kl="delay",Vl="duration";function mg({slide:e,index:t,onClick:r,fadeIn:n,fadeOut:o,placeholder:a,onLoseFocus:s}){const l=T.useRef(null),{render:f,styles:h,labels:d}=it(),{slides:i,globalIndex:u}=Ft(),{getOwnerDocument:g}=$r(),{width:p,height:m,imageFit:w}=Wl(),x={width:p,height:m},O=t===u,v=Pe(s);return T.useEffect(()=>{o&&g().activeElement===l.current&&v()},[o,v,g]),T.createElement("button",{ref:l,type:"button",className:ht(ye(Dr),ye(ct()),O&&ye(ct(hg())),n&&ye(ct(aa())),o&&ye(ct(sa())),a&&ye(ct(pg()))),style:{...n?{[Ye(ct(aa(Vl)))]:`${n.duration}ms`,[Ye(ct(aa(Kl)))]:`${n.delay}ms`}:null,...o?{[Ye(ct(sa(Vl)))]:`${o.duration}ms`,[Ye(ct(sa(Kl)))]:`${o.delay}ms`}:null,...h.thumbnail},onClick:r,"aria-current":O?!0:void 0,"aria-label":rl(d,i,t)},e&&gg({slide:e,render:f,rect:x,imageFit:w}))}function Yl(e){return["top","bottom"].includes(e)}function Xl(e,t){return t+2*(e.border+e.padding)+e.gap}function bg(e){const{thumbnail:t,poster:r}=e||{thumbnail:"placeholder"};return typeof t=="string"&&t||typeof r=="string"&&r||e&&nl(e)||void 0}function Zl({visible:e,containerRef:t}){const r=T.useRef(null),n=$n(),{publish:o,subscribe:a}=Ur(),{carousel:s,styles:l,labels:f}=it(),{slides:h,globalIndex:d,animation:i}=Ft(),{registerSensors:u,subscribeSensors:g}=vl();El(g);const p=Wl(),{position:m,width:w,height:x,border:O,borderStyle:v,borderColor:E,borderRadius:A,padding:_,gap:M,vignette:k}=p,y=i?.duration!==void 0&&i?.increment||0,N=i?.duration||0,{prepareAnimation:I}=Jo(r,S=>({keyframes:Yl(m)?[{transform:`translateX(${(n?-1:1)*Xl(p,w)*y+S}px)`},{transform:"translateX(0)"}]:[{transform:`translateY(${Xl(p,x)*y+S}px)`},{transform:"translateY(0)"}],duration:N,easing:i?.easing})),F=Pe(()=>{let S=0;if(t.current&&r.current){const b=t.current.getBoundingClientRect(),z=r.current.getBoundingClientRect();S=Yl(m)?z.left-b.left-(b.width-z.width)/2:z.top-b.top-(b.height-z.height)/2}I(S)});T.useEffect(()=>Lr(a(zo,F)),[a,F]);const P=ol(s,h),L=[];if(Vo(h))for(let S=d-P-Math.abs(y);S<=d+P+Math.abs(y);S+=1){const z=s.finite&&(S<0||S>h.length-1)||y<0&&S<d-P||y>0&&S>d+P?null:Yo(h,S),U=[`${S}`,bg(z)].filter(Boolean).join("|");L.push({key:U,index:S,slide:z})}const $=S=>()=>{S>d?o(ir,{count:S-d}):S<d&&o(lr,{count:d-S})};return T.createElement("div",{className:ht(ye(xr("container")),ye(Dr)),style:{...e?null:{display:"none"},...w!==wr.width?{[Ye(ct("width"))]:`${w}px`}:null,...x!==wr.height?{[Ye(ct("height"))]:`${x}px`}:null,...O!==wr.border?{[Ye(ct("border"))]:`${O}px`}:null,...v?{[Ye(ct("border_style"))]:v}:null,...E?{[Ye(ct("border_color"))]:E}:null,...A!==wr.borderRadius?{[Ye(ct("border_radius"))]:`${A}px`}:null,..._!==wr.padding?{[Ye(ct("padding"))]:`${_}px`}:null,...M!==wr.gap?{[Ye(ct("gap"))]:`${M}px`}:null,...l.thumbnailsContainer}},T.createElement("nav",{ref:r,style:l.thumbnailsTrack,className:ht(ye(xr("track")),ye(Dr)),"aria-label":br(f,"Thumbnails"),tabIndex:-1,...u},L.map(({key:S,index:b,slide:z})=>{const U=N/Math.abs(y||1),H=y>0&&b>d+P-y&&b<=d+P||y<0&&b<d-P-y&&b>=d-P?{duration:U,delay:((y>0?b-(d+P-y):d-P-y-b)-1)*U}:void 0,Y=y>0&&b<d-P||y<0&&b>d+P?{duration:U,delay:(y>0?y-(d-P-b):-y-(b-(d+P)))*U}:void 0;return T.createElement(mg,{key:S,index:b,slide:z,fadeIn:H,fadeOut:Y,placeholder:!z,onClick:$(b),onLoseFocus:()=>{var B;return(B=r.current)===null||B===void 0?void 0:B.focus()}})})),k&&T.createElement("div",{className:ye(xr("vignette"))}))}const ql=T.createContext(null),yg=At("useThumbnails","ThumbnailsContext",ql);function vg({children:e,...t}){const{ref:r,position:n,hidden:o}=oa(t.thumbnails),[a,s]=T.useState(!o),l=T.useRef(null),f=T.useMemo(()=>({visible:a,show:()=>s(!0),hide:()=>s(!1)}),[a]);return T.useImperativeHandle(r,()=>f,[f]),T.createElement(dl,{...t},T.createElement(ql.Provider,{value:f},T.createElement("div",{ref:l,className:ht(ye(xr()),ye(xr(`${n}`)))},["start","top"].includes(n)&&T.createElement(Zl,{containerRef:l,visible:a}),T.createElement("div",{className:ye(xr("wrapper"))},e),["end","bottom"].includes(n)&&T.createElement(Zl,{containerRef:l,visible:a}))))}const Ql=()=>T.createElement(T.Fragment,null,T.createElement("path",{strokeWidth:2,stroke:"currentColor",strokeLinejoin:"round",fill:"none",d:"M3 5l18 0l0 14l-18 0l0-14z"}),T.createElement("path",{d:"M5 14h4v3h-4zM10 14h4v3h-4zM15 14h4v3h-4z"})),wg=xt("ThumbnailsVisible",Ql()),xg=Ju("ThumbnailsHidden",Ql());function kg(){const{visible:e,show:t,hide:r}=yg(),{render:n}=it();return n.buttonThumbnails?T.createElement(T.Fragment,null,n.buttonThumbnails({visible:e,show:t,hide:r})):T.createElement(zr,{label:e?"Hide thumbnails":"Show thumbnails",icon:e?wg:xg,renderIcon:e?n.iconThumbnailsVisible:n.iconThumbnailsHidden,onClick:e?r:t})}function Cg({augment:e,contains:t,append:r,addParent:n}){e(({thumbnails:a,toolbar:s,...l})=>{const f=oa(a);return{toolbar:Ln(s,on,f.showToggle?T.createElement(kg,null):null),thumbnails:f,...l}});const o=Lt(on,vg);t(nn)?r(nn,o):n(rn,o)}const Ot=({className:e="",children:t,style:r,...n})=>c.jsx("i",{className:e,style:r,...n,children:t}),la=window.G7Core,zn=(e,t)=>la?.t?.(e,t)??e,Sg=async(e,t)=>{try{const r=await la.api.get(e,{responseType:"blob"});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),la?.toast?.error?.(zn("common.download_failed"))}},_g=(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)},Jl=async e=>{const t=e.downloadUrl||e.src,r=e.filename||e.title||"image";e.downloadRequiresAuth?await Sg(t,r):_g(t,r)},Eg=({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 Jl(e)}finally{o(!1)}};return c.jsx(J,{type:"button",onClick:a,disabled:n,className:"yarl__button flex items-center justify-center","aria-label":zn("common.download"),title:zn("common.download"),children:n?c.jsx(Ot,{className:"fa-solid fa-spinner fa-spin text-white"}):c.jsx(Ot,{className:"fa-solid fa-download text-white"})})},Hr=({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:d,editorAttrs:i,id:u})=>{const[g,p]=C.useState(n),m=C.useRef(n),w=e.map(v=>({src:v.src,title:v.title,description:v.description})),x=[];o&&x.push(Yf),a&&x.push(ng),s&&x.push(dg),l&&x.push(qf),h&&x.push(Cg);const O=e[g];if(C.useEffect(()=>{m.current=g},[g]),i){const v=(e??[]).slice(0,4);return c.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((E,A)=>c.jsx(zt,{src:E.thumbnail||E.src,alt:E.title||"",className:"w-full aspect-square object-cover rounded bg-gray-200 dark:bg-gray-700"},A)):c.jsxs(j,{className:"col-span-2 flex items-center justify-center py-6 text-sm text-gray-400 dark:text-gray-500",children:[c.jsx(Ot,{className:"fa-regular fa-images mr-2"}),zn("editor.component.image_gallery")]})})}return c.jsx(Of,{open:t,close:r,slides:w,index:g,plugins:x,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&&O&&c.jsx(Eg,{image:O,index:g,onDownload:d},"download"),"close"].filter(Boolean)},styles:{container:{backgroundColor:"rgba(0, 0, 0, 0.9)"}}})},Rl=()=>{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}}};Hr.displayName="ImageGallery";const ei=Object.freeze(Object.defineProperty({__proto__:null,ImageGallery:Hr,default:Hr,executeImageDownload:Jl,useImageGallery:Rl},Symbol.toStringTag,{value:"Module"})),Tg=window.G7Core,ia=(e,t)=>Tg?.t?.(e,t)??e,Hn=e=>e.url??e.download_url,Gn=({images:e=[],className:t="",id:r,editorAttrs:n})=>{const[o,a]=C.useState(0),{openGallery:s,galleryProps:l}=Rl(),f=C.useMemo(()=>e.map(d=>({src:Hn(d),title:d.alt_text_current??"",thumbnail:Hn(d),downloadUrl:d.download_url,filename:d.alt_text_current??`image-${d.id}`})),[e]);if(!e||e.length===0)return c.jsx(j,{className:`flex items-center justify-center bg-gray-100 dark:bg-gray-700 rounded-lg aspect-square ${t}`,id:r,...n,children:c.jsxs(j,{className:"text-center text-gray-400 dark:text-gray-500",children:[c.jsx(ge,{name:"image",size:"3x",className:"mb-3 opacity-50"}),c.jsx(j,{className:"text-sm",children:ia("shop.no_image")})]})});const h=e[o]??e[0];return c.jsxs(j,{id:r,className:t,...n,children:[c.jsx(j,{className:"relative overflow-hidden rounded-lg bg-gray-100 dark:bg-gray-700 aspect-square mb-3",children:c.jsx(J,{type:"button",className:"w-full h-full cursor-zoom-in block",onClick:()=>s(f,o),"aria-label":ia("shop.view_image"),children:c.jsx(zt,{src:Hn(h),alt:h.alt_text_current??"",className:"w-full h-full object-contain"})})}),e.length>1&&c.jsx(j,{className:"flex gap-2 overflow-x-auto pb-1",children:e.map((d,i)=>c.jsx(J,{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":d.alt_text_current??`${ia("shop.image")} ${i+1}`,children:c.jsx(zt,{src:Hn(d),alt:d.alt_text_current??"",className:"w-full h-full object-cover"})},d.id))}),c.jsx(Hr,{...l})]})};Gn.displayName="ProductImageViewer";const Ng=Object.freeze(Object.defineProperty({__proto__:null,ProductImageViewer:Gn,default:Gn},Symbol.toStringTag,{value:"Module"})),ti=({value:e,min:t=1,max:r=999,onChange:n,size:o="md",disabled:a=!1,className:s="",id:l,editorAttrs:f})=>{const d={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=x=>{const O=parseInt(x.target.value,10);if(!isNaN(O)){const v=Math.max(t,Math.min(r,O));n(v)}},p=x=>{const O=parseInt(x.target.value,10);isNaN(O)||O<t?n(t):O>r&&n(r)},m=a||e<=t,w=a||e>=r;return c.jsxs(j,{className:`inline-flex items-center border border-gray-300 dark:border-gray-600 rounded-lg ${d.container} ${s}`,id:l,...f,children:[c.jsx(J,{type:"button",onClick:i,disabled:m,className:`${d.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:c.jsx(ge,{name:"minus",className:"w-4 h-4"})}),c.jsx(Et,{type:"number",value:e,onChange:g,onBlur:p,min:t,max:r,disabled:a,className:`${d.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":"수량"}),c.jsx(J,{type:"button",onClick:u,disabled:w,className:`${d.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:c.jsx(ge,{name:"plus",className:"w-4 h-4"})})]})},Ag=Object.freeze(Object.defineProperty({__proto__:null,default:ti},Symbol.toStringTag,{value:"Module"})),Og=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)},ri=(e,t)=>window.G7Core?.t?.(e,t)??e,Mg=[{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"}],ni=({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"},d=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){Og.error("리액션 오류:",g)}};return c.jsx(j,{className:`flex flex-wrap gap-2 ${a}`,id:s,...l,children:Mg.map(u=>{const g=d(u.type),p=t===u.type;return c.jsxs(J,{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:ri(u.labelKey),children:[c.jsx(re,{className:h[o],children:u.emoji}),c.jsx(re,{children:ri(u.labelKey)}),g>0&&c.jsx(re,{className:"font-medium",children:g})]},u.type)})})},Ig=Object.freeze(Object.defineProperty({__proto__:null,default:ni},Symbol.toStringTag,{value:"Module"})),jn=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)},Mt=(e,t)=>window.G7Core?.t?.(e,t)??e,oi=({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 d=C.useRef(null),[i,u]=C.useState(t),[g,p]=C.useState(!1),[m,w]=C.useState(!1),[x,O]=C.useState("");C.useEffect(()=>{d.current&&!d.current.innerHTML&&(d.current.innerHTML=t)},[t]),C.useEffect(()=>{n&&n(i)},[i,n]);const v=N=>{jn.log("Apply format:",N)},E=async N=>{const I=new FormData;I.append("file",N);try{const F=await fetch(o,{method:"POST",body:I,credentials:"include"});if(!F.ok)throw new Error("업로드 실패");const P=await F.json();jn.log("Image uploaded:",P.url)}catch(F){jn.error("이미지 업로드 오류:",F)}},A=N=>{const I=N.target.files?.[0];I&&E(I)},_=()=>{x&&(jn.log("Insert link:",x),w(!1),O(""))},M=[{format:"bold",icon:"B",title:Mt("editor.toolbar.bold")},{format:"italic",icon:"I",title:Mt("editor.toolbar.italic")},{format:"underline",icon:"U",title:Mt("editor.toolbar.underline")},{format:"strike",icon:"S",title:Mt("editor.toolbar.strike")},{format:"code",icon:"</>",title:Mt("editor.toolbar.code")}],k=[{format:"h1",label:"H1"},{format:"h2",label:"H2"},{format:"h3",label:"H3"}],y=[{format:"bulletList",icon:"•",title:Mt("editor.toolbar.bullet_list")},{format:"orderedList",icon:"1.",title:Mt("editor.toolbar.ordered_list")},{format:"blockquote",icon:"❝",title:Mt("editor.toolbar.blockquote")}];return c.jsxs(j,{className:`border border-gray-300 dark:border-gray-600 rounded-lg overflow-hidden ${l}`,id:f,...h,children:[c.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:[c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:M.map(N=>c.jsx(J,{type:"button",onClick:()=>v(N.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:N.title,children:N.icon},N.format))}),c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:k.map(N=>c.jsx(J,{type:"button",onClick:()=>v(N.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:N.label},N.format))}),c.jsx(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:y.map(N=>c.jsx(J,{type:"button",onClick:()=>v(N.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:N.title,children:N.icon},N.format))}),c.jsxs(j,{className:"flex items-center gap-1 pr-2 border-r border-gray-200 dark:border-gray-700",children:[c.jsx(J,{type:"button",onClick:()=>w(!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:Mt("editor.toolbar.link"),children:"🔗"}),c.jsxs(Nr,{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:["🖼",c.jsx(Et,{type:"file",accept:"image/*",onChange:A,disabled:s,className:"hidden"})]})]}),c.jsxs(J,{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:["</>",Mt("editor.toolbar.code_view")]})]}),g?c.jsx(wo,{value:i,onChange:N=>u(N.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}}):c.jsx(j,{ref:d,contentEditable:!s,onInput:N=>u(N.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}),c.jsx(Et,{type:"hidden",name:e,value:i}),m&&c.jsx(j,{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:c.jsxs(j,{className:"bg-white dark:bg-gray-800 rounded-lg p-6 w-96",children:[c.jsx(Tn,{className:"text-lg font-medium text-gray-900 dark:text-white mb-4",children:Mt("editor.link_modal.title")}),c.jsx(Et,{type:"url",value:x,onChange:N=>O(N.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"}),c.jsxs(j,{className:"flex justify-end gap-2",children:[c.jsx(J,{type:"button",onClick:()=>{w(!1),O("")},className:"px-4 py-2 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg",children:Mt("common.cancel")}),c.jsx(J,{type:"button",onClick:_,className:"px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700",children:Mt("editor.link_modal.insert")})]})]})})]})},Dg=Object.freeze(Object.defineProperty({__proto__:null,default:oi},Symbol.toStringTag,{value:"Module"})),ca=({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 c.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 Po.sanitize(l,i).replace(/<a\s+([^>]*?)href=["']([^"']+)["']([^>]*?)>/gi,(g,p,m,w)=>(m.startsWith("http://")||m.startsWith("https://"))&&!g.includes("rel=")?`<a ${p}href="${m}"${w} rel="noopener noreferrer">`:g)},[l,o]),d=`
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 c.jsx(j,{id:a,className:d,dangerouslySetInnerHTML:{__html:h},...s})},Pg=Object.freeze(Object.defineProperty({__proto__:null,HtmlContent:ca},Symbol.toStringTag,{value:"Module"})),da=()=>window.G7Core,ua=(e,t)=>da()?.t?.(e,t)??e,ai=({content:e="",onChange:t,isHtml:r=!1,onIsHtmlChange:n,rows:o=15,placeholder:a="",label:s,showHtmlModeToggle:l=!0,contentClassName:f="",purifyConfig:h,className:d="",name:i="content",htmlFieldName:u="content_mode",readOnly:g=!1,id:p,editorAttrs:m})=>{const[w,x]=C.useState(r),[O,v]=C.useState(e),[E,A]=C.useState(!1);C.useEffect(()=>{x(r)},[r]),C.useEffect(()=>{v(e)},[e]);const _=C.useCallback(y=>{const N=y.target.value;if(v(N),t){const I=da()?.createChangeEvent?.({value:N,name:i,type:"textarea"})??{target:{name:i,value:N}};t(I)}},[t,i]),M=C.useCallback(y=>{const N=y.target.checked;if(x(N),N||A(!1),n){const I=da()?.createChangeEvent?.({checked:N,name:u,type:"checkbox"})??{target:{name:u,checked:N}};n(I)}},[n,u]),k=C.useCallback(()=>{A(y=>!y)},[]);return c.jsxs(j,{className:`space-y-2 ${d}`,id:p,...m,children:[c.jsxs(j,{className:"flex items-center justify-between",children:[s&&c.jsx(Nr,{className:"block text-sm font-medium text-gray-500 dark:text-gray-400",children:s}),c.jsxs(j,{className:"flex items-center gap-3",children:[w&&!g&&c.jsx(J,{type:"button",onClick:k,className:`px-3 py-1.5 text-xs font-bold rounded-lg focus:outline-none focus:ring-2 ${E?"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:ua(E?"common.preview_off":"common.preview")}),l&&c.jsxs(Nr,{className:"flex items-center gap-2 p-2 cursor-pointer",children:[c.jsx(Et,{type:"checkbox",name:u,checked:w,onChange:M,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"}),c.jsx(j,{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:ua("common.html_mode")})]})]})]}),!E&&c.jsx(wo,{name:i,value:O,onChange:_,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 ${w?"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"}`}),E&&c.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:c.jsx(ca,{content:O,isHtml:!0,className:f||"prose dark:prose-invert max-w-none text-gray-900 dark:text-gray-100",purifyConfig:h})})]})},Lg=Object.freeze(Object.defineProperty({__proto__:null,HtmlEditor:ai},Symbol.toStringTag,{value:"Module"})),si=e=>window.G7Core?.t?.(e)??e,fa=({maxHeight:e=500,expandText:t,collapseText:r,className:n="",children:o,id:a,editorAttrs:s})=>{const[l,f]=C.useState(!1),[h,d]=C.useState(!1),i=C.useRef(null),u=C.useCallback(()=>{if(i.current){const w=i.current.scrollHeight;d(w>e)}},[e]);C.useEffect(()=>{u();const w=i.current;if(!w)return;const x=w.querySelectorAll("img");x.forEach(v=>{v.complete||v.addEventListener("load",u)});let O=null;return typeof ResizeObserver<"u"&&(O=new ResizeObserver(u),O.observe(w)),()=>{x.forEach(v=>{v.removeEventListener("load",u)}),O?.disconnect()}},[u,o]);const g=()=>{f(w=>!w)},p=t||si("sirsoft-ecommerce.shop.product.expand_detail"),m=r||si("sirsoft-ecommerce.shop.product.collapse_detail");return c.jsxs(j,{className:n,id:a,...s,children:[c.jsxs(j,{className:"relative",children:[c.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&&c.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&&c.jsxs(J,{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:[c.jsx(re,{className:"text-sm font-semibold text-gray-600 dark:text-gray-400",children:l?m:p}),c.jsx(ge,{name:l?"chevron-up":"chevron-down",size:"sm"})]})]})},Fg=Object.freeze(Object.defineProperty({__proto__:null,ExpandableContent:fa,default:fa},Symbol.toStringTag,{value:"Module"})),$g=(e,t)=>window.G7Core?.t?.(e,t)??e,ga=({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:d="500px",className:i="",style:u})=>{const g=s!==void 0?s:a,p=C.useRef(null),m=C.useRef(null);if(C.useEffect(()=>{const x=O=>{O.key==="Escape"&&e&&f&&t()};if(e&&f)return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[e,t,f]),C.useEffect(()=>{if(e&&p.current){m.current=document.activeElement;const x=p.current.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),O=x[0],v=x[x.length-1];O?.focus();const E=A=>{A.key==="Tab"&&(A.shiftKey?document.activeElement===O&&(A.preventDefault(),v?.focus()):document.activeElement===v&&(A.preventDefault(),O?.focus()))};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E),m.current?.focus()}}},[e]),C.useEffect(()=>{if(e)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[e]),!e)return null;const w=u?.zIndex??50;return c.jsxs(j,{className:"fixed inset-0 flex items-center justify-center",style:{zIndex:w},onClick:g?t:void 0,children:[c.jsx(j,{className:"absolute inset-0 bg-black/50","aria-hidden":"true"}),c.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:d,...u?{...u,zIndex:void 0}:{}},onClick:x=>x.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":r?"modal-title":void 0,children:[(r||n||l)&&c.jsxs(j,{className:"flex items-center justify-between p-4",children:[(r||n)&&c.jsxs(j,{id:"modal-title",className:"flex items-center gap-3 text-lg font-semibold text-gray-900 dark:text-white",children:[n&&c.jsx(ge,{name:n,size:"md",className:o}),r]}),l&&c.jsx(J,{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":$g("common.close_modal"),children:c.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:c.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),c.jsx(j,{className:"px-6 py-4 overflow-y-auto max-h-[calc(90vh-140px)]",children:h})]})]})},Ug=Object.freeze(Object.defineProperty({__proto__:null,Modal:ga},Symbol.toStringTag,{value:"Module"})),ha=(e,t)=>window.G7Core?.t?.(e,t)??e,pa=({isOpen:e,onClose:t,title:r,message:n,confirmText:o,cancelText:a,onConfirm:s,onCancel:l,confirmButtonVariant:f="primary",cancelButtonVariant:h="secondary",width:d="500px",closeOnOverlay:i=!0,isLoading:u=!1,loadingText:g})=>{const p=o??ha("common.confirm"),m=a??ha("common.cancel"),w=g??ha("common.loading"),x=()=>{s()},O=()=>{u||(l?.(),t())},v=()=>{u||t()},E={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 c.jsxs(ga,{isOpen:e,onClose:v,title:r,width:d,children:[c.jsx(j,{className:"py-2",children:typeof n=="string"?c.jsx(Ut,{className:"text-gray-700 dark:text-gray-300",children:n}):n}),c.jsxs(j,{className:"flex justify-end gap-3 mt-6",children:[c.jsx(J,{onClick:O,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:c.jsx(re,{children:m})}),c.jsxs(J,{onClick:x,disabled:u,className:`flex items-center gap-2 px-4 py-2 rounded-lg disabled:opacity-50 disabled:cursor-not-allowed ${E[f]}`,children:[u&&c.jsx(Ot,{className:"fa-solid fa-spinner w-4 h-4 animate-spin"}),c.jsx(re,{children:u?w:p})]})]})]})},zg=Object.freeze(Object.defineProperty({__proto__:null,ConfirmDialog:pa},Symbol.toStringTag,{value:"Module"})),li=C.createContext(null),ii=({value:e,children:t})=>c.jsx(li.Provider,{value:e,children:t}),Hg=()=>{const e=C.useContext(li);if(!e)throw new Error("useFileUploaderContext must be used within FileUploaderProvider");return e};function Gg(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 ci(e,t){return new Promise((function(r,n){let o;return jg(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 jg=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 d;switch(a.getUint16(h)){case 18761:d=!0;break;case 19789:d=!1;break;default:return r("TIFF header contains invalid endian")}if(a.getUint16(h+2,d)!==42)return r("TIFF header contains invalid version");const i=a.getUint32(h+4,d),u=h+i+2+12*a.getUint16(h+i,d);for(let g=h+i+2;g<u;g+=12)if(a.getUint16(g,d)==274){if(a.getUint16(g+2,d)!==3)return r("Orientation data type is invalid");if(a.getUint32(g+4,d)!==1)return r("Orientation data count is invalid");a.setUint16(g+8,1,d);break}return t(o.slice(s,s+2+f))}s+=2+f}return t(new Blob)})),n.readAsArrayBuffer(e)}));var Bn={},Bg={get exports(){return Bn},set exports(e){Bn=e}};(function(e){var t,r,n={};Bg.exports=n,n.parse=function(o,a){for(var s=n.bin.readUshort,l=n.bin.readUint,f=0,h={},d=new Uint8Array(o),i=d.length-4;l(d,i)!=101010256;)i--;f=i,f+=4;var u=s(d,f+=4);s(d,f+=2);var g=l(d,f+=2),p=l(d,f+=4);f+=4,f=p;for(var m=0;m<u;m++){l(d,f),f+=4,f+=4,f+=4,l(d,f+=4),g=l(d,f+=4);var w=l(d,f+=4),x=s(d,f+=4),O=s(d,f+2),v=s(d,f+4);f+=6;var E=l(d,f+=8);f+=4,f+=x+O+v,n._readLocal(d,E,h,g,w,a)}return h},n._readLocal=function(o,a,s,l,f,h){var d=n.bin.readUshort,i=n.bin.readUint;i(o,a),d(o,a+=4),d(o,a+=2);var u=d(o,a+=2);i(o,a+=2),i(o,a+=4),a+=4;var g=d(o,a+=8),p=d(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 w=new Uint8Array(o.buffer,a);if(u==0)s[m]=new Uint8Array(w.buffer.slice(a,a+l));else{if(u!=8)throw"unknown compression method: "+u;var x=new Uint8Array(f);n.inflateRaw(w,x),s[m]=x}}},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 d in o){var i=!n._noNeed(d)&&!a,u=o[d],g=n.crc.crc(u,0,u.length);h[d]={cpr:i,usize:u.length,crc:g,file:i?n.deflateRaw(u):u}}for(var d in h)s+=h[d].file.length+30+46+2*n.bin.sizeUTF8(d);s+=22;var p=new Uint8Array(s),m=0,w=[];for(var d in h){var x=h[d];w.push(m),m=n._writeHeader(p,m,d,x,0)}var O=0,v=m;for(var d in h)x=h[d],w.push(m),m=n._writeHeader(p,m,d,x,1,w[O++]);var E=m-v;return l(p,m,101010256),m+=4,f(p,m+=4,O),f(p,m+=2,O),l(p,m+=2,E),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 d=n.bin.writeUint,i=n.bin.writeUshort,u=l.file;return d(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),d(o,a+=2,0),d(o,a+=4,l.crc),d(o,a+=4,u.length),d(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,d(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,d=a+s;h<d;){for(var i=Math.min(h+5552,d);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 d=s.charCodeAt(h);if((4294967168&d)==0)o[a+f]=d,f++;else if((4294965248&d)==0)o[a+f]=192|d>>6,o[a+f+1]=128|d>>0&63,f+=2;else if((4294901760&d)==0)o[a+f]=224|d>>12,o[a+f+1]=128|d>>6&63,o[a+f+2]=128|d>>0&63,f+=3;else{if((4292870144&d)!=0)throw"e";o[a+f]=240|d>>18,o[a+f+1]=128|d>>12&63,o[a+f+2]=128|d>>6&63,o[a+f+3]=128|d>>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,d=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+(I=Math.min(65535,m-u))==m?1:0),g=n.F._copyExact(o,u,I,a,g+8),u+=I;return g>>>3}var w=h.lits,x=h.strt,O=h.prev,v=0,E=0,A=0,_=0,M=0,k=0;for(m>2&&(x[k=n.F._hash(o,0)]=0),u=0;u<m;u++){if(M=k,u+1<m-2){k=n.F._hash(o,u+1);var y=u+1&32767;O[y]=x[k],x[k]=y}if(p<=u){(v>14e3||E>26697)&&m-u>100&&(p<u&&(w[v]=u-p,v+=2,p=u),g=n.F._writeBlock(u==m-1||p==m?1:0,w,v,_,o,A,u-A,a,g),v=E=_=0,A=u);var N=0;u<m-2&&(N=n.F._bestMatch(o,u,O,M,Math.min(f[2],m-u),f[3]));var I=N>>>16,F=65535&N;if(N!=0){F=65535&N;var P=d(I=N>>>16,h.of0);h.lhst[257+P]++;var L=d(F,h.df0);h.dhst[L]++,_+=h.exb[P]+h.dxb[L],w[v]=I<<23|u-p,w[v+1]=F<<16|P<<8|L,v+=2,p=u+I}else h.lhst[o[u]]++;E++}}for(A==u&&o.length!=0||(p<u&&(w[v]=u-p,v+=2,p=u),g=n.F._writeBlock(1,w,v,_,o,A,u-A,a,g),v=0,E=0,v=E=_=0,A=u);(7&g)!=0;)g++;return g>>>3},n.F._bestMatch=function(o,a,s,l,f,h){var d=32767&a,i=s[d],u=d-i+32768&32767;if(i==d||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!=d;){if(g==0||o[a+g]==o[a+g-u]){var w=n.F._howLong(o,a,u);if(w>g){if(p=u,(g=w)>=f)break;u+2<w&&(w=u+2);for(var x=0,O=0;O<w-2;O++){var v=a-u+O+32768&32767,E=v-s[v]+32768&32767;E>x&&(x=E,i=v)}}}u+=(d=i)-(i=s[d])+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,d,i,u){var g,p,m,w,x,O,v,E,A,_=n.F.U,M=n.F._putsF,k=n.F._putsE;_.lhst[256]++,p=(g=n.F.getTrees())[0],m=g[1],w=g[2],x=g[3],O=g[4],v=g[5],E=g[6],A=g[7];var y=32+((u+3&7)==0?0:8-(u+3&7))+(d<<3),N=l+n.F.contSize(_.fltree,_.lhst)+n.F.contSize(_.fdtree,_.dhst),I=l+n.F.contSize(_.ltree,_.lhst)+n.F.contSize(_.dtree,_.dhst);I+=14+3*v+n.F.contSize(_.itree,_.ihst)+(2*_.ihst[16]+3*_.ihst[17]+7*_.ihst[18]);for(var F=0;F<286;F++)_.lhst[F]=0;for(F=0;F<30;F++)_.dhst[F]=0;for(F=0;F<19;F++)_.ihst[F]=0;var P=y<N&&y<I?0:N<I?1:2;if(M(i,u,o),M(i,u+1,P),u+=3,P==0){for(;(7&u)!=0;)u++;u=n.F._copyExact(f,h,d,i,u)}else{var L,$;if(P==1&&(L=_.fltree,$=_.fdtree),P==2){n.F.makeCodes(_.ltree,p),n.F.revCodes(_.ltree,p),n.F.makeCodes(_.dtree,m),n.F.revCodes(_.dtree,m),n.F.makeCodes(_.itree,w),n.F.revCodes(_.itree,w),L=_.ltree,$=_.dtree,k(i,u,x-257),k(i,u+=5,O-1),k(i,u+=5,v-4),u+=4;for(var S=0;S<v;S++)k(i,u+3*S,_.itree[1+(_.ordr[S]<<1)]);u+=3*v,u=n.F._codeTiny(E,_.itree,i,u),u=n.F._codeTiny(A,_.itree,i,u)}for(var b=h,z=0;z<s;z+=2){for(var U=a[z],H=U>>>23,Y=b+(8388607&U);b<Y;)u=n.F._writeLit(f[b++],L,i,u);if(H!=0){var B=a[z+1],X=B>>16,G=B>>8&255,W=255&B;k(i,u=n.F._writeLit(257+G,L,i,u),H-_.of0[G]),u+=_.exb[G],M(i,u=n.F._writeLit(W,$,i,u),X-_.df0[W]),u+=_.dxb[W],b+=H}}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=[],d=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,d,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],d=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,d,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,d=l+5<s?o[l+5]:-1,i=l==0?-1:o[l-1];if(f==0&&h==f&&d==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&&d==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,d=0;for(d=0;d<h;d+=2)a[d]=0,a[d+1]=0;for(d=0;d<f;d++)o[d]!=0&&l.push({lit:d,f:o[d]});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(E,A){return E.f-A.f}));var p=l[0],m=l[1],w=0,x=1,O=2;for(l[0]={lit:-1,f:p.f+m.f,l:p,r:m,d:0};x!=i-1;)p=w!=x&&(O==i||l[w].f<l[O].f)?l[w++]:l[O++],m=w!=x&&(O==i||l[w].f<l[O].f)?l[w++]:l[O++],l[x++]={lit:-1,f:p.f+m.f,l:p,r:m};var v=n.F.setDepth(l[x-1],0);for(v>s&&(n.F.restrictDepth(u,s,v),v=s),d=0;d<i;d++)a[1+(u[d].lit<<1)]=u[d].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 d=o[l].d;o[l].d=a,h+=f-(1<<s-d)}for(h>>>=s-a;h>0;)(d=o[l].d)<a?(o[l].d++,h-=1<<a-d-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,d=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 w,x,O=0,v=0,E=0,A=0,_=0,M=0,k=0,y=0,N=0;O==0;)if(O=f(o,N,1),v=f(o,N+1,2),N+=3,v!=0){if(m&&(a=n.F._check(a,y+131072)),v==1&&(w=p.flmap,x=p.fdmap,M=511,k=31),v==2){E=h(o,N,5)+257,A=h(o,N+5,5)+1,_=h(o,N+10,4)+4,N+=14;for(var I=0;I<38;I+=2)p.itree[I]=0,p.itree[I+1]=0;var F=1;for(I=0;I<_;I++){var P=h(o,N+3*I,3);p.itree[1+(p.ordr[I]<<1)]=P,P>F&&(F=P)}N+=3*_,i(p.itree,F),u(p.itree,F,p.imap),w=p.lmap,x=p.dmap,N=d(p.imap,(1<<F)-1,E+A,o,N,p.ttree);var L=l._copyOut(p.ttree,0,E,p.ltree);M=(1<<L)-1;var $=l._copyOut(p.ttree,E,A,p.dtree);k=(1<<$)-1,i(p.ltree,L),u(p.ltree,L,w),i(p.dtree,$),u(p.dtree,$,x)}for(;;){var S=w[g(o,N)&M];N+=15&S;var b=S>>>4;if(!(b>>>8))a[y++]=b;else{if(b==256)break;var z=y+b-254;if(b>264){var U=p.ldef[b-257];z=y+(U>>>3)+h(o,N,7&U),N+=7&U}var H=x[g(o,N)&k];N+=15&H;var Y=H>>>4,B=p.ddef[Y],X=(B>>>4)+f(o,N,15&B);for(N+=15&B,m&&(a=n.F._check(a,y+131072));y<z;)a[y]=a[y++-X],a[y]=a[y++-X],a[y]=a[y++-X],a[y]=a[y++-X];y=z}}}else{(7&N)!=0&&(N+=8-(7&N));var G=4+(N>>>3),W=o[G-4]|o[G-3]<<8;m&&(a=n.F._check(a,y+W)),a.set(new s(o.buffer,o.byteOffset+G,W),y),N=G+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 d=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,w=0;p==16?(w=3+d(l,f,2),f+=2,m=h[u-1]):p==17?(w=3+d(l,f,3),f+=3):p==18&&(w=11+d(l,f,7),f+=7);for(var x=u+w;u<x;)h[u]=m,u++}}return f},n.F._copyOut=function(o,a,s,l){for(var f=0,h=0,d=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<d;)l[h<<1]=0,l[1+(h<<1)]=0,h++;return f},n.F.makeCodes=function(o,a){for(var s,l,f,h,d=n.F.U,i=o.length,u=d.bl_count,g=0;g<=a;g++)u[g]=0;for(g=1;g<i;g+=2)u[o[g]]++;var p=d.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 d=h>>1,i=o[h+1],u=d<<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,d){for(;h--!=0;)f.push(0,d)}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 Wg=Gg({__proto__:null,default:Bn},[Bn]);const Wt=(function(){var e={nextZero(d,i){for(;d[i]!=0;)i++;return i},readUshort:(d,i)=>d[i]<<8|d[i+1],writeUshort(d,i,u){d[i]=u>>8&255,d[i+1]=255&u},readUint:(d,i)=>16777216*d[i]+(d[i+1]<<16|d[i+2]<<8|d[i+3]),writeUint(d,i,u){d[i]=u>>24&255,d[i+1]=u>>16&255,d[i+2]=u>>8&255,d[i+3]=255&u},readASCII(d,i,u){let g="";for(let p=0;p<u;p++)g+=String.fromCharCode(d[i+p]);return g},writeASCII(d,i,u){for(let g=0;g<u.length;g++)d[i+g]=u.charCodeAt(g)},readBytes(d,i,u){const g=[];for(let p=0;p<u;p++)g.push(d[i+p]);return g},pad:d=>d.length<2?`0${d}`:d,readUTF8(d,i,u){let g,p="";for(let m=0;m<u;m++)p+=`%${e.pad(d[i+m].toString(16))}`;try{g=decodeURIComponent(p)}catch{return e.readASCII(d,i,u)}return g}};function t(d,i,u,g){const p=i*u,m=a(g),w=Math.ceil(i*m/8),x=new Uint8Array(4*p),O=new Uint32Array(x.buffer),{ctype:v}=g,{depth:E}=g,A=e.readUshort;if(v==6){const U=p<<2;if(E==8)for(var _=0;_<U;_+=4)x[_]=d[_],x[_+1]=d[_+1],x[_+2]=d[_+2],x[_+3]=d[_+3];if(E==16)for(_=0;_<U;_++)x[_]=d[_<<1]}else if(v==2){const U=g.tabs.tRNS;if(U==null){if(E==8)for(_=0;_<p;_++){var M=3*_;O[_]=255<<24|d[M+2]<<16|d[M+1]<<8|d[M]}if(E==16)for(_=0;_<p;_++)M=6*_,O[_]=255<<24|d[M+4]<<16|d[M+2]<<8|d[M]}else{var k=U[0];const H=U[1],Y=U[2];if(E==8)for(_=0;_<p;_++){var y=_<<2;M=3*_,O[_]=255<<24|d[M+2]<<16|d[M+1]<<8|d[M],d[M]==k&&d[M+1]==H&&d[M+2]==Y&&(x[y+3]=0)}if(E==16)for(_=0;_<p;_++)y=_<<2,M=6*_,O[_]=255<<24|d[M+4]<<16|d[M+2]<<8|d[M],A(d,M)==k&&A(d,M+2)==H&&A(d,M+4)==Y&&(x[y+3]=0)}}else if(v==3){const U=g.tabs.PLTE,H=g.tabs.tRNS,Y=H?H.length:0;if(E==1)for(var N=0;N<u;N++){var I=N*w,F=N*i;for(_=0;_<i;_++){y=F+_<<2;var P=3*(L=d[I+(_>>3)]>>7-((7&_)<<0)&1);x[y]=U[P],x[y+1]=U[P+1],x[y+2]=U[P+2],x[y+3]=L<Y?H[L]:255}}if(E==2)for(N=0;N<u;N++)for(I=N*w,F=N*i,_=0;_<i;_++)y=F+_<<2,P=3*(L=d[I+(_>>2)]>>6-((3&_)<<1)&3),x[y]=U[P],x[y+1]=U[P+1],x[y+2]=U[P+2],x[y+3]=L<Y?H[L]:255;if(E==4)for(N=0;N<u;N++)for(I=N*w,F=N*i,_=0;_<i;_++)y=F+_<<2,P=3*(L=d[I+(_>>1)]>>4-((1&_)<<2)&15),x[y]=U[P],x[y+1]=U[P+1],x[y+2]=U[P+2],x[y+3]=L<Y?H[L]:255;if(E==8)for(_=0;_<p;_++){var L;y=_<<2,P=3*(L=d[_]),x[y]=U[P],x[y+1]=U[P+1],x[y+2]=U[P+2],x[y+3]=L<Y?H[L]:255}}else if(v==4){if(E==8)for(_=0;_<p;_++){y=_<<2;var $=d[S=_<<1];x[y]=$,x[y+1]=$,x[y+2]=$,x[y+3]=d[S+1]}if(E==16)for(_=0;_<p;_++){var S;y=_<<2,$=d[S=_<<2],x[y]=$,x[y+1]=$,x[y+2]=$,x[y+3]=d[S+2]}}else if(v==0)for(k=g.tabs.tRNS?g.tabs.tRNS:-1,N=0;N<u;N++){const U=N*w,H=N*i;if(E==1)for(var b=0;b<i;b++){var z=($=255*(d[U+(b>>>3)]>>>7-(7&b)&1))==255*k?0:255;O[H+b]=z<<24|$<<16|$<<8|$}else if(E==2)for(b=0;b<i;b++)z=($=85*(d[U+(b>>>2)]>>>6-((3&b)<<1)&3))==85*k?0:255,O[H+b]=z<<24|$<<16|$<<8|$;else if(E==4)for(b=0;b<i;b++)z=($=17*(d[U+(b>>>1)]>>>4-((1&b)<<2)&15))==17*k?0:255,O[H+b]=z<<24|$<<16|$<<8|$;else if(E==8)for(b=0;b<i;b++)z=($=d[U+b])==k?0:255,O[H+b]=z<<24|$<<16|$<<8|$;else if(E==16)for(b=0;b<i;b++)$=d[U+(b<<1)],z=A(d,U+(b<<1))==k?0:255,O[H+b]=z<<24|$<<16|$<<8|$}return x}function r(d,i,u,g){const p=a(d),m=Math.ceil(u*p/8),w=new Uint8Array((m+1+d.interlace)*g);return i=d.tabs.CgBI?o(i,w):n(i,w),d.interlace==0?i=s(i,d,0,u,g):d.interlace==1&&(i=(function(O,v){const E=v.width,A=v.height,_=a(v),M=_>>3,k=Math.ceil(E*_/8),y=new Uint8Array(A*k);let N=0;const I=[0,0,4,0,2,0,1],F=[0,4,0,2,0,1,0],P=[8,8,8,4,4,2,2],L=[8,8,4,4,2,2,1];let $=0;for(;$<7;){const b=P[$],z=L[$];let U=0,H=0,Y=I[$];for(;Y<A;)Y+=b,H++;let B=F[$];for(;B<E;)B+=z,U++;const X=Math.ceil(U*_/8);s(O,v,N,U,H);let G=0,W=I[$];for(;W<A;){let Q=F[$],me=N+G*X<<3;for(;Q<E;){var S;if(_==1&&(S=(S=O[me>>3])>>7-(7&me)&1,y[W*k+(Q>>3)]|=S<<7-((7&Q)<<0)),_==2&&(S=(S=O[me>>3])>>6-(7&me)&3,y[W*k+(Q>>2)]|=S<<6-((3&Q)<<1)),_==4&&(S=(S=O[me>>3])>>4-(7&me)&15,y[W*k+(Q>>1)]|=S<<4-((1&Q)<<2)),_>=8){const se=W*k+Q*M;for(let pe=0;pe<M;pe++)y[se+pe]=O[(me>>3)+pe]}me+=_,Q+=z}G++,W+=b}U*H!=0&&(N+=H*(1+X)),$+=1}return y})(i,d)),i}function n(d,i){return o(new Uint8Array(d.buffer,2,d.length-6),i)}var o=(function(){const d={H:{}};return d.H.N=function(i,u){const g=Uint8Array;let p,m,w=0,x=0,O=0,v=0,E=0,A=0,_=0,M=0,k=0;if(i[0]==3&&i[1]==0)return u||new g(0);const y=d.H,N=y.b,I=y.e,F=y.R,P=y.n,L=y.A,$=y.Z,S=y.m,b=u==null;for(b&&(u=new g(i.length>>>2<<5));w==0;)if(w=N(i,k,1),x=N(i,k+1,2),k+=3,x!=0){if(b&&(u=d.H.W(u,M+(1<<17))),x==1&&(p=S.J,m=S.h,A=511,_=31),x==2){O=I(i,k,5)+257,v=I(i,k+5,5)+1,E=I(i,k+10,4)+4,k+=14;let U=1;for(var z=0;z<38;z+=2)S.Q[z]=0,S.Q[z+1]=0;for(z=0;z<E;z++){const B=I(i,k+3*z,3);S.Q[1+(S.X[z]<<1)]=B,B>U&&(U=B)}k+=3*E,P(S.Q,U),L(S.Q,U,S.u),p=S.w,m=S.d,k=F(S.u,(1<<U)-1,O+v,i,k,S.v);const H=y.V(S.v,0,O,S.C);A=(1<<H)-1;const Y=y.V(S.v,O,v,S.D);_=(1<<Y)-1,P(S.C,H),L(S.C,H,p),P(S.D,Y),L(S.D,Y,m)}for(;;){const U=p[$(i,k)&A];k+=15&U;const H=U>>>4;if(!(H>>>8))u[M++]=H;else{if(H==256)break;{let Y=M+H-254;if(H>264){const Q=S.q[H-257];Y=M+(Q>>>3)+I(i,k,7&Q),k+=7&Q}const B=m[$(i,k)&_];k+=15&B;const X=B>>>4,G=S.c[X],W=(G>>>4)+N(i,k,15&G);for(k+=15&G;M<Y;)u[M]=u[M++-W],u[M]=u[M++-W],u[M]=u[M++-W],u[M]=u[M++-W];M=Y}}}}else{(7&k)!=0&&(k+=8-(7&k));const U=4+(k>>>3),H=i[U-4]|i[U-3]<<8;b&&(u=d.H.W(u,M+H)),u.set(new g(i.buffer,i.byteOffset+U,H),M),k=U+H<<3,M+=H}return u.length==M?u:u.slice(0,M)},d.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},d.H.R=function(i,u,g,p,m,w){const x=d.H.e,O=d.H.Z;let v=0;for(;v<g;){const E=i[O(p,m)&u];m+=15&E;const A=E>>>4;if(A<=15)w[v]=A,v++;else{let _=0,M=0;A==16?(M=3+x(p,m,2),m+=2,_=w[v-1]):A==17?(M=3+x(p,m,3),m+=3):A==18&&(M=11+x(p,m,7),m+=7);const k=v+M;for(;v<k;)w[v]=_,v++}}return m},d.H.V=function(i,u,g,p){let m=0,w=0;const x=p.length>>>1;for(;w<g;){const O=i[w+u];p[w<<1]=0,p[1+(w<<1)]=O,O>m&&(m=O),w++}for(;w<x;)p[w<<1]=0,p[1+(w<<1)]=0,w++;return m},d.H.n=function(i,u){const g=d.H.m,p=i.length;let m,w,x,O;const v=g.j;for(var E=0;E<=u;E++)v[E]=0;for(E=1;E<p;E+=2)v[i[E]]++;const A=g.K;for(m=0,v[0]=0,w=1;w<=u;w++)m=m+v[w-1]<<1,A[w]=m;for(x=0;x<p;x+=2)O=i[x+1],O!=0&&(i[x]=A[O],A[O]++)},d.H.A=function(i,u,g){const p=i.length,m=d.H.m.r;for(let w=0;w<p;w+=2)if(i[w+1]!=0){const x=w>>1,O=i[w+1],v=x<<4|O,E=u-O;let A=i[w]<<E;const _=A+(1<<E);for(;A!=_;)g[m[A]>>>15-u]=v,A++}},d.H.l=function(i,u){const g=d.H.m.r,p=15-u;for(let m=0;m<i.length;m+=2){const w=i[m]<<u-i[m+1];i[m]=g[w]>>>p}},d.H.M=function(i,u,g){g<<=7&u;const p=u>>>3;i[p]|=g,i[p+1]|=g>>>8},d.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},d.H.e=function(i,u,g){return(i[u>>>3]|i[1+(u>>>3)]<<8)>>>(7&u)&(1<<g)-1},d.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},d.H.Z=function(i,u){return(i[u>>>3]|i[1+(u>>>3)]<<8|i[2+(u>>>3)]<<16)>>>(7&u)},d.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)},d.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=d.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,w){for(;m--!=0;)p.push(0,w)}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),d.H.n(i._,9),d.H.A(i._,9,i.J),d.H.l(i._,9),g(i.$,32,5),d.H.n(i.$,5),d.H.A(i.$,5,i.h),d.H.l(i.$,5),g(i.Q,19,0),g(i.C,286,0),g(i.D,30,0),g(i.v,320,0)})(),d.H.N})();function a(d){return[1,null,3,1,2,null,4][d.ctype]*d.depth}function s(d,i,u,g,p){let m=a(i);const w=Math.ceil(g*m/8);let x,O;m=Math.ceil(m/8);let v=d[u],E=0;if(v>1&&(d[u]=[0,0,1][v-2]),v==3)for(E=m;E<w;E++)d[E+1]=d[E+1]+(d[E+1-m]>>>1)&255;for(let A=0;A<p;A++)if(x=u+A*w,O=x+A+1,v=d[O-1],E=0,v==0)for(;E<w;E++)d[x+E]=d[O+E];else if(v==1){for(;E<m;E++)d[x+E]=d[O+E];for(;E<w;E++)d[x+E]=d[O+E]+d[x+E-m]}else if(v==2)for(;E<w;E++)d[x+E]=d[O+E]+d[x+E-w];else if(v==3){for(;E<m;E++)d[x+E]=d[O+E]+(d[x+E-w]>>>1);for(;E<w;E++)d[x+E]=d[O+E]+(d[x+E-w]+d[x+E-m]>>>1)}else{for(;E<m;E++)d[x+E]=d[O+E]+l(0,d[x+E-w],0);for(;E<w;E++)d[x+E]=d[O+E]+l(d[x+E-m],d[x+E-w],d[x+E-m-w])}return d}function l(d,i,u){const g=d+i-u,p=g-d,m=g-i,w=g-u;return p*p<=m*m&&p*p<=w*w?d:m*m<=w*w?i:u}function f(d,i,u){u.width=e.readUint(d,i),i+=4,u.height=e.readUint(d,i),i+=4,u.depth=d[i],i++,u.ctype=d[i],i++,u.compress=d[i],i++,u.filter=d[i],i++,u.interlace=d[i],i++}function h(d,i,u,g,p,m,w,x,O){const v=Math.min(i,p),E=Math.min(u,m);let A=0,_=0;for(let $=0;$<E;$++)for(let S=0;S<v;S++)if(w>=0&&x>=0?(A=$*i+S<<2,_=(x+$)*p+w+S<<2):(A=(-x+$)*i-w+S<<2,_=$*p+S<<2),O==0)g[_]=d[A],g[_+1]=d[A+1],g[_+2]=d[A+2],g[_+3]=d[A+3];else if(O==1){var M=d[A+3]*.00392156862745098,k=d[A]*M,y=d[A+1]*M,N=d[A+2]*M,I=g[_+3]*(1/255),F=g[_]*I,P=g[_+1]*I,L=g[_+2]*I;const b=1-M,z=M+I*b,U=z==0?0:1/z;g[_+3]=255*z,g[_+0]=(k+F*b)*U,g[_+1]=(y+P*b)*U,g[_+2]=(N+L*b)*U}else if(O==2)M=d[A+3],k=d[A],y=d[A+1],N=d[A+2],I=g[_+3],F=g[_],P=g[_+1],L=g[_+2],M==I&&k==F&&y==P&&N==L?(g[_]=0,g[_+1]=0,g[_+2]=0,g[_+3]=0):(g[_]=k,g[_+1]=y,g[_+2]=N,g[_+3]=M);else if(O==3){if(M=d[A+3],k=d[A],y=d[A+1],N=d[A+2],I=g[_+3],F=g[_],P=g[_+1],L=g[_+2],M==I&&k==F&&y==P&&N==L)continue;if(M<220&&I>20)return!1}return!0}return{decode:function(i){const u=new Uint8Array(i);let g=8;const p=e,m=p.readUshort,w=p.readUint,x={tabs:{},frames:[]},O=new Uint8Array(u.length);let v,E=0,A=0;const _=[137,80,78,71,13,10,26,10];for(var M=0;M<8;M++)if(u[M]!=_[M])throw"The input is not a PNG file!";for(;g<u.length;){const $=p.readUint(u,g);g+=4;const S=p.readASCII(u,g,4);if(g+=4,S=="IHDR")f(u,g,x);else if(S=="iCCP"){for(var k=g;u[k]!=0;)k++;p.readASCII(u,g,k-g),u[k+1];const b=u.slice(k+2,g+$);let z=null;try{z=n(b)}catch{z=o(b)}x.tabs[S]=z}else if(S=="CgBI")x.tabs[S]=u.slice(g,g+4);else if(S=="IDAT"){for(M=0;M<$;M++)O[E+M]=u[g+M];E+=$}else if(S=="acTL")x.tabs[S]={num_frames:w(u,g),num_plays:w(u,g+4)},v=new Uint8Array(u.length);else if(S=="fcTL"){A!=0&&((L=x.frames[x.frames.length-1]).data=r(x,v.slice(0,A),L.rect.width,L.rect.height),A=0);const b={x:w(u,g+12),y:w(u,g+16),width:w(u,g+4),height:w(u,g+8)};let z=m(u,g+22);z=m(u,g+20)/(z==0?100:z);const U={rect:b,delay:Math.round(1e3*z),dispose:u[g+24],blend:u[g+25]};x.frames.push(U)}else if(S=="fdAT"){for(M=0;M<$-4;M++)v[A+M]=u[g+M+4];A+=$-4}else if(S=="pHYs")x.tabs[S]=[p.readUint(u,g),p.readUint(u,g+4),u[g+8]];else if(S=="cHRM")for(x.tabs[S]=[],M=0;M<8;M++)x.tabs[S].push(p.readUint(u,g+4*M));else if(S=="tEXt"||S=="zTXt"){x.tabs[S]==null&&(x.tabs[S]={});var y=p.nextZero(u,g),N=p.readASCII(u,g,y-g),I=g+$-y-1;if(S=="tEXt")P=p.readASCII(u,y+1,I);else{var F=n(u.slice(y+2,y+2+I));P=p.readUTF8(F,0,F.length)}x.tabs[S][N]=P}else if(S=="iTXt"){x.tabs[S]==null&&(x.tabs[S]={}),y=0,k=g,y=p.nextZero(u,k),N=p.readASCII(u,k,y-k);const b=u[k=y+1];var P;u[k+1],k+=2,y=p.nextZero(u,k),p.readASCII(u,k,y-k),k=y+1,y=p.nextZero(u,k),p.readUTF8(u,k,y-k),I=$-((k=y+1)-g),b==0?P=p.readUTF8(u,k,I):(F=n(u.slice(k,k+I)),P=p.readUTF8(F,0,F.length)),x.tabs[S][N]=P}else if(S=="PLTE")x.tabs[S]=p.readBytes(u,g,$);else if(S=="hIST"){const b=x.tabs.PLTE.length/3;for(x.tabs[S]=[],M=0;M<b;M++)x.tabs[S].push(m(u,g+2*M))}else if(S=="tRNS")x.ctype==3?x.tabs[S]=p.readBytes(u,g,$):x.ctype==0?x.tabs[S]=m(u,g):x.ctype==2&&(x.tabs[S]=[m(u,g),m(u,g+2),m(u,g+4)]);else if(S=="gAMA")x.tabs[S]=p.readUint(u,g)/1e5;else if(S=="sRGB")x.tabs[S]=u[g];else if(S=="bKGD")x.ctype==0||x.ctype==4?x.tabs[S]=[m(u,g)]:x.ctype==2||x.ctype==6?x.tabs[S]=[m(u,g),m(u,g+2),m(u,g+4)]:x.ctype==3&&(x.tabs[S]=u[g]);else if(S=="IEND")break;g+=$,p.readUint(u,g),g+=4}var L;return A!=0&&((L=x.frames[x.frames.length-1]).data=r(x,v.slice(0,A),L.rect.width,L.rect.height)),x.data=r(x,O,x.width,x.height),delete x.compress,delete x.interlace,delete x.filter,x},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,w=new Uint8Array(m),x=new Uint8Array(m),O=new Uint8Array(m);for(let E=0;E<i.frames.length;E++){const A=i.frames[E],_=A.rect.x,M=A.rect.y,k=A.rect.width,y=A.rect.height,N=t(A.data,k,y,i);if(E!=0)for(var v=0;v<m;v++)O[v]=w[v];if(A.blend==0?h(N,k,y,w,u,g,_,M,0):A.blend==1&&h(N,k,y,w,u,g,_,M,1),p.push(w.buffer.slice(0)),A.dispose!=0){if(A.dispose==1)h(x,k,y,w,u,g,_,M,0);else if(A.dispose==2)for(v=0;v<m;v++)w[v]=O[v]}}return p},_paeth:l,_copyTile:h,_bin:e}})();(function(){const{_copyTile:e}=Wt,{_bin:t}=Wt,r=Wt._paeth;var n={table:(function(){const k=new Uint32Array(256);for(let y=0;y<256;y++){let N=y;for(let I=0;I<8;I++)1&N?N=3988292384^N>>>1:N>>>=1;k[y]=N}return k})(),update(k,y,N,I){for(let F=0;F<I;F++)k=n.table[255&(k^y[N+F])]^k>>>8;return k},crc:(k,y,N)=>4294967295^n.update(4294967295,k,y,N)};function o(k,y,N,I){y[N]+=k[0]*I>>4,y[N+1]+=k[1]*I>>4,y[N+2]+=k[2]*I>>4,y[N+3]+=k[3]*I>>4}function a(k){return Math.max(0,Math.min(255,k))}function s(k,y){const N=k[0]-y[0],I=k[1]-y[1],F=k[2]-y[2],P=k[3]-y[3];return N*N+I*I+F*F+P*P}function l(k,y,N,I,F,P,L){L==null&&(L=1);const $=I.length,S=[];for(var b=0;b<$;b++){const W=I[b];S.push([W>>>0&255,W>>>8&255,W>>>16&255,W>>>24&255])}for(b=0;b<$;b++){let W=4294967295;for(var z=0,U=0;U<$;U++){var H=s(S[b],S[U]);U!=b&&H<W&&(W=H,z=U)}}const Y=new Uint32Array(F.buffer),B=new Int16Array(y*N*4),X=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(b=0;b<X.length;b++)X[b]=255*((X[b]+.5)/16-.5);for(let W=0;W<N;W++)for(let Q=0;Q<y;Q++){var G;b=4*(W*y+Q),L!=2?G=[a(k[b]+B[b]),a(k[b+1]+B[b+1]),a(k[b+2]+B[b+2]),a(k[b+3]+B[b+3])]:(H=X[4*(3&W)+(3&Q)],G=[a(k[b]+H),a(k[b+1]+H),a(k[b+2]+H),a(k[b+3]+H)]),z=0;let me=16777215;for(U=0;U<$;U++){const ne=s(G,S[U]);ne<me&&(me=ne,z=U)}const se=S[z],pe=[G[0]-se[0],G[1]-se[1],G[2]-se[2],G[3]-se[3]];L==1&&(Q!=y-1&&o(pe,B,b+4,7),W!=N-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,Y[b>>2]=I[z]}}function f(k,y,N,I,F){F==null&&(F={});const{crc:P}=n,L=t.writeUint,$=t.writeUshort,S=t.writeASCII;let b=8;const z=k.frames.length>1;let U,H=!1,Y=33+(z?20:0);if(F.sRGB!=null&&(Y+=13),F.pHYs!=null&&(Y+=21),F.iCCP!=null&&(U=pako.deflate(F.iCCP),Y+=21+U.length+4),k.ctype==3){for(var B=k.plte.length,X=0;X<B;X++)k.plte[X]>>>24!=255&&(H=!0);Y+=8+3*B+4+(H?8+1*B+4:0)}for(var G=0;G<k.frames.length;G++)z&&(Y+=38),Y+=(se=k.frames[G]).cimg.length+12,G!=0&&(Y+=4);Y+=12;const W=new Uint8Array(Y),Q=[137,80,78,71,13,10,26,10];for(X=0;X<8;X++)W[X]=Q[X];if(L(W,b,13),b+=4,S(W,b,"IHDR"),b+=4,L(W,b,y),b+=4,L(W,b,N),b+=4,W[b]=k.depth,b++,W[b]=k.ctype,b++,W[b]=0,b++,W[b]=0,b++,W[b]=0,b++,L(W,b,P(W,b-17,17)),b+=4,F.sRGB!=null&&(L(W,b,1),b+=4,S(W,b,"sRGB"),b+=4,W[b]=F.sRGB,b++,L(W,b,P(W,b-5,5)),b+=4),F.iCCP!=null){const pe=13+U.length;L(W,b,pe),b+=4,S(W,b,"iCCP"),b+=4,S(W,b,"ICC profile"),b+=11,b+=2,W.set(U,b),b+=U.length,L(W,b,P(W,b-(pe+4),pe+4)),b+=4}if(F.pHYs!=null&&(L(W,b,9),b+=4,S(W,b,"pHYs"),b+=4,L(W,b,F.pHYs[0]),b+=4,L(W,b,F.pHYs[1]),b+=4,W[b]=F.pHYs[2],b++,L(W,b,P(W,b-13,13)),b+=4),z&&(L(W,b,8),b+=4,S(W,b,"acTL"),b+=4,L(W,b,k.frames.length),b+=4,L(W,b,F.loop!=null?F.loop:0),b+=4,L(W,b,P(W,b-12,12)),b+=4),k.ctype==3){for(L(W,b,3*(B=k.plte.length)),b+=4,S(W,b,"PLTE"),b+=4,X=0;X<B;X++){const pe=3*X,ne=k.plte[X],ce=255&ne,ve=ne>>>8&255,Se=ne>>>16&255;W[b+pe+0]=ce,W[b+pe+1]=ve,W[b+pe+2]=Se}if(b+=3*B,L(W,b,P(W,b-3*B-4,3*B+4)),b+=4,H){for(L(W,b,B),b+=4,S(W,b,"tRNS"),b+=4,X=0;X<B;X++)W[b+X]=k.plte[X]>>>24&255;b+=B,L(W,b,P(W,b-B-4,B+4)),b+=4}}let me=0;for(G=0;G<k.frames.length;G++){var se=k.frames[G];z&&(L(W,b,26),b+=4,S(W,b,"fcTL"),b+=4,L(W,b,me++),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,$(W,b,I[G]),b+=2,$(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)+(G==0?0:4)),b+=4;const ne=b;S(W,b,G==0?"IDAT":"fdAT"),b+=4,G!=0&&(L(W,b,me++),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,S(W,b,"IEND"),b+=4,L(W,b,P(W,b-4,4)),b+=4,W.buffer}function h(k,y,N){for(let I=0;I<k.frames.length;I++){const F=k.frames[I];F.rect.width;const P=F.rect.height,L=new Uint8Array(P*F.bpl+P);F.cimg=g(F.img,P,F.bpp,F.bpl,L,y,N)}}function d(k,y,N,I,F){const P=F[0],L=F[1],$=F[2],S=F[3],b=F[4],z=F[5];let U=6,H=8,Y=255;for(var B=0;B<k.length;B++){const De=new Uint8Array(k[B]);for(var X=De.length,G=0;G<X;G+=4)Y&=De[G+3]}const W=Y!=255,Q=(function(Ae,ke,je,$e,K,oe){const te=[];for(var ae=0;ae<Ae.length;ae++){const Oe=new Uint8Array(Ae[ae]),Z=new Uint32Array(Oe.buffer);var be;let le=0,he=0,ue=ke,fe=je,Le=$e?1:0;if(ae!=0){const _e=oe||$e||ae==1||te[ae-2].dispose!=0?1:2;let Ee=0,we=1e9;for(let He=0;He<_e;He++){var Me=new Uint8Array(Ae[ae-1-He]);const Ke=new Uint32Array(Ae[ae-1-He]);let Ne=ke,xe=je,Ie=-1,We=-1;for(let Be=0;Be<je;Be++)for(let Ze=0;Ze<ke;Ze++)Z[Fe=Be*ke+Ze]!=Ke[Fe]&&(Ze<Ne&&(Ne=Ze),Ze>Ie&&(Ie=Ze),Be<xe&&(xe=Be),Be>We&&(We=Be));Ie==-1&&(Ne=xe=Ie=We=0),K&&((1&Ne)==1&&Ne--,(1&xe)==1&&xe--);const Je=(Ie-Ne+1)*(We-xe+1);Je<we&&(we=Je,Ee=He,le=Ne,he=xe,ue=Ie-Ne+1,fe=We-xe+1)}Me=new Uint8Array(Ae[ae-1-Ee]),Ee==1&&(te[ae-1].dispose=2),be=new Uint8Array(ue*fe*4),e(Me,ke,je,be,ue,fe,-le,-he,0),Le=e(Oe,ke,je,be,ue,fe,-le,-he,3)?1:0,Le==1?u(Oe,ke,je,be,{x:le,y:he,width:ue,height:fe}):e(Oe,ke,je,be,ue,fe,-le,-he,0)}else be=Oe.slice(0);te.push({rect:{x:le,y:he,width:ue,height:fe},img:be,blend:Le,dispose:0})}if($e)for(ae=0;ae<te.length;ae++){if((Ve=te[ae]).blend==1)continue;const Oe=Ve.rect,Z=te[ae-1].rect,le=Math.min(Oe.x,Z.x),he=Math.min(Oe.y,Z.y),ue={x:le,y:he,width:Math.max(Oe.x+Oe.width,Z.x+Z.width)-le,height:Math.max(Oe.y+Oe.height,Z.y+Z.height)-he};te[ae-1].dispose=1,ae-1!=0&&i(Ae,ke,je,te,ae-1,ue,K),i(Ae,ke,je,te,ae,ue,K)}let Xe=0;if(Ae.length!=1)for(var Fe=0;Fe<te.length;Fe++){var Ve;Xe+=(Ve=te[Fe]).rect.width*Ve.rect.height}return te})(k,y,N,P,L,$),me={},se=[],pe=[];if(I!=0){const De=[];for(G=0;G<Q.length;G++)De.push(Q[G].img.buffer);const Ae=(function(K){let oe=0;for(var te=0;te<K.length;te++)oe+=K[te].byteLength;const ae=new Uint8Array(oe);let be=0;for(te=0;te<K.length;te++){const Me=new Uint8Array(K[te]),Xe=Me.length;for(let Fe=0;Fe<Xe;Fe+=4){let Ve=Me[Fe],Oe=Me[Fe+1],Z=Me[Fe+2];const le=Me[Fe+3];le==0&&(Ve=Oe=Z=0),ae[be+Fe]=Ve,ae[be+Fe+1]=Oe,ae[be+Fe+2]=Z,ae[be+Fe+3]=le}be+=Xe}return ae.buffer})(De),ke=m(Ae,I);for(G=0;G<ke.plte.length;G++)se.push(ke.plte[G].est.rgba);let je=0;for(G=0;G<Q.length;G++){const $e=(ce=Q[G]).img.length;var ne=new Uint8Array(ke.inds.buffer,je>>2,$e>>2);pe.push(ne);const K=new Uint8Array(ke.abuf,je,$e);z&&l(ce.img,ce.rect.width,ce.rect.height,se,K,ne),ce.img.set(K),je+=$e}}else for(B=0;B<Q.length;B++){var ce=Q[B];const De=new Uint32Array(ce.img.buffer);var ve=ce.rect.width;for(X=De.length,ne=new Uint8Array(X),pe.push(ne),G=0;G<X;G++){const Ae=De[G];if(G!=0&&Ae==De[G-1])ne[G]=ne[G-1];else if(G>ve&&Ae==De[G-ve])ne[G]=ne[G-ve];else{let ke=me[Ae];if(ke==null&&(me[Ae]=ke=se.length,se.push(Ae),se.length>=300))break;ne[G]=ke}}}const Se=se.length;for(Se<=256&&b==0&&(H=Se<=2?1:Se<=4?2:Se<=16?4:8,H=Math.max(H,S)),B=0;B<Q.length;B++){(ce=Q[B]).rect.x,ce.rect.y,ve=ce.rect.width;const De=ce.rect.height;let Ae=ce.img;new Uint32Array(Ae.buffer);let ke=4*ve,je=4;if(Se<=256&&b==0){ke=Math.ceil(H*ve/8);var ze=new Uint8Array(ke*De);const $e=pe[B];for(let K=0;K<De;K++){G=K*ke;const oe=K*ve;if(H==8)for(var ie=0;ie<ve;ie++)ze[G+ie]=$e[oe+ie];else if(H==4)for(ie=0;ie<ve;ie++)ze[G+(ie>>1)]|=$e[oe+ie]<<4-4*(1&ie);else if(H==2)for(ie=0;ie<ve;ie++)ze[G+(ie>>2)]|=$e[oe+ie]<<6-2*(3&ie);else if(H==1)for(ie=0;ie<ve;ie++)ze[G+(ie>>3)]|=$e[oe+ie]<<7-1*(7&ie)}Ae=ze,U=3,je=1}else if(W==0&&Q.length==1){ze=new Uint8Array(ve*De*3);const $e=ve*De;for(G=0;G<$e;G++){const K=3*G,oe=4*G;ze[K]=Ae[oe],ze[K+1]=Ae[oe+1],ze[K+2]=Ae[oe+2]}Ae=ze,U=2,je=3,ke=3*ve}ce.img=Ae,ce.bpl=ke,ce.bpp=je}return{ctype:U,depth:H,plte:se,frames:Q}}function i(k,y,N,I,F,P,L){const $=Uint8Array,S=Uint32Array,b=new $(k[F-1]),z=new S(k[F-1]),U=F+1<k.length?new $(k[F+1]):null,H=new $(k[F]),Y=new S(H.buffer);let B=y,X=N,G=-1,W=-1;for(let me=0;me<P.height;me++)for(let se=0;se<P.width;se++){const pe=P.x+se,ne=P.y+me,ce=ne*y+pe,ve=Y[ce];ve==0||I[F-1].dispose==0&&z[ce]==ve&&(U==null||U[4*ce+3]!=0)||(pe<B&&(B=pe),pe>G&&(G=pe),ne<X&&(X=ne),ne>W&&(W=ne))}G==-1&&(B=X=G=W=0),L&&((1&B)==1&&B--,(1&X)==1&&X--),P={x:B,y:X,width:G-B+1,height:W-X+1};const Q=I[F];Q.rect=P,Q.blend=1,Q.img=new Uint8Array(P.width*P.height*4),I[F-1].dispose==0?(e(b,y,N,Q.img,P.width,P.height,-P.x,-P.y,0),u(H,y,N,Q.img,P)):e(H,y,N,Q.img,P.width,P.height,-P.x,-P.y,0)}function u(k,y,N,I,F){e(k,y,N,I,F.width,F.height,-F.x,-F.y,2)}function g(k,y,N,I,F,P,L){const $=[];let S,b=[0,1,2,3,4];P!=-1?b=[P]:(y*I>5e5||N==1)&&(b=[0]),L&&(S={level:0});const z=Wg;for(var U=0;U<b.length;U++){for(let B=0;B<y;B++)p(F,k,B,I,N,b[U]);$.push(z.deflate(F,S))}let H,Y=1e9;for(U=0;U<$.length;U++)$[U].length<Y&&(H=U,Y=$[U].length);return $[H]}function p(k,y,N,I,F,P){const L=N*I;let $=L+N;if(k[$]=P,$++,P==0)if(I<500)for(var S=0;S<I;S++)k[$+S]=y[L+S];else k.set(new Uint8Array(y.buffer,L,I),$);else if(P==1){for(S=0;S<F;S++)k[$+S]=y[L+S];for(S=F;S<I;S++)k[$+S]=y[L+S]-y[L+S-F]+256&255}else if(N==0){for(S=0;S<F;S++)k[$+S]=y[L+S];if(P==2)for(S=F;S<I;S++)k[$+S]=y[L+S];if(P==3)for(S=F;S<I;S++)k[$+S]=y[L+S]-(y[L+S-F]>>1)+256&255;if(P==4)for(S=F;S<I;S++)k[$+S]=y[L+S]-r(y[L+S-F],0,0)+256&255}else{if(P==2)for(S=0;S<I;S++)k[$+S]=y[L+S]+256-y[L+S-I]&255;if(P==3){for(S=0;S<F;S++)k[$+S]=y[L+S]+256-(y[L+S-I]>>1)&255;for(S=F;S<I;S++)k[$+S]=y[L+S]+256-(y[L+S-I]+y[L+S-F]>>1)&255}if(P==4){for(S=0;S<F;S++)k[$+S]=y[L+S]+256-r(0,y[L+S-I],0)&255;for(S=F;S<I;S++)k[$+S]=y[L+S]+256-r(y[L+S-F],y[L+S-I],y[L+S-F-I])&255}}}function m(k,y){const N=new Uint8Array(k),I=N.slice(0),F=new Uint32Array(I.buffer),P=w(I,y),L=P[0],$=P[1],S=N.length,b=new Uint8Array(S>>2);let z;if(N.length<2e7)for(var U=0;U<S;U+=4)z=x(L,H=N[U]*.00392156862745098,Y=N[U+1]*.00392156862745098,B=N[U+2]*.00392156862745098,X=N[U+3]*.00392156862745098),b[U>>2]=z.ind,F[U>>2]=z.est.rgba;else for(U=0;U<S;U+=4){var H=N[U]*.00392156862745098,Y=N[U+1]*(1/255),B=N[U+2]*(1/255),X=N[U+3]*(1/255);for(z=L;z.left;)z=O(z.est,H,Y,B,X)<=0?z.left:z.right;b[U>>2]=z.ind,F[U>>2]=z.est.rgba}return{abuf:I.buffer,inds:b,plte:$}}function w(k,y,N){N==null&&(N=1e-4);const I=new Uint32Array(k.buffer),F={i0:0,i1:k.length,bst:null,est:null,tdst:0,left:null,right:null};F.bst=A(k,F.i0,F.i1),F.est=_(F.bst);const P=[F];for(;P.length<y;){let $=0,S=0;for(var L=0;L<P.length;L++)P[L].est.L>$&&($=P[L].est.L,S=L);if($<N)break;const b=P[S],z=v(k,I,b.i0,b.i1,b.est.e,b.est.eMq255);if(b.i0>=z||b.i1<=z){b.est.L=0;continue}const U={i0:b.i0,i1:z,bst:null,est:null,tdst:0,left:null,right:null};U.bst=A(k,U.i0,U.i1),U.est=_(U.bst);const H={i0:z,i1:b.i1,bst:null,est:null,tdst:0,left:null,right:null};for(H.bst={R:[],m:[],N:b.bst.N-U.bst.N},L=0;L<16;L++)H.bst.R[L]=b.bst.R[L]-U.bst.R[L];for(L=0;L<4;L++)H.bst.m[L]=b.bst.m[L]-U.bst.m[L];H.est=_(H.bst),b.left=U,b.right=H,P[S]=U,P.push(H)}for(P.sort((($,S)=>S.bst.N-$.bst.N)),L=0;L<P.length;L++)P[L].ind=L;return[F,P]}function x(k,y,N,I,F){if(k.left==null)return k.tdst=(function(U,H,Y,B,X){const G=H-U[0],W=Y-U[1],Q=B-U[2],me=X-U[3];return G*G+W*W+Q*Q+me*me})(k.est.q,y,N,I,F),k;const P=O(k.est,y,N,I,F);let L=k.left,$=k.right;P>0&&(L=k.right,$=k.left);const S=x(L,y,N,I,F);if(S.tdst<=P*P)return S;const b=x($,y,N,I,F);return b.tdst<S.tdst?b:S}function O(k,y,N,I,F){const{e:P}=k;return P[0]*y+P[1]*N+P[2]*I+P[3]*F-k.eMq}function v(k,y,N,I,F,P){for(I-=4;N<I;){for(;E(k,N,F)<=P;)N+=4;for(;E(k,I,F)>P;)I-=4;if(N>=I)break;const L=y[N>>2];y[N>>2]=y[I>>2],y[I>>2]=L,N+=4,I-=4}for(;E(k,N,F)>P;)N-=4;return N+4}function E(k,y,N){return k[y]*N[0]+k[y+1]*N[1]+k[y+2]*N[2]+k[y+3]*N[3]}function A(k,y,N){const I=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],F=[0,0,0,0],P=N-y>>2;for(let L=y;L<N;L+=4){const $=k[L]*.00392156862745098,S=k[L+1]*(1/255),b=k[L+2]*(1/255),z=k[L+3]*(1/255);F[0]+=$,F[1]+=S,F[2]+=b,F[3]+=z,I[0]+=$*$,I[1]+=$*S,I[2]+=$*b,I[3]+=$*z,I[5]+=S*S,I[6]+=S*b,I[7]+=S*z,I[10]+=b*b,I[11]+=b*z,I[15]+=z*z}return I[4]=I[1],I[8]=I[2],I[9]=I[6],I[12]=I[3],I[13]=I[7],I[14]=I[11],{R:I,m:F,N:P}}function _(k){const{R:y}=k,{m:N}=k,{N:I}=k,F=N[0],P=N[1],L=N[2],$=N[3],S=I==0?0:1/I,b=[y[0]-F*F*S,y[1]-F*P*S,y[2]-F*L*S,y[3]-F*$*S,y[4]-P*F*S,y[5]-P*P*S,y[6]-P*L*S,y[7]-P*$*S,y[8]-L*F*S,y[9]-L*P*S,y[10]-L*L*S,y[11]-L*$*S,y[12]-$*F*S,y[13]-$*P*S,y[14]-$*L*S,y[15]-$*$*S],z=b,U=M;let H=[Math.random(),Math.random(),Math.random(),Math.random()],Y=0,B=0;if(I!=0)for(let G=0;G<16&&(H=U.multVec(z,H),B=Math.sqrt(U.dot(H,H)),H=U.sml(1/B,H),!(G!=0&&Math.abs(B-Y)<1e-9));G++)Y=B;const X=[F*S,P*S,L*S,$*S];return{Cov:b,q:X,e:H,L:Y,eMq255:U.dot(U.sml(255,X),H),eMq:U.dot(H,X),rgba:(Math.round(255*X[3])<<24|Math.round(255*X[2])<<16|Math.round(255*X[1])<<8|Math.round(255*X[0])<<0)>>>0}}var M={multVec:(k,y)=>[k[0]*y[0]+k[1]*y[1]+k[2]*y[2]+k[3]*y[3],k[4]*y[0]+k[5]*y[1]+k[6]*y[2]+k[7]*y[3],k[8]*y[0]+k[9]*y[1]+k[10]*y[2]+k[11]*y[3],k[12]*y[0]+k[13]*y[1]+k[14]*y[2]+k[15]*y[3]],dot:(k,y)=>k[0]*y[0]+k[1]*y[1]+k[2]*y[2]+k[3]*y[3],sml:(k,y)=>[k*y[0],k*y[1],k*y[2],k*y[3]]};Wt.encode=function(y,N,I,F,P,L,$){F==null&&(F=0),$==null&&($=!1);const S=d(y,N,I,F,[!1,!1,!1,0,$,!1]);return h(S,-1),f(S,N,I,P,L)},Wt.encodeLL=function(y,N,I,F,P,L,$,S){const b={ctype:0+(F==1?0:2)+(P==0?0:4),depth:L,frames:[]},z=(F+P)*L,U=z*N;for(let H=0;H<y.length;H++)b.frames.push({rect:{x:0,y:0,width:N,height:I},img:new Uint8Array(y[H]),blend:0,dispose:1,bpp:Math.ceil(z/8),bpl:Math.ceil(U/8)});return h(b,0,!0),f(b,N,I,$,S)},Wt.encode.compress=d,Wt.encode.dither=l,Wt.quantize=m,Wt.quantize.getKDtree=w,Wt.quantize.getNearest=x})();const di={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,d=new ArrayBuffer(h),i=new DataView(d),u=1<<20;let g,p,m,w,x=u,O=0,v=0,E=0;function A(k){i.setUint16(v,k,!0),v+=2}function _(k){i.setUint32(v,k,!0),v+=4}function M(k){v+=k}A(19778),_(h),M(4),_(122),_(108),_(r),_(-n>>>0),A(1),A(32),_(3),_(f),_(2835),_(2835),M(8),_(16711680),_(65280),_(255),_(4278190080),_(1466527264),(function k(){for(;O<n&&x>0;){for(w=122+O*l,g=0;g<o;)x--,p=s[E++],m=p>>>24,i.setUint32(w+g,p<<8|m),g+=4;O++}E<s.length?(x=u,setTimeout(k,di._dly)):t(d)})()},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"},Kg={[kt.CHROME]:16384,[kt.FIREFOX]:11180,[kt.DESKTOP_SAFARI]:16384,[kt.IE]:8192,[kt.IOS]:4096,[kt.ETC]:8192};const ma=typeof window<"u",ui=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Wn=ma&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),Vg=(ma||ui)&&(Wn&&Wn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),fi=(ma||ui)&&(Wn&&Wn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function ba(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 gi(e){return new Promise(((t,r)=>{const n=new fi;n.onload=()=>t(n.result),n.onerror=o=>r(o),n.readAsDataURL(e)}))}function hi(e){return new Promise(((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=o=>r(o),n.src=e}))}function kr(){if(kr.cachedResult!==void 0)return kr.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),kr.cachedResult=e,kr.cachedResult}function pi(e,t){const r=kr(),n=Kg[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 mi(e,t){const{width:r,height:n}=pi(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 Vn(){return Vn.cachedResult!==void 0||(Vn.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),Vn.cachedResult}function Yn(e,t={}){return new Promise((function(r,n){let o,a;var s=function(){try{return a=mi(o,t.fileType||e.type),r([o,a])}catch(f){return n(f)}},l=function(f){try{var h=function(d){try{throw d}catch(i){return n(i)}};try{let d;return gi(e).then((function(i){try{return d=i,hi(d).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(d){h(d)}}catch(d){return n(d)}};try{if(Vn()||[kt.DESKTOP_SAFARI,kt.MOBILE_SAFARI].includes(kr()))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 Xn(e,t,r,n,o=1){return new Promise((function(a,s){let l;if(t==="image/png"){let h,d,i;return h=e.getContext("2d"),{data:d}=h.getImageData(0,0,e.width,e.height),i=Wt.encode([d.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((d=>di.toBlob(e,d))).then(function(d){try{return l=d,l.name=r,l.lastModified=n,h.call(this)}catch(i){return s(i)}}.bind(this),s);{let d=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,d.call(this)}catch(u){return s(u)}}.bind(this),s);{let i;return i=e.toDataURL(t,o),ba(i,r,n).then(function(u){try{return l=u,d.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 Gr(){return new Promise((function(e,t){let r,n,o,a;return Gr.cachedResult!==void 0?e(Gr.cachedResult):ba("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(s){try{return r=s,Yn(r).then((function(l){try{return n=l[1],Xn(n,r.type,r.name,r.lastModified).then((function(f){try{return o=f,qt(n),Yn(o).then((function(h){try{return a=h[0],Gr.cachedResult=a.width===1&&a.height===2,e(Gr.cachedResult)}catch(d){return t(d)}}),t)}catch(h){return t(h)}}),t)}catch(f){return t(f)}}),t)}catch(l){return t(l)}}),t)}))}function bi(e){return new Promise(((t,r)=>{const n=new fi;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 d=a.getUint16(l,h);l+=2;for(let i=0;i<d;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 yi(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 vi(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 wi(e,t,r=0){return new Promise((function(n,o){let a,s,l,f,h,d,i,u,g,p,m,w,x,O,v,E,A,_,M,k;function y(I=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;a+=I,t.onProgress(Math.min(a,100))}function N(I){if(t.signal&&t.signal.aborted)throw t.signal.reason;a=Math.min(Math.max(I,a),100),t.onProgress(a)}return a=r,s=t.maxIteration||10,l=1024*t.maxSizeMB*1024,y(),Yn(e,t).then(function(I){try{return[,f]=I,y(),h=yi(f,t),y(),new Promise((function(F,P){var L;if(!(L=t.exifOrientation))return bi(e).then(function(S){try{return L=S,$.call(this)}catch(b){return P(b)}}.bind(this),P);function $(){return F(L)}return $.call(this)})).then(function(F){try{return d=F,y(),Gr().then(function(P){try{return i=P?h:vi(h,d),y(),u=t.initialQuality||1,g=t.fileType||e.type,Xn(i,g,e.name,e.lastModified,u).then(function(L){try{{let S=function(){if(s--&&(v>l||v>x)){let z,U;return z=k?.95*M.width:M.width,U=k?.95*M.height:M.height,[A,_]=Kn(z,U),_.drawImage(M,0,0,z,U),u*=g==="image/png"?.85:.95,Xn(A,g,e.name,e.lastModified,u).then((function(H){try{return E=H,qt(M),M=A,v=E.size,N(Math.min(99,Math.floor((O-v)/(O-l)*100))),S}catch(Y){return o(Y)}}),o)}return[1]},b=function(){return qt(M),qt(A),qt(h),qt(i),qt(f),N(100),n(E)};if(p=L,y(),m=p.size>l,w=p.size>e.size,!m&&!w)return N(100),n(p);var $;return x=e.size,O=p.size,v=O,M=i,k=!t.alwaysKeepResolution&&m,($=function(z){for(;z;){if(z.then)return void z.then($,o);try{if(z.pop){if(z.length)return z.pop()?b.call(this):z;z=S}else z=z.call(this)}catch(U){return o(U)}}}.bind(this))(S)}}catch(S){return o(S)}}.bind(this),o)}catch(L){return o(L)}}.bind(this),o)}catch(P){return o(P)}}.bind(this),o)}catch(F){return o(F)}}.bind(this),o)}))}const Yg=`
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 ya;function Xg(e,t){return new Promise(((r,n)=>{ya||(ya=(function(s){const l=[];return l.push(s),URL.createObjectURL(new Blob(l))})(Yg));const o=new Worker(ya);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 Vg))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 wi(e,o).then(function(g){try{return a=g,u.call(this)}catch(p){return n(p)}}.bind(this),n);var d=function(){try{return u.call(this)}catch(g){return n(g)}}.bind(this),i=function(g){try{return wi(e,o).then((function(p){try{return a=p,d()}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",Xg(e,o).then((function(g){try{return a=g,d()}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=ci(e,a))}catch{}return r(a)}}))}mt.getDataUrlFromFile=gi,mt.getFilefromDataUrl=ba,mt.loadImage=hi,mt.drawImageInCanvas=mi,mt.drawFileInCanvas=Yn,mt.canvasToFile=Xn,mt.getExifOrientation=bi,mt.handleMaxWidthOrHeight=yi,mt.followExifOrientation=vi,mt.cleanupCanvasMemory=qt,mt.isAutoOrientationInBrowser=Gr,mt.approximateBelowMaximumCanvasSizeOfBrowser=pi,mt.copyExifWithoutOrientation=ci,mt.getBrowserName=kr,mt.version="2.0.2";const Zg=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]}`},xi=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:"업로드 실패"},ki=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",nt=(e,t)=>Zg?.t?.(e,t)??e,Cr=window.G7Core;function Ci(e){const{attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:d,initialFiles:i,endpoints:u,onFilesChange:g,onUploadComplete:p,onUploadError:m,onRemove:w,onReorder:x,uploadTriggerEvent:O,confirmBeforeRemove:v,uploadParams:E}=e,[A,_]=C.useState(i),[M,k]=C.useState([]),[y,N]=C.useState(!1),I=C.useRef(null),F=C.useRef(0),P=C.useRef(new Set),L=C.useRef(new Map),[$,S]=C.useState(!1),[b,z]=C.useState(null),[U,H]=C.useState(!1),Y=C.useRef(!1),[B,X]=C.useState([]),G=C.useRef(i),[W,Q]=C.useState(!1),[me,se]=C.useState(0),pe=C.useRef(0),[ne,ce]=C.useState(new Map),ve=C.useRef(new Map);C.useEffect(()=>{g?.(M)},[M,g]);const Se=C.useMemo(()=>{const Z=G.current;return Z===i?Z:Z.length!==i.length?(G.current=i,i):Z.length===0&&i.length===0?Z:i.some((he,ue)=>he.id!==Z[ue]?.id)?(G.current=i,i):Z},[i]);C.useEffect(()=>{if(Y.current)return;const Z=Se.filter(ue=>!P.current.has(ue.id)&&(!ue.hash||!P.current.has(ue.hash))),le=new Set(Z.map(ue=>ue.id)),he=Array.from(L.current.values()).filter(ue=>!le.has(ue.id)&&!P.current.has(ue.id));_([...Z,...he])},[Se]);const ze=C.useCallback(async Z=>{const le={maxSizeMB:f?.maxSizeMB??1,maxWidthOrHeight:f?.maxWidthOrHeight??1920,useWebWorker:!0};return await mt(Z,le)},[f]),ie=C.useCallback(async Z=>{const le=A.length+M.length,he=Math.max(0,o-le),ue=Array.from(Z).slice(0,he);if(Z.length>he){const fe=Array.from(Z).slice(he),Le=nt("attachment.upload_limit_exceeded",{max:o});m?.(Le,fe[0]??Z[0])}for(const fe of ue){if(fe.size>a*1024*1024){m?.(`[${fe.name}] 파일 크기(${Zn(fe.size)})가 최대 허용 크기(${a}MB)를 초과합니다.`,fe);continue}if(l){const _e="."+fe.name.split(".").pop()?.toLowerCase();if(!l.split(",").map(He=>He.trim().toLowerCase()).some(He=>{if(He.includes("/")){if(He.endsWith("/*")){const Ke=He.slice(0,-2);return fe.type.toLowerCase().startsWith(Ke+"/")}return fe.type.toLowerCase()===He}return _e===He})){m?.(`[${fe.name}] 허용되지 않는 파일 형식입니다. (허용: ${l})`,fe);continue}}const Le={id:`pending-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,file:fe,original_filename:fe.name,mime_type:fe.type,size:fe.size,size_formatted:Zn(fe.size),status:"pending",progress:0};if(fe.type.startsWith("image/")&&(Le.preview=URL.createObjectURL(fe)),k(_e=>[..._e,Le]),fe.type.startsWith("image/")&&f){k(_e=>_e.map(Ee=>Ee.id===Le.id?{...Ee,status:"compressing"}:Ee));try{const _e=await ze(fe);k(Ee=>Ee.map(we=>we.id===Le.id?{...we,compressedBlob:_e,size:_e.size,size_formatted:Zn(_e.size),status:"pending",progress:0}:we))}catch{k(_e=>_e.map(Ee=>Ee.id===Le.id?{...Ee,status:"error",error:"이미지 압축 실패"}:Ee))}}}},[A.length,M.length,o,a,l,f,ze,m]),De=C.useCallback(async Z=>{const le=new FormData,he=Z.compressedBlob?new File([Z.compressedBlob],Z.original_filename,{type:Z.mime_type}):Z.file;le.append("file",he),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))}),E&&Object.entries(E).forEach(([ue,fe])=>{le.append(ue,fe)});try{const ue=await Cr.api.post(u.upload,le,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:Le=>{const _e=Math.round(Le.loaded*100/(Le.total??1));k(Ee=>Ee.map(we=>we.id===Z.id?{...we,progress:_e}:we))}});return ue?.data?.data??ue?.data}catch(ue){const fe=xi(ue);throw new Error(fe)}},[t,r,n,h,u.upload]),Ae=C.useCallback(async()=>{const Z=M.filter(_e=>_e.status==="pending"||_e.status==="error");if(Z.length===0)return[];const le=[],he=new Map,ue=[...Z],fe=async()=>{for(;ue.length>0&&F.current<s;){const _e=ue.shift();F.current++,k(Ee=>Ee.map(we=>we.id===_e.id?{...we,status:"uploading",progress:0}:we));try{const Ee=await De(_e);if(Ee)le.push(Ee),he.set(String(_e.id),String(Ee.hash)),L.current.set(Ee.id,Ee),k(we=>we.filter(He=>He.id!==_e.id)),_(we=>[...we,Ee]),X(we=>{if(we.length===0)return we;const He=String(_e.id);return we.some(Ne=>String(Ne)===He)?we.map(Ne=>String(Ne)===He?String(Ee.hash):Ne):we}),_e.preview&&URL.revokeObjectURL(_e.preview);else{const we=nt("attachment.upload_response_invalid");k(He=>He.map(Ke=>Ke.id===_e.id?{...Ke,status:"error",error:we}:Ke)),m?.(`[${_e.original_filename}] ${we}`,_e.file)}}catch(Ee){const we=Ee instanceof Error?Ee.message:"업로드 실패";k(He=>He.map(Ke=>Ke.id===_e.id?{...Ke,status:"error",error:we}:Ke)),m?.(`[${_e.original_filename}] ${we}`,_e.file)}finally{F.current--}}},Le=Array(Math.min(s,Z.length)).fill(null).map(()=>fe());if(await Promise.all(Le),le.length>0&&(p?.(le),u.reorder&&B.length>0&&x)){const _e=[...A,...le],Ee=B.map(Ke=>he.get(String(Ke))??Ke),we=new Map(Ee.map((Ke,Ne)=>[String(Ke),Ne])),He=[..._e].sort((Ke,Ne)=>{const xe=we.get(String(Ke.hash))??_e.length,Ie=we.get(String(Ne.hash))??_e.length;return xe-Ie}).map((Ke,Ne)=>({...Ke,sort_order:Ne,order:Ne+1}));x(He)}return le},[M,s,De,p,m,B,A,x,u.reorder]);C.useEffect(()=>{if(!O)return;const Z=Cr.componentEvent.on(O,async()=>{const le=await Ae();return{uploadedAttachments:le,existingFiles:A,allFiles:[...A,...le]}});return()=>{Z()}},[O,Ae,A]),C.useEffect(()=>{d&&M.some(Z=>Z.status==="pending")&&Ae()},[d,M,Ae]);const ke=C.useCallback(async Z=>{H(!0);try{if(Z.id&&u.delete){const he=u.delete.replace(":id",String(Z.id));await Cr.api.delete(he)}const le=Z.hash||Z.id;Z.id&&(P.current.add(Z.id),L.current.delete(Z.id)),Z.hash&&P.current.add(Z.hash),_(he=>he.filter(ue=>(ue.hash||ue.id)!==le)),w?.(Z.hash||Z.id),S(!1),z(null)}catch{console.error("첨부파일 삭제 실패")}finally{H(!1)}},[w,u.delete]),je=C.useCallback(async Z=>{"hash"in Z?v?(z(Z),S(!0)):await ke(Z):(Z.preview&&URL.revokeObjectURL(Z.preview),k(le=>le.filter(he=>he.id!==Z.id)))},[v,ke]),$e=C.useCallback(Z=>{k(le=>le.map(he=>he.id===Z.id?{...he,status:"pending",error:void 0}:he))},[]),K=C.useCallback(async Z=>{const{arrayMove:le}=await Promise.resolve().then(()=>O0),{active:he,over:ue}=Z;if(!ue||he.id===ue.id)return;const fe=[...A,...M];let Le;if(B.length===0)Le=fe;else{const xe=new Map(B.map((Ie,We)=>[String(Ie),We]));Le=[...fe].sort((Ie,We)=>{const Je="hash"in Ie?String(Ie.hash):String(Ie.id),Be="hash"in We?String(We.hash):String(We.id);return(xe.get(Je)??fe.length)-(xe.get(Be)??fe.length)})}const _e=Le.findIndex(xe=>"hash"in xe?xe.hash===he.id:xe.id===he.id),Ee=Le.findIndex(xe=>"hash"in xe?xe.hash===ue.id:xe.id===ue.id),we=le(Le,_e,Ee);X(we.map(xe=>"hash"in xe?xe.hash:xe.id));const He=we.filter(xe=>"hash"in xe),Ke=we.filter(xe=>!("hash"in xe));Y.current=!0,_(He),k(Ke);const Ne=He.map((xe,Ie)=>({...xe,sort_order:Ie,order:Ie+1}));if(He.length>0&&u.reorder){const xe=He.map((Ie,We)=>({id:Ie.id,order:We+1}));try{const Ie=await Cr.api.patch(u.reorder,{order:xe});Cr.toast.success(Ie.message)}catch(Ie){const We=Ie instanceof Error?Ie.message:nt("attachment.reorder_failed");Cr.toast.error(We)}}x?.(Ne)},[A,M,B,u.reorder,x]),oe=C.useMemo(()=>[...A,...M].filter(Z=>"is_image"in Z?Z.is_image:Z.mime_type?.startsWith("image/")??!1),[A,M]),te=C.useCallback(Z=>{const le=oe.findIndex(he=>"hash"in Z&&"hash"in he?he.hash===Z.hash:"id"in Z&&"id"in he&&!("hash"in Z)&&!("hash"in he)?he.id===Z.id:!1);le!==-1&&(pe.current+=1,se(le),Q(!0))},[oe]);C.useEffect(()=>{let Z=!1;return(async()=>{const he=A.filter(fe=>fe.is_image),ue=new Set(he.map(fe=>fe.id));for(const[fe,Le]of ve.current)ue.has(fe)||(URL.revokeObjectURL(Le),ve.current.delete(fe));for(const fe of he){if(Z)break;if(!ve.current.has(fe.id))try{const Le=await Cr.api.get(fe.download_url,{responseType:"blob"});if(!Z&&Le){const _e=URL.createObjectURL(Le);ve.current.set(fe.id,_e),ce(new Map(ve.current))}}catch(Le){console.error("Failed to load authenticated image:",Le)}}})(),()=>{Z=!0}},[A]),C.useEffect(()=>()=>{ve.current.forEach(Z=>URL.revokeObjectURL(Z)),ve.current.clear()},[]);const ae=C.useCallback(async Z=>{const{executeImageDownload:le}=await Promise.resolve().then(()=>ei);await le({src:Z.download_url,downloadUrl:Z.download_url,filename:Z.original_filename,downloadRequiresAuth:!0})},[]),be=C.useMemo(()=>{const Z=[...A,...M];if(B.length===0)return Z;const le=new Map(B.map((he,ue)=>[String(he),ue]));return[...Z].sort((he,ue)=>{const fe="hash"in he?String(he.hash):String(he.id),Le="hash"in ue?String(ue.hash):String(ue.id),_e=le.get(fe)??Z.length,Ee=le.get(Le)??Z.length;return _e-Ee})},[A,M,B]),Me=be.length,Xe=Me>0,Fe=Me<o,Ve=C.useCallback(()=>k([]),[]),Oe=C.useCallback(()=>M,[M]);return{existingFiles:A,pendingFiles:M,isDragOver:y,setIsDragOver:N,isDeleting:U,totalCount:Me,hasFiles:Xe,canAddMore:Fe,allItems:be,imageFiles:oe,handleFiles:ie,handleRemove:je,handleRetry:$e,handleUploadAll:Ae,handleOpenGallery:te,handleDownload:ae,handleDragEnd:K,inputRef:I,galleryOpen:W,setGalleryOpen:Q,galleryStartIndex:me,galleryKeyRef:pe,confirmDialogOpen:$,setConfirmDialogOpen:S,itemToDelete:b,executeRemoveAttachment:ke,authenticatedImageUrls:ne,clear:Ve,getPendingFiles:Oe}}const Si=({isDragOver:e,canAddMore:t,onFiles:r,setIsDragOver:n,inputRef:o,accept:a,maxFiles:s,maxSize:l,children:f})=>c.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:[c.jsx("input",{ref:o,type:"file",multiple:!0,accept:a,onChange:h=>h.target.files&&r(h.target.files),className:"hidden"}),!f&&c.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:[c.jsx(Ot,{className:"fa-solid fa-cloud-arrow-up text-4xl text-gray-400 dark:text-gray-500 mb-4"}),c.jsx(Ut,{className:"text-sm text-gray-600 dark:text-gray-400",children:nt("attachment.drop_or_click")}),c.jsxs(Ut,{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:[nt("attachment.upload_limit",{maxFiles:s,maxSize:l}),a&&` (${a})`]})]}),f]});function qg(){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 jr(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function va(e){return"nodeType"in e}function Ct(e){var t,r;return e?jr(e)?e:va(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function wa(e){const{Document:t}=Ct(e);return e instanceof t}function dn(e){return jr(e)?!1:e instanceof Ct(e).HTMLElement}function _i(e){return e instanceof Ct(e).SVGElement}function Br(e){return e?jr(e)?e.document:va(e)?wa(e)?e:dn(e)||_i(e)?e.ownerDocument:document:document:document}const Qt=qn?C.useLayoutEffect:C.useEffect;function xa(e){const t=C.useRef(e);return Qt(()=>{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 Qg(){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 Qt(()=>{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 Qn(e){const t=xa(e),r=C.useRef(null),n=C.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o},[]);return[r,n]}function ka(e){const t=C.useRef();return C.useEffect(()=>{t.current=e},[e]),t.current}let Ca={};function gn(e,t){return C.useMemo(()=>{if(t)return t;const r=Ca[e]==null?0:Ca[e]+1;return Ca[e]=r,e+"-"+r},[e,t])}function Ei(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 d=a[f];d!=null&&(a[f]=d+e*h)}return a},{...t})}}const Wr=Ei(1),hn=Ei(-1);function Jg(e){return"clientX"in e&&"clientY"in e}function Sa(e){if(!e)return!1;const{KeyboardEvent:t}=Ct(e.target);return t&&e instanceof t}function Rg(e){if(!e)return!1;const{TouchEvent:t}=Ct(e.target);return t&&e instanceof t}function _a(e){if(Rg(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 Jg(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}}}),Ti="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function eh(e){return e.matches(Ti)?e:e.querySelector(Ti)}const th={display:"none"};function rh(e){let{id:t,value:r}=e;return C.createElement("div",{id:t,style:th},r)}function nh(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 oh(){const[e,t]=C.useState("");return{announce:C.useCallback(n=>{n!=null&&t(n)},[]),announcement:e}}const Ni=C.createContext(null);function ah(e){const t=C.useContext(Ni);C.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function sh(){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 lh={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.
`},ih={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 ch(e){let{announcements:t=ih,container:r,hiddenTextDescribedById:n,screenReaderInstructions:o=lh}=e;const{announce:a,announcement:s}=oh(),l=gn("DndLiveRegion"),[f,h]=C.useState(!1);if(C.useEffect(()=>{h(!0)},[]),ah(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 d=C.createElement(C.Fragment,null,C.createElement(rh,{id:n,value:o.draggable}),C.createElement(nh,{id:l,announcement:s}));return r?or.createPortal(d,r):d}var ot;(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"})(ot||(ot={}));function Jn(){}function Ai(e,t){return C.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function dh(){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 Kt=Object.freeze({x:0,y:0});function Oi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Mi(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function uh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function Ii(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 Di(e,t){if(!e||e.length===0)return null;const[r]=e;return r[t]}function Pi(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 fh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Pi(t,t.left,t.top),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Oi(Pi(f),o);a.push({id:l,data:{droppableContainer:s,value:h}})}}return a.sort(Mi)},gh=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e;const o=Ii(t),a=[];for(const s of n){const{id:l}=s,f=r.get(l);if(f){const h=Ii(f),d=o.reduce((u,g,p)=>u+Oi(h[p],g),0),i=Number((d/4).toFixed(4));a.push({id:l,data:{droppableContainer:s,value:i}})}}return a.sort(Mi)};function hh(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,d=s*l,i=d/(f+h-d);return Number(i.toFixed(4))}return 0}const ph=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=hh(l,t);f>0&&o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(uh)};function mh(e,t,r){return{...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function Li(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Kt}function bh(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 yh=bh(1);function vh(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 wh(e,t,r){const n=vh(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)),d=o?e.width/o:e.width,i=a?e.height/a:e.height;return{width:d,height:i,top:h,right:f+d,bottom:h+i,left:f}}const xh={ignoreTransform:!1};function Kr(e,t){t===void 0&&(t=xh);let r=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:d}=Ct(e).getComputedStyle(e);h&&(r=wh(r,h,d))}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 Fi(e){return Kr(e,{ignoreTransform:!0})}function kh(e){const t=e.innerWidth,r=e.innerHeight;return{top:0,left:0,right:t,bottom:r,width:t,height:r}}function Ch(e,t){return t===void 0&&(t=Ct(e).getComputedStyle(e)),t.position==="fixed"}function Sh(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 Rn(e,t){const r=[];function n(o){if(t!=null&&r.length>=t||!o)return r;if(wa(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!dn(o)||_i(o)||r.includes(o))return r;const a=Ct(e).getComputedStyle(o);return o!==e&&Sh(o,a)&&r.push(o),Ch(o,a)?r:n(o.parentNode)}return e?n(e):r}function $i(e){const[t]=Rn(e,1);return t??null}function Ea(e){return!qn||!e?null:jr(e)?e:va(e)?wa(e)||e===Br(e).scrollingElement?window:dn(e)?e:null:null}function Ui(e){return jr(e)?e.scrollX:e.scrollLeft}function zi(e){return jr(e)?e.scrollY:e.scrollTop}function Ta(e){return{x:Ui(e),y:zi(e)}}var dt;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(dt||(dt={}));function Hi(e){return!qn||!e?!1:e===document.scrollingElement}function Gi(e){const t={x:0,y:0},r=Hi(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 _h={x:.2,y:.2};function Eh(e,t,r,n,o){let{top:a,left:s,right:l,bottom:f}=r;n===void 0&&(n=10),o===void 0&&(o=_h);const{isTop:h,isBottom:d,isLeft:i,isRight:u}=Gi(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=dt.Backward,p.y=n*Math.abs((t.top+m.height-a)/m.height)):!d&&f>=t.bottom-m.height&&(g.y=dt.Forward,p.y=n*Math.abs((t.bottom-m.height-f)/m.height)),!u&&l>=t.right-m.width?(g.x=dt.Forward,p.x=n*Math.abs((t.right-m.width-l)/m.width)):!i&&s<=t.left+m.width&&(g.x=dt.Backward,p.x=n*Math.abs((t.left+m.width-s)/m.width)),{direction:g,speed:p}}function Th(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 ji(e){return e.reduce((t,r)=>Wr(t,Ta(r)),Kt)}function Nh(e){return e.reduce((t,r)=>t+Ui(r),0)}function Ah(e){return e.reduce((t,r)=>t+zi(r),0)}function Oh(e,t){if(t===void 0&&(t=Kr),!e)return;const{top:r,left:n,bottom:o,right:a}=t(e);$i(e)&&(o<=0||a<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Mh=[["x",["left","right"],Nh],["y",["top","bottom"],Ah]];class Na{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=Rn(r),o=ji(n);this.rect={...t},this.width=t.width,this.height=t.height;for(const[a,s,l]of Mh)for(const f of s)Object.defineProperty(this,f,{get:()=>{const h=l(n),d=o[a]-h;return this.rect[f]+d},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 Ih(e){const{EventTarget:t}=Ct(e);return e instanceof t?e:Br(e)}function Aa(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 $t;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})($t||($t={}));function Bi(e){e.preventDefault()}function Dh(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 Wi={start:[Ue.Space,Ue.Enter],cancel:[Ue.Esc],end:[Ue.Space,Ue.Enter,Ue.Tab]},Ph=(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 Oa{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(Br(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($t.Resize,this.handleCancel),this.windowListeners.add($t.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add($t.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:r}=this.props,n=t.node.current;n&&Oh(n),r(Kt)}handleKeyDown(t){if(Sa(t)){const{active:r,context:n,options:o}=this.props,{keyboardCodes:a=Wi,coordinateGetter:s=Ph,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,d=h?{x:h.left,y:h.top}:Kt;this.referenceCoordinates||(this.referenceCoordinates=d);const i=s(t,{active:r,context:n.current,currentCoordinates:d});if(i){const u=hn(i,d),g={x:0,y:0},{scrollableAncestors:p}=n.current;for(const m of p){const w=t.code,{isTop:x,isRight:O,isLeft:v,isBottom:E,maxScroll:A,minScroll:_}=Gi(m),M=Th(m),k={x:Math.min(w===Ue.Right?M.right-M.width/2:M.right,Math.max(w===Ue.Right?M.left:M.left+M.width/2,i.x)),y:Math.min(w===Ue.Down?M.bottom-M.height/2:M.bottom,Math.max(w===Ue.Down?M.top:M.top+M.height/2,i.y))},y=w===Ue.Right&&!O||w===Ue.Left&&!v,N=w===Ue.Down&&!E||w===Ue.Up&&!x;if(y&&k.x!==i.x){const I=m.scrollLeft+u.x,F=w===Ue.Right&&I<=A.x||w===Ue.Left&&I>=_.x;if(F&&!u.y){m.scrollTo({left:I,behavior:l});return}F?g.x=m.scrollLeft-I:g.x=w===Ue.Right?m.scrollLeft-A.x:m.scrollLeft-_.x,g.x&&m.scrollBy({left:-g.x,behavior:l});break}else if(N&&k.y!==i.y){const I=m.scrollTop+u.y,F=w===Ue.Down&&I<=A.y||w===Ue.Up&&I>=_.y;if(F&&!u.x){m.scrollTo({top:I,behavior:l});return}F?g.y=m.scrollTop-I:g.y=w===Ue.Down?m.scrollTop-A.y:m.scrollTop-_.y,g.y&&m.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Wr(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()}}Oa.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=Wi,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 Ki(e){return!!(e&&"distance"in e)}function Vi(e){return!!(e&&"delay"in e)}class Ma{constructor(t,r,n){var o;n===void 0&&(n=Ih(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=Br(s),this.documentListeners=new mn(this.document),this.listeners=new mn(n),this.windowListeners=new mn(Ct(s)),this.initialCoordinates=(o=_a(a))!=null?o:Kt,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($t.Resize,this.handleCancel),this.windowListeners.add($t.DragStart,Bi),this.windowListeners.add($t.VisibilityChange,this.handleCancel),this.windowListeners.add($t.ContextMenu,Bi),this.documentListeners.add($t.Keydown,this.handleKeydown),r){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Vi(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Ki(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($t.Click,Dh,{capture:!0}),this.removeTextSelection(),this.documentListeners.add($t.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=_a(t))!=null?r:Kt,h=hn(o,f);if(!n&&l){if(Ki(l)){if(l.tolerance!=null&&Aa(h,l.tolerance))return this.handleCancel();if(Aa(h,l.distance))return this.handleStart()}if(Vi(l)&&Aa(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 Lh={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Ia extends Ma{constructor(t){const{event:r}=t,n=Br(r.target);super(t,Lh,n)}}Ia.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 Fh={move:{name:"mousemove"},end:{name:"mouseup"}};var Da;(function(e){e[e.RightClick=2]="RightClick"})(Da||(Da={}));class $h extends Ma{constructor(t){super(t,Fh,Br(t.event.target))}}$h.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button===Da.RightClick?!1:(n?.({event:r}),!0)}}];const Pa={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Uh extends Ma{constructor(t){super(t,Pa)}static setup(){return window.addEventListener(Pa.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Pa.move.name,t)};function t(){}}}Uh.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 eo;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(eo||(eo={}));function zh(e){let{acceleration:t,activator:r=bn.Pointer,canScroll:n,draggingRect:o,enabled:a,interval:s=5,order:l=eo.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:d,delta:i,threshold:u}=e;const g=Gh({delta:i,disabled:!a}),[p,m]=Qg(),w=C.useRef({x:0,y:0}),x=C.useRef({x:0,y:0}),O=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),E=C.useCallback(()=>{const _=v.current;if(!_)return;const M=w.current.x*x.current.x,k=w.current.y*x.current.y;_.scrollBy(M,k)},[]),A=C.useMemo(()=>l===eo.TreeOrder?[...h].reverse():h,[l,h]);C.useEffect(()=>{if(!a||!h.length||!O){m();return}for(const _ of A){if(n?.(_)===!1)continue;const M=h.indexOf(_),k=d[M];if(!k)continue;const{direction:y,speed:N}=Eh(_,k,O,t,u);for(const I of["x","y"])g[I][y[I]]||(N[I]=0,y[I]=0);if(N.x>0||N.y>0){m(),v.current=_,p(E,s),w.current=N,x.current=y;return}}w.current={x:0,y:0},x.current={x:0,y:0},m()},[t,E,n,m,a,s,JSON.stringify(O),JSON.stringify(g),p,h,A,d,JSON.stringify(u)])}const Hh={x:{[dt.Backward]:!1,[dt.Forward]:!1},y:{[dt.Backward]:!1,[dt.Forward]:!1}};function Gh(e){let{delta:t,disabled:r}=e;const n=ka(t);return fn(o=>{if(r||!n||!o)return Hh;const a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[dt.Backward]:o.x[dt.Backward]||a.x===-1,[dt.Forward]:o.x[dt.Forward]||a.x===1},y:{[dt.Backward]:o.y[dt.Backward]||a.y===-1,[dt.Forward]:o.y[dt.Forward]||a.y===1}}},[r,t,n])}function jh(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 Bh(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 La;(function(e){e.Optimized="optimized"})(La||(La={}));const Yi=new Map;function Wh(e,t){let{dragging:r,dependencies:n,config:o}=t;const[a,s]=C.useState(null),{frequency:l,measure:f,strategy:h}=o,d=C.useRef(e),i=w(),u=un(i),g=C.useCallback(function(x){x===void 0&&(x=[]),!u.current&&s(O=>O===null?x:O.concat(x.filter(v=>!O.includes(v))))},[u]),p=C.useRef(null),m=fn(x=>{if(i&&!r)return Yi;if(!x||x===Yi||d.current!==e||a!=null){const O=new Map;for(let v of e){if(!v)continue;if(a&&a.length>0&&!a.includes(v.id)&&v.rect.current){O.set(v.id,v.rect.current);continue}const E=v.node.current,A=E?new Na(f(E),E):null;v.rect.current=A,A&&O.set(v.id,A)}return O}return x},[e,a,r,i,f]);return C.useEffect(()=>{d.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 w(){switch(h){case yn.Always:return!1;case yn.BeforeDragging:return r;default:return!r}}}function Xi(e,t){return fn(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function Kh(e,t){return Xi(e,t)}function Vh(e){let{callback:t,disabled:r}=e;const n=xa(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 to(e){let{callback:t,disabled:r}=e;const n=xa(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 Yh(e){return new Na(Kr(e),e)}function Zi(e,t,r){t===void 0&&(t=Yh);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 d=t(e);return JSON.stringify(f)===JSON.stringify(d)?f:d})}const s=Vh({callback(f){if(e)for(const h of f){const{type:d,target:i}=h;if(d==="childList"&&i instanceof HTMLElement&&i.contains(e)){a();break}}}}),l=to({callback:a});return Qt(()=>{a(),e?(l?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),s?.disconnect())},[e]),n}function Xh(e){const t=Xi(e);return Li(e,t)}const qi=[];function Zh(e){const t=C.useRef(e),r=fn(n=>e?n&&n!==qi&&e&&t.current&&e.parentNode===t.current.parentNode?n:Rn(e):qi,[e]);return C.useEffect(()=>{t.current=e},[e]),r}function qh(e){const[t,r]=C.useState(null),n=C.useRef(e),o=C.useCallback(a=>{const s=Ea(a.target);s&&r(l=>l?(l.set(s,Ta(s)),new Map(l)):null)},[]);return C.useEffect(()=>{const a=n.current;if(e!==a){s(a);const l=e.map(f=>{const h=Ea(f);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,Ta(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=Ea(f);h?.removeEventListener("scroll",o)})}},[o,e]),C.useMemo(()=>e.length?t?Array.from(t.values()).reduce((a,s)=>Wr(a,s),Kt):ji(e):Kt,[e,t])}function Qi(e,t){t===void 0&&(t=[]);const r=C.useRef(null);return C.useEffect(()=>{r.current=null},t),C.useEffect(()=>{const n=e!==Kt;n&&!r.current&&(r.current=e),!n&&r.current&&(r.current=null)},[e]),r.current?hn(e,r.current):Kt}function Qh(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 Jh(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 Ji(e){return C.useMemo(()=>e?kh(e):null,[e])}const Ri=[];function Rh(e,t){t===void 0&&(t=Kr);const[r]=e,n=Ji(r?Ct(r):null),[o,a]=C.useState(Ri);function s(){a(()=>e.length?e.map(f=>Hi(f)?n:new Na(t(f),f)):Ri)}const l=to({callback:s});return Qt(()=>{l?.disconnect(),s(),e.forEach(f=>l?.observe(f))},[e]),o}function e0(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return dn(t)?t:e}function t0(e){let{measure:t}=e;const[r,n]=C.useState(null),o=C.useCallback(h=>{for(const{target:d}of h)if(dn(d)){n(i=>{const u=t(d);return i?{...i,width:u.width,height:u.height}:u});break}},[t]),a=to({callback:o}),s=C.useCallback(h=>{const d=e0(h);a?.disconnect(),d&&a?.observe(d),n(d?t(d):null)},[t,a]),[l,f]=Qn(s);return C.useMemo(()=>({nodeRef:l,rect:r,setRef:f}),[r,l,f])}const r0=[{sensor:Ia,options:{}},{sensor:Oa,options:{}}],n0={current:{}},ro={draggable:{measure:Fi},droppable:{measure:Fi,strategy:yn.WhileDragging,frequency:La.Optimized},dragOverlay:{measure:Kr}};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 o0={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:Jn},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ro,measureDroppableContainers:Jn,windowRect:null,measuringScheduled:!1},a0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Jn,draggableNodes:new Map,over:null,measureDroppableContainers:Jn},no=C.createContext(a0),ec=C.createContext(o0);function s0(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new vn}}}function l0(e,t){switch(t.type){case ot.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ot.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 ot.DragEnd:case ot.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ot.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 ot.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 ot.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 i0(e){let{disabled:t}=e;const{active:r,activatorEvent:n,draggableNodes:o}=C.useContext(no),a=ka(n),s=ka(r?.id);return C.useEffect(()=>{if(!t&&!n&&a&&s!=null){if(!Sa(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 d of[f.current,h.current]){if(!d)continue;const i=eh(d);if(i){i.focus();break}}})}},[n,t,o,s,a]),null}function c0(e,t){let{transform:r,...n}=t;return e!=null&&e.length?e.reduce((o,a)=>a({transform:o,...n}),r):r}function d0(e){return C.useMemo(()=>({draggable:{...ro.draggable,...e?.draggable},droppable:{...ro.droppable,...e?.droppable},dragOverlay:{...ro.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function u0(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;Qt(()=>{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 d=r(h),i=Li(d,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=$i(h);u&&u.scrollBy({top:i.y,left:i.x})}},[t,s,l,n,r])}const tc=C.createContext({...Kt,scaleX:1,scaleY:1});var dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(dr||(dr={}));const f0=C.memo(function(t){var r,n,o,a;let{id:s,accessibility:l,autoScroll:f=!0,children:h,sensors:d=r0,collisionDetection:i=ph,measuring:u,modifiers:g,...p}=t;const m=C.useReducer(l0,void 0,s0),[w,x]=m,[O,v]=sh(),[E,A]=C.useState(dr.Uninitialized),_=E===dr.Initialized,{draggable:{active:M,nodes:k,translate:y},droppable:{containers:N}}=w,I=M!=null?k.get(M):null,F=C.useRef({initial:null,translated:null}),P=C.useMemo(()=>{var Ne;return M!=null?{id:M,data:(Ne=I?.data)!=null?Ne:n0,rect:F}:null},[M,I]),L=C.useRef(null),[$,S]=C.useState(null),[b,z]=C.useState(null),U=un(p,Object.values(p)),H=gn("DndDescribedBy",s),Y=C.useMemo(()=>N.getEnabled(),[N]),B=d0(u),{droppableRects:X,measureDroppableContainers:G,measuringScheduled:W}=Wh(Y,{dragging:_,dependencies:[y.x,y.y],config:B.droppable}),Q=jh(k,M),me=C.useMemo(()=>b?_a(b):null,[b]),se=Ke(),pe=Kh(Q,B.draggable.measure);u0({activeNode:M!=null?k.get(M):null,config:se.layoutShiftCompensation,initialRect:pe,measure:B.draggable.measure});const ne=Zi(Q,B.draggable.measure,pe),ce=Zi(Q?Q.parentElement:null),ve=C.useRef({activatorEvent:null,active:null,activeNode:Q,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Se=N.getNodeFor((r=ve.current.over)==null?void 0:r.id),ze=t0({measure:B.dragOverlay.measure}),ie=(n=ze.nodeRef.current)!=null?n:Q,De=_?(o=ze.rect)!=null?o:ne:null,Ae=!!(ze.nodeRef.current&&ze.rect),ke=Xh(Ae?null:ne),je=Ji(ie?Ct(ie):null),$e=Zh(_?Se??Q:null),K=Rh($e),oe=c0(g,{transform:{x:y.x-ke.x,y:y.y-ke.y,scaleX:1,scaleY:1},activatorEvent:b,active:P,activeNodeRect:ne,containerNodeRect:ce,draggingNodeRect:De,over:ve.current.over,overlayNodeRect:ze.rect,scrollableAncestors:$e,scrollableAncestorRects:K,windowRect:je}),te=me?Wr(me,y):null,ae=qh($e),be=Qi(ae),Me=Qi(ae,[ne]),Xe=Wr(oe,be),Fe=De?yh(De,oe):null,Ve=P&&Fe?i({active:P,collisionRect:Fe,droppableRects:X,droppableContainers:Y,pointerCoordinates:te}):null,Oe=Di(Ve,"id"),[Z,le]=C.useState(null),he=Ae?oe:Wr(oe,Me),ue=mh(he,(a=Z?.rect)!=null?a:null,ne),fe=C.useRef(null),Le=C.useCallback((Ne,xe)=>{let{sensor:Ie,options:We}=xe;if(L.current==null)return;const Je=k.get(L.current);if(!Je)return;const Be=Ne.nativeEvent,Ze=new Ie({active:L.current,activeNode:Je,event:Be,options:We,context:ve,onAbort(et){if(!k.get(et))return;const{onDragAbort:It}=U.current,Dt={id:et};It?.(Dt),O({type:"onDragAbort",event:Dt})},onPending(et,Rt,It,Dt){if(!k.get(et))return;const{onDragPending:nr}=U.current,er={id:et,constraint:Rt,initialCoordinates:It,offset:Dt};nr?.(er),O({type:"onDragPending",event:er})},onStart(et){const Rt=L.current;if(Rt==null)return;const It=k.get(Rt);if(!It)return;const{onDragStart:Dt}=U.current,fr={activatorEvent:Be,active:{id:Rt,data:It.data,rect:F}};or.unstable_batchedUpdates(()=>{Dt?.(fr),A(dr.Initializing),x({type:ot.DragStart,initialCoordinates:et,active:Rt}),O({type:"onDragStart",event:fr}),S(fe.current),z(Be)})},onMove(et){x({type:ot.DragMove,coordinates:et})},onEnd:Jt(ot.DragEnd),onCancel:Jt(ot.DragCancel)});fe.current=Ze;function Jt(et){return async function(){const{active:It,collisions:Dt,over:fr,scrollAdjustedTranslate:nr}=ve.current;let er=null;if(It&&nr){const{cancelDrop:Vt}=U.current;er={activatorEvent:Be,active:It,collisions:Dt,delta:nr,over:fr},et===ot.DragEnd&&typeof Vt=="function"&&await Promise.resolve(Vt(er))&&(et=ot.DragCancel)}L.current=null,or.unstable_batchedUpdates(()=>{x({type:et}),A(dr.Uninitialized),le(null),S(null),z(null),fe.current=null;const Vt=et===ot.DragEnd?"onDragEnd":"onDragCancel";if(er){const Sn=U.current[Vt];Sn?.(er),O({type:Vt,event:er})}})}}},[k]),_e=C.useCallback((Ne,xe)=>(Ie,We)=>{const Je=Ie.nativeEvent,Be=k.get(We);if(L.current!==null||!Be||Je.dndKit||Je.defaultPrevented)return;const Ze={active:Be};Ne(Ie,xe.options,Ze)===!0&&(Je.dndKit={capturedBy:xe.sensor},L.current=We,Le(Ie,xe))},[k,Le]),Ee=Bh(d,_e);Qh(d),Qt(()=>{ne&&E===dr.Initializing&&A(dr.Initialized)},[ne,E]),C.useEffect(()=>{const{onDragMove:Ne}=U.current,{active:xe,activatorEvent:Ie,collisions:We,over:Je}=ve.current;if(!xe||!Ie)return;const Be={active:xe,activatorEvent:Ie,collisions:We,delta:{x:Xe.x,y:Xe.y},over:Je};or.unstable_batchedUpdates(()=>{Ne?.(Be),O({type:"onDragMove",event:Be})})},[Xe.x,Xe.y]),C.useEffect(()=>{const{active:Ne,activatorEvent:xe,collisions:Ie,droppableContainers:We,scrollAdjustedTranslate:Je}=ve.current;if(!Ne||L.current==null||!xe||!Je)return;const{onDragOver:Be}=U.current,Ze=We.get(Oe),Jt=Ze&&Ze.rect.current?{id:Ze.id,rect:Ze.rect.current,data:Ze.data,disabled:Ze.disabled}:null,et={active:Ne,activatorEvent:xe,collisions:Ie,delta:{x:Je.x,y:Je.y},over:Jt};or.unstable_batchedUpdates(()=>{le(Jt),Be?.(et),O({type:"onDragOver",event:et})})},[Oe]),Qt(()=>{ve.current={activatorEvent:b,active:P,activeNode:Q,collisionRect:Fe,collisions:Ve,droppableRects:X,draggableNodes:k,draggingNode:ie,draggingNodeRect:De,droppableContainers:N,over:Z,scrollableAncestors:$e,scrollAdjustedTranslate:Xe},F.current={initial:De,translated:Fe}},[P,Q,Ve,Fe,k,ie,De,X,N,Z,$e,Xe]),zh({...se,delta:y,draggingRect:Fe,pointerCoordinates:te,scrollableAncestors:$e,scrollableAncestorRects:K});const we=C.useMemo(()=>({active:P,activeNode:Q,activeNodeRect:ne,activatorEvent:b,collisions:Ve,containerNodeRect:ce,dragOverlay:ze,draggableNodes:k,droppableContainers:N,droppableRects:X,over:Z,measureDroppableContainers:G,scrollableAncestors:$e,scrollableAncestorRects:K,measuringConfiguration:B,measuringScheduled:W,windowRect:je}),[P,Q,ne,b,Ve,ce,ze,k,N,X,Z,G,$e,K,B,W,je]),He=C.useMemo(()=>({activatorEvent:b,activators:Ee,active:P,activeNodeRect:ne,ariaDescribedById:{draggable:H},dispatch:x,draggableNodes:k,over:Z,measureDroppableContainers:G}),[b,Ee,P,ne,x,H,k,Z,G]);return C.createElement(Ni.Provider,{value:v},C.createElement(no.Provider,{value:He},C.createElement(ec.Provider,{value:we},C.createElement(tc.Provider,{value:ue},h)),C.createElement(i0,{disabled:l?.restoreFocus===!1})),C.createElement(ch,{...l,hiddenTextDescribedById:H}));function Ke(){const Ne=$?.autoScrollEnabled===!1,xe=typeof f=="object"?f.enabled===!1:f===!1,Ie=_&&!Ne&&!xe;return typeof f=="object"?{...f,enabled:Ie}:{enabled:Ie}}}),g0=C.createContext(null),rc="button",h0="Draggable";function p0(e){let{id:t,data:r,disabled:n=!1,attributes:o}=e;const a=gn(h0),{activators:s,activatorEvent:l,active:f,activeNodeRect:h,ariaDescribedById:d,draggableNodes:i,over:u}=C.useContext(no),{role:g=rc,roleDescription:p="draggable",tabIndex:m=0}=o??{},w=f?.id===t,x=C.useContext(w?tc:g0),[O,v]=Qn(),[E,A]=Qn(),_=Jh(s,t),M=un(r);Qt(()=>(i.set(t,{id:t,key:a,node:O,activatorNode:E,data:M}),()=>{const y=i.get(t);y&&y.key===a&&i.delete(t)}),[i,t]);const k=C.useMemo(()=>({role:g,tabIndex:m,"aria-disabled":n,"aria-pressed":w&&g===rc?!0:void 0,"aria-roledescription":p,"aria-describedby":d.draggable}),[n,g,m,w,p,d.draggable]);return{active:f,activatorEvent:l,activeNodeRect:h,attributes:k,isDragging:w,listeners:n?void 0:_,node:O,over:u,setNodeRef:v,setActivatorNodeRef:A,transform:x}}function m0(){return C.useContext(ec)}const b0="Droppable",y0={timeout:25};function v0(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:o}=e;const a=gn(b0),{active:s,dispatch:l,over:f,measureDroppableContainers:h}=C.useContext(no),d=C.useRef({disabled:r}),i=C.useRef(!1),u=C.useRef(null),g=C.useRef(null),{disabled:p,updateMeasurementsFor:m,timeout:w}={...y0,...o},x=un(m??n),O=C.useCallback(()=>{if(!i.current){i.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{h(Array.isArray(x.current)?x.current:[x.current]),g.current=null},w)},[w]),v=to({callback:O,disabled:p||!s}),E=C.useCallback((k,y)=>{v&&(y&&(v.unobserve(y),i.current=!1),k&&v.observe(k))},[v]),[A,_]=Qn(E),M=un(t);return C.useEffect(()=>{!v||!A.current||(v.disconnect(),i.current=!1,v.observe(A.current))},[A,v]),C.useEffect(()=>(l({type:ot.RegisterDroppable,element:{id:n,key:a,disabled:r,node:A,rect:u,data:M}}),()=>l({type:ot.UnregisterDroppable,key:a,id:n})),[n]),C.useEffect(()=>{r!==d.current.disabled&&(l({type:ot.SetDroppableDisabled,id:n,key:a,disabled:r}),d.current.disabled=r)},[n,a,r,l]),{active:s,rect:u,isOver:f?.id===n,node:A,over:f,setNodeRef:_}}function Fa(e,t,r){const n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function w0(e,t){return e.reduce((r,n,o)=>{const a=t.get(n);return a&&(r[o]=a),r},Array(e.length))}function oo(e){return e!==null&&e>=0}function x0(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 k0(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ao=e=>{let{rects:t,activeIndex:r,overIndex:n,index:o}=e;const a=Fa(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}},nc="Sortable",oc=C.createContext({activeIndex:-1,containerId:nc,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:ao,disabled:{draggable:!1,droppable:!1}});function ac(e){let{children:t,id:r,items:n,strategy:o=ao,disabled:a=!1}=e;const{active:s,dragOverlay:l,droppableRects:f,over:h,measureDroppableContainers:d}=m0(),i=gn(nc,r),u=l.rect!==null,g=C.useMemo(()=>n.map(_=>typeof _=="object"&&"id"in _?_.id:_),[n]),p=s!=null,m=s?g.indexOf(s.id):-1,w=h?g.indexOf(h.id):-1,x=C.useRef(g),O=!x0(g,x.current),v=w!==-1&&m===-1||O,E=k0(a);Qt(()=>{O&&p&&d(g)},[O,g,p,d]),C.useEffect(()=>{x.current=g},[g]);const A=C.useMemo(()=>({activeIndex:m,containerId:i,disabled:E,disableTransforms:v,items:g,overIndex:w,useDragOverlay:u,sortedRects:w0(g,f),strategy:o}),[m,i,E.draggable,E.droppable,v,g,w,f,u,o]);return C.createElement(oc.Provider,{value:A},t)}const sc=e=>{let{id:t,items:r,activeIndex:n,overIndex:o}=e;return Fa(r,n,o).indexOf(t)},lc=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},C0={duration:200,easing:"ease"},ic="transform",S0=pn.Transition.toString({property:ic,duration:0,easing:"linear"}),_0={roleDescription:"sortable"};function E0(e){let{disabled:t,index:r,node:n,rect:o}=e;const[a,s]=C.useState(null),l=C.useRef(r);return Qt(()=>{if(!t&&r!==l.current&&n.current){const f=o.current;if(f){const h=Kr(n.current,{ignoreTransform:!0}),d={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(d.x||d.y)&&s(d)}}r!==l.current&&(l.current=r)},[t,r,n,o]),C.useEffect(()=>{a&&s(null)},[a]),a}function cc(e){let{animateLayoutChanges:t=lc,attributes:r,disabled:n,data:o,getNewIndex:a=sc,id:s,strategy:l,resizeObserverConfig:f,transition:h=C0}=e;const{items:d,containerId:i,activeIndex:u,disabled:g,disableTransforms:p,sortedRects:m,overIndex:w,useDragOverlay:x,strategy:O}=C.useContext(oc),v=T0(n,g),E=d.indexOf(s),A=C.useMemo(()=>({sortable:{containerId:i,index:E,items:d},...o}),[i,o,E,d]),_=C.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:M,node:k,isOver:y,setNodeRef:N}=v0({id:s,data:A,disabled:v.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...f}}),{active:I,activatorEvent:F,activeNodeRect:P,attributes:L,setNodeRef:$,listeners:S,isDragging:b,over:z,setActivatorNodeRef:U,transform:H}=p0({id:s,data:A,attributes:{..._0,...r},disabled:v.draggable}),Y=qg(N,$),B=!!I,X=B&&!p&&oo(u)&&oo(w),G=!x&&b,W=G&&X?H:null,me=X?W??(l??O)({rects:m,activeNodeRect:P,activeIndex:u,overIndex:w,index:E}):null,se=oo(u)&&oo(w)?a({id:s,items:d,activeIndex:u,overIndex:w}):E,pe=I?.id,ne=C.useRef({activeId:pe,items:d,newIndex:se,containerId:i}),ce=d!==ne.current.items,ve=t({active:I,containerId:i,isDragging:b,isSorting:B,id:s,index:E,items:d,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:h,wasDragging:ne.current.activeId!=null}),Se=E0({disabled:!ve,index:E,node:k,rect:M});return C.useEffect(()=>{B&&ne.current.newIndex!==se&&(ne.current.newIndex=se),i!==ne.current.containerId&&(ne.current.containerId=i),d!==ne.current.items&&(ne.current.items=d)},[B,se,i,d]),C.useEffect(()=>{if(pe===ne.current.activeId)return;if(pe!=null&&ne.current.activeId==null){ne.current.activeId=pe;return}const ie=setTimeout(()=>{ne.current.activeId=pe},50);return()=>clearTimeout(ie)},[pe]),{active:I,activeIndex:u,attributes:L,data:A,rect:M,index:E,newIndex:se,items:d,isOver:y,isSorting:B,isDragging:b,listeners:S,node:k,overIndex:w,over:z,setNodeRef:Y,setActivatorNodeRef:U,setDroppableNodeRef:N,setDraggableNodeRef:$,transform:Se??me,transition:ze()};function ze(){if(Se||ce&&ne.current.newIndex===E)return S0;if(!(G&&!Sa(F)||!h)&&(B||ve))return pn.Transition.toString({...h,property:ic})}}function T0(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 N0=[Ue.Down,Ue.Right,Ue.Up,Ue.Left],dc=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:o,droppableContainers:a,over:s,scrollableAncestors:l}}=t;if(N0.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=gh({collisionRect:n,droppableRects:o,droppableContainers:f});let d=Di(h,"id");if(d===s?.id&&h.length>1&&(d=h[1].id),d!=null){const i=a.get(r.id),u=a.get(d),g=u?o.get(u.id):null,p=u?.node.current;if(p&&g&&i&&u){const w=Rn(p).some((_,M)=>l[M]!==_),x=uc(i,u),O=A0(i,u),v=w||!x?{x:0,y:0}:{x:O?n.width-g.width:0,y:O?n.height-g.height:0},E={x:g.left,y:g.top};return v.x&&v.y?E:hn(E,v)}}}};function uc(e,t){return!wn(e)||!wn(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function A0(e,t){return!wn(e)||!wn(t)||!uc(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const O0=Object.freeze(Object.defineProperty({__proto__:null,SortableContext:ac,arrayMove:Fa,defaultAnimateLayoutChanges:lc,defaultNewIndexGetter:sc,hasSortableData:wn,rectSortingStrategy:ao,sortableKeyboardCoordinates:dc,useSortable:cc},Symbol.toStringTag,{value:"Module"})),M0=window.G7Core,fc=({file:e,onRemove:t,onRetry:r,onImageClick:n,onDownload:o,isPrimary:a,onPrimaryClick:s})=>{const{attributes:l,listeners:f,setNodeRef:h,transform:d,transition:i,isDragging:u}=cc({id:"hash"in e?e.hash:e.id}),g={transform:pn.Transform.toString(d),transition:i,opacity:u?.5:1},p="status"in e&&e.status!==void 0,m=p?e.status:"done",w=m==="uploading",x=m==="compressing",O=m==="error",v=p?e.progress:100,E=p?e.preview:void 0,A=p?e.mime_type?.startsWith("image/")??!1:e.is_image,[_,M]=C.useState(void 0),k=!p&&A?e.download_url:void 0;C.useEffect(()=>{if(!k){M(void 0);return}let N=!0,I;return(async()=>{try{const P=await M0.api.get(k,{responseType:"blob"});N&&P&&(I=URL.createObjectURL(P),M(I))}catch(P){console.error("Failed to load authenticated image:",P)}})(),()=>{N=!1,I&&URL.revokeObjectURL(I)}},[k]);const y=_;return c.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:[c.jsxs(j,{className:`aspect-square w-full flex items-center justify-center bg-gray-50 dark:bg-gray-900 relative ${A||!p?"cursor-pointer":""}`,onClick:()=>{w||x||(A&&n?n():!p&&o&&o())},children:[E||y?c.jsx(zt,{src:E||y,alt:e.original_filename,className:"w-full h-full object-cover"}):c.jsx(Ot,{className:`fa-solid ${ki(e.mime_type)} text-4xl text-gray-400 dark:text-gray-500`}),(w||x)&&c.jsxs(j,{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center",children:[c.jsx(j,{className:"w-3/4 h-2 bg-gray-700 rounded-full overflow-hidden",children:c.jsx(j,{className:"h-full bg-blue-500 transition-all",style:{width:`${v}%`}})}),c.jsxs(re,{className:"text-white text-xs mt-1",children:[v,"%"]})]}),O&&c.jsx(j,{className:"absolute inset-0 bg-red-500/50 flex items-center justify-center",children:c.jsx(Ot,{className:"fa-solid fa-exclamation-triangle text-2xl text-white"})}),s&&c.jsx(J,{type:"button",onClick:N=>{N.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:nt(a?"attachment.primary_image":"attachment.set_as_primary"),children:c.jsx(Ot,{className:"fa-solid fa-star text-xs"})}),c.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:[c.jsx(J,{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:nt("attachment.drag_to_reorder"),onClick:N=>N.stopPropagation(),children:c.jsx(Ot,{className:"fa-solid fa-grip-vertical text-sm"})}),!p&&o&&c.jsx(J,{type:"button",onClick:N=>{N.stopPropagation(),o()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-blue-500 hover:bg-white",title:nt("common.download"),children:c.jsx(Ot,{className:"fa-solid fa-download text-sm"})}),O&&r&&c.jsx(J,{type:"button",onClick:N=>{N.stopPropagation(),r()},className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-orange-500 hover:bg-white",title:nt("common.retry"),children:c.jsx(Ot,{className:"fa-solid fa-arrow-rotate-right text-sm"})}),c.jsx(J,{type:"button",onClick:N=>{N.stopPropagation(),t()},disabled:w||x,className:"p-1.5 bg-white/90 dark:bg-gray-800/90 rounded text-red-500 hover:bg-white disabled:opacity-50",title:nt("common.delete"),children:c.jsx(Ot,{className:"fa-solid fa-times text-sm"})})]})]}),c.jsxs(j,{className:`p-2 ${!p&&o?"cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-700":""}`,onClick:()=>{!p&&o&&o()},children:[c.jsx(Ut,{className:"text-xs font-medium text-gray-900 dark:text-white truncate",title:e.original_filename,children:e.original_filename}),c.jsx(Ut,{className:"text-xs text-gray-500 dark:text-gray-400",children:e.size_formatted})]})]})},gc=({allItems:e,canAddMore:t,totalCount:r,maxFiles:n,maxSize:o,accept:a,onRemove:s,onRetry:l,onImageClick:f,onDownload:h,onDragEnd:d,onAddClick:i,enablePrimarySelection:u,primaryFileId:g,onPrimaryChange:p})=>{const m=dh(Ai(Ia,{activationConstraint:{distance:8}}),Ai(Oa,{coordinateGetter:dc}));return c.jsxs(j,{className:"p-3",children:[c.jsx(f0,{sensors:m,collisionDetection:fh,onDragEnd:d,children:c.jsx(ac,{items:e.map(w=>"hash"in w?w.hash:w.id),strategy:ao,children:c.jsxs(j,{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-3",children:[e.map(w=>{const x="hash"in w,O=x?w.is_image:w.mime_type?.startsWith("image/")??!1;return c.jsx(fc,{file:w,onRemove:()=>s(w),onRetry:"status"in w&&w.status==="error"?()=>l(w):void 0,onImageClick:O?()=>f(w):void 0,onDownload:x?()=>h(w):void 0,isPrimary:u&&x&&(w.hash||w.id)===g,onPrimaryClick:u&&x?()=>p?.(w.hash||w.id):void 0},x?w.hash:w.id)}),t&&c.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:[c.jsx(Ot,{className:"fa-solid fa-plus text-2xl text-gray-400 dark:text-gray-500 mb-1"}),c.jsx(re,{className:"text-xs text-gray-500 dark:text-gray-400",children:nt("common.add")})]})]})})}),c.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:[c.jsx(re,{children:nt("attachment.attached_count",{count:r,max:n})}),c.jsxs(re,{children:[nt("attachment.max_size",{size:o}),a&&` (${a})`]})]})]})},I0=[],D0=[],so=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=D0,autoUpload:d=!0,onFilesChange:i,onChange:u,onUploadComplete:g,onUploadError:p,onRemove:m,onReorder:w,initialFiles:x=I0,className:O="",confirmBeforeRemove:v=!1,confirmRemoveTitle:E,confirmRemoveMessage:A,apiEndpoints:_,uploadParams:M,enablePrimarySelection:k=!1,primaryFileId:y,onPrimaryChange:N,id:I,editorAttrs:F},P)=>{const L={upload:_?.upload??"/api/attachments",delete:_?.delete??"/api/attachments/:id",reorder:_?.reorder??"/api/attachments/reorder"},$=C.useRef(u??i);$.current=u??i;const S=C.useCallback(H=>{const Y=$.current;if(!Y)return;Y({target:{value:H,files:H},preventDefault:()=>{},stopPropagation:()=>{}})},[]),b=Ci({attachmentableType:t,attachmentableId:r,collection:n,maxFiles:o,maxSize:a,maxConcurrentUploads:s,accept:l,imageCompression:f,roleIds:h,autoUpload:d,initialFiles:x,endpoints:L,onFilesChange:S,onUploadComplete:g,onUploadError:p,onRemove:m,onReorder:w,uploadTriggerEvent:e,confirmBeforeRemove:v,uploadParams:M});C.useImperativeHandle(P,()=>({uploadAll:b.handleUploadAll,clear:b.clear,getPendingFiles:b.getPendingFiles}));const z=C.useMemo(()=>b.imageFiles.map(H=>{const Y=!("hash"in H),B=H,X=H;return Y?{src:B.preview||"",filename:B.original_filename,title:B.original_filename,downloadRequiresAuth:!1}:{src:b.authenticatedImageUrls.get(X.id)||X.download_url,downloadUrl:X.download_url,filename:X.original_filename,title:X.original_filename,downloadRequiresAuth:!0}}),[b.imageFiles,b.authenticatedImageUrls]),U=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 c.jsx(ii,{value:U,children:c.jsxs(j,{id:I,className:O,...F,children:[c.jsx(Si,{isDragOver:b.isDragOver,canAddMore:b.canAddMore,onFiles:b.handleFiles,setIsDragOver:b.setIsDragOver,inputRef:b.inputRef,accept:l,maxFiles:o,maxSize:a,children:b.hasFiles&&c.jsx(gc,{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:k,primaryFileId:y,onPrimaryChange:N})}),v&&c.jsx(pa,{isOpen:b.confirmDialogOpen,onClose:()=>{b.isDeleting||b.setConfirmDialogOpen(!1)},title:E??nt("attachment.delete_confirm_title"),message:A??nt("attachment.delete_confirm_message"),confirmText:nt("common.delete"),confirmButtonVariant:"danger",onConfirm:()=>{b.itemToDelete&&b.executeRemoveAttachment(b.itemToDelete)},isLoading:b.isDeleting,loadingText:nt("attachment.deleting")}),z.length>0&&b.galleryOpen&&c.jsx(Hr,{images:z,isOpen:!0,onClose:()=>b.setGalleryOpen(!1),startIndex:b.galleryStartIndex,showDownload:!0},`gallery-${b.galleryKeyRef.current}`)]})})});so.displayName="FileUploader";const P0=Object.freeze(Object.defineProperty({__proto__:null,FileDropZone:Si,FileList:gc,FileUploader:so,FileUploaderProvider:ii,SortableThumbnailItem:fc,default:so,extractErrorMessage:xi,fileUploaderT:nt,formatFileSize:Zn,getFileIcon:ki,useFileUploader:Ci,useFileUploaderContext:Hg},Symbol.toStringTag,{value:"Module"})),hc=({provider:e,className:t="w-5 h-5"})=>{switch(e){case"google":return c.jsxs("svg",{className:t,viewBox:"0 0 24 24",children:[c.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"}),c.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"}),c.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"}),c.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 c.jsx("svg",{className:t,viewBox:"0 0 24 24",children:c.jsx("path",{fill:"currentColor",d:"M16.273 12.845L7.376 0H0v24h7.727V11.155L16.624 24H24V0h-7.727z"})});case"kakao":return c.jsx("svg",{className:t,viewBox:"0 0 24 24",children:c.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 c.jsx("svg",{className:t,viewBox:"0 0 24 24",children:c.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 c.jsx("svg",{className:t,viewBox:"0 0 24 24",children:c.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}},pc=(e,t)=>window.G7Core?.t?.(e,t)??e,L0=[{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"}],mc=({providers:e=["google","naver","kakao"],mode:t="login",variant:r="full",className:n="",id:o,editorAttrs:a})=>{const s=h=>{const d=encodeURIComponent(window.location.href);window.location.href=`/api/auth/${h}?redirect=${d}`},l=h=>t==="register"?pc("auth.social.register_with",{provider:h}):pc("auth.social.login_with",{provider:h}),f=L0.filter(h=>e.includes(h.id));return r==="icon"?c.jsx(j,{className:`flex justify-center gap-4 ${n}`,id:o,...a,children:f.map(h=>c.jsx(J,{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:c.jsx(hc,{provider:h.id,className:"w-5 h-5"})},h.id))}):c.jsx(j,{className:`space-y-3 ${n}`,id:o,...a,children:f.map(h=>c.jsxs(J,{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:[c.jsx(hc,{provider:h.id,className:"w-5 h-5"}),c.jsx(re,{children:l(h.name)})]},h.id))})},F0=Object.freeze(Object.defineProperty({__proto__:null,default:mc},Symbol.toStringTag,{value:"Module"})),$0=(e,t)=>window.G7Core?.t?.(e,t)??e,U0={success:rt.CheckCircle,error:rt.XCircle,warning:rt.ExclamationTriangle,info:rt.InfoCircle},bc={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"}},z0={"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"},$a=({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 d=new Map(h);return d.set(l.id,!0),d});const f=l.duration||r;f>0&&setTimeout(()=>{s(l.id)},f)})},[e,r,s,o]),!e||e.length===0?null:c.jsx(j,{className:`fixed z-[9999] flex flex-col gap-2 ${z0[t]}`,"aria-live":"polite","aria-atomic":"true",children:e.map(l=>c.jsx(H0,{toast:l,position:t,isVisible:o.get(l.id)??!0,onClose:()=>s(l.id)},l.id))})},H0=({toast:e,position:t,isVisible:r,onClose:n})=>{const o=bc[e.type]||bc.info,a=e.icon?e.icon:U0[e.type],s=t.startsWith("bottom")?"translate-y-2":"-translate-y-2";return c.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:[c.jsx(ge,{name:a,className:`w-5 h-5 flex-shrink-0 ${o.text}`}),c.jsx(re,{className:`flex-1 text-sm font-medium ${o.text}`,children:e.message}),c.jsx(J,{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":$0("common.close"),children:c.jsx(ge,{name:rt.Times,className:"w-4 h-4"})})]})},G0=Object.freeze(Object.defineProperty({__proto__:null,Toast:$a,default:$a},Symbol.toStringTag,{value:"Module"})),j0=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)},Ua=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){j0.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{n(s)})},[]),r?c.jsxs(j,{className:`fixed top-0 left-0 right-0 z-50 ${e}`,style:t,role:"progressbar","aria-label":"페이지 로딩 중",children:[c.jsx(j,{className:"h-1 bg-gradient-to-r from-blue-500 via-blue-600 to-blue-500 animate-pulse",children:c.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"}})}),c.jsx("style",{children:`
@keyframes loading {
0% {
transform: translateX(-100%);
}
50% {
transform: translateX(300%);
}
100% {
transform: translateX(-100%);
}
}
`})]}):null},B0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionIndicator:Ua,default:Ua},Symbol.toStringTag,{value:"Module"})),yc=window.G7Core?.createLogger?.("Comp:PageTransitionBlur")??{log:(...e)=>console.log("[Comp:PageTransitionBlur]",...e),warn:(...e)=>console.warn("[Comp:PageTransitionBlur]",...e)},za=({className:e="",style:t})=>{const[r,n]=C.useState(!1);return C.useEffect(()=>{const o=window.G7Core?.TransitionManager;if(!o){yc.warn("TransitionManager를 찾을 수 없습니다.");return}return n(o.getIsPending()),o.subscribe(s=>{yc.log("isPending changed:",s),n(s)})},[]),r?c.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},W0=Object.freeze(Object.defineProperty({__proto__:null,PageTransitionBlur:za,default:za},Symbol.toStringTag,{value:"Module"})),vc={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},wc=new Set(["hidden","block","inline-block","inline","flex","inline-flex","grid","inline-grid","table","table-row","table-cell","contents","list-item","flow-root"]),K0=new Set(["Div","Flex","Grid","Section","Article","Nav","Aside","Main","Header","Footer","Fragment","Form","Container"]),V0=new Set(["H1","H2","H3","H4","H5","H6","P","Span","Label","A","Strong","Em","Small","Badge"]),Y0=new Set(["Input","Textarea","Select","Checkbox","Radio","Toggle","DatePicker","TagInput","SearchBar"]),X0=new Set(["Img","Image","Avatar","AvatarUploader","ImageGallery","ProductImageViewer","FileUploader"]),xc={DataGrid:(e,t)=>c.jsxs("div",{className:"w-full border border-gray-200 dark:border-gray-700 rounded-lg overflow-hidden",children:[c.jsx("div",{className:`h-10 bg-gray-100 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 ${e}`,children:c.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[c.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-24 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-20 bg-gray-300 dark:bg-gray-600 rounded"}),c.jsx("div",{className:"h-3 w-16 bg-gray-300 dark:bg-gray-600 rounded"})]})}),Array.from({length:t},(r,n)=>c.jsx("div",{className:`h-12 border-b border-gray-100 dark:border-gray-800 ${e}`,style:{animationDelay:`${n*75}ms`},children:c.jsxs("div",{className:"flex items-center h-full px-4 gap-8",children:[c.jsx("div",{className:"h-3 w-12 bg-gray-200 dark:bg-gray-700 rounded"}),c.jsx("div",{className:"h-3 flex-1 bg-gray-200 dark:bg-gray-700 rounded"}),c.jsx("div",{className:"h-3 w-16 bg-gray-100 dark:bg-gray-800 rounded"}),c.jsx("div",{className:"h-3 w-14 bg-gray-100 dark:bg-gray-800 rounded"})]})},n))]}),Pagination:e=>c.jsx("div",{className:"flex justify-center gap-1.5 py-3",children:Array.from({length:5},(t,r)=>c.jsx("div",{className:`w-8 h-8 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),Tabs:e=>c.jsxs("div",{children:[c.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)=>c.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),c.jsx("div",{className:`h-32 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]}),TabNavigation:e=>c.jsx("div",{className:"flex gap-4 border-b border-gray-200 dark:border-gray-700 pb-2",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-4 w-20 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))}),ProductCard:e=>c.jsxs("div",{className:"rounded-lg overflow-hidden",children:[c.jsx("div",{className:`h-48 w-full bg-gray-200 dark:bg-gray-700 ${e}`}),c.jsxs("div",{className:"p-3 space-y-2",children:[c.jsx("div",{className:`h-3.5 w-3/4 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),c.jsx("div",{className:`h-4 w-1/3 bg-gray-300 dark:bg-gray-600 rounded ${e}`})]})]}),UserInfo:e=>c.jsx("div",{className:`h-3 w-14 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),QuantitySelector:e=>c.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=>c.jsx("header",{className:"bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700",children:c.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:c.jsxs("div",{className:"flex items-center justify-between h-16",children:[c.jsxs("div",{className:"flex items-center gap-8",children:[c.jsx("div",{className:`h-8 w-24 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),c.jsx("div",{className:"hidden lg:flex items-center gap-6",children:Array.from({length:4},(t,r)=>c.jsx("div",{className:`h-3.5 w-16 bg-gray-200 dark:bg-gray-700 rounded ${e}`},r))})]}),c.jsx("div",{className:"flex items-center gap-4",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-8 w-8 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))})]})})}),Footer:e=>c.jsx("footer",{className:"bg-white dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 mt-auto",children:c.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:c.jsxs("div",{className:"flex flex-col items-center gap-4",children:[c.jsx("div",{className:`h-4 w-32 bg-gray-200 dark:bg-gray-700 rounded ${e}`}),c.jsx("div",{className:`h-3 w-48 bg-gray-100 dark:bg-gray-800 rounded ${e}`}),c.jsx("div",{className:"flex gap-3",children:Array.from({length:3},(t,r)=>c.jsx("div",{className:`h-6 w-6 bg-gray-200 dark:bg-gray-700 rounded-full ${e}`},r))}),c.jsx("div",{className:`h-3 w-40 bg-gray-100 dark:bg-gray-800 rounded ${e}`})]})})}),Modal:()=>c.jsx(c.Fragment,{}),Toast:()=>c.jsx(c.Fragment,{}),ConfirmDialog:()=>c.jsx(c.Fragment,{})};function Z0(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=>!kc(o.if));return n.length>1&&q0(n)?[...r,Cc(n)]:[...r,...n]}if(t.length>1&&r.length===0){const n=t.filter(o=>!kc(o.if));return n.length===0?[]:n.length===1?n:[Cc(n)]}return e}function kc(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 q0(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 Cc(e){return e.reduce((t,r)=>Ha(r)>Ha(t)?r:t)}function Ha(e){return e.children?e.children.length+e.children.reduce((t,r)=>t+Ha(r),0):0}function Q0(e){return e.includes("{{")?e.replace(/\{\{([^}]+)\}\}/g,(t,r)=>{const n=r.match(/\?[\s]*['"]([^'"]*)['"]\s*:\s*['"]/);return n?n[1]:""}):e}function Ga(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 J0(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 d=r.wrap||"nowrap",i={wrap:"flex-wrap",nowrap:"flex-nowrap","wrap-reverse":"flex-wrap-reverse"};i[d]&&n.push(i[d]),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 R0(e){switch(e){case"pulse":return"animate-pulse";case"wave":return"animate-pulse";case"none":return"";default:return"animate-pulse"}}function lo(e,t,r,n){return!e||e.length===0?[]:Z0(e).map((a,s)=>Sc(a,t,r,s,n))}function ep(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 tp(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[,d,i]=h;if(wc.has(i)){n.push({breakpoint:vc[d]||0,display:i});continue}(vc[d]||0)<=t&&o.push(i);continue}if(wc.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 rp(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 Sc(e,t,r,n,o){const{name:a,children:s,iteration:l}=e,f=ep(e,o),h=J0(e),d=h?`${h} ${f}`.trim():f,i=Q0(d),u=tp(i,o);if(!a||!u.visible)return null;const g=u.className;if(l)return c.jsx(C.Fragment,{children:Array.from({length:r},(m,w)=>Sc({...e,iteration:void 0},t,r,w,o))},n);if(xc[a])return c.jsx("div",{className:g,children:xc[a](t,r)},n);if(K0.has(a)){const m=Ga(g,a);if(!s||s.length===0){const E=/\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 c.jsx("div",{className:E},n)}const w=lo(s,t,r,o);if(!(w.length>0&&w.some(v=>v!==null)))return null;const O=rp(m);return c.jsx("div",{className:O.className,style:O.style,children:w},n)}const p=Ga(g,a);if(V0.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"},w={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"},x=m[a]||"h-3.5",O=w[a]||"w-full",v=a.startsWith("H")?"mb-2 mt-1":"mb-1.5";return c.jsx("div",{className:`${x} ${O} bg-gray-200 dark:bg-gray-700 rounded ${t} ${v} ${p}`.trim()},n)}if(Y0.has(a))return a==="Textarea"?c.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"?c.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n):c.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(X0.has(a))return a==="Avatar"||a==="AvatarUploader"?c.jsx("div",{className:`h-10 w-10 bg-gray-200 dark:bg-gray-700 rounded-full ${t}`},n):a==="ProductImageViewer"?c.jsx("div",{className:`h-80 w-full bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):c.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=Ga(g,a),w=lo(s,t,r,o);if(!(w.length>0&&w.some(E=>E!==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 c.jsx("div",{className:`${m} ${v}`.trim(),children:w},n)}return c.jsx("div",{className:`h-9 w-24 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n)}return a==="Icon"?c.jsx("div",{className:`h-5 w-5 bg-gray-200 dark:bg-gray-700 rounded ${t}`},n):s&&s.length>0?c.jsx("div",{className:p,children:lo(s,t,r,o)},n):c.jsx("div",{className:`h-3.5 w-full bg-gray-200 dark:bg-gray-700 rounded mb-1.5 ${t}`},n)}const ja=({components:e,options:t})=>{const r=R0(t.animation),o=window.G7Core?.useResponsive,a=o?.(),s=a?a.width:typeof window<"u"?window.innerWidth:1024;return c.jsx("div",{className:"w-full",role:"status","aria-busy":"true","aria-label":"Loading...",children:lo(e,r,t.iteration_count,s)})},np=Object.freeze(Object.defineProperty({__proto__:null,PageSkeleton:ja,default:ja},Symbol.toStringTag,{value:"Module"})),op=(e,t)=>window.G7Core?.t?.(e,t)??e,_c=({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 c.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:[c.jsx("div",{style:{width:"32px",height:"32px",border:`3px solid ${n}`,borderTopColor:"transparent",borderRadius:"50%",animation:"g7-spin 0.8s linear infinite"}}),c.jsx("span",{style:{color:o,fontSize:"14px"},children:e?.text||op("nav.loading")})]})},ap=Object.freeze(Object.defineProperty({__proto__:null,default:_c},Symbol.toStringTag,{value:"Module"})),Vr=(e,t)=>window.G7Core?.t?.(e,t)??e,Ec=({currentPage:e,totalPages:t,onPageChange:r,maxVisiblePages:n=5,showFirstLast:o=!0,className:a="",style:s,prevText:l,nextText:f,id:h,editorAttrs:d})=>{const i=C.useMemo(()=>{const m=[];if(t<=n+2)for(let w=1;w<=t;w++)m.push(w);else{const w=Math.floor(n/2);let x=Math.max(2,e-w),O=Math.min(t-1,e+w);e<=w+1?O=n:e>=t-w&&(x=t-n+1),m.push(1),x>2&&m.push("...");for(let v=x;v<=O;v++)m.push(v);O<t-1&&m.push("..."),t>1&&m.push(t)}return m},[e,t,n]),u=m=>{m<1||m>t||m===e||r(m)},g=()=>{e>1&&r(e-1)},p=()=>{e<t&&r(e+1)};return c.jsxs(j,{className:`flex items-center gap-2 ${a}`,style:s,role:"navigation","aria-label":Vr("common.pagination"),id:h,...d,children:[o&&c.jsx(J,{onClick:()=>u(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:"«"}),c.jsx(J,{onClick:g,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:l||c.jsx(c.Fragment,{children:"‹"})}),c.jsx(j,{className:"flex items-center gap-1",children:i.map((m,w)=>{if(m==="...")return c.jsx(re,{className:"px-3 py-1 text-sm text-gray-500 dark:text-gray-400",children:"..."},`ellipsis-${w}`);const x=m,O=x===e;return c.jsx(J,{onClick:()=>u(x),className:`px-3 py-1 text-sm border rounded ${O?"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:x}),"aria-current":O?"page":void 0,children:x},x)})}),c.jsx(J,{onClick:p,disabled:e===t,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:f||c.jsx(c.Fragment,{children:"›"})}),o&&c.jsx(J,{onClick:()=>u(t),disabled:e===t,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:"»"})]})},sp=Object.freeze(Object.defineProperty({__proto__:null,Pagination:Ec},Symbol.toStringTag,{value:"Module"})),Tc=(e,t)=>window.G7Core?.t?.(e,t)??e,Nc=({name:e="search",placeholder:t,value:r,onChange:n,onSubmit:o,showButton:a=!1,suggestions:s=[],onSuggestionClick:l,showSuggestions:f=!1,className:h="",style:d,id:i,editorAttrs:u})=>{const g=t??Tc("common.search_placeholder"),[p,m]=C.useState(""),[w,x]=C.useState(!1),O=C.useRef(null),v=C.useRef(""),E=r!==void 0?r:p,A=f&&w&&s.length>0&&E.length>0;C.useEffect(()=>{r!==void 0&&(v.current=r)},[r]);const _=y=>{const N=y.target.value;m(N),n?.(y),v.current!==""&&N===""&&!y.nativeEvent.inputType&&setTimeout(()=>{const I=O.current?.querySelector("form");I&&I.requestSubmit()},0),v.current=N},M=y=>{m(y.text);const N={target:{value:y.text,name:e}};n?.(N),l?.(y),x(!1)},k=y=>{y.preventDefault(),o?.(y)};return c.jsxs(j,{ref:O,className:`relative ${h}`,style:d,id:i,...u,children:[c.jsx(Co,{onSubmit:k,className:"relative",children:c.jsxs(j,{className:`relative flex items-center ${a?"gap-2":""}`,children:[c.jsxs(j,{className:"relative flex-1",children:[c.jsx(j,{className:"absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none",children:c.jsx(ge,{name:rt.Search,className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),c.jsx(Et,{type:"search",name:e,value:E,onChange:_,onFocus:()=>x(!0),onBlur:()=>setTimeout(()=>x(!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&&c.jsx(J,{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:Tc("common.search")})]})}),A&&c.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=>c.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:()=>M(y),children:c.jsxs(j,{className:"flex items-center gap-2",children:[c.jsx(ge,{name:rt.Search,className:"w-4 h-4 text-gray-400 dark:text-gray-500"}),c.jsx(re,{className:"text-sm text-gray-700 dark:text-gray-300",children:y.text})]})},y.id))})]})},lp=Object.freeze(Object.defineProperty({__proto__:null,SearchBar:Nc},Symbol.toStringTag,{value:"Module"})),St=window.G7Core,ip={sm:"md",md:"lg",lg:"xl",xl:"2xl","2xl":"3xl"};function Ba({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:d="image/*",maxSize:i=5,className:u="",uploadButtonText:g,deleteButtonText:p,readOnly:m=!1,confirmDelete:w=!0,deleteConfirmMessage:x,confirmUpload:O=!0,uploadConfirmMessage:v,uploadSuccessActions:E,uploadErrorActions:A,deleteSuccessActions:_,deleteErrorActions:M,id:k,editorAttrs:y}){const N=C.useRef(null),[I,F]=C.useState(!1),[P,L]=C.useState(!1),[$,S]=C.useState(void 0),[b,z]=C.useState(null),[U,H]=C.useState(!1),[Y,B]=C.useState(!1),[X,G]=C.useState(null),[W,Q]=C.useState(null),me=C.useRef(`avatar-upload-${Math.random().toString(36).slice(2,11)}`).current;C.useEffect(()=>{if(X){const te=URL.createObjectURL(X);return Q(te),()=>URL.revokeObjectURL(te)}else Q(null)},[X]);const se=C.useCallback(te=>St?.t?.(te)??te,[]),pe=C.useCallback(()=>{const te=document.cookie.match(/XSRF-TOKEN=([^;]+)/);return te?decodeURIComponent(te[1]):null},[]),ne=C.useCallback(()=>St?.api?.getToken?.()??null,[]),ce=C.useCallback(async te=>{B(!1),G(null),F(!0),z(null);try{const ae=new FormData;ae.append("avatar",te);const be=pe(),Me=ne(),Xe=await fetch(n,{method:"POST",headers:{Accept:"application/json",...be&&{"X-XSRF-TOKEN":be},...Me&&{Authorization:`Bearer ${Me}`}},credentials:"include",body:ae});if(!Xe.ok){const Oe=await Xe.json().catch(()=>({}));throw new Error(Oe.message||se("attachment.upload_failed"))}const Fe=await Xe.json(),Ve=Fe.data||Fe;Ve.avatar&&S(Ve.avatar),a?.(Ve),St?.toast?.success?.(se("mypage.profile.avatar_uploaded")),E?.length?E.forEach(Oe=>St?.dispatch?.(Oe)):St?.refetchDataSource?.("user")}catch(ae){const be=ae instanceof Error?ae:new Error(String(ae));z(be.message),s?.(be),St?.toast?.error?.(be.message),A?.length&&A.forEach(Me=>St?.dispatch?.(Me))}finally{F(!1),N.current&&(N.current.value="")}},[n,a,s,pe,ne,se]),ve=C.useCallback(async te=>{const ae=te.target.files?.[0];if(!ae)return;z(null);const be=i*1024*1024;if(ae.size>be){const Me=new Error(se("attachment.file_too_large").replace(":max",`${i}MB`));z(Me.message),s?.(Me),St?.toast?.error?.(Me.message);return}if(d&&!ae.type.match(d.replace("*",".*"))){const Me=new Error(se("attachment.invalid_file_type"));z(Me.message),s?.(Me),St?.toast?.error?.(Me.message);return}O?(G(ae),B(!0)):ce(ae)},[i,d,s,O,ce,se]),Se=C.useCallback(async()=>{H(!1),L(!0),z(null);try{const te=pe(),ae=ne(),be=await fetch(o,{method:"DELETE",headers:{Accept:"application/json","Content-Type":"application/json",...te&&{"X-XSRF-TOKEN":te},...ae&&{Authorization:`Bearer ${ae}`}},credentials:"include"});if(!be.ok){const Me=await be.json().catch(()=>({}));throw new Error(Me.message||se("attachment.delete_failed"))}S(null),l?.(),St?.toast?.success?.(se("mypage.profile.avatar_deleted")),_?.length?_.forEach(Me=>St?.dispatch?.(Me)):St?.refetchDataSource?.("user")}catch(te){const ae=te instanceof Error?te:new Error(String(te));z(ae.message),f?.(ae),St?.toast?.error?.(ae.message),M?.length&&M.forEach(be=>St?.dispatch?.(be))}finally{L(!1)}},[o,l,f,pe,ne,se]),ze=C.useCallback(()=>{w?H(!0):Se()},[w,Se]),ie=C.useCallback(()=>{H(!1)},[]),De=C.useCallback(()=>{B(!1),G(null),N.current&&(N.current.value="")},[]),Ae=C.useCallback(()=>{X&&ce(X)},[X,ce]),ke=$===void 0?e:$,je=!!ke,$e=ip[r]||"lg",K=U||Y,oe=()=>c.jsxs(j,{className:"flex items-center justify-center gap-2",children:[c.jsx(Et,{ref:N,id:me,type:"file",accept:d,className:"hidden",onChange:ve,disabled:I}),!je&&c.jsxs(Nr,{htmlFor:me,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 ${I?"opacity-50 cursor-not-allowed":""}`,children:[I?c.jsx(ge,{name:"spinner",size:"sm",className:"animate-spin"}):c.jsx(ge,{name:"image",size:"sm"}),c.jsx(re,{children:g||se("mypage.profile.register_avatar")})]}),je&&c.jsxs(c.Fragment,{children:[c.jsxs(Nr,{htmlFor:me,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 ${I?"opacity-50 cursor-not-allowed":""}`,children:[I?c.jsx(ge,{name:"spinner",size:"sm",className:"animate-spin"}):c.jsx(ge,{name:"upload",size:"sm"}),c.jsx(re,{children:g||se("common.change")})]}),h&&c.jsxs(J,{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:ze,disabled:P,children:[P?c.jsx(ge,{name:"spinner",size:"sm",className:"animate-spin"}):c.jsx(ge,{name:"trash-2",size:"sm"}),c.jsx(re,{children:p||se("common.delete")})]})]})]});return c.jsxs(j,{className:`flex flex-col items-center gap-3 ${u}`,id:k,...y,children:[Y&&W?c.jsxs(j,{className:"relative",children:[c.jsx(zt,{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"}`}),c.jsx(j,{className:"absolute inset-0 rounded-full bg-blue-500/20 border-2 border-blue-500 border-dashed"})]}):c.jsx(Jr,{avatar:ke||void 0,name:t,size:$e}),!m&&c.jsxs(j,{className:"w-[220px] flex flex-col items-center gap-2",children:[Y&&X&&c.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:[c.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[c.jsx(ge,{name:"upload",size:"sm",className:"text-blue-600 dark:text-blue-400 shrink-0"}),c.jsx(re,{className:"text-sm font-medium text-blue-800 dark:text-blue-300",children:v||se("mypage.profile.upload_avatar_confirm")})]}),c.jsxs(j,{className:"text-xs text-blue-600 dark:text-blue-400 truncate mb-3",title:X.name,children:[X.name," (",(X.size/1024/1024).toFixed(2),"MB)"]}),c.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[c.jsxs(J,{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:Ae,disabled:I,children:[I?c.jsx(ge,{name:"spinner",size:"sm",className:"animate-spin"}):c.jsx(ge,{name:"check",size:"sm"}),c.jsx(re,{children:se("common.confirm")})]}),c.jsx(J,{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:De,children:c.jsx(re,{children:se("common.cancel")})})]})]}),U&&c.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:[c.jsxs(j,{className:"flex items-center gap-2 mb-2",children:[c.jsx(ge,{name:"alert-triangle",size:"sm",className:"text-red-600 dark:text-red-400 shrink-0"}),c.jsx(re,{className:"text-sm font-medium text-red-800 dark:text-red-300",children:x||se("mypage.profile.delete_avatar_confirm")})]}),c.jsxs(j,{className:"grid grid-cols-2 gap-2",children:[c.jsxs(J,{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:Se,disabled:P,children:[P?c.jsx(ge,{name:"spinner",size:"sm",className:"animate-spin"}):c.jsx(ge,{name:"trash-2",size:"sm"}),c.jsx(re,{children:se("common.delete")})]}),c.jsx(J,{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:ie,children:c.jsx(re,{children:se("common.cancel")})})]})]}),!K&&oe()]}),b&&!K&&c.jsxs(j,{className:"flex items-center gap-2 text-sm text-red-600 dark:text-red-400",children:[c.jsx(ge,{name:"alert-circle",size:"sm"}),c.jsx(re,{children:b})]})]})}const cp=Object.freeze(Object.defineProperty({__proto__:null,AvatarUploader:Ba,default:Ba},Symbol.toStringTag,{value:"Module"})),Ac=()=>window.G7Core,io=(e,t)=>window.G7Core?.t?.(e,t)??e,Oc={horizontal:"flex items-center gap-1.5",vertical:"flex flex-col items-start"},dp=()=>[{key:"view_profile",label:io("userinfo.view_profile"),icon:"user",path:"/users/{{userId}}"},{key:"view_posts",label:io("userinfo.view_posts"),icon:"file-lines",path:"/users/{{userId}}/posts"}],Wa=({text:e,title:t})=>e?c.jsx(re,{className:"text-sm text-gray-500 dark:text-gray-400",title:t,children:e}):null,Mc=({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:d="",layout:i="vertical",text:u,stopPropagation:g=!1,menuItems:p,hideMenuItems:m=[],appendMenuItems:w=[],id:x,editorAttrs:O})=>{const v=r??e?.uuid,E=a||e?.is_guest||!1,A=s||e?.status==="withdrawn",_=A?io("userinfo.withdrawn_user"):u??t??e?.name??"",[M,k]=C.useState(!1),[y,N]=C.useState({top:0,left:0}),I=C.useRef(null),F=C.useRef(null),P=C.useRef(null),L=h.replace("{userId}",String(v??"")),$=`${Oc[i]} ${d}`;C.useEffect(()=>{if(!M)return;const G=Q=>{const me=Q.target,se=I.current?.contains(me),pe=F.current?.contains(me);!se&&!pe&&k(!1)},W=()=>k(!1);return document.addEventListener("mousedown",G),window.addEventListener("scroll",W,!0),window.addEventListener("resize",W),()=>{document.removeEventListener("mousedown",G),window.removeEventListener("scroll",W,!0),window.removeEventListener("resize",W)}},[M]);const S=C.useCallback(()=>{if(p&&p.length>0)return p.filter(Q=>Q.show!==!1);let W=dp().filter(Q=>!m.includes(Q.key)&&Q.show!==!1);return w&&w.length>0&&(W=[...W,...w.filter(Q=>Q.show!==!1)]),W},[p,m,w]),b=C.useCallback(()=>{if(P.current){const G=P.current.getBoundingClientRect();N({top:G.bottom+4,left:G.left})}},[]),z=C.useCallback((G,W)=>{if(W.stopPropagation(),W.preventDefault(),k(!1),G.onClick)G.onClick();else if(G.path){const Q=G.path.replace(/\{\{userId\}\}/g,String(v??"")),me=Ac();me?.navigate?me.navigate(Q):window.location.href=Q}},[v]),U=C.useCallback(G=>{G.preventDefault(),g&&G.stopPropagation(),!(E||!v)&&(l?(M||b(),k(W=>!W)):f&&Ac()?.navigate?.(L))},[g,E,v,l,M,b,f,L]);if(E||!v)return c.jsxs(j,{className:$,id:x,...O,children:[c.jsxs(j,{className:"flex items-center gap-1.5 text-gray-400 dark:text-gray-500",children:[c.jsx(re,{children:_}),c.jsx(re,{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:io("userinfo.guest_badge")})]}),c.jsx(Wa,{text:n,title:o})]});if(A)return c.jsxs(j,{className:$,id:x,...O,children:[c.jsx(re,{className:"text-gray-400 dark:text-gray-500 line-through",children:_}),c.jsx(Wa,{text:n,title:o})]});const H=S(),B=/\btext-\S+/.test(d)?"":"text-gray-900 dark:text-white",X=l||f?`${B} hover:text-blue-600 dark:hover:text-blue-400 cursor-pointer font-medium`.trim():`${B} font-medium`.trim();return c.jsxs(j,{ref:I,className:`relative inline-block ${d}`,id:x,...O,children:[c.jsxs(j,{className:Oc[i],children:[c.jsx(J,{ref:P,onClick:U,className:X,children:_}),c.jsx(Wa,{text:n,title:o})]}),l&&M&&H.length>0&&or.createPortal(c.jsx(j,{ref:F,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:H.map(G=>c.jsxs(J,{onClick:W=>z(G,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-${G.key}`,children:[G.icon&&c.jsx(ge,{name:G.icon,className:"w-4 h-4"}),c.jsx(re,{children:G.label})]},G.key))}),document.body)]})},up=Object.freeze(Object.defineProperty({__proto__:null,UserInfo:Mc},Symbol.toStringTag,{value:"Module"})),Ic=({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 E=v.target.value,A=Number(E),_=typeof E=="string"&&E!==""&&!Number.isNaN(A)?A:E,M=e.find(k=>String(k.id)===String(_));M&&p(M)},w=s.length>0?e.filter(v=>!s.includes(v.id)):e;if(g)return c.jsx(j,{className:`relative ${o}`,style:a,id:f,...h,children:c.jsx(us,{value:t!==void 0?String(t):"",onChange:m,options:w.map(v=>({value:String(v.id),label:v.badge!==void 0?`${v.label} (${v.badge})`:v.label,disabled:v.disabled})),className:"w-full"})});const x=v=>{const E=v.id===t,A="flex items-center gap-2 px-3 py-2 font-medium text-sm transition-all shrink-0 whitespace-nowrap";if(v.disabled)return`${A} opacity-50 cursor-not-allowed text-gray-400 dark:text-gray-600`;switch(n){case"pills":return E?`${A} bg-blue-600 dark:bg-blue-500 text-white rounded-lg`:`${A} text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg`;case"underline":return E?`${A} text-gray-900 dark:text-white border-b-2 border-gray-900 dark:border-white`:`${A} 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 E?`${A} 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`:`${A} 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`}},O=n==="underline"?"flex gap-0 border-b border-gray-200 dark:border-gray-700":"flex gap-2";return c.jsx(j,{className:`relative ${o}`,style:a,id:f,...h,children:c.jsx(Qr,{className:O,children:w.map(v=>c.jsxs(J,{type:"button",onClick:()=>p(v),disabled:v.disabled,className:x(v),children:[v.iconName&&c.jsx(ge,{name:v.iconName,size:"sm"}),c.jsx(re,{children:v.label}),v.badge!==void 0&&c.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:c.jsx(re,{children:v.badge})})]},v.id))})})},fp=Object.freeze(Object.defineProperty({__proto__:null,TabNavigation:Ic},Symbol.toStringTag,{value:"Module"})),gp={Header:()=>Promise.resolve().then(()=>Md),Footer:()=>Promise.resolve().then(()=>Ld),MobileNav:()=>Promise.resolve().then(()=>Fd),SlotContainer:()=>Promise.resolve().then(()=>Ad),NotificationCenter:()=>Promise.resolve().then(()=>Od),ProductCard:()=>Promise.resolve().then(()=>yu),BrandMark:()=>Promise.resolve().then(()=>wu),ImageGallery:()=>Promise.resolve().then(()=>ei),ProductImageViewer:()=>Promise.resolve().then(()=>Ng),QuantitySelector:()=>Promise.resolve().then(()=>Ag),PostReactions:()=>Promise.resolve().then(()=>Ig),RichTextEditor:()=>Promise.resolve().then(()=>Dg),HtmlContent:()=>Promise.resolve().then(()=>Pg),HtmlEditor:()=>Promise.resolve().then(()=>Lg),ExpandableContent:()=>Promise.resolve().then(()=>Fg),FileUploader:()=>Promise.resolve().then(()=>P0),ConfirmDialog:()=>Promise.resolve().then(()=>zg),SocialLoginButtons:()=>Promise.resolve().then(()=>F0),Toast:()=>Promise.resolve().then(()=>G0),PageTransitionIndicator:()=>Promise.resolve().then(()=>B0),PageTransitionBlur:()=>Promise.resolve().then(()=>W0),PageSkeleton:()=>Promise.resolve().then(()=>np),PageLoading:()=>Promise.resolve().then(()=>ap),ThemeToggle:()=>Promise.resolve().then(()=>Sd),Pagination:()=>Promise.resolve().then(()=>sp),SearchBar:()=>Promise.resolve().then(()=>lp),Avatar:()=>Promise.resolve().then(()=>Td),AvatarUploader:()=>Promise.resolve().then(()=>cp),UserInfo:()=>Promise.resolve().then(()=>up),Modal:()=>Promise.resolve().then(()=>Ug),TabNavigation:()=>Promise.resolve().then(()=>fp)},hp=({id:e,className:t,style:r,children:n,editorAttrs:o})=>c.jsx(j,{id:e,className:t,style:r,...o,children:n}),pp=({id:e,children:t,cols:r=1,responsive:n,gap:o,rowGap:a,colGap:s,autoRows:l,autoCols:f,flow:h="row",className:d="",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 w={auto:"auto-rows-auto",min:"auto-rows-min",max:"auto-rows-max",fr:"auto-rows-fr"};p.push(w[l])}if(f){const w={auto:"auto-cols-auto",min:"auto-cols-min",max:"auto-cols-max",fr:"auto-cols-fr"};p.push(w[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]),d&&p.push(d),c.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:d,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 w={start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly"};g.push(w[n]);const x={start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"};return g.push(x[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),c.jsx(j,{id:e,className:g.join(" "),style:d,onClick:i,...u,children:t})},bp=({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:d=!1,className:i="",style:u,onClick:g,editorAttrs:p})=>{const m=[],w={none:"p-0",sm:"p-2",md:"p-4",lg:"p-6",xl:"p-8"};m.push(w[o]);const x={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(x[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 O={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg",xl:"shadow-xl"};return h!=="none"&&m.push(O[h]),d&&m.push("rounded-lg"),i&&m.push(i),c.jsxs(gs,{id:e,className:m.join(" "),style:u,onClick:g,...p,children:[(t||r)&&c.jsxs(j,{className:"mb-4",children:[t&&c.jsx(cs,{className:"text-2xl font-bold text-gray-900 dark:text-white",children:t}),r&&c.jsx(Ut,{className:"mt-1 text-sm text-gray-600 dark:text-gray-400",children:r})]}),n]})},yp=({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(),d={width:t,flexShrink:0},i={flex:1,minWidth:0},u={width:r,flexShrink:0};return c.jsxs(j,{id:e,className:h,style:l,...f,children:[c.jsx(j,{className:"flex flex-col",style:d,children:n}),c.jsx(j,{className:"flex flex-col",style:i,children:o}),c.jsx(j,{className:"flex flex-col",style:u,children:a})]})},vp={identifier:"sirsoft-basic",vendor:"sirsoft",name:{ko:"Basic",en:"Basic"},version:"1.0.4",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.0",dependencies:{modules:{"sirsoft-board":">=1.0.0","sirsoft-ecommerce":">=1.0.5","sirsoft-page":">=1.0.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",url:"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css",preconnect:"https://cdnjs.cloudflare.com"},{id:"pretendard",type:"webfont",url:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css",preconnect:"https://cdn.jsdelivr.net",crossorigin:"anonymous"}]},Dc={KRW:{locale:"ko-KR",decimals:0},USD:{locale:"en-US",decimals:2},JPY:{locale:"ja-JP",decimals:0},CNY:{locale:"zh-CN",decimals:2},EUR:{locale:"de-DE",decimals:2}};function Yr(e,t="KRW"){if(!Number.isFinite(e))return"0";const r=Dc[t]||Dc.KRW;try{return new Intl.NumberFormat(r.locale,{style:"currency",currency:t,minimumFractionDigits:r.decimals,maximumFractionDigits:r.decimals}).format(e)}catch{return e.toLocaleString()+(t==="KRW"?"원":"")}}function co(e,t,r=0){if(!e)return;const n=e.KRW?.value??e.KRW?.price??0,o={};for(const[a,s]of Object.entries(e)){const l=s?.value??s?.price??0;let f=0;r>0&&(a==="KRW"?f=r:n>0&&(f=r*l/n));const h=(l+f)*t;o[a]={value:h,formatted:Yr(h,a)}}return o}function uo(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:Yr(o,n)};return r}function Pc(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 fo(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function wp(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 xp(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 kp(e,t,r){return r.find(n=>!n?.option_values||!n?.is_active?!1:e.every(o=>{const a=fo(o),s=t?.[a];return wp(n.option_values,n.option_values_localized,a)===s}))}function Cp(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(A=>{const _=fo(A);return l?.[_]}))return;const h=kp(n,l,o??[]);if(!h){t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const d=n.map(A=>l[fo(A)]).join("_"),i=a??[];if(i.find(A=>A.id===d)){const A=window.G7Core;A?.toast?.warning?.(A?.t?.("sirsoft-ecommerce.shop.already_added_option")??"이미 추가된 옵션입니다."),t.setState?.({currentSelection:{},__mergeMode:"shallow"});return}const g=h.selling_price??0,p={};n.forEach(A=>{const _=fo(A);p[_]=l[_]});const m=r.additionalOptionGroups??[],w={};for(const A of m){if(!A.is_required)continue;const _=A.values?.find(M=>M.is_default);_&&(w[A.id]=_.id)}const x=Pc(w,m),O=g+x,v={id:d,optionId:h.id,options:p,optionValues:xp(h.option_values,h.option_values_localized),quantity:1,stock:h.stock_quantity??999,unitPrice:g,unitPriceFormatted:Yr(g,s),totalPrice:O,totalPriceFormatted:Yr(O,s),multiCurrencyUnitPrice:h.multi_currency_selling_price,multiCurrencyTotalPrice:co(h.multi_currency_selling_price,1,x),additionalOptionSelections:w,additionalOptionsTotal:x},E=[...i,v];t.setState?.({selectedOptionItems:E,selectedTotalMultiCurrency:uo(E),currentSelection:{},__mergeMode:"shallow"})}function Sp(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 d=f?.unitPrice??0,i=f?.additionalOptionsTotal??0,u=(d+i)*s;return{...f,quantity:s,totalPrice:u,totalPriceFormatted:Yr(u,o),multiCurrencyTotalPrice:co(f?.multiCurrencyUnitPrice,s,i)}});t.setState?.({selectedOptionItems:l,selectedTotalMultiCurrency:uo(l)})}function _p(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),d=(n??[]).map((i,u)=>{if(u!==s)return i;const g={...i.additionalOptionSelections??{}},p={...i.additionalOptionCustomTexts??{}};if(f){const v=String(r.customText??"");v.trim()===""?delete p[l]:p[l]=v}else h==null?(delete g[l],delete p[l]):(g[l]=h,(o??[]).find(A=>A.id===l)?.values?.find(A=>A.id===h)?.allow_custom_text||delete p[l]);const m=Pc(g,o),w=i?.unitPrice??0,x=i?.quantity??1,O=(w+m)*x;return{...i,additionalOptionSelections:g,additionalOptionCustomTexts:p,additionalOptionsTotal:m,totalPrice:O,totalPriceFormatted:Yr(O,a),multiCurrencyTotalPrice:co(i?.multiCurrencyUnitPrice,x,m)}});t.setState?.({selectedOptionItems:d,selectedTotalMultiCurrency:uo(d)})}function Ep(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:uo(o)})}function Tp(e,t){const r=e.params;if(!r)return;const n=Math.max(1,Number(r.newQuantity)||1);t.setState?.({noOptionQuantity:n,noOptionTotalMultiCurrency:co(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 Sr(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 Lc(){return window.G7Core?.state?.getLocal?.()||{}}function Np(){return window.G7Core?.state?.get?.()||{}}function Ap(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 Op(e){const t=window.G7Core;return t?.t?t.t(e):e}function Fc(){const e=window.G7Core;if(e?.dispatch){const r=Lc().selectedItems||[];e.dispatch({handler:"refetchDataSource",params:{dataSourceId:"cartItems"}}),xn.log("Refetching cartItems with selected_ids:",r)}else xn.warn("G7Core.dispatch not available")}function Mp(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=Np().cartItems?.data?.items||[],f=l.length>0&&a.length===l.length;Sr({selectedItems:a,allSelected:f,selectedCount:a.length}),Fc()}function Ip(e,t){const{allItemIds:r,isSelected:n}=e?.params||{};Sr({selectedItems:n?r:[],allSelected:n,selectedCount:n?r.length:0}),Fc()}function Dp(e,t){const{optionName:r,optionValue:n}=e?.params||{},a=Lc().selectedOptions||{};Sr({selectedOptions:{...a,[r]:n}})}function Pp(e,t){const{targetIds:r}=e?.params||{};if(!r||r.length===0){Ap(Op("shop.cart.select_items_to_delete"),"warning");return}Sr({deleteModal:{visible:!0,targetIds:r}})}function Lp(e,t){const{targetItem:r}=e?.params||{};Sr({optionModal:{visible:!0,targetItem:r},selectedOptions:r?.options||{},selectedQuantity:r?.quantity})}function Fp(e,t){const{selectedItems:r}=e?.params||{};if(!r||r.length===0){Sr({isCalculating:!1});return}Sr({isCalculating:!0})}const _r=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 Ka(e){return e.name_localized?e.name_localized:typeof e.name=="string"?e.name:e.name?.ko??""}function $p(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 $c(e,t,r){return!e||!t?.length?null:t.every(a=>{const s=Ka(a);return e[s]})?r?.find(a=>t.every(s=>{const l=Ka(s);return $p(a.option_values,a.option_values_localized,l)===e[l]}))||null:(_r.log("Not all options selected yet"),null)}function Up(e,t){const{selectedOptions:r,optionGroups:n,options:o}=e?.params||{};_r.log("findMatchingOption called:",{selectedOptions:r,optionGroups:n,optionsCount:o?.length});const a=$c(r,n,o);return _r.log("Matched option:",a),{matchedOption:a}}function zp(e,t){const{currentOptionValues:r,optionGroups:n,options:o}=e?.params||{};if(_r.log("initCartOptionSelection called:",{currentOptionValues:r,optionGroups:n,optionsCount:o?.length}),!n?.length||!r)return _r.log("No option groups or current values, returning empty"),{selectedOptions:{},matchedOption:null};const a={};for(const l of n){const f=Ka(l),h=r[f],d=l.values_localized??(Array.isArray(l.values)?l.values.map(i=>typeof i=="string"?i:i?.ko??""):[]);h&&d.includes(h)&&(a[f]=h)}_r.log("Initial selectedOptions:",a);const s=$c(a,n,o||[]);return _r.log("Matched option:",s),{selectedOptions:a,matchedOption:s}}const kn="g7_cart_key",Hp="/api/modules/sirsoft-ecommerce/cart/key",Va="g7_guest_order_token",Uc="g7_guest_order_number",Ya="g7_guest_order_expires_at",gt=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 zc(){try{const e=await fetch(Hp,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}});return e.ok?(await e.json()).data?.cart_key||null:(gt.error("Failed to issue cartKey from API:",e.status),null)}catch(e){return gt.error("Error issuing cartKey from API:",e),null}}function ur(e){const t=window.G7Core;t?.state?.set?(t.state.set(e),gt.log("Global state updated:",e)):gt.warn("G7Core.state.set not available")}function Gp(){try{const e=window.G7Config;return e?.user?e.user:(window.G7Core?.state?.get?.()||{}).currentUser||null}catch{return null}}async function jp(e,t){let r=null;try{r=localStorage.getItem(kn)}catch{}if(r)gt.log("Existing cartKey loaded:",r);else if(r=await zc(),r)try{localStorage.setItem(kn,r),gt.log("New cartKey issued from API:",r)}catch{}else gt.error("Failed to issue cartKey from API");ur({cartKey:r})}function Bp(e,t){try{return localStorage.getItem(kn)}catch{return null}}function Hc(e,t){try{localStorage.removeItem(kn),gt.log("cartKey removed from localStorage")}catch{}ur({cartKey:null})}async function Wp(e,t){if(Gp()){Hc();return}const n=await zc();if(n){try{localStorage.setItem(kn,n),gt.log("New cartKey regenerated from API:",n)}catch{}ur({cartKey:n})}else gt.error("Failed to regenerate cartKey from API")}function Kp(e,t){const{key:r,value:n}=e?.params||{};if(!r){gt.warn("saveToStorage: key is required");return}try{localStorage.setItem(r,n),gt.log("Saved to storage:",r,n)}catch{}}function Vp(e,t){const{key:r,defaultValue:n}=e?.params||{};if(!r)return gt.warn("loadFromStorage: key is required"),n||null;try{return localStorage.getItem(r)||n||null}catch{return n||null}}function Xa(){try{sessionStorage.removeItem(Va),sessionStorage.removeItem(Uc),sessionStorage.removeItem(Ya)}catch{}}function Yp(e,t){let r=null,n=null;try{r=sessionStorage.getItem(Va),n=sessionStorage.getItem(Ya)}catch{}let o=!1;if(r){const a=n?new Date(n).getTime():NaN;(isNaN(a)||a<=Date.now())&&(Xa(),r=null,o=!0)}if(r){ur({guestOrderToken:r}),gt.log("Guest order token loaded from sessionStorage");return}if(!o){const s=window.G7Core?.state?.get?.("_global")?.guestOrderToken;if(typeof s=="string"&&s!==""){gt.log("Guest order token preserved from in-memory _global (sessionStorage empty)");return}}ur({guestOrderToken:null}),gt.log("No guest order token (visitor not authenticated)")}function Xp(e,t){const{token:r,orderNumber:n,expiresAt:o}=e?.params||{};if(!r||!n||!o){gt.warn("saveGuestOrderToken: token, orderNumber, expiresAt are required");return}try{sessionStorage.setItem(Va,r),sessionStorage.setItem(Uc,n),sessionStorage.setItem(Ya,o)}catch{}ur({guestOrderToken:r})}function Zp(e,t){Xa(),ur({guestOrderToken:null})}function qp(e,t){Xa(),ur({guestOrderToken:null})}function Qp(e,t){const{product:r,priceField:n,currencyCode:o}=e,a=o||t.getState("_global.preferredCurrency")||"KRW",s=`multi_currency_${n}`,l=r[s];if(l&&l[a])return l[a].formatted;const f=`${n}_formatted`;return r[f]||String(r[n])}const Za={KRW:{code:"KRW",symbol:"₩",locale:"ko-KR",decimals:0},USD:{code:"USD",symbol:"$",locale:"en-US",decimals:2},JPY:{code:"JPY",symbol:"¥",locale:"ja-JP",decimals:0},CNY:{code:"CNY",symbol:"¥",locale:"zh-CN",decimals:2},EUR:{code:"EUR",symbol:"€",locale:"de-DE",decimals:2}};function Jp(e,t){const{value:r,currencyCode:n,locale:o}=e,a=n||t.getState("_global.preferredCurrency")||"KRW",s=Za[a]||Za.KRW,l=o||s.locale;try{return new Intl.NumberFormat(l,{style:"currency",currency:s.code,minimumFractionDigits:s.decimals,maximumFractionDigits:s.decimals}).format(r)}catch{const f=r.toLocaleString(void 0,{minimumFractionDigits:s.decimals,maximumFractionDigits:s.decimals});return`${s.symbol}${f}`}}function Rp(e){return Za[e]?.symbol||e}const qa=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)},Gc="g7_preferred_currency",em="KRW";function tm(e,t){const{defaultCurrency:r=em}=e;let n=r;try{if(typeof window<"u"&&window.localStorage){const o=localStorage.getItem(Gc);o&&jc(o)&&(n=o)}}catch{qa.warn("localStorage 접근 불가, 기본 통화 사용:",r)}return t.setState("global",{preferredCurrency:n}),n}function rm(e,t){const{currencyCode:r}=e;if(!jc(r)){qa.warn("유효하지 않은 통화 코드:",r);return}try{typeof window<"u"&&window.localStorage&&localStorage.setItem(Gc,r)}catch{qa.warn("localStorage 저장 실패")}t.setState("global",{preferredCurrency:r})}function jc(e){return typeof e=="string"&&/^[A-Z]{3}$/.test(e)}const Xr=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)},Qa=["auto","light","dark"],Bc="g7_color_scheme",nm=e=>e==="auto"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e,go=e=>{const t=nm(e);document.documentElement.setAttribute("data-theme",t),t==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")};function om(){try{const e=localStorage.getItem(Bc),t=e&&Qa.includes(e)?e:"auto";go(t),Xr.log("Initial theme applied:",t)}catch(e){Xr.warn("Failed to load initial theme:",e),go("auto")}}async function am(e,t){const r=e?.target;if(r&&typeof r=="string"&&Qa.includes(r)){go(r);return}om()}async function sm(e,t){let r;if(e?.target&&typeof e.target=="string"&&!e.target.includes("{{")&&(r=e.target),!r||typeof r!="string"){Xr.warn("Invalid theme:",r);return}if(!Qa.includes(r)){Xr.warn("Unsupported theme:",r);return}const n=r;try{localStorage.setItem(Bc,n)}catch(o){Xr.error("Failed to save theme to localStorage:",o);return}go(n),Xr.log("Theme changed to:",n)}const lm=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 im(e,t){const r=window.G7Core;if(!r?.dispatch){lm.error("G7Core.dispatch 가 초기화되지 않아 로그인 리다이렉트를 실행할 수 없습니다.");return}const n=window.location.pathname+window.location.search;await r.dispatch({handler:"navigate",params:{path:"/login",query:{redirect:n}}})}const Ja=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 cm(e,t){const r=window.G7Core,{url:n,filename:o}=e?.params||{};if(!n){Ja.warn("다운로드 URL 이 없어 요청을 건너뜁니다.");return}if(!r?.api?.get){Ja.error("G7Core.api.get 이 초기화되지 않아 다운로드를 실행할 수 없습니다.");return}try{const a=await r.api.get(n,{responseType:"blob"});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){Ja.error("첨부파일 다운로드 실패",a),r?.toast?.error?.(r?.t?.("common.download_failed")??"Download failed")}}const ho={"sirsoft-basic.addSelectedItemIfComplete":Cp,"sirsoft-basic.updateSelectedItemQuantity":Sp,"sirsoft-basic.removeSelectedItem":Ep,"sirsoft-basic.updateNoOptionQuantity":Tp,"sirsoft-basic.setBlockAdditionalOption":_p,"sirsoft-basic.getDisplayPrice":Qp,"sirsoft-basic.formatCurrency":Jp,"sirsoft-basic.getCurrencySymbol":Rp,"sirsoft-basic.loadPreferredCurrency":tm,"sirsoft-basic.savePreferredCurrency":rm,setTheme:sm,initTheme:am,redirectToLoginWithReturn:im,downloadAttachment:cm,toggleCartItemSelection:Mp,selectAllCartItems:Ip,setCartOption:Dp,openCartDeleteModal:Pp,openCartOptionModal:Lp,recalculateCart:Fp,findMatchingOption:Up,initCartOptionSelection:zp,initCartKey:jp,getCartKey:Bp,clearCartKey:Hc,regenerateCartKey:Wp,saveToStorage:Kp,loadFromStorage:Vp,initGuestOrderToken:Yp,saveGuestOrderToken:Xp,clearGuestOrderToken:Zp,clearGuestTokenOnEntry:qp},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 dm(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 um(){const t=window.G7Core?.api?.getToken?.()??null;return t?{Authorization:`Bearer ${t}`}:{}}function fm(){try{const e=typeof window<"u"?window.localStorage?.getItem("g7_locale"):null;return e?{"Accept-Language":e}:{}}catch{return{}}}async function gm(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",...fm(),...um()},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 hm(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=dm(e);let o;try{o=await gm(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 d=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 x=new Date(m).getTime();Number.isFinite(x)&&x!==f&&(f=x)}const w=p?.identityChallenge?.resendCooldown;typeof w=="number"&&w>h&&(h=w)})??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(d),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(d),i?.(),g}function pm(){const e=window.G7Core?.identity;if(!e?.setLauncher){Cn.warn("G7Core.identity 가 아직 초기화되지 않아 launcher 등록을 건너뜁니다. 코어 부트스트랩 순서를 확인하세요.");return}e.setLauncher(hm),Cn.log("IDV launcher registered (sirsoft-basic)")}const Wc=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 mm(){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 bm(){const e=window.G7Core;if(!e?.state?.get||!e?.state?.set){Wc.warn("G7Core.state not available; skip iOS device correction");return}if(!mm())return;const r=(e.state.get()||{}).appConfig||{};r.isIos!==!0&&(e.state.set({appConfig:{...r,isIos:!0}}),Wc.log("appConfig.isIos corrected to true by client signals (iPadOS desktop-UA)"))}function ym(e){const t=e.icons;return Array.isArray(t)?t.filter(r=>!!r&&typeof r=="object"&&typeof r.value=="string"):[]}function vm(e,t){const r=e.label;return typeof r=="string"?r.startsWith("$t:")?t(r.slice(3)):r:e.value}function wm(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 xm({entry:e}){const t=e.preview;return t?.html?c.jsx("span",{className:"g7le-icon-preview",dangerouslySetInnerHTML:{__html:t.html},style:es}):t?.className?c.jsx("span",{className:`g7le-icon-preview ${t.className}`,style:es}):c.jsx("i",{className:`fas fa-${e.value}`,style:es,"aria-hidden":"true"})}function km({control:e,value:t,onChange:r,t:n}){const o=ym(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,d]=C.useState("");if(o.length===0)return c.jsx("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Kc,children:c.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:Vc})});const i=g=>vm(g,n),u=o.filter(g=>wm(g,i(g),h));return c.jsxs("div",{className:"g7le-widget g7le-widget--icon-picker","data-testid":"g7le-widget-icon-picker",style:Kc,children:[c.jsx("input",{type:"text",className:"g7le-widget g7le-widget--icon-search","data-testid":"g7le-widget-icon-picker-search",value:h,placeholder:f,onChange:g=>d(g.target.value),style:Vc}),c.jsxs("div",{className:"g7le-icon-grid","data-testid":"g7le-widget-icon-picker-grid",style:{...Cm,gridTemplateColumns:`repeat(${s}, minmax(0, 1fr))`},children:[c.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===""?Yc:Ra,children:c.jsx("span",{style:Sm,children:"—"})}),u.map(g=>{const p=g.value===a;return c.jsx("button",{type:"button","data-testid":`g7le-icon-cell-${g.value}`,title:i(g),"aria-pressed":p,onClick:()=>r(g.value),style:p?Yc:Ra,children:c.jsx(xm,{entry:g})},g.value)})]}),u.length===0&&c.jsx("div",{"data-testid":"g7le-widget-icon-picker-empty",style:_m,children:n("layout_editor.icon_picker.no_results")})]})}const Kc={display:"flex",flexDirection:"column",gap:6,width:"100%"},Vc={padding:"5px 8px",fontSize:12,border:"1px solid #cbd5e1",borderRadius:6,width:"100%"},Cm={display:"grid",gap:4,maxHeight:220,overflowY:"auto",padding:2},Ra={display:"flex",alignItems:"center",justifyContent:"center",minHeight:34,padding:4,border:"1px solid #e2e8f0",borderRadius:6,background:"#fff",cursor:"pointer"},Yc={...Ra,border:"2px solid #2563eb",background:"#eff6ff"},es={display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:16,lineHeight:1},Sm={fontSize:10,color:"#475569",fontFamily:"monospace",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},_m={fontSize:11,color:"#94a3b8",fontStyle:"italic",padding:"4px 2px"},Xc=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 Em(){if(typeof window>"u")return;const e=window.G7Core?.layoutEditor;if(!e?.registerWidget){Xc.warn("G7Core.layoutEditor 미노출 — icon-picker 위젯 등록 보류");return}e.registerWidget("icon-picker",km),Xc.log("편집기 위젯 'icon-picker' 등록됨(Font Awesome 검색 그리드)")}const ts=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=ho);function Zc(){if(typeof window<"u"){let e=0;const t=50,r=()=>{const n=window.G7Core?.getActionDispatcher?.();n?(Object.entries(ho).forEach(([o,a])=>{n.registerHandler(o,a)}),ts.log(`${Object.keys(ho).length} custom handler(s) registered:`,Object.keys(ho)),pm(),bm()):(e++,e<=t?(ts.warn(`ActionDispatcher not found, retrying... (${e}/${t})`),setTimeout(r,100)):ts.error("Failed to register handlers: ActionDispatcher not available after maximum retries"))};document.readyState==="complete"?r():window.addEventListener("load",r)}}return Em(),Zc(),ee.A=ko,ee.Avatar=Jr,ee.AvatarUploader=Ba,ee.BrandMark=Lo,ee.Button=J,ee.Checkbox=fs,ee.Code=xd,ee.ConfirmDialog=pa,ee.Container=hp,ee.Div=j,ee.ExpandableContent=fa,ee.FileInput=ss,ee.FileUploader=so,ee.Flex=mp,ee.Footer=vs,ee.Form=Co,ee.Grid=pp,ee.H1=cd,ee.H2=cs,ee.H3=Tn,ee.H4=ds,ee.Header=bs,ee.Hr=So,ee.HtmlContent=ca,ee.HtmlEditor=ai,ee.Icon=ge,ee.IconName=rt,ee.ImageGallery=Hr,ee.Img=zt,ee.Input=Et,ee.Label=Nr,ee.Li=rr,ee.MobileNav=ws,ee.Modal=ga,ee.Nav=Qr,ee.NotificationCenter=On,ee.Ol=dd,ee.Optgroup=hd,ee.Option=gd,ee.P=Ut,ee.PageLoading=_c,ee.PageSkeleton=ja,ee.PageTransitionBlur=za,ee.PageTransitionIndicator=Ua,ee.Pagination=Ec,ee.PasswordInput=is,ee.PostReactions=ni,ee.ProductCard=zs,ee.ProductImageViewer=Gn,ee.QuantitySelector=ti,ee.RichTextEditor=oi,ee.SearchBar=Nc,ee.Section=gs,ee.SectionLayout=bp,ee.Select=us,ee.SlotContainer=An,ee.SocialLoginButtons=mc,ee.Span=re,ee.Svg=En,ee.TabNavigation=Ic,ee.Table=pd,ee.Tbody=bd,ee.Td=wd,ee.Textarea=wo,ee.Th=vd,ee.Thead=md,ee.ThemeToggle=Nn,ee.ThreeColumnLayout=yp,ee.Toast=$a,ee.Tr=yd,ee.Ul=xo,ee.UserInfo=Mc,ee.availablePasswordRules=vo,ee.compositeComponents=gp,ee.defaultPasswordRules=ls,ee.initTemplate=Zc,ee.templateMetadata=vp,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}),ee})({},ReactJSXRuntime,React,ReactDOM);
//# sourceMappingURL=components.iife.js.map