public/lookbook-assets/js/index.js in lookbook-2.0.2 vs public/lookbook-assets/js/index.js in lookbook-2.0.3

- old
+ new

@@ -1,16 +1,1097 @@ (() => { function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } +var $parcel$global = +typeof globalThis !== 'undefined' + ? globalThis + : typeof self !== 'undefined' + ? self + : typeof window !== 'undefined' + ? window + : typeof global !== 'undefined' + ? global + : {}; function $parcel$defineInteropFlag(a) { Object.defineProperty(a, '__esModule', {value: true, configurable: true}); } function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true}); } // packages/alpinejs/src/scheduler.js +/** + * Make a map and return a function for checking if a key + * is in that map. + * IMPORTANT: all calls of this function must be prefixed with + * \/\*#\_\_PURE\_\_\*\/ + * So that rollup can tree-shake them if necessary. + */ function $dcd1c8c04a2b6f59$export$b41394a5437791c8(str, expectsLowerCase) { + const map = Object.create(null); + const list = str.split(","); + for(let i = 0; i < list.length; i++)map[list[i]] = true; + return expectsLowerCase ? (val)=>!!map[val.toLowerCase()] : (val)=>!!map[val]; +} +/** + * dev only flag -> name mapping + */ const $dcd1c8c04a2b6f59$export$def7dc2c2e95a08a = { + [1 /* TEXT */ ]: `TEXT`, + [2 /* CLASS */ ]: `CLASS`, + [4 /* STYLE */ ]: `STYLE`, + [8 /* PROPS */ ]: `PROPS`, + [16 /* FULL_PROPS */ ]: `FULL_PROPS`, + [32 /* HYDRATE_EVENTS */ ]: `HYDRATE_EVENTS`, + [64 /* STABLE_FRAGMENT */ ]: `STABLE_FRAGMENT`, + [128 /* KEYED_FRAGMENT */ ]: `KEYED_FRAGMENT`, + [256 /* UNKEYED_FRAGMENT */ ]: `UNKEYED_FRAGMENT`, + [512 /* NEED_PATCH */ ]: `NEED_PATCH`, + [1024 /* DYNAMIC_SLOTS */ ]: `DYNAMIC_SLOTS`, + [2048 /* DEV_ROOT_FRAGMENT */ ]: `DEV_ROOT_FRAGMENT`, + [-1 /* HOISTED */ ]: `HOISTED`, + [-2 /* BAIL */ ]: `BAIL` +}; +/** + * Dev only + */ const $dcd1c8c04a2b6f59$export$624972196ed3745f = { + [1 /* STABLE */ ]: "STABLE", + [2 /* DYNAMIC */ ]: "DYNAMIC", + [3 /* FORWARDED */ ]: "FORWARDED" +}; +const $dcd1c8c04a2b6f59$var$GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"; +const $dcd1c8c04a2b6f59$export$d6571a1911e4f27e = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$GLOBALS_WHITE_LISTED); +const $dcd1c8c04a2b6f59$var$range = 2; +function $dcd1c8c04a2b6f59$export$f9c0d8b6684a279b(source, start = 0, end = source.length) { + // Split the content into individual lines but capture the newline sequence + // that separated each line. This is important because the actual sequence is + // needed to properly take into account the full line length for offset + // comparison + let lines = source.split(/(\r?\n)/); + // Separate the lines and newline sequences into separate arrays for easier referencing + const newlineSequences = lines.filter((_, idx)=>idx % 2 === 1); + lines = lines.filter((_, idx)=>idx % 2 === 0); + let count = 0; + const res = []; + for(let i = 0; i < lines.length; i++){ + count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0); + if (count >= start) { + for(let j = i - $dcd1c8c04a2b6f59$var$range; j <= i + $dcd1c8c04a2b6f59$var$range || end > count; j++){ + if (j < 0 || j >= lines.length) continue; + const line = j + 1; + res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`); + const lineLength = lines[j].length; + const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0; + if (j === i) { + // push underline + const pad = start - (count - (lineLength + newLineSeqLength)); + const length = Math.max(1, end > count ? lineLength - pad : end - start); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j > i) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; + } + } + return res.join("\n"); +} +/** + * On the client we only need to offer special cases for boolean attributes that + * have different names from their corresponding dom properties: + * - itemscope -> N/A + * - allowfullscreen -> allowFullscreen + * - formnovalidate -> formNoValidate + * - ismap -> isMap + * - nomodule -> noModule + * - novalidate -> noValidate + * - readonly -> readOnly + */ const $dcd1c8c04a2b6f59$var$specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; +const $dcd1c8c04a2b6f59$export$d186f5eb2e810715 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$specialBooleanAttrs); +/** + * The full list is needed during SSR to produce the correct initial markup. + */ const $dcd1c8c04a2b6f59$export$f763ba3b84e9cd8c = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` + `loop,open,required,reversed,scoped,seamless,` + `checked,muted,multiple,selected`); +const $dcd1c8c04a2b6f59$var$unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; +const $dcd1c8c04a2b6f59$var$attrValidationCache = {}; +function $dcd1c8c04a2b6f59$export$d55ef77660f30d12(name) { + if ($dcd1c8c04a2b6f59$var$attrValidationCache.hasOwnProperty(name)) return $dcd1c8c04a2b6f59$var$attrValidationCache[name]; + const isUnsafe = $dcd1c8c04a2b6f59$var$unsafeAttrCharRE.test(name); + if (isUnsafe) console.error(`unsafe attribute name: ${name}`); + return $dcd1c8c04a2b6f59$var$attrValidationCache[name] = !isUnsafe; +} +const $dcd1c8c04a2b6f59$export$b66fd0cae8dec3c8 = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" +}; +/** + * CSS properties that accept plain numbers + */ const $dcd1c8c04a2b6f59$export$84da53524c6b1314 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8(`animation-iteration-count,border-image-outset,border-image-slice,` + `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` + `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` + `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` + `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` + `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` + // SVG +`fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` + `stroke-miterlimit,stroke-opacity,stroke-width`); +/** + * Known attributes, this is used for stringification of runtime static nodes + * so that we don't stringify bindings that cannot be set from HTML. + * Don't also forget to allow `data-*` and `aria-*`! + * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes + */ const $dcd1c8c04a2b6f59$export$94be033ec0a4a248 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8(`accept,accept-charset,accesskey,action,align,allow,alt,async,` + `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` + `border,buffered,capture,challenge,charset,checked,cite,class,code,` + `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` + `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` + `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` + `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` + `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` + `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` + `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` + `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` + `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` + `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` + `start,step,style,summary,tabindex,target,title,translate,type,usemap,` + `value,width,wrap`); +function $dcd1c8c04a2b6f59$export$8756898546458274(value) { + if ($dcd1c8c04a2b6f59$export$43bee75e5e14138e(value)) { + const res = {}; + for(let i = 0; i < value.length; i++){ + const item = value[i]; + const normalized = $dcd1c8c04a2b6f59$export$8756898546458274($dcd1c8c04a2b6f59$export$844ec244b1367d54(item) ? $dcd1c8c04a2b6f59$export$76a205ce979d066a(item) : item); + if (normalized) for(const key in normalized)res[key] = normalized[key]; + } + return res; + } else if ($dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(value)) return value; +} +const $dcd1c8c04a2b6f59$var$listDelimiterRE = /;(?![^(]*\))/g; +const $dcd1c8c04a2b6f59$var$propertyDelimiterRE = /:(.+)/; +function $dcd1c8c04a2b6f59$export$76a205ce979d066a(cssText) { + const ret = {}; + cssText.split($dcd1c8c04a2b6f59$var$listDelimiterRE).forEach((item)=>{ + if (item) { + const tmp = item.split($dcd1c8c04a2b6f59$var$propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); + } + }); + return ret; +} +function $dcd1c8c04a2b6f59$export$9466a5a0ee6f1479(styles) { + let ret = ""; + if (!styles) return ret; + for(const key in styles){ + const value = styles[key]; + const normalizedKey = key.startsWith(`--`) ? key : $dcd1c8c04a2b6f59$export$6e6a0a3676c4b8bb(key); + if ($dcd1c8c04a2b6f59$export$844ec244b1367d54(value) || typeof value === "number" && $dcd1c8c04a2b6f59$export$84da53524c6b1314(normalizedKey)) // only render valid values + ret += `${normalizedKey}:${value};`; + } + return ret; +} +function $dcd1c8c04a2b6f59$export$4f7022d2d68e2c5a(value) { + let res = ""; + if ($dcd1c8c04a2b6f59$export$844ec244b1367d54(value)) res = value; + else if ($dcd1c8c04a2b6f59$export$43bee75e5e14138e(value)) for(let i = 0; i < value.length; i++){ + const normalized = $dcd1c8c04a2b6f59$export$4f7022d2d68e2c5a(value[i]); + if (normalized) res += normalized + " "; + } + else if ($dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(value)) { + for(const name in value)if (value[name]) res += name + " "; + } + return res.trim(); +} +// These tag configs are shared between compiler-dom and runtime-dom, so they +// https://developer.mozilla.org/en-US/docs/Web/HTML/Element +const $dcd1c8c04a2b6f59$var$HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; +// https://developer.mozilla.org/en-US/docs/Web/SVG/Element +const $dcd1c8c04a2b6f59$var$SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; +const $dcd1c8c04a2b6f59$var$VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; +const $dcd1c8c04a2b6f59$export$1ccf854a0984f890 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$HTML_TAGS); +const $dcd1c8c04a2b6f59$export$6328ce7565ea1049 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$SVG_TAGS); +const $dcd1c8c04a2b6f59$export$e5f2d3d97d9367a4 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8($dcd1c8c04a2b6f59$var$VOID_TAGS); +const $dcd1c8c04a2b6f59$var$escapeRE = /["'&<>]/; +function $dcd1c8c04a2b6f59$export$4cf11838cdc2a8a8(string) { + const str = "" + string; + const match = $dcd1c8c04a2b6f59$var$escapeRE.exec(str); + if (!match) return str; + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for(index = match.index; index < str.length; index++){ + switch(str.charCodeAt(index)){ + case 34: + escaped = "&quot;"; + break; + case 38: + escaped = "&amp;"; + break; + case 39: + escaped = "&#39;"; + break; + case 60: + escaped = "&lt;"; + break; + case 62: + escaped = "&gt;"; + break; + default: + continue; + } + if (lastIndex !== index) html += str.substring(lastIndex, index); + lastIndex = index + 1; + html += escaped; + } + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; +} +// https://www.w3.org/TR/html52/syntax.html#comments +const $dcd1c8c04a2b6f59$var$commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; +function $dcd1c8c04a2b6f59$export$7b105034a53bde5f(src) { + return src.replace($dcd1c8c04a2b6f59$var$commentStripRE, ""); +} +function $dcd1c8c04a2b6f59$var$looseCompareArrays(a, b) { + if (a.length !== b.length) return false; + let equal = true; + for(let i = 0; equal && i < a.length; i++)equal = $dcd1c8c04a2b6f59$export$ae8015769846262c(a[i], b[i]); + return equal; +} +function $dcd1c8c04a2b6f59$export$ae8015769846262c(a, b) { + if (a === b) return true; + let aValidType = $dcd1c8c04a2b6f59$export$871608497c498473(a); + let bValidType = $dcd1c8c04a2b6f59$export$871608497c498473(b); + if (aValidType || bValidType) return aValidType && bValidType ? a.getTime() === b.getTime() : false; + aValidType = $dcd1c8c04a2b6f59$export$43bee75e5e14138e(a); + bValidType = $dcd1c8c04a2b6f59$export$43bee75e5e14138e(b); + if (aValidType || bValidType) return aValidType && bValidType ? $dcd1c8c04a2b6f59$var$looseCompareArrays(a, b) : false; + aValidType = $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(a); + bValidType = $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(b); + if (aValidType || bValidType) { + /* istanbul ignore if: this if will probably never be called */ if (!aValidType || !bValidType) return false; + const aKeysCount = Object.keys(a).length; + const bKeysCount = Object.keys(b).length; + if (aKeysCount !== bKeysCount) return false; + for(const key in a){ + const aHasKey = a.hasOwnProperty(key); + const bHasKey = b.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !$dcd1c8c04a2b6f59$export$ae8015769846262c(a[key], b[key])) return false; + } + } + return String(a) === String(b); +} +function $dcd1c8c04a2b6f59$export$42912a80cedb8bd4(arr, val) { + return arr.findIndex((item)=>$dcd1c8c04a2b6f59$export$ae8015769846262c(item, val)); +} +/** + * For converting {{ interpolation }} values to displayed strings. + * @private + */ const $dcd1c8c04a2b6f59$export$b5b1545233b45293 = (val)=>{ + return val == null ? "" : $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(val) ? JSON.stringify(val, $dcd1c8c04a2b6f59$var$replacer, 2) : String(val); +}; +const $dcd1c8c04a2b6f59$var$replacer = (_key, val)=>{ + if ($dcd1c8c04a2b6f59$export$5c90113a285f2241(val)) return { + [`Map(${val.size})`]: [ + ...val.entries() + ].reduce((entries, [key, val])=>{ + entries[`${key} =>`] = val; + return entries; + }, {}) + }; + else if ($dcd1c8c04a2b6f59$export$6750766a7c7ec627(val)) return { + [`Set(${val.size})`]: [ + ...val.values() + ] + }; + else if ($dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(val) && !$dcd1c8c04a2b6f59$export$43bee75e5e14138e(val) && !$dcd1c8c04a2b6f59$export$53b83ca8eaab0383(val)) return String(val); + return val; +}; +/** + * List of @babel/parser plugins that are used for template expression + * transforms and SFC script transforms. By default we enable proposals slated + * for ES2020. This will need to be updated as the spec moves forward. + * Full list at https://babeljs.io/docs/en/next/babel-parser#plugins + */ const $dcd1c8c04a2b6f59$export$10dfb620782d8404 = [ + "bigInt", + "optionalChaining", + "nullishCoalescingOperator" +]; +const $dcd1c8c04a2b6f59$export$cf583d23ab39677c = {}; +const $dcd1c8c04a2b6f59$export$6bd8558f433f1cc1 = []; +const $dcd1c8c04a2b6f59$export$5702a91a6f42969f = ()=>{}; +/** + * Always return false. + */ const $dcd1c8c04a2b6f59$export$c01351c0af048e39 = ()=>false; +const $dcd1c8c04a2b6f59$var$onRE = /^on[^a-z]/; +const $dcd1c8c04a2b6f59$export$1a2d97de39ecbb75 = (key)=>$dcd1c8c04a2b6f59$var$onRE.test(key); +const $dcd1c8c04a2b6f59$export$793aa5469768d691 = (key)=>key.startsWith("onUpdate:"); +const $dcd1c8c04a2b6f59$export$8b58be045bf06082 = Object.assign; +const $dcd1c8c04a2b6f59$export$cd7f480d6b8286c3 = (arr, el)=>{ + const i = arr.indexOf(el); + if (i > -1) arr.splice(i, 1); +}; +const $dcd1c8c04a2b6f59$var$hasOwnProperty = Object.prototype.hasOwnProperty; +const $dcd1c8c04a2b6f59$export$b5a638e9b3fff9f3 = (val, key)=>$dcd1c8c04a2b6f59$var$hasOwnProperty.call(val, key); +const $dcd1c8c04a2b6f59$export$43bee75e5e14138e = Array.isArray; +const $dcd1c8c04a2b6f59$export$5c90113a285f2241 = (val)=>$dcd1c8c04a2b6f59$export$1dccc787cc36538b(val) === "[object Map]"; +const $dcd1c8c04a2b6f59$export$6750766a7c7ec627 = (val)=>$dcd1c8c04a2b6f59$export$1dccc787cc36538b(val) === "[object Set]"; +const $dcd1c8c04a2b6f59$export$871608497c498473 = (val)=>val instanceof Date; +const $dcd1c8c04a2b6f59$export$f6e2535fb5126e54 = (val)=>typeof val === "function"; +const $dcd1c8c04a2b6f59$export$844ec244b1367d54 = (val)=>typeof val === "string"; +const $dcd1c8c04a2b6f59$export$a244864fd9645c7f = (val)=>typeof val === "symbol"; +const $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a = (val)=>val !== null && typeof val === "object"; +const $dcd1c8c04a2b6f59$export$4369c812aac99591 = (val)=>{ + return $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a(val) && $dcd1c8c04a2b6f59$export$f6e2535fb5126e54(val.then) && $dcd1c8c04a2b6f59$export$f6e2535fb5126e54(val.catch); +}; +const $dcd1c8c04a2b6f59$export$830c053460e5ddf6 = Object.prototype.toString; +const $dcd1c8c04a2b6f59$export$1dccc787cc36538b = (value)=>$dcd1c8c04a2b6f59$export$830c053460e5ddf6.call(value); +const $dcd1c8c04a2b6f59$export$5ad0a3c360b8fbb5 = (value)=>{ + // extract "RawType" from strings like "[object RawType]" + return $dcd1c8c04a2b6f59$export$1dccc787cc36538b(value).slice(8, -1); +}; +const $dcd1c8c04a2b6f59$export$53b83ca8eaab0383 = (val)=>$dcd1c8c04a2b6f59$export$1dccc787cc36538b(val) === "[object Object]"; +const $dcd1c8c04a2b6f59$export$e2a2b93446ec9fe = (key)=>$dcd1c8c04a2b6f59$export$844ec244b1367d54(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; +const $dcd1c8c04a2b6f59$export$bf7d3c0236f0aa85 = /*#__PURE__*/ $dcd1c8c04a2b6f59$export$b41394a5437791c8(// the leading comma is intentional so empty string "" is also included +",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"); +const $dcd1c8c04a2b6f59$var$cacheStringFunction = (fn)=>{ + const cache = Object.create(null); + return (str)=>{ + const hit = cache[str]; + return hit || (cache[str] = fn(str)); + }; +}; +const $dcd1c8c04a2b6f59$var$camelizeRE = /-(\w)/g; +/** + * @private + */ const $dcd1c8c04a2b6f59$export$161d051f5dd25de7 = $dcd1c8c04a2b6f59$var$cacheStringFunction((str)=>{ + return str.replace($dcd1c8c04a2b6f59$var$camelizeRE, (_, c)=>c ? c.toUpperCase() : ""); +}); +const $dcd1c8c04a2b6f59$var$hyphenateRE = /\B([A-Z])/g; +/** + * @private + */ const $dcd1c8c04a2b6f59$export$6e6a0a3676c4b8bb = $dcd1c8c04a2b6f59$var$cacheStringFunction((str)=>str.replace($dcd1c8c04a2b6f59$var$hyphenateRE, "-$1").toLowerCase()); +/** + * @private + */ const $dcd1c8c04a2b6f59$export$9a00dee1beb8f576 = $dcd1c8c04a2b6f59$var$cacheStringFunction((str)=>str.charAt(0).toUpperCase() + str.slice(1)); +/** + * @private + */ const $dcd1c8c04a2b6f59$export$8c022799eeaaefcd = $dcd1c8c04a2b6f59$var$cacheStringFunction((str)=>str ? `on${$dcd1c8c04a2b6f59$export$9a00dee1beb8f576(str)}` : ``); +// compare whether a value has changed, accounting for NaN. +const $dcd1c8c04a2b6f59$export$f619eb8b89076d23 = (value, oldValue)=>value !== oldValue && (value === value || oldValue === oldValue); +const $dcd1c8c04a2b6f59$export$39951422d618a9d3 = (fns, arg)=>{ + for(let i = 0; i < fns.length; i++)fns[i](arg); +}; +const $dcd1c8c04a2b6f59$export$8afb76124cf08683 = (obj, key, value)=>{ + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value: value + }); +}; +const $dcd1c8c04a2b6f59$export$a0a81dc3380ce7d3 = (val)=>{ + const n = parseFloat(val); + return isNaN(n) ? val : n; +}; +let $dcd1c8c04a2b6f59$var$_globalThis; +const $dcd1c8c04a2b6f59$export$ff5f2eeb11fc7e14 = ()=>{ + return $dcd1c8c04a2b6f59$var$_globalThis || ($dcd1c8c04a2b6f59$var$_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof $parcel$global !== "undefined" ? $parcel$global : {}); +}; + + +const $c045fc085b5f16e6$var$targetMap = new WeakMap(); +const $c045fc085b5f16e6$var$effectStack = []; +let $c045fc085b5f16e6$var$activeEffect; +const $c045fc085b5f16e6$export$3c41b1a4e06acc14 = Symbol(""); +const $c045fc085b5f16e6$var$MAP_KEY_ITERATE_KEY = Symbol(""); +function $c045fc085b5f16e6$var$isEffect(fn) { + return fn && fn._isEffect === true; +} +function $c045fc085b5f16e6$export$dc573d8a6576cdb3(fn, options = (0, $dcd1c8c04a2b6f59$export$cf583d23ab39677c)) { + if ($c045fc085b5f16e6$var$isEffect(fn)) fn = fn.raw; + const effect = $c045fc085b5f16e6$var$createReactiveEffect(fn, options); + if (!options.lazy) effect(); + return effect; +} +function $c045fc085b5f16e6$export$fa6813432f753b0d(effect) { + if (effect.active) { + $c045fc085b5f16e6$var$cleanup(effect); + if (effect.options.onStop) effect.options.onStop(); + effect.active = false; + } +} +let $c045fc085b5f16e6$var$uid = 0; +function $c045fc085b5f16e6$var$createReactiveEffect(fn, options) { + const effect = function reactiveEffect() { + if (!effect.active) return fn(); + if (!$c045fc085b5f16e6$var$effectStack.includes(effect)) { + $c045fc085b5f16e6$var$cleanup(effect); + try { + $c045fc085b5f16e6$export$1f8ffc6fd33b1d16(); + $c045fc085b5f16e6$var$effectStack.push(effect); + $c045fc085b5f16e6$var$activeEffect = effect; + return fn(); + } finally{ + $c045fc085b5f16e6$var$effectStack.pop(); + $c045fc085b5f16e6$export$c39176b1babaa8b8(); + $c045fc085b5f16e6$var$activeEffect = $c045fc085b5f16e6$var$effectStack[$c045fc085b5f16e6$var$effectStack.length - 1]; + } + } + }; + effect.id = $c045fc085b5f16e6$var$uid++; + effect.allowRecurse = !!options.allowRecurse; + effect._isEffect = true; + effect.active = true; + effect.raw = fn; + effect.deps = []; + effect.options = options; + return effect; +} +function $c045fc085b5f16e6$var$cleanup(effect) { + const { deps: deps } = effect; + if (deps.length) { + for(let i = 0; i < deps.length; i++)deps[i].delete(effect); + deps.length = 0; + } +} +let $c045fc085b5f16e6$var$shouldTrack = true; +const $c045fc085b5f16e6$var$trackStack = []; +function $c045fc085b5f16e6$export$938a971395fef855() { + $c045fc085b5f16e6$var$trackStack.push($c045fc085b5f16e6$var$shouldTrack); + $c045fc085b5f16e6$var$shouldTrack = false; +} +function $c045fc085b5f16e6$export$1f8ffc6fd33b1d16() { + $c045fc085b5f16e6$var$trackStack.push($c045fc085b5f16e6$var$shouldTrack); + $c045fc085b5f16e6$var$shouldTrack = true; +} +function $c045fc085b5f16e6$export$c39176b1babaa8b8() { + const last = $c045fc085b5f16e6$var$trackStack.pop(); + $c045fc085b5f16e6$var$shouldTrack = last === undefined ? true : last; +} +function $c045fc085b5f16e6$export$6b2a7d5132615086(target, type, key) { + if (!$c045fc085b5f16e6$var$shouldTrack || $c045fc085b5f16e6$var$activeEffect === undefined) return; + let depsMap = $c045fc085b5f16e6$var$targetMap.get(target); + if (!depsMap) $c045fc085b5f16e6$var$targetMap.set(target, depsMap = new Map()); + let dep = depsMap.get(key); + if (!dep) depsMap.set(key, dep = new Set()); + if (!dep.has($c045fc085b5f16e6$var$activeEffect)) { + dep.add($c045fc085b5f16e6$var$activeEffect); + $c045fc085b5f16e6$var$activeEffect.deps.push(dep); + } +} +function $c045fc085b5f16e6$export$e614dc9140f7ae71(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = $c045fc085b5f16e6$var$targetMap.get(target); + if (!depsMap) // never been tracked + return; + const effects = new Set(); + const add = (effectsToAdd)=>{ + if (effectsToAdd) effectsToAdd.forEach((effect)=>{ + if (effect !== $c045fc085b5f16e6$var$activeEffect || effect.allowRecurse) effects.add(effect); + }); + }; + if (type === "clear" /* CLEAR */ ) // collection being cleared + // trigger all effects for target + depsMap.forEach(add); + else if (key === "length" && (0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target)) depsMap.forEach((dep, key)=>{ + if (key === "length" || key >= newValue) add(dep); + }); + else { + // schedule runs for SET | ADD | DELETE + if (key !== void 0) add(depsMap.get(key)); + // also run for iteration key on ADD | DELETE | Map.SET + switch(type){ + case "add" /* ADD */ : + if (!(0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target)) { + add(depsMap.get($c045fc085b5f16e6$export$3c41b1a4e06acc14)); + if ((0, $dcd1c8c04a2b6f59$export$5c90113a285f2241)(target)) add(depsMap.get($c045fc085b5f16e6$var$MAP_KEY_ITERATE_KEY)); + } else if ((0, $dcd1c8c04a2b6f59$export$e2a2b93446ec9fe)(key)) // new index added to array -> length changes + add(depsMap.get("length")); + break; + case "delete" /* DELETE */ : + if (!(0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target)) { + add(depsMap.get($c045fc085b5f16e6$export$3c41b1a4e06acc14)); + if ((0, $dcd1c8c04a2b6f59$export$5c90113a285f2241)(target)) add(depsMap.get($c045fc085b5f16e6$var$MAP_KEY_ITERATE_KEY)); + } + break; + case "set" /* SET */ : + if ((0, $dcd1c8c04a2b6f59$export$5c90113a285f2241)(target)) add(depsMap.get($c045fc085b5f16e6$export$3c41b1a4e06acc14)); + break; + } + } + const run = (effect)=>{ + if (effect.options.scheduler) effect.options.scheduler(effect); + else effect(); + }; + effects.forEach(run); +} +const $c045fc085b5f16e6$var$isNonTrackableKeys = /*#__PURE__*/ (0, $dcd1c8c04a2b6f59$export$b41394a5437791c8)(`__proto__,__v_isRef,__isVue`); +const $c045fc085b5f16e6$var$builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key)=>Symbol[key]).filter((0, $dcd1c8c04a2b6f59$export$a244864fd9645c7f))); +const $c045fc085b5f16e6$var$get = /*#__PURE__*/ $c045fc085b5f16e6$var$createGetter(); +const $c045fc085b5f16e6$var$shallowGet = /*#__PURE__*/ $c045fc085b5f16e6$var$createGetter(false, true); +const $c045fc085b5f16e6$var$readonlyGet = /*#__PURE__*/ $c045fc085b5f16e6$var$createGetter(true); +const $c045fc085b5f16e6$var$shallowReadonlyGet = /*#__PURE__*/ $c045fc085b5f16e6$var$createGetter(true, true); +const $c045fc085b5f16e6$var$arrayInstrumentations = /*#__PURE__*/ $c045fc085b5f16e6$var$createArrayInstrumentations(); +function $c045fc085b5f16e6$var$createArrayInstrumentations() { + const instrumentations = {}; + [ + "includes", + "indexOf", + "lastIndexOf" + ].forEach((key)=>{ + instrumentations[key] = function(...args) { + const arr = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + for(let i = 0, l = this.length; i < l; i++)$c045fc085b5f16e6$export$6b2a7d5132615086(arr, "get" /* GET */ , i + ""); + // we run the method using the original args first (which may be reactive) + const res = arr[key](...args); + if (res === -1 || res === false) // if that didn't work, run it again using raw values. + return arr[key](...args.map($c045fc085b5f16e6$export$ab18938b9fc5f28e)); + else return res; + }; + }); + [ + "push", + "pop", + "shift", + "unshift", + "splice" + ].forEach((key)=>{ + instrumentations[key] = function(...args) { + $c045fc085b5f16e6$export$938a971395fef855(); + const res = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this)[key].apply(this, args); + $c045fc085b5f16e6$export$c39176b1babaa8b8(); + return res; + }; + }); + return instrumentations; +} +function $c045fc085b5f16e6$var$createGetter(isReadonly = false, shallow = false) { + return function get(target, key, receiver) { + if (key === "__v_isReactive" /* IS_REACTIVE */ ) return !isReadonly; + else if (key === "__v_isReadonly" /* IS_READONLY */ ) return isReadonly; + else if (key === "__v_raw" /* RAW */ && receiver === (isReadonly ? shallow ? $c045fc085b5f16e6$var$shallowReadonlyMap : $c045fc085b5f16e6$var$readonlyMap : shallow ? $c045fc085b5f16e6$var$shallowReactiveMap : $c045fc085b5f16e6$var$reactiveMap).get(target)) return target; + const targetIsArray = (0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target); + if (!isReadonly && targetIsArray && (0, $dcd1c8c04a2b6f59$export$b5a638e9b3fff9f3)($c045fc085b5f16e6$var$arrayInstrumentations, key)) return Reflect.get($c045fc085b5f16e6$var$arrayInstrumentations, key, receiver); + const res = Reflect.get(target, key, receiver); + if ((0, $dcd1c8c04a2b6f59$export$a244864fd9645c7f)(key) ? $c045fc085b5f16e6$var$builtInSymbols.has(key) : $c045fc085b5f16e6$var$isNonTrackableKeys(key)) return res; + if (!isReadonly) $c045fc085b5f16e6$export$6b2a7d5132615086(target, "get" /* GET */ , key); + if (shallow) return res; + if ($c045fc085b5f16e6$export$4f9f5282de18fc69(res)) { + // ref unwrapping - does not apply for Array + integer key. + const shouldUnwrap = !targetIsArray || !(0, $dcd1c8c04a2b6f59$export$e2a2b93446ec9fe)(key); + return shouldUnwrap ? res.value : res; + } + if ((0, $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a)(res)) // Convert returned value into a proxy as well. we do the isObject check + // here to avoid invalid value warning. Also need to lazy access readonly + // and reactive here to avoid circular dependency. + return isReadonly ? $c045fc085b5f16e6$export$6ec456bd5b7b3c51(res) : $c045fc085b5f16e6$export$90a44edba14e47be(res); + return res; + }; +} +const $c045fc085b5f16e6$var$set = /*#__PURE__*/ $c045fc085b5f16e6$var$createSetter(); +const $c045fc085b5f16e6$var$shallowSet = /*#__PURE__*/ $c045fc085b5f16e6$var$createSetter(true); +function $c045fc085b5f16e6$var$createSetter(shallow = false) { + return function set(target, key, value, receiver) { + let oldValue = target[key]; + if (!shallow) { + value = $c045fc085b5f16e6$export$ab18938b9fc5f28e(value); + oldValue = $c045fc085b5f16e6$export$ab18938b9fc5f28e(oldValue); + if (!(0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target) && $c045fc085b5f16e6$export$4f9f5282de18fc69(oldValue) && !$c045fc085b5f16e6$export$4f9f5282de18fc69(value)) { + oldValue.value = value; + return true; + } + } + const hadKey = (0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target) && (0, $dcd1c8c04a2b6f59$export$e2a2b93446ec9fe)(key) ? Number(key) < target.length : (0, $dcd1c8c04a2b6f59$export$b5a638e9b3fff9f3)(target, key); + const result = Reflect.set(target, key, value, receiver); + // don't trigger if target is something up in the prototype chain of original + if (target === $c045fc085b5f16e6$export$ab18938b9fc5f28e(receiver)) { + if (!hadKey) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "add" /* ADD */ , key, value); + else if ((0, $dcd1c8c04a2b6f59$export$f619eb8b89076d23)(value, oldValue)) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "set" /* SET */ , key, value, oldValue); + } + return result; + }; +} +function $c045fc085b5f16e6$var$deleteProperty(target, key) { + const hadKey = (0, $dcd1c8c04a2b6f59$export$b5a638e9b3fff9f3)(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "delete" /* DELETE */ , key, undefined, oldValue); + return result; +} +function $c045fc085b5f16e6$var$has(target, key) { + const result = Reflect.has(target, key); + if (!(0, $dcd1c8c04a2b6f59$export$a244864fd9645c7f)(key) || !$c045fc085b5f16e6$var$builtInSymbols.has(key)) $c045fc085b5f16e6$export$6b2a7d5132615086(target, "has" /* HAS */ , key); + return result; +} +function $c045fc085b5f16e6$var$ownKeys(target) { + $c045fc085b5f16e6$export$6b2a7d5132615086(target, "iterate" /* ITERATE */ , (0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(target) ? "length" : $c045fc085b5f16e6$export$3c41b1a4e06acc14); + return Reflect.ownKeys(target); +} +const $c045fc085b5f16e6$var$mutableHandlers = { + get: $c045fc085b5f16e6$var$get, + set: $c045fc085b5f16e6$var$set, + deleteProperty: $c045fc085b5f16e6$var$deleteProperty, + has: $c045fc085b5f16e6$var$has, + ownKeys: $c045fc085b5f16e6$var$ownKeys +}; +const $c045fc085b5f16e6$var$readonlyHandlers = { + get: $c045fc085b5f16e6$var$readonlyGet, + set (target, key) { + return true; + }, + deleteProperty (target, key) { + return true; + } +}; +const $c045fc085b5f16e6$var$shallowReactiveHandlers = /*#__PURE__*/ (0, $dcd1c8c04a2b6f59$export$8b58be045bf06082)({}, $c045fc085b5f16e6$var$mutableHandlers, { + get: $c045fc085b5f16e6$var$shallowGet, + set: $c045fc085b5f16e6$var$shallowSet +}); +// Props handlers are special in the sense that it should not unwrap top-level +// refs (in order to allow refs to be explicitly passed down), but should +// retain the reactivity of the normal readonly object. +const $c045fc085b5f16e6$var$shallowReadonlyHandlers = /*#__PURE__*/ (0, $dcd1c8c04a2b6f59$export$8b58be045bf06082)({}, $c045fc085b5f16e6$var$readonlyHandlers, { + get: $c045fc085b5f16e6$var$shallowReadonlyGet +}); +const $c045fc085b5f16e6$var$toReactive = (value)=>(0, $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a)(value) ? $c045fc085b5f16e6$export$90a44edba14e47be(value) : value; +const $c045fc085b5f16e6$var$toReadonly = (value)=>(0, $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a)(value) ? $c045fc085b5f16e6$export$6ec456bd5b7b3c51(value) : value; +const $c045fc085b5f16e6$var$toShallow = (value)=>value; +const $c045fc085b5f16e6$var$getProto = (v)=>Reflect.getPrototypeOf(v); +function $c045fc085b5f16e6$var$get$1(target, key, isReadonly = false, isShallow = false) { + // #1772: readonly(reactive(Map)) should return readonly + reactive version + // of the value + target = target["__v_raw" /* RAW */ ]; + const rawTarget = $c045fc085b5f16e6$export$ab18938b9fc5f28e(target); + const rawKey = $c045fc085b5f16e6$export$ab18938b9fc5f28e(key); + if (key !== rawKey) !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "get" /* GET */ , key); + !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "get" /* GET */ , rawKey); + const { has: has } = $c045fc085b5f16e6$var$getProto(rawTarget); + const wrap = isShallow ? $c045fc085b5f16e6$var$toShallow : isReadonly ? $c045fc085b5f16e6$var$toReadonly : $c045fc085b5f16e6$var$toReactive; + if (has.call(rawTarget, key)) return wrap(target.get(key)); + else if (has.call(rawTarget, rawKey)) return wrap(target.get(rawKey)); + else if (target !== rawTarget) // #3602 readonly(reactive(Map)) + // ensure that the nested reactive `Map` can do tracking for itself + target.get(key); +} +function $c045fc085b5f16e6$var$has$1(key, isReadonly = false) { + const target = this["__v_raw" /* RAW */ ]; + const rawTarget = $c045fc085b5f16e6$export$ab18938b9fc5f28e(target); + const rawKey = $c045fc085b5f16e6$export$ab18938b9fc5f28e(key); + if (key !== rawKey) !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "has" /* HAS */ , key); + !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "has" /* HAS */ , rawKey); + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); +} +function $c045fc085b5f16e6$var$size(target, isReadonly = false) { + target = target["__v_raw" /* RAW */ ]; + !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086($c045fc085b5f16e6$export$ab18938b9fc5f28e(target), "iterate" /* ITERATE */ , $c045fc085b5f16e6$export$3c41b1a4e06acc14); + return Reflect.get(target, "size", target); +} +function $c045fc085b5f16e6$var$add(value) { + value = $c045fc085b5f16e6$export$ab18938b9fc5f28e(value); + const target = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + const proto = $c045fc085b5f16e6$var$getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "add" /* ADD */ , value, value); + } + return this; +} +function $c045fc085b5f16e6$var$set$1(key, value) { + value = $c045fc085b5f16e6$export$ab18938b9fc5f28e(value); + const target = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + const { has: has , get: get } = $c045fc085b5f16e6$var$getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = $c045fc085b5f16e6$export$ab18938b9fc5f28e(key); + hadKey = has.call(target, key); + } + const oldValue = get.call(target, key); + target.set(key, value); + if (!hadKey) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "add" /* ADD */ , key, value); + else if ((0, $dcd1c8c04a2b6f59$export$f619eb8b89076d23)(value, oldValue)) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "set" /* SET */ , key, value, oldValue); + return this; +} +function $c045fc085b5f16e6$var$deleteEntry(key) { + const target = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + const { has: has , get: get } = $c045fc085b5f16e6$var$getProto(target); + let hadKey = has.call(target, key); + if (!hadKey) { + key = $c045fc085b5f16e6$export$ab18938b9fc5f28e(key); + hadKey = has.call(target, key); + } + const oldValue = get ? get.call(target, key) : undefined; + // forward the operation before queueing reactions + const result = target.delete(key); + if (hadKey) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "delete" /* DELETE */ , key, undefined, oldValue); + return result; +} +function $c045fc085b5f16e6$var$clear() { + const target = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + const hadItems = target.size !== 0; + const oldTarget = undefined; + // forward the operation before queueing reactions + const result = target.clear(); + if (hadItems) $c045fc085b5f16e6$export$e614dc9140f7ae71(target, "clear" /* CLEAR */ , undefined, undefined, oldTarget); + return result; +} +function $c045fc085b5f16e6$var$createForEach(isReadonly, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed["__v_raw" /* RAW */ ]; + const rawTarget = $c045fc085b5f16e6$export$ab18938b9fc5f28e(target); + const wrap = isShallow ? $c045fc085b5f16e6$var$toShallow : isReadonly ? $c045fc085b5f16e6$var$toReadonly : $c045fc085b5f16e6$var$toReactive; + !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "iterate" /* ITERATE */ , $c045fc085b5f16e6$export$3c41b1a4e06acc14); + return target.forEach((value, key)=>{ + // important: make sure the callback is + // 1. invoked with the reactive map as `this` and 3rd arg + // 2. the value received should be a corresponding reactive/readonly. + return callback.call(thisArg, wrap(value), wrap(key), observed); + }); + }; +} +function $c045fc085b5f16e6$var$createIterableMethod(method, isReadonly, isShallow) { + return function(...args) { + const target = this["__v_raw" /* RAW */ ]; + const rawTarget = $c045fc085b5f16e6$export$ab18938b9fc5f28e(target); + const targetIsMap = (0, $dcd1c8c04a2b6f59$export$5c90113a285f2241)(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? $c045fc085b5f16e6$var$toShallow : isReadonly ? $c045fc085b5f16e6$var$toReadonly : $c045fc085b5f16e6$var$toReactive; + !isReadonly && $c045fc085b5f16e6$export$6b2a7d5132615086(rawTarget, "iterate" /* ITERATE */ , isKeyOnly ? $c045fc085b5f16e6$var$MAP_KEY_ITERATE_KEY : $c045fc085b5f16e6$export$3c41b1a4e06acc14); + // return a wrapped iterator which returns observed versions of the + // values emitted from the real iterator + return { + // iterator protocol + next () { + const { value: value , done: done } = innerIterator.next(); + return done ? { + value: value, + done: done + } : { + value: isPair ? [ + wrap(value[0]), + wrap(value[1]) + ] : wrap(value), + done: done + }; + }, + // iterable protocol + [Symbol.iterator] () { + return this; + } + }; + }; +} +function $c045fc085b5f16e6$var$createReadonlyMethod(type) { + return function(...args) { + return type === "delete" /* DELETE */ ? false : this; + }; +} +function $c045fc085b5f16e6$var$createInstrumentations() { + const mutableInstrumentations = { + get (key) { + return $c045fc085b5f16e6$var$get$1(this, key); + }, + get size () { + return $c045fc085b5f16e6$var$size(this); + }, + has: $c045fc085b5f16e6$var$has$1, + add: $c045fc085b5f16e6$var$add, + set: $c045fc085b5f16e6$var$set$1, + delete: $c045fc085b5f16e6$var$deleteEntry, + clear: $c045fc085b5f16e6$var$clear, + forEach: $c045fc085b5f16e6$var$createForEach(false, false) + }; + const shallowInstrumentations = { + get (key) { + return $c045fc085b5f16e6$var$get$1(this, key, false, true); + }, + get size () { + return $c045fc085b5f16e6$var$size(this); + }, + has: $c045fc085b5f16e6$var$has$1, + add: $c045fc085b5f16e6$var$add, + set: $c045fc085b5f16e6$var$set$1, + delete: $c045fc085b5f16e6$var$deleteEntry, + clear: $c045fc085b5f16e6$var$clear, + forEach: $c045fc085b5f16e6$var$createForEach(false, true) + }; + const readonlyInstrumentations = { + get (key) { + return $c045fc085b5f16e6$var$get$1(this, key, true); + }, + get size () { + return $c045fc085b5f16e6$var$size(this, true); + }, + has (key) { + return $c045fc085b5f16e6$var$has$1.call(this, key, true); + }, + add: $c045fc085b5f16e6$var$createReadonlyMethod("add" /* ADD */ ), + set: $c045fc085b5f16e6$var$createReadonlyMethod("set" /* SET */ ), + delete: $c045fc085b5f16e6$var$createReadonlyMethod("delete" /* DELETE */ ), + clear: $c045fc085b5f16e6$var$createReadonlyMethod("clear" /* CLEAR */ ), + forEach: $c045fc085b5f16e6$var$createForEach(true, false) + }; + const shallowReadonlyInstrumentations = { + get (key) { + return $c045fc085b5f16e6$var$get$1(this, key, true, true); + }, + get size () { + return $c045fc085b5f16e6$var$size(this, true); + }, + has (key) { + return $c045fc085b5f16e6$var$has$1.call(this, key, true); + }, + add: $c045fc085b5f16e6$var$createReadonlyMethod("add" /* ADD */ ), + set: $c045fc085b5f16e6$var$createReadonlyMethod("set" /* SET */ ), + delete: $c045fc085b5f16e6$var$createReadonlyMethod("delete" /* DELETE */ ), + clear: $c045fc085b5f16e6$var$createReadonlyMethod("clear" /* CLEAR */ ), + forEach: $c045fc085b5f16e6$var$createForEach(true, true) + }; + const iteratorMethods = [ + "keys", + "values", + "entries", + Symbol.iterator + ]; + iteratorMethods.forEach((method)=>{ + mutableInstrumentations[method] = $c045fc085b5f16e6$var$createIterableMethod(method, false, false); + readonlyInstrumentations[method] = $c045fc085b5f16e6$var$createIterableMethod(method, true, false); + shallowInstrumentations[method] = $c045fc085b5f16e6$var$createIterableMethod(method, false, true); + shallowReadonlyInstrumentations[method] = $c045fc085b5f16e6$var$createIterableMethod(method, true, true); + }); + return [ + mutableInstrumentations, + readonlyInstrumentations, + shallowInstrumentations, + shallowReadonlyInstrumentations + ]; +} +const [$c045fc085b5f16e6$var$mutableInstrumentations, $c045fc085b5f16e6$var$readonlyInstrumentations, $c045fc085b5f16e6$var$shallowInstrumentations, $c045fc085b5f16e6$var$shallowReadonlyInstrumentations] = /* #__PURE__*/ $c045fc085b5f16e6$var$createInstrumentations(); +function $c045fc085b5f16e6$var$createInstrumentationGetter(isReadonly, shallow) { + const instrumentations = shallow ? isReadonly ? $c045fc085b5f16e6$var$shallowReadonlyInstrumentations : $c045fc085b5f16e6$var$shallowInstrumentations : isReadonly ? $c045fc085b5f16e6$var$readonlyInstrumentations : $c045fc085b5f16e6$var$mutableInstrumentations; + return (target, key, receiver)=>{ + if (key === "__v_isReactive" /* IS_REACTIVE */ ) return !isReadonly; + else if (key === "__v_isReadonly" /* IS_READONLY */ ) return isReadonly; + else if (key === "__v_raw" /* RAW */ ) return target; + return Reflect.get((0, $dcd1c8c04a2b6f59$export$b5a638e9b3fff9f3)(instrumentations, key) && key in target ? instrumentations : target, key, receiver); + }; +} +const $c045fc085b5f16e6$var$mutableCollectionHandlers = { + get: /*#__PURE__*/ $c045fc085b5f16e6$var$createInstrumentationGetter(false, false) +}; +const $c045fc085b5f16e6$var$shallowCollectionHandlers = { + get: /*#__PURE__*/ $c045fc085b5f16e6$var$createInstrumentationGetter(false, true) +}; +const $c045fc085b5f16e6$var$readonlyCollectionHandlers = { + get: /*#__PURE__*/ $c045fc085b5f16e6$var$createInstrumentationGetter(true, false) +}; +const $c045fc085b5f16e6$var$shallowReadonlyCollectionHandlers = { + get: /*#__PURE__*/ $c045fc085b5f16e6$var$createInstrumentationGetter(true, true) +}; +function $c045fc085b5f16e6$var$checkIdentityKeys(target, has, key) { + const rawKey = $c045fc085b5f16e6$export$ab18938b9fc5f28e(key); + if (rawKey !== key && has.call(target, rawKey)) { + const type = (0, $dcd1c8c04a2b6f59$export$5ad0a3c360b8fbb5)(target); + console.warn(`Reactive ${type} contains both the raw and reactive ` + `versions of the same object${type === `Map` ? ` as keys` : ``}, ` + `which can lead to inconsistencies. ` + `Avoid differentiating between the raw and reactive versions ` + `of an object and only use the reactive version if possible.`); + } +} +const $c045fc085b5f16e6$var$reactiveMap = new WeakMap(); +const $c045fc085b5f16e6$var$shallowReactiveMap = new WeakMap(); +const $c045fc085b5f16e6$var$readonlyMap = new WeakMap(); +const $c045fc085b5f16e6$var$shallowReadonlyMap = new WeakMap(); +function $c045fc085b5f16e6$var$targetTypeMap(rawType) { + switch(rawType){ + case "Object": + case "Array": + return 1 /* COMMON */ ; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2 /* COLLECTION */ ; + default: + return 0 /* INVALID */ ; + } +} +function $c045fc085b5f16e6$var$getTargetType(value) { + return value["__v_skip" /* SKIP */ ] || !Object.isExtensible(value) ? 0 /* INVALID */ : $c045fc085b5f16e6$var$targetTypeMap((0, $dcd1c8c04a2b6f59$export$5ad0a3c360b8fbb5)(value)); +} +function $c045fc085b5f16e6$export$90a44edba14e47be(target) { + // if trying to observe a readonly proxy, return the readonly version. + if (target && target["__v_isReadonly" /* IS_READONLY */ ]) return target; + return $c045fc085b5f16e6$var$createReactiveObject(target, false, $c045fc085b5f16e6$var$mutableHandlers, $c045fc085b5f16e6$var$mutableCollectionHandlers, $c045fc085b5f16e6$var$reactiveMap); +} +/** + * Return a shallowly-reactive copy of the original object, where only the root + * level properties are reactive. It also does not auto-unwrap refs (even at the + * root level). + */ function $c045fc085b5f16e6$export$8d81cefd22d22260(target) { + return $c045fc085b5f16e6$var$createReactiveObject(target, false, $c045fc085b5f16e6$var$shallowReactiveHandlers, $c045fc085b5f16e6$var$shallowCollectionHandlers, $c045fc085b5f16e6$var$shallowReactiveMap); +} +/** + * Creates a readonly copy of the original object. Note the returned copy is not + * made reactive, but `readonly` can be called on an already reactive object. + */ function $c045fc085b5f16e6$export$6ec456bd5b7b3c51(target) { + return $c045fc085b5f16e6$var$createReactiveObject(target, true, $c045fc085b5f16e6$var$readonlyHandlers, $c045fc085b5f16e6$var$readonlyCollectionHandlers, $c045fc085b5f16e6$var$readonlyMap); +} +/** + * Returns a reactive-copy of the original object, where only the root level + * properties are readonly, and does NOT unwrap refs nor recursively convert + * returned properties. + * This is used for creating the props proxy object for stateful components. + */ function $c045fc085b5f16e6$export$7c4b5f2b50f09f6b(target) { + return $c045fc085b5f16e6$var$createReactiveObject(target, true, $c045fc085b5f16e6$var$shallowReadonlyHandlers, $c045fc085b5f16e6$var$shallowReadonlyCollectionHandlers, $c045fc085b5f16e6$var$shallowReadonlyMap); +} +function $c045fc085b5f16e6$var$createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) { + if (!(0, $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a)(target)) return target; + // target is already a Proxy, return it. + // exception: calling readonly() on a reactive object + if (target["__v_raw" /* RAW */ ] && !(isReadonly && target["__v_isReactive" /* IS_REACTIVE */ ])) return target; + // target already has corresponding Proxy + const existingProxy = proxyMap.get(target); + if (existingProxy) return existingProxy; + // only a whitelist of value types can be observed. + const targetType = $c045fc085b5f16e6$var$getTargetType(target); + if (targetType === 0 /* INVALID */ ) return target; + const proxy = new Proxy(target, targetType === 2 /* COLLECTION */ ? collectionHandlers : baseHandlers); + proxyMap.set(target, proxy); + return proxy; +} +function $c045fc085b5f16e6$export$352205f445242f02(value) { + if ($c045fc085b5f16e6$export$92d09b48637741e7(value)) return $c045fc085b5f16e6$export$352205f445242f02(value["__v_raw" /* RAW */ ]); + return !!(value && value["__v_isReactive" /* IS_REACTIVE */ ]); +} +function $c045fc085b5f16e6$export$92d09b48637741e7(value) { + return !!(value && value["__v_isReadonly" /* IS_READONLY */ ]); +} +function $c045fc085b5f16e6$export$5f3ca29d057519b3(value) { + return $c045fc085b5f16e6$export$352205f445242f02(value) || $c045fc085b5f16e6$export$92d09b48637741e7(value); +} +function $c045fc085b5f16e6$export$ab18938b9fc5f28e(observed) { + return observed && $c045fc085b5f16e6$export$ab18938b9fc5f28e(observed["__v_raw" /* RAW */ ]) || observed; +} +function $c045fc085b5f16e6$export$995ab8b13ad7a9d0(value) { + (0, $dcd1c8c04a2b6f59$export$8afb76124cf08683)(value, "__v_skip" /* SKIP */ , true); + return value; +} +const $c045fc085b5f16e6$var$convert = (val)=>(0, $dcd1c8c04a2b6f59$export$a6cdc56e425d0d0a)(val) ? $c045fc085b5f16e6$export$90a44edba14e47be(val) : val; +function $c045fc085b5f16e6$export$4f9f5282de18fc69(r) { + return Boolean(r && r.__v_isRef === true); +} +function $c045fc085b5f16e6$export$eff4d24c3ff7876e(value) { + return $c045fc085b5f16e6$var$createRef(value); +} +function $c045fc085b5f16e6$export$9b7bc5fe3b17c8b3(value) { + return $c045fc085b5f16e6$var$createRef(value, true); +} +class $c045fc085b5f16e6$var$RefImpl { + constructor(value, _shallow = false){ + this._shallow = _shallow; + this.__v_isRef = true; + this._rawValue = _shallow ? value : $c045fc085b5f16e6$export$ab18938b9fc5f28e(value); + this._value = _shallow ? value : $c045fc085b5f16e6$var$convert(value); + } + get value() { + $c045fc085b5f16e6$export$6b2a7d5132615086($c045fc085b5f16e6$export$ab18938b9fc5f28e(this), "get" /* GET */ , "value"); + return this._value; + } + set value(newVal) { + newVal = this._shallow ? newVal : $c045fc085b5f16e6$export$ab18938b9fc5f28e(newVal); + if ((0, $dcd1c8c04a2b6f59$export$f619eb8b89076d23)(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = this._shallow ? newVal : $c045fc085b5f16e6$var$convert(newVal); + $c045fc085b5f16e6$export$e614dc9140f7ae71($c045fc085b5f16e6$export$ab18938b9fc5f28e(this), "set" /* SET */ , "value", newVal); + } + } +} +function $c045fc085b5f16e6$var$createRef(rawValue, shallow = false) { + if ($c045fc085b5f16e6$export$4f9f5282de18fc69(rawValue)) return rawValue; + return new $c045fc085b5f16e6$var$RefImpl(rawValue, shallow); +} +function $c045fc085b5f16e6$export$f402f86588575ccc(ref) { + $c045fc085b5f16e6$export$e614dc9140f7ae71($c045fc085b5f16e6$export$ab18938b9fc5f28e(ref), "set" /* SET */ , "value", void 0); +} +function $c045fc085b5f16e6$export$a239a76781616204(ref) { + return $c045fc085b5f16e6$export$4f9f5282de18fc69(ref) ? ref.value : ref; +} +const $c045fc085b5f16e6$var$shallowUnwrapHandlers = { + get: (target, key, receiver)=>$c045fc085b5f16e6$export$a239a76781616204(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver)=>{ + const oldValue = target[key]; + if ($c045fc085b5f16e6$export$4f9f5282de18fc69(oldValue) && !$c045fc085b5f16e6$export$4f9f5282de18fc69(value)) { + oldValue.value = value; + return true; + } else return Reflect.set(target, key, value, receiver); + } +}; +function $c045fc085b5f16e6$export$f353fd1b97db3fa0(objectWithRefs) { + return $c045fc085b5f16e6$export$352205f445242f02(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, $c045fc085b5f16e6$var$shallowUnwrapHandlers); +} +class $c045fc085b5f16e6$var$CustomRefImpl { + constructor(factory){ + this.__v_isRef = true; + const { get: get , set: set } = factory(()=>$c045fc085b5f16e6$export$6b2a7d5132615086(this, "get" /* GET */ , "value"), ()=>$c045fc085b5f16e6$export$e614dc9140f7ae71(this, "set" /* SET */ , "value")); + this._get = get; + this._set = set; + } + get value() { + return this._get(); + } + set value(newVal) { + this._set(newVal); + } +} +function $c045fc085b5f16e6$export$a20c2dd6199824cb(factory) { + return new $c045fc085b5f16e6$var$CustomRefImpl(factory); +} +function $c045fc085b5f16e6$export$2e9533675e5e70e0(object) { + const ret = (0, $dcd1c8c04a2b6f59$export$43bee75e5e14138e)(object) ? new Array(object.length) : {}; + for(const key in object)ret[key] = $c045fc085b5f16e6$export$1f60508e4f47b4b7(object, key); + return ret; +} +class $c045fc085b5f16e6$var$ObjectRefImpl { + constructor(_object, _key){ + this._object = _object; + this._key = _key; + this.__v_isRef = true; + } + get value() { + return this._object[this._key]; + } + set value(newVal) { + this._object[this._key] = newVal; + } +} +function $c045fc085b5f16e6$export$1f60508e4f47b4b7(object, key) { + return $c045fc085b5f16e6$export$4f9f5282de18fc69(object[key]) ? object[key] : new $c045fc085b5f16e6$var$ObjectRefImpl(object, key); +} +class $c045fc085b5f16e6$var$ComputedRefImpl { + constructor(getter, _setter, isReadonly){ + this._setter = _setter; + this._dirty = true; + this.__v_isRef = true; + this.effect = $c045fc085b5f16e6$export$dc573d8a6576cdb3(getter, { + lazy: true, + scheduler: ()=>{ + if (!this._dirty) { + this._dirty = true; + $c045fc085b5f16e6$export$e614dc9140f7ae71($c045fc085b5f16e6$export$ab18938b9fc5f28e(this), "set" /* SET */ , "value"); + } + } + }); + this["__v_isReadonly" /* IS_READONLY */ ] = isReadonly; + } + get value() { + // the computed ref may get wrapped by other proxies e.g. readonly() #3376 + const self = $c045fc085b5f16e6$export$ab18938b9fc5f28e(this); + if (self._dirty) { + self._value = this.effect(); + self._dirty = false; + } + $c045fc085b5f16e6$export$6b2a7d5132615086(self, "get" /* GET */ , "value"); + return self._value; + } + set value(newValue) { + this._setter(newValue); + } +} +function $c045fc085b5f16e6$export$2983e091f1a1e8e2(getterOrOptions) { + let getter; + let setter; + if ((0, $dcd1c8c04a2b6f59$export$f6e2535fb5126e54)(getterOrOptions)) { + getter = getterOrOptions; + setter = (0, $dcd1c8c04a2b6f59$export$5702a91a6f42969f); + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; + } + return new $c045fc085b5f16e6$var$ComputedRefImpl(getter, setter, (0, $dcd1c8c04a2b6f59$export$f6e2535fb5126e54)(getterOrOptions) || !getterOrOptions.set); +} + + var $caa9439642c6336c$var$flushPending = false; var $caa9439642c6336c$var$flushing = false; var $caa9439642c6336c$var$queue = []; var $caa9439642c6336c$var$lastFlushedIndex = -1; function $caa9439642c6336c$var$scheduler(callback) { @@ -65,31 +1146,31 @@ } function $caa9439642c6336c$var$overrideEffect(override) { $caa9439642c6336c$var$effect = override; } function $caa9439642c6336c$var$elementBoundEffect(el) { - let cleanup2 = ()=>{}; + let cleanup = ()=>{}; let wrappedEffect = (callback)=>{ let effectReference = $caa9439642c6336c$var$effect(callback); if (!el._x_effects) { el._x_effects = /* @__PURE__ */ new Set(); el._x_runEffects = ()=>{ el._x_effects.forEach((i)=>i()); }; } el._x_effects.add(effectReference); - cleanup2 = ()=>{ + cleanup = ()=>{ if (effectReference === void 0) return; el._x_effects.delete(effectReference); $caa9439642c6336c$var$release(effectReference); }; return effectReference; }; return [ wrappedEffect, ()=>{ - cleanup2(); + cleanup(); } ]; } // packages/alpinejs/src/mutation.js var $caa9439642c6336c$var$onAttributeAddeds = []; @@ -190,25 +1271,25 @@ } if (mutations[i].type === "attributes") { let el = mutations[i].target; let name = mutations[i].attributeName; let oldValue = mutations[i].oldValue; - let add2 = ()=>{ + let add = ()=>{ if (!addedAttributes.has(el)) addedAttributes.set(el, []); addedAttributes.get(el).push({ name: name, value: el.getAttribute(name) }); }; let remove = ()=>{ if (!removedAttributes.has(el)) removedAttributes.set(el, []); removedAttributes.get(el).push(name); }; - if (el.hasAttribute(name) && oldValue === null) add2(); + if (el.hasAttribute(name) && oldValue === null) add(); else if (el.hasAttribute(name)) { remove(); - add2(); + add(); } else remove(); } } removedAttributes.forEach((attrs, el)=>{ $caa9439642c6336c$var$cleanupAttributes(el, attrs); @@ -254,16 +1335,10 @@ ]; return ()=>{ node._x_dataStack = node._x_dataStack.filter((i)=>i !== data2); }; } -function $caa9439642c6336c$var$refreshScope(element, scope2) { - let existingScope = element._x_dataStack[0]; - Object.entries(scope2).forEach(([key, value])=>{ - existingScope[key] = value; - }); -} function $caa9439642c6336c$var$closestDataStack(node) { if (node._x_dataStack) return node._x_dataStack; if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) return $caa9439642c6336c$var$closestDataStack(node.host); if (!node.parentNode) return []; return $caa9439642c6336c$var$closestDataStack(node.parentNode); @@ -309,17 +1384,17 @@ }); return thisProxy; } // packages/alpinejs/src/interceptor.js function $caa9439642c6336c$var$initInterceptors(data2) { - let isObject2 = (val)=>typeof val === "object" && !Array.isArray(val) && val !== null; + let isObject = (val)=>typeof val === "object" && !Array.isArray(val) && val !== null; let recurse = (obj, basePath = "")=>{ Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value: value , enumerable: enumerable }])=>{ if (enumerable === false || value === void 0) return; let path = basePath === "" ? key : `${basePath}.${key}`; if (typeof value === "object" && value !== null && value._x_interceptor) obj[key] = value.initialize(data2, path, key); - else if (isObject2(value) && value !== obj && !(value instanceof Element)) recurse(value, path); + else if (isObject(value) && value !== obj && !(value instanceof Element)) recurse(value, path); }); }; return recurse(data2); } function $caa9439642c6336c$var$interceptor(callback, mutateObj = ()=>{}) { @@ -363,19 +1438,26 @@ function $caa9439642c6336c$var$magic(name, callback) { $caa9439642c6336c$var$magics[name] = callback; } function $caa9439642c6336c$var$injectMagics(obj, el) { Object.entries($caa9439642c6336c$var$magics).forEach(([name, callback])=>{ - Object.defineProperty(obj, `$${name}`, { - get () { - let [utilities, cleanup2] = $caa9439642c6336c$var$getElementBoundUtilities(el); - utilities = { + let memoizedUtilities = null; + function getUtilities() { + if (memoizedUtilities) return memoizedUtilities; + else { + let [utilities, cleanup] = $caa9439642c6336c$var$getElementBoundUtilities(el); + memoizedUtilities = { interceptor: $caa9439642c6336c$var$interceptor, ...utilities }; - $caa9439642c6336c$var$onElRemoved(el, cleanup2); - return callback(el, utilities); + $caa9439642c6336c$var$onElRemoved(el, cleanup); + return memoizedUtilities; + } + } + Object.defineProperty(obj, `$${name}`, { + get () { + return callback(el, getUtilities()); }, enumerable: false }); }); return obj; @@ -554,17 +1636,17 @@ callback(flushHandlers); stopDeferring(); } function $caa9439642c6336c$var$getElementBoundUtilities(el) { let cleanups = []; - let cleanup2 = (callback)=>cleanups.push(callback); + let cleanup = (callback)=>cleanups.push(callback); let [effect3, cleanupEffect] = $caa9439642c6336c$var$elementBoundEffect(el); cleanups.push(cleanupEffect); let utilities = { Alpine: $caa9439642c6336c$var$alpine_default, effect: effect3, - cleanup: cleanup2, + cleanup: cleanup, evaluateLater: $caa9439642c6336c$var$evaluateLater.bind($caa9439642c6336c$var$evaluateLater, el), evaluate: $caa9439642c6336c$var$evaluate.bind($caa9439642c6336c$var$evaluate, el) }; let doCleanup = ()=>cleanups.forEach((i)=>i()); return [ @@ -573,19 +1655,19 @@ ]; } function $caa9439642c6336c$var$getDirectiveHandler(el, directive2) { let noop = ()=>{}; let handler3 = $caa9439642c6336c$var$directiveHandlers[directive2.type] || noop; - let [utilities, cleanup2] = $caa9439642c6336c$var$getElementBoundUtilities(el); - $caa9439642c6336c$var$onAttributeRemoved(el, directive2.original, cleanup2); + let [utilities, cleanup] = $caa9439642c6336c$var$getElementBoundUtilities(el); + $caa9439642c6336c$var$onAttributeRemoved(el, directive2.original, cleanup); let fullHandler = ()=>{ if (el._x_ignore || el._x_ignoreSelf) return; handler3.inline && handler3.inline(el, directive2, utilities); handler3 = handler3.bind(handler3, el, directive2, utilities); $caa9439642c6336c$var$isDeferringHandlers ? $caa9439642c6336c$var$directiveHandlerStacks.get($caa9439642c6336c$var$currentHandlerStackKey).push(handler3) : handler3(); }; - fullHandler.runCleanups = cleanup2; + fullHandler.runCleanups = cleanup; return fullHandler; } var $caa9439642c6336c$var$startingWith = (subject, replacement)=>({ name: name , value: value })=>{ if (name.startsWith(subject)) name = name.replace(subject, replacement); return { @@ -682,11 +1764,14 @@ // packages/alpinejs/src/utils/warn.js function $caa9439642c6336c$var$warn(message, ...args) { console.warn(`Alpine Warning: ${message}`, ...args); } // packages/alpinejs/src/lifecycle.js +var $caa9439642c6336c$var$started = false; function $caa9439642c6336c$var$start() { + if ($caa9439642c6336c$var$started) $caa9439642c6336c$var$warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."); + $caa9439642c6336c$var$started = true; if (!document.body) $caa9439642c6336c$var$warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"); $caa9439642c6336c$var$dispatch(document, "alpine:init"); $caa9439642c6336c$var$dispatch(document, "alpine:initializing"); $caa9439642c6336c$var$startObservingMutations(); $caa9439642c6336c$var$onElAdded((el)=>$caa9439642c6336c$var$initTree(el, $caa9439642c6336c$var$walk)); @@ -852,11 +1937,12 @@ }; } // packages/alpinejs/src/directives/x-transition.js $caa9439642c6336c$var$directive("transition", (el, { value: value , modifiers: modifiers , expression: expression }, { evaluate: evaluate2 })=>{ if (typeof expression === "function") expression = evaluate2(expression); - if (!expression) $caa9439642c6336c$var$registerTransitionsFromHelper(el, modifiers, value); + if (expression === false) return; + if (!expression || typeof expression === "boolean") $caa9439642c6336c$var$registerTransitionsFromHelper(el, modifiers, value); else $caa9439642c6336c$var$registerTransitionsFromClassString(el, expression, value); }); function $caa9439642c6336c$var$registerTransitionsFromClassString(el, classString, stage) { $caa9439642c6336c$var$registerTransitionObject(el, $caa9439642c6336c$var$setClasses, ""); let directiveStorageMap = { @@ -895,20 +1981,20 @@ let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale"); let wantsOpacity = wantsAll || modifiers.includes("opacity"); let wantsScale = wantsAll || modifiers.includes("scale"); let opacityValue = wantsOpacity ? 0 : 1; let scaleValue = wantsScale ? $caa9439642c6336c$var$modifierValue(modifiers, "scale", 95) / 100 : 1; - let delay = $caa9439642c6336c$var$modifierValue(modifiers, "delay", 0); + let delay = $caa9439642c6336c$var$modifierValue(modifiers, "delay", 0) / 1e3; let origin = $caa9439642c6336c$var$modifierValue(modifiers, "origin", "center"); let property = "opacity, transform"; let durationIn = $caa9439642c6336c$var$modifierValue(modifiers, "duration", 150) / 1e3; let durationOut = $caa9439642c6336c$var$modifierValue(modifiers, "duration", 75) / 1e3; let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`; if (transitioningIn) { el._x_transition.enter.during = { transformOrigin: origin, - transitionDelay: delay, + transitionDelay: `${delay}s`, transitionProperty: property, transitionDuration: `${durationIn}s`, transitionTimingFunction: easing }; el._x_transition.enter.start = { @@ -921,11 +2007,11 @@ }; } if (transitioningOut) { el._x_transition.leave.during = { transformOrigin: origin, - transitionDelay: delay, + transitionDelay: `${delay}s`, transitionProperty: property, transitionDuration: `${durationOut}s`, transitionTimingFunction: easing }; el._x_transition.leave.start = { @@ -1089,11 +2175,11 @@ const rawValue = modifiers[modifiers.indexOf(key) + 1]; if (!rawValue) return fallback; if (key === "scale") { if (isNaN(rawValue)) return fallback; } - if (key === "duration") { + if (key === "duration" || key === "delay") { let match = rawValue.match(/([0-9]+)ms/); if (match) return match[1]; } if (key === "origin") { if ([ @@ -1159,10 +2245,14 @@ $caa9439642c6336c$var$bindStyles(el, value); break; case "class": $caa9439642c6336c$var$bindClasses(el, value); break; + case "selected": + case "checked": + $caa9439642c6336c$var$bindAttributeAndProperty(el, name, value); + break; default: $caa9439642c6336c$var$bindAttribute(el, name, value); break; } } @@ -1190,10 +2280,14 @@ } function $caa9439642c6336c$var$bindStyles(el, value) { if (el._x_undoAddedStyles) el._x_undoAddedStyles(); el._x_undoAddedStyles = $caa9439642c6336c$var$setStyles(el, value); } +function $caa9439642c6336c$var$bindAttributeAndProperty(el, name, value) { + $caa9439642c6336c$var$bindAttribute(el, name, value); + $caa9439642c6336c$var$setPropertyIfChanged(el, name, value); +} function $caa9439642c6336c$var$bindAttribute(el, name, value) { if ([ null, void 0, false @@ -1204,10 +2298,13 @@ } } function $caa9439642c6336c$var$setIfChanged(el, attrName, value) { if (el.getAttribute(attrName) != value) el.setAttribute(attrName, value); } +function $caa9439642c6336c$var$setPropertyIfChanged(el, propName, value) { + if (el[propName] !== value) el[propName] = value; +} function $caa9439642c6336c$var$updateSelect(el, value) { const arrayWrappedValue = [].concat(value).map((value2)=>{ return value2 + ""; }); Array.from(el.options).forEach((option)=>{ @@ -1294,11 +2391,14 @@ } }; } // packages/alpinejs/src/plugin.js function $caa9439642c6336c$var$plugin(callback) { - callback($caa9439642c6336c$var$alpine_default); + let callbacks = Array.isArray(callback) ? callback : [ + callback + ]; + callbacks.forEach((i)=>i($caa9439642c6336c$var$alpine_default)); } // packages/alpinejs/src/store.js var $caa9439642c6336c$var$stores = {}; var $caa9439642c6336c$var$isReactive = false; function $caa9439642c6336c$var$store(name, value) { @@ -1383,11 +2483,11 @@ return $caa9439642c6336c$var$effect; }, get raw () { return $caa9439642c6336c$var$raw; }, - version: "3.12.0", + version: "3.12.1", flushAndStopDeferringMutations: $caa9439642c6336c$var$flushAndStopDeferringMutations, dontAutoEvaluateFunctions: $caa9439642c6336c$var$dontAutoEvaluateFunctions, disableEffectScheduling: $caa9439642c6336c$var$disableEffectScheduling, startObservingMutations: $caa9439642c6336c$var$startObservingMutations, stopObservingMutations: $caa9439642c6336c$var$stopObservingMutations, @@ -1432,581 +2532,10 @@ walk: $caa9439642c6336c$var$walk, data: $caa9439642c6336c$var$data, bind: $caa9439642c6336c$var$bind2 }; var $caa9439642c6336c$var$alpine_default = $caa9439642c6336c$var$Alpine; -// node_modules/@vue/shared/dist/shared.esm-bundler.js -function $caa9439642c6336c$var$makeMap(str, expectsLowerCase) { - const map = /* @__PURE__ */ Object.create(null); - const list = str.split(","); - for(let i = 0; i < list.length; i++)map[list[i]] = true; - return expectsLowerCase ? (val)=>!!map[val.toLowerCase()] : (val)=>!!map[val]; -} -var $caa9439642c6336c$var$specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; -var $caa9439642c6336c$var$isBooleanAttr2 = /* @__PURE__ */ $caa9439642c6336c$var$makeMap($caa9439642c6336c$var$specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); -var $caa9439642c6336c$var$EMPTY_OBJ = Object.freeze({}); -var $caa9439642c6336c$var$EMPTY_ARR = Object.freeze([]); -var $caa9439642c6336c$var$extend = Object.assign; -var $caa9439642c6336c$var$hasOwnProperty = Object.prototype.hasOwnProperty; -var $caa9439642c6336c$var$hasOwn = (val, key)=>$caa9439642c6336c$var$hasOwnProperty.call(val, key); -var $caa9439642c6336c$var$isArray = Array.isArray; -var $caa9439642c6336c$var$isMap = (val)=>$caa9439642c6336c$var$toTypeString(val) === "[object Map]"; -var $caa9439642c6336c$var$isString = (val)=>typeof val === "string"; -var $caa9439642c6336c$var$isSymbol = (val)=>typeof val === "symbol"; -var $caa9439642c6336c$var$isObject = (val)=>val !== null && typeof val === "object"; -var $caa9439642c6336c$var$objectToString = Object.prototype.toString; -var $caa9439642c6336c$var$toTypeString = (value)=>$caa9439642c6336c$var$objectToString.call(value); -var $caa9439642c6336c$var$toRawType = (value)=>{ - return $caa9439642c6336c$var$toTypeString(value).slice(8, -1); -}; -var $caa9439642c6336c$var$isIntegerKey = (key)=>$caa9439642c6336c$var$isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; -var $caa9439642c6336c$var$cacheStringFunction = (fn)=>{ - const cache = /* @__PURE__ */ Object.create(null); - return (str)=>{ - const hit = cache[str]; - return hit || (cache[str] = fn(str)); - }; -}; -var $caa9439642c6336c$var$camelizeRE = /-(\w)/g; -var $caa9439642c6336c$var$camelize = $caa9439642c6336c$var$cacheStringFunction((str)=>{ - return str.replace($caa9439642c6336c$var$camelizeRE, (_, c)=>c ? c.toUpperCase() : ""); -}); -var $caa9439642c6336c$var$hyphenateRE = /\B([A-Z])/g; -var $caa9439642c6336c$var$hyphenate = $caa9439642c6336c$var$cacheStringFunction((str)=>str.replace($caa9439642c6336c$var$hyphenateRE, "-$1").toLowerCase()); -var $caa9439642c6336c$var$capitalize = $caa9439642c6336c$var$cacheStringFunction((str)=>str.charAt(0).toUpperCase() + str.slice(1)); -var $caa9439642c6336c$var$toHandlerKey = $caa9439642c6336c$var$cacheStringFunction((str)=>str ? `on${$caa9439642c6336c$var$capitalize(str)}` : ``); -var $caa9439642c6336c$var$hasChanged = (value, oldValue)=>value !== oldValue && (value === value || oldValue === oldValue); -// node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js -var $caa9439642c6336c$var$targetMap = /* @__PURE__ */ new WeakMap(); -var $caa9439642c6336c$var$effectStack = []; -var $caa9439642c6336c$var$activeEffect; -var $caa9439642c6336c$var$ITERATE_KEY = Symbol("iterate"); -var $caa9439642c6336c$var$MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); -function $caa9439642c6336c$var$isEffect(fn) { - return fn && fn._isEffect === true; -} -function $caa9439642c6336c$var$effect2(fn, options = $caa9439642c6336c$var$EMPTY_OBJ) { - if ($caa9439642c6336c$var$isEffect(fn)) fn = fn.raw; - const effect3 = $caa9439642c6336c$var$createReactiveEffect(fn, options); - if (!options.lazy) effect3(); - return effect3; -} -function $caa9439642c6336c$var$stop(effect3) { - if (effect3.active) { - $caa9439642c6336c$var$cleanup(effect3); - if (effect3.options.onStop) effect3.options.onStop(); - effect3.active = false; - } -} -var $caa9439642c6336c$var$uid = 0; -function $caa9439642c6336c$var$createReactiveEffect(fn, options) { - const effect3 = function reactiveEffect() { - if (!effect3.active) return fn(); - if (!$caa9439642c6336c$var$effectStack.includes(effect3)) { - $caa9439642c6336c$var$cleanup(effect3); - try { - $caa9439642c6336c$var$enableTracking(); - $caa9439642c6336c$var$effectStack.push(effect3); - $caa9439642c6336c$var$activeEffect = effect3; - return fn(); - } finally{ - $caa9439642c6336c$var$effectStack.pop(); - $caa9439642c6336c$var$resetTracking(); - $caa9439642c6336c$var$activeEffect = $caa9439642c6336c$var$effectStack[$caa9439642c6336c$var$effectStack.length - 1]; - } - } - }; - effect3.id = $caa9439642c6336c$var$uid++; - effect3.allowRecurse = !!options.allowRecurse; - effect3._isEffect = true; - effect3.active = true; - effect3.raw = fn; - effect3.deps = []; - effect3.options = options; - return effect3; -} -function $caa9439642c6336c$var$cleanup(effect3) { - const { deps: deps } = effect3; - if (deps.length) { - for(let i = 0; i < deps.length; i++)deps[i].delete(effect3); - deps.length = 0; - } -} -var $caa9439642c6336c$var$shouldTrack = true; -var $caa9439642c6336c$var$trackStack = []; -function $caa9439642c6336c$var$pauseTracking() { - $caa9439642c6336c$var$trackStack.push($caa9439642c6336c$var$shouldTrack); - $caa9439642c6336c$var$shouldTrack = false; -} -function $caa9439642c6336c$var$enableTracking() { - $caa9439642c6336c$var$trackStack.push($caa9439642c6336c$var$shouldTrack); - $caa9439642c6336c$var$shouldTrack = true; -} -function $caa9439642c6336c$var$resetTracking() { - const last = $caa9439642c6336c$var$trackStack.pop(); - $caa9439642c6336c$var$shouldTrack = last === void 0 ? true : last; -} -function $caa9439642c6336c$var$track(target, type, key) { - if (!$caa9439642c6336c$var$shouldTrack || $caa9439642c6336c$var$activeEffect === void 0) return; - let depsMap = $caa9439642c6336c$var$targetMap.get(target); - if (!depsMap) $caa9439642c6336c$var$targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); - let dep = depsMap.get(key); - if (!dep) depsMap.set(key, dep = /* @__PURE__ */ new Set()); - if (!dep.has($caa9439642c6336c$var$activeEffect)) { - dep.add($caa9439642c6336c$var$activeEffect); - $caa9439642c6336c$var$activeEffect.deps.push(dep); - if ($caa9439642c6336c$var$activeEffect.options.onTrack) $caa9439642c6336c$var$activeEffect.options.onTrack({ - effect: $caa9439642c6336c$var$activeEffect, - target: target, - type: type, - key: key - }); - } -} -function $caa9439642c6336c$var$trigger(target, type, key, newValue, oldValue, oldTarget) { - const depsMap = $caa9439642c6336c$var$targetMap.get(target); - if (!depsMap) return; - const effects = /* @__PURE__ */ new Set(); - const add2 = (effectsToAdd)=>{ - if (effectsToAdd) effectsToAdd.forEach((effect3)=>{ - if (effect3 !== $caa9439642c6336c$var$activeEffect || effect3.allowRecurse) effects.add(effect3); - }); - }; - if (type === "clear") depsMap.forEach(add2); - else if (key === "length" && $caa9439642c6336c$var$isArray(target)) depsMap.forEach((dep, key2)=>{ - if (key2 === "length" || key2 >= newValue) add2(dep); - }); - else { - if (key !== void 0) add2(depsMap.get(key)); - switch(type){ - case "add": - if (!$caa9439642c6336c$var$isArray(target)) { - add2(depsMap.get($caa9439642c6336c$var$ITERATE_KEY)); - if ($caa9439642c6336c$var$isMap(target)) add2(depsMap.get($caa9439642c6336c$var$MAP_KEY_ITERATE_KEY)); - } else if ($caa9439642c6336c$var$isIntegerKey(key)) add2(depsMap.get("length")); - break; - case "delete": - if (!$caa9439642c6336c$var$isArray(target)) { - add2(depsMap.get($caa9439642c6336c$var$ITERATE_KEY)); - if ($caa9439642c6336c$var$isMap(target)) add2(depsMap.get($caa9439642c6336c$var$MAP_KEY_ITERATE_KEY)); - } - break; - case "set": - if ($caa9439642c6336c$var$isMap(target)) add2(depsMap.get($caa9439642c6336c$var$ITERATE_KEY)); - break; - } - } - const run = (effect3)=>{ - if (effect3.options.onTrigger) effect3.options.onTrigger({ - effect: effect3, - target: target, - key: key, - type: type, - newValue: newValue, - oldValue: oldValue, - oldTarget: oldTarget - }); - if (effect3.options.scheduler) effect3.options.scheduler(effect3); - else effect3(); - }; - effects.forEach(run); -} -var $caa9439642c6336c$var$isNonTrackableKeys = /* @__PURE__ */ $caa9439642c6336c$var$makeMap(`__proto__,__v_isRef,__isVue`); -var $caa9439642c6336c$var$builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key)=>Symbol[key]).filter($caa9439642c6336c$var$isSymbol)); -var $caa9439642c6336c$var$get2 = /* @__PURE__ */ $caa9439642c6336c$var$createGetter(); -var $caa9439642c6336c$var$shallowGet = /* @__PURE__ */ $caa9439642c6336c$var$createGetter(false, true); -var $caa9439642c6336c$var$readonlyGet = /* @__PURE__ */ $caa9439642c6336c$var$createGetter(true); -var $caa9439642c6336c$var$shallowReadonlyGet = /* @__PURE__ */ $caa9439642c6336c$var$createGetter(true, true); -var $caa9439642c6336c$var$arrayInstrumentations = {}; -[ - "includes", - "indexOf", - "lastIndexOf" -].forEach((key)=>{ - const method = Array.prototype[key]; - $caa9439642c6336c$var$arrayInstrumentations[key] = function(...args) { - const arr = $caa9439642c6336c$var$toRaw(this); - for(let i = 0, l = this.length; i < l; i++)$caa9439642c6336c$var$track(arr, "get", i + ""); - const res = method.apply(arr, args); - if (res === -1 || res === false) return method.apply(arr, args.map($caa9439642c6336c$var$toRaw)); - else return res; - }; -}); -[ - "push", - "pop", - "shift", - "unshift", - "splice" -].forEach((key)=>{ - const method = Array.prototype[key]; - $caa9439642c6336c$var$arrayInstrumentations[key] = function(...args) { - $caa9439642c6336c$var$pauseTracking(); - const res = method.apply(this, args); - $caa9439642c6336c$var$resetTracking(); - return res; - }; -}); -function $caa9439642c6336c$var$createGetter(isReadonly = false, shallow = false) { - return function get3(target, key, receiver) { - if (key === "__v_isReactive") return !isReadonly; - else if (key === "__v_isReadonly") return isReadonly; - else if (key === "__v_raw" && receiver === (isReadonly ? shallow ? $caa9439642c6336c$var$shallowReadonlyMap : $caa9439642c6336c$var$readonlyMap : shallow ? $caa9439642c6336c$var$shallowReactiveMap : $caa9439642c6336c$var$reactiveMap).get(target)) return target; - const targetIsArray = $caa9439642c6336c$var$isArray(target); - if (!isReadonly && targetIsArray && $caa9439642c6336c$var$hasOwn($caa9439642c6336c$var$arrayInstrumentations, key)) return Reflect.get($caa9439642c6336c$var$arrayInstrumentations, key, receiver); - const res = Reflect.get(target, key, receiver); - if ($caa9439642c6336c$var$isSymbol(key) ? $caa9439642c6336c$var$builtInSymbols.has(key) : $caa9439642c6336c$var$isNonTrackableKeys(key)) return res; - if (!isReadonly) $caa9439642c6336c$var$track(target, "get", key); - if (shallow) return res; - if ($caa9439642c6336c$var$isRef(res)) { - const shouldUnwrap = !targetIsArray || !$caa9439642c6336c$var$isIntegerKey(key); - return shouldUnwrap ? res.value : res; - } - if ($caa9439642c6336c$var$isObject(res)) return isReadonly ? $caa9439642c6336c$var$readonly(res) : $caa9439642c6336c$var$reactive2(res); - return res; - }; -} -var $caa9439642c6336c$var$set2 = /* @__PURE__ */ $caa9439642c6336c$var$createSetter(); -var $caa9439642c6336c$var$shallowSet = /* @__PURE__ */ $caa9439642c6336c$var$createSetter(true); -function $caa9439642c6336c$var$createSetter(shallow = false) { - return function set3(target, key, value, receiver) { - let oldValue = target[key]; - if (!shallow) { - value = $caa9439642c6336c$var$toRaw(value); - oldValue = $caa9439642c6336c$var$toRaw(oldValue); - if (!$caa9439642c6336c$var$isArray(target) && $caa9439642c6336c$var$isRef(oldValue) && !$caa9439642c6336c$var$isRef(value)) { - oldValue.value = value; - return true; - } - } - const hadKey = $caa9439642c6336c$var$isArray(target) && $caa9439642c6336c$var$isIntegerKey(key) ? Number(key) < target.length : $caa9439642c6336c$var$hasOwn(target, key); - const result = Reflect.set(target, key, value, receiver); - if (target === $caa9439642c6336c$var$toRaw(receiver)) { - if (!hadKey) $caa9439642c6336c$var$trigger(target, "add", key, value); - else if ($caa9439642c6336c$var$hasChanged(value, oldValue)) $caa9439642c6336c$var$trigger(target, "set", key, value, oldValue); - } - return result; - }; -} -function $caa9439642c6336c$var$deleteProperty(target, key) { - const hadKey = $caa9439642c6336c$var$hasOwn(target, key); - const oldValue = target[key]; - const result = Reflect.deleteProperty(target, key); - if (result && hadKey) $caa9439642c6336c$var$trigger(target, "delete", key, void 0, oldValue); - return result; -} -function $caa9439642c6336c$var$has(target, key) { - const result = Reflect.has(target, key); - if (!$caa9439642c6336c$var$isSymbol(key) || !$caa9439642c6336c$var$builtInSymbols.has(key)) $caa9439642c6336c$var$track(target, "has", key); - return result; -} -function $caa9439642c6336c$var$ownKeys(target) { - $caa9439642c6336c$var$track(target, "iterate", $caa9439642c6336c$var$isArray(target) ? "length" : $caa9439642c6336c$var$ITERATE_KEY); - return Reflect.ownKeys(target); -} -var $caa9439642c6336c$var$mutableHandlers = { - get: $caa9439642c6336c$var$get2, - set: $caa9439642c6336c$var$set2, - deleteProperty: $caa9439642c6336c$var$deleteProperty, - has: $caa9439642c6336c$var$has, - ownKeys: $caa9439642c6336c$var$ownKeys -}; -var $caa9439642c6336c$var$readonlyHandlers = { - get: $caa9439642c6336c$var$readonlyGet, - set (target, key) { - console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); - return true; - }, - deleteProperty (target, key) { - console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); - return true; - } -}; -var $caa9439642c6336c$var$shallowReactiveHandlers = $caa9439642c6336c$var$extend({}, $caa9439642c6336c$var$mutableHandlers, { - get: $caa9439642c6336c$var$shallowGet, - set: $caa9439642c6336c$var$shallowSet -}); -var $caa9439642c6336c$var$shallowReadonlyHandlers = $caa9439642c6336c$var$extend({}, $caa9439642c6336c$var$readonlyHandlers, { - get: $caa9439642c6336c$var$shallowReadonlyGet -}); -var $caa9439642c6336c$var$toReactive = (value)=>$caa9439642c6336c$var$isObject(value) ? $caa9439642c6336c$var$reactive2(value) : value; -var $caa9439642c6336c$var$toReadonly = (value)=>$caa9439642c6336c$var$isObject(value) ? $caa9439642c6336c$var$readonly(value) : value; -var $caa9439642c6336c$var$toShallow = (value)=>value; -var $caa9439642c6336c$var$getProto = (v)=>Reflect.getPrototypeOf(v); -function $caa9439642c6336c$var$get$1(target, key, isReadonly = false, isShallow = false) { - target = target["__v_raw"]; - const rawTarget = $caa9439642c6336c$var$toRaw(target); - const rawKey = $caa9439642c6336c$var$toRaw(key); - if (key !== rawKey) !isReadonly && $caa9439642c6336c$var$track(rawTarget, "get", key); - !isReadonly && $caa9439642c6336c$var$track(rawTarget, "get", rawKey); - const { has: has2 } = $caa9439642c6336c$var$getProto(rawTarget); - const wrap = isShallow ? $caa9439642c6336c$var$toShallow : isReadonly ? $caa9439642c6336c$var$toReadonly : $caa9439642c6336c$var$toReactive; - if (has2.call(rawTarget, key)) return wrap(target.get(key)); - else if (has2.call(rawTarget, rawKey)) return wrap(target.get(rawKey)); - else if (target !== rawTarget) target.get(key); -} -function $caa9439642c6336c$var$has$1(key, isReadonly = false) { - const target = this["__v_raw"]; - const rawTarget = $caa9439642c6336c$var$toRaw(target); - const rawKey = $caa9439642c6336c$var$toRaw(key); - if (key !== rawKey) !isReadonly && $caa9439642c6336c$var$track(rawTarget, "has", key); - !isReadonly && $caa9439642c6336c$var$track(rawTarget, "has", rawKey); - return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); -} -function $caa9439642c6336c$var$size(target, isReadonly = false) { - target = target["__v_raw"]; - !isReadonly && $caa9439642c6336c$var$track($caa9439642c6336c$var$toRaw(target), "iterate", $caa9439642c6336c$var$ITERATE_KEY); - return Reflect.get(target, "size", target); -} -function $caa9439642c6336c$var$add(value) { - value = $caa9439642c6336c$var$toRaw(value); - const target = $caa9439642c6336c$var$toRaw(this); - const proto = $caa9439642c6336c$var$getProto(target); - const hadKey = proto.has.call(target, value); - if (!hadKey) { - target.add(value); - $caa9439642c6336c$var$trigger(target, "add", value, value); - } - return this; -} -function $caa9439642c6336c$var$set$1(key, value) { - value = $caa9439642c6336c$var$toRaw(value); - const target = $caa9439642c6336c$var$toRaw(this); - const { has: has2 , get: get3 } = $caa9439642c6336c$var$getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = $caa9439642c6336c$var$toRaw(key); - hadKey = has2.call(target, key); - } else $caa9439642c6336c$var$checkIdentityKeys(target, has2, key); - const oldValue = get3.call(target, key); - target.set(key, value); - if (!hadKey) $caa9439642c6336c$var$trigger(target, "add", key, value); - else if ($caa9439642c6336c$var$hasChanged(value, oldValue)) $caa9439642c6336c$var$trigger(target, "set", key, value, oldValue); - return this; -} -function $caa9439642c6336c$var$deleteEntry(key) { - const target = $caa9439642c6336c$var$toRaw(this); - const { has: has2 , get: get3 } = $caa9439642c6336c$var$getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = $caa9439642c6336c$var$toRaw(key); - hadKey = has2.call(target, key); - } else $caa9439642c6336c$var$checkIdentityKeys(target, has2, key); - const oldValue = get3 ? get3.call(target, key) : void 0; - const result = target.delete(key); - if (hadKey) $caa9439642c6336c$var$trigger(target, "delete", key, void 0, oldValue); - return result; -} -function $caa9439642c6336c$var$clear() { - const target = $caa9439642c6336c$var$toRaw(this); - const hadItems = target.size !== 0; - const oldTarget = $caa9439642c6336c$var$isMap(target) ? new Map(target) : new Set(target); - const result = target.clear(); - if (hadItems) $caa9439642c6336c$var$trigger(target, "clear", void 0, void 0, oldTarget); - return result; -} -function $caa9439642c6336c$var$createForEach(isReadonly, isShallow) { - return function forEach(callback, thisArg) { - const observed = this; - const target = observed["__v_raw"]; - const rawTarget = $caa9439642c6336c$var$toRaw(target); - const wrap = isShallow ? $caa9439642c6336c$var$toShallow : isReadonly ? $caa9439642c6336c$var$toReadonly : $caa9439642c6336c$var$toReactive; - !isReadonly && $caa9439642c6336c$var$track(rawTarget, "iterate", $caa9439642c6336c$var$ITERATE_KEY); - return target.forEach((value, key)=>{ - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - }; -} -function $caa9439642c6336c$var$createIterableMethod(method, isReadonly, isShallow) { - return function(...args) { - const target = this["__v_raw"]; - const rawTarget = $caa9439642c6336c$var$toRaw(target); - const targetIsMap = $caa9439642c6336c$var$isMap(rawTarget); - const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; - const isKeyOnly = method === "keys" && targetIsMap; - const innerIterator = target[method](...args); - const wrap = isShallow ? $caa9439642c6336c$var$toShallow : isReadonly ? $caa9439642c6336c$var$toReadonly : $caa9439642c6336c$var$toReactive; - !isReadonly && $caa9439642c6336c$var$track(rawTarget, "iterate", isKeyOnly ? $caa9439642c6336c$var$MAP_KEY_ITERATE_KEY : $caa9439642c6336c$var$ITERATE_KEY); - return { - // iterator protocol - next () { - const { value: value , done: done } = innerIterator.next(); - return done ? { - value: value, - done: done - } : { - value: isPair ? [ - wrap(value[0]), - wrap(value[1]) - ] : wrap(value), - done: done - }; - }, - // iterable protocol - [Symbol.iterator] () { - return this; - } - }; - }; -} -function $caa9439642c6336c$var$createReadonlyMethod(type) { - return function(...args) { - { - const key = args[0] ? `on key "${args[0]}" ` : ``; - console.warn(`${$caa9439642c6336c$var$capitalize(type)} operation ${key}failed: target is readonly.`, $caa9439642c6336c$var$toRaw(this)); - } - return type === "delete" ? false : this; - }; -} -var $caa9439642c6336c$var$mutableInstrumentations = { - get (key) { - return $caa9439642c6336c$var$get$1(this, key); - }, - get size () { - return $caa9439642c6336c$var$size(this); - }, - has: $caa9439642c6336c$var$has$1, - add: $caa9439642c6336c$var$add, - set: $caa9439642c6336c$var$set$1, - delete: $caa9439642c6336c$var$deleteEntry, - clear: $caa9439642c6336c$var$clear, - forEach: $caa9439642c6336c$var$createForEach(false, false) -}; -var $caa9439642c6336c$var$shallowInstrumentations = { - get (key) { - return $caa9439642c6336c$var$get$1(this, key, false, true); - }, - get size () { - return $caa9439642c6336c$var$size(this); - }, - has: $caa9439642c6336c$var$has$1, - add: $caa9439642c6336c$var$add, - set: $caa9439642c6336c$var$set$1, - delete: $caa9439642c6336c$var$deleteEntry, - clear: $caa9439642c6336c$var$clear, - forEach: $caa9439642c6336c$var$createForEach(false, true) -}; -var $caa9439642c6336c$var$readonlyInstrumentations = { - get (key) { - return $caa9439642c6336c$var$get$1(this, key, true); - }, - get size () { - return $caa9439642c6336c$var$size(this, true); - }, - has (key) { - return $caa9439642c6336c$var$has$1.call(this, key, true); - }, - add: $caa9439642c6336c$var$createReadonlyMethod("add"), - set: $caa9439642c6336c$var$createReadonlyMethod("set"), - delete: $caa9439642c6336c$var$createReadonlyMethod("delete"), - clear: $caa9439642c6336c$var$createReadonlyMethod("clear"), - forEach: $caa9439642c6336c$var$createForEach(true, false) -}; -var $caa9439642c6336c$var$shallowReadonlyInstrumentations = { - get (key) { - return $caa9439642c6336c$var$get$1(this, key, true, true); - }, - get size () { - return $caa9439642c6336c$var$size(this, true); - }, - has (key) { - return $caa9439642c6336c$var$has$1.call(this, key, true); - }, - add: $caa9439642c6336c$var$createReadonlyMethod("add"), - set: $caa9439642c6336c$var$createReadonlyMethod("set"), - delete: $caa9439642c6336c$var$createReadonlyMethod("delete"), - clear: $caa9439642c6336c$var$createReadonlyMethod("clear"), - forEach: $caa9439642c6336c$var$createForEach(true, true) -}; -var $caa9439642c6336c$var$iteratorMethods = [ - "keys", - "values", - "entries", - Symbol.iterator -]; -$caa9439642c6336c$var$iteratorMethods.forEach((method)=>{ - $caa9439642c6336c$var$mutableInstrumentations[method] = $caa9439642c6336c$var$createIterableMethod(method, false, false); - $caa9439642c6336c$var$readonlyInstrumentations[method] = $caa9439642c6336c$var$createIterableMethod(method, true, false); - $caa9439642c6336c$var$shallowInstrumentations[method] = $caa9439642c6336c$var$createIterableMethod(method, false, true); - $caa9439642c6336c$var$shallowReadonlyInstrumentations[method] = $caa9439642c6336c$var$createIterableMethod(method, true, true); -}); -function $caa9439642c6336c$var$createInstrumentationGetter(isReadonly, shallow) { - const instrumentations = shallow ? isReadonly ? $caa9439642c6336c$var$shallowReadonlyInstrumentations : $caa9439642c6336c$var$shallowInstrumentations : isReadonly ? $caa9439642c6336c$var$readonlyInstrumentations : $caa9439642c6336c$var$mutableInstrumentations; - return (target, key, receiver)=>{ - if (key === "__v_isReactive") return !isReadonly; - else if (key === "__v_isReadonly") return isReadonly; - else if (key === "__v_raw") return target; - return Reflect.get($caa9439642c6336c$var$hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); - }; -} -var $caa9439642c6336c$var$mutableCollectionHandlers = { - get: $caa9439642c6336c$var$createInstrumentationGetter(false, false) -}; -var $caa9439642c6336c$var$shallowCollectionHandlers = { - get: $caa9439642c6336c$var$createInstrumentationGetter(false, true) -}; -var $caa9439642c6336c$var$readonlyCollectionHandlers = { - get: $caa9439642c6336c$var$createInstrumentationGetter(true, false) -}; -var $caa9439642c6336c$var$shallowReadonlyCollectionHandlers = { - get: $caa9439642c6336c$var$createInstrumentationGetter(true, true) -}; -function $caa9439642c6336c$var$checkIdentityKeys(target, has2, key) { - const rawKey = $caa9439642c6336c$var$toRaw(key); - if (rawKey !== key && has2.call(target, rawKey)) { - const type = $caa9439642c6336c$var$toRawType(target); - console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); - } -} -var $caa9439642c6336c$var$reactiveMap = /* @__PURE__ */ new WeakMap(); -var $caa9439642c6336c$var$shallowReactiveMap = /* @__PURE__ */ new WeakMap(); -var $caa9439642c6336c$var$readonlyMap = /* @__PURE__ */ new WeakMap(); -var $caa9439642c6336c$var$shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); -function $caa9439642c6336c$var$targetTypeMap(rawType) { - switch(rawType){ - case "Object": - case "Array": - return 1; - case "Map": - case "Set": - case "WeakMap": - case "WeakSet": - return 2; - default: - return 0; - } -} -function $caa9439642c6336c$var$getTargetType(value) { - return value["__v_skip"] || !Object.isExtensible(value) ? 0 : $caa9439642c6336c$var$targetTypeMap($caa9439642c6336c$var$toRawType(value)); -} -function $caa9439642c6336c$var$reactive2(target) { - if (target && target["__v_isReadonly"]) return target; - return $caa9439642c6336c$var$createReactiveObject(target, false, $caa9439642c6336c$var$mutableHandlers, $caa9439642c6336c$var$mutableCollectionHandlers, $caa9439642c6336c$var$reactiveMap); -} -function $caa9439642c6336c$var$readonly(target) { - return $caa9439642c6336c$var$createReactiveObject(target, true, $caa9439642c6336c$var$readonlyHandlers, $caa9439642c6336c$var$readonlyCollectionHandlers, $caa9439642c6336c$var$readonlyMap); -} -function $caa9439642c6336c$var$createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) { - if (!$caa9439642c6336c$var$isObject(target)) { - console.warn(`value cannot be made reactive: ${String(target)}`); - return target; - } - if (target["__v_raw"] && !(isReadonly && target["__v_isReactive"])) return target; - const existingProxy = proxyMap.get(target); - if (existingProxy) return existingProxy; - const targetType = $caa9439642c6336c$var$getTargetType(target); - if (targetType === 0) return target; - const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); - proxyMap.set(target, proxy); - return proxy; -} -function $caa9439642c6336c$var$toRaw(observed) { - return observed && $caa9439642c6336c$var$toRaw(observed["__v_raw"]) || observed; -} -function $caa9439642c6336c$var$isRef(r) { - return Boolean(r && r.__v_isRef === true); -} // packages/alpinejs/src/magics/$nextTick.js $caa9439642c6336c$var$magic("nextTick", ()=>$caa9439642c6336c$var$nextTick); // packages/alpinejs/src/magics/$dispatch.js $caa9439642c6336c$var$magic("dispatch", (el)=>$caa9439642c6336c$var$dispatch.bind($caa9439642c6336c$var$dispatch, el)); // packages/alpinejs/src/magics/$watch.js @@ -2106,11 +2635,11 @@ return ()=>{ $caa9439642c6336c$var$release(reference); }; } // packages/alpinejs/src/directives/x-modelable.js -$caa9439642c6336c$var$directive("modelable", (el, { expression: expression }, { effect: effect3 , evaluateLater: evaluateLater2 , cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("modelable", (el, { expression: expression }, { effect: effect3 , evaluateLater: evaluateLater2 , cleanup: cleanup })=>{ let func = evaluateLater2(expression); let innerGet = ()=>{ let result; func((i)=>result = i); return result; @@ -2141,16 +2670,16 @@ }, set (value) { innerSet(value); } }); - cleanup2(releaseEntanglement); + cleanup(releaseEntanglement); }); }); // packages/alpinejs/src/directives/x-teleport.js var $caa9439642c6336c$var$teleportContainerDuringClone = document.createElement("div"); -$caa9439642c6336c$var$directive("teleport", (el, { modifiers: modifiers , expression: expression }, { cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("teleport", (el, { modifiers: modifiers , expression: expression }, { cleanup: cleanup })=>{ if (el.tagName.toLowerCase() !== "template") $caa9439642c6336c$var$warn("x-teleport can only be used on a <template> tag", el); let target = $caa9439642c6336c$var$skipDuringClone(()=>{ return document.querySelector(expression); }, ()=>{ return $caa9439642c6336c$var$teleportContainerDuringClone; @@ -2171,17 +2700,17 @@ else if (modifiers.includes("append")) target.parentNode.insertBefore(clone2, target.nextSibling); else target.appendChild(clone2); $caa9439642c6336c$var$initTree(clone2); clone2._x_ignore = true; }); - cleanup2(()=>clone2.remove()); + cleanup(()=>clone2.remove()); }); // packages/alpinejs/src/directives/x-ignore.js var $caa9439642c6336c$var$handler = ()=>{}; -$caa9439642c6336c$var$handler.inline = (el, { modifiers: modifiers }, { cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$handler.inline = (el, { modifiers: modifiers }, { cleanup: cleanup })=>{ modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true; - cleanup2(()=>{ + cleanup(()=>{ modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore; }); }; $caa9439642c6336c$var$directive("ignore", $caa9439642c6336c$var$handler); // packages/alpinejs/src/directives/x-effect.js @@ -2196,10 +2725,20 @@ if (modifiers.includes("camel")) event = $caa9439642c6336c$var$camelCase2(event); if (modifiers.includes("passive")) options.passive = true; if (modifiers.includes("capture")) options.capture = true; if (modifiers.includes("window")) listenerTarget = window; if (modifiers.includes("document")) listenerTarget = document; + if (modifiers.includes("debounce")) { + let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait"; + let wait = $caa9439642c6336c$var$isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler3 = $caa9439642c6336c$var$debounce(handler3, wait); + } + if (modifiers.includes("throttle")) { + let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait"; + let wait = $caa9439642c6336c$var$isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler3 = $caa9439642c6336c$var$throttle(handler3, wait); + } if (modifiers.includes("prevent")) handler3 = wrapHandler(handler3, (next, e)=>{ e.preventDefault(); next(e); }); if (modifiers.includes("stop")) handler3 = wrapHandler(handler3, (next, e)=>{ @@ -2227,20 +2766,10 @@ if ($caa9439642c6336c$var$isKeyEvent(event)) { if ($caa9439642c6336c$var$isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) return; } next(e); }); - if (modifiers.includes("debounce")) { - let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait"; - let wait = $caa9439642c6336c$var$isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; - handler3 = $caa9439642c6336c$var$debounce(handler3, wait); - } - if (modifiers.includes("throttle")) { - let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait"; - let wait = $caa9439642c6336c$var$isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; - handler3 = $caa9439642c6336c$var$throttle(handler3, wait); - } listenerTarget.addEventListener(event, handler3, options); return ()=>{ listenerTarget.removeEventListener(event, handler3, options); }; } @@ -2331,11 +2860,11 @@ return Object.keys(modifierToKeyMap).map((modifier)=>{ if (modifierToKeyMap[modifier] === key) return modifier; }).filter((modifier)=>modifier); } // packages/alpinejs/src/directives/x-model.js -$caa9439642c6336c$var$directive("model", (el, { modifiers: modifiers , expression: expression }, { effect: effect3 , cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("model", (el, { modifiers: modifiers , expression: expression }, { effect: effect3 , cleanup: cleanup })=>{ let scopeTarget = el; if (modifiers.includes("parent")) scopeTarget = el.parentNode; let evaluateGet = $caa9439642c6336c$var$evaluateLater(scopeTarget, expression); let evaluateSet; if (typeof expression === "string") evaluateSet = $caa9439642c6336c$var$evaluateLater(scopeTarget, `${expression} = __placeholder`); @@ -2354,29 +2883,32 @@ scope: { "__placeholder": value } }); }; - if (modifiers.includes("fill") && el.hasAttribute("value") && (getValue() === null || getValue() === "")) setValue(el.value); if (typeof expression === "string" && el.type === "radio") $caa9439642c6336c$var$mutateDom(()=>{ if (!el.hasAttribute("name")) el.setAttribute("name", expression); }); var event = el.tagName.toLowerCase() === "select" || [ "checkbox", "radio" ].includes(el.type) || modifiers.includes("lazy") ? "change" : "input"; let removeListener = $caa9439642c6336c$var$isCloning ? ()=>{} : $caa9439642c6336c$var$on(el, event, modifiers, (e)=>{ setValue($caa9439642c6336c$var$getInputValue(el, modifiers, e, getValue())); }); + if (modifiers.includes("fill") && [ + null, + "" + ].includes(getValue())) el.dispatchEvent(new Event(event, {})); if (!el._x_removeModelListeners) el._x_removeModelListeners = {}; el._x_removeModelListeners["default"] = removeListener; - cleanup2(()=>el._x_removeModelListeners["default"]()); + cleanup(()=>el._x_removeModelListeners["default"]()); if (el.form) { let removeResetListener = $caa9439642c6336c$var$on(el.form, "reset", [], (e)=>{ $caa9439642c6336c$var$nextTick(()=>el._x_model && el._x_model.set(el.value)); }); - cleanup2(()=>removeResetListener()); + cleanup(()=>removeResetListener()); } el._x_model = { get () { return getValue(); }, @@ -2397,11 +2929,11 @@ el._x_forceModelUpdate(value); }); }); function $caa9439642c6336c$var$getInputValue(el, modifiers, event, currentValue) { return $caa9439642c6336c$var$mutateDom(()=>{ - if (event instanceof CustomEvent && event.detail !== void 0) return typeof event.detail != "undefined" ? event.detail : event.target.value; + if (event instanceof CustomEvent && event.detail !== void 0) return event.detail ?? event.target.value; else if (el.type === "checkbox") { if (Array.isArray(currentValue)) { let newValue = modifiers.includes("number") ? $caa9439642c6336c$var$safeParseNumber(event.target.value) : event.target.value; return event.target.checked ? currentValue.concat([ newValue @@ -2489,11 +3021,11 @@ function $caa9439642c6336c$var$storeKeyForXFor(el, expression) { el._x_keyExpression = expression; } // packages/alpinejs/src/directives/x-data.js $caa9439642c6336c$var$addRootSelector(()=>`[${$caa9439642c6336c$var$prefix("data")}]`); -$caa9439642c6336c$var$directive("data", $caa9439642c6336c$var$skipDuringClone((el, { expression: expression }, { cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("data", $caa9439642c6336c$var$skipDuringClone((el, { expression: expression }, { cleanup: cleanup })=>{ expression = expression === "" ? "{}" : expression; let magicContext = {}; $caa9439642c6336c$var$injectMagics(magicContext, el); let dataProviderContext = {}; $caa9439642c6336c$var$injectDataProviders(dataProviderContext, magicContext); @@ -2504,11 +3036,11 @@ $caa9439642c6336c$var$injectMagics(data2, el); let reactiveData = $caa9439642c6336c$var$reactive(data2); $caa9439642c6336c$var$initInterceptors(reactiveData); let undo = $caa9439642c6336c$var$addScopeToNode(el, reactiveData); reactiveData["init"] && $caa9439642c6336c$var$evaluate(el, reactiveData["init"]); - cleanup2(()=>{ + cleanup(()=>{ reactiveData["destroy"] && $caa9439642c6336c$var$evaluate(el, reactiveData["destroy"]); undo(); }); })); // packages/alpinejs/src/directives/x-show.js @@ -2547,35 +3079,35 @@ oldValue = value; firstTime = false; })); }); // packages/alpinejs/src/directives/x-for.js -$caa9439642c6336c$var$directive("for", (el, { expression: expression }, { effect: effect3 , cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("for", (el, { expression: expression }, { effect: effect3 , cleanup: cleanup })=>{ let iteratorNames = $caa9439642c6336c$var$parseForExpression(expression); let evaluateItems = $caa9439642c6336c$var$evaluateLater(el, iteratorNames.items); let evaluateKey = $caa9439642c6336c$var$evaluateLater(el, // the x-bind:key expression is stored for our use instead of evaluated. el._x_keyExpression || "index"); el._x_prevKeys = []; el._x_lookup = {}; effect3(()=>$caa9439642c6336c$var$loop(el, iteratorNames, evaluateItems, evaluateKey)); - cleanup2(()=>{ + cleanup(()=>{ Object.values(el._x_lookup).forEach((el2)=>el2.remove()); delete el._x_prevKeys; delete el._x_lookup; }); }); function $caa9439642c6336c$var$loop(el, iteratorNames, evaluateItems, evaluateKey) { - let isObject2 = (i)=>typeof i === "object" && !Array.isArray(i); + let isObject = (i)=>typeof i === "object" && !Array.isArray(i); let templateEl = el; evaluateItems((items)=>{ if ($caa9439642c6336c$var$isNumeric3(items) && items >= 0) items = Array.from(Array(items).keys(), (i)=>i + 1); if (items === void 0) items = []; let lookup = el._x_lookup; let prevKeys = el._x_prevKeys; let scopes = []; let keys = []; - if (isObject2(items)) items = Object.entries(items).map(([key, value])=>{ + if (isObject(items)) items = Object.entries(items).map(([key, value])=>{ let scope2 = $caa9439642c6336c$var$getIterationScopeVariables(iteratorNames, value, key, items); evaluateKey((value2)=>keys.push(value2), { scope: { index: key, ...scope2 @@ -2635,35 +3167,42 @@ let [keyInSpot, keyForSpot] = moves[i]; let elInSpot = lookup[keyInSpot]; let elForSpot = lookup[keyForSpot]; let marker = document.createElement("div"); $caa9439642c6336c$var$mutateDom(()=>{ + if (!elForSpot) $caa9439642c6336c$var$warn(`x-for ":key" is undefined or invalid`, templateEl); elForSpot.after(marker); elInSpot.after(elForSpot); elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl); marker.before(elInSpot); elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl); marker.remove(); }); - $caa9439642c6336c$var$refreshScope(elForSpot, scopes[keys.indexOf(keyForSpot)]); + elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]); } for(let i = 0; i < adds.length; i++){ let [lastKey2, index] = adds[i]; let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2]; if (lastEl._x_currentIfEl) lastEl = lastEl._x_currentIfEl; let scope2 = scopes[index]; let key = keys[index]; let clone2 = document.importNode(templateEl.content, true).firstElementChild; - $caa9439642c6336c$var$addScopeToNode(clone2, $caa9439642c6336c$var$reactive(scope2), templateEl); + let reactiveScope = $caa9439642c6336c$var$reactive(scope2); + $caa9439642c6336c$var$addScopeToNode(clone2, reactiveScope, templateEl); + clone2._x_refreshXForScope = (newScope)=>{ + Object.entries(newScope).forEach(([key2, value])=>{ + reactiveScope[key2] = value; + }); + }; $caa9439642c6336c$var$mutateDom(()=>{ lastEl.after(clone2); $caa9439642c6336c$var$initTree(clone2); }); if (typeof key === "object") $caa9439642c6336c$var$warn("x-for key cannot be an object, it must be a string or an integer", templateEl); lookup[key] = clone2; } - for(let i = 0; i < sames.length; i++)$caa9439642c6336c$var$refreshScope(lookup[sames[i]], scopes[keys.indexOf(sames[i])]); + for(let i = 0; i < sames.length; i++)lookup[sames[i]]._x_refreshXForScope(scopes[keys.indexOf(sames[i])]); templateEl._x_prevKeys = keys; }); } function $caa9439642c6336c$var$parseForExpression(expression) { let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; @@ -2702,19 +3241,19 @@ function $caa9439642c6336c$var$isNumeric3(subject) { return !Array.isArray(subject) && !isNaN(subject); } // packages/alpinejs/src/directives/x-ref.js function $caa9439642c6336c$var$handler2() {} -$caa9439642c6336c$var$handler2.inline = (el, { expression: expression }, { cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$handler2.inline = (el, { expression: expression }, { cleanup: cleanup })=>{ let root = $caa9439642c6336c$var$closestRoot(el); if (!root._x_refs) root._x_refs = {}; root._x_refs[expression] = el; - cleanup2(()=>delete root._x_refs[expression]); + cleanup(()=>delete root._x_refs[expression]); }; $caa9439642c6336c$var$directive("ref", $caa9439642c6336c$var$handler2); // packages/alpinejs/src/directives/x-if.js -$caa9439642c6336c$var$directive("if", (el, { expression: expression }, { effect: effect3 , cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("if", (el, { expression: expression }, { effect: effect3 , cleanup: cleanup })=>{ let evaluate2 = $caa9439642c6336c$var$evaluateLater(el, expression); let show = ()=>{ if (el._x_currentIfEl) return el._x_currentIfEl; let clone2 = el.content.cloneNode(true).firstElementChild; $caa9439642c6336c$var$addScopeToNode(clone2, {}, el); @@ -2738,20 +3277,20 @@ delete el._x_undoIf; }; effect3(()=>evaluate2((value)=>{ value ? show() : hide(); })); - cleanup2(()=>el._x_undoIf && el._x_undoIf()); + cleanup(()=>el._x_undoIf && el._x_undoIf()); }); // packages/alpinejs/src/directives/x-id.js $caa9439642c6336c$var$directive("id", (el, { expression: expression }, { evaluate: evaluate2 })=>{ let names = evaluate2(expression); names.forEach((name)=>$caa9439642c6336c$var$setIdRoot(el, name)); }); // packages/alpinejs/src/directives/x-on.js $caa9439642c6336c$var$mapAttributes($caa9439642c6336c$var$startingWith("@", $caa9439642c6336c$var$into($caa9439642c6336c$var$prefix("on:")))); -$caa9439642c6336c$var$directive("on", $caa9439642c6336c$var$skipDuringClone((el, { value: value , modifiers: modifiers , expression: expression }, { cleanup: cleanup2 })=>{ +$caa9439642c6336c$var$directive("on", $caa9439642c6336c$var$skipDuringClone((el, { value: value , modifiers: modifiers , expression: expression }, { cleanup: cleanup })=>{ let evaluate2 = expression ? $caa9439642c6336c$var$evaluateLater(el, expression) : ()=>{}; if (el.tagName.toLowerCase() === "template") { if (!el._x_forwardEvents) el._x_forwardEvents = []; if (!el._x_forwardEvents.includes(value)) el._x_forwardEvents.push(value); } @@ -2763,11 +3302,11 @@ params: [ e ] }); }); - cleanup2(()=>removeListener()); + cleanup(()=>removeListener()); })); // packages/alpinejs/src/directives/index.js $caa9439642c6336c$var$warnMissingPluginDirective("Collapse", "collapse", "collapse"); $caa9439642c6336c$var$warnMissingPluginDirective("Intersect", "intersect", "intersect"); $caa9439642c6336c$var$warnMissingPluginDirective("Focus", "trap", "focus"); @@ -2776,14 +3315,14 @@ $caa9439642c6336c$var$directive(directiveName2, (el)=>$caa9439642c6336c$var$warn(`You can't use [x-${directiveName2}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); } // packages/alpinejs/src/index.js $caa9439642c6336c$var$alpine_default.setEvaluator($caa9439642c6336c$var$normalEvaluator); $caa9439642c6336c$var$alpine_default.setReactivityEngine({ - reactive: $caa9439642c6336c$var$reactive2, - effect: $caa9439642c6336c$var$effect2, - release: $caa9439642c6336c$var$stop, - raw: $caa9439642c6336c$var$toRaw + reactive: (0, $c045fc085b5f16e6$export$90a44edba14e47be), + effect: (0, $c045fc085b5f16e6$export$dc573d8a6576cdb3), + release: (0, $c045fc085b5f16e6$export$fa6813432f753b0d), + raw: (0, $c045fc085b5f16e6$export$ab18938b9fc5f28e) }); var $caa9439642c6336c$var$src_default = $caa9439642c6336c$var$alpine_default; // packages/alpinejs/builds/module.js var $caa9439642c6336c$export$2e2bcd8739ae039 = $caa9439642c6336c$var$src_default; @@ -2845,10 +3384,11 @@ }; // packages/morph/src/morph.js var $512e3a9270ec7803$var$resolveStep = ()=>{}; var $512e3a9270ec7803$var$logger = ()=>{}; function $512e3a9270ec7803$export$2e5e8c41f5d4e7c7(from, toHtml, options) { + $512e3a9270ec7803$var$monkeyPatchDomSetAttributeToAllowAtSymbols(); let fromEl; let toEl; let key, lookahead, updating, updated, removing, removed, adding, added; function assignOptions(options2 = {}) { let defaultGetKey = (el)=>el.getAttribute("key"); @@ -3075,10 +3615,24 @@ } function $512e3a9270ec7803$var$initializeAlpineOnTo(from, to, childrenOnly) { if (from.nodeType !== 1) return; if (from._x_dataStack) window.Alpine.clone(from, to); } +var $512e3a9270ec7803$var$patched = false; +function $512e3a9270ec7803$var$monkeyPatchDomSetAttributeToAllowAtSymbols() { + if ($512e3a9270ec7803$var$patched) return; + $512e3a9270ec7803$var$patched = true; + let original = Element.prototype.setAttribute; + let hostDiv = document.createElement("div"); + Element.prototype.setAttribute = function newSetAttribute(name, value) { + if (!name.includes("@")) return original.call(this, name, value); + hostDiv.innerHTML = `<span ${name}="${value}"></span>`; + let attr = hostDiv.firstElementChild.getAttributeNode(name); + hostDiv.firstElementChild.removeAttributeNode(attr); + this.setAttributeNode(attr); + }; +} // packages/morph/src/index.js function $512e3a9270ec7803$var$src_default(Alpine) { Alpine.morph = $512e3a9270ec7803$export$2e5e8c41f5d4e7c7; } // packages/morph/builds/module.js @@ -7813,11 +8367,11 @@ return $1.toUpperCase().replace("-", "").replace("_", ""); }); } -var $db546f7a367d8ec7$exports = {}; +var $46a9823468a0406a$exports = {}; var $cbd28b10fa9798c7$exports = {}; $parcel$defineInteropFlag($cbd28b10fa9798c7$exports); $parcel$export($cbd28b10fa9798c7$exports, "default", () => $cbd28b10fa9798c7$export$2e2bcd8739ae039); @@ -11344,20 +11898,10 @@ _spinning: false }; } -var $99486586f6691564$exports = {}; - -$parcel$defineInteropFlag($99486586f6691564$exports); - -$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039); -function $99486586f6691564$export$2e2bcd8739ae039() { - return {}; -} - - var $47a1c62621be0c54$exports = {}; $parcel$defineInteropFlag($47a1c62621be0c54$exports); $parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039); @@ -11443,10 +11987,20 @@ } }; } +var $99486586f6691564$exports = {}; + +$parcel$defineInteropFlag($99486586f6691564$exports); + +$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039); +function $99486586f6691564$export$2e2bcd8739ae039() { + return {}; +} + + var $216ef7001f59f21d$exports = {}; $parcel$defineInteropFlag($216ef7001f59f21d$exports); $parcel$export($216ef7001f59f21d$exports, "default", () => $216ef7001f59f21d$export$2e2bcd8739ae039); @@ -11549,103 +12103,10 @@ } }; } -var $0db07828cadc68e0$exports = {}; - -$parcel$defineInteropFlag($0db07828cadc68e0$exports); - -$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039); - - - - -function $0db07828cadc68e0$export$2e2bcd8739ae039(store) { - const initial = store ? store.activeTab : null; - let dropdown = null; - return { - visibleTabsCount: 0, - triggerLeft: 0, - get store () { - return store || this; - }, - get tabs () { - return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : []; - }, - get dropdownTabs () { - return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []); - }, - get tabWidths () { - return this.tabs.map((tab)=>(0, $490552754c23ef6f$export$bdf7e699b242f476)(tab, { - includeMargins: true - }).width); - }, - init () { - this.$nextTick(()=>{ - if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length; - dropdown = (0, $789b7d27a7c715a6$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, { - content: this.$refs.tabsDropdown, - theme: "menu", - interactive: true, - trigger: "click", - placement: "bottom", - appendTo: this.$root - }); - const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0]; - this.selectTab(initialTab || this.tabs[0], true); - this.parentObserver = (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this))); - this.$watch("visibleTabsCount", (value)=>{ - this.debug(`'#${this.$root.id}' visible tabs count:`, value); - }); - }); - }, - handleResize ({ width: width }) { - if (width === this._lastMeasuredWidth) return; - if (width === this.$root.offsetWidth) { - this.visibleTabsCount = this.tabs.length; - return; - } - let sumTabWidths = 60; - let triggerLeft = 20; - let visibleTabsCount = 0; - this.tabWidths.forEach((tabWidth)=>{ - sumTabWidths += tabWidth; - if (sumTabWidths < width) { - triggerLeft += tabWidth; - visibleTabsCount++; - } - }); - this.visibleTabsCount = visibleTabsCount; - this.triggerLeft = triggerLeft; - this._lastMeasuredWidth = width; - }, - selectTab (el, initial = false) { - this.store.activeTab = this._getRef(el); - dropdown.hide(); - if (!initial) this.$dispatch("tabs:change", { - tabs: this - }); - }, - isSelected (el) { - return this.store.activeTab === this._getRef(el); - }, - isDisabled (el) { - return el.getAttribute("data-disabled") == "true"; - }, - hasHiddenTabs () { - return this.visibleTabsCount < this.tabs.length; - }, - // protected - _lastMeasuredWidth: 0, - _getRef (el) { - return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null; - } - }; -} - - var $506dabb2bf255b38$exports = {}; $parcel$defineInteropFlag($506dabb2bf255b38$exports); $parcel$export($506dabb2bf255b38$exports, "default", () => $506dabb2bf255b38$export$2e2bcd8739ae039); @@ -12192,10 +12653,103 @@ }); return splits; } +var $0db07828cadc68e0$exports = {}; + +$parcel$defineInteropFlag($0db07828cadc68e0$exports); + +$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039); + + + + +function $0db07828cadc68e0$export$2e2bcd8739ae039(store) { + const initial = store ? store.activeTab : null; + let dropdown = null; + return { + visibleTabsCount: 0, + triggerLeft: 0, + get store () { + return store || this; + }, + get tabs () { + return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : []; + }, + get dropdownTabs () { + return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []); + }, + get tabWidths () { + return this.tabs.map((tab)=>(0, $490552754c23ef6f$export$bdf7e699b242f476)(tab, { + includeMargins: true + }).width); + }, + init () { + this.$nextTick(()=>{ + if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length; + dropdown = (0, $789b7d27a7c715a6$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, { + content: this.$refs.tabsDropdown, + theme: "menu", + interactive: true, + trigger: "click", + placement: "bottom", + appendTo: this.$root + }); + const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0]; + this.selectTab(initialTab || this.tabs[0], true); + this.parentObserver = (0, $7ecd1fc3a6b35e5c$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this))); + this.$watch("visibleTabsCount", (value)=>{ + this.debug(`'#${this.$root.id}' visible tabs count:`, value); + }); + }); + }, + handleResize ({ width: width }) { + if (width === this._lastMeasuredWidth) return; + if (width === this.$root.offsetWidth) { + this.visibleTabsCount = this.tabs.length; + return; + } + let sumTabWidths = 60; + let triggerLeft = 20; + let visibleTabsCount = 0; + this.tabWidths.forEach((tabWidth)=>{ + sumTabWidths += tabWidth; + if (sumTabWidths < width) { + triggerLeft += tabWidth; + visibleTabsCount++; + } + }); + this.visibleTabsCount = visibleTabsCount; + this.triggerLeft = triggerLeft; + this._lastMeasuredWidth = width; + }, + selectTab (el, initial = false) { + this.store.activeTab = this._getRef(el); + dropdown.hide(); + if (!initial) this.$dispatch("tabs:change", { + tabs: this + }); + }, + isSelected (el) { + return this.store.activeTab === this._getRef(el); + }, + isDisabled (el) { + return el.getAttribute("data-disabled") == "true"; + }, + hasHiddenTabs () { + return this.visibleTabsCount < this.tabs.length; + }, + // protected + _lastMeasuredWidth: 0, + _getRef (el) { + return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null; + } + }; +} + + var $6d64716f0b34fdf4$exports = {}; $parcel$defineInteropFlag($6d64716f0b34fdf4$exports); $parcel$export($6d64716f0b34fdf4$exports, "default", () => $6d64716f0b34fdf4$export$2e2bcd8739ae039); @@ -12319,21 +12873,21 @@ } }; } -$db546f7a367d8ec7$exports = { +$46a9823468a0406a$exports = { "button": $cbd28b10fa9798c7$exports, - "code": $99486586f6691564$exports, "copy_button": $47a1c62621be0c54$exports, "dimensions_display": $e398acaded942bbe$exports, + "code": $99486586f6691564$exports, "embed_code_dropdown": $216ef7001f59f21d$exports, "filter": $e9904a14dabf652d$exports, "nav": $d92d9d5253f84566$exports, "tab_panels": $a87dacf5139b5e2f$exports, - "tabs": $0db07828cadc68e0$exports, "split_layout": $506dabb2bf255b38$exports, + "tabs": $0db07828cadc68e0$exports, "viewport": $6d64716f0b34fdf4$exports }; var $234342a379d83f20$exports = {}; @@ -13422,11 +13976,11 @@ } return true; }, bindings: { toggle: { - ["@click.stop"]: "toggle", + ["x-on:click.stop"]: "toggle", ["x-ref"]: "toggle" }, link: { [":class"]: "{'!bg-lookbook-nav-item-active':active}", ["x-ref"]: "link" @@ -13514,10 +14068,10 @@ prefix: $22969b543678f572$var$prefix })); // Components (0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $5792afa4170ed552$export$2e2bcd8739ae039)); [ - $db546f7a367d8ec7$exports, + $46a9823468a0406a$exports, $234342a379d83f20$exports, $338da9a25bc5c332$exports ].forEach((scripts)=>{ const components = (0, $12b7aa006b8a97e1$export$4e811121b221213b)(scripts); Object.keys(components).forEach((name)=>{