mnfst 0.5.322 → 0.5.324
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/manifest.appwrite.data.js +1 -1
- package/lib/manifest.data.js +211 -48
- package/lib/manifest.data.min.js +1 -1
- package/lib/manifest.data.min.js.map +1 -1
- package/lib/manifest.icons.js +34 -10
- package/lib/manifest.icons.min.js +1 -1
- package/lib/manifest.icons.min.js.map +1 -1
- package/lib/manifest.integrity.json +12 -12
- package/lib/manifest.js +2 -2
- package/lib/manifest.min.js +1 -1
- package/lib/manifest.modules.integrity.json +9 -9
- package/lib/manifest.sw.js +1 -1
- package/lib/manifest.sw.min.js +1 -1
- package/lib/manifest.utilities.js +102 -56
- package/lib/manifest.utilities.min.js +1 -1
- package/lib/manifest.utilities.min.js.map +1 -1
- package/lib/manifest.utilities.node.mjs +77 -16
- package/package.json +2 -1
package/lib/manifest.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";const e=document.currentScript;if(!window.ManifestPending){const we=new Map;let ge=0;window.ManifestPending={hold(e="work"){const t=++ge;return we.set(t,e),()=>{we.delete(t)}},get count(){return we.size+(window.__manifestMarkdownPending||0)+(window.__manifestUtilitiesPending||0)},labels(){const e=[...we.values()];return window.__manifestMarkdownPending>0&&e.push("markdown"),window.__manifestUtilitiesPending>0&&e.push("utilities"),e},background:e=>("function"==typeof e&&(e.__manifestBackground=!0),e)}}const t=new Set,n=new WeakSet;let i=!1;function o(){for(const e of[...t])e.settle()}function r(){i||(i=!0,queueMicrotask(()=>{i=!1,o()}))}function a(e){for(let t=e.parentNode;t;t=t.parentNode)if(t._x_ignore)return!0;return!1}function s(e,i){const s=window.Alpine,c=e.getAttribute("x-if");let d=!e.closest("[x-data],[x-init]"),l=!1,u=null;const f=()=>!!s.evaluate(e,c),m=()=>{u&&(u(),u=null)},p=()=>{t.delete(y),m()},w=()=>{d=!1,l=!1,m(),i._x_ignore=!0,t.add(y)},g=()=>{p(),s.mutateDom(()=>{s.destroyTree(i),i.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl,r()},h=()=>{d||e._x_currentIfEl!==i||!i.isConnected||a(e)||(d=!0,l=!1,p(),delete i._x_ignore,s.initTree(i),o())},y={settle(){if(!d&&!l)return e._x_currentIfEl!==i?p():void(i.isConnected?e._x_marker&&!a(e)&&f()&&h():i.getRootNode()instanceof DocumentFragment||p())}},v=()=>window.__manifestReady||!window.__manifestReadyCoordinator?g():(queueMicrotask(()=>{e._x_currentIfEl===i&&(e._x_undoIf=v,(()=>{if(u||!l||e._x_currentIfEl!==i||a(e))return;const t=s.evaluateLater(e,c),n=s.effect(()=>t(e=>{e&&queueMicrotask(()=>{l&&f()&&h()})}));u=()=>s.release(n)})())}),a(e)?w():(d&&(d=!1,i._x_ignore=!0,s.destroyTree(i),t.add(y)),void(l||(l=!0,window.addEventListener("manifest:ready",()=>{if(l&&e._x_currentIfEl===i){if(e.isConnected&&a(e))return w();if(e.isConnected&&f())return h();g(),delete e._x_undoIf}},{once:!0})))));e._x_currentIfEl=i,e._x_lastRenderedEl=i,e._x_undoIf=v,n.add(e),d||(i._x_ignore=!0,t.add(y))}function c(e,t){e.querySelectorAll("template").forEach(e=>{const n=t||e.matches("[x-if],[x-for]");n&&e.content.querySelectorAll("[data-pre-rendered]").forEach(e=>{e.tagName.startsWith("X-")&&e.removeAttribute("data-pre-rendered")}),c(e.content,n)})}function d(){try{!function(){if("undefined"==typeof document||!document.querySelector)return;const e=document.querySelector('meta[name="manifest:prerendered"]');if(!e||"0"===e.getAttribute("content"))return;const t=document.getElementById("__manifest_hydrate__");if(!t)return;let n;try{n=JSON.parse(t.textContent||"[]")}catch(e){n=[]}if(!Array.isArray(n)||0===n.length)return void t.remove();const i=e=>String(null==e?"":e).replace(/&/g,"&").replace(/"/g,"""),o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=[];for(const e of n){const t=document.querySelector('[data-hydrate-id="'+e.id+'"]');if(!t)continue;let n=0;for(let e=t.parentNode;e;e=e.parentNode)n++;r.push({entry:e,el:t,depth:n})}r.sort((e,t)=>t.depth-e.depth);for(const{entry:e,el:t}of r){const n=document.querySelector('[data-hydrate-id="'+e.id+'"]')||t;if(!n||!n.parentNode)continue;if("string"==typeof e.html){const t=n.tagName.toLowerCase(),r={},a=n.attributes;for(let e=0;e<a.length;e++)"data-hydrate-id"!==a[e].name&&(r[a[e].name]=a[e].value);if(e.attrs)for(const t in e.attrs){const n=e.attrs[t];null===n?delete r[t]:r[t]=n}const s=Object.keys(r).map(e=>e+'="'+i(r[e])+'"').join(" "),c=o.has(t)?"<"+t+" "+s+">":"<"+t+" "+s+">"+e.html+"</"+t+">",d=document.createElement("div");d.innerHTML=c;const l=d.firstElementChild;if(l)try{n.parentNode.replaceChild(l,n)}catch(e){}continue}if(!e.attrs)continue;const r=n.tagName.toLowerCase(),a={},s=n.attributes;for(let e=0;e<s.length;e++)"data-hydrate-id"!==s[e].name&&(a[s[e].name]=s[e].value);for(const t in e.attrs){const n=e.attrs[t];null===n?delete a[t]:a[t]=n}const c=Object.keys(a).map(e=>e+'="'+i(a[e])+'"').join(" "),d=o.has(r),l=d?"":n.innerHTML,u=d?"<"+r+" "+c+">":"<"+r+" "+c+">"+l+"</"+r+">",f=document.createElement("div");f.innerHTML=u;const m=f.firstElementChild;if(m)try{n.parentNode.replaceChild(m,n)}catch(e){}}t.remove()}()}catch(e){}}if("undefined"!=typeof document&&document.addEventListener("alpine:init",function(){if("undefined"==typeof document||!document.querySelectorAll)return;c(document);let e=0;if(document.querySelectorAll("[data-mnfst-prerender-clone]").forEach(t=>{if(t.closest&&t.closest("[data-hydrate]"))return;t.removeAttribute("data-mnfst-prerender-clone");const n=t.previousElementSibling;n&&"TEMPLATE"===n.tagName&&n.hasAttribute("x-if")?(s(n,t),e++):t.remove()}),!e)return;const i=window.Alpine;"function"==typeof i.interceptInit&&i.interceptInit(e=>{n.has(e)&&t.size&&r()}),document.addEventListener("alpine:initialized",o,{once:!0})},{once:!0}),"undefined"!=typeof document)if("loading"===document.readyState){let he=!1;document.addEventListener("readystatechange",()=>{he||"loading"===document.readyState||(he=!0,d())})}else d();if("undefined"!=typeof window&&"undefined"!=typeof document){let ye=null;window.addEventListener("resize",()=>{document.documentElement.classList.add("window-resizing"),ye&&clearTimeout(ye),ye=setTimeout(()=>{document.documentElement.classList.remove("window-resizing"),ye=null},200)},{passive:!0})}const l="latest",u="0.5.322",f="sha384-PUeP7gAZ/TF/irfkafsZfzEfzuGrnd1/GEYLFO0Z2KjisjUAoZMpea0cCoItXvBo",m="manifest.modules.integrity.json",p="manifest.vendor.integrity.json";let w=null,g=null,h=!1,y=null,v=l,_=["https://cdn.manifestx.dev/npm","https://cdn.jsdelivr.net/npm","https://unpkg.com"];function b(e,t){return e.includes("unpkg.com")?t.replace(/\.min\.js$/,".js"):t}function $(e=l,t=_[0]){return`${t}/mnfst@${e}/lib`}const E=["components","router","utilities","data","icons","localization","markdown","svg","code","color","toasts","tooltips","dropdowns","combobox","computed","tabs","slides","colorpicker","datepicker","charts","url-parameters","virtual","export","status"],k=["defer","bindings"],L=["edit"],S=["appwrite-auth","appwrite-data","appwrite-presences"],j=["rich-text","submissions"],A={"appwrite-data":["data"],"appwrite-presences":["data","appwrite-auth"],device:["utilities"],edit:["rich-text"]};let M=null;function x(e,t=v){const n=e.replace(/-/g,".");if(M){return[`${M.replace(/\/$/,"")}/manifest.${n}.js`]}return _.map(e=>`${$(t,e)}/${b(e,`manifest.${n}.min.js`)}`)}function P(e,t=v){return x(e,t)[0]}function C(e){if(function(){if("complete"===document.readyState)return!0;if("loading"===document.readyState)return!1;try{const e=performance.getEntriesByType("navigation")[0];if(e)return e.domContentLoadedEventEnd>0}catch(e){}return!1}())return void e();let t=!1;const n=()=>{t||(t=!0,e())};document.addEventListener("DOMContentLoaded",n,{once:!0}),window.addEventListener("load",n,{once:!0})}function I(t){if(t.hasAttribute("data-mnfst-loaded"))return!0;if(t.hasAttribute("data-mnfst-loading"))return!1;if("complete"===document.readyState)return!0;if(!t.async&&!t.defer&&e&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)return!0;try{if(t.src&&performance.getEntriesByName(t.src).length)return!0}catch(e){}return!1}function N(e,t,n=!0){return new Promise((i,o)=>{const r=document.querySelector(`script[src="${e}"]`);if(r){if(I(r))return i();let t=!1;const n=()=>{t||(t=!0,i())};r.addEventListener("load",n),r.addEventListener("error",()=>{t||(t=!0,o(new Error(`Failed to load ${e}`)))});const a=setInterval(()=>{I(r)&&(clearInterval(a),n())},50);return void setTimeout(()=>{clearInterval(a),n()},4e3)}const a=document.createElement("script");t&&(a.integrity=t,a.crossOrigin="anonymous"),a.src=e,a.async=!n,a.setAttribute("data-mnfst-loading",""),a.onload=()=>{a.removeAttribute("data-mnfst-loading"),a.setAttribute("data-mnfst-loaded",""),i()},a.onerror=()=>{a.removeAttribute("data-mnfst-loading"),a.remove(),o(new Error(`Failed to load ${e}`))},document.head.appendChild(a)})}function R(e){return e.split(/[?#]/)[0].split("/").pop()}function T(e){const t=e.match(/(alpinejs@[^/]+\/dist\/cdn\.min\.js)(?:[?#]|$)/);return t?t[1]:null}function O(e){try{const t=performance.getEntriesByName(new URL(e,location.href).href).pop();return!!t&&200===t.responseStatus}catch(e){return!1}}function W(e,t){if("warn"!==w)throw console.error(`[Manifest Loader] ${e} ${t} data-integrity="warn" loads it unchecked instead.`),Object.assign(new Error(e),{logged:!0});console.warn(`[Manifest Loader] ${e} Loading unchecked (data-integrity="warn").`)}async function q(e,t,n){for(const i of e){try{const e=await fetch(i,t?{integrity:t,mode:"cors",credentials:"omit"}:{mode:"cors",credentials:"omit"});if(e.ok)return e}catch(e){}console.error(`[Manifest Loader] ${n} failed to load${t?" or failed its integrity check":""} from ${i}`)}throw new Error(`${n} could not be ${t?"verified":"loaded"} from any CDN${t?` (expected ${t})`:""}.`)}let U=null;const z=/^sha(256|384|512)-[A-Za-z0-9+/=]+$/;function B(e,t){const n=e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:null;return"string"==typeof n&&z.test(n)?n:null}async function D(e,t){const n=B(e,t);if(n)return n;const i=B(e,p);return i&&/\/(languages|langs)\//.test(t)?(U||(U=q(_.map(e=>`${$(u,e)}/${p}`),i,p).then(e=>e.json()).catch(e=>{throw U=null,e})),B(await U,t)):null}async function F(e,{key:t=null,hash:n=null,alpine:i=!1,unchecked:o=!1,ordered:r=!0}={}){const a=g&&!o?await g:null,s=t||R(e[0]||"");let c=null;for(const o of e){let s=n;if(a){const e=t||(i?T(o):R(o));s=e&&await D(a,e)||(i?y:null),s||(i?W(`No integrity hash is known for Alpine at ${o}. Add data-alpine-integrity="sha384-…" for it, or remove data-alpine to use the default.`,"Alpine was not loaded."):W(`${e||o} has no integrity hash in this release.`,"Not loaded."))}try{return await N(o,s,r)}catch(t){c=t,s?console.error(`[Manifest Loader] ${R(o)} ${O(o)?"failed its integrity check":"failed to load or failed its integrity check"} from ${o}${e.length>1?" — trying next CDN":""}`):e.length>1&&console.warn(`[Manifest Loader] ${o} failed — trying fallback CDN`)}}throw a&&console.error(`[Manifest Loader] ${s} did not match its integrity hash on any CDN — not loaded.`),c||new Error(`Failed to load ${s}`)}const Z=new Map;async function H(e,t=v){const n=Z.get(e);if(n)return n.version!==t&&console.warn(`[Manifest Loader] ${e} already loaded at ${n.version} — ignoring request for ${t}`),n.promise;const i=async function(e,t){let n=!1;return h&&t!==u&&(W(`Integrity checks cover this loader's own version (${u}); ${e} was requested at ${t}.`,"Not loaded."),n=!0),F(x(e,t),{unchecked:n})}(e,t);return Z.set(e,{version:t,promise:i}),i.catch(()=>Z.delete(e)),i}function G(e){const t=[],n=new Set,i={native:"device",import:"export"};function o(e){if(e=i[e]||e,n.has(e))return;const r=A[e];if(r)for(const e of r)n.has(e)||o(e);t.push(e),n.add(e)}for(const t of e)o(t);return t}const V=[{magic:"$chat",plugin:"chat"},{magic:"$presence",plugin:"appwrite-presences"},{magic:"$rich",plugin:"rich-text",attr:"x-rich-text"},{plugin:"submissions",attr:"x-submit"},...["$share","$secure","$links","$push","$app","$haptics","$biometric","$camera"].map(e=>({magic:e,plugin:"device"}))].map(e=>({...e,re:e.magic?new RegExp("\\"+e.magic+"\\b"):null}));let X=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||X)return;X=!0;const e=()=>{const e=window.Alpine;if(window.ManifestRichText||!e||!e.magic||!e.reactive||window.__manifestRichStub)return;const t=window.__manifestRichStub=e.reactive({v:0}),n=window.__manifestRichStubWrites=[],i=new WeakMap,o=e=>e&&"function"==typeof e.deref?e.deref():e,r={value:"",link:"",selection:null,all:{},active:()=>!1,can:()=>!1,markdown:()=>"",html:()=>""};e.magic("rich",(e,a)=>(t.v,window.__manifestRichMagic?window.__manifestRichMagic(e,a):(e=>(i.has(e)||i.set(e,new Proxy(r,{get:(t,i)=>{const r=n.find(t=>o(t[0])===e&&t[1]===i);return r?r[2]:i in t?t[i]:"string"==typeof i?()=>{}:void 0},set:(t,i,r)=>{for(let t=n.length-1;t>=0;t--){const r=o(n[t][0]);r&&r.isConnected&&(r!==e||n[t][1]!==i)||n.splice(t,1)}return n.push(["function"==typeof WeakRef?new WeakRef(e):e,i,r]),!0}})),i.get(e)))(e)))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}();let J=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||J)return;J=!0;const e=()=>{const e=window.Alpine;if(window.__manifestEditMagic||!e||!e.magic||!e.reactive||window.__manifestEditStub)return;const t=window.__manifestEditStub=e.reactive({v:0}),n=()=>!1,i=window.__manifestEditStubWrites={},o=new Proxy({active:!1,canUndo:!1,canRedo:!1,version:0,stale:[],conflicts:[],onPublish:null,target:null,can:n,scope:()=>null,block:()=>null,patches:()=>[],export:()=>({log:[],cursor:0}),publish:()=>Promise.resolve({results:[]}),undo:()=>Promise.resolve(!1),redo:()=>Promise.resolve(!1),classes:new Proxy({},{get:()=>n})},{get:(e,t)=>t in i?i[t]:t in e?e[t]:"string"==typeof t?n:void 0,set:(e,t,n)=>(i[t]=n,!0)});e.magic("edit",(e,n)=>(t.v,window.__manifestEditMagic?window.__manifestEditMagic(e,n):o))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}(),"undefined"!=typeof document&&document.addEventListener("alpine:initialized",()=>{window.__manifestAlpineStarted=!0},{once:!0});const K=/^x-(code|code-group)$/,Y=new RegExp("\\$("+V.filter(e=>e.magic).map(e=>e.magic.slice(1)).join("|")+")\\b"),Q=new Set;function ee(e,t=("undefined"==typeof document?null:document)){const n=V.filter(t=>!e.includes(t.plugin)),i=!e.includes("components");if(0===n.length&&!i||!t)return[];const o=new Set,r=new Set(n.map(e=>e.plugin)).size+(i?1:0),a=()=>o.size===r;for(const e of t.querySelectorAll("script:not([src])")){const t=e.textContent||"";for(const e of n)e.re&&!o.has(e.plugin)&&e.re.test(t)&&o.add(e.plugin);if(a())return[...o]}const s=e=>{if(i&&!o.has("components")){const t=e.tagName.toLowerCase();t.startsWith("x-")&&!K.test(t)&&o.add("components")}for(const t of e.attributes||[]){for(const e of n)e.attr&&!o.has(e.plugin)&&(t.name===e.attr||t.name.startsWith(e.attr+"-")||t.name.startsWith(e.attr+"."))&&o.add(e.plugin);const e=t.value;if(e&&-1!==e.indexOf("$")&&!Q.has(e))if(Y.test(e))for(const t of n)t.re&&!o.has(t.plugin)&&t.re.test(e)&&o.add(t.plugin);else Q.size>2e4&&Q.clear(),Q.add(e)}},c=e=>{for(const t of e.querySelectorAll("*")){if(s(t),a())return;if("TEMPLATE"===t.tagName&&t.content&&(c(t.content),a()))return}};return 1===t.nodeType&&(s(t),"TEMPLATE"===t.tagName&&t.content&&c(t.content)),a()||c(t),[...o]}let te=!1;const ne=new Set,ie=e=>Z.has(e)||ne.has(e);function oe(e,t=v){if(!te||!e||"undefined"==typeof document)return Promise.resolve([]);let n=e;if("string"==typeof e){if(-1===e.indexOf("x-")&&-1===e.indexOf("$"))return Promise.resolve([]);n=document.createElement("template"),n.innerHTML=e,n=n.content}const i=ee([...new Set(V.map(e=>e.plugin))].filter(ie).concat("components"),n);if(!i.length)return Promise.resolve([]);const o=G(i).filter(e=>!ie(e));return Promise.all(o.map(e=>H(e,t).catch(t=>{ne.has(e)||(ne.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t))}))).then(()=>o)}function re(e){if("undefined"==typeof MutationObserver)return;const t=new Set;let n=!1;const i=new MutationObserver(o=>{for(const e of o)for(const n of e.addedNodes)1===n.nodeType&&t.add(n);!n&&t.size&&(n=!0,setTimeout(()=>{n=!1;const o=[...t].filter(e=>e.isConnected);t.clear(),o.forEach(t=>oe(t,e)),V.every(e=>ie(e.plugin))&&i.disconnect()},0))});i.observe(document.documentElement,{childList:!0,subtree:!0})}const ae={"text-edit":"rich-text"};function se(e){return e.filter(e=>{const t=e.replace(/^\+/,"");return!ae[t]||(console.warn(`[Manifest Loader] ${t} was renamed to ${ae[t]}`),!1)})}async function ce(e=v){const t=_.map(t=>`${$(e,t)}/${b(t,"manifest.tailwind.min.js")}`);let n=null;try{return await F(t)}catch(e){n=e}throw console.warn('[Manifest Loader] Tailwind plugin not available from any CDN. Load it directly: <script src="/scripts/tailwind.v4.3.1.js"><\/script>'),n||new Error("Tailwind plugin not available from CDN.")}window.Manifest={loadPlugin:function(e,t=v){if(![...E,...j,...S,...L,"payments","chat","device","native","import","tailwind"].includes(e))return ae[e]?se([e]):console.warn(`[Manifest Loader] Unknown module: ${e}`),Promise.reject(new Error(`Unknown module: ${e}`));const n=G([e]);return Promise.all(n.map(e=>H(e,t)))},loadTailwind:ce,loadVendor:function(e,t){return F(_.map(t=>`${t}/${e}`),{key:e,hash:t,ordered:!1})},fetchVendor:async function(e,t){const n=g?await g:null;let i=t||null;return n&&(i=await D(n,e),i||W(`${e} has no integrity hash in this release.`,"Not loaded.")),q(_.map(t=>`${t}/${e}`),i,e)},get integrity(){return h},getPluginUrl:P,getModuleUrl:P,loadUsed:oe},window.Manifest.loadModule=window.Manifest.loadPlugin;const de="/sw.js";const le={registered:!1,version:null,kill:()=>ue(null)};async function ue(e){le.registered=!1;try{const t=e||await navigator.serviceWorker.getRegistration(de);if(t){const e=t.active||t.waiting||t.installing;try{e&&e.postMessage({type:"manifest:sw",action:"kill"})}catch(e){}await t.unregister()}}catch(e){}try{if(window.caches){const e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith("mnfst-sw:")).map(e=>caches.delete(e)))}}catch(e){}}async function fe(e){const t=e.sw,n="on"===t,i=n?(...e)=>console.info("[Manifest SW]",...e):()=>{};if(!navigator.serviceWorker)return i("skip: unsupported");const o=window.location,r=!!window.__mnfstRun,a=function(e){const t=String(e||"").toLowerCase();return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t||"0.0.0.0"===t||t.endsWith(".localhost")||t.endsWith(".local")}(o.hostname);let s=window.__manifestLoaded||null;if(!s&&window.__manifestPromise&&(s=await window.__manifestPromise.catch(()=>null)),!s){const e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json";s=await fetch(e).then(e=>e.ok?e.json():null).catch(()=>null)}const c="off"===t||s&&!1===s.sw,d=await navigator.serviceWorker.getRegistration(de).catch(()=>null);if(c||r||a&&!n)return i("skip:",c?"kill switch":r?"mnfst-run":"dev origin",d?"(unregistering)":""),void await ue(d);if(!("https:"===o.protocol||n&&window.isSecureContext))return i("skip: not https");let l=null;try{l=sessionStorage.getItem("manifest:sw-probe")}catch(e){}const u="strict"===w;if("ok"!==l||u){const e=await fetch(de,{cache:"no-store"}).catch(()=>null),t=e&&e.headers.get("content-type")||"";if(!e||!e.ok||!/javascript|ecmascript/i.test(t))return i("skip: no stub",e&&e.status,t);if(u&&(f=await e.text().catch(()=>""),(String(f).match(/importScripts\s*\(([^)]*)\)/g)||[]).some(e=>(e.match(/https?:\/\/[^'"`\s)]+/g)||[]).some(e=>{try{return new URL(e).origin!==location.origin}catch(e){return!0}}))))return console.warn(`[Manifest Loader] ${de} imports its worker module from another origin, which integrity checks can't cover, so the service worker stays off. Serve the module from this origin (copy lib/manifest.sw.min.js into ${de}), set data-sw="off", or set data-integrity="warn" to register it anyway.`),void await ue(d);try{sessionStorage.setItem("manifest:sw-probe","ok")}catch(e){}}var f;const m=s&&"string"==typeof s.deployment?s.deployment:"",p=`${de}?v=${encodeURIComponent(e.version)}&d=${encodeURIComponent(m)}`,g=await navigator.serviceWorker.register(p,{scope:"/"});le.registered=!0,le.version=e.version,i("registered",p,g.active?"active":g.installing?"installing":"waiting")}window.Manifest.swStub=function(e=l){const t=`mnfst@${String(e||l).replace(/[^\w.+-]/g,"")}/lib/manifest.sw.min.js`;return`try { importScripts('https://cdn.manifestx.dev/npm/${t}'); } catch (e) { importScripts('https://cdn.jsdelivr.net/npm/${t}'); }\nif (!self.__mnfstSw) self.addEventListener('activate', function () { self.registration.unregister(); });\n`},window.Manifest.sw=le;const me=function(){let e=document.currentScript;if(e||(e=document.querySelector('script[src*="manifest.js"]')),!e)return null;const t=e.getAttribute("data-modules")??e.getAttribute("data-plugins"),n=e.getAttribute("data-omit"),i=null!==e.getAttribute("data-tailwind"),o=e.getAttribute("data-version")||l,r=!!e.getAttribute("data-version"),a=e.getAttribute("data-alpine"),s=(e.getAttribute("data-integrity")??"").trim().toLowerCase(),c=/^(off|false)$/.test(s)?null:"warn"===s?"warn":e.hasAttribute("data-integrity")||e.getAttribute("integrity")?"strict":null,d=e.getAttribute("data-module-base")??e.getAttribute("data-plugin-base"),u=e.getAttribute("data-cdn"),f=e.getAttribute("data-sw");let m=[],p=[],w=!t;if(t){const e=se(t.split(",").map(e=>e.trim()).filter(e=>e));p=e.filter(e=>e.startsWith("+")).map(e=>e.slice(1));const n=e.filter(e=>!e.startsWith("+"));n.length>0?m=[...n,...p]:(w=!0,m=E.slice())}else m=E.slice();if(n&&m.length>0){const e=n.split(",").map(e=>e.trim());m=m.filter(t=>!e.includes(t))}return m=G(m),{plugins:m,extraPlugins:p,deriveFromManifest:w,tailwind:i,version:o,versionSet:r,alpine:a,alpineIntegrity:e.getAttribute("data-alpine-integrity"),integrity:c,pluginBase:d,cdn:u,sw:f}}();var pe;if(me&&me.version&&(v=me.version),me&&me.pluginBase&&(pe=me.pluginBase,M=pe||null),me&&me.cdn&&function(e){if(!e)return;const t=e.split(",").map(e=>e.trim().replace(/\/$/,"")).filter(Boolean);t.length&&(_=t)}(me.cdn),me&&me.integrity&&(w=me.integrity,!me.versionSet&&f&&(v=me.version=u),h=me.version===u,y=me.alpineIntegrity&&z.test(me.alpineIntegrity.trim())?me.alpineIntegrity.trim():null,g=async function(e){if(e.version!==u)return W(`Integrity checks cover this loader's own version (${u}), but data-version is "${e.version}". Set data-version="${u}" or remove it.`,"No modules were loaded."),null;const t=M?[`${M.replace(/\/$/,"")}/${m}`]:_.map(e=>`${$(u,e)}/${m}`);try{return await(await q(t,f,m)).json()}catch(e){throw new Error(`${e.message} No modules were loaded.`)}}(me),g.catch(()=>{})),function(e){if(!e||window.__manifestSwArmed)return;const t=window.__manifestSwArmed={};let n=!1;const i=()=>{if(!n&&window.__manifestSwArmed===t){n=!0;try{fe(e).catch(()=>{})}catch(e){}}};setTimeout(()=>{if(window.__manifestReady)return i();window.addEventListener("manifest:ready",i,{once:!0}),window.__manifestLoaderStarted||("complete"===document.readyState?setTimeout(i,0):window.addEventListener("load",i,{once:!0}))},0)}(me),me&&me.plugins.length>0){if(window.__manifestLoaderStarted)return;window.__manifestLoaderStarted=!0;const ve=["data","localization","components","appwrite-auth","appwrite-data","appwrite-presences","payments","chat"],_e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json",be=new Set,$e=e=>{if(null===e||"object"!=typeof e)return;const t=e=>e.replace(/\$\{([^}]+)\}/g,(e,t)=>"undefined"!=typeof window&&window.env&&void 0!==window.env[t]?window.env[t]:(be.has(t)||(be.add(t),t.startsWith("PUBLIC_")?console.warn(`[Manifest] manifest.json references \${${t}}, but it is not present in window.env. Add ${t}=… to .env (read by mnfst-run) or set it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`):console.warn(`[Manifest] manifest.json references \${${t}}, but only PUBLIC_-prefixed env vars are injected into window.env by mnfst-run. Rename to PUBLIC_${t}, hardcode the value, or supply it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`)),e)),n=e=>{if(Array.isArray(e))for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}else for(const i of Object.keys(e)){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}};n(e)},Ee=()=>window.__manifestLoaded?Promise.resolve(window.__manifestLoaded):(window.__manifestPromise||(window.__manifestPromise=fetch(_e).then(e=>e.ok?e.json():null).then(e=>(e&&!e.__interpolated&&($e(e),Object.defineProperty(e,"__interpolated",{value:!0,enumerable:!1})),e)).catch(()=>null)),window.__manifestPromise);function ke(e,t){if(window.__manifestReadyCoordinator)return;window.__manifestReadyCoordinator=!0;const n=window.ManifestPending.hold("ready"),i=!!t,o={data:!e.some(e=>"data"===e||"appwrite-data"===e)||!!window.__manifestRenderReady,utilities:!i||!!window.__manifestUtilitiesReady};let r=!1,a=null;const s=()=>!(window.__manifestMarkdownPending>0),c=()=>!(window.__manifestUtilitiesPending>0),d=()=>{r||(r=!0,n(),window.__manifestReady=!0,window.dispatchEvent(new CustomEvent("manifest:ready")))},l=()=>{r||o.data&&o.utilities&&s()&&c()&&(clearTimeout(a),a=setTimeout(()=>{o.data&&o.utilities&&s()&&c()&&d()},300))};window.addEventListener("manifest:render-ready",()=>{o.data=!0,l()}),window.addEventListener("manifest:utilities-ready",()=>{o.utilities=!0,l()}),window.addEventListener("manifest:utilities-idle",l),window.addEventListener("manifest:markdown-idle",l),setTimeout(d,15e3),l()}(async()=>{if(g){(me.deriveFromManifest||me.plugins.some(e=>ve.includes(e)))&&Ee();try{await g}catch(e){return void(e.logged||console.error(`[Manifest Loader] ${e.message}`))}}let e=null,t=me.plugins,n=null;if(me.deriveFromManifest){e=await Ee();const n=function(e){if(!e||"object"!=typeof e)return E.slice();const t=e.data&&"object"==typeof e.data&&Object.keys(e.data).length>0,n=e.components?.length>0||e.preloadedComponents?.length>0,i=(()=>{if(!e.data||"object"!=typeof e.data)return!1;for(const t of Object.values(e.data))if(t&&"object"==typeof t){if("string"==typeof t.locales)return!0;for(const e of Object.keys(t))if(!["url","headers","params","transform","defaultValue","locales"].includes(e)&&/^[a-zA-Z]{2}(-[a-zA-Z]{2})?$/.test(e))return!0}return!1})(),o=e.status&&"object"==typeof e.status&&Object.keys(e.status).length>0;return E.filter(e=>"data"===e?t:"localization"===e?i:"components"===e?n:"status"!==e||o)}(e),i=function(e){if(!e||"object"!=typeof e)return[];if(!(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&(e.appwriteTableId||e.appwriteDatabaseId||e.appwriteBucketId))))return[];const t=[];return e.appwrite?.auth&&t.push("appwrite-auth"),(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&e.appwriteTableId))&&t.push("appwrite-data"),(e.appwrite?.presence||e.appwrite?.presences)&&t.push("appwrite-presences"),t}(e),o=function(e){return e&&"object"==typeof e&&e.payments&&"object"==typeof e.payments?["payments"]:[]}(e),r=function(e){return e&&"object"==typeof e&&(e.ai||e.chat)?["chat"]:[]}(e),a=function(e){if("undefined"!=typeof window&&window.Capacitor)return["device"];const t=e&&"object"==typeof e?e.device??e.native:null;return t&&"object"==typeof t?["device"]:[]}(e);t=G([...k,...n,...i,...o,...r,...a,...me.extraPlugins||[]])}else{t=G([...k,...t.filter(e=>!k.includes(e))]);me.plugins.some(e=>ve.includes(e))&&(n=Ee()),"undefined"!=typeof window&&window.Capacitor&&!t.includes("device")&&(t=G([...t,"device"]))}const i=t.map(e=>H(e,me.version).catch(t=>{console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)}));me.tailwind&&!function(){try{return!!document.querySelector("style[data-mnfst-utilities][data-mnfst-utilities-complete]")}catch(e){return!1}}()&&i.push(ce(me.version).catch(()=>{})),await Promise.all(i),n&&(e=await n),e&&"undefined"!=typeof window&&(window.__manifestLoaded=e,window.ManifestComponentsRegistry&&(window.ManifestComponentsRegistry.manifest=e)),C(async()=>{if(me.deriveFromManifest){try{const e=ee(t);if(e.length>0){const n=G(e).filter(e=>!t.includes(e));await Promise.all(n.map(e=>H(e,me.version).catch(t=>{ne.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)})))}}catch(e){}te=!0,re(me.version)}var e;ke(t,me.tailwind),e=function(e){if(e&&(e.startsWith("http")||e.startsWith("/")))return[e];const t=e||"3.17.5";return _.map(e=>`${e}/alpinejs@${t}/dist/cdn.min.js`)}(me.alpine),C(()=>{window.Alpine||document.querySelector('script[src*="alpinejs"]')||F(e,{alpine:!0}).catch(e=>{e.logged||console.error("[Manifest Loader] Alpine.js failed to load from all CDNs.")})})})})()}}();
|
|
1
|
+
!function(){"use strict";const e=document.currentScript;if(!window.ManifestPending){const we=new Map;let ge=0;window.ManifestPending={hold(e="work"){const t=++ge;return we.set(t,e),()=>{we.delete(t)}},get count(){return we.size+(window.__manifestMarkdownPending||0)+(window.__manifestUtilitiesPending||0)},labels(){const e=[...we.values()];return window.__manifestMarkdownPending>0&&e.push("markdown"),window.__manifestUtilitiesPending>0&&e.push("utilities"),e},background:e=>("function"==typeof e&&(e.__manifestBackground=!0),e)}}const t=new Set,n=new WeakSet;let i=!1;function o(){for(const e of[...t])e.settle()}function r(){i||(i=!0,queueMicrotask(()=>{i=!1,o()}))}function a(e){for(let t=e.parentNode;t;t=t.parentNode)if(t._x_ignore)return!0;return!1}function s(e,i){const s=window.Alpine,c=e.getAttribute("x-if");let d=!e.closest("[x-data],[x-init]"),l=!1,u=null;const f=()=>!!s.evaluate(e,c),m=()=>{u&&(u(),u=null)},p=()=>{t.delete(y),m()},w=()=>{d=!1,l=!1,m(),i._x_ignore=!0,t.add(y)},g=()=>{p(),s.mutateDom(()=>{s.destroyTree(i),i.remove()}),delete e._x_currentIfEl,delete e._x_lastRenderedEl,r()},h=()=>{d||e._x_currentIfEl!==i||!i.isConnected||a(e)||(d=!0,l=!1,p(),delete i._x_ignore,s.initTree(i),o())},y={settle(){if(!d&&!l)return e._x_currentIfEl!==i?p():void(i.isConnected?e._x_marker&&!a(e)&&f()&&h():i.getRootNode()instanceof DocumentFragment||p())}},v=()=>window.__manifestReady||!window.__manifestReadyCoordinator?g():(queueMicrotask(()=>{e._x_currentIfEl===i&&(e._x_undoIf=v,(()=>{if(u||!l||e._x_currentIfEl!==i||a(e))return;const t=s.evaluateLater(e,c),n=s.effect(()=>t(e=>{e&&queueMicrotask(()=>{l&&f()&&h()})}));u=()=>s.release(n)})())}),a(e)?w():(d&&(d=!1,i._x_ignore=!0,s.destroyTree(i),t.add(y)),void(l||(l=!0,window.addEventListener("manifest:ready",()=>{if(l&&e._x_currentIfEl===i){if(e.isConnected&&a(e))return w();if(e.isConnected&&f())return h();g(),delete e._x_undoIf}},{once:!0})))));e._x_currentIfEl=i,e._x_lastRenderedEl=i,e._x_undoIf=v,n.add(e),d||(i._x_ignore=!0,t.add(y))}function c(e,t){e.querySelectorAll("template").forEach(e=>{const n=t||e.matches("[x-if],[x-for]");n&&e.content.querySelectorAll("[data-pre-rendered]").forEach(e=>{e.tagName.startsWith("X-")&&e.removeAttribute("data-pre-rendered")}),c(e.content,n)})}function d(){try{!function(){if("undefined"==typeof document||!document.querySelector)return;const e=document.querySelector('meta[name="manifest:prerendered"]');if(!e||"0"===e.getAttribute("content"))return;const t=document.getElementById("__manifest_hydrate__");if(!t)return;let n;try{n=JSON.parse(t.textContent||"[]")}catch(e){n=[]}if(!Array.isArray(n)||0===n.length)return void t.remove();const i=e=>String(null==e?"":e).replace(/&/g,"&").replace(/"/g,"""),o=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),r=[];for(const e of n){const t=document.querySelector('[data-hydrate-id="'+e.id+'"]');if(!t)continue;let n=0;for(let e=t.parentNode;e;e=e.parentNode)n++;r.push({entry:e,el:t,depth:n})}r.sort((e,t)=>t.depth-e.depth);for(const{entry:e,el:t}of r){const n=document.querySelector('[data-hydrate-id="'+e.id+'"]')||t;if(!n||!n.parentNode)continue;if("string"==typeof e.html){const t=n.tagName.toLowerCase(),r={},a=n.attributes;for(let e=0;e<a.length;e++)"data-hydrate-id"!==a[e].name&&(r[a[e].name]=a[e].value);if(e.attrs)for(const t in e.attrs){const n=e.attrs[t];null===n?delete r[t]:r[t]=n}const s=Object.keys(r).map(e=>e+'="'+i(r[e])+'"').join(" "),c=o.has(t)?"<"+t+" "+s+">":"<"+t+" "+s+">"+e.html+"</"+t+">",d=document.createElement("div");d.innerHTML=c;const l=d.firstElementChild;if(l)try{n.parentNode.replaceChild(l,n)}catch(e){}continue}if(!e.attrs)continue;const r=n.tagName.toLowerCase(),a={},s=n.attributes;for(let e=0;e<s.length;e++)"data-hydrate-id"!==s[e].name&&(a[s[e].name]=s[e].value);for(const t in e.attrs){const n=e.attrs[t];null===n?delete a[t]:a[t]=n}const c=Object.keys(a).map(e=>e+'="'+i(a[e])+'"').join(" "),d=o.has(r),l=d?"":n.innerHTML,u=d?"<"+r+" "+c+">":"<"+r+" "+c+">"+l+"</"+r+">",f=document.createElement("div");f.innerHTML=u;const m=f.firstElementChild;if(m)try{n.parentNode.replaceChild(m,n)}catch(e){}}t.remove()}()}catch(e){}}if("undefined"!=typeof document&&document.addEventListener("alpine:init",function(){if("undefined"==typeof document||!document.querySelectorAll)return;c(document);let e=0;if(document.querySelectorAll("[data-mnfst-prerender-clone]").forEach(t=>{if(t.closest&&t.closest("[data-hydrate]"))return;t.removeAttribute("data-mnfst-prerender-clone");const n=t.previousElementSibling;n&&"TEMPLATE"===n.tagName&&n.hasAttribute("x-if")?(s(n,t),e++):t.remove()}),!e)return;const i=window.Alpine;"function"==typeof i.interceptInit&&i.interceptInit(e=>{n.has(e)&&t.size&&r()}),document.addEventListener("alpine:initialized",o,{once:!0})},{once:!0}),"undefined"!=typeof document)if("loading"===document.readyState){let he=!1;document.addEventListener("readystatechange",()=>{he||"loading"===document.readyState||(he=!0,d())})}else d();if("undefined"!=typeof window&&"undefined"!=typeof document){let ye=null;window.addEventListener("resize",()=>{document.documentElement.classList.add("window-resizing"),ye&&clearTimeout(ye),ye=setTimeout(()=>{document.documentElement.classList.remove("window-resizing"),ye=null},200)},{passive:!0})}const l="latest",u="0.5.324",f="sha384-7kidkTng5XzgpLM9hmnBX+CxH+g9EFOiNbV9/BEFmxRd8r4Z1fprL5r95Hgsrm2x",m="manifest.modules.integrity.json",p="manifest.vendor.integrity.json";let w=null,g=null,h=!1,y=null,v=l,_=["https://cdn.manifestx.dev/npm","https://cdn.jsdelivr.net/npm","https://unpkg.com"];function b(e,t){return e.includes("unpkg.com")?t.replace(/\.min\.js$/,".js"):t}function $(e=l,t=_[0]){return`${t}/mnfst@${e}/lib`}const E=["components","router","utilities","data","icons","localization","markdown","svg","code","color","toasts","tooltips","dropdowns","combobox","computed","tabs","slides","colorpicker","datepicker","charts","url-parameters","virtual","export","status"],k=["defer","bindings"],L=["edit"],S=["appwrite-auth","appwrite-data","appwrite-presences"],M=["rich-text","submissions"],j={"appwrite-data":["data"],"appwrite-presences":["data","appwrite-auth"],device:["utilities"],edit:["rich-text"]};let x=null;function A(e,t=v){const n=e.replace(/-/g,".");if(x){return[`${x.replace(/\/$/,"")}/manifest.${n}.js`]}return _.map(e=>`${$(t,e)}/${b(e,`manifest.${n}.min.js`)}`)}function P(e,t=v){return A(e,t)[0]}function C(e){if(function(){if("complete"===document.readyState)return!0;if("loading"===document.readyState)return!1;try{const e=performance.getEntriesByType("navigation")[0];if(e)return e.domContentLoadedEventEnd>0}catch(e){}return!1}())return void e();let t=!1;const n=()=>{t||(t=!0,e())};document.addEventListener("DOMContentLoaded",n,{once:!0}),window.addEventListener("load",n,{once:!0})}function N(t){if(t.hasAttribute("data-mnfst-loaded"))return!0;if(t.hasAttribute("data-mnfst-loading"))return!1;if("complete"===document.readyState)return!0;if(!t.async&&!t.defer&&e&&e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_PRECEDING)return!0;try{if(t.src&&performance.getEntriesByName(t.src).length)return!0}catch(e){}return!1}function I(e,t,n=!0){return new Promise((i,o)=>{const r=document.querySelector(`script[src="${e}"]`);if(r){if(N(r))return i();let t=!1;const n=()=>{t||(t=!0,i())};r.addEventListener("load",n),r.addEventListener("error",()=>{t||(t=!0,o(new Error(`Failed to load ${e}`)))});const a=setInterval(()=>{N(r)&&(clearInterval(a),n())},50);return void setTimeout(()=>{clearInterval(a),n()},4e3)}const a=document.createElement("script");t&&(a.integrity=t,a.crossOrigin="anonymous"),a.src=e,a.async=!n,a.setAttribute("data-mnfst-loading",""),a.onload=()=>{a.removeAttribute("data-mnfst-loading"),a.setAttribute("data-mnfst-loaded",""),i()},a.onerror=()=>{a.removeAttribute("data-mnfst-loading"),a.remove(),o(new Error(`Failed to load ${e}`))},document.head.appendChild(a)})}function R(e){return e.split(/[?#]/)[0].split("/").pop()}function T(e){const t=e.match(/(alpinejs@[^/]+\/dist\/cdn\.min\.js)(?:[?#]|$)/);return t?t[1]:null}function O(e){try{const t=performance.getEntriesByName(new URL(e,location.href).href).pop();return!!t&&200===t.responseStatus}catch(e){return!1}}function W(e,t){if("warn"!==w)throw console.error(`[Manifest Loader] ${e} ${t} data-integrity="warn" loads it unchecked instead.`),Object.assign(new Error(e),{logged:!0});console.warn(`[Manifest Loader] ${e} Loading unchecked (data-integrity="warn").`)}async function q(e,t,n){for(const i of e){try{const e=await fetch(i,t?{integrity:t,mode:"cors",credentials:"omit"}:{mode:"cors",credentials:"omit"});if(e.ok)return e}catch(e){}console.error(`[Manifest Loader] ${n} failed to load${t?" or failed its integrity check":""} from ${i}`)}throw new Error(`${n} could not be ${t?"verified":"loaded"} from any CDN${t?` (expected ${t})`:""}.`)}let z=null;const U=/^sha(256|384|512)-[A-Za-z0-9+/=]+$/;function B(e,t){const n=e&&Object.prototype.hasOwnProperty.call(e,t)?e[t]:null;return"string"==typeof n&&U.test(n)?n:null}async function D(e,t){const n=B(e,t);if(n)return n;const i=B(e,p);return i&&/\/(languages|langs)\//.test(t)?(z||(z=q(_.map(e=>`${$(u,e)}/${p}`),i,p).then(e=>e.json()).catch(e=>{throw z=null,e})),B(await z,t)):null}async function F(e,{key:t=null,hash:n=null,alpine:i=!1,unchecked:o=!1,ordered:r=!0}={}){const a=g&&!o?await g:null,s=t||R(e[0]||"");let c=null;for(const o of e){let s=n;if(a){const e=t||(i?T(o):R(o));s=e&&await D(a,e)||(i?y:null),s||(i?W(`No integrity hash is known for Alpine at ${o}. Add data-alpine-integrity="sha384-…" for it, or remove data-alpine to use the default.`,"Alpine was not loaded."):W(`${e||o} has no integrity hash in this release.`,"Not loaded."))}try{return await I(o,s,r)}catch(t){c=t,s?console.error(`[Manifest Loader] ${R(o)} ${O(o)?"failed its integrity check":"failed to load or failed its integrity check"} from ${o}${e.length>1?" — trying next CDN":""}`):e.length>1&&console.warn(`[Manifest Loader] ${o} failed — trying fallback CDN`)}}throw a&&console.error(`[Manifest Loader] ${s} did not match its integrity hash on any CDN — not loaded.`),c||new Error(`Failed to load ${s}`)}const H=new Map;async function V(e,t=v){const n=H.get(e);if(n)return n.version!==t&&console.warn(`[Manifest Loader] ${e} already loaded at ${n.version} — ignoring request for ${t}`),n.promise;const i=async function(e,t){let n=!1;return h&&t!==u&&(W(`Integrity checks cover this loader's own version (${u}); ${e} was requested at ${t}.`,"Not loaded."),n=!0),F(A(e,t),{unchecked:n})}(e,t);return H.set(e,{version:t,promise:i}),i.catch(()=>H.delete(e)),i}function Z(e){const t=[],n=new Set,i={native:"device",import:"export"};function o(e){if(e=i[e]||e,n.has(e))return;const r=j[e];if(r)for(const e of r)n.has(e)||o(e);t.push(e),n.add(e)}for(const t of e)o(t);return t}const X=[{magic:"$chat",plugin:"chat"},{magic:"$presence",plugin:"appwrite-presences"},{magic:"$rich",plugin:"rich-text",attr:"x-rich-text"},{plugin:"submissions",attr:"x-submit"},...["$share","$secure","$links","$push","$app","$haptics","$biometric","$camera"].map(e=>({magic:e,plugin:"device"}))].map(e=>({...e,re:e.magic?new RegExp("\\"+e.magic+"\\b"):null}));let G=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||G)return;G=!0;const e=()=>{const e=window.Alpine;if(window.ManifestRichText||!e||!e.magic||!e.reactive||window.__manifestRichStub)return;const t=window.__manifestRichStub=e.reactive({v:0}),n=window.__manifestRichStubWrites=[],i=new WeakMap,o=e=>e&&"function"==typeof e.deref?e.deref():e,r={value:"",link:"",selection:null,all:{},active:()=>!1,can:()=>!1,markdown:()=>"",html:()=>""};e.magic("rich",(e,a)=>(t.v,window.__manifestRichMagic?window.__manifestRichMagic(e,a):(e=>(i.has(e)||i.set(e,new Proxy(r,{get:(t,i)=>{const r=n.find(t=>o(t[0])===e&&t[1]===i);return r?r[2]:i in t?t[i]:"string"==typeof i?()=>{}:void 0},set:(t,i,r)=>{for(let t=n.length-1;t>=0;t--){const r=o(n[t][0]);r&&r.isConnected&&(r!==e||n[t][1]!==i)||n.splice(t,1)}return n.push(["function"==typeof WeakRef?new WeakRef(e):e,i,r]),!0}})),i.get(e)))(e)))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}();let J=!1;!function(){if("undefined"==typeof window||"undefined"==typeof document||J)return;J=!0;const e=()=>{const e=window.Alpine;if(window.__manifestEditMagic||!e||!e.magic||!e.reactive||window.__manifestEditStub)return;const t=window.__manifestEditStub=e.reactive({v:0}),n=()=>!1,i=window.__manifestEditStubWrites={},o=new Proxy({active:!1,canUndo:!1,canRedo:!1,version:0,stale:[],conflicts:[],onPublish:null,target:null,can:n,scope:()=>null,block:()=>null,patches:()=>[],export:()=>({log:[],cursor:0}),publish:()=>Promise.resolve({results:[]}),undo:()=>Promise.resolve(!1),redo:()=>Promise.resolve(!1),classes:new Proxy({},{get:()=>n})},{get:(e,t)=>t in i?i[t]:t in e?e[t]:"string"==typeof t?n:void 0,set:(e,t,n)=>(i[t]=n,!0)});e.magic("edit",(e,n)=>(t.v,window.__manifestEditMagic?window.__manifestEditMagic(e,n):o))};document.addEventListener("alpine:init",e,{once:!0}),window.Alpine&&window.Alpine.magic&&e()}(),"undefined"!=typeof document&&document.addEventListener("alpine:initialized",()=>{window.__manifestAlpineStarted=!0},{once:!0});const K=/^x-(code|code-group)$/,Q=new RegExp("\\$("+X.filter(e=>e.magic).map(e=>e.magic.slice(1)).join("|")+")\\b"),Y=new Set;function ee(e,t=("undefined"==typeof document?null:document)){const n=X.filter(t=>!e.includes(t.plugin)),i=!e.includes("components");if(0===n.length&&!i||!t)return[];const o=new Set,r=new Set(n.map(e=>e.plugin)).size+(i?1:0),a=()=>o.size===r;for(const e of t.querySelectorAll("script:not([src])")){const t=e.textContent||"";for(const e of n)e.re&&!o.has(e.plugin)&&e.re.test(t)&&o.add(e.plugin);if(a())return[...o]}const s=e=>{if(i&&!o.has("components")){const t=e.tagName.toLowerCase();t.startsWith("x-")&&!K.test(t)&&o.add("components")}for(const t of e.attributes||[]){for(const e of n)e.attr&&!o.has(e.plugin)&&(t.name===e.attr||t.name.startsWith(e.attr+"-")||t.name.startsWith(e.attr+"."))&&o.add(e.plugin);const e=t.value;if(e&&-1!==e.indexOf("$")&&!Y.has(e))if(Q.test(e))for(const t of n)t.re&&!o.has(t.plugin)&&t.re.test(e)&&o.add(t.plugin);else Y.size>2e4&&Y.clear(),Y.add(e)}},c=e=>{for(const t of e.querySelectorAll("*")){if(s(t),a())return;if("TEMPLATE"===t.tagName&&t.content&&(c(t.content),a()))return}};return 1===t.nodeType&&(s(t),"TEMPLATE"===t.tagName&&t.content&&c(t.content)),a()||c(t),[...o]}let te=!1;const ne=new Set,ie=e=>H.has(e)||ne.has(e);function oe(e,t=v){if(!te||!e||"undefined"==typeof document)return Promise.resolve([]);let n=e;if("string"==typeof e){if(-1===e.indexOf("x-")&&-1===e.indexOf("$"))return Promise.resolve([]);n=document.createElement("template"),n.innerHTML=e,n=n.content}const i=ee([...new Set(X.map(e=>e.plugin))].filter(ie).concat("components"),n);if(!i.length)return Promise.resolve([]);const o=Z(i).filter(e=>!ie(e));return Promise.all(o.map(e=>V(e,t).catch(t=>{ne.has(e)||(ne.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t))}))).then(()=>o)}function re(e){if("undefined"==typeof MutationObserver)return;const t=new Set;let n=!1;const i=new MutationObserver(o=>{for(const e of o)for(const n of e.addedNodes)1===n.nodeType&&t.add(n);!n&&t.size&&(n=!0,setTimeout(()=>{n=!1;const o=[...t].filter(e=>e.isConnected);t.clear(),o.forEach(t=>oe(t,e)),X.every(e=>ie(e.plugin))&&i.disconnect()},0))});i.observe(document.documentElement,{childList:!0,subtree:!0})}const ae={"text-edit":"rich-text"};function se(e){return e.filter(e=>{const t=e.replace(/^\+/,"");return!ae[t]||(console.warn(`[Manifest Loader] ${t} was renamed to ${ae[t]}`),!1)})}async function ce(e=v){const t=_.map(t=>`${$(e,t)}/${b(t,"manifest.tailwind.min.js")}`);let n=null;try{return await F(t)}catch(e){n=e}throw console.warn('[Manifest Loader] Tailwind plugin not available from any CDN. Load it directly: <script src="/scripts/tailwind.v4.3.1.js"><\/script>'),n||new Error("Tailwind plugin not available from CDN.")}window.Manifest={loadPlugin:function(e,t=v){if(![...E,...M,...S,...L,"payments","chat","device","native","import","tailwind"].includes(e))return ae[e]?se([e]):console.warn(`[Manifest Loader] Unknown module: ${e}`),Promise.reject(new Error(`Unknown module: ${e}`));const n=Z([e]);return Promise.all(n.map(e=>V(e,t)))},loadTailwind:ce,loadVendor:function(e,t){return F(_.map(t=>`${t}/${e}`),{key:e,hash:t,ordered:!1})},fetchVendor:async function(e,t){const n=g?await g:null;let i=t||null;return n&&(i=await D(n,e),i||W(`${e} has no integrity hash in this release.`,"Not loaded.")),q(_.map(t=>`${t}/${e}`),i,e)},get integrity(){return h},getPluginUrl:P,getModuleUrl:P,loadUsed:oe},window.Manifest.loadModule=window.Manifest.loadPlugin;const de="/sw.js";const le={registered:!1,version:null,kill:()=>ue(null)};async function ue(e){le.registered=!1;try{const t=e||await navigator.serviceWorker.getRegistration(de);if(t){const e=t.active||t.waiting||t.installing;try{e&&e.postMessage({type:"manifest:sw",action:"kill"})}catch(e){}await t.unregister()}}catch(e){}try{if(window.caches){const e=await caches.keys();await Promise.all(e.filter(e=>e.startsWith("mnfst-sw:")).map(e=>caches.delete(e)))}}catch(e){}}async function fe(e){const t=e.sw,n="on"===t,i=n?(...e)=>console.info("[Manifest SW]",...e):()=>{};if(!navigator.serviceWorker)return i("skip: unsupported");const o=window.location,r=!!window.__mnfstRun,a=function(e){const t=String(e||"").toLowerCase();return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||"::1"===t||"0.0.0.0"===t||t.endsWith(".localhost")||t.endsWith(".local")}(o.hostname);let s=window.__manifestLoaded||null;if(!s&&window.__manifestPromise&&(s=await window.__manifestPromise.catch(()=>null)),!s){const e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json";s=await fetch(e).then(e=>e.ok?e.json():null).catch(()=>null)}const c="off"===t||s&&!1===s.sw,d=await navigator.serviceWorker.getRegistration(de).catch(()=>null);if(c||r||a&&!n)return i("skip:",c?"kill switch":r?"mnfst-run":"dev origin",d?"(unregistering)":""),void await ue(d);if(!("https:"===o.protocol||n&&window.isSecureContext))return i("skip: not https");let l=null;try{l=sessionStorage.getItem("manifest:sw-probe")}catch(e){}const u="strict"===w;if("ok"!==l||u){const e=await fetch(de,{cache:"no-store"}).catch(()=>null),t=e&&e.headers.get("content-type")||"";if(!e||!e.ok||!/javascript|ecmascript/i.test(t))return i("skip: no stub",e&&e.status,t);if(u&&(f=await e.text().catch(()=>""),(String(f).match(/importScripts\s*\(([^)]*)\)/g)||[]).some(e=>(e.match(/https?:\/\/[^'"`\s)]+/g)||[]).some(e=>{try{return new URL(e).origin!==location.origin}catch(e){return!0}}))))return console.warn(`[Manifest Loader] ${de} imports its worker module from another origin, which integrity checks can't cover, so the service worker stays off. Serve the module from this origin (copy lib/manifest.sw.min.js into ${de}), set data-sw="off", or set data-integrity="warn" to register it anyway.`),void await ue(d);try{sessionStorage.setItem("manifest:sw-probe","ok")}catch(e){}}var f;const m=s&&"string"==typeof s.deployment?s.deployment:"",p=`${de}?v=${encodeURIComponent(e.version)}&d=${encodeURIComponent(m)}`,g=await navigator.serviceWorker.register(p,{scope:"/"});le.registered=!0,le.version=e.version,i("registered",p,g.active?"active":g.installing?"installing":"waiting")}window.Manifest.swStub=function(e=l){const t=`mnfst@${String(e||l).replace(/[^\w.+-]/g,"")}/lib/manifest.sw.min.js`;return`try { importScripts('https://cdn.manifestx.dev/npm/${t}'); } catch (e) { importScripts('https://cdn.jsdelivr.net/npm/${t}'); }\nif (!self.__mnfstSw) self.addEventListener('activate', function () { self.registration.unregister(); });\n`},window.Manifest.sw=le;const me=function(){let e=document.currentScript;if(e||(e=document.querySelector('script[src*="manifest.js"]')),!e)return null;const t=e.getAttribute("data-modules")??e.getAttribute("data-plugins"),n=e.getAttribute("data-omit"),i=null!==e.getAttribute("data-tailwind"),o=e.getAttribute("data-version")||l,r=!!e.getAttribute("data-version"),a=e.getAttribute("data-alpine"),s=(e.getAttribute("data-integrity")??"").trim().toLowerCase(),c=/^(off|false)$/.test(s)?null:"warn"===s?"warn":e.hasAttribute("data-integrity")||e.getAttribute("integrity")?"strict":null,d=e.getAttribute("data-module-base")??e.getAttribute("data-plugin-base"),u=e.getAttribute("data-cdn"),f=e.getAttribute("data-sw");let m=[],p=[],w=!t;if(t){const e=se(t.split(",").map(e=>e.trim()).filter(e=>e));p=e.filter(e=>e.startsWith("+")).map(e=>e.slice(1));const n=e.filter(e=>!e.startsWith("+"));n.length>0?m=[...n,...p]:(w=!0,m=E.slice())}else m=E.slice();if(n&&m.length>0){const e=n.split(",").map(e=>e.trim());m=m.filter(t=>!e.includes(t))}return m=Z(m),{plugins:m,extraPlugins:p,deriveFromManifest:w,tailwind:i,version:o,versionSet:r,alpine:a,alpineIntegrity:e.getAttribute("data-alpine-integrity"),integrity:c,pluginBase:d,cdn:u,sw:f}}();var pe;if(me&&me.version&&(v=me.version),me&&me.pluginBase&&(pe=me.pluginBase,x=pe||null),me&&me.cdn&&function(e){if(!e)return;const t=e.split(",").map(e=>e.trim().replace(/\/$/,"")).filter(Boolean);t.length&&(_=t)}(me.cdn),me&&me.integrity&&(w=me.integrity,!me.versionSet&&f&&(v=me.version=u),h=me.version===u,y=me.alpineIntegrity&&U.test(me.alpineIntegrity.trim())?me.alpineIntegrity.trim():null,g=async function(e){if(e.version!==u)return W(`Integrity checks cover this loader's own version (${u}), but data-version is "${e.version}". Set data-version="${u}" or remove it.`,"No modules were loaded."),null;const t=x?[`${x.replace(/\/$/,"")}/${m}`]:_.map(e=>`${$(u,e)}/${m}`);try{return await(await q(t,f,m)).json()}catch(e){throw new Error(`${e.message} No modules were loaded.`)}}(me),g.catch(()=>{})),function(e){if(!e||window.__manifestSwArmed)return;const t=window.__manifestSwArmed={};let n=!1;const i=()=>{if(!n&&window.__manifestSwArmed===t){n=!0;try{fe(e).catch(()=>{})}catch(e){}}};setTimeout(()=>{if(window.__manifestReady)return i();window.addEventListener("manifest:ready",i,{once:!0}),window.__manifestLoaderStarted||("complete"===document.readyState?setTimeout(i,0):window.addEventListener("load",i,{once:!0}))},0)}(me),me&&me.plugins.length>0){if(window.__manifestLoaderStarted)return;window.__manifestLoaderStarted=!0;const ve=["data","localization","components","appwrite-auth","appwrite-data","appwrite-presences","payments","chat"],_e=document.querySelector('link[rel="manifest"]')?.getAttribute("href")||"/manifest.json",be=new Set,$e=e=>{if(null===e||"object"!=typeof e)return;const t=e=>e.replace(/\$\{([^}]+)\}/g,(e,t)=>"undefined"!=typeof window&&window.env&&void 0!==window.env[t]?window.env[t]:(be.has(t)||(be.add(t),t.startsWith("PUBLIC_")?console.warn(`[Manifest] manifest.json references \${${t}}, but it is not present in window.env. Add ${t}=… to .env (read by mnfst-run) or set it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`):console.warn(`[Manifest] manifest.json references \${${t}}, but only PUBLIC_-prefixed env vars are injected into window.env by mnfst-run. Rename to PUBLIC_${t}, hardcode the value, or supply it via <script>window.env = {…}<\/script>. Leaving placeholder literal.`)),e)),n=e=>{if(Array.isArray(e))for(let i=0;i<e.length;i++){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}else for(const i of Object.keys(e)){const o=e[i];"string"==typeof o?e[i]=t(o):o&&"object"==typeof o&&n(o)}};n(e)},Ee=()=>window.__manifestLoaded?Promise.resolve(window.__manifestLoaded):(window.__manifestPromise||(window.__manifestPromise=fetch(_e).then(e=>e.ok?e.json():null).then(e=>(e&&!e.__interpolated&&($e(e),Object.defineProperty(e,"__interpolated",{value:!0,enumerable:!1})),e)).catch(()=>null)),window.__manifestPromise);function ke(e,t){if(window.__manifestReadyCoordinator)return;window.__manifestReadyCoordinator=!0;const n=window.ManifestPending.hold("ready"),i=!!t,o={data:!e.some(e=>"data"===e||"appwrite-data"===e)||!!window.__manifestRenderReady,utilities:!i||!!window.__manifestUtilitiesReady};let r=!1,a=null;const s=()=>!(window.__manifestMarkdownPending>0),c=()=>!(window.__manifestUtilitiesPending>0),d=()=>{r||(r=!0,n(),window.__manifestReady=!0,window.dispatchEvent(new CustomEvent("manifest:ready")))},l=()=>{r||o.data&&o.utilities&&s()&&c()&&(clearTimeout(a),a=setTimeout(()=>{o.data&&o.utilities&&s()&&c()&&d()},300))};window.addEventListener("manifest:render-ready",()=>{o.data=!0,l()}),window.addEventListener("manifest:utilities-ready",()=>{o.utilities=!0,l()}),window.addEventListener("manifest:utilities-idle",l),window.addEventListener("manifest:markdown-idle",l),setTimeout(d,15e3),l()}(async()=>{if(g){(me.deriveFromManifest||me.plugins.some(e=>ve.includes(e)))&&Ee();try{await g}catch(e){return void(e.logged||console.error(`[Manifest Loader] ${e.message}`))}}let e=null,t=me.plugins,n=null;if(me.deriveFromManifest){e=await Ee();const n=function(e){if(!e||"object"!=typeof e)return E.slice();const t=e.data&&"object"==typeof e.data&&Object.keys(e.data).length>0,n=e.components?.length>0||e.preloadedComponents?.length>0,i=(()=>{if(!e.data||"object"!=typeof e.data)return!1;for(const t of Object.values(e.data))if(t&&"object"==typeof t){if("string"==typeof t.locales)return!0;for(const e of Object.keys(t))if(!["url","headers","params","transform","defaultValue","locales"].includes(e)&&/^[a-zA-Z]{2}(-[a-zA-Z]{2})?$/.test(e))return!0}return!1})(),o=e.status&&"object"==typeof e.status&&Object.keys(e.status).length>0;return E.filter(e=>"data"===e?t:"localization"===e?i:"components"===e?n:"status"!==e||o)}(e),i=function(e){if(!e||"object"!=typeof e)return[];if(!(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&(e.appwriteTableId||e.appwriteDatabaseId||e.appwriteBucketId))))return[];const t=[];return e.appwrite?.auth&&t.push("appwrite-auth"),(e.appwrite||e.data&&Object.values(e.data).some(e=>e&&"object"==typeof e&&e.appwriteTableId))&&t.push("appwrite-data"),(e.appwrite?.presence||e.appwrite?.presences)&&t.push("appwrite-presences"),t}(e),o=function(e){return e&&"object"==typeof e&&e.payments&&"object"==typeof e.payments?["payments"]:[]}(e),r=function(e){return e&&"object"==typeof e&&(e.ai||e.chat)?["chat"]:[]}(e),a=function(e){if("undefined"!=typeof window&&window.Capacitor)return["device"];const t=e&&"object"==typeof e?e.device??e.native:null;return t&&"object"==typeof t?["device"]:[]}(e);t=Z([...k,...n,...i,...o,...r,...a,...me.extraPlugins||[]])}else{t=Z([...k,...t.filter(e=>!k.includes(e))]);me.plugins.some(e=>ve.includes(e))&&(n=Ee()),"undefined"!=typeof window&&window.Capacitor&&!t.includes("device")&&(t=Z([...t,"device"]))}const i=t.map(e=>V(e,me.version).catch(t=>{console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)}));me.tailwind&&!function(){try{return!!document.querySelector("style[data-mnfst-utilities][data-mnfst-utilities-complete]")}catch(e){return!1}}()&&i.push(ce(me.version).catch(()=>{})),await Promise.all(i),n&&(e=await n),e&&"undefined"!=typeof window&&(window.__manifestLoaded=e,window.ManifestComponentsRegistry&&(window.ManifestComponentsRegistry.manifest=e)),C(async()=>{if(me.deriveFromManifest){try{const e=ee(t);if(e.length>0){const n=Z(e).filter(e=>!t.includes(e));await Promise.all(n.map(e=>V(e,me.version).catch(t=>{ne.add(e),console.warn(`[Manifest Loader] Failed to load plugin ${e}:`,t)})))}}catch(e){}te=!0,re(me.version)}var e;ke(t,me.tailwind),e=function(e){if(e&&(e.startsWith("http")||e.startsWith("/")))return[e];const t=e||"3.17.5";return _.map(e=>`${e}/alpinejs@${t}/dist/cdn.min.js`)}(me.alpine),C(()=>{window.Alpine||document.querySelector('script[src*="alpinejs"]')||F(e,{alpine:!0}).catch(e=>{e.logged||console.error("[Manifest Loader] Alpine.js failed to load from all CDNs.")})})})})()}}();
|
|
2
2
|
//# sourceMappingURL=manifest.min.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest.appwrite.auth.js": "sha384-n+Fohtui5o2h3HpM7ifnop9YsAdlTj0uHYfzljQMghLJeDkODC6OXop6ds6OTZha",
|
|
3
3
|
"manifest.appwrite.auth.min.js": "sha384-qN5XF96RpRVTzBeOBoxwh6ziq2+eZ2rS0cLUtlwp4CFcbyuMCaf6kHFJKoWEGNvp",
|
|
4
|
-
"manifest.appwrite.data.js": "sha384-
|
|
4
|
+
"manifest.appwrite.data.js": "sha384-M78EpQj1OZ9StC7a5U4sanGXMxwm6b9v0d2W1SZnaQASRDoicWDn6eKbXXam/6Va",
|
|
5
5
|
"manifest.appwrite.data.min.js": "sha384-0fTVQE2rvA0T/qiXgSxe9YZDezipYFzrsSqnDcN8Xh6Vij1Pt/b3M6xySEqUtTjK",
|
|
6
6
|
"manifest.appwrite.presences.js": "sha384-O3EedwV2QTzd4YotjvGPsDHbxaGbtRaZuNopC7/Cfoo5uYPo8ZHYkCPCWurXpA2/",
|
|
7
7
|
"manifest.appwrite.presences.min.js": "sha384-7AHt7baL29VI3S1Nbkkyq34j2eJ2ysGpDnllmpXXSlc4GHvTk5hdCrXra2R3mSfH",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"manifest.components.min.js": "sha384-hESaKDaMHi3fGoq63adUyrJQ65iyA8fpAvbFSAEzhoSOvQfAhG6LqPNc8Tt7qGf+",
|
|
24
24
|
"manifest.computed.js": "sha384-GYML/e81gQfN+iDbqhPUgny8bINCyL+SrbTofoGk4hlCnLLjv51mCv42JMqq+ku5",
|
|
25
25
|
"manifest.computed.min.js": "sha384-90LbCcEOhrjhxi0GWBRb3DJyOkKWLRwzK7Z2nkbc1uaZ5B9EGmNKqx+mstTLWFGJ",
|
|
26
|
-
"manifest.data.js": "sha384-
|
|
27
|
-
"manifest.data.min.js": "sha384
|
|
26
|
+
"manifest.data.js": "sha384-mNneNp5BKXKzqaj69DFe7u0/wRHwNQEnmnUcSkjmbMdTVWaM66aC9R89CWws657d",
|
|
27
|
+
"manifest.data.min.js": "sha384-tovMhuS5xH9VPSuqO3s7ZhRjChncDYdbu2JiUvMln0ghBKB3oLN7Jeq//5pr9QBB",
|
|
28
28
|
"manifest.datepicker.js": "sha384-pZUQhUK6u5cl6g0myBXND/Wtrs1RTovYmy/ETQLUV0JujvTvUdRNc/XjPpVhtK16",
|
|
29
29
|
"manifest.datepicker.min.js": "sha384-e6xN1xQW3LLFvmSWrh3INMCgfUwD+gJca6n9fJfUFArA/OSm2KY0MDeN0pHVsYiw",
|
|
30
30
|
"manifest.defer.js": "sha384-W8aR5uCnUlmet/NscIgAoGijW064iSLASszQH3RKoLF19klJCyLdVrdz796QqSgD",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"manifest.edit.min.js": "sha384-gwQ+3V2Ycej1MGCEaTHay8akm1YFl5Jg9vDBVIU4+qp7qX9YpPfci9P5r3nywPaR",
|
|
38
38
|
"manifest.export.js": "sha384-5RyifGXBvBkCbB4lpQfKuHOr5cuYKvDFvzft2NYLU+wARFtx2D6WsOR24IrKfDNm",
|
|
39
39
|
"manifest.export.min.js": "sha384-JD/6lIfS91JAU0eZBiB7nFB3Auv2fuq0oHcaEkLInFEbqPz9otUFV5Fyx+NS1yKf",
|
|
40
|
-
"manifest.icons.js": "sha384-
|
|
41
|
-
"manifest.icons.min.js": "sha384-
|
|
40
|
+
"manifest.icons.js": "sha384-gLb9vW0MRJTQi6M1HFUylSLGNohkaCyUaCfhcoRPPzJOIxVrQzMeQuFUMqRMj2Yy",
|
|
41
|
+
"manifest.icons.min.js": "sha384-TZpazdx9K8xe3e7jmYoCzg7YD/7kBp1u8ScByfigopAvGJOzR4K10zpmGovwA0nv",
|
|
42
42
|
"manifest.localization.js": "sha384-9EDAqnI7MNCZp4Vas0RMZgceCuz9EJUi/OARm8iI+Hi4S8HF//yyVOhhhhQ+XcLq",
|
|
43
43
|
"manifest.localization.min.js": "sha384-5EkwrlpE29wmsy0JBq7UwWy8rVzEsu8tTprnsiNThVddFWsbFd63C/il4JjnWLmP",
|
|
44
44
|
"manifest.markdown.js": "sha384-rh24qtS792HpX6P83zUQEOxloelp1zNMninBZWSh5XTfpSEfmAasEjVG/OBAK76C",
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
"manifest.submissions.min.js": "sha384-p/5Ekd6u/cTsyVQbRgGzEi3h1hJU9zD7+hjdR+upcwt++26sfrLXMjFI2YjS8zWt",
|
|
60
60
|
"manifest.svg.js": "sha384-D1jF3a0pXIuzm7T2sltyzblF8BTZ8sv1CkfJyQ33q21G6QlYyjdPv8DJi80eCISD",
|
|
61
61
|
"manifest.svg.min.js": "sha384-rsvQ50FgVpTxX2Wvba3hed2TQvZR+CHHfgS4Cg7V1Dyjx6rxkS1s6rG6UMWDIMez",
|
|
62
|
-
"manifest.sw.js": "sha384-
|
|
63
|
-
"manifest.sw.min.js": "sha384-
|
|
62
|
+
"manifest.sw.js": "sha384-c81JfVhFh1sYQCNHKybmWr3xvuiRQAqTM1Ht1rcRysxE/JDQ8lsUs7LtfKkb3Hd0",
|
|
63
|
+
"manifest.sw.min.js": "sha384-0dMZiQSTOG5gC/rORsDuJYz/FH2wIhw02J60gT09bwkJNGaGeouNDEfgoHSzw3Zh",
|
|
64
64
|
"manifest.tabs.js": "sha384-otU09H7jnawVKQdLAYpMCd3jx00tgyPVr42D2hLIBzN5dG4se505YesavdnMqEi1",
|
|
65
65
|
"manifest.tabs.min.js": "sha384-Bi4vymb32IKQ3xZ0gHRArRqLj5BwIagAjn+r/CSG3OLLw8ArDw60haBfz4v1wjRC",
|
|
66
66
|
"manifest.tailwind.js": "sha384-yuP3LEvWU+QVjxjkZ0YhErtC9RrGmhOmHjjFjhS9obqZbp5/KTIEnSR0CXDvHE0B",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"manifest.tooltips.min.js": "sha384-Yo2bjvUmVpIDAFYFVrK32d0ncmYJf66S4bwmOsadUM4HOGIhEzALTVO4BedCikTW",
|
|
72
72
|
"manifest.url.parameters.js": "sha384-J2aSVBOPsoqsbafHndrWLHEDpKb4AKJAoQnVmKA4gZh5P/8HHjFWHO/lkusmG84l",
|
|
73
73
|
"manifest.url.parameters.min.js": "sha384-0C6e6FIjB9TKVGy5W0LH0TDQ3Eg4mRAokM4MANHUuwoG0IzUZV7HaYUQd2AnkB7a",
|
|
74
|
-
"manifest.utilities.js": "sha384-
|
|
75
|
-
"manifest.utilities.min.js": "sha384-
|
|
74
|
+
"manifest.utilities.js": "sha384-66aMe+M/lXRCPohIjKwkR5xEo6QYm8kbFp2xNknYTqABxn+fkV9bygD6kLi3XOml",
|
|
75
|
+
"manifest.utilities.min.js": "sha384-m2voYdYplK2zSjvjNNMSJ7dkALNoRKi7XcjY0DER5rLDtccKECgU8Q0ykQqgzx0o",
|
|
76
76
|
"manifest.virtual.js": "sha384-PtIDx042i29mkxEYZH+y3whBzKgBgV01CU1XzzeEl/8TBPl9qvny4ppyXgYI5DsM",
|
|
77
77
|
"manifest.virtual.min.js": "sha384-T50w4Y91/MCfR2ioessUCNc7ddvbr93fDxR81+zN6pGj2G5or02TIx6NLH3e/o3O",
|
|
78
78
|
"@highlightjs/cdn-assets@11.11.1/highlight.min.js": "sha384-RH2xi4eIQ/gjtbs9fUXM68sLSi99C7ZWBRX1vDrVv6GQXRibxXLbwO2NGZB74MbU",
|
package/lib/manifest.sw.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
// Build stamps the published version here; unstamped (dev) falls back to the
|
|
18
18
|
// registration URL's `v`, then 'dev'.
|
|
19
|
-
const BUILD_VERSION = '0.5.
|
|
19
|
+
const BUILD_VERSION = '0.5.324';
|
|
20
20
|
const CACHE_PREFIX = 'mnfst-sw:';
|
|
21
21
|
const META_CACHE = CACHE_PREFIX + 'meta';
|
|
22
22
|
// Sized to hold a full precache.json warm-up (PRECACHE_MAX_ENTRIES server-side)
|
package/lib/manifest.sw.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(){"use strict";const t="0.5.
|
|
1
|
+
!function(){"use strict";const t="0.5.324",e="mnfst-sw:",n=e+"meta",a=/\.(css|js|mjs|json|csv|tsv|ya?ml|md|txt|xml|svg|png|jpe?g|gif|webp|avif|ico|bmp|woff2?|ttf|otf|eot|mp3|mp4|webm|ogg|wav|flac|m4a|wasm|webmanifest|map)$/i,s=/^\/(sw\.js$|precache\.json$|v1\/|_appwrite\/|_ai\/|__mnfst|__edit)/,i=/^(cdn\.manifestx\.dev|cdn\.jsdelivr\.net|unpkg\.com|esm\.run)$/,c="https://cdn.manifestx.dev/npm/",r=/^api\.(iconify\.design|simplesvg\.com|unisvg\.com)$/,o=/@\d+\.\d+\.\d+[^/]*(\/|$)/,l=/@[^/]+(\/|$)/;let f=null,u=!1;function m(t){try{return new URL(self.location.href).searchParams.get(t)||""}catch(t){return""}}function h(){return{version:-1===t.indexOf("-dev")?t:m("v")||"dev",deployment:m("d")}}function w(t){return e+t.version+":"+(t.deployment||"-")+":"}async function d(){const t=h();try{const e=await fetch("/manifest.json",{cache:"no-store"});if(e.ok){const n=await e.json();n&&"string"==typeof n.deployment&&n.deployment&&(t.deployment=n.deployment)}}catch(t){}try{const e=await caches.open(n);await e.put("/__meta",new Response(JSON.stringify(t),{headers:{"content-type":"application/json"}}))}catch(t){}return t}function p(){return f||(f=(async()=>{try{const t=await caches.open(n),e=await t.match("/__meta");if(e){const t=await e.json();if(t&&t.version)return t}}catch(t){}return d()})().catch(()=>h())),f}async function y(t){if(u)throw new Error("killed");const e=await p();return caches.open(w(e)+t)}function g(t){return t.url.replace(/([?&])t=\d+(?=&|$)/,"$1").replace(/[?&]$/,"").replace(/\?&/,"?")}function v(t){if("GET"!==t.method)return null;if(t.headers.has("range"))return null;if(-1!==(t.headers.get("accept")||"").indexOf("text/event-stream"))return null;const e=new URL(g(t));if("http:"!==e.protocol&&"https:"!==e.protocol)return null;const n=e.origin===self.location.origin,c=e.pathname;return"navigate"===t.mode||"document"===t.destination?n?"document":null:n?s.test(c)?null:/(^|\/)manifest\.json$/.test(c)?"manifest":e.searchParams.get("v")?"immutable":/\.html?$/i.test(c)?"document":a.test(c)?"swr":null:r.test(e.host)?/\.json$/.test(c)?"immutable":null:i.test(e.host)?o.test(c)||/\/alpinejs@/.test(c)?"immutable":l.test(c)?"swr":null:null}function j(t){return!!t&&t.ok&&!t.redirected&&("basic"===t.type||"cors"===t.type||"default"===t.type)}function _(t){const e=new URL(t.url).origin===self.location.origin||"cors"===t.mode?fetch(t):fetch(new Request(t.url,{mode:"cors",credentials:"omit",redirect:"follow",integrity:t.integrity||""}));if(0!==t.url.indexOf(c))return e;const n=()=>fetch(new Request("https://cdn.jsdelivr.net/npm/"+t.url.slice(30),{mode:"cors",credentials:"omit",redirect:"follow",integrity:t.integrity||""}));return e.then(t=>t.ok?t:n().then(e=>e.ok?e:t).catch(()=>t),()=>n())}async function k(t,e){const n=await y("pages"),a=g(t);try{const e=await fetch(t);return j(e)&&await n.put(a,e.clone()),e}catch(s){const i=await n.match(a,{ignoreSearch:e});if(i)return i;if(e&&"navigate"===t.mode){const t=await n.match("/index.html")||await n.match("/");if(t)return t}throw s}}function $(t,e){const n=t.request;switch(e){case"immutable":return async function(t){const e=await y("assets"),n=g(t),a=await e.match(n);if(a)return a;const s=await _(t);return j(s)&&await e.put(n,s.clone()),s}(n);case"swr":return async function(t,e){const n=await y("swr"),a=g(t),s=await n.match(a),i=(async()=>{const e=await _(t);return j(e)&&(await n.put(a,e.clone()),await async function(t){const e=await t.keys(),n=e.length-500;for(let a=0;a<n;a++)await t.delete(e[a])}(n)),e})();return s?(e.waitUntil(i.catch(()=>{})),s):i}(n,t);case"document":return k(n,!0);case"manifest":return k(n,!1);default:return fetch(n)}}const x={version:h().version,ready:!0};self.__mnfstSw=x,self.addEventListener("install",t=>{try{f=null,t.waitUntil(d().then(t=>{f=Promise.resolve(t)}).catch(()=>{}))}catch(t){}}),self.addEventListener("activate",t=>{try{t.waitUntil((async()=>{if(!self.registration||"undefined"==typeof caches||"function"!=typeof fetch||self.__mnfstSw!==x)return void await self.registration.unregister();const t=await p();await async function(t){const a=w(t),s=await caches.keys();await Promise.all(s.filter(t=>0===t.indexOf(e)&&t!==n&&0!==t.indexOf(a)).map(t=>caches.delete(t)))}(t).catch(()=>{}),async function(t){let e;try{const t=await fetch("/precache.json",{cache:"no-store"});if(!t.ok)return;e=await t.json()}catch(t){return}if(!e||!Array.isArray(e.files))return;if(e.deployment&&t.deployment&&e.deployment!==t.deployment)return;const n=e.files.filter(t=>"string"==typeof t),a=async t=>{try{const e=new Request(new URL(t,self.location.origin).href),n=v(e);if(!n)return;const a="immutable"===n?"assets":"swr"===n?"swr":"pages",s=await y(a),i=g(e);if(await s.match(i))return;const c=await _(e);j(c)&&await s.put(i,c)}catch(t){}};let s=0;await Promise.all(Array.from({length:4},async()=>{for(;s<n.length;)await a(n[s++])}))}(t).catch(()=>{})})().catch(()=>{}))}catch(t){}}),self.addEventListener("fetch",t=>{if(u)return;let e=null;try{e=v(t.request)}catch(t){return}if(e)try{t.respondWith($(t,e).catch(()=>fetch(t.request)))}catch(t){}}),self.addEventListener("message",t=>{try{const n=t.data;if(!n||"manifest:sw"!==n.type)return;const a=e=>{try{const n=t.ports&&t.ports[0];n?n.postMessage(e):t.source&&t.source.postMessage&&t.source.postMessage(e)}catch(t){}};if("ping"===n.action)return void a({type:"manifest:sw",action:"pong"});if("version"===n.action)return void t.waitUntil(p().then(t=>a({type:"manifest:sw",action:"version",version:t.version,deployment:t.deployment,key:w(t)})).catch(()=>{}));"kill"===n.action&&(u=!0,t.waitUntil((async()=>{await async function(){const t=await caches.keys();await Promise.all(t.filter(t=>0===t.indexOf(e)).map(t=>caches.delete(t)))}().catch(()=>{}),await self.registration.unregister().catch(()=>{}),a({type:"manifest:sw",action:"killed"})})().catch(()=>{})))}catch(t){}})}();
|
|
2
2
|
//# sourceMappingURL=manifest.sw.min.js.map
|
|
@@ -1158,7 +1158,7 @@ TailwindCompiler.prototype.loadAndApplyCache = function () {
|
|
|
1158
1158
|
if (currentClasses.size > 0) {
|
|
1159
1159
|
for (const [key, value] of this.cache.entries()) {
|
|
1160
1160
|
// Extract classes from cache key (format: "class1,class2-themeHash")
|
|
1161
|
-
//
|
|
1161
|
+
// The theme hash has no '-': split on the last one
|
|
1162
1162
|
const lastDashIndex = key.lastIndexOf('-');
|
|
1163
1163
|
const classesPart = lastDashIndex > 0 ? key.substring(0, lastDashIndex) : key;
|
|
1164
1164
|
const cachedClasses = classesPart ? classesPart.split(',') : [];
|
|
@@ -1287,8 +1287,13 @@ TailwindCompiler.prototype.loadPersistentCache = function () {
|
|
|
1287
1287
|
|
|
1288
1288
|
// Generate a hash of the theme variables to detect changes
|
|
1289
1289
|
TailwindCompiler.prototype.generateThemeHash = function (themeCss) {
|
|
1290
|
-
//
|
|
1291
|
-
|
|
1290
|
+
// FNV-1a over the whole theme text
|
|
1291
|
+
let h = 0x811c9dc5;
|
|
1292
|
+
for (let i = 0; i < themeCss.length; i++) {
|
|
1293
|
+
h ^= themeCss.charCodeAt(i);
|
|
1294
|
+
h = Math.imul(h, 0x01000193);
|
|
1295
|
+
}
|
|
1296
|
+
return (h >>> 0).toString(36) + themeCss.length.toString(36);
|
|
1292
1297
|
};
|
|
1293
1298
|
|
|
1294
1299
|
// Clean up old cache entries
|
|
@@ -1319,12 +1324,20 @@ TailwindCompiler.prototype.cleanupCache = function () {
|
|
|
1319
1324
|
|
|
1320
1325
|
// Ensure #manifest-styles is last in head so our responsive/variant rules win over Tailwind and any later-injected styles
|
|
1321
1326
|
TailwindCompiler.prototype.ensureUtilityStylesLast = function () {
|
|
1322
|
-
if (this.styleElement
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1327
|
+
if (!this.styleElement || !this.styleElement.parentNode) return;
|
|
1328
|
+
// Only a stylesheet after ours can out-order it (scripts and meta tags cannot)
|
|
1329
|
+
let later = this.styleElement.nextElementSibling;
|
|
1330
|
+
while (later && !isStylesheetNode(later)) later = later.nextElementSibling;
|
|
1331
|
+
if (!later && this.styleElement.parentNode === document.head) return;
|
|
1332
|
+
document.head.appendChild(this.styleElement);
|
|
1333
|
+
if (this.resyncUtilitiesText) this.resyncUtilitiesText();
|
|
1326
1334
|
};
|
|
1327
1335
|
|
|
1336
|
+
// Any <link> counts: a preload can become a stylesheet after insertion
|
|
1337
|
+
function isStylesheetNode(node) {
|
|
1338
|
+
return node.localName === 'style' || node.localName === 'link';
|
|
1339
|
+
}
|
|
1340
|
+
|
|
1328
1341
|
// When any element is added to head after ours, move #manifest-styles to end. Handles CDN load order (e.g. Tailwind injecting after we run).
|
|
1329
1342
|
TailwindCompiler.prototype.setupUtilityStylesOrderObserver = function () {
|
|
1330
1343
|
if (!document.head || !this.styleElement) return;
|
|
@@ -1334,6 +1347,7 @@ TailwindCompiler.prototype.setupUtilityStylesOrderObserver = function () {
|
|
|
1334
1347
|
if (mutation.type !== 'childList' || !mutation.addedNodes.length) continue;
|
|
1335
1348
|
for (const node of mutation.addedNodes) {
|
|
1336
1349
|
if (node.nodeType !== Node.ELEMENT_NODE || node === self.styleElement) continue;
|
|
1350
|
+
if (!isStylesheetNode(node)) continue;
|
|
1337
1351
|
self.ensureUtilityStylesLast();
|
|
1338
1352
|
break;
|
|
1339
1353
|
}
|
|
@@ -1438,7 +1452,10 @@ TailwindCompiler.prototype.scanStaticClasses = async function () {
|
|
|
1438
1452
|
|
|
1439
1453
|
const componentUrls = [];
|
|
1440
1454
|
|
|
1441
|
-
|
|
1455
|
+
// A complete shipped sheet was baked from these same files: nothing to learn by fetching them
|
|
1456
|
+
const baked = !!document.querySelector('[data-mnfst-utilities][data-mnfst-utilities-complete]');
|
|
1457
|
+
|
|
1458
|
+
if (!baked && registry && registry.manifest) {
|
|
1442
1459
|
// Get all component paths from manifest
|
|
1443
1460
|
const allComponents = [
|
|
1444
1461
|
...(registry.manifest.preloadedComponents || []),
|
|
@@ -1652,6 +1669,12 @@ TailwindCompiler.prototype.getUsedClasses = function () {
|
|
|
1652
1669
|
}
|
|
1653
1670
|
};
|
|
1654
1671
|
|
|
1672
|
+
function isDevHostname(host) {
|
|
1673
|
+
const h = String(host || '').toLowerCase();
|
|
1674
|
+
return !h || h === 'localhost' || h === '127.0.0.1' || h === '[::1]' || h === '::1' || h === '0.0.0.0' ||
|
|
1675
|
+
h.endsWith('.localhost') || h.endsWith('.local') || h.endsWith('.test');
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1655
1678
|
// Fetch theme content from CSS files
|
|
1656
1679
|
TailwindCompiler.prototype.fetchThemeContent = async function () {
|
|
1657
1680
|
const themeContents = new Set();
|
|
@@ -1695,25 +1718,33 @@ TailwindCompiler.prototype.fetchThemeContent = async function () {
|
|
|
1695
1718
|
cacheTime = this.hasScannedStatic ? 5000 : 30000;
|
|
1696
1719
|
}
|
|
1697
1720
|
|
|
1698
|
-
|
|
1721
|
+
// Off a dev host a stylesheet never changes under a loaded page: fetch once, from the HTTP cache
|
|
1722
|
+
const dev = isDevHostname(location.hostname);
|
|
1723
|
+
if (cached && (!dev || (now - cached.timestamp) < cacheTime)) {
|
|
1699
1724
|
content = cached.content;
|
|
1700
1725
|
needsFetch = false;
|
|
1701
1726
|
}
|
|
1702
1727
|
|
|
1703
1728
|
if (needsFetch) {
|
|
1704
|
-
//
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
const
|
|
1729
|
+
// Dev: cache-bust so an edited stylesheet is re-read
|
|
1730
|
+
const url = dev ? `${source}${source.includes('?') ? '&' : '?'}t=${Math.floor(now / 1000)}` : source;
|
|
1731
|
+
|
|
1732
|
+
// Overlapping compiles share one request
|
|
1733
|
+
const inflight = this._cssInflight || (this._cssInflight = new Map());
|
|
1734
|
+
let pending = inflight.get(url);
|
|
1735
|
+
if (!pending) {
|
|
1736
|
+
pending = fetch(url).then(response => (response.ok ? response.text() : null));
|
|
1737
|
+
inflight.set(url, pending);
|
|
1738
|
+
const done = () => inflight.delete(url);
|
|
1739
|
+
pending.then(done, done);
|
|
1740
|
+
}
|
|
1741
|
+
content = await pending;
|
|
1709
1742
|
|
|
1710
|
-
if (
|
|
1743
|
+
if (content === null) {
|
|
1711
1744
|
console.warn('Failed to fetch stylesheet:', url);
|
|
1712
1745
|
return;
|
|
1713
1746
|
}
|
|
1714
1747
|
|
|
1715
|
-
content = await response.text();
|
|
1716
|
-
|
|
1717
1748
|
// Cache the content with timestamp
|
|
1718
1749
|
this.cssContentCache.set(cacheKey, {
|
|
1719
1750
|
content: content,
|
|
@@ -3373,6 +3404,9 @@ TailwindCompiler.prototype.compileDelta = function (themeCss) {
|
|
|
3373
3404
|
const applied = this._applied;
|
|
3374
3405
|
const candidates = [];
|
|
3375
3406
|
for (const cls of this.dynamicClassCache) if (!applied.classes.has(cls)) candidates.push(cls);
|
|
3407
|
+
// A shipped at-rule variant arriving beside our own rules may need re-emitting after a bare partner: full regen decides
|
|
3408
|
+
if (this.staticUtilitiesCoveredClasses && applied.entries.length &&
|
|
3409
|
+
candidates.some(c => this.isAtRuleVariantClass(c) && this.isClassCovered(c))) return false;
|
|
3376
3410
|
const classes = this.filterStaticallyCoveredClasses(candidates);
|
|
3377
3411
|
// Tailwind display classes at a breakpoint join the display block, which only a full regen emits
|
|
3378
3412
|
if (tailwindResponsiveDisplay(classes).length) return false;
|
|
@@ -3515,6 +3549,28 @@ TailwindCompiler.prototype.clearStaleUtilityPatches = function () {
|
|
|
3515
3549
|
}
|
|
3516
3550
|
};
|
|
3517
3551
|
|
|
3552
|
+
// Boot-time guesses are unlayered and beat every layered variant: drop them once real rules cover the page
|
|
3553
|
+
TailwindCompiler.prototype.dropCriticalStyles = function () {
|
|
3554
|
+
if (!this.criticalStyleElement) return;
|
|
3555
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
3556
|
+
if (this.criticalStyleElement && this.criticalStyleElement.parentNode) {
|
|
3557
|
+
this.criticalStyleElement.parentNode.removeChild(this.criticalStyleElement);
|
|
3558
|
+
this.criticalStyleElement = null;
|
|
3559
|
+
}
|
|
3560
|
+
this.ensureUtilityStylesLast();
|
|
3561
|
+
}));
|
|
3562
|
+
};
|
|
3563
|
+
|
|
3564
|
+
// Nothing to generate yet: arm delta on an empty layer so later classes insert, not regenerate
|
|
3565
|
+
TailwindCompiler.prototype.armEmptyDelta = function (themeCss, classes) {
|
|
3566
|
+
if (!this.styleElement) return;
|
|
3567
|
+
// A replayed cache sheet stays until the next full write replaces it
|
|
3568
|
+
if (!this.staticUtilitiesCoveredClasses && this.styleElement.textContent.trim()) return;
|
|
3569
|
+
this._applied = null;
|
|
3570
|
+
this.styleElement.textContent = '@layer utilities {\n}';
|
|
3571
|
+
this.recordAppliedUtilities([], themeCss, classes);
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3518
3574
|
// Main compilation method
|
|
3519
3575
|
TailwindCompiler.prototype.compile = async function () {
|
|
3520
3576
|
if (this.usesStaticPrerenderUtilities) {
|
|
@@ -3593,11 +3649,13 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3593
3649
|
}
|
|
3594
3650
|
}
|
|
3595
3651
|
|
|
3596
|
-
const
|
|
3652
|
+
const staticEntries = this.generateOrderedUtilities(themeCss, staticUsedData);
|
|
3653
|
+
const allUtilities = this.orderedUtilitiesCss(staticEntries);
|
|
3597
3654
|
|
|
3598
3655
|
if (allUtilities) {
|
|
3599
3656
|
const finalCss = `@layer utilities {\n${allUtilities}\n}`;
|
|
3600
3657
|
|
|
3658
|
+
this._applied = null; // a move below must not write the previous delta state back
|
|
3601
3659
|
this.styleElement.textContent = finalCss;
|
|
3602
3660
|
this.ensureUtilityStylesLast();
|
|
3603
3661
|
this.scheduleEnsureUtilityStylesLast();
|
|
@@ -3615,6 +3673,7 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3615
3673
|
});
|
|
3616
3674
|
});
|
|
3617
3675
|
this.lastClassesHash = staticUsedData.classes.sort().join(',');
|
|
3676
|
+
this.recordAppliedUtilities(staticEntries, themeCss, []);
|
|
3618
3677
|
|
|
3619
3678
|
// Save to cache for next page load
|
|
3620
3679
|
const themeHash = this.generateThemeHash(themeCss);
|
|
@@ -3627,6 +3686,7 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3627
3686
|
this.savePersistentCache();
|
|
3628
3687
|
} else {
|
|
3629
3688
|
this.clearStaleUtilityPatches();
|
|
3689
|
+
this.armEmptyDelta(themeCss, []);
|
|
3630
3690
|
}
|
|
3631
3691
|
}
|
|
3632
3692
|
|
|
@@ -3639,7 +3699,10 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3639
3699
|
let prefetchedTheme = null;
|
|
3640
3700
|
if (this.canCompileDelta()) {
|
|
3641
3701
|
prefetchedTheme = await this.fetchThemeContent();
|
|
3642
|
-
if (prefetchedTheme && this.lastThemeKey === this._applied.themeKey && this.compileDelta(this._applied.themeCss))
|
|
3702
|
+
if (prefetchedTheme && this.lastThemeKey === this._applied.themeKey && this.compileDelta(this._applied.themeCss)) {
|
|
3703
|
+
this.dropCriticalStyles();
|
|
3704
|
+
return;
|
|
3705
|
+
}
|
|
3643
3706
|
}
|
|
3644
3707
|
|
|
3645
3708
|
// For subsequent compilations, check for new dynamic classes
|
|
@@ -3684,6 +3747,7 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3684
3747
|
if (allUtilities) {
|
|
3685
3748
|
const finalCss = `@layer utilities {\n${allUtilities}\n}`;
|
|
3686
3749
|
|
|
3750
|
+
this._applied = null; // a move below must not write the previous delta state back
|
|
3687
3751
|
this.styleElement.textContent = finalCss;
|
|
3688
3752
|
this.ensureUtilityStylesLast();
|
|
3689
3753
|
this.scheduleEnsureUtilityStylesLast();
|
|
@@ -3716,6 +3780,8 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3716
3780
|
this.savePersistentCache();
|
|
3717
3781
|
} else {
|
|
3718
3782
|
this.clearStaleUtilityPatches();
|
|
3783
|
+
this.lastClassesHash = dynamicClassesHash;
|
|
3784
|
+
this.armEmptyDelta(themeCss, dynamicClasses);
|
|
3719
3785
|
}
|
|
3720
3786
|
} else {
|
|
3721
3787
|
this._applied = null; // theme text moved: order keys are stale until the next full write
|
|
@@ -4213,7 +4279,7 @@ TailwindCompiler.prototype.setupComponentLoadListener = function () {
|
|
|
4213
4279
|
// compile() queues a retry when busy; dropping the call here lost classes seen mid-compile
|
|
4214
4280
|
const debouncedCompile = this.debounce(() => this.compile(), this.options.debounceTime);
|
|
4215
4281
|
|
|
4216
|
-
// Recompile when components load/process
|
|
4282
|
+
// Recompile when components load/process (the observer has already collected their classes)
|
|
4217
4283
|
const handleComponentEvent = () => {
|
|
4218
4284
|
if (!this.hasScannedStatic) {
|
|
4219
4285
|
this.staticScanPromise = null;
|
|
@@ -4225,39 +4291,6 @@ TailwindCompiler.prototype.setupComponentLoadListener = function () {
|
|
|
4225
4291
|
document.addEventListener('manifest:component-loaded', handleComponentEvent);
|
|
4226
4292
|
document.addEventListener('manifest:components-processed', handleComponentEvent);
|
|
4227
4293
|
document.addEventListener('manifest:components-ready', handleComponentEvent);
|
|
4228
|
-
// Also listen for manifest-prefixed events (for future compatibility)
|
|
4229
|
-
document.addEventListener('manifest:components-processed', handleComponentEvent);
|
|
4230
|
-
document.addEventListener('manifest:components-ready', handleComponentEvent);
|
|
4231
|
-
|
|
4232
|
-
// On route change, recompile only if genuinely new dynamic classes appeared.
|
|
4233
|
-
document.addEventListener('manifest:route-change', (event) => {
|
|
4234
|
-
if (this.hasScannedStatic) {
|
|
4235
|
-
setTimeout(() => {
|
|
4236
|
-
const currentDynamicCount = this.dynamicClassCache.size;
|
|
4237
|
-
const currentClassesHash = this.lastClassesHash;
|
|
4238
|
-
|
|
4239
|
-
// Scan for new classes
|
|
4240
|
-
const usedData = this.getUsedClasses();
|
|
4241
|
-
const newDynamicCount = this.dynamicClassCache.size;
|
|
4242
|
-
const dynamicClasses = Array.from(this.dynamicClassCache);
|
|
4243
|
-
const newClassesHash = dynamicClasses.sort().join(',');
|
|
4244
|
-
|
|
4245
|
-
if (newDynamicCount > currentDynamicCount && newClassesHash !== currentClassesHash) {
|
|
4246
|
-
const newClasses = dynamicClasses.filter(cls =>
|
|
4247
|
-
// Ignore highlight/code-processing artifacts
|
|
4248
|
-
!cls.includes('hljs') &&
|
|
4249
|
-
!cls.startsWith('language-') &&
|
|
4250
|
-
!cls.includes('copy') &&
|
|
4251
|
-
!cls.includes('lines')
|
|
4252
|
-
);
|
|
4253
|
-
|
|
4254
|
-
if (newClasses.length > 0) {
|
|
4255
|
-
debouncedCompile();
|
|
4256
|
-
}
|
|
4257
|
-
}
|
|
4258
|
-
}, 300); // let code processing finish
|
|
4259
|
-
}
|
|
4260
|
-
});
|
|
4261
4294
|
|
|
4262
4295
|
// Single MutationObserver for all DOM changes: recompile only when a class not yet seen appears
|
|
4263
4296
|
const observer = new MutationObserver((mutations) => {
|
|
@@ -4266,7 +4299,7 @@ TailwindCompiler.prototype.setupComponentLoadListener = function () {
|
|
|
4266
4299
|
for (const mutation of mutations) {
|
|
4267
4300
|
if (mutation.type === 'attributes') {
|
|
4268
4301
|
if (this.ignoredAttributes.includes(mutation.attributeName) || mutation.attributeName !== 'class') continue;
|
|
4269
|
-
if (mutation.target.nodeType === Node.ELEMENT_NODE && this.collectNewClasses(mutation.target)) fresh = true;
|
|
4302
|
+
if (mutation.target.nodeType === Node.ELEMENT_NODE && this.collectNewClasses(mutation.target, false, true)) fresh = true;
|
|
4270
4303
|
} else if (mutation.type === 'childList') {
|
|
4271
4304
|
for (const node of mutation.addedNodes) {
|
|
4272
4305
|
if (node.nodeType !== Node.ELEMENT_NODE) continue;
|
|
@@ -4296,10 +4329,23 @@ TailwindCompiler.prototype.setupComponentLoadListener = function () {
|
|
|
4296
4329
|
};
|
|
4297
4330
|
|
|
4298
4331
|
// Record classes not seen before; true when any were new. Quiet = collect without triggering
|
|
4299
|
-
|
|
4332
|
+
// classOnly: a class attribute change (the element's binding expression was read when it was added)
|
|
4333
|
+
TailwindCompiler.prototype.collectNewClasses = function (el, quiet, classOnly) {
|
|
4300
4334
|
if (!el.getAttribute) return false;
|
|
4301
4335
|
const value = el.getAttribute('class');
|
|
4302
|
-
let fresh =
|
|
4336
|
+
let fresh = false;
|
|
4337
|
+
if (value) {
|
|
4338
|
+
// Rows repeat a handful of class strings: one fully recorded needs no re-split
|
|
4339
|
+
const seen = this._seenClassStrings || (this._seenClassStrings = new Set());
|
|
4340
|
+
if (!seen.has(value)) {
|
|
4341
|
+
fresh = this.recordClasses(value.split(/\s+/), quiet);
|
|
4342
|
+
if (!quiet) {
|
|
4343
|
+
if (seen.size > 5000) seen.clear();
|
|
4344
|
+
seen.add(value);
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
}
|
|
4348
|
+
if (classOnly) return fresh;
|
|
4303
4349
|
const bound = el.getAttribute(':class') || el.getAttribute('x-bind:class');
|
|
4304
4350
|
if (bound && this.recordClasses(this.bindingClasses(bound), quiet)) fresh = true;
|
|
4305
4351
|
return fresh;
|