Publicador de Conteúdos e Mídias

Um erro ocorreu enquanto processava o modelo.
The following has evaluated to null or missing:
==> themeDisplay.getURLCurrent()?split("/")[2]  [in template "20102#20129#34563606" at line 350, column 41]

----
Tip: It's the final [] step that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----

----
FTL stack trace ("~" means nesting-related):
	- Failed at: #assign friendlyURLTipoCurso = themeD...  [in template "20102#20129#34563606" in function "getTipoCursoFirendlyUrl" at line 350, column 9]
----
1<#-- 
2Name: Unidade Página Modalidades 
3Type: Asset Publisher Widget Template 
4Path: ROOT/assets/unidades-tipos-de-curso/widget-templates/unidades_pagina_modalidades.html 
5--> 
6<#assign prefix = "ssp" /> 
7<#assign companyId = themeDisplay.getCompanyId() /> 
8<#assign siteGroupId = themeDisplay.getSiteGroupId() /> 
9<#assign friendlyUrlTipoCurso = getTipoCursoFirendlyUrl() /> 
10<#assign friendlyUrlUnidade = getUnidadeFirendlyUrl() /> 
11 
12<#assign categoryId = 0 /> 
13 
14<#if friendlyUrlTipoCurso?contains("livre")> 
15   	<#assign tipoCurso = "Livre" /> 
16	<#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
17	<#assign friendlyUrlTemaSecond = getTemaSecondLevelFriendly() /> 
18	<#assign friendlyUrlTemaThird = getTemaThirdLevelFriendly() /> 
19 
20<#-- cursos tecnicos nao tem 2o e 3o nivel de temas conforme prototipo GCR --> 
21<#else> 
22    <#assign tipoCurso = "Técnico" /> 
23    <#assign friendlyUrlTemaFirst = getTemaFirstLevelFriendly() /> 
24	<#assign friendlyUrlTemaSecond = "#erro#" /> 
25	<#assign friendlyUrlTemaThird = "#erro#" /> 
26</#if> 
27 
28<#assign groupService = serviceLocator.findService("com.liferay.portal.kernel.service.GroupLocalService") /> 
29<#assign groupObj = groupService.fetchFriendlyURLGroup(companyId, "/"+friendlyUrlUnidade) /> 
30<#assign groupIdUnidade = groupObj.getGroupId() /> 
31 
32		<#assign journal = getJournalArticle(groupIdUnidade) > 
33		<#if !journal?contains("#erro#")> 
34			 <#assign groupIdUnidade = groupId /> 
35			 <#assign journalArticleUnidade = journal> 
36			<#assign document = saxReaderUtil.read(journalArticleUnidade.getContent()) /> 
37			<#assign rootElement = document.getRootElement() /> 
38			 
39			    <#-- Get fields --> 
40 
41					 <#--  Nome da unidade  --> 
42                    <#assign xPathSelector_nomeUnidadeParaBreadCrumb = saxReaderUtil.createXPath("dynamic-element[@name='nomeUnidade']")> 
43                    <#assign nomeUnidadeParaBreadCrumb = xPathSelector_nomeUnidadeParaBreadCrumb.selectSingleNode(rootElement).getStringValue()> 
44 
45                    <#--  Nome da unidade  --> 
46                    <#assign xPathSelector_nome = saxReaderUtil.createXPath("dynamic-element[@name='nomeUsualUnidade']")> 
47                    <#assign nomeUnidade = xPathSelector_nome.selectSingleNode(rootElement).getStringValue()> 
48 
49                    <#assign xPathSelector_codigoUnidade = saxReaderUtil.createXPath("dynamic-element[@name='codigoUnidade']")> 
50                    <#assign codigoUnidade = xPathSelector_codigoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
51                     
52                        <#if nomeUnidade?? > 
53                            <#assign nome = nomeUnidade > 
54                            <#else> 
55                            <#assign nome = "" > 
56                        </#if> 
57 
58                <#--  Endereço 1  --> 
59 
60                        <#--  Rua  --> 
61                        <#assign xPathSelector_enderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@name='enderecoUnidade']")> 
62                        <#assign enderecoUnidade = xPathSelector_enderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
63 
64                            <#if enderecoUnidade?? > 
65                                <#assign endereco = enderecoUnidade > 
66                                <#else> 
67                                <#assign endereco = "" > 
68                            </#if> 
69 
70                        <#--  número  --> 
71                        <#assign xPathSelector_numEnderecoUnidade = saxReaderUtil.createXPath("dynamic-element[@name='numEnderecoUnidade']")> 
72                        <#assign numeroUnidade = xPathSelector_numEnderecoUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
73 
74                            <#if numeroUnidade?? > 
75                                <#assign numero = numeroUnidade > 
76                                <#else> 
77                                <#assign numero = "" > 
78                            </#if> 
79 
80                        <#--  Bairro  --> 
81                        <#assign xPathSelector_bairroUnidade = saxReaderUtil.createXPath("dynamic-element[@name='bairroUnidade']")> 
82                        <#assign bairroUnidade = xPathSelector_bairroUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
83 
84                            <#if bairroUnidade?? > 
85                                <#assign bairro = bairroUnidade > 
86                                <#else> 
87                                <#assign bairro = "" > 
88                            </#if> 
89                         
90                        <#--  Cidade  --> 
91                        <#assign xPathSelector_cidadeUnidade = saxReaderUtil.createXPath("dynamic-element[@name='cidadeUnidade']")> 
92                        <#assign cidadeUnidade = xPathSelector_cidadeUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
93 
94                            <#if cidadeUnidade?? > 
95                                <#assign cidade = cidadeUnidade > 
96                                <#else> 
97                                <#assign cidade = "" > 
98                            </#if> 
99 
100                        <#--  Cep  --> 
101                        <#assign xPathSelector_cepUnidade = saxReaderUtil.createXPath("dynamic-element[@name='cepUnidade']")> 
102                        <#assign cepUnidade = xPathSelector_cepUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
103 
104                            <#if cepUnidade?? > 
105                                <#assign cep = cepUnidade > 
106                                <#else> 
107                                <#assign cep = "" > 
108                            </#if>  
109 
110            <#-- Fim endereço 1 -->   
111 
112            <#--  Endereço 2  --> 
113 
114                        <#--  Rua  --> 
115                        <#assign xPathSelector_enderecoUnidade2 = saxReaderUtil.createXPath("dynamic-element[@name='enderecoUnidade2']")> 
116                        <#assign enderecoUnidade2 = xPathSelector_enderecoUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
117 
118                            <#if enderecoUnidade2?? > 
119                                <#assign endereco2 = enderecoUnidade2 > 
120                                <#else> 
121                                <#assign endereco2 = "" > 
122                            </#if> 
123 
124                        <#--  número  --> 
125                        <#assign xPathSelector_numeroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@name='numeroUnidade2']")> 
126                        <#assign numeroUnidade2 = xPathSelector_numeroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
127 
128                            <#if numeroUnidade2?? > 
129                                <#assign numero2 = numeroUnidade2 > 
130                                <#else> 
131                                <#assign numero2 = "" > 
132                            </#if> 
133 
134                        <#--  Bairro  --> 
135                        <#assign xPathSelector_bairroUnidade2 = saxReaderUtil.createXPath("dynamic-element[@name='bairroUnidade2']")> 
136                        <#assign bairroUnidade2 = xPathSelector_bairroUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
137 
138                            <#if bairroUnidade2?? > 
139                                <#assign bairro2 = bairroUnidade2 > 
140                                <#else> 
141                                <#assign bairro2 = "" > 
142                            </#if> 
143                         
144                        <#--  Cidade  --> 
145                        <#assign xPathSelector_cidadeUnidade2 = saxReaderUtil.createXPath("dynamic-element[@name='cidadeUnidade2']")> 
146                        <#assign cidadeUnidade2 = xPathSelector_cidadeUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
147 
148                            <#if cidadeUnidade2?? > 
149                                <#assign cidade2 = cidadeUnidade2 > 
150                                <#else> 
151                                <#assign cidade2 = "" > 
152                            </#if> 
153 
154                        <#--  Cep  --> 
155                        <#assign xPathSelector_cepUnidade2 = saxReaderUtil.createXPath("dynamic-element[@name='cepUnidade2']")> 
156                        <#assign cepUnidade2 = xPathSelector_cepUnidade2.selectSingleNode(rootElement).getStringValue()?trim> 
157 
158                            <#if cepUnidade2?? > 
159                                <#assign cep2 = cepUnidade2 > 
160                                <#else> 
161                                <#assign cep2 = "" > 
162                            </#if>  
163 
164            <#-- Fim endereço 2 --> 
165 
166 
167 
168                        <#--  Horário  --> 
169                        <#assign xPathSelector_horarioUnidade = saxReaderUtil.createXPath("dynamic-element[@name='horarioUnidade']")> 
170                        <#assign horarioUnidade = xPathSelector_horarioUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
171 
172                            <#if horarioUnidade?? > 
173                                <#assign horario = horarioUnidade > 
174                                <#else> 
175                                <#assign horario = "" > 
176                            </#if> 
177 
178                        <#--  DDD  --> 
179                        <#assign xPathSelector_dddUnidade = saxReaderUtil.createXPath("dynamic-element[@name='dddTelefoneUnidade']")> 
180                        <#assign dddUnidade = xPathSelector_dddUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
181 
182                            <#if dddUnidade?? > 
183                                <#assign ddd = dddUnidade > 
184                                <#else> 
185                                <#assign ddd = "" > 
186                            </#if> 
187 
188                        <#--  telefone  --> 
189                        <#assign xPathSelector_telefoneUnidade = saxReaderUtil.createXPath("dynamic-element[@name='telefoneUnidade']")> 
190                        <#assign telefoneUnidade = xPathSelector_telefoneUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
191 
192                            <#if telefoneUnidade?? > 
193                                <#assign telefone = telefoneUnidade > 
194                                <#else> 
195                                <#assign telefone = "" > 
196                            </#if>                         
197 
198                        <#--  UF  --> 
199                        <#assign xPathSelector_ufUnidade = saxReaderUtil.createXPath("dynamic-element[@name='ufUnidade']")> 
200                        <#assign ufUnidade = xPathSelector_ufUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
201 
202                            <#if ufUnidade?? > 
203                                <#assign UF = ufUnidade > 
204                                <#else> 
205                                <#assign UF = "" > 
206                            </#if> 
207 
208                        <#-- Estacionamento --> 
209                        <#assign xPathSelector_estacionamento = saxReaderUtil.createXPath("dynamic-element[@name='estacionamentoUnidade']")> 
210                        <#assign estacionamentoUnidade = xPathSelector_estacionamento.selectSingleNode(rootElement).getStringValue()>  
211 
212                            <#if estacionamentoUnidade?? > 
213                                <#assign estacionamento = estacionamentoUnidade > 
214                                <#else> 
215                                <#assign estacionamento = "" > 
216                            </#if> 
217 
218                         <#-- Estacionamento Unidade 2 --> 
219                        <#assign xPathSelector_estacionamento2 = saxReaderUtil.createXPath("dynamic-element[@name='estacionamentoUnidade2']")> 
220                        <#assign estacionamentoUnidade2 = xPathSelector_estacionamento2.selectSingleNode(rootElement).getStringValue()>  
221 
222                            <#if estacionamentoUnidade2?? > 
223                                <#assign estacionamento2 = estacionamentoUnidade2 > 
224                                <#else> 
225                                <#assign estacionamento2 = "" > 
226                            </#if>          
227 
228                        <#--  Facebook  --> 
229                        <#assign xPathSelector_facebookUnidade = saxReaderUtil.createXPath("dynamic-element[@name='facebookUnidade']")> 
230                        <#assign facebookUnidade = xPathSelector_facebookUnidade.selectSingleNode(rootElement).getStringValue()> 
231 
232                            <#if facebookUnidade?? > 
233                                <#assign facebook = facebookUnidade > 
234                                <#else> 
235                                <#assign facebook = "" > 
236                            </#if> 
237 
238                        <#--  Instagram  --> 
239                        <#assign xPathSelector_instagramUnidade = saxReaderUtil.createXPath("dynamic-element[@name='instagramUnidade']")> 
240                        <#assign instagramUnidade = xPathSelector_instagramUnidade.selectSingleNode(rootElement).getStringValue()> 
241 
242                            <#if instagramUnidade?? > 
243                                <#assign instagram = instagramUnidade > 
244                                <#else> 
245                                <#assign instagram = "" > 
246                            </#if> 
247 
248                        <#--  Maps  --> 
249                        <#assign xPathSelector_googlemapsUnidade = saxReaderUtil.createXPath("dynamic-element[@name='googlemapsUnidade']")> 
250                        <#assign googlemapsUnidade = xPathSelector_googlemapsUnidade.selectSingleNode(rootElement).getStringValue()?trim> 
251 
252                            <#if googlemapsUnidade?? > 
253                                <#assign googlemaps = googlemapsUnidade > 
254                                <#else> 
255                                <#assign googlemaps = "" > 
256                            </#if> 
257 
258                        <#assign  hasMaps = (googlemaps?trim?length > 0) > 
259 
260                         
261 
262                        <#--  Waze  --> 
263                        <#assign xPathSelector_wazeUnidade = saxReaderUtil.createXPath("dynamic-element[@name='wazeUnidade']")> 
264                        <#assign wazeUnidade = xPathSelector_wazeUnidade.selectSingleNode(rootElement).getStringValue()> 
265 
266                            <#if wazeUnidade?? > 
267                                <#assign waze = wazeUnidade > 
268                                <#else> 
269                                <#assign waze = "" > 
270                            </#if>    
271 
272                                       
273 
274                                 
275                    <#--  Imagem  --> 
276 
277                    <#assign xPathSelector = saxReaderUtil.createXPath("dynamic-element[@name='imagemUnidade']")> 
278 
279                        <#assign imagemStr = xPathSelector.selectSingleNode(rootElement).getStringValue()> 
280                         
281                        <#if imagemStr?contains("{") > 
282                            <#assign 
283                                imagemJson = jsonFactoryUtil.createJSONObject(imagemStr) 
284                                imagemId = getterUtil.getInteger(imagemJson.get('fileEntryId')) 
285                                dl = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") 
286                                dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] 
287                                fileEntry = dl.getFileEntry(imagemId) 
288                                imagemUrl = dlUtil.getImagePreviewURL(fileEntry, themeDisplay)  
289                            /> 
290                            <#else> 
291                                <#assign imagemUrl = ""> 
292                        </#if> 
293 
294						<#--  Imagem 2  -->     
295						<#assign xPathSelector2 = saxReaderUtil.createXPath("dynamic-element[@name='imagemUnidade2']")> 
296 
297                        <#assign imagemStr2 = xPathSelector2.selectSingleNode(rootElement).getStringValue()> 
298                         
299                        <#if imagemStr2?contains("{") > 
300                            <#assign 
301                                imagemJson2 = jsonFactoryUtil.createJSONObject(imagemStr2) 
302                                imagemId2 = getterUtil.getInteger(imagemJson2.get('fileEntryId')) 
303                                dl = serviceLocator.findService("com.liferay.document.library.kernel.service.DLAppService") 
304                                dlUtil = staticUtil["com.liferay.document.library.kernel.util.DLUtil"] 
305                                fileEntry = dl.getFileEntry(imagemId2) 
306                                imagemUrl2 = dlUtil.getImagePreviewURL(fileEntry, themeDisplay)  
307                            /> 
308                            <#else> 
309                                <#assign imagemUrl2 = ""> 
310                        </#if>     
311 
312						<#--  Estação próxima  -->                     
313						<#assign xPathSelector_estacaoProxima = saxReaderUtil.createXPath("dynamic-element[@name='estacaoProxima']")> 
314			 
315						<#assign estacaoProxima = xPathSelector_estacaoProxima.selectSingleNode(rootElement).getStringValue()> 
316			 
317						<#assign  hasEstacaoProxima = (estacaoProxima?trim?length > 0) > 
318		 	</#if> 
319 
320 <#function getJournalArticle groupId> 
321    <#assign journalArticleService = serviceLocator.findService("com.liferay.journal.service.JournalArticleLocalService") /> 
322    <#assign friendlyURL = getUnidadeFirendlyUrl()> 
323    
324    <#attempt> 
325   
326      <#if !friendlyURL?contains("fragment_collections") > 
327         
328        <#return journalArticleService.getArticleByUrlTitle(groupId,friendlyURL)> 
329         
330      </#if> 
331       
332    <#recover> 
333         
334      <#return '#erro#'> 
335    </#attempt> 
336 </#function> 
337 
338 <#function getUnidadeFirendlyUrl > 
339 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
340 	 <#if friendly?contains("web") > 
341    	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first> 
342    </#if> 
343     
344    <#return friendly /> 
345     
346 </#function> 
347   
348 <#function getTipoCursoFirendlyUrl > 
349 	 
350 	<#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[2]?split("?")?first /> 
351 	<#if friendlyURLTipoCurso?contains("guest") > 
352   	 	<#assign friendlyURLTipoCurso = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first> 
353   	</#if> 
354     	 
355    <#return friendlyURLTipoCurso /> 
356     
357 </#function> 
358 
359 <#function getTemaFirstLevelFriendly > 
360 	 <#attempt> 
361	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
362	 	 <#if !friendly?contains("web") > 
363	 	 	 <#if themeDisplay.getURLCurrent()?split("/")?size gt 3 > 
364	 	 		<#assign friendly = themeDisplay.getURLCurrent()?split("/")[3]?split("?")?first /> 
365	 	 	<#else> 
366	 	 		<#assign friendly = "" /> 
367	 	 	</#if>	 
368	 	 		 
369		<#else> 
370			<#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
371	    	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first> 
372	    	 <#else> 
373	 	 		<#assign friendly = "" /> 
374	 	 	</#if> 
375	     </#if> 
376	      	  
377	    <#return friendly /> 
378    <#recover> 
379     	<#return '#erro#'> 
380    </#attempt> 
381     
382</#function>  
383 
384 <#function getTemaSecondLevelFriendly > 
385 	 <#attempt> 
386	 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
387	 	 
388	 	 <#if !friendly?contains("web") > 
389	 		 <#if themeDisplay.getURLCurrent()?split("/")?size gt 4 > 
390	 		 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[4]?split("?")?first /> 
391	 		 <#else> 
392	 	 		<#assign friendly = "" /> 
393	 	 	</#if>		 
394		<#else> 
395			 <#if themeDisplay.getURLCurrent()?split("/")?size gt 6 > 
396	    		 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[6]?split("?")?first> 
397    		<#else> 
398	 	 		<#assign friendly = "" /> 
399	 	 	</#if>	  
400	    </#if> 
401	 
402	    <#return friendly /> 
403    <#recover> 
404     	<#return '#erro#'> 
405    </#attempt> 
406     
407</#function>  
408  
409 <#function getTemaThirdLevelFriendly > 
410 	 <#attempt> 
411	 	 <#assign friendly = themeDisplay.getURLCurrent()?split("/")[1]?split("?")?first /> 
412	 	  
413	 	 <#if !friendly?contains("web") > 
414	 	 	<#if themeDisplay.getURLCurrent()?split("/")?size gt 5 > 
415	 	 		<#assign friendly = themeDisplay.getURLCurrent()?split("/")[5]?split("?")?first /> 
416	 	 	<#else> 
417	 	 		<#assign friendly = "" /> 
418	 	 	</#if>	 
419		<#else> 
420			<#if themeDisplay.getURLCurrent()?split("/")?size gt 7 > 
421	    	 	<#assign friendly = themeDisplay.getURLCurrent()?split("/")[7]?split("?")?first> 
422	    	<#else> 
423	 	 		<#assign friendly = "" /> 
424	 	 	</#if> 	 
425	    </#if> 
426		    <#return friendly /> 
427    <#recover> 
428     	<#return '#erro#'> 
429    </#attempt> 
430     
431</#function>  
432 
433<style> 
434 
435/*Header Unidade*/ 
436 
437.ssp-header-unidade__content-info-body{ 
438	padding-top:30px; 
439
440 
441.ssp-header-unidade__atendimento-container > p > a { 
442    color:white!important; 
443
444 
445.ssp-header-unidade__atendimento-container > p > a:hover { 
446    color:white!important; 
447    font-weight: normal!important; 
448
449 
450.creditoFotoMob{ 
451 
452    margin: 0 auto; 
453    background: #FFF7D6; 
454    font-family: 'Montserrat'; 
455    font-size: 14px; 
456    line-height: 1.6em; 
457    border-radius: 3px; 
458    max-width: 240px; 
459    height: auto; 
460    color: #4F596F; 
461    padding: 5px; 
462    position: relative;     
463    float: right;     
464    top: 70%; 
465    max-height: 40px; 
466    font-weight: 500; 
467    right: 15%; 
468    flex-wrap: unset; 
469
470 
471.creditoFotoMob:after{ /*Triangulo*/ 
472    content: ""; 
473    width: 0; 
474    height: 0; 
475    position: absolute; 
476    border-left: 10px solid transparent; 
477    border-right: 10px solid transparent; 
478    /*Faz seta "apontar para baixo. Definir o valor como 'top' fará ela "apontar para cima" */ 
479    /*Aqui entra a cor da "aba" do balão */ 
480    border-bottom: 10px solid #FFF7D6; 
481    top: -9px; /*localização. Experimente alterar para 'bottom'*/ 
482    left: 20%; 
483
484.tooltip-inner { 
485    max-width: 230px; 
486    padding: 0.75rem 0.75rem; 
487    color: #4F596F; 
488    text-align: center; 
489    background-color: #FFF7D6; 
490    border-radius: 0.3125rem; 
491
492.bs-tooltip-top .arrow::before, .bs-tooltip-auto[x-placement^="top"] .arrow::before { 
493    top: 0; 
494    border-width: 0.4rem 0.4rem 0; 
495    border-top-color: #FFF7D6; 
496
497.ssp-header-title-bloco { 
498    font-size: 20px; 
499    font-weight: 600; 
500
501 
502.ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
503    height:100%; 
504
505/*#slider { 
506    width: 80%; 
507    max-width: 500px; 
508    height: 25vw; 
509    max-height: 150px; 
510 
511    position: relative; 
512}*/ 
513 
514#slider .ssp-header-unidade__imagem-box-imagem{ 
515    opacity: 0; 
516    position: absolute; 
517    /*width: 100%; 
518    height: 100%;*/ 
519    object-fit: cover; 
520    transition: opacity 2000ms; 
521
522 
523#slider .ssp-header-unidade__imagem-box-imagem.selected {  
524    opacity: 1; 
525
526 
527@media only screen and (max-width: 1024px) { 
528     
529#slider .ssp-header-unidade__imagem-box-imagem{  
530    margin-top: -240px; 
531    height: 248px; 
532 
533
534 .ssp-header-unidade__container-info { 
535    margin-top: 240px!important; 
536
537 
538
539 
540 @media only screen and (max-width: 768px){ 
541 
542  .ssp:not(.liferay-instance) .ssp-header-unidade__imagem-box-imagem{ 
543    height:228px; 
544
545  .ssp-header-title-bloco { 
546    font-size: 14px;     
547}    
548 
549  .creditoFotoMob{ 
550    font-size: 9px!important; 
551    max-width: 161px!important; 
552    max-height: 30px!important; 
553    padding: 8.5px 9.5px!important; 
554    line-height: 0.6em!important; 
555     
556
557}  
558 
559/* Final Header Unidade*/ 
560 
561.btn-nivel-livre-ead{ 
562        background-color: #ff9057; 
563        border-color: #ff9057; 
564        box-shadow: none; 
565
566 
567    .icon-ao-vivo{ 
568    font-size:12px; 
569    margin:0 3px; 
570
571 
572 
573.subtema-ativo{ 
574 
575    color:#fcc080!important; 
576
577 
578.separador-subtemas{ 
579	width:100% !important; 
580	margin-top: -1em !important; 
581    margin-bottom: 2.25rem!important; 
582
583 
584</style> 
585 
586<#if tipoCurso == "Livre"> 
587 
588	<style> 
589	.ssp:not(.liferay-instance) .ativo{ 
590	  background-color: #FF9057!important; 
591	  color:white!important; 
592	  font-weight: 600!important; 
593
594	 
595	.tema-ativo{ 
596	  background-color: #FF9057!important; 
597	  color:white!important; 
598	  font-weight: 600!important; 
599
600	</style> 
601 
602<#else> 
603 
604	<style> 
605	   
606		.ssp:not(.liferay-instance) .ativo{ 
607			background-color: #F7BD23!important; 
608			color: #454F63!important; 
609			font-weight: 600!important; 
610
611		 
612		.tema-ativo{ 
613			background-color: #F7BD23!important; 
614			color: #454F63!important; 
615			font-weight: 600!important; 
616
617 
618		.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
619			background-color: #F7BD23; 
620			color: white; 
621			font-weight: 600 !important; 
622
623		 
624		.subtema.btn-nivel-3.subtema-ativo { 
625			background: #F7BD23!important; 
626			color: white!important; 
627			border-color: #F7BD23!important; 
628
629 
630	</style> 
631 
632</#if> 
633 
634<style> 
635 
636/* css para link no nome da unidade */ 
637 
638.ssp-header-unidade__title a{ 
639     
640    text-decoration: none!important; 
641    font-family: Montserrat; 
642    font-size: 44px; 
643    max-width: 440px; 
644    font-weight: 600!important; 
645    line-height: 1.23; 
646    text-align: left; 
647    color: white; 
648
649 
650.ssp-section-tema__subtitle-curso-section { 
651 
652	margin-left: 40px!important; 
653 
654
655 
656.ssp-page-busca__section-resultado__ver-todos{ 
657	margin-right: 40px!important; 
658
659 
660.submenu-tema-ativo{ 
661  background-color: #34495e!important; 
662  color:white!important; 
663  font-weight: 600!important; 
664
665 
666.submenu-tema-ativo-hover{ 
667  background-color: #34495e!important; 
668  color:white!important; 
669  font-size:50px; 
670  font-weight: 600!important; 
671
672 
673.subtema.btn-nivel-3.subtema-ativo{ 
674	background:#a2acc3!important; 
675	color:white!important; 
676
677 
678.slider-curso>.slick-area__item{ 
679 
680width:100%; 
681	 
682
683 
684.custom-card-curso-tema{ 
685  
686 height:288px!important;  
687   
688
689 
690@media only screen and (max-width: 768px){ 
691	 
692  .ssp:not(.liferay-instance) .custom-card-curso-tema { 
693      width: 100% !important; 
694      height:auto!important; 
695
696   
697   
698  .ssp-page-busca__section-resultado__ver-todos { 
699    display:none; 
700
701   
702  .filtroInscBolsa{ 
703  	display:none!important; 
704
705   
706
707   
708.ssp:not(.liferay-instance) .ssp-container__cursos-sem-slick { 
709    display: flex; 
710    justify-content: center; 
711    flex-wrap: wrap; 
712
713 
714/*Novas funcionalidades*/ 
715	#filtro-temas-nivel-3{ 
716		padding-bottom: 2em; 
717
718	 
719 .switch { 
720          position: relative; 
721          display: inline-block; 
722          width: 63px; 
723          height: 31.5px; 
724          margin: 0; 
725
726         
727        .switch input {  
728          opacity: 0; 
729          width: 0; 
730          height: 0; 
731
732         
733        .slider { 
734          position: absolute; 
735          cursor: pointer; 
736          top: 0; 
737          left: 0; 
738          right: 0; 
739          bottom: 0; 
740          background-color: #ccc; 
741          -webkit-transition: .4s; 
742          transition: .4s; 
743
744         
745        .slider:before { 
746          position: absolute; 
747          content: ""; 
748          height: 21px; 
749          width: 21px; 
750          left: 7px; 
751          bottom: 5.5px; 
752          background-color: white; 
753          -webkit-transition: .4s; 
754          transition: .4s; 
755
756         
757        input:checked + .slider { 
758          background-color: #5ACC75; 
759
760         
761        input:focus + .slider { 
762          box-shadow: 0 0 1px #5ACC75; 
763
764         
765        input:checked + .slider:before { 
766          -webkit-transform: translateX(26px); 
767          -ms-transform: translateX(26px); 
768          transform: translateX(26px); 
769
770         
771        /* Rounded sliders */ 
772        .slider.round { 
773          border-radius: 35px; 
774
775         
776        .slider.round:before { 
777          border-radius: 50%; 
778
779 
780        /* content filter */ 
781 
782        .ssp-slider-check__container{ 
783 
784            display: flex; 
785            justify-content: flex-end; 
786 
787
788 
789        .ssp-slider-check__content-itens{ 
790 
791            display: flex; 
792            width: 640px!important; 
793            justify-content: space-between; 
794             
795
796 
797        .ssp-slider-check__content-item{ 
798 
799            display: flex; 
800            align-items: center; 
801 
802
803 
804        .ssp-slider-check__label{ 
805 
806            font-family: Montserrat; 
807            color: #78849E; 
808            font-size: 16px; 
809            padding-left: 10px; 
810            font-weight: 600; 
811 
812
813		 
814        .ssp-section-tema__container-menu { 
815            padding-bottom: 15px; 
816
817 
818		.ssp-section-tema__subtitle-desconto{ 
819			display: block; 
820			font-size: 30px; 
821
822 
823        @media only screen and (max-width: 1024px) { 
824 
825			.ssp-section-tema__subtitle-desconto{ 
826				font-size: 19px; 
827
828 
829			.ssp-header-unidade__title a{ 
830				 
831				font-size: 24px; 
832
833 
834			.ssp-section-tema__subtitle-curso-section { 
835 
836				margin-left: 0px!important; 
837 
838
839 
840            #filtro-ativo-nivel-2{ 
841                justify-content: center; 
842
843 
844            .ssp-slider-check__label{ 
845 
846                font-size: 11px; 
847 
848
849 
850            .tema-slick-area { 
851     
852                display: flex; 
853                align-items: center; 
854                justify-content: flex-start; 
855                font-size: 0; 
856                flex-wrap: wrap; 
857
858 
859            /* custom  itens */ 
860			 
861			 
862            .ssp-unidade-temas__label-filtre-por{ 
863                font-size: 15px!important; 
864    			padding-left: 5px!important; 
865
866            
867 
868            .ssp-section-tema__container-menu { 
869                height: auto!important; 
870
871 
872            .tema-slick-area-mobile { 
873                display: flex; 
874                align-items: center; 
875                justify-content: center; 
876                font-size: 0; 
877                flex-wrap: wrap; 
878
879 
880            .ssp-section-tema__container-submenu-nivel3 { 
881 
882                justify-content: center; 
883
884             
885             .ssp-slider-check__container{ 
886            	padding-top:10px!important; 
887
888      }      
889</style> 
890 
891<#if tipoCurso == "Livre"> 
892 
893	<style>     
894		@media only screen and (max-width: 768px){      
895			.tema-ativo::after{ 
896				font-family: "Font Awesome 5 Free";  
897				font-weight: 900;  
898				content: "\f00d"; 
899				font-size: 12px; 
900				margin: 0 5px; 
901
902
903	</style>             
904</#if> 
905<style> 
906		@media only screen and (max-width: 768px){      
907			.subtema-ativo::after{ 
908				font-family: "Font Awesome 5 Free";  
909				font-weight: 900;  
910				content: "\f00d"; 
911				font-size: 12px; 
912				margin: 0 5px; 
913
914             
915            .ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile { 
916			    font-family: Montserrat; 
917			    font-size: 16px; 
918			    font-weight: 600; 
919			    line-height: 1.21; 
920			    color: #78849e; 
921			    text-decoration: none !important; 
922			    transition: 0.3s; 
923			    text-align: center !important; 
924   				 padding-left: 7em; 
925
926			 
927			.ssp:not(.liferay-instance) .ssp-page-busca__section-resultado__ver-todos-mobile::after { 
928			    font-family: FontAwesome; 
929			    font-weight: 900; 
930			    content: '\f054'; 
931			    font-size: 12px; 
932			    margin-left: 5px; 
933
934 
935
936 
937        /* Custom css para unidades */ 
938 
939        .ssp-unidade-temas__label-filtre-por{ 
940 
941            font-family: Montserrat; 
942            font-size: 20px; 
943            font-weight: 600; 
944            padding: 15px; 
945            padding-left: 30px; 
946            color: #78849E; 
947 
948
949 
950        .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
951            margin: 15px 10px; 
952           
953
954 
955 
956        .ssp-line-nivel-divisor { 
957            width: 100%; 
958            height: 1px; 
959            background: #78849E; 
960            margin: 15px 0; 
961
962 
963     .ssp-header-unidade__content-info{ 
964            z-index: 0!important; 
965
966 
967        .ssp-btn-tema-mobile--active{ 
968            background-color: #FE9057!important; 
969            color: white!important; 
970
971 
972        .ssp-btn-tema-mobile--active::after{ 
973            font-family: "Font Awesome 5 Free";  
974            font-weight: 900;  
975            content: "\f00d"; 
976            font-size: 12px; 
977            margin: 0 5px; 
978
979 
980        .ssp-btn-subtema-mobile--active{ 
981            background-color: #78849E!important; 
982            color: white!important; 
983
984         
985        
986 
987        /* Botão Visualizar mais */ 
988 
989        .ssp-btn__visualizar-mais-content{ 
990            display: flex; 
991            flex-wrap: nowrap; 
992            align-items: center; 
993            justify-content: center; 
994
995 
996        .ssp-btn__visualizar-mais{ 
997            cursor: pointer; 
998            font-size: 14px; 
999
1000         
1001        #visualizar-mais{ 
1002        	font-family:montserrat; 
1003
1004		 
1005		.tema{ 
1006			box-shadow: none !important; 
1007
1008		.separador-subtemas{ 
1009			margin:10px 0px 30px 0px!important; 
1010
1011		 
1012		.py-5{ 
1013			padding-bottom: 0px!important; 
1014			padding-top: 5px!important; 
1015
1016		 
1017		.ssp-section-tema__title{ 
1018			margin: 40px 0px 25px 0px!important; 
1019
1020@media only screen and (min-width: 1025px){ 
1021	.ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1022		margin-bottom: 20px!important; 
1023
1024	 
1025	.filtroTextoMobile{ 
1026		display: none; 
1027
1028}  
1029 
1030.ssp-section-tema__title{ 
1031	margin: 40px 0px 25px 0px!important; 
1032
1033 
1034.py-5{ 
1035	padding-bottom: 0px!important; 
1036	padding-top: 5px!important; 
1037
1038 
1039.ssp-slider-check__content-itens{ 
1040	display: flex; 
1041	width: 800px!important; 
1042	justify-content: flex-end!important; 
1043
1044 
1045.ssp-slider-check__content-item{ 
1046	display: flex; 
1047	align-items: center; 
1048	padding: 0 20px; 
1049
1050 
1051/* novo botao ver todos os cursos */ 
1052 
1053.ver-todos-cursos-link{ 
1054	color: #78849E!important; 
1055
1056 
1057.ver-todos-cursos-link:hover{ 
1058	color: #515A6B!important; 
1059
1060 
1061.ver-todos-cursos-link:hover p{ 
1062	color: #515A6B!important; 
1063
1064 
1065.custom-card-curso-tema{ 
1066  
1067 height:282px!important;  
1068   
1069
1070 
1071.container-fluid .row{ 
1072	margin: 0 !important; 
1073
1074 
1075 
1076.container-fluid .col-md-12{ 
1077	padding: 0 !important; 
1078
1079 
1080.ver-todos-no-click{ 
1081	text-decoration: none !important; 
1082	pointer-events: none !important; 
1083
1084 
1085.slick-area__item.card-curso-nivel-2 .custom-card-curso-tema__title{ 
1086	height: 70px; 
1087
1088 
1089/*novo forma de exibir o menu de areas*/ 
1090 
1091.ssp:not(.liferay-instance) .ativo { 
1092    background-color: #F7BD23!important; 
1093    color: #454F63!important; 
1094    font-weight: 600 !important; 
1095
1096 
1097.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema { 
1098	font-size: 15px; 
1099	color: #454F63; 
1100
1101 
1102.ssp:not(.liferay-instance) .ssp-section-tema__container-menu-item .tema:hover { 
1103    background-color: #F7BD23; 
1104	color: #454F63!important; 
1105    font-weight: 600 !important; 
1106
1107 
1108.ssp:not(.liferay-instance) .ssp-section-tema__container-menu { 
1109    flex-wrap: wrap; 
1110
1111 
1112.tema i{ 
1113	margin-right: 8px; 
1114
1115 
1116.subtema.btn-nivel-3.subtema-ativo { 
1117    background: #F7BD23!important; 
1118	color: #454F63!important; 
1119	border-color: #F7BD23!important; 
1120
1121 
1122.ssp:not(.liferay-instance) .ssp-section-tema__container-submenu-nivel3 .btn-nivel-3 { 
1123font-weight: 600; 
1124color: #454F63; 
1125
1126 
1127/* Transporte próximo */ 
1128 
1129.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento { 
1130    display:block; 
1131    padding-top: 5px; 
1132
1133 
1134.ssp:not(.liferay-instance) .ssp-header-unidade__endereco-container { 
1135    display: flex; 
1136    align-items: center; 
1137    justify-content: space-between; 
1138    flex-flow: column; 
1139    align-items: flex-start; 
1140    gap: 15px; 
1141
1142 
1143.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a{ 
1144    color:white; 
1145
1146 
1147.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento a:hover{ 
1148    font-weight:normal!important; 
1149
1150 
1151.ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1152    display:inline-block; 
1153    margin: 0; 
1154
1155 
1156.ssp:not(.liferay-instance) .ssp-header-unidade__endereco { 
1157    max-width: 100%; 
1158
1159 
1160@media only screen and (max-width: 768px){ 
1161 
1162    .ssp:not(.liferay-instance) .ssp-header-unidade__container-info .container { 
1163        padding: 0; 
1164
1165 
1166    .ssp:not(.liferay-instance) .ssp-header-unidade__estacionamento p{ 
1167        display:inline; 
1168        font-size: 13px; 
1169
1170
1171 
1172 
1173 
1174</style>      
1175 
1176<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")> 
1177<#assign assetCategoryLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService")> 
1178<#assign groupId = themeDisplay.getSiteGroupId()> 
1179 
1180<#assign vocabularyTemaMercadologico = assetVocabularyLocalService.getGroupVocabulary(groupId, "Tema(Mercadológico)")> 
1181 
1182<input type="hidden" id="ssp-vocabulary-id-tema-mercadologico" value="${vocabularyTemaMercadologico.getVocabularyId()}"> 
1183      
1184      
1185<#--  Header da Unidade  --> 
1186 
1187 
1188<section style="position:relative;"> 
1189    <div class="ssp-header-unidade__imagem-box">     
1190        <div class="ssp-header-unidade__imagem-box-box-linha"></div> 
1191 
1192        <div class="ssp-header-unidade__imagem-box-box-linha2"></div> 
1193 
1194		<div id="slider">      
1195 
1196            <div class="ssp-header-unidade__imagem-box-imagem selected" style="background-image: url(${imagemUrl})">                 
1197 
1198            </div> 
1199        
1200            <#if endereco2?length != 0> 
1201 
1202                <div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(${imagemUrl2})"></div>     
1203 
1204            </#if>     
1205                 
1206             
1207                 
1208        </div> 
1209        <!--div class="ssp-header-unidade__imagem-box-imagem" style="background-image: url(img/bg-fale-com-gente.jpg)"></div--> 
1210 
1211		<#--  dados de compartilhamento  --> 
1212		<@liferay_util["html-top"]> 
1213			<meta name="image" property="og:image" content="${imagemUrl}"> 
1214			<meta property="og:image:width" content="1024"> 
1215		</@> 
1216		<#--  dados de compartilhamento  --> 
1217	 
1218		<#if tipoCurso == "Livre" > 
1219			<div class="ssp-header-tema__tag-tipo-curso"></div> 
1220		<#else> 
1221        	<!-- Tag de Tipo de Curso --> 
1222        	<div class="ssp-header-tema__tag-tipo-curso bg-nivel-tecnico"></div> 
1223			 
1224		</#if> 
1225        <div class="ssp-header-unidade__container-info"> 
1226 
1227            <div class="container"> 
1228 
1229                <div class="ssp-header-unidade__content-info" style="height: auto;"> 
1230 
1231                    <div class="ssp-header-unidade__content-info-container"> 
1232 
1233                        <div> 
1234 
1235                            <div> 
1236                                <small class="ssp-header-unidade__subtitle">Senac</small> 
1237                            </div> 
1238 
1239                            <div class="ssp-header-unidade__title-container"> 
1240 
1241                                <div> 
1242 
1243                                    <h1 class="ssp-header-unidade__title"> 
1244										<a href="https://www.sp.senac.br/${friendlyUrlUnidade}"> 
1245											${nome} 
1246										</a>	 
1247									</h1> 
1248									 
1249 
1250								</div> 
1251								 
1252                                <#-- o código da unidade é usado para referência de unidade no --> 
1253                                <span id="codUnidadeReferencia" class="d-none">${codigoUnidade}</span> 
1254                                <span id="friendlyUnidade" class="d-none">${friendlyUrlUnidade}</span> 
1255                                <span id="friendlyTipoCurso" class="d-none">${friendlyUrlTipoCurso}</span> 
1256                                <span id="nomeUnidadeParaBreadCrumb" class="d-none">${nomeUnidadeParaBreadCrumb}</span> 
1257								 
1258								<#if friendlyUrlTipoCurso?contains("livre")> 
1259                                 	<span id="tipoCursoText" class="d-none">Livre</span> 
1260                                <#else> 
1261                                  	<span id="tipoCursoText" class="d-none">Técnico</span> 
1262                               </#if> 
1263                            	<#if friendlyUrlTemaFirst?contains("#erro#")> 
1264                                 	<span id="friendlyTemaNv1" class="d-none"></span> 
1265                                 <#else> 
1266                                  	<span id="friendlyTemaNv1" class="d-none">${friendlyUrlTemaFirst}</span> 
1267                               </#if> 
1268                                <#if friendlyUrlTemaSecond?contains("#erro#")> 
1269                                 	<span id="friendlyTemaNv2" class="d-none"></span> 
1270                                <#else> 
1271                                  <span id="friendlyTemaNv2" class="d-none">${friendlyUrlTemaSecond}</span> 
1272                               </#if> 
1273                               <#if friendlyUrlTemaThird?contains("#erro#")> 
1274                                 	<span id="friendlyTemaNv3" class="d-none"></span> 
1275                                 <#else> 
1276                                 	 <span id="friendlyTemaNv3" class="d-none">${friendlyUrlTemaThird}</span> 
1277                               </#if> 
1278                                
1279                            </div> 
1280 
1281                        </div> 
1282 
1283                        <div class="ssp-header-unidade__endereco-container"> 
1284 
1285                            <div class="d-flex flex-wrap"> 
1286                                 
1287								<div> 
1288								 
1289									<#if endereco2?length != 0> 
1290										<span class="ssp-header-title-bloco">Bloco I</span><br> 
1291									</#if> 
1292 
1293									<address class="ssp-header-unidade__endereco"> 
1294										${endereco}, ${numero}<br>  
1295										${bairro}, ${cidade} - ${UF}, ${cep} 
1296									</address> 
1297 
1298									<span class="ssp-header-unidade__estacionamento"> 
1299 
1300									<i class="fas fa-car"></i> 
1301 
1302										<#if estacionamento?contains("true")> 
1303											<strong>Possui estacionamento?</strong> Sim 
1304											<#else> 
1305											<strong>Possui estacionamento?</strong> Não 
1306										</#if> 
1307 
1308									</span> 
1309								</div> 
1310 
1311								<#if endereco2?length != 0> 
1312 
1313									<div class="pt-5"> 
1314										<span class="ssp-header-title-bloco">Bloco II</span><br> 
1315										<address class="ssp-header-unidade__endereco"> 
1316											${endereco2}, ${numero2}<br>  
1317											${bairro2}, ${cidade2}, ${cep2} 
1318										</address> 
1319										<span class="ssp-header-unidade__estacionamento"> 
1320											<i class="fas fa-car"></i> 
1321 
1322												<#if estacionamento2?contains("true")> 
1323													<strong>Possui estacionamento?</strong> Sim 
1324													<#else> 
1325													<strong>Possui estacionamento?</strong> Não 
1326												</#if> 
1327 
1328										</span> 
1329									</div> 
1330 
1331								</#if> 
1332 
1333								<#if hasEstacaoProxima> 
1334                                            
1335									<span class="ssp-header-unidade__estacionamento"> 
1336										<i class="fa-solid fa-train-subway" aria-hidden="true"></i> 
1337										<strong>Estação mais próxima:</strong> 
1338										${estacaoProxima} 
1339									</span> 
1340							 
1341								</#if>  
1342 
1343							</div>   
1344 
1345                            <div class="ssp-header-unidade__content-info-maps"> 
1346 
1347 
1348                                <a class="btn btn-nivel border-white ssp-header-unidade__btn" href="${googlemaps}" target="_blank"> 
1349                                    <i class="fas fa-map-marker-alt mr-2 ssp-header-unidade__btn-icon"></i>Google Maps 
1350                                </a> 
1351 
1352	                            <a class="btn btn-nivel border-white ml-2  d-sm-inline-block d-md-none d-lg-none d-xl-none ssp-header-unidade__btn" href="${waze}" target="_blank"> 
1353                                    <i class="fab fa-waze mr-2 ssp-header-unidade__btn-icon"></i>Waze 
1354                                </a> 
1355 
1356                            </div>                         
1357                             
1358                        </div> 
1359 
1360                    </div> 
1361 
1362                    <div class="ssp-header-unidade__content-info-body"> 
1363 
1364                        <div class="ssp-header-unidade__atendimento-container"> 
1365                            <p><strong>Atendimento:</strong></p> 
1366	                        <p>${horario}</p> 
1367                        </div> 
1368                         
1369                    </div> 
1370 
1371                     
1372            </div> 
1373             
1374        </div> 
1375 
1376        </div>  
1377                     
1378    </div> 
1379         
1380 
1381<script> 
1382     
1383    if ( $.trim($('.ssp-header-unidade__title').html()) === 'Santo Amaro'){ 
1384 
1385    $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1386 
1387    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Campos do Jordão'){ 
1388 
1389        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1390 
1391    } else if ( $.trim($('.ssp-header-unidade__title').html()) === 'Águas de São Pedro'){ 
1392 
1393        $('.ssp-header-unidade__subtitle').html('Centro Universitário Senac') 
1394 
1395
1396 
1397//Animação de Crédito da imagem 
1398 
1399$(document).ready(function(){   
1400 
1401    let larguraTela = $(window).width(); 
1402 
1403    if(larguraTela < 1024){ 
1404 
1405        animateCreditImage() 
1406 
1407        $(window).scroll(function() { 
1408            ScrollPagina() 
1409        }); 
1410 
1411    }else{ 
1412 
1413        $(".ssp-header-unidade__imagem-box-imagem" ).mouseover(function() { 
1414            $(".creditoFotoMob").removeClass('d-none') 
1415         
1416        });   
1417 
1418        $(".ssp-header-unidade__imagem-box-imagem" ).mouseout(function() { 
1419                $(".creditoFotoMob").addClass('d-none') 
1420                 
1421        });  
1422 
1423
1424 
1425    //verifica posição do Top 
1426 
1427    function ScrollPagina(){ 
1428 
1429        let scrollPage = $(window).scrollTop(); 
1430 
1431        if(scrollPage == 0){ 
1432 
1433            animateCreditImage() 
1434 
1435
1436
1437 
1438    function animateCreditImage(){ 
1439 
1440        $( ".creditoFotoMob" ).removeClass('d-none').fadeIn( 200 ).delay( 2500 ).fadeOut( 5000 ); 
1441 
1442
1443 
1444    //anima Slider fotos unidades de 
1445 
1446    let time = 5000, 
1447        currentImageIndex = 0, 
1448        images = document 
1449                    .querySelectorAll("#slider .ssp-header-unidade__imagem-box-imagem") 
1450        max = images.length; 
1451 
1452    function nextImage() { 
1453 
1454        images[currentImageIndex] 
1455            .classList.remove("selected") 
1456 
1457        currentImageIndex++ 
1458 
1459        if(currentImageIndex >= max) 
1460            currentImageIndex = 0 
1461 
1462        images[currentImageIndex] 
1463            .classList.add("selected") 
1464
1465 
1466    function start() { 
1467 
1468        let enderecos = document.querySelectorAll('address'); 
1469 
1470        if(enderecos.length >= 2){     
1471 
1472            setInterval(() => { 
1473                // troca de image 
1474                nextImage() 
1475            }, time) 
1476
1477        
1478
1479 
1480    window.addEventListener("load", start) 
1481 
1482});  
1483     
1484</script> 
1485	 
1486 
1487     
1488</section> 
1489 
1490<!--  Fim Header Unidade --> 
1491 
1492 
1493      
1494<#--  Conteúdo dinâmico que carrega os temas, subtemas e cursos  --> 
1495 
1496<section> 
1497 
1498	<div> 
1499 
1500		<h2 class="ssp-section-tema__title"> 
1501		 
1502			Especialização Técnica 
1503 
1504		</h2> 
1505 
1506		<div class="container"> 
1507 
1508			<div> 
1509				<span class="ssp-unidade-temas__label-filtre-por">Selecione uma área:</span> 
1510			</div> 
1511 
1512			<div id="temas" class="ssp-section-tema__container-menu"> 
1513 
1514				<div class="ssp-section-tema__container-menu-item"> 
1515					<a href="#a" class="tema todos" data-nvl="0"> 
1516						<i class="fa-solid fa-dice-d6"></i> 
1517						Todos 
1518					</a> 
1519				</div> 
1520 
1521			</div> 
1522 
1523			<!-- Botão Visualizar Mais --> 
1524 
1525			<div class="ssp-btn__visualizar-mais-content d-md-none d-lg-none d-xl-none"> 
1526 
1527				<p id="visualizar-mais" class="ssp-btn__visualizar-mais">Visualizar mais</p> 
1528 
1529				<i class="fas fa-chevron-down mx-2 visualizar-mais-seta" style="font-size: 14px;"></i> 
1530				 
1531			</div> 
1532 
1533			<!-- filtros ativos para Mobile --> 
1534 
1535			<div id="filtro-ativo" class="tema-slick-area-mobile py-2"> 
1536 
1537				<!-- filtro nivel 1 --> 
1538				<div id="filtro-ativo-nivel-1" class="ssp-section-tema__container-menu-item mega-menu"> 
1539					 
1540				</div> 
1541 
1542				<div id="filtro-ativo-nivel-2" class="container ssp-section-tema__container-submenu-nivel3"> 
1543							 
1544				</div> 
1545 
1546			</div> 
1547 
1548		</div> 
1549 
1550	</div> 
1551 
1552</section> 
1553 
1554<section  id="tema-nivel2-container" 
1555	style="background-color: #e4e8f0;"> 
1556	 
1557	<h2 id="tema-atual" class="ssp-section-tema__title"></h2> 
1558		 
1559	<#--   
1560	<div id="subtemas-lista-mobile" 
1561		class="container d-none ssp-section-tema__container-submenu-nivel3"></div>  --> 
1562 
1563	<div id="filtro-temas-nivel-2" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1564	 
1565	<div id="filtro-temas-nivel-3" class="container ssp-section-tema__container-submenu-nivel3 d-none"></div> 
1566 
1567</section> 
1568 
1569<section id="cursos-por-categoria-container" 
1570	style="background-color: #e4e8f0;padding-bottom:30px"> 
1571 
1572	<section class="py-5" style="background-color: #e4e8f0;"> 
1573 
1574		<div class="container"> 
1575			<!-- <hr class="filtroInscBolsa"> --> 
1576			<div class="filtroTextoMobile">  
1577				<span style="font-family: 'Montserrat';font-size: 15px;font-weight: 600;color: #454F63;" > Filtre por:</span>  
1578			</div> 
1579			<div class="ssp-slider-check__container" style="padding: 20px 0px;" id="container-filtros"> 
1580				<div class="ssp-slider-check__content-itens"> 
1581					<div class="ssp-slider-check__content-item filtroInscBolsa"> 
1582                   		 <span style="font-family: 'Montserrat';font-size: 18px;font-weight: 600;color: #454F63;" >Filtre por: </span> 
1583                    </div> 
1584 
1585					<div class="ssp-slider-check__content-item"> 
1586 
1587						<label id="inscricao-aberta" class="switch"> 
1588							<input id="chkInscricao" type="checkbox"> 
1589							<span class="slider round"></span> 
1590						</label> 
1591			 
1592						<span class="ssp-slider-check__label">Comprar agora</span> 
1593 
1594					</div>					 
1595	 
1596					<div class="ssp-slider-check__content-item"> 
1597	 
1598						<label id="bolsas-estudo" class="switch"> 
1599							<input id="chkBolsa" type="checkbox"> 
1600							<span class="slider azul round"></span> 
1601						</label> 
1602			 
1603						<span class="ssp-slider-check__label">Bolsas de estudo</span> 
1604	 
1605					</div> 
1606	 
1607				</div>     
1608 
1609			</div> 
1610 
1611			<!-- <hr class="filtroInscBolsa"> --> 
1612		</div> 
1613		 
1614		<div id="curso-sem-slick" class="ssp-container__cursos-sem-slick container" style="margin-top:15px;"></div> 
1615 
1616 
1617	</section> 
1618	<div id="filtroSemCurso" class="ssp-bolsa-formulario__card-aviso-atencao d-none container text-left" style="width: 100%;"> 
1619                     
1620        <i class="fas fa-exclamation-circle ssp-bolsa-formulario__card-aviso-atencao-icon" aria-hidden="true"></i> 
1621     
1622        <div class="ssp-bolsa-formulario__card-aviso-texto""><p>Sem cursos para o filtro selecionado</p> 
1623        </div> 
1624     
1625     </div> 
1626	 
1627	 
1628</section> 
1629 
1630 
1631<#-- Template para card de cursos por categoria --> 
1632<section id="cursos-por-categoria-template" 
1633	class="cursos-por-categoria ssp-section container d-none"> 
1634 
1635 
1636	<div class="ssp-page-busca__section-resultado-container" 
1637		id="container-slider-cursos-livres"> 
1638 
1639		<a href="#a" data-nvl="" data-tema="" 
1640			class="ver-todos-cursos-link d-none-mobile"> 
1641		<p 
1642			class="ssp-page-busca__section-resultado__title-outros tema-nome ssp-section-tema__subtitle-curso-section"></p></a> 
1643			 
1644	</div> 
1645 
1646	<div class="slider-curso" style="display: flex;"></div> 
1647 
1648</section> 
1649 
1650<#-- Section para o item de curso--> 
1651<div id="curso-item-template" class="d-none slick-area__item"> 
1652 
1653	<div class="ssp-card-curso custom-card-curso-tema"> 
1654 
1655		<a class="ssp-absolute-link ck-curso" href="#a"></a> 
1656 
1657		<div class="ssp-card-curso__image custom-card-curso-tema__image"> 
1658 
1659			<div class="ssp-image-container"> 
1660				<img src="" /> 
1661 
1662			</div> 
1663 
1664		</div> 
1665 
1666		<div class="ssp-card-curso__body custom-card-curso-tema__body"> 
1667        	<!-- Tag de Tipo de Curso --> 
1668			<#if tipoCurso == "Livre" > 
1669				<div class="ssp-card-curso__color-tag-modalidade bg-nivel-livre custom-card-curso-tema__color-tag-modalidade"></div> 
1670			<#else> 
1671     			<div class="ssp-card-curso__color-tag-modalidade bg-nivel-tecnico custom-card-curso-tema__color-tag-modalidade"></div> 
1672			 
1673			</#if> 
1674			 
1675 
1676			<div class="ssp-card-curso__tags custom-card-curso-tema__tags"> 
1677 
1678				<span class="ssp-card-curso__tag-formato-title">${tipoCurso}</span> 
1679				 
1680				<span class="tag-modalidade-title__senac-online d-none">Senac Online - ao vivo</span> 
1681 
1682			</div> 
1683 
1684			<h6 class="ssp-card-curso__title custom-card-curso-tema__title"> 
1685 
1686			</h6> 
1687 
1688			<div class="ssp-card-curso__info custom-card-curso-tema__info"> 
1689 
1690				<span 
1691					class="ssp-tag bg-white border-nivel-extensao text-nivel-extensao mr-1 btn-inscricoes-abertas">Inscrições 
1692					abertas</span> <span 
1693					class="ssp-tag bg-white border-primary text-primary btn-bolsas">Bolsas</span> 
1694 
1695			</div> 
1696						 
1697		</div> 
1698 
1699	</div> 
1700 
1701</div> 
1702 
1703<#--  Estrutura com botões de tipos de curso -  os únicos que precisam ser dinâmicos são Livre e Técnico  --> 
1704 
1705<section class="ssp-section ssp-section-lg-top"> 
1706 
1707 
1708    <div class="container text-left"> 
1709 
1710        <h2 class="ssp-section-title"> 
1711            <lfr-editable id="title" type="rich-text"> 
1712                Cursos oferecidos 
1713            </lfr-editable> 
1714        </h2> 
1715     
1716        <div class="ssp-btns-horizontal-area"> 
1717 
1718			<#function getCategorias primaryKey> 
1719   
1720			<#assign categoryService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetCategoryLocalService") /> 
1721			<#attempt> 
1722		   
1723				<#return categoryService.getCategories("com.liferay.journal.model.JournalArticle", primaryKey)> 
1724		   
1725			<#recover> 
1726			   
1727			  <#return '#erro#'> 
1728			</#attempt> 
1729		  </#function> 
1730 
1731			<#assign  
1732			 
1733 
1734				categoriesList = getCategorias(journal.getResourcePrimKey())  
1735				normalizer = serviceLocator.findService("com.liferay.portal.kernel.util.FriendlyURLNormalizerUtil")  
1736				vocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService") 
1737				vocabularies = vocabularyLocalService.getAssetVocabularies(-1,-1) 
1738				 
1739			/> 
1740 
1741 
1742			<#list vocabularies as vocabulary > 
1743			<#if vocabulary.getName() == 'Unidades'> 
1744				 
1745				<#assign  
1746					xPathSelector_nomeUsualUnidade = saxReaderUtil.createXPath("dynamic-element[@name='nomeUsualUnidade']") 
1747					  nomeUsual = xPathSelector_nomeUsualUnidade.selectSingleNode(rootElement).getStringValue() 
1748					  categories = vocabulary.getCategories() 
1749
1750				<#list categories as category> 
1751					<#if  category.getName()?trim == nomeUsual?trim> 
1752						 
1753						<#assign categoryId = category.getCategoryId() > 
1754					</#if> 
1755				</#list> 
1756			</#if> 
1757		</#list> 
1758 
1759 
1760 
1761		<#-- Prefixo EAD--> 
1762        <#assign xPathSelector_urlEAD = saxReaderUtil.createXPath("dynamic-element[@name='prefixourlead']")> 
1763        <#assign prefixoURLEAD = xPathSelector_urlEAD.selectSingleNode(rootElement).getStringValue()> 
1764 
1765        <#assign  hasPrefixoUrlEad = (prefixoURLEAD?trim?length > 0) > 
1766 
1767 
1768			<#list categoriesList![] as category> 
1769  
1770                <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
1771  
1772                <#if normalizer.normalize(vocabularyName) == "tipo-de-curso"> 
1773					<#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
1774					 
1775					<#if category.getName() == "Livre EAD"> 
1776                    <a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">Senac Online<i class="fas fa-signal-stream icon-ao-vivo" aria-hidden="true"></i>ao vivo</a> 
1777                    <#else> 
1778                        <a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a> 
1779                    </#if> 
1780					 
1781 
1782                </#if> 
1783  
1784			</#list> 
1785 
1786			<#-- Verifica se a unidade oferta curso de Idiomas--> 
1787 
1788                <<#list categoriesList![] as category> 
1789 
1790                    <#assign vocabularyName = vocabularyLocalService.getVocabulary(category.getVocabularyId()).getTitle("pt-br")?trim /> 
1791 
1792                    <#if normalizer.normalize(vocabularyName) == "tema-mercadologico-">  
1793 
1794						<#assign normalizedCategoryName = normalizer.normalize(category.getName()) /> 
1795 
1796						<#if category.getName() == "Idiomas"> 
1797								<a href="#" data-categoryId="${category.getCategoryId()}" class="btn btn-nivel btn-nivel-${normalizedCategoryName}">${category.getName()}</a> 
1798							<#else> 
1799						</#if> 
1800 
1801                    </#if> 
1802 
1803                </#list>  
1804 
1805            <#-- Verifica se a unidade oferta curso livre--> 
1806 
1807			 
1808			<#if hasPrefixoUrlEad > 
1809 
1810                <a href="${prefixoURLEAD}" target="_blank" class="btn btn-nivel btn-nivel-ead">EAD</a> 
1811 
1812            </#if> 
1813     
1814 
1815	</div> 
1816 
1817    </div> 
1818 
1819 
1820</section> 
1821  
1822 <script> 
1823  
1824var temas = []; 
1825var subtemasStorage = new Map(); 
1826var activeCategory = 'all'; 
1827var activeCategoryLevel = 0; 
1828var limit = 2; 
1829var offset = 0; 
1830var todosText = ''; 
1831var limitTodosCursos = 16; 
1832var offsetTodosCursos = 0; 
1833var groupId = 0; 
1834var tipoCursoNome = ""; 
1835var tipoCursoNomeBreadCrumb = ""; 
1836var cookieName = ""; 
1837var tam = $(window).width(); 
1838var urlUnidade = ""; 
1839var urlTipoCurso = "";  
1840var categoryIdUnidade = ""; 
1841var urlTemasStorage = new Map(); 
1842var urlTemaNv1 = ""; 
1843var urlTemaNv2 = ""; 
1844var urlTemaNv3 = ""; 
1845var acessoDireto = 0; 
1846var categoryIdTemaNv1 = ""; 
1847var categoryIdTemaNv2 = ""; 
1848var categoryIdTemaNv3 = ""; 
1849const HOST = window.location.origin; 
1850var filtrarInscricoesAbertas = 0; 
1851var filtrarBolsaEstudo = 0; 
1852var activeModeloExibicao = 1; 
1853var limitCursos = tam <= 1024 ? 4 : 11; 
1854var cliqueFiltroMobile = 0; 
1855var idModalidadeEspecTecnica = 0; 
1856 
1857const codModalidadeEspecTecnica = 10; 
1858var urlSearchModalidadeEspecTecnica = '/o/senac-category-services/categoryByVocabularyNameAndProperty/{groupId}/Modalidade/codModalidade/' + codModalidadeEspecTecnica; 
1859var urlSearchCursos = '/o/senac-unidade-services/cursosPorCategoriaETemaEUnidade/{groupId}/{categoryTemaId}/{categoriaId}/{unidadeCategoryId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{start}/{end}'; 
1860var urlCursosPorTipoCursoETemaComFiltrosBolsaECompra = "/o/senac-content-services/cursosPorCategoriasComFiltrosBolsaECompra/{groupId}/{filtrarInscricoesAbertas}/{filtrarBolsaEstudo}/{considerarUnidade}/{start}/{end}?categoryIds={categoryTemaId}&categoryIds={categoriaId}&categoryIds={unidadeCategoryId}" 
1861var urlSearchTemas = '/o/senac-unidade-services/temasPorCategoriaEUnidade/{groupId}/{unidadeCategoryId}/{categoriaId}/{nivelTema}/{categoriaParentId}'; 
1862 
1863let categorias = [] 
1864 
1865function montaBreadCrumb(){ 
1866	var breadCrumb = $(".breadcrumb"); 
1867	var nomeUnidade = $("#nomeUnidadeParaBreadCrumb").text().trim(); 
1868	 
1869	breadCrumb.empty(); 
1870	 
1871	//Home 
1872	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/" title="Home"><span class="breadcrumb-text-truncate">Home</span></a></li>'); 
1873	 
1874	//Unidades 
1875	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/unidades" title="Unidades"><span class="breadcrumb-text-truncate">Unidades</span></a></li>'); 
1876	 
1877	//Unidade 
1878	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+urlUnidade+'" title="'+nomeUnidade+'"><span class="breadcrumb-text-truncate">'+nomeUnidade+'</span></a></li>'); 
1879	 
1880	//Tipo de Curso 
1881	breadCrumb.append('<li class="breadcrumb-item"><a class="breadcrumb-link" href="/'+urlUnidade+'/'+urlTipoCurso+'" title="'+tipoCursoNomeBreadCrumb+'"><span class="breadcrumb-text-truncate">'+tipoCursoNomeBreadCrumb+'</span></a></li>'); 
1882	 
1883
1884 
1885function carregaLinkTodosBotoesModalidades(){ 
1886 
1887	$( document ).ready(function() { 
1888		 
1889        var friendlyUrlUnidade = $("#friendlyUnidade").text().trim(); 
1890 
1891        // extensão 
1892        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-extensao'))){ 
1893 
1894            $('.ssp-btns-horizontal-area').find('.btn-nivel-extensao').attr("href", "https://www.sp.senac.br/jsp/default.jsp?template=1588.dwt&testeira=725&type=X&unit=NONE&sub=") 
1895 
1896
1897 
1898        // Ensino Médio 
1899        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-ensino-medio-tecnico'))){ 
1900 
1901            $('.ssp-btns-horizontal-area').find('.btn-nivel-ensino-medio-tecnico').attr({ 
1902                href : "http://www1.sp.senac.br/hotsites/sites/ensinomedio/", 
1903                target: "_blank" 
1904            }) 
1905 
1906
1907 
1908 
1909        // Graduação 
1910        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-graduacao'))){ 
1911        	 
1912        	var urlGraduacao = "/"+friendlyUrlUnidade+ "/graduacao"; 
1913 
1914            $('.ssp-btns-horizontal-area').find('.btn-nivel-graduacao').attr("href", urlGraduacao); 
1915             
1916
1917 
1918        // Pos-Graduação 
1919        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-pos-graduacao'))){ 
1920 
1921            $('.ssp-btns-horizontal-area').find('.btn-nivel-pos-graduacao').attr({ 
1922                href: "/"+friendlyUrlUnidade+ "/pos-graduacao", 
1923                target: "_blank" 
1924            }) 
1925 
1926
1927 
1928        // livre 
1929        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-livre'))){ 
1930                 
1931            var urlLiv = "/"+friendlyUrlUnidade+ "/cursos-livres"; 
1932             
1933            //Solucao temporaria, ate o proxy estiver correto 
1934            if(friendlyUrlUnidade == "senac-tatuape-luis-americano" || friendlyUrlUnidade == "centro-universitario-senac-campos-do-jordao")  
1935                urlLiv = "/busca?q=*&tipo-curso="+$('.ssp-btns-horizontal-area').find('.btn-nivel-livre').data('categoryid')+"&unidade="+${categoryId}+'#c'; 
1936             
1937				$('.ssp-btns-horizontal-area').find('.btn-nivel-livre').attr("href", urlLiv); 
1938 
1939
1940		 
1941		 // livre Ao vivo 
1942		 if (($('.ssp-btns-horizontal-area').find('.btn-nivel-livre-ead'))){ 
1943 
1944			$('.ssp-btns-horizontal-area').find('.btn-nivel-livre-ead').attr({ 
1945 
1946				href : "https://www.sp.senac.br/cursos-livres-senac-online-ao-vivo" 
1947			}) 
1948 
1949
1950 
1951		// Regra para Botão de Idiomas 
1952 
1953        if( 
1954 
1955            $('#codUnidadeReferencia').text() === "123" ||  
1956            $('#codUnidadeReferencia').text() === "23" ||  
1957            $('#codUnidadeReferencia').text() === "58" ||  
1958            $('#codUnidadeReferencia').text() === "32" ||  
1959            $('#codUnidadeReferencia').text() === "62" && $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas') 
1960             
1961        ) { 
1962 
1963            var urlIdi = "/"+friendlyUrlUnidade+ "/cursos-livres/idiomas"; 
1964 
1965            $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas').attr("href", urlIdi); 
1966 
1967        }else{ 
1968            $('.ssp-btns-horizontal-area').find('.btn-nivel-idiomas').addClass("d-none") 
1969
1970 
1971        // Técnicos 
1972        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-tecnico'))){ 
1973 
1974            var urlTec = "/"+friendlyUrlUnidade+ "/cursos-tecnicos"; 
1975             
1976        //Solucao temporaria, ate o proxy estiver correto 
1977        if(friendlyUrlUnidade == "senac-tatuape-luis-americano" || friendlyUrlUnidade == "centro-universitario-senac-campos-do-jordao")  
1978            urlTec = "/busca?q=*&tipo-curso="+$('.ssp-btns-horizontal-area').find('.btn-nivel-tecnico').data('categoryid')+"&unidade="+${categoryId}+'#c'; 
1979         
1980            $(this).find('.btn-nivel-tecnico').attr("href", urlTec); 
1981 
1982
1983 
1984        // Jovem Aprendiz 
1985        if (($('.ssp-btns-horizontal-area').find('.btn-nivel-jovem-aprendiz'))){ 
1986 
1987            $(this).find('.btn-nivel-jovem-aprendiz').attr({ 
1988                href: "/jovem-aprendiz", 
1989            }) 
1990 
1991
1992 
1993 
1994    }); 
1995 
1996 
1997
1998 
1999function carregaLinkBotoesLivreETecnico(){ 
2000	 
2001	urlUnidade = $("#friendlyUnidade").text().trim(); 
2002	urlTipoCurso = $("#friendlyTipoCurso").text().trim();  
2003		 
2004	$.ajax({ 
2005	 
2006		url : '/o/senac-content-services/url-tipos-de-curso/'+groupId, 
2007		type : 'get', 
2008		dataType: 'json', 
2009	 
2010	}).done(function(res) { 
2011		$(res).each(function(key , value){ 
2012			 
2013			if(value.name == 'tecnico'){ 
2014				//botao livre 
2015				$("#linkTecnico").attr('href', "/"+urlUnidade+"/"+value.friendlyURL); 
2016				 
2017			}else 
2018				 if(value.name == 'livre'){ 
2019			 
2020					 $("#linkLivre").attr('href', "/"+urlUnidade+"/"+ value.friendlyURL); 
2021					  
2022
2023			 
2024		 
2025		}); 
2026		 
2027	}); 
2028 
2029	 
2030 
2031
2032 
2033//verifica se usuario acessou direto pelas urls dos temas e carrega os temas para dar sequencia 
2034function verificaAcessoDiretoELoadTema(){ 
2035	 
2036	urlTemaNv1 = $("#friendlyTemaNv1").text().trim(); 
2037	urlTemaNv2 = $("#friendlyTemaNv2").text().trim(); 
2038	urlTemaNv3 = $("#friendlyTemaNv3").text().trim(); 
2039	 
2040	//tem tema de nivel 1 na url 
2041	if(urlTemaNv1 != ''){ 
2042		 
2043		//seta variavel global para checar de outras partes se necessario 
2044		acessoDireto = 1; 
2045		 
2046		$.ajax({ 
2047			url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+urlTemaNv1+"/"+0, 
2048			type : 'get', 
2049			dataType: 'json' 
2050		}) 
2051		.done(function(temaCategories) { 
2052			 
2053			categoryIdTemaNv1 = temaCategories[0].categoryId; 
2054			 
2055			//armazenando no map para nao precisar ficar buscando a url quando clicar nos temas  
2056			urlTemasStorage.set(categoryIdTemaNv1,urlTemaNv1); 
2057			 
2058			if(urlTemaNv2 == ""){ 
2059				carregaTemasNivelDireto(1); 
2060			}else{ 
2061				//buscando categoria do tema nivel 2 
2062				$.ajax({ 
2063					url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+urlTemaNv2+"/"+categoryIdTemaNv1, 
2064					type : 'get', 
2065					dataType: 'json' 
2066				}) 
2067				.done(function(temaCategories2) { 
2068					 
2069						 
2070					categoryIdTemaNv2 = temaCategories2[0].categoryId; 
2071					urlTemasStorage.set(categoryIdTemaNv2,urlTemaNv2); 
2072					 
2073					if(urlTemaNv3 == ""){ 
2074						carregaTemasNivelDireto(2); 
2075					}else{ 
2076						 
2077						//buscando categoria do tema nivel 3 
2078						$.ajax({ 
2079							url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+urlTemaNv3+"/"+categoryIdTemaNv2, 
2080							type : 'get', 
2081							dataType: 'json' 
2082						}) 
2083						.done(function(temaCategories3) { 
2084							categoryIdTemaNv3 = temaCategories3[0].categoryId; 
2085							urlTemasStorage.set(categoryIdTemaNv3,urlTemaNv3); 
2086							carregaTemasNivelDireto(3); 
2087							 
2088						}); 
2089						 
2090
2091				}); 
2092
2093			 
2094		}); 
2095		 
2096	//nao tem tema na url entao carrega tudo normal 
2097	}else{ 
2098		carregaTemas(); 
2099		$('#tema-atual').text("Todos os cursos"); 
2100		todosText = $('#tema-atual').text(); 
2101
2102 
2103 
2104
2105 
2106// Verificar se a url em parametro de bolsas 
2107 
2108function verificaUrlBolsa(){ 
2109 
2110	let urlPage = window.location.href; 
2111	let parametroBolsa = "?bolsa:true" 
2112	let verificaURL = urlPage.includes(parametroBolsa) 
2113 
2114	if(verificaURL == true){ 
2115 
2116		$('#bolsas-estudo input').trigger( "click" ); 
2117 
2118
2119 
2120
2121 
2122/* Prepara a montagem inicial da página */ 
2123function init() { 
2124	 
2125 
2126	tipoCursoNomeBreadCrumb = "Cursos Técnicos"; 
2127	tipoCursoNome = "Técnico"; 
2128	cookieName = "ck-cursos-tecnico";	 
2129 
2130	const urlParams = new URLSearchParams(window.location.search) 
2131	  $('#chkInscricao').prop("checked", urlParams.get('inscricao') == 'true') 
2132	  $('#chkInscricao').prop("checked") ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0 
2133	  $('#chkInscricao').change(ev => selectFilter('inscricao', $('#chkInscricao')) ) 
2134	   
2135	  if($('#chkBolsa').length) { 
2136	   $('#chkBolsa').prop("checked", urlParams.get('bolsa') == 'true') 
2137	   $('#chkBolsa').prop("checked") ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0 
2138	   $('#chkBolsa').change(ev => selectFilter('bolsa', $('#chkBolsa')) ) 
2139	     
2140	  }  
2141 
2142	 
2143	groupId = Liferay.ThemeDisplay.getScopeGroupId(); 
2144	 
2145	 
2146	carregarCategorias(); 
2147	setCategoryIds(); 
2148
2149 
2150function carregarCategorias() { 
2151	if(!categorias.length) { 
2152		const searchParams = new URLSearchParams({ 
2153			companyId: themeDisplay.getCompanyId(), 
2154			groupIds: themeDisplay.getScopeGroupId(), 
2155			parentCategoryIds: 0, 
2156			vocabularyIds: document.querySelector('#ssp-vocabulary-id-tema-mercadologico').value 
2157		}) 
2158 
2159		$.ajax({ 
2160			url : '/o/senac-category-services/categories?' + searchParams.toString(), 
2161			method : 'get', 
2162			async: false 
2163		}) 
2164		.done(data => categorias = data) 
2165		.fail(err => console.error(err)) 
2166
2167
2168 
2169function selectFilter(paramkey, el) { 
2170	 setUrlParam(paramkey, el.prop("checked"))   
2171
2172 
2173function setUrlParam(key, value) { 
2174	 const url = new URL(window.location.href) 
2175	 if(value) 
2176	 	url.searchParams.set(key, value); 
2177	 else 
2178	 	url.searchParams.set(key, false); 
2179	 window.history.pushState({}, '', url.toString()) 
2180
2181 
2182 
2183 
2184 
2185$(document).ready(function() { 
2186	 
2187	init(); 
2188	 
2189	//Associa eventos 
2190	$(document).on("click", ".ver-todos-cursos-link", verTodosCursos); 
2191	$(document).on("click", ".card-ver-todos-cursos-link", verTodosCursos); 
2192 
2193 
2194}); 
2195 
2196 
2197//Função que carrega os 5 primeiros Temas e utiliza o botão Visualizar mais e menos na versão Mobile 
2198 
2199function exibeTemasMobile(){ 
2200 
2201   //seleciona todos os temas 
2202	var itensTema = $('#temas').children() 
2203	var itensExibidos = 6 
2204 
2205	//mostra apenas os 5 primeiros 
2206	itensTema.slice(itensExibidos).hide() 
2207 
2208	//Verifica a quantidade de temas e se exibe ou nao o botao ver mais  
2209	if( itensTema.length < itensExibidos){ 
2210 
2211		$('.ssp-btn__visualizar-mais-content').addClass('d-none') 
2212 
2213	}else{ 
2214		$('.ssp-btn__visualizar-mais-content').removeClass('d-none') 
2215
2216 
2217	//Mostra apenas os 5 primeiros temas 
2218	//$('#temas').children().slice(3).hide() 
2219 
2220 
2221 
2222
2223 
2224// mobile - botao visualiza mais/menos 
2225if(tam <= 1024){ 
2226	// Botao ver mais e menos Temas 
2227	$(document).on("click", '#visualizar-mais',function(){ 
2228			var itensTema = $('#temas').children() 
2229			var itensExibidos = 6; 
2230			 
2231			if( $(this).text() === "Visualizar mais" ){ 
2232	 
2233				itensTema.slice(itensExibidos).show(); 
2234	 
2235				$(this).text('Visualizar menos'); 
2236				 
2237				$(this).parent().find('i').removeClass('fa-chevron-down'); 
2238				 
2239				$(this).parent().find('i').addClass('fa-chevron-up'); 
2240				 
2241	 
2242			}else{ 
2243	 
2244				itensTema.slice(itensExibidos).hide(); 
2245	 
2246				$(this).text('Visualizar mais'); 
2247	 
2248				$(this).parent().find('i').removeClass('fa-chevron-up'); 
2249				 
2250				$(this).parent().find('i').addClass('fa-chevron-down'); 
2251				 
2252			}      
2253	}) 
2254 
2255
2256function resetTemasMobile(){ 
2257    $('.todos').trigger('click'); 
2258     
2259    if($('#visualizar-mais').text() === "Visualizar menos"){ 
2260    	$('#visualizar-mais').text("Visualizar mais"); 
2261    	$('#visualizar-mais').parent().find('i').removeClass('fa-chevron-up'); 
2262    	$('#visualizar-mais').parent().find('i').addClass('fa-chevron-down'); 
2263
2264     
2265    $('#visualizar-mais').removeClass('d-none'); 
2266
2267 
2268// Botao para filtro de cursos com inscricoes abertas e bolsas 
2269$('#inscricao-aberta input, #bolsas-estudo input').click(function(){ 
2270	 
2271	if(tam <= 1024){ 
2272		//mobile quando clica no tema/subtema volta ao nivel anterior, esta flag serve para nos eventos de click nao fazer isso 
2273		cliqueFiltroMobile = 1; 
2274
2275	 
2276   
2277  //Atualiza as variaveis globais dos dois filtros 
2278  $("#inscricao-aberta input").is(":checked") == true ? filtrarInscricoesAbertas = 1 : filtrarInscricoesAbertas = 0; 
2279  $("#bolsas-estudo input").is(":checked") == true ? filtrarBolsaEstudo = 1 : filtrarBolsaEstudo = 0; 
2280   
2281  //Refaz a busca com os filtros atualizados 
2282  switch(activeModeloExibicao){ 
2283    case 1: 
2284    	  
2285    case 2: 
2286       
2287      //Verifica se esta exibindo todos ou algum tema 
2288      var botaoTodos = $('.todos'); 
2289       
2290      if(botaoTodos.hasClass('ativo') || botaoTodos.hasClass('tema-ativo'))  
2291          $('.todos:first').trigger('click'); 
2292       
2293      //Se estiver ativo um tema, verifica se possui ativo um subtema 
2294      else 
2295        //Verifica o nivel do tema clicado 
2296        $('.subtema-ativo').length == 0 ? $('.tema-ativo:first').trigger('click') : $('.subtema-ativo:first').trigger('click'); 
2297        break; 
2298 
2299      case 3: 
2300    	  $('.subtema-ativo').length == 0 ? $('.tema-ativo:first').trigger('click') : $('.subtema-ativo:last').trigger('click'); 
2301      break; 
2302
2303}) 
2304 
2305//nivel 0 -> botao todos 
2306function atualizaUrlBrowser(urlTema,nivel){ 
2307	var path = window.location.pathname; 
2308	var urlFinal = ""; 
2309	 
2310	if(path.indexOf('staging') > 1){ 
2311		urlFinal = "/web/guest-staging"; 
2312	}else 
2313		if(path.indexOf('guest') > 1){ 
2314			urlFinal = "/web/guest"; 
2315
2316		 
2317	urlFinal += "/"+urlUnidade+"/"+urlTipoCurso;	 
2318	 
2319	//se for todos os cursos a url fica so /unidade/tipo-curso 
2320	if(nivel > 0){ 
2321 
2322		switch(nivel){ 
2323		 
2324			case 1: 
2325				urlTemaNv1 = urlTema; 
2326				urlFinal += "/"+urlTemaNv1; 
2327			break; 
2328			 
2329			case 2: 
2330				urlTemaNv2 = urlTema; 
2331				if(tipoCursoNome == "Livre"){ 
2332					urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2; 
2333				}else{ 
2334					urlFinal += "/"+urlTemaNv1; 
2335
2336			break; 
2337			 
2338			case 3: 
2339				if(tipoCursoNome == "Livre"){ 
2340					urlTemaNv3 = urlTema; 
2341					urlFinal += "/"+urlTemaNv1+"/"+urlTemaNv2+"/"+urlTemaNv3; 
2342
2343			break; 
2344		 
2345
2346		 
2347
2348 
2349	urlFinal = new URL(window.location.origin + urlFinal); 
2350	  if($("#inscricao-aberta input").is(":checked")){ 
2351	    urlFinal.searchParams.set("inscricao", true); 
2352	  }  
2353	  if($("#bolsas-estudo input").is(":checked")){ 
2354	    urlFinal.searchParams.set("bolsa", true); 
2355	  }  
2356	  window.history.pushState('', 'Categoria JavaScript', urlFinal.toString()); 
2357
2358 
2359function buscaFriendlyUrlTemaEAtualizaBrowser(temaId,nivelClicado){ 
2360	 
2361	var friendlyUrlTema = urlTemasStorage.get(temaId); 
2362	 
2363	 
2364	//se ainda nao tem no map, busco via ajax e armazeno no map a url do tema clicado para nao precisar buscar novamente 
2365	if(typeof  friendlyUrlTema === "undefined"){ 
2366		$.ajax({ 
2367			url : '/o/senac-content-services/friendlyUrlPorCategoria/'+temaId, 
2368			type : 'get', 
2369			dataType: 'json', 
2370		}).done(function(res) { 
2371			 
2372			urlTemasStorage.set(temaId,res.url); 
2373			 
2374			atualizaUrlBrowser(res.url,nivelClicado); 
2375			 
2376		}) 
2377	}else{ 
2378		atualizaUrlBrowser(friendlyUrlTema,nivelClicado); 
2379
2380
2381 
2382/* Carrega os subtemas ou cursos ao clicar no tema */ 
2383$(".container").on( 
2384		"click", 
2385		".tema", 
2386		function() { 
2387			 
2388			//No mobile, se ja tiver o tema ativo, fecha esse tema e volta ao nivel 0 
2389			if(tam <= 1024){ 
2390				 
2391				if(!cliqueFiltroMobile){ 
2392					 
2393					$('#visualizar-mais').addClass('d-none'); 
2394					 
2395					if($(this).hasClass('tema-ativo')){ 
2396						 
2397						carregaTemas(); 
2398					    $('#filtro-ativo-nivel-1').empty() 
2399					    $('#temas').empty() 
2400					    $('#temas').removeClass('d-none') 
2401					    //Recria o botao Todos os cursos e recarrega os temas 
2402					    $('#temas').append('<div class="ssp-section-tema__container-menu-item"><a href="#a" class="tema todos" data-nvl="0"><i class="fa-solid fa-dice-d6"></i>Todos</a></div>') 
2403					    resetTemasMobile(); 
2404					   
2405					    //Limpa os filtros de nivel 2 ativos 
2406					    $("#filtro-ativo-nivel-2").empty(); 
2407					     
2408						return; 
2409
2410				}else{ 
2411					//reinicializo clique no filtro quando é mobile e continuo com comportamento normal do clique 
2412					cliqueFiltroMobile = 0; 
2413
2414
2415			 
2416			 
2417			var categoriaId = $(this).data('tema'); 
2418			 
2419			if($(this).hasClass('todos')){ 
2420			 
2421				//se clicou em todos nao preciso buscar o id da categoria do tema, so atualizo a url 
2422				//nivel 0 = botao todos os cursos 
2423				atualizaUrlBrowser(0,0);		 
2424				 
2425				$('.todos').addClass('ativo'); 
2426			}else{ 
2427				 
2428				if(!acessoDireto)				 
2429					buscaFriendlyUrlTemaEAtualizaBrowser(categoriaId,1); 
2430				 
2431				// Verifica o elemento, adiciona a classe ativo e remove dos seus primos 
2432				$('.todos').removeClass('ativo'); 
2433
2434			 
2435			var primos = $(this).parent().siblings().children(); 
2436			$('.tema[data-tema="'+categoriaId+'"]').addClass('tema-ativo'); 
2437			$(primos).not('.tema[data-tema="'+categoriaId+'"]').removeClass('tema-ativo'); 
2438			 
2439			 
2440			// limpa a lista de subtemas 
2441			$('#filtro-temas-nivel-2').empty(); 
2442			$('#filtro-temas-nivel-3').empty() 
2443			 
2444			limit = 2; 
2445			offset = 0; 
2446			 
2447			limitTodosCursos = 16; 
2448			offsetTodosCursos = 0; 
2449			 
2450			activeCategoryLevel = $(this).data('nvl'); 
2451 
2452      		//Evita de chamar o servico de categoria quando clicar em 'todos' 
2453	      if(!$(this).hasClass('todos')){ 
2454	  			$.ajax( 
2455
2456	  						url : '/o/senac-content-services/category/' 
2457	  								+ $(this).data('tema'), 
2458	  						type : 'get' 
2459	  					}).done(function(category) { 
2460	 
2461	  				activeCategory = JSON.parse(category); 
2462	  				 
2463	  				cleanElements();		 
2464	  				 
2465	  				displayCursosPorTema(); 
2466	  				 
2467	  				//if(tipoCursoNome == "Livre") 
2468	  					displaySubTemasLista(); 
2469	  			}); 
2470	  			 
2471	  			if(tipoCursoNome == "Livre"){ 
2472	  				if (tam <=1024){ 
2473	 
2474	  					$('#temas').addClass('d-none') 
2475	  					// adiciona o item selecionado nos filtros 
2476	  					$("#filtro-ativo-nivel-1").prepend(this); 
2477
2478
2479
2480		 
2481}); 
2482		 
2483 
2484/* Quando clica em Ver Todos cursos de um tema */ 
2485function verTodosCursos(){ 
2486	 
2487	 
2488	//Scrool top 
2489	$('html, body').animate({ 
2490        scrollTop: $("#temas").offset().top 
2491    }, -1000); 
2492	 
2493	 
2494	var tema = $(this).data('tema'); 
2495	activeCategoryLevel = $(this).data('nvl'); 
2496	 
2497	//buscaFriendlyUrlTemaEAtualizaBrowser(tema,activeCategoryLevel); 
2498 
2499	// Verifica o elemento, adiciona a classe ativo e remove dos seus primos 
2500	$('.todos').removeClass('ativo'); 
2501	 
2502 
2503	// Esconde os subtemas 
2504	//$('#filtro-temas-nivel-2').empty(); 
2505	//$('#filtro-temas-nivel-2').addClass('d-none'); 
2506	 
2507	 
2508	limit = 2; 
2509	offset = 0; 
2510 
2511	$.ajax({ 
2512		url : '/o/senac-content-services/category/'+ tema, 
2513		type : 'get' 
2514	}).done(function(category) { 
2515 
2516		activeCategory = JSON.parse(category); 
2517		 
2518		switch(activeCategoryLevel){ 
2519			case 1: 
2520				$('.tema').removeClass('tema-ativo'); 
2521				$('.tema[data-tema="'+activeCategory.categoryId+'"]').not('.slick-cloned').each(function(){ 
2522					if(!$(this).parent().hasClass('slick-cloned')){	 
2523						var botaoTemaVerTodos = $(this); 
2524						botaoTemaVerTodos.trigger('click'); 
2525
2526				}); 
2527				 
2528				break; 
2529			case 2: 
2530					 
2531				var botaoTemaVerTodosNv2 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2532				botaoTemaVerTodosNv2.trigger('click'); 
2533				 
2534				break; 
2535			case 3: 
2536				var botaoTemaVerTodosNv3 = $('.subtema[data-tema="'+activeCategory.categoryId+'"]'); 
2537				botaoTemaVerTodosNv3.trigger('click'); 
2538				 
2539				break; 
2540
2541			 
2542		 
2543	}); 
2544
2545 
2546// evento de click nos subtemas 
2547 
2548$("#filtro-temas-nivel-2, #filtro-temas-nivel-3").on( 
2549		"click", 
2550		".subtema", 
2551		function() { 
2552			$(this).addClass("subtema-ativo"); 
2553			$(this).siblings().removeClass("subtema-ativo"); 
2554			$(this).siblings().removeClass("ativo"); 
2555			 
2556			limitTodosCursos = 16; 
2557			offsetTodosCursos = 0; 
2558			offset = 0; 
2559			 
2560			$('#cursos-por-subtema-container').find('#curso-sem-slick').empty(); 
2561 
2562			activeCategoryLevel = $(this).data('nvl'); 
2563			 
2564			if(!acessoDireto) 
2565				buscaFriendlyUrlTemaEAtualizaBrowser($(this).data('tema'),activeCategoryLevel); 
2566			 
2567			$.ajax( 
2568
2569						url : '/o/senac-content-services/category/' 
2570								+ $(this).data('tema'), 
2571						type : 'get' 
2572					}) 
2573 
2574			.done(function(category) { 
2575 
2576				activeCategory = JSON.parse(category); 
2577				 
2578				cleanElements();				 
2579				displayCursosPorTema(); 
2580 
2581			}); 
2582			 
2583            if (tam <=1024){ 
2584 
2585				//$('#temas').addClass('d-none') 
2586				// adiciona o item selecionado nos filtros 
2587            	$("#filtro-ativo-nivel-2").append(this); 
2588                $("#filtro-temas-nivel-2, #filtro-temas-nivel-3").empty(); 
2589                 
2590
2591 
2592}); 
2593 
2594//Mobile, quando clica em um subtema ativo 
2595$("#filtro-ativo-nivel-2").on( 
2596		"click", 
2597		".subtema-ativo", 
2598		function() { 
2599		 
2600		//o filtro ativa esta trigger, entao preciso saber se clique veio do filtro ou do botao mesmo	 
2601		//se botao, removo ele e volto pro tema pai 
2602		if(!cliqueFiltroMobile){ 
2603				 
2604				$(this).remove(); 
2605				 
2606				if($(this).attr('data-nvl') == '2'){ 
2607			    	 
2608					var temaAtivo = $('.tema-ativo'); 
2609					 
2610					temaAtivo.removeClass('tema-ativo'); 
2611					 
2612					temaAtivo.trigger('click'); 
2613			       
2614			    }else { 
2615			    	 
2616					var subtemaAtivo = $('.subtema-ativo'); 
2617					 
2618					subtemaAtivo.removeClass('subtema-ativo'); 
2619					 
2620					subtemaAtivo.trigger('click'); 
2621			       
2622
2623				 
2624		//se filtro carrego os cursos com o filtro, igual comportamento desktop 		 
2625		}else{ 
2626			 
2627			//reinicializo a flag 
2628			cliqueFiltroMobile = 0 ; 
2629			 
2630			$(this).addClass("subtema-ativo"); 
2631			 
2632			limitTodosCursos = 16; 
2633			offsetTodosCursos = 0; 
2634			offset = 0; 
2635			 
2636			$('#cursos-por-subtema-container').find('#curso-sem-slick').empty(); 
2637		 
2638			activeCategoryLevel = $(this).data('nvl'); 
2639			 
2640			if(!acessoDireto) 
2641				buscaFriendlyUrlTemaEAtualizaBrowser($(this).data('tema'),activeCategoryLevel); 
2642		 
2643			$.ajax( 
2644
2645						url : '/o/senac-content-services/category/' 
2646								+ $(this).data('tema'), 
2647						type : 'get' 
2648					}) 
2649		 
2650			.done(function(category) { 
2651		 
2652				activeCategory = JSON.parse(category); 
2653				 
2654				cleanElements();				 
2655				displayCursosPorTema(); 
2656		 
2657			}); 
2658		 
2659			if($(this).attr('data-nvl') == '2'){		 
2660				// adiciona o item selecionado nos filtros 
2661		    	$("#filtro-ativo-nivel-2").prepend(this); 
2662		        $("#filtro-temas-nivel-2, #filtro-temas-nivel-3").empty(); 
2663
2664		 
2665
2666}); 
2667 
2668/*Mobile, quando clica em um subtema via trigger*/ 
2669 if (tam <=1024){ 
2670	$("#filtro-ativo-nivel-2").on( 
2671			"click", 
2672			".subtema", 
2673			function() { 
2674				 
2675				if($(this).attr('data-nvl') == '2' && !$(this).hasClass('subtema-ativo')){ 
2676					 
2677					$(this).addClass("subtema-ativo"); 
2678					$(this).siblings().removeClass("subtema-ativo"); 
2679					$(this).siblings().removeClass("ativo"); 
2680					 
2681					limitTodosCursos = 16; 
2682					offsetTodosCursos = 0; 
2683					offset = 0; 
2684					 
2685					$('#cursos-por-subtema-container').find('#curso-sem-slick').empty(); 
2686				 
2687					activeCategoryLevel = $(this).data('nvl'); 
2688					 
2689					if(!acessoDireto) 
2690						buscaFriendlyUrlTemaEAtualizaBrowser($(this).data('tema'),activeCategoryLevel); 
2691				 
2692					$.ajax( 
2693
2694								url : '/o/senac-content-services/category/' 
2695										+ $(this).data('tema'), 
2696								type : 'get' 
2697							}) 
2698				 
2699					.done(function(category) { 
2700				 
2701						activeCategory = JSON.parse(category); 
2702						 
2703						cleanElements();				 
2704						displayCursosPorTema(); 
2705				 
2706					}); 
2707					 
2708					// adiciona o item selecionado nos filtros 
2709			    	$("#filtro-ativo-nivel-2").prepend(this); 
2710			        $("#filtro-temas-nivel-2, #filtro-temas-nivel-3").empty(); 
2711
2712
2713	); 
2714 }		 
2715		 
2716/* Click no botao todos */ 
2717$(".container").on("click", ".todos", function() { 
2718	 
2719	activeCategory = 'all'; 
2720	activeCategoryLevel = $(this).data('nvl'); 
2721	offset = 0; 
2722 
2723	/* Limpa dados de subtemas que possam ter sido criados na navegacao */ 
2724	cleanElements(); 
2725 
2726	$('#tema-atual').text("Todos os cursos"); 
2727 
2728	// Esconde a div com subtemas 
2729	$('#filtro-temas-nivel-2').empty(); 
2730	$('#filtro-temas-nivel-2').addClass('d-none'); 
2731 
2732 
2733	displayCursosPorTema(); 
2734 
2735}); 
2736 
2737function getTextoSemCurso(filtroBolsa,filtroInsc,temaNome){ 
2738	 
2739	temaNome = typeof temaNome === "undefined" ? '' : 'de '+temaNome; 
2740	 
2741	if(filtroBolsa && filtroInsc) 
2742		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra e com bolsas de estudo nesta unidade.<br>Selecione outras áreas para consultar bolsas nesta unidade ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos de outras unidades.</a></p>"; 
2743	else if(filtroBolsa) 
2744		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> com bolsas de estudo nesta unidade.<br>Selecione outras áreas para consultar bolsas nesta unidade ou <a href='https://www.sp.senac.br/bolsas-de-estudo'>confira bolsas disponíveis em diferentes cursos de outras unidades.</a></p>";	 
2745	else if(filtroInsc) 
2746		return "<p>No momento, estamos sem cursos <strong><span id='nomeTemaSemCurso'>"+temaNome+"</span></strong> disponíveis para compra nesta unidade."; 
2747
2748 
2749/* Limpa a tela para exibicao de novos cursos */ 
2750function cleanElements() { 
2751 
2752	$('#cursos-por-categoria-container .cursos-por-categoria').remove(); 
2753	$('#curso-sem-slick').empty(); 
2754	$('#cursos-por-categoria-container').removeClass('d-none'); 
2755
2756 
2757function cleanCursosCategoria(){ 
2758	$('#cursos-por-categoria-container .cursos-por-categoria').remove(); 
2759
2760 
2761function cleanTemasNivel2(){ 
2762	$('#subsubtemas-lista').remove(); 
2763
2764 
2765/* 
2766 * Armazena a navegacao em cookies, se habilitado 
2767 */ 
2768$(document).on("click", ".ck-curso", function() { 
2769	 
2770	//Verifica se o cookie esta habilitado 
2771    if(getCookie('portalSenacCookie') != null){ 
2772    	 
2773		var articleId = $(this).data('ck'); 
2774		manageCookieArray(cookieName, articleId); 
2775		manageCookieArray('ck-cursos', articleId); 
2776
2777 
2778}); 
2779 
2780/* 
2781 * Exibe os cursos por tema, dependendo do nivel 
2782 */ 
2783function displayCursosPorTema() { 
2784	 
2785	$("#filtroSemCurso").addClass("d-none"); 
2786	 
2787	// Verifica o nivel 
2788	switch (activeCategoryLevel) { 
2789 
2790	case 0: // exibe todos 
2791		 
2792		limit = 2; 
2793 
2794		$.each(temas.slice(offset, limit + offset), function(k, t) { 
2795			 
2796			if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2797				 
2798				var template = $('#cursos-por-categoria-template').clone(); 
2799				template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2800				template.removeClass('d-none'); 
2801				$('#cursos-por-categoria-container').append(template); 
2802
2803			 
2804			$.ajax( 
2805
2806						url : '/o/senac-content-services/category/' 
2807								+ t.categoryId, 
2808						type : 'get' 
2809					}).done(function(category) { 
2810						 
2811						var dadosCategoria = JSON.parse(category); 
2812						 
2813						//monta as divs para cada tcategoria 
2814						var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2815						templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2816						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 1); 
2817						templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2818						templatePorCategoria.removeClass('d-none'); 
2819 
2820						cursosPorCategoriaModelo1(dadosCategoria); 
2821 
2822			}); 
2823		}); 
2824		 
2825		// Esconde botao carregar mais, se  necessario 
2826		 
2827		$('.section-carregar-mais').remove(); 
2828		 
2829		if (temas.length > limit + offset){ 
2830			$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2831
2832		 
2833		 
2834		break; 
2835 
2836	case 1: 
2837		limit = 2; 
2838 
2839		$('#tema-atual').text("Cursos de "+activeCategory.name); 
2840			 
2841		//Exibe a lista de subtemas, quando mobile 
2842		var tam = $(window).width(); 
2843		  
2844		if (tam < 1024){ 
2845			 
2846			$('#subtemas-lista-mobile').empty(); 
2847			$('#subtemas-lista-mobile').removeClass('d-none'); 
2848			 
2849			$.each(subtemasStorage.get(activeCategory.categoryId), function(k, t) { 
2850				 
2851				$('#subtemas-lista-mobile').append('<a href="#a" class="subtema btn-nivel-3" data-tema="' 
2852						+ t.categoryId 
2853						+ '" data-nvl="2" style="font-size: 14px;">' 
2854						+ t.name 
2855						+ '</a>'); 
2856			}); 
2857			 
2858
2859		 
2860		// Exibe os cursos dos subtemas do tema clicado percorrendo a lista de 
2861		// subtemas do tema clicado 
2862		if(subtemasStorage.get(activeCategory.categoryId).length > 0){ 
2863						 
2864			$.each(subtemasStorage.get(activeCategory.categoryId).slice(offset, 
2865					limit + offset), function(k, t) { 
2866				 
2867				 
2868				if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
2869					 
2870					var template = $('#cursos-por-categoria-template').clone(); 
2871					template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
2872	 
2873					template.removeClass('d-none'); 
2874					 
2875					$('#cursos-por-categoria-container').append(template); 
2876
2877	 
2878				$.ajax( 
2879
2880							url : '/o/senac-content-services/category/' 
2881									+ t.categoryId, 
2882							type : 'get' 
2883						}).done(function(category) { 
2884							 
2885							var dadosCategoria = JSON.parse(category); 
2886							 
2887							//monta as divs para cada tcategoria 
2888							var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
2889							templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
2890							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 2); 
2891							templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
2892							templatePorCategoria.removeClass('d-none'); 
2893 
2894							cursosPorCategoriaModelo1(dadosCategoria); 
2895	 
2896				}); 
2897				 
2898			}); 
2899			 
2900			 
2901			// Esconde botao carregar mais, se  necessario 
2902			$('.section-carregar-mais').remove(); 
2903			 
2904			if (subtemasStorage.get(activeCategory.categoryId).length > limit + offset) 
2905				$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
2906			 
2907			 
2908			 
2909		}else{ 
2910			//Se nao tiver subtema, exibe o modelo 3 
2911			cursosPorCategoriaModelo3(); 
2912
2913 
2914		break; 
2915 
2916	case 2: // exibe cursos do nivel 2 
2917		limit = 2; 
2918		cursosPorCategoriaModelo2(); 
2919		break; 
2920		 
2921	case 3: 
2922		cursosPorCategoriaModelo3(); 
2923		break; 
2924
2925
2926 
2927/* 
2928 * Faz a exibicao dos cursos quando se carrega a tela ou clica em 'Todos' 
2929 */ 
2930 function cursosPorCategoriaModelo1(category) { 
2931		 
2932	 	activeModeloExibicao = 1; 
2933	 	 	 
2934		var url = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra 
2935		.replace('{groupId}', groupId) 
2936		.replace('{unidadeCategoryId}', categoryIdUnidade) 
2937		.replace('{categoryTemaId}', category.categoryId) 
2938		.replace('{categoriaId}', idModalidadeEspecTecnica) 
2939		.replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas) 
2940		.replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo) 
2941		.replace('{considerarUnidade}', 1) 
2942		.replace('{start}', 0) 
2943		.replace('{end}', limitCursos); 
2944		 
2945		$.ajax({ 
2946			url : url, 
2947			type : 'get', 
2948			beforeSend: function () { 
2949				loading('#cursos-por-categoria-'+category.categoryId+' .slider-curso'); 
2950
2951		}).done(function(cursosPorCategoria) { 
2952 
2953			cursosPorCategoria = JSON.parse(cursosPorCategoria); 
2954							 
2955			var totalCursos = cursosPorCategoria.total; 
2956			 
2957			//Se nao retornou cursos, deve esconder a div da categoria 
2958			if(totalCursos == 0){ 
2959				//$('#cursos-por-categoria-'+category.categoryId).remove(); 
2960				$('#cursos-por-categoria-'+category.categoryId).html(''); 
2961				 
2962				//essa classe tirar todo o padding da div, escondendo ela 
2963				$('#cursos-por-categoria-'+category.categoryId).removeClass('ssp-section'); 
2964				 
2965				if(tam <= 1024){ 
2966					var $element = document.getElementById('cursos-por-categoria-container'); 
2967					var _elementPos = $element.offsetTop + 100; 
2968					var _scrollDown = _elementPos + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 300 : 1); 
2969					window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown);//carrega os cursos 
2970					setTimeout(()=> window.scrollTo(window.scrollX || window.pageXOffset, _elementPos), 500);//mostra o primeiro 
2971					 
2972				}else{ 
2973					var _scrollDown = (window.scrollY || window.pageYOffset) + (filtrarInscricoesAbertas == 1 || filtrarBolsaEstudo == 1 ? 20 : 1); 
2974					window.scrollTo(window.scrollX || window.pageXOffset, _scrollDown); 
2975
2976				return; 
2977			}else{ 
2978			 
2979				if(!$('#cursos-por-categoria-'+category.categoryId).hasClass('ssp-section')) 
2980					$('#cursos-por-categoria-'+category.categoryId).addClass('ssp-section'); 
2981			 
2982
2983		 
2984			var articles = []; 
2985				      		 
2986	   		 $.each(cursosPorCategoria.cursos, function(k, c){ 
2987	   			articles.push(c.articleId); 
2988	   		 }); 
2989				      		  
2990	   		//Verifica a situacao dos botoes de inscricoes e bolsa 
2991			  $.ajax({ 
2992			        url :  '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+categoryIdUnidade, 
2993			        type : 'get' 
2994			    })  
2995			    .done(function(infoBotoes){ 
2996				    	 
2997				    	if(infoBotoes.length > 0) { 
2998				    		 
2999			    		  	infoBotoes = JSON.parse(infoBotoes); 
3000 
3001							var template = $('#cursos-por-categoria-'+category.categoryId); 
3002							 
3003							$('#cursos-por-categoria-'+category.categoryId+' .slider-curso').empty(); 
3004 
3005							$.each(cursosPorCategoria.cursos, function(k, curso) { 
3006		 
3007								var itemCurso = buildCardCurso(curso, infoBotoes, tam <=1024) 
3008 
3009								template.append(itemCurso); 
3010 
3011								template.find('.slider-curso').append(itemCurso); 
3012		 
3013							}); // fim each 
3014		 
3015							// chama o slider por categoria 
3016							if (tam >=1024){ 
3017 
3018								template.find('.slider-curso').addClass( 
3019									'slick-area slick-area--md-bleed slider-container slider-id-' 
3020											+ category.categoryId); 
3021								 
3022								if(totalCursos > 11){ 
3023									template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>')			 
3024								} else { 
3025									$(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click"); 
3026
3027 
3028							}else{ 
3029								template.find('.slider-curso').css({"flex-wrap":"wrap"}); 
3030								 
3031								if($('.ssp-page-busca__section-resultado__ver-todos-mobile[data-tema="'+category.categoryId+'"]').length == 0){ 
3032									 
3033									//Adicionava o botão ver todos. Possível adição do código do card novo! 
3034									if(totalCursos > 4){ 
3035										template.find('.slider-curso').append('<a data-nvl="'+(activeCategoryLevel+1)+'" data-tema="'+category.categoryId+'" class="ssp-card-todos-cursos especializacao-tecnica card-ver-todos-cursos-link" ><p>Conferir todos <br>os <span>cursos</span></p><i class="far fa-arrow-right"></i></a>') 
3036									} else { 
3037										$(".ver-todos-cursos-link[data-tema='"+category.categoryId+"']").addClass("ver-todos-no-click"); 
3038
3039									 
3040
3041							}; 
3042 
3043 
3044							// chama o slider por categoria 
3045							if (tam >=1024){ 
3046 
3047								sliderCurso('.slider-id-' + category.categoryId); 
3048 
3049							}; 
3050				    	} //fim if botoes length 
3051				    	 
3052						 
3053			    }); // fim done 
3054			 
3055		}).fail(function(jqXHR, textStatus, msg) { 
3056			// alert(msg); 
3057		}); 
3058	 
3059		 
3060
3061 
3062//ao final de todos os ajax, se não houver curso na pag por causa dos filtros, exibimos mensagem de nenhum curso 
3063$(document).ajaxStop(function () { 
3064	if($(".slick-area__item").not('.d-none').length == 0){ 
3065		var htmlTextoSemCurso = getTextoSemCurso(filtrarBolsaEstudo,filtrarInscricoesAbertas,activeCategory.name);  
3066 
3067		$(".ssp-bolsa-formulario__card-aviso-texto").html(htmlTextoSemCurso);					 
3068		$("#filtroSemCurso").removeClass("d-none"); 
3069
3070});	 
3071 
3072/* 
3073 * Faz a exibicao dos cursos quando se clica em temas nivel 2 
3074 */ 
3075 function cursosPorCategoriaModelo2() { 
3076		activeModeloExibicao = 2; 
3077	 
3078		$("#tema-atual").html("<span>Cursos de </span>"	+ activeCategory.name); 
3079		 
3080		var url = urlSearchTemas 
3081		.replace('{groupId}', groupId) 
3082		.replace('{unidadeCategoryId}', categoryIdUnidade) 
3083		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3084		.replace('{nivelTema}', 2) 
3085		.replace('{categoriaParentId}', activeCategory.categoryId); 
3086		 
3087		// Busca os filhos (3 nivel) 
3088		$.ajax({ 
3089			//url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ activeCategory.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3090			url: url, 
3091			type : 'get', 
3092			data : {} 
3093			}).done(function(subtemas) { 
3094 
3095				subtemas = JSON.parse(subtemas); 
3096				 
3097				if(tam > 1024 && subtemas.length > 0) 
3098					var subsubtemaLista = '<hr class="separador-subtemas"/>'; 
3099				else 
3100					var subsubtemaLista = '' ;  
3101						 
3102				$.each(subtemas, function(k, v) { 
3103					subsubtemaLista += '<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3104							+ v.categoryId 
3105							+ '" data-nvl="3" style="font-size: 14px;">' 
3106							+ v.name 
3107							+ '</a>'; 
3108				}); 
3109	 
3110				$('#filtro-temas-nivel-3').html(subsubtemaLista); 
3111				 
3112				if(subtemas.length > 0 && tipoCursoNome == "Livre"){  
3113					$('#filtro-temas-nivel-3').removeClass('d-none'); 
3114					//Caso nao tenha subtemas, exibe o modelo 3 
3115						 
3116				}else{ 
3117					cursosPorCategoriaModelo3(); 
3118					return; 
3119
3120					 
3121				// Exibe os cursos dos subtemas do tema clicado percorrendo a lista de 
3122				// subtemas do tema clicado 
3123				if(subtemas.length > 0){ 
3124					 
3125					$.each(subtemas.slice(offset, limit + offset), function(k, t) { 
3126						 
3127						if($('#cursos-por-categoria-'+t.categoryId).length == 0){ 
3128							var template = $('#cursos-por-categoria-template').clone(); 
3129							template.prop('id', 'cursos-por-categoria-'+t.categoryId); 
3130	 
3131							template.removeClass('d-none'); 
3132							 
3133							$('#cursos-por-categoria-container').append(template); 
3134
3135			 
3136						$.ajax( 
3137
3138									url : '/o/senac-content-services/category/' 
3139											+ t.categoryId, 
3140									type : 'get' 
3141								}).done(function(category) { 
3142									 
3143									var dadosCategoria = JSON.parse(category); 
3144									 
3145									//monta as divs para cada tcategoria 
3146									var templatePorCategoria = $('#cursos-por-categoria-'+dadosCategoria.categoryId); 
3147									templatePorCategoria.find('.tema-nome').text(dadosCategoria.name); 
3148									templatePorCategoria.find('.ver-todos-cursos-link').attr('data-nvl', 3); 
3149									templatePorCategoria.find('.ver-todos-cursos-link').attr('data-tema', dadosCategoria.categoryId); 
3150									templatePorCategoria.removeClass('d-none'); 
3151 
3152									cursosPorCategoriaModelo1(dadosCategoria); 
3153			 
3154						}); 
3155					}); 
3156					 
3157					// Esconde botao carregar mais, se  necessario 
3158					$('.section-carregar-mais').remove(); 
3159					 
3160					if (subtemas.length > limit + offset) 
3161						$('#cursos-por-categoria-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
3162					 
3163				}else{ 
3164					//Se nao tiver subtema, exibe o modelo 3 
3165					cursosPorCategoriaModelo3(); 
3166
3167					 
3168		}); 
3169		 
3170	 
3171		 
3172
3173/* 
3174 * Faz a exibicao dos cursos quando se clica em temas nivel 3 
3175 */ 
3176 function cursosPorCategoriaModelo3() { 
3177		activeModeloExibicao = 3; 
3178	     
3179		//Se já estiver carregando não deixa juntar várias chamadas 
3180		if($('#loading-todos-cursos').length > 0) return; 
3181		 
3182		//Loading 
3183		$('#curso-sem-slick').append('<div id="loading-todos-cursos" style="width:100%; text-align:center">'+ 
3184		'<div class="ssp-loader-content">'+ 
3185		'<div class="ssp-loader"></div>'+ 
3186		'<p class="ssp-loader-text">Carregando...</p>'+ 
3187		'</div>'+ 
3188		'</div>'); 
3189		 
3190		$("#tema-atual").html("<span>Cursos de </span>"	+ activeCategory.name); 
3191		 
3192		//Ativa o botao clicado 
3193		$('.btn-nivel-3').each(function(btn){ 
3194			$(this).removeClass('ativo'); 
3195			 
3196			if($(this).attr('data-tema') == activeCategory.categoryId) $(this).addClass('ativo'); 
3197		}); 
3198		 
3199		var url = urlCursosPorTipoCursoETemaComFiltrosBolsaECompra 
3200		.replace('{groupId}', groupId) 
3201		.replace('{unidadeCategoryId}', categoryIdUnidade) 
3202		.replace('{categoryTemaId}', activeCategory.categoryId) 
3203		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3204		.replace('{filtrarInscricoesAbertas}', filtrarInscricoesAbertas) 
3205		.replace('{filtrarBolsaEstudo}', filtrarBolsaEstudo) 
3206		.replace('{considerarUnidade}', 1) 
3207		.replace('{start}', offsetTodosCursos) 
3208		.replace('{end}', (limitTodosCursos + offsetTodosCursos)); 
3209		 
3210		$.ajax({ 
3211			url : url, 
3212			type : 'get', 
3213			data : {}, 
3214			/*beforeSend: function () { 
3215				 
3216				var totalItens = $('#curso-sem-slick .slick-area__item').length; 
3217				if(totalItens == 0) 
3218					loading('#curso-sem-slick'); 
3219			}*/ 
3220		}).done(function(cursosPorSubtema) { 
3221							 
3222			$('.ssp-loader-content').parent().remove(); 
3223 
3224			cursosPorSubtema = JSON.parse(cursosPorSubtema); 
3225			 
3226			var totalCursos = cursosPorSubtema.total; 
3227			 
3228			var templateContainer = $('#cursos-por-categoria-container'); 
3229 
3230			var articles = []; 
3231	      		 
3232	      	$.each(cursosPorSubtema.cursos, function(k, c){ 
3233	    		articles.push(c.articleId); 
3234	   		 }); 
3235	      		  
3236	      		//Verifica a situacao dos botoes de inscricoes e bolsa 
3237			 $.ajax({ 
3238				        url :  '/o/senac-content-services/verificaBotoesInscricaoEBolsaPorUnidade/'+groupId+'/'+articles.join(',')+'/'+categoryIdUnidade, 
3239				        type : 'get' 
3240		    }).done(function(infoBotoes){ 
3241		    	 
3242		    	templateContainer.find('#curso-sem-slick').empty(); 
3243		    	 
3244		    	if(infoBotoes.length > 0) { 
3245		    		 
3246	    		   infoBotoes = JSON.parse(infoBotoes); 
3247		 
3248 
3249					$.each(cursosPorSubtema.cursos,function(k, curso) { 
3250 
3251							var itemCurso = buildCardCurso(curso, infoBotoes, tam <=1024) 
3252							 
3253							itemCurso.addClass('card-curso-nivel-2'); 
3254 
3255							// procura a div criada e adiciona os cursos 
3256							templateContainer.find('#curso-sem-slick').append(itemCurso); 
3257					}); // fim each 
3258 
3259					templateContainer.removeClass('d-none'); 
3260 
3261					var totalCursosExibicao = $('#curso-sem-slick .slick-area__item').length; 
3262						 
3263					// Esconde botao carregar mais, se  necessario 
3264					$('.section-carregar-mais').remove(); 
3265						 
3266					if (totalCursosExibicao < totalCursos)  
3267						$('#cursos-por-subtema-container').append('<section style="padding: 30px 0; width:100%" class="section-carregar-mais"><div class="container"><a href="#a" class="ssp-section-tema__btn-ver-mais" id="carregar-mais" style="visibility:hidden"> Carregar mais unidades </a></div></section>'); 
3268
3269 
3270			});  
3271 
3272		}).fail(function(jqXHR, textStatus, msg) { 
3273			// alert(msg); 
3274		}); 
3275	 
3276
3277 
3278/* 
3279 * Faz a exibicao dos cursos quando se carrega a tela ou clica em 'Todos' 
3280 */ 
3281function displayCursosRecentes() { 
3282 
3283	// Verifica se existem cursos no cookie 
3284	if (getCookie(cookieName) == null || getCookie(cookieName) == null) 
3285		return; 
3286	 
3287	var cursosLivresRecentes = JSON.parse(getCookie(cookieName)).join(','); 
3288	 
3289	if(cursosLivresRecentes.length) 
3290		$('#section-buscados-recentes').removeClass('d-none'); 
3291 
3292
3293			.ajax( 
3294
3295						url : '/o/senac-content-services/cursosInfo/' + groupId 
3296								+ '/' + cursosLivresRecentes+'/0/' 
3297								+ limitCursos, 
3298						type : 'get' 
3299					}) 
3300			.done( 
3301					function(cursosRecentes) { 
3302 
3303						cursosRecentes = JSON.parse(cursosRecentes); 
3304 
3305						var template = $('#cursos-recentes-template'); 
3306 
3307						$.each(cursosRecentes, function(k, curso) { 
3308 
3309							var itemCurso = buildCardCurso(curso) 
3310							itemCurso.addClass("cursos-recentes-card") 
3311							template.find('.slider-curso').append(itemCurso); 
3312 
3313						}); 
3314 
3315						template 
3316								.find('.slider-curso') 
3317								.addClass( 
3318										'slick-area slick-area--md-bleed slider-container slider-id-recentes'); 
3319 
3320						 
3321						// section de buscado recentes* 
3322 
3323						$('#template').removeClass('d-none'); 
3324						template.removeClass('d-none'); 
3325						// div de recentes* 
3326 
3327						sliderCurso('.slider-id-recentes'); 
3328 
3329					}).fail(function(jqXHR, textStatus, msg) { 
3330				// alert(msg); 
3331			}); 
3332 
3333
3334 
3335/* 
3336 * Monta a lista de temas de curso livre no header da pagina 
3337 */ 
3338 
3339 function carregaTemasNivelDireto(nivel) { 
3340		//buscando o categoryId da unidade 
3341		$.ajax({ 
3342			url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+urlUnidade+"/"+0, 
3343			type : 'get', 
3344			dataType: 'json' 
3345		}) 
3346		.done(function(unidadesCategory) { 
3347			 
3348			categoryIdUnidade = unidadesCategory[0].categoryId; 
3349			 
3350			var url = urlSearchTemas 
3351			.replace('{groupId}', groupId) 
3352			.replace('{unidadeCategoryId}', categoryIdUnidade) 
3353			.replace('{categoriaId}', idModalidadeEspecTecnica) 
3354			.replace('{nivelTema}', 0) 
3355			.replace('{categoriaParentId}', 0); 
3356			 
3357			//buscando os temas que os cursos da unidade tem com este tipo de curso 
3358			$.ajax({ 
3359				url : url, 
3360				type : 'get', 
3361				dataType: 'json' 
3362			}) 
3363			.done(function(temasLista) { 
3364					var temasObj = $('#temas'); 
3365									 
3366					$.each(temasLista,function(k, tema) { 
3367						const icon = (categorias.filter(cat => cat.categoryId == tema.categoryId)[0] || {properties: {}}).properties.icon 
3368						temasObj.append('<div class="ssp-section-tema__container-menu-item mega-menu"><a href="#a" class="tema" data-nvl="1" data-tema="'+ tema.categoryId+ '">'+ '<i class="' + icon + '"></i>'+ tema.name+ '</a></div>'); 
3369		 
3370						var url = urlSearchTemas 
3371						.replace('{groupId}', groupId) 
3372						.replace('{unidadeCategoryId}', categoryIdUnidade) 
3373						.replace('{categoriaId}', idModalidadeEspecTecnica) 
3374						.replace('{nivelTema}', 2) 
3375						.replace('{categoriaParentId}', tema.categoryId); 
3376						 
3377						// Armazena os subtemas deste tema 
3378						$.ajax({ 
3379							//url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ tema.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3380							url: url, 
3381							type : 'get', 
3382						}) 
3383						.done(function(subtemas) { 
3384							 
3385							 
3386							subtemasStorage.set(tema.categoryId,JSON.parse(subtemas)); 
3387							 
3388							if(nivel == 1 && tema.categoryId == categoryIdTemaNv1){ 
3389								var clicou = 0; 
3390								$('.tema[data-tema="'+categoryIdTemaNv1+'"]').not('.slick-cloned').each(function(){ 
3391									 
3392									if(!clicou){ 
3393										var botaoTemaTargetNv1 = $(this); 
3394										botaoTemaTargetNv1.trigger('click'); 
3395										 
3396										clicou = 1; 
3397										acessoDireto = 0; 
3398
3399										 
3400								}); 
3401
3402							 
3403							if(nivel == 2){ 
3404								 
3405								if(tipoCursoNome == "Livre"){ 
3406									subTemasJson = JSON.parse(subtemas); 
3407									if(subTemasJson.length > 0){ 
3408									 
3409										$.each(subTemasJson, function(i, each){ 
3410											if(each.categoryId == categoryIdTemaNv2){ 
3411													 
3412													var botaoTema = $('.tema[data-tema="'+categoryIdTemaNv1+'"]'); 
3413													botaoTema.addClass('tema-ativo'); 
3414													 
3415													tam = $(window).width(); 
3416													 
3417													if (tam <=1024){ 
3418														$("#visualizar-mais, .visualizar-mais-seta").addClass('d-none'); 
3419														$('#temas').addClass('d-none'); 
3420														// adiciona o item selecionado nos filtros 
3421														$("#filtro-ativo-nivel-1").prepend(botaoTema); 
3422
3423													 
3424													$.ajax({ 
3425														url : '/o/senac-content-services/category/' 
3426																+ categoryIdTemaNv1, 
3427														type : 'get' 
3428													}).done(function(category) { 
3429														 
3430														activeCategory = JSON.parse(category); 
3431														displaySubTemasLista(); 
3432														 
3433														$.ajax({ 
3434															url : '/o/senac-content-services/category/' 
3435																	+ categoryIdTemaNv2, 
3436															type : 'get' 
3437														}).done(function(category2) { 
3438															 
3439															activeCategory = JSON.parse(category2); 
3440															var botaoTemaTargetNv2 = $('.subtema[data-tema="'+categoryIdTemaNv2+'"]'); 
3441															botaoTemaTargetNv2.trigger('click'); 
3442															acessoDireto = 0; 
3443														}); 
3444														 
3445													}); 
3446													 
3447
3448													 
3449											}); 
3450
3451
3452
3453							 
3454							 
3455							 
3456						}); 
3457						 
3458					}); // fim each 
3459												 
3460					 
3461					if(nivel == 3){ 
3462						if(tipoCursoNome == "Livre"){ 
3463							 
3464							var botaoTema = $('.tema[data-tema="'+categoryIdTemaNv1+'"]'); 
3465							botaoTema.addClass('tema-ativo'); 
3466							 
3467							tam = $(window).width(); 
3468							 
3469							if (tam <=1024){ 
3470								$("#visualizar-mais, .visualizar-mais-seta").addClass('d-none'); 
3471								$('#temas').addClass('d-none'); 
3472								// adiciona o item selecionado nos filtros 
3473								$("#filtro-ativo-nivel-1").prepend(botaoTema); 
3474
3475							 
3476							$.ajax({ 
3477								url : '/o/senac-content-services/category/' 
3478										+ categoryIdTemaNv1, 
3479								type : 'get' 
3480							}).done(function(category) { 
3481 
3482								 
3483								activeCategory = JSON.parse(category); 
3484								displaySubTemasLista(); 
3485								var botaoSubtema = $('.subtema[data-tema="'+categoryIdTemaNv2+'"]'); 
3486								botaoSubtema.addClass('subtema-ativo'); 
3487								 
3488								if (tam <=1024){ 
3489									// adiciona o item selecionado nos filtros 
3490									$("#filtro-ativo-nivel-2").prepend(botaoSubtema); 
3491
3492 
3493								$.ajax({ 
3494									url : '/o/senac-content-services/category/' 
3495											+ categoryIdTemaNv2, 
3496									type : 'get' 
3497								}).done(function(category2) { 
3498									 
3499									activeCategory = JSON.parse(category2); 
3500 
3501									var url = urlSearchTemas 
3502									.replace('{groupId}', groupId) 
3503									.replace('{unidadeCategoryId}', categoryIdUnidade) 
3504									.replace('{categoriaId}', idModalidadeEspecTecnica) 
3505									.replace('{nivelTema}', 2) 
3506									.replace('{categoriaParentId}', activeCategory.categoryId); 
3507									 
3508									// Busca os filhos (3 nivel) 
3509									$.ajax({ 
3510										//url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ activeCategory.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3511										url: url, 
3512										type : 'get', 
3513										data : {} 
3514										}).done(function(subtemas) { 
3515											subtemas = JSON.parse(subtemas); 
3516											 
3517											if(tam > 1024 && subtemas.length > 0) 
3518												var subsubtemaLista = '<hr class="separador-subtemas"/>'; 
3519											else 
3520												var subsubtemaLista = ''; 
3521											 
3522											$.each(subtemas, function(k, v) { 
3523												subsubtemaLista += '<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3524														+ v.categoryId 
3525														+ '" data-nvl="3" style="font-size: 14px;">' 
3526														+ v.name 
3527														+ '</a>'; 
3528														 
3529												if(v.categoryId == categoryIdTemaNv3) 
3530													activeCategory = v; 
3531													 
3532											}); 
3533 
3534											$('#filtro-temas-nivel-3').html(subsubtemaLista); 
3535											$('#filtro-temas-nivel-3').removeClass('d-none'); 
3536											 
3537											var botaoTemaTargetNv3 = $('.subtema[data-tema="'+categoryIdTemaNv3+'"]'); 
3538											botaoTemaTargetNv3.trigger('click'); 
3539											acessoDireto = 0; 
3540										});	 
3541									 
3542								}); 
3543								 
3544							}); 
3545
3546
3547					 
3548					temas = temasLista; 
3549			 
3550					 
3551					//displayCursosPorTema(); 
3552 
3553					// Verificar o tamanho da tela e chama da função para desktop e mobile 
3554					var tam = $(window).width(); 
3555					 
3556					//$('.todos').addClass('ativo'); 
3557 
3558					if (tam <=1024){ 
3559 
3560						exibeTemasMobile() 
3561						 
3562
3563 
3564					// // Adiciona a classe do slider no elemento 
3565					// $('#temas').addClass("tema-slick-area tema-slick-area--md-bleed slider-container"); 
3566					// // e faz a chamada da função 
3567					// sliderTemaBtn(); 
3568 
3569					// verifica Device e tira o slider 
3570					 
3571					 
3572 
3573				}).fail(function(jqXHR, textStatus, msg) { 
3574					// alert(msg); 
3575				}); 
3576		 
3577					 
3578		 
3579		}); // fim done 1o ajax 
3580		 
3581		 
3582
3583 
3584function carregaTemas() {	 
3585	//buscando o categoryId da unidade 
3586	$.ajax({ 
3587		url : '/o/senac-unidade-services/categoriaPorFriendlyURL/'+urlUnidade+"/"+0, 
3588		type : 'get', 
3589		dataType: 'json' 
3590	}) 
3591	.done(function(unidadesCategory) { 
3592		 
3593		categoryIdUnidade = unidadesCategory[0].categoryId; 
3594 
3595		var url = urlSearchTemas 
3596		.replace('{groupId}', groupId) 
3597		.replace('{unidadeCategoryId}', categoryIdUnidade) 
3598		.replace('{categoriaId}', idModalidadeEspecTecnica) 
3599		.replace('{nivelTema}', 0) 
3600		.replace('{categoriaParentId}', 0); 
3601		 
3602		//buscando os temas que os cursos da unidade tem com este tipo de curso 
3603		$.ajax({ 
3604			url : url, 
3605			type : 'get', 
3606			dataType: 'json' 
3607		}) 
3608		.done(function(temasLista) { 
3609				var temasObj = $('#temas'); 
3610								 
3611				$.each(temasLista,function(k, tema) { 
3612					const icon = (categorias.filter(cat => cat.categoryId == tema.categoryId)[0] || {properties: {}}).properties.icon 
3613					temasObj.append('<div class="ssp-section-tema__container-menu-item mega-menu"><a href="#a" class="tema" data-nvl="1" data-tema="'+ tema.categoryId+ '">'+ '<i class="' + icon + '"></i>'+ tema.name+ '</a></div>'); 
3614	 
3615 
3616					var url = urlSearchTemas 
3617					.replace('{groupId}', groupId) 
3618					.replace('{unidadeCategoryId}', categoryIdUnidade) 
3619					.replace('{categoriaId}', idModalidadeEspecTecnica) 
3620					.replace('{nivelTema}', 2) 
3621					.replace('{categoriaParentId}', tema.categoryId); 
3622					 
3623					// Armazena os subtemas deste tema 
3624					$.ajax({ 
3625						//url : '/o/senac-unidade-services/subtemasPorTipoCursoETemaEUnidade/'+ groupId+ '/'+ tema.categoryId+ '/'+ tipoCursoNome+'/'+categoryIdUnidade, 
3626						url: url, 
3627						type : 'get', 
3628					}) 
3629					.done(function(subtemas) { 
3630						subtemasStorage.set(tema.categoryId,JSON.parse(subtemas)); 
3631 
3632					}); 
3633					 
3634				}); // fim each 
3635 
3636				temas = temasLista; 
3637		 
3638				displayCursosPorTema(); 
3639 
3640				// Verificar o tamanho da tela e chama da função para desktop e mobile 
3641				var tam = $(window).width(); 
3642				 
3643				$('.todos').addClass('ativo'); 
3644 
3645				if (tam <=1024){ 
3646 
3647					exibeTemasMobile() 
3648 
3649
3650 
3651				// // Adiciona a classe do slider no elemento 
3652				// $('#temas').addClass("tema-slick-area tema-slick-area--md-bleed slider-container"); 
3653				// // e faz a chamada da função 
3654				// sliderTemaBtn(); 
3655 
3656				// verifica Device e tira o slider 
3657				 
3658				 
3659 
3660			}).fail(function(jqXHR, textStatus, msg) { 
3661				// alert(msg); 
3662			}); 
3663	 
3664	 
3665	 
3666	}); // fim done 1o ajax 
3667	 
3668	 
3669
3670 
3671/* 
3672 * Exibe a lista de subtemas no click do tema 
3673 */ 
3674function displaySubTemasLista(categoryId) { 
3675	 
3676	$('#filtro-temas-nivel-2').empty(); 
3677	$('#filtro-temas-nivel-2').removeClass('d-none'); 
3678	 
3679	$.each(subtemasStorage.get(activeCategory.categoryId), function(k, t) { 
3680		$('#filtro-temas-nivel-2').append('<a href="#a" class="subtema btn-nivel-3" data-tema="' 
3681				+ t.categoryId 
3682				+ '" data-nvl="2" style="font-size: 14px;">' 
3683				+ t.name 
3684				+ '</a>'); 
3685	}); 
3686	 
3687	 
3688	// $('#subtemas-lista').empty(); 
3689 
3690	// var subtemaLista = '<div class="subtema-content">'; 
3691 
3692	// $.each(subtemasStorage.get(categoryId), function(k, s) { 
3693 
3694	// 	// controle feito pela classe tema 
3695	// 	subtemaLista += '<a href="#a" class="subtema"  data-tema="' 
3696	// 			+ s.categoryId + '" data-nvl="2">' + s.name + '</a>'; 
3697 
3698	// }); 
3699 
3700	// subtemaLista += '</div>'; 
3701 
3702	// $('#subtemas-lista').append(subtemaLista); 
3703
3704  
3705 
3706 function setCategoryIds(){ 
3707		 
3708		//Obter o id da modalidade espec tecnica 
3709		var url = urlSearchModalidadeEspecTecnica 
3710			.replace('{groupId}', groupId); 
3711		 
3712		$.ajax({ 
3713			url : url, 
3714			type : 'get' 
3715		}).done(function(categoryIdModalidade) { 
3716			try{ 
3717				idModalidadeEspecTecnica = JSON.parse(categoryIdModalidade).categoryId; 
3718				 
3719				carregaLinkTodosBotoesModalidades(); 
3720				 
3721				carregaLinkBotoesLivreETecnico(); 
3722				 
3723				montaBreadCrumb(); 
3724 
3725				verificaAcessoDiretoELoadTema(); 
3726 
3727				//verificaUrlBolsa(); 
3728			}catch(err){ 
3729				console.error('idModalidadeEspecTecnica nao obtido ' + err.message); 
3730
3731			 
3732		}); 
3733		 
3734
3735 
3736//Carregar mais 
3737$(window).scroll(function() { 
3738	 
3739	var element = document.querySelector('#carregar-mais'); 
3740	 
3741	if(element != null){ 
3742		$("#filtroSemCurso").addClass("d-none"); 
3743		var position = element.getBoundingClientRect(); 
3744		 
3745		// carregar maios 
3746		if(position.top >= 0 && position.bottom <= window.innerHeight) { 
3747			 
3748			if (activeCategoryLevel == 0 || activeCategoryLevel == 1 || activeCategoryLevel == 2){ 
3749				offset = $('.cursos-por-categoria').not('.d-none').length; 
3750				 
3751				displayCursosPorTema(); 
3752				 
3753			}else{ 
3754				offsetTodosCursos = $('#cursos-por-subtema-container .ssp-card-curso') 
3755						.not('.d-none').length; 
3756				 
3757				displayCursosPorTema(); 
3758
3759
3760
3761	 
3762}); 
3763 
3764</script>