PageSourceSearch

https://uncrop.ai/_next/static/chunks/0_1kpa9u_h4zx.js

js uncrop.ai collected 2026-10-05 15:08:45 UTC 45,889 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,33968,e=>{"use strict";function t(e,t,a,s,i,r,n){try{var l=e[r](n),o=l.value}catch(e){return void a(e)}l.done?t(o):Promise.resolve(o).then(s,i)}e.s(["default",0,function(e){return function(){var a=this,s=arguments;return new Promise(function(i,r){var n=e.apply(a,s);function l(e){t(n,i,r,l,o,"next",e)}function o(e){t(n,i,r,l,o,"throw",e)}l(void 0)})}}])},118124,361653,e=>{"use strict";let t=(0,e.i(475254).default)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);e.s(["default",0,t],361653),e.s(["AlertCircle",0,t],118124)},469194,(e,t,a)=>{"use strict";var s=e.r(271645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=s.useState,n=s.useEffect,l=s.useLayoutEffect,o=s.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!i(e,a)}catch(e){return!0}}var c="u"<typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var a=t(),s=r({inst:{value:a,getSnapshot:t}}),i=s[0].inst,c=s[1];return l(function(){i.value=a,i.getSnapshot=t,u(i)&&c({inst:i})},[e,a,t]),n(function(){return u(i)&&c({inst:i}),e(function(){u(i)&&c({inst:i})})},[e]),o(a),a};a.useSyncExternalStore=void 0!==s.useSyncExternalStore?s.useSyncExternalStore:c},599898,(e,t,a)=>{"use strict";t.exports=e.r(469194)},486384,(e,t,a)=>{"use strict";var s=e.r(271645),i=e.r(599898),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},n=i.useSyncExternalStore,l=s.useRef,o=s.useEffect,u=s.useMemo,c=s.useDebugValue;a.useSyncExternalStoreWithSelector=function(e,t,a,s,i){var d=l(null);if(null===d.current){var p={hasValue:!1,value:null};d.current=p}else p=d.current;var f=n(e,(d=u(function(){function e(e){if(!o){if(o=!0,n=e,e=s(e),void 0!==i&&p.hasValue){var t=p.value;if(i(t,e))return l=t}return l=e}if(t=l,r(n,e))return t;var a=s(e);return void 0!==i&&i(t,a)?t:(n=e,l=a)}var n,l,o=!1,u=void 0===a?null:a;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,a,s,i]))[0],d[1]);return o(function(){p.hasValue=!0,p.value=f},[f]),c(f),f}},179849,(e,t,a)=>{"use strict";t.exports=e.r(486384)},350986,e=>{"use strict";let t,a,s;e.i(167225);var i,r=e.i(271645);let n=e=>{let t,a=new Set,s=(e,s)=>{let i="function"==typeof e?e(t):e;if(i!==t){let e=t;t=s?i:Object.assign({},t,i),a.forEach(a=>a(t,e))}},i=()=>t,r={setState:s,getState:i,subscribe:e=>(a.add(e),()=>a.delete(e)),destroy:()=>a.clear()};return t=e(s,i,r),r},{useSyncExternalStoreWithSelector:l}=e.i(179849).default,o=e=>{let t="function"==typeof e?e?n(e):n:e,a=(e,a)=>(function(e,t=e.getState,a){let s=l(e.subscribe,e.getState,e.getServerState||e.getState,t,a);return(0,r.useDebugValue)(s),s})(t,e,a);return Object.assign(a,t),a},{useGlobalState:u}=(i={dataSources:[],appFields:[]},t=(s=()=>i)?o(s):o,Object.keys(i),{useGlobalState:e=>[t((0,r.useCallback)(t=>t[e],[e])),(0,r.useCallback)(t=>a(e,t),[e])],getGlobalState:e=>t.getState()[e],setGlobalState:a=(e,a)=>{t.setState(t=>{var s;return{[e]:(s=t[e],"function"==typeof a?a(s):a)}})},subscribe:(e,a)=>{t.subscribe((t,s)=>{t[e]!==s[e]&&a(t[e])})}});e.s(["useGlobalState",0,u],350986)},240812,e=>{"use strict";var t=e.i(843476),a=e.i(989895),s=e.i(854056),i=e.i(118124),r=e.i(491816);e.s(["default",0,({children:e,options:n,isNarrow:l=!1,className:o=""})=>(0,t.jsxs)(a.Menu,{as:"div",className:`${o} relative`,children:[(0,t.jsx)(a.Menu.Button,{onClick:e=>e.stopPropagation(),className:"rounded-full focus:outline-none",children:e}),(0,t.jsx)(s.Transition,{as:"div",enter:"transition transform duration-100 ease-out",enterFrom:"opacity-0 scale-90",enterTo:"opacity-100 scale-100",leave:"transition transform duration-100 ease-in",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-90",children:(0,t.jsx)(a.Menu.Items,{anchor:"bottom end",className:`${l?"min-w-[120px] max-w-[200px] md:min-w-[120px]":"min-w-[180px] max-w-[200px] md:min-w-[140px]"} z-50 origin-top-right rtl:origin-top-left divide-y divide-gray-100 overflow-hidden overflow-y-auto rounded-md bg-white font-light shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none`,children:(0,t.jsx)("div",{className:"relative overflow-hidden px-1 py-1",children:n.map((e,s)=>(0,t.jsx)(a.Menu.Item,{disabled:e.disabled,children:({active:a})=>(0,t.jsxs)("button",{onClick:t=>{t.stopPropagation(),e.disabled||e?.triggerAction()},className:`${a?"bg-gray-100":""} ${e.disabled?"cursor-not-allowed opacity-50":""} group flex w-full items-center rounded-md px-2 py-2 text-sm text-gray-700 md:px-1 md:py-2`,children:[e.icon&&(0,t.jsx)("div",{className:"pe-2",children:e.icon})," ",(0,t.jsx)("div",{className:"flex-1 truncate text-start",title:e.title,children:e.title}),e.disabled&&e.disabledReason&&(0,t.jsx)(r.default,{placement:"right",title:e.disabledReason,
1children:(0,t.jsx)(i.AlertCircle,{className:"ms-2 h-4 w-4 cursor-pointer hover:text-gray-500"})})]})},s))})})})]})])},145177,e=>{"use strict";var t=e.i(618566),a=e.i(271645),s=e.i(672464),i=e.i(65328),r=e.i(715429),n=e.i(166628),l=e.i(892204),o=e.i(350986);e.s(["useAppBuilder",0,function(){let e=(0,s.useSetAtom)(n.genAppHeaderState),u=(0,s.useSetAtom)(n.genAppDescriptionState),c=(0,s.useSetAtom)(n.genAppBackgroundState),d=(0,s.useSetAtom)(n.genAppStyleState),p=(0,s.useSetAtom)(n.toolsState),f=(0,s.useSetAtom)(n.chatState),m=(0,s.useSetAtom)(n.headerState),h=(0,s.useSetAtom)(n.descriptionState),x=(0,s.useSetAtom)(n.backgroundState),g=(0,s.useSetAtom)(n.appStyleState);(0,s.useSetAtom)(n.appSettingsState);let y=(0,s.useSetAtom)(n.gptPromptState),b=(0,s.useSetAtom)(n.featuresState);(0,s.useSetAtom)(r.hasAppContextState);let v=(0,s.useSetAtom)(r.appContextItemsState),S=(0,s.useSetAtom)(n.examplesState),w=(0,s.useSetAtom)(n.welcomeMessageState),j=(0,s.useSetAtom)(n.inputLabelState),A=(0,s.useSetAtom)(n.inputPlaceholderState),k=(0,s.useSetAtom)(n.isInputCollapsedState),C=(0,s.useSetAtom)(n.isInputHiddenState),I=(0,s.useSetAtom)(n.isMultiStepInputState),N=(0,s.useSetAtom)(n.inputStepsState),P=(0,s.useSetAtom)(n.ctaMessageState),T=(0,s.useSetAtom)(n.ctaButtonState),O=(0,s.useSetAtom)(n.ctaLinkState),M=(0,s.useSetAtom)(n.fieldsState),E=(0,s.useSetAtom)(n.appBlocksState),_=(0,s.useSetAtom)(n.appGenerationPromptState),B=(0,s.useSetAtom)(r.appOutputState),D=(0,s.useSetAtom)(r.appInputState),L=(0,s.useSetAtom)(n.initialPromptState);(0,s.useSetAtom)(r.isPublishedState),(0,s.useSetAtom)(r.appLinkState);let F=(0,s.useSetAtom)(r.selectedPanelState),$=(0,s.useSetAtom)(r.showDataSourcesDialogState);(0,s.useSetAtom)(r.sidebarDockedState),(0,s.useSetAtom)(r.showBuilderPanelState);let R=(0,s.useSetAtom)(r.unsyncedContextItemsState),U=(0,s.useSetAtom)(r.isResultsInEditModeState);(0,t.usePathname)();let[V,z]=(0,o.useGlobalState)("dataSources"),[G,H]=(0,o.useGlobalState)("appFields"),q=(0,s.useSetAtom)(n.appBundleState),K=(0,s.useSetAtom)(n.appErrorsState),W=(0,s.useSetAtom)(n.versionIdState),Y=(0,a.useCallback)(t=>{t&&(e(t.header),u(t.description),c(t.background||""),p(t.tools||[]),f(t.chatSettings||void 0))},[e,u,c,d,p,f]);return{setGenAppProps:Y,setAppProps:(0,a.useCallback)(e=>{if(e){m(e.header),h(e.description),x(e.background),y(e.gptPrompt),b(e.features||[]),S(e.examples||[]),w(e.welcomeMessage||""),j(e.inputLabel||""),A(e.inputPlaceholder||n.defaultInputPlaceholder),k(e.isInputCollapsed||!1),C(e.isInputHidden||!1),I(e.isMultiStepInput||!1),N(e.inputSteps||[]),P(e.ctaMessage||""),T(e.ctaButton||""),O(e.ctaLink||""),M(e.fields||[]),H(e.fields||[]);let t=e.blocks||[];0===t.length&&e.gptPrompt&&(t=(0,l.migrateOldPromptToBlocks)(e.gptPrompt)),E(t)}},[m,h,x,y,b,S,w,j,A,P,T,O,M,H,E,C,k,I,N]),resetBuilder:()=>{F(i.PanelState.MAIN),$(!1),U(!1),q(null),K([]),W(void 0),L(void 0),m(n.defaultHeader),h(n.defaultDesc),x(""),b([]),v(null),y(""),S([]),w(""),j(""),A(n.defaultInputPlaceholder),P(""),T(""),O(""),g(null),B(void 0),D(""),_(""),M([]),E([]),R(null),z([]),H([])}}}])},900465,e=>{"use strict";let t=(0,e.i(475254).default)("arrow-right-left",[["path",{d:"m16 3 4 4-4 4",key:"1x1c3m"}],["path",{d:"M20 7H4",key:"zbl0bi"}],["path",{d:"m8 21-4-4 4-4",key:"h9nckh"}],["path",{d:"M4 17h16",key:"g4d7ey"}]]);e.s(["default",0,t])},734571,510296,827073,e=>{"use strict";var t=e.i(271645),a=e.i(743784),s=a.isBrowser?t.useLayoutEffect:t.useEffect;e.s(["default",0,s],510296);var i={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};let r=a.isBrowser&&void 0!==window.ResizeObserver?function(){var e=(0,t.useState)(null),a=e[0],r=e[1],n=(0,t.useState)(i),l=n[0],o=n[1],u=(0,t.useMemo)(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect;o({x:t.x,y:t.y,width:t.width,height:t.height,top:t.top,left:t.left,bottom:t.bottom,right:t.right})}})},[]);return s(function(){if(a)return u.observe(a),function(){u.disconnect()}},[a]),[r,l]}:function(){return[a.noop,i]};e.s(["default",0,r],827073),e.s(["useMeasure",0,r],734571)},87316,361277,e=>{"use strict";let t=(0,e.i(475254).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["default",0,t],361277),e.s(["Calendar",0,t],87316)},503783,e=>{"use strict";let t=(0,e.i(475254).default)("party-popper",[["path",{d:"M5.8 11.3 2 22l10.7-3.79",key:"gwxi1d"}],["path",{d:"M4 3h.01",key:"1vcuye"}],["path",{d:"M22 8h.01",key:"1mrtc2"}],["path",{d:"M15 2h.01",key:"1cjtqr"}],["path",{d:"M22 20h.01",key:"1mrys2"}],["path",{d:"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10",key:"hbicv8"}],["path",{d:"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17",key:"1i94pl"}],["path",{d:"m11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7",key:"1cofks"}],["path",{d:"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z",key:"4kbmks"}]]);e.s(["default",0,t])},3303,(e,t,a)=>{t.exports=e.r(479520)},662031,368570,e=>{"use strict";let t=(0,e.i(475254).default)("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);e.s(["default",0,t],368570),e.s(["Share2",0,t],662031)},357545,e=>{"use strict";var t=e.i(672464),a=e.i(166628),s=e.i(17508),i=e.i(383642),r=e.i(836242),n=e.i(271645),l=e.i(463585),o=e.i(22196);e.s(["useBuildGenApp",0,function(e){let{currentUser:u}=(0,i.useAuth)(),[c,d]=(0,t.useAtom)(a.toolsState),[p,f]=(0,n.use
1State)(!1),m=(0,t.useSetAtom)(l.myAppIdsState);return{handleAddMyTool:async t=>{var a;a={toolId:t.id,title:t.title,description:t.description,path:(0,o.getUniqueSlug)(t.path||t.title,c.map(e=>e.path)),status:"draft",originalToolId:t.id},d(t=>{let s=[...t,a];return e?.debouncedSaveGenApp({tools:s}),s}),await e?.forceSaveChangesGenApp()},duplicateTemplate:async e=>{if(u)try{f(!0);let t=await fetch(`/api/apps/${e}/template/duplicate`,{method:"POST",headers:await (0,s.getAuthorizationHeaders)(u)});t.ok||(0,r.showErrorMessage)("Failed to duplicate Generative App template, please try again later");let a=await t.json();return m(e=>[...e,a.genAppId]),a.genAppId}finally{f(!1)}},createApp:async(e,t,a,i,n,l,o)=>{try{f(!0);let c=await fetch("/api/apps/create",{method:"POST",headers:await (0,s.getAuthorizationHeaders)(u),body:JSON.stringify({genApp:{header:"My Space App",description:"Welcome to my AI app, trained on my knowledge.\nChoose what you need and let's get started!",background:"#ffffff",tools:[]},prompt:e,modelId:t,selectedIntegrations:a,enableCustomIntegrations:i,language:n,languageName:l,attachments:o})});return c.ok||(0,r.showErrorMessage)("Failed to create Space App, please try again later"),(await c.json()).genAppId}finally{f(!1)}},isSaving:p}}])},554956,e=>{"use strict";let t=(0,e.i(475254).default)("linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);e.s(["default",0,t])},551348,e=>{"use strict";var t=e.i(554956);e.s(["Linkedin",()=>t.default])},378021,e=>{"use strict";var t=e.i(681885);e.s(["Twitter",()=>t.default])},711471,369384,e=>{"use strict";var t=e.i(271645),a=e.i(986098);e.s(["useWindowSize",()=>a.default],369384);var a=a;e.s(["useSetViewport",0,function(){let{width:e,height:s}=(0,a.default)();(0,t.useEffect)(()=>{var e;e=window.innerHeight,document.documentElement.style.setProperty("--vh",e+"px")},[s])}],711471)},309095,(e,t,a)=>{"u">typeof self?self:e.e,t.exports=function(e){var t=[function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(e[s]=a[s])}return e},i=function(){function e(e,t){for(var a=0;a<t.length;a++){var s=t[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}return function(t,a,s){return a&&e(t.prototype,a),s&&e(t,s),t}}(),r=a(1),n=c(r),l=c(a(2)),o=c(a(5)),u=a(6);function c(e){return e&&e.__esModule?e:{default:e}}var d=function(){function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function");var a=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),s=t.fields,i=t.type,r=t.isValid,n=t.disabled,l=t.filterKeyCodes,o=t.forceUppercase,c=t.value;o&&(c=c.toUpperCase()),a.state={value:c,fields:s,type:i,input:[],isValid:r,disabled:n,filterKeyCodes:l,defaultInputStyle:{fontFamily:"monospace",MozAppearance:"textfield",borderRadius:"6px",border:"1px solid",boxShadow:"0px 0px 10px 0px rgba(0,0,0,.10)",margin:"4px",paddingLeft:"8px",width:"36px",height:"42px",fontSize:"32px",boxSizing:"border-box"}};for(var d=0;d<Number(a.state.fields);d+=1)if(d<32){var p=a.state.value[d]||"";a.state.input.push(p)}return a.textInput=[],a.uuid=(0,u.uuidv4)(),a}return function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(e,r.Component),i(e,[{key:"UNSAFE_componentWillReceiveProps",value:function(e){this.setState({isValid:e.isValid,value:e.value,disabled:e.disabled})}},{key:"handleBlur",value:function(e){this.handleTouch(e.target.value)}},{key:"handleTouch",value:function(e){var t=this.props,a=t.touch,s=t.untouch,i=t.name;"function"==typeof a&&"function"==typeof s&&(""===e?a(i):s(i))}},{key:"handleChange",value:function(e){var t=this,a=this.props.filterChars,s=String(e.target.value);this.props.forceUppercase&&(s=s.toUpperCase()),"number"===this.state.type&&(s=s.replace(/[^\d]/g,""));var i=s=s.split("").filter(function(e){return!a.includes(e)}).join("");if(""!==s){var r=this.state.input.slice();s.length>1?s.split("").map(function(a,s){return Number(e.target.dataset.id)+s<t.props.fields&&(r[Number(e.target.dataset.id)+s]=a),!1}):r[Number(e.target.dataset.id)]=s,r.map(function(e,a){return t.textInput[a]&&(t.textInput[a].value=e),!1});var n=this.textInput[e.target.dataset.id<r.length?Number(e.target.dataset.id)+1:e.target.dataset.id];n&&(n.focus(),n.select()),i=r.join(""),this.setState({value:r.join(""),input:r})}this.props.onChange&&i&&this.props.onChange(i),this.handleTouch(i)}},{key:"handleKeyDown",value:function(e){var t=Number(e.target.dataset.id),a=this.textInput[t+1],s=this.textInput[t-1],i=void 0,r=void 0;switch(this.state.filterKeyCodes.length>0&&this.state.filterKeyCodes.map(function(t){if(t===e.keyCode)return e.preventDefault(),!0}),e.keyCode){case 8:e.preventDefault(),this.textInput[t].value="",(i=this.state.input.slice())[t]="",r=i.join(""),this.setState({value:r,input:i}),""===this.textInput[t].value&&s&&(s.focus(),s.select()),this.props.onChange&&this.props.onChange(r);break;case 37:e.preventDefault(),s&&(s.focus(),s.select());break;case 39:e.preventDefault(),a&&(a.focus(),a.select());break;case 38:case 40:e.preventDefault();break;case 69:"number"===e.target.type&&e.preventDefault()}this.handleTouch(r)}},{key:"render",value:function(){var e=this,t=this.props,a=t.className,i=t.style,r=t.inputStyle,l=void 0===r?{}:r,u=t.inputStyleInvalid,c=void 0===u?{}
1:u,d=t.type,p=t.autoFocus,f=t.pattern,m=t.inputMode,h=this.state,x=h.disabled,g=h.input,y=h.isValid,b=h.defaultInputStyle,v={container:void 0===i?{}:i,input:y?l:c};return Object.assign(v.container,{display:"inline-block"}),a||0!==Object.keys(l).length||Object.assign(l,s({},b,{color:"black",backgroundColor:"white",borderColor:"lightgrey"})),a||0!==Object.keys(c).length||Object.assign(c,s({},b,{color:"#b94a48",backgroundColor:"#f2dede",borderColor:"#eed3d7"})),x&&Object.assign(v.input,{cursor:"not-allowed",color:"lightgrey",borderColor:"lightgrey",backgroundColor:"#efeff1"}),n.default.createElement("div",{className:(0,o.default)(a,"react-code-input"),style:v.container},g.map(function(t,a){return n.default.createElement("input",{ref:function(t){e.textInput[a]=t},id:e.uuid+"-"+a,"data-id":a,autoFocus:p&&0===a?"autoFocus":"",value:t,key:"input_"+a,type:d,min:0,max:9,maxLength:g.length===a+1?1:g.length,style:v.input,autoComplete:"off",onFocus:function(e){return e.target.select(e)},onBlur:function(t){return e.handleBlur(t)},onChange:function(t){return e.handleChange(t)},onKeyDown:function(t){return e.handleKeyDown(t)},disabled:x,"data-valid":y,pattern:f,inputMode:m})}))}}]),e}();d.defaultProps={autoFocus:!0,isValid:!0,disabled:!1,forceUppercase:!1,fields:4,value:"",type:"text",filterKeyCodes:[189,190],filterChars:["-","."]},d.propTypes={type:l.default.oneOf(["text","number","password","tel"]),fields:l.default.number,value:l.default.string,onChange:l.default.func,name:l.default.string,touch:l.default.func,untouch:l.default.func,className:l.default.string,isValid:l.default.bool,disabled:l.default.bool,style:l.default.object,inputStyle:l.default.object,inputStyleInvalid:l.default.object,autoFocus:l.default.bool,forceUppercase:l.default.bool,filterKeyCodes:l.default.array,filterChars:l.default.array,pattern:l.default.string,inputMode:l.default.oneOf(["verbatim","latin","latin-name","latin-prose","full-width-latin","kana","kana-name","katakana","numeric","tel","email","url"])},t.default=d},function(t,a){t.exports=e},function(e,t,a){e.exports=a(3)()},function(e,t,a){"use strict";var s=a(4);function i(){}e.exports=function(){function e(e,t,a,i,r,n){if(n!==s){var l=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var a={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return a.checkPropTypes=i,a.PropTypes=a,a}},function(e,t,a){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,a){var s;!function(){"use strict";var a={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var s=arguments[t];if(s){var r=typeof s;if("string"===r||"number"===r)e.push(s);else if(Array.isArray(s)&&s.length){var n=i.apply(null,s);n&&e.push(n)}else if("object"===r)for(var l in s)a.call(s,l)&&s[l]&&e.push(l)}}return e.join(" ")}void 0!==e&&e.exports?(i.default=i,e.exports=i):void 0===(s=(function(){return i}).apply(t,[]))||(e.exports=s)}()},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}],a={};function s(e){if(a[e])return a[e].exports;var i=a[e]={i:e,l:!1,exports:{}};return t[e].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=t,s.c=a,s.d=function(e,t,a){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},s.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(s.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(a,i,(function(t){return e[t]}).bind(null,i));return a}
1,s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="",s(s.s=0)}(e.r(271645))},540200,e=>{"use strict";var t=e.i(843476),a=e.i(522016),s=e.i(618566),i=e.i(271645),r=e.i(672464),n=e.i(262925),l=e.i(836242),o=e.i(128065),u=e.i(65328),c=e.i(591785),d=e.i(160282),p=e.i(172388),f=e.i(291340),m=e.i(145177),h=e.i(166628),x=e.i(894790),g=e.i(545924),y=e.i(803790),b=e.i(792723),v=e.i(334863),S=e.i(841970),w=e.i(303076),j=e.i(715429),A=e.i(541940);let k=({openNewWindow:e=!1,utmSource:a,builtWithLink:s="https://buildai.space"})=>(0,t.jsxs)("a",{className:"fixed bottom-[72px] right-2 flex items-center gap-1 rounded-full bg-gray-900 py-1 pl-1 pr-2 text-sm shadow-md md:bottom-4 md:right-4",style:{fontFamily:"Inter"},href:`${s}?utm_medium=powered_by&utm_source=${a}&utm_content=footer`,target:e?"_blank":"_self",children:[(0,t.jsx)("img",{src:"/logo_v2.png",alt:"buildai logo",className:"h-5 w-5"}),(0,t.jsxs)("div",{className:"text-white",children:["Built with ",(0,t.jsx)("span",{className:"font-bold",children:"BuildAI"})]})]}),C=["Generating your app...\nIt may take a few minutes"],I=({appId:e,publicAppLink:a,appStyle:n,initialData:l,isInIframe:u=!1,isEditPreview:c=!1,appSettings:d,dashboardConfig:p,slug:I})=>{(0,s.useRouter)();let[N,P]=(0,r.useAtom)(h.genAppStyleState),[T,O]=(0,r.useAtom)(h.genAppBackgroundState),{currentUser:M}=(0,g.useAppLevelAuth)(),E=(0,o.getClassByStyle)(T?.toLowerCase()==="#ffffff"?"light":N?.styleName),[_,B]=(0,r.useAtom)(h.genAppHeaderState),[D,L]=(0,r.useAtom)(h.genAppDescriptionState),{setGenAppProps:F}=(0,m.useAppBuilder)(),$=(0,r.useAtomValue)(j.showBuilderPanelState),R=(0,r.useAtomValue)(j.sidebarDockedState),[U,V]=(0,i.useState)(!1),{backToDefault:z}=(0,f.default)(),{refreshMemories:G}=(0,y.useAppUserMemories)(),H=(0,r.useAtomValue)(h.versionIdState),q=(0,r.useAtomValue)(h.appBundleLoadingState),{isLoading:K}=(0,w.useBuilderChat)();return(0,i.useEffect)(()=>{z(),G(),$crisp?.push(["do","chat:hide"])},[]),(0,i.useEffect)(()=>{l&&F(l),V(!0)},[l,F]),(0,i.useEffect)(()=>{n&&P(n)},[n,P]),(0,t.jsxs)("div",{className:`app-container space-app ${u?`${x.default.app_container_iframe}`:""} ${E}`,children:[(0,t.jsx)("div",{className:`app-container-inner flex h-full flex-col ${!u?"app-container-fill":""}`,children:(0,t.jsxs)("div",{className:"flex h-full w-full flex-1",children:[(0,t.jsx)("div",{className:"h-full w-full flex-1",children:c&&!q&&!H&&K?(0,t.jsx)("div",{className:"flex h-full w-full flex-col items-center justify-center text-gray-800",children:(!$||R)&&(0,t.jsx)(S.default,{style:"light",messages:C,appId:e})}):(0,t.jsx)(b.default,{appId:e,isEditPreview:c,pageName:I?.[0]},e)}),(0,t.jsx)(v.Toaster,{}),!c&&!!d?.enablePwaInstall&&!!n?.logoUrl&&(0,t.jsx)(A.default,{})]})}),!c&&!n?.hideBuildAI&&(0,t.jsx)("div",{className:"absolute bottom-0 right-0",children:(0,t.jsx)(k,{openNewWindow:!0,utmSource:"standalone_app",builtWithLink:d?.builtWithLink||void 0})})]})};var N=e.i(854878),P=e.i(854056),T=e.i(37727),O=e.i(348978);let M=({isOpen:e,setIsOpen:a,userInput:s,triggerAction:r})=>{let[n,l]=(0,i.useState)(!1);function o(){a(!1),l(!1)}return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.Transition,{as:"div",appear:!0,show:e,children:(0,t.jsxs)(N.Dialog,{as:"div",className:"relative z-50",onClose:o,children:[(0,t.jsx)(P.Transition.Child,{as:"div",className:"fixed inset-0 bg-black bg-opacity-25",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,t.jsx)(P.Transition.Child,{as:"div",enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,t.jsxs)(N.Dialog.Panel,{className:"w-full max-w-[700px] relative transform overflow-hidden rounded-2xl max-h-full bg-white p-10 text-left align-middle shadow-xl transition-all",children:[(0,t.jsx)("div",{onClick:o,className:"absolute right-4 top-4 m-2 p-2 rounded-full",children:(0,t.jsx)(T.X,{className:"cursor-pointer hover:bg-gray-200 h-8 w-8 text-gray-400"})}),(0,t.jsx)(N.Dialog.Title,{as:"h1",className:"text-3xl font-medium text-gray-900 text-center",children:"Out of AI Trip Plans"}),(0,t.jsx)("div",{className:"my-8 text-center",children:(0,t.jsx)("p",{className:"text-gray-700 text-xl mt-2",children:"Looks like you're all out of AI trip plans to run. But don't worry, you can always purchase more and keep the adventure going!"})}),(0,t.jsxs)("div",{className:"w-full md:flex md:flex-row gap-4 justify-center my-4",children:[(0,t.jsx)(O.default,{label:"2$ for 5 plans",className:"mt-4 md:m-0",onClick:()=>{r("2$")}}),(0,t.jsx)(O.default,{label:"5$ for 20 plans",className:"mt-4 md:m-0",onClick:()=>{r("5$")}})]})]})})})})]})})})};var E=e.i(551348),_=e.i(378021);let B=({isOpen:e,setIsOpen:a,userInput:s,appGenerationPrompt:r,triggerAction:n,generationsCount:l=0,showSpecialOffer:o=!1,app:u,isCheckout:c=!1})=>{let[d,p]=(0,i.useState)(!1);function f(){a(!1),p(!1)}return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(P.Transition,{as:"div",appear:!0,show:e,children:(0,t.jsxs)(N.Dialog,{as:"div",className:"relative z-50",onClose:f,children:[(0,t.jsx)(P.Transition.Child,{as:"div",className:"fixed inset-0 bg-black bg-opacity-25",enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"}),(0,t.jsx)("div",{className:"fixed inset-0 overflow-y-auto",children:(0,t.jsx)("div",{className:"flex min-h-full items-center justify-center p-4 text-center",children:(0,t.jsx)(P.Transition.Child,{as:"div",enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,t.jsxs)(N.Dialog.Panel,{className:"w-full max-w-[700px] relative transform overflow-hidden rounded-2xl max-h-full bg-white p-10 text-left align-middle shadow-xl transition-all",children:[(0,t.jsx)("div",{onClick:f,className:"absolute right-4 top-4 m-2 p-2 rounded-full",children:(0,t.jsx)(T.X,{className:"cursor-pointer hover:bg-gray-200 h-8 w-8 text-gray-400"})}),(0,t.jsx)(N.Dialog.Title,{as:"h1",className:"text-3xl font-medium text-gray-900 text-center",children:d?(0,t.jsx)("span",{children:"Thanks for your interest! We'll get back to you soon"}):o?(0,t.jsx)("span",{children:"Special Offer for AI Trip Plans"}):(0,t.jsx)("span",{children:"Free Daily Usage Limit Reached"})}),(0,t.jsx)("div",{className:"my-8 text-center",children:d?(0,t.jsxs)("p",{className:"text-gray-500",children:[(0,t.jsx)("br",{}),"Interested in building an AI app? Our platform"," ",(0,t.jsx)("a",{className:"font-bold",href:"https://buildai.space",rel:"noreferrer",children:"BuildAI"})," ","lets you do it in minutes, no coding skills required. Here's how y
1ou can"," ",(0,t.jsx)("a",{className:"font-bold",href:"https://buildai.space",rel:"noreferrer",children:"get started."}),";",(0,t.jsx)("br",{}),(0,t.jsx)("br",{}),"And make sure you follow us on social:",(0,t.jsxs)("div",{className:"flex flex-row justify-center items-center gap-8 mt-10",children:[(0,t.jsx)(_.Twitter,{className:"h-10 w-10 cursor-pointer hover:text-black",onClick:()=>{window.open("https://twitter.com/buildaispace")}}),(0,t.jsx)(E.Linkedin,{className:"h-10 w-10 cursor-pointer hover:text-black",onClick:()=>{window.open("https://www.linkedin.com/company/buildaispace/")}})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{className:"text-gray-400 text-xl",children:[o?(0,t.jsx)("span",{children:"Make the most out of your vacation with tailor made plans"}):(0,t.jsx)("span",{children:"Due to the awesomeness of this app, all of the free trials for the first 200 users have been claimed for the day."}),(0,t.jsx)("div",{children:"The app clock resets at 00:00 UTC"}),(0,t.jsx)("br",{})]}),(0,t.jsxs)("p",{className:"text-gray-700 text-xl mt-2",children:["If you're interested, you can purchase",(0,t.jsx)("br",{}),(0,t.jsx)("b",{children:"5 trip plan generations for only 2$"}),".",!c&&(0,t.jsx)("span",{children:" Please leave your email and we'll get back to you with more details:"})]})]})}),!d&&(0,t.jsxs)("div",{className:"w-full md:flex md:flex-row gap-4 justify-center my-4",children:[(0,t.jsx)(O.default,{label:"2$ for 5 plans",className:"mt-4 md:m-0",onClick:()=>{n("2$")}}),(0,t.jsx)(O.default,{label:"5$ for 20 plans",className:"mt-4 md:m-0",onClick:()=>{n("5$")}})]})]})})})})]})})})};var D=e.i(857592);let L=({isOpen:e,setIsOpen:a,appStyle:s})=>(0,t.jsx)(D.default,{isOpen:e,modalTitle:"Free Daily Usage Limit Reached",closeModal:function(){a(!1)},children:(0,t.jsxs)("div",{className:"my-8 text-center flex flex-col gap-2 items-center",children:[(0,t.jsxs)("p",{className:"text-gray-400 text-xl",children:["Due to the awesomeness of this app, all of the free trials have been claimed for the day. The app clock resets at 00:00 UTC. Meanwhile, you can check it out by running the examples!",(0,t.jsx)("br",{}),(0,t.jsx)("br",{})]}),(0,t.jsxs)("p",{className:"text-gray-700 text-xl",children:["✨ Ready to power up your business with AI? ✨",(0,t.jsx)("br",{}),"Check out BuildAI.space!"]}),(0,t.jsx)("p",{className:"text-gray-700 text-xl mt-4",children:(0,t.jsx)("b",{children:"Level up user engagement. Generate leads. Enhance the user experience."})}),(0,t.jsx)(O.default,{style:{color:s?.buttonTextColor||"#ffffff",backgroundColor:s?.buttonBackgroundColor||"#111827",borderColor:s?.buttonBackgroundColor||"#111827"},className:"mt-2",square:!0,onClick:()=>{window.open("https://buildai.space","_blank")},label:"Build your own AI app"})]})});var F=e.i(383642),$=e.i(711471),R=e.i(463585),U=e.i(294643);let V=({children:e})=>(0,t.jsx)(U.CopilotKit,{runtimeUrl:"/api/copilotkit",showDevConsole:!1,enableInspector:!1,children:e});var z=e.i(105215);e.i(167225);var G=e.i(17508),H=e.i(111837),q=e.i(309095),K=e.i(374276);let W=({className:e="",agreed:a,onChange:s})=>(0,t.jsxs)("div",{className:`flex flex-row gap-2 ${e}`,children:[(0,t.jsx)(K.default,{onChange:e=>{s(e.target.checked)},checked:a,className:"mt-[2px] self-start"}),(0,t.jsxs)("div",{children:['I agree to the "Builder Collaborator Account"'," ",(0,t.jsx)("a",{href:"https://www.buildai.space/terms-of-service",target:"_blank",rel:"noreferrer",className:"link_text font-semibold",children:"Terms of Service"})," ","and"," ",(0,t.jsx)("a",{href:"https://www.buildai.space/privacy-policy",target:"_blank",rel:"noreferrer",className:"link_text font-semibold",children:"Privacy Policy"})]})]}),Y=({isOpen:e,setIsOpen:a,appIdToClaim:n,appNameToClaim:o,skipCode:u=!1,requireBuilderCollaboratorAccount:c,onDone:d})=>{let{currentUser:p,isFirstLoad:f}=(0,F.useAuth)(),[m,h]=(0,i.useState)(""),[x,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[v,S]=(0,i.useState)(!1),w=(0,r.useSetAtom)(R.appsCountState),j=(0,s.useRouter)();async function A(){if(!u&&(!m||6!==m.length))return void(0,l.showErrorMessage)("Enter the code you received via email");if(c&&!v)return void(0,l.showErrorMessage)('Please read and agree to the "Builder Collaborator Account" Terms of Service and Privacy Policy');b(!0);let e=setTimeout(()=>{g(!0)},2e3);try{let e=await fetch(`/api/apps/${n}/claim`,{method:"POST",headers:await (0,G.getAuthorizationHeaders)(p),body:JSON.stringify({claimCode:m,agreedToTerms:v})});if(!e.ok)if(403===e.status)return void(0,l.showErrorMessage)("Invalid code","invali
1d-code");else throw Error("Something went wrong");w(e=>e+1),await j.replace("/apps"),(0,l.showInfoMessage)("Congrats! You've claimed the app!"),d?.()}catch(e){(0,l.showErrorMessage)("Something went wrong. Please try again later or contact us")}finally{e&&clearTimeout(e),g(!1),b(!1)}}return(0,t.jsxs)(D.default,{isOpen:e,closeModal:function(){x||y||a(!1)},modalTitle:`Claim '${o}' AI App`,ctaButtonLabel:x?"":"Claim it",cancelButtonLabel:x||y?"":"Cancel",showCloseButton:!x&&!y,triggerAction:A,ctaIsLoading:y,align:"left",children:[f&&(0,t.jsx)("div",{className:"flex h-[216px] flex-col items-center justify-center text-black",children:(0,t.jsx)(H.default,{})}),x&&(0,t.jsxs)("div",{className:"flex h-[216px] flex-col items-center justify-center text-black",children:["We're claiming the app for you...it might take up to 60 seconds",(0,t.jsx)(H.default,{})]}),!f&&!x&&(0,t.jsxs)("div",{className:"pb-6 text-gray-800",children:[(0,t.jsx)("p",{className:"mt-4",children:"Then you can customize, publish, and share it."}),!u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{className:"mb-2 mt-6",children:"Please type the code you got via email:"}),(0,t.jsx)(q.default,{value:m,onChange:h,fields:6,name:"claimCode",inputMode:"tel",disabled:y})]}),c&&(0,t.jsx)(W,{agreed:v,onChange:S,className:"mt-4"})]})]})};var X=e.i(833881),J=e.i(174886),Z=e.i(742531),Q=e.i(918789);let ee=({appId:e,appHeader:a,showClaim:n=!1,claimSettings:o,requireBuilderCollaboratorAccount:u,customIntegrationsEnabled:c})=>{let[d,p]=(0,i.useState)(!1),{currentUser:f,isAdmin:m,isFirstLoad:x}=(0,F.useAuth)(),g=(0,s.useRouter)(),y=(0,s.useSearchParams)(),b=(0,s.usePathname)(),[v,S]=(0,i.useState)(!1),w=(0,r.useAtomValue)(h.shareableAppIdState);return(0,i.useEffect)(()=>{if(y?.get("claim")==="true"){p(!0);let e=new URLSearchParams(Array.from(y.entries()));e.delete("claim");let t=e.toString(),a=t?`?${t}`:"";g.replace(`${b}${a}`)}},[y,b,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"fixed z-[100] flex w-full flex-row items-center justify-between gap-2 bg-white bg-opacity-70 px-2 py-1 text-black shadow-sm sm:right-0 sm:top-0 sm:bg-transparent sm:shadow-none",style:{backgroundColor:o?.claimBarBackground},children:[o?.claimCustomMessage?(0,t.jsx)("div",{className:"w-full text-center text-sm",children:(0,t.jsx)(Q.default,{remarkPlugins:[Z.default],children:o?.claimCustomMessage})}):(0,t.jsxs)(t.Fragment,{children:[!m&&(0,t.jsx)("div",{className:"pl-2 sm:hidden",children:o?.claimButtonMessage||"Make this app yours"})," ",(0,t.jsx)("div",{children:n&&(0,t.jsx)(O.default,{alwaysFitContent:!0,size:"xs",label:o?.claimButtonLabel||"Claim your AI App",square:!0,dense:!0,loading:x,onClick:async()=>{f?p(!0):(window.location.assign(`https://www.buildai.space/signup?claimApp=${encodeURIComponent(`/app/${w}?claim=true`)}`),(0,l.showInfoMessage)("Great! You are one step away from claiming your app. Please sign up to continue."))}})})]}),m&&(0,t.jsx)(O.default,{alwaysFitContent:!0,size:"xs",icon:(0,t.jsx)(J.Copy,{className:"h-5 w-5"}),square:!0,dense:!0,onClick:async()=>{S(!0)}})]}),(0,t.jsx)(Y,{isOpen:d,setIsOpen:p,skipCode:!!o?.skipCode,appIdToClaim:e,appNameToClaim:a,requireBuilderCollaboratorAccount:u,onDone:()=>{p(!1)}}),(0,t.jsx)(X.default,{isOpen:v,setIsOpen:S,appId:e,appHeader:a,customIntegrationsEnabled:c,onDone:()=>{S(!1),window.open("/apps","_blank")}})]})};var et=e.i(357545);let ea=({isOpen:e,setIsOpen:a,appIdToDuplicate:n,appNameToDuplicate:o,onDone:c})=>{let{currentUser:d,isFirstLoad:p,isFreeUser:f}=(0,F.useAuth)(),[m,h]=(0,i.useState)(!1),[x,g]=(0,i.useState)(!1),y=(0,s.useRouter)(),{duplicateTemplate:b,isSaving:v}=(0,et.useBuildGenApp)(),S=(0,r.useAtomValue)(R.pricingRegionState),w=(0,r.useSetAtom)(R.upgradePlanModalState),j="premium"===S&&f;function A(){m||x||v||a(!1)}async function k(){if(j){A(),y.push("/apps?goto=upgrade"),w(u.UpgradePlanMessage.DEFAULT);return}if(!n)return void(0,l.showErrorMessage)("Template ID is missing");g(!0);let e=setTimeout(()=>{h(!0)},2e3);try{let e=await b(n);if(!e)throw Error("Failed to duplicate template");await y.replace(`/build/app/${e}`),(0,l.showInfoMessage)("Template duplicated successfully!"),c?.()}catch(e){(0,l.showErrorMessage)("Something went wrong. Please try again later or contact us")}finally{e&&clearTimeout(e),h(!1),g(!1)}}return(0,t.jsxs)(D.default,{isOpen:e,closeModal:A,modalTitle:`Duplicate '${o}' Template`,ctaButtonLabel:j?"Upgrade Plan":m?"":"Duplicate",cancelButtonLabel:m||x||v?"":"Cancel",showCloseButton:!m&&!x&&!v,triggerAction:k,ctaIsLoading:x||v,align:"left",children:[p&&(0,t.jsx)("div",{className:"flex h-[216px] flex-col items-center justify-center text-black",children:(0,t.jsx)(H.default,{})}),m&&(0,t.jsxs)("div",{className:"flex h-[216px] flex-col items-center justify-center text-center text-black",children:["We're duplicating the template for you...it might take up to 60 seconds",(0,t.jsx)(H.default,{})]}),!p&&!m&&j&&(0,t.jsxs)("div",{className:"pb-6 text-gray-800",children:[(0,t.jsx)("p",{className:"mt-4 font-semibold text-purple-900",children:"Premium Plan Required"}),(0,t.jsx)("p",{className:"mt-4",children:"This template requires a paid plan to use. Upgrade your plan to duplicate and customize this template."}),(0,t.jsx)("p",{className:"mt-4 text-sm text-gray-600",children:"Plans start from $25/month and include unlimited apps, more AI credits, and premium features."})]}),!p&&!m&&!j&&(0,t.jsxs)("div",{className:"pb-6 text-gray-800",children:[(0,t.jsx)("p",{className:"mt-4",children:"Would you like to duplicate this template to create your own app?"}),(0,t.jsx)("p",{className:"mt-4",children:"After duplicating, you'll be able to customize, edit, and publish the app as your own."})]})]})};var es=e.i(167881);let ei=({appId:e,appHeader:a,showDuplicateOption:n=!1,customMessage:o,customBackgroun
1d:u,buttonLabel:c="Use template"})=>{let[d,p]=(0,i.useState)(!1),{currentUser:f,isAdmin:m,isFirstLoad:x}=(0,F.useAuth)(),g=(0,s.useRouter)(),y=(0,s.useSearchParams)(),b=(0,s.usePathname)(),v=(0,r.useAtomValue)(h.shareableAppIdState);return(0,i.useEffect)(()=>{if(y?.get("duplicate")==="true"){p(!0);let e=new URLSearchParams(Array.from(y.entries()));e.delete("duplicate");let t=e.toString(),a=t?`?${t}`:"";g.replace(`${b}${a}`)}},[y,b,g]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed z-[100] flex w-full flex-row items-center justify-between gap-2 bg-white bg-white/50 px-2 py-1 text-black shadow-sm md:px-1",style:{backgroundColor:u},children:o?(0,t.jsx)("div",{className:"w-full text-center text-sm",children:(0,t.jsx)(Q.default,{remarkPlugins:[Z.default],children:o})}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"pl-2 text-sm",children:[(0,t.jsxs)("span",{className:"font-bold",children:["Built with"," ",(0,t.jsx)("a",{href:"https://buildai.space",target:"_blank",rel:"noopener noreferrer",className:"underline",children:"BuildAI.Space"})]}),(0,t.jsx)("br",{className:"block md:hidden"}),(0,t.jsx)("span",{className:"hidden md:inline",children:" - "}),(0,t.jsx)("span",{children:"use this template to create your own app"})]}),(0,t.jsx)("div",{children:n&&!x&&(0,t.jsxs)(es.Button,{size:"sm",onClick:async()=>{f?p(!0):(window.location.assign(`https://www.buildai.space/signup?duplicateTemplate=${encodeURIComponent(`/app/${v}?duplicate=true`)}`),(0,l.showInfoMessage)("Great! You are one step away from using this template. Please sign up to continue."))},children:[(0,t.jsx)(J.Copy,{className:"mr-1 h-4 w-4"}),c]})})]})}),(0,t.jsx)(ea,{isOpen:d,setIsOpen:p,appIdToDuplicate:e,appNameToDuplicate:a,onDone:()=>{p(!1)}})]})};var er=e.i(657688),en=e.i(417420),el=e.i(938635);e.s(["default",0,({appType:e,appData:f,versionId:m,genAppData:x,mainAppId:y,appId:b,isUnlimited:v,appStyle:S,shareableId:w,hasAppContext:A,isClaimable:k,isAppTemplate:C,requireBuilderCollaboratorAccount:N,savedResult:P,resultNotFound:T,appLink:O,toolPath:E,clientAppSettings:_,dashboardConfig:D,slug:U,isAppOwner:G})=>{(0,$.useSetViewport)();let[H,q]=(0,i.useState)(""),K=(0,s.useSearchParams)(),W=K?.get("goto"),Y=K?.get("transparentBack"),X=K?.get("buildai-embed"),J=X&&u.embedStringToType[X]?u.embedStringToType[X]:null,Z="checkout"===W,[Q,et]=(0,i.useState)(Z),[ea,es]=(0,i.useState)(!1),[eo,eu]=(0,i.useState)(!1),[ec,ed]=(0,i.useState)(!1),ep=(0,r.useSetAtom)(R.upgradePlanModalState),[ef,em]=(0,i.useState)("2$"),{currentUser:eh,isFirstLoad:ex,isAdmin:eg}=(0,F.useAuth)(),{appBundle:ey}=(0,el.useCompileApp)(),eb=(0,r.useAtomValue)(R.myAppIdsState),ev=(0,i.useRef)(null),eS=(0,r.useAtomValue)(h.mainBackgroundState),ew=(0,r.useAtomValue)(h.mainHeaderState),ej=(0,r.useSetAtom)(h.appTypeState),eA=(0,r.useSetAtom)(h.currentToolIdState),ek=(0,r.useSetAtom)(j.appLinkState),eC=(0,r.useSetAtom)(h.shareableAppIdState),eI=(0,r.useSetAtom)(h.appSettingsState),eN=(0,r.useSetAtom)(h.isEditPreviewState),eP=(0,r.useSetAtom)(h.versionIdState),{currentUser:eT}=(0,g.useAppLevelAuth)();(0,i.useEffect)(()=>{ej(e)},[e]),(0,i.useEffect)(()=>{ek(O),eC(w)},[O,w]),(0,i.useEffect)(()=>{eA(b)},[eA,b]),(0,i.useEffect)(()=>{_&&eI(_)},[_,eI]),(0,i.useEffect)(()=>{eP(m)},[m,eP]),(0,i.useEffect)(()=>{eN(G),$crisp?.push(["do","chat:hide"])},[]),(0,i.useEffect)(()=>{if(T)return void(0,l.showErrorMessage)("Something went wrong fetching the result. Please try again later or contact support","fetch-app-result-failed")},[T,b]);let eO="5KrHivL0dPGT2TVXKrzv"===b;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(V,{children:[(0,t.jsx)("div",{children:null===f?(0,t.jsxs)("div",{className:"centered-container text-black",children:[(0,t.jsx)("div",{children:"The app was not found"}),(0,t.jsx)(a.default,{href:"/",style:{color:"black",textDecoration:"underline",marginTop:8},children:"Build your own AI"})]}):(0,t.jsxs)("div",{className:`root relative ${(0,o.isLightBackgroun
1d)(eS)&&e!==u.AIAppType.SPACE_APP?"light-bg":""} ${J?`embed_${J}`:""}`,ref:ev,style:e===u.AIAppType.SPACE_APP?void 0:S?.backgroundImage?{color:(0,o.isLightBackground)(eS)?"black":"white"}:{backgroundColor:(0,n.inIframe)()&&"true"===Y?"transparent":eS,color:(0,o.isLightBackground)(eS)?"black":"white"},children:[!C&&(k||eg)&&!ex&&!(0,n.inIframe)()&&(0,t.jsx)(i.Suspense,{children:(0,t.jsx)(ee,{appId:y||b,showClaim:!eT&&k,appHeader:ew,claimSettings:_?.claimSettings,requireBuilderCollaboratorAccount:N,customIntegrationsEnabled:_?.customIntegrationsEnabled})}),C&&!ex&&ey?.getCurrentPage()?.name?.toLowerCase()===en.DEFAULT_LANDING_PAGE_NAME&&!(0,n.inIframe)()&&(0,t.jsx)(i.Suspense,{children:(0,t.jsx)(ei,{appId:y||b,appHeader:ew,showDuplicateOption:!0})}),e===u.AIAppType.SPACE_APP?(0,t.jsx)(I,{appId:b,publicAppLink:O,initialData:x,appStyle:S,isInIframe:(0,n.inIframe)(),isEditPreview:G,appSettings:_,dashboardConfig:D,slug:U}):e!==u.AIAppType.GEN_APP||P?(0,t.jsx)(c.default,{appId:b,mainAppId:y,toolPath:E,initialData:f,onGenerateLimit:e=>{eO?e?eu(!0):et(!0):"0yZc6W1hi6h6HfbFKOvT"===b?ed(!0):eh&&eb.includes(b)?ep(u.UpgradePlanMessage.APP_RUNS_LIMIT_REACHED):(0,l.showInfoMessage)(v?"Due to the awesomeness of this app, the daily usage limit has been exceeded. Don't worry, you can try again tomorrow.":"Due to the awesomeness of this app, the monthly usage limit has been exceeded. Don't worry, you can come back and try it again at another time!")},onUserInputChanged:q,appStyle:S,isInIframe:(0,n.inIframe)(),shareableId:w,hasAppContext:A,isUnlimitedApp:v,savedResult:P,isAppPublished:!0,scrollToTop:()=>{window.scrollTo({top:0,behavior:"smooth"})},appPublicLink:O,clientAppSettings:_}):(0,t.jsx)(p.default,{appId:b,publicAppLink:O,initialData:x,appStyle:S,isInIframe:(0,n.inIframe)(),appSettings:_,dashboardConfig:D,slug:U}),S?.backgroundImage&&(0,t.jsx)("div",{className:"fixed z-[-5] h-screen w-screen",children:(0,t.jsx)(er.default,{src:S?.backgroundImage,fill:!0,style:{objectFit:"cover"},alt:"background image"})})]})}),(0,t.jsx)(B,{isOpen:Q,setIsOpen:et,userInput:H,showSpecialOffer:Z,isCheckout:!0,triggerAction:e=>{em(e),es(!0),et(!1)}}),(0,t.jsx)(d.default,{plan:ef,isOpen:ea,setIsOpen:es,triggerAction:()=>{},userEmail:eh?.email||"",userId:eh?.uid||""}),(0,t.jsx)(M,{isOpen:eo,setIsOpen:eu,userInput:H,triggerAction:e=>{em(e),es(!0)}}),(0,t.jsx)(L,{isOpen:ec,setIsOpen:ed,appStyle:S}),(0,t.jsx)(z.default,{mainAppId:y})]})})}],540200)},812857,e=>{"use strict";var t=e.i(843476),a=e.i(271645),s=e.i(431343),i=e.i(770703),r=e.i(348978);let n=(0,i.default)(()=>e.A(992943),{loadableGenerated:{modules:[381019]},ssr:!1});e.s(["default",0,({videoUrl:e,thumbnailUrl:i})=>{let[l,o]=(0,a.useState)(!1),[u,c]=(0,a.useState)(!1);return(0,t.jsxs)("div",{className:`relative flex w-full max-w-[830px] flex-row justify-center overflow-hidden ${u?"":"cursor-pointer"}`,onClick:e=>{u||(e.preventDefault(),o(!0),c(!0))},children:[(0,t.jsx)(n,{controls:u,playing:l,onPause:()=>o(!1),url:e,width:"100%",height:"100%",style:{borderRadius:44,overflow:"hidden"}}),!u&&(0,t.jsx)("div",{className:"absolute right-4 top-4",children:(0,t.jsx)(r.default,{style:{color:"#000000bf",backgroundColor:"#ffffffbf"},alwaysFitContent:!0,variant:"tertiary",size:"xl",icon:(0,t.jsx)(s.Play,{className:"h-8 w-8 md:h-16 md:w-16"}),dense:!0,onClick:e=>{e.preventDefault(),o(!0),c(!0)}})})]})}])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.