(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{237:function(e,t){PluginRegistry.add("guide.step",[{guideBlockName:"execute-sparql-query",getSteps:(e,t)=>{const r=t.GuideUtils,n=t.YasguiComponentDirectiveUtil,o=t.toastr,u=t.$translate,i=t.$interpolate,s=t.$location;e.mainAction="execute-sparql-query";const l=document.createElement("code"),a=document.createElement("button");a.className="btn btn-sm btn-secondary",a.innerText=u.instant("guide.step_plugin.execute-sparql-query.copy-to-editor.button"),a.setAttribute("ng-click","copyQuery()");const c=[{guideBlockName:"click-main-menu",options:angular.extend({},{menu:"sparql",showIntro:!0},e)}],p={"-1":'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\nselect * where { \n\t?s ?p ?o .\n?o rdf:type ""\n} limit 100 '};let d=!1;return e.queries.forEach((S,y)=>{const g=S.query;p[y]=g,l.innerText=g,e.queryAsHtmlCodeElement='<div class="shepherd-code">'+l.outerHTML+a.outerHTML+"</div>",c.push({guideBlockName:"input-element",options:angular.extend({},{content:"guide.step_plugin.execute-sparql-query.query-editor.content",url:"/sparql",elementSelector:r.CSS_SELECTORS.SPARQL_EDITOR_SELECTOR,class:"yasgui-query-editor-guide-dialog",beforeShowPromise:()=>n.getOntotextYasguiElementAsync("#query-editor").then(()=>r.waitFor(r.CSS_SELECTORS.SPARQL_EDITOR_SELECTOR,3)).then(()=>r.deferredShow(500)()).catch(e=>{throw t.toastr.error(t.$translate.instant("guide.unexpected.error.message")),e}),onNextValidate:()=>n.getOntotextYasguiElementAsync("#query-editor").then(e=>e.getQuery().then(t=>({yasgui:e,queryFromEditor:t}))).then(({yasgui:t,queryFromEditor:n})=>{const s=r.removeWhiteSpaces(n);if(s!==r.removeWhiteSpaces(g)){if("select*where{?s?p?o.}limit100"!==s&&!d)return r.noNextErrorToast(o,u,i,"guide.step_plugin.execute-sparql-query.query-not-same.error",e),!1;t.setQuery(g)}return d=!0,!0}),initPreviousStep:()=>{if(0===y)return n.setQuery("#query-editor","select * where { \n\t?s ?p ?o .\n} limit 100 \n");return"/sparql"!==s.url()&&s.path("/sparql").search({}),r.waitFor(r.CSS_SELECTORS.SPARQL_EDITOR_SELECTOR).then(()=>n.executeSparqlQuery("#query-editor",g))},scrollToHandler:r.scrollToTop,extraContent:S.queryExtraContent,onScope:e=>{e.copyQuery=()=>n.setQuery("#query-editor",g).then(()=>{})}},e)}),c.push({guideBlockName:"clickable-element",options:angular.extend({},{content:"guide.step_plugin.execute-sparql-query.run-sparql-query.content",url:"/sparql",elementSelector:r.CSS_SELECTORS.SPARQL_RUN_BUTTON_SELECTOR,class:"yasgui-run-button-guide-dialog",onNextClick:e=>n.getOntotextYasguiElementAsync("#query-editor").then(t=>{t.query(),e.next()}),scrollToHandler:r.scrollToTop,canBePaused:!1,initPreviousStep:(e,t)=>{const r=e.ShepherdService.getPreviousStepFromHistory(t);return r.options.initPreviousStep(e,r.options.id).then(()=>e.ShepherdService.getCurrentStepId()===t?Promise.resolve():n.executeSparqlQuery("#query-editor",g))}},e)}),c.push({guideBlockName:"read-only-element",options:angular.extend({},{content:"guide.step_plugin.execute-sparql-query.result-explain.content",url:"/sparql",placement:"top",elementSelector:r.CSS_SELECTORS.SPARQL_RESULTS_SELECTOR,class:"yasgui-query-results-guide-dialog",fileName:e.fileName,scrollToHandler:r.scrollToTop,extraContent:S.resultExtraContent,canBePaused:!1,initPreviousStep:(e,t)=>{if("/sparql"!==s.url())return s.path("/sparql").search({}),r.waitFor(r.CSS_SELECTORS.SPARQL_EDITOR_SELECTOR).then(()=>r.deferredShow(500)()).then(()=>n.executeSparqlQuery("#query-editor",g));const o=e.ShepherdService.getPreviousStepFromHistory(t);return o.options.initPreviousStep(e,o.options.id).then(()=>n.setQuery("#query-editor",g))}},e)})}),c}}])}}]);