PageSourceSearch

https://seagrassspotter.org/chunk-F33TJLE4.js

js seagrassspotter.org collected 2026-10-02 17:08:10 UTC 6,192 bytes, 10 lines download raw bytes

1import{Oa as v,b as G,c as J}from"./chunk-NYUGFUQL.js";import"./chunk-3M2UTCCC.js";import"./chunk-EVYAXDDZ.js";import"./chunk-MML7HSSY.js";import{a as D}from"./chunk-WGRLQ6DS.js";import{a as V}from"./chunk-LLC5S226.js";import{a as H}from"./chunk-GC4ED4DY.js";import{a as z}from"./chunk-7P27RJDN.js";import{a as j}from"./chunk-OITSX4YX.js";import{a as Z}from"./chunk-FVPSG52T.js";import{e as P,h as W,l as $,m as L,n as R,o as k}from"./chunk-USFOSCCE.js";import{a as q}from"./chunk-JSQY5VOS.js";import{a as A}from"./chunk-A3WGCC4I.js";import"./chunk-BLTQ4L52.js";import"./chunk-GMAVKO4H.js";import"./chunk-2Y5LUAY3.js";import{c as N}from"./chunk-FDSZTAV7.js";import{d as Q}from"./chunk-RQPCUL6Z.js";import{Ab as y,Ac as O,Bb as w,Gb as F,Hb as s,Ib as p,Jb as S,Ra as C,Ub as g,Va as o,Wb as _,_a as f,dc as I,eb as x,fc as d,gc as m,hc as E,lc as M,mc as T,nc as B,xc as a,yc as l}from"./chunk-6XLY2MTM.js";import{h as b,j as h}from"./chunk-SZAW6ZBW.js";var te=b(G(),1),ie=b(J(),1);function K(c,i){if(c&1&&(S(0,"div",20),a(1,"safeHtml")),c&2){let t=_();F("innerHTML",l(1,1,t.mermaidOutput),C)}}function X(c,i){c&1&&S(0,"spotter-spinner")}var U=class c{constructor(i,t,e,n,r){this.http=i;this.species=t;this.toast=e;this.lang=n;r.setTitle("Identify Flowchart"),r.setDescription("View our flowchart for identifying seagrass species")}mermaidOutput;isZoomedIn=!1;bioregion=1;maxWidth;allRegionQuestions;biogregions=["tna","ta","m","tnp","tip"];ngOnInit(){let i=this.lang.language;this.http.get(`./spotter-shared/assets/i18n/${this.lang.language.code}.json?v=`+H).subscribe({next:t=>h(this,null,function*(){this.allRegionQuestions=t.identifyq,this.species.getAllSpecies().subscribe(e=>h(this,null,function*(){yield this.drawFlowchart()}))}),error:t=>{console.error("Unable to load the flowchart data")}})}drawFlowchart(){return h(this,null,function*(){let i=this.allRegionQuestions[this.bioregion],t=this.extractAllQuestions(i),e=this.createMermaidFlowchart(t);var n={startOnLoad:!1,flowchart:{useMaxWidth:!0,nodeSpacing:20,rankSpacing:60,defaultRenderer:"elk"}};v.initialize(n);let{svg:r,bindFunctions:u}=yield v.render("identifyChart",e);this.maxWidth=this.getMaxWidthFromSVG(r),this.isZoomedIn?this.zoomIn():this.zoomOut(),this.mermaidOutput=r})}getMaxWidthFromSVG(i){var t=i.match(/max-width: (-?\d+\.\d+|-?\d+)/g);if(t){var e=t[0].match(/-?\d+\.\d+|\d+/g);if(e)return parseInt(e[0])}}zoomIn(){this.maxWidth!=null?(document.getElementsByClassName("flowchart-scaler")[0]?.setAttribute("style",`width: ${this.maxWidth}px`),this.isZoomedIn=!0):this.toast.showError("Unable to zoom in")}zoomOut(){document.getElementsByClassName("flowchart-scaler")[0]?.setAttribute("style","width: 100%;"),this.isZoomedIn=!1}extractAllQuestions(i){let t=[];for(let e in i.questions)if(i.questions.hasOwnProperty(e)){let n=i.questions[e],r={text:n.question,identifier:e};r.choices=[],n.answers.forEach(u=>{r.choices.push({text:u.text,result:u.next_question??u.species})}),t.push(r)}return t}createMermaidTheme(){let i="";return i=`%%{
2init: {'theme': 'base',`,i+="'themeVariables': {",i+="'fontFamily': 'system-ui, -apple-system, Segoe UI, Roboto, Helvetica Neue, Noto Sans, Liberation Sans, Arial'",i+=`}}
3}%%
4`,i}createMermaidFlowchart(i){let t="";return t+=this.createMermaidTheme(),t+=`flowchart
5`,t+=`classDef whiteText color: white
6`,i.forEach(e=>{t+=`${e.identifier}(${e.text})
7`}),i.forEach(e=>{e.choices&&e.choices.forEach(n=>{if(n.result&&typeof n.result=="number"){let r=this.species.getSpeciesFromId(n.result);t+=`${n.result}([${r?.display_name}])
8`}})}
8),i.forEach(e=>{e.choices&&e.choices.forEach(n=>{typeof n.result=="number"?t+=`${e.identifier} --> |"${n.text}"| ${n.result}:::whiteText
9`:t+=`${e.identifier} --> |"${n.text}"| ${n.result}
10`})}),t}static \u0275fac=function(t){return new(t||c)(f(N),f(V),f(Z),f(z),f(A))};static \u0275cmp=x({type:c,selectors:[["app-identify-flow-chart"]],decls:49,vars:50,consts:[[1,"panel","panel-fill"],[1,"panel-header"],[1,"panel-body"],[1,"chart-container"],[1,"chart-title"],[1,"flowchart-controls"],[1,"row"],[1,"col-sm-4","offset-sm-2"],[1,"bioregion-dev"],[1,"form-select",3,"ngModelChange","change","ngModel"],["value","1"],["value","2"],["value","3"],["value","4"],["value","5"],[1,"col-sm-4"],[1,"btn-group"],[1,"btn",3,"click"],[1,"flowchart-holder"],[1,"flowchart-scaler"],[1,"flowchart-container",3,"innerHTML"]],template:function(t,e){t&1&&(s(0,"div",0)(1,"div",1),d(2),a(3,"translate"),p(),s(4,"div",2)(5,"div",3)(6,"p",4),d(7),a(8,"translate"),a(9,"translate"),a(10,"datainterpreter"),p(),s(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"p"),d(16),a(17,"translate"),p(),s(18,"select",9),B("ngModelChange",function(r){return T(e.bioregion,r)||(e.bioregion=r),r}),g("change",function(){return e.drawFlowchart()}),s(19,"option",10),d(20),a(21,"translate"),p(),s(22,"option",11),d(23),a(24,"translate"),p(),s(25,"option",12),d(26),a(27,"translate"),p(),s(28,"option",13),d(29),a(30,"translate"),p(),s(31,"option",14),d(32),a(33,"translate"),p()()()(),s(34,"div",15)(35,"p"),d(36),a(37,"translate"),p(),s(38,"div",16)(39,"button",17),g("click",function(){return e.zoomIn()}),d(40),a(41,"translate"),p(),s(42,"button",17),g("click",function(){return e.zoomOut()}),d(43),a(44,"translate"),p()()()()(),s(45,"div",18)(46,"div",19),y(47,K,2,3,"div",20),y(48,X,1,0,"spotter-spinner"),p()()()()()),t&2&&(o(2),E(" ",l(3,22,"data.identify.title")," "),o(5),m(O(10,28,l(8,24,"data.identify.region_title"),"regionName",l(9,26,"identify.regions."+e.biogregions[e.bioregion-1]))),o(9),m(l(17,32,"data.identify.bioregion")),o(2),M("ngModel",e.bioregion),o(2),m(l(21,34,"identify.regions.tna")),o(3),m(l(24,36,"identify.regions.ta")),o(3),m(l(27,38,"identify.regions.m")),o(3),m(l(30,40,"identify.regions.tnp")),o(3),m(l(33,42,"identify.regions.tip")),o(4),m(l(37,44,"data.identify.zoom")),o(3),I("btn-primary",e.isZoomedIn)("btn-outline-primary",!e.isZoomedIn),o(),m(l(41,46,"data.identify.full")),o(2),I("btn-primary",!e.isZoomedIn)("btn-outline-primary",e.isZoomedIn),o(),m(l(44,48,"data.identify.fit")),o(4),w(e.mermaidOutput?47:-1),o(),w(e.mermaidOutput?-1:48))},dependencies:[q,k,L,R,$,P,W,Q,j,D],encapsulation:2})};export{U as IdentifyFlowChartComponent};

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.