@builder.io/sdk-react-nextjs 0.14.1 → 0.14.3
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-51815064.js → USE_CLIENT_BUNDLE-1270c8f4.js} +2 -2
- package/lib/{node/USE_CLIENT_BUNDLE-62a178e1.cjs → browser/USE_CLIENT_BUNDLE-c1f06a46.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-f0e5fdef.cjs → browser/USE_SERVER_BUNDLE-24e8f107.cjs} +1 -1
- package/lib/{edge/USE_SERVER_BUNDLE-7191faac.js → browser/USE_SERVER_BUNDLE-99e0334d.js} +1 -1
- package/lib/browser/{bundle-cc12d1bc.js → bundle-333e93b9.js} +22 -20
- package/lib/browser/{bundle-9c5f5cde.cjs → bundle-bebe179f.cjs} +3 -3
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +3 -3
- package/lib/{node/USE_CLIENT_BUNDLE-d012a153.js → edge/USE_CLIENT_BUNDLE-91b3973b.js} +2 -2
- package/lib/{browser/USE_CLIENT_BUNDLE-83c9a885.cjs → edge/USE_CLIENT_BUNDLE-e0cb789c.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-95968708.cjs → edge/USE_SERVER_BUNDLE-28ff24f9.cjs} +1 -1
- package/lib/{node/USE_SERVER_BUNDLE-a4460138.js → edge/USE_SERVER_BUNDLE-f29a4a48.js} +1 -1
- package/lib/edge/{bundle-cc82bd60.js → bundle-49ee510b.js} +22 -20
- package/lib/edge/{bundle-a08cccde.cjs → bundle-8abf9251.cjs} +3 -3
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +3 -3
- package/lib/{edge/USE_CLIENT_BUNDLE-366693e9.cjs → node/USE_CLIENT_BUNDLE-516849e4.cjs} +1 -1
- package/lib/{edge/USE_CLIENT_BUNDLE-c1fb11f0.js → node/USE_CLIENT_BUNDLE-6ecc05ac.js} +2 -2
- package/lib/{browser/USE_SERVER_BUNDLE-fb3ef1bb.cjs → node/USE_SERVER_BUNDLE-6860cf7c.cjs} +1 -1
- package/lib/{browser/USE_SERVER_BUNDLE-60b2536b.js → node/USE_SERVER_BUNDLE-6a09d70e.js} +1 -1
- package/lib/node/{bundle-72550faf.js → bundle-35759433.js} +7 -5
- package/lib/node/{bundle-b5a3f37b.cjs → bundle-e917fcc7.cjs} +3 -3
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +3 -3
- package/package.json +4 -4
- package/types/cjs/blocks/button/index.d.ts +1 -0
- package/types/cjs/blocks/columns/index.d.ts +1 -0
- package/types/cjs/blocks/custom-code/index.d.ts +1 -0
- package/types/cjs/blocks/embed/index.d.ts +1 -0
- package/types/cjs/blocks/form/form/index.d.ts +1 -0
- package/types/cjs/blocks/form/input/index.d.ts +1 -0
- package/types/cjs/blocks/form/select/index.d.ts +1 -0
- package/types/cjs/blocks/form/submit-button/index.d.ts +1 -0
- package/types/cjs/blocks/fragment/index.d.ts +1 -0
- package/types/cjs/blocks/image/index.d.ts +1 -0
- package/types/cjs/blocks/img/index.d.ts +1 -0
- package/types/cjs/blocks/section/index.d.ts +1 -0
- package/types/cjs/blocks/slot/index.d.ts +1 -0
- package/types/cjs/blocks/symbol/index.d.ts +1 -0
- package/types/cjs/blocks/text/index.d.ts +1 -0
- package/types/cjs/blocks/video/index.d.ts +1 -0
- package/types/cjs/components/blocks/index.d.ts +1 -0
- package/types/cjs/components/content-variants/index.d.ts +1 -0
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/functions/get-content/types.d.ts +1 -1
- package/types/cjs/index-helpers/blocks-exports.d.ts +10 -11
- package/types/esm/blocks/button/index.d.ts +1 -0
- package/types/esm/blocks/columns/index.d.ts +1 -0
- package/types/esm/blocks/custom-code/index.d.ts +1 -0
- package/types/esm/blocks/embed/index.d.ts +1 -0
- package/types/esm/blocks/form/form/index.d.ts +1 -0
- package/types/esm/blocks/form/input/index.d.ts +1 -0
- package/types/esm/blocks/form/select/index.d.ts +1 -0
- package/types/esm/blocks/form/submit-button/index.d.ts +1 -0
- package/types/esm/blocks/fragment/index.d.ts +1 -0
- package/types/esm/blocks/image/index.d.ts +1 -0
- package/types/esm/blocks/img/index.d.ts +1 -0
- package/types/esm/blocks/section/index.d.ts +1 -0
- package/types/esm/blocks/slot/index.d.ts +1 -0
- package/types/esm/blocks/symbol/index.d.ts +1 -0
- package/types/esm/blocks/text/index.d.ts +1 -0
- package/types/esm/blocks/video/index.d.ts +1 -0
- package/types/esm/components/blocks/index.d.ts +1 -0
- package/types/esm/components/content-variants/index.d.ts +1 -0
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/functions/get-content/types.d.ts +1 -1
- package/types/esm/index-helpers/blocks-exports.d.ts +10 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const m=require("react/jsx-runtime");require("react");const
|
|
1
|
+
"use strict";const m=require("react/jsx-runtime");require("react");const uo=require("lru-cache"),Z=require("./USE_CLIENT_BUNDLE-e0cb789c.cjs");require("next/navigation");const fo=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),po=e=>typeof e=="string"&&fo.has(e.toLowerCase()),he="rsc",ft=()=>{switch(he){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};function ho(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}const at="[Builder.io]: ",X={log:(...e)=>console.log(at,...e),error:(...e)=>console.error(at,...e),warn:(...e)=>console.warn(at,...e),debug:(...e)=>console.debug(at,...e)};function K(){return typeof window<"u"&&typeof document<"u"}function mo(){return K()&&window.self!==window.top}function pt(){return mo()&&window.location.search.indexOf("builder.frameEditing=")!==-1}const go=()=>{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},yo=()=>typeof navigator=="object"&&navigator.userAgent||"",sr=()=>{const e=yo(),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()||he==="reactNative"}},n=e.match(/Tablet|iPad/i),r=go();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"}},lr=({builder:e,context:t,event:n,state:r})=>Object.entries({state:r,Builder:e,builder:e,context:t,event:n}),vo=()=>({isEditing:pt(),isBrowser:K(),isServer:!K(),getUserAttributes:()=>sr()}),xo=(e,{isExpression:t=!0})=>t&&!(e.includes(";")||e.includes(" return ")||e.trim().startsWith("return "))?`return (${e});`:e,bo=({code:e,builder:t,context:n,event:r,localState:o,rootSetState:i,rootState:s})=>{const u=lr({builder:t,context:n,event:r,state:cr({rootState:s,localState:o,rootSetState:i})});return new Function(...u.map(([d])=>d),e)(...u.map(([,d])=>d))};function cr({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"?cr({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 ur=(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 F,So=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&&lo.test(String.fromCharCode(a))}function n(a){return 65>a?a===36:91>a?!0:97>a?a===95:123>a?!0:170<=a&&_n.test(String.fromCharCode(a))}function r(a,l){for(var c=g,p=1,j=0;;){it.lastIndex=j;var _=it.exec(c);if(_&&_.index<a)++p,j=_.index+_[0].length;else break}throw c={line:p,ab:a-j},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(p){return l[p]||!1}}function i(){this.line=be,this.ab=f-se}function s(a,l){ke=f,A.C&&(Tt=new i),I=a,d(),te=l,Be=a.m}function u(){for(var a=f,l=A.va&&A.C&&new i,c=g.charCodeAt(f+=2);f<we&&c!==10&&c!==13&&c!==8232&&c!==8233;)++f,c=g.charCodeAt(f);A.va&&A.va(!1,g.slice(a+2,f),a,f,l,A.C&&new i)}function d(){for(;f<we;){var a=g.charCodeAt(f);if(a===32)++f;else if(a===13)++f,a=g.charCodeAt(f),a===10&&++f,A.C&&(++be,se=f);else if(a===10||a===8232||a===8233)++f,A.C&&(++be,se=f);else if(8<a&&14>a)++f;else if(a===47)if(a=g.charCodeAt(f+1),a===42){a=void 0;var l=A.va&&A.C&&new i,c=f,p=g.indexOf("*/",f+=2);if(p===-1&&r(f-2,"Unterminated comment"),f=p+2,A.C)for(it.lastIndex=c;(a=it.exec(g))&&a.index<f;)++be,se=a.index+a[0].length;A.va&&A.va(!0,g.slice(c+2,p),c,f,l,A.C&&new i)}else if(a===47)u();else break;else if(a===160)++f;else if(5760<=a&&so.test(String.fromCharCode(a)))++f;else break}}function C(a){switch(a){case 46:a=g.charCodeAt(f+1),48<=a&&57>=a?x(!0):(++f,s(Nn));return;case 40:return++f,s(le);case 41:return++f,s(re);case 59:return++f,s(ce);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(Fn);case 48:if(a=g.charCodeAt(f+1),a===120||a===88){f+=2,a=O(16),a===null&&r(V+2,"Expected hexadecimal number"),n(g.charCodeAt(f))&&r(f,"Identifier directly after number"),s(Me,a);return}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return x(!1);case 34:case 39:f++;for(var l="";;){f>=we&&r(V,"Unterminated string constant");var c=g.charCodeAt(f);if(c===a){++f,s(tt,l);break}if(c===92){c=g.charCodeAt(++f);var p=/^[0-7]+/.exec(g.slice(f,f+3));for(p&&(p=p[0]);p&&255<parseInt(p,8);)p=p.slice(0,-1);if(p==="0"&&(p=null),++f,p)q&&r(f-2,"Octal literal in strict mode"),l+=String.fromCharCode(parseInt(p,8)),f+=p.length-1;else switch(c){case 110:l+=`
|
|
2
2
|
`;break;case 114:l+="\r";break;case 120:l+=String.fromCharCode(w(2));break;case 117:l+=String.fromCharCode(w(4));break;case 85:l+=String.fromCharCode(w(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:g.charCodeAt(f)===10&&++f;case 10:A.C&&(se=f,++be);break;default:l+=String.fromCharCode(c)}}else c!==13&&c!==10&&c!==8232&&c!==8233||r(V,"Unterminated string constant"),l+=String.fromCharCode(c),++f}return;case 47:a=g.charCodeAt(f+1),Be?(++f,R()):a===61?v(Se,2):v(Bn,1);return;case 37:case 42:g.charCodeAt(f+1)===61?v(Se,2):v(oo,1);return;case 124:case 38:l=g.charCodeAt(f+1),l===a?v(a===124?Dn:Ln,2):l===61?v(Se,2):v(a===124?qr:Qr,1);return;case 94:g.charCodeAt(f+1)===61?v(Se,2):v(Zr,1);return;case 43:case 45:l=g.charCodeAt(f+1),l===a?l===45&&g.charCodeAt(f+2)===62&&ot.test(g.slice(ge,f))?(f+=3,u(),d(),E()):v(zr,2):l===61?v(Se,2):v(ro,1);return;case 60:case 62:l=g.charCodeAt(f+1),c=1,l===a?(c=a===62&&g.charCodeAt(f+2)===62?3:2,g.charCodeAt(f+c)===61?v(Se,c+1):v(no,c)):l===33&&a===60&&g.charCodeAt(f+2)===45&&g.charCodeAt(f+3)===45?(f+=4,u(),d(),E()):(l===61&&(c=g.charCodeAt(f+2)===61?3:2),v(to,c));return;case 61:case 33:g.charCodeAt(f+1)===61?v(eo,g.charCodeAt(f+2)===61?3:2):v(a===61?Un:Mn,1);return;case 126:return v(Mn,1)}return!1}function E(a){if(a?f=V+1:V=f,A.C&&(jt=new i),a)return R();if(f>=we)return s(Rt);if(a=g.charCodeAt(f),n(a)||a===92)return N();if(C(a)===!1){if(a=String.fromCharCode(a),a==="\\"||_n.test(a))return N();r(f,"Unexpected character '"+a+"'")}}function v(a,l){var c=g.slice(f,f+l);f+=l,s(a,c)}function R(){for(var a,l,c=f;;){f>=we&&r(c,"Unterminated regexp");var p=g.charAt(f);if(ot.test(p)&&r(c,"Unterminated regexp"),a)a=!1;else{if(p==="[")l=!0;else if(p==="]"&&l)l=!1;else if(p==="/"&&!l)break;a=p==="\\"}++f}a=g.slice(c,f),++f,(l=B())&&!/^[gmi]*$/.test(l)&&r(c,"Invalid regexp flag");try{var j=new RegExp(a,l)}catch(_){throw _ instanceof SyntaxError&&r(c,_.message),_}s(hn,j)}function O(a,l){for(var c=f,p=0,j=l===void 0?1/0:l,_=0;_<j;++_){var J=g.charCodeAt(f);if(J=97<=J?J-97+10:65<=J?J-65+10:48<=J&&57>=J?J-48:1/0,J>=a)break;++f,p=p*a+J}return f===c||l!==void 0&&f-c!==l?null:p}function x(a){var l=f,c=!1,p=g.charCodeAt(f)===48;a||O(10)!==null||r(l,"Invalid number"),g.charCodeAt(f)===46&&(++f,O(10),c=!0),a=g.charCodeAt(f),(a===69||a===101)&&(a=g.charCodeAt(++f),a!==43&&a!==45||++f,O(10)===null&&r(l,"Invalid number"),c=!0),n(g.charCodeAt(f))&&r(f,"Identifier directly after number"),a=g.slice(l,f);var j;c?j=parseFloat(a):p&&a.length!==1?/[89]/.test(a)||q?r(l,"Invalid number"):j=parseInt(a,8):j=parseInt(a,10),s(Me,j)}function w(a){return a=O(16,a),a===null&&r(V,"Bad character escape sequence"),a}function B(){Ie=!1;for(var a,l=!0,c=f;;){var p=g.charCodeAt(f);if(t(p))Ie&&(a+=g.charAt(f)),++f;else if(p===92){Ie||(a=g.slice(c,f)),Ie=!0,g.charCodeAt(++f)!==117&&r(f,"Expecting Unicode escape sequence \\uXXXX"),++f,p=w(4);var j=String.fromCharCode(p);j||r(f-1,"Invalid Unicode escape"),(l?n(p):t(p))||r(f-4,"Invalid Unicode escape"),a+=j}else break;l=!1}return Ie?a:g.slice(c,f)}function N(){var a=B(),l=Ce;!Ie&&ao(a)&&(l=Yr[a]),s(l,a)}function k(){At=V,ge=ke,Ot=Tt,E()}function Q(a){if(q=a,f=V,A.C)for(;f<se;)se=g.lastIndexOf(`
|
|
3
3
|
`,se-2)+1,--be;d(),E()}function $(){this.type=null,this.start=V,this.end=null}function ee(){this.start=jt,this.end=null,It&&(this.source=It)}function M(){var a=new $;return A.C&&(a.X=new ee),A.vb&&(a.sourceFile=A.vb),A.Xa&&(a.j=[V,0]),a}function me(a){var l=new $;return l.start=a.start,A.C&&(l.X=new ee,l.X.start=a.X.start),A.Xa&&(l.j=[a.j[0],0]),l}function T(a,l){return a.type=l,a.end=ge,A.C&&(a.X.end=Ot),A.Xa&&(a.j[1]=ge),a}function xt(a){return a.type==="ExpressionStatement"&&a.la.type==="Literal"&&a.la.value==="use strict"}function U(a){return I===a?(k(),!0):!1}function Ze(){return!A.fc&&(I===Rt||I===Ee||ot.test(g.slice(ge,V)))}function xe(){U(ce)||Ze()||ie()}function D(a){I===a?k():ie()}function ie(){r(V,"Unexpected token")}function Qe(a){a.type!=="Identifier"&&a.type!=="MemberExpression"&&r(a.start,"Assigning to rvalue"),q&&a.type==="Identifier"&&rt(a.name)&&r(a.start,"Assigning to "+a.name+" in strict mode")}function ne(){(I===Bn||I===Se&&te==="/=")&&E(!0);var a=I,l=M();switch(a){case Pt:case gn:k();var c=a===Pt;U(ce)||Ze()?l.label=null:I!==Ce?ie():(l.label=ae(),xe());for(var p=0;p<L.length;++p){var j=L[p];if((l.label===null||j.name===l.label.name)&&(j.kind!==null&&(c||j.kind==="loop")||l.label&&c))break}return p===L.length&&r(l.start,"Unsyntactic "+a.l),T(l,c?"BreakStatement":"ContinueStatement");case yn:return k(),xe(),T(l,"DebuggerStatement");case xn:return k(),L.push(Vt),l.body=ne(),L.pop(),D(Mt),l.test=Pe(),xe(),T(l,"DoWhileStatement");case wn:return k(),L.push(Vt),D(le),I===ce?bt(l,null):I===Ut?(a=M(),k(),pn(a,!0),T(a,"VariableDeclaration"),a.fa.length===1&&U(nt)?fn(l,a):bt(l,a)):(a=G(!1,!0),U(nt)?(Qe(a),fn(l,a)):bt(l,a));case Ft:return k(),Ct(l,!0);case kn:return k(),l.test=Pe(),l.da=ne(),l.alternate=U(bn)?ne():null,T(l,"IfStatement");case Cn:return Ue||A.Ib||r(V,"'return' outside of function"),k(),U(ce)||Ze()?l.K=null:(l.K=G(),xe()),T(l,"ReturnStatement");case Bt:for(k(),l.Qb=Pe(),l.tb=[],D(De),L.push(co);I!==Ee;)I===Nt||I===vn?(a=I===Nt,p&&T(p,"SwitchCase"),l.tb.push(p=M()),p.da=[],k(),a?p.test=G():(c&&r(At,"Multiple default clauses"),c=!0,p.test=null),D(Le)):(p||ie(),p.da.push(ne()));return p&&T(p,"SwitchCase"),k(),L.pop(),T(l,"SwitchStatement");case En:return k(),ot.test(g.slice(ge,V))&&r(ge,"Illegal newline after throw"),l.K=G(),xe(),T(l,"ThrowStatement");case In:return k(),l.block=Ne(),l.Ea=null,I===mn&&(a=M(),k(),D(le),a.Ua=ae(),q&&rt(a.Ua.name)&&r(a.Ua.start,"Binding "+a.Ua.name+" in strict mode"),D(re),a.body=Ne(),l.Ea=T(a,"CatchClause")),l.fb=U(Sn)?Ne():null,l.Ea||l.fb||r(l.start,"Missing catch or finally clause"),T(l,"TryStatement");case Ut:return k(),pn(l),xe(),T(l,"VariableDeclaration");case Mt:return k(),l.test=Pe(),L.push(Vt),l.body=ne(),L.pop(),T(l,"WhileStatement");case jn:return q&&r(V,"'with' in strict mode"),k(),l.object=Pe(),l.body=ne(),T(l,"WithStatement");case De:return Ne();case ce:return k(),T(l,"EmptyStatement");default:if(c=te,j=G(),a===Ce&&j.type==="Identifier"&&U(Le)){for(p=0;p<L.length;++p)L[p].name===c&&r(j.start,"Label '"+c+"' is already declared");return L.push({name:c,kind:I.W?"loop":I===Bt?"switch":null}),l.body=ne(),L.pop(),l.label=j,T(l,"LabeledStatement")}return l.la=j,xe(),T(l,"ExpressionStatement")}}function Pe(){D(le);var a=G();return D(re),a}function Ne(a){var l=M(),c=!0,p=!1;for(l.body=[],D(De);!U(Ee);){var j=ne();if(l.body.push(j),c&&a&&xt(j)){var _=p;Q(p=!0)}c=!1}return p&&!_&&Q(!1),T(l,"BlockStatement")}function bt(a,l){return a.ua=l,D(ce),a.test=I===ce?null:G(),D(ce),a.update=I===re?null:G(),D(re),a.body=ne(),L.pop(),T(a,"ForStatement")}function fn(a,l){return a.left=l,a.right=G(),D(re),a.body=ne(),L.pop(),T(a,"ForInStatement")}function pn(a,l){for(a.fa=[],a.kind="var";;){var c=M();if(c.id=ae(),q&&rt(c.id.name)&&r(c.id.start,"Binding "+c.id.name+" in strict mode"),c.ua=U(Un)?G(!0,l):null,a.fa.push(T(c,"VariableDeclarator")),!U(ye))break}}function G(a,l){var c=St(l);if(!a&&I===ye){for(a=me(c),a.xb=[c];U(ye);)a.xb.push(St(l));return T(a,"SequenceExpression")}return c}function St(a){var l=wt(kt(),-1,a);if(U(Fn)){var c=me(l);c.test=l,c.da=G(!0),D(Le),c.alternate=G(!0,a),l=T(c,"ConditionalExpression")}return I.Cb?(c=me(l),c.operator=te,c.left=l,k(),c.right=St(a),Qe(l),T(c,"AssignmentExpression")):l}function wt(a,l,c){var p=I.L;if(p!==null&&(!c||I!==nt)&&p>l){var j=me(a);return j.left=a,j.operator=te,a=I,k(),j.right=wt(kt(),p,c),p=T(j,a===Dn||a===Ln?"LogicalExpression":"BinaryExpression"),wt(p,l,c)}return a}function kt(){if(I.prefix){var a=M(),l=I.$b;return a.operator=te,Be=a.prefix=!0,k(),a.K=kt(),l?Qe(a.K):q&&a.operator==="delete"&&a.K.type==="Identifier"&&r(a.start,"Deleting local variable in strict mode"),T(a,l?"UpdateExpression":"UnaryExpression")}for(l=Fe(et());I.cc&&!Ze();)a=me(l),a.operator=te,a.prefix=!1,a.K=l,Qe(l),k(),l=T(a,"UpdateExpression");return l}function Fe(a,l){if(U(Nn)){var c=me(a);return c.object=a,c.Wa=ae(!0),c.bb=!1,Fe(T(c,"MemberExpression"),l)}return U(Dt)?(c=me(a),c.object=a,c.Wa=G(),c.bb=!0,D(Lt),Fe(T(c,"MemberExpression"),l)):!l&&U(le)?(c=me(a),c.callee=a,c.arguments=Et(re,!1),Fe(T(c,"CallExpression"),l)):a}function et(){switch(I){case An:var a=M();return k(),T(a,"ThisExpression");case Ce:return ae();case Me:case tt:case hn:return a=M(),a.value=te,a.raw=g.slice(V,ke),k(),T(a,"Literal");case On:case Rn:case Pn:return a=M(),a.value=I.$a,a.raw=I.l,k(),T(a,"Literal");case le:a=jt;var l=V;k();var c=G();return c.start=l,c.end=ke,A.C&&(c.X.start=a,c.X.end=Tt),A.Xa&&(c.j=[l,ke]),D(re),c;case Dt:return a=M(),k(),a.elements=Et(Lt,!0,!0),T(a,"ArrayExpression");case De:for(a=M(),l=!0,c=!1,a.h=[],k();!U(Ee);){if(l)l=!1;else if(D(ye),A.sb&&U(Ee))break;var p={key:I===Me||I===tt?et():ae(!0)},j=!1;if(U(Le)){p.value=G(!0);var _=p.kind="init"}else p.key.type!=="Identifier"||p.key.name!=="get"&&p.key.name!=="set"?ie():(j=c=!0,_=p.kind=p.key.name,p.key=I===Me||I===tt?et():ae(!0),I!==le&&ie(),p.value=Ct(M(),!1));if(p.key.type==="Identifier"&&(q||c))for(var J=0;J<a.h.length;++J){var je=a.h[J];if(je.key.name===p.key.name){var _t=_===je.kind||j&&je.kind==="init"||_==="init"&&(je.kind==="get"||je.kind==="set");_t&&!q&&_==="init"&&je.kind==="init"&&(_t=!1),_t&&r(p.key.start,"Redefinition of property")}}a.h.push(p)}return T(a,"ObjectExpression");case Ft:return a=M(),k(),Ct(a,!1);case Tn:return a=M(),k(),a.callee=Fe(et(),!0),a.arguments=U(le)?Et(re,!1):Jr,T(a,"NewExpression")}ie()}function Ct(a,l){I===Ce?a.id=ae():l?ie():a.id=null,a.oa=[];var c=!0;for(D(le);!U(re);)c?c=!1:D(ye),a.oa.push(ae());c=Ue;var p=L;if(Ue=!0,L=[],a.body=Ne(!0),Ue=c,L=p,q||a.body.body.length&&xt(a.body.body[0])){for(c=a.id?-1:0;c<a.oa.length;++c)if(p=0>c?a.id:a.oa[c],(Vn(p.name)||rt(p.name))&&r(p.start,"Defining '"+p.name+"' in strict mode"),0<=c)for(var j=0;j<c;++j)p.name===a.oa[j].name&&r(p.start,"Argument name clash in strict mode")}return T(a,l?"FunctionDeclaration":"FunctionExpression")}function Et(a,l,c){for(var p=[],j=!0;!U(a);){if(j)j=!1;else if(D(ye),l&&A.sb&&U(a))break;p.push(c&&I===ye?null:G(!0))}return p}function ae(a){var l=M();return a&&A.yb==="everywhere"&&(a=!1),I===Ce?(!a&&(A.yb&&io(te)||q&&Vn(te))&&g.slice(V,ke).indexOf("\\")===-1&&r(V,"The keyword '"+te+"' is reserved"),l.name=te):a&&I.l?l.name=I.l:ie(),Be=!1,k(),T(l,"Identifier")}e.version="0.5.0";var A,g="",we,It;e.parse=function(a,l){g=String(a),we=g.length,A=l||{};for(var c in dn)Object.prototype.hasOwnProperty.call(A,c)||(A[c]=dn[c]);for(It=A.sourceFile,be=1,f=se=0,Be=!0,d(),c=A.dc,At=ge=f,A.C&&(Ot=new i),Ue=q=!1,L=[],E(),a=c||M(),l=!0,c||(a.body=[]);I!==Rt;)c=ne(),a.body.push(c),l&&xt(c)&&Q(!0),l=!1;return T(a,"Program")};var dn={fc:!1,sb:!0,yb:!1,Ib:!1,C:!1,va:null,Xa:!1,dc:null,sourceFile:null,vb:null},f=0,V=0,ke=0,jt,Tt,I,te,Be,be,se,At=0,ge=0,Ot,Ue,L,q,Jr=[],Me={type:"num"},hn={type:"regexp"},tt={type:"string"},Ce={type:"name"},Rt={type:"eof"},Pt={l:"break"},Nt={l:"case",m:!0},mn={l:"catch"},gn={l:"continue"},yn={l:"debugger"},vn={l:"default"},xn={l:"do",W:!0},bn={l:"else",m:!0},Sn={l:"finally"},wn={l:"for",W:!0},Ft={l:"function"},kn={l:"if"},Cn={l:"return",m:!0},Bt={l:"switch"},En={l:"throw",m:!0},In={l:"try"},Ut={l:"var"},Mt={l:"while",W:!0},jn={l:"with"},Tn={l:"new",m:!0},An={l:"this"},On={l:"null",$a:null},Rn={l:"true",$a:!0},Pn={l:"false",$a:!1},nt={l:"in",L:7,m:!0},Yr={break:Pt,case:Nt,catch:mn,continue:gn,debugger:yn,default:vn,do:xn,else:bn,finally:Sn,for:wn,function:Ft,if:kn,return:Cn,switch:Bt,throw:En,try:In,var:Ut,while:Mt,with:jn,null:On,true:Rn,false:Pn,new:Tn,in:nt,instanceof:{l:"instanceof",L:7,m:!0},this:An,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:"}"},le={type:"(",m:!0},re={type:")"},ye={type:",",m:!0},ce={type:";",m:!0},Le={type:":",m:!0},Nn={type:"."},Fn={type:"?",m:!0},Bn={L:10,m:!0},Un={Cb:!0,m:!0},Se={Cb:!0,m:!0},zr={cc:!0,prefix:!0,$b:!0},Mn={prefix:!0,m:!0},Dn={L:1,m:!0},Ln={L:2,m:!0},qr={L:3,m:!0},Zr={L:4,m:!0},Qr={L:5,m:!0},eo={L:6,m:!0},to={L:7,m:!0},no={L:8,m:!0},ro={L:9,prefix:!0,m:!0},oo={L:10,m:!0},io=o("class enum extends super const export import"),Vn=o("implements interface let package private protected public static yield"),rt=o("eval arguments"),ao=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"),so=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/,_n=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),lo=RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ̀-ͯ҃-֑҇-ׇֽֿׁׂׅׄؐ-ؚؠ-ىٲ-ۓۧ-ۨۻ-ۼܰ-݊ࠀ-ࠔࠛ-ࠣࠥ-ࠧࠩ-࠭ࡀ-ࡗࣤ-ࣾऀ-ःऺ-़ा-ॏ॑-ॗॢ-ॣ०-९ঁ-ঃ়া-ৄেৈৗয়-ৠਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୟ-ୠ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఁ-ఃె-ైొ-్ౕౖౢ-ౣ౦-౯ಂಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢ-ೣ೦-೯ംഃെ-ൈൗൢ-ൣ൦-൯ංඃ්ා-ුූෘ-ෟෲෳิ-ฺเ-ๅ๐-๙ິ-ູ່-ໍ໐-໙༘༙༠-༩༹༵༷ཁ-ཇཱ-྄྆-྇ྍ-ྗྙ-ྼ࿆က-ဩ၀-၉ၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟ᜎ-ᜐᜠ-ᜰᝀ-ᝐᝲᝳក-ឲ៝០-៩᠋-᠍᠐-᠙ᤠ-ᤫᤰ-᤻ᥑ-ᥭᦰ-ᧀᧈ-ᧉ᧐-᧙ᨀ-ᨕᨠ-ᩓ᩠-᩿᩼-᪉᪐-᪙ᭆ-ᭋ᭐-᭙᭫-᭳᮰-᮹᯦-᯳ᰀ-ᰢ᱀-᱉ᱛ-ᱽ᳐-᳒ᴀ-ᶾḁ-ἕ‿⁀⁔⃐-⃥⃜⃡-⃰ⶁ-ⶖⷠ-ⷿ〡-〨゙゚Ꙁ-ꙭꙴ-꙽ꚟ꛰-꛱ꟸ-ꠀ꠆ꠋꠣ-ꠧꢀ-ꢁꢴ-꣄꣐-꣙ꣳ-ꣷ꤀-꤉ꤦ-꤭ꤰ-ꥅꦀ-ꦃ꦳-꧀ꨀ-ꨧꩀ-ꩁꩌ-ꩍ꩐-꩙ꩻꫠ-ꫩꫲ-ꫳꯀ-ꯡ꯬꯭꯰-꯹ﬠ-ﬨ︀-️︠-︦︳︴﹍-﹏0-9_]"),ot=/[\n\r\u2028\u2029]/,it=/\r\n|[\n\r\u2028\u2029]/g,Ie,Vt={kind:"loop"},co={kind:"switch"}},Ht=Ht=typeof globalThis>"u"?void 0:globalThis;So(Ht.j||(Ht.j={}));function h(e,t){typeof e=="string"&&(e=Ae(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=Ae(this.ba.join(`
|
|
4
4
|
`),"polyfills"),this.ba=void 0,dt(this.ra),i=new b(this.ra,this.N),i.done=!1,this.o=[i],this.Eb(),this.value=void 0,this.ra=r,i=new b(this.ra,this.N),i.done=!1,this.o.length=0,this.o[0]=i}var Wn={C:!0,kc:5},Yt={configurable:!0,enumerable:!0,writable:!1},y={configurable:!0,enumerable:!1,writable:!0},z={configurable:!0,enumerable:!1,writable:!1},Ve={configurable:!1,enumerable:!1,writable:!1},$n={configurable:!1,enumerable:!0,writable:!0},fr={STEP_ERROR:!0},Re={SCOPE_REFERENCE:!0},Xe={VALUE_IN_DESCRIPTOR:!0},Te={REGEXP_TIMEOUT:!0},Hn=[],fe=null,Ke=null,ve=typeof globalThis>"u"?void 0:globalThis,wo=["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 Ge(e){var t=e>>>0;return String(t)===String(e)&&t!==4294967295?t:NaN}function dt(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"&&dt(o,t,n)}}h.prototype.REGEXP_MODE=2;h.prototype.REGEXP_THREAD_TIMEOUT=1e3;h.prototype.POLYFILL_TIMEOUT=1e3;F=h.prototype;F.P=!1;F.Ka=!1;F.Kb=0;F.ic=0;function Ae(e,t){var n={},r;for(r in Wn)n[r]=Wn[r];return n.sourceFile=t,ve.j.parse(e,n)}F.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=Ae(e,"appendCode"+this.Kb++)),!e||e.type!=="Program")throw Error("Expecting new AST to start with a Program node");Je(this,e,t.scope),Array.prototype.push.apply(t.node.body,e.body),t.node.body.jb=null,t.done=!1};F.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&&hr(this,n,n.interval);var r=new b(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=Ke;Ke=this;try{var i=this.rb[r.type](e,n,r)}catch(s){if(s!==fr)throw this.value!==s&&(this.value=void 0),s}finally{Ke=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};F.Eb=function(){for(;!this.za&&this.lb(););return this.za};function ko(e,t){e.g(t,"NaN",NaN,Ve),e.g(t,"Infinity",1/0,Ve),e.g(t,"undefined",void 0,Ve),e.g(t,"window",t,Yt),e.g(t,"this",t,Ve),e.g(t,"self",t),e.M=new P(null),e.Z=new P(e.M),Co(e,t),Eo(e,t),t.xa=e.M,e.g(t,"constructor",e.v,y),Io(e,t),jo(e,t),To(e,t),Ao(e,t),Oo(e,t),Ro(e,t),Po(e,t),No(e,t),Fo(e,t);var n=e.i(function(){throw EvalError("Can't happen")},!1);n.eval=!0,e.g(t,"eval",n,y),e.g(t,"parseInt",e.i(parseInt,!1),y),e.g(t,"parseFloat",e.i(parseFloat,!1),y),e.g(t,"isNaN",e.i(isNaN,!1),y),e.g(t,"isFinite",e.i(isFinite,!1),y);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){S(e,e.Gb,u.message)}}}(r[o][0]),e.g(t,r[o][1],e.i(n,!1),y);n=function(i){return Kn(e,!1,arguments)},e.g(t,"setTimeout",e.i(n,!1),y),n=function(i){return Kn(e,!0,arguments)},e.g(t,"setInterval",e.i(n,!1),y),n=function(i){Gn(e,i)},e.g(t,"clearTimeout",e.i(n,!1),y),n=function(i){Gn(e,i)},e.g(t,"clearInterval",e.i(n,!1),y),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)}F.Wb=0;function Co(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 d=s[u];n.test(d)||S(e,e.T,"Invalid function argument: "+d)}s=s.join(", ")}try{var C=Ae("(function("+s+") {"+i+"})","function"+e.Wb++)}catch(E){S(e,e.T,"Invalid code: "+E.message)}return C.body.length!==1&&S(e,e.T,"Invalid code in function body"),Qt(e,C.body[0].la,e.N,"anonymous")};e.O=e.i(r,!0),e.g(t,"Function",e.O,y),e.g(e.O,"prototype",e.Z,y),e.g(e.Z,"constructor",e.O,y),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=pr(e,i):S(e,e.j,"CreateListFromArrayLike called on non-object")),s.eb=!1},W(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},W(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)},W(e,e.O,"toString",r),e.g(e.O,"toString",e.i(r,!1),y),r=function(){return this.valueOf()},W(e,e.O,"valueOf",r),e.g(e.O,"valueOf",e.i(r,!1),y)}function Eo(e,t){function n(o){o!=null||S(e,e.j,"Cannot convert '"+o+"' to object")}var r=function(o){if(o==null)return de(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,y),e.g(e.M,"constructor",e.v,y),e.g(t,"Object",e.v,y),r=function(o){return n(o),ue(e,Object.getOwnPropertyNames(o instanceof P?o.h:o))},e.g(e.v,"getOwnPropertyNames",e.i(r,!1),y),r=function(o){return n(o),o instanceof P&&(o=o.h),ue(e,Object.keys(o))},e.g(e.v,"keys",e.i(r,!1),y),r=function(o){return o===null?e.s(null):(o instanceof P||S(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),y),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||S(e,e.j,"Object.defineProperty called on non-object: "+o),s instanceof P||S(e,e.j,"Property description must be an object"),!o.preventExtensions||i in o.h||S(e,e.j,"Can't define property '"+i+"', object is not extensible"),e.g(o,i,Xe,s.h),o},e.g(e.v,"defineProperty",e.i(r,!1),y),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||S(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),y),r=function(o){return n(o),pe(e,o)},e.g(e.v,"getPrototypeOf",e.i(r,!1),y),r=function(o){return!!o&&!o.preventExtensions},e.g(e.v,"isExtensible",e.i(r,!1),y),r=function(o){return o instanceof P&&(o.preventExtensions=!0),o},e.g(e.v,"preventExtensions",e.i(r,!1),y),W(e,e.v,"toString",P.prototype.toString),W(e,e.v,"toLocaleString",P.prototype.toString),W(e,e.v,"valueOf",P.prototype.valueOf),r=function(o){return n(this),this instanceof P?String(o)in this.h:this.hasOwnProperty(o)},W(e,e.v,"hasOwnProperty",r),r=function(o){return n(this),this instanceof P?Object.prototype.propertyIsEnumerable.call(this.h,o):this.propertyIsEnumerable(o)},W(e,e.v,"propertyIsEnumerable",r),r=function(o){for(;;){if(o=pe(e,o),!o)return!1;if(o===this)return!0}},W(e,e.v,"isPrototypeOf",r)}function Io(e,t){var n=function(r){var o=de(e)?this:Oe(e),i=arguments[0];if(arguments.length===1&&typeof i=="number")isNaN(zt(i))&&S(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,y),n=function(r){return r&&r.H==="Array"},e.g(e.qa,"isArray",e.i(n,!1),y),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 jo(e,t){var n=function(r){return r=arguments.length?ve.String(r):"",de(e)?(this.data=r,this):r};for(e.J=e.i(n,!0),e.g(t,"String",e.J,y),e.g(e.J,"fromCharCode",e.i(String.fromCharCode,!1),y),t="charAt charCodeAt concat indexOf lastIndexOf slice substr substring toLocaleLowerCase toLocaleUpperCase toLowerCase toUpperCase trim".split(" "),n=0;n<t.length;n++)W(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){S(e,e.D,"localeCompare: "+s.message)}},W(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,We(e,r,i),e.REGEXP_MODE===2)){if(fe)r=_e(e,"string.split(separator, limit)",{string:s,separator:r,limit:o},r,i),r!==Te&&i(ue(e,r));else{var u=e.ha(),d=$e(e,r,u,i);u.onmessage=function(C){clearTimeout(d),i(ue(e,C.data))},u.postMessage(["split",s,r,o])}return}r=s.split(r,o),i(ue(e,r))},He(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),We(e,r,o),e.REGEXP_MODE===2)if(fe)r=_e(e,"string.match(regexp)",{string:i,regexp:r},r,o),r!==Te&&o(r&&ue(e,r));else{var s=e.ha(),u=$e(e,r,s,o);s.onmessage=function(d){clearTimeout(u),o(d.data&&ue(e,d.data))},s.postMessage(["match",i,r])}else r=i.match(r),o(r&&ue(e,r))},He(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),We(e,r,o),e.REGEXP_MODE===2)if(fe)r=_e(e,"string.search(regexp)",{string:i,regexp:r},r,o),r!==Te&&o(r);else{var s=e.ha(),u=$e(e,r,s,o);s.onmessage=function(d){clearTimeout(u),o(d.data)},s.postMessage(["search",i,r])}else o(i.search(r))},He(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,We(e,r,i),e.REGEXP_MODE===2)){if(fe)r=_e(e,"string.replace(substr, newSubstr)",{string:s,substr:r,newSubstr:o},r,i),r!==Te&&i(r);else{var u=e.ha(),d=$e(e,r,u,i);u.onmessage=function(C){clearTimeout(d),i(C.data)},u.postMessage(["replace",s,r,o])}return}i(s.replace(r,o))},He(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 To(e,t){e.mb=e.i(function(n){return n=ve.Boolean(n),de(e)?(this.data=n,this):n},!0),e.g(t,"Boolean",e.mb,y)}function Ao(e,t){var n=function(r){return r=arguments.length?ve.Number(r):0,de(e)?(this.data=r,this):r};for(e.aa=e.i(n,!0),e.g(t,"Number",e.aa,y),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]],Ve);n=function(r){try{return Number(this).toExponential(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toExponential",n),n=function(r){try{return Number(this).toFixed(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toFixed",n),n=function(r){try{return Number(this).toPrecision(r)}catch(o){S(e,e.D,o.message)}},W(e,e.aa,"toPrecision",n),n=function(r){try{return Number(this).toString(r)}catch(o){S(e,e.D,o.message)}},W(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){S(e,e.D,"toLocaleString: "+i.message)}},W(e,e.aa,"toLocaleString",n)}function Oo(e,t){var n=function(o,i){if(!de(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.$,y),e.g(e.$,"now",e.i(Date.now,!1),y),e.g(e.$,"parse",e.i(Date.parse,!1),y),e.g(e.$,"UTC",e.i(Date.UTC,!1),y),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||S(e,e.j,o+" not called on a Date");for(var u=[],d=0;d<arguments.length;d++)u[d]=e.R(arguments[d]);return s[o].apply(s,u)}}(t[r]),W(e,e.$,t[r],n)}function Ro(e,t){var n=function(r,o){if(de(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)||S(e,e.T,"Invalid regexp flag: "+o);try{var s=new ve.RegExp(r,o)}catch(u){S(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,y),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(E){if(E){var v=ue(e,E);return e.g(v,"index",E.index),e.g(v,"input",E.input),v}return null}var s=this.data;if(r=String(r),s.lastIndex=Number(e.G(this,"lastIndex")),We(e,s,o),e.REGEXP_MODE===2)if(fe)r=_e(e,"regexp.exec(string)",{string:r,regexp:s},s,o),r!==Te&&(e.g(this,"lastIndex",s.lastIndex),o(i(r)));else{var u=e.ha(),d=$e(e,s,u,o),C=this;u.onmessage=function(E){clearTimeout(d),e.g(C,"lastIndex",E.data[1]),o(i(E.data[0]))},u.postMessage(["exec",s,s.lastIndex,r])}else r=s.exec(r),e.g(this,"lastIndex",s.lastIndex),o(i(r))},He(e,e.I,"exec",n)}function Po(e,t){function n(r){var o=e.i(function(i){var s=de(e)?this:e.Aa(o);return Kt(e,s,i),s},!0);return e.g(o,"prototype",e.Aa(e.D),y),e.g(o.h.prototype,"name",r,y),e.g(t,r,o,y),o}e.D=e.i(function(r){var o=de(e)?this:e.Aa(e.D);return Kt(e,o,r),o},!0),e.g(t,"Error",e.D,y),e.g(e.D.h.prototype,"message","",y),e.g(e.D.h.prototype,"name","Error",y),n("EvalError"),e.ob=n("RangeError"),e.pb=n("ReferenceError"),e.T=n("SyntaxError"),e.j=n("TypeError"),e.Gb=n("URIError")}function No(e,t){var n=e.s(e.M);e.g(t,"Math",n,y);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),y)}function Fo(e,t){var n=e.s(e.M);e.g(t,"JSON",n,y),t=function(r){try{var o=JSON.parse(String(r))}catch(i){S(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"?S(e,e.j,"Function replacer on JSON.stringify not supported"):o&&o.H==="Array"?(o=pr(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){S(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,y),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),y),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
|
)`,$i=({contentId:e,variationId:t})=>`window.${Or}(
|
|
152
152
|
"${t}", "${e}", ${Rr}
|
|
153
153
|
)`;function Jt(e){return m.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},id:e.id||""})}const Hi=e=>{const t=e.get("preview"),n=e.get("overrides."+t);return n||X.warn("No previewed ID found in search params."),n};function Pr(){globalThis._BUILDER_PREVIEW_LRU_CACHE||(globalThis._BUILDER_PREVIEW_LRU_CACHE=new uo.LRUCache({max:500,ttl:1e3*60*5}))}function Ki(e){Pr();const t=Hi(e);return typeof t=="string"?globalThis._BUILDER_PREVIEW_LRU_CACHE.get(t):void 0}function Gi(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:globalThis}function Xi(){const e=Gi().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 Nr=Xi();function lt(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,...lt(i,s,n)}:{...r,[s]:i}},{})}const Ji="v3",Zn="builder.",Yi="options.",zi=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},ln=e=>{if(!e)return{};const t=Fr(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(Zn)){const o=r.replace(Zn,"").replace(Yi,"");n[o]=t[r]}}),n},qi=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return ln(e)},Fr=e=>e instanceof URLSearchParams?zi(e):e,Qn=e=>typeof e=="number"&&!isNaN(e)&&e>=0,cn=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:i,enrich:s,locale:u,apiVersion:d=Ji,fields:C,omit:E,offset:v,cacheSeconds:R,staleCacheSeconds:O,sort:x,includeUnpublished:w}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(d))throw new Error(`Invalid apiVersion: expected 'v3', received '${d}'`);const B=t!==1,N=new URL(`https://cdn.builder.io/api/${d}/content/${o}`);if(N.searchParams.set("apiKey",i),N.searchParams.set("limit",String(t)),N.searchParams.set("noTraverse",String(B)),N.searchParams.set("includeRefs",String(!0)),u&&N.searchParams.set("locale",u),s&&N.searchParams.set("enrich",String(s)),N.searchParams.set("omit",E||"meta.componentsUsed"),C&&N.searchParams.set("fields",C),Number.isFinite(v)&&v>-1&&N.searchParams.set("offset",String(Math.floor(v))),typeof w=="boolean"&&N.searchParams.set("includeUnpublished",String(w)),R&&Qn(R)&&N.searchParams.set("cacheSeconds",String(R)),O&&Qn(O)&&N.searchParams.set("staleCacheSeconds",String(O)),x){const $=lt({sort:x});for(const ee in $)N.searchParams.set(ee,JSON.stringify($[ee]))}const k={...qi(),...Fr(e.options||{})},Q=lt(k);for(const $ in Q)N.searchParams.set($,String(Q[$]));if(n&&N.searchParams.set("userAttributes",JSON.stringify(n)),r){const $=lt({query:r});for(const ee in $)N.searchParams.set(ee,JSON.stringify($[ee]))}return N},Zi=e=>"results"in e;async function un(e){const t=await Ur({...e,limit:1});return t&&t[0]||null}const Qi=async e=>{const t=cn(e);return await(await Nr(t.href)).json()},Br=async(e,t,n=cn(e))=>{const r=ut(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=Ki(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||he==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await yi({item:s,canTrack:r}));t.results=i}catch(i){X.error("Could not process A/B tests. ",i)}return t.results};async function Ur(e){try{const t=cn(e),n=await Qi(e);return Zi(n)?Br(e,n):(X.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return X.error("Error fetching data. ",t),null}}function ea(){return!K()||pt()?!1:location.search.indexOf("builder.preview=")!==-1}function ta(){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 Mr(){return ta().replace(/-/g,"")}const Dr="builderSessionId",na=async({canTrack:e})=>{if(!e)return;const t=await kr({name:Dr,canTrack:e});if(oe(t))return t;{const n=ra();return oa({id:n,canTrack:e}),n}},ra=()=>Mr(),oa=({id:e,canTrack:t})=>Cr({name:Dr,value:e,canTrack:t}),Lr=()=>K()&&typeof localStorage<"u"?localStorage:void 0,ia=({key:e,canTrack:t})=>{var n;try{return t?(n=Lr())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},aa=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Lr())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Vr="builderVisitorId",sa=({canTrack:e})=>{if(!e)return;const t=ia({key:Vr,canTrack:e});if(oe(t))return t;{const n=la();return ca({id:n,canTrack:e}),n}},la=()=>Mr(),ca=({id:e,canTrack:t})=>aa({key:Vr,value:e,canTrack:t}),ua=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await na({canTrack:e}),n=sa({canTrack:e});return{sessionId:t,visitorId:n}},fa=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await ua({canTrack:t}),userAttributes:sr(),ownerId:n}});async function _r(e){if(!e.apiKey){X.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!pt()&&(K()||he==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await fa(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const pa=e=>_r({...e,canTrack:!0});function er(e){return Math.round(e*1e3)/1e3}const da=(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},ha=e=>da(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),tr=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=er(r/n.width),s=er(o/n.height);return{x:i,y:s}},ma=e=>{const t=e.target,n=t&&ha(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?tr({event:e,target:t}):void 0,builderTargetOffset:n?tr({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},ga=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Wr(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ga).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const ya="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 Nr=Xi();function lt(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,...lt(i,s,n)}:{...r,[s]:i}},{})}const Ji="v3",Zn="builder.",Yi="options.",zi=e=>{const t={};return e.forEach((n,r)=>{t[r]=n}),t},ln=e=>{if(!e)return{};const t=Fr(e),n={};return Object.keys(t).forEach(r=>{if(r.startsWith(Zn)){const o=r.replace(Zn,"").replace(Yi,"");n[o]=t[r]}}),n},qi=()=>{if(!K())return{};const e=new URLSearchParams(window.location.search);return ln(e)},Fr=e=>e instanceof URLSearchParams?zi(e):e,Qn=e=>typeof e=="number"&&!isNaN(e)&&e>=0,cn=e=>{const{limit:t=30,userAttributes:n,query:r,model:o,apiKey:i,enrich:s,locale:u,apiVersion:d=Ji,fields:C,omit:E,offset:v,cacheSeconds:R,staleCacheSeconds:O,sort:x,includeUnpublished:w}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(d))throw new Error(`Invalid apiVersion: expected 'v3', received '${d}'`);const B=t!==1,N=new URL(`https://cdn.builder.io/api/${d}/content/${o}`);if(N.searchParams.set("apiKey",i),N.searchParams.set("limit",String(t)),N.searchParams.set("noTraverse",String(B)),N.searchParams.set("includeRefs",String(!0)),u&&N.searchParams.set("locale",u),s&&N.searchParams.set("enrich",String(s)),N.searchParams.set("omit",E||"meta.componentsUsed"),C&&N.searchParams.set("fields",C),Number.isFinite(v)&&v>-1&&N.searchParams.set("offset",String(Math.floor(v))),typeof w=="boolean"&&N.searchParams.set("includeUnpublished",String(w)),R&&Qn(R)&&N.searchParams.set("cacheSeconds",String(R)),O&&Qn(O)&&N.searchParams.set("staleCacheSeconds",String(O)),x){const $=lt({sort:x});for(const ee in $)N.searchParams.set(ee,JSON.stringify($[ee]))}const k={...qi(),...Fr(e.options||{})},Q=lt(k);for(const $ in Q)N.searchParams.set($,String(Q[$]));if(n&&N.searchParams.set("userAttributes",JSON.stringify(n)),r){const $=lt({query:r});for(const ee in $)N.searchParams.set(ee,JSON.stringify($[ee]))}return N},Zi=e=>"results"in e;async function un(e){const t=await Ur({...e,limit:1});return t&&t[0]||null}const Qi=async e=>{const t=cn(e);return await(await Nr(t.href)).json()},Br=async(e,t,n=cn(e))=>{const r=ut(e.canTrack);if(n.search.includes("preview=")){const i=[];for(const s of t.results){const u=Ki(n.searchParams);i.push(u||s)}t.results=i}if(!r||!(K()||he==="reactNative"))return t.results;try{const i=[];for(const s of t.results)i.push(await yi({item:s,canTrack:r}));t.results=i}catch(i){X.error("Could not process A/B tests. ",i)}return t.results};async function Ur(e){try{const t=cn(e),n=await Qi(e);return Zi(n)?Br(e,n):(X.error("Error fetching data. ",{url:t,content:n,options:e}),null)}catch(t){return X.error("Error fetching data. ",t),null}}function ea(){return!K()||pt()?!1:location.search.indexOf("builder.preview=")!==-1}function ta(){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 Mr(){return ta().replace(/-/g,"")}const Dr="builderSessionId",na=async({canTrack:e})=>{if(!e)return;const t=await kr({name:Dr,canTrack:e});if(oe(t))return t;{const n=ra();return oa({id:n,canTrack:e}),n}},ra=()=>Mr(),oa=({id:e,canTrack:t})=>Cr({name:Dr,value:e,canTrack:t}),Lr=()=>K()&&typeof localStorage<"u"?localStorage:void 0,ia=({key:e,canTrack:t})=>{var n;try{return t?(n=Lr())==null?void 0:n.getItem(e):void 0}catch(r){console.debug("[LocalStorage] GET error: ",r);return}},aa=({key:e,canTrack:t,value:n})=>{var r;try{t&&((r=Lr())==null||r.setItem(e,n))}catch(o){console.debug("[LocalStorage] SET error: ",o)}},Vr="builderVisitorId",sa=({canTrack:e})=>{if(!e)return;const t=ia({key:Vr,canTrack:e});if(oe(t))return t;{const n=la();return ca({id:n,canTrack:e}),n}},la=()=>Mr(),ca=({id:e,canTrack:t})=>aa({key:Vr,value:e,canTrack:t}),ua=async({canTrack:e})=>{if(!e)return{visitorId:void 0,sessionId:void 0};const t=await na({canTrack:e}),n=sa({canTrack:e});return{sessionId:t,visitorId:n}},fa=async({type:e,canTrack:t,apiKey:n,metadata:r,...o})=>({type:e,data:{...o,metadata:{url:location.href,...r},...await ua({canTrack:t}),userAttributes:sr(),ownerId:n}});async function _r(e){if(!e.apiKey){X.error("Missing API key for track call. Please provide your API key.");return}if(e.canTrack&&!pt()&&(K()||he==="reactNative"))return fetch("https://cdn.builder.io/api/v1/track",{method:"POST",body:JSON.stringify({events:[await fa(e)]}),headers:{"content-type":"application/json"},mode:"cors"}).catch(t=>{console.error("Failed to track: ",t)})}const pa=e=>_r({...e,canTrack:!0});function er(e){return Math.round(e*1e3)/1e3}const da=(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},ha=e=>da(e,t=>{const n=t.getAttribute("builder-id")||t.id;return(n==null?void 0:n.indexOf("builder-"))===0}),tr=({event:e,target:t})=>{const n=t.getBoundingClientRect(),r=e.clientX-n.left,o=e.clientY-n.top,i=er(r/n.width),s=er(o/n.height);return{x:i,y:s}},ma=e=>{const t=e.target,n=t&&ha(t),r=(n==null?void 0:n.getAttribute("builder-id"))||(n==null?void 0:n.id);return{targetBuilderElement:r||void 0,metadata:{targetOffset:t?tr({event:e,target:t}):void 0,builderTargetOffset:n?tr({event:e,target:n}):void 0,builderElementIndex:n&&r?[].slice.call(document.getElementsByClassName(r)).indexOf(n):void 0}}},ga=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"];function Wr(e,t){const n=new URL(t.origin),r=n.hostname;return(e||ga).findIndex(o=>o.startsWith("*.")?r.endsWith(o.slice(1)):o===r)>-1}const ya="0.14.3",nr={};function $r(e,t){let n=nr[e];if(n||(n=nr[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 va=()=>{$r("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 rr=!1;const Hr=(e={})=>{var t,n;rr||(rr=!0,K()&&((t=window.parent)==null||t.postMessage({type:"builder.sdkInfo",data:{target:he,version:ya,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(!Wr(e.trustedHosts,r))return;const{data:o}=r;if(o!=null&&o.type)switch(o.type){case"builder.evaluate":{const u=o.data.text,d=o.data.arguments||[],C=o.data.id,E=new Function(u);let v,R=null;try{v=E.apply(null,d)}catch(O){R=O}R?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:C,error:R.message}},"*"):v&&typeof v.then=="function"?v.then(O=>{var x;(x=window.parent)==null||x.postMessage({type:"builder.evaluateResult",data:{id:C,result:O}},"*")}).catch(console.error):(s=window.parent)==null||s.postMessage({type:"builder.evaluateResult",data:{result:v,id:C}},"*");break}}})))},Kr=({model:e,trustedHosts:t,callbacks:n})=>r=>{if(!Wr(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}}},xa=(e,t,n)=>{if(!K)return X.warn("`subscribeToEditor` only works in the browser. It currently seems to be running on the server."),()=>{};Hr();const r=Kr({callbacks:{contentUpdate:t,animation:()=>{},configureSdk:()=>{}},model:e,trustedHosts:n==null?void 0:n.trustedHosts});return window.addEventListener("message",r),()=>{window.removeEventListener("message",r)}};function or(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}const ba=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";function Sa(e){console.warn(`Cannot animate element: element with ID ${e} not found!`)}function wa(e,t){const n=ka(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 d of n)d in u||(u[d]=r[d])}function ka(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 Ca(e){const t=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));if(!t.length){Sa(e.elementId||e.id||"");return}Array.from(t).forEach(n=>{wa(e,n),n.style.transition="none",n.style.transitionDelay="0",or(n.style,e.steps[0].styles),setTimeout(()=>{n.style.transition=`all ${e.duration}s ${ba(e.easing)}`,e.delay&&(n.style.transitionDelay=e.delay+"s"),or(n.style,e.steps[1].styles),setTimeout(()=>{n.style.transition="",n.style.transitionDelay=""},(e.delay||0)*1e3+e.duration*1e3+100)})})}const Ea=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');
|
|
@@ -185,4 +185,4 @@ ${Ia({customFonts:e.customFonts})}
|
|
|
185
185
|
text-align: inherit;
|
|
186
186
|
font-family: inherit;
|
|
187
187
|
}
|
|
188
|
-
`.trim();return m.jsx(gt,{styles:t})}const Aa=({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(d=>{d.name&&d.defaultValue!==void 0&&(r[d.name]=d.defaultValue)}),{...r,...o,...t,...n?{locale:n}:{}}},Oa=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ir(e){var o,i,s,u,d,C,E,v,R;const t=$i({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...qn(),...e.customComponents||[]].reduce((O,{component:x,...w})=>({...O,[w.name]:{component:x,...Xt(w)}}),{}),r={content:Oa({content:e.content,data:e.data}),localState:void 0,rootState:Aa({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...qn(),...e.customComponents||[]].reduce((O,{component:x,...w})=>({...O,[w.name]:Xt(w)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return m.jsxs(Z.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?m.jsx(m.Fragment,{children:m.jsx(Jt,{scriptStr:t})}):null,m.jsx(m.Fragment,{children:m.jsx(Ta,{contentId:(s=r.content)==null?void 0:s.id,cssCode:(d=(u=r.content)==null?void 0:u.data)==null?void 0:d.cssCode,customFonts:(E=(C=r.content)==null?void 0:C.data)==null?void 0:E.customFonts})}),m.jsx(vt,{blocks:(R=(v=r.content)==null?void 0:v.data)==null?void 0:R.blocks,context:r,registeredComponents:n,linkComponent:e.linkComponent})]})}function Gr(e){var i,s;const t=Li({canTrack:ut(e.canTrack),content:e.content}),n=function(){var d;return Wi(st(e.content).map(C=>({id:C.testVariationId,testRatio:C.testRatio})),((d=e.content)==null?void 0:d.id)||"")},r=function(){return st(e.content).map(d=>`.variant-${d.testVariationId} { display: none; } `).join("")},o=function(){var d;return t?{...e.content,testVariationId:(d=e.content)==null?void 0:d.id}:gi({item:e.content,canTrack:ut(e.canTrack)})};return m.jsxs(m.Fragment,{children:[!e.__isNestedRender&&he!=="reactNative"?m.jsx(m.Fragment,{children:m.jsx(Jt,{scriptStr:_i()})}):null,t?m.jsxs(m.Fragment,{children:[m.jsx(gt,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:r()}),m.jsx(Jt,{scriptStr:n()}),(s=st(e.content))==null?void 0:s.map(u=>m.jsx(ir,{content:u,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},u.testVariationId))]}):null,m.jsx(ir,{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 Ra=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return un({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{X.error("Could not fetch symbol content: ",n)})};async function Xr(e){var r,o,i,s,u;const t=function(){var C,E;return[e.attributes[ft()],"builder-symbol",(C=e.symbol)!=null&&C.inline?"builder-inline-symbol":void 0,(E=e.symbol)!=null&&E.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((r=e.symbol)==null?void 0:r.content)||await Ra({symbol:e.symbol,builderContextValue:e.builderContext});return m.jsx("div",{...e.attributes,className:t(),children:m.jsx(Gr,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(o=e.builderBlock)==null?void 0:o.id},customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(s=n==null?void 0:n.data)==null?void 0:s.state},model:(u=e.symbol)==null?void 0:u.model,content:n,linkComponent:e.builderLinkComponent})})}const ar={};function Pa(e){if(K()){Object.assign(ar,e);const t={type:"builder.settingsChange",data:ar};parent.postMessage(t,"*")}}const Na=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:ln(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await un(n)}};exports.Blocks=vt;exports.Columns=Sr;exports.ContentVariants=Gr;exports.Symbol=Xr;exports.Text=Tr;exports._processContentResult=Br;exports._track=_r;exports.createEditorListener=Kr;exports.createRegisterComponentMessage=Fi;exports.evaluate=mt;exports.fastClone=qe;exports.fetch=Nr;exports.fetchBuilderProps=Na;exports.fetchEntries=Ur;exports.fetchOneEntry=un;exports.getBlockActions=qo;exports.getBlockProperties=br;exports.getBuilderSearchParams=ln;exports.getClassPropName=ft;exports.getDefaultCanTrack=ut;exports.getInteractionPropertiesForEvent=ma;exports.getSrcSet=ai;exports.init=Pr;exports.isBrowser=K;exports.isEditing=pt;exports.isEmptyElement=po;exports.isJsScript=Oi;exports.isPreviewing=ea;exports.logger=X;exports.register=$r;exports.registerInsertMenu=va;exports.setEditorSettings=Pa;exports.setupBrowserForEditing=Hr;exports.subscribeToEditor=xa;exports.track=pa;exports.triggerAnimation=Ca;
|
|
188
|
+
`.trim();return m.jsx(gt,{styles:t})}const Aa=({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(d=>{d.name&&d.defaultValue!==void 0&&(r[d.name]=d.defaultValue)}),{...r,...o,...t,...n?{locale:n}:{}}},Oa=({content:e,data:t})=>e?{...e,data:{...e==null?void 0:e.data,...t},meta:e==null?void 0:e.meta}:void 0;function ir(e){var o,i,s,u,d,C,E,v,R;const t=$i({variationId:(o=e.content)==null?void 0:o.testVariationId,contentId:(i=e.content)==null?void 0:i.id}),n=[...qn(),...e.customComponents||[]].reduce((O,{component:x,...w})=>({...O,[w.name]:{component:x,...Xt(w)}}),{}),r={content:Oa({content:e.content,data:e.data}),localState:void 0,rootState:Aa({content:e.content,data:e.data,locale:e.locale}),rootSetState:void 0,context:e.context||{},apiKey:e.apiKey,apiVersion:e.apiVersion,componentInfos:[...qn(),...e.customComponents||[]].reduce((O,{component:x,...w})=>({...O,[w.name]:Xt(w)}),{}),inheritedStyles:{},BlocksWrapper:e.blocksWrapper||"div",BlocksWrapperProps:e.blocksWrapperProps||{}};return m.jsxs(Z.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?m.jsx(m.Fragment,{children:m.jsx(Jt,{scriptStr:t})}):null,m.jsx(m.Fragment,{children:m.jsx(Ta,{contentId:(s=r.content)==null?void 0:s.id,cssCode:(d=(u=r.content)==null?void 0:u.data)==null?void 0:d.cssCode,customFonts:(E=(C=r.content)==null?void 0:C.data)==null?void 0:E.customFonts})}),m.jsx(vt,{blocks:(R=(v=r.content)==null?void 0:v.data)==null?void 0:R.blocks,context:r,registeredComponents:n,linkComponent:e.linkComponent})]})}function Gr(e){var i,s;const t=Li({canTrack:ut(e.canTrack),content:e.content}),n=function(){var d;return Wi(st(e.content).map(C=>({id:C.testVariationId,testRatio:C.testRatio})),((d=e.content)==null?void 0:d.id)||"")},r=function(){return st(e.content).map(d=>`.variant-${d.testVariationId} { display: none; } `).join("")},o=function(){var d;return t?{...e.content,testVariationId:(d=e.content)==null?void 0:d.id}:gi({item:e.content,canTrack:ut(e.canTrack)})};return m.jsxs(m.Fragment,{children:[!e.__isNestedRender&&he!=="reactNative"?m.jsx(m.Fragment,{children:m.jsx(Jt,{scriptStr:_i()})}):null,t?m.jsxs(m.Fragment,{children:[m.jsx(gt,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:r()}),m.jsx(Jt,{scriptStr:n()}),(s=st(e.content))==null?void 0:s.map(u=>m.jsx(ir,{content:u,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},u.testVariationId))]}):null,m.jsx(ir,{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 Ra=async({builderContextValue:e,symbol:t})=>{if(t!=null&&t.model&&(e!=null&&e.apiKey))return un({model:t.model,apiKey:e.apiKey,apiVersion:e.apiVersion,...(t==null?void 0:t.entry)&&{query:{id:t.entry}}}).catch(n=>{X.error("Could not fetch symbol content: ",n)})};async function Xr(e){var r,o,i,s,u;const t=function(){var C,E;return[e.attributes[ft()],"builder-symbol",(C=e.symbol)!=null&&C.inline?"builder-inline-symbol":void 0,(E=e.symbol)!=null&&E.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((r=e.symbol)==null?void 0:r.content)||await Ra({symbol:e.symbol,builderContextValue:e.builderContext});return m.jsx("div",{...e.attributes,className:t(),children:m.jsx(Gr,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(o=e.builderBlock)==null?void 0:o.id},customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(s=n==null?void 0:n.data)==null?void 0:s.state},model:(u=e.symbol)==null?void 0:u.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}const ar={};function Pa(e){if(K()){Object.assign(ar,e);const t={type:"builder.settingsChange",data:ar};parent.postMessage(t,"*")}}const Na=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:ln(e.searchParams||((i=e.url)==null?void 0:i.searchParams)||e.options)};return{apiKey:n.apiKey,model:n.model,content:await un(n)}};exports.Blocks=vt;exports.Columns=Sr;exports.ContentVariants=Gr;exports.Symbol=Xr;exports.Text=Tr;exports._processContentResult=Br;exports._track=_r;exports.createEditorListener=Kr;exports.createRegisterComponentMessage=Fi;exports.evaluate=mt;exports.fastClone=qe;exports.fetch=Nr;exports.fetchBuilderProps=Na;exports.fetchEntries=Ur;exports.fetchOneEntry=un;exports.getBlockActions=qo;exports.getBlockProperties=br;exports.getBuilderSearchParams=ln;exports.getClassPropName=ft;exports.getDefaultCanTrack=ut;exports.getInteractionPropertiesForEvent=ma;exports.getSrcSet=ai;exports.init=Pr;exports.isBrowser=K;exports.isEditing=pt;exports.isEmptyElement=po;exports.isJsScript=Oi;exports.isPreviewing=ea;exports.logger=X;exports.register=$r;exports.registerInsertMenu=va;exports.setEditorSettings=Pa;exports.setupBrowserForEditing=Hr;exports.subscribeToEditor=xa;exports.track=pa;exports.triggerAnimation=Ca;
|
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-e0cb789c.cjs"),e=require("./bundle-8abf9251.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-28ff24f9.cjs");require("next/navigation");require("lru-cache");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 { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l,
|
|
1
|
+
import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-91b3973b.js";
|
|
2
|
+
import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-49ee510b.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-f29a4a48.js";
|
|
6
6
|
import "next/navigation";
|
|
7
7
|
import "lru-cache";
|
|
8
8
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-
|
|
1
|
+
"use client";"use strict";const t=require("react/jsx-runtime"),a=require("./bundle-e917fcc7.cjs"),r=require("react"),D=require("./USE_SERVER_BUNDLE-6860cf7c.cjs"),V=require("next/navigation");function C(e){return t.jsx(t.Fragment,{children:a.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(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}function H(e){return t.jsx(C,{attributes:{...e.attributes,[a.getClassPropName()]:`${e.link?"":"builder-button"} ${e.attributes[a.getClassPropName()]||""}`,...e.link?{href:e.link,target:e.openLinkInNewTab?"_blank":void 0,role:"link"}:{role:"button"}},TagName:e.link?e.builderLinkComponent||"a":"button",actionAttributes:{},children:e.text})}function U(e){return t.jsx(C,{TagName:e.Wrapper,attributes:a.getBlockProperties({block:e.block,context:e.context}),actionAttributes:a.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 $(e){return t.jsx(e.Wrapper,{...e.wrapperProps,attributes:e.includeBlockProps?{...a.getBlockProperties({block:e.block,context:e.context}),...a.getBlockActions({block:e.block,rootState:e.context.rootState,rootSetState:e.context.rootSetState,localState:e.context.localState,context:e.context.context})}:{},children:e.children})}function O(e){function l(){var o;return"builder-blocks"+((o=e.blocks)!=null&&o.length?"":" no-blocks")}function g(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}function x(){var o,m;a.isEditing()&&!((o=e.blocks)!=null&&o.length)&&((m=window.parent)==null||m.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:e.path}},"*"))}return t.jsxs(t.Fragment,{children:[t.jsx(e.BlocksWrapper,{className:l()+" props-blocks-wrapper-7354e098","builder-path":e.path,"builder-parent-id":e.parent,style:e.styleProp,onClick:o=>g(),onMouseEnter:o=>x(),onKeyPress:o=>g(),...e.BlocksWrapperProps,children:e.children}),t.jsx("style",{children:`.props-blocks-wrapper-7354e098 {
|
|
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 i, Fragment as h, jsxs as E } from "react/jsx-runtime";
|
|
3
|
-
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-
|
|
3
|
+
import { i as p, g as H, a as $, b as O, c as w, d as R, e as ee, f as P, h as V, _ as D, j as te, l as ne, k as ie, t as ae, m as U, n as ce, o as re, r as le, s as oe, p as de, q as se, u as ue } from "./bundle-35759433.js";
|
|
4
4
|
import { useRef as T, useState as x, useEffect as b, createContext as me, createElement as ge } from "react";
|
|
5
|
-
import { p as he } from "./USE_SERVER_BUNDLE-
|
|
5
|
+
import { p as he } from "./USE_SERVER_BUNDLE-6a09d70e.js";
|
|
6
6
|
import { useRouter as be } from "next/navigation";
|
|
7
7
|
function J(e) {
|
|
8
8
|
return /* @__PURE__ */ i(h, { children: p(e.TagName) ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ i(h, { children: typeof e.TagName == "string" ? /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ i(h, { children: /* @__PURE__ */ i(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-e917fcc7.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
|
-
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-d012a153.js";
|
|
4
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-6ecc05ac.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) {
|
|
@@ -2233,7 +2233,7 @@ function isFromTrustedHost(e, t) {
|
|
|
2233
2233
|
const n = new URL(t.origin), o = n.hostname;
|
|
2234
2234
|
return (e || DEFAULT_TRUSTED_HOSTS).findIndex((r) => r.startsWith("*.") ? o.endsWith(r.slice(1)) : r === o) > -1;
|
|
2235
2235
|
}
|
|
2236
|
-
const SDK_VERSION = "0.14.
|
|
2236
|
+
const SDK_VERSION = "0.14.3", registry = {};
|
|
2237
2237
|
function register(e, t) {
|
|
2238
2238
|
let n = registry[e];
|
|
2239
2239
|
if (n || (n = registry[e] = []), n.push(t), isBrowser()) {
|
|
@@ -2741,7 +2741,9 @@ async function Symbol$1(e) {
|
|
|
2741
2741
|
},
|
|
2742
2742
|
model: (s = e.symbol) == null ? void 0 : s.model,
|
|
2743
2743
|
content: n,
|
|
2744
|
-
linkComponent: e.builderLinkComponent
|
|
2744
|
+
linkComponent: e.builderLinkComponent,
|
|
2745
|
+
blocksWrapper: "div",
|
|
2746
|
+
contentWrapper: "div"
|
|
2745
2747
|
}
|
|
2746
2748
|
) });
|
|
2747
2749
|
}
|
|
@@ -2779,7 +2781,7 @@ const fetchBuilderProps = async (e) => {
|
|
|
2779
2781
|
export {
|
|
2780
2782
|
track as A,
|
|
2781
2783
|
Blocks as B,
|
|
2782
|
-
|
|
2784
|
+
Columns as C,
|
|
2783
2785
|
subscribeToEditor as D,
|
|
2784
2786
|
fetchBuilderProps as E,
|
|
2785
2787
|
_processContentResult as F,
|
|
@@ -2809,7 +2811,7 @@ export {
|
|
|
2809
2811
|
triggerAnimation as t,
|
|
2810
2812
|
fetch$1 as u,
|
|
2811
2813
|
init as v,
|
|
2812
|
-
|
|
2814
|
+
ContentVariants as w,
|
|
2813
2815
|
register as x,
|
|
2814
2816
|
setEditorSettings as y,
|
|
2815
2817
|
getBuilderSearchParams as z
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const
|
|
1
|
+
"use strict";const jsxRuntime=require("react/jsx-runtime");require("react");const lruCache=require("lru-cache"),USE_CLIENT_BUNDLE=require("./USE_CLIENT_BUNDLE-516849e4.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":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"}function isIframe(){return isBrowser()&&window.self!==window.top}function isEditing(){return isIframe()&&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"?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;
|
|
@@ -171,7 +171,7 @@ output;
|
|
|
171
171
|
)`,getUpdateVariantVisibilityScript=({contentId:e,variationId:t})=>`window.${UPDATE_VARIANT_VISIBILITY_SCRIPT_FN_NAME}(
|
|
172
172
|
"${t}", "${e}", ${isHydrationTarget}
|
|
173
173
|
)`;function InlinedScript(e){return jsxRuntime.jsx("script",{dangerouslySetInnerHTML:{__html:e.scriptStr},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.
|
|
174
|
-
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}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},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)},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):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:d,omit:h,offset:m,cacheSeconds:f,staleCacheSeconds:g,sort:l,includeUnpublished:u}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const b=t!==1,p=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(p.searchParams.set("apiKey",i),p.searchParams.set("limit",String(t)),p.searchParams.set("noTraverse",String(b)),p.searchParams.set("includeRefs",String(!0)),s&&p.searchParams.set("locale",s),a&&p.searchParams.set("enrich",String(a)),p.searchParams.set("omit",h||"meta.componentsUsed"),d&&p.searchParams.set("fields",d),Number.isFinite(m)&&m>-1&&p.searchParams.set("offset",String(Math.floor(m))),typeof u=="boolean"&&p.searchParams.set("includeUnpublished",String(u)),f&&isPositiveNumber(f)&&p.searchParams.set("cacheSeconds",String(f)),g&&isPositiveNumber(g)&&p.searchParams.set("staleCacheSeconds",String(g)),l){const y=flatten({sort:l});for(const x in y)p.searchParams.set(x,JSON.stringify(y[x]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},C=flatten(S);for(const y in C)p.searchParams.set(y,String(C[y]));if(n&&p.searchParams.set("userAttributes",JSON.stringify(n)),o){const y=flatten({query:o});for(const x in y)p.searchParams.set(x,JSON.stringify(y[x]))}return p},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 fetch$1(t.href)).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(){return!isBrowser()||isEditing()?!1:location.search.indexOf("builder.preview=")!==-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.1",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||[],d=r.data.id,h=new Function(s);let m,f=null;try{m=h.apply(null,c)}catch(g){f=g}f?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):m&&typeof m.then=="function"?m.then(g=>{var l;(l=window.parent)==null||l.postMessage({type:"builder.evaluateResult",data:{id:d,result:g}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:m,id:d}},"*");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}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";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 ${camelCaseToKebabCase(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+=`
|
|
174
|
+
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}},{})}const DEFAULT_API_VERSION="v3",BUILDER_SEARCHPARAMS_PREFIX="builder.",BUILDER_OPTIONS_PREFIX="options.",convertSearchParamsToQueryObject=e=>{const t={};return e.forEach((n,o)=>{t[o]=n}),t},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)},normalizeSearchParams=e=>e instanceof URLSearchParams?convertSearchParamsToQueryObject(e):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:d,omit:h,offset:m,cacheSeconds:f,staleCacheSeconds:g,sort:l,includeUnpublished:u}=e;if(!i)throw new Error("Missing API key");if(!["v3"].includes(c))throw new Error(`Invalid apiVersion: expected 'v3', received '${c}'`);const b=t!==1,p=new URL(`https://cdn.builder.io/api/${c}/content/${r}`);if(p.searchParams.set("apiKey",i),p.searchParams.set("limit",String(t)),p.searchParams.set("noTraverse",String(b)),p.searchParams.set("includeRefs",String(!0)),s&&p.searchParams.set("locale",s),a&&p.searchParams.set("enrich",String(a)),p.searchParams.set("omit",h||"meta.componentsUsed"),d&&p.searchParams.set("fields",d),Number.isFinite(m)&&m>-1&&p.searchParams.set("offset",String(Math.floor(m))),typeof u=="boolean"&&p.searchParams.set("includeUnpublished",String(u)),f&&isPositiveNumber(f)&&p.searchParams.set("cacheSeconds",String(f)),g&&isPositiveNumber(g)&&p.searchParams.set("staleCacheSeconds",String(g)),l){const y=flatten({sort:l});for(const x in y)p.searchParams.set(x,JSON.stringify(y[x]))}const S={...getBuilderSearchParamsFromWindow(),...normalizeSearchParams(e.options||{})},C=flatten(S);for(const y in C)p.searchParams.set(y,String(C[y]));if(n&&p.searchParams.set("userAttributes",JSON.stringify(n)),o){const y=flatten({query:o});for(const x in y)p.searchParams.set(x,JSON.stringify(y[x]))}return p},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 fetch$1(t.href)).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(){return!isBrowser()||isEditing()?!1:location.search.indexOf("builder.preview=")!==-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.3",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||[],d=r.data.id,h=new Function(s);let m,f=null;try{m=h.apply(null,c)}catch(g){f=g}f?(i=window.parent)==null||i.postMessage({type:"builder.evaluateError",data:{id:d,error:f.message}},"*"):m&&typeof m.then=="function"?m.then(g=>{var l;(l=window.parent)==null||l.postMessage({type:"builder.evaluateResult",data:{id:d,result:g}},"*")}).catch(console.error):(a=window.parent)==null||a.postMessage({type:"builder.evaluateResult",data:{result:m,id:d}},"*");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}const camelCaseToKebabCase=e=>e?e.replace(/([A-Z])/g,t=>`-${t[0].toLowerCase()}`):"";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 ${camelCaseToKebabCase(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+=`
|
|
175
175
|
@font-face {
|
|
176
176
|
font-family: "${t}";
|
|
177
177
|
src: local("${n}"), url('${o}') format('woff2');
|
|
@@ -205,4 +205,4 @@ ${getFontCss({customFonts:e.customFonts})}
|
|
|
205
205
|
text-align: inherit;
|
|
206
206
|
font-family: inherit;
|
|
207
207
|
}
|
|
208
|
-
`.trim();return jsxRuntime.jsx(InlinedStyles,{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,d,h,m,f;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:l,...u})=>({...g,[u.name]:{component:l,...serializeComponentInfo(u)}}),{}),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:l,...u})=>({...g,[u.name]:serializeComponentInfo(u)}),{}),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(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:t})}):null,jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ContentStyles,{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:(h=(d=o.content)==null?void 0:d.data)==null?void 0:h.customFonts})}),jsxRuntime.jsx(Blocks,{blocks:(f=(m=o.content)==null?void 0:m.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function ContentVariants(e){var i,a;const t=checkShouldRenderVariants({canTrack:getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var c;return getUpdateCookieAndStylesScript(getVariants(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((c=e.content)==null?void 0:c.id)||"")},o=function(){return getVariants(e.content).map(c=>`.variant-${c.testVariationId} { display: none; } `).join("")},r=function(){var c;return t?{...e.content,testVariationId:(c=e.content)==null?void 0:c.id}:handleABTestingSync({item:e.content,canTrack:getDefaultCanTrack(e.canTrack)})};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.__isNestedRender&&TARGET!=="reactNative"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:getScriptString()})}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:o()}),jsxRuntime.jsx(InlinedScript,{scriptStr:n()}),(a=getVariants(e.content))==null?void 0:a.map(s=>jsxRuntime.jsx(ContentComponent,{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,jsxRuntime.jsx(ContentComponent,{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 o,r,i,a,s;const t=function(){var d,h;return[e.attributes[getClassPropName()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(h=e.symbol)!=null&&h.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return jsxRuntime.jsx("div",{...e.attributes,className:t(),children:jsxRuntime.jsx(ContentVariants,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent})})}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.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;
|
|
208
|
+
`.trim();return jsxRuntime.jsx(InlinedStyles,{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,d,h,m,f;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:l,...u})=>({...g,[u.name]:{component:l,...serializeComponentInfo(u)}}),{}),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:l,...u})=>({...g,[u.name]:serializeComponentInfo(u)}),{}),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(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:t})}):null,jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(ContentStyles,{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:(h=(d=o.content)==null?void 0:d.data)==null?void 0:h.customFonts})}),jsxRuntime.jsx(Blocks,{blocks:(f=(m=o.content)==null?void 0:m.data)==null?void 0:f.blocks,context:o,registeredComponents:n,linkComponent:e.linkComponent})]})}function ContentVariants(e){var i,a;const t=checkShouldRenderVariants({canTrack:getDefaultCanTrack(e.canTrack),content:e.content}),n=function(){var c;return getUpdateCookieAndStylesScript(getVariants(e.content).map(d=>({id:d.testVariationId,testRatio:d.testRatio})),((c=e.content)==null?void 0:c.id)||"")},o=function(){return getVariants(e.content).map(c=>`.variant-${c.testVariationId} { display: none; } `).join("")},r=function(){var c;return t?{...e.content,testVariationId:(c=e.content)==null?void 0:c.id}:handleABTestingSync({item:e.content,canTrack:getDefaultCanTrack(e.canTrack)})};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[!e.__isNestedRender&&TARGET!=="reactNative"?jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx(InlinedScript,{scriptStr:getScriptString()})}):null,t?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(InlinedStyles,{id:`variants-styles-${(i=e.content)==null?void 0:i.id}`,styles:o()}),jsxRuntime.jsx(InlinedScript,{scriptStr:n()}),(a=getVariants(e.content))==null?void 0:a.map(s=>jsxRuntime.jsx(ContentComponent,{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,jsxRuntime.jsx(ContentComponent,{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 o,r,i,a,s;const t=function(){var d,h;return[e.attributes[getClassPropName()],"builder-symbol",(d=e.symbol)!=null&&d.inline?"builder-inline-symbol":void 0,(h=e.symbol)!=null&&h.dynamic||e.dynamic?"builder-dynamic-symbol":void 0].filter(Boolean).join(" ")},n=((o=e.symbol)==null?void 0:o.content)||await fetchSymbolContent({symbol:e.symbol,builderContextValue:e.builderContext});return jsxRuntime.jsx("div",{...e.attributes,className:t(),children:jsxRuntime.jsx(ContentVariants,{__isNestedRender:!0,apiVersion:e.builderContext.apiVersion,apiKey:e.builderContext.apiKey,context:{...e.builderContext.context,symbolId:(r=e.builderBlock)==null?void 0:r.id},customComponents:Object.values(e.builderComponents),data:{...(i=e.symbol)==null?void 0:i.data,...e.builderContext.localState,...(a=n==null?void 0:n.data)==null?void 0:a.state},model:(s=e.symbol)==null?void 0:s.model,content:n,linkComponent:e.builderLinkComponent,blocksWrapper:"div",contentWrapper:"div"})})}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.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-516849e4.cjs"),e=require("./bundle-e917fcc7.cjs");require("react/jsx-runtime");require("react");require("./USE_SERVER_BUNDLE-6860cf7c.cjs");require("next/navigation");require("lru-cache");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 { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-
|
|
2
|
-
import { B as l,
|
|
1
|
+
import { c as n, F as m, d as c, S as p, V as g } from "./USE_CLIENT_BUNDLE-6ecc05ac.js";
|
|
2
|
+
import { B as l, C as u, w as E, S, T as f, F as B, p as C, E as h, G as x, q as b, z as y, c as F, j as P, x as T, y as k, D as w, A as R } from "./bundle-35759433.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
-
import "./USE_SERVER_BUNDLE-
|
|
5
|
+
import "./USE_SERVER_BUNDLE-6a09d70e.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.3",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/builder/tree/main/packages/sdks/output/nextjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -66,15 +66,15 @@
|
|
|
66
66
|
"require": "./lib/browser/index.cjs"
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
-
"./edge": {
|
|
69
|
+
"./bundle/edge": {
|
|
70
70
|
"import": "./lib/edge/index.mjs",
|
|
71
71
|
"require": "./lib/edge/index.cjs"
|
|
72
72
|
},
|
|
73
|
-
"./node": {
|
|
73
|
+
"./bundle/node": {
|
|
74
74
|
"import": "./lib/node/index.mjs",
|
|
75
75
|
"require": "./lib/node/index.cjs"
|
|
76
76
|
},
|
|
77
|
-
"./browser": {
|
|
77
|
+
"./bundle/browser": {
|
|
78
78
|
"import": "./lib/browser/index.mjs",
|
|
79
79
|
"require": "./lib/browser/index.cjs"
|
|
80
80
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './button.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './columns.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './custom-code.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './embed.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './form.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './input.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './select.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './submit-button.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './fragment.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './image.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './img.js';
|