@pickaxeproject/react 6.3.0 → 6.3.2
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/dist/cjs/components/Core/StudioTip.js +1 -0
- package/dist/cjs/components/EmbedPreview/FAB.js +1 -1
- package/dist/cjs/components/EmbedPreview/Popup.js +1 -1
- package/dist/cjs/components/Icons/history.svg.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Artifact/Renderer/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Auth/hooks/useAuth.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Auth/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/cjs/components/Pickaxe/Addons/Navbar/NavPill.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Chat/index.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/History/Item.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/History/Response.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Checkbox.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Input.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Option.js +1 -1
- package/dist/cjs/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/cjs/components/Pickaxe/Provider.js +1 -1
- package/dist/cjs/components/Pickaxe/common/AccessGroupCardPreview.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/A/Html/HtmlModal.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/A/Html/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/Artifact/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/Iframe/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/Img/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMarkdown/Components/common/IframeVideo.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/ActionToolCaptionPart/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/ReasoningCaptionPart/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/ReasoningPart/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/cjs/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/cjs/components/Pickaxe/common/SmitheryConnectView.js +1 -1
- package/dist/cjs/components/Pickaxe/index.js +1 -1
- package/dist/cjs/src/components/Core/StudioTip.d.ts +11 -0
- package/dist/cjs/src/components/Pickaxe/common/PickaxeMarkdown/Components/common/IframeVideo.d.ts +1 -1
- package/dist/esm/components/Core/StudioTip.js +1 -0
- package/dist/esm/components/EmbedPreview/FAB.js +1 -1
- package/dist/esm/components/EmbedPreview/Popup.js +1 -1
- package/dist/esm/components/Icons/history.svg.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Artifact/Renderer/index.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Auth/hooks/useAuth.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Auth/index.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Document/hooks/useDocument.js +1 -1
- package/dist/esm/components/Pickaxe/Addons/Navbar/NavPill.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/History/index.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Chat/index.js +1 -1
- package/dist/esm/components/Pickaxe/Form/History/Item.js +1 -1
- package/dist/esm/components/Pickaxe/Form/History/Response.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Checkbox.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Input.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Option.js +1 -1
- package/dist/esm/components/Pickaxe/Form/Questions/Submit.js +1 -1
- package/dist/esm/components/Pickaxe/Provider.js +1 -1
- package/dist/esm/components/Pickaxe/common/AccessGroupCardPreview.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/A/Html/HtmlModal.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/A/Html/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/Artifact/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/Iframe/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/Img/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMarkdown/Components/common/IframeVideo.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ActionToolCaptionPart/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ReasoningCaptionPart/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ReasoningPart/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/index.js +1 -1
- package/dist/esm/components/Pickaxe/common/PickaxeUpgradeCard.js +1 -1
- package/dist/esm/components/Pickaxe/common/SmitheryConnectView.js +1 -1
- package/dist/esm/components/Pickaxe/index.js +1 -1
- package/dist/esm/src/components/Core/StudioTip.d.ts +11 -0
- package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Components/common/IframeVideo.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";import{useState as n,useRef as i,useMemo as o}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as a}from"../../Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDocument as d}from"../../Addons/Document/hooks/useDocument.js";import{useScroll as c}from"../../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as
|
|
1
|
+
import{__awaiter as e}from"../../../../_virtual/_tslib.js";import{jsxs as t,jsx as s}from"react/jsx-runtime";import{useState as n,useRef as i,useMemo as o}from"react";import{usePickaxeContext as r}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as a}from"../../Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as l}from"../../../../hooks/pickaxe/useResponseContext.js";import{useDocument as d}from"../../Addons/Document/hooks/useDocument.js";import{useScroll as c}from"../../Addons/Scroll/hooks/useScroll.js";import{useArtifactContext as u}from"../../Addons/Artifact/hooks/useArtifactContext.js";import{extractUrlsFromText as p,initializeEmbedUserId as m}from"../../../../common/utils.js";import{encode as g}from"@nem035/gpt-3-encoder";import{createParser as f}from"eventsource-parser";import h from"../../common/PickaxeBranding.js";import v from"../../common/PickaxeButton.js";import b from"../../../../common/error.js";import{getValidationFailure as y}from"../../../../common/validation.js";const j=({questions:j,resetQuestions:O})=>{var x;const{origin:w,pickaxeId:I,sender:S,senderType:k,portalId:C,deploymentId:N,pickaxe:E,misc:P,translations:_,isRtl:A,setSessionId:T,setIsNewChat:U,setValidationStatus:D,setValidationUpgradeGroups:L,setValidationUpgradeUrl:q,onGenerateComplete:J}=r(),{token:B}=a(),{isGenerating:K,setResponse:R,setMessages:V,setStatus:W,setLimitData:X,setError:G,setIsSwitchedToChat:$}=l(),{documents:F,websiteLink:M,isUploading:Q,onWebsiteUpload:Y,setDocuments:z,setDocumentError:H}=d(),{scrollStartSession:Z,scrollEndSession:ee,scrollToTarget:te}=c({auto:!(null==E?void 0:E.enablechatresponses)}),{artifacts:se,currentPopupType:ne,setArtifacts:ie,setCurrentArtifact:oe}=u(),[re,ae]=n(!1),le=i(null),de=e=>{const t=y(e);return!!t&&(G(""),X(null),D(t.status),L(t.upgradeGroups),q(t.upgradeUrl),!0)},ce=o((()=>j.some((e=>("Short Answer"===e.type||"Long Answer"===e.type||"long"===e.type||"short"===e.type||"Checkbox"===e.type||"Knowledge Upload"===e.type||e.id.includes("documentupload"))&&e.input.length>0))),[j]);return t("div",Object.assign({className:"mt-4 flex flex-wrap justify-between gap-4 items-center",dir:A?"rtl":"ltr"},{children:[t("div",Object.assign({className:"flex items-center flex-grow flex-wrap gap-2"},{children:[s(v,Object.assign({className:"px-5 min-h-[42px]",isDisabled:Q||K||re,onClick:()=>e(void 0,void 0,void 0,(function*(){var e,t,s;try{if(K||Q||re)return;G(""),H(""),X(null),R(null);const n=["Multiple Choice","Checkbox"];for(const e of j){if(g(e.input).length>e.maxLength&&!n.includes(e.type))throw new Error((null==_?void 0:_["response-too-long"])||"One or more of your responses is too long!");if(e.isRequired&&!e.input.trim()&&"userinput:documentupload"!==e.id)throw new Error((null==_?void 0:_["required-fields-missing"])||"You must fill out all required fields.")}const i=F.filter((e=>"finished"===e.status)),o=F.map((e=>e.name)),r=null!==(t=null===(e=null==E?void 0:E.documentuploadtype)||void 0===e?void 0:e.startsWith("enduserupload"))&&void 0!==t&&t,a=j.some((e=>"userinput:documentupload"===e.id&&e.isRequired)),l=p(M).filter((e=>!o.includes(e)));if(l.length){const e=l[l.length-1];ae(!0);const t=yield Y(e);t&&(i.push(t),yield new Promise((e=>setTimeout(e,5e3)))),ae(!1)}else if(a&&r&&!i.length)return void H((null==_?void 0:_["document-upload-required"])||"Please paste a valid website/video link or drag a file to add to the knowledge base.");const d=i.map((e=>e.documentId||"")).filter(Boolean),c=r&&d.length>0,u={};j.forEach((e=>{u[e.id]="Knowledge Upload"===e.type||e.id.includes("documentupload")?i.map((e=>e.name)).join(",")||"":e.input})),W("fetching"),Z(),te();const h=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/submit`,{method:"POST",headers:Object.assign(Object.assign({"Content-Type":"application/json"},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}),{"x-request-sent-at":(new Date).toISOString()}),body:JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({origin:w,pickaxeId:I,senderType:k,valueObj:u},c&&{documentIds:d}),S&&{sender:S}),B&&{studioSessionToken:B}),!B&&!S&&{sender:m()}),C&&{portalId:C}),N&&{deploymentId:N}))}),v=yield h.json();if(!v.success){if(de(v))return;const e=new Error(v.error||v.message||(null==_?void 0:_["failed-to-start-generation"])||"Failed to start generation");throw v.limitData&&(e.limitData=v.limitData),e}if(!v.submissionId||!v.sessionId)throw new Error((null==_?void 0:_["failed-to-start-generation"])||"Failed to start generation");const b=v.submissionId,y=v.sessionId,O={sessionId:y,documentIds:c?d:[],question:{inputs:j.map((e=>({id:e.id,question:e.main,answer:e.input}))),responseParts:[]},messageCount:0,sentAt:new Date};R(O),(null==E?void 0:E.enablechatresponses)&&(T(y),U(!1),$(!0),V([{id:0,role:"assistant",parts:[],documentIds:[]}])),c&&z([]),W("streaming"),le.current=new AbortController;const x=[];let P=[...null!=se?se:[]],A=0,D=!1,L="";for(;!D;)try{const e=yield fetch(`${process.env.NEXT_PUBLIC_PICKAXE_API_URL}/stream/${b}?index=${A}`,{signal:null===(s=le.current)||void 0===s?void 0:s.signal,headers:{"Cache-Control":"no-cache",Connection:"keep-alive"}});if(!e.body)throw new Error("No response body");const t=e.body.getReader(),n=new TextDecoder,i=f({onEvent:e=>{var t,s;if(e.event&&"ping"!==e.event&&A++,"stop"!==e.event){if("error"===e.event){const t=JSON.parse(e.data),s=t.error||t.message||(null==_?void 0:_["something-went-wrong"])||"Something went wrong.";return de(t)||G(s),void(D=!0)}if("delta"===e.event){const n=JSON.parse(e.data);if("text-start"===n.type)L="",x.push({type:"text",content:"",isVisible:null===(t=n.isVisible)||void 0===t||t});else if("text-delta"===n.type)L+=n.delta,x[x.length-1].content=L;else if("text-end"===n.type)L="";else if("reasoning-start"===n.type)L="",x.push({type:"reasoning",content:"",isVisible:null===(s=n.isVisible)||void 0===s||s});else if("reasoning-delta"===n.type)L+=n.delta,x[x.length-1].content=L;else if("reasoning-end"===n.type)L="";else if(n.type.startsWith("data-")){const e=n;x.push({type:e.type,content:JSON.stringify(e.data),isVisible:!0})}const i=Object.assign(Object.assign({},O),{question:Object.assign(Object.assign({},O.question),{responseParts:[...x]})});R(i),(null==E?void 0:E.enablechatresponses)&&V([{id:0,role:"assistant",parts:[...x],documentIds:[]}])}else if("artifact_created"===e.event){const t=JSON.parse(e.data);P=P.filter((e=>!(e.id===t.id&&e.version===t.version))),P.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),ie([...P]),ne.startsWith("inline")||oe({id:t.id,version:t.version})}else if("artifact_updated"===e.event){const t=JSON.parse(e.data);P=P.filter((e=>!(e.id===t.id&&e.version===t.version))),P.push(Object.assign(Object.assign({},t),{content:"",status:"updating"})),ie([...P]),ne.startsWith("inline")||oe({id:t.id,version:t.version})}else if("artifact_rewrite"===e.event){const t=JSON.parse(e.data);P=P.filter((e=>!(e.id===t.id&&e.version===t.version))),P.push(Object.assign(Object.assign({},t),{content:"",status:"streaming"})),ie([...P]),ne.startsWith("inline")||oe({id:t.id,version:t.version})}else if("artifact_content"===e.event){const t=JSON.parse(e.data),s=t.token.replace(/\u200B/g,"");P=P.map((e=>e.id===t.id&&e.version===t.version?Object.assign(Object.assign({},e),{content:e.content+s,status:"streaming"}):e)),ie([...P])}else if("artifact_finished"===e.event){const t=JSON.parse(e.data);ie(P.map((e=>e.id===t.id?Object.assign(Object.assign({},e),{status:"finished"}):e)))}}else D=!0}});for(;;){const{value:e,done:s}=yield t.read();if(s)break;i.feed(n.decode(e))}D||(yield new Promise((e=>setTimeout(e,1e3))))}catch(e){if("AbortError"===e.name)return void(D=!0);console.warn("Stream connection lost, retrying...",e),yield new Promise((e=>setTimeout(e,1e3)))}null==J||J(y)}catch(e){let t=b(e)||"";t&&!t.includes("Unexpected token 'A',")||(t=(null==_?void 0:_["high-traffic-try-again-later"])||"Oops! We're experiencing high traffic at the moment. Please try again later."),de(t)||G(t),te()}finally{W("idle"),ae(!1),ee()}}))},{children:re?(null==_?void 0:_.processing)||"Processing...":Q?(null==_?void 0:_.uploading)||"Uploading...":K?(null==_?void 0:_.loading)||"Loading...":null!==(x=null==E?void 0:E.submittext)&&void 0!==x?x:"Submit"})),ce&&s(v,Object.assign({variant:"transparent-text",className:"min-h-[42px] px-5",isDisabled:Q||K||re,onClick:O},{children:(null==_?void 0:_["clear-form"])||"Clear form"}))]})),!P.isWhiteLabel&&s(h,{containerClassName:"justify-end"})]}))};export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as t}from"react/jsx-runtime";import{createContext as o,useState as i,useEffect as a}from"react";import{ArtifactProvider as n}from"./Addons/Artifact/Provider.js";import s from"./DimensionProvider.js";import r from"./ResponseProvider.js";import l from"./Addons/Document/Provider.js";import d from"./Addons/Auth/Provider.js";const c=o({}),u=({children:o,origin:u,sender:p,senderType:f,deploymentId:h,portalId:m,deploymentType:g,deploymentDimensions:y,deploymentMisc:b,styles:w,colors:v,limits:k={},misc:S={isWhiteLabel:!0,isProfileImage:!0,isChatImage:!0,isTitle:!0,isDescription:!0,isHistory:!0},translations:C,artifact:F={popupType:"auto"},responsiveBy:I="viewport",locale:P="en",opacity:x=1,forceMobile:T=!1,disableHtml:D=!1,disableJs:A=!1,disableCss:U=!1,loadFont:q=!0,isRtl:R=!1,isEmbed:O=!1,isDropShadow:j=!1,allowGuestUsage:L=!0,preventInitialSessionId:E=!1,onGenerateComplete:G,onSessionIdChange:H})=>{const[M,W]=i(""),[B,N]=i(""),[X,V]=i(""),[Y,J]=i(""),[_,z]=i(p),[K,Q]=i(null),[Z,$]=i(f),[ee,te]=i("loading"),[oe,ie]=i([]),[ae,ne]=i(null),[se,re]=i(null),[le,de]=i(null),[ce,ue]=i(null),[pe,fe]=i(!1),[he,me]=i(!0),[ge,ye]=i(!0),[be,we]=i(!1);return a((()=>{fe(!1)}),[null==w?void 0:w.font]),a((()=>{e(void 0,void 0,void 0,(function*(){if("undefined"!=typeof window&&q&&!pe&&(null==w?void 0:w.font)&&"Real Head Pro"!==w.font)try{(yield import("webfontloader")).default.load({google:{families:[w.font]},active:()=>{fe(!0)},inactive:()=>{console.error("[pxe] failed to load font {styles.font}"),fe(!0)}})}catch(e){console.error("[pxe] failed to load font:",e),fe(!0)}}))}),[q,pe,null==w?void 0:w.font]),a((()=>{z(p)}),[p]),t(c.Provider,Object.assign({value:Object.assign({origin:u,contextId:M,pickaxeId:B,sessionId:X,lastSessionId:Y,sender:_,senderType:Z,portalId:m,deploymentId:h,deploymentType:g,validationStatus:ee,validationUpgradeGroups:oe,validationUpgradeUrl:ae,deploymentDimensions:y,deploymentMisc:b,accessGroup:K,pickaxe:ce,styles:Object.assign({theme:"light",font:"Real Head Pro",fontSize:"md",formFieldStyle:"box",btnStyle:"filled",outlineThickness:1,cornerRadius:4},w),colors:Object.assign({primary:"#F6F8FA",text:"#000000",secondary:"#FFFFFF",secondaryText:"#000000",accent:"#228DD7",accentText:"#FFFFFF",error:"#EF4444"},v),misc:S,translations:Object.assign({"new-chat":"New chat","see-history":"See history","see-input":"See input","hide-input":"Hide input",processing:"Processing...",uploading:"Uploading...",loading:"Loading...","powered-by-pickaxe":"Powered by Pickaxe","form-doc-placeholder":"Paste a website/video link or drag a file",website:"Website",copy:"Copy","file-limit-reached":"You have reached the file limit.",save:"Save","save-as":"Save as","please-enter-email-to-continue":"Please enter your email to continue:","enter-email-to-continue":"Enter here your email to continue",submit:"Submit",sending:"Sending...","check-your-inbox":"Check your inbox","we-sent-your-an-activation-link":"We sent you an activation link. Please be sure to check your spam folder too.",resend:"Resend",resending:"Resending...","chat-history":"Chat History","exit-chat-history":"Exit Chat History","no-history":"No history yet.","log-out":"Log Out","clear-form":"Clear form",expand:"Expand","expand-artifact":"Expand artifact",collapse:"Collapse","collapse-artifact":"Collapse artifact",close:"Close","close-artifact":"Close artifact",download:"Download","copy-artifact-content":"Copy artifact content","download-artifact-content":"Download artifact content","delete-confirm":"Are you sure you want to delete this conversation?",other:"Other","select-options":"Select option(s)","select-an-option":"Select an option","type-your-answer":"Type your answer...",cancel:"Cancel","rename-chat":"Rename chat","delete-chat":"Delete chat","conversation-name":"Conversation name","not-available":"n/a","open-chat":"Open Chat",copied:"Copied!","copy-assistant-message":"Copy assistant message","failed-delete-conversation":"Failed to delete conversation.","failed-update-name":"Failed to update name.","failed-rename-chat":"Failed to rename chat.","failed-delete-chat":"Failed to delete chat.","drop-files-to-upload":"Drop files to upload","add-anything-to-the-conversation":"Add anything to the conversation","something-went-wrong-please-try-again":"Something went wrong. Please try again, or","contact-us":"contact us","for-help":"for help.",back:"Back","upgrade-required":"Upgrade Required","please-upgrade-to-continue-using-this-tool":"Please upgrade to continue using this tool.","access-locked":"Access Locked","this-tool-is-locked-contact-owner":"This tool is locked to use. Contact owner for more information.","access-denied":"Access Denied","login-is-required":"Login is required.","no-access-request-access":"It looks like you don't have access to these resources. Please request access to continue.","request-access":"Request Access",or:"or","sign-in-with-different-account":"Sign in with a different account","access-requested-successfully":"Successfully requested access!","open-tool":"Open Tool","fab-icon":"FAB Icon","iframe-artifact-fallback":"Iframe is not supported, please view this artifact in a browser that supports it.","html-preview":"HTML preview","image-link-is-broken":"[Image link is broken]","download-video":"Download Video","available-plans":"Available Plans",buy:"Buy",credits:"Credits",uses:"Uses",credits_upper:"CREDITS",uses_upper:"USES",free:"Free",unlimited:"Unlimited","authentication-required":"Authentication Required","smithery-auth-description-prefix":"The tool you are trying to use requires authentication with",dismiss:"Dismiss",connect:"Connect",connecting:"Connecting...","auth-failed":"Auth failed","failed-to-finalize-authentication":"Failed to finalize authentication.","must-be-logged-in-to-connect-smithery":"You must be logged in to connect Smithery MCPs.","feedback-dislike-input-placeholder":"Write here...","feedback-submit":"Submit","feedback-thanks":"Thanks for the feedback!","feedback-like-title":"What went right?","feedback-dislike-title":"What went wrong?","feedback-dislike-message":"Help us improve our answers","what-do-you-want-to-talk-about":"What do you want to talk about?","failed-to-start-generation":"Failed to start generation","response-too-long":"One or more of your responses is too long!","required-fields-missing":"You must fill out all required fields.","something-went-wrong":"Something went wrong.","something-went-wrong-try-again":"Something went wrong, please try again.","high-traffic-try-again-later":"Oops! We're experiencing high traffic at the moment. Please try again later.",listening:"Listening...",remaining:"remaining",upgrade:"Upgrade","email-address-cannot-be-empty":"Email address cannot be empty.","please-enter-valid-email-address":"Please enter a valid email address.","failed-to-send-sign-in-link":"Failed to send sign-in link.",tool:"Tool","document-processing-failed":"Document processing failed","invalid-upload-file-types":"You can only upload PDF, TXT, DOCX, CSV, XLSX, JSON, PPTX, MD, XML, PNG, JPEG, WEBP, or GIF files. Please try again.","invalid-website-or-youtube-link":"Please paste a valid website URL or Youtube video link to add to the knowledge base.","website-processing-failed":"Website processing failed, please try again.","invalid-website-url":"Please paste a valid website URL","document-upload-required":"Please paste a valid website/video link or drag a file to add to the knowledge base.",thinking:"Thinking...",thought:"Thought","thought-for":"Thought for",seconds:"seconds","untitled-artifact":"Untitled Artifact",created:"Created",updated:"Updated",rewrote:"Rewrote",artifact:"Artifact","iframe-not-supported-use-different-browser":"Iframe not supported, use a different browser."},C),artifact:F,responsiveBy:I,locale:P,opacity:x,forceMobile:T,loadFont:q,disableHtml:D,disableJs:A,disableCss:U,isFontLoaded:pe,isNewChat:he,isShowIceBreaker:ge,isShowFeedbackMessage:be,isRtl:R,isEmbed:O,isDropShadow:j,allowGuestUsage:L,clientSecret:le,stripeAccountId:se,preventInitialSessionId:E,setClientSecret:de,setStripeAccountId:re,setContextId:W,setValidationStatus:te,setValidationUpgradeGroups:ie,setValidationUpgradeUrl:ne,setPickaxeId:N,setSessionId:e=>{V((t=>{const o="function"==typeof e?e(t):e;return null==H||H(o),o}))},setLastSessionId:J,setSender:z,setSenderType:$,setAccessGroup:Q,setPickaxe:ue,setIsFontLoaded:fe,setIsNewChat:me,setIsShowIceBreaker:ye,setIsShowFeedbackMessage:we},G&&{onGenerateComplete:G})},{children:t(d,{children:t(s,{children:t(r,Object.assign({limits:k},{children:t(l,{children:t(n,Object.assign({},F,{children:o}))})}))})})}))};export{c as PickaxeContext,u as PickaxeProvider};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useMemo as s}from"react";import{usePickaxeContext as o}from"../../../hooks/pickaxe/usePickaxeContext.js";import r from"./PickaxeButton.js";import{STUDIO_INFINITY_VALUE as n,intervalToSuffix as l}from"./PickaxeCommon.js";import{currencyOptions as a}from"./PickaxeCurrency.js";import{Avatar as c,AvatarImage as d,AvatarFallback as m}from"./PickaxeAvatar.js";import{useAuthContext as u}from"../Addons/Auth/hooks/useAuthContext.js";import p from"../../../common/api/pickaxe.js";import{isInIframe as f}from"../../../common/utils.js";import{useResponseContext as x}from"../../../hooks/pickaxe/useResponseContext.js";import{useStudio as v}from"../../../hooks/studio/useStudio.js";const h=({data:h,children:b,upgradeUrl:j})=>{var g;const{limitData:k}=x(),{studio:y}=v(),{colors:N,sender:O,pickaxe:w,translations:C,setValidationStatus:S,setStripeAccountId:I,setClientSecret:U}=o(),{token:_,setRedirectUrl:A}=u(),L=s((()=>{var e;return null!==(e=h.displayName)&&void 0!==e?e:h.name}),[h]),T=s((()=>{var e;return null!==(e=h.displayDescription)&&void 0!==e?e:h.description}),[h]),P=!!(null==y?void 0:y.data.usage)&&y.data.usage.isCredits,R=s((()=>{var e;const{price:i,priceInterval:t,currency:s}=h;if(!i)return{price:(null==C?void 0:C.free)||"Free",suffix:""};const o=l(t,!0);return{price:`${(null!==(e=a.find((e=>e.id===s)))&&void 0!==e?e:a[0]).symbol}${i.toLocaleString()}`,suffix:o}}),[h]),$=s((()=>{const{limit:e,limitInterval:i}=h;if(e===n)return{limit:(null==C?void 0:C.unlimited)||"Unlimited",suffix:""};const t=l(i,!0);return{limit:e.toLocaleString(),suffix:t}}),[h]);return i("div",Object.assign({className:"relative flex min-h-[260px] w-[220px] shrink-0 snap-center flex-col justify-between rounded-xl border p-4 shadow-sm",style:{backgroundColor:N.secondary,color:N.secondaryText}},{children:[b,i("div",Object.assign({className:"flex flex-col"},{children:[i("div",Object.assign({className:"flex flex-col"},{children:[i(c,Object.assign({className:"h-8 w-8"},{children:[t(d,{src:null!==(g=h.image)&&void 0!==g?g:"",alt:L}),t(m,{})]})),t("p",Object.assign({className:"mt-2 text-sm font-semibold line-clamp-1",title:L},{children:L})),Boolean(T)&&t("p",Object.assign({className:"mt-1 text-[10px] opacity-70 line-clamp-2 leading-tight"},{children:T})),i("p",Object.assign({className:"mt-2 text-base font-semibold"},{children:[R.price,t("span",Object.assign({className:"text-xs font-normal opacity-70"},{children:R.suffix}))]}))]})),i("div",Object.assign({className:"mt-3 flex flex-col border-t py-2",style:{borderTopColor:N.secondaryText}},{children:[t("span",Object.assign({className:"text-[10px] font-bold opacity-50"},{children:P?(null==C?void 0:C.credits_upper)||"CREDITS":(null==C?void 0:C.uses_upper)||"USES"})),i("p",Object.assign({className:"text-base font-semibold"},{children:[$.limit,t("span",Object.assign({className:"text-xs font-normal opacity-70"},{children:$.suffix}))]}))]}))]})),t(r,Object.assign({variant:"primary",className:"w-full mt-2 min-h-[32px] text-xs",onClick:()=>e(void 0,void 0,void 0,(function*(){if(_)e(void 0,void 0,void 0,(function*(){try{const e=yield p.post("/access_group_checkout",{data:{studioUserId:O||void 0,studioId:null==w?void 0:w.studioid,accessGroupId:h.accessGroupId,successUrl:document.URL,isEmbed:f(),studioSessionToken:_}}),{success:i,url:t,clientSecret:s,stripeAccountId:o,error:r}=e.data;i?f()?s&&o?(I(o),U(s),S("stripe_checkout")):t&&window.open(t,"_blank"):t&&(window.location.href=t):alert(r)}catch(e){alert(e)}}));else if(f()){const e=j||(null==k?void 0:k.limitLink);A(e||null),S("login_required")}else window.location.href=j||`${null==k?void 0:k.limitLink}?redirectUrl=${document.URL}`}))},{children:h.ctaButtonText}))]}))};export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import o from"../../common/Modal/index.js";import r from"../../common/Modal/Body.js";const s=({src:s,isOpen:
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import o from"../../common/Modal/index.js";import r from"../../common/Modal/Body.js";import{usePickaxeContext as i}from"../../../../../../../hooks/pickaxe/usePickaxeContext.js";const s=({src:s,isOpen:t,onChangeIsOpen:n})=>{const{translations:a}=i();return e(o,Object.assign({isOpen:t,onChange:n},{children:e(r,Object.assign({style:{width:"90vw",height:"90vh",border:"none"},avoidOverflow:!0},{children:e("iframe",{src:s,title:(null==a?void 0:a["html-preview"])||"HTML preview",className:"scrollbar scrollbar-thin",style:{width:"100%",height:"100%",flex:1,borderRadius:"8px"}})}))}))};export{s as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import{useState as i}from"react";import{usePickaxeContext as o}from"../../../../../../../hooks/pickaxe/usePickaxeContext.js";import{usePickaxeMarkdownContext as s}from"../../../hooks/usePickaxeMarkdownContext.js";import n from"../../../../../../Icons/eye.svg.js";import l from"../../../../../../Icons/arrow-up-right.svg.js";import a from"./HtmlModal.js";const c=({url:c})=>{const{theme:h,colors:m}=s(),{translations:d}=o(),[p,f]=i(!1);return e(r,{children:[p&&t(a,{src:c,isOpen:p,onChangeIsOpen:f}),e("div",Object.assign({style:{display:"flex",alignItems:"flex-start",gap:"1rem",minHeight:"200px",overflow:"hidden",borderRadius:"8px"}},{children:[t("iframe",{src:c,title:(null==d?void 0:d["html-preview"])||"HTML preview",className:"scrollbar scrollbar-thin",style:{width:"100%",minHeight:"200px",border:"1px solid "+("dark"===h?"#30363D":"#D0D7DE")}}),e("div",Object.assign({style:{display:"flex",flexDirection:"column",gap:".75rem"}},{children:[t("button",Object.assign({style:{outline:"none",color:m.accent},onClick:()=>f(!0)},{children:t(n,{width:24,height:24,style:{flexShrink:0}})})),t("a",Object.assign({href:c,rel:"noreferrer",target:"_blank"},{children:t("button",Object.assign({style:{outline:"none",color:m.accent}},{children:t(l,{width:24,height:24,style:{flexShrink:0}})}))}))]}))]}))]})};export{c as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useMemo as r,useEffect as i}from"react";import{usePickaxeMarkdownContext as a}from"../../hooks/usePickaxeMarkdownContext.js";import{useArtifactContext as n}from"../../../../Addons/Artifact/hooks/useArtifactContext.js";import{motion as s}from"framer-motion";import
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useMemo as r,useEffect as i}from"react";import{usePickaxeMarkdownContext as a}from"../../hooks/usePickaxeMarkdownContext.js";import{useArtifactContext as n}from"../../../../Addons/Artifact/hooks/useArtifactContext.js";import{usePickaxeContext as o}from"../../../../../../hooks/pickaxe/usePickaxeContext.js";import{motion as s}from"framer-motion";import d from"../../../../../Icons/spinner-lines.svg.js";import c from"../../../../Addons/Artifact/Renderer/index.js";const l=({node:i})=>{const{theme:l,colors:p,styles:m,onArtifactClick:u}=a(),{translations:f}=o(),{artifacts:v,currentPopupType:x,currentArtifact:h}=n(),C=r((()=>{const{dataId:e,dataCommand:t,dataTitle:r,dataType:a,dataVersion:n}=(null==i?void 0:i.properties)||{};return e?{id:e,command:t||"create",title:r||(null==f?void 0:f["untitled-artifact"])||"Untitled Artifact",type:a||"text/markdown",version:n?parseInt(n,10):1}:null}),[f]),g=r((()=>{var e,t,r,i;if(!C)return null;const{command:a,type:n,version:o}=C;let s=`${null!==(t=null!==(e={create:(null==f?void 0:f.created)||"Created",update:(null==f?void 0:f.updated)||"Updated",rewrite:(null==f?void 0:f.rewrote)||"Rewrote"}[a])&&void 0!==e?e:null==f?void 0:f.created)&&void 0!==t?t:"Created"} ${null!==(i=null!==(r={"text/markdown":"Markdown","text/html":"HTML","text/csv":"CSV","text/tab-separated-values":"TSV","image/svg+xml":"SVG","application/pdf":"PDF","application/vnd.pxe.code":"Code","application/vnd.pxe.mermaid":"Diagram","application/vnd.pxe.react":"React Component"}[n])&&void 0!==r?r:null==f?void 0:f.artifact)&&void 0!==i?i:"Artifact"}`;return o>1&&(s+=` (v${o})`),s}),[C,f]),b=r((()=>{if(!C)return"finished";const e=v.find((e=>e.id===C.id&&e.version===C.version));return e?e.status:"finished"}),[v,C]);return C?x.startsWith("inline")&&"finished"===b?h?null:e(c,{type:"inline",className:"pxe-artifact-inline",styling:{colors:p,styles:m},artifact:{id:C.id,version:C.version}}):t(s.div,Object.assign({className:"pxe-artifact-create-container p-4 flex items-center gap-8 flex-wrap justify-between mb-4 select-none",style:Object.assign({borderColor:"dark"===l?"#444444":"#CCCCCC",backgroundColor:p.secondary+"80",color:p.secondaryText,borderRadius:m.cornerRadius},!!u&&{cursor:"pointer"}),initial:{opacity:0,x:10,scale:.95},animate:{opacity:1,x:0,scale:1},transition:{duration:.5,ease:"easeOut",staggerChildren:.1},whileHover:{borderColor:"dark"===l?"#666666":"#AAAAAA",backgroundColor:p.secondary}},u&&{onClick:()=>u({id:C.id,version:C.version})},{children:[t("div",Object.assign({className:"pxe-artifact-create-header flex flex-col gap-2 text-[10pt]"},{children:[e("p",Object.assign({className:"font-semibold"},{children:C.title})),e("p",Object.assign({className:"opacity-90"},{children:g}))]})),"finished"!==b&&e("div",{children:e(d,{className:"pxe-spin w-5 h-5 shrink-0"})})]})):null},p=({node:t,children:r})=>{const{setArtifacts:a}=n();return i((()=>{if(!t||!t.properties)return;const e=t.properties.dataId;e&&a((t=>t.map((t=>t.id===e?Object.assign(Object.assign({},t),{status:"error"}):t))))}),[]),e("div",Object.assign({className:"pxe-red pxe-artifact-error"},{children:r}))};export{l as Artifact,p as ArtifactError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as t}from"../../../../../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";const r=r=>{var{title:
|
|
1
|
+
import{__rest as t}from"../../../../../../_virtual/_tslib.js";import{jsx as e}from"react/jsx-runtime";import{usePickaxeContext as i}from"../../../../../../hooks/pickaxe/usePickaxeContext.js";const r=r=>{var{title:l,children:s,style:o}=r,n=t(r,["title","children","style"]);const{translations:a}=i();return e("iframe",Object.assign({title:l||(null==a?void 0:a["html-preview"])||"HTML preview",style:Object.assign({borderRadius:"8px",width:"100%"},o),allowFullScreen:!0},n,{children:s}))};export{r as Iframe};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as o,__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{usePickaxeMarkdownContext as n}from"../../hooks/usePickaxeMarkdownContext.js";import{useHover as s}from"../../../../../../hooks/core/useHover.js";import{motion as a}from"framer-motion";import
|
|
1
|
+
import{__rest as o,__awaiter as e}from"../../../../../../_virtual/_tslib.js";import{jsxs as i,jsx as t}from"react/jsx-runtime";import{useState as r}from"react";import{usePickaxeMarkdownContext as n}from"../../hooks/usePickaxeMarkdownContext.js";import{useHover as s}from"../../../../../../hooks/core/useHover.js";import{motion as a}from"framer-motion";import l from"../../../../../Icons/download.svg.js";import c from"../../../../../Icons/copied.svg.js";import p from"../../../../../Icons/copy.svg.js";import d from"./ImgModal.js";import m from"copy-to-clipboard";import{usePickaxeContext as b}from"../../../../../../hooks/pickaxe/usePickaxeContext.js";const x=({src:x,alt:h})=>{const{colors:g,readOnly:y}=n(),{translations:u}=b(),[f,v]=r(!1),[k,w]=r(!1),[j,O]=r(!1),C=s(),{isHover:S}=C,I=o(C,["isHover"]);return i("div",Object.assign({className:"pxe-markdown-image",style:Object.assign({display:"flex",width:"100%",justifyContent:"center",overflow:"hidden",borderRadius:"8px"},!y&&{transition:"transform 0.3s ease, box-shadow 0.3s ease",transform:S?"translateY(-5px)":"translateY(0)"})},!y&&Object.assign({},I),{children:[k&&t(d,{src:x,isOpen:k,onChangeIsOpen:w}),f?t("p",Object.assign({style:{userSelect:"none",opacity:.5,fontStyle:"italic"}},{children:(null==u?void 0:u["image-link-is-broken"])||"[Image link is broken]"})):i("div",Object.assign({style:{position:"relative"}},{children:[!y&&i(a.div,Object.assign({initial:"hidden",animate:S||j?"visible":"hidden",variants:{hidden:{opacity:0,y:-10,pointerEvents:"none"},visible:{opacity:1,y:0,pointerEvents:"auto"}},style:{position:"absolute",display:"flex",gap:"0.4rem",top:"10px",right:"10px",color:"#FFF"}},{children:[t(a.button,Object.assign({style:{outline:"none",padding:"0.5rem 0.65rem",borderRadius:"4px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)",transition:"background-color 0.2s ease",backgroundColor:g.accent,opacity:.6},whileTap:{scale:.95},whileHover:{opacity:1},onClick:o=>{o.stopPropagation(),window.open(x,"_blank")}},{children:t(l,{width:24,height:24,style:{color:g.accentText,flexShrink:0}})})),t(a.button,Object.assign({style:{outline:"none",padding:"0.5rem 0.65rem",borderRadius:"4px",boxShadow:"0px 4px 6px rgba(0, 0, 0, 0.1)",transition:"background-color 0.2s ease",backgroundColor:g.accent,opacity:j?1:.6},whileTap:{scale:.95},whileHover:{opacity:1},onClick:o=>{o.stopPropagation(),e(void 0,void 0,void 0,(function*(){try{O(!0),m(x||""),yield new Promise((o=>setTimeout(o,1500)))}finally{O(!1)}}))}},{children:t(j?c:p,{width:24,height:24,style:{color:g.accentText,flexShrink:0}})}))]})),t("img",Object.assign({src:x,alt:h,style:{borderRadius:"8px",width:"100%",transition:"box-shadow 0.3s ease",boxShadow:S?"inset 0px 4px 10px rgba(0, 0, 0, 0.5)":"none"},onError:()=>v(!0)},!y&&{onClick:()=>w(!0)}))]}))]}))};export{x as Img};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";const
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../../../../hooks/pickaxe/usePickaxeContext.js";const r=({title:r,src:s,fallback:a})=>{const{translations:i}=t();return e("div",Object.assign({className:"pxe-markdown-video"},{children:e("iframe",Object.assign({title:r,src:s,allowFullScreen:!0,style:{width:"100%",maxWidth:"560px",aspectRatio:"16 / 9"}},{children:a||(null==i?void 0:i["iframe-not-supported-use-different-browser"])||"Iframe not supported, use a different browser."}))}))};export{r as default};
|
package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ActionToolCaptionPart/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{usePickaxeContext as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{usePickaxeContext as o}from"../../../../../hooks/pickaxe/usePickaxeContext.js";import i from"./TextShimmer.js";const e=({caption:e,isLoading:r})=>{const{colors:s,translations:n}=o();return r?t(i,Object.assign({theme:"#000000"===s.text?"light":"dark",isDisabled:!r},{children:e||((null==n?void 0:n.loading)||"Loading...")})):null};export{e as default};
|
package/dist/esm/components/Pickaxe/common/PickaxeMessageParts/ReasoningCaptionPart/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{usePickaxeContext as t}from"../../../../../hooks/pickaxe/usePickaxeContext.js";import i from"../ActionToolCaptionPart/TextShimmer.js";const e=({caption:e,isLoading:n})=>{const{colors:r,translations:a}=t();return n?o(i,Object.assign({theme:"#000000"===r.text?"light":"dark",isDisabled:!n},{children:e||((null==a?void 0:a.loading)||"Loading...")})):null};export{e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__rest as e}from"../../../../../_virtual/_tslib.js";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__rest as e}from"../../../../../_virtual/_tslib.js";import{jsxs as o,jsx as t}from"react/jsx-runtime";import{useState as n,useEffect as i}from"react";import{usePickaxeContext as r}from"../../../../../hooks/pickaxe/usePickaxeContext.js";import{useHover as s}from"../../../../../hooks/core/useHover.js";import{motion as a,AnimatePresence as l}from"framer-motion";import c from"../../../../Icons/chevron-down.svg.js";import m from"../../../../Icons/chevron-up.svg.js";const d=({children:d,isReasoning:u})=>{const{colors:h,translations:p}=r(),[g,f]=n(-1),[v,x]=n(!1),j=s(),{isHover:b}=j,y=e(j,["isHover"]);return i((()=>{let e=null;return u?(f(0),e=setInterval((()=>{f((e=>e+1))}),1e3)):(e&&clearInterval(e),x(!1)),()=>{e&&clearInterval(e)}}),[u]),o(a.div,Object.assign({className:"flex flex-col mb-2",initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,ease:"easeInOut"}},{children:[o("div",Object.assign({className:"flex flex-row gap-2 items-center"},{children:[t("div",Object.assign({className:"text-sm",style:{color:h.text+"80"}},{children:u?(null==p?void 0:p.thinking)||"Thinking...":g>=0?`${(null==p?void 0:p["thought-for"])||"Thought for"} ${g} ${(null==p?void 0:p.seconds)||"seconds"}`:(null==p?void 0:p.thought)||"Thought"})),t("button",Object.assign({className:"rounded-full cursor-pointer outline-none text-c-secondary transition-colors duration-300",style:{backgroundColor:v||b?h.secondary+"80":"transparent"},onClick:()=>{x(!v)}},y,{children:t(v?m:c,{className:"w-3 h-3 shrink-0"})}))]})),t(l,Object.assign({initial:!1},{children:v&&t(a.div,Object.assign({className:"flex flex-col pl-3 text-sm",style:{color:h.text+"80",borderLeftColor:h.secondary+"80"},initial:"collapsed",animate:"expanded",exit:"collapsed",variants:{collapsed:{height:0,opacity:0,marginTop:0,marginBottom:0},expanded:{height:"auto",opacity:1,marginTop:"1rem",marginBottom:0}},transition:{duration:.2,ease:"easeInOut"}},{children:d}),"reasoning")}))]}))};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Suspense as t,lazy as n}from"react";import{
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Suspense as t,lazy as n}from"react";import{usePickaxeContext as a}from"../../../../hooks/pickaxe/usePickaxeContext.js";import{PickaxeMarkdownRenderer as o}from"../PickaxeMarkdown/Renderer.js";import{safeJSONParse as i}from"../../../../common/utils.js";import r from"../../../../common/cn.js";const s=n((()=>import("./TextPart/index.js"))),l=n((()=>import("./ReasoningPart/index.js"))),c=n((()=>import("./ActionToolCaptionPart/index.js"))),m=n((()=>import("./ReasoningCaptionPart/index.js"))),d=({className:n,parts:d})=>{const{translations:p}=a();return e("div",Object.assign({className:r("flex flex-col gap-2",n)},{children:e(t,Object.assign({fallback:e("div",{})},{children:d.map(((t,n)=>{if(!t.isVisible)return null;if("text"===t.type){const a=/(https?:\/\/[^\s"']+\.mp4)/g,i=t.content.split(a);return e(s,{children:i.map(((t,n)=>t.match(a)?e("div",Object.assign({className:"my-3 block w-full max-w-full"},{children:e("video",Object.assign({controls:!0,preload:"metadata",className:"max-h-[400px] w-auto max-w-full rounded-lg bg-black/5 shadow-sm",src:t},{children:e("a",Object.assign({href:t,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-blue-500 hover:underline"},{children:(null==p?void 0:p["download-video"])||"Download Video"}))}))}),n):t?e(o,{value:t},n):null))},n)}if("reasoning"===t.type)return e(l,Object.assign({isReasoning:n===d.length-1},{children:e(o,{value:t.content})}),n);if("data-action-tool-caption"===t.type){const a=i(t.content);return e(c,Object.assign({},a&&a,{isLoading:n===d.length-1}),n)}if("data-reasoning-caption"===t.type){const a=i(t.content);return e(m,Object.assign({},a&&a,{isLoading:n===d.length-1}),n)}return null}))}))}))};export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsx as o,jsxs as s}from"react/jsx-runtime";import{useState as i,useEffect as t}from"react";import{AnimatePresence as r}from"framer-motion";import{usePickaxeContext as l}from"../../../hooks/pickaxe/usePickaxeContext.js";import{useResponseContext as a}from"../../../hooks/pickaxe/useResponseContext.js";import{useStyleFontSize as n}from"../../../hooks/studio/useStyleFontSize.js";import{isInIframe as c}from"../../../common/utils.js";import d from"../../Icons/circle-exclamation.svg.js";import u from"../../Core/SpringTransition.js";import p from"../../Core/HtmlRenderer.js";import m from"./PickaxeButton.js";import v from"../../../common/cn.js";import x from"../../../common/api/pickaxe.js";import{useAuthContext as f}from"../Addons/Auth/hooks/useAuthContext.js";import g from"./AccessGroupCardPreview.js";import{useStudio as h}from"../../../hooks/studio/useStudio.js";import{currencyOptions as b}from"./PickaxeCurrency.js";const y=({price:e,uses:i,isCredits:t,isSelected:r,costPerRun:l,onClick:a,colors:n})=>{const c={backgroundColor:n.secondary,color:n.secondaryText,borderColor:r?n.secondaryText:"rgba(0,0,0,0.1)"},d=t&&l?Math.ceil(i/l):0;return s("button",t?Object.assign({onClick:a,className:v("flex min-w-[200px] shrink-0 cursor-pointer flex-col rounded-[16px] px-6 py-5 text-left transition-all duration-200",r?"border-2 shadow-sm":"border opacity-80 hover:opacity-100"),style:c},{children:[s("div",Object.assign({className:"mb-4 flex items-center gap-2"},{children:[o("span",Object.assign({className:"text-[24px] font-semibold tracking-tight"},{children:e})),s("span",Object.assign({className:"text-[14px] font-light opacity-80"},{children:["/",i," credits"]}))]})),o("div",{className:"mb-4 h-[1px] w-full",style:{backgroundColor:n.secondaryText,opacity:.15}}),s("span",Object.assign({className:"text-[14px] italic opacity-70"},{children:["~ ",void 0!==d&&d>0?d.toLocaleString():"..."," ","runs"]}))]}):Object.assign({onClick:a,className:v("flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-[16px] px-5 py-3 transition-all duration-200",r?"border-2 shadow-sm":"border opacity-80 hover:opacity-100"),style:c},{children:[o("span",Object.assign({className:"text-[24px] font-semibold tracking-tight"},{children:e})),s("span",Object.assign({className:"text-[14px] font-light opacity-80"},{children:["/",i," uses"]}))]}))},j=({className:j,iconClassName:k,htmlClassName:w})=>{var C,N,O,A,S,U;const{colors:_,pickaxe:I,sender:R,translations:P,setValidationStatus:G,setClientSecret:L,setStripeAccountId:T}=l(),{token:$,setRedirectUrl:B}=f(),{limitData:q}=a(),{studio:F}=h(),M=n(),[z,D]=i(0),[E,H]=i(null),V=!!(null==F?void 0:F.data.usage)&&F.data.usage.isCredits,J=null!==(N=null===(C=b.find((e=>e.id===(null==F?void 0:F.data.currency))))||void 0===C?void 0:C.symbol)&&void 0!==N?N:b[0].symbol;t((()=>{var e;(null===(e=null==q?void 0:q.buyUses)||void 0===e?void 0:e.length)&&D(0)}),[q]);const K=null==q?void 0:q.customLink,Q=null==q?void 0:q.limitCTA,W=Array.isArray(null==q?void 0:q.upgradeGroups)&&(null==q?void 0:q.upgradeGroups)&&(null==q?void 0:q.upgradeGroups.length)>0,X=(V?null===(O=null==F?void 0:F.data.usage)||void 0===O?void 0:O.availableCredits:null===(A=null==F?void 0:F.data.usage)||void 0===A?void 0:A.availableUses)||(null==q?void 0:q.buyUses),Y=Array.isArray(X)&&X.length>0,Z=Y&&Array.isArray(X)&&X[z];t((()=>{let o=!0;return e(void 0,void 0,void 0,(function*(){var e;if(F&&(null===(e=F.data)||void 0===e?void 0:e.workspaceId))try{const e=yield x.get(`/cost_per_run?workspaceId=${F.data.workspaceId}`,{withCredentials:!1});if(o){const o=1e4*e.data.costPerRun||0;H(o)}}catch(e){console.error("Failed to fetch cost per run:",e),o&&H(0)}else H(0)})),()=>{o=!1}}),[F,null===(S=null==F?void 0:F.data)||void 0===S?void 0:S.workspaceId,H]);return q?o(r,{children:s(u,Object.assign({className:v("flex flex-col gap-5 w-full",j)},{children:[s("div",Object.assign({className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center justify-between rounded-lg p-3 bg-opacity-5",style:{backgroundColor:_.secondary}},{children:[s("div",Object.assign({className:"flex gap-3 items-start"},{children:[o(d,{className:v("h-5 w-5 shrink-0 mt-0.5",k),style:{color:_.accent}}),o(p,{className:v(M.b2,"font-semibold leading-relaxed text-sm",w),style:{color:_.text},html:q.limitMessage||""})]})),K&&o(m,Object.assign({variant:"primary",className:"whitespace-nowrap min-h-[32px] w-full sm:w-auto text-sm",onClick:()=>e(void 0,void 0,void 0,(function*(){if(c()){if(!$)return B(K||null),void G("login_required");window.open(K)}else window.location.href=`${K}?redirectUrl=${document.URL}`}))},{children:Q}))]})),W&&s("div",Object.assign({className:"flex flex-col gap-2"},{children:[o("h3",Object.assign({className:"text-xs font-bold opacity-70 uppercase px-1",style:{color:_.text}},{children:(null==P?void 0:P["available-plans"])||"Available Plans"})),o("div",Object.assign({className:"flex flex-row gap-3 overflow-x-auto pb-4 pt-1 snap-x scrollbar-thin"},{children:null===(U=q.upgradeGroups)||void 0===U?void 0:U.map(((e,s)=>o(g,{data:e},e.accessGroupId||s)))}))]})),Y&&Z&&s("div",Object.assign({className:"flex flex-col gap-3"},{children:[s("h3",Object.assign({className:"text-xs font-bold opacity-70 uppercase px-1",style:{color:_.text}},{children:[(null==P?void 0:P.buy)||"Buy"," ",V?(null==P?void 0:P.credits)||"Credits":(null==P?void 0:P.uses)||"Uses"]})),o("div",Object.assign({className:"flex flex-row gap-3 overflow-x-auto pb-2 pt-1 snap-x scrollbar-thin"},{children:null==X?void 0:X.map(((e,s)=>o(y,{price:e.price,uses:e.uses,isCredits:V,costPerRun:E||void 0,isSelected:s===z,onClick:()=>D(s),colors:_},s)))})),s(m,Object.assign({variant:"primary",className:"w-full py-3 text-sm font-bold shadow-md",onClick:()=>e(void 0,void 0,void 0,(function*(){var o,s;$?(o=Z.uses,s=Z.price,e(void 0,void 0,void 0,(function*(){try{const e=yield x.post("/get_extra_usage_payment_link",{data:{sender:R||void 0,studioSessionToken:$,studioId:null==I?void 0:I.studioid,cost:s,isEmbed:c(),extraUses:o,successUrl:document.URL}}),{success:i,url:t,clientSecret:r,stripeAccountId:l,error:a}=e.data;i?c()?r&&l?(T(l),L(r),G("stripe_checkout")):t&&window.open(t,"_blank"):t&&(window.location.href=t):alert(a)}catch(e){alert(e)}}))):c()?(B(K||null),G("login_required")):window.location.href=`${K}?redirectUrl=${document.URL}`}))},{children:[(null==P?void 0:P.buy)||"Buy"," ",Z.uses.toLocaleString()," ",V?(null==P?void 0:P.credits)||"Credits":(null==P?void 0:P.uses)||"Uses"," ","for ",J,Z.price]}))]}))]}))}):null};export{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{__awaiter as e}from"../../../_virtual/_tslib.js";import{jsxs as t,jsx as o}from"react/jsx-runtime";import{useState as i,useRef as n,useMemo as r,useEffect as s}from"react";import l from"../../../common/error.js";import{Client as c}from"../../../node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js";import{StreamableHTTPClientTransport as a}from"../../../node_modules/.pnpm/@modelcontextprotocol_sdk@1.20.2/node_modules/@modelcontextprotocol/sdk/dist/esm/client/streamableHttp.js";import d from"../../Core/Button.js";import m from"../../Core/ErrorAlert.js";import{SmitheryAuthProvider as u}from"./SmitheryAuthProvider.js";import{v4 as p}from"uuid";import f from"../../../common/api/api.js";import{usePickaxeContext as h}from"../../../hooks/pickaxe/usePickaxeContext.js";import{isPickaxeDomain as v}from"../../../common/api/pickaxe.js";import{encryptFernet as g}from"../../../common/fernet.js";const x=({serverId:x,smitheryId:b,name:j,resubmitPrompt:_})=>{const{sender:O,translations:k}=h(),[N,y]=i(!0),[I,E]=i(!1),[S,C]=i(null),w=n(null),P=r((()=>p()),[]);s((()=>{let t=null;return I&&(t=setInterval((()=>e(void 0,void 0,void 0,(function*(){const e=yield f.post("/oauth/handshake/check",{sessionId:P}),{success:o,code:i}=e.data;if("failed"===i)return C((null==k?void 0:k["auth-failed"])||"Auth failed"),E(!1),void(t&&clearInterval(t));if(i&&o){t&&clearInterval(t);try{if(!w.current)throw new Error("Transport not available for finalization.");yield w.current.finishAuth(i)}catch(e){return console.error(e),C((null==k?void 0:k["failed-to-finalize-authentication"])||"Failed to finalize authentication."),void E(!1)}const e=localStorage.getItem("mcp_tokens"),o=localStorage.getItem("mcp_client");e&&o&&T(JSON.parse(e),JSON.parse(o))}}))),1e3)),()=>{t&&clearInterval(t)}}),[I]);const T=(t,o)=>e(void 0,void 0,void 0,(function*(){try{yield f.post("/mcp/user/save",{tokens:yield g(JSON.stringify(t)),clientId:o.client_id,serverId:x,userId:O},Object.assign(Object.assign({},(!process.env.NODE_ENV||"development"===process.env.NODE_ENV)&&Object.assign({},process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN&&{headers:{"x-pickaxe-session-token":process.env.NEXT_PUBLIC_PICKAXE_SESSION_TOKEN}})),v&&{credentials:"include"})),localStorage.removeItem("mcp_tokens"),localStorage.removeItem("mcp_client"),y(!1),_()}catch(e){C(l(e))}}));return N?t("div",Object.assign({className:"w-full bg-white border border-c-sep rounded-lg shadow-sm p-4 flex flex-col gap-4"},{children:[t("div",Object.assign({className:"flex flex-col gap-1"},{children:[o("h3",Object.assign({className:"font-semibold text-black/80 text-lg"},{children:(null==k?void 0:k["authentication-required"])||"Authentication Required"})),t("p",Object.assign({className:"text-black/60 text-sm"},{children:[(null==k?void 0:k["smithery-auth-description-prefix"])||"The tool you are trying to use requires authentication with"," ",o("span",Object.assign({className:"font-semibold text-black/80"},{children:j||b})),"."]}))]})),S&&o(m,{error:S}),t("div",Object.assign({className:"flex justify-end gap-2"},{children:[o(d,Object.assign({variant:"secondary",onClick:()=>y(!1),className:"text-sm px-3 h-9"},{children:(null==k?void 0:k.dismiss)||"Dismiss"})),o(d,Object.assign({variant:"primary",loadingText:(null==k?void 0:k.connecting)||"Connecting...",isLoading:I,onClick:()=>e(void 0,void 0,void 0,(function*(){if(!I)if("LOGGED OUT"!==O)try{C(null),E(!0);const e=new u(P),t=new a(new URL(`https://server.smithery.ai/${b}/mcp`),{authProvider:e});w.current=t;const o=new c({name:"Pickaxe",version:"1.0.0"});yield o.connect(t)}catch(e){console.log(l(e))}else C((null==k?void 0:k["must-be-logged-in-to-connect-smithery"])||"You must be logged in to connect Smithery MCPs.")})),className:"text-sm px-3 h-9"},{children:(null==k?void 0:k.connect)||"Connect"}))]}))]})):null};export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as s,jsxs as t}from"react/jsx-runtime";import{usePickaxe as o}from"../../hooks/pickaxe/usePickaxe.js";import{useState as i,useMemo as a,useEffect as
|
|
1
|
+
import{__awaiter as e}from"../../_virtual/_tslib.js";import{jsx as s,jsxs as t}from"react/jsx-runtime";import{usePickaxe as o}from"../../hooks/pickaxe/usePickaxe.js";import{useState as i,useMemo as a,useEffect as l}from"react";import{usePickaxeContext as r}from"../../hooks/pickaxe/usePickaxeContext.js";import{useAuthContext as c}from"./Addons/Auth/hooks/useAuthContext.js";import{useResponseContext as n}from"../../hooks/pickaxe/useResponseContext.js";import{useDocumentContext as d}from"./Addons/Document/hooks/useDocumentContext.js";import{useArtifactContext as m}from"./Addons/Artifact/hooks/useArtifactContext.js";import{v4 as u}from"uuid";import{ScrollProvider as p}from"./Addons/Scroll/Provider.js";import f from"./common/PickaxeSkeleton.js";import x from"./Chat/index.js";import h from"./Form/index.js";import v from"./Addons/Auth/index.js";import g from"../../common/cn.js";import j from"../../common/api/pickaxe.js";import{getValidationFailure as b}from"../../common/validation.js";import y from"./common/AccessGroupCardPreview.js";import{Avatar as k,AvatarImage as w,AvatarFallback as N}from"./common/PickaxeAvatar.js";import O from"../Icons/lock.svg.js";import{EmbeddedCheckoutProvider as _,EmbeddedCheckout as I}from"../../node_modules/.pnpm/@stripe_react-stripe-js@4.0.2_@stripe_stripe-js@7.9.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@stripe/react-stripe-js/dist/react-stripe.esm.mjs.js";import{loadStripe as A}from"../../node_modules/.pnpm/@stripe_stripe-js@7.9.0/node_modules/@stripe/stripe-js/dist/index.mjs.js";const C=({className:e})=>s("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e},{children:s("polyline",{points:"15 18 9 12 15 6"})})),S=({pickaxeId:S,className:q})=>{const{sessionId:P,styles:U,colors:T,responsiveBy:G,deploymentType:L,isNewChat:R,isEmbed:E,opacity:D,deploymentId:B,sender:$,portalId:F,validationStatus:V,validationUpgradeGroups:M,validationUpgradeUrl:W,stripeAccountId:z,clientSecret:H,translations:J,preventInitialSessionId:K,setClientSecret:X,setStripeAccountId:Y,setValidationStatus:Q,setValidationUpgradeGroups:Z,setValidationUpgradeUrl:ee,setContextId:se,setPickaxeId:te,setSessionId:oe,setPickaxe:ie,setAccessGroup:ae}=r(),{isSent:le,token:re}=c(),{setMessages:ce,setResponse:ne,setError:de,setLimitData:me,setIsSwitchedToChat:ue}=n(),{setDocumentError:pe}=d(),{setCurrentArtifact:fe}=m(),[xe,he]=i(!1),ve=o(),ge="chat-input"===L&&R&&!le,je=a((()=>z?A(process.env.NEXT_PUBLIC_STRIPE_KEY,{stripeAccount:z}):null),[z]);l((()=>{te(S)}),[S]);l((()=>{if(!B&&!F||!ve.data)return;if("stripe_checkout"===V)return;e(void 0,void 0,void 0,(function*(){var e;Q("loading");try{const s=yield j.post("/validate_studio_deployment",{data:{deploymentId:B,sender:$||void 0,studioSessionToken:re,portalId:F,studioId:null===(e=ve.data)||void 0===e?void 0:e.studioid}});if(s.data.success)Q("success"),Z([]),ee(null),ae(s.data.accessGroup);else{const e=b(s.data);if(!e)return Q("login_required"),Z([]),void ee(null);Q(e.status),Z(e.upgradeGroups),ee(e.upgradeUrl),he(!0)}}catch(e){console.error("Failed to validate deployment:",e),Q("success")}}))}),[B,$,re,F,ve.data]),l((()=>{if(!ve.data)return;const e=ve.data.chatflag;K||oe(e?u():""),se(u()),e?ce([]):ne(null),de(""),pe(""),me(null),fe(null),ue(!1),ie(ve.data),he(!0)}),[ve.data]),l((()=>{de(""),pe(""),me(null),ce([]),ne(null),fe(null)}),[P]);const be=a((()=>{const e=null!=D?D:1;if(!T.primary||!T.primary.startsWith("#")||e<0||e>1)return T.primary;const s=Math.round(255*e).toString(16).padStart(2,"0");return`${T.primary}${s}`}),[T.primary,D]);if(!ve.data)return null;return s("div",Object.assign({className:g("relative @container/pickaxe-root flex flex-col flex-grow w-full h-full","dark"===U.theme&&"dark",q),style:Object.assign({backgroundColor:ge?"transparent":be,color:T.text},U.font&&"Real Head Pro"!==U.font&&{fontFamily:U.font})},{children:"stripe_checkout"===V&&H&&je?t("div",Object.assign({className:"absolute inset-0 z-[999] flex flex-col w-full h-full overflow-hidden",style:{backgroundColor:T.secondary||"#ffffff",color:T.secondaryText||"#000000"}},{children:[s("div",Object.assign({className:"flex items-center p-4 border-b border-gray-100 shrink-0"},{children:t("button",Object.assign({onClick:()=>{X&&X(null),Y&&Y(null),Q("success")},className:"flex items-center gap-2 text-sm font-semibold opacity-70 hover:opacity-100 transition-opacity",style:{color:T.text}},{children:[s(C,{className:"w-5 h-5"}),s("span",{children:(null==J?void 0:J.back)||"Back"})]}))})),s("div",Object.assign({className:"flex-1 w-full h-full overflow-y-auto [&>div]:h-full"},{children:s(_,Object.assign({stripe:je,options:{clientSecret:H}},{children:s(I,{})}))}))]})):ve.isLoading||!xe||"loading"===V?s("div",Object.assign({className:g("flex items-center flex-col w-full pt-12 px-4 pb-10","viewport"===G?"min-[767px]:pb-40":"@[767px]/pickaxe-root:pb-40")},{children:t("div",Object.assign({className:"flex w-full items-center max-w-[700px] flex-col"},{children:[s(f,{className:"w-[72px] h-[72px]"}),s(f,{className:"h-[20px] mt-6 w-full"}),s(f,{className:"h-[20px] mt-2 w-full"}),s(f,{className:"h-[20px] mt-2 w-full max-w-[400px]"}),s("div",Object.assign({className:"flex flex-col gap-y-8 w-full mt-6"},{children:s(f,{className:g("w-full min-h-[48px]","viewport"===G?"min-[767px]:max-w-[176px]":"@[767px]/pickaxe-root:max-w-[176px]")})}))]}))})):"upgrade_required"===V?s("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:M&&M.length>0?t("div",Object.assign({className:"flex flex-col items-center gap-6 w-full max-w-4xl"},{children:[t("div",Object.assign({className:"text-center"},{children:[s("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:(null==J?void 0:J["upgrade-required"])||"Upgrade Required"})),s("p",Object.assign({className:"opacity-80"},{children:(null==J?void 0:J["please-upgrade-to-continue-using-this-tool"])||"Please upgrade to continue using this tool."}))]})),s("div",Object.assign({className:"flex flex-wrap justify-center gap-4 w-full"},{children:M.map(((e,t)=>s(y,{data:e,upgradeUrl:W},e.id||t)))}))]})):t("div",Object.assign({className:"text-center mb-8"},{children:[s("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:(null==J?void 0:J["access-locked"])||"Access Locked"})),s("p",Object.assign({className:"opacity-80"},{children:(null==J?void 0:J["this-tool-is-locked-contact-owner"])||"This tool is locked to use. Contact owner for more information."}))]}))})):"login_required"===V&&E?s(v,{}):"login_required"!==V||E?"access_denied"===V?t("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:[t(k,Object.assign({className:"h-[68px] w-[68px] mb-4"},{children:[s(w,{src:null===(ye=ve.data)||void 0===ye?void 0:ye.coverphoto,alt:`${null===(ke=ve.data)||void 0===ke?void 0:ke.formtitle} Logo`}),s(N,{})]})),t("div",Object.assign({className:"text-center mb-6"},{children:[s("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:(null==J?void 0:J["access-denied"])||"Access Denied"})),t("div",Object.assign({className:"w-[400px] text-xl flex justify-center items-start"},{children:[s(O,{className:"h-6 w-6 mr-[-20px] shrink-0"}),s("p",Object.assign({className:"ml-1"},{children:(null==J?void 0:J["no-access-request-access"])||"It looks like you don't have access to these resources. Please request access to continue."}))]}))]})),s("button",Object.assign({className:"px-6 py-2 font-medium rounded-md transition-colors",style:{backgroundColor:T.accent,color:T.accentText,borderRadius:U.cornerRadius},onClick:()=>{e(void 0,void 0,void 0,(function*(){var e,s;const t=M.map((e=>e.accessGroupId));try{const o=yield j.post("/request_access",{data:{sender:$||void 0,studioSessionToken:re,studioId:null===(e=ve.data)||void 0===e?void 0:e.studioid,message:JSON.stringify({toolId:null===(s=ve.data)||void 0===s?void 0:s.formid,deploymentId:B,accessGroupIds:t})}});o.data.success?alert((null==J?void 0:J["access-requested-successfully"])||"Successfully requested access!"):alert(o.data.error)}catch(e){alert(`Couldn't request access. Error: ${e}`)}}))}},{children:(null==J?void 0:J["request-access"])||"Request Access"})),s("span",Object.assign({className:"mt-4 mb-2"},{children:(null==J?void 0:J.or)||"or"})),s("span",Object.assign({className:"font-medium text-lg"},{children:(null==J?void 0:J["sign-in-with-different-account"])||"Sign in with a different account"}))]})):s(p,P?{children:s(x,{})}:{children:s(h,{})}):s("div",Object.assign({className:"flex flex-col items-center justify-center w-full h-full p-4 overflow-y-auto"},{children:t("div",Object.assign({className:"text-center mb-8"},{children:[s("h2",Object.assign({className:"text-2xl font-bold mb-2"},{children:(null==J?void 0:J["access-denied"])||"Access Denied"})),s("p",Object.assign({className:"opacity-80"},{children:(null==J?void 0:J["login-is-required"])||"Login is required."}))]}))}))}));var ye,ke};export{S as Pickaxe};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface StudioTipProps {
|
|
3
|
+
containerClassName?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
content: string;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
strategy?: "absolute" | "fixed";
|
|
8
|
+
align?: "top" | "bottom" | "left" | "right";
|
|
9
|
+
}
|
|
10
|
+
export declare const StudioTip: ({ containerClassName, className, content, children, strategy, align, }: StudioTipProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default StudioTip;
|
package/dist/esm/src/components/Pickaxe/common/PickaxeMarkdown/Components/common/IframeVideo.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ interface IframeVideoProps {
|
|
|
3
3
|
src: string;
|
|
4
4
|
fallback?: string;
|
|
5
5
|
}
|
|
6
|
-
declare const IframeVideo: ({ title, src, fallback
|
|
6
|
+
declare const IframeVideo: ({ title, src, fallback }: IframeVideoProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default IframeVideo;
|