fjffk简å�•的咖啡店科开å�‘2方法2 环æ»�皆山也。其西å�—诸峰,林壑尤美,望之蔚然而深秀者,ç�…ç�Šä¹Ÿã€‚山行六七里,æ¸�闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  Â¥2" ÿÄ     ÿÄ J    ! 1AQ"aqÂ�2‘#BR‚¡Ã�Ñ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3Â�±ð#b¡ÿÚ   ? ¼QxJQaÃ�uò¸Zö Úü8,Ã�Úú "SSn<rçù–´âE—^ªBÖ9À\†¸Â�ÔÂ�Ã�T­ÃÛ5 ëd´³Ã�#Ã�;Þ38ϔÂ� ¶H£M:wÃŽ3…³…âpÔF&‚FK¸9„â4àGEõªfÂ�ÿ ‘ñ(ßw­pŽF|È¥ù®häðÃ�Ѷ¹‘[Ã’inÙW¶ùñYËœQ{›K"išÒ[Ú8žë\F¹@-?v"ÔUâ€�,ìöžkÿ {I‡£šÃ�?e rÂ�íV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdflivewire/README.md000064400000003064152665372570007676 0ustar00

Livewire Logo

Total Downloads Latest Stable Version License

## Introduction Livewire is a full-stack framework for Laravel that allows you to build dynamic UI components without leaving PHP. ## Official Documentation You can read the official documentation on the [Livewire website](https://livewire.laravel.com/docs). ## Contributing Thank you for considering contributing to Livewire! You can read the contribution guide [here](.github/CONTRIBUTING.md). ## Code of Conduct In order to ensure that the Laravel community is welcoming to all, please review and abide by Laravel's [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). ## Security Vulnerabilities Please review [our security policy](https://github.com/livewire/livewire/security/policy) on how to report security vulnerabilities. ## License Livewire is open-sourced software licensed under the [MIT license](LICENSE.md). livewire/dist/livewire.esm.js.map000064400002470677152665372570013131 0ustar00{ "version": 3, "sources": ["../../alpine/packages/alpinejs/dist/module.cjs.js", "../../alpine/packages/collapse/dist/module.cjs.js", "../../alpine/packages/focus/dist/module.cjs.js", "../../alpine/packages/persist/dist/module.cjs.js", "../../alpine/packages/intersect/dist/module.cjs.js", "../node_modules/@alpinejs/resize/dist/module.cjs.js", "../../alpine/packages/anchor/dist/module.cjs.js", "../node_modules/nprogress/nprogress.js", "../../alpine/packages/morph/dist/module.cjs.js", "../../alpine/packages/mask/dist/module.cjs.js", "../js/utils.js", "../js/features/supportFileUploads.js", "../js/features/supportEntangle.js", "../js/hooks.js", "../js/request/modal.js", "../js/request/pool.js", "../js/request/commit.js", "../js/request/bus.js", "../js/request/index.js", "../js/$wire.js", "../js/component.js", "../js/store.js", "../js/events.js", "../js/directives.js", "../js/lifecycle.js", "../js/plugins/navigate/history.js", "../js/plugins/navigate/links.js", "../js/plugins/navigate/fetch.js", "../js/plugins/navigate/prefetch.js", "../js/plugins/navigate/teleport.js", "../js/plugins/navigate/scroll.js", "../js/plugins/navigate/persist.js", "../js/plugins/navigate/bar.js", "../js/plugins/navigate/popover.js", "../js/plugins/navigate/page.js", "../js/plugins/navigate/index.js", "../js/plugins/history/index.js", "../js/index.js", "../js/features/supportListeners.js", "../js/features/supportScriptsAndAssets.js", "../js/features/supportJsEvaluation.js", "../js/morph.js", "../js/features/supportMorphDom.js", "../js/features/supportDispatches.js", "../js/features/supportDisablingFormsDuringRequest.js", "../js/features/supportPropsAndModelables.js", "../js/features/supportFileDownloads.js", "../js/features/supportLazyLoading.js", "../js/features/supportQueryString.js", "../js/features/supportLaravelEcho.js", "../js/features/supportIsolating.js", "../js/features/supportNavigate.js", "../js/features/supportRedirects.js", "../js/directives/wire-transition.js", "../js/debounce.js", "../js/directives/wire-wildcard.js", "../js/directives/wire-navigate.js", "../js/directives/wire-confirm.js", "../js/directives/wire-current.js", "../js/directives/shared.js", "../js/directives/wire-offline.js", "../js/directives/wire-loading.js", "../js/directives/wire-stream.js", "../js/directives/wire-replace.js", "../js/directives/wire-ignore.js", "../js/directives/wire-cloak.js", "../js/directives/wire-dirty.js", "../js/directives/wire-model.js", "../js/directives/wire-init.js", "../js/directives/wire-poll.js", "../js/directives/wire-show.js", "../js/directives/wire-text.js"], "sourcesContent": ["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __commonJS = (cb, mod) => function __require() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// node_modules/@vue/shared/dist/shared.cjs.js\nvar require_shared_cjs = __commonJS({\n \"node_modules/@vue/shared/dist/shared.cjs.js\"(exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n function makeMap(str, expectsLowerCase) {\n const map = /* @__PURE__ */ Object.create(null);\n const list = str.split(\",\");\n for (let i = 0; i < list.length; i++) {\n map[list[i]] = true;\n }\n return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];\n }\n var PatchFlagNames = {\n [\n 1\n /* TEXT */\n ]: `TEXT`,\n [\n 2\n /* CLASS */\n ]: `CLASS`,\n [\n 4\n /* STYLE */\n ]: `STYLE`,\n [\n 8\n /* PROPS */\n ]: `PROPS`,\n [\n 16\n /* FULL_PROPS */\n ]: `FULL_PROPS`,\n [\n 32\n /* HYDRATE_EVENTS */\n ]: `HYDRATE_EVENTS`,\n [\n 64\n /* STABLE_FRAGMENT */\n ]: `STABLE_FRAGMENT`,\n [\n 128\n /* KEYED_FRAGMENT */\n ]: `KEYED_FRAGMENT`,\n [\n 256\n /* UNKEYED_FRAGMENT */\n ]: `UNKEYED_FRAGMENT`,\n [\n 512\n /* NEED_PATCH */\n ]: `NEED_PATCH`,\n [\n 1024\n /* DYNAMIC_SLOTS */\n ]: `DYNAMIC_SLOTS`,\n [\n 2048\n /* DEV_ROOT_FRAGMENT */\n ]: `DEV_ROOT_FRAGMENT`,\n [\n -1\n /* HOISTED */\n ]: `HOISTED`,\n [\n -2\n /* BAIL */\n ]: `BAIL`\n };\n var slotFlagsText = {\n [\n 1\n /* STABLE */\n ]: \"STABLE\",\n [\n 2\n /* DYNAMIC */\n ]: \"DYNAMIC\",\n [\n 3\n /* FORWARDED */\n ]: \"FORWARDED\"\n };\n 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\";\n var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED);\n var range = 2;\n function generateCodeFrame(source, start2 = 0, end = source.length) {\n let lines = source.split(/(\\r?\\n)/);\n const newlineSequences = lines.filter((_, idx) => idx % 2 === 1);\n lines = lines.filter((_, idx) => idx % 2 === 0);\n let count = 0;\n const res = [];\n for (let i = 0; i < lines.length; i++) {\n count += lines[i].length + (newlineSequences[i] && newlineSequences[i].length || 0);\n if (count >= start2) {\n for (let j = i - range; j <= i + range || end > count; j++) {\n if (j < 0 || j >= lines.length)\n continue;\n const line = j + 1;\n res.push(`${line}${\" \".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j]}`);\n const lineLength = lines[j].length;\n const newLineSeqLength = newlineSequences[j] && newlineSequences[j].length || 0;\n if (j === i) {\n const pad = start2 - (count - (lineLength + newLineSeqLength));\n const length = Math.max(1, end > count ? lineLength - pad : end - start2);\n res.push(` | ` + \" \".repeat(pad) + \"^\".repeat(length));\n } else if (j > i) {\n if (end > count) {\n const length = Math.max(Math.min(end - count, lineLength), 1);\n res.push(` | ` + \"^\".repeat(length));\n }\n count += lineLength + newLineSeqLength;\n }\n }\n break;\n }\n }\n return res.join(\"\\n\");\n }\n var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\n var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);\n var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);\n var unsafeAttrCharRE = /[>/=\"'\\u0009\\u000a\\u000c\\u0020]/;\n var attrValidationCache = {};\n function isSSRSafeAttrName(name) {\n if (attrValidationCache.hasOwnProperty(name)) {\n return attrValidationCache[name];\n }\n const isUnsafe = unsafeAttrCharRE.test(name);\n if (isUnsafe) {\n console.error(`unsafe attribute name: ${name}`);\n }\n return attrValidationCache[name] = !isUnsafe;\n }\n var propsToAttrMap = {\n acceptCharset: \"accept-charset\",\n className: \"class\",\n htmlFor: \"for\",\n httpEquiv: \"http-equiv\"\n };\n var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`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,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`);\n var isKnownAttr = /* @__PURE__ */ makeMap(`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`);\n function normalizeStyle(value) {\n if (isArray(value)) {\n const res = {};\n for (let i = 0; i < value.length; i++) {\n const item = value[i];\n const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item);\n if (normalized) {\n for (const key in normalized) {\n res[key] = normalized[key];\n }\n }\n }\n return res;\n } else if (isObject(value)) {\n return value;\n }\n }\n var listDelimiterRE = /;(?![^(]*\\))/g;\n var propertyDelimiterRE = /:(.+)/;\n function parseStringStyle(cssText) {\n const ret = {};\n cssText.split(listDelimiterRE).forEach((item) => {\n if (item) {\n const tmp = item.split(propertyDelimiterRE);\n tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());\n }\n });\n return ret;\n }\n function stringifyStyle(styles) {\n let ret = \"\";\n if (!styles) {\n return ret;\n }\n for (const key in styles) {\n const value = styles[key];\n const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);\n if (isString(value) || typeof value === \"number\" && isNoUnitNumericStyleProp(normalizedKey)) {\n ret += `${normalizedKey}:${value};`;\n }\n }\n return ret;\n }\n function normalizeClass(value) {\n let res = \"\";\n if (isString(value)) {\n res = value;\n } else if (isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n const normalized = normalizeClass(value[i]);\n if (normalized) {\n res += normalized + \" \";\n }\n }\n } else if (isObject(value)) {\n for (const name in value) {\n if (value[name]) {\n res += name + \" \";\n }\n }\n }\n return res.trim();\n }\n 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\";\n 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\";\n var VOID_TAGS = \"area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr\";\n var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);\n var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);\n var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS);\n var escapeRE = /[\"'&<>]/;\n function escapeHtml(string) {\n const str = \"\" + string;\n const match = escapeRE.exec(str);\n if (!match) {\n return str;\n }\n let html = \"\";\n let escaped;\n let index;\n let lastIndex = 0;\n for (index = match.index; index < str.length; index++) {\n switch (str.charCodeAt(index)) {\n case 34:\n escaped = \""\";\n break;\n case 38:\n escaped = \"&\";\n break;\n case 39:\n escaped = \"'\";\n break;\n case 60:\n escaped = \"<\";\n break;\n case 62:\n escaped = \">\";\n break;\n default:\n continue;\n }\n if (lastIndex !== index) {\n html += str.substring(lastIndex, index);\n }\n lastIndex = index + 1;\n html += escaped;\n }\n return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n }\n var commentStripRE = /^-?>||--!>| looseEqual(item, val));\n }\n var toDisplayString = (val) => {\n return val == null ? \"\" : isObject(val) ? JSON.stringify(val, replacer, 2) : String(val);\n };\n var replacer = (_key, val) => {\n if (isMap(val)) {\n return {\n [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => {\n entries[`${key} =>`] = val2;\n return entries;\n }, {})\n };\n } else if (isSet(val)) {\n return {\n [`Set(${val.size})`]: [...val.values()]\n };\n } else if (isObject(val) && !isArray(val) && !isPlainObject(val)) {\n return String(val);\n }\n return val;\n };\n var babelParserDefaultPlugins = [\n \"bigInt\",\n \"optionalChaining\",\n \"nullishCoalescingOperator\"\n ];\n var EMPTY_OBJ = Object.freeze({});\n var EMPTY_ARR = Object.freeze([]);\n var NOOP = () => {\n };\n var NO = () => false;\n var onRE = /^on[^a-z]/;\n var isOn = (key) => onRE.test(key);\n var isModelListener = (key) => key.startsWith(\"onUpdate:\");\n var extend = Object.assign;\n var remove = (arr, el) => {\n const i = arr.indexOf(el);\n if (i > -1) {\n arr.splice(i, 1);\n }\n };\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var hasOwn = (val, key) => hasOwnProperty.call(val, key);\n var isArray = Array.isArray;\n var isMap = (val) => toTypeString(val) === \"[object Map]\";\n var isSet = (val) => toTypeString(val) === \"[object Set]\";\n var isDate = (val) => val instanceof Date;\n var isFunction = (val) => typeof val === \"function\";\n var isString = (val) => typeof val === \"string\";\n var isSymbol = (val) => typeof val === \"symbol\";\n var isObject = (val) => val !== null && typeof val === \"object\";\n var isPromise = (val) => {\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\n };\n var objectToString = Object.prototype.toString;\n var toTypeString = (value) => objectToString.call(value);\n var toRawType = (value) => {\n return toTypeString(value).slice(8, -1);\n };\n var isPlainObject = (val) => toTypeString(val) === \"[object Object]\";\n var isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\n var isReservedProp = /* @__PURE__ */ makeMap(\n // the leading comma is intentional so empty string \"\" is also included\n \",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted\"\n );\n var cacheStringFunction = (fn) => {\n const cache = /* @__PURE__ */ Object.create(null);\n return (str) => {\n const hit = cache[str];\n return hit || (cache[str] = fn(str));\n };\n };\n var camelizeRE = /-(\\w)/g;\n var camelize = cacheStringFunction((str) => {\n return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n });\n var hyphenateRE = /\\B([A-Z])/g;\n var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\n var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\n var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);\n var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\n var invokeArrayFns = (fns, arg) => {\n for (let i = 0; i < fns.length; i++) {\n fns[i](arg);\n }\n };\n var def = (obj, key, value) => {\n Object.defineProperty(obj, key, {\n configurable: true,\n enumerable: false,\n value\n });\n };\n var toNumber = (val) => {\n const n = parseFloat(val);\n return isNaN(n) ? val : n;\n };\n var _globalThis;\n var getGlobalThis = () => {\n return _globalThis || (_globalThis = typeof globalThis !== \"undefined\" ? globalThis : typeof self !== \"undefined\" ? self : typeof window !== \"undefined\" ? window : typeof global !== \"undefined\" ? global : {});\n };\n exports.EMPTY_ARR = EMPTY_ARR;\n exports.EMPTY_OBJ = EMPTY_OBJ;\n exports.NO = NO;\n exports.NOOP = NOOP;\n exports.PatchFlagNames = PatchFlagNames;\n exports.babelParserDefaultPlugins = babelParserDefaultPlugins;\n exports.camelize = camelize;\n exports.capitalize = capitalize;\n exports.def = def;\n exports.escapeHtml = escapeHtml;\n exports.escapeHtmlComment = escapeHtmlComment;\n exports.extend = extend;\n exports.generateCodeFrame = generateCodeFrame;\n exports.getGlobalThis = getGlobalThis;\n exports.hasChanged = hasChanged;\n exports.hasOwn = hasOwn;\n exports.hyphenate = hyphenate;\n exports.invokeArrayFns = invokeArrayFns;\n exports.isArray = isArray;\n exports.isBooleanAttr = isBooleanAttr2;\n exports.isDate = isDate;\n exports.isFunction = isFunction;\n exports.isGloballyWhitelisted = isGloballyWhitelisted;\n exports.isHTMLTag = isHTMLTag;\n exports.isIntegerKey = isIntegerKey;\n exports.isKnownAttr = isKnownAttr;\n exports.isMap = isMap;\n exports.isModelListener = isModelListener;\n exports.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp;\n exports.isObject = isObject;\n exports.isOn = isOn;\n exports.isPlainObject = isPlainObject;\n exports.isPromise = isPromise;\n exports.isReservedProp = isReservedProp;\n exports.isSSRSafeAttrName = isSSRSafeAttrName;\n exports.isSVGTag = isSVGTag;\n exports.isSet = isSet;\n exports.isSpecialBooleanAttr = isSpecialBooleanAttr;\n exports.isString = isString;\n exports.isSymbol = isSymbol;\n exports.isVoidTag = isVoidTag;\n exports.looseEqual = looseEqual;\n exports.looseIndexOf = looseIndexOf;\n exports.makeMap = makeMap;\n exports.normalizeClass = normalizeClass;\n exports.normalizeStyle = normalizeStyle;\n exports.objectToString = objectToString;\n exports.parseStringStyle = parseStringStyle;\n exports.propsToAttrMap = propsToAttrMap;\n exports.remove = remove;\n exports.slotFlagsText = slotFlagsText;\n exports.stringifyStyle = stringifyStyle;\n exports.toDisplayString = toDisplayString;\n exports.toHandlerKey = toHandlerKey;\n exports.toNumber = toNumber;\n exports.toRawType = toRawType;\n exports.toTypeString = toTypeString;\n }\n});\n\n// node_modules/@vue/shared/index.js\nvar require_shared = __commonJS({\n \"node_modules/@vue/shared/index.js\"(exports, module2) {\n \"use strict\";\n if (false) {\n module2.exports = null;\n } else {\n module2.exports = require_shared_cjs();\n }\n }\n});\n\n// node_modules/@vue/reactivity/dist/reactivity.cjs.js\nvar require_reactivity_cjs = __commonJS({\n \"node_modules/@vue/reactivity/dist/reactivity.cjs.js\"(exports) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n var shared = require_shared();\n var targetMap = /* @__PURE__ */ new WeakMap();\n var effectStack = [];\n var activeEffect;\n var ITERATE_KEY = Symbol(\"iterate\");\n var MAP_KEY_ITERATE_KEY = Symbol(\"Map key iterate\");\n function isEffect(fn) {\n return fn && fn._isEffect === true;\n }\n function effect3(fn, options = shared.EMPTY_OBJ) {\n if (isEffect(fn)) {\n fn = fn.raw;\n }\n const effect4 = createReactiveEffect(fn, options);\n if (!options.lazy) {\n effect4();\n }\n return effect4;\n }\n function stop2(effect4) {\n if (effect4.active) {\n cleanup(effect4);\n if (effect4.options.onStop) {\n effect4.options.onStop();\n }\n effect4.active = false;\n }\n }\n var uid = 0;\n function createReactiveEffect(fn, options) {\n const effect4 = function reactiveEffect() {\n if (!effect4.active) {\n return fn();\n }\n if (!effectStack.includes(effect4)) {\n cleanup(effect4);\n try {\n enableTracking();\n effectStack.push(effect4);\n activeEffect = effect4;\n return fn();\n } finally {\n effectStack.pop();\n resetTracking();\n activeEffect = effectStack[effectStack.length - 1];\n }\n }\n };\n effect4.id = uid++;\n effect4.allowRecurse = !!options.allowRecurse;\n effect4._isEffect = true;\n effect4.active = true;\n effect4.raw = fn;\n effect4.deps = [];\n effect4.options = options;\n return effect4;\n }\n function cleanup(effect4) {\n const { deps } = effect4;\n if (deps.length) {\n for (let i = 0; i < deps.length; i++) {\n deps[i].delete(effect4);\n }\n deps.length = 0;\n }\n }\n var shouldTrack = true;\n var trackStack = [];\n function pauseTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = false;\n }\n function enableTracking() {\n trackStack.push(shouldTrack);\n shouldTrack = true;\n }\n function resetTracking() {\n const last = trackStack.pop();\n shouldTrack = last === void 0 ? true : last;\n }\n function track(target, type, key) {\n if (!shouldTrack || activeEffect === void 0) {\n return;\n }\n let depsMap = targetMap.get(target);\n if (!depsMap) {\n targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n }\n let dep = depsMap.get(key);\n if (!dep) {\n depsMap.set(key, dep = /* @__PURE__ */ new Set());\n }\n if (!dep.has(activeEffect)) {\n dep.add(activeEffect);\n activeEffect.deps.push(dep);\n if (activeEffect.options.onTrack) {\n activeEffect.options.onTrack({\n effect: activeEffect,\n target,\n type,\n key\n });\n }\n }\n }\n function trigger(target, type, key, newValue, oldValue, oldTarget) {\n const depsMap = targetMap.get(target);\n if (!depsMap) {\n return;\n }\n const effects = /* @__PURE__ */ new Set();\n const add2 = (effectsToAdd) => {\n if (effectsToAdd) {\n effectsToAdd.forEach((effect4) => {\n if (effect4 !== activeEffect || effect4.allowRecurse) {\n effects.add(effect4);\n }\n });\n }\n };\n if (type === \"clear\") {\n depsMap.forEach(add2);\n } else if (key === \"length\" && shared.isArray(target)) {\n depsMap.forEach((dep, key2) => {\n if (key2 === \"length\" || key2 >= newValue) {\n add2(dep);\n }\n });\n } else {\n if (key !== void 0) {\n add2(depsMap.get(key));\n }\n switch (type) {\n case \"add\":\n if (!shared.isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (shared.isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n } else if (shared.isIntegerKey(key)) {\n add2(depsMap.get(\"length\"));\n }\n break;\n case \"delete\":\n if (!shared.isArray(target)) {\n add2(depsMap.get(ITERATE_KEY));\n if (shared.isMap(target)) {\n add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n }\n }\n break;\n case \"set\":\n if (shared.isMap(target)) {\n add2(depsMap.get(ITERATE_KEY));\n }\n break;\n }\n }\n const run = (effect4) => {\n if (effect4.options.onTrigger) {\n effect4.options.onTrigger({\n effect: effect4,\n target,\n key,\n type,\n newValue,\n oldValue,\n oldTarget\n });\n }\n if (effect4.options.scheduler) {\n effect4.options.scheduler(effect4);\n } else {\n effect4();\n }\n };\n effects.forEach(run);\n }\n var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`);\n var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol));\n var get2 = /* @__PURE__ */ createGetter();\n var shallowGet = /* @__PURE__ */ createGetter(false, true);\n var readonlyGet = /* @__PURE__ */ createGetter(true);\n var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true);\n var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();\n function createArrayInstrumentations() {\n const instrumentations = {};\n [\"includes\", \"indexOf\", \"lastIndexOf\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n const arr = toRaw2(this);\n for (let i = 0, l = this.length; i < l; i++) {\n track(arr, \"get\", i + \"\");\n }\n const res = arr[key](...args);\n if (res === -1 || res === false) {\n return arr[key](...args.map(toRaw2));\n } else {\n return res;\n }\n };\n });\n [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"].forEach((key) => {\n instrumentations[key] = function(...args) {\n pauseTracking();\n const res = toRaw2(this)[key].apply(this, args);\n resetTracking();\n return res;\n };\n });\n return instrumentations;\n }\n function createGetter(isReadonly2 = false, shallow = false) {\n return function get3(target, key, receiver) {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {\n return target;\n }\n const targetIsArray = shared.isArray(target);\n if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) {\n return Reflect.get(arrayInstrumentations, key, receiver);\n }\n const res = Reflect.get(target, key, receiver);\n if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n return res;\n }\n if (!isReadonly2) {\n track(target, \"get\", key);\n }\n if (shallow) {\n return res;\n }\n if (isRef(res)) {\n const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key);\n return shouldUnwrap ? res.value : res;\n }\n if (shared.isObject(res)) {\n return isReadonly2 ? readonly(res) : reactive3(res);\n }\n return res;\n };\n }\n var set2 = /* @__PURE__ */ createSetter();\n var shallowSet = /* @__PURE__ */ createSetter(true);\n function createSetter(shallow = false) {\n return function set3(target, key, value, receiver) {\n let oldValue = target[key];\n if (!shallow) {\n value = toRaw2(value);\n oldValue = toRaw2(oldValue);\n if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n }\n }\n const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key);\n const result = Reflect.set(target, key, value, receiver);\n if (target === toRaw2(receiver)) {\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (shared.hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n }\n return result;\n };\n }\n function deleteProperty(target, key) {\n const hadKey = shared.hasOwn(target, key);\n const oldValue = target[key];\n const result = Reflect.deleteProperty(target, key);\n if (result && hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n function has(target, key) {\n const result = Reflect.has(target, key);\n if (!shared.isSymbol(key) || !builtInSymbols.has(key)) {\n track(target, \"has\", key);\n }\n return result;\n }\n function ownKeys(target) {\n track(target, \"iterate\", shared.isArray(target) ? \"length\" : ITERATE_KEY);\n return Reflect.ownKeys(target);\n }\n var mutableHandlers = {\n get: get2,\n set: set2,\n deleteProperty,\n has,\n ownKeys\n };\n var readonlyHandlers = {\n get: readonlyGet,\n set(target, key) {\n {\n console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n },\n deleteProperty(target, key) {\n {\n console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\n }\n return true;\n }\n };\n var shallowReactiveHandlers = /* @__PURE__ */ shared.extend({}, mutableHandlers, {\n get: shallowGet,\n set: shallowSet\n });\n var shallowReadonlyHandlers = /* @__PURE__ */ shared.extend({}, readonlyHandlers, {\n get: shallowReadonlyGet\n });\n var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value;\n var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value;\n var toShallow = (value) => value;\n var getProto = (v) => Reflect.getPrototypeOf(v);\n function get$1(target, key, isReadonly2 = false, isShallow = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const rawKey = toRaw2(key);\n if (key !== rawKey) {\n !isReadonly2 && track(rawTarget, \"get\", key);\n }\n !isReadonly2 && track(rawTarget, \"get\", rawKey);\n const { has: has2 } = getProto(rawTarget);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n if (has2.call(rawTarget, key)) {\n return wrap(target.get(key));\n } else if (has2.call(rawTarget, rawKey)) {\n return wrap(target.get(rawKey));\n } else if (target !== rawTarget) {\n target.get(key);\n }\n }\n function has$1(key, isReadonly2 = false) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const rawKey = toRaw2(key);\n if (key !== rawKey) {\n !isReadonly2 && track(rawTarget, \"has\", key);\n }\n !isReadonly2 && track(rawTarget, \"has\", rawKey);\n return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n }\n function size(target, isReadonly2 = false) {\n target = target[\n \"__v_raw\"\n /* RAW */\n ];\n !isReadonly2 && track(toRaw2(target), \"iterate\", ITERATE_KEY);\n return Reflect.get(target, \"size\", target);\n }\n function add(value) {\n value = toRaw2(value);\n const target = toRaw2(this);\n const proto = getProto(target);\n const hadKey = proto.has.call(target, value);\n if (!hadKey) {\n target.add(value);\n trigger(target, \"add\", value, value);\n }\n return this;\n }\n function set$1(key, value) {\n value = toRaw2(value);\n const target = toRaw2(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw2(key);\n hadKey = has2.call(target, key);\n } else {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3.call(target, key);\n target.set(key, value);\n if (!hadKey) {\n trigger(target, \"add\", key, value);\n } else if (shared.hasChanged(value, oldValue)) {\n trigger(target, \"set\", key, value, oldValue);\n }\n return this;\n }\n function deleteEntry(key) {\n const target = toRaw2(this);\n const { has: has2, get: get3 } = getProto(target);\n let hadKey = has2.call(target, key);\n if (!hadKey) {\n key = toRaw2(key);\n hadKey = has2.call(target, key);\n } else {\n checkIdentityKeys(target, has2, key);\n }\n const oldValue = get3 ? get3.call(target, key) : void 0;\n const result = target.delete(key);\n if (hadKey) {\n trigger(target, \"delete\", key, void 0, oldValue);\n }\n return result;\n }\n function clear() {\n const target = toRaw2(this);\n const hadItems = target.size !== 0;\n const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target);\n const result = target.clear();\n if (hadItems) {\n trigger(target, \"clear\", void 0, void 0, oldTarget);\n }\n return result;\n }\n function createForEach(isReadonly2, isShallow) {\n return function forEach(callback, thisArg) {\n const observed = this;\n const target = observed[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(rawTarget, \"iterate\", ITERATE_KEY);\n return target.forEach((value, key) => {\n return callback.call(thisArg, wrap(value), wrap(key), observed);\n });\n };\n }\n function createIterableMethod(method, isReadonly2, isShallow) {\n return function(...args) {\n const target = this[\n \"__v_raw\"\n /* RAW */\n ];\n const rawTarget = toRaw2(target);\n const targetIsMap = shared.isMap(rawTarget);\n const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n const isKeyOnly = method === \"keys\" && targetIsMap;\n const innerIterator = target[method](...args);\n const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive;\n !isReadonly2 && track(rawTarget, \"iterate\", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n return {\n // iterator protocol\n next() {\n const { value, done } = innerIterator.next();\n return done ? { value, done } : {\n value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n done\n };\n },\n // iterable protocol\n [Symbol.iterator]() {\n return this;\n }\n };\n };\n }\n function createReadonlyMethod(type) {\n return function(...args) {\n {\n const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this));\n }\n return type === \"delete\" ? false : this;\n };\n }\n function createInstrumentations() {\n const mutableInstrumentations2 = {\n get(key) {\n return get$1(this, key);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, false)\n };\n const shallowInstrumentations2 = {\n get(key) {\n return get$1(this, key, false, true);\n },\n get size() {\n return size(this);\n },\n has: has$1,\n add,\n set: set$1,\n delete: deleteEntry,\n clear,\n forEach: createForEach(false, true)\n };\n const readonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, false)\n };\n const shallowReadonlyInstrumentations2 = {\n get(key) {\n return get$1(this, key, true, true);\n },\n get size() {\n return size(this, true);\n },\n has(key) {\n return has$1.call(this, key, true);\n },\n add: createReadonlyMethod(\n \"add\"\n /* ADD */\n ),\n set: createReadonlyMethod(\n \"set\"\n /* SET */\n ),\n delete: createReadonlyMethod(\n \"delete\"\n /* DELETE */\n ),\n clear: createReadonlyMethod(\n \"clear\"\n /* CLEAR */\n ),\n forEach: createForEach(true, true)\n };\n const iteratorMethods = [\"keys\", \"values\", \"entries\", Symbol.iterator];\n iteratorMethods.forEach((method) => {\n mutableInstrumentations2[method] = createIterableMethod(method, false, false);\n readonlyInstrumentations2[method] = createIterableMethod(method, true, false);\n shallowInstrumentations2[method] = createIterableMethod(method, false, true);\n shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);\n });\n return [\n mutableInstrumentations2,\n readonlyInstrumentations2,\n shallowInstrumentations2,\n shallowReadonlyInstrumentations2\n ];\n }\n var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();\n function createInstrumentationGetter(isReadonly2, shallow) {\n const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations;\n return (target, key, receiver) => {\n if (key === \"__v_isReactive\") {\n return !isReadonly2;\n } else if (key === \"__v_isReadonly\") {\n return isReadonly2;\n } else if (key === \"__v_raw\") {\n return target;\n }\n return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);\n };\n }\n var mutableCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n };\n var shallowCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(false, true)\n };\n var readonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n };\n var shallowReadonlyCollectionHandlers = {\n get: /* @__PURE__ */ createInstrumentationGetter(true, true)\n };\n function checkIdentityKeys(target, has2, key) {\n const rawKey = toRaw2(key);\n if (rawKey !== key && has2.call(target, rawKey)) {\n const type = shared.toRawType(target);\n 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.`);\n }\n }\n var reactiveMap = /* @__PURE__ */ new WeakMap();\n var shallowReactiveMap = /* @__PURE__ */ new WeakMap();\n var readonlyMap = /* @__PURE__ */ new WeakMap();\n var shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\n function targetTypeMap(rawType) {\n switch (rawType) {\n case \"Object\":\n case \"Array\":\n return 1;\n case \"Map\":\n case \"Set\":\n case \"WeakMap\":\n case \"WeakSet\":\n return 2;\n default:\n return 0;\n }\n }\n function getTargetType(value) {\n return value[\n \"__v_skip\"\n /* SKIP */\n ] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value));\n }\n function reactive3(target) {\n if (target && target[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ]) {\n return target;\n }\n return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n }\n function shallowReactive(target) {\n return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap);\n }\n function readonly(target) {\n return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n }\n function shallowReadonly(target) {\n return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap);\n }\n function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) {\n if (!shared.isObject(target)) {\n {\n console.warn(`value cannot be made reactive: ${String(target)}`);\n }\n return target;\n }\n if (target[\n \"__v_raw\"\n /* RAW */\n ] && !(isReadonly2 && target[\n \"__v_isReactive\"\n /* IS_REACTIVE */\n ])) {\n return target;\n }\n const existingProxy = proxyMap.get(target);\n if (existingProxy) {\n return existingProxy;\n }\n const targetType = getTargetType(target);\n if (targetType === 0) {\n return target;\n }\n const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);\n proxyMap.set(target, proxy);\n return proxy;\n }\n function isReactive2(value) {\n if (isReadonly(value)) {\n return isReactive2(value[\n \"__v_raw\"\n /* RAW */\n ]);\n }\n return !!(value && value[\n \"__v_isReactive\"\n /* IS_REACTIVE */\n ]);\n }\n function isReadonly(value) {\n return !!(value && value[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ]);\n }\n function isProxy(value) {\n return isReactive2(value) || isReadonly(value);\n }\n function toRaw2(observed) {\n return observed && toRaw2(observed[\n \"__v_raw\"\n /* RAW */\n ]) || observed;\n }\n function markRaw(value) {\n shared.def(value, \"__v_skip\", true);\n return value;\n }\n var convert = (val) => shared.isObject(val) ? reactive3(val) : val;\n function isRef(r) {\n return Boolean(r && r.__v_isRef === true);\n }\n function ref(value) {\n return createRef(value);\n }\n function shallowRef(value) {\n return createRef(value, true);\n }\n var RefImpl = class {\n constructor(value, _shallow = false) {\n this._shallow = _shallow;\n this.__v_isRef = true;\n this._rawValue = _shallow ? value : toRaw2(value);\n this._value = _shallow ? value : convert(value);\n }\n get value() {\n track(toRaw2(this), \"get\", \"value\");\n return this._value;\n }\n set value(newVal) {\n newVal = this._shallow ? newVal : toRaw2(newVal);\n if (shared.hasChanged(newVal, this._rawValue)) {\n this._rawValue = newVal;\n this._value = this._shallow ? newVal : convert(newVal);\n trigger(toRaw2(this), \"set\", \"value\", newVal);\n }\n }\n };\n function createRef(rawValue, shallow = false) {\n if (isRef(rawValue)) {\n return rawValue;\n }\n return new RefImpl(rawValue, shallow);\n }\n function triggerRef(ref2) {\n trigger(toRaw2(ref2), \"set\", \"value\", ref2.value);\n }\n function unref(ref2) {\n return isRef(ref2) ? ref2.value : ref2;\n }\n var shallowUnwrapHandlers = {\n get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),\n set: (target, key, value, receiver) => {\n const oldValue = target[key];\n if (isRef(oldValue) && !isRef(value)) {\n oldValue.value = value;\n return true;\n } else {\n return Reflect.set(target, key, value, receiver);\n }\n }\n };\n function proxyRefs(objectWithRefs) {\n return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);\n }\n var CustomRefImpl = class {\n constructor(factory) {\n this.__v_isRef = true;\n const { get: get3, set: set3 } = factory(() => track(this, \"get\", \"value\"), () => trigger(this, \"set\", \"value\"));\n this._get = get3;\n this._set = set3;\n }\n get value() {\n return this._get();\n }\n set value(newVal) {\n this._set(newVal);\n }\n };\n function customRef(factory) {\n return new CustomRefImpl(factory);\n }\n function toRefs(object) {\n if (!isProxy(object)) {\n console.warn(`toRefs() expects a reactive object but received a plain one.`);\n }\n const ret = shared.isArray(object) ? new Array(object.length) : {};\n for (const key in object) {\n ret[key] = toRef(object, key);\n }\n return ret;\n }\n var ObjectRefImpl = class {\n constructor(_object, _key) {\n this._object = _object;\n this._key = _key;\n this.__v_isRef = true;\n }\n get value() {\n return this._object[this._key];\n }\n set value(newVal) {\n this._object[this._key] = newVal;\n }\n };\n function toRef(object, key) {\n return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key);\n }\n var ComputedRefImpl = class {\n constructor(getter, _setter, isReadonly2) {\n this._setter = _setter;\n this._dirty = true;\n this.__v_isRef = true;\n this.effect = effect3(getter, {\n lazy: true,\n scheduler: () => {\n if (!this._dirty) {\n this._dirty = true;\n trigger(toRaw2(this), \"set\", \"value\");\n }\n }\n });\n this[\n \"__v_isReadonly\"\n /* IS_READONLY */\n ] = isReadonly2;\n }\n get value() {\n const self2 = toRaw2(this);\n if (self2._dirty) {\n self2._value = this.effect();\n self2._dirty = false;\n }\n track(self2, \"get\", \"value\");\n return self2._value;\n }\n set value(newValue) {\n this._setter(newValue);\n }\n };\n function computed(getterOrOptions) {\n let getter;\n let setter;\n if (shared.isFunction(getterOrOptions)) {\n getter = getterOrOptions;\n setter = () => {\n console.warn(\"Write operation failed: computed value is readonly\");\n };\n } else {\n getter = getterOrOptions.get;\n setter = getterOrOptions.set;\n }\n return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set);\n }\n exports.ITERATE_KEY = ITERATE_KEY;\n exports.computed = computed;\n exports.customRef = customRef;\n exports.effect = effect3;\n exports.enableTracking = enableTracking;\n exports.isProxy = isProxy;\n exports.isReactive = isReactive2;\n exports.isReadonly = isReadonly;\n exports.isRef = isRef;\n exports.markRaw = markRaw;\n exports.pauseTracking = pauseTracking;\n exports.proxyRefs = proxyRefs;\n exports.reactive = reactive3;\n exports.readonly = readonly;\n exports.ref = ref;\n exports.resetTracking = resetTracking;\n exports.shallowReactive = shallowReactive;\n exports.shallowReadonly = shallowReadonly;\n exports.shallowRef = shallowRef;\n exports.stop = stop2;\n exports.toRaw = toRaw2;\n exports.toRef = toRef;\n exports.toRefs = toRefs;\n exports.track = track;\n exports.trigger = trigger;\n exports.triggerRef = triggerRef;\n exports.unref = unref;\n }\n});\n\n// node_modules/@vue/reactivity/index.js\nvar require_reactivity = __commonJS({\n \"node_modules/@vue/reactivity/index.js\"(exports, module2) {\n \"use strict\";\n if (false) {\n module2.exports = null;\n } else {\n module2.exports = require_reactivity_cjs();\n }\n }\n});\n\n// packages/alpinejs/builds/module.js\nvar module_exports = {};\n__export(module_exports, {\n Alpine: () => src_default,\n default: () => module_default\n});\nmodule.exports = __toCommonJS(module_exports);\n\n// packages/alpinejs/src/scheduler.js\nvar flushPending = false;\nvar flushing = false;\nvar queue = [];\nvar lastFlushedIndex = -1;\nfunction scheduler(callback) {\n queueJob(callback);\n}\nfunction queueJob(job) {\n if (!queue.includes(job))\n queue.push(job);\n queueFlush();\n}\nfunction dequeueJob(job) {\n let index = queue.indexOf(job);\n if (index !== -1 && index > lastFlushedIndex)\n queue.splice(index, 1);\n}\nfunction queueFlush() {\n if (!flushing && !flushPending) {\n flushPending = true;\n queueMicrotask(flushJobs);\n }\n}\nfunction flushJobs() {\n flushPending = false;\n flushing = true;\n for (let i = 0; i < queue.length; i++) {\n queue[i]();\n lastFlushedIndex = i;\n }\n queue.length = 0;\n lastFlushedIndex = -1;\n flushing = false;\n}\n\n// packages/alpinejs/src/reactivity.js\nvar reactive;\nvar effect;\nvar release;\nvar raw;\nvar shouldSchedule = true;\nfunction disableEffectScheduling(callback) {\n shouldSchedule = false;\n callback();\n shouldSchedule = true;\n}\nfunction setReactivityEngine(engine) {\n reactive = engine.reactive;\n release = engine.release;\n effect = (callback) => engine.effect(callback, { scheduler: (task) => {\n if (shouldSchedule) {\n scheduler(task);\n } else {\n task();\n }\n } });\n raw = engine.raw;\n}\nfunction overrideEffect(override) {\n effect = override;\n}\nfunction elementBoundEffect(el) {\n let cleanup = () => {\n };\n let wrappedEffect = (callback) => {\n let effectReference = effect(callback);\n if (!el._x_effects) {\n el._x_effects = /* @__PURE__ */ new Set();\n el._x_runEffects = () => {\n el._x_effects.forEach((i) => i());\n };\n }\n el._x_effects.add(effectReference);\n cleanup = () => {\n if (effectReference === void 0)\n return;\n el._x_effects.delete(effectReference);\n release(effectReference);\n };\n return effectReference;\n };\n return [wrappedEffect, () => {\n cleanup();\n }];\n}\nfunction watch(getter, callback) {\n let firstTime = true;\n let oldValue;\n let effectReference = effect(() => {\n let value = getter();\n JSON.stringify(value);\n if (!firstTime) {\n queueMicrotask(() => {\n callback(value, oldValue);\n oldValue = value;\n });\n } else {\n oldValue = value;\n }\n firstTime = false;\n });\n return () => release(effectReference);\n}\n\n// packages/alpinejs/src/mutation.js\nvar onAttributeAddeds = [];\nvar onElRemoveds = [];\nvar onElAddeds = [];\nfunction onElAdded(callback) {\n onElAddeds.push(callback);\n}\nfunction onElRemoved(el, callback) {\n if (typeof callback === \"function\") {\n if (!el._x_cleanups)\n el._x_cleanups = [];\n el._x_cleanups.push(callback);\n } else {\n callback = el;\n onElRemoveds.push(callback);\n }\n}\nfunction onAttributesAdded(callback) {\n onAttributeAddeds.push(callback);\n}\nfunction onAttributeRemoved(el, name, callback) {\n if (!el._x_attributeCleanups)\n el._x_attributeCleanups = {};\n if (!el._x_attributeCleanups[name])\n el._x_attributeCleanups[name] = [];\n el._x_attributeCleanups[name].push(callback);\n}\nfunction cleanupAttributes(el, names) {\n if (!el._x_attributeCleanups)\n return;\n Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {\n if (names === void 0 || names.includes(name)) {\n value.forEach((i) => i());\n delete el._x_attributeCleanups[name];\n }\n });\n}\nfunction cleanupElement(el) {\n var _a, _b;\n (_a = el._x_effects) == null ? void 0 : _a.forEach(dequeueJob);\n while ((_b = el._x_cleanups) == null ? void 0 : _b.length)\n el._x_cleanups.pop()();\n}\nvar observer = new MutationObserver(onMutate);\nvar currentlyObserving = false;\nfunction startObservingMutations() {\n observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\n currentlyObserving = true;\n}\nfunction stopObservingMutations() {\n flushObserver();\n observer.disconnect();\n currentlyObserving = false;\n}\nvar queuedMutations = [];\nfunction flushObserver() {\n let records = observer.takeRecords();\n queuedMutations.push(() => records.length > 0 && onMutate(records));\n let queueLengthWhenTriggered = queuedMutations.length;\n queueMicrotask(() => {\n if (queuedMutations.length === queueLengthWhenTriggered) {\n while (queuedMutations.length > 0)\n queuedMutations.shift()();\n }\n });\n}\nfunction mutateDom(callback) {\n if (!currentlyObserving)\n return callback();\n stopObservingMutations();\n let result = callback();\n startObservingMutations();\n return result;\n}\nvar isCollecting = false;\nvar deferredMutations = [];\nfunction deferMutations() {\n isCollecting = true;\n}\nfunction flushAndStopDeferringMutations() {\n isCollecting = false;\n onMutate(deferredMutations);\n deferredMutations = [];\n}\nfunction onMutate(mutations) {\n if (isCollecting) {\n deferredMutations = deferredMutations.concat(mutations);\n return;\n }\n let addedNodes = [];\n let removedNodes = /* @__PURE__ */ new Set();\n let addedAttributes = /* @__PURE__ */ new Map();\n let removedAttributes = /* @__PURE__ */ new Map();\n for (let i = 0; i < mutations.length; i++) {\n if (mutations[i].target._x_ignoreMutationObserver)\n continue;\n if (mutations[i].type === \"childList\") {\n mutations[i].removedNodes.forEach((node) => {\n if (node.nodeType !== 1)\n return;\n if (!node._x_marker)\n return;\n removedNodes.add(node);\n });\n mutations[i].addedNodes.forEach((node) => {\n if (node.nodeType !== 1)\n return;\n if (removedNodes.has(node)) {\n removedNodes.delete(node);\n return;\n }\n if (node._x_marker)\n return;\n addedNodes.push(node);\n });\n }\n if (mutations[i].type === \"attributes\") {\n let el = mutations[i].target;\n let name = mutations[i].attributeName;\n let oldValue = mutations[i].oldValue;\n let add = () => {\n if (!addedAttributes.has(el))\n addedAttributes.set(el, []);\n addedAttributes.get(el).push({ name, value: el.getAttribute(name) });\n };\n let remove = () => {\n if (!removedAttributes.has(el))\n removedAttributes.set(el, []);\n removedAttributes.get(el).push(name);\n };\n if (el.hasAttribute(name) && oldValue === null) {\n add();\n } else if (el.hasAttribute(name)) {\n remove();\n add();\n } else {\n remove();\n }\n }\n }\n removedAttributes.forEach((attrs, el) => {\n cleanupAttributes(el, attrs);\n });\n addedAttributes.forEach((attrs, el) => {\n onAttributeAddeds.forEach((i) => i(el, attrs));\n });\n for (let node of removedNodes) {\n if (addedNodes.some((i) => i.contains(node)))\n continue;\n onElRemoveds.forEach((i) => i(node));\n }\n for (let node of addedNodes) {\n if (!node.isConnected)\n continue;\n onElAddeds.forEach((i) => i(node));\n }\n addedNodes = null;\n removedNodes = null;\n addedAttributes = null;\n removedAttributes = null;\n}\n\n// packages/alpinejs/src/scope.js\nfunction scope(node) {\n return mergeProxies(closestDataStack(node));\n}\nfunction addScopeToNode(node, data2, referenceNode) {\n node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];\n return () => {\n node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);\n };\n}\nfunction closestDataStack(node) {\n if (node._x_dataStack)\n return node._x_dataStack;\n if (typeof ShadowRoot === \"function\" && node instanceof ShadowRoot) {\n return closestDataStack(node.host);\n }\n if (!node.parentNode) {\n return [];\n }\n return closestDataStack(node.parentNode);\n}\nfunction mergeProxies(objects) {\n return new Proxy({ objects }, mergeProxyTrap);\n}\nvar mergeProxyTrap = {\n ownKeys({ objects }) {\n return Array.from(\n new Set(objects.flatMap((i) => Object.keys(i)))\n );\n },\n has({ objects }, name) {\n if (name == Symbol.unscopables)\n return false;\n return objects.some(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name) || Reflect.has(obj, name)\n );\n },\n get({ objects }, name, thisProxy) {\n if (name == \"toJSON\")\n return collapseProxies;\n return Reflect.get(\n objects.find(\n (obj) => Reflect.has(obj, name)\n ) || {},\n name,\n thisProxy\n );\n },\n set({ objects }, name, value, thisProxy) {\n const target = objects.find(\n (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n ) || objects[objects.length - 1];\n const descriptor = Object.getOwnPropertyDescriptor(target, name);\n if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get))\n return descriptor.set.call(thisProxy, value) || true;\n return Reflect.set(target, name, value);\n }\n};\nfunction collapseProxies() {\n let keys = Reflect.ownKeys(this);\n return keys.reduce((acc, key) => {\n acc[key] = Reflect.get(this, key);\n return acc;\n }, {});\n}\n\n// packages/alpinejs/src/interceptor.js\nfunction initInterceptors(data2) {\n let isObject = (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null;\n let recurse = (obj, basePath = \"\") => {\n Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {\n if (enumerable === false || value === void 0)\n return;\n if (typeof value === \"object\" && value !== null && value.__v_skip)\n return;\n let path = basePath === \"\" ? key : `${basePath}.${key}`;\n if (typeof value === \"object\" && value !== null && value._x_interceptor) {\n obj[key] = value.initialize(data2, path, key);\n } else {\n if (isObject(value) && value !== obj && !(value instanceof Element)) {\n recurse(value, path);\n }\n }\n });\n };\n return recurse(data2);\n}\nfunction interceptor(callback, mutateObj = () => {\n}) {\n let obj = {\n initialValue: void 0,\n _x_interceptor: true,\n initialize(data2, path, key) {\n return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);\n }\n };\n mutateObj(obj);\n return (initialValue) => {\n if (typeof initialValue === \"object\" && initialValue !== null && initialValue._x_interceptor) {\n let initialize = obj.initialize.bind(obj);\n obj.initialize = (data2, path, key) => {\n let innerValue = initialValue.initialize(data2, path, key);\n obj.initialValue = innerValue;\n return initialize(data2, path, key);\n };\n } else {\n obj.initialValue = initialValue;\n }\n return obj;\n };\n}\nfunction get(obj, path) {\n return path.split(\".\").reduce((carry, segment) => carry[segment], obj);\n}\nfunction set(obj, path, value) {\n if (typeof path === \"string\")\n path = path.split(\".\");\n if (path.length === 1)\n obj[path[0]] = value;\n else if (path.length === 0)\n throw error;\n else {\n if (obj[path[0]])\n return set(obj[path[0]], path.slice(1), value);\n else {\n obj[path[0]] = {};\n return set(obj[path[0]], path.slice(1), value);\n }\n }\n}\n\n// packages/alpinejs/src/magics.js\nvar magics = {};\nfunction magic(name, callback) {\n magics[name] = callback;\n}\nfunction injectMagics(obj, el) {\n let memoizedUtilities = getUtilities(el);\n Object.entries(magics).forEach(([name, callback]) => {\n Object.defineProperty(obj, `$${name}`, {\n get() {\n return callback(el, memoizedUtilities);\n },\n enumerable: false\n });\n });\n return obj;\n}\nfunction getUtilities(el) {\n let [utilities, cleanup] = getElementBoundUtilities(el);\n let utils = { interceptor, ...utilities };\n onElRemoved(el, cleanup);\n return utils;\n}\n\n// packages/alpinejs/src/utils/error.js\nfunction tryCatch(el, expression, callback, ...args) {\n try {\n return callback(...args);\n } catch (e) {\n handleError(e, el, expression);\n }\n}\nfunction handleError(error2, el, expression = void 0) {\n error2 = Object.assign(\n error2 != null ? error2 : { message: \"No error message given.\" },\n { el, expression }\n );\n console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression ? 'Expression: \"' + expression + '\"\\n\\n' : \"\"}`, el);\n setTimeout(() => {\n throw error2;\n }, 0);\n}\n\n// packages/alpinejs/src/evaluator.js\nvar shouldAutoEvaluateFunctions = true;\nfunction dontAutoEvaluateFunctions(callback) {\n let cache = shouldAutoEvaluateFunctions;\n shouldAutoEvaluateFunctions = false;\n let result = callback();\n shouldAutoEvaluateFunctions = cache;\n return result;\n}\nfunction evaluate(el, expression, extras = {}) {\n let result;\n evaluateLater(el, expression)((value) => result = value, extras);\n return result;\n}\nfunction evaluateLater(...args) {\n return theEvaluatorFunction(...args);\n}\nvar theEvaluatorFunction = normalEvaluator;\nfunction setEvaluator(newEvaluator) {\n theEvaluatorFunction = newEvaluator;\n}\nfunction normalEvaluator(el, expression) {\n let overriddenMagics = {};\n injectMagics(overriddenMagics, el);\n let dataStack = [overriddenMagics, ...closestDataStack(el)];\n let evaluator = typeof expression === \"function\" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el);\n return tryCatch.bind(null, el, expression, evaluator);\n}\nfunction generateEvaluatorFromFunction(dataStack, func) {\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n let result = func.apply(mergeProxies([scope2, ...dataStack]), params);\n runIfTypeOfFunction(receiver, result);\n };\n}\nvar evaluatorMemo = {};\nfunction generateFunctionFromString(expression, el) {\n if (evaluatorMemo[expression]) {\n return evaluatorMemo[expression];\n }\n let AsyncFunction = Object.getPrototypeOf(async function() {\n }).constructor;\n let rightSideSafeExpression = /^[\\n\\s]*if.*\\(.*\\)/.test(expression.trim()) || /^(let|const)\\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression;\n const safeAsyncFunction = () => {\n try {\n let func2 = new AsyncFunction(\n [\"__self\", \"scope\"],\n `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`\n );\n Object.defineProperty(func2, \"name\", {\n value: `[Alpine] ${expression}`\n });\n return func2;\n } catch (error2) {\n handleError(error2, el, expression);\n return Promise.resolve();\n }\n };\n let func = safeAsyncFunction();\n evaluatorMemo[expression] = func;\n return func;\n}\nfunction generateEvaluatorFromString(dataStack, expression, el) {\n let func = generateFunctionFromString(expression, el);\n return (receiver = () => {\n }, { scope: scope2 = {}, params = [] } = {}) => {\n func.result = void 0;\n func.finished = false;\n let completeScope = mergeProxies([scope2, ...dataStack]);\n if (typeof func === \"function\") {\n let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression));\n if (func.finished) {\n runIfTypeOfFunction(receiver, func.result, completeScope, params, el);\n func.result = void 0;\n } else {\n promise.then((result) => {\n runIfTypeOfFunction(receiver, result, completeScope, params, el);\n }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0);\n }\n }\n };\n}\nfunction runIfTypeOfFunction(receiver, value, scope2, params, el) {\n if (shouldAutoEvaluateFunctions && typeof value === \"function\") {\n let result = value.apply(scope2, params);\n if (result instanceof Promise) {\n result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value));\n } else {\n receiver(result);\n }\n } else if (typeof value === \"object\" && value instanceof Promise) {\n value.then((i) => receiver(i));\n } else {\n receiver(value);\n }\n}\n\n// packages/alpinejs/src/directives.js\nvar prefixAsString = \"x-\";\nfunction prefix(subject = \"\") {\n return prefixAsString + subject;\n}\nfunction setPrefix(newPrefix) {\n prefixAsString = newPrefix;\n}\nvar directiveHandlers = {};\nfunction directive(name, callback) {\n directiveHandlers[name] = callback;\n return {\n before(directive2) {\n if (!directiveHandlers[directive2]) {\n console.warn(String.raw`Cannot find directive \\`${directive2}\\`. \\`${name}\\` will use the default order of execution`);\n return;\n }\n const pos = directiveOrder.indexOf(directive2);\n directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf(\"DEFAULT\"), 0, name);\n }\n };\n}\nfunction directiveExists(name) {\n return Object.keys(directiveHandlers).includes(name);\n}\nfunction directives(el, attributes, originalAttributeOverride) {\n attributes = Array.from(attributes);\n if (el._x_virtualDirectives) {\n let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value }));\n let staticAttributes = attributesOnly(vAttributes);\n vAttributes = vAttributes.map((attribute) => {\n if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n return {\n name: `x-bind:${attribute.name}`,\n value: `\"${attribute.value}\"`\n };\n }\n return attribute;\n });\n attributes = attributes.concat(vAttributes);\n }\n let transformedAttributeMap = {};\n let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);\n return directives2.map((directive2) => {\n return getDirectiveHandler(el, directive2);\n });\n}\nfunction attributesOnly(attributes) {\n return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));\n}\nvar isDeferringHandlers = false;\nvar directiveHandlerStacks = /* @__PURE__ */ new Map();\nvar currentHandlerStackKey = Symbol();\nfunction deferHandlingDirectives(callback) {\n isDeferringHandlers = true;\n let key = Symbol();\n currentHandlerStackKey = key;\n directiveHandlerStacks.set(key, []);\n let flushHandlers = () => {\n while (directiveHandlerStacks.get(key).length)\n directiveHandlerStacks.get(key).shift()();\n directiveHandlerStacks.delete(key);\n };\n let stopDeferring = () => {\n isDeferringHandlers = false;\n flushHandlers();\n };\n callback(flushHandlers);\n stopDeferring();\n}\nfunction getElementBoundUtilities(el) {\n let cleanups = [];\n let cleanup = (callback) => cleanups.push(callback);\n let [effect3, cleanupEffect] = elementBoundEffect(el);\n cleanups.push(cleanupEffect);\n let utilities = {\n Alpine: alpine_default,\n effect: effect3,\n cleanup,\n evaluateLater: evaluateLater.bind(evaluateLater, el),\n evaluate: evaluate.bind(evaluate, el)\n };\n let doCleanup = () => cleanups.forEach((i) => i());\n return [utilities, doCleanup];\n}\nfunction getDirectiveHandler(el, directive2) {\n let noop = () => {\n };\n let handler4 = directiveHandlers[directive2.type] || noop;\n let [utilities, cleanup] = getElementBoundUtilities(el);\n onAttributeRemoved(el, directive2.original, cleanup);\n let fullHandler = () => {\n if (el._x_ignore || el._x_ignoreSelf)\n return;\n handler4.inline && handler4.inline(el, directive2, utilities);\n handler4 = handler4.bind(handler4, el, directive2, utilities);\n isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4();\n };\n fullHandler.runCleanups = cleanup;\n return fullHandler;\n}\nvar startingWith = (subject, replacement) => ({ name, value }) => {\n if (name.startsWith(subject))\n name = name.replace(subject, replacement);\n return { name, value };\n};\nvar into = (i) => i;\nfunction toTransformedAttributes(callback = () => {\n}) {\n return ({ name, value }) => {\n let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => {\n return transform(carry);\n }, { name, value });\n if (newName !== name)\n callback(newName, name);\n return { name: newName, value: newValue };\n };\n}\nvar attributeTransformers = [];\nfunction mapAttributes(callback) {\n attributeTransformers.push(callback);\n}\nfunction outNonAlpineAttributes({ name }) {\n return alpineAttributeRegex().test(name);\n}\nvar alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\\\b`);\nfunction toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {\n return ({ name, value }) => {\n let typeMatch = name.match(alpineAttributeRegex());\n let valueMatch = name.match(/:([a-zA-Z0-9\\-_:]+)/);\n let modifiers = name.match(/\\.[^.\\]]+(?=[^\\]]*$)/g) || [];\n let original = originalAttributeOverride || transformedAttributeMap[name] || name;\n return {\n type: typeMatch ? typeMatch[1] : null,\n value: valueMatch ? valueMatch[1] : null,\n modifiers: modifiers.map((i) => i.replace(\".\", \"\")),\n expression: value,\n original\n };\n };\n}\nvar DEFAULT = \"DEFAULT\";\nvar directiveOrder = [\n \"ignore\",\n \"ref\",\n \"data\",\n \"id\",\n \"anchor\",\n \"bind\",\n \"init\",\n \"for\",\n \"model\",\n \"modelable\",\n \"transition\",\n \"show\",\n \"if\",\n DEFAULT,\n \"teleport\"\n];\nfunction byPriority(a, b) {\n let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;\n let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;\n return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);\n}\n\n// packages/alpinejs/src/utils/dispatch.js\nfunction dispatch(el, name, detail = {}) {\n el.dispatchEvent(\n new CustomEvent(name, {\n detail,\n bubbles: true,\n // Allows events to pass the shadow DOM barrier.\n composed: true,\n cancelable: true\n })\n );\n}\n\n// packages/alpinejs/src/utils/walk.js\nfunction walk(el, callback) {\n if (typeof ShadowRoot === \"function\" && el instanceof ShadowRoot) {\n Array.from(el.children).forEach((el2) => walk(el2, callback));\n return;\n }\n let skip = false;\n callback(el, () => skip = true);\n if (skip)\n return;\n let node = el.firstElementChild;\n while (node) {\n walk(node, callback, false);\n node = node.nextElementSibling;\n }\n}\n\n// packages/alpinejs/src/utils/warn.js\nfunction warn(message, ...args) {\n console.warn(`Alpine Warning: ${message}`, ...args);\n}\n\n// packages/alpinejs/src/lifecycle.js\nvar started = false;\nfunction start() {\n if (started)\n warn(\"Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.\");\n started = true;\n if (!document.body)\n warn(\"Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's ` Go to second page (outside) {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/test-navigate-asset.js000064400000000171152665372570022453 0ustar00 if (! window._lw_dusk_asset_count) { window._lw_dusk_asset_count = 1 } else { window._lw_dusk_asset_count++ } livewire/src/Features/SupportNavigate/test-views/navbar-sidebar.blade.php000064400000006330152665372570022667 0ustar00 Document
@persist('nav') @endpersist
{{ $slot }}
livewire/src/Features/SupportNavigate/test-views/tracked-layout.blade.php000064400000000336152665372570022737 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/layout-with-noscript.blade.php000064400000000457152665372570024140 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/html-attributes1.blade.php000064400000000364152665372570023221 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/layout.blade.php000064400000000312152665372570021316 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/html-attributes2.blade.php000064400000000364152665372570023222 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/changed-tracked-layout.blade.php000064400000000336152665372570024326 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNavigate/test-views/changed-layout.blade.php000064400000000312152665372570022705 0ustar00 {{ $slot }} @stack('scripts') livewire/src/Features/SupportNestedComponentListeners/SupportNestedComponentListeners.php000064400000004063152665372570026463 0ustar00 $value) { if (str($key)->startsWith('@')) { // any kebab-cased parameters passed in will have been converted to camelCase // so we need to convert back to kebab to ensure events are valid in html $fullEvent = str($key)->after('@')->kebab(); $attributeKey = 'x-on:'.$fullEvent; $attributeValue = "\$wire.\$parent.".$value; store($this->component)->push('attributes', $attributeValue, $attributeKey); } } } public function render($view, $data) { return function ($html, $replaceHtml) { $attributes = store($this->component)->get('attributes', false); if (! $attributes) return; $replaceHtml(Utils::insertAttributesIntoHtmlRoot($html, $attributes)); }; } public function dehydrate($context) { $attributes = store($this->component)->get('attributes', false); if (! $attributes) return; $attributes && $context->addMemo('attributes', $attributes); } public function hydrate($memo) { if (! isset($memo['attributes'])) return; $attributes = $memo['attributes']; // Store the attributes for later dehydration... store($this->component)->set('attributes', $attributes); } } livewire/src/Features/SupportReactiveProps/BaseReactive.php000064400000002302152665372570020207 0ustar00getName(); store($this->component)->push('reactiveProps', $property); $this->originalValueHash = crc32(json_encode($this->getValue())); } public function hydrate() { if (SupportReactiveProps::hasPassedInProps($this->component->getId())) { $updatedValue = SupportReactiveProps::getPassedInProp( $this->component->getId(), $this->getName() ); $this->setValue($updatedValue); } $this->originalValueHash = crc32(json_encode($this->getValue())); } public function dehydrate($context) { if ($this->originalValueHash !== crc32(json_encode($this->getValue()))) { throw new CannotMutateReactivePropException($this->component->getName(), $this->getName()); } $context->pushMemo('props', $this->getName()); } } livewire/src/Features/SupportReactiveProps/SupportReactiveProps.php000064400000001325152665372570022041 0ustar00 static::$pendingChildParams = []); on('mount.stub', function ($tag, $id, $params, $parent, $key) { static::$pendingChildParams[$id] = $params; }); } static function hasPassedInProps($id) { return isset(static::$pendingChildParams[$id]); } static function getPassedInProp($id, $name) { $params = static::$pendingChildParams[$id] ?? []; return $params[$name] ?? null; } } livewire/src/Features/SupportReactiveProps/CannotMutateReactivePropException.php000064400000000463152665372570024465 0ustar00component); if (! in_array($name, $names)) { throw new EventHandlerDoesNotExist($name); } $method = static::getListenerMethodName($this->component, $name); $returnEarly( wrap($this->component)->$method(...$params) ); // Here we have to manually check to see if the event listener method // is "renderless" as it's normal "call" hook doesn't get run when // the method is called as an event listener... $isRenderless = $this->component->getAttributes() ->filter(fn ($i) => is_subclass_of($i, BaseRenderless::class)) ->filter(fn ($i) => $i->getName() === $method) ->filter(fn ($i) => $i->getLevel() === AttributeLevel::METHOD) ->count() > 0; if ($isRenderless) $this->component->skipRender(); } } function dehydrate($context) { if ($context->mounting) { $listeners = static::getListenerEventNames($this->component); $listeners && $context->addEffect('listeners', $listeners); } $dispatches = $this->getServerDispatchedEvents($this->component); $dispatches && $context->addEffect('dispatches', $dispatches); } static function getListenerEventNames($component) { $listeners = static::getComponentListeners($component); return collect($listeners) ->map(fn ($value, $key) => is_numeric($key) ? $value : $key) ->values() ->toArray(); } static function getListenerMethodName($component, $name) { $listeners = static::getComponentListeners($component); foreach ($listeners as $event => $method) { if (is_numeric($event)) $event = $method; if ($name === $event) return $method; } throw new \Exception('Event method not found'); } static function getComponentListeners($component) { $fromClass = invade($component)->getListeners(); $fromAttributes = store($component)->get('listenersFromAttributes', []); $listeners = array_merge($fromClass, $fromAttributes); return static::replaceDynamicEventNamePlaceholders($listeners, $component); } function getServerDispatchedEvents($component) { return collect(store($component)->get('dispatched', [])) ->map(fn ($event) => $event->serialize()) ->toArray(); } static function replaceDynamicEventNamePlaceholders($listeners, $component) { foreach ($listeners as $event => $method) { if (is_numeric($event)) continue; $replaced = static::replaceDynamicPlaceholders($event, $component); unset($listeners[$event]); $listeners[$replaced] = $method; } return $listeners; } static function replaceDynamicPlaceholders($event, $component) { return preg_replace_callback('/\{(.*)\}/U', function ($matches) use ($component) { return data_get($component, $matches[1], function () use ($matches) { throw new \Exception('Unable to evaluate dynamic event name placeholder: '.$matches[0]); }); }, $event); } } livewire/src/Features/SupportEvents/BaseOn.php000064400000001223152665372570015500 0ustar00event) as $event) { store($this->component)->push( 'listenersFromAttributes', $this->getName() ?? '$refresh', $event, ); } } } livewire/src/Features/SupportEvents/HandlesEvents.php000064400000000616152665372570017101 0ustar00listeners; } public function dispatch($event, ...$params) { $event = new Event($event, $params); store($this)->push('dispatched', $event); return $event; } } livewire/src/Features/SupportEvents/fake-echo.js000064400000004073152665372570016006 0ustar00 window.fakeEchoListeners = [] class FakeChannel { constructor(channel) { this.channel = channel this.type = 'public' } listen(eventName, callback) { window.fakeEchoListeners.push({ channel: this.channel, event: eventName, type: this.type, callback, }) return this } stopListening(eventName, callback) { window.fakeEchoListeners = window.fakeEchoListeners.filter(i => { if (callback) { return ! (i.event === eventName && i.callback === callback) } return ! (i.event === eventName) }) return this } } class FakePrivateChannel extends FakeChannel { constructor(channel) { super(channel) this.type = 'private' } whisper(eventName, data) { return this } } class FakePresenceChannel extends FakeChannel { constructor(channel) { super(channel) this.type = 'presence' } here(callback) { return this } joining(callback) { return this } whisper(eventName, data) { return this } leaving(callback) { return this } } class FakeEcho { join(channel) { return new FakePresenceChannel(channel); } channel(channel) { return new FakeChannel(channel); } private(channel) { return new FakePrivateChannel(channel); } encryptedPrivate(channel) { return new FakePrivateChannel(channel); } socketId() { return 'fake-socked-id' } // For dusk to trigger listeners... fakeTrigger({ channel, event, type, payload = {} }) { window.fakeEchoListeners.filter(listener => { if (event !== listener.event) return false if (channel !== listener.channel) return false if (type !== undefined && type !== listener.type) return false return true }).forEach(({ callback }) => { callback(payload) }) } } window.Echo = new FakeEcho livewire/src/Features/SupportEvents/TestsEvents.php000064400000005504152665372570016626 0ustar00call('__dispatch', $event, $parameters); } public function fireEvent($event, ...$parameters) { return $this->dispatch($event, ...$parameters); } public function assertDispatched($event, ...$params) { $result = $this->testDispatched($event, $params); PHPUnit::assertTrue($result['test'], "Failed asserting that an event [{$event}] was fired{$result['assertionSuffix']}"); return $this; } public function assertNotDispatched($event, ...$params) { $result = $this->testDispatched($event, $params); PHPUnit::assertFalse($result['test'], "Failed asserting that an event [{$event}] was not fired{$result['assertionSuffix']}"); return $this; } public function assertDispatchedTo($target, $event, ...$params) { $this->assertDispatched($event, ...$params); $result = $this->testDispatchedTo($target, $event); PHPUnit::assertTrue($result, "Failed asserting that an event [{$event}] was fired to {$target}."); return $this; } protected function testDispatched($value, $params) { $assertionSuffix = '.'; if (empty($params)) { $test = collect(data_get($this->effects, 'dispatches'))->contains('name', '=', $value); } elseif (isset($params[0]) && ! is_string($params[0]) && is_callable($params[0])) { $event = collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($value) { return $item['name'] === $value; }); $test = $event && $params[0]($event['name'], $event['params']); } else { $test = (bool) collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($value, $params) { $commonParams = array_intersect_key($item['params'], $params); ksort($commonParams); ksort($params); return $item['name'] === $value && $commonParams === $params; }); $encodedParams = json_encode($params); $assertionSuffix = " with parameters: {$encodedParams}"; } return [ 'test' => $test, 'assertionSuffix' => $assertionSuffix, ]; } protected function testDispatchedTo($target, $value) { $name = app(ComponentRegistry::class)->getName($target); return (bool) collect(data_get($this->effects, 'dispatches'))->first(function ($item) use ($name, $value) { return $item['name'] === $value && $item['to'] === $name; }); } } livewire/src/Features/SupportEvents/Event.php000064400000001647152665372570015424 0ustar00name = $name; $this->params = $params; } public function self() { $this->self = true; return $this; } public function component($name) { $this->component = $name; return $this; } public function to($name) { return $this->component($name); } public function serialize() { $output = [ 'name' => $this->name, 'params' => $this->params, ]; if ($this->self) $output['self'] = true; if ($this->component) $output['to'] = app(ComponentRegistry::class)->getName($this->component); return $output; } } livewire/src/Features/SupportModels/SupportModels.php000064400000000456152665372570017137 0ustar00propertySynthesizer([ ModelSynth::class, EloquentCollectionSynth::class, ]); } } livewire/src/Features/SupportModels/EloquentCollectionSynth.php000064400000005355152665372570021160 0ustar00getQueueableClass(); /** * `getQueueableClass` above checks all models are the same and * then returns the class. We then instantiate a model object * so we can call `getMorphClass()` on it. * * If no alias is found, this just returns the class name */ $modelAlias = $modelClass ? (new $modelClass)->getMorphClass() : null; $meta = []; $serializedCollection = (array) $this->getSerializedPropertyValue($target); $meta['keys'] = $serializedCollection['id']; $meta['class'] = $class; $meta['modelClass'] = $modelAlias; return [ null, $meta ]; } function hydrate($data, $meta, $hydrateChild) { $class = $meta['class']; $modelClass = $meta['modelClass']; // If no alias found, this returns `null` $modelAlias = Relation::getMorphedModel($modelClass); if (! is_null($modelAlias)) { $modelClass = $modelAlias; } $keys = $meta['keys'] ?? []; if (count($keys) === 0) { return new $class(); } // We are using Laravel's method here for restoring the collection, which ensures // that all models in the collection are restored in one query, preventing n+1 // issues and also only restores models that exist. $collection = (new $modelClass)->newQueryForRestoration($keys)->useWritePdo()->get(); $collection = $collection->keyBy->getKey(); return new $meta['class']( collect($meta['keys'])->map(function ($id) use ($collection) { return $collection[$id] ?? null; })->filter() ); } function get(&$target, $key) { throw new \Exception('Can\'t access model properties directly'); } function set(&$target, $key, $value, $pathThusFar, $fullPath) { throw new \Exception('Can\'t set model properties directly'); } function call($target, $method, $params, $addEffect) { throw new \Exception('Can\'t call model methods directly'); } }livewire/src/Features/SupportModels/ModelSynth.php000064400000004422152665372570016402 0ustar00getMorphClass(); } catch (ClassMorphViolationException $e) { // If the model is not using morph classes, this exception is thrown $alias = $class; } $serializedModel = $target->exists ? (array) $this->getSerializedPropertyValue($target) : null; $meta = ['class' => $alias]; // If the model doesn't exist as it's an empty model or has been // recently deleted, then we don't want to include any key. if ($serializedModel) $meta['key'] = $serializedModel['id']; return [ null, $meta, ]; } function hydrate($data, $meta) { $class = $meta['class']; // If no alias found, this returns `null` $aliasClass = Relation::getMorphedModel($class); if (! is_null($aliasClass)) { $class = $aliasClass; } // If no key is provided then an empty model is returned if (! array_key_exists('key', $meta)) { return new $class; } $key = $meta['key']; $model = (new $class)->newQueryForRestoration($key)->useWritePdo()->firstOrFail(); return $model; } function get(&$target, $key) { throw new \Exception('Can\'t access model properties directly'); } function set(&$target, $key, $value, $pathThusFar, $fullPath) { throw new \Exception('Can\'t set model properties directly'); } function call($target, $method, $params, $addEffect) { throw new \Exception('Can\'t call model methods directly'); } } livewire/src/LivewireServiceProvider.php000064400000011625152665372570014543 0ustar00registerLivewireSingleton(); $this->registerConfig(); $this->bootEventBus(); $this->registerMechanisms(); } public function boot() { $this->bootMechanisms(); $this->bootFeatures(); } protected function registerLivewireSingleton() { $this->app->alias(LivewireManager::class, 'livewire'); $this->app->singleton(LivewireManager::class); app('livewire')->setProvider($this); } protected function registerConfig() { $config = __DIR__.'/../config/livewire.php'; $this->publishes([$config => base_path('config/livewire.php')], ['livewire', 'livewire:config']); $this->mergeConfigFrom($config, 'livewire'); } protected function bootEventBus() { app(EventBus::class)->boot(); } protected function getMechanisms() { return [ Mechanisms\PersistentMiddleware\PersistentMiddleware::class, Mechanisms\HandleComponents\HandleComponents::class, Mechanisms\HandleRequests\HandleRequests::class, Mechanisms\FrontendAssets\FrontendAssets::class, Mechanisms\ExtendBlade\ExtendBlade::class, Mechanisms\CompileLivewireTags\CompileLivewireTags::class, Mechanisms\ComponentRegistry::class, Mechanisms\RenderComponent::class, Mechanisms\DataStore::class, ]; } protected function registerMechanisms() { foreach ($this->getMechanisms() as $mechanism) { app($mechanism)->register(); } } protected function bootMechanisms() { if (class_exists(AboutCommand::class) && class_exists(InstalledVersions::class)) { AboutCommand::add('Livewire', [ 'Livewire' => InstalledVersions::getPrettyVersion('livewire/livewire'), ]); } foreach ($this->getMechanisms() as $mechanism) { app($mechanism)->boot(); } } protected function bootFeatures() { foreach([ Features\SupportWireModelingNestedComponents\SupportWireModelingNestedComponents::class, Features\SupportMultipleRootElementDetection\SupportMultipleRootElementDetection::class, Features\SupportDisablingBackButtonCache\SupportDisablingBackButtonCache::class, Features\SupportNestedComponentListeners\SupportNestedComponentListeners::class, Features\SupportMorphAwareIfStatement\SupportMorphAwareIfStatement::class, Features\SupportAutoInjectedAssets\SupportAutoInjectedAssets::class, Features\SupportComputed\SupportLegacyComputedPropertySyntax::class, Features\SupportNestingComponents\SupportNestingComponents::class, Features\SupportScriptsAndAssets\SupportScriptsAndAssets::class, Features\SupportBladeAttributes\SupportBladeAttributes::class, Features\SupportConsoleCommands\SupportConsoleCommands::class, Features\SupportPageComponents\SupportPageComponents::class, Features\SupportReactiveProps\SupportReactiveProps::class, Features\SupportFileDownloads\SupportFileDownloads::class, Features\SupportJsEvaluation\SupportJsEvaluation::class, Features\SupportQueryString\SupportQueryString::class, Features\SupportFileUploads\SupportFileUploads::class, Features\SupportTeleporting\SupportTeleporting::class, Features\SupportLazyLoading\SupportLazyLoading::class, Features\SupportFormObjects\SupportFormObjects::class, Features\SupportAttributes\SupportAttributes::class, Features\SupportPagination\SupportPagination::class, Features\SupportValidation\SupportValidation::class, Features\SupportIsolating\SupportIsolating::class, Features\SupportRedirects\SupportRedirects::class, Features\SupportStreaming\SupportStreaming::class, Features\SupportNavigate\SupportNavigate::class, Features\SupportEntangle\SupportEntangle::class, Features\SupportLocales\SupportLocales::class, Features\SupportTesting\SupportTesting::class, Features\SupportModels\SupportModels::class, Features\SupportEvents\SupportEvents::class, // Some features we want to have priority over others... Features\SupportLifecycleHooks\SupportLifecycleHooks::class, Features\SupportLegacyModels\SupportLegacyModels::class, Features\SupportWireables\SupportWireables::class, ] as $feature) { app('livewire')->componentHook($feature); } ComponentHookRegistry::boot(); } } livewire/src/Mechanisms/ComponentRegistry.php000064400000014440152665372570015501 0ustar00nonAliasedClasses[] = $name; } else { $this->aliases[$name] = $class; } } function new($nameOrClass, $id = null) { [$class, $name] = $this->getNameAndClass($nameOrClass); $component = new $class; $component->setId($id ?: str()->random(20)); $component->setName($name); // // Parameters passed in automatically set public properties by the same name... // foreach ($params as $key => $value) { // if (! property_exists($component, $key)) continue; // // Typed properties shouldn't be set back to "null". It will throw an error... // if ((new \ReflectionProperty($component, $key))->getType() && is_null($value)) continue; // $component->$key = $value; // } return $component; } function isDiscoverable($classOrName) { if (is_object($classOrName)) { $classOrName = get_class($classOrName); } if (class_exists($name = $classOrName)) { $name = $this->generateNameFromClass($classOrName); } $class = $this->generateClassFromName($name); if (is_subclass_of($class, Component::class)) { return true; } return false; } function getName($nameOrClassOrComponent) { [$class, $name] = $this->getNameAndClass($nameOrClassOrComponent); return $name; } function getClass($nameOrClassOrComponent) { [$class, $name] = $this->getNameAndClass($nameOrClassOrComponent); return $class; } function resolveMissingComponent($resolver) { $this->missingComponentResolvers[] = $resolver; } protected function getNameAndClass($nameComponentOrClass) { // If a component itself was passed in, just take the class name... $nameOrClass = is_object($nameComponentOrClass) ? $nameComponentOrClass::class : $nameComponentOrClass; // If a component class was passed in, use that... if (is_subclass_of($nameOrClass, Component::class)) { $class = $nameOrClass; // Otherwise, assume it was a simple name... } else { $class = $this->nameToClass($nameOrClass); // If class can't be found, see if there is an index component in a subfolder... if(! class_exists($class)) { $class = $class . '\\Index'; } if(! class_exists($class)) { foreach ($this->missingComponentResolvers as $resolve) { if ($resolved = $resolve($nameOrClass)) { $this->component($nameOrClass, $resolved); $class = $this->aliases[$nameOrClass]; break; } } } } // Now that we have a class, we can check that it's actually a Livewire component... if (! is_subclass_of($class, Component::class)) { throw new ComponentNotFoundException( "Unable to find component: [{$nameOrClass}]" ); } // Convert it to a name even if a name was passed in to make sure we're using deterministic names... $name = $this->classToName($class); return [$class, $name]; } protected function nameToClass($name) { // Check the aliases... if (isset($this->aliases[$name])) { if (is_object($this->aliases[$name])) return $this->aliases[$name]::class; return $this->aliases[$name]; } // Hash check the non-aliased classes... foreach ($this->nonAliasedClasses as $class) { if (crc32($class) === $name) { return $class; } } // Reverse generate a class from a name... return $this->generateClassFromName($name); } protected function classToName($class) { // Check the aliases... $resolvedAliases = array_map(fn ($i) => is_object($i) ? get_class($i) : $i, $this->aliases); if ($name = array_search($class, $resolvedAliases)) return $name; // Check existance in non-aliased classes and hash... foreach ($this->nonAliasedClasses as $oneOff) { if (crc32($oneOff) === $hash = crc32($class)) { return $hash; } } // Generate name from class... return $this->generateNameFromClass($class); } protected function generateClassFromName($name) { $rootNamespace = config('livewire.class_namespace'); $class = collect(str($name)->explode('.')) ->map(fn ($segment) => (string) str($segment)->studly()) ->join('\\'); if (empty($rootNamespace)) { return $class; } return '\\' . $rootNamespace . '\\' . $class; } protected function generateNameFromClass($class) { $namespace = str_replace( ['/', '\\'], '.', trim(trim(config('livewire.class_namespace')), '\\') ); $class = str_replace( ['/', '\\'], '.', trim(trim($class, '/'), '\\') ); $namespace = collect(explode('.', $namespace)) ->map(fn ($i) => \Illuminate\Support\Str::kebab($i)) ->implode('.'); $fullName = str(collect(explode('.', $class)) ->map(fn ($i) => \Illuminate\Support\Str::kebab($i)) ->implode('.')); if ($fullName->startsWith('.')) { $fullName = $fullName->substr(1); } // If using an index component in a sub folder, remove the '.index' so the name is the subfolder name... if ($fullName->endsWith('.index')) { $fullName = $fullName->replaceLast('.index', ''); } if ($fullName->startsWith($namespace)) { return (string) $fullName->substr(strlen($namespace) + 1); } return (string) $fullName; } } livewire/src/Mechanisms/HandleComponents/Synthesizers/IntSynth.php000064400000001071152665372570021535 0ustar00 $child) { $target[$key] = $dehydrateChild($key, $child); } return [$target, []]; } function hydrate($value, $meta, $hydrateChild) { // If we are "hydrating" a value about to be used in an update, // Let's make sure it's actually an array before try to set it. // This is most common in the case of "__rm__" values, but also // applies to any non-array value... if (! is_array($value)) { return $value; } foreach ($value as $key => $child) { $value[$key] = $hydrateChild($key, $child); } return $value; } function set(&$target, $key, $value) { $target[$key] = $value; } function unset(&$target, $key) { unset($target[$key]); } } livewire/src/Mechanisms/HandleComponents/Synthesizers/CollectionSynth.php000064400000002465152665372570023106 0ustar00all(); foreach ($data as $key => $child) { $data[$key] = $dehydrateChild($key, $child); } return [ $data, ['class' => get_class($target)] ]; } function hydrate($value, $meta, $hydrateChild) { foreach ($value as $key => $child) { $value[$key] = $hydrateChild($key, $child); } return new $meta['class']($value); } function &get(&$target, $key) { // We need this "$reader" callback to get a reference to // the items property inside collections. Otherwise, // we'd receive a copy instead of the reference. $reader = function & ($object, $property) { $value = & \Closure::bind(function & () use ($property) { return $this->$property; }, $object, $object)->__invoke(); return $value; }; $items =& $reader($target, 'items'); return $items[$key]; } } livewire/src/Mechanisms/HandleComponents/Synthesizers/FloatSynth.php000064400000001105152665372570022046 0ustar00 $child) { $data[$key] = $dehydrateChild($key, $child); } return [$data, []]; } function hydrate($value, $meta, $hydrateChild) { $obj = new stdClass; foreach ($value as $key => $child) { $obj->$key = $hydrateChild($key, $child); } return $obj; } function set(&$target, $key, $value) { $target->$key = $value; } } livewire/src/Mechanisms/HandleComponents/Synthesizers/CarbonSynth.php000064400000002466152665372570022220 0ustar00 DateTime::class, 'nativeImmutable' => DateTimeImmutable::class, 'carbon' => Carbon::class, 'carbonImmutable' => CarbonImmutable::class, 'illuminate' => \Illuminate\Support\Carbon::class, ]; public static $key = 'cbn'; static function match($target) { foreach (static::$types as $type => $class) { if ($target instanceof $class) return true; } return false; } static function matchByType($type) { return is_subclass_of($type, DateTimeInterface::class); } function dehydrate($target) { return [ $target->format(DateTimeInterface::ATOM), ['type' => array_search(get_class($target), static::$types)], ]; } static function hydrateFromType($type, $value) { if ($value === '' || $value === null) return null; return new $type($value); } function hydrate($value, $meta) { if ($value === '' || $value === null) return null; return new static::$types[$meta['type']]($value); } } livewire/src/Mechanisms/HandleComponents/Synthesizers/StringableSynth.php000064400000000642152665372570023100 0ustar00__toString(), []]; } function hydrate($value) { return str($value); } } livewire/src/Mechanisms/HandleComponents/Synthesizers/EnumSynth.php000064400000001451152665372570021711 0ustar00value, ['class' => get_class($target)] ]; } function hydrate($value, $meta) { if ($value === null || $value === '') return null; $class = $meta['class']; return $class::from($value); } } livewire/src/Mechanisms/HandleComponents/Synthesizers/Synth.php000064400000003403152665372570021063 0ustar00$key; } function __call($method, $params) { if ($method === 'dehydrate') { throw new \Exception('You must define a "dehydrate" method'); } if ($method === 'hydrate') { throw new \Exception('You must define a "hydrate" method'); } if ($method === 'hydrateFromType') { throw new \Exception('You must define a "hydrateFromType" method'); } if ($method === 'get') { throw new \Exception('This synth doesn\'t support getting properties: '.get_class($this)); } if ($method === 'set') { throw new \Exception('This synth doesn\'t support setting properties: '.get_class($this)); } if ($method === 'unset') { throw new \Exception('This synth doesn\'t support unsetting properties: '.get_class($this)); } if ($method === 'call') { throw new \Exception('This synth doesn\'t support calling methods: '.get_class($this)); } } } livewire/src/Mechanisms/HandleComponents/HandleComponents.php000064400000044625152665372570020520 0ustar00propertySynthesizers, $class); } } public function mount($name, $params = [], $key = null) { $parent = app('livewire')->current(); if ($html = $this->shortCircuitMount($name, $params, $key, $parent)) return $html; $component = app('livewire')->new($name); $this->pushOntoComponentStack($component); $context = new ComponentContext($component, mounting: true); if (config('app.debug')) $start = microtime(true); $finish = trigger('mount', $component, $params, $key, $parent); if (config('app.debug')) trigger('profile', 'mount', $component->getId(), [$start, microtime(true)]); if (config('app.debug')) $start = microtime(true); $html = $this->render($component, '
'); if (config('app.debug')) trigger('profile', 'render', $component->getId(), [$start, microtime(true)]); if (config('app.debug')) $start = microtime(true); trigger('dehydrate', $component, $context); $snapshot = $this->snapshot($component, $context); if (config('app.debug')) trigger('profile', 'dehydrate', $component->getId(), [$start, microtime(true)]); trigger('destroy', $component, $context); $html = Utils::insertAttributesIntoHtmlRoot($html, [ 'wire:snapshot' => $snapshot, 'wire:effects' => $context->effects, ]); $this->popOffComponentStack(); return $finish($html, $snapshot); } protected function shortCircuitMount($name, $params, $key, $parent) { $newHtml = null; trigger('pre-mount', $name, $params, $key, $parent, function ($html) use (&$newHtml) { $newHtml = $html; }); return $newHtml; } public function update($snapshot, $updates, $calls) { $data = $snapshot['data']; $memo = $snapshot['memo']; if (config('app.debug')) $start = microtime(true); [ $component, $context ] = $this->fromSnapshot($snapshot); $this->pushOntoComponentStack($component); trigger('hydrate', $component, $memo, $context); $this->updateProperties($component, $updates, $data, $context); if (config('app.debug')) trigger('profile', 'hydrate', $component->getId(), [$start, microtime(true)]); $this->callMethods($component, $calls, $context); if (config('app.debug')) $start = microtime(true); if ($html = $this->render($component)) { $context->addEffect('html', $html); if (config('app.debug')) trigger('profile', 'render', $component->getId(), [$start, microtime(true)]); } if (config('app.debug')) $start = microtime(true); trigger('dehydrate', $component, $context); $snapshot = $this->snapshot($component, $context); if (config('app.debug')) trigger('profile', 'dehydrate', $component->getId(), [$start, microtime(true)]); trigger('destroy', $component, $context); $this->popOffComponentStack(); return [ $snapshot, $context->effects ]; } public function fromSnapshot($snapshot) { Checksum::verify($snapshot); trigger('snapshot-verified', $snapshot); $data = $snapshot['data']; $name = $snapshot['memo']['name']; $id = $snapshot['memo']['id']; $component = app('livewire')->new($name, id: $id); $context = new ComponentContext($component); $this->hydrateProperties($component, $data, $context); return [ $component, $context ]; } public function snapshot($component, $context = null) { $context ??= new ComponentContext($component); $data = $this->dehydrateProperties($component, $context); $snapshot = [ 'data' => $data, 'memo' => [ 'id' => $component->getId(), 'name' => $component->getName(), ...$context->memo, ], ]; $snapshot['checksum'] = Checksum::generate($snapshot); return $snapshot; } protected function dehydrateProperties($component, $context) { $data = Utils::getPublicPropertiesDefinedOnSubclass($component); foreach ($data as $key => $value) { $data[$key] = $this->dehydrate($value, $context, $key); } return $data; } protected function dehydrate($target, $context, $path) { if (Utils::isAPrimitive($target)) return $target; $synth = $this->propertySynth($target, $context, $path); [ $data, $meta ] = $synth->dehydrate($target, function ($name, $child) use ($context, $path) { return $this->dehydrate($child, $context, "{$path}.{$name}"); }); $meta['s'] = $synth::getKey(); return [ $data, $meta ]; } protected function hydrateProperties($component, $data, $context) { foreach ($data as $key => $value) { if (! property_exists($component, $key)) continue; $child = $this->hydrate($value, $context, $key); // Typed properties shouldn't be set back to "null". It will throw an error... if ((new \ReflectionProperty($component, $key))->getType() && is_null($child)) continue; $component->$key = $child; } } protected function hydrate($valueOrTuple, $context, $path) { if (! Utils::isSyntheticTuple($value = $tuple = $valueOrTuple)) return $value; [$value, $meta] = $tuple; // Nested properties get set as `__rm__` when they are removed. We don't want to hydrate these. if ($this->isRemoval($value) && str($path)->contains('.')) { return $value; } $synth = $this->propertySynth($meta['s'], $context, $path); return $synth->hydrate($value, $meta, function ($name, $child) use ($context, $path) { return $this->hydrate($child, $context, "{$path}.{$name}"); }); } protected function hydratePropertyUpdate($valueOrTuple, $context, $path, $raw) { if (! Utils::isSyntheticTuple($value = $tuple = $valueOrTuple)) return $value; [$value, $meta] = $tuple; // Nested properties get set as `__rm__` when they are removed. We don't want to hydrate these. if ($this->isRemoval($value) && str($path)->contains('.')) { return $value; } $synth = $this->propertySynth($meta['s'], $context, $path); return $synth->hydrate($value, $meta, function ($name, $child) use ($context, $path, $raw) { return $this->hydrateForUpdate($raw, "{$path}.{$name}", $child, $context); }); } protected function render($component, $default = null) { if ($html = store($component)->get('skipRender', false)) { $html = value(is_string($html) ? $html : $default); if (! $html) return; return Utils::insertAttributesIntoHtmlRoot($html, [ 'wire:id' => $component->getId(), ]); } [ $view, $properties ] = $this->getView($component); return $this->trackInRenderStack($component, function () use ($component, $view, $properties) { $finish = trigger('render', $component, $view, $properties); $revertA = Utils::shareWithViews('__livewire', $component); $revertB = Utils::shareWithViews('_instance', $component); // @deprecated $viewContext = new ViewContext; $html = $view->render(function ($view) use ($viewContext) { // Extract leftover slots, sections, and pushes before they get flushed... $viewContext->extractFromEnvironment($view->getFactory()); }); $revertA(); $revertB(); $html = Utils::insertAttributesIntoHtmlRoot($html, [ 'wire:id' => $component->getId(), ]); $replaceHtml = function ($newHtml) use (&$html) { $html = $newHtml; }; $html = $finish($html, $replaceHtml, $viewContext); return $html; }); } protected function getView($component) { $viewPath = config('livewire.view_path', resource_path('views/livewire')); $dotName = $component->getName(); $fileName = str($dotName)->replace('.', '/')->__toString(); $viewOrString = method_exists($component, 'render') ? wrap($component)->render() : View::file($viewPath . '/' . $fileName . '.blade.php'); $properties = Utils::getPublicPropertiesDefinedOnSubclass($component); $view = Utils::generateBladeView($viewOrString, $properties); return [ $view, $properties ]; } protected function trackInRenderStack($component, $callback) { array_push(static::$renderStack, $component); return tap($callback(), function () { array_pop(static::$renderStack); }); } protected function updateProperties($component, $updates, $data, $context) { $finishes = []; foreach ($updates as $path => $value) { $value = $this->hydrateForUpdate($data, $path, $value, $context); // We only want to run "updated" hooks after all properties have // been updated so that each individual hook has the ability // to overwrite the updated states of other properties... $finishes[] = $this->updateProperty($component, $path, $value, $context); } foreach ($finishes as $finish) { $finish(); } } public function updateProperty($component, $path, $value, $context) { $segments = explode('.', $path); $property = array_shift($segments); $finish = trigger('update', $component, $path, $value); // Ensure that it's a public property, not on the base class first... if (! in_array($property, array_keys(Utils::getPublicPropertiesDefinedOnSubclass($component)))) { throw new PublicPropertyNotFoundException($property, $component->getName()); } // If this isn't a "deep" set, set it directly, otherwise we have to // recursively get up and set down the value through the synths... if (empty($segments)) { $this->setComponentPropertyAwareOfTypes($component, $property, $value); } else { $propertyValue = $component->$property; $this->setComponentPropertyAwareOfTypes($component, $property, $this->recursivelySetValue($property, $propertyValue, $value, $segments, 0, $context) ); } return $finish; } protected function hydrateForUpdate($raw, $path, $value, $context) { $meta = $this->getMetaForPath($raw, $path); // If we have meta data already for this property, let's use that to get a synth... if ($meta) { return $this->hydratePropertyUpdate([$value, $meta], $context, $path, $raw); } // If we don't, let's check to see if it's a typed property and fetch the synth that way... $parent = str($path)->contains('.') ? data_get($context->component, str($path)->beforeLast('.')->toString()) : $context->component; $childKey = str($path)->afterLast('.'); if ($parent && is_object($parent) && property_exists($parent, $childKey) && Utils::propertyIsTyped($parent, $childKey)) { $type = Utils::getProperty($parent, $childKey)->getType(); $types = $type instanceof ReflectionUnionType ? $type->getTypes() : [$type]; foreach ($types as $type) { $synth = $this->getSynthesizerByType($type->getName(), $context, $path); if ($synth) return $synth->hydrateFromType($type->getName(), $value); } } return $value; } protected function getMetaForPath($raw, $path) { $segments = explode('.', $path); $first = array_shift($segments); [$data, $meta] = Utils::isSyntheticTuple($raw) ? $raw : [$raw, null]; if ($path !== '') { $value = $data[$first] ?? null; return $this->getMetaForPath($value, implode('.', $segments)); } return $meta; } protected function recursivelySetValue($baseProperty, $target, $leafValue, $segments, $index = 0, $context = null) { $isLastSegment = count($segments) === $index + 1; $property = $segments[$index]; $path = implode('.', array_slice($segments, 0, $index + 1)); $synth = $this->propertySynth($target, $context, $path); if ($isLastSegment) { $toSet = $leafValue; } else { $propertyTarget = $synth->get($target, $property); // "$path" is a dot-notated key. This means we may need to drill // down and set a value on a deeply nested object. That object // may not exist, so let's find the first one that does... // Here's we've determined we're trying to set a deeply nested // value on an object/array that doesn't exist, so we need // to build up that non-existant nesting structure first. if ($propertyTarget === null) $propertyTarget = []; $toSet = $this->recursivelySetValue($baseProperty, $propertyTarget, $leafValue, $segments, $index + 1, $context); } $method = ($this->isRemoval($leafValue) && $isLastSegment) ? 'unset' : 'set'; $pathThusFar = collect([$baseProperty, ...$segments])->slice(0, $index + 1)->join('.'); $fullPath = collect([$baseProperty, ...$segments])->join('.'); $synth->$method($target, $property, $toSet, $pathThusFar, $fullPath); return $target; } protected function setComponentPropertyAwareOfTypes($component, $property, $value) { try { $component->$property = $value; } catch (\TypeError $e) { // If an "int" is being set to empty string, unset the property (making it null). // This is common in the case of `wire:model`ing an int to a text field... // If a value is being set to "null", do the same... if ($value === '' || $value === null) { unset($component->$property); } else { throw $e; } } } protected function callMethods($root, $calls, $context) { $returns = []; foreach ($calls as $idx => $call) { $method = $call['method']; $params = $call['params']; $earlyReturnCalled = false; $earlyReturn = null; $returnEarly = function ($return = null) use (&$earlyReturnCalled, &$earlyReturn) { $earlyReturnCalled = true; $earlyReturn = $return; }; $finish = trigger('call', $root, $method, $params, $context, $returnEarly); if ($earlyReturnCalled) { $returns[] = $finish($earlyReturn); continue; } $methods = Utils::getPublicMethodsDefinedBySubClass($root); // Also remove "render" from the list... $methods = array_values(array_diff($methods, ['render'])); // @todo: put this in a better place: $methods[] = '__dispatch'; if (! in_array($method, $methods)) { throw new MethodNotFoundException($method); } if (config('app.debug')) $start = microtime(true); $return = wrap($root)->{$method}(...$params); if (config('app.debug')) trigger('profile', 'call'.$idx, $root->getId(), [$start, microtime(true)]); $returns[] = $finish($return); } $context->addEffect('returns', $returns); } public function findSynth($keyOrTarget, $component): ?Synth { $context = new ComponentContext($component); try { return $this->propertySynth($keyOrTarget, $context, null); } catch (\Exception $e) { return null; } } public function propertySynth($keyOrTarget, $context, $path): Synth { return is_string($keyOrTarget) ? $this->getSynthesizerByKey($keyOrTarget, $context, $path) : $this->getSynthesizerByTarget($keyOrTarget, $context, $path); } protected function getSynthesizerByKey($key, $context, $path) { foreach ($this->propertySynthesizers as $synth) { if ($synth::getKey() === $key) { return new $synth($context, $path); } } throw new \Exception('No synthesizer found for key: "'.$key.'"'); } protected function getSynthesizerByTarget($target, $context, $path) { foreach ($this->propertySynthesizers as $synth) { if ($synth::match($target)) { return new $synth($context, $path); } } throw new \Exception('Property type not supported in Livewire for property: ['.json_encode($target).']'); } protected function getSynthesizerByType($type, $context, $path) { foreach ($this->propertySynthesizers as $synth) { if ($synth::matchByType($type)) { return new $synth($context, $path); } } return null; } protected function pushOntoComponentStack($component) { array_push($this::$componentStack, $component); } protected function popOffComponentStack() { array_pop($this::$componentStack); } protected function isRemoval($value) { return $value === '__rm__'; } } livewire/src/Mechanisms/HandleComponents/ViewContext.php000064400000001436152665372570017527 0ustar00slots = $factory->slots; $this->pushes = $factory->pushes; $this->prepends = $factory->prepends; $this->sections = $factory->sections; } function mergeIntoNewEnvironment($__env) { $factory = invade($__env); $factory->slots = $this->slots; $factory->pushes = $this->pushes; $factory->prepends = $this->prepends; $factory->sections = $this->sections; } } livewire/src/Mechanisms/HandleComponents/CorruptComponentPayloadException.php000064400000000734152665372570023762 0ustar00getKey(); $checksum = hash_hmac('sha256', json_encode($snapshot), $hashKey); trigger('checksum.generate', $checksum, $snapshot); return $checksum; } } livewire/src/Mechanisms/HandleComponents/ComponentContext.php000064400000002351152665372570020554 0ustar00mounting; } public function addEffect($key, $value) { if (is_array($key)) { foreach ($key as $iKey => $iValue) $this->addEffect($iKey, $iValue); return; } $this->effects[$key] = $value; } public function pushEffect($key, $value, $iKey = null) { if (! isset($this->effects[$key])) $this->effects[$key] = []; if ($iKey) { $this->effects[$key][$iKey] = $value; } else { $this->effects[$key][] = $value; } } public function addMemo($key, $value) { $this->memo[$key] = $value; } public function pushMemo($key, $value, $iKey = null) { if (! isset($this->memo[$key])) $this->memo[$key] = []; if ($iKey) { $this->memo[$key][$iKey] = $value; } else { $this->memo[$key][] = $value; } } } livewire/src/Mechanisms/HandleComponents/BaseRenderless.php000064400000000412152665372570020142 0ustar00component->skipRender(); } } livewire/src/Mechanisms/PersistentMiddleware/PersistentMiddleware.php000064400000013061152665372570022300 0ustar00extractPathAndMethodFromRequest(); $context->addMemo('path', $path); $context->addMemo('method', $method); }); on('snapshot-verified', function ($snapshot) { // Only apply middleware to requests hitting the Livewire update endpoint, and not any fake requests such as a test. if (! app(HandleRequests::class)->isLivewireRoute()) return; $this->extractPathAndMethodFromSnapshot($snapshot); $this->applyPersistentMiddleware(); }); on('flush-state', function() { // Only flush these at the end of a full request, so that child components have access to this data. $this->path = null; $this->method = null; }); } function addPersistentMiddleware($middleware) { static::$persistentMiddleware = Router::uniqueMiddleware(array_merge(static::$persistentMiddleware, (array) $middleware)); } function setPersistentMiddleware($middleware) { static::$persistentMiddleware = Router::uniqueMiddleware((array) $middleware); } function getPersistentMiddleware() { return static::$persistentMiddleware; } protected function extractPathAndMethodFromRequest() { if (app(HandleRequests::class)->isLivewireRoute()) { return [$this->path, $this->method]; } return [request()->path(), request()->method()]; } protected function extractPathAndMethodFromSnapshot($snapshot) { if ( ! isset($snapshot['memo']['path']) || ! isset($snapshot['memo']['method']) ) return; // Store these locally, so dynamically added child components can use this data. $this->path = $snapshot['memo']['path']; $this->method = $snapshot['memo']['method']; } protected function applyPersistentMiddleware() { $request = $this->makeFakeRequest(); $middleware = $this->getApplicablePersistentMiddleware($request); // Only send through pipeline if there are middleware found if (is_null($middleware)) return; Utils::applyMiddleware($request, $middleware); } protected function makeFakeRequest() { $originalPath = $this->formatPath($this->path); $originalMethod = $this->method; $currentPath = $this->formatPath(request()->path()); // Clone server bag to ensure changes below don't overwrite the original. $serverBag = clone request()->server; // Replace the Livewire endpoint path with the path from the original request. $serverBag->set( 'REQUEST_URI', str_replace($currentPath, $originalPath, $serverBag->get('REQUEST_URI')) ); $serverBag->set('REQUEST_METHOD', $originalMethod); /** * Make the fake request from the current request with path and method changed so * all other request data, such as headers, are available in the fake request, * but merge in the new server bag with the updated `REQUEST_URI`. */ $request = request()->duplicate( server: $serverBag->all() ); return $request; } protected function formatPath($path) { return '/' . ltrim($path, '/'); } protected function getApplicablePersistentMiddleware($request) { $route = $this->getRouteFromRequest($request); if (! $route) return []; $middleware = app('router')->gatherRouteMiddleware($route); return $this->filterMiddlewareByPersistentMiddleware($middleware); } protected function getRouteFromRequest($request) { $route = app('router')->getRoutes()->match($request); $request->setRouteResolver(fn() => $route); return $route; } protected function filterMiddlewareByPersistentMiddleware($middleware) { $middleware = collect($middleware); $persistentMiddleware = collect(app(PersistentMiddleware::class)->getPersistentMiddleware()); return $middleware ->filter(function ($value, $key) use ($persistentMiddleware) { return $persistentMiddleware->contains(function($iValue, $iKey) use ($value) { // Some middlewares can be closures. if (! is_string($value)) return false; // Ensure any middleware arguments aren't included in the comparison return Str::before($value, ':') == $iValue; }); }) ->values() ->all(); } } livewire/src/Mechanisms/HandleRequests/HandleRequests.php000064400000006211152665372570017661 0ustar00updateRoute) { app($this::class)->setUpdateRoute(function ($handle) { return Route::post('/livewire/update', $handle)->middleware('web'); }); } $this->skipRequestPayloadTamperingMiddleware(); } function getUpdateUri() { return (string) str( route($this->updateRoute->getName(), [], false) )->start('/'); } function skipRequestPayloadTamperingMiddleware() { \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::skipWhen(function () { return $this->isLivewireRequest(); }); \Illuminate\Foundation\Http\Middleware\TrimStrings::skipWhen(function () { return $this->isLivewireRequest(); }); } function setUpdateRoute($callback) { $route = $callback([self::class, 'handleUpdate']); // Append `livewire.update` to the existing name, if any. if (! str($route->getName())->endsWith('livewire.update')) { $route->name('livewire.update'); } $this->updateRoute = $route; } function isLivewireRequest() { return request()->hasHeader('X-Livewire'); } function isLivewireRoute() { // @todo: Rename this back to `isLivewireRequest` once the need for it in tests has been fixed. $route = request()->route(); if (! $route) return false; /* * Check to see if route name ends with `livewire.update`, as if * a custom update route is used and they add a name, then when * we call `->name('livewire.update')` on the route it will * suffix the existing name with `livewire.update`. */ return $route->named('*livewire.update'); } function handleUpdate() { $requestPayload = request(key: 'components', default: []); $finish = trigger('request', $requestPayload); $requestPayload = $finish($requestPayload); $componentResponses = []; foreach ($requestPayload as $componentPayload) { $snapshot = json_decode($componentPayload['snapshot'], associative: true); $updates = $componentPayload['updates']; $calls = $componentPayload['calls']; [ $snapshot, $effects ] = app('livewire')->update($snapshot, $updates, $calls); $componentResponses[] = [ 'snapshot' => json_encode($snapshot), 'effects' => $effects, ]; } $responsePayload = [ 'components' => $componentResponses, 'assets' => SupportScriptsAndAssets::getAssets(), ]; $finish = trigger('response', $responsePayload); return $finish($responsePayload); } } livewire/src/Mechanisms/CompileLivewireTags/LivewireTagPrecompiler.php000064400000007623152665372570022355 0ustar00getAttributesFromAttributeString($matches['attributes']); $keys = array_keys($attributes); $values = array_values($attributes); $attributesCount = count($attributes); for ($i=0; $i < $attributesCount; $i++) { if ($keys[$i] === ':' && $values[$i] === 'true') { if (isset($values[$i + 1]) && $values[$i + 1] === 'true') { $attributes[$keys[$i + 1]] = '$'.$keys[$i + 1]; unset($attributes[':']); } } } // Convert all kebab-cased to camelCase. $attributes = collect($attributes)->mapWithKeys(function ($value, $key) { // Skip snake_cased attributes. if (str($key)->contains('_')) return [$key => $value]; return [(string) str($key)->camel() => $value]; })->toArray(); // Convert all snake_cased attributes to camelCase, and merge with // existing attributes so both snake and camel are available. $attributes = collect($attributes)->mapWithKeys(function ($value, $key) { // Skip snake_cased attributes if (! str($key)->contains('_')) return [$key => false]; return [(string) str($key)->camel() => $value]; })->filter()->merge($attributes)->toArray(); $component = $matches[1]; if ($component === 'styles') return '@livewireStyles'; if ($component === 'scripts') return '@livewireScripts'; if ($component === 'dynamic-component' || $component === 'is') { if (! isset($attributes['component']) && ! isset($attributes['is'])) { throw new ComponentAttributeMissingOnDynamicComponentException; } // Does not need quotes as resolved with quotes already. $component = $attributes['component'] ?? $attributes['is']; unset($attributes['component'], $attributes['is']); } else { // Add single quotes to the component name to compile it as string in quotes $component = "'{$component}'"; } return $this->componentString($component, $attributes); }, $value); } protected function componentString(string $component, array $attributes) { if (isset($attributes['key']) || isset($attributes['wire:key'])) { $key = $attributes['key'] ?? $attributes['wire:key']; unset($attributes['key'], $attributes['wire:key']); return "@livewire({$component}, [".$this->attributesToString($attributes, escapeBound: false)."], key({$key}))"; } return "@livewire({$component}, [".$this->attributesToString($attributes, escapeBound: false).'])'; } protected function attributesToString(array $attributes, $escapeBound = true) { return collect($attributes) ->map(function (string $value, string $attribute) use ($escapeBound) { return $escapeBound && isset($this->boundAttributes[$attribute]) && $value !== 'true' && ! is_numeric($value) ? "'{$attribute}' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute({$value})" : "'{$attribute}' => {$value}"; }) ->implode(','); } } livewire/src/Mechanisms/CompileLivewireTags/CompileLivewireTags.php000064400000000376152665372570021645 0ustar00precompiler(new LivewireTagPrecompiler); } } livewire/src/Mechanisms/ExtendBlade/DeterministicBladeKeys.php000064400000002427152665372570020556 0ustar00currentPathHash) { throw new \Exception('Latest compiled component path not found.'); } $path = $this->currentPathHash; $count = $this->counter(); // $key = "lw-[hash of Blade view path]-[current @livewire directive count]" return 'lw-' . $this->currentPathHash . '-' . $count; } public function counter() { if (! isset($this->countersByPath[$this->currentPathHash])) { $this->countersByPath[$this->currentPathHash] = 0; } return $this->countersByPath[$this->currentPathHash]++; } public function hookIntoCompile(BladeCompiler $compiler, $viewContent) { $path = $compiler->getPath(); // If there is no path this means this Blade is being compiled // with ->compileString(...) directly instead of ->compile() // therefore we'll generate a hash of the contents instead if ($path === null) { $path = $viewContent; } $this->currentPathHash = crc32($path); } } livewire/src/Mechanisms/ExtendBlade/ExtendBlade.php000064400000010363152665372570016344 0ustar00 "window.Livewire.find('{{ \$_instance->getId() }}')"); on('render', function ($target, $view) { $this->startLivewireRendering($target); $undo = $this->livewireifyBladeCompiler(); $this->renderCounter++; return function ($html) use ($view, $undo, $target) { $this->endLivewireRendering(); $this->renderCounter--; if ($this->renderCounter === 0) { $undo(); } return $html; }; }); // This is a custom view engine that gets used when rendering // Livewire views. Things like letting certain exceptions bubble // to the handler, and registering custom directives like: "@this". app()->make('view.engine.resolver')->register('blade', function () { return new ExtendedCompilerEngine(app('blade.compiler')); }); app()->singleton(DeterministicBladeKeys::class); // Reset this singleton between tests and Octane requests... on('flush-state', function () { app()->singleton(DeterministicBladeKeys::class); }); // We're using "precompiler" as a hook for the point in time when // Laravel compiles a Blade view... app('blade.compiler')->precompiler(function ($value) { app(DeterministicBladeKeys::class)->hookIntoCompile(app('blade.compiler'), $value); return $value; }); } function livewireOnlyDirective($name, $handler) { $this->directives[$name] = $handler; } function livewireOnlyPrecompiler($handler) { $this->precompilers[] = $handler; } function livewireifyBladeCompiler() { $removals = []; if ($this->renderCounter === 0) { $customDirectives = app('blade.compiler')->getCustomDirectives(); $precompilers = invade(app('blade.compiler'))->precompilers; foreach ($this->directives as $name => $handler) { if (! isset($customDirectives[$name])) { $customDirectives[$name] = $handler; invade(app('blade.compiler'))->customDirectives = $customDirectives; $removals[] = function () use ($name) { $customDirectives = app('blade.compiler')->getCustomDirectives(); unset($customDirectives[$name]); invade(app('blade.compiler'))->customDirectives = $customDirectives; }; } } foreach ($this->precompilers as $handler) { if (array_search($handler, $precompilers) === false) { array_unshift($precompilers, $handler); invade(app('blade.compiler'))->precompilers = $precompilers; $removals[] = function () use ($handler) { $precompilers = invade(app('blade.compiler'))->precompilers; $index = array_search($handler, $precompilers); if ($index === false) return; unset($precompilers[$index]); invade(app('blade.compiler'))->precompilers = $precompilers; }; } } } return function () use ($removals) { while ($removals) array_pop($removals)(); }; } } livewire/src/Mechanisms/ExtendBlade/ExtendedCompilerEngine.php000064400000005157152665372570020553 0ustar00handleViewException($e, $obLevel); } return ltrim(ob_get_clean()); } // Errors thrown while a view is rendering are caught by the Blade // compiler and wrapped in an "ErrorException". This makes Livewire errors // harder to read, AND causes issues like `abort(404)` not actually working. protected function handleViewException(\Throwable $e, $obLevel) { if ($this->shouldBypassExceptionForLivewire($e, $obLevel)) { // This is because there is no "parent::parent::". \Illuminate\View\Engines\PhpEngine::handleViewException($e, $obLevel); return; } parent::handleViewException($e, $obLevel); } public function shouldBypassExceptionForLivewire(\Throwable $e, $obLevel) { $uses = array_flip(class_uses_recursive($e)); return ( // Don't wrap "abort(403)". $e instanceof \Illuminate\Auth\Access\AuthorizationException // Don't wrap "abort(404)". || $e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException // Don't wrap "abort(500)". || $e instanceof \Symfony\Component\HttpKernel\Exception\HttpException // Don't wrap most Livewire exceptions. || isset($uses[\Livewire\Exceptions\BypassViewHandler::class]) ); } } livewire/src/Mechanisms/Mechanism.php000064400000000303152665372570013703 0ustar00instance(static::class, $this); } function boot() { // } } livewire/src/Mechanisms/DataStore.php000064400000005371152665372570013677 0ustar00lookup = new WeakMap; } function set($instance, $key, $value) { if (! isset($this->lookup[$instance])) { $this->lookup[$instance] = []; } $this->lookup[$instance][$key] = $value; } function has($instance, $key, $iKey = null) { if (! isset($this->lookup[$instance])) { return false; } if (! isset($this->lookup[$instance][$key])) { return false; } if ($iKey !== null) { return !! ($this->lookup[$instance][$key][$iKey] ?? false); } return true; } function get($instance, $key, $default = null) { if (! isset($this->lookup[$instance])) { return value($default); } if (! isset($this->lookup[$instance][$key])) { return value($default); } return $this->lookup[$instance][$key]; } function find($instance, $key, $iKey = null, $default = null) { if (! isset($this->lookup[$instance])) { return value($default); } if (! isset($this->lookup[$instance][$key])) { return value($default); } if ($iKey !== null && ! isset($this->lookup[$instance][$key][$iKey])) { return value($default); } return $iKey !== null ? $this->lookup[$instance][$key][$iKey] : $this->lookup[$instance][$key]; } function push($instance, $key, $value, $iKey = null) { if (! isset($this->lookup[$instance])) { $this->lookup[$instance] = []; } if (! isset($this->lookup[$instance][$key])) { $this->lookup[$instance][$key] = []; } if ($iKey) { $this->lookup[$instance][$key][$iKey] = $value; } else { $this->lookup[$instance][$key][] = $value; } } function unset($instance, $key, $iKey = null) { if (! isset($this->lookup[$instance])) { return; } if (! isset($this->lookup[$instance][$key])) { return; } if ($iKey !== null) { // Set a local variable to avoid the "indirect modification" error. $keyValue = $this->lookup[$instance][$key]; unset($keyValue[$iKey]); $this->lookup[$instance][$key] = $keyValue; } else { // Set a local variable to avoid the "indirect modification" error. $instanceValue = $this->lookup[$instance]; unset($instanceValue[$key]); $this->lookup[$instance] = $instanceValue; } } } livewire/src/Mechanisms/RenderComponent.php000064400000002150152665372570015103 0ustar00generate(); $key = "'{$key}'"; } return <<mount(\$__name, \$__params, $key, \$__slots ?? [], get_defined_vars()); echo \$__html; unset(\$__html); unset(\$__name); unset(\$__params); unset(\$__split); if (isset(\$__slots)) unset(\$__slots); ?> EOT; } } livewire/src/Mechanisms/FrontendAssets/FrontendAssets.php000064400000021353152665372570017713 0ustar00setScriptRoute(function ($handle) { return config('app.debug') ? Route::get('/livewire/livewire.js', $handle) : Route::get('/livewire/livewire.min.js', $handle); }); Route::get('/livewire/livewire.min.js.map', [static::class, 'maps']); Blade::directive('livewireScripts', [static::class, 'livewireScripts']); Blade::directive('livewireScriptConfig', [static::class, 'livewireScriptConfig']); Blade::directive('livewireStyles', [static::class, 'livewireStyles']); app('livewire')->provide(function() { $this->publishes( [ __DIR__.'/../../../dist' => public_path('vendor/livewire'), ], 'livewire:assets', ); }); on('flush-state', function () { $instance = app(static::class); $instance->hasRenderedScripts = false; $instance->hasRenderedStyles = false; }); } function useScriptTagAttributes($attributes) { $this->scriptTagAttributes = array_merge($this->scriptTagAttributes, $attributes); } function setScriptRoute($callback) { $route = $callback([self::class, 'returnJavaScriptAsFile']); $this->javaScriptRoute = $route; } public static function livewireScripts($expression) { return '{!! \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts('.$expression.') !!}'; } public static function livewireScriptConfig($expression) { return '{!! \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scriptConfig('.$expression.') !!}'; } public static function livewireStyles($expression) { return '{!! \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles('.$expression.') !!}'; } public function returnJavaScriptAsFile() { return Utils::pretendResponseIsFile( config('app.debug') ? __DIR__.'/../../../dist/livewire.js' : __DIR__.'/../../../dist/livewire.min.js' ); } public function maps() { return Utils::pretendResponseIsFile(__DIR__.'/../../../dist/livewire.min.js.map'); } public static function styles($options = []) { app(static::class)->hasRenderedStyles = true; $nonce = isset($options['nonce']) ? "nonce=\"{$options['nonce']}\" data-livewire-style" : ''; $progressBarColor = config('livewire.navigate.progress_bar_color', '#2299dd'); // Note: the attribute selectors are "doubled" so that they don't get overriden when Tailwind's CDN loads a script tag // BELOW the one Livewire injects... $html = << HTML; return static::minify($html); } public static function scripts($options = []) { app(static::class)->hasRenderedScripts = true; $debug = config('app.debug'); $scripts = static::js($options); // HTML Label. $html = $debug ? [''] : []; $html[] = $scripts; return implode("\n", $html); } public static function js($options) { // Use the default endpoint... $url = app(static::class)->javaScriptRoute->uri; // Use the configured one... $url = config('livewire.asset_url') ?: $url; // Use the legacy passed in one... $url = $options['asset_url'] ?? $url; // Use the new passed in one... $url = $options['url'] ?? $url; $url = rtrim($url, '/'); $url = (string) str($url)->when(! str($url)->isUrl(), fn($url) => $url->start('/')); // Add the build manifest hash to it... $manifest = json_decode(file_get_contents(__DIR__.'/../../../dist/manifest.json'), true); $versionHash = $manifest['/livewire.js']; $url = "{$url}?id={$versionHash}"; $token = app()->has('session.store') ? csrf_token() : ''; $assetWarning = null; $nonce = isset($options['nonce']) ? "nonce=\"{$options['nonce']}\"" : ''; [$url, $assetWarning] = static::usePublishedAssetsIfAvailable($url, $manifest, $nonce); $progressBar = config('livewire.navigate.show_progress_bar', true) ? '' : 'data-no-progress-bar'; $updateUri = app('livewire')->getUpdateUri(); $extraAttributes = Utils::stringifyHtmlAttributes( app(static::class)->scriptTagAttributes, ); return << HTML; } public static function scriptConfig($options = []) { app(static::class)->hasRenderedScripts = true; $nonce = isset($options['nonce']) ? " nonce=\"{$options['nonce']}\"" : ''; $progressBar = config('livewire.navigate.show_progress_bar', true) ? '' : 'data-no-progress-bar'; $attributes = json_encode([ 'csrf' => app()->has('session.store') ? csrf_token() : '', 'uri' => app('livewire')->getUpdateUri(), 'progressBar' => $progressBar, 'nonce' => isset($options['nonce']) ? $options['nonce'] : '', ]); return <<window.livewireScriptConfig = {$attributes}; HTML; } protected static function usePublishedAssetsIfAvailable($url, $manifest, $nonce) { $assetWarning = null; // Check to see if static assets have been published... if (! file_exists(public_path('vendor/livewire/manifest.json'))) { return [$url, $assetWarning]; } $publishedManifest = json_decode(file_get_contents(public_path('vendor/livewire/manifest.json')), true); $versionedFileName = $publishedManifest['/livewire.js']; $fileName = config('app.debug') ? '/livewire.js' : '/livewire.min.js'; $versionedFileName = "{$fileName}?id={$versionedFileName}"; $assertUrl = config('livewire.asset_url') ?? (app('livewire')->isRunningServerless() ? rtrim(config('app.asset_url'), '/')."/vendor/livewire$versionedFileName" : url("vendor/livewire{$versionedFileName}") ); $url = $assertUrl; if ($manifest !== $publishedManifest) { $assetWarning = << console.warn('Livewire: The published Livewire assets are out of date\\n See: https://livewire.laravel.com/docs/installation#publishing-livewires-frontend-assets') \n HTML; } return [$url, $assetWarning]; } protected static function minify($subject) { return preg_replace('~(\v|\t|\s{2,})~m', '', $subject); } } livewire/src/ComponentHook.php000064400000005135152665372570012503 0ustar00component = $component; } function callBoot(...$params) { if (method_exists($this, 'boot')) $this->boot(...$params); } function callMount(...$params) { if (method_exists($this, 'mount')) $this->mount(...$params); } function callHydrate(...$params) { if (method_exists($this, 'hydrate')) $this->hydrate(...$params); } function callUpdate($propertyName, $fullPath, $newValue) { $callbacks = []; if (method_exists($this, 'update')) $callbacks[] = $this->update($propertyName, $fullPath, $newValue); return function (...$params) use ($callbacks) { foreach ($callbacks as $callback) { if (is_callable($callback)) $callback(...$params); } }; } function callCall($method, $params, $returnEarly) { $callbacks = []; if (method_exists($this, 'call')) $callbacks[] = $this->call($method, $params, $returnEarly); return function (...$params) use ($callbacks) { foreach ($callbacks as $callback) { if (is_callable($callback)) $callback(...$params); } }; } function callRender(...$params) { $callbacks = []; if (method_exists($this, 'render')) $callbacks[] = $this->render(...$params); return function (...$params) use ($callbacks) { foreach ($callbacks as $callback) { if (is_callable($callback)) $callback(...$params); } }; } function callDehydrate(...$params) { if (method_exists($this, 'dehydrate')) $this->dehydrate(...$params); } function callDestroy(...$params) { if (method_exists($this, 'destroy')) $this->destroy(...$params); } function callException(...$params) { if (method_exists($this, 'exception')) $this->exception(...$params); } function getProperties() { return $this->component->all(); } function getProperty($name) { return data_get($this->getProperties(), $name); } function storeSet($key, $value) { store($this->component)->set($key, $value); } function storePush($key, $value, $iKey = null) { store($this->component)->push($key, $value, $iKey); } function storeGet($key, $default = null) { return store($this->component)->get($key, $default); } function storeHas($key) { return store($this->component)->has($key); } } livewire/composer.json000064400000002641152665372570011141 0ustar00{ "name": "livewire/livewire", "description": "A front-end framework for Laravel.", "license": "MIT", "authors": [ { "name": "Caleb Porzio", "email": "calebporzio@gmail.com" } ], "require": { "php": "^8.1", "illuminate/database": "^10.0|^11.0|^12.0", "illuminate/routing": "^10.0|^11.0|^12.0", "illuminate/support": "^10.0|^11.0|^12.0", "illuminate/validation": "^10.0|^11.0|^12.0", "league/mime-type-detection": "^1.9", "symfony/console": "^6.0|^7.0", "symfony/http-kernel": "^6.2|^7.0", "laravel/prompts": "^0.1.24|^0.2|^0.3" }, "require-dev": { "psy/psysh": "^0.11.22|^0.12", "mockery/mockery": "^1.3.1", "phpunit/phpunit": "^10.4|^11.5", "laravel/framework": "^10.15.0|^11.0|^12.0", "orchestra/testbench": "^8.21.0|^9.0|^10.0", "orchestra/testbench-dusk": "^8.24|^9.1|^10.0", "calebporzio/sushi": "^2.1" }, "autoload": { "files": [ "src/helpers.php" ], "psr-4": { "Livewire\\": "src/" } }, "autoload-dev": { "psr-4": { "App\\": "vendor/orchestra/testbench-core/laravel/app", "Tests\\": "tests/", "LegacyTests\\": "legacy_tests/" } }, "extra": { "laravel": { "providers": [ "Livewire\\LivewireServiceProvider" ], "aliases": { "Livewire": "Livewire\\Livewire" } } }, "minimum-stability": "dev", "prefer-stable": true } livewire/LICENSE.md000064400000002063152665372570010021 0ustar00## MIT License Copyright © Caleb Porzio Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. livewire/config/livewire.php000064400000014211152665372570012217 0ustar00 'App\\Livewire', /* |--------------------------------------------------------------------------- | View Path |--------------------------------------------------------------------------- | | This value is used to specify where Livewire component Blade templates are | stored when running file creation commands like `artisan make:livewire`. | It is also used if you choose to omit a component's render() method. | */ 'view_path' => resource_path('views/livewire'), /* |--------------------------------------------------------------------------- | Layout |--------------------------------------------------------------------------- | The view that will be used as the layout when rendering a single component | as an entire page via `Route::get('/post/create', CreatePost::class);`. | In this case, the view returned by CreatePost will render into $slot. | */ 'layout' => 'components.layouts.app', /* |--------------------------------------------------------------------------- | Lazy Loading Placeholder |--------------------------------------------------------------------------- | Livewire allows you to lazy load components that would otherwise slow down | the initial page load. Every component can have a custom placeholder or | you can define the default placeholder view for all components below. | */ 'lazy_placeholder' => null, /* |--------------------------------------------------------------------------- | Temporary File Uploads |--------------------------------------------------------------------------- | | Livewire handles file uploads by storing uploads in a temporary directory | before the file is stored permanently. All file uploads are directed to | a global endpoint for temporary storage. You may configure this below: | */ 'temporary_file_upload' => [ 'disk' => null, // Example: 'local', 's3' | Default: 'default' 'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', 'mov', 'avi', 'wmv', 'mp3', 'm4a', 'jpg', 'jpeg', 'mpga', 'webp', 'wma', ], 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... ], /* |--------------------------------------------------------------------------- | Render On Redirect |--------------------------------------------------------------------------- | | This value determines if Livewire will run a component's `render()` method | after a redirect has been triggered using something like `redirect(...)` | Setting this to true will render the view once more before redirecting | */ 'render_on_redirect' => false, /* |--------------------------------------------------------------------------- | Eloquent Model Binding |--------------------------------------------------------------------------- | | Previous versions of Livewire supported binding directly to eloquent model | properties using wire:model by default. However, this behavior has been | deemed too "magical" and has therefore been put under a feature flag. | */ 'legacy_model_binding' => false, /* |--------------------------------------------------------------------------- | Auto-inject Frontend Assets |--------------------------------------------------------------------------- | | By default, Livewire automatically injects its JavaScript and CSS into the | and of pages containing Livewire components. By disabling | this behavior, you need to use @livewireStyles and @livewireScripts. | */ 'inject_assets' => true, /* |--------------------------------------------------------------------------- | Navigate (SPA mode) |--------------------------------------------------------------------------- | | By adding `wire:navigate` to links in your Livewire application, Livewire | will prevent the default link handling and instead request those pages | via AJAX, creating an SPA-like effect. Configure this behavior here. | */ 'navigate' => [ 'show_progress_bar' => true, 'progress_bar_color' => '#2299dd', ], /* |--------------------------------------------------------------------------- | HTML Morph Markers |--------------------------------------------------------------------------- | | Livewire intelligently "morphs" existing HTML into the newly rendered HTML | after each update. To make this process more reliable, Livewire injects | "markers" into the rendered Blade surrounding @if, @class & @foreach. | */ 'inject_morph_markers' => true, /* |--------------------------------------------------------------------------- | Pagination Theme |--------------------------------------------------------------------------- | | When enabling Livewire's pagination feature by using the `WithPagination` | trait, Livewire will use Tailwind templates to render pagination views | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" | */ 'pagination_theme' => 'tailwind', ]; admin/finance/plan/subscription-plan-create.blade.php000064400000005416152665656260016716 0ustar00
@lang("We've revamped the plan management system to give you full control over your pricing strategies. Your users' credits will be migrated to the new pricing system, so you may need to review and update your pricing plans. New pricing plans won't be affected.") @lang('Learn more >')
@for ($i = 1; $i <= $this->totalStep(); $i++)
$this->currentStep() >= $i, ])> {{ $i }} @lang($this->stepTitle($i))
@endfor
@includeWhen($this->currentStepIs(1), 'panel.admin.finance.plan.includes.step-first') @includeWhen($this->currentStepIs(2), 'panel.admin.finance.plan.includes.step-second') @includeWhen($this->currentStepIs(3), 'panel.admin.finance.plan.includes.step-third') @includeWhen($this->currentStepIs(4), 'panel.admin.finance.plan.includes.step-fourth') @include('panel.admin.finance.plan.includes.step-actions')
admin/finance/plan/token-pack-plan-create.blade.php000064400000015620152665656260016224 0ustar00
@lang("We've revamped the plan management system to give you full control over your pricing strategies. Your users' credits will be migrated to the new pricing system, so you may need to review and update your pricing plans. New pricing plans won't be affected.") @lang('Learn more >')
@for ($i = 1; $i <= $this->totalStep(); $i++)
$this->currentStep() >= $i, ])> {{ $i }} @lang($this->stepTitle($i))
@endfor
@if ($this->currentStepIs(1))
@endif @if ($this->currentStepIs(2)) @include('panel.admin.finance.plan.includes.step-fourth') @endif @include('panel.admin.finance.plan.includes.step-actions')
offline.blade.php000064400000000411152665656260007764 0ustar00
{{ __('No Internet Connection') }}
chatbot/empty.blade.php000064400000000015152665656260011124 0ustar00
chatbot/chatbot.blade.php000064400000001225152665656260011416 0ustar00
@include('panel.chatbot.widget')
@assets {!! \App\Support\Chatbot\ChatbotHelper::getViteAssets('resources/views/default/js/chatbotApp.js') !!} {{----}} @endassetschatbot/code.blade.php000064400000013031152665656260010702 0ustar00
@if ($showCodeDialog)
{{ __('Copy to Clipboard') }}
{{ __('Copy to Clipboard') }}
{{ __('Copy to Clipboard') }}
@endif
{{--
--}} {{-- --}} {{--
--}}chatbot/domain.blade.php000064400000020064152665656260011243 0ustar00
  • {{ $domain->domain }}
    @if ($editDomainDialog)
    @error('editingDomain')

    {{ $message }}

    @enderror
    {{ __('Update') }}
    @endif @if ($deleteDomainDialog)
    {{ __('Are you sure you want to delete this domain?') }}
    {{ __('Cancel') }} {{ __('Delete') }}
    @endif
  • chatbot/domains.blade.php000064400000005162152665656260011430 0ustar00
    @if ($addDomainButton) @endif
    @if ($this->domains->isNotEmpty())
      @foreach ($this->domains as $key => $domain) @endforeach
    @else

    {{ __('No domains yet.') }}

    @endif
    @if ($addDomainDialog)
    @error('domain')

    {{ $message }}

    @enderror
    {{ __('Add Domain') }}
    @endif
    media-manager-modal.blade.php000064400000231276152665656260012142 0ustar00@php use Illuminate\Support\Str; @endphp
    {{-- Header with Title, Filters, Sorting, and Search --}}

    @lang('Content Manager')

    {{-- Filters Tabs --}}
      @foreach ($filters as $filter)
    • @endforeach
    {{-- Sorting & Search --}}
    {{ __('Sort by') }}
    @foreach ($sortButtons as $button) @endforeach
    {{-- Search input with clear button --}}
    @if (!empty($searchTerm)) @endif {{-- Search loading indicator --}}
    {{-- Upload Files Section --}} @if ($activeFilter === 'Upload Files')
    {{-- Upload Area --}}

    @lang('Drag and Drop a File')

    @lang('or')
    {{-- File Processing Indicator --}}
    @lang('Processing selected files')...

    @lang('Please wait, validating large files may take a moment.')

    {{-- File List --}} @if (count($uploadingFiles))
      @foreach ($uploadingFiles as $file)
    • {{ $file?->getClientOriginalName() }} {{ number_format($file?->getSize() / 1024, 1) }} KB
    • @endforeach
    @endif {{-- Upload Errors --}} @if (!empty($uploadErrors))
      @foreach ($uploadErrors as $error)
    • • {{ $error }}
    • @endforeach
    @endif {{-- Upload Progress --}} @if ($isUploading && !empty($uploadProgress))
    {{ $uploadProgress }}
    @endif {{-- Upload Success --}} @if (!empty($uploadedFiles) && !$isUploading)

    ✓ {{ count($uploadedFiles) }} file(s) uploaded successfully!

      @foreach ($uploadedFiles as $file)
    • • {{ $file['name'] }}
    • @endforeach
    @endif {{-- Action Buttons --}}
    {{ count($uploadingFiles) ? __('Add More') : __('Browse Files') }}

    @lang('Max :max files, :maxSize MB each.', [ 'max' => setting('media_max_files', 5), 'maxSize' => setting('media_max_size', 25), ])
    @lang('Allowed types: :types', [ 'types' => setting('media_allowed_types', 'jpg, png, gif, webp, svg, mp4, avi, mov, wmv, flv, webm, mp3, wav, m4a, pdf, doc, docx, xls, xlsx'), ])

    @endif {{-- Images Section --}} @if ($activeFilter === 'Images')
    {{-- Search results info --}} @if (!empty($searchTerm))
    @if ($images->count() > 0) @lang('Found :count images for', ['count' => $images->count()]) "{{ $searchTerm }}" @else @lang('No images found for') "{{ $searchTerm }}" @endif
    @endif
    @forelse ($images as $image) @php $isDisabledImage = $this->isCardDisabled('image', $this->allowedTypes); @endphp
    @php $img = $image->output_url ?? $image->url; if (Str::contains($img, 'uploads')) { $img = Str::after($img, '/uploads'); $img = '/uploads' . $img; } @endphp {{ $image->title ?? $image->input }}
    {{ $image->title ?? Str::limit($image->input ?? ($image->filename ?? 'Untitled'), 30) }}
    {{-- Show creation date on hover --}}
    {{ $image->format_date ?? $image->created_at->format('M d, Y') }}
    {{-- Selection indicator --}} @if (in_array((string) $image->id, $selectedImages ?? [], true)) @endif
    @empty

    @lang('No images found.')

    @if (!empty($searchTerm))

    @lang('Try adjusting your search term.')

    @endif
    @endforelse
    {{-- Loading indicator --}} @if ($hasMoreImages && !$isLoading && $images->count() > 0)
    @lang('Scroll for more images...')
    @endif {{-- Loading spinner --}}
    @if (!empty($selectedImages) && count($selectedImages) > 0)
    @lang($allowMultipleSelection ? 'Insert Selected Images' : 'Insert Selected Image') @if ($allowMultipleSelection) ({{ count($selectedImages) }}) @endif
    @endif @endif {{-- Videos Section --}} @if ($activeFilter === 'Videos')
    {{-- Search results info --}} @if (!empty($searchTerm))
    @if ($videos->count() > 0) @lang('Found :count videos for', ['count' => $videos->count()]) "{{ $searchTerm }}" @else @lang('No videos found for') "{{ $searchTerm }}" @endif
    @endif
    @forelse ($videos as $video) @php $isDisabledVideo = $this->isCardDisabled('video', $this->allowedTypes); @endphp
    {{-- Video thumbnail or video player --}} @if (isset($video->output_url) && $video->output_url)
    {{-- Static thumbnail/placeholder shown initially --}}
    {{-- Video element (initially without src) --}}
    @else
    @endif {{-- Video Controls Overlay --}} @if (isset($video->output_url) && $video->output_url)
    @endif
    {{ $video->title ?? Str::limit($video->input ?? ($video->filename ?? 'Untitled'), 30) }}
    {{-- Show creation date on hover --}}
    {{ $video->format_date ?? $video->created_at->format('M d, Y') }}
    {{-- Selection indicator --}} @if (in_array((string) $video->id, $selectedVideos ?? [], true)) @endif @if (!in_array((string) $video->id, $selectedVideos ?? [], true))
    @endif
    @empty

    @lang('No videos found.')

    @if (!empty($searchTerm))

    @lang('Try adjusting your search term.')

    @endif
    @endforelse
    {{-- Loading indicator --}} @if ($hasMoreVideos && !$isLoading && $videos->count() > 0)
    @lang('Scroll for more videos...')
    @endif {{-- Loading spinner --}}
    @if (!empty($selectedVideos) && count($selectedVideos) > 0)
    @lang($allowMultipleSelection ? 'Insert Selected Videos' : 'Insert Selected Video') @if ($allowMultipleSelection && count($selectedVideos)) ({{ count($selectedVideos) }}) @endif
    @endif @endif {{-- Other Files Section --}} @if ($activeFilter === 'Other Files')
    {{-- Search results info --}} @if (!empty($searchTerm))
    @if ($otherFiles->count() > 0) @lang('Found :count files for', ['count' => $otherFiles->count()]) "{{ $searchTerm }}" @else @lang('No files found for') "{{ $searchTerm }}" @endif
    @endif
    @forelse ($otherFiles as $file) @php $isDisabledOther = $this->isCardDisabled('other', $this->allowedTypes); @endphp
    {{-- File icon based on extension --}}
    @if (in_array($file->extension, ['pdf'])) @elseif (in_array($file->extension, ['doc', 'docx'])) @elseif (in_array($file->extension, ['xls', 'xlsx'])) @elseif (in_array($file->extension, ['ppt', 'pptx'])) @else @endif
    {{-- File info --}}

    {{ \Illuminate\Support\Str::limit($file->filename, 20, '...') }}

    {{ strtoupper($file->extension) }} • {{ number_format($file->file_size / 1024, 1) }} KB

    {{ $file->format_date }}

    {{-- Selection indicator --}} @if (in_array((string) $file->id, $selectedOtherFiles ?? [], true)) @endif
    @empty

    @lang('No files found.')

    @if (!empty($searchTerm))

    @lang('Try adjusting your search term.')

    @endif
    @endforelse
    {{-- Loading indicator --}} @if ($hasMoreOtherFiles && !$isLoading && $otherFiles->count() > 0)
    @lang('Scroll for more files...')
    @endif {{-- Loading spinner --}}
    @if (!empty($selectedOtherFiles) && count($selectedOtherFiles) > 0)
    @lang('Insert Selected Files') ({{ count($selectedOtherFiles) }})
    @endif @endif {{-- Google Drive Section --}} @if ($activeFilter === 'Google Drive')

    @lang('Google Drive integration coming soon...')

    @endif {{-- Stock Images Section --}} @if ($activeFilter === 'Stock Images')
    {{-- Search results info --}} @if (!empty($searchTerm))
    @if ($stockImages->count() > 0) @lang('Found :count stock images for', ['count' => $stockImages->count()]) "{{ $searchTerm }}" @else @lang('No stock images found for') "{{ $searchTerm }}" @endif
    @endif
    @forelse ($stockImages as $stockImage) @php $isDisabledImage = $this->isCardDisabled('image', $this->allowedTypes); // Check if this stock image is selected $isSelected = in_array((string) $stockImage->id, $selectedStockImages ?? [], true); @endphp
    {{ $stockImage->title }} {{-- Title overlay - matches images section style --}}
    {{ Str::limit($stockImage->title ?? 'Untitled', 30) }}
    {{-- Selection indicator --}} @if ($isSelected) @endif
    @empty
    @if (empty($searchTerm))

    @lang('Enter a search term to find stock images')

    @else

    @lang('No stock images found for') "{{ $searchTerm }}"

    @lang('Try adjusting your search term.')

    @endif
    @endforelse
    {{-- Loading spinner --}}
    {{-- Insert button for selected stock images --}} @if (!empty($selectedStockImages) && count($selectedStockImages) > 0)
    @lang($allowMultipleSelection ? 'Download & Insert Selected Images' : 'Download & Insert Selected Image') @if ($allowMultipleSelection) ({{ count($selectedStockImages) }}) @endif @lang('Downloading...')
    @endif @endif {{-- Stock Videos Section --}} @if ($activeFilter === 'Stock Videos')
    {{-- Search results info --}} @if (!empty($searchTerm))
    @if ($stockVideos->count() > 0) @lang('Found :count stock videos for', ['count' => $stockVideos->count()]) "{{ $searchTerm }}" @else @lang('No stock videos found for') "{{ $searchTerm }}" @endif
    @endif
    @forelse ($stockVideos as $stockVideo) @php $isDisabledVideo = $this->isCardDisabled('video', $this->allowedTypes); // Check if this stock video is selected $isSelected = in_array((string) $stockVideo->id, $selectedStockVideos ?? [], true); @endphp
    {{-- Video thumbnail with hidden video player --}} @if ($stockVideo->thumbnail)
    {{ $stockVideo->title }} {{-- Hidden video player for stock videos --}} @if ($stockVideo->preview_url || $stockVideo->url) @endif
    @else
    @endif {{-- Video Controls Overlay --}} @if ($stockVideo->preview_url || $stockVideo->url)
    @endif {{-- Duration badge --}} @if ($stockVideo->duration > 0)
    {{ gmdate('i:s', $stockVideo->duration) }}
    @endif {{-- Title overlay --}}
    {{ Str::limit($stockVideo->title ?? 'Untitled', 30) }}
    {{-- Selection indicator --}} @if ($isSelected) @endif
    @empty
    @if (empty($searchTerm))

    @lang('Enter a search term to find stock videos')

    @else

    @lang('No stock videos found for') "{{ $searchTerm }}"

    @lang('Try adjusting your search term.')

    @endif
    @endforelse
    {{-- Loading spinner --}}
    {{-- Insert button for selected stock videos --}} @if (!empty($selectedStockVideos) && count($selectedStockVideos) > 0)
    @lang($allowMultipleSelection ? 'Download & Insert Selected Videos' : 'Download & Insert Selected Video') @if ($allowMultipleSelection) ({{ count($selectedStockVideos) }}) @endif @lang('Downloading...')
    @endif @endif
    assign-view-credits.blade.php000064400000022117152665656260012240 0ustar00
    @foreach ($enabledAiEngines as $aiEngine) @if (isset($entities[$aiEngine->value]))
    @php $defaultModels = $aiEngine->getDefaultModels($setting, $settings_two); $modelsWithoutDefault = $aiEngine->getListableActiveModels($setting, $settings_two); @endphp @foreach ($defaultModels as $defaultModel)
    {{ $defaultModel->tooltipHowToCalc() }} @php $key = $defaultModel->engine()->slug().'.'.$defaultModel->slug(); if (data_get($costs, $key . '.isUnlimited')) { $cost = '∞'; } else{ if (is_numeric(data_get($costs, $key.'.credit', 0.00))) { $cost = '$' . formatSmallNumber(data_get($costs, $key.'.credit', 0.00)); } } @endphp {{ trans('Estimated cost (USD): '). $cost }}
    @endforeach @if ($modelsWithoutDefault->count() > 0)
    {{ __('View All') }}
    @endif
    @endif @endforeach @if(count($totals) && $plan)
      @foreach($totals['engine'] as $total)
    • {{ $total['enum']->label() }} ${{ $total['total'] }}
    • @endforeach
    • @lang('Plan Price') ${{ $plan->price }}
    • @lang('Total Cost') ${{ $totals['costs'] }}
    • @lang('Net Profit') ${{ $plan->price - $totals['costs'] }}
    @endif