UNPKG

ranui

Version:

A framework-agnostic Web Components UI library built on native custom elements, with TypeScript types, light/dark theming, SSR and PWA support.

11 lines 1 MB
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fs=require("./rolldown-runtime-CAnuVJ4g.cjs");var hi="ran-theme",kr=null,Ir=null,pi=r=>{if(r&&"style"in r)return r;if(r&&"documentElement"in r)return r.documentElement;if(!(typeof document>"u"))return document.documentElement},_o=r=>{const c=typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").matches;r.setAttribute("data-ran-theme",c?"dark":"light"),r.setAttribute("theme",c?"dark":"light")},xd=()=>{kr&&Ir&&(kr.removeEventListener("change",Ir),kr=null,Ir=null)},Va=(r,c)=>{const g=pi(c);if(g){if(xd(),r==="system"){if(typeof window>"u")return;_o(g),kr=window.matchMedia("(prefers-color-scheme: dark)"),Ir=()=>_o(g),kr.addEventListener("change",Ir);try{localStorage.setItem(hi,"system")}catch{}return}g.setAttribute("data-ran-theme",r),g.setAttribute("theme",r);try{localStorage.setItem(hi,r)}catch{}}},ps=r=>{const c=pi(r);if(!c)return"";const g=c.getAttribute("data-ran-theme")||c.getAttribute("theme")||"";if(g==="light"||g==="dark"){try{if(localStorage.getItem(hi)==="system")return"system"}catch{}return g}return""},As=(r,c,g)=>{const A=pi(g);A&&A.style.setProperty(r,String(c))},ms=(r,c)=>{const g=pi(c);g&&g.style.removeProperty(r)},Td=(r,c)=>{Object.entries(r).forEach(([g,A])=>{if(A==null){ms(g,c);return}As(g,A,c)})},Dd=r=>{if(!(typeof localStorage>"u"))try{const c=localStorage.getItem(hi);(c==="light"||c==="dark"||c==="system")&&Va(c,r)}catch{}},vs=class{_events=new Map;tap=(r,c)=>{this._events.get(r)&&r!==Symbol.for("NEW_LISTENER")&&this.call(Symbol.for("NEW_LISTENER"),r);const g=this._events.get(r)||new Set;return typeof c=="function"?g.add({name:r,callback:c}):g.add(c),this._events.set(r,g),this};call=(r,...c)=>((this._events.get(r)||new Set).forEach(g=>{const{callback:A}=g;A(...c)}),this);callSync=async(r,...c)=>{const g=this._events.get(r)||new Set;for(const A of g){const{callback:k}=A;await k(...c)}return this};once=(r,c)=>{let g;if(typeof c=="function")g={name:r,callback:(...A)=>{c(...A),this.off(r,g)},initialCallback:c};else{const{callback:A}=c;g={name:r,callback:(...k)=>{A(...k),this.off(r,g)},initialCallback:A}}return this.tap(r,g),this};off=(r,c)=>{const g=[...this._events.get(r)||new Set].filter(A=>{if(typeof c=="function")return A.callback!==c&&A.initialCallback!==c;{const{callback:k}=c;return A.callback!==k&&A.initialCallback!==k}});return this._events.set(r,new Set(g)),this}},Qa=(r=8)=>Math.random().toString(36).substring(2,r+2),Wo=(r="")=>{if(r.length===0)return 0;if(r.endsWith("%")){const c=Number(r.replace("%",""));return c>1?c/100:c}return Number(r)},Gt=(r,c=0,g=1)=>Math.min(g,Math.max(c,r)),Rd=r=>typeof r=="function";function si(r){return r<10?`0${r}`:r}var Je=r=>{if(r===0)return"00:00";if(!r)return"";const c=Math.trunc(r/3600),g=Math.trunc(r%3600/60),A=si(Math.trunc(r-3600*c-60*g));return c===0?`${si(g)}:${A}`:`${si(c)}:${si(g)}:${A}`},Xo=()=>{if(typeof window<"u"){const r=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(r)?"ipad":/android/.test(r)?"android":/iphone/.test(r)?"iphone":"pc"}return"pc"},bs=typeof window<"u",Br=()=>{if(!bs)return!1;const r=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(r)},vr=r=>{const c=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||1;return(bs&&window.devicePixelRatio||1)/c},Md=12e4,Fd="__ranuts_bridge__",Od="default",Zo=new class{bridges=new Set;attachedWindow=null;handleMessage=r=>{for(const c of Array.from(this.bridges))c.receive(r)};add(r){this.bridges.add(r),typeof window<"u"&&this.attachedWindow!==window&&(window.addEventListener("message",this.handleMessage),this.attachedWindow=window)}remove(r){this.bridges.delete(r),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener("message",this.handleMessage),this.attachedWindow=null)}},Pd=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(r,c="*",g=Od){this.targetOrigin=c,this.channel=g,this.senderId=Qa(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<"u",this.available?(this.targetWindow=r??window,Zo.add(this)):this.targetWindow=void 0}post(r,c){const g={...c,__bridge:Fd,channel:this.channel,senderId:this.senderId};r.postMessage(g,this.targetOrigin)}receive=r=>{if(!this.available||this.targetOrigin!=="*"&&r.origin!==this.targetOrigin||r.source&&r.source!==this.targetWindow)return;const c=r.data;if(!c||typeof c!="object"||c.__bridge!=="__ranuts_bridge__"||(c.channel??"default")!==this.channel)return;const{type:g,payload:A,id:k,isResponse:B,isError:D,senderId:O}=c;if(B&&k){const X=this.pendingRequests.get(k);X&&(D?X.reject(new Error(typeof A=="string"?A:"Bridge request failed")):X.resolve(A),this.pendingRequests.delete(k));return}if(O&&O===this.senderId||typeof g!="string"||!this.messageHandlers.has(g))return;const Y=this.messageHandlers.get(g);if(Rd(Y)){const X=r.source??this.targetWindow;Promise.resolve(Y(A)).then(wt=>{k&&this.post(X,{type:g,payload:wt,id:k,isResponse:!0})}).catch(wt=>{k&&this.post(X,{type:g,payload:wt instanceof Error?wt.message:String(wt),id:k,isResponse:!0,isError:!0})})}};on=(r,c)=>{this.messageHandlers.set(r,c)};off=r=>{this.messageHandlers.delete(r)};send=async(r,c)=>{if(!this.available)return Promise.reject(new Error("PostMessageBridge is unavailable outside a browser environment"));const g=Qa(10);return new Promise((A,k)=>{const B=setTimeout(()=>{this.pendingRequests.has(g)&&(this.pendingRequests.delete(g),k(new Error("Request timeout")))},Md),D=O=>{clearTimeout(B),k(O)};this.pendingRequests.set(g,{resolve:O=>{clearTimeout(B),A(O)},reject:D});try{this.post(this.targetWindow,{type:r,payload:c,id:g})}catch(O){this.pendingRequests.delete(g),D(O instanceof Error?O:new Error("Failed to post message"))}})};broadcast=r=>{if(this.available)try{this.post(this.targetWindow,{type:r.type,payload:r.payload})}catch{}};destroy=()=>{Zo.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(r=>{r.reject(new Error("Bridge destroyed"))}),this.pendingRequests.clear()}},Ud=class Cr{static instance;bridges=new Map;constructor(){}static getInstance(){return Cr.instance||(Cr.instance=new Cr),Cr.instance}connectClient=({id:c,targetOrigin:g,targetWindow:A,channel:k})=>{const B=new Pd(A,g,k);if(c||(c=Qa(10)),this.bridges.has(c))throw new Error(`Bridge ${c} already exists`);return this.bridges.set(c,B),{bridge:B,id:c}};getClient=c=>this.bridges.get(c);removeClient=c=>{const g=this.bridges.get(c);g&&(g.destroy(),this.bridges.delete(c))};removeAllClient=()=>{this.bridges.forEach(c=>{c.destroy()}),this.bridges.clear()};broadcast=c=>{this.bridges.forEach(g=>{g.broadcast(c)})};sendTo=(c,g,A)=>{const k=this.getClient(c);return k?k.send(g,A):Promise.reject(new Error(`Bridge ${c} not found`))}},zg=Ud.getInstance(),Vg=new vs,z=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],N=class{highOrder;lowOrder;constructor(r,c){this.highOrder=r,this.lowOrder=c}},qg=[new N(z[0],3609767458),new N(z[1],602891725),new N(z[2],3964484399),new N(z[3],2173295548),new N(z[4],4081628472),new N(z[5],3053834265),new N(z[6],2937671579),new N(z[7],3664609560),new N(z[8],2734883394),new N(z[9],1164996542),new N(z[10],1323610764),new N(z[11],3590304994),new N(z[12],4068182383),new N(z[13],991336113),new N(z[14],633803317),new N(z[15],3479774868),new N(z[16],2666613458),new N(z[17],944711139),new N(z[18],2341262773),new N(z[19],2007800933),new N(z[20],1495990901),new N(z[21],1856431235),new N(z[22],3175218132),new N(z[23],2198950837),new N(z[24],3999719339),new N(z[25],766784016),new N(z[26],2566594879),new N(z[27],3203337956),new N(z[28],1034457026),new N(z[29],2466948901),new N(z[30],3758326383),new N(z[31],168717936),new N(z[32],1188179964),new N(z[33],1546045734),new N(z[34],1522805485),new N(z[35],2643833823),new N(z[36],2343527390),new N(z[37],1014477480),new N(z[38],1206759142),new N(z[39],344077627),new N(z[40],1290863460),new N(z[41],3158454273),new N(z[42],3505952657),new N(z[43],106217008),new N(z[44],3606008344),new N(z[45],1432725776),new N(z[46],1467031594),new N(z[47],851169720),new N(z[48],3100823752),new N(z[49],1363258195),new N(z[50],3750685593),new N(z[51],3785050280),new N(z[52],3318307427),new N(z[53],3812723403),new N(z[54],2003034995),new N(z[55],3602036899),new N(z[56],1575990012),new N(z[57],1125592928),new N(z[58],2716904306),new N(z[59],442776044),new N(z[60],593698344),new N(z[61],3733110249),new N(z[62],2999351573),new N(z[63],3815920427),new N(3391569614,3928383900),new N(3515267271,566280711),new N(3940187606,3454069534),new N(4118630271,4000239992),new N(116418474,1914138554),new N(174292421,2731055270),new N(289380356,3203993006),new N(460393269,320620315),new N(685471733,587496836),new N(852142971,1086792851),new N(1017036298,365543100),new N(1126000580,2618297676),new N(1288033470,3409855158),new N(1501505948,4234509866),new N(1607167915,987167468),new N(1816402316,1246189591)],_g=[new N(0,1),new N(0,32898),new N(2147483648,32906),new N(2147483648,2147516416),new N(0,32907),new N(0,2147483649),new N(2147483648,2147516545),new N(2147483648,32777),new N(0,138),new N(0,136),new N(0,2147516425),new N(0,2147483658),new N(0,2147516555),new N(2147483648,139),new N(2147483648,32905),new N(2147483648,32771),new N(2147483648,32770),new N(2147483648,128),new N(0,32778),new N(2147483648,2147483658),new N(2147483648,2147516545),new N(2147483648,32896),new N(0,2147483649),new N(2147483648,2147516424)],br=(r,c=500)=>{let g;return(...A)=>{clearTimeout(g),g=setTimeout(()=>{r.apply(void 0,A)},c)}},de=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)||g.add(c)},be=(r,c)=>{if(typeof document>"u")return;const g=r.classList;g.contains(c)&&g.remove(c)},ys=()=>{let r=0,c=null;return function(g,A=300){return function(...k){const B=Date.now();B-r>=A?(c!=null&&(clearTimeout(c),c=null),r=B,g.apply(this,k)):c??=window.setTimeout(()=>{r=Date.now(),g.apply(this,k),c=null},A-(B-r))}}},Ia=new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[103,"Early Hints"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[208,"Already Reported"],[226,"IM Used"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Found"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[308,"Permanent Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Payload Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a Teapot"],[421,"Misdirected Request"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]]),Wg={message:Ia,code:(function(r){const c=new Map;for(const[g,A]of r)c.set(A.toLowerCase(),g);return c})(Ia),codes:(function(r){const c=[];for(const[g,A]of r)c.push(g);return c})(Ia),redirect:{300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},empty:{204:!0,205:!0,304:!0},retry:{502:!0,503:!0,504:!0}},Qd='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{box-sizing:var(--ran-btn-box-sizing, border-box);position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-flex);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, var(--ran-skin-raised-shadow, 0 2px #00000004));cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{box-sizing:var(--ran-btn-contain-box-sizing, border-box);position:var(--ran-btn-contain-position, relative);display:var(--ran-btn-contain-display, block);background-image:var(--ran-btn-contain-background-image, none);cursor:var(--ran-btn-contain-cursor, pointer);transition:var(--ran-btn-contain-transition, opacity var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-standard, cubic-bezier(.645, .045, .355, 1)));-webkit-user-select:var(--ran-btn-contain-user-select, none);user-select:var(--ran-btn-contain-user-select, none);touch-action:var(--ran-btn-contain-touch-action, manipulation);border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));background:var(--ran-btn-contain-background, var(--ran-color-bg-elevated, #fff))}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:var(--ran-btn-contain-outline, 0)}:host(:focus-visible){outline:var(--ran-btn-focus-outline, 2px solid var(--ran-color-primary));outline-offset:var(--ran-btn-focus-outline-offset, 2px)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, var(--ran-color-primary, #171717));background-image:var(--ran-btn-content-background-image, none);border-color:var(--ran-btn-content-border-color, var(--ran-color-primary, #171717));color:var(--ran-btn-content-color, var(--ran-color-primary-text, #fff))}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, var(--ran-color-primary-text, #fff) 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):active) .ran-btn-content{background-color:var(--ran-btn-content-active-background-color, var(--ran-color-primary-active, #4d4d4d));border-color:var(--ran-btn-content-active-border-color, var(--ran-color-primary-active, #4d4d4d))}@media(min-width:1024px){:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-border-hover, #c9c9c9));color:var(--ran-btn-content-hover-color, var(--ran-color-text, #171717))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, var(--ran-color-primary-hover, #383838));border-color:var(--ran-btn-content-hover-border-color, var(--ran-color-primary-hover, #383838));color:var(--ran-btn-content-hover-color, var(--ran-color-primary-text, #fff))}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));color:var(--ran-btn-content-warning-color, #fff)}}:host([type="warning"]) .ran-btn-content{border-color:var(--ran-btn-content-warning-border-color, var(--ran-color-danger, #ff4d4f));background-color:var(--ran-btn-content-warning-background-color, var(--ran-color-danger, #ff4d4f));background-image:var(--ran-btn-content-background-image, none);color:var(--ran-btn-content-warning-color, #fff)}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="text"]) .ran-btn-content{border:var(--ran-btn-content-text-border, none)}:host([disabled]){cursor:var(--ran-btn-disabled-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-pointer-events, all);opacity:var(--ran-btn-disabled-opacity, .6)}:host([disabled]) .ran-btn{cursor:var(--ran-btn-disabled-container-cursor, not-allowed);pointer-events:var(--ran-btn-disabled-container-pointer-events, all);opacity:var(--ran-btn-disabled-container-opacity, .6)}:host(:not([disabled]):active) .ran-btn:after{transform:var(--ran-btn-after-transform, translate(-50%, -50%) scale(0));opacity:var(--ran-btn-after-opacity, .3);transition:var(--ran-btn-after-transition, 0s)}:host(:not([disabled]):active) .ran-btn-content{transform:var(--ran-btn-content-active-transform, scale(.96))}@media(min-width:1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,var(--ran-gray-alpha-400, #00000014) 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:var(--ran-btn-slot-display, block)}.ran-btn-content{display:var(--ran-btn-content-display, flex);justify-content:var(--ran-btn-content-display, space-between);align-items:var(--ran-btn-content-align-items, center);padding:var(--ran-btn-content-padding, 4px 15px);border:var(--ran-btn-content-border, 1px solid transparent);border-image-source:var(--ran-btn-content-border-image-source, none);border-image-slice:var(--ran-btn-content-border-image-slice, 8);border-image-width:var(--ran-btn-content-border-image-width, 4px);border-image-outset:0;border-image-repeat:stretch;border-radius:var(--ran-btn-content-border-radius, var(--ran-radius-sm, 6px));border-color:var(--ran-btn-content-border-color, var(--ran-color-border, #eaeaea));color:var(--ran-btn-content-color, var(--ran-color-text, #000000d9));line-height:var(--ran-btn-content-line-height, 22px);font-size:var(--ran-btn-content-font-size, 14px);font-weight:var(--ran-btn-content-font-weight, 400);font-family:var(--ran-btn-content-font-family, var(--ran-skin-font-family, inherit));white-space:var(--ran-btn-content-white-space, nowrap);text-align:var(--ran-btn-content-text-align, center);box-sizing:var(--ran-btn-content-box-sizing, border-box);transition:var(--ran-btn-content-transition, transform var(--ran-motion-duration-base, .2s) var(--ran-motion-ease-spring, cubic-bezier(.34, 1.26, .5, 1)))}.ran-btn-content .icon{margin-right:var(--ran-btn-icon-margin-right, 2px)}@media(prefers-reduced-motion:reduce){.ran-btn-content{transition:none}}',zt=typeof document>"u",xt=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(r,c,g,A){return r.addEventListener(c,g,{...A,signal:this.ac.signal}),this}delegate(r,c,g,A,k){return r.addEventListener(g,B=>{const D=B.target?.closest(c);D&&r.contains(D)&&A(B,D)},{...k,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}},ui=0,ws=1,Ai=2,ye=null,jt=null,Cs=0,di=new Set,Ba=!1;function qa(r,c){const g=c?.equals??Object.is,A={value:r,observers:new Set};return[()=>(Kd(A),A.value),D=>{const O=typeof D=="function"?D(A.value):D;if(!g(A.value,O)){A.value=O;for(const Y of A.observers)_a(Y,Ai);Cs===0&&Yd()}}]}function Ee(r){const c=Nd(r,!0);return Hd(c),ks(c),()=>Wa(c)}function mi(r){const c={owned:[],cleanups:[],owner:jt},g=jt,A=ye;jt=c,ye=null;try{return r(()=>Gd(c))}finally{jt=g,ye=A}}function vi(r){jt&&jt.cleanups.push(r)}function Nd(r,c,g){return{fn:r,sources:new Set,isEffect:c,running:!1,disposed:!1,state:Ai,observers:new Set,value:void 0,equals:g??Object.is,owned:[],cleanups:[],owner:jt}}function Hd(r){jt&&jt.owned.push(r)}function Kd(r){ye&&(ye.sources.add(r),r.observers.add(ye))}function _a(r,c){if(r.disposed||r.state>=c)return;const g=r.state===ui;if(r.state=c,r.isEffect)di.add(r);else if(g)for(const A of r.observers)_a(A,ws)}function Yd(){if(!(Cs>0||Ba)){Ba=!0;try{for(;di.size>0;){const r=[...di];di.clear();for(const c of r)c.disposed||Es(c)}}finally{Ba=!1}}}function Es(r){if(!(r.disposed||r.state===ui)){if(r.state===ws)for(const c of r.sources)"fn"in c&&Es(c);r.state===Ai&&ks(r),r.state=ui}}function ks(r){if(r.running)throw new Error("ranui reactivity: cyclic dependency detected (a computation triggered itself).");Is(r);const c=ye,g=jt;ye=r,jt=r,r.running=!0,r.state=ui;try{const A=r.fn();if(r.isEffect)typeof A=="function"&&r.cleanups.push(A);else{const k=r.value;if(r.value=A,r.observers.size>0&&!r.equals(k,A))for(const B of r.observers)_a(B,Ai)}}finally{r.running=!1,ye=c,jt=g}}function Is(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0;for(const c of r.sources)c.observers.delete(r);r.sources.clear()}function Wa(r){r.disposed||(r.disposed=!0,Is(r),r.observers.clear())}function Gd(r){for(const c of r.owned)Wa(c);r.owned.length=0;for(const c of r.cleanups)c();r.cleanups.length=0}function je(r){return typeof r!="string"?String(r):r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function Jo(r){return je(r)}var zd=r=>typeof r=="string"?!1:"tagName"in r&&"childrenList"in r,Vd=(r,c)=>{const g=c.trim();if(!g)return!1;if(g.startsWith("."))return r.classList.contains(g.slice(1));if(g.startsWith("#"))return r.getAttribute("id")===g.slice(1);if(g.startsWith("[")&&g.endsWith("]")){const[A,k]=g.slice(1,-1).trim().split("="),B=(A||"").trim();if(!B)return!1;if(k==null)return r.hasAttribute(B);const D=k.trim().replace(/^['"]|['"]$/g,"");return r.getAttribute(B)===D}return r.tagName===g.toLowerCase()},bi=(r,c,g)=>{for(const A of r)zd(A)&&(Vd(A,c)&&g.push(A),bi(A.childrenList,c,g))},Na=class{childrenList=[];appendChild(r){return this.childrenList.push(r),r}serialize(){return this.childrenList.map(r=>typeof r=="string"?je(r):r.serialize()).join("")}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}},Xa=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(r,c)=>{const g=r.startsWith("--")?r:r.replace(/([A-Z])/g,"-$1").toLowerCase();this.inlineStyles.set(g,c)},removeProperty:r=>this.inlineStyles.delete(r)};classList={add:(...r)=>{const c=this.attributes.get("class")||"",g=new Set([...c.split(" ").filter(Boolean),...r]);this.attributes.set("class",Array.from(g).join(" "))},remove:(...r)=>{const c=(this.attributes.get("class")||"").split(" ").filter(g=>!r.includes(g));this.attributes.set("class",c.join(" "))},toggle:r=>{this.classList.contains(r)?this.classList.remove(r):this.classList.add(r)},contains:r=>(this.attributes.get("class")||"").split(" ").includes(r)};_innerHTML="";get innerHTML(){return this._innerHTML}set innerHTML(r){this._innerHTML=r,this.tagName==="template"&&this.content&&(this.content.childrenList=[r])}constructor(r="div"){this.tagName=r.toLowerCase(),this.tagName==="template"&&(this.content=new Na)}get hidden(){return this.hasAttribute("hidden")}set hidden(r){r?this.setAttribute("hidden",""):this.removeAttribute("hidden")}setAttribute(r,c){this.attributes.set(r,c)}getAttribute(r){return this.attributes.get(r)||null}removeAttribute(r){this.attributes.delete(r)}hasAttribute(r){return this.attributes.has(r)}appendChild(r){return this.childrenList.push(r),r}attachShadow(r){return this.shadowRoot=new qd(this,r),this.shadowRoot}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}addEventListener(r,c){const g=this.eventListeners.get(r)||new Set;g.add(c),this.eventListeners.set(r,g)}removeEventListener(r,c){const g=this.eventListeners.get(r);g&&(g.delete(c),g.size===0&&this.eventListeners.delete(r))}dispatchEvent(r){const c=this.eventListeners.get(r.type);if(!c||c.size===0)return!0;for(const g of c)typeof g=="function"?g.call(this,r):g.handleEvent(r);return!r.defaultPrevented}serialize(r){typeof this._preSerialize=="function"&&this._preSerialize();const c=r||this._ssrTag||this.tagName,g=Array.from(this.attributes.entries()).map(([D,O])=>` ${D}="${Jo(O)}"`).join(""),A=Array.from(this.inlineStyles.entries()).map(([D,O])=>`${D}:${O}`).join(";"),k=A?` style="${Jo(A)}"`:"";let B="";return this.shadowRoot&&(B+=this.shadowRoot.serialize()),this.textContent!==null?B+=je(this.textContent):this._innerHTML?B+=this._innerHTML:B+=this.childrenList.map(D=>typeof D=="string"?je(D):(D instanceof Na,D.serialize())).join(""),["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"].includes(c)&&!B?`<${c}${g}${k} />`:`<${c}${g}${k}>${B}</${c}>`}},qd=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(r,c){this.host=r,this.options=c}appendChild(r){return this.childrenList.push(r),r}querySelector(r){const c=this.querySelectorAll(r);return c.length>0?c[0]:null}querySelectorAll(r){const c=[];return bi(this.childrenList,r,c),c}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?" shadowrootdelegatesfocus":""}>${this.adoptedStyleSheets.map(r=>`<style>${je(r)}</style>`).join("")}${this.childrenList.map(r=>typeof r=="string"?je(r):(r instanceof Na,r.serialize())).join("")}</template>`}},Bs=r=>r.reduce((c,g)=>Array.isArray(g)?c.concat(Bs(g)):c.concat(g),[]),Sr=r=>r==null?null:r instanceof Ss?r.build():typeof r=="string"?zt?r:document.createTextNode(r):r,_d=(r,c)=>{if(zt){gi(r,[c()]);return}const g=document.createComment(""),A=document.createComment("");r.appendChild(g),r.appendChild(A);let k=null;const B=()=>{k?.(),k=null;let D=g.nextSibling;for(;D&&D!==A;){const O=D.nextSibling;D.parentNode?.removeChild(D),D=O}};Ee(()=>{const D=c();B();const O=document.createDocumentFragment();k=mi(Y=>(gi(O,[D]),Y)),A.parentNode?.insertBefore(O,A)}),vi(()=>k?.())},Wd="__ranFor",Xd=r=>typeof r=="object"&&r!==null&&r[Wd]===!0,Zd=(r,c,g)=>{const[A,k]=qa(c);let B=null;const D=mi(O=>{const Y=Sr(g(r,A));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,index:k,dispose:D}},Ls=(r,c)=>{const g=r.parentNode;if(!g)return;let A=r;for(const k of c)A.nextSibling!==k&&g.insertBefore(k,A.nextSibling),A=k},Jd=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(k,()=>B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=new Map;vi(()=>{for(const k of A.values())k.dispose();A.clear()}),Ee(()=>{const k=c.each()??[],B=new Map,D=[];k.forEach((O,Y)=>{const X=c.key(O,Y);if(B.has(X))return;let wt=A.get(X);wt?(A.delete(X),wt.index(Y)):wt=Zd(O,Y,c.render),B.set(X,wt),wt.node&&D.push(wt.node)});for(const O of A.values())O.node?.parentNode?.removeChild(O.node),O.dispose();Ls(g,D),A=B})},jd="__ranIndex",$d=r=>typeof r=="object"&&r!==null&&r[jd]===!0,th=(r,c,g)=>{const[A,k]=qa(r);let B=null;const D=mi(O=>{const Y=Sr(g(A,c));return B=typeof Y=="string"?document.createTextNode(Y):Y,O});return{node:B,setItem:k,dispose:D}},eh=(r,c)=>{if(zt){(c.each()??[]).forEach((k,B)=>{const D=Sr(c.render(()=>k,B));D!=null&&r.appendChild(D)});return}const g=document.createComment("");r.appendChild(g);let A=[];vi(()=>{for(const k of A)k.dispose();A=[]}),Ee(()=>{const k=c.each()??[];for(let B=0;B<k.length;B++)B<A.length?A[B].setItem(k[B]):A.push(th(k[B],B,c.render));for(let B=A.length-1;B>=k.length;B--){const{node:D}=A[B];D?.parentNode?.removeChild(D),A[B].dispose(),A.pop()}Ls(g,A.map(B=>B.node).filter(B=>B!=null))})},gi=(r,c)=>{Bs(c).forEach(g=>{if(Xd(g)){Jd(r,g);return}if($d(g)){eh(r,g);return}if(typeof g=="function"){_d(r,g);return}const A=Sr(g);A!=null&&r.appendChild(A)})},Ss=class{el;constructor(r){this.el=zt?new Xa(r):document.createElement(r)}id(r){return this.el.setAttribute("id",r),this}bind(r,c){typeof r=="function"?Ee(()=>c(r())):c(r)}class(r){return this.bind(r,c=>{zt?this.el.attributes.set("class",c):this.el.className=c}),this}addClass(...r){return r.forEach(c=>this.el.classList.add(c)),this}removeClass(...r){return r.forEach(c=>this.el.classList.remove(c)),this}attr(r,c){return this.bind(c,g=>this.el.setAttribute(r,g)),this}attrs(r){return Object.entries(r).forEach(([c,g])=>{g!=null&&this.el.setAttribute(c,String(g))}),this}boolAttr(r,c,g=""){return this.bind(c,A=>{A?this.el.setAttribute(r,g):this.el.removeAttribute(r)}),this}part(r){return this.attr("part",r)}data(r,c){return this.attr(`data-${r}`,c)}style(r,c){return typeof r=="string"?this.bind(c??"",g=>this.el.style.setProperty(r,g)):Object.entries(r).forEach(([g,A])=>this.el.style.setProperty(g,A)),this}cssVar(r,c){const g=r.startsWith("--")?r:`--${r}`;return this.style(g,c)}aria(r,c){return this.attr(`aria-${r}`,c)}role(r){return this.attr("role",r)}tabIndex(r){return this.attr("tabindex",String(r))}label(r){return this.aria("label",r)}labelledBy(r){return this.aria("labelledby",r)}describedBy(r){return this.aria("describedby",r)}ariaHidden(r=!0){return this.aria("hidden",String(r))}on(r,c,g){return this.el.addEventListener(r,c,g),this}listen(r,c,g,A){return r.on(this.el,c,g,A),this}delegate(r,c,g,A,k){return r.delegate(this.el,c,g,A,k),this}children(...r){return gi(this.el,r),this}replaceChildren(...r){if(zt){const c=this.el;c.childrenList=[]}else this.el.replaceChildren();return this.children(...r)}text(r){return this.bind(r,c=>{this.el.textContent=c}),this}ref(r){return r.current=this.el,this}shadow(r={mode:"closed"}){const c=this.el.attachShadow(r);return new rh(this.el,c,r)}build(){return this.el}serialize(){if(zt)return this.el.serialize();const r=document.createElement("div");return r.appendChild(this.el.cloneNode(!0)),r.innerHTML}},rh=class{root;hostEl;options;constructor(r,c,g){this.hostEl=r,this.root=c,this.options=g}children(...r){return gi(this.root,r),this}adoptSheet(...r){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...r],this}css(r){if(zt)return this.root.adoptedStyleSheets.push(r),this;if(typeof CSSStyleSheet<"u")try{const g=new CSSStyleSheet;return g.replaceSync(r),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,g],this}catch{}const c=document.createElement("style");return c.textContent=r,this.root.appendChild(c),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return zt?this.root.serialize():this.root.innerHTML}},rt=r=>new Ss(r),x=()=>rt("div"),ke=()=>rt("span"),Bt=()=>rt("slot"),Ha=()=>rt("button"),Za=()=>rt("input"),ih=()=>rt("style"),ah=()=>rt("label"),ce=[!1,"false",null,void 0],yt=r=>{const c=r.hasAttribute("disabled"),g=r.getAttribute("disabled");return!!(c&&!ce.includes(g))},xs=new Map;function dt(r,c){zt?(xs.set(r,c),c.prototype._ssrTag=r):customElements.get(r)||customElements.define(r,c)}function nh(){return xs}var Ts=()=>typeof document<"u"?HTMLElement:Xa,ct=Ts(),oh=r=>{if(r.tagName&&r.tagName!=="div")return r.tagName;const c=nh();for(const[g,A]of c)if(r instanceof A)return g;return r.constructor.name.toLowerCase()},sh=r=>{if(!r)return"";const c=oh(r);return typeof r.serialize=="function"||r instanceof Xa?r.serialize(c):""},La=new Map,Sa=new Map,lh=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!La.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),La.set(c,A)}const g=La.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!r.querySelector("style[data-ranui]")){const g=document.createElement("style");g.setAttribute("data-ranui",""),g.textContent=c,r.appendChild(g)}}},ch=(r,c)=>{if(!(typeof document>"u")&&c){if(typeof CSSStyleSheet<"u")try{if(!Sa.has(c)){const A=new CSSStyleSheet;A.replaceSync(c),Sa.set(c,A)}const g=Sa.get(c);r.adoptedStyleSheets.includes(g)||(r.adoptedStyleSheets=[...r.adoptedStyleSheets,g]);return}catch{}if(!Array.from(r.querySelectorAll("style[data-ranui-sheet]")).some(g=>g.textContent===c)){const g=document.createElement("style");g.setAttribute("data-ranui-sheet",""),g.textContent=c,r.appendChild(g)}}},jo=new WeakMap,$o="@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}",ht=(r,c="",g={mode:"closed"})=>{const A=r.shadowRoot||jo.get(r)||r.attachShadow(g);return jo.set(r,A),lh(A,c?`${c} ${$o}`:$o),A},gt=(r,c,g)=>{const A=r.querySelector(c);if(A)return A;const k=g();return r.appendChild(k),k},_=(r,c,g="")=>r.getAttribute(c)??g,$=(r,c,g,A={})=>{if(A.removeEmpty&&!g){r.removeAttribute(c);return}r.setAttribute(c,g??"")},xa=(r,c,g,A={})=>{if(g){r.setAttribute(c,""),A.aria&&r.setAttribute(`aria-${A.aria}`,"true");return}r.removeAttribute(c),A.aria&&r.removeAttribute(`aria-${A.aria}`)},ut=(r,c,g,A,k)=>{if(g!=="sheet"||A===k)return;const B=r.getAttribute("sheet")||"";B&&ch(c,B)},Ds=class extends ct{_btn;_btnContent;_iconElement;_slot;_shadowDom;_events=new xt;debounceTimeId;static get observedAttributes(){return["disabled","icon","effect","iconSize","type","sheet"]}constructor(){super(),this._shadowDom=ht(this,Qd);const r=gt(this._shadowDom,".ran-btn",()=>x().class("ran-btn").attr("part","button").role("button").tabIndex(0).children(x().class("ran-btn-content").attr("part","content").children(Bt().class("slot"))).build());this._btn=r,this._btnContent=r.querySelector(".ran-btn-content"),this._slot=r.querySelector("slot")}get sheet(){return this.getAttribute("sheet")||""}set sheet(r){this.setAttribute("sheet",r||""),this.handlerExternalCss()}get disabled(){return yt(this)}set disabled(r){!r||r==="false"?(this.removeAttribute("disabled"),this.removeAttribute("aria-disabled")):(this.setAttribute("disabled",""),this.setAttribute("aria-disabled","true"))}get iconSize(){return this.getAttribute("iconSize")||""}set iconSize(r){!r||r==="false"?this.removeAttribute("iconSize"):(this.setAttribute("iconSize",r),this.setIcon())}get icon(){return this.getAttribute("icon")||""}set icon(r){!r||r==="false"?this.removeAttribute("icon"):(this.setAttribute("icon",r),this.setIcon())}get effect(){return this.getAttribute("effect")||""}set effect(r){ce.includes(r)||!r?this.removeAttribute("effect"):this.setAttribute("effect",r)}get type(){return this.getAttribute("type")||""}set type(r){r?this.setAttribute("type",r):this.removeAttribute("type")}setIcon=()=>{if(typeof document>"u"||!this._slot)return;const r=this.icon;if(!r){this._iconElement&&(this._iconElement.remove(),this._iconElement=void 0);return}if(this._iconElement)this._iconElement.setAttribute("name",r);else{let B=this._shadowDom.querySelector("r-icon");B||(B=rt("r-icon").attr("color","currentColor").class("icon").build(),this._slot.insertAdjacentElement("beforebegin",B)),this._iconElement=B,this._iconElement.setAttribute("name",r)}const{width:c,height:g}=this._slot.getBoundingClientRect(),A=Math.min(c,g)||16,k=this.iconSize||`${A>5?A-5:A}`;this._iconElement.setAttribute("size",String(k))};mousedown=r=>{if(Xo()==="pc"&&!this.disabled){this.debounceMouseEvent();const{left:c,top:g}=this.getBoundingClientRect();this._btn.style.setProperty("--ran-x",`${r.clientX-c}px`),this._btn.style.setProperty("--ran-y",`${r.clientY-g}px`)}};mouseup=()=>{Xo()==="pc"&&(this.debounceTimeId||(this.debounceTimeId=setTimeout(()=>{this._btn.style.removeProperty("--ran-x"),this._btn.style.removeProperty("--ran-y"),this.debounceMouseEvent()},600)))};keydown=r=>{yt(this)||(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),this.click())};debounceMouseEvent=()=>{this.debounceTimeId&&(clearTimeout(this.debounceTimeId),this.debounceTimeId=void 0)};handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};syncA11yState=()=>{const r=yt(this);this._btn.setAttribute("aria-disabled",r?"true":"false"),this._btn.tabIndex=r?-1:0,r?(this.setAttribute("aria-disabled","true"),this._btnContent.setAttribute("disabled","true")):(this.removeAttribute("aria-disabled"),this._btnContent.removeAttribute("disabled"))};connectedCallback(){this.handlerExternalCss(),this.setIcon(),this.syncA11yState(),this._events.on(this._btn,"mousedown",this.mousedown).on(this._btn,"mouseup",this.mouseup).on(this._btn,"keydown",this.keydown)}disconnectedCallback(){this.debounceMouseEvent(),this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(r==="disabled"&&this._btnContent&&this.syncA11yState(),(r==="icon"||r==="iconSize")&&this.setIcon(),r==="sheet"&&this.handlerExternalCss())}};dt("r-button",Ds);var dh=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}:host{display:var(--ran-icon-host-display, inline-flex)}:host([spin]){animation-name:var(--ran-icon-host-spin-animation-name, rotate);animation-duration:var(--ran-icon-host-spin-animation-name, 1.4s);animation-timing-function:linear;animation-iteration-count:var(--ran-icon-host-spin-animation-name, infinite)}.ran-icon{display:var(--ran-icon-display, flex);align-items:var(--ran-icon-align-items, center);justify-content:var(--ran-icon-justify-content, center);color:var(--ran-icon-color, inherit);font-size:var(--ran-icon-font-size, 1em);margin:var(--ran-icon-margin, 0)}.ran-icon svg{width:var(--ran-icon-svg-width, 1em);height:var(--ran-icon-svg-height, 1em);fill:var(--ran-icon-svg-fill, currentColor);stroke:var(--ran-icon-svg-stroke, currentColor)}@keyframes rotate{to{transform:var(--ran-icon-keyframes-to-transform, rotate(360deg))}}",Rs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></g></svg>'},Ms={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></g></svg>'},Fs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></g></svg>'},Os={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3M8 21H5a2 2 0 0 1-2-2v-3m18 0v3a2 2 0 0 1-2 2h-3"/></g></svg>'},Ps={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="11" y1="8" x2="11" y2="14"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>'},Us={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/><line x1="8" y1="11" x2="14" y2="11"/></g></svg>'},Qs={success:!0,_identification:!0,data:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><g fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="23 4 23 10 17 10"/><polyline points="1 20 1 14 7 14"/><path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/></g></svg>'},hh={copy:Rs,check:Ms,download:Fs,fullscreen:Os,"zoom-in":Ps,"zoom-out":Us,refresh:Qs},uh=!1,Ns=new Map,Ja=!1,Er=r=>/<svg[\s>]/i.test(r),gh=r=>{if(typeof r=="string")return Er(r)?r:void 0;if(!r||typeof r!="object")return;const c=r,g=c.data;if(typeof g=="string"&&Er(g))return g;const A=c.default;if(typeof A=="string"&&Er(A))return A;if(A&&typeof A=="object"){const k=A;if(typeof k.data=="string"&&Er(k.data))return k.data}},ja=(r,c)=>{Ja=!0;const g=gh(c);g&&(Ns.set(`inline:${r}`,g),typeof window<"u"&&window.dispatchEvent(new CustomEvent("ranui-icon-registered",{detail:{name:r}})))},yi=r=>{Ja=!0,Object.entries(r).forEach(([c,g])=>{ja(c,g)})};yi(hh);var fh=["add-user","arrow-down","book","check","check-circle","check-circle-fill","close","close-circle","close-circle-fill","copy","download","drop","eye","eye-close","fullscreen","github","globe","home","info-circle","info-circle-fill","issue","loading","loading-scene","lock","menu","message","more","plus","power-off","preview","refresh","search","setting","sort","team","unlock","user","warning-circle","warning-circle-fill","without-content","zoom-in","zoom-out"],Hs=class extends ct{isDev=uh;_events=new xt;static get observedAttributes(){return["name","size","color","spin","decorative","aria-label","sheet"]}_icon;_div;_shadowDom;_onIconRegistered=r=>{const c=r.detail?.name;c&&c===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=ht(this,dh);const r=gt(this._shadowDom,".ran-icon",()=>x().class("ran-icon").part("ran-icon").build());this._div=r}get name(){return _(this,"name")}set name(r){r&&this.setAttribute("name",r)}get size(){return _(this,"size")}set size(r){r&&this.setAttribute("size",r)}get color(){return _(this,"color")}set color(r){r&&this.setAttribute("color",r)}get spin(){return this.hasAttribute("spin")}set spin(r){r?this.setAttribute("spin",""):this.removeAttribute("spin")}get decorative(){const r=this.getAttribute("decorative");return r==null?!this.hasAttribute("aria-label"):r!=="false"&&r!=="0"}set decorative(r){this.setAttribute("decorative",r?"true":"false")}get ariaLabel(){return _(this,"aria-label")}set ariaLabel(r){$(this,"aria-label",r,{removeEmpty:!0})}get sheet(){return _(this,"sheet")}set sheet(r){$(this,"sheet",r)}handlerExternalCss=()=>{ut(this,this._shadowDom,"sheet",null,this.sheet)};syncA11y=()=>{if(this._icon){if(this.decorative){this.setAttribute("aria-hidden","true"),this.removeAttribute("role"),this._icon.setAttribute("aria-hidden","true"),this._icon.setAttribute("focusable","false");return}this.removeAttribute("aria-hidden"),this.setAttribute("role","img"),this._icon.removeAttribute("aria-hidden"),this._icon.setAttribute("focusable","false")}};setIcon=()=>{if(typeof document>"u")return;this._icon&&(this._icon.remove(),this._icon=void 0);const r=this.name;if(r)if(r.startsWith("<svg"))this.renderSvg(r,r);else try{const c=`inline:${r}`,g=Ns.get(c);if(!g){this.isDev&&Ja&&console.warn(`[ranui-icon] icon not registered: ${r}`);return}g&&this.isSvgText(g)?this.renderSvg(g,r):this.isDev&&console.warn(`[ranui-icon] invalid svg text: ${r}`)}catch(c){this.isDev&&console.warn(`[ranui-icon] render icon failed: ${r}`,c)}};isSvgText=r=>Er(r);parseSvg=r=>{const c=new window.DOMParser().parseFromString(r,"image/svg+xml").documentElement;if(!c||c.tagName.toLowerCase()==="parsererror"||c.tagName.toLowerCase()!=="svg")return;const g=new XMLSerializer().serializeToString(c),A=rt("template").build();A.innerHTML=g.trim();const k=A.content.firstElementChild;if(!(!k||k.tagName.toLowerCase()!=="svg"))return k};renderSvg=(r,c)=>{const g=this.parseSvg(r);g?(this._icon=g,this._icon.setAttribute("part","icon-svg"),this._icon.setAttribute("data-name",c),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${c}`)};setSize=()=>{if(this._icon){const r=this.size||"1em";this._icon.setAttribute("width",r),this._icon.setAttribute("height",r);const c=/^\d+(\.\d+)?$/.test(r)?`${r}px`:r;this._icon.style.setProperty("width",c),this._icon.style.setProperty("height",c)}};setColor=()=>{if(this._icon){const r=this.color||"currentColor";this._icon.style.setProperty("color",r),this._icon.style.setProperty("fill",r),this._icon.style.setProperty("stroke",r)}};setSpin=()=>{this.spin?this._div.classList.add("ran-icon-spin"):this._div.classList.remove("ran-icon-spin")};connectedCallback(){this._events.on(window,"ranui-icon-registered",this._onIconRegistered),this.handlerExternalCss(),this.setIcon()}disconnectedCallback(){this._events.abort()}attributeChangedCallback(r,c,g){c!==g&&(r==="name"&&this.setIcon(),r==="size"&&this.setSize(),r==="color"&&this.setColor(),r==="spin"&&this.setSpin(),(r==="decorative"||r==="aria-label")&&this.syncA11y(),r==="sheet"&&this.handlerExternalCss())}};dt("r-icon",Hs);var ph={success:!0,_identification:!0,data:`<svg t="1667110768583" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8046" width="200" height="200"> <path d="M678.3 642.4c24.2-13 51.9-20.4 81.4-20.4h0.1c3 0 4.4-3.6 2.2-5.6-30.8-27.6-65.6-49.7-103.7-65.8-0.4-0.2-0.8-0.3-1.2-0.5C719.2 505 759.6 431.7 759.6 349c0-137-110.8-248-247.5-248S264.7 212 264.7 349c0 82.7 40.4 156 102.6 201.1-0.4 0.2-0.8 0.3-1.2 0.5-44.7 18.9-84.8 46-119.3 80.6-34.5 34.5-61.5 74.7-80.4 119.5C147.9 794.5 138 841 137 888.8c-0.1 4.5 3.5 8.2 8 8.2h59.9c4.3 0 7.9-3.5 8-7.8 2-77.2 32.9-149.5 87.6-204.3C357 628.2 432.2 597 512.2 597c56.7 0 111.1 15.7 158 45.1 2.5 1.5 5.5 1.7 8.1 0.3zM512.2 521c-45.8 0-88.9-17.9-121.4-50.4-32.4-32.5-50.3-75.7-50.3-121.6 0-45.9 17.9-89.1 50.3-121.6S466.3 177 512.2 177s88.9 17.9 121.4 50.4c32.4 32.5 50.3 75.7 50.3 121.6 0 45.9-17.9 89.1-50.3 121.6C601.1 503.1 558 521 512.2 521zM880 759h-84v-84c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v84h-84c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h84v84c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-84h84c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8z" p-id="8047"></path> </svg>`},Ks={success:!0,_identification:!0,data:`<svg viewBox="0 0 1024 1024" width="200" height="200" version="1.1" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> <path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path> </svg>`},Ah={success:!0,_identification:!0,data:'<svg t="1667110830636" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8464" width="200" height="200"><path d="M832 64H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V96c0-17.7-14.3-32-32-32z m-260 72h96v209.9L621.5 312 572 347.4V136z m220 752H232V136h280v296.9c0 3.3 1 6.6 3 9.3 5.1 7.2 15.1 8.9 22.3 3.7l83.8-59.9 81.4 59.4c2.7 2 6 3.1 9.4 3.1 8.8 0 16-7.2 16-16V136h64v752z" p-id="8465"></path></svg>'},Ys={success:!0,_identification:!0,data:'<svg t="1667965185400" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8572" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m193.5 301.7l-210.6 292c-12.7 17.7-39 17.7-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" p-id="8573"></path></svg>'},mh={success:!0,_identification:!0,data:'<svg t="1667483538687" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8683" width="200" height="200"><path d="M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8c12.7 17.7 39 17.7 51.7 0l210.6-292c3.9-5.3 0.1-12.7-6.4-12.7z" p-id="8684"></path><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" p-id="8685"></path></svg>'},Gs={success:!0,_identification:!0,data:'<svg t="1667965220951" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8711" width="200" height="200"><path d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64z m165.4 618.2l-66-0.3L512 563.4l-99.3 118.4-66.1 0.3c-4.4 0-8-3.5-8-8 0-1.9 0.7-3.7 1.9-5.2l130.1-155L340.5 359c-1.2-1.5-1.9-3.3-1.9-5.2 0-4.4 3.6-8 8-8l66.1 0.3L512 464.6l99.3-118.4 66-0.3c4.4 0 8 3.5 8 8 0 1.9-0.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z" p-id="8712"></path></svg>'},vh={success:!0,_identification:!0,data:'<svg t="1667483596224" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8848" width="200" height="200"><path d="M685.4 354.8c0-4.4-3.6-8-8-8l-66 0.3L512 465.6l-99.3-118.4-66.1-0.3c-4.4 0-8 3.5-8 8 0 1.9 0.7 3.7 1.9 5.2l130.1 155L340.5 670c-1.2 1.5-1.9 3.3-1.9 5.2 0 4.4 3.6 8 8 8l66.1-0.3L512 564.4l99.3 118.4 66 0.3c4.4 0 8-3.5 8-8 0-1.9-0.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" p-id="8849"></path><path d="M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65z m0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" p-id="8850"></path></svg>'},bh={success:!0,_identification:!0,data:'<svg t="1688378016663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2608" width="128" height="128"><