@builder.io/sdk-react-nextjs 0.14.25 → 0.14.26
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/browser/{USE_CLIENT_BUNDLE-1ddfeb58.cjs → USE_CLIENT_BUNDLE-26be487e.cjs} +1 -1
- package/lib/{node/USE_CLIENT_BUNDLE-ef4baa66.js → browser/USE_CLIENT_BUNDLE-4c845b66.js} +2 -2
- package/lib/{edge/USE_SERVER_BUNDLE-78eb2f70.cjs → browser/USE_SERVER_BUNDLE-a3f3b1f7.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-f025d6d8.js → browser/USE_SERVER_BUNDLE-f8a1ee85.js} +1 -1
- package/lib/browser/{bundle-9d1d2542.cjs → bundle-476e30d7.cjs} +3 -3
- package/lib/browser/{bundle-761961a0.js → bundle-999a2785.js} +4 -2
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{browser/USE_CLIENT_BUNDLE-8cd3386f.js → edge/USE_CLIENT_BUNDLE-6a4fcac3.js} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-f7463aa3.cjs → edge/USE_CLIENT_BUNDLE-7517cd42.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-e5e233d2.cjs → edge/USE_SERVER_BUNDLE-06472a9d.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-3c35d11e.js → edge/USE_SERVER_BUNDLE-3c38a1b1.js} +1 -1
- package/lib/edge/{bundle-2dc98ad8.js → bundle-66b04b60.js} +4 -2
- package/lib/edge/{bundle-8f003cc6.cjs → bundle-ba82c7f5.cjs} +3 -3
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-e4abd45c.js → node/USE_CLIENT_BUNDLE-07e24176.js} +2 -2
- package/lib/{edge/USE_CLIENT_BUNDLE-2ee56c62.cjs → node/USE_CLIENT_BUNDLE-9966f569.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-457ff39c.js → node/USE_SERVER_BUNDLE-aa3e89ff.js} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-7b480ad5.cjs → node/USE_SERVER_BUNDLE-e36813e6.cjs} +1 -1
- package/lib/node/{bundle-90827143.js → bundle-1b7db75b.js} +4 -2
- package/lib/node/{bundle-df5510f7.cjs → bundle-e09f3bd9.cjs} +5 -5
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +1 -1
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/context/types.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/context/types.d.ts +1 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-476e30d7.cjs"),l=require("react"),D=require("./USE_SERVER_BUNDLE-a3f3b1f7.cjs"),H=require("next/navigation");function j(e){return t.jsx(t.Fragment,{children:n.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function V(e){function c(){return{...e.attributes,[n.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[n.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return t.jsx(j,{attributes:c(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function U(e){return t.jsx(j,{TagName:e.Wrapper,attributes:n.getBlockProperties({block:e.block,context:e.context}),actionAttributes:n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function O(e){function c(){return e.includeBlockProps?{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:c(),children:e.children})}function $(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:c()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, Fragment as w, jsxs as I } from "react/jsx-runtime";
|
|
3
|
-
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-
|
|
3
|
+
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-999a2785.js";
|
|
4
4
|
import { useRef as T, useState as C, useEffect as f, createContext as me } from "react";
|
|
5
|
-
import { p as ge } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-f8a1ee85.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ a(w, { children: Z(e.TagName) ? /* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-476e30d7.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const c=require("react/jsx-runtime");require("react");const Ye=require("lru-cache"),k=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const c=require("react/jsx-runtime");require("react");const Ye=require("lru-cache"),k=require("./USE_CLIENT_BUNDLE-26be487e.cjs");require("next/navigation");const Ge=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),Qe=e=>typeof e=="string"&&Ge.has(e.toLowerCase()),E="rsc",F=()=>{switch(E){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function Xe(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const A="[Builder.io]: ",C={log:(...e)=>console.log(A,...e),error:(...e)=>console.error(A,...e),warn:(...e)=>console.warn(A,...e),debug:(...e)=>console.debug(A,...e)};function v(){return typeof window<"u"&&typeof document<"u"}const Ze=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},fe=e=>e instanceof URLSearchParams?Ze(e):e,he=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function et(){return v()&&window.self!==window.top}function H(e){return et()&&he(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const tt=()=>{if(v()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},nt=()=>typeof navigator=="object"&&navigator.userAgent||"",pe=()=>{const e=nt(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||E==="reactNative"}},n=e.match(/Tablet|iPad/i),o=tt();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},ot=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),it=()=>({isEditing:H(),isBrowser:v(),isServer:!v(),getUserAttributes:()=>pe()}),rt=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,Z=({code:e,builder:t,context:n,event:o,localState:i,rootSetState:r,rootState:a})=>{const s=ot({builder:t,context:n,event:o,state:ge({rootState:a,localState:i,rootSetState:r})});return new Function(...s.map(([l])=>l),e)(...s.map(([,l])=>l))};function ge({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,i)=>{if(t&&i in t)return t[i];const r=o[i];return typeof r=="object"&&r!==null?ge({rootState:r,localState:void 0,rootSetState:n?a=>{o[i]=a,n(o)}:void 0}):r},set:(o,i,r)=>{if(t&&i in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[i]=r,n==null||n(o),!0}})}const I=e=>e!=null;function at(){var e;return typeof process<"u"&&I((e=process==null?void 0:process.versions)==null?void 0:e.node)}const st=()=>{var o;if(!at())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(C.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},ct=e=>(v()||st(),Z(e)),K=class R{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return R.cache.get(t)}static setCachedValue(t,n){R.cache.size>20&&R.cache.delete(R.cache.keys().next().value),R.cache.set(t,{value:n})}};K.cacheLimit=20;K.cache=new Map;let B=K;function O({code:e,context:t,localState:n,rootState:o,rootSetState:i,event:r,isExpression:a=!0,enableCache:s}){if(e==="")return;const l={code:rt(e,{isExpression:a}),builder:it(),context:t,event:r,rootSetState:i,rootState:o,localState:n};if(s){const u=B.getCacheKey(l),h=B.getCachedValue(u);if(h)return h.value}try{const u=ct(l);if(s){const h=B.getCacheKey(l);B.setCachedValue(h,u)}return u}catch(u){C.error("Failed code evaluation: "+u.message,{code:e});return}}const P=e=>JSON.parse(JSON.stringify(e)),lt=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((i,r,a)=>Object(i[r])===i[r]?i[r]:i[r]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e};const dt=({block:e,context:t,localState:n,rootState:o,rootSetState:i})=>{if(!e.bindings)return e;const r=P(e),a={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const l=e.bindings[s],u=O({code:l,localState:n,rootState:o,rootSetState:i,context:t,enableCache:!0});lt(a,s,u)}return a};function j({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:i,rootSetState:r}){const a=e;return n?dt({block:a,localState:o,rootState:i,rootSetState:r,context:t}):a}const z=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"",be=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${z(n)}: ${o};`}).filter(I),ut=e=>be(e).join(`
|
|
2
2
|
`),V=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
3
3
|
${ut(n)}
|
|
4
4
|
}`;return e?`${e} {
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
)`,hn=({contentId:e,variationId:t})=>`window.${Be}(
|
|
132
132
|
"${t}", "${e}", ${Ve}
|
|
133
133
|
)`;function _(e){return c.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const pn=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||C.warn("No previewed ID found in search params."),n};function We(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new Ye.LRUCache({max:500,ttl:1e3*60*5}))}function gn(e){We();const t=pn(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function bn(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function yn(){const e=bn().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
134
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const je=yn();function M(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...M(r,a,n)}:{...o,[a]:r}},{})}function Ne(e,t,n={}){for(const o in e){const i=e[o],r=t?t+"."+o:o;i&&typeof i=="object"&&!Array.isArray(i)&&!Object.keys(i).find(a=>a.startsWith("$"))?Ne(i,r,n):n[r]=i}return n}const Sn="v3",ie="builder.",xn="options.",J=e=>{if(!e)return{};const t=fe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(ie)){const i=o.replace(ie,"").replace(xn,"");n[i]=t[o]}}),n},vn=()=>{if(!v())return{};const e=new URLSearchParams(window.location.search);return J(e)},re=e=>typeof e=="number"&&!isNaN(e)&&e>=0,Y=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=Sn,fields:u,omit:h,offset:d,cacheSeconds:f,staleCacheSeconds:g,sort:x,includeUnpublished:b}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const T=t!==1,m=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(m.searchParams.set("apiKey",r),m.searchParams.set("limit",String(t)),m.searchParams.set("noTraverse",String(T)),m.searchParams.set("includeRefs",String(!0)),s&&m.searchParams.set("locale",s),a&&m.searchParams.set("enrich",String(a)),m.searchParams.set("omit",h||"meta.componentsUsed"),u&&m.searchParams.set("fields",u),Number.isFinite(d)&&d>-1&&m.searchParams.set("offset",String(Math.floor(d))),typeof b=="boolean"&&m.searchParams.set("includeUnpublished",String(b)),f&&re(f)&&m.searchParams.set("cacheSeconds",String(f)),g&&re(g)&&m.searchParams.set("staleCacheSeconds",String(g)),x){const S=M({sort:x});for(const w in S)m.searchParams.set(w,JSON.stringify(S[w]))}const p={...vn(),...fe(e.options||{})},y=M(p);for(const S in y)m.searchParams.set(S,String(y[S]));if(n&&m.searchParams.set("userAttributes",JSON.stringify(n)),o){const S=Ne({query:o});for(const w in S)m.searchParams.set(w,JSON.stringify(S[w]))}return m},kn=e=>"results"in e;async function G(e){const t=await Oe({...e,limit:1});return t&&t[0]||null}const Cn=async e=>{const t=Y(e);return await(await(e.fetch??je)(t.href,e.fetchOptions)).json()},Fe=async(e,t,n=Y(e))=>{const o=N(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=gn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(v()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Dt({item:a,canTrack:o}));t.results=r}catch(r){C.error("Could not process A/B tests. ",r)}return t.results};async function Oe(e){try{const t=Y(e),n=await Cn(e);return kn(n)?Fe(e,n):(C.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return C.error("Error fetching data. ",t),null}}function wn(e){const t=e||(v()?window.location.search:void 0);return t?he(t).indexOf("builder.preview=")!==-1:!1}function In(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function $e(){return In().replace(/-/g,"")}const Le="builderSessionId",En=async({canTrack:e})=>{if(!e)return;const t=await we({name:Le,canTrack:e});if(I(t))return t;{const n=Tn();return Rn({id:n,canTrack:e}),n}},Tn=()=>$e(),Rn=({id:e,canTrack:t})=>Ie({name:Le,value:e,canTrack:t}),Ue=()=>v()&&typeof localStorage<"u"?localStorage:void 0,Pn=({key:e,canTrack:t})=>{var n;try{return t?(n=Ue())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},An=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ue())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},De="builderVisitorId",Bn=({canTrack:e})=>{if(!e)return;const t=Pn({key:De,canTrack:e});if(I(t))return t;{const n=Vn();return Wn({id:n,canTrack:e}),n}},Vn=()=>$e(),Wn=({id:e,canTrack:t})=>An({key:De,value:e,canTrack:t}),jn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await En({canTrack:e}),n=Bn({canTrack:e});return{sessionId:t,visitorId:n}},Nn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await jn({canTrack:t}),userAttributes:pe(),ownerId:n}});async function _e(e){if(!e.apiKey){C.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!H()&&(v()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Nn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Fn=e=>_e({...e,canTrack:!0});function ae(e){return Math.round(e*1e3)/1e3}const On=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},$n=e=>On(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),se=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=ae(o/n.width),a=ae(i/n.height);return{x:r,y:a}},Ln=e=>{const t=e.target,n=t&&$n(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?se({event:e,target:t}):void 0,builderTargetOffset:n?se({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Un=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Me(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Un).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Dn="0.14.
|
|
134
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const je=yn();function M(e,t=null,n="."){return Object.keys(e).reduce((o,i)=>{const r=e[i],a=[t,i].filter(Boolean).join(n);return[typeof r=="object",r!==null,!(Array.isArray(r)&&r.length===0)].every(Boolean)?{...o,...M(r,a,n)}:{...o,[a]:r}},{})}function Ne(e,t,n={}){for(const o in e){const i=e[o],r=t?t+"."+o:o;i&&typeof i=="object"&&!Array.isArray(i)&&!Object.keys(i).find(a=>a.startsWith("$"))?Ne(i,r,n):n[r]=i}return n}const Sn="v3",ie="builder.",xn="options.",J=e=>{if(!e)return{};const t=fe(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(ie)){const i=o.replace(ie,"").replace(xn,"");n[i]=t[o]}}),n},vn=()=>{if(!v())return{};const e=new URLSearchParams(window.location.search);return J(e)},re=e=>typeof e=="number"&&!isNaN(e)&&e>=0,Y=e=>{const{limit:t=30,userAttributes:n,query:o,model:i,apiKey:r,enrich:a,locale:s,apiVersion:l=Sn,fields:u,omit:h,offset:d,cacheSeconds:f,staleCacheSeconds:g,sort:x,includeUnpublished:b}=e;if(!r)throw new Error("Missing API key");if(!["v3"].includes(l))throw new Error(`Invalid apiVersion: expected 'v3', received '${l}'`);const T=t!==1,m=new URL(`https://cdn.builder.io/api/${l}/content/${i}`);if(m.searchParams.set("apiKey",r),m.searchParams.set("limit",String(t)),m.searchParams.set("noTraverse",String(T)),m.searchParams.set("includeRefs",String(!0)),s&&m.searchParams.set("locale",s),a&&m.searchParams.set("enrich",String(a)),m.searchParams.set("omit",h||"meta.componentsUsed"),u&&m.searchParams.set("fields",u),Number.isFinite(d)&&d>-1&&m.searchParams.set("offset",String(Math.floor(d))),typeof b=="boolean"&&m.searchParams.set("includeUnpublished",String(b)),f&&re(f)&&m.searchParams.set("cacheSeconds",String(f)),g&&re(g)&&m.searchParams.set("staleCacheSeconds",String(g)),x){const S=M({sort:x});for(const w in S)m.searchParams.set(w,JSON.stringify(S[w]))}const p={...vn(),...fe(e.options||{})},y=M(p);for(const S in y)m.searchParams.set(S,String(y[S]));if(n&&m.searchParams.set("userAttributes",JSON.stringify(n)),o){const S=Ne({query:o});for(const w in S)m.searchParams.set(w,JSON.stringify(S[w]))}return m},kn=e=>"results"in e;async function G(e){const t=await Oe({...e,limit:1});return t&&t[0]||null}const Cn=async e=>{const t=Y(e);return await(await(e.fetch??je)(t.href,e.fetchOptions)).json()},Fe=async(e,t,n=Y(e))=>{const o=N(e.canTrack);if(n.search.includes("preview=")){const r=[];for(const a of t.results){const s=gn(n.searchParams);r.push(s||a)}t.results=r}if(!o||!(v()||E==="reactNative"))return t.results;try{const r=[];for(const a of t.results)r.push(await Dt({item:a,canTrack:o}));t.results=r}catch(r){C.error("Could not process A/B tests. ",r)}return t.results};async function Oe(e){try{const t=Y(e),n=await Cn(e);return kn(n)?Fe(e,n):(C.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return C.error("Error fetching data. ",t),null}}function wn(e){const t=e||(v()?window.location.search:void 0);return t?he(t).indexOf("builder.preview=")!==-1:!1}function In(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function $e(){return In().replace(/-/g,"")}const Le="builderSessionId",En=async({canTrack:e})=>{if(!e)return;const t=await we({name:Le,canTrack:e});if(I(t))return t;{const n=Tn();return Rn({id:n,canTrack:e}),n}},Tn=()=>$e(),Rn=({id:e,canTrack:t})=>Ie({name:Le,value:e,canTrack:t}),Ue=()=>v()&&typeof localStorage<"u"?localStorage:void 0,Pn=({key:e,canTrack:t})=>{var n;try{return t?(n=Ue())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},An=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=Ue())==null||o.setItem(e,n))}catch(i){console.debug("[LocalStorage] SET error: ",i)}},De="builderVisitorId",Bn=({canTrack:e})=>{if(!e)return;const t=Pn({key:De,canTrack:e});if(I(t))return t;{const n=Vn();return Wn({id:n,canTrack:e}),n}},Vn=()=>$e(),Wn=({id:e,canTrack:t})=>An({key:De,value:e,canTrack:t}),jn=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await En({canTrack:e}),n=Bn({canTrack:e});return{sessionId:t,visitorId:n}},Nn=async({type:e,canTrack:t,apiKey:n,metadata:o,...i})=>({type:e,data:{...i,metadata:{url:location.href,...o},...await jn({canTrack:t}),userAttributes:pe(),ownerId:n}});async function _e(e){if(!e.apiKey){C.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!H()&&(v()||E==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await Nn(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const Fn=e=>_e({...e,canTrack:!0});function ae(e){return Math.round(e*1e3)/1e3}const On=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},$n=e=>On(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),se=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,i=e.clientY-n.top,r=ae(o/n.width),a=ae(i/n.height);return{x:r,y:a}},Ln=e=>{const t=e.target,n=t&&$n(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?se({event:e,target:t}):void 0,builderTargetOffset:n?se({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},Un=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Me(e,t){const n=new URL(t.origin),o=n.hostname;return(e||Un).findIndex(i=>i.startsWith("*.")?o.endsWith(i.slice(1)):i===o)>-1}const Dn="0.14.26",ce={};function He(e,t){let n=ce[e];if(n||(n=ce[e]=[]),n.push(t),v()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(i){console.debug("Could not postmessage",i)}}}const _n=()=>{He("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let le=!1;const Ke=(e={})=>{var t,n;le||(le=!0,v()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:E,version:Dn,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var r,a;if(!Me(e.trustedHosts,o))return;const{data:i}=o;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const s=i.data.text,l=i.data.arguments||[],u=i.data.id,h=new Function(s);let d,f=null;try{d=h.apply(null,l)}catch(g){f=g}f?(r=window.parent)==null||r.postMessage({type:"builder.evaluateError",data:{id:u,error:f.message}},"*"):d&&typeof d.then=="function"?d.then(g=>{var x;(x=window.parent)==null||x.postMessage({type:"builder.evaluateResult",data:{id:u,result:g}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:d,id:u}},"*");break}}})))},ze=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!Me(t,o))return;const{data:i}=o;if(i)switch(i.type){case"builder.configureSdk":{n.configureSdk(i.data);break}case"builder.triggerAnimation":{n.animation(i.data);break}case"builder.contentUpdate":{const r=i.data,a=r.key||r.alias||r.entry||r.modelName,s=r.data;a===e&&n.contentUpdate(s);break}}},Mn=(e,t,n)=>{if(!v)return C.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};Ke();const o=ze({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function de(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const i=arguments[o];if(i!=null)for(const r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])}return n}function Hn(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Kn(e,t){const n=zn(e),o=getComputedStyle(t),i=e.steps[0].styles,r=e.steps[e.steps.length-1].styles,a=[i,r];for(const s of a)for(const l of n)l in s||(s[l]=o[l])}function zn(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function qn(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Hn(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Kn(e,n),n.style.transition="none",n.style.transitionDelay="0",de(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${z(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),de(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Jn=e=>{var r;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((r=e==null?void 0:e.files)==null?void 0:r.regular);let i="";if(o&&t&&n&&(i+=`
|
|
135
135
|
@font-face {
|
|
136
136
|
font-family: "${t}";
|
|
137
137
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -166,4 +166,4 @@ font-weight: ${a};
|
|
|
166
166
|
${Gn({cssCode:e.cssCode,contentId:e.contentId})}
|
|
167
167
|
${Yn({customFonts:e.customFonts})}
|
|
168
168
|
${Xn(e.isNestedRender)}
|
|
169
|
-
`.trim();return c.jsx($,{id:"builderio-content",styles:t})}const to=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},no=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ue(e){var i,r,a,s,l,u,h,d,f;const t=hn({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...oe(),...e.customComponents||[]].reduce((g,{component:x,...b})=>({...g,[b.name]:{component:x,...D(b)}}),{}),o={content:no({content:e.content,data:e.data}),localState:void 0,rootState:to({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...oe(),...e.customComponents||[]].reduce((g,{component:x,...b})=>({...g,[b.name]:D(b)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return c.jsxs(k.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(_,{id:"builderio-variant-visibility",scriptStr:t}):null,c.jsx(eo,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(s=o.content)==null?void 0:s.data)==null?void 0:l.cssCode,customFonts:(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.customFonts}),c.jsx(U,{blocks:(f=(d=o.content)==null?void 0:d.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function qe(e){var r;const t=dn({canTrack:N(e.canTrack),content:e.content}),n=function(){var s;return fn(W(e.content).map(l=>({id:l.testVariationId,testRatio:l.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return W(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},i=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:Ut({item:e.content,canTrack:N(e.canTrack)})};return c.jsxs(c.Fragment,{children:[!e.isNestedRender&&E!=="reactNative"?c.jsx(_,{id:"builderio-init-variants-fns",scriptStr:mn()}):null,t?c.jsxs(c.Fragment,{children:[c.jsx($,{id:"builderio-variants",styles:o()}),c.jsx(_,{id:"builderio-variants-visibility",scriptStr:n()}),(r=W(e.content))==null?void 0:r.map(a=>c.jsx(ue,{isNestedRender:e.isNestedRender,content:a,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},a.testVariationId))]}):null,c.jsx(ue,{isNestedRender:e.isNestedRender,content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const oo=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return G({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{C.error("Could not fetch symbol content: ",n)})};async function Je(e){var r,a,s,l,u;const t=function(){return"div"},n=function(){return"div"},o=function(){var d,f;return[e.attributes[F()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},i=((r=e.symbol)==null?void 0:r.content)||await oo({symbol:e.symbol,builderContextValue:e.builderContext});return c.jsx("div",{...e.attributes,className:o(),children:c.jsx(qe,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(l=i==null?void 0:i.data)==null?void 0:l.state},model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const me={};function io(e){if(v()){Object.assign(me,e);const t={type:"builder.settingsChange",data:me};parent.postMessage(t,"*")}}const ro=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:J(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await G(n)}};exports.Blocks=U;exports.Columns=ke;exports.ContentVariants=qe;exports.Symbol=Je;exports.Text=Pe;exports._processContentResult=Fe;exports._track=_e;exports.createEditorListener=ze;exports.createRegisterComponentMessage=rn;exports.evaluate=O;exports.fastClone=P;exports.fetch=je;exports.fetchBuilderProps=ro;exports.fetchEntries=Oe;exports.fetchOneEntry=G;exports.getBlockActions=kt;exports.getBlockProperties=ve;exports.getBuilderSearchParams=J;exports.getClassPropName=F;exports.getDefaultCanTrack=N;exports.getInteractionPropertiesForEvent=Ln;exports.getSrcSet=At;exports.getWrapperClassName=Zn;exports.init=We;exports.isBrowser=v;exports.isEditing=H;exports.isEmptyElement=Qe;exports.isJsScript=en;exports.isPreviewing=wn;exports.logger=C;exports.register=He;exports.registerInsertMenu=_n;exports.setEditorSettings=io;exports.setupBrowserForEditing=Ke;exports.subscribeToEditor=Mn;exports.track=Fn;exports.triggerAnimation=qn;
|
|
169
|
+
`.trim();return c.jsx($,{id:"builderio-content",styles:t})}const to=({content:e,data:t,locale:n})=>{var r,a,s;const o={},i=((r=e==null?void 0:e.data)==null?void 0:r.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(l=>{l.name&&l.defaultValue!==void 0&&(o[l.name]=l.defaultValue)}),{...o,...i,...t,...n?{locale:n}:{}}},no=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ue(e){var i,r,a,s,l,u,h,d,f;const t=hn({variationId:(i=e.content)==null?void 0:i.testVariationId,contentId:(r=e.content)==null?void 0:r.id}),n=[...oe(),...e.customComponents||[]].reduce((g,{component:x,...b})=>({...g,[b.name]:{component:x,...D(b)}}),{}),o={content:no({content:e.content,data:e.data}),localState:void 0,rootState:to({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...oe(),...e.customComponents||[]].reduce((g,{component:x,...b})=>({...g,[b.name]:D(b)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return c.jsxs(k.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?c.jsx(_,{id:"builderio-variant-visibility",scriptStr:t}):null,c.jsx(eo,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(l=(s=o.content)==null?void 0:s.data)==null?void 0:l.cssCode,customFonts:(h=(u=o.content)==null?void 0:u.data)==null?void 0:h.customFonts}),c.jsx(U,{blocks:(f=(d=o.content)==null?void 0:d.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function qe(e){var r;const t=dn({canTrack:N(e.canTrack),content:e.content}),n=function(){var s;return fn(W(e.content).map(l=>({id:l.testVariationId,testRatio:l.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return W(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},i=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:Ut({item:e.content,canTrack:N(e.canTrack)})};return c.jsxs(c.Fragment,{children:[!e.isNestedRender&&E!=="reactNative"?c.jsx(_,{id:"builderio-init-variants-fns",scriptStr:mn()}):null,t?c.jsxs(c.Fragment,{children:[c.jsx($,{id:"builderio-variants",styles:o()}),c.jsx(_,{id:"builderio-variants-visibility",scriptStr:n()}),(r=W(e.content))==null?void 0:r.map(a=>c.jsx(ue,{isNestedRender:e.isNestedRender,content:a,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},a.testVariationId))]}):null,c.jsx(ue,{isNestedRender:e.isNestedRender,content:i(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const oo=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return G({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{C.error("Could not fetch symbol content: ",n)})};async function Je(e){var r,a,s,l,u;const t=function(){return"div"},n=function(){return"div"},o=function(){var d,f;return[e.attributes[F()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(f=e.symbol)!=null&&f.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},i=((r=e.symbol)==null?void 0:r.content)||await oo({symbol:e.symbol,builderContextValue:e.builderContext});return c.jsx("div",{...e.attributes,className:o(),children:c.jsx(qe,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(l=i==null?void 0:i.data)==null?void 0:l.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:i,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const me={};function io(e){if(v()){Object.assign(me,e);const t={type:"builder.settingsChange",data:me};parent.postMessage(t,"*")}}const ro=async e=>{var o,i,r;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((i=e.userAttributes)==null?void 0:i.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:J(e.searchParams||((r=e.url)==null?void 0:r.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await G(n)}};exports.Blocks=U;exports.Columns=ke;exports.ContentVariants=qe;exports.Symbol=Je;exports.Text=Pe;exports._processContentResult=Fe;exports._track=_e;exports.createEditorListener=ze;exports.createRegisterComponentMessage=rn;exports.evaluate=O;exports.fastClone=P;exports.fetch=je;exports.fetchBuilderProps=ro;exports.fetchEntries=Oe;exports.fetchOneEntry=G;exports.getBlockActions=kt;exports.getBlockProperties=ve;exports.getBuilderSearchParams=J;exports.getClassPropName=F;exports.getDefaultCanTrack=N;exports.getInteractionPropertiesForEvent=Ln;exports.getSrcSet=At;exports.getWrapperClassName=Zn;exports.init=We;exports.isBrowser=v;exports.isEditing=H;exports.isEmptyElement=Qe;exports.isJsScript=en;exports.isPreviewing=wn;exports.logger=C;exports.register=He;exports.registerInsertMenu=_n;exports.setEditorSettings=io;exports.setupBrowserForEditing=Ke;exports.subscribeToEditor=Mn;exports.track=Fn;exports.triggerAnimation=qn;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l, Fragment as C, jsxs as R } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { LRUCache as Fe } from "lru-cache";
|
|
4
|
-
import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as Le, B as Ue, a as De, D as _e, C as Me, E as je, b as He, V as Ke, c as ze, F as qe, d as Ye, S as Ge, e as Je } from "./USE_CLIENT_BUNDLE-4c845b66.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
const Qe = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), ho = (e) => typeof e == "string" && Qe.has(e.toLowerCase()), T = "rsc", M = () => {
|
|
7
7
|
switch (T) {
|
|
@@ -2207,7 +2207,7 @@ function Ne(e, t) {
|
|
|
2207
2207
|
const n = new URL(t.origin), o = n.hostname;
|
|
2208
2208
|
return (e || _n).findIndex((i) => i.startsWith("*.") ? o.endsWith(i.slice(1)) : i === o) > -1;
|
|
2209
2209
|
}
|
|
2210
|
-
const Mn = "0.14.
|
|
2210
|
+
const Mn = "0.14.26", ae = {};
|
|
2211
2211
|
function jn(e, t) {
|
|
2212
2212
|
let n = ae[e];
|
|
2213
2213
|
if (n || (n = ae[e] = []), n.push(t), k()) {
|
|
@@ -2521,6 +2521,7 @@ function le(e) {
|
|
|
2521
2521
|
}),
|
|
2522
2522
|
rootSetState: void 0,
|
|
2523
2523
|
context: e.context || {},
|
|
2524
|
+
canTrack: e.canTrack,
|
|
2524
2525
|
apiKey: e.apiKey,
|
|
2525
2526
|
apiVersion: e.apiVersion,
|
|
2526
2527
|
componentInfos: [
|
|
@@ -2738,6 +2739,7 @@ async function ro(e) {
|
|
|
2738
2739
|
...e.builderContext.localState,
|
|
2739
2740
|
...(c = i == null ? void 0 : i.data) == null ? void 0 : c.state
|
|
2740
2741
|
},
|
|
2742
|
+
canTrack: e.builderContext.canTrack,
|
|
2741
2743
|
model: (u = e.symbol) == null ? void 0 : u.model,
|
|
2742
2744
|
content: i,
|
|
2743
2745
|
linkComponent: e.builderLinkComponent,
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-26be487e.cjs"),e=require("./bundle-476e30d7.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-a3f3b1f7.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-4c845b66.js";
|
|
2
|
+
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-999a2785.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-f8a1ee85.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, Fragment as w, jsxs as I } from "react/jsx-runtime";
|
|
3
|
-
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-
|
|
3
|
+
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-66b04b60.js";
|
|
4
4
|
import { useRef as T, useState as C, useEffect as f, createContext as me } from "react";
|
|
5
|
-
import { p as ge } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-3c38a1b1.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ a(w, { children: Z(e.TagName) ? /* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-ba82c7f5.cjs"),l=require("react"),D=require("./USE_SERVER_BUNDLE-06472a9d.cjs"),H=require("next/navigation");function j(e){return t.jsx(t.Fragment,{children:n.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function V(e){function c(){return{...e.attributes,[n.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[n.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return t.jsx(j,{attributes:c(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function U(e){return t.jsx(j,{TagName:e.Wrapper,attributes:n.getBlockProperties({block:e.block,context:e.context}),actionAttributes:n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function O(e){function c(){return e.includeBlockProps?{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:c(),children:e.children})}function $(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:c()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-ba82c7f5.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as I, Fragment as ee, jsxs as xe } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { LRUCache as oo } from "lru-cache";
|
|
4
|
-
import { I as io, B as ao, a as so, D as lo, C as co, E as uo, b as fo, V as po, c as ho, F as mo, d as go, S as yo, e as vo } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as io, B as ao, a as so, D as lo, C as co, E as uo, b as fo, V as po, c as ho, F as mo, d as go, S as yo, e as vo } from "./USE_CLIENT_BUNDLE-6a4fcac3.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
const bo = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), Ja = (e) => typeof e == "string" && bo.has(e.toLowerCase()), me = "rsc", Yt = () => {
|
|
7
7
|
switch (me) {
|
|
@@ -4680,7 +4680,7 @@ function Wr(e, t) {
|
|
|
4680
4680
|
const n = new URL(t.origin), r = n.hostname;
|
|
4681
4681
|
return (e || Ea).findIndex((o) => o.startsWith("*.") ? r.endsWith(o.slice(1)) : o === r) > -1;
|
|
4682
4682
|
}
|
|
4683
|
-
const Ia = "0.14.
|
|
4683
|
+
const Ia = "0.14.26", or = {};
|
|
4684
4684
|
function Ta(e, t) {
|
|
4685
4685
|
let n = or[e];
|
|
4686
4686
|
if (n || (n = or[e] = []), n.push(t), G()) {
|
|
@@ -4994,6 +4994,7 @@ function sr(e) {
|
|
|
4994
4994
|
}),
|
|
4995
4995
|
rootSetState: void 0,
|
|
4996
4996
|
context: e.context || {},
|
|
4997
|
+
canTrack: e.canTrack,
|
|
4997
4998
|
apiKey: e.apiKey,
|
|
4998
4999
|
apiVersion: e.apiVersion,
|
|
4999
5000
|
componentInfos: [
|
|
@@ -5211,6 +5212,7 @@ async function $a(e) {
|
|
|
5211
5212
|
...e.builderContext.localState,
|
|
5212
5213
|
...(p = o == null ? void 0 : o.data) == null ? void 0 : p.state
|
|
5213
5214
|
},
|
|
5215
|
+
canTrack: e.builderContext.canTrack,
|
|
5214
5216
|
model: (b = e.symbol) == null ? void 0 : b.model,
|
|
5215
5217
|
content: o,
|
|
5216
5218
|
linkComponent: e.builderLinkComponent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const y=require("react/jsx-runtime");require("react");const yo=require("lru-cache"),ee=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const y=require("react/jsx-runtime");require("react");const yo=require("lru-cache"),ee=require("./USE_CLIENT_BUNDLE-7517cd42.cjs");require("next/navigation");const vo=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),bo=e=>typeof e=="string"&&vo.has(e.toLowerCase()),me="rsc",ht=()=>{switch(me){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function xo(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const lt="[Builder.io]: ",J={log:(...e)=>console.log(lt,...e),error:(...e)=>console.error(lt,...e),warn:(...e)=>console.warn(lt,...e),debug:(...e)=>console.debug(lt,...e)};function K(){return typeof window<"u"&&typeof document<"u"}const So=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},fr=e=>e instanceof URLSearchParams?So(e):e,dr=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function wo(){return K()&&window.self!==window.top}function zt(e){return wo()&&dr(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const ko=()=>{if(K()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},Co=()=>typeof navigator=="object"&&navigator.userAgent||"",pr=()=>{const e=Co(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||me==="reactNative"}},n=e.match(/Tablet|iPad/i),r=ko();return{urlPath:r==null?void 0:r.pathname,host:(r==null?void 0:r.host)||(r==null?void 0:r.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},hr=({builder:e,context:t,event:n,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:n}),Eo=()=>({isEditing:zt(),isBrowser:K(),isServer:!K(),getUserAttributes:()=>pr()}),Io=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,jo=({code:e,builder:t,context:n,event:r,localState:o,rootSetState:i,rootState:s})=>{const u=hr({builder:t,context:n,event:r,state:mr({rootState:s,localState:o,rootSetState:i})});return new Function(...u.map(([p])=>p),e)(...u.map(([,p])=>p))};function mr({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(r,o)=>{if(t&&o in t)return t[o];const i=r[o];return typeof i=="object"&&i!==null?mr({rootState:i,localState:void 0,rootSetState:n?s=>{r[o]=s,n(r)}:void 0}):i},set:(r,o,i)=>{if(t&&o in t)throw new Error("Writing to local state is not allowed as it is read-only.");return r[o]=i,n==null||n(r),!0}})}const gr=(e,t,n)=>{if(Object(e)!==e)return e;const r=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return r.slice(0,-1).reduce((o,i,s)=>Object(o[i])===o[i]?o[i]:o[i]=Math.abs(Number(r[s+1]))>>0===+r[s+1]?[]:{},e)[r[r.length-1]]=n,e};var B,To=function(e){function t(a){return 48>a?a===36:58>a?!0:65>a?!1:91>a?!0:97>a?a===95:123>a?!0:170<=a&&mo.test(String.fromCharCode(a))}function n(a){return 65>a?a===36:91>a?!0:97>a?a===95:123>a?!0:170<=a&&Kn.test(String.fromCharCode(a))}function r(a,l){for(var c=v,d=1,E=0;;){st.lastIndex=E;var W=st.exec(c);if(W&&W.index<a)++d,E=W.index+W[0].length;else break}throw c={line:d,ab:a-E},l+=" ("+c.line+":"+c.ab+")",l=new SyntaxError(l),l.j=a,l.X=c,l.o=f,l}function o(a){a=a.split(" ");for(var l=Object.create(null),c=0;c<a.length;c++)l[a[c]]=!0;return function(d){return l[d]||!1}}function i(){this.line=xe,this.ab=f-le}function s(a,l){ke=f,T.C&&(At=new i),C=a,p(),te=l,Ue=a.m}function u(){for(var a=f,l=T.va&&T.C&&new i,c=v.charCodeAt(f+=2);f<we&&c!==10&&c!==13&&c!==8232&&c!==8233;)++f,c=v.charCodeAt(f);T.va&&T.va(!1,v.slice(a+2,f),a,f,l,T.C&&new i)}function p(){for(;f<we;){var a=v.charCodeAt(f);if(a===32)++f;else if(a===13)++f,a=v.charCodeAt(f),a===10&&++f,T.C&&(++xe,le=f);else if(a===10||a===8232||a===8233)++f,T.C&&(++xe,le=f);else if(8<a&&14>a)++f;else if(a===47)if(a=v.charCodeAt(f+1),a===42){a=void 0;var l=T.va&&T.C&&new i,c=f,d=v.indexOf("*/",f+=2);if(d===-1&&r(f-2,"Unterminated comment"),f=d+2,T.C)for(st.lastIndex=c;(a=st.exec(v))&&a.index<f;)++xe,le=a.index+a[0].length;T.va&&T.va(!0,v.slice(c+2,d),c,f,l,T.C&&new i)}else if(a===47)u();else break;else if(a===160)++f;else if(5760<=a&&ho.test(String.fromCharCode(a)))++f;else break}}function x(a){switch(a){case 46:a=v.charCodeAt(f+1),48<=a&&57>=a?O(!0):(++f,s(Mn));return;case 40:return++f,s(ce);case 41:return++f,s(oe);case 59:return++f,s(ue);case 44:return++f,s(ye);case 91:return++f,s(Dt);case 93:return++f,s(Lt);case 123:return++f,s(De);case 125:return++f,s(Ee);case 58:return++f,s(Le);case 63:return++f,s(Vn);case 48:if(a=v.charCodeAt(f+1),a===120||a===88){f+=2,a=N(16),a===null&&r(_+2,"Expected hexadecimal number"),n(v.charCodeAt(f))&&r(f,"Identifier directly after number"),s(Ve,a);return}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return O(!1);case 34:case 39:f++;for(var l="";;){f>=we&&r(_,"Unterminated string constant");var c=v.charCodeAt(f);if(c===a){++f,s(rt,l);break}if(c===92){c=v.charCodeAt(++f);var d=/^[0-7]+/.exec(v.slice(f,f+3));for(d&&(d=d[0]);d&&255<parseInt(d,8);)d=d.slice(0,-1);if(d==="0"&&(d=null),++f,d)Q&&r(f-2,"Octal literal in strict mode"),l+=String.fromCharCode(parseInt(d,8)),f+=d.length-1;else switch(c){case 110:l+=`
|
|
2
2
|
`;break;case 114:l+="\r";break;case 120:l+=String.fromCharCode(R(2));break;case 117:l+=String.fromCharCode(R(4));break;case 85:l+=String.fromCharCode(R(8));break;case 116:l+=" ";break;case 98:l+="\b";break;case 118:l+="\v";break;case 102:l+="\f";break;case 48:l+="\0";break;case 13:v.charCodeAt(f)===10&&++f;case 10:T.C&&(le=f,++xe);break;default:l+=String.fromCharCode(c)}}else c!==13&&c!==10&&c!==8232&&c!==8233||r(_,"Unterminated string constant"),l+=String.fromCharCode(c),++f}return;case 47:a=v.charCodeAt(f+1),Ue?(++f,A()):a===61?m(Se,2):m(Dn,1);return;case 37:case 42:v.charCodeAt(f+1)===61?m(Se,2):m(uo,1);return;case 124:case 38:l=v.charCodeAt(f+1),l===a?m(a===124?Wn:$n,2):l===61?m(Se,2):m(a===124?ro:io,1);return;case 94:v.charCodeAt(f+1)===61?m(Se,2):m(oo,1);return;case 43:case 45:l=v.charCodeAt(f+1),l===a?l===45&&v.charCodeAt(f+2)===62&&at.test(v.slice(ge,f))?(f+=3,u(),p(),k()):m(no,2):l===61?m(Se,2):m(co,1);return;case 60:case 62:l=v.charCodeAt(f+1),c=1,l===a?(c=a===62&&v.charCodeAt(f+2)===62?3:2,v.charCodeAt(f+c)===61?m(Se,c+1):m(lo,c)):l===33&&a===60&&v.charCodeAt(f+2)===45&&v.charCodeAt(f+3)===45?(f+=4,u(),p(),k()):(l===61&&(c=v.charCodeAt(f+2)===61?3:2),m(so,c));return;case 61:case 33:v.charCodeAt(f+1)===61?m(ao,v.charCodeAt(f+2)===61?3:2):m(a===61?Ln:_n,1);return;case 126:return m(_n,1)}return!1}function k(a){if(a?f=_+1:_=f,T.C&&(Tt=new i),a)return A();if(f>=we)return s(Pt);if(a=v.charCodeAt(f),n(a)||a===92)return j();if(x(a)===!1){if(a=String.fromCharCode(a),a==="\\"||Kn.test(a))return j();r(f,"Unexpected character '"+a+"'")}}function m(a,l){var c=v.slice(f,f+l);f+=l,s(a,c)}function A(){for(var a,l,c=f;;){f>=we&&r(c,"Unterminated regexp");var d=v.charAt(f);if(at.test(d)&&r(c,"Unterminated regexp"),a)a=!1;else{if(d==="[")l=!0;else if(d==="]"&&l)l=!1;else if(d==="/"&&!l)break;a=d==="\\"}++f}a=v.slice(c,f),++f,(l=Y())&&!/^[gmi]*$/.test(l)&&r(c,"Invalid regexp flag");try{var E=new RegExp(a,l)}catch(W){throw W instanceof SyntaxError&&r(c,W.message),W}s(vn,E)}function N(a,l){for(var c=f,d=0,E=l===void 0?1/0:l,W=0;W<E;++W){var z=v.charCodeAt(f);if(z=97<=z?z-97+10:65<=z?z-65+10:48<=z&&57>=z?z-48:1/0,z>=a)break;++f,d=d*a+z}return f===c||l!==void 0&&f-c!==l?null:d}function O(a){var l=f,c=!1,d=v.charCodeAt(f)===48;a||N(10)!==null||r(l,"Invalid number"),v.charCodeAt(f)===46&&(++f,N(10),c=!0),a=v.charCodeAt(f),(a===69||a===101)&&(a=v.charCodeAt(++f),a!==43&&a!==45||++f,N(10)===null&&r(l,"Invalid number"),c=!0),n(v.charCodeAt(f))&&r(f,"Identifier directly after number"),a=v.slice(l,f);var E;c?E=parseFloat(a):d&&a.length!==1?/[89]/.test(a)||Q?r(l,"Invalid number"):E=parseInt(a,8):E=parseInt(a,10),s(Ve,E)}function R(a){return a=N(16,a),a===null&&r(_,"Bad character escape sequence"),a}function Y(){Ie=!1;for(var a,l=!0,c=f;;){var d=v.charCodeAt(f);if(t(d))Ie&&(a+=v.charAt(f)),++f;else if(d===92){Ie||(a=v.slice(c,f)),Ie=!0,v.charCodeAt(++f)!==117&&r(f,"Expecting Unicode escape sequence \\uXXXX"),++f,d=R(4);var E=String.fromCharCode(d);E||r(f-1,"Invalid Unicode escape"),(l?n(d):t(d))||r(f-4,"Invalid Unicode escape"),a+=E}else break;l=!1}return Ie?a:v.slice(c,f)}function j(){var a=Y(),l=Ce;!Ie&&po(a)&&(l=to[a]),s(l,a)}function g(){Ot=_,ge=ke,Rt=At,k()}function F(a){if(Q=a,f=_,T.C)for(;f<le;)le=v.lastIndexOf(`
|
|
3
3
|
`,le-2)+1,--xe;p(),k()}function M(){this.type=null,this.start=_,this.end=null}function X(){this.start=Tt,this.end=null,jt&&(this.source=jt)}function V(){var a=new M;return T.C&&(a.X=new X),T.vb&&(a.sourceFile=T.vb),T.Xa&&(a.j=[_,0]),a}function ne(a){var l=new M;return l.start=a.start,T.C&&(l.X=new X,l.X.start=a.X.start),T.Xa&&(l.j=[a.j[0],0]),l}function I(a,l){return a.type=l,a.end=ge,T.C&&(a.X.end=Rt),T.Xa&&(a.j[1]=ge),a}function Qe(a){return a.type==="ExpressionStatement"&&a.la.type==="Literal"&&a.la.value==="use strict"}function U(a){return C===a?(g(),!0):!1}function et(){return!T.fc&&(C===Pt||C===Ee||at.test(v.slice(ge,_)))}function be(){U(ue)||et()||ae()}function D(a){C===a?g():ae()}function ae(){r(_,"Unexpected token")}function tt(a){a.type!=="Identifier"&&a.type!=="MemberExpression"&&r(a.start,"Assigning to rvalue"),Q&&a.type==="Identifier"&&it(a.name)&&r(a.start,"Assigning to "+a.name+" in strict mode")}function re(){(C===Dn||C===Se&&te==="/=")&&k(!0);var a=C,l=V();switch(a){case Nt:case xn:g();var c=a===Nt;U(ue)||et()?l.label=null:C!==Ce?ae():(l.label=se(),be());for(var d=0;d<L.length;++d){var E=L[d];if((l.label===null||E.name===l.label.name)&&(E.kind!==null&&(c||E.kind==="loop")||l.label&&c))break}return d===L.length&&r(l.start,"Unsyntactic "+a.l),I(l,c?"BreakStatement":"ContinueStatement");case Sn:return g(),be(),I(l,"DebuggerStatement");case kn:return g(),L.push(_t),l.body=re(),L.pop(),D(Vt),l.test=Ne(),be(),I(l,"DoWhileStatement");case In:return g(),L.push(_t),D(ce),C===ue?St(l,null):C===Mt?(a=V(),g(),gn(a,!0),I(a,"VariableDeclaration"),a.fa.length===1&&U(ot)?mn(l,a):St(l,a)):(a=G(!1,!0),U(ot)?(tt(a),mn(l,a)):St(l,a));case Ft:return g(),Et(l,!0);case jn:return g(),l.test=Ne(),l.da=re(),l.alternate=U(Cn)?re():null,I(l,"IfStatement");case Tn:return Me||T.Ib||r(_,"'return' outside of function"),g(),U(ue)||et()?l.K=null:(l.K=G(),be()),I(l,"ReturnStatement");case Ut:for(g(),l.Qb=Ne(),l.tb=[],D(De),L.push(go);C!==Ee;)C===Bt||C===wn?(a=C===Bt,d&&I(d,"SwitchCase"),l.tb.push(d=V()),d.da=[],g(),a?d.test=G():(c&&r(Ot,"Multiple default clauses"),c=!0,d.test=null),D(Le)):(d||ae(),d.da.push(re()));return d&&I(d,"SwitchCase"),g(),L.pop(),I(l,"SwitchStatement");case An:return g(),at.test(v.slice(ge,_))&&r(ge,"Illegal newline after throw"),l.K=G(),be(),I(l,"ThrowStatement");case On:return g(),l.block=Be(),l.Ea=null,C===bn&&(a=V(),g(),D(ce),a.Ua=se(),Q&&it(a.Ua.name)&&r(a.Ua.start,"Binding "+a.Ua.name+" in strict mode"),D(oe),a.body=Be(),l.Ea=I(a,"CatchClause")),l.fb=U(En)?Be():null,l.Ea||l.fb||r(l.start,"Missing catch or finally clause"),I(l,"TryStatement");case Mt:return g(),gn(l),be(),I(l,"VariableDeclaration");case Vt:return g(),l.test=Ne(),L.push(_t),l.body=re(),L.pop(),I(l,"WhileStatement");case Rn:return Q&&r(_,"'with' in strict mode"),g(),l.object=Ne(),l.body=re(),I(l,"WithStatement");case De:return Be();case ue:return g(),I(l,"EmptyStatement");default:if(c=te,E=G(),a===Ce&&E.type==="Identifier"&&U(Le)){for(d=0;d<L.length;++d)L[d].name===c&&r(E.start,"Label '"+c+"' is already declared");return L.push({name:c,kind:C.W?"loop":C===Ut?"switch":null}),l.body=re(),L.pop(),l.label=E,I(l,"LabeledStatement")}return l.la=E,be(),I(l,"ExpressionStatement")}}function Ne(){D(ce);var a=G();return D(oe),a}function Be(a){var l=V(),c=!0,d=!1;for(l.body=[],D(De);!U(Ee);){var E=re();if(l.body.push(E),c&&a&&Qe(E)){var W=d;F(d=!0)}c=!1}return d&&!W&&F(!1),I(l,"BlockStatement")}function St(a,l){return a.ua=l,D(ue),a.test=C===ue?null:G(),D(ue),a.update=C===oe?null:G(),D(oe),a.body=re(),L.pop(),I(a,"ForStatement")}function mn(a,l){return a.left=l,a.right=G(),D(oe),a.body=re(),L.pop(),I(a,"ForInStatement")}function gn(a,l){for(a.fa=[],a.kind="var";;){var c=V();if(c.id=se(),Q&&it(c.id.name)&&r(c.id.start,"Binding "+c.id.name+" in strict mode"),c.ua=U(Ln)?G(!0,l):null,a.fa.push(I(c,"VariableDeclarator")),!U(ye))break}}function G(a,l){var c=wt(l);if(!a&&C===ye){for(a=ne(c),a.xb=[c];U(ye);)a.xb.push(wt(l));return I(a,"SequenceExpression")}return c}function wt(a){var l=kt(Ct(),-1,a);if(U(Vn)){var c=ne(l);c.test=l,c.da=G(!0),D(Le),c.alternate=G(!0,a),l=I(c,"ConditionalExpression")}return C.Cb?(c=ne(l),c.operator=te,c.left=l,g(),c.right=wt(a),tt(l),I(c,"AssignmentExpression")):l}function kt(a,l,c){var d=C.L;if(d!==null&&(!c||C!==ot)&&d>l){var E=ne(a);return E.left=a,E.operator=te,a=C,g(),E.right=kt(Ct(),d,c),d=I(E,a===Wn||a===$n?"LogicalExpression":"BinaryExpression"),kt(d,l,c)}return a}function Ct(){if(C.prefix){var a=V(),l=C.$b;return a.operator=te,Ue=a.prefix=!0,g(),a.K=Ct(),l?tt(a.K):Q&&a.operator==="delete"&&a.K.type==="Identifier"&&r(a.start,"Deleting local variable in strict mode"),I(a,l?"UpdateExpression":"UnaryExpression")}for(l=Fe(nt());C.cc&&!et();)a=ne(l),a.operator=te,a.prefix=!1,a.K=l,tt(l),g(),l=I(a,"UpdateExpression");return l}function Fe(a,l){if(U(Mn)){var c=ne(a);return c.object=a,c.Wa=se(!0),c.bb=!1,Fe(I(c,"MemberExpression"),l)}return U(Dt)?(c=ne(a),c.object=a,c.Wa=G(),c.bb=!0,D(Lt),Fe(I(c,"MemberExpression"),l)):!l&&U(ce)?(c=ne(a),c.callee=a,c.arguments=It(oe,!1),Fe(I(c,"CallExpression"),l)):a}function nt(){switch(C){case Nn:var a=V();return g(),I(a,"ThisExpression");case Ce:return se();case Ve:case rt:case vn:return a=V(),a.value=te,a.raw=v.slice(_,ke),g(),I(a,"Literal");case Bn:case Fn:case Un:return a=V(),a.value=C.$a,a.raw=C.l,g(),I(a,"Literal");case ce:a=Tt;var l=_;g();var c=G();return c.start=l,c.end=ke,T.C&&(c.X.start=a,c.X.end=At),T.Xa&&(c.j=[l,ke]),D(oe),c;case Dt:return a=V(),g(),a.elements=It(Lt,!0,!0),I(a,"ArrayExpression");case De:for(a=V(),l=!0,c=!1,a.h=[],g();!U(Ee);){if(l)l=!1;else if(D(ye),T.sb&&U(Ee))break;var d={key:C===Ve||C===rt?nt():se(!0)},E=!1;if(U(Le)){d.value=G(!0);var W=d.kind="init"}else d.key.type!=="Identifier"||d.key.name!=="get"&&d.key.name!=="set"?ae():(E=c=!0,W=d.kind=d.key.name,d.key=C===Ve||C===rt?nt():se(!0),C!==ce&&ae(),d.value=Et(V(),!1));if(d.key.type==="Identifier"&&(Q||c))for(var z=0;z<a.h.length;++z){var je=a.h[z];if(je.key.name===d.key.name){var Wt=W===je.kind||E&&je.kind==="init"||W==="init"&&(je.kind==="get"||je.kind==="set");Wt&&!Q&&W==="init"&&je.kind==="init"&&(Wt=!1),Wt&&r(d.key.start,"Redefinition of property")}}a.h.push(d)}return I(a,"ObjectExpression");case Ft:return a=V(),g(),Et(a,!1);case Pn:return a=V(),g(),a.callee=Fe(nt(),!0),a.arguments=U(ce)?It(oe,!1):eo,I(a,"NewExpression")}ae()}function Et(a,l){C===Ce?a.id=se():l?ae():a.id=null,a.oa=[];var c=!0;for(D(ce);!U(oe);)c?c=!1:D(ye),a.oa.push(se());c=Me;var d=L;if(Me=!0,L=[],a.body=Be(!0),Me=c,L=d,Q||a.body.body.length&&Qe(a.body.body[0])){for(c=a.id?-1:0;c<a.oa.length;++c)if(d=0>c?a.id:a.oa[c],(Hn(d.name)||it(d.name))&&r(d.start,"Defining '"+d.name+"' in strict mode"),0<=c)for(var E=0;E<c;++E)d.name===a.oa[E].name&&r(d.start,"Argument name clash in strict mode")}return I(a,l?"FunctionDeclaration":"FunctionExpression")}function It(a,l,c){for(var d=[],E=!0;!U(a);){if(E)E=!1;else if(D(ye),l&&T.sb&&U(a))break;d.push(c&&C===ye?null:G(!0))}return d}function se(a){var l=V();return a&&T.yb==="everywhere"&&(a=!1),C===Ce?(!a&&(T.yb&&fo(te)||Q&&Hn(te))&&v.slice(_,ke).indexOf("\\")===-1&&r(_,"The keyword '"+te+"' is reserved"),l.name=te):a&&C.l?l.name=C.l:ae(),Ue=!1,g(),I(l,"Identifier")}e.version="0.5.0";var T,v="",we,jt;e.parse=function(a,l){v=String(a),we=v.length,T=l||{};for(var c in yn)Object.prototype.hasOwnProperty.call(T,c)||(T[c]=yn[c]);for(jt=T.sourceFile,xe=1,f=le=0,Ue=!0,p(),c=T.dc,Ot=ge=f,T.C&&(Rt=new i),Me=Q=!1,L=[],k(),a=c||V(),l=!0,c||(a.body=[]);C!==Pt;)c=re(),a.body.push(c),l&&Qe(c)&&F(!0),l=!1;return I(a,"Program")};var yn={fc:!1,sb:!0,yb:!1,Ib:!1,C:!1,va:null,Xa:!1,dc:null,sourceFile:null,vb:null},f=0,_=0,ke=0,Tt,At,C,te,Ue,xe,le,Ot=0,ge=0,Rt,Me,L,Q,eo=[],Ve={type:"num"},vn={type:"regexp"},rt={type:"string"},Ce={type:"name"},Pt={type:"eof"},Nt={l:"break"},Bt={l:"case",m:!0},bn={l:"catch"},xn={l:"continue"},Sn={l:"debugger"},wn={l:"default"},kn={l:"do",W:!0},Cn={l:"else",m:!0},En={l:"finally"},In={l:"for",W:!0},Ft={l:"function"},jn={l:"if"},Tn={l:"return",m:!0},Ut={l:"switch"},An={l:"throw",m:!0},On={l:"try"},Mt={l:"var"},Vt={l:"while",W:!0},Rn={l:"with"},Pn={l:"new",m:!0},Nn={l:"this"},Bn={l:"null",$a:null},Fn={l:"true",$a:!0},Un={l:"false",$a:!1},ot={l:"in",L:7,m:!0},to={break:Nt,case:Bt,catch:bn,continue:xn,debugger:Sn,default:wn,do:kn,else:Cn,finally:En,for:In,function:Ft,if:jn,return:Tn,switch:Ut,throw:An,try:On,var:Mt,while:Vt,with:Rn,null:Bn,true:Fn,false:Un,new:Pn,in:ot,instanceof:{l:"instanceof",L:7,m:!0},this:Nn,typeof:{l:"typeof",prefix:!0,m:!0},void:{l:"void",prefix:!0,m:!0},delete:{l:"delete",prefix:!0,m:!0}},Dt={type:"[",m:!0},Lt={type:"]"},De={type:"{",m:!0},Ee={type:"}"},ce={type:"(",m:!0},oe={type:")"},ye={type:",",m:!0},ue={type:";",m:!0},Le={type:":",m:!0},Mn={type:"."},Vn={type:"?",m:!0},Dn={L:10,m:!0},Ln={Cb:!0,m:!0},Se={Cb:!0,m:!0},no={cc:!0,prefix:!0,$b:!0},_n={prefix:!0,m:!0},Wn={L:1,m:!0},$n={L:2,m:!0},ro={L:3,m:!0},oo={L:4,m:!0},io={L:5,m:!0},ao={L:6,m:!0},so={L:7,m:!0},lo={L:8,m:!0},co={L:9,prefix:!0,m:!0},uo={L:10,m:!0},fo=o("class enum extends super const export import"),Hn=o("implements interface let package private protected public static yield"),it=o("eval arguments"),po=o("break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"),ho=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,Kn=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),mo=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),at=/[\n\r\u2028\u2029]/,st=/\r\n|[\n\r\u2028\u2029]/g,Ie,_t={kind:"loop"},go={kind:"switch"}},Ht=Ht=typeof globalThis>"u"?void 0:globalThis;To(Ht.j||(Ht.j={}));function h(e,t){typeof e=="string"&&(e=Oe(e,"code"));var n=e.constructor;this.ya=function(){return new n({options:{}})};var r=this.ya(),o;for(o in e)r[o]=o==="body"?e[o].slice():e[o];this.ra=r,this.ca=[],this.qb=t,this.za=!1,this.ba=[],this.Ya=0,this.rb=Object.create(null),e=/^step([A-Z]\w*)$/;var i,s;for(s in this)typeof this[s]=="function"&&(i=s.match(e))&&(this.rb[i[1]]=this[s].bind(this));this.N=Gt(this,this.ra,null),this.Na=this.N.object,this.ra=Oe(this.ba.join(`
|
|
4
4
|
`),"polyfills"),this.ba=void 0,mt(this.ra),i=new S(this.ra,this.N),i.done=!1,this.o=[i],this.Eb(),this.value=void 0,this.ra=r,i=new S(this.ra,this.N),i.done=!1,this.o.length=0,this.o[0]=i}var Gn={C:!0,kc:5},qt={configurable:!0,enumerable:!0,writable:!1},b={configurable:!0,enumerable:!1,writable:!0},Z={configurable:!0,enumerable:!1,writable:!1},_e={configurable:!1,enumerable:!1,writable:!1},Xn={configurable:!1,enumerable:!0,writable:!0},yr={STEP_ERROR:!0},Pe={SCOPE_REFERENCE:!0},Je={VALUE_IN_DESCRIPTOR:!0},Ae={REGEXP_TIMEOUT:!0},Jn=[],de=null,Ge=null,ve=typeof globalThis>"u"?void 0:globalThis,Ao=["onmessage = function(e) {","var result;","var data = e.data;","switch (data[0]) {","case 'split':","result = data[1].split(data[2], data[3]);","break;","case 'match':","result = data[1].match(data[2]);","break;","case 'search':","result = data[1].search(data[2]);","break;","case 'replace':","result = data[1].replace(data[2], data[3]);","break;","case 'exec':","var regexp = data[1];","regexp.lastIndex = data[2];","result = [regexp.exec(data[3]), data[1].lastIndex];","break;","default:","throw Error('Unknown RegExp operation: ' + data[0]);","}","postMessage(result);","close();","};"];function Zt(e){var t=e>>>0;return t===Number(e)?t:NaN}function Xe(e){var t=e>>>0;return String(t)===String(e)&&t!==4294967295?t:NaN}function mt(e,t,n){t?e.start=t:delete e.start,n?e.end=n:delete e.end;for(var r in e)if(r!=="loc"&&e.hasOwnProperty(r)){var o=e[r];o&&typeof o=="object"&&mt(o,t,n)}}h.prototype.REGEXP_MODE=2;h.prototype.REGEXP_THREAD_TIMEOUT=1e3;h.prototype.POLYFILL_TIMEOUT=1e3;B=h.prototype;B.P=!1;B.Ka=!1;B.Kb=0;B.ic=0;function Oe(e,t){var n={},r;for(r in Gn)n[r]=Gn[r];return n.sourceFile=t,ve.j.parse(e,n)}B.Jb=function(e){var t=this.o[0];if(!t||t.node.type!=="Program")throw Error("Expecting original AST to start with a Program node");if(typeof e=="string"&&(e=Oe(e,"appendCode"+this.Kb++)),!e||e.type!=="Program")throw Error("Expecting new AST to start with a Program node");Ye(this,e,t.scope),Array.prototype.push.apply(t.node.body,e.body),t.node.body.jb=null,t.done=!1};B.lb=function(){var e=this.o,t;do{var n=e[e.length-1];if(this.za)break;if(!n||n.node.type==="Program"&&n.done){if(!this.ca.length)return!1;if(n=this.ca[0],!n||n.time>Date.now())n=null;else{this.ca.shift(),0<=n.interval&&xr(this,n,n.interval);var r=new S(n.node,n.scope);n.zb&&(r.ia=2,r.B=this.Na,r.U=n.zb,r.Qa=!0,r.F=n.Lb),n=r}if(!n)break}r=n.node;var o=Ge;Ge=this;try{var i=this.rb[r.type](e,n,r)}catch(s){if(s!==yr)throw this.value!==s&&(this.value=void 0),s}finally{Ge=o}if(i&&e.push(i),this.P)throw this.value=void 0,Error("Getter not supported in this context");if(this.Ka)throw this.value=void 0,Error("Setter not supported in this context");t||r.end||(t=Date.now()+this.POLYFILL_TIMEOUT)}while(!r.end&&t>Date.now());return!0};B.Eb=function(){for(;!this.za&&this.lb(););return this.za};function Oo(e,t){e.g(t,"NaN",NaN,_e),e.g(t,"Infinity",1/0,_e),e.g(t,"undefined",void 0,_e),e.g(t,"window",t,qt),e.g(t,"this",t,_e),e.g(t,"self",t),e.M=new P(null),e.Z=new P(e.M),Ro(e,t),Po(e,t),t.xa=e.M,e.g(t,"constructor",e.v,b),No(e,t),Bo(e,t),Fo(e,t),Uo(e,t),Mo(e,t),Vo(e,t),Do(e,t),Lo(e,t),_o(e,t);var n=e.i(function(){throw EvalError("Can't happen")},!1);n.eval=!0,e.g(t,"eval",n,b),e.g(t,"parseInt",e.i(parseInt,!1),b),e.g(t,"parseFloat",e.i(parseFloat,!1),b),e.g(t,"isNaN",e.i(isNaN,!1),b),e.g(t,"isFinite",e.i(isFinite,!1),b);for(var r=[[escape,"escape"],[unescape,"unescape"],[decodeURI,"decodeURI"],[decodeURIComponent,"decodeURIComponent"],[encodeURI,"encodeURI"],[encodeURIComponent,"encodeURIComponent"]],o=0;o<r.length;o++)n=function(i){return function(s){try{return i(s)}catch(u){w(e,e.Gb,u.message)}}}(r[o][0]),e.g(t,r[o][1],e.i(n,!1),b);n=function(i){return Yn(e,!1,arguments)},e.g(t,"setTimeout",e.i(n,!1),b),n=function(i){return Yn(e,!0,arguments)},e.g(t,"setInterval",e.i(n,!1),b),n=function(i){zn(e,i)},e.g(t,"clearTimeout",e.i(n,!1),b),n=function(i){zn(e,i)},e.g(t,"clearInterval",e.i(n,!1),b),e.OBJECT=e.v,e.OBJECT_PROTO=e.M,e.FUNCTION=e.O,e.FUNCTION_PROTO=e.Z,e.ARRAY=e.qa,e.ARRAY_PROTO=e.La,e.REGEXP=e.I,e.REGEXP_PROTO=e.Ma,e.DATE=e.$,e.DATE_PROTO=e.nb,e.qb&&e.qb(e,t)}B.Wb=0;function Ro(e,t){var n=/^[A-Za-z_$][\w$]*$/,r=function(o){var i=arguments.length?String(arguments[arguments.length-1]):"",s=Array.prototype.slice.call(arguments,0,-1).join(",").trim();if(s){s=s.split(/\s*,\s*/);for(var u=0;u<s.length;u++){var p=s[u];n.test(p)||w(e,e.T,"Invalid function argument: "+p)}s=s.join(", ")}try{var x=Oe("(function("+s+") {"+i+"})","function"+e.Wb++)}catch(k){w(e,e.T,"Invalid code: "+k.message)}return x.body.length!==1&&w(e,e.T,"Invalid code in function body"),tn(e,x.body[0].la,e.N,"anonymous")};e.O=e.i(r,!0),e.g(t,"Function",e.O,b),e.g(e.O,"prototype",e.Z,b),e.g(e.Z,"constructor",e.O,b),e.Z.Ta=function(){},e.Z.Ta.id=e.Ya++,e.Z.Ab=!0,e.g(e.Z,"length",0,Z),e.Z.H="Function",r=function(o,i){var s=e.o[e.o.length-1];s.U=this,s.B=o,s.F=[],i!=null&&(i instanceof P?s.F=vr(e,i):w(e,e.j,"CreateListFromArrayLike called on non-object")),s.eb=!1},$(e,e.O,"apply",r),r=function(o){var i=e.o[e.o.length-1];i.U=this,i.B=o,i.F=[];for(var s=1;s<arguments.length;s++)i.F.push(arguments[s]);i.eb=!1},$(e,e.O,"call",r),e.ba.push("Object.defineProperty(Function.prototype, 'bind',","{configurable: true, writable: true, value:","function bind(oThis) {","if (typeof this !== 'function') {","throw TypeError('What is trying to be bound is not callable');","}","var aArgs = Array.prototype.slice.call(arguments, 1),","fToBind = this,","fNOP = function() {},","fBound = function() {","return fToBind.apply(this instanceof fNOP","? this",": oThis,","aArgs.concat(Array.prototype.slice.call(arguments)));","};","if (this.prototype) {","fNOP.prototype = this.prototype;","}","fBound.prototype = new fNOP();","return fBound;","}","});",""),r=function(){return String(this)},$(e,e.O,"toString",r),e.g(e.O,"toString",e.i(r,!1),b),r=function(){return this.valueOf()},$(e,e.O,"valueOf",r),e.g(e.O,"valueOf",e.i(r,!1),b)}function Po(e,t){function n(o){o!=null||w(e,e.j,"Cannot convert '"+o+"' to object")}var r=function(o){if(o==null)return he(e)?this:e.s(e.M);if(!(o instanceof P)){var i=e.s(pe(e,o));return i.data=o,i}return o};e.v=e.i(r,!0),e.g(e.v,"prototype",e.M,b),e.g(e.M,"constructor",e.v,b),e.g(t,"Object",e.v,b),r=function(o){return n(o),fe(e,Object.getOwnPropertyNames(o instanceof P?o.h:o))},e.g(e.v,"getOwnPropertyNames",e.i(r,!1),b),r=function(o){return n(o),o instanceof P&&(o=o.h),fe(e,Object.keys(o))},e.g(e.v,"keys",e.i(r,!1),b),r=function(o){return o===null?e.s(null):(o instanceof P||w(e,e.j,"Object prototype may only be an Object or null, not "+o),e.s(o))},e.g(e.v,"create",e.i(r,!1),b),e.ba.push("(function() {","var create_ = Object.create;","Object.create = function create(proto, props) {","var obj = create_(proto);","props && Object.defineProperties(obj, props);","return obj;","};","})();",""),r=function(o,i,s){return i=String(i),o instanceof P||w(e,e.j,"Object.defineProperty called on non-object: "+o),s instanceof P||w(e,e.j,"Property description must be an object"),!o.preventExtensions||i in o.h||w(e,e.j,"Can't define property '"+i+"', object is not extensible"),e.g(o,i,Je,s.h),o},e.g(e.v,"defineProperty",e.i(r,!1),b),e.ba.push("(function() {","var defineProperty_ = Object.defineProperty;","Object.defineProperty = function defineProperty(obj, prop, d1) {","var d2 = {};","if ('configurable' in d1) d2.configurable = d1.configurable;","if ('enumerable' in d1) d2.enumerable = d1.enumerable;","if ('writable' in d1) d2.writable = d1.writable;","if ('value' in d1) d2.value = d1.value;","if ('get' in d1) d2.get = d1.get;","if ('set' in d1) d2.set = d1.set;","return defineProperty_(obj, prop, d2);","};","})();","Object.defineProperty(Object, 'defineProperties',","{configurable: true, writable: true, value:","function defineProperties(obj, props) {","var keys = Object.keys(props);","for (var i = 0; i < keys.length; i++) {","Object.defineProperty(obj, keys[i], props[keys[i]]);","}","return obj;","}","});",""),r=function(o,i){if(o instanceof P||w(e,e.j,"Object.getOwnPropertyDescriptor called on non-object: "+o),i=String(i),i in o.h){var s=Object.getOwnPropertyDescriptor(o.h,i),u=o.V[i];return o=o.Y[i],i=e.s(e.M),u||o?(e.g(i,"get",u),e.g(i,"set",o)):(e.g(i,"value",s.value),e.g(i,"writable",s.writable)),e.g(i,"configurable",s.configurable),e.g(i,"enumerable",s.enumerable),i}},e.g(e.v,"getOwnPropertyDescriptor",e.i(r,!1),b),r=function(o){return n(o),pe(e,o)},e.g(e.v,"getPrototypeOf",e.i(r,!1),b),r=function(o){return!!o&&!o.preventExtensions},e.g(e.v,"isExtensible",e.i(r,!1),b),r=function(o){return o instanceof P&&(o.preventExtensions=!0),o},e.g(e.v,"preventExtensions",e.i(r,!1),b),$(e,e.v,"toString",P.prototype.toString),$(e,e.v,"toLocaleString",P.prototype.toString),$(e,e.v,"valueOf",P.prototype.valueOf),r=function(o){return n(this),this instanceof P?String(o)in this.h:this.hasOwnProperty(o)},$(e,e.v,"hasOwnProperty",r),r=function(o){return n(this),this instanceof P?Object.prototype.propertyIsEnumerable.call(this.h,o):this.propertyIsEnumerable(o)},$(e,e.v,"propertyIsEnumerable",r),r=function(o){for(;;){if(o=pe(e,o),!o)return!1;if(o===this)return!0}},$(e,e.v,"isPrototypeOf",r)}function No(e,t){var n=function(r){var o=he(e)?this:Re(e),i=arguments[0];if(arguments.length===1&&typeof i=="number")isNaN(Zt(i))&&w(e,e.ob,"Invalid array length: "+i),o.h.length=i;else{for(i=0;i<arguments.length;i++)o.h[i]=arguments[i];o.h.length=i}return o};e.qa=e.i(n,!0),e.La=e.qa.h.prototype,e.g(t,"Array",e.qa,b),n=function(r){return r&&r.H==="Array"},e.g(e.qa,"isArray",e.i(n,!1),b),e.g(e.La,"length",0,{configurable:!1,enumerable:!1,writable:!0}),e.La.H="Array",e.ba.push("(function() {","function createArrayMethod_(f) {","Object.defineProperty(Array.prototype, f.name,","{configurable: true, writable: true, value: f});","}","createArrayMethod_(","function pop() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","o.length = 0;","return undefined;","}","len--;","var x = o[len];","delete o[len];","o.length = len;","return x;","}",");","createArrayMethod_(","function push(var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","for (var i = 0; i < arguments.length; i++) {","o[len] = arguments[i];","len++;","}","o.length = len;","return len;","}",");","createArrayMethod_(","function shift() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","o.length = 0;","return undefined;","}","var value = o[0];","for (var i = 0; i < len - 1; i++) {","if ((i + 1) in o) {","o[i] = o[i + 1];","} else {","delete o[i];","}","}","delete o[i];","o.length = len - 1;","return value;","}",");","createArrayMethod_(","function unshift(var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 0) {","len = 0;","}","for (var i = len - 1; i >= 0; i--) {","if (i in o) {","o[i + arguments.length] = o[i];","} else {","delete o[i + arguments.length];","}","}","for (var i = 0; i < arguments.length; i++) {","o[i] = arguments[i];","}","return (o.length = len + arguments.length);","}",");","createArrayMethod_(","function reverse() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len || len < 2) {","return o;","}","for (var i = 0; i < len / 2 - 0.5; i++) {","var x = o[i];","var hasX = i in o;","if ((len - i - 1) in o) {","o[i] = o[len - i - 1];","} else {","delete o[i];","}","if (hasX) {","o[len - i - 1] = x;","} else {","delete o[len - i - 1];","}","}","return o;","}",");","createArrayMethod_(","function indexOf(searchElement, fromIndex) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var n = fromIndex | 0;","if (!len || n >= len) {","return -1;","}","var i = Math.max(n >= 0 ? n : len - Math.abs(n), 0);","while (i < len) {","if (i in o && o[i] === searchElement) {","return i;","}","i++;","}","return -1;","}",");","createArrayMethod_(","function lastIndexOf(searchElement, fromIndex) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","if (!len) {","return -1;","}","var n = len - 1;","if (arguments.length > 1) {","n = fromIndex | 0;","if (n) {","n = (n > 0 || -1) * Math.floor(Math.abs(n));","}","}","var i = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);","while (i >= 0) {","if (i in o && o[i] === searchElement) {","return i;","}","i--;","}","return -1;","}",");","createArrayMethod_(","function slice(start, end) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","start |= 0;","start = (start >= 0) ? start : Math.max(0, len + start);","if (typeof end !== 'undefined') {","if (end !== Infinity) {","end |= 0;","}","if (end < 0) {","end = len + end;","} else {","end = Math.min(end, len);","}","} else {","end = len;","}","var size = end - start;","var cloned = new Array(size);","for (var i = 0; i < size; i++) {","if ((start + i) in o) {","cloned[i] = o[start + i];","}","}","return cloned;","}",");","createArrayMethod_(","function splice(start, deleteCount, var_args) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","start |= 0;","if (start < 0) {","start = Math.max(len + start, 0);","} else {","start = Math.min(start, len);","}","if (arguments.length < 1) {","deleteCount = len - start;","} else {","deleteCount |= 0;","deleteCount = Math.max(0, Math.min(deleteCount, len - start));","}","var removed = [];","for (var i = start; i < start + deleteCount; i++) {","if (i in o) {","removed.push(o[i]);","} else {","removed.length++;","}","if ((i + deleteCount) in o) {","o[i] = o[i + deleteCount];","} else {","delete o[i];","}","}","for (var i = start + deleteCount; i < len - deleteCount; i++) {","if ((i + deleteCount) in o) {","o[i] = o[i + deleteCount];","} else {","delete o[i];","}","}","for (var i = len - deleteCount; i < len; i++) {","delete o[i];","}","len -= deleteCount;","var arl = arguments.length - 2;","for (var i = len - 1; i >= start; i--) {","if (i in o) {","o[i + arl] = o[i];","} else {","delete o[i + arl];","}","}","len += arl;","for (var i = 2; i < arguments.length; i++) {","o[start + i - 2] = arguments[i];","}","o.length = len;","return removed;","}",");","createArrayMethod_(","function concat(var_args) {","if (!this) throw TypeError();","var o = Object(this);","var cloned = [];","for (var i = -1; i < arguments.length; i++) {","var value = (i === -1) ? o : arguments[i];","if (Array.isArray(value)) {","for (var j = 0, l = value.length; j < l; j++) {","if (j in value) {","cloned.push(value[j]);","} else {","cloned.length++;","}","}","} else {","cloned.push(value);","}","}","return cloned;","}",");","createArrayMethod_(","function join(opt_separator) {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var sep = typeof opt_separator === 'undefined' ?","',' : ('' + opt_separator);","var str = '';","for (var i = 0; i < len; i++) {","if (i && sep) str += sep;","str += (o[i] === null || o[i] === undefined) ? '' : o[i];","}","return str;","}",");","createArrayMethod_(","function every(callbackfn, thisArg) {","if (!this || typeof callbackfn !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","while (k < len) {","if (k in o && !callbackfn.call(t, o[k], k, o)) return false;","k++;","}","return true;","}",");","createArrayMethod_(","function filter(fun, var_args) {","if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var res = [];","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in o) {","var val = o[i];","if (fun.call(thisArg, val, i, o)) res.push(val);","}","}","return res;","}",");","createArrayMethod_(","function forEach(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","while (k < len) {","if (k in o) callback.call(t, o[k], k, o);","k++;","}","}",");","createArrayMethod_(","function map(callback, thisArg) {","if (!this || typeof callback !== 'function') throw TypeError();","var t, k = 0;","var o = Object(this), len = o.length >>> 0;","if (arguments.length > 1) t = thisArg;","var a = new Array(len);","while (k < len) {","if (k in o) a[k] = callback.call(t, o[k], k, o);","k++;","}","return a;","}",");","createArrayMethod_(","function reduce(callback /*, initialValue*/) {","if (!this || typeof callback !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var k = 0, value;","if (arguments.length === 2) {","value = arguments[1];","} else {","while (k < len && !(k in o)) k++;","if (k >= len) {","throw TypeError('Reduce of empty array with no initial value');","}","value = o[k++];","}","for (; k < len; k++) {","if (k in o) value = callback(value, o[k], k, o);","}","return value;","}",");","createArrayMethod_(","function reduceRight(callback /*, initialValue*/) {","if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var k = len - 1, value;","if (arguments.length >= 2) {","value = arguments[1];","} else {","while (k >= 0 && !(k in o)) k--;","if (k < 0) {","throw TypeError('Reduce of empty array with no initial value');","}","value = o[k--];","}","for (; k >= 0; k--) {","if (k in o) value = callback(value, o[k], k, o);","}","return value;","}",");","createArrayMethod_(","function some(fun/*, thisArg*/) {","if (!this || typeof fun !== 'function') throw TypeError();","var o = Object(this), len = o.length >>> 0;","var thisArg = arguments.length >= 2 ? arguments[1] : void 0;","for (var i = 0; i < len; i++) {","if (i in o && fun.call(thisArg, o[i], i, o)) return true;","}","return false;","}",");","createArrayMethod_(","function sort(opt_comp) {","if (!this) throw TypeError();","if (typeof opt_comp !== 'function') {","opt_comp = undefined;","}","for (var i = 0; i < this.length; i++) {","var changes = 0;","for (var j = 0; j < this.length - i - 1; j++) {","if (opt_comp ? (opt_comp(this[j], this[j + 1]) > 0) :","(String(this[j]) > String(this[j + 1]))) {","var swap = this[j];","var hasSwap = j in this;","if ((j + 1) in this) {","this[j] = this[j + 1];","} else {","delete this[j];","}","if (hasSwap) {","this[j + 1] = swap;","} else {","delete this[j + 1];","}","changes++;","}","}","if (!changes) break;","}","return this;","}",");","createArrayMethod_(","function toLocaleString() {","if (!this) throw TypeError();","var o = Object(this), len = o.length >>> 0;","var out = [];","for (var i = 0; i < len; i++) {","out[i] = (o[i] === null || o[i] === undefined) ? '' : o[i].toLocaleString();","}","return out.join(',');","}",");","})();","")}function Bo(e,t){var n=function(r){return r=arguments.length?ve.String(r):"",he(e)?(this.data=r,this):r};for(e.J=e.i(n,!0),e.g(t,"String",e.J,b),e.g(e.J,"fromCharCode",e.i(String.fromCharCode,!1),b),t="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" "),n=0;n<t.length;n++)$(e,e.J,t[n],String.prototype[t[n]]);n=function(r,o,i){o=e.R(o),i=e.R(i);try{return String(this).localeCompare(r,o,i)}catch(s){w(e,e.D,"localeCompare: "+s.message)}},$(e,e.J,"localeCompare",n),n=function(r,o,i){var s=String(this);if(o=o?Number(o):void 0,H(e,r,e.I)&&(r=r.data,$e(e,r,i),e.REGEXP_MODE===2)){if(de)r=We(e,"string.split(separator, limit)",{string:s,separator:r,limit:o},r,i),r!==Ae&&i(fe(e,r));else{var u=e.ha(),p=He(e,r,u,i);u.onmessage=function(x){clearTimeout(p),i(fe(e,x.data))},u.postMessage(["split",s,r,o])}return}r=s.split(r,o),i(fe(e,r))},Ke(e,e.J,"split",n),n=function(r,o){var i=String(this);if(r=H(e,r,e.I)?r.data:new RegExp(r),$e(e,r,o),e.REGEXP_MODE===2)if(de)r=We(e,"string.match(regexp)",{string:i,regexp:r},r,o),r!==Ae&&o(r&&fe(e,r));else{var s=e.ha(),u=He(e,r,s,o);s.onmessage=function(p){clearTimeout(u),o(p.data&&fe(e,p.data))},s.postMessage(["match",i,r])}else r=i.match(r),o(r&&fe(e,r))},Ke(e,e.J,"match",n),n=function(r,o){var i=String(this);if(H(e,r,e.I)?r=r.data:r=new RegExp(r),$e(e,r,o),e.REGEXP_MODE===2)if(de)r=We(e,"string.search(regexp)",{string:i,regexp:r},r,o),r!==Ae&&o(r);else{var s=e.ha(),u=He(e,r,s,o);s.onmessage=function(p){clearTimeout(u),o(p.data)},s.postMessage(["search",i,r])}else o(i.search(r))},Ke(e,e.J,"search",n),n=function(r,o,i){var s=String(this);if(o=String(o),H(e,r,e.I)&&(r=r.data,$e(e,r,i),e.REGEXP_MODE===2)){if(de)r=We(e,"string.replace(substr, newSubstr)",{string:s,substr:r,newSubstr:o},r,i),r!==Ae&&i(r);else{var u=e.ha(),p=He(e,r,u,i);u.onmessage=function(x){clearTimeout(p),i(x.data)},u.postMessage(["replace",s,r,o])}return}i(s.replace(r,o))},Ke(e,e.J,"replace",n),e.ba.push("(function() {","var replace_ = String.prototype.replace;","String.prototype.replace = function replace(substr, newSubstr) {","if (typeof newSubstr !== 'function') {","return replace_.call(this, substr, newSubstr);","}","var str = this;","if (substr instanceof RegExp) {","var subs = [];","var m = substr.exec(str);","while (m) {","m.push(m.index, str);","var inject = newSubstr.apply(null, m);","subs.push([m.index, m[0].length, inject]);","m = substr.global ? substr.exec(str) : null;","}","for (var i = subs.length - 1; i >= 0; i--) {","str = str.substring(0, subs[i][0]) + subs[i][2] + str.substring(subs[i][0] + subs[i][1]);","}","} else {","var i = str.indexOf(substr);","if (i !== -1) {","var inject = newSubstr(str.substr(i, substr.length), i, str);","str = str.substring(0, i) + inject + str.substring(i + substr.length);","}","}","return str;","};","})();","")}function Fo(e,t){e.mb=e.i(function(n){return n=ve.Boolean(n),he(e)?(this.data=n,this):n},!0),e.g(t,"Boolean",e.mb,b)}function Uo(e,t){var n=function(r){return r=arguments.length?ve.Number(r):0,he(e)?(this.data=r,this):r};for(e.aa=e.i(n,!0),e.g(t,"Number",e.aa,b),t=["MAX_VALUE","MIN_VALUE","NaN","NEGATIVE_INFINITY","POSITIVE_INFINITY"],n=0;n<t.length;n++)e.g(e.aa,t[n],Number[t[n]],_e);n=function(r){try{return Number(this).toExponential(r)}catch(o){w(e,e.D,o.message)}},$(e,e.aa,"toExponential",n),n=function(r){try{return Number(this).toFixed(r)}catch(o){w(e,e.D,o.message)}},$(e,e.aa,"toFixed",n),n=function(r){try{return Number(this).toPrecision(r)}catch(o){w(e,e.D,o.message)}},$(e,e.aa,"toPrecision",n),n=function(r){try{return Number(this).toString(r)}catch(o){w(e,e.D,o.message)}},$(e,e.aa,"toString",n),n=function(r,o){r=r?e.R(r):void 0,o=o?e.R(o):void 0;try{return Number(this).toLocaleString(r,o)}catch(i){w(e,e.D,"toLocaleString: "+i.message)}},$(e,e.aa,"toLocaleString",n)}function Mo(e,t){var n=function(o,i){if(!he(e))return ve.Date();var s=[null].concat(Array.from(arguments));return this.data=new(Function.prototype.bind.apply(ve.Date,s)),this};e.$=e.i(n,!0),e.nb=e.$.h.prototype,e.g(t,"Date",e.$,b),e.g(e.$,"now",e.i(Date.now,!1),b),e.g(e.$,"parse",e.i(Date.parse,!1),b),e.g(e.$,"UTC",e.i(Date.UTC,!1),b),t="getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear toDateString toISOString toJSON toGMTString toLocaleDateString toLocaleString toLocaleTimeString toTimeString toUTCString".split(" ");for(var r=0;r<t.length;r++)n=function(o){return function(i){var s=this.data;s instanceof Date||w(e,e.j,o+" not called on a Date");for(var u=[],p=0;p<arguments.length;p++)u[p]=e.R(arguments[p]);return s[o].apply(s,u)}}(t[r]),$(e,e.$,t[r],n)}function Vo(e,t){var n=function(r,o){if(he(e))var i=this;else{if(o===void 0&&H(e,r,e.I))return r;i=e.s(e.Ma)}r=r===void 0?"":String(r),o=o?String(o):"",/^[gmi]*$/.test(o)||w(e,e.T,"Invalid regexp flag: "+o);try{var s=new ve.RegExp(r,o)}catch(u){w(e,e.T,u.message)}return Qt(e,i,s),i};e.I=e.i(n,!0),e.Ma=e.I.h.prototype,e.g(t,"RegExp",e.I,b),e.g(e.I.h.prototype,"global",void 0,Z),e.g(e.I.h.prototype,"ignoreCase",void 0,Z),e.g(e.I.h.prototype,"multiline",void 0,Z),e.g(e.I.h.prototype,"source","(?:)",Z),e.ba.push("Object.defineProperty(RegExp.prototype, 'test',","{configurable: true, writable: true, value:","function test(str) {","return !!this.exec(str);","}","});"),n=function(r,o){function i(k){if(k){var m=fe(e,k);return e.g(m,"index",k.index),e.g(m,"input",k.input),m}return null}var s=this.data;if(r=String(r),s.lastIndex=Number(e.G(this,"lastIndex")),$e(e,s,o),e.REGEXP_MODE===2)if(de)r=We(e,"regexp.exec(string)",{string:r,regexp:s},s,o),r!==Ae&&(e.g(this,"lastIndex",s.lastIndex),o(i(r)));else{var u=e.ha(),p=He(e,s,u,o),x=this;u.onmessage=function(k){clearTimeout(p),e.g(x,"lastIndex",k.data[1]),o(i(k.data[0]))},u.postMessage(["exec",s,s.lastIndex,r])}else r=s.exec(r),e.g(this,"lastIndex",s.lastIndex),o(i(r))},Ke(e,e.I,"exec",n)}function Do(e,t){function n(r){var o=e.i(function(i){var s=he(e)?this:e.Aa(o);return Kt(e,s,i),s},!0);return e.g(o,"prototype",e.Aa(e.D),b),e.g(o.h.prototype,"name",r,b),e.g(t,r,o,b),o}e.D=e.i(function(r){var o=he(e)?this:e.Aa(e.D);return Kt(e,o,r),o},!0),e.g(t,"Error",e.D,b),e.g(e.D.h.prototype,"message","",b),e.g(e.D.h.prototype,"name","Error",b),n("EvalError"),e.ob=n("RangeError"),e.pb=n("ReferenceError"),e.T=n("SyntaxError"),e.j=n("TypeError"),e.Gb=n("URIError")}function Lo(e,t){var n=e.s(e.M);e.g(t,"Math",n,b);var r="E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2".split(" ");for(t=0;t<r.length;t++)e.g(n,r[t],Math[r[t]],Z);for(r="abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan".split(" "),t=0;t<r.length;t++)e.g(n,r[t],e.i(Math[r[t]],!1),b)}function _o(e,t){var n=e.s(e.M);e.g(t,"JSON",n,b),t=function(r){try{var o=JSON.parse(String(r))}catch(i){w(e,e.T,i.message)}return e.Ia(o)},e.g(n,"parse",e.i(t,!1)),t=function(r,o,i){o&&o.H==="Function"?w(e,e.j,"Function replacer on JSON.stringify not supported"):o&&o.H==="Array"?(o=vr(e,o),o=o.filter(function(u){return typeof u=="string"||typeof u=="number"})):o=null,typeof i!="string"&&typeof i!="number"&&(i=void 0),r=e.R(r);try{var s=JSON.stringify(r,o,i)}catch(u){w(e,e.j,u.message)}return s},e.g(n,"stringify",e.i(t,!1))}function H(e,t,n){if(t==null||!n)return!1;if(n=n.h.prototype,t===n)return!0;for(t=pe(e,t);t;){if(t===n)return!0;t=t.xa}return!1}function Qt(e,t,n){t.data=new RegExp(n.source,n.flags),e.g(t,"lastIndex",n.lastIndex,b),e.g(t,"source",n.source,Z),e.g(t,"global",n.global,Z),e.g(t,"ignoreCase",n.ignoreCase,Z),e.g(t,"multiline",n.multiline,Z)}function Kt(e,t,n){n&&e.g(t,"message",String(n),b),n=[];for(var r=e.o.length-1;0<=r;r--){var o=e.o[r],i=o.node;i.type==="CallExpression"&&(o=o.U)&&n.length&&(n[n.length-1].Ob=e.G(o,"name")),!i.X||n.length&&i.type!=="CallExpression"||n.push({Nb:i.X})}for(r=String(e.G(t,"name")),i=String(e.G(t,"message")),i=r+": "+i+`
|
|
@@ -151,7 +151,7 @@ theFunction();
|
|
|
151
151
|
)`,Zi=({contentId:e,variationId:t})=>`window.${Ur}(
|
|
152
152
|
"${t}", "${e}", ${Mr}
|
|
153
153
|
)`;function Jt(e){return y.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const Qi=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||J.warn("No previewed ID found in search params."),n};function Vr(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new yo.LRUCache({max:500,ttl:1e3*60*5}))}function ea(e){Vr();const t=Qi(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function ta(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function na(){const e=ta().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
154
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Dr=na();function Yt(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const i=e[o],s=[t,o].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...r,...Yt(i,s,n)}:{...r,[s]:i}},{})}function Lr(e,t,n={}){for(const r in e){const o=e[r],i=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(s=>s.startsWith("$"))?Lr(o,i,n):n[i]=o}return n}const ra="v3",nr="builder.",oa="options.",dn=e=>{if(!e)return{};const t=fr(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(nr)){const o=r.replace(nr,"").replace(oa,"");n[o]=t[r]}}),n},ia=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return dn(e)},rr=e=>typeof e=="number"&&!isNaN(e)&&e>=0,pn=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:i,enrich:s,locale:u,apiVersion:p=ra,fields:x,omit:k,offset:m,cacheSeconds:A,staleCacheSeconds:N,sort:O,includeUnpublished:R}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(p))throw new Error(`Invalid apiVersion: expected 'v3', received '${p}'`);const Y=t!==1,j=new URL(`https://cdn.builder.io/api/${p}/content/${o}`);if(j.searchParams.set("apiKey",i),j.searchParams.set("limit",String(t)),j.searchParams.set("noTraverse",String(Y)),j.searchParams.set("includeRefs",String(!0)),u&&j.searchParams.set("locale",u),s&&j.searchParams.set("enrich",String(s)),j.searchParams.set("omit",k||"meta.componentsUsed"),x&&j.searchParams.set("fields",x),Number.isFinite(m)&&m>-1&&j.searchParams.set("offset",String(Math.floor(m))),typeof R=="boolean"&&j.searchParams.set("includeUnpublished",String(R)),A&&rr(A)&&j.searchParams.set("cacheSeconds",String(A)),N&&rr(N)&&j.searchParams.set("staleCacheSeconds",String(N)),O){const M=Yt({sort:O});for(const X in M)j.searchParams.set(X,JSON.stringify(M[X]))}const g={...ia(),...fr(e.options||{})},F=Yt(g);for(const M in F)j.searchParams.set(M,String(F[M]));if(n&&j.searchParams.set("userAttributes",JSON.stringify(n)),r){const M=Lr({query:r});for(const X in M)j.searchParams.set(X,JSON.stringify(M[X]))}return j},aa=e=>"results"in e;async function hn(e){const t=await Wr({...e,limit:1});return t&&t[0]||null}const sa=async e=>{const t=pn(e);return await(await(e.fetch??Dr)(t.href,e.fetchOptions)).json()},_r=async(e,t,n=pn(e))=>{const r=pt(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=ea(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||me==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await Ii({item:s,canTrack:r}));t.results=i}catch(i){J.error("Could not process A/B tests. ",i)}return t.results};async function Wr(e){try{const t=pn(e),n=await sa(e);return aa(n)?_r(e,n):(J.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return J.error("Error fetching data. ",t),null}}function la(e){const t=e||(K()?window.location.search:void 0);return t?dr(t).indexOf("builder.preview=")!==-1:!1}function ca(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function $r(){return ca().replace(/-/g,"")}const Hr="builderSessionId",ua=async({canTrack:e})=>{if(!e)return;const t=await Ar({name:Hr,canTrack:e});if(ie(t))return t;{const n=fa();return da({id:n,canTrack:e}),n}},fa=()=>$r(),da=({id:e,canTrack:t})=>Or({name:Hr,value:e,canTrack:t}),Kr=()=>K()&&typeof localStorage<"u"?localStorage:void 0,pa=({key:e,canTrack:t})=>{var n;try{return t?(n=Kr())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},ha=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Kr())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Gr="builderVisitorId",ma=({canTrack:e})=>{if(!e)return;const t=pa({key:Gr,canTrack:e});if(ie(t))return t;{const n=ga();return ya({id:n,canTrack:e}),n}},ga=()=>$r(),ya=({id:e,canTrack:t})=>ha({key:Gr,value:e,canTrack:t}),va=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ua({canTrack:e}),n=ma({canTrack:e});return{sessionId:t,visitorId:n}},ba=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await va({canTrack:t}),userAttributes:pr(),ownerId:n}});async function Xr(e){if(!e.apiKey){J.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!zt()&&(K()||me==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ba(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xa=e=>Xr({...e,canTrack:!0});function or(e){return Math.round(e*1e3)/1e3}const Sa=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},wa=e=>Sa(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ir=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=or(r/n.width),s=or(o/n.height);return{x:i,y:s}},ka=e=>{const t=e.target,n=t&&wa(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?ir({event:e,target:t}):void 0,builderTargetOffset:n?ir({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},Ca=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Jr(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Ca).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Ea="0.14.
|
|
154
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const Dr=na();function Yt(e,t=null,n="."){return Object.keys(e).reduce((r,o)=>{const i=e[o],s=[t,o].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...r,...Yt(i,s,n)}:{...r,[s]:i}},{})}function Lr(e,t,n={}){for(const r in e){const o=e[r],i=t?t+"."+r:r;o&&typeof o=="object"&&!Array.isArray(o)&&!Object.keys(o).find(s=>s.startsWith("$"))?Lr(o,i,n):n[i]=o}return n}const ra="v3",nr="builder.",oa="options.",dn=e=>{if(!e)return{};const t=fr(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(nr)){const o=r.replace(nr,"").replace(oa,"");n[o]=t[r]}}),n},ia=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return dn(e)},rr=e=>typeof e=="number"&&!isNaN(e)&&e>=0,pn=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:i,enrich:s,locale:u,apiVersion:p=ra,fields:x,omit:k,offset:m,cacheSeconds:A,staleCacheSeconds:N,sort:O,includeUnpublished:R}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(p))throw new Error(`Invalid apiVersion: expected 'v3', received '${p}'`);const Y=t!==1,j=new URL(`https://cdn.builder.io/api/${p}/content/${o}`);if(j.searchParams.set("apiKey",i),j.searchParams.set("limit",String(t)),j.searchParams.set("noTraverse",String(Y)),j.searchParams.set("includeRefs",String(!0)),u&&j.searchParams.set("locale",u),s&&j.searchParams.set("enrich",String(s)),j.searchParams.set("omit",k||"meta.componentsUsed"),x&&j.searchParams.set("fields",x),Number.isFinite(m)&&m>-1&&j.searchParams.set("offset",String(Math.floor(m))),typeof R=="boolean"&&j.searchParams.set("includeUnpublished",String(R)),A&&rr(A)&&j.searchParams.set("cacheSeconds",String(A)),N&&rr(N)&&j.searchParams.set("staleCacheSeconds",String(N)),O){const M=Yt({sort:O});for(const X in M)j.searchParams.set(X,JSON.stringify(M[X]))}const g={...ia(),...fr(e.options||{})},F=Yt(g);for(const M in F)j.searchParams.set(M,String(F[M]));if(n&&j.searchParams.set("userAttributes",JSON.stringify(n)),r){const M=Lr({query:r});for(const X in M)j.searchParams.set(X,JSON.stringify(M[X]))}return j},aa=e=>"results"in e;async function hn(e){const t=await Wr({...e,limit:1});return t&&t[0]||null}const sa=async e=>{const t=pn(e);return await(await(e.fetch??Dr)(t.href,e.fetchOptions)).json()},_r=async(e,t,n=pn(e))=>{const r=pt(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=ea(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||me==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await Ii({item:s,canTrack:r}));t.results=i}catch(i){J.error("Could not process A/B tests. ",i)}return t.results};async function Wr(e){try{const t=pn(e),n=await sa(e);return aa(n)?_r(e,n):(J.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return J.error("Error fetching data. ",t),null}}function la(e){const t=e||(K()?window.location.search:void 0);return t?dr(t).indexOf("builder.preview=")!==-1:!1}function ca(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function $r(){return ca().replace(/-/g,"")}const Hr="builderSessionId",ua=async({canTrack:e})=>{if(!e)return;const t=await Ar({name:Hr,canTrack:e});if(ie(t))return t;{const n=fa();return da({id:n,canTrack:e}),n}},fa=()=>$r(),da=({id:e,canTrack:t})=>Or({name:Hr,value:e,canTrack:t}),Kr=()=>K()&&typeof localStorage<"u"?localStorage:void 0,pa=({key:e,canTrack:t})=>{var n;try{return t?(n=Kr())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},ha=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Kr())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Gr="builderVisitorId",ma=({canTrack:e})=>{if(!e)return;const t=pa({key:Gr,canTrack:e});if(ie(t))return t;{const n=ga();return ya({id:n,canTrack:e}),n}},ga=()=>$r(),ya=({id:e,canTrack:t})=>ha({key:Gr,value:e,canTrack:t}),va=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await ua({canTrack:e}),n=ma({canTrack:e});return{sessionId:t,visitorId:n}},ba=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await va({canTrack:t}),userAttributes:pr(),ownerId:n}});async function Xr(e){if(!e.apiKey){J.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!zt()&&(K()||me==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await ba(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const xa=e=>Xr({...e,canTrack:!0});function or(e){return Math.round(e*1e3)/1e3}const Sa=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},wa=e=>Sa(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),ir=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=or(r/n.width),s=or(o/n.height);return{x:i,y:s}},ka=e=>{const t=e.target,n=t&&wa(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?ir({event:e,target:t}):void 0,builderTargetOffset:n?ir({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},Ca=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Jr(e,t){const n=new URL(t.origin),r=n.hostname;return(e||Ca).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const Ea="0.14.26",ar={};function Yr(e,t){let n=ar[e];if(n||(n=ar[e]=[]),n.push(t),K()){const r={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(r,"*"),parent!==window&&window.postMessage(r,"*")}catch(o){console.debug("Could not postmessage",o)}}}const Ia=()=>{Yr("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let sr=!1;const zr=(e={})=>{var t,n;sr||(sr=!0,K()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:me,version:Ea,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",r=>{var i,s;if(!Jr(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const u=o.data.text,p=o.data.arguments||[],x=o.data.id,k=new Function(u);let m,A=null;try{m=k.apply(null,p)}catch(N){A=N}A?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:x,error:A.message}},"*"):m&&typeof m.then=="function"?m.then(N=>{var O;(O=window.parent)==null||O.postMessage({type:"builder.evaluateResult",data:{id:x,result:N}},"*")}).catch(console.error):(s=window.parent)==null||s.postMessage({type:"builder.evaluateResult",data:{result:m,id:x}},"*");break}}})))},qr=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!Jr(t,r))return;const{data:o}=r;if(o)switch(o.type){case"builder.configureSdk":{n.configureSdk(o.data);break}case"builder.triggerAnimation":{n.animation(o.data);break}case"builder.contentUpdate":{const i=o.data,s=i.key||i.alias||i.entry||i.modelName,u=i.data;s===e&&n.contentUpdate(u);break}}},ja=(e,t,n)=>{if(!K)return J.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};zr();const r=qr({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}};function lr(e,...t){const n=Object(e);for(let r=1;r<arguments.length;r++){const o=arguments[r];if(o!=null)for(const i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])}return n}function Ta(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function Aa(e,t){const n=Oa(e),r=getComputedStyle(t),o=e.steps[0].styles,i=e.steps[e.steps.length-1].styles,s=[o,i];for(const u of s)for(const p of n)p in u||(u[p]=r[p])}function Oa(e){const t=[];for(const n of e.steps)for(const r in n.styles)t.indexOf(r)===-1&&t.push(r);return t}function Ra(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Ta(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{Aa(e,n),n.style.transition="none",n.style.transitionDelay="0",lr(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${un(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),lr(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Pa=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],r=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let o="";if(r&&t&&n&&(o+=`
|
|
155
155
|
@font-face {
|
|
156
156
|
font-family: "${t}";
|
|
157
157
|
src: local("${n}"), url('${r}') format('woff2');
|
|
@@ -186,4 +186,4 @@ font-weight: ${s};
|
|
|
186
186
|
${Ba({cssCode:e.cssCode,contentId:e.contentId})}
|
|
187
187
|
${Na({customFonts:e.customFonts})}
|
|
188
188
|
${Ua(e.isNestedRender)}
|
|
189
|
-
`.trim();return y.jsx(vt,{id:"builderio-content",styles:t})}const Da=({content:e,data:t,locale:n})=>{var i,s,u;const r={},o=((i=e==null?void 0:e.data)==null?void 0:i.state)||{};return(u=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||u.forEach(p=>{p.name&&p.defaultValue!==void 0&&(r[p.name]=p.defaultValue)}),{...r,...o,...t,...n?{locale:n}:{}}},La=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function cr(e){var o,i,s,u,p,x,k,m,A;const t=Zi({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...tr(),...e.customComponents||[]].reduce((N,{component:O,...R})=>({...N,[R.name]:{component:O,...Xt(R)}}),{}),r={content:La({content:e.content,data:e.data}),localState:void 0,rootState:Da({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...tr(),...e.customComponents||[]].reduce((N,{component:O,...R})=>({...N,[R.name]:Xt(R)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return y.jsxs(ee.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?y.jsx(Jt,{id:"builderio-variant-visibility",scriptStr:t}):null,y.jsx(Va,{isNestedRender:e.isNestedRender,contentId:(s=r.content)==null?void 0:s.id,cssCode:(p=(u=r.content)==null?void 0:u.data)==null?void 0:p.cssCode,customFonts:(k=(x=r.content)==null?void 0:x.data)==null?void 0:k.customFonts}),y.jsx(xt,{blocks:(A=(m=r.content)==null?void 0:m.data)==null?void 0:A.blocks,context:r,registeredComponents:n,linkComponent:e.linkComponent})]})}function Zr(e){var i;const t=Ji({canTrack:pt(e.canTrack),content:e.content}),n=function(){var u;return qi(ft(e.content).map(p=>({id:p.testVariationId,testRatio:p.testRatio})),((u=e.content)==null?void 0:u.id)||"")},r=function(){return ft(e.content).map(u=>`.variant-${u.testVariationId} { display: none; } `).join("")},o=function(){var u;return t?{...e.content,testVariationId:(u=e.content)==null?void 0:u.id}:Ei({item:e.content,canTrack:pt(e.canTrack)})};return y.jsxs(y.Fragment,{children:[!e.isNestedRender&&me!=="reactNative"?y.jsx(Jt,{id:"builderio-init-variants-fns",scriptStr:zi()}):null,t?y.jsxs(y.Fragment,{children:[y.jsx(vt,{id:"builderio-variants",styles:r()}),y.jsx(Jt,{id:"builderio-variants-visibility",scriptStr:n()}),(i=ft(e.content))==null?void 0:i.map(s=>y.jsx(cr,{isNestedRender:e.isNestedRender,content:s,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},s.testVariationId))]}):null,y.jsx(cr,{isNestedRender:e.isNestedRender,content:o(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const _a=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return hn({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{J.error("Could not fetch symbol content: ",n)})};async function Qr(e){var i,s,u,p,x;const t=function(){return"div"},n=function(){return"div"},r=function(){var m,A;return[e.attributes[ht()],"builder-symbol",(m=e.symbol)!=null&&m.inline?"builder-inline-symbol":void 0,(A=e.symbol)!=null&&A.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},o=((i=e.symbol)==null?void 0:i.content)||await _a({symbol:e.symbol,builderContextValue:e.builderContext});return y.jsx("div",{...e.attributes,className:r(),children:y.jsx(Zr,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(s=e.builderBlock)==null?void 0:s.id},customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(p=o==null?void 0:o.data)==null?void 0:p.state},model:(x=e.symbol)==null?void 0:x.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const ur={};function Wa(e){if(K()){Object.assign(ur,e);const t={type:"builder.settingsChange",data:ur};parent.postMessage(t,"*")}}const $a=async e=>{var r,o,i;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:dn(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await hn(n)}};exports.Blocks=xt;exports.Columns=jr;exports.ContentVariants=Zr;exports.Symbol=Qr;exports.Text=Br;exports._processContentResult=_r;exports._track=Xr;exports.createEditorListener=qr;exports.createRegisterComponentMessage=$i;exports.evaluate=yt;exports.fastClone=Ze;exports.fetch=Dr;exports.fetchBuilderProps=$a;exports.fetchEntries=Wr;exports.fetchOneEntry=hn;exports.getBlockActions=si;exports.getBlockProperties=Ir;exports.getBuilderSearchParams=dn;exports.getClassPropName=ht;exports.getDefaultCanTrack=pt;exports.getInteractionPropertiesForEvent=ka;exports.getSrcSet=mi;exports.getWrapperClassName=Ma;exports.init=Vr;exports.isBrowser=K;exports.isEditing=zt;exports.isEmptyElement=bo;exports.isJsScript=Di;exports.isPreviewing=la;exports.logger=J;exports.register=Yr;exports.registerInsertMenu=Ia;exports.setEditorSettings=Wa;exports.setupBrowserForEditing=zr;exports.subscribeToEditor=ja;exports.track=xa;exports.triggerAnimation=Ra;
|
|
189
|
+
`.trim();return y.jsx(vt,{id:"builderio-content",styles:t})}const Da=({content:e,data:t,locale:n})=>{var i,s,u;const r={},o=((i=e==null?void 0:e.data)==null?void 0:i.state)||{};return(u=(s=e==null?void 0:e.data)==null?void 0:s.inputs)==null||u.forEach(p=>{p.name&&p.defaultValue!==void 0&&(r[p.name]=p.defaultValue)}),{...r,...o,...t,...n?{locale:n}:{}}},La=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function cr(e){var o,i,s,u,p,x,k,m,A;const t=Zi({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...tr(),...e.customComponents||[]].reduce((N,{component:O,...R})=>({...N,[R.name]:{component:O,...Xt(R)}}),{}),r={content:La({content:e.content,data:e.data}),localState:void 0,rootState:Da({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...tr(),...e.customComponents||[]].reduce((N,{component:O,...R})=>({...N,[R.name]:Xt(R)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return y.jsxs(ee.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:r,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?y.jsx(Jt,{id:"builderio-variant-visibility",scriptStr:t}):null,y.jsx(Va,{isNestedRender:e.isNestedRender,contentId:(s=r.content)==null?void 0:s.id,cssCode:(p=(u=r.content)==null?void 0:u.data)==null?void 0:p.cssCode,customFonts:(k=(x=r.content)==null?void 0:x.data)==null?void 0:k.customFonts}),y.jsx(xt,{blocks:(A=(m=r.content)==null?void 0:m.data)==null?void 0:A.blocks,context:r,registeredComponents:n,linkComponent:e.linkComponent})]})}function Zr(e){var i;const t=Ji({canTrack:pt(e.canTrack),content:e.content}),n=function(){var u;return qi(ft(e.content).map(p=>({id:p.testVariationId,testRatio:p.testRatio})),((u=e.content)==null?void 0:u.id)||"")},r=function(){return ft(e.content).map(u=>`.variant-${u.testVariationId} { display: none; } `).join("")},o=function(){var u;return t?{...e.content,testVariationId:(u=e.content)==null?void 0:u.id}:Ei({item:e.content,canTrack:pt(e.canTrack)})};return y.jsxs(y.Fragment,{children:[!e.isNestedRender&&me!=="reactNative"?y.jsx(Jt,{id:"builderio-init-variants-fns",scriptStr:zi()}):null,t?y.jsxs(y.Fragment,{children:[y.jsx(vt,{id:"builderio-variants",styles:r()}),y.jsx(Jt,{id:"builderio-variants-visibility",scriptStr:n()}),(i=ft(e.content))==null?void 0:i.map(s=>y.jsx(cr,{isNestedRender:e.isNestedRender,content:s,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},s.testVariationId))]}):null,y.jsx(cr,{isNestedRender:e.isNestedRender,content:o(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const _a=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return hn({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{J.error("Could not fetch symbol content: ",n)})};async function Qr(e){var i,s,u,p,x;const t=function(){return"div"},n=function(){return"div"},r=function(){var m,A;return[e.attributes[ht()],"builder-symbol",(m=e.symbol)!=null&&m.inline?"builder-inline-symbol":void 0,(A=e.symbol)!=null&&A.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},o=((i=e.symbol)==null?void 0:i.content)||await _a({symbol:e.symbol,builderContextValue:e.builderContext});return y.jsx("div",{...e.attributes,className:r(),children:y.jsx(Zr,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(s=e.builderBlock)==null?void 0:s.id},customComponents:Object.values(e.builderComponents),data:{...(u=e.symbol)==null?void 0:u.data,...e.builderContext.localState,...(p=o==null?void 0:o.data)==null?void 0:p.state},canTrack:e.builderContext.canTrack,model:(x=e.symbol)==null?void 0:x.model,content:o,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const ur={};function Wa(e){if(K()){Object.assign(ur,e);const t={type:"builder.settingsChange",data:ur};parent.postMessage(t,"*")}}const $a=async e=>{var r,o,i;const t=e.path||((r=e.url)==null?void 0:r.pathname)||((o=e.userAttributes)==null?void 0:o.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:dn(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await hn(n)}};exports.Blocks=xt;exports.Columns=jr;exports.ContentVariants=Zr;exports.Symbol=Qr;exports.Text=Br;exports._processContentResult=_r;exports._track=Xr;exports.createEditorListener=qr;exports.createRegisterComponentMessage=$i;exports.evaluate=yt;exports.fastClone=Ze;exports.fetch=Dr;exports.fetchBuilderProps=$a;exports.fetchEntries=Wr;exports.fetchOneEntry=hn;exports.getBlockActions=si;exports.getBlockProperties=Ir;exports.getBuilderSearchParams=dn;exports.getClassPropName=ht;exports.getDefaultCanTrack=pt;exports.getInteractionPropertiesForEvent=ka;exports.getSrcSet=mi;exports.getWrapperClassName=Ma;exports.init=Vr;exports.isBrowser=K;exports.isEditing=zt;exports.isEmptyElement=bo;exports.isJsScript=Di;exports.isPreviewing=la;exports.logger=J;exports.register=Yr;exports.registerInsertMenu=Ia;exports.setEditorSettings=Wa;exports.setupBrowserForEditing=zr;exports.subscribeToEditor=ja;exports.track=xa;exports.triggerAnimation=Ra;
|
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-7517cd42.cjs"),e=require("./bundle-ba82c7f5.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-06472a9d.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-6a4fcac3.js";
|
|
2
|
+
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-66b04b60.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-3c38a1b1.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a, Fragment as w, jsxs as I } from "react/jsx-runtime";
|
|
3
|
-
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-
|
|
3
|
+
import { i as Z, g as H, a as $, b as O, c as E, d as R, e as p, f as _, h as V, _ as D, j as ee, l as te, k as ne, m as ie, t as ae, n as U, o as ce, p as re, q as le, r as oe, s as de, u as se, v as ue } from "./bundle-1b7db75b.js";
|
|
4
4
|
import { useRef as T, useState as C, useEffect as f, createContext as me } from "react";
|
|
5
|
-
import { p as ge } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as ge } from "./USE_SERVER_BUNDLE-aa3e89ff.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ a(w, { children: Z(e.TagName) ? /* @__PURE__ */ a(w, { children: /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ a(w, { children: typeof e.TagName == "string" ? /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) : /* @__PURE__ */ a(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),n=require("./bundle-e09f3bd9.cjs"),l=require("react"),D=require("./USE_SERVER_BUNDLE-e36813e6.cjs"),H=require("next/navigation");function j(e){return t.jsx(t.Fragment,{children:n.isEmptyElement(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}function V(e){function c(){return{...e.attributes,[n.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[n.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}}}return t.jsx(j,{attributes:c(),TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function U(e){return t.jsx(j,{TagName:e.Wrapper,attributes:n.getBlockProperties({block:e.block,context:e.context}),actionAttributes:n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context,stripPrefix:!0}),children:e.children})}function O(e){function c(){return e.includeBlockProps?{...n.getBlockProperties({block:e.block,context:e.context}),...n.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{}}return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:c(),children:e.children})}function $(e){function c(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function S(){var o,b;n.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((b=window.parent)==null||b.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:c()+" props-blocks-wrapper-7cd1560e","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>S(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7cd1560e {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use server";"use strict";const n=require("./bundle-
|
|
1
|
+
"use server";"use strict";const n=require("./bundle-e09f3bd9.cjs");async function s({key:e,value:t}){return n.init(),globalThis._BUILDER_PREVIEW_LRU_CACHE.set(e,t),{[e]:t}}exports.postPreviewContent=s;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { LRUCache } from "lru-cache";
|
|
4
|
-
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-
|
|
4
|
+
import { I as InteractiveElement, B as BlockWrapper, a as BlocksWrapper, D as DynamicRenderer, C as CustomCode, E as Embed, b as ImgComponent, V as Video, c as Button, F as FragmentComponent, d as Image, S as SectionComponent, e as EnableEditor } from "./USE_CLIENT_BUNDLE-07e24176.js";
|
|
5
5
|
import "next/navigation";
|
|
6
6
|
const EMPTY_HTML_ELEMENTS = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), isEmptyElement = (e) => typeof e == "string" && EMPTY_HTML_ELEMENTS.has(e.toLowerCase()), TARGET = "rsc", getClassPropName = () => {
|
|
7
7
|
switch (TARGET) {
|
|
@@ -2328,7 +2328,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2328
2328
|
const n = new URL(t.origin), o = n.hostname;
|
|
2329
2329
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2330
2330
|
}
|
|
2331
|
-
const SDK_VERSION = "0.14.
|
|
2331
|
+
const SDK_VERSION = "0.14.26", registry = {};
|
|
2332
2332
|
function register(e, t) {
|
|
2333
2333
|
let n = registry[e];
|
|
2334
2334
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2642,6 +2642,7 @@ function ContentComponent(e) {
|
|
|
2642
2642
|
}),
|
|
2643
2643
|
rootSetState: void 0,
|
|
2644
2644
|
context: e.context || {},
|
|
2645
|
+
canTrack: e.canTrack,
|
|
2645
2646
|
apiKey: e.apiKey,
|
|
2646
2647
|
apiVersion: e.apiVersion,
|
|
2647
2648
|
componentInfos: [
|
|
@@ -2859,6 +2860,7 @@ async function Symbol$1(e) {
|
|
|
2859
2860
|
...e.builderContext.localState,
|
|
2860
2861
|
...(c = r == null ? void 0 : r.data) == null ? void 0 : c.state
|
|
2861
2862
|
},
|
|
2863
|
+
canTrack: e.builderContext.canTrack,
|
|
2862
2864
|
model: (d = e.symbol) == null ? void 0 : d.model,
|
|
2863
2865
|
content: r,
|
|
2864
2866
|
linkComponent: e.builderLinkComponent,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const lruCache=require("lru-cache"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const lruCache=require("lru-cache"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-9966f569.cjs");require("next/navigation");const EMPTY_HTML_ELEMENTS=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),isEmptyElement=e=>typeof e=="string"&&EMPTY_HTML_ELEMENTS.has(e.toLowerCase()),TARGET="rsc",getClassPropName=()=>{switch(TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":case"angular":return"class"}};function getBlockComponentOptions(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const MSG_PREFIX="[Builder.io]: ",logger={log:(...e)=>console.log(MSG_PREFIX,...e),error:(...e)=>console.error(MSG_PREFIX,...e),warn:(...e)=>console.warn(MSG_PREFIX,...e),debug:(...e)=>console.debug(MSG_PREFIX,...e)};function isBrowser(){return typeof window<"u"&&typeof document<"u"}const convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):e,getSearchString=e=>typeof e=="string"?e:e instanceof URLSearchParams?e.toString():new URLSearchParams(e).toString();function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(e){return isIframe()&&getSearchString(e||window.location.search).indexOf("builder.frameEditing=")!==-1}const getLocation=()=>{if(isBrowser()){const e=new URL(location.href);return e.pathname===""&&(e.pathname="/"),e}else return console.warn("Cannot get location for tracking in non-browser environment"),null},getUserAgent=()=>typeof navigator=="object"&&navigator.userAgent||"",getUserAttributes=()=>{const e=getUserAgent(),t={Android(){return e.match(/Android/i)},BlackBerry(){return e.match(/BlackBerry/i)},iOS(){return e.match(/iPhone|iPod/i)},Opera(){return e.match(/Opera Mini/i)},Windows(){return e.match(/IEMobile/i)||e.match(/WPDesktop/i)},any(){return t.Android()||t.BlackBerry()||t.iOS()||t.Opera()||t.Windows()||TARGET==="reactNative"}},n=e.match(/Tablet|iPad/i),o=getLocation();return{urlPath:o==null?void 0:o.pathname,host:(o==null?void 0:o.host)||(o==null?void 0:o.hostname),device:n?"tablet":t.any()?"mobile":"desktop"}},getFunctionArguments=({builder:e,context:t,event:n,state:o})=>Object.entries({state:o,Builder:e,builder:e,context:t,event:n}),getBuilderGlobals=()=>({isEditing:isEditing(),isBrowser:isBrowser(),isServer:!isBrowser(),getUserAttributes:()=>getUserAttributes()}),parseCode=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,runInBrowser=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const s=getFunctionArguments({builder:t,context:n,event:o,state:flattenState({rootState:a,localState:r,rootSetState:i})});return new Function(...s.map(([c])=>c),e)(...s.map(([,c])=>c))};function flattenState({rootState:e,localState:t,rootSetState:n}){return new Proxy(e,{get:(o,r)=>{if(t&&r in t)return t[r];const i=o[r];return typeof i=="object"&&i!==null?flattenState({rootState:i,localState:void 0,rootSetState:n?a=>{o[r]=a,n(o)}:void 0}):i},set:(o,r,i)=>{if(t&&r in t)throw new Error("Writing to local state is not allowed as it is read-only.");return o[r]=i,n==null||n(o),!0}})}const fastClone=e=>JSON.parse(JSON.stringify(e)),set=(e,t,n)=>{if(Object(e)!==e)return e;const o=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return o.slice(0,-1).reduce((r,i,a)=>Object(r[i])===r[i]?r[i]:r[i]=Math.abs(Number(o[a+1]))>>0===+o[a+1]?[]:{},e)[o[o.length-1]]=n,e},noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const getSyncValName=e=>`bldr_${e}_sync`,BUILDER_SET_STATE_NAME="BUILDER_SET_STATE",INJECTED_IVM_GLOBAL="BUILDER_IVM",REF_TO_PROXY_FN=`
|
|
2
2
|
var refToProxy = (obj) => {
|
|
3
3
|
if (typeof obj !== 'object' || obj === null) {
|
|
4
4
|
return obj;
|
|
@@ -45,14 +45,14 @@ if (typeof output === 'object' && output !== null) {
|
|
|
45
45
|
a server-only execution path within your application.
|
|
46
46
|
|
|
47
47
|
Please see the documentation for more information: https://builder.io/c/docs/integration-tips#enabling-data-bindings-in-node-environments
|
|
48
|
-
`)};function setIsolateContext(e={memoryLimit:128}){const t=getIvm(),o=new t.Isolate(e).createContextSync(),r=o.global;return r.setSync("global",r.derefInto()),r.setSync("log",function(...i){console.log(...i)}),r.setSync(INJECTED_IVM_GLOBAL,t),IVM_CONTEXT=o,o}const getIsolateContext=()=>IVM_CONTEXT||setIsolateContext(),runInNode=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const s=getIvm(),c=fastClone({...a,...r}),u=getFunctionArguments({builder:t,context:n,event:o,state:c}),f=getIsolateContext(),l=f.global;l.setSync(BUILDER_SET_STATE_NAME,function(y,p){set(a,y,p),i==null||i(a)}),u.forEach(([y,p])=>{const C=typeof p=="object"?new s.Reference(y==="builder"?{...p,getUserAttributes:()=>p.getUserAttributes()}:p):null;l.setSync(getSyncValName(y),C)});const d=processCode({code:e,args:u}),g=f.evalClosureSync(d);try{return JSON.parse(g)}catch{return g}},checkIsDefined=e=>e!=null;function isNodeRuntime(){var e;return typeof process<"u"&&checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const shouldForceBrowserRuntimeInNode=()=>{var o;if(!isNodeRuntime())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},chooseBrowserOrServerEval=e=>isBrowser()||shouldForceBrowserRuntimeInNode()?runInBrowser(e):runInNode(e),_EvalCache=class
|
|
48
|
+
`)};function setIsolateContext(e={memoryLimit:128}){const t=getIvm(),o=new t.Isolate(e).createContextSync(),r=o.global;return r.setSync("global",r.derefInto()),r.setSync("log",function(...i){console.log(...i)}),r.setSync(INJECTED_IVM_GLOBAL,t),IVM_CONTEXT=o,o}const getIsolateContext=()=>IVM_CONTEXT||setIsolateContext(),runInNode=({code:e,builder:t,context:n,event:o,localState:r,rootSetState:i,rootState:a})=>{const s=getIvm(),c=fastClone({...a,...r}),u=getFunctionArguments({builder:t,context:n,event:o,state:c}),f=getIsolateContext(),l=f.global;l.setSync(BUILDER_SET_STATE_NAME,function(y,p){set(a,y,p),i==null||i(a)}),u.forEach(([y,p])=>{const C=typeof p=="object"?new s.Reference(y==="builder"?{...p,getUserAttributes:()=>p.getUserAttributes()}:p):null;l.setSync(getSyncValName(y),C)});const d=processCode({code:e,args:u}),g=f.evalClosureSync(d);try{return JSON.parse(g)}catch{return g}},checkIsDefined=e=>e!=null;function isNodeRuntime(){var e;return typeof process<"u"&&checkIsDefined((e=process==null?void 0:process.versions)==null?void 0:e.node)}const shouldForceBrowserRuntimeInNode=()=>{var o;if(!isNodeRuntime())return!1;const e=process.arch==="arm64",t=process.version.startsWith("v20"),n=(o=process.env.NODE_OPTIONS)==null?void 0:o.includes("--no-node-snapshot");return e&&t&&!n?(logger.log("Skipping usage of `isolated-vm` to avoid crashes in Node v20 on an arm64 machine.\n If you would like to use the `isolated-vm` package on this machine, please provide the `NODE_OPTIONS=--no-node-snapshot` config to your Node process.\n See https://github.com/BuilderIO/builder/blob/main/packages/sdks/README.md#node-v20--m1-macs-apple-silicon-support for more information.\n "),!0):!1},chooseBrowserOrServerEval=e=>isBrowser()||shouldForceBrowserRuntimeInNode()?runInBrowser(e):runInNode(e),_EvalCache=class k{static getCacheKey(t){return JSON.stringify({...t,event:t.event?Math.random():void 0})}static getCachedValue(t){return k.cache.get(t)}static setCachedValue(t,n){k.cache.size>20&&k.cache.delete(k.cache.keys().next().value),k.cache.set(t,{value:n})}};_EvalCache.cacheLimit=20;_EvalCache.cache=new Map;let EvalCache=_EvalCache;function evaluate({code:e,context:t,localState:n,rootState:o,rootSetState:r,event:i,isExpression:a=!0,enableCache:s}){if(e==="")return;const c={code:parseCode(e,{isExpression:a}),builder:getBuilderGlobals(),context:t,event:i,rootSetState:r,rootState:o,localState:n};if(s){const u=EvalCache.getCacheKey(c),f=EvalCache.getCachedValue(u);if(f)return f.value}try{const u=chooseBrowserOrServerEval(c);if(s){const f=EvalCache.getCacheKey(c);EvalCache.setCachedValue(f,u)}return u}catch(u){logger.error("Failed code evaluation: "+u.message,{code:e});return}}function transformBlock(e){return e}const evaluateBindings=({block:e,context:t,localState:n,rootState:o,rootSetState:r})=>{if(!e.bindings)return e;const i=fastClone(e),a={...i,properties:{...i.properties},actions:{...i.actions}};for(const s in e.bindings){const c=e.bindings[s],u=evaluate({code:c,localState:n,rootState:o,rootSetState:r,context:t,enableCache:!0});set(a,s,u)}return a};function getProcessedBlock({block:e,context:t,shouldEvaluateBindings:n,localState:o,rootState:r,rootSetState:i}){const a=e;return n?evaluateBindings({block:a,localState:o,rootState:r,rootSetState:i,context:t}):a}const camelToKebabCase=e=>e?e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase():"",convertStyleMapToCSSArray=e=>Object.entries(e).map(([n,o])=>{if(typeof o=="string")return`${camelToKebabCase(n)}: ${o};`}).filter(checkIsDefined),convertStyleMapToCSS=e=>convertStyleMapToCSSArray(e).join(`
|
|
49
49
|
`),createCssClass=({mediaQuery:e,className:t,styles:n})=>{const o=`.${t} {
|
|
50
50
|
${convertStyleMapToCSS(n)}
|
|
51
51
|
}`;return e?`${e} {
|
|
52
52
|
${o}
|
|
53
53
|
}`:o};function transformStyleProperty({style:e}){return e}const getStyle=({block:e,context:t})=>mapStyleObjToStrIfNeeded(transformStyleProperty({style:e.style||{},context:t,block:e}));function mapStyleObjToStrIfNeeded(e){switch(TARGET){case"svelte":case"vue":case"solid":case"angular":return convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}const getComponent=({block:e,context:t,registeredComponents:n})=>{var i;const o=(i=getProcessedBlock({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:i.name;if(!o)return null;const r=n[o];if(r)return r;console.warn(`
|
|
54
54
|
Could not find a registered component named "${o}".
|
|
55
|
-
If you registered it, is the file that registered it imported by the file that needs to render it?`)},getRepeatItemData=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const r=evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(r))return;const i=n.collection.split(".").pop(),a=n.itemName||(i?i+"Item":"item");return r.map((c,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:c,[a]:c,[`$${a}Index`]:u}},block:o}))},shouldPassLinkComponent=e=>e&&(e.isRSC||["Core:Button","Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name)),shouldPassRegisteredComponents=e=>e&&(e.isRSC||["Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name)),SIZES={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},getMaxWidthQueryForSize=(e,t=SIZES)=>`@media (max-width: ${t[e].max}px)`,getSizesForBreakpoints=({small:e,medium:t})=>{const n=fastClone(SIZES);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const r=n.small.max+1;n.medium={max:t,min:r,default:r+1};const i=n.medium.max+1;return n.large={max:2e3,min:i,default:i+1},n};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function BlockStyles(e){const t=function(){const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(r.hide)?!r.hide:checkIsDefined(r.show)?r.show:!0},n=function(){var m,h,b;const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=r.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||{}),c=i==null?void 0:i.large,u=i==null?void 0:i.medium,f=i==null?void 0:i.small,l=r.id;if(!l)return"";const d=c?createCssClass({className:l,styles:c}):"",g=u?createCssClass({className:l,styles:u,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",y=f?createCssClass({className:l,styles:f,mediaQuery:getMaxWidthQueryForSize("small",s)}):"",p=r.animations&&r.animations.find(S=>S.trigger==="hover");let C="";if(p){const S=((b=(h=p.steps)==null?void 0:h[1])==null?void 0:b.styles)||{};C=createCssClass({className:`${l}:hover`,styles:{...S,transition:`all ${p.duration}s ${camelToKebabCase(p.easing)}`,transitionDelay:p.delay?`${p.delay}s`:"0s"}})||""}return[d,g,y,C].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{id:"builderio-block",styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let i=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"vue":i=i.replace("v-on:","");break;case"svelte":i=i.replace("on:","");break}t[i]=createEventHandler(r,e)}return t}function transformBlockProperties({properties:e}){return e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var o;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:getStyle({block:e,context:t}),[getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return transformBlockProperties({properties:n,context:t,block:e})}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:r,isInteractive:i,contextValue:a})=>{const s={...e,...r?{attributes:getBlockProperties({block:t,context:a})}:{}};return i?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:r}:s};function ComponentRef(e){var n;const t=e.isInteractive?USE_CLIENT_BUNDLE.InteractiveElement:e.componentRef;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(t,{...getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>jsxRuntime.jsx(Block,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function RepeatedBlock(e){const t=e.repeatContext;return jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function Block(e){var c,u,f;const t=function(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return getRepeatItemData({block:e.block,context:e.context})},o=function(){var d;return(d=e.block.repeat)!=null&&d.collection?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},r=function(){var g;return e.block.tagName==="a"||((g=o().properties)==null?void 0:g.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},i=function(){var y,p;if((y=e.block.repeat)!=null&&y.collection)return!!((p=n())!=null&&p.length);const d="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!d},a=function(){var g;return!((g=t())!=null&&g.component)&&!n()?o().children??[]:[]},s=function(){var d,g,y;return{blockChildren:o().children??[],componentRef:(d=t())==null?void 0:d.component,componentOptions:{...getBlockComponentOptions(o()),builderContext:e.context,...shouldPassLinkComponent(t())?{builderLinkComponent:e.linkComponent}:{},...shouldPassRegisteredComponents(t())?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((g=t())==null?void 0:g.noWrap)===!0,isInteractive:!((y=t())!=null&&y.isRSC)}};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:i()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(BlockStyles,{block:e.block,context:e.context}),(c=t())!=null&&c.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(f=n())==null?void 0:f.map((l,d)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:l.context,block:l.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d))}):jsxRuntime.jsxs(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:r(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(u=a())==null?void 0:u.map(l=>jsxRuntime.jsx(Block,{block:l,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},l.id))]})})]}):null})}function Blocks(e){var t,n,o;return jsxRuntime.jsx(USE_CLIENT_BUNDLE.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(o=e.blocks)==null?void 0:o.map(r=>jsxRuntime.jsx(Block,{block:r,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},r.id))}):null})}const getColumnsClass=e=>`builder-columns ${e}-breakpoints`;function Columns(e){var p,C;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",r=function(h){return h.link?e.builderLinkComponent||"a":"div"},i=function(h){var b;return((b=n[h])==null?void 0:b.width)||100/n.length},a=function(h){const b=t*(n.length-1)/n.length;return`calc(${i(h)}% - ${b}px)`},s=function({stackedStyle:h,desktopStyle:b}){return o==="tablet"?h:b},c=function({stackedStyle:h,desktopStyle:b}){return o==="never"?b:h},u=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",f=function(){return{"--flex-dir":u,"--flex-dir-tablet":s({stackedStyle:u,desktopStyle:"row"})}},l=function(h){const b=h===0?0:t,S=a(h),x=`${b}px`,
|
|
55
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},getRepeatItemData=({block:e,context:t})=>{const{repeat:n,...o}=e;if(!(n!=null&&n.collection))return;const r=evaluate({code:n.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,enableCache:!0});if(!Array.isArray(r))return;const i=n.collection.split(".").pop(),a=n.itemName||(i?i+"Item":"item");return r.map((c,u)=>({context:{...t,localState:{...t.localState,$index:u,$item:c,[a]:c,[`$${a}Index`]:u}},block:o}))},shouldPassLinkComponent=e=>e&&(e.isRSC||["Core:Button","Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name)),shouldPassRegisteredComponents=e=>e&&(e.isRSC||["Symbol","Columns","Form:Form","Builder: Tabs","Builder:Accordion"].includes(e.name)),SIZES={small:{min:320,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},getMaxWidthQueryForSize=(e,t=SIZES)=>`@media (max-width: ${t[e].max}px)`,getSizesForBreakpoints=({small:e,medium:t})=>{const n=fastClone(SIZES);if(!e||!t)return n;const o=Math.floor(e/2);n.small={max:e,min:o,default:o+1};const r=n.small.max+1;n.medium={max:t,min:r,default:r+1};const i=n.medium.max+1;return n.large={max:2e3,min:i,default:i+1},n};function InlinedStyles(e){return jsxRuntime.jsx("style",{dangerouslySetInnerHTML:{__html:e.styles},"data-id":e.id})}function BlockStyles(e){const t=function(){const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0});return checkIsDefined(r.hide)?!r.hide:checkIsDefined(r.show)?r.show:!0},n=function(){var m,h,b;const r=getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0}),i=r.responsiveStyles,a=e.context.content,s=getSizesForBreakpoints(((m=a==null?void 0:a.meta)==null?void 0:m.breakpoints)||{}),c=i==null?void 0:i.large,u=i==null?void 0:i.medium,f=i==null?void 0:i.small,l=r.id;if(!l)return"";const d=c?createCssClass({className:l,styles:c}):"",g=u?createCssClass({className:l,styles:u,mediaQuery:getMaxWidthQueryForSize("medium",s)}):"",y=f?createCssClass({className:l,styles:f,mediaQuery:getMaxWidthQueryForSize("small",s)}):"",p=r.animations&&r.animations.find(S=>S.trigger==="hover");let C="";if(p){const S=((b=(h=p.steps)==null?void 0:h[1])==null?void 0:b.styles)||{};C=createCssClass({className:`${l}:hover`,styles:{...S,transition:`all ${p.duration}s ${camelToKebabCase(p.easing)}`,transitionDelay:p.delay?`${p.delay}s`:"0s"}})||""}return[d,g,y,C].join(" ")};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()&&t()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedStyles,{id:"builderio-block",styles:n()})}):null})}function capitalizeFirstLetter(e){return e.charAt(0).toUpperCase()+e.slice(1)}const getEventHandlerName=e=>`on${capitalizeFirstLetter(e)}`,createEventHandler=(e,t)=>n=>evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:n,isExpression:!1,enableCache:!0});function getBlockActions(e){const t={},n=e.block.actions??{};for(const o in n){if(!n.hasOwnProperty(o))continue;const r=n[o];let i=getEventHandlerName(o);if(e.stripPrefix)switch(TARGET){case"vue":i=i.replace("v-on:","");break;case"svelte":i=i.replace("on:","");break}t[i]=createEventHandler(r,e)}return t}function transformBlockProperties({properties:e}){return e}const extractRelevantRootBlockProperties=e=>({href:e.href});function getBlockProperties({block:e,context:t}){var o;const n={...extractRelevantRootBlockProperties(e),...e.properties,"builder-id":e.id,style:getStyle({block:e,context:t}),[getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return transformBlockProperties({properties:n,context:t,block:e})}const getWrapperProps=({componentOptions:e,builderBlock:t,context:n,componentRef:o,includeBlockProps:r,isInteractive:i,contextValue:a})=>{const s={...e,...r?{attributes:getBlockProperties({block:t,context:a})}:{}};return i?{Wrapper:o,block:t,context:n,wrapperProps:e,includeBlockProps:r}:s};function ComponentRef(e){var n;const t=e.isInteractive?USE_CLIENT_BUNDLE.InteractiveElement:e.componentRef;return jsxRuntime.jsx(jsxRuntime.Fragment,{children:e.componentRef?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(t,{...getWrapperProps({componentOptions:e.componentOptions,builderBlock:e.builderBlock,context:e.context,componentRef:e.componentRef,linkComponent:e.linkComponent,includeBlockProps:e.includeBlockProps,isInteractive:e.isInteractive,contextValue:e.context}),children:(n=e.blockChildren)==null?void 0:n.map(o=>jsxRuntime.jsx(Block,{block:o,context:e.context,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},o.id))})}):null})}function RepeatedBlock(e){const t=e.repeatContext;return jsxRuntime.jsx(Block,{block:e.block,context:t,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent})}function Block(e){var c,u,f;const t=function(){return getComponent({block:e.block,context:e.context,registeredComponents:e.registeredComponents})},n=function(){return getRepeatItemData({block:e.block,context:e.context})},o=function(){var d;return(d=e.block.repeat)!=null&&d.collection?e.block:getProcessedBlock({block:e.block,localState:e.context.localState,rootState:e.context.rootState,rootSetState:e.context.rootSetState,context:e.context.context,shouldEvaluateBindings:!0})},r=function(){var g;return e.block.tagName==="a"||((g=o().properties)==null?void 0:g.href)||o().href?e.linkComponent||"a":e.block.tagName||"div"},i=function(){var y,p;if((y=e.block.repeat)!=null&&y.collection)return!!((p=n())!=null&&p.length);const d="hide"in o()?o().hide:!1;return("show"in o()?o().show:!0)&&!d},a=function(){var g;return!((g=t())!=null&&g.component)&&!n()?o().children??[]:[]},s=function(){var d,g,y;return{blockChildren:o().children??[],componentRef:(d=t())==null?void 0:d.component,componentOptions:{...getBlockComponentOptions(o()),builderContext:e.context,...shouldPassLinkComponent(t())?{builderLinkComponent:e.linkComponent}:{},...shouldPassRegisteredComponents(t())?{builderComponents:e.registeredComponents}:{}},context:e.context,linkComponent:e.linkComponent,registeredComponents:e.registeredComponents,builderBlock:o(),includeBlockProps:((g=t())==null?void 0:g.noWrap)===!0,isInteractive:!((y=t())!=null&&y.isRSC)}};return jsxRuntime.jsx(jsxRuntime.Fragment,{children:i()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(BlockStyles,{block:e.block,context:e.context}),(c=t())!=null&&c.noWrap?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive})}):jsxRuntime.jsx(jsxRuntime.Fragment,{children:n()?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(f=n())==null?void 0:f.map((l,d)=>jsxRuntime.jsx(RepeatedBlock,{repeatContext:l.context,block:l.block,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent},d))}):jsxRuntime.jsxs(USE_CLIENT_BUNDLE.BlockWrapper,{Wrapper:r(),block:o(),context:e.context,linkComponent:e.linkComponent,children:[jsxRuntime.jsx(ComponentRef,{componentRef:s().componentRef,componentOptions:s().componentOptions,blockChildren:s().blockChildren,context:s().context,registeredComponents:s().registeredComponents,linkComponent:s().linkComponent,builderBlock:s().builderBlock,includeBlockProps:s().includeBlockProps,isInteractive:s().isInteractive}),(u=a())==null?void 0:u.map(l=>jsxRuntime.jsx(Block,{block:l,registeredComponents:e.registeredComponents,linkComponent:e.linkComponent,context:e.context},l.id))]})})]}):null})}function Blocks(e){var t,n,o;return jsxRuntime.jsx(USE_CLIENT_BUNDLE.BlocksWrapper,{blocks:e.blocks,parent:e.parent,path:e.path,styleProp:e.styleProp,BlocksWrapper:(t=e.context)==null?void 0:t.BlocksWrapper,BlocksWrapperProps:(n=e.context)==null?void 0:n.BlocksWrapperProps,children:e.blocks?jsxRuntime.jsx(jsxRuntime.Fragment,{children:(o=e.blocks)==null?void 0:o.map(r=>jsxRuntime.jsx(Block,{block:r,linkComponent:e.linkComponent,context:e.context,registeredComponents:e.registeredComponents},r.id))}):null})}const getColumnsClass=e=>`builder-columns ${e}-breakpoints`;function Columns(e){var p,C;const t=typeof e.space=="number"?e.space||0:20,n=e.columns||[],o=e.stackColumnsAt||"tablet",r=function(h){return h.link?e.builderLinkComponent||"a":"div"},i=function(h){var b;return((b=n[h])==null?void 0:b.width)||100/n.length},a=function(h){const b=t*(n.length-1)/n.length;return`calc(${i(h)}% - ${b}px)`},s=function({stackedStyle:h,desktopStyle:b}){return o==="tablet"?h:b},c=function({stackedStyle:h,desktopStyle:b}){return o==="never"?b:h},u=e.stackColumnsAt==="never"?"row":e.reverseColumnsWhenStacked?"column-reverse":"column",f=function(){return{"--flex-dir":u,"--flex-dir-tablet":s({stackedStyle:u,desktopStyle:"row"})}},l=function(h){const b=h===0?0:t,S=a(h),x=`${b}px`,v="100%",I=0;return{...{display:"flex",flexDirection:"column",alignItems:"stretch"},width:S,["marginLeft"]:x,"--column-width-mobile":c({stackedStyle:v,desktopStyle:S}),"--column-margin-left-mobile":c({stackedStyle:I,desktopStyle:x}),"--column-width-tablet":s({stackedStyle:v,desktopStyle:S}),"--column-margin-left-tablet":s({stackedStyle:I,desktopStyle:x})}},d=function(h){var S,x;return getSizesForBreakpoints(((x=(S=e.builderContext.content)==null?void 0:S.meta)==null?void 0:x.breakpoints)||{})[h].max},g=function(){return`
|
|
56
56
|
@media (max-width: ${d("medium")}px) {
|
|
57
57
|
.${e.builderBlock.id}-breakpoints {
|
|
58
58
|
flex-direction: var(--flex-dir-tablet);
|
|
@@ -178,7 +178,7 @@ if (typeof output === 'object' && output !== null) {
|
|
|
178
178
|
)`,getUpdateVariantVisibilityScript=({contentId:e,variationId:t})=>`window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
179
179
|
"${t}", "${e}", ${isHydrationTarget}
|
|
180
180
|
)`;function InlinedScript(e){return jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},"data-id":e.id})}const getIdFromSearchParams=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||logger.warn("No previewed ID found in search params."),n};function init(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new lruCache.LRUCache({max:500,ttl:1e3*60*5}))}function getPreviewContent(e){init();const t=getIdFromSearchParams(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function getGlobalThis(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function getFetch(){const e=getGlobalThis().fetch;if(typeof e>"u")throw console.warn(`Builder SDK could not find a global fetch function. Make sure you have a polyfill for fetch in your project.
|
|
181
|
-
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...flatten(i,a,n)}:{...o,[a]:i}},{})}function flattenMongoQuery(e,t,n={}){for(const o in e){const r=e[o],i=t?t+"."+o:o;r&&typeof r=="object"&&!Array.isArray(r)&&!Object.keys(r).find(a=>a.startsWith("$"))?flattenMongoQuery(r,i,n):n[i]=r}return n}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const r=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[r]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:r,apiKey:i,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:u,omit:f,offset:l,cacheSeconds:d,staleCacheSeconds:g,sort:y,includeUnpublished:p}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const C=t!==1,m=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(m.searchParams.set("apiKey",i),m.searchParams.set("limit",String(t)),m.searchParams.set("noTraverse",String(C)),m.searchParams.set("includeRefs",String(!0)),s&&m.searchParams.set("locale",s),a&&m.searchParams.set("enrich",String(a)),m.searchParams.set("omit",f||"meta.componentsUsed"),u&&m.searchParams.set("fields",u),Number.isFinite(l)&&l>-1&&m.searchParams.set("offset",String(Math.floor(l))),typeof p=="boolean"&&m.searchParams.set("includeUnpublished",String(p)),d&&isPositiveNumber(d)&&m.searchParams.set("cacheSeconds",String(d)),g&&isPositiveNumber(g)&&m.searchParams.set("staleCacheSeconds",String(g)),y){const S=flatten({sort:y});for(const x in S)m.searchParams.set(x,JSON.stringify(S[x]))}const h={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},b=flatten(h);for(const S in b)m.searchParams.set(S,String(b[S]));if(n&&m.searchParams.set("userAttributes",JSON.stringify(n)),o){const S=flattenMongoQuery({query:o});for(const x in S)m.searchParams.set(x,JSON.stringify(S[x]))}return m},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await(e.fetch??fetch$1)(t.href,e.fetchOptions)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);i.push(s||a)}t.results=i}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const i=[];for(const a of t.results)i.push(await handleABTesting({item:a,canTrack:o}));t.results=i}catch(i){logger.error("Could not process A/B tests. ",i)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){const t=e||(isBrowser()?window.location.search:void 0);return t?getSearchString(t).indexOf("builder.preview=")!==-1:!1}function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=round(o/n.width),a=round(r/n.height);return{x:i,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(r=>r.startsWith("*.")?o.endsWith(r.slice(1)):r===o)>-1}const SDK_VERSION="0.14.25",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const registerInsertMenu=()=>{register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var i,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:r}=o;if(r!=null&&r.type)switch(r.type){case"builder.evaluate":{const s=r.data.text,c=r.data.arguments||[],u=r.data.id,f=new Function(s);let l,d=null;try{l=f.apply(null,c)}catch(g){d=g}d?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:u,error:d.message}},"*"):l&&typeof l.then=="function"?l.then(g=>{var y;(y=window.parent)==null||y.postMessage({type:"builder.evaluateResult",data:{id:u,result:g}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:l,id:u}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:r}=o;if(r)switch(r.type){case"builder.configureSdk":{n.configureSdk(r.data);break}case"builder.triggerAnimation":{n.animation(r.data);break}case"builder.contentUpdate":{const i=r.data,a=i.key||i.alias||i.entry||i.modelName,s=i.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const r=arguments[o];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n}function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),r=e.steps[0].styles,i=e.steps[e.steps.length-1].styles,a=[r,i];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const getCssFromFont=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let r="";if(o&&t&&n&&(r+=`
|
|
181
|
+
For more information, read https://github.com/BuilderIO/this-package-uses-fetch`),new Error("Builder SDK could not find a global `fetch` function");return e}const fetch$1=getFetch();function flatten(e,t=null,n="."){return Object.keys(e).reduce((o,r)=>{const i=e[r],a=[t,r].filter(Boolean).join(n);return[typeof i=="object",i!==null,!(Array.isArray(i)&&i.length===0)].every(Boolean)?{...o,...flatten(i,a,n)}:{...o,[a]:i}},{})}function flattenMongoQuery(e,t,n={}){for(const o in e){const r=e[o],i=t?t+"."+o:o;r&&typeof r=="object"&&!Array.isArray(r)&&!Object.keys(r).find(a=>a.startsWith("$"))?flattenMongoQuery(r,i,n):n[i]=r}return n}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",getBuilderSearchParams=e=>{if(!e)return{};const t=normalizeSearchParams(e),n={};return Object.keys(t).forEach(o=>{if(o.startsWith(BUILDER_SEARCHPARAMS_PREFIX)){const r=o.replace(BUILDER_SEARCHPARAMS_PREFIX,"").replace(BUILDER_OPTIONS_PREFIX,"");n[r]=t[o]}}),n},getBuilderSearchParamsFromWindow=()=>{if(!isBrowser())return{};const e=new URLSearchParams(window.location.search);return getBuilderSearchParams(e)},isPositiveNumber=e=>typeof e=="number"&&!isNaN(e)&&e>=0,generateContentUrl=e=>{const{limit:t=30,userAttributes:n,query:o,model:r,apiKey:i,enrich:a,locale:s,apiVersion:c=DEFAULT_API_VERSION,fields:u,omit:f,offset:l,cacheSeconds:d,staleCacheSeconds:g,sort:y,includeUnpublished:p}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const C=t!==1,m=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(m.searchParams.set("apiKey",i),m.searchParams.set("limit",String(t)),m.searchParams.set("noTraverse",String(C)),m.searchParams.set("includeRefs",String(!0)),s&&m.searchParams.set("locale",s),a&&m.searchParams.set("enrich",String(a)),m.searchParams.set("omit",f||"meta.componentsUsed"),u&&m.searchParams.set("fields",u),Number.isFinite(l)&&l>-1&&m.searchParams.set("offset",String(Math.floor(l))),typeof p=="boolean"&&m.searchParams.set("includeUnpublished",String(p)),d&&isPositiveNumber(d)&&m.searchParams.set("cacheSeconds",String(d)),g&&isPositiveNumber(g)&&m.searchParams.set("staleCacheSeconds",String(g)),y){const S=flatten({sort:y});for(const x in S)m.searchParams.set(x,JSON.stringify(S[x]))}const h={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},b=flatten(h);for(const S in b)m.searchParams.set(S,String(b[S]));if(n&&m.searchParams.set("userAttributes",JSON.stringify(n)),o){const S=flattenMongoQuery({query:o});for(const x in S)m.searchParams.set(x,JSON.stringify(S[x]))}return m},checkContentHasResults=e=>"results"in e;async function fetchOneEntry(e){const t=await fetchEntries({...e,limit:1});return t&&t[0]||null}const _fetchContent=async e=>{const t=generateContentUrl(e);return await(await(e.fetch??fetch$1)(t.href,e.fetchOptions)).json()},_processContentResult=async(e,t,n=generateContentUrl(e))=>{const o=getDefaultCanTrack(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const a of t.results){const s=getPreviewContent(n.searchParams);i.push(s||a)}t.results=i}if(!o||!(isBrowser()||TARGET==="reactNative"))return t.results;try{const i=[];for(const a of t.results)i.push(await handleABTesting({item:a,canTrack:o}));t.results=i}catch(i){logger.error("Could not process A/B tests. ",i)}return t.results};async function fetchEntries(e){try{const t=generateContentUrl(e),n=await _fetchContent(e);return checkContentHasResults(n)?_processContentResult(e,n):(logger.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return logger.error("Error fetching data. ",t),null}}function isPreviewing(e){const t=e||(isBrowser()?window.location.search:void 0);return t?getSearchString(t).indexOf("builder.preview=")!==-1:!1}function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){const t=Math.random()*16|0;return(e=="x"?t:t&3|8).toString(16)})}function uuid(){return uuidv4().replace(/-/g,"")}const SESSION_LOCAL_STORAGE_KEY="builderSessionId",getSessionId=async({canTrack:e})=>{if(!e)return;const t=await getCookie({name:SESSION_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createSessionId();return setSessionId({id:n,canTrack:e}),n}},createSessionId=()=>uuid(),setSessionId=({id:e,canTrack:t})=>setCookie({name:SESSION_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getLocalStorage=()=>isBrowser()&&typeof localStorage<"u"?localStorage:void 0,getLocalStorageItem=({key:e,canTrack:t})=>{var n;try{return t?(n=getLocalStorage())==null?void 0:n.getItem(e):void 0}catch(o){console.debug("[LocalStorage] GET error: ",o);return}},setLocalStorageItem=({key:e,canTrack:t,value:n})=>{var o;try{t&&((o=getLocalStorage())==null||o.setItem(e,n))}catch(r){console.debug("[LocalStorage] SET error: ",r)}},VISITOR_LOCAL_STORAGE_KEY="builderVisitorId",getVisitorId=({canTrack:e})=>{if(!e)return;const t=getLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,canTrack:e});if(checkIsDefined(t))return t;{const n=createVisitorId();return setVisitorId({id:n,canTrack:e}),n}},createVisitorId=()=>uuid(),setVisitorId=({id:e,canTrack:t})=>setLocalStorageItem({key:VISITOR_LOCAL_STORAGE_KEY,value:e,canTrack:t}),getTrackingEventData=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await getSessionId({canTrack:e}),n=getVisitorId({canTrack:e});return{sessionId:t,visitorId:n}},createEvent=async({type:e,canTrack:t,apiKey:n,metadata:o,...r})=>({type:e,data:{...r,metadata:{url:location.href,...o},...await getTrackingEventData({canTrack:t}),userAttributes:getUserAttributes(),ownerId:n}});async function _track(e){if(!e.apiKey){logger.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!isEditing()&&(isBrowser()||TARGET==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await createEvent(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const track=e=>_track({...e,canTrack:!0});function round(e){return Math.round(e*1e3)/1e3}const findParentElement=(e,t,n=!0)=>{if(!(e instanceof HTMLElement))return null;let o=n?e:e.parentElement;do{if(!o)return null;if(t(o))return o}while(o=o.parentElement);return null},findBuilderParent=e=>findParentElement(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),computeOffset=({event:e,target:t})=>{const n=t.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top,i=round(o/n.width),a=round(r/n.height);return{x:i,y:a}},getInteractionPropertiesForEvent=e=>{const t=e.target,n=t&&findBuilderParent(t),o=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:o||void 0,metadata:{targetOffset:t?computeOffset({event:e,target:t}):void 0,builderTargetOffset:n?computeOffset({event:e,target:n}):void 0,builderElementIndex:n&&o?[].slice.call(document.getElementsByClassName(o)).indexOf(n):void 0}}},DEFAULT_TRUSTED_HOSTS=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function isFromTrustedHost(e,t){const n=new URL(t.origin),o=n.hostname;return(e||DEFAULT_TRUSTED_HOSTS).findIndex(r=>r.startsWith("*.")?o.endsWith(r.slice(1)):r===o)>-1}const SDK_VERSION="0.14.26",registry={};function register(e,t){let n=registry[e];if(n||(n=registry[e]=[]),n.push(t),isBrowser()){const o={type:"builder.register",data:{type:e,info:t}};try{parent.postMessage(o,"*"),parent!==window&&window.postMessage(o,"*")}catch(r){console.debug("Could not postmessage",r)}}}const registerInsertMenu=()=>{register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let isSetupForEditing=!1;const setupBrowserForEditing=(e={})=>{var t,n;isSetupForEditing||(isSetupForEditing=!0,isBrowser()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:TARGET,version:SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(n=window.parent)==null||n.postMessage({type:"builder.updateContent",data:{options:e}},"*"),window.addEventListener("message",o=>{var i,a;if(!isFromTrustedHost(e.trustedHosts,o))return;const{data:r}=o;if(r!=null&&r.type)switch(r.type){case"builder.evaluate":{const s=r.data.text,c=r.data.arguments||[],u=r.data.id,f=new Function(s);let l,d=null;try{l=f.apply(null,c)}catch(g){d=g}d?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:u,error:d.message}},"*"):l&&typeof l.then=="function"?l.then(g=>{var y;(y=window.parent)==null||y.postMessage({type:"builder.evaluateResult",data:{id:u,result:g}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:l,id:u}},"*");break}}})))},createEditorListener=({model:e,trustedHosts:t,callbacks:n})=>o=>{if(!isFromTrustedHost(t,o))return;const{data:r}=o;if(r)switch(r.type){case"builder.configureSdk":{n.configureSdk(r.data);break}case"builder.triggerAnimation":{n.animation(r.data);break}case"builder.contentUpdate":{const i=r.data,a=i.key||i.alias||i.entry||i.modelName,s=i.data;a===e&&n.contentUpdate(s);break}}},subscribeToEditor=(e,t,n)=>{if(!isBrowser)return logger.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};setupBrowserForEditing();const o=createEditorListener({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",o),()=>{window.removeEventListener("message",o)}};function assign(e,...t){const n=Object(e);for(let o=1;o<arguments.length;o++){const r=arguments[o];if(r!=null)for(const i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])}return n}function warnElementNotPresent(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function augmentAnimation(e,t){const n=getAllStylesUsed(e),o=getComputedStyle(t),r=e.steps[0].styles,i=e.steps[e.steps.length-1].styles,a=[r,i];for(const s of a)for(const c of n)c in s||(s[c]=o[c])}function getAllStylesUsed(e){const t=[];for(const n of e.steps)for(const o in n.styles)t.indexOf(o)===-1&&t.push(o);return t}function triggerAnimation(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){warnElementNotPresent(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${camelToKebabCase(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const getCssFromFont=e=>{var i;const t=e.family+(e.kind&&!e.kind.includes("#")?", "+e.kind:""),n=t.split(",")[0],o=e.fileUrl??((i=e==null?void 0:e.files)==null?void 0:i.regular);let r="";if(o&&t&&n&&(r+=`
|
|
182
182
|
@font-face {
|
|
183
183
|
font-family: "${t}";
|
|
184
184
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -213,4 +213,4 @@ font-weight: ${a};
|
|
|
213
213
|
${getCss({cssCode:e.cssCode,contentId:e.contentId})}
|
|
214
214
|
${getFontCss({customFonts:e.customFonts})}
|
|
215
215
|
${getDefaultStyles(e.isNestedRender)}
|
|
216
|
-
`.trim();return jsxRuntime.jsx(InlinedStyles,{id:"builderio-content",styles:t})}const getRootStateInitialValue=({content:e,data:t,locale:n})=>{var i,a,s;const o={},r=((i=e==null?void 0:e.data)==null?void 0:i.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(c=>{c.name&&c.defaultValue!==void 0&&(o[c.name]=c.defaultValue)}),{...o,...r,...t,...n?{locale:n}:{}}},getContentInitialValue=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ContentComponent(e){var r,i,a,s,c,u,f,l,d;const t=getUpdateVariantVisibilityScript({variationId:(r=e.content)==null?void 0:r.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((g,{component:y,...p})=>({...g,[p.name]:{component:y,...serializeComponentInfo(p)}}),{}),o={content:getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((g,{component:y,...p})=>({...g,[p.name]:serializeComponentInfo(p)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return jsxRuntime.jsxs(USE_CLIENT_BUNDLE.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?jsxRuntime.jsx(InlinedScript,{id:"builderio-variant-visibility",scriptStr:t}):null,jsxRuntime.jsx(ContentStyles,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(c=(s=o.content)==null?void 0:s.data)==null?void 0:c.cssCode,customFonts:(f=(u=o.content)==null?void 0:u.data)==null?void 0:f.customFonts}),jsxRuntime.jsx(Blocks,{blocks:(d=(l=o.content)==null?void 0:l.data)==null?void 0:d.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function ContentVariants(e){var i;const t=checkShouldRenderVariants({canTrack:getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var s;return getUpdateCookieAndStylesScript(getVariants(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return getVariants(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},r=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:handleABTestingSync({item:e.content,canTrack:getDefaultCanTrack(e.canTrack)})};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.isNestedRender&&TARGET!=="reactNative"?jsxRuntime.jsx(InlinedScript,{id:"builderio-init-variants-fns",scriptStr:getInitVariantsFnsScriptString()}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:"builderio-variants",styles:o()}),jsxRuntime.jsx(InlinedScript,{id:"builderio-variants-visibility",scriptStr:n()}),(i=getVariants(e.content))==null?void 0:i.map(a=>jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:a,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},a.testVariationId))]}):null,jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:r(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const fetchSymbolContent=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{logger.error("Could not fetch symbol content: ",n)})};async function Symbol$1(e){var i,a,s,c,u;const t=function(){return"div"},n=function(){return"div"},o=function(){var l,d;return[e.attributes[getClassPropName()],"builder-symbol",(l=e.symbol)!=null&&l.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},r=((i=e.symbol)==null?void 0:i.content)||await fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return jsxRuntime.jsx("div",{...e.attributes,className:o(),children:jsxRuntime.jsx(ContentVariants,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(c=r==null?void 0:r.data)==null?void 0:c.state},model:(u=e.symbol)==null?void 0:u.model,content:r,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const settings={};function setEditorSettings(e){if(isBrowser()){Object.assign(settings,e);const t={type:"builder.settingsChange",data:settings};parent.postMessage(t,"*")}}const fetchBuilderProps=async e=>{var o,r,i;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((r=e.userAttributes)==null?void 0:r.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:getBuilderSearchParams(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await fetchOneEntry(n)}};exports.Blocks=Blocks;exports.Columns=Columns;exports.ContentVariants=ContentVariants;exports.Symbol=Symbol$1;exports.Text=Text;exports._processContentResult=_processContentResult;exports._track=_track;exports.createEditorListener=createEditorListener;exports.createRegisterComponentMessage=createRegisterComponentMessage;exports.evaluate=evaluate;exports.fastClone=fastClone;exports.fetch=fetch$1;exports.fetchBuilderProps=fetchBuilderProps;exports.fetchEntries=fetchEntries;exports.fetchOneEntry=fetchOneEntry;exports.getBlockActions=getBlockActions;exports.getBlockProperties=getBlockProperties;exports.getBuilderSearchParams=getBuilderSearchParams;exports.getClassPropName=getClassPropName;exports.getDefaultCanTrack=getDefaultCanTrack;exports.getInteractionPropertiesForEvent=getInteractionPropertiesForEvent;exports.getSrcSet=getSrcSet;exports.getWrapperClassName=getWrapperClassName;exports.init=init;exports.isBrowser=isBrowser;exports.isEditing=isEditing;exports.isEmptyElement=isEmptyElement;exports.isJsScript=isJsScript;exports.isPreviewing=isPreviewing;exports.logger=logger;exports.register=register;exports.registerInsertMenu=registerInsertMenu;exports.setEditorSettings=setEditorSettings;exports.setupBrowserForEditing=setupBrowserForEditing;exports.subscribeToEditor=subscribeToEditor;exports.track=track;exports.triggerAnimation=triggerAnimation;
|
|
216
|
+
`.trim();return jsxRuntime.jsx(InlinedStyles,{id:"builderio-content",styles:t})}const getRootStateInitialValue=({content:e,data:t,locale:n})=>{var i,a,s;const o={},r=((i=e==null?void 0:e.data)==null?void 0:i.state)||{};return(s=(a=e==null?void 0:e.data)==null?void 0:a.inputs)==null||s.forEach(c=>{c.name&&c.defaultValue!==void 0&&(o[c.name]=c.defaultValue)}),{...o,...r,...t,...n?{locale:n}:{}}},getContentInitialValue=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ContentComponent(e){var r,i,a,s,c,u,f,l,d;const t=getUpdateVariantVisibilityScript({variationId:(r=e.content)==null?void 0:r.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((g,{component:y,...p})=>({...g,[p.name]:{component:y,...serializeComponentInfo(p)}}),{}),o={content:getContentInitialValue({content:e.content,data:e.data}),localState:void 0,rootState:getRootStateInitialValue({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},canTrack:e.canTrack,apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...getDefaultRegisteredComponents(),...e.customComponents||[]].reduce((g,{component:y,...p})=>({...g,[p.name]:serializeComponentInfo(p)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return jsxRuntime.jsxs(USE_CLIENT_BUNDLE.EnableEditor,{content:e.content,data:e.data,model:e.model,context:e.context,apiKey:e.apiKey,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,showContent:e.showContent,builderContextSignal:o,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,linkComponent:e.linkComponent,trustedHosts:e.trustedHosts,children:[e.isSsrAbTest?jsxRuntime.jsx(InlinedScript,{id:"builderio-variant-visibility",scriptStr:t}):null,jsxRuntime.jsx(ContentStyles,{isNestedRender:e.isNestedRender,contentId:(a=o.content)==null?void 0:a.id,cssCode:(c=(s=o.content)==null?void 0:s.data)==null?void 0:c.cssCode,customFonts:(f=(u=o.content)==null?void 0:u.data)==null?void 0:f.customFonts}),jsxRuntime.jsx(Blocks,{blocks:(d=(l=o.content)==null?void 0:l.data)==null?void 0:d.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function ContentVariants(e){var i;const t=checkShouldRenderVariants({canTrack:getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var s;return getUpdateCookieAndStylesScript(getVariants(e.content).map(c=>({id:c.testVariationId,testRatio:c.testRatio})),((s=e.content)==null?void 0:s.id)||"")},o=function(){return getVariants(e.content).map(s=>`.variant-${s.testVariationId} { display: none; } `).join("")},r=function(){var s;return t?{...e.content,testVariationId:(s=e.content)==null?void 0:s.id}:handleABTestingSync({item:e.content,canTrack:getDefaultCanTrack(e.canTrack)})};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.isNestedRender&&TARGET!=="reactNative"?jsxRuntime.jsx(InlinedScript,{id:"builderio-init-variants-fns",scriptStr:getInitVariantsFnsScriptString()}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:"builderio-variants",styles:o()}),jsxRuntime.jsx(InlinedScript,{id:"builderio-variants-visibility",scriptStr:n()}),(i=getVariants(e.content))==null?void 0:i.map(a=>jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:a,showContent:!1,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts},a.testVariationId))]}):null,jsxRuntime.jsx(ContentComponent,{isNestedRender:e.isNestedRender,content:r(),showContent:!0,model:e.model,data:e.data,context:e.context,apiKey:e.apiKey,apiVersion:e.apiVersion,customComponents:e.customComponents,linkComponent:e.linkComponent,canTrack:e.canTrack,locale:e.locale,enrich:e.enrich,isSsrAbTest:t,blocksWrapper:e.blocksWrapper,blocksWrapperProps:e.blocksWrapperProps,contentWrapper:e.contentWrapper,contentWrapperProps:e.contentWrapperProps,trustedHosts:e.trustedHosts})]})}const fetchSymbolContent=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return fetchOneEntry({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{logger.error("Could not fetch symbol content: ",n)})};async function Symbol$1(e){var i,a,s,c,u;const t=function(){return"div"},n=function(){return"div"},o=function(){var l,d;return[e.attributes[getClassPropName()],"builder-symbol",(l=e.symbol)!=null&&l.inline?"builder-inline-symbol":void 0,(d=e.symbol)!=null&&d.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},r=((i=e.symbol)==null?void 0:i.content)||await fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return jsxRuntime.jsx("div",{...e.attributes,className:o(),children:jsxRuntime.jsx(ContentVariants,{isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(a=e.builderBlock)==null?void 0:a.id},customComponents:Object.values(e.builderComponents),data:{...(s=e.symbol)==null?void 0:s.data,...e.builderContext.localState,...(c=r==null?void 0:r.data)==null?void 0:c.state},canTrack:e.builderContext.canTrack,model:(u=e.symbol)==null?void 0:u.model,content:r,linkComponent:e.builderLinkComponent,blocksWrapper:t(),contentWrapper:n()})})}const settings={};function setEditorSettings(e){if(isBrowser()){Object.assign(settings,e);const t={type:"builder.settingsChange",data:settings};parent.postMessage(t,"*")}}const fetchBuilderProps=async e=>{var o,r,i;const t=e.path||((o=e.url)==null?void 0:o.pathname)||((r=e.userAttributes)==null?void 0:r.urlPath),n={...e,apiKey:e.apiKey,model:e.model||"page",userAttributes:{...e.userAttributes,...t?{urlPath:t}:{}},options:getBuilderSearchParams(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await fetchOneEntry(n)}};exports.Blocks=Blocks;exports.Columns=Columns;exports.ContentVariants=ContentVariants;exports.Symbol=Symbol$1;exports.Text=Text;exports._processContentResult=_processContentResult;exports._track=_track;exports.createEditorListener=createEditorListener;exports.createRegisterComponentMessage=createRegisterComponentMessage;exports.evaluate=evaluate;exports.fastClone=fastClone;exports.fetch=fetch$1;exports.fetchBuilderProps=fetchBuilderProps;exports.fetchEntries=fetchEntries;exports.fetchOneEntry=fetchOneEntry;exports.getBlockActions=getBlockActions;exports.getBlockProperties=getBlockProperties;exports.getBuilderSearchParams=getBuilderSearchParams;exports.getClassPropName=getClassPropName;exports.getDefaultCanTrack=getDefaultCanTrack;exports.getInteractionPropertiesForEvent=getInteractionPropertiesForEvent;exports.getSrcSet=getSrcSet;exports.getWrapperClassName=getWrapperClassName;exports.init=init;exports.isBrowser=isBrowser;exports.isEditing=isEditing;exports.isEmptyElement=isEmptyElement;exports.isJsScript=isJsScript;exports.isPreviewing=isPreviewing;exports.logger=logger;exports.register=register;exports.registerInsertMenu=registerInsertMenu;exports.setEditorSettings=setEditorSettings;exports.setupBrowserForEditing=setupBrowserForEditing;exports.subscribeToEditor=subscribeToEditor;exports.track=track;exports.triggerAnimation=triggerAnimation;
|
package/lib/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./USE_CLIENT_BUNDLE-9966f569.cjs"),e=require("./bundle-e09f3bd9.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-e36813e6.cjs");require("next/navigation");require("lru-cache");exports.BuilderContext=t.builderContext;exports.Button=t.Button;exports.Fragment=t.FragmentComponent;exports.Image=t.Image;exports.Section=t.SectionComponent;exports.Video=t.Video;exports.Blocks=e.Blocks;exports.Columns=e.Columns;exports.Content=e.ContentVariants;exports.Symbol=e.Symbol;exports.Text=e.Text;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/node/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-
|
|
1
|
+
import { f as n, c as m, F as c, d as p, S as g, V as d } from "./USE_CLIENT_BUNDLE-07e24176.js";
|
|
2
|
+
import { B as l, C as f, x as B, S as C, T as E, G as S, u as x, F as h, H as b, v as y, A as F, c as P, j as T, y as k, z as v, E as R, D as V } from "./bundle-1b7db75b.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-aa3e89ff.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder.io/sdk-react-nextjs",
|
|
3
3
|
"description": "Builder.io RSC SDK for NextJS App Directory",
|
|
4
|
-
"version": "0.14.
|
|
4
|
+
"version": "0.14.26",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.26";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.14.
|
|
1
|
+
export declare const SDK_VERSION = "0.14.26";
|