ranui 0.2.0-alpha.2 → 0.2.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.js +1 -1
- package/dist/{button-BstLjXNe.js → button-CJFSrjq_.js} +10 -10
- package/dist/button.js +1 -1
- package/dist/card-F-3fRynz.js +67 -0
- package/dist/card.js +1 -1
- package/dist/{checkbox-iHZQb-yQ.js → checkbox-BS5kNY6n.js} +9 -9
- package/dist/checkbox.js +1 -1
- package/dist/{colorpicker-CGh8pRqo.js → colorpicker-CdzUAVC5.js} +11 -11
- package/dist/colorpicker.js +1 -1
- package/dist/components/button/index.d.ts +1 -1
- package/dist/components/card/index.d.ts +3 -0
- package/dist/components/theme-switch/index.d.ts +36 -0
- package/dist/{dropdown-RqHMRhFE.js → dropdown-BYS1Trdu.js} +9 -9
- package/dist/dropdown.js +1 -1
- package/dist/fonts/Geist-Variable.woff2 +0 -0
- package/dist/fonts/GeistMono-Variable.woff2 +0 -0
- package/dist/fonts/OFL-LICENSE.txt +92 -0
- package/dist/fonts/fonts.css +26 -0
- package/dist/{form-05Lxxl3D.js → form-BsB5JhS4.js} +9 -9
- package/dist/form.js +1 -1
- package/dist/{icon-Blm7AbyY.js → icon-pfolda2m.js} +3 -3
- package/dist/icon.js +1 -1
- package/dist/iife/button.iife.js +1 -1
- package/dist/iife/card.iife.js +1 -1
- package/dist/iife/checkbox.iife.js +1 -1
- package/dist/iife/colorpicker.iife.js +2 -2
- package/dist/iife/dropdown.iife.js +1 -1
- package/dist/iife/form.iife.js +1 -1
- package/dist/iife/icon.iife.js +1 -1
- package/dist/iife/image.iife.js +1 -1
- package/dist/iife/input.iife.js +1 -1
- package/dist/iife/link.iife.js +1 -1
- package/dist/iife/loading.iife.js +1 -1
- package/dist/iife/math.iife.js +14 -14
- package/dist/iife/message.iife.js +1 -1
- package/dist/iife/modal.iife.js +1 -1
- package/dist/iife/player.iife.js +9 -9
- package/dist/iife/popover.iife.js +1 -1
- package/dist/iife/progress.iife.js +1 -1
- package/dist/iife/radar.iife.js +1 -1
- package/dist/iife/route.iife.js +1 -1
- package/dist/iife/router.iife.js +1 -1
- package/dist/iife/scratch.iife.js +1 -1
- package/dist/iife/section.iife.js +1 -1
- package/dist/iife/select.iife.js +2 -2
- package/dist/iife/skeleton.iife.js +1 -1
- package/dist/iife/tab.iife.js +1 -1
- package/dist/iife/tabpane.iife.js +1 -1
- package/dist/iife/theme-switch.iife.js +1 -0
- package/dist/{image-DKm6z7YQ.js → image-BXpKQ9sU.js} +9 -9
- package/dist/image.js +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.d.ts +4 -0
- package/dist/index.iife.js +67 -78
- package/dist/index.js +73 -72
- package/dist/{input-Dskw1bAl.js → input-BM6e_LQr.js} +13 -13
- package/dist/input.js +1 -1
- package/dist/{link-BW-gvrpN.js → link-DURZzd7u.js} +7 -7
- package/dist/link.js +1 -1
- package/dist/{loading-C4QUpm70.js → loading-Bd-gF1AH.js} +24 -24
- package/dist/loading.js +1 -1
- package/dist/{math-Dv4nXSoI.js → math-IjzOAwnA.js} +7 -7
- package/dist/math.js +1 -1
- package/dist/{message-De5e1txT.js → message-CLpuP8HY.js} +8 -8
- package/dist/message.js +1 -1
- package/dist/{modal-DruDj3AB.js → modal-DOTpABRe.js} +7 -7
- package/dist/modal.js +1 -1
- package/dist/{player-CqTAmg_E.js → player-C2pB5L2N.js} +7 -7
- package/dist/player.js +1 -1
- package/dist/{popover-BY32HNMl.js → popover-DRUQjdPs.js} +10 -10
- package/dist/popover.js +1 -1
- package/dist/{progress-gZo0knzu.js → progress-BIEXYYd2.js} +6 -6
- package/dist/progress.js +1 -1
- package/dist/{radar-19P5Mtld.js → radar-DAF95_Mj.js} +9 -9
- package/dist/radar.js +1 -1
- package/dist/ranui.css +1 -1
- package/dist/{route-BY_E6-2C.js → route-MQZpn2BP.js} +14 -14
- package/dist/route.js +1 -1
- package/dist/{router-BDcv4F-2.js → router-B9rCrWXm.js} +5 -5
- package/dist/router.js +1 -1
- package/dist/{scratch-Dbd9G6Q6.js → scratch-QlPyy1f4.js} +1 -1
- package/dist/scratch.js +1 -1
- package/dist/{section-CNTvgdQ-.js → section-D0qMm9KM.js} +8 -8
- package/dist/section.js +1 -1
- package/dist/{select-BVdUtQX5.js → select-BSeCT9tF.js} +13 -13
- package/dist/select.js +1 -1
- package/dist/{signal-XHfNsQNW.js → signal-CSSZxlK5.js} +1 -1
- package/dist/{skeleton-BAdJ6vyA.js → skeleton-CFqQmKyt.js} +8 -8
- package/dist/skeleton.js +1 -1
- package/dist/{tab-DH2owP2V.js → tab-CqFrgo2v.js} +5 -5
- package/dist/tab.js +1 -1
- package/dist/{tabpane-B_M-Jokw.js → tabpane-B-m3xwqu.js} +7 -7
- package/dist/tabpane.js +1 -1
- package/dist/test/unit/theme-switch.contract.test.d.ts +1 -0
- package/dist/theme-switch-B8K9y2RL.js +170 -0
- package/dist/theme-switch.js +5 -0
- package/dist/{utils-D4pPF77E.js → utils-DBfrRFoE.js} +116 -198
- package/docs/COMPONENTS.md +21 -5
- package/docs/DESIGN.md +24 -19
- package/docs/style-tokens-public.md +55 -8
- package/package.json +16 -10
- package/dist/card-DQUJoDUQ.js +0 -60
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_dropdown=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=12e4,a=`__ranuts_bridge__`,o=`default`,s=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},c=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=o){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,s.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:a,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let r=n(10);return new Promise((n,a)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),a(Error(`Request timeout`)))},i),s=e=>{clearTimeout(o),a(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{s.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:r,channel:i})=>{let a=new c(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance();function l(e){return Object.prototype.toString.call(e)}function u(e,t,n=new Map){if(e===t)return!0;if(e==null||t==null)return e===t;if(e!=e&&t!=t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r!==`object`)return e===t;let i=l(e);if(i!==l(t))return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),i===`[object Array]`){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!u(e[r],t[r],n))return!1;return!0}if(i===`[object Date]`)return+e==+t;if(i===`[object RegExp]`)return e.toString()===t.toString();if(i===`[object Map]`){if(e.size!==t.size)return!1;let r=!0;return e.forEach((e,i)=>{r&&(t.has(i)&&u(e,t.get(i),n)||(r=!1))}),r}if(i===`[object Set]`){if(e.size!==t.size)return!1;let r=Array.from(e),i=Array.from(t);return r.every(e=>i.some(t=>u(e,t,n)))}let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(let r of a)if(!Object.prototype.hasOwnProperty.call(t,r)||!u(e[r],t[r],n))return!1;return!0}var d=(e,t=new WeakMap)=>{if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=d(e[r],t);return n}if(e instanceof Map){let n=new Map;return t.set(e,n),e.forEach((e,r)=>{n.set(typeof r==`object`&&r?d(r,t):r,d(e,t))}),n}if(e instanceof Set){let n=new Set;return t.set(e,n),e.forEach(e=>{n.add(d(e,t))}),n}if(typeof e==`object`&&e.constructor===Object){let n={};return t.set(e,n),[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].forEach(r=>{n[r]=d(e[r],t)}),n}try{let n=new(Object.getPrototypeOf(e)).constructor;t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=d(e[r],t));return n}catch{return console.warn(`Unable to deeply clone object of type ${Object.prototype.toString.call(e)}. Fallback to shallow copy.`),{...e}}};new t;var f=[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],p=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new p(f[0],3609767458),new p(f[1],602891725),new p(f[2],3964484399),new p(f[3],2173295548),new p(f[4],4081628472),new p(f[5],3053834265),new p(f[6],2937671579),new p(f[7],3664609560),new p(f[8],2734883394),new p(f[9],1164996542),new p(f[10],1323610764),new p(f[11],3590304994),new p(f[12],4068182383),new p(f[13],991336113),new p(f[14],633803317),new p(f[15],3479774868),new p(f[16],2666613458),new p(f[17],944711139),new p(f[18],2341262773),new p(f[19],2007800933),new p(f[20],1495990901),new p(f[21],1856431235),new p(f[22],3175218132),new p(f[23],2198950837),new p(f[24],3999719339),new p(f[25],766784016),new p(f[26],2566594879),new p(f[27],3203337956),new p(f[28],1034457026),new p(f[29],2466948901),new p(f[30],3758326383),new p(f[31],168717936),new p(f[32],1188179964),new p(f[33],1546045734),new p(f[34],1522805485),new p(f[35],2643833823),new p(f[36],2343527390),new p(f[37],1014477480),new p(f[38],1206759142),new p(f[39],344077627),new p(f[40],1290863460),new p(f[41],3158454273),new p(f[42],3505952657),new p(f[43],106217008),new p(f[44],3606008344),new p(f[45],1432725776),new p(f[46],1467031594),new p(f[47],851169720),new p(f[48],3100823752),new p(f[49],1363258195),new p(f[50],3750685593),new p(f[51],3785050280),new p(f[52],3318307427),new p(f[53],3812723403),new p(f[54],2003034995),new p(f[55],3602036899),new p(f[56],1575990012),new p(f[57],1125592928),new p(f[58],2716904306),new p(f[59],442776044),new p(f[60],593698344),new p(f[61],3733110249),new p(f[62],2999351573),new p(f[63],3815920427),new p(3391569614,3928383900),new p(3515267271,566280711),new p(3940187606,3454069534),new p(4118630271,4000239992),new p(116418474,1914138554),new p(174292421,2731055270),new p(289380356,3203993006),new p(460393269,320620315),new p(685471733,587496836),new p(852142971,1086792851),new p(1017036298,365543100),new p(1126000580,2618297676),new p(1288033470,3409855158),new p(1501505948,4234509866),new p(1607167915,987167468),new p(1816402316,1246189591),new p(0,1),new p(0,32898),new p(2147483648,32906),new p(2147483648,2147516416),new p(0,32907),new p(0,2147483649),new p(2147483648,2147516545),new p(2147483648,32777),new p(0,138),new p(0,136),new p(0,2147516425),new p(0,2147483658),new p(0,2147516555),new p(2147483648,139),new p(2147483648,32905),new p(2147483648,32771),new p(2147483648,32770),new p(2147483648,128),new p(0,32778),new p(2147483648,2147483658),new p(2147483648,2147516545),new p(2147483648,32896),new p(0,2147483649),new p(2147483648,2147516424);var m=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},h=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},g=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(g),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(g);var _=typeof document>`u`;function v(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function y(e){return v(e)}var b=e=>typeof e==`string`?!1:`tagName`in e&&`childrenList`in e,x=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},S=(e,t,n)=>{for(let r of e)b(r)&&(x(r,t)&&n.push(r),S(r.childrenList,t,n))},C=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?v(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return S(this.childrenList,e,t),t}},w=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new C)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new T(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return S(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${y(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${y(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?v(e):(e instanceof C,e.serialize())).join(``):a+=v(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},T=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return S(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${v(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?v(e):(e instanceof C,e.serialize())).join(``)}</template>`}},E=class e{el;constructor(e){this.el=_?new w(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return _?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?_?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(_){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new D(this.el,t,e)}build(){return this.el}serialize(){if(_)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},D=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof E?this.root.appendChild(e.build()):typeof e==`string`?_?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(_)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return _?this.root.serialize():this.root.innerHTML}},O=e=>new E(e),k=()=>O(`div`),A=()=>O(`slot`),j=new Map;function M(e,t){_?(j.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var N=typeof document<`u`?HTMLElement:w,P=new Map,F=new Map,I=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!P.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),P.set(t,e)}let n=P.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},L=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!F.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),F.set(t,e)}let n=F.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},R=new WeakMap,z=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,B=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||R.get(e)||e.attachShadow(n);return R.set(e,r),I(r,t?`${t}\n${z}`:z),r},V=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},H=(e,t,n=``)=>e.getAttribute(t)??n,U=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},W=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&L(t,a)},G=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,K=300,q=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),J=class extends N{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=B(this,G);let e=V(this._shadowDom,`.ranui-dropdown-container`,()=>k().class(`ranui-dropdown-container`).children(k().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(A().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return H(this,`transit`)}set transit(e){U(this,`transit`,e,{removeEmpty:!0})}get arrow(){return H(this,`arrow`)}set arrow(e){U(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return H(this,`sheet`)}set sheet(e){U(this,`sheet`,e)}handlerExternalCss=()=>{W(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(m(this.dropdown,this.transit),setTimeout(()=>{h(this.dropdown,this.transit)},K))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=k().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(m(this.dropdown,this.transit),setTimeout(()=>{h(this.dropdown,this.transit)},K)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}};return M(`r-dropdown`,J),e.ARROW_TYPE=q,e.Dropdown=J,e.default=J,e})({});
|
|
1
|
+
var ranui_dropdown=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},n=(e=8)=>Math.random().toString(36).substring(2,e+2),r=e=>typeof e==`function`,i=12e4,a=`__ranuts_bridge__`,o=`default`,s=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},c=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,r=o){this.targetOrigin=t,this.channel=r,this.senderId=n(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,s.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:a,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:i,id:a,isResponse:o,isError:s,senderId:c}=t;if(o&&a){let e=this.pendingRequests.get(a);e&&(s?e.reject(Error(typeof i==`string`?i:`Bridge request failed`)):e.resolve(i),this.pendingRequests.delete(a));return}if(c&&c===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let l=this.messageHandlers.get(n);if(r(l)){let t=e.source??this.targetWindow;Promise.resolve(l(i)).then(e=>{a&&this.post(t,{type:n,payload:e,id:a,isResponse:!0})}).catch(e=>{a&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:a,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let r=n(10);return new Promise((n,a)=>{let o=setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),a(Error(`Request timeout`)))},i),s=e=>{clearTimeout(o),a(e)};this.pendingRequests.set(r,{resolve:e=>{clearTimeout(o),n(e)},reject:s});try{this.post(this.targetWindow,{type:e,payload:t,id:r})}catch(e){this.pendingRequests.delete(r),s(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{s.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:r,channel:i})=>{let a=new c(r,t,i);if(e||=n(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,a),{bridge:a,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new t;var l=[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],u=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new u(l[0],3609767458),new u(l[1],602891725),new u(l[2],3964484399),new u(l[3],2173295548),new u(l[4],4081628472),new u(l[5],3053834265),new u(l[6],2937671579),new u(l[7],3664609560),new u(l[8],2734883394),new u(l[9],1164996542),new u(l[10],1323610764),new u(l[11],3590304994),new u(l[12],4068182383),new u(l[13],991336113),new u(l[14],633803317),new u(l[15],3479774868),new u(l[16],2666613458),new u(l[17],944711139),new u(l[18],2341262773),new u(l[19],2007800933),new u(l[20],1495990901),new u(l[21],1856431235),new u(l[22],3175218132),new u(l[23],2198950837),new u(l[24],3999719339),new u(l[25],766784016),new u(l[26],2566594879),new u(l[27],3203337956),new u(l[28],1034457026),new u(l[29],2466948901),new u(l[30],3758326383),new u(l[31],168717936),new u(l[32],1188179964),new u(l[33],1546045734),new u(l[34],1522805485),new u(l[35],2643833823),new u(l[36],2343527390),new u(l[37],1014477480),new u(l[38],1206759142),new u(l[39],344077627),new u(l[40],1290863460),new u(l[41],3158454273),new u(l[42],3505952657),new u(l[43],106217008),new u(l[44],3606008344),new u(l[45],1432725776),new u(l[46],1467031594),new u(l[47],851169720),new u(l[48],3100823752),new u(l[49],1363258195),new u(l[50],3750685593),new u(l[51],3785050280),new u(l[52],3318307427),new u(l[53],3812723403),new u(l[54],2003034995),new u(l[55],3602036899),new u(l[56],1575990012),new u(l[57],1125592928),new u(l[58],2716904306),new u(l[59],442776044),new u(l[60],593698344),new u(l[61],3733110249),new u(l[62],2999351573),new u(l[63],3815920427),new u(3391569614,3928383900),new u(3515267271,566280711),new u(3940187606,3454069534),new u(4118630271,4000239992),new u(116418474,1914138554),new u(174292421,2731055270),new u(289380356,3203993006),new u(460393269,320620315),new u(685471733,587496836),new u(852142971,1086792851),new u(1017036298,365543100),new u(1126000580,2618297676),new u(1288033470,3409855158),new u(1501505948,4234509866),new u(1607167915,987167468),new u(1816402316,1246189591),new u(0,1),new u(0,32898),new u(2147483648,32906),new u(2147483648,2147516416),new u(0,32907),new u(0,2147483649),new u(2147483648,2147516545),new u(2147483648,32777),new u(0,138),new u(0,136),new u(0,2147516425),new u(0,2147483658),new u(0,2147516555),new u(2147483648,139),new u(2147483648,32905),new u(2147483648,32771),new u(2147483648,32770),new u(2147483648,128),new u(0,32778),new u(2147483648,2147483658),new u(2147483648,2147516545),new u(2147483648,32896),new u(0,2147483649),new u(2147483648,2147516424);var d=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)||n.add(t)},f=(e,t)=>{if(typeof document>`u`)return;let n=e.classList;n.contains(t)&&n.remove(t)},p=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(p),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(p);var m=typeof document>`u`;function h(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function g(e){return h(e)}var _=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,v=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},y=(e,t,n)=>{for(let r of e)_(r)&&(v(r,t)&&n.push(r),y(r.childrenList,t,n))},b=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?h(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return y(this.childrenList,e,t),t}},x=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new b)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new S(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return y(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${g(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),i=r?` style="${g(r)}"`:``,a=``;return this.shadowRoot&&(a+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?a+=this._innerHTML:a+=this.childrenList.map(e=>typeof e==`string`?h(e):(e instanceof b,e.serialize())).join(``):a+=h(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!a?`<${t}${n}${i} />`:`<${t}${n}${i}>${a}</${t}>`}},S=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return y(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${h(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?h(e):(e instanceof b,e.serialize())).join(``)}</template>`}},C=class e{el;constructor(e){this.el=m?new x(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return m?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?m?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(m){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new w(this.el,t,e)}build(){return this.el}serialize(){if(m)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},w=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof C?this.root.appendChild(e.build()):typeof e==`string`?m?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(m)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return m?this.root.serialize():this.root.innerHTML}},T=e=>new C(e),E=()=>T(`div`),D=()=>T(`slot`),O=new Map;function k(e,t){m?(O.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var A=typeof document<`u`?HTMLElement:x,j=new Map,M=new Map,N=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!j.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),j.set(t,e)}let n=j.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},P=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!M.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),M.set(t,e)}let n=M.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},F=new WeakMap,I=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,L=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||F.get(e)||e.attachShadow(n);return F.set(e,r),N(r,t?`${t}\n${I}`:I),r},R=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},z=(e,t,n=``)=>e.getAttribute(t)??n,B=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},V=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&P(t,a)},H=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}@keyframes ranui-dropdown-up-in{0%{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}to{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-up-out{0%{transform-origin:100% 100%;opacity:1;transform:scaleY(1)}to{transform-origin:100% 100%;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-down-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(.8)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes ranui-dropdown-down-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(.8)}}@keyframes ranui-dropdown-left-in{0%{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}to{transform-origin:100% 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-left-out{0%{transform-origin:100% 0;opacity:1;transform:scaleX(1)}to{transform-origin:100% 0;opacity:0;transform:scaleX(.8)}}@keyframes ranui-dropdown-right-in{0%{transform-origin:0 0;opacity:0;transform:scaleX(.8)}to{transform-origin:0 0;opacity:1;transform:scaleX(1)}}@keyframes ranui-dropdown-right-out{0%{transform-origin:0 0;opacity:1;transform:scaleX(1)}to{transform-origin:0 0;opacity:0;transform:scaleX(.8)}}.ran-dropdown-down-in{animation:.1s forwards ranui-dropdown-down-in}.ran-dropdown-down-out{animation:.1s forwards ranui-dropdown-down-out}.ran-dropdown-up-in{animation:.1s forwards ranui-dropdown-up-in}.ran-dropdown-up-out{animation:.1s forwards ranui-dropdown-up-out}.ran-dropdown-left-in{animation:.1s forwards ranui-dropdown-left-in}.ran-dropdown-left-out{animation:.1s forwards ranui-dropdown-left-out}.ran-dropdown-right-in{animation:.1s forwards ranui-dropdown-right-in}.ran-dropdown-right-out{animation:.1s forwards ranui-dropdown-right-out}:host{text-align:var(--ran-dropdown-host-text-align,left);z-index:var(--ran-dropdown-host-z-index,var(--ran-z-dropdown,1100))}.ranui-dropdown{transform-origin:var(--ran-x,50%) var(--ran-y,50%);box-sizing:var(--ran-dropdown-box-sizing,border-box);margin:var(--ran-dropdown-margin,0);padding:var(--ran-dropdown-padding,0);color:var(--ran-dropdown-color,var(--ran-color-text,#000000e0));font-size:var(--ran-dropdown-font-size,14px);list-style:var(--ran-dropdown-list-style,none);font-family:var(--ran-dropdown-font-family,var(--ran-skin-font-family,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"));z-index:var(--ran-dropdown-z-index,1050);overflow:var(--ran-dropdown-overflow,hidden);font-variant:var(--ran-dropdown-font-variant,initial);background:var(--ran-dropdown-background,var(--ran-color-bg-elevated,#fff));border-radius:var(--ran-dropdown-border-radius,var(--ran-radius-md,12px));outline:var(--ran-dropdown-outline,none);box-shadow:var(--ran-dropdown-box-shadow,var(--ran-shadow-menu,var(--ran-shadow-elevated,0 6px 16px 0 #00000014, 0 3px 6px -4px #0000001f, 0 9px 28px 8px #0000000d)));cursor:var(--ran-dropdown-cursor,auto);width:var(--ran-dropdown-width,100%);height:var(--ran-dropdown-height,100%);min-height:var(--ran-dropdown-min-height,100%);min-width:var(--ran-dropdown-min-width,100%)}.ranui-dropdown-container{position:var(--ran-dropdown-container-position,relative);display:var(--ran-dropdown-container-display,block);width:var(--ran-dropdown-container-width,100%);height:var(--ran-dropdown-container-height,100%);box-sizing:var(--ran-dropdown-container-box-sizing,border-box)}.ranui-dropdown-container .top{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(calc(-1 * var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px)) + var(--ran-dropdown-arrow-overlap,2px))) rotate(0deg);top:0}.ranui-dropdown-container .bottom{transform:translateX(calc(var(--ran-dropdown-arrow-anchor-width,var(--ran-dropdown-min-width,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2))) translateY(var(--ran-dropdown-arrow-overlap,2px)) rotate(180deg);top:max(0px, calc(var(--ran-dropdown-min-height,100%) - calc(var(--ran-dropdown-arrow-width,16px) / 4)))}.ranui-dropdown-container .left{transform:translateX(calc(0px - var(--ran-dropdown-arrow-width,16px))) translateY(calc(var(--ran-dropdown-arrow-width,16px) / 2 + var(--ran-dropdown-arrow-overlap,2px))) rotate(270deg);top:max(0px, calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - var(--ran-dropdown-arrow-width,16px)))}.ranui-dropdown-container .right{transform:translateX(0) translateY(calc(var(--ran-dropdown-arrow-anchor-height,var(--ran-dropdown-min-height,100%)) / 2 - calc(var(--ran-dropdown-arrow-width,16px) / 2) + var(--ran-dropdown-arrow-overlap,2px))) rotate(90deg);top:0;left:100%}.ranui-dropdown-arrow{position:var(--ran-dropdown-arrow-position,absolute);box-sizing:var(--ran-dropdown-arrow-box-sizing,border-box);z-index:var(--ran-dropdown-arrow-z-index,1);display:var(--ran-dropdown-arrow-display,block);pointer-events:var(--ran-dropdown-arrow-pointer-events,none);width:var(--ran-dropdown-arrow-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-height,var(--ran-dropdown-arrow-width,16px));overflow:var(--ran-dropdown-arrow-overflow,hidden)}.ranui-dropdown-arrow:before{background:var(--ran-dropdown-arrow-before-background,var(--ran-color-bg-elevated,#fff));position:var(--ran-dropdown-arrow-before-position,absolute);bottom:var(--ran-dropdown-arrow-before-bottom,0);width:var(--ran-dropdown-arrow-before-width,var(--ran-dropdown-arrow-width,16px));height:var(--ran-dropdown-arrow-before-height,calc(var(--ran-dropdown-arrow-width,16px) / 2));clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:var(--ran-dropdown-arrow-before-content,"");inset-inline-start:0}.ranui-dropdown-arrow:after{content:var(--ran-dropdown-arrow-after-content,"");position:var(--ran-dropdown-arrow-after-position,absolute);width:var(--ran-dropdown-arrow-after-width,9px);height:var(--ran-dropdown-arrow-after-height,9px);bottom:var(--ran-dropdown-arrow-after-bottom,0);margin:var(--ran-dropdown-arrow-after-margin,auto);border-radius:var(--ran-dropdown-arrow-after-border-radius,0 0 2px 0);transform:var(--ran-dropdown-arrow-after-transform,translateY(50%) rotate(-135deg));box-shadow:var(--ran-dropdown-arrow-after-box-shadow,2px 2px 5px #0000000d);z-index:var(--ran-dropdown-arrow-after-z-index,0);background:var(--ran-dropdown-arrow-after-background,var(--ran-color-bg-elevated,#fff));inset-inline:0}`,U=300,W=function(e){return e.TOP=`top`,e.BOTTOM=`bottom`,e.LEFT=`left`,e.RIGHT=`right`,e}({}),G=class extends A{dropdown;_slot;_shadowDom;arrowIcon;container;static get observedAttributes(){return[`transit`,`arrow`,`sheet`]}constructor(){super(),this._shadowDom=L(this,H);let e=R(this._shadowDom,`.ranui-dropdown-container`,()=>E().class(`ranui-dropdown-container`).children(E().style(`-webkit-tap-highlight-color`,`transparent`).style(`outline`,`0`).class(`ranui-dropdown`).part(`dropdown`).children(D().class(`slot`))).build());this.container=e,this.dropdown=e.querySelector(`.ranui-dropdown`),this._slot=e.querySelector(`.slot`)}get transit(){return z(this,`transit`)}set transit(e){B(this,`transit`,e,{removeEmpty:!0})}get arrow(){return z(this,`arrow`)}set arrow(e){B(this,`arrow`,e,{removeEmpty:!0})}get sheet(){return z(this,`sheet`)}set sheet(e){B(this,`sheet`,e)}handlerExternalCss=()=>{V(this,this._shadowDom,`sheet`,null,this.sheet)};handlerTransit=()=>{this.transit&&this.dropdown&&(d(this.dropdown,this.transit),setTimeout(()=>{f(this.dropdown,this.transit)},U))};handlerArrow=()=>{let e=(this.arrow||``).trim();if(!e){this.arrowIcon&&this.container.contains(this.arrowIcon)&&this.container.removeChild(this.arrowIcon),this.arrowIcon=void 0;return}!this.arrowIcon&&this.container&&(this.arrowIcon=E().class(`ranui-dropdown-arrow`).build(),this.container.appendChild(this.arrowIcon)),this.arrowIcon&&(this.arrowIcon.className=`ranui-dropdown-arrow ${e}`)};stopPropagation=e=>{e.stopPropagation()};connectedCallback(){this.handlerExternalCss(),this.handlerTransit(),this.handlerArrow()}disconnectedCallback(){}attributeChangedCallback(e,t,n){e===`transit`&&n&&(d(this.dropdown,this.transit),setTimeout(()=>{f(this.dropdown,this.transit)},U)),e===`arrow`&&this.handlerArrow(),e===`sheet`&&t!==n&&this.handlerExternalCss()}};return k(`r-dropdown`,G),e.ARROW_TYPE=W,e.Dropdown=G,e.default=G,e})({});
|
package/dist/iife/form.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_form=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=typeof document>`u`;function n(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function r(e){return n(e)}var i=e=>typeof e==`string`?!1:`tagName`in e&&`childrenList`in e,a=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},o=(e,t,n)=>{for(let r of e)i(r)&&(a(r,t)&&n.push(r),o(r.childrenList,t,n))},s=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?n(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}},c=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new s)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new l(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,i=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${r(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${r(a)}"`:``,c=``;return this.shadowRoot&&(c+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?c+=this._innerHTML:c+=this.childrenList.map(e=>typeof e==`string`?n(e):(e instanceof s,e.serialize())).join(``):c+=n(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!c?`<${t}${i}${o} />`:`<${t}${i}${o}>${c}</${t}>`}},l=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${n(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?n(e):(e instanceof s,e.serialize())).join(``)}</template>`}},u=class e{el;constructor(e){this.el=t?new c(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return t?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...n){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(n).forEach(n=>{n!=null&&(n instanceof e?this.el.appendChild(n.build()):typeof n==`string`?t?this.el.appendChild(n):this.el.appendChild(document.createTextNode(n)):this.el.appendChild(n))}),this}replaceChildren(...e){if(t){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new d(this.el,t,e)}build(){return this.el}serialize(){if(t)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},d=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(e).forEach(e=>{e!=null&&(e instanceof u?this.root.appendChild(e.build()):typeof e==`string`?t?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(t)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let n=document.createElement(`style`);return n.textContent=e,this.root.appendChild(n),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return t?this.root.serialize():this.root.innerHTML}},f=e=>new u(e),p=()=>f(`slot`),m=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}`,h=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},g=(e=8)=>Math.random().toString(36).substring(2,e+2),_=e=>typeof e==`function`,v=12e4,y=`__ranuts_bridge__`,b=`default`,x=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},S=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=b){this.targetOrigin=t,this.channel=n,this.senderId=g(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,x.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:y,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(_(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=g(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},v),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{x.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new S(n,t,r);if(e||=g(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance();function C(e){return Object.prototype.toString.call(e)}function w(e,t,n=new Map){if(e===t)return!0;if(e==null||t==null)return e===t;if(e!=e&&t!=t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r!==`object`)return e===t;let i=C(e);if(i!==C(t))return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),i===`[object Array]`){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!w(e[r],t[r],n))return!1;return!0}if(i===`[object Date]`)return+e==+t;if(i===`[object RegExp]`)return e.toString()===t.toString();if(i===`[object Map]`){if(e.size!==t.size)return!1;let r=!0;return e.forEach((e,i)=>{r&&(t.has(i)&&w(e,t.get(i),n)||(r=!1))}),r}if(i===`[object Set]`){if(e.size!==t.size)return!1;let r=Array.from(e),i=Array.from(t);return r.every(e=>i.some(t=>w(e,t,n)))}let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(let r of a)if(!Object.prototype.hasOwnProperty.call(t,r)||!w(e[r],t[r],n))return!1;return!0}var T=(e,t=new WeakMap)=>{if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=T(e[r],t);return n}if(e instanceof Map){let n=new Map;return t.set(e,n),e.forEach((e,r)=>{n.set(typeof r==`object`&&r?T(r,t):r,T(e,t))}),n}if(e instanceof Set){let n=new Set;return t.set(e,n),e.forEach(e=>{n.add(T(e,t))}),n}if(typeof e==`object`&&e.constructor===Object){let n={};return t.set(e,n),[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].forEach(r=>{n[r]=T(e[r],t)}),n}try{let n=new(Object.getPrototypeOf(e)).constructor;t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=T(e[r],t));return n}catch{return console.warn(`Unable to deeply clone object of type ${Object.prototype.toString.call(e)}. Fallback to shallow copy.`),{...e}}};new h;var E=[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],D=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new D(E[0],3609767458),new D(E[1],602891725),new D(E[2],3964484399),new D(E[3],2173295548),new D(E[4],4081628472),new D(E[5],3053834265),new D(E[6],2937671579),new D(E[7],3664609560),new D(E[8],2734883394),new D(E[9],1164996542),new D(E[10],1323610764),new D(E[11],3590304994),new D(E[12],4068182383),new D(E[13],991336113),new D(E[14],633803317),new D(E[15],3479774868),new D(E[16],2666613458),new D(E[17],944711139),new D(E[18],2341262773),new D(E[19],2007800933),new D(E[20],1495990901),new D(E[21],1856431235),new D(E[22],3175218132),new D(E[23],2198950837),new D(E[24],3999719339),new D(E[25],766784016),new D(E[26],2566594879),new D(E[27],3203337956),new D(E[28],1034457026),new D(E[29],2466948901),new D(E[30],3758326383),new D(E[31],168717936),new D(E[32],1188179964),new D(E[33],1546045734),new D(E[34],1522805485),new D(E[35],2643833823),new D(E[36],2343527390),new D(E[37],1014477480),new D(E[38],1206759142),new D(E[39],344077627),new D(E[40],1290863460),new D(E[41],3158454273),new D(E[42],3505952657),new D(E[43],106217008),new D(E[44],3606008344),new D(E[45],1432725776),new D(E[46],1467031594),new D(E[47],851169720),new D(E[48],3100823752),new D(E[49],1363258195),new D(E[50],3750685593),new D(E[51],3785050280),new D(E[52],3318307427),new D(E[53],3812723403),new D(E[54],2003034995),new D(E[55],3602036899),new D(E[56],1575990012),new D(E[57],1125592928),new D(E[58],2716904306),new D(E[59],442776044),new D(E[60],593698344),new D(E[61],3733110249),new D(E[62],2999351573),new D(E[63],3815920427),new D(3391569614,3928383900),new D(3515267271,566280711),new D(3940187606,3454069534),new D(4118630271,4000239992),new D(116418474,1914138554),new D(174292421,2731055270),new D(289380356,3203993006),new D(460393269,320620315),new D(685471733,587496836),new D(852142971,1086792851),new D(1017036298,365543100),new D(1126000580,2618297676),new D(1288033470,3409855158),new D(1501505948,4234509866),new D(1607167915,987167468),new D(1816402316,1246189591),new D(0,1),new D(0,32898),new D(2147483648,32906),new D(2147483648,2147516416),new D(0,32907),new D(0,2147483649),new D(2147483648,2147516545),new D(2147483648,32777),new D(0,138),new D(0,136),new D(0,2147516425),new D(0,2147483658),new D(0,2147516555),new D(2147483648,139),new D(2147483648,32905),new D(2147483648,32771),new D(2147483648,32770),new D(2147483648,128),new D(0,32778),new D(2147483648,2147483658),new D(2147483648,2147516545),new D(2147483648,32896),new D(0,2147483649),new D(2147483648,2147516424);var O=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(O),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(O);var k=new Map;function A(e,n){t?(k.set(e,n),n.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,n)}var j=typeof document<`u`?HTMLElement:c,M=new Map,N=new Map,P=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!M.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),M.set(t,e)}let n=M.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},F=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!N.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),N.set(t,e)}let n=N.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},I=new WeakMap,L=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,R=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||I.get(e)||e.attachShadow(n);return I.set(e,r),P(r,t?`${t}\n${L}`:L),r},z=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},B=(e,t,n=``)=>e.getAttribute(t)??n,V=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},H=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&F(t,a)},U=class extends j{_form;_shadowDom;static get observedAttributes(){return[`sheet`]}constructor(){super(),this._shadowDom=R(this,m),this._form=z(this._shadowDom,`.r-form`,()=>f(`form`).class(`r-form`).children(p().attr(`name`,`r-form_content`)).build())}get value(){return this.getAttribute(`value`)}set value(e){e!=null&&this.setAttribute(`value`,e)}get sheet(){return B(this,`sheet`)}set sheet(e){V(this,`sheet`,e)}handlerExternalCss=()=>{H(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss();let e={},t=new FormData(this._form);t.forEach((n,r)=>{e[r]||(e[r]=t.getAll(r).length>1?t.getAll(r):t.get(r))}),this._form.addEventListener(`submit`,()=>{this.value=JSON.stringify(e)})}attributeChangedCallback(e,t,n){t!==n&&e===`sheet`&&this.handlerExternalCss()}};return A(`r-form`,U),e.Form=U,e.default=U,e})({});
|
|
1
|
+
var ranui_form=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=typeof document>`u`;function n(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function r(e){return n(e)}var i=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,a=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},o=(e,t,n)=>{for(let r of e)i(r)&&(a(r,t)&&n.push(r),o(r.childrenList,t,n))},s=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?n(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}},c=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new s)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new l(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,i=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${r(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${r(a)}"`:``,c=``;return this.shadowRoot&&(c+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?c+=this._innerHTML:c+=this.childrenList.map(e=>typeof e==`string`?n(e):(e instanceof s,e.serialize())).join(``):c+=n(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!c?`<${t}${i}${o} />`:`<${t}${i}${o}>${c}</${t}>`}},l=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return o(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${n(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?n(e):(e instanceof s,e.serialize())).join(``)}</template>`}},u=class e{el;constructor(e){this.el=t?new c(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return t?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...n){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(n).forEach(n=>{n!=null&&(n instanceof e?this.el.appendChild(n.build()):typeof n==`string`?t?this.el.appendChild(n):this.el.appendChild(document.createTextNode(n)):this.el.appendChild(n))}),this}replaceChildren(...e){if(t){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new d(this.el,t,e)}build(){return this.el}serialize(){if(t)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},d=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let n=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(n(t)):e.concat(t),[]);return n(e).forEach(e=>{e!=null&&(e instanceof u?this.root.appendChild(e.build()):typeof e==`string`?t?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(t)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let n=document.createElement(`style`);return n.textContent=e,this.root.appendChild(n),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return t?this.root.serialize():this.root.innerHTML}},f=e=>new u(e),p=()=>f(`slot`),m=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}`,h=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},g=(e=8)=>Math.random().toString(36).substring(2,e+2),_=e=>typeof e==`function`,v=12e4,y=`__ranuts_bridge__`,b=`default`,x=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},S=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=b){this.targetOrigin=t,this.channel=n,this.senderId=g(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,x.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:y,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(_(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=g(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},v),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{x.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new S(n,t,r);if(e||=g(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new h;var C=[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],w=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new w(C[0],3609767458),new w(C[1],602891725),new w(C[2],3964484399),new w(C[3],2173295548),new w(C[4],4081628472),new w(C[5],3053834265),new w(C[6],2937671579),new w(C[7],3664609560),new w(C[8],2734883394),new w(C[9],1164996542),new w(C[10],1323610764),new w(C[11],3590304994),new w(C[12],4068182383),new w(C[13],991336113),new w(C[14],633803317),new w(C[15],3479774868),new w(C[16],2666613458),new w(C[17],944711139),new w(C[18],2341262773),new w(C[19],2007800933),new w(C[20],1495990901),new w(C[21],1856431235),new w(C[22],3175218132),new w(C[23],2198950837),new w(C[24],3999719339),new w(C[25],766784016),new w(C[26],2566594879),new w(C[27],3203337956),new w(C[28],1034457026),new w(C[29],2466948901),new w(C[30],3758326383),new w(C[31],168717936),new w(C[32],1188179964),new w(C[33],1546045734),new w(C[34],1522805485),new w(C[35],2643833823),new w(C[36],2343527390),new w(C[37],1014477480),new w(C[38],1206759142),new w(C[39],344077627),new w(C[40],1290863460),new w(C[41],3158454273),new w(C[42],3505952657),new w(C[43],106217008),new w(C[44],3606008344),new w(C[45],1432725776),new w(C[46],1467031594),new w(C[47],851169720),new w(C[48],3100823752),new w(C[49],1363258195),new w(C[50],3750685593),new w(C[51],3785050280),new w(C[52],3318307427),new w(C[53],3812723403),new w(C[54],2003034995),new w(C[55],3602036899),new w(C[56],1575990012),new w(C[57],1125592928),new w(C[58],2716904306),new w(C[59],442776044),new w(C[60],593698344),new w(C[61],3733110249),new w(C[62],2999351573),new w(C[63],3815920427),new w(3391569614,3928383900),new w(3515267271,566280711),new w(3940187606,3454069534),new w(4118630271,4000239992),new w(116418474,1914138554),new w(174292421,2731055270),new w(289380356,3203993006),new w(460393269,320620315),new w(685471733,587496836),new w(852142971,1086792851),new w(1017036298,365543100),new w(1126000580,2618297676),new w(1288033470,3409855158),new w(1501505948,4234509866),new w(1607167915,987167468),new w(1816402316,1246189591),new w(0,1),new w(0,32898),new w(2147483648,32906),new w(2147483648,2147516416),new w(0,32907),new w(0,2147483649),new w(2147483648,2147516545),new w(2147483648,32777),new w(0,138),new w(0,136),new w(0,2147516425),new w(0,2147483658),new w(0,2147516555),new w(2147483648,139),new w(2147483648,32905),new w(2147483648,32771),new w(2147483648,32770),new w(2147483648,128),new w(0,32778),new w(2147483648,2147483658),new w(2147483648,2147516545),new w(2147483648,32896),new w(0,2147483649),new w(2147483648,2147516424);var T=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(T),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(T);var E=new Map;function D(e,n){t?(E.set(e,n),n.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,n)}var O=typeof document<`u`?HTMLElement:c,k=new Map,A=new Map,j=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!k.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),k.set(t,e)}let n=k.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},M=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!A.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),A.set(t,e)}let n=A.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},N=new WeakMap,P=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,F=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||N.get(e)||e.attachShadow(n);return N.set(e,r),j(r,t?`${t}\n${P}`:P),r},I=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},L=(e,t,n=``)=>e.getAttribute(t)??n,R=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},z=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&M(t,a)},B=class extends O{_form;_shadowDom;static get observedAttributes(){return[`sheet`]}constructor(){super(),this._shadowDom=F(this,m),this._form=I(this._shadowDom,`.r-form`,()=>f(`form`).class(`r-form`).children(p().attr(`name`,`r-form_content`)).build())}get value(){return this.getAttribute(`value`)}set value(e){e!=null&&this.setAttribute(`value`,e)}get sheet(){return L(this,`sheet`)}set sheet(e){R(this,`sheet`,e)}handlerExternalCss=()=>{z(this,this._shadowDom,`sheet`,null,this.sheet)};connectedCallback(){this.handlerExternalCss();let e={},t=new FormData(this._form);t.forEach((n,r)=>{e[r]||(e[r]=t.getAll(r).length>1?t.getAll(r):t.get(r))}),this._form.addEventListener(`submit`,()=>{this.value=JSON.stringify(e)})}attributeChangedCallback(e,t,n){t!==n&&e===`sheet`&&this.handlerExternalCss()}};return D(`r-form`,B),e.Form=B,e.default=B,e})({});
|
package/dist/iife/icon.iife.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var ranui_icon=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}: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))}}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}};function i(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function a(e){return i(e)}var o=e=>typeof e==`string`?!1:`tagName`in e&&`childrenList`in e,s=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},c=(e,t,n)=>{for(let r of e)o(r)&&(s(r,t)&&n.push(r),c(r.childrenList,t,n))},l=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}},u=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new l)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new d(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${a(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=r?` style="${a(r)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof l,e.serialize())).join(``):s+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},d=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${i(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof l,e.serialize())).join(``)}</template>`}},f=class e{el;constructor(e){this.el=n?new u(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new p(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},p=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof f?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},m=e=>new f(e),h=()=>m(`div`),g=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},_=(e=8)=>Math.random().toString(36).substring(2,e+2),v=e=>typeof e==`function`,y=12e4,b=`__ranuts_bridge__`,x=`default`,S=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},C=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=x){this.targetOrigin=t,this.channel=n,this.senderId=_(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,S.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:b,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(v(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=_(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},y),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{S.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new C(n,t,r);if(e||=_(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance();function w(e){return Object.prototype.toString.call(e)}function T(e,t,n=new Map){if(e===t)return!0;if(e==null||t==null)return e===t;if(e!=e&&t!=t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r!==`object`)return e===t;let i=w(e);if(i!==w(t))return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),i===`[object Array]`){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!T(e[r],t[r],n))return!1;return!0}if(i===`[object Date]`)return+e==+t;if(i===`[object RegExp]`)return e.toString()===t.toString();if(i===`[object Map]`){if(e.size!==t.size)return!1;let r=!0;return e.forEach((e,i)=>{r&&(t.has(i)&&T(e,t.get(i),n)||(r=!1))}),r}if(i===`[object Set]`){if(e.size!==t.size)return!1;let r=Array.from(e),i=Array.from(t);return r.every(e=>i.some(t=>T(e,t,n)))}let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(let r of a)if(!Object.prototype.hasOwnProperty.call(t,r)||!T(e[r],t[r],n))return!1;return!0}var E=(e,t=new WeakMap)=>{if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=E(e[r],t);return n}if(e instanceof Map){let n=new Map;return t.set(e,n),e.forEach((e,r)=>{n.set(typeof r==`object`&&r?E(r,t):r,E(e,t))}),n}if(e instanceof Set){let n=new Set;return t.set(e,n),e.forEach(e=>{n.add(E(e,t))}),n}if(typeof e==`object`&&e.constructor===Object){let n={};return t.set(e,n),[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].forEach(r=>{n[r]=E(e[r],t)}),n}try{let n=new(Object.getPrototypeOf(e)).constructor;t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=E(e[r],t));return n}catch{return console.warn(`Unable to deeply clone object of type ${Object.prototype.toString.call(e)}. Fallback to shallow copy.`),{...e}}};new g;var D=[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],O=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new O(D[0],3609767458),new O(D[1],602891725),new O(D[2],3964484399),new O(D[3],2173295548),new O(D[4],4081628472),new O(D[5],3053834265),new O(D[6],2937671579),new O(D[7],3664609560),new O(D[8],2734883394),new O(D[9],1164996542),new O(D[10],1323610764),new O(D[11],3590304994),new O(D[12],4068182383),new O(D[13],991336113),new O(D[14],633803317),new O(D[15],3479774868),new O(D[16],2666613458),new O(D[17],944711139),new O(D[18],2341262773),new O(D[19],2007800933),new O(D[20],1495990901),new O(D[21],1856431235),new O(D[22],3175218132),new O(D[23],2198950837),new O(D[24],3999719339),new O(D[25],766784016),new O(D[26],2566594879),new O(D[27],3203337956),new O(D[28],1034457026),new O(D[29],2466948901),new O(D[30],3758326383),new O(D[31],168717936),new O(D[32],1188179964),new O(D[33],1546045734),new O(D[34],1522805485),new O(D[35],2643833823),new O(D[36],2343527390),new O(D[37],1014477480),new O(D[38],1206759142),new O(D[39],344077627),new O(D[40],1290863460),new O(D[41],3158454273),new O(D[42],3505952657),new O(D[43],106217008),new O(D[44],3606008344),new O(D[45],1432725776),new O(D[46],1467031594),new O(D[47],851169720),new O(D[48],3100823752),new O(D[49],1363258195),new O(D[50],3750685593),new O(D[51],3785050280),new O(D[52],3318307427),new O(D[53],3812723403),new O(D[54],2003034995),new O(D[55],3602036899),new O(D[56],1575990012),new O(D[57],1125592928),new O(D[58],2716904306),new O(D[59],442776044),new O(D[60],593698344),new O(D[61],3733110249),new O(D[62],2999351573),new O(D[63],3815920427),new O(3391569614,3928383900),new O(3515267271,566280711),new O(3940187606,3454069534),new O(4118630271,4000239992),new O(116418474,1914138554),new O(174292421,2731055270),new O(289380356,3203993006),new O(460393269,320620315),new O(685471733,587496836),new O(852142971,1086792851),new O(1017036298,365543100),new O(1126000580,2618297676),new O(1288033470,3409855158),new O(1501505948,4234509866),new O(1607167915,987167468),new O(1816402316,1246189591),new O(0,1),new O(0,32898),new O(2147483648,32906),new O(2147483648,2147516416),new O(0,32907),new O(0,2147483649),new O(2147483648,2147516545),new O(2147483648,32777),new O(0,138),new O(0,136),new O(0,2147516425),new O(0,2147483658),new O(0,2147516555),new O(2147483648,139),new O(2147483648,32905),new O(2147483648,32771),new O(2147483648,32770),new O(2147483648,128),new O(0,32778),new O(2147483648,2147483658),new O(2147483648,2147516545),new O(2147483648,32896),new O(0,2147483649),new O(2147483648,2147516424);var k=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(k),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(k);var A=new Map;function j(e,t){n?(A.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var M=typeof document<`u`?HTMLElement:u,N=new Map,P=new Map,F=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!N.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),N.set(t,e)}let n=N.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},I=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!P.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),P.set(t,e)}let n=P.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},L=new WeakMap,R=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,z=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||L.get(e)||e.attachShadow(n);return L.set(e,r),F(r,t?`${t}\n${R}`:R),r},B=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},V=(e,t,n=``)=>e.getAttribute(t)??n,H=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},U=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&I(t,a)},W=!1,G=new Map,K=!1,q=e=>/<svg[\s>]/i.test(e),J=e=>{if(typeof e==`string`)return q(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&q(n))return n;let r=t.default;if(typeof r==`string`&&q(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&q(e.data))return e.data}},Y=(e,t)=>{K=!0;let n=J(t);n&&(G.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))},X=e=>{K=!0,Object.entries(e).forEach(([e,t])=>{Y(e,t)})},Z=class extends M{isDev=W;_events=new r;static get observedAttributes(){return[`name`,`size`,`color`,`spin`,`decorative`,`aria-label`,`sheet`]}_icon;_div;_shadowDom;_onIconRegistered=e=>{let t=e.detail?.name;t&&t===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=z(this,t);let e=B(this._shadowDom,`.ran-icon`,()=>h().class(`ran-icon`).part(`ran-icon`).build());this._div=e}get name(){return V(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return V(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return V(this,`color`)}set color(e){e&&this.setAttribute(`color`,e)}get spin(){return this.hasAttribute(`spin`)}set spin(e){e?this.setAttribute(`spin`,``):this.removeAttribute(`spin`)}get decorative(){let e=this.getAttribute(`decorative`);return e==null?!this.hasAttribute(`aria-label`):e!==`false`&&e!==`0`}set decorative(e){this.setAttribute(`decorative`,e?`true`:`false`)}get ariaLabel(){return V(this,`aria-label`)}set ariaLabel(e){H(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return V(this,`sheet`)}set sheet(e){H(this,`sheet`,e)}handlerExternalCss=()=>{U(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(),void 0);let e=this.name;if(e)if(e.startsWith(`<svg`))this.renderSvg(e,e);else try{let t=`inline:${e}`,n=G.get(t);if(!n){this.isDev&&K&&console.warn(`[ranui-icon] icon not registered: ${e}`);return}n&&this.isSvgText(n)?this.renderSvg(n,e):this.isDev&&console.warn(`[ranui-icon] invalid svg text: ${e}`)}catch(t){this.isDev&&console.warn(`[ranui-icon] render icon failed: ${e}`,t)}};isSvgText=e=>q(e);parseSvg=e=>{let t=new window.DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.tagName.toLowerCase()===`parsererror`||t.tagName.toLowerCase()!==`svg`)return;let n=new XMLSerializer().serializeToString(t),r=m(`template`).build();r.innerHTML=n.trim();let i=r.content.firstElementChild;if(!(!i||i.tagName.toLowerCase()!==`svg`))return i};renderSvg=(e,t)=>{let n=this.parseSvg(e);n?(this._icon=n,this._icon.setAttribute(`part`,`icon-svg`),this._icon.setAttribute(`data-name`,t),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${t}`)};setSize=()=>{if(this._icon){let e=this.size||`1em`;this._icon.setAttribute(`width`,e),this._icon.setAttribute(`height`,e);let t=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;this._icon.style.setProperty(`width`,t),this._icon.style.setProperty(`height`,t)}};setColor=()=>{if(this._icon){let e=this.color||`currentColor`;this._icon.style.setProperty(`color`,e),this._icon.style.setProperty(`fill`,e),this._icon.style.setProperty(`stroke`,e)}};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(e,t,n){t!==n&&(e===`name`&&this.setIcon(),e===`size`&&this.setSize(),e===`color`&&this.setColor(),e===`spin`&&this.setSpin(),(e===`decorative`||e===`aria-label`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}};return j(`r-icon`,Z),e.Icon=Z,e.registerIcon=Y,e.registerIcons=X,e})({});
|
|
1
|
+
var ranui_icon=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}: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))}}`,n=typeof document>`u`,r=class{ac;constructor(){this.ac=new AbortController}get signal(){return this.ac.signal}on(e,t,n,r){return e.addEventListener(t,n,{...r,signal:this.ac.signal}),this}delegate(e,t,n,r,i){return e.addEventListener(n,n=>{let i=n.target?.closest(t);i&&e.contains(i)&&r(n,i)},{...i,signal:this.ac.signal}),this}abort(){this.ac.abort(),this.ac=new AbortController}};function i(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function a(e){return i(e)}var o=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,s=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},c=(e,t,n)=>{for(let r of e)o(r)&&(s(r,t)&&n.push(r),c(r.childrenList,t,n))},l=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?i(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}},u=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new l)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new d(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${a(t)}"`).join(``),r=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=r?` style="${a(r)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof l,e.serialize())).join(``):s+=i(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},d=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return c(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${i(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?i(e):(e instanceof l,e.serialize())).join(``)}</template>`}},f=class e{el;constructor(e){this.el=n?new u(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new p(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},p=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof f?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},m=e=>new f(e),h=()=>m(`div`),g=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},_=(e=8)=>Math.random().toString(36).substring(2,e+2),v=e=>typeof e==`function`,y=12e4,b=`__ranuts_bridge__`,x=`default`,S=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},C=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=x){this.targetOrigin=t,this.channel=n,this.senderId=_(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,S.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:b,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(v(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=_(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},y),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{S.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new C(n,t,r);if(e||=_(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new g;var w=[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],T=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new T(w[0],3609767458),new T(w[1],602891725),new T(w[2],3964484399),new T(w[3],2173295548),new T(w[4],4081628472),new T(w[5],3053834265),new T(w[6],2937671579),new T(w[7],3664609560),new T(w[8],2734883394),new T(w[9],1164996542),new T(w[10],1323610764),new T(w[11],3590304994),new T(w[12],4068182383),new T(w[13],991336113),new T(w[14],633803317),new T(w[15],3479774868),new T(w[16],2666613458),new T(w[17],944711139),new T(w[18],2341262773),new T(w[19],2007800933),new T(w[20],1495990901),new T(w[21],1856431235),new T(w[22],3175218132),new T(w[23],2198950837),new T(w[24],3999719339),new T(w[25],766784016),new T(w[26],2566594879),new T(w[27],3203337956),new T(w[28],1034457026),new T(w[29],2466948901),new T(w[30],3758326383),new T(w[31],168717936),new T(w[32],1188179964),new T(w[33],1546045734),new T(w[34],1522805485),new T(w[35],2643833823),new T(w[36],2343527390),new T(w[37],1014477480),new T(w[38],1206759142),new T(w[39],344077627),new T(w[40],1290863460),new T(w[41],3158454273),new T(w[42],3505952657),new T(w[43],106217008),new T(w[44],3606008344),new T(w[45],1432725776),new T(w[46],1467031594),new T(w[47],851169720),new T(w[48],3100823752),new T(w[49],1363258195),new T(w[50],3750685593),new T(w[51],3785050280),new T(w[52],3318307427),new T(w[53],3812723403),new T(w[54],2003034995),new T(w[55],3602036899),new T(w[56],1575990012),new T(w[57],1125592928),new T(w[58],2716904306),new T(w[59],442776044),new T(w[60],593698344),new T(w[61],3733110249),new T(w[62],2999351573),new T(w[63],3815920427),new T(3391569614,3928383900),new T(3515267271,566280711),new T(3940187606,3454069534),new T(4118630271,4000239992),new T(116418474,1914138554),new T(174292421,2731055270),new T(289380356,3203993006),new T(460393269,320620315),new T(685471733,587496836),new T(852142971,1086792851),new T(1017036298,365543100),new T(1126000580,2618297676),new T(1288033470,3409855158),new T(1501505948,4234509866),new T(1607167915,987167468),new T(1816402316,1246189591),new T(0,1),new T(0,32898),new T(2147483648,32906),new T(2147483648,2147516416),new T(0,32907),new T(0,2147483649),new T(2147483648,2147516545),new T(2147483648,32777),new T(0,138),new T(0,136),new T(0,2147516425),new T(0,2147483658),new T(0,2147516555),new T(2147483648,139),new T(2147483648,32905),new T(2147483648,32771),new T(2147483648,32770),new T(2147483648,128),new T(0,32778),new T(2147483648,2147483658),new T(2147483648,2147516545),new T(2147483648,32896),new T(0,2147483649),new T(2147483648,2147516424);var E=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(E),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(E);var D=new Map;function O(e,t){n?(D.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var k=typeof document<`u`?HTMLElement:u,A=new Map,j=new Map,M=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!A.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),A.set(t,e)}let n=A.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},N=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!j.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),j.set(t,e)}let n=j.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},P=new WeakMap,F=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,I=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||P.get(e)||e.attachShadow(n);return P.set(e,r),M(r,t?`${t}\n${F}`:F),r},L=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},R=(e,t,n=``)=>e.getAttribute(t)??n,z=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},B=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&N(t,a)},V=!1,H=new Map,U=!1,W=e=>/<svg[\s>]/i.test(e),G=e=>{if(typeof e==`string`)return W(e)?e:void 0;if(!e||typeof e!=`object`)return;let t=e,n=t.data;if(typeof n==`string`&&W(n))return n;let r=t.default;if(typeof r==`string`&&W(r))return r;if(r&&typeof r==`object`){let e=r;if(typeof e.data==`string`&&W(e.data))return e.data}},K=(e,t)=>{U=!0;let n=G(t);n&&(H.set(`inline:${e}`,n),typeof window<`u`&&window.dispatchEvent(new CustomEvent(`ranui-icon-registered`,{detail:{name:e}})))},q=e=>{U=!0,Object.entries(e).forEach(([e,t])=>{K(e,t)})},J=class extends k{isDev=V;_events=new r;static get observedAttributes(){return[`name`,`size`,`color`,`spin`,`decorative`,`aria-label`,`sheet`]}_icon;_div;_shadowDom;_onIconRegistered=e=>{let t=e.detail?.name;t&&t===this.name&&!this._icon&&this.setIcon()};constructor(){super(),this._shadowDom=I(this,t);let e=L(this._shadowDom,`.ran-icon`,()=>h().class(`ran-icon`).part(`ran-icon`).build());this._div=e}get name(){return R(this,`name`)}set name(e){e&&this.setAttribute(`name`,e)}get size(){return R(this,`size`)}set size(e){e&&this.setAttribute(`size`,e)}get color(){return R(this,`color`)}set color(e){e&&this.setAttribute(`color`,e)}get spin(){return this.hasAttribute(`spin`)}set spin(e){e?this.setAttribute(`spin`,``):this.removeAttribute(`spin`)}get decorative(){let e=this.getAttribute(`decorative`);return e==null?!this.hasAttribute(`aria-label`):e!==`false`&&e!==`0`}set decorative(e){this.setAttribute(`decorative`,e?`true`:`false`)}get ariaLabel(){return R(this,`aria-label`)}set ariaLabel(e){z(this,`aria-label`,e,{removeEmpty:!0})}get sheet(){return R(this,`sheet`)}set sheet(e){z(this,`sheet`,e)}handlerExternalCss=()=>{B(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(),void 0);let e=this.name;if(e)if(e.startsWith(`<svg`))this.renderSvg(e,e);else try{let t=`inline:${e}`,n=H.get(t);if(!n){this.isDev&&U&&console.warn(`[ranui-icon] icon not registered: ${e}`);return}n&&this.isSvgText(n)?this.renderSvg(n,e):this.isDev&&console.warn(`[ranui-icon] invalid svg text: ${e}`)}catch(t){this.isDev&&console.warn(`[ranui-icon] render icon failed: ${e}`,t)}};isSvgText=e=>W(e);parseSvg=e=>{let t=new window.DOMParser().parseFromString(e,`image/svg+xml`).documentElement;if(!t||t.tagName.toLowerCase()===`parsererror`||t.tagName.toLowerCase()!==`svg`)return;let n=new XMLSerializer().serializeToString(t),r=m(`template`).build();r.innerHTML=n.trim();let i=r.content.firstElementChild;if(!(!i||i.tagName.toLowerCase()!==`svg`))return i};renderSvg=(e,t)=>{let n=this.parseSvg(e);n?(this._icon=n,this._icon.setAttribute(`part`,`icon-svg`),this._icon.setAttribute(`data-name`,t),this._div.appendChild(this._icon),this.setSize(),this.setColor(),this.setSpin(),this.syncA11y()):this.isDev&&console.warn(`[ranui-icon] parse svg failed: ${t}`)};setSize=()=>{if(this._icon){let e=this.size||`1em`;this._icon.setAttribute(`width`,e),this._icon.setAttribute(`height`,e);let t=/^\d+(\.\d+)?$/.test(e)?`${e}px`:e;this._icon.style.setProperty(`width`,t),this._icon.style.setProperty(`height`,t)}};setColor=()=>{if(this._icon){let e=this.color||`currentColor`;this._icon.style.setProperty(`color`,e),this._icon.style.setProperty(`fill`,e),this._icon.style.setProperty(`stroke`,e)}};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(e,t,n){t!==n&&(e===`name`&&this.setIcon(),e===`size`&&this.setSize(),e===`color`&&this.setColor(),e===`spin`&&this.setSpin(),(e===`decorative`||e===`aria-label`)&&this.syncA11y(),e===`sheet`&&this.handlerExternalCss())}};return O(`r-icon`,J),e.Icon=J,e.registerIcon=K,e.registerIcons=q,e})({});
|
package/dist/iife/image.iife.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
var ranui_image=(function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=`
|
|
2
2
|
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMIAAADDCAYAAADQvc6UAAABRWlDQ1BJQ0MgUHJvZmlsZQAAKJFjYGASSSwoyGFhYGDIzSspCnJ3UoiIjFJgf8LAwSDCIMogwMCcmFxc4BgQ4ANUwgCjUcG3awyMIPqyLsis7PPOq3QdDFcvjV3jOD1boQVTPQrgSkktTgbSf4A4LbmgqISBgTEFyFYuLykAsTuAbJEioKOA7DkgdjqEvQHEToKwj4DVhAQ5A9k3gGyB5IxEoBmML4BsnSQk8XQkNtReEOBxcfXxUQg1Mjc0dyHgXNJBSWpFCYh2zi+oLMpMzyhRcASGUqqCZ16yno6CkYGRAQMDKMwhqj/fAIcloxgHQqxAjIHBEugw5sUIsSQpBobtQPdLciLEVJYzMPBHMDBsayhILEqEO4DxG0txmrERhM29nYGBddr//5/DGRjYNRkY/l7////39v///y4Dmn+LgeHANwDrkl1AuO+pmgAAADhlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAAqACAAQAAAABAAAAwqADAAQAAAABAAAAwwAAAAD9b/HnAAAHlklEQVR4Ae3dP3PTWBSGcbGzM6GCKqlIBRV0dHRJFarQ0eUT8LH4BnRU0NHR0UEFVdIlFRV7TzRksomPY8uykTk/zewQfKw/9znv4yvJynLv4uLiV2dBoDiBf4qP3/ARuCRABEFAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghggQAQZQKAnYEaQBAQaASKIAQJEkAEEegJmBElAoBEgghgg0Aj8i0JO4OzsrPv69Wv+hi2qPHr0qNvf39+iI97soRIh4f3z58/u7du3SXX7Xt7Z2enevHmzfQe+oSN2apSAPj09TSrb+XKI/f379+08+A0cNRE2ANkupk+ACNPvkSPcAAEibACyXUyfABGm3yNHuAECRNgAZLuYPgEirKlHu7u7XdyytGwHAd8jjNyng4OD7vnz51dbPT8/7z58+NB9+/bt6jU/TI+AGWHEnrx48eJ/EsSmHzx40L18+fLyzxF3ZVMjEyDCiEDjMYZZS5wiPXnyZFbJaxMhQIQRGzHvWR7XCyOCXsOmiDAi1HmPMMQjDpbpEiDCiL358eNHurW/5SnWdIBbXiDCiA38/Pnzrce2YyZ4//59F3ePLNMl4PbpiL2J0L979+7yDtHDhw8vtzzvdGnEXdvUigSIsCLAWavHp/+qM0BcXMd/q25n1vF57TYBp0a3mUzilePj4+7k5KSLb6gt6ydAhPUzXnoPR0dHl79WGTNCfBnn1uvSCJdegQhLI1vvCk+fPu2ePXt2tZOYEV6/fn31dz+shwAR1sP1cqvLntbEN9MxA9xcYjsxS1jWR4AIa2Ibzx0tc44fYX/16lV6NDFLXH+YL32jwiACRBiEbf5KcXoTIsQSpzXx4N28Ja4BQoK7rgXiydbHjx/P25TaQAJEGAguWy0+2Q8PD6/Ki4R8EVl+bzBOnZY95fq9rj9zAkTI2SxdidBHqG9+skdw43borCXO/ZcJdraPWdv22uIEiLA4q7nvvCug8WTqzQveOH26fodo7g6uFe/a17W3+nFBAkRYENRdb1vkkz1CH9cPsVy/jrhr27PqMYvENYNlHAIesRiBYwRy0V+8iXP8+/fvX11Mr7L7ECueb/r48eMqm7FuI2BGWDEG8cm+7G3NEOfmdcTQw4h9/55lhm7DekRYKQPZF2ArbXTAyu4kDYB2YxUzwg0gi/41ztHnfQG26HbGel/crVrm7tNY+/1btkOEAZ2M05r4FB7r9GbAIdxaZYrHdOsgJ/wCEQY0J74TmOKnbxxT9n3FgGGWWsVdowHtjt9Nnvf7yQM2aZU/TIAIAxrw6dOnAWtZZcoEnBpNuTuObWMEiLAx1HY0ZQJEmHJ3HNvGCBBhY6jtaMoEiJB0Z29vL6ls58vxPcO8/zfrdo5qvKO+d3Fx8Wu8zf1dW4p/cPzLly/dtv9Ts/EbcvGAHhHyfBIhZ6NSiIBTo0LNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiECRCjUbEPNCRAhZ6NSiAARCjXbUHMCRMjZqBQiQIRCzTbUnAARcjYqhQgQoVCzDTUnQIScjUohAkQo1GxDzQkQIWejUogAEQo121BzAkTI2agUIkCEQs021JwAEXI2KoUIEKFQsw01J0CEnI1KIQJEKNRsQ80JECFno1KIABEKNdtQcwJEyNmoFCJAhELNNtScABFyNiqFCBChULMNNSdAhJyNSiEC/wGgKKC4YMA4TAAAAABJRU5ErkJggg==
|
|
3
|
-
`,n=typeof document>`u`;function r(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function i(e){return r(e)}var a=e=>typeof e==`string`?!1:`tagName`in e&&`childrenList`in e,o=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},s=(e,t,n)=>{for(let r of e)a(r)&&(o(r,t)&&n.push(r),s(r.childrenList,t,n))},c=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}},l=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new c)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new u(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${i(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${i(a)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``):s+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},u=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${r(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``)}</template>`}},d=class e{el;constructor(e){this.el=n?new l(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new f(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},f=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof d?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},p=e=>new d(e),m=()=>p(`div`),h=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},g=(e=8)=>Math.random().toString(36).substring(2,e+2),_=e=>typeof e==`function`,v=12e4,y=`__ranuts_bridge__`,b=`default`,x=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},S=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=b){this.targetOrigin=t,this.channel=n,this.senderId=g(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,x.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:y,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(_(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=g(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},v),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{x.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new S(n,t,r);if(e||=g(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance();function C(e){return Object.prototype.toString.call(e)}function w(e,t,n=new Map){if(e===t)return!0;if(e==null||t==null)return e===t;if(e!=e&&t!=t)return!0;let r=typeof e;if(r!==typeof t)return!1;if(r!==`object`)return e===t;let i=C(e);if(i!==C(t))return!1;if(n.has(e))return n.get(e)===t;if(n.set(e,t),i===`[object Array]`){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!w(e[r],t[r],n))return!1;return!0}if(i===`[object Date]`)return+e==+t;if(i===`[object RegExp]`)return e.toString()===t.toString();if(i===`[object Map]`){if(e.size!==t.size)return!1;let r=!0;return e.forEach((e,i)=>{r&&(t.has(i)&&w(e,t.get(i),n)||(r=!1))}),r}if(i===`[object Set]`){if(e.size!==t.size)return!1;let r=Array.from(e),i=Array.from(t);return r.every(e=>i.some(t=>w(e,t,n)))}let a=Object.keys(e),o=Object.keys(t);if(a.length!==o.length)return!1;for(let r of a)if(!Object.prototype.hasOwnProperty.call(t,r)||!w(e[r],t[r],n))return!1;return!0}var T=(e,t=new WeakMap)=>{if(typeof e!=`object`||!e)return e;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(Array.isArray(e)){let n=[];t.set(e,n);for(let r=0;r<e.length;r++)n[r]=T(e[r],t);return n}if(e instanceof Map){let n=new Map;return t.set(e,n),e.forEach((e,r)=>{n.set(typeof r==`object`&&r?T(r,t):r,T(e,t))}),n}if(e instanceof Set){let n=new Set;return t.set(e,n),e.forEach(e=>{n.add(T(e,t))}),n}if(typeof e==`object`&&e.constructor===Object){let n={};return t.set(e,n),[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)].forEach(r=>{n[r]=T(e[r],t)}),n}try{let n=new(Object.getPrototypeOf(e)).constructor;t.set(e,n);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=T(e[r],t));return n}catch{return console.warn(`Unable to deeply clone object of type ${Object.prototype.toString.call(e)}. Fallback to shallow copy.`),{...e}}};new h;var E=[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],D=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new D(E[0],3609767458),new D(E[1],602891725),new D(E[2],3964484399),new D(E[3],2173295548),new D(E[4],4081628472),new D(E[5],3053834265),new D(E[6],2937671579),new D(E[7],3664609560),new D(E[8],2734883394),new D(E[9],1164996542),new D(E[10],1323610764),new D(E[11],3590304994),new D(E[12],4068182383),new D(E[13],991336113),new D(E[14],633803317),new D(E[15],3479774868),new D(E[16],2666613458),new D(E[17],944711139),new D(E[18],2341262773),new D(E[19],2007800933),new D(E[20],1495990901),new D(E[21],1856431235),new D(E[22],3175218132),new D(E[23],2198950837),new D(E[24],3999719339),new D(E[25],766784016),new D(E[26],2566594879),new D(E[27],3203337956),new D(E[28],1034457026),new D(E[29],2466948901),new D(E[30],3758326383),new D(E[31],168717936),new D(E[32],1188179964),new D(E[33],1546045734),new D(E[34],1522805485),new D(E[35],2643833823),new D(E[36],2343527390),new D(E[37],1014477480),new D(E[38],1206759142),new D(E[39],344077627),new D(E[40],1290863460),new D(E[41],3158454273),new D(E[42],3505952657),new D(E[43],106217008),new D(E[44],3606008344),new D(E[45],1432725776),new D(E[46],1467031594),new D(E[47],851169720),new D(E[48],3100823752),new D(E[49],1363258195),new D(E[50],3750685593),new D(E[51],3785050280),new D(E[52],3318307427),new D(E[53],3812723403),new D(E[54],2003034995),new D(E[55],3602036899),new D(E[56],1575990012),new D(E[57],1125592928),new D(E[58],2716904306),new D(E[59],442776044),new D(E[60],593698344),new D(E[61],3733110249),new D(E[62],2999351573),new D(E[63],3815920427),new D(3391569614,3928383900),new D(3515267271,566280711),new D(3940187606,3454069534),new D(4118630271,4000239992),new D(116418474,1914138554),new D(174292421,2731055270),new D(289380356,3203993006),new D(460393269,320620315),new D(685471733,587496836),new D(852142971,1086792851),new D(1017036298,365543100),new D(1126000580,2618297676),new D(1288033470,3409855158),new D(1501505948,4234509866),new D(1607167915,987167468),new D(1816402316,1246189591),new D(0,1),new D(0,32898),new D(2147483648,32906),new D(2147483648,2147516416),new D(0,32907),new D(0,2147483649),new D(2147483648,2147516545),new D(2147483648,32777),new D(0,138),new D(0,136),new D(0,2147516425),new D(0,2147483658),new D(0,2147516555),new D(2147483648,139),new D(2147483648,32905),new D(2147483648,32771),new D(2147483648,32770),new D(2147483648,128),new D(0,32778),new D(2147483648,2147483658),new D(2147483648,2147516545),new D(2147483648,32896),new D(0,2147483649),new D(2147483648,2147516424);var O=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(O),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(O);var k=new Map;function A(e,t){n?(k.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var j=typeof document<`u`?HTMLElement:l,M=new Map,N=new Map,P=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!M.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),M.set(t,e)}let n=M.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},F=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!N.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),N.set(t,e)}let n=N.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},I=new WeakMap,L=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,R=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||I.get(e)||e.attachShadow(n);return I.set(e,r),P(r,t?`${t}\n${L}`:L),r},z=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},B=(e,t,n=``)=>e.getAttribute(t)??n,V=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},H=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&F(t,a)},U=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}`,W=class extends j{static get observedAttributes(){return[`src`,`fallback`,`sheet`,`alt`]}_image;_container;_shadowDom;constructor(){super(),this._shadowDom=R(this,U);let e=z(this._shadowDom,`.ran-image`,()=>m().class(`ran-image`).build());this._container=e}get fallback(){return B(this,`fallback`,t)}set fallback(e){V(this,`fallback`,e,{removeEmpty:!0})}get sheet(){return B(this,`sheet`)}set sheet(e){V(this,`sheet`,e)}get alt(){return B(this,`alt`)}set alt(e){V(this,`alt`,e)}handlerExternalCss=()=>{H(this,this._shadowDom,`sheet`,null,this.sheet)};listenFallback(e,t){e===`fallback`&&this._image&&(t?this._image.setAttribute(`fallback`,t):this._image.removeAttribute(`fallback`))}updateSrc=()=>{this._image&&(this._image.src=this.getAttribute(`src`)||``)};connectedCallback(){this.handlerExternalCss(),this._image=new Image,this._image.alt=this.alt,this._image.addEventListener(`error`,()=>{this._image&&this.fallback&&(this._image.src=this.fallback)}),this._image.addEventListener(`load`,()=>{this._image&&this._container.appendChild(this._image)}),this.updateSrc()}attributeChangedCallback(e,t,n){t!==n&&(this.listenFallback(e,n),e===`src`&&this.updateSrc(),e===`alt`&&this._image&&(this._image.alt=n??``),e===`sheet`&&this.handlerExternalCss())}};return A(`r-img`,W),e.ImageElement=W,e.default=W,e})({});
|
|
3
|
+
`,n=typeof document>`u`;function r(e){return typeof e==`string`?e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`):String(e)}function i(e){return r(e)}var a=e=>typeof e!=`string`&&`tagName`in e&&`childrenList`in e,o=(e,t)=>{let n=t.trim();if(!n)return!1;if(n.startsWith(`.`))return e.classList.contains(n.slice(1));if(n.startsWith(`#`))return e.getAttribute(`id`)===n.slice(1);if(n.startsWith(`[`)&&n.endsWith(`]`)){let[t,r]=n.slice(1,-1).trim().split(`=`),i=(t||``).trim();if(!i)return!1;if(r==null)return e.hasAttribute(i);let a=r.trim().replace(/^['"]|['"]$/g,``);return e.getAttribute(i)===a}return e.tagName===n.toLowerCase()},s=(e,t,n)=>{for(let r of e)a(r)&&(o(r,t)&&n.push(r),s(r.childrenList,t,n))},c=class{childrenList=[];appendChild(e){return this.childrenList.push(e),e}serialize(){return this.childrenList.map(e=>typeof e==`string`?r(e):e.serialize()).join(``)}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}},l=class{tagName;attributes=new Map;inlineStyles=new Map;childrenList=[];shadowRoot=null;textContent=null;content;eventListeners=new Map;style={setProperty:(e,t)=>{let n=e.startsWith(`--`)?e:e.replace(/([A-Z])/g,`-$1`).toLowerCase();this.inlineStyles.set(n,t)},removeProperty:e=>this.inlineStyles.delete(e)};classList={add:(...e)=>{let t=this.attributes.get(`class`)||``,n=new Set([...t.split(` `).filter(Boolean),...e]);this.attributes.set(`class`,Array.from(n).join(` `))},remove:(...e)=>{let t=(this.attributes.get(`class`)||``).split(` `).filter(t=>!e.includes(t));this.attributes.set(`class`,t.join(` `))},toggle:e=>{this.classList.contains(e)?this.classList.remove(e):this.classList.add(e)},contains:e=>(this.attributes.get(`class`)||``).split(` `).includes(e)};_innerHTML=``;get innerHTML(){return this._innerHTML}set innerHTML(e){this._innerHTML=e,this.tagName===`template`&&this.content&&(this.content.childrenList=[e])}constructor(e=`div`){this.tagName=e.toLowerCase(),this.tagName===`template`&&(this.content=new c)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){e?this.setAttribute(`hidden`,``):this.removeAttribute(`hidden`)}setAttribute(e,t){this.attributes.set(e,t)}getAttribute(e){return this.attributes.get(e)||null}removeAttribute(e){this.attributes.delete(e)}hasAttribute(e){return this.attributes.has(e)}appendChild(e){return this.childrenList.push(e),e}attachShadow(e){return this.shadowRoot=new u(this,e),this.shadowRoot}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}addEventListener(e,t){let n=this.eventListeners.get(e)||new Set;n.add(t),this.eventListeners.set(e,n)}removeEventListener(e,t){let n=this.eventListeners.get(e);n&&(n.delete(t),n.size===0&&this.eventListeners.delete(e))}dispatchEvent(e){let t=this.eventListeners.get(e.type);if(!t||t.size===0)return!0;for(let n of t)typeof n==`function`?n.call(this,e):n.handleEvent(e);return!e.defaultPrevented}serialize(e){typeof this._preSerialize==`function`&&this._preSerialize();let t=e||this._ssrTag||this.tagName,n=Array.from(this.attributes.entries()).map(([e,t])=>` ${e}="${i(t)}"`).join(``),a=Array.from(this.inlineStyles.entries()).map(([e,t])=>`${e}:${t}`).join(`;`),o=a?` style="${i(a)}"`:``,s=``;return this.shadowRoot&&(s+=this.shadowRoot.serialize()),this.textContent===null?this._innerHTML?s+=this._innerHTML:s+=this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``):s+=r(this.textContent),[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`link`,`meta`,`param`,`source`,`track`,`wbr`].includes(t)&&!s?`<${t}${n}${o} />`:`<${t}${n}${o}>${s}</${t}>`}},u=class{host;options;childrenList=[];adoptedStyleSheets=[];constructor(e,t){this.host=e,this.options=t}appendChild(e){return this.childrenList.push(e),e}querySelector(e){let t=this.querySelectorAll(e);return t.length>0?t[0]:null}querySelectorAll(e){let t=[];return s(this.childrenList,e,t),t}serialize(){return`<template shadowrootmode="${this.options.mode}"${this.options.delegatesFocus?` shadowrootdelegatesfocus`:``}>${this.adoptedStyleSheets.map(e=>`<style>${r(e)}</style>`).join(``)}${this.childrenList.map(e=>typeof e==`string`?r(e):(e instanceof c,e.serialize())).join(``)}</template>`}},d=class e{el;constructor(e){this.el=n?new l(e):document.createElement(e)}id(e){return this.el.setAttribute(`id`,e),this}class(e){return n?this.el.attributes.set(`class`,e):this.el.className=e,this}addClass(...e){return e.forEach(e=>this.el.classList.add(e)),this}removeClass(...e){return e.forEach(e=>this.el.classList.remove(e)),this}attr(e,t){return this.el.setAttribute(e,t),this}attrs(e){return Object.entries(e).forEach(([e,t])=>{t!=null&&this.el.setAttribute(e,String(t))}),this}boolAttr(e,t,n=``){return t?this.el.setAttribute(e,n):this.el.removeAttribute(e),this}part(e){return this.el.setAttribute(`part`,e),this}data(e,t){return this.attr(`data-${e}`,t)}style(e,t){return typeof e==`string`?this.el.style.setProperty(e,t??``):Object.entries(e).forEach(([e,t])=>this.el.style.setProperty(e,t)),this}cssVar(e,t){let n=e.startsWith(`--`)?e:`--${e}`;return this.style(n,t)}aria(e,t){return this.attr(`aria-${e}`,t)}role(e){return this.attr(`role`,e)}tabIndex(e){return this.attr(`tabindex`,String(e))}label(e){return this.aria(`label`,e)}labelledBy(e){return this.aria(`labelledby`,e)}describedBy(e){return this.aria(`describedby`,e)}ariaHidden(e=!0){return this.aria(`hidden`,String(e))}on(e,t,n){return this.el.addEventListener(e,t,n),this}listen(e,t,n,r){return e.on(this.el,t,n,r),this}delegate(e,t,n,r,i){return e.delegate(this.el,t,n,r,i),this}children(...t){let r=e=>e.reduce((e,t)=>Array.isArray(t)?e.concat(r(t)):e.concat(t),[]);return r(t).forEach(t=>{t!=null&&(t instanceof e?this.el.appendChild(t.build()):typeof t==`string`?n?this.el.appendChild(t):this.el.appendChild(document.createTextNode(t)):this.el.appendChild(t))}),this}replaceChildren(...e){if(n){let e=this.el;e.childrenList=[]}else this.el.replaceChildren();return this.children(...e)}text(e){return this.el.textContent=e,this}ref(e){return e.current=this.el,this}shadow(e={mode:`closed`}){let t=this.el.attachShadow(e);return new f(this.el,t,e)}build(){return this.el}serialize(){if(n)return this.el.serialize();let e=document.createElement(`div`);return e.appendChild(this.el.cloneNode(!0)),e.innerHTML}},f=class{root;hostEl;options;constructor(e,t,n){this.hostEl=e,this.root=t,this.options=n}children(...e){let t=e=>e.reduce((e,n)=>Array.isArray(n)?e.concat(t(n)):e.concat(n),[]);return t(e).forEach(e=>{e!=null&&(e instanceof d?this.root.appendChild(e.build()):typeof e==`string`?n?this.root.appendChild(e):this.root.appendChild(document.createTextNode(e)):this.root.appendChild(e))}),this}adoptSheet(...e){return this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,...e],this}css(e){if(n)return this.root.adoptedStyleSheets.push(e),this;if(typeof CSSStyleSheet<`u`)try{let t=new CSSStyleSheet;return t.replaceSync(e),this.root.adoptedStyleSheets=[...this.root.adoptedStyleSheets,t],this}catch{}let t=document.createElement(`style`);return t.textContent=e,this.root.appendChild(t),this}done(){return{host:this.hostEl,shadow:this.root}}serialize(){return n?this.root.serialize():this.root.innerHTML}},p=e=>new d(e),m=()=>p(`div`),h=class{_events=new Map;tap=(e,t)=>{this._events.get(e)&&e!==Symbol.for(`NEW_LISTENER`)&&this.call(Symbol.for(`NEW_LISTENER`),e);let n=this._events.get(e)||new Set;return typeof t==`function`?n.add({name:e,callback:t}):n.add(t),this._events.set(e,n),this};call=(e,...t)=>((this._events.get(e)||new Set).forEach(e=>{let{callback:n}=e;n(...t)}),this);callSync=async(e,...t)=>{let n=this._events.get(e)||new Set;for(let e of n){let{callback:n}=e;await n(...t)}return this};once=(e,t)=>{let n;if(typeof t==`function`)n={name:e,callback:(...r)=>{t(...r),this.off(e,n)},initialCallback:t};else{let{callback:r}=t;n={name:e,callback:(...t)=>{r(...t),this.off(e,n)},initialCallback:r}}return this.tap(e,n),this};off=(e,t)=>{let n=[...this._events.get(e)||new Set].filter(e=>{if(typeof t==`function`)return e.callback!==t&&e.initialCallback!==t;{let{callback:n}=t;return e.callback!==n&&e.initialCallback!==n}});return this._events.set(e,new Set(n)),this}},g=(e=8)=>Math.random().toString(36).substring(2,e+2),_=e=>typeof e==`function`,v=12e4,y=`__ranuts_bridge__`,b=`default`,x=new class{bridges=new Set;attachedWindow=null;handleMessage=e=>{for(let t of Array.from(this.bridges))t.receive(e)};add(e){this.bridges.add(e),typeof window<`u`&&this.attachedWindow!==window&&(window.addEventListener(`message`,this.handleMessage),this.attachedWindow=window)}remove(e){this.bridges.delete(e),this.bridges.size===0&&this.attachedWindow&&(this.attachedWindow.removeEventListener(`message`,this.handleMessage),this.attachedWindow=null)}},S=class{targetWindow;targetOrigin;messageHandlers;pendingRequests;channel;senderId;available;constructor(e,t=`*`,n=b){this.targetOrigin=t,this.channel=n,this.senderId=g(12),this.messageHandlers=new Map,this.pendingRequests=new Map,this.available=typeof window<`u`,this.available?(this.targetWindow=e??window,x.add(this)):this.targetWindow=void 0}post(e,t){let n={...t,__bridge:y,channel:this.channel,senderId:this.senderId};e.postMessage(n,this.targetOrigin)}receive=e=>{if(!this.available||this.targetOrigin!==`*`&&e.origin!==this.targetOrigin||e.source&&e.source!==this.targetWindow)return;let t=e.data;if(!t||typeof t!=`object`||t.__bridge!==`__ranuts_bridge__`||(t.channel??`default`)!==this.channel)return;let{type:n,payload:r,id:i,isResponse:a,isError:o,senderId:s}=t;if(a&&i){let e=this.pendingRequests.get(i);e&&(o?e.reject(Error(typeof r==`string`?r:`Bridge request failed`)):e.resolve(r),this.pendingRequests.delete(i));return}if(s&&s===this.senderId||typeof n!=`string`||!this.messageHandlers.has(n))return;let c=this.messageHandlers.get(n);if(_(c)){let t=e.source??this.targetWindow;Promise.resolve(c(r)).then(e=>{i&&this.post(t,{type:n,payload:e,id:i,isResponse:!0})}).catch(e=>{i&&this.post(t,{type:n,payload:e instanceof Error?e.message:String(e),id:i,isResponse:!0,isError:!0})})}};on=(e,t)=>{this.messageHandlers.set(e,t)};off=e=>{this.messageHandlers.delete(e)};send=async(e,t)=>{if(!this.available)return Promise.reject(Error(`PostMessageBridge is unavailable outside a browser environment`));let n=g(10);return new Promise((r,i)=>{let a=setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),i(Error(`Request timeout`)))},v),o=e=>{clearTimeout(a),i(e)};this.pendingRequests.set(n,{resolve:e=>{clearTimeout(a),r(e)},reject:o});try{this.post(this.targetWindow,{type:e,payload:t,id:n})}catch(e){this.pendingRequests.delete(n),o(e instanceof Error?e:Error(`Failed to post message`))}})};broadcast=e=>{if(this.available)try{this.post(this.targetWindow,{type:e.type,payload:e.payload})}catch{}};destroy=()=>{x.remove(this),this.messageHandlers.clear(),this.pendingRequests.forEach(e=>{e.reject(Error(`Bridge destroyed`))}),this.pendingRequests.clear()}};(class e{static instance;bridges=new Map;constructor(){}static getInstance(){return e.instance||=new e,e.instance}connectClient=({id:e,targetOrigin:t,targetWindow:n,channel:r})=>{let i=new S(n,t,r);if(e||=g(10),this.bridges.has(e))throw Error(`Bridge ${e} already exists`);return this.bridges.set(e,i),{bridge:i,id:e}};getClient=e=>this.bridges.get(e);removeClient=e=>{let t=this.bridges.get(e);t&&(t.destroy(),this.bridges.delete(e))};removeAllClient=()=>{this.bridges.forEach(e=>{e.destroy()}),this.bridges.clear()};broadcast=e=>{this.bridges.forEach(t=>{t.broadcast(e)})};sendTo=(e,t,n)=>{let r=this.getClient(e);return r?r.send(t,n):Promise.reject(Error(`Bridge ${e} not found`))}}).getInstance(),new h;var C=[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],w=class{highOrder;lowOrder;constructor(e,t){this.highOrder=e,this.lowOrder=t}};new w(C[0],3609767458),new w(C[1],602891725),new w(C[2],3964484399),new w(C[3],2173295548),new w(C[4],4081628472),new w(C[5],3053834265),new w(C[6],2937671579),new w(C[7],3664609560),new w(C[8],2734883394),new w(C[9],1164996542),new w(C[10],1323610764),new w(C[11],3590304994),new w(C[12],4068182383),new w(C[13],991336113),new w(C[14],633803317),new w(C[15],3479774868),new w(C[16],2666613458),new w(C[17],944711139),new w(C[18],2341262773),new w(C[19],2007800933),new w(C[20],1495990901),new w(C[21],1856431235),new w(C[22],3175218132),new w(C[23],2198950837),new w(C[24],3999719339),new w(C[25],766784016),new w(C[26],2566594879),new w(C[27],3203337956),new w(C[28],1034457026),new w(C[29],2466948901),new w(C[30],3758326383),new w(C[31],168717936),new w(C[32],1188179964),new w(C[33],1546045734),new w(C[34],1522805485),new w(C[35],2643833823),new w(C[36],2343527390),new w(C[37],1014477480),new w(C[38],1206759142),new w(C[39],344077627),new w(C[40],1290863460),new w(C[41],3158454273),new w(C[42],3505952657),new w(C[43],106217008),new w(C[44],3606008344),new w(C[45],1432725776),new w(C[46],1467031594),new w(C[47],851169720),new w(C[48],3100823752),new w(C[49],1363258195),new w(C[50],3750685593),new w(C[51],3785050280),new w(C[52],3318307427),new w(C[53],3812723403),new w(C[54],2003034995),new w(C[55],3602036899),new w(C[56],1575990012),new w(C[57],1125592928),new w(C[58],2716904306),new w(C[59],442776044),new w(C[60],593698344),new w(C[61],3733110249),new w(C[62],2999351573),new w(C[63],3815920427),new w(3391569614,3928383900),new w(3515267271,566280711),new w(3940187606,3454069534),new w(4118630271,4000239992),new w(116418474,1914138554),new w(174292421,2731055270),new w(289380356,3203993006),new w(460393269,320620315),new w(685471733,587496836),new w(852142971,1086792851),new w(1017036298,365543100),new w(1126000580,2618297676),new w(1288033470,3409855158),new w(1501505948,4234509866),new w(1607167915,987167468),new w(1816402316,1246189591),new w(0,1),new w(0,32898),new w(2147483648,32906),new w(2147483648,2147516416),new w(0,32907),new w(0,2147483649),new w(2147483648,2147516545),new w(2147483648,32777),new w(0,138),new w(0,136),new w(0,2147516425),new w(0,2147483658),new w(0,2147516555),new w(2147483648,139),new w(2147483648,32905),new w(2147483648,32771),new w(2147483648,32770),new w(2147483648,128),new w(0,32778),new w(2147483648,2147483658),new w(2147483648,2147516545),new w(2147483648,32896),new w(0,2147483649),new w(2147483648,2147516424);var T=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`]]);(function(e){let t=new Map;for(let[n,r]of e)t.set(r.toLowerCase(),n);return t})(T),function(e){let t=[];for(let[n,r]of e)t.push(n);return t}(T);var E=new Map;function D(e,t){n?(E.set(e,t),t.prototype._ssrTag=e):customElements.get(e)||customElements.define(e,t)}var O=typeof document<`u`?HTMLElement:l,k=new Map,A=new Map,j=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!k.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),k.set(t,e)}let n=k.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!e.querySelector(`style[data-ranui]`)){let n=document.createElement(`style`);n.setAttribute(`data-ranui`,``),n.textContent=t,e.appendChild(n)}}},M=(e,t)=>{if(!(typeof document>`u`)&&t){if(typeof CSSStyleSheet<`u`)try{if(!A.has(t)){let e=new CSSStyleSheet;e.replaceSync(t),A.set(t,e)}let n=A.get(t);e.adoptedStyleSheets.includes(n)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,n]);return}catch{}if(!Array.from(e.querySelectorAll(`style[data-ranui-sheet]`)).some(e=>e.textContent===t)){let n=document.createElement(`style`);n.setAttribute(`data-ranui-sheet`,``),n.textContent=t,e.appendChild(n)}}},N=new WeakMap,P=`@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}}`,F=(e,t=``,n={mode:`closed`})=>{let r=e.shadowRoot||N.get(e)||e.attachShadow(n);return N.set(e,r),j(r,t?`${t}\n${P}`:P),r},I=(e,t,n)=>{let r=e.querySelector(t);if(r)return r;let i=n();return e.appendChild(i),i},L=(e,t,n=``)=>e.getAttribute(t)??n,R=(e,t,n,r={})=>{if(r.removeEmpty&&!n){e.removeAttribute(t);return}e.setAttribute(t,n??``)},z=(e,t,n,r,i)=>{if(n!==`sheet`||r===i)return;let a=e.getAttribute(`sheet`)||``;a&&M(t,a)},B=`.remove-wap-active-focus,.remove-wap-active-focus:active,.remove-wap-active-focus:focus{-webkit-tap-highlight-color:transparent;outline:0}`,V=class extends O{static get observedAttributes(){return[`src`,`fallback`,`sheet`,`alt`]}_image;_container;_shadowDom;constructor(){super(),this._shadowDom=F(this,B);let e=I(this._shadowDom,`.ran-image`,()=>m().class(`ran-image`).build());this._container=e}get fallback(){return L(this,`fallback`,t)}set fallback(e){R(this,`fallback`,e,{removeEmpty:!0})}get sheet(){return L(this,`sheet`)}set sheet(e){R(this,`sheet`,e)}get alt(){return L(this,`alt`)}set alt(e){R(this,`alt`,e)}handlerExternalCss=()=>{z(this,this._shadowDom,`sheet`,null,this.sheet)};listenFallback(e,t){e===`fallback`&&this._image&&(t?this._image.setAttribute(`fallback`,t):this._image.removeAttribute(`fallback`))}updateSrc=()=>{this._image&&(this._image.src=this.getAttribute(`src`)||``)};connectedCallback(){this.handlerExternalCss(),this._image=new Image,this._image.alt=this.alt,this._image.addEventListener(`error`,()=>{this._image&&this.fallback&&(this._image.src=this.fallback)}),this._image.addEventListener(`load`,()=>{this._image&&this._container.appendChild(this._image)}),this.updateSrc()}attributeChangedCallback(e,t,n){t!==n&&(this.listenFallback(e,n),e===`src`&&this.updateSrc(),e===`alt`&&this._image&&(this._image.alt=n??``),e===`sheet`&&this.handlerExternalCss())}};return D(`r-img`,V),e.ImageElement=V,e.default=V,e})({});
|